]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/msw/_core.py
helpers and typemaps for new GraphicsContext methods
[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
092f0ed7 105WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
d55e5bfc
RD
106ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
107RETAINED = _core_.RETAINED
108BACKINGSTORE = _core_.BACKINGSTORE
109COLOURED = _core_.COLOURED
110FIXED_LENGTH = _core_.FIXED_LENGTH
111LB_NEEDED_SB = _core_.LB_NEEDED_SB
112LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
113LB_SORT = _core_.LB_SORT
114LB_SINGLE = _core_.LB_SINGLE
115LB_MULTIPLE = _core_.LB_MULTIPLE
116LB_EXTENDED = _core_.LB_EXTENDED
117LB_OWNERDRAW = _core_.LB_OWNERDRAW
118LB_HSCROLL = _core_.LB_HSCROLL
119PROCESS_ENTER = _core_.PROCESS_ENTER
120PASSWORD = _core_.PASSWORD
121CB_SIMPLE = _core_.CB_SIMPLE
122CB_DROPDOWN = _core_.CB_DROPDOWN
123CB_SORT = _core_.CB_SORT
124CB_READONLY = _core_.CB_READONLY
125RA_HORIZONTAL = _core_.RA_HORIZONTAL
126RA_VERTICAL = _core_.RA_VERTICAL
127RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
128RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
fef4c27a 129RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
d55e5bfc
RD
130RB_GROUP = _core_.RB_GROUP
131RB_SINGLE = _core_.RB_SINGLE
d55e5bfc
RD
132SB_HORIZONTAL = _core_.SB_HORIZONTAL
133SB_VERTICAL = _core_.SB_VERTICAL
fef4c27a 134RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
d55e5bfc
RD
135ST_SIZEGRIP = _core_.ST_SIZEGRIP
136ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
e9d6f3a4
RD
137ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
138ST_DOTS_END = _core_.ST_DOTS_END
d55e5bfc
RD
139FLOOD_SURFACE = _core_.FLOOD_SURFACE
140FLOOD_BORDER = _core_.FLOOD_BORDER
141ODDEVEN_RULE = _core_.ODDEVEN_RULE
142WINDING_RULE = _core_.WINDING_RULE
143TOOL_TOP = _core_.TOOL_TOP
144TOOL_BOTTOM = _core_.TOOL_BOTTOM
145TOOL_LEFT = _core_.TOOL_LEFT
146TOOL_RIGHT = _core_.TOOL_RIGHT
147OK = _core_.OK
148YES_NO = _core_.YES_NO
149CANCEL = _core_.CANCEL
150YES = _core_.YES
151NO = _core_.NO
152NO_DEFAULT = _core_.NO_DEFAULT
153YES_DEFAULT = _core_.YES_DEFAULT
154ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
155ICON_HAND = _core_.ICON_HAND
156ICON_QUESTION = _core_.ICON_QUESTION
157ICON_INFORMATION = _core_.ICON_INFORMATION
158ICON_STOP = _core_.ICON_STOP
159ICON_ASTERISK = _core_.ICON_ASTERISK
160ICON_MASK = _core_.ICON_MASK
161ICON_WARNING = _core_.ICON_WARNING
162ICON_ERROR = _core_.ICON_ERROR
163FORWARD = _core_.FORWARD
164BACKWARD = _core_.BACKWARD
165RESET = _core_.RESET
166HELP = _core_.HELP
167MORE = _core_.MORE
168SETUP = _core_.SETUP
169SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
170SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
171SIZE_AUTO = _core_.SIZE_AUTO
172SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
173SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
9d7dfdff 174SIZE_FORCE = _core_.SIZE_FORCE
d55e5bfc
RD
175PORTRAIT = _core_.PORTRAIT
176LANDSCAPE = _core_.LANDSCAPE
177PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
178PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
179PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
180PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
181ID_ANY = _core_.ID_ANY
182ID_SEPARATOR = _core_.ID_SEPARATOR
9d7dfdff 183ID_NONE = _core_.ID_NONE
d55e5bfc
RD
184ID_LOWEST = _core_.ID_LOWEST
185ID_OPEN = _core_.ID_OPEN
186ID_CLOSE = _core_.ID_CLOSE
187ID_NEW = _core_.ID_NEW
188ID_SAVE = _core_.ID_SAVE
189ID_SAVEAS = _core_.ID_SAVEAS
190ID_REVERT = _core_.ID_REVERT
191ID_EXIT = _core_.ID_EXIT
192ID_UNDO = _core_.ID_UNDO
193ID_REDO = _core_.ID_REDO
194ID_HELP = _core_.ID_HELP
195ID_PRINT = _core_.ID_PRINT
196ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
fc46b7f3 197ID_PAGE_SETUP = _core_.ID_PAGE_SETUP
d55e5bfc
RD
198ID_PREVIEW = _core_.ID_PREVIEW
199ID_ABOUT = _core_.ID_ABOUT
200ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
201ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
202ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
203ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
1eeb270e
RD
204ID_HELP_INDEX = _core_.ID_HELP_INDEX
205ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
d55e5bfc
RD
206ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
207ID_PREFERENCES = _core_.ID_PREFERENCES
97ab0f6a 208ID_EDIT = _core_.ID_EDIT
d55e5bfc
RD
209ID_CUT = _core_.ID_CUT
210ID_COPY = _core_.ID_COPY
211ID_PASTE = _core_.ID_PASTE
212ID_CLEAR = _core_.ID_CLEAR
213ID_FIND = _core_.ID_FIND
214ID_DUPLICATE = _core_.ID_DUPLICATE
215ID_SELECTALL = _core_.ID_SELECTALL
216ID_DELETE = _core_.ID_DELETE
217ID_REPLACE = _core_.ID_REPLACE
218ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
219ID_PROPERTIES = _core_.ID_PROPERTIES
220ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
221ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
222ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
223ID_VIEW_LIST = _core_.ID_VIEW_LIST
224ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
225ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
226ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
227ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
97ab0f6a 228ID_FILE = _core_.ID_FILE
d55e5bfc
RD
229ID_FILE1 = _core_.ID_FILE1
230ID_FILE2 = _core_.ID_FILE2
231ID_FILE3 = _core_.ID_FILE3
232ID_FILE4 = _core_.ID_FILE4
233ID_FILE5 = _core_.ID_FILE5
234ID_FILE6 = _core_.ID_FILE6
235ID_FILE7 = _core_.ID_FILE7
236ID_FILE8 = _core_.ID_FILE8
237ID_FILE9 = _core_.ID_FILE9
238ID_OK = _core_.ID_OK
239ID_CANCEL = _core_.ID_CANCEL
240ID_APPLY = _core_.ID_APPLY
241ID_YES = _core_.ID_YES
242ID_NO = _core_.ID_NO
243ID_STATIC = _core_.ID_STATIC
244ID_FORWARD = _core_.ID_FORWARD
245ID_BACKWARD = _core_.ID_BACKWARD
246ID_DEFAULT = _core_.ID_DEFAULT
247ID_MORE = _core_.ID_MORE
248ID_SETUP = _core_.ID_SETUP
249ID_RESET = _core_.ID_RESET
250ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
251ID_YESTOALL = _core_.ID_YESTOALL
252ID_NOTOALL = _core_.ID_NOTOALL
253ID_ABORT = _core_.ID_ABORT
254ID_RETRY = _core_.ID_RETRY
255ID_IGNORE = _core_.ID_IGNORE
0f63ec68
RD
256ID_ADD = _core_.ID_ADD
257ID_REMOVE = _core_.ID_REMOVE
258ID_UP = _core_.ID_UP
259ID_DOWN = _core_.ID_DOWN
260ID_HOME = _core_.ID_HOME
261ID_REFRESH = _core_.ID_REFRESH
262ID_STOP = _core_.ID_STOP
263ID_INDEX = _core_.ID_INDEX
264ID_BOLD = _core_.ID_BOLD
265ID_ITALIC = _core_.ID_ITALIC
266ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
267ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
268ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
269ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
270ID_UNDERLINE = _core_.ID_UNDERLINE
271ID_INDENT = _core_.ID_INDENT
272ID_UNINDENT = _core_.ID_UNINDENT
273ID_ZOOM_100 = _core_.ID_ZOOM_100
274ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
275ID_ZOOM_IN = _core_.ID_ZOOM_IN
276ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
277ID_UNDELETE = _core_.ID_UNDELETE
278ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
d55e5bfc 279ID_HIGHEST = _core_.ID_HIGHEST
d55e5bfc
RD
280MENU_TEAROFF = _core_.MENU_TEAROFF
281MB_DOCKABLE = _core_.MB_DOCKABLE
282NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
283FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
284LI_HORIZONTAL = _core_.LI_HORIZONTAL
285LI_VERTICAL = _core_.LI_VERTICAL
286WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
287WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
288WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
289WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
290WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
291WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
292MM_TEXT = _core_.MM_TEXT
293MM_LOMETRIC = _core_.MM_LOMETRIC
294MM_HIMETRIC = _core_.MM_HIMETRIC
295MM_LOENGLISH = _core_.MM_LOENGLISH
296MM_HIENGLISH = _core_.MM_HIENGLISH
297MM_TWIPS = _core_.MM_TWIPS
298MM_ISOTROPIC = _core_.MM_ISOTROPIC
299MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
300MM_POINTS = _core_.MM_POINTS
301MM_METRIC = _core_.MM_METRIC
302CENTRE = _core_.CENTRE
303CENTER = _core_.CENTER
304HORIZONTAL = _core_.HORIZONTAL
305VERTICAL = _core_.VERTICAL
306BOTH = _core_.BOTH
307LEFT = _core_.LEFT
308RIGHT = _core_.RIGHT
309UP = _core_.UP
310DOWN = _core_.DOWN
311TOP = _core_.TOP
312BOTTOM = _core_.BOTTOM
313NORTH = _core_.NORTH
314SOUTH = _core_.SOUTH
315WEST = _core_.WEST
316EAST = _core_.EAST
317ALL = _core_.ALL
318ALIGN_NOT = _core_.ALIGN_NOT
319ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
320ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
321ALIGN_LEFT = _core_.ALIGN_LEFT
322ALIGN_TOP = _core_.ALIGN_TOP
323ALIGN_RIGHT = _core_.ALIGN_RIGHT
324ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
325ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
326ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
327ALIGN_CENTER = _core_.ALIGN_CENTER
328ALIGN_CENTRE = _core_.ALIGN_CENTRE
329ALIGN_MASK = _core_.ALIGN_MASK
330STRETCH_NOT = _core_.STRETCH_NOT
331SHRINK = _core_.SHRINK
332GROW = _core_.GROW
333EXPAND = _core_.EXPAND
334SHAPED = _core_.SHAPED
335FIXED_MINSIZE = _core_.FIXED_MINSIZE
336TILE = _core_.TILE
337ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
338BORDER_DEFAULT = _core_.BORDER_DEFAULT
339BORDER_NONE = _core_.BORDER_NONE
340BORDER_STATIC = _core_.BORDER_STATIC
341BORDER_SIMPLE = _core_.BORDER_SIMPLE
342BORDER_RAISED = _core_.BORDER_RAISED
343BORDER_SUNKEN = _core_.BORDER_SUNKEN
344BORDER_DOUBLE = _core_.BORDER_DOUBLE
345BORDER_MASK = _core_.BORDER_MASK
0f63ec68
RD
346BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
347BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
348BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
d55e5bfc
RD
349DEFAULT = _core_.DEFAULT
350DECORATIVE = _core_.DECORATIVE
351ROMAN = _core_.ROMAN
352SCRIPT = _core_.SCRIPT
353SWISS = _core_.SWISS
354MODERN = _core_.MODERN
355TELETYPE = _core_.TELETYPE
356VARIABLE = _core_.VARIABLE
357FIXED = _core_.FIXED
358NORMAL = _core_.NORMAL
359LIGHT = _core_.LIGHT
360BOLD = _core_.BOLD
361ITALIC = _core_.ITALIC
362SLANT = _core_.SLANT
363SOLID = _core_.SOLID
364DOT = _core_.DOT
365LONG_DASH = _core_.LONG_DASH
366SHORT_DASH = _core_.SHORT_DASH
367DOT_DASH = _core_.DOT_DASH
368USER_DASH = _core_.USER_DASH
369TRANSPARENT = _core_.TRANSPARENT
370STIPPLE = _core_.STIPPLE
d04418a7
RD
371STIPPLE_MASK = _core_.STIPPLE_MASK
372STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
d55e5bfc
RD
373BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
374CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
375FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
376CROSS_HATCH = _core_.CROSS_HATCH
377HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
378VERTICAL_HATCH = _core_.VERTICAL_HATCH
379JOIN_BEVEL = _core_.JOIN_BEVEL
380JOIN_MITER = _core_.JOIN_MITER
381JOIN_ROUND = _core_.JOIN_ROUND
382CAP_ROUND = _core_.CAP_ROUND
383CAP_PROJECTING = _core_.CAP_PROJECTING
384CAP_BUTT = _core_.CAP_BUTT
385CLEAR = _core_.CLEAR
386XOR = _core_.XOR
387INVERT = _core_.INVERT
388OR_REVERSE = _core_.OR_REVERSE
389AND_REVERSE = _core_.AND_REVERSE
390COPY = _core_.COPY
391AND = _core_.AND
392AND_INVERT = _core_.AND_INVERT
393NO_OP = _core_.NO_OP
394NOR = _core_.NOR
395EQUIV = _core_.EQUIV
396SRC_INVERT = _core_.SRC_INVERT
397OR_INVERT = _core_.OR_INVERT
398NAND = _core_.NAND
399OR = _core_.OR
400SET = _core_.SET
401WXK_BACK = _core_.WXK_BACK
402WXK_TAB = _core_.WXK_TAB
403WXK_RETURN = _core_.WXK_RETURN
404WXK_ESCAPE = _core_.WXK_ESCAPE
405WXK_SPACE = _core_.WXK_SPACE
406WXK_DELETE = _core_.WXK_DELETE
407WXK_START = _core_.WXK_START
408WXK_LBUTTON = _core_.WXK_LBUTTON
409WXK_RBUTTON = _core_.WXK_RBUTTON
410WXK_CANCEL = _core_.WXK_CANCEL
411WXK_MBUTTON = _core_.WXK_MBUTTON
412WXK_CLEAR = _core_.WXK_CLEAR
413WXK_SHIFT = _core_.WXK_SHIFT
414WXK_ALT = _core_.WXK_ALT
415WXK_CONTROL = _core_.WXK_CONTROL
416WXK_MENU = _core_.WXK_MENU
417WXK_PAUSE = _core_.WXK_PAUSE
418WXK_CAPITAL = _core_.WXK_CAPITAL
419WXK_PRIOR = _core_.WXK_PRIOR
420WXK_NEXT = _core_.WXK_NEXT
421WXK_END = _core_.WXK_END
422WXK_HOME = _core_.WXK_HOME
423WXK_LEFT = _core_.WXK_LEFT
424WXK_UP = _core_.WXK_UP
425WXK_RIGHT = _core_.WXK_RIGHT
426WXK_DOWN = _core_.WXK_DOWN
427WXK_SELECT = _core_.WXK_SELECT
428WXK_PRINT = _core_.WXK_PRINT
429WXK_EXECUTE = _core_.WXK_EXECUTE
430WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
431WXK_INSERT = _core_.WXK_INSERT
432WXK_HELP = _core_.WXK_HELP
433WXK_NUMPAD0 = _core_.WXK_NUMPAD0
434WXK_NUMPAD1 = _core_.WXK_NUMPAD1
435WXK_NUMPAD2 = _core_.WXK_NUMPAD2
436WXK_NUMPAD3 = _core_.WXK_NUMPAD3
437WXK_NUMPAD4 = _core_.WXK_NUMPAD4
438WXK_NUMPAD5 = _core_.WXK_NUMPAD5
439WXK_NUMPAD6 = _core_.WXK_NUMPAD6
440WXK_NUMPAD7 = _core_.WXK_NUMPAD7
441WXK_NUMPAD8 = _core_.WXK_NUMPAD8
442WXK_NUMPAD9 = _core_.WXK_NUMPAD9
443WXK_MULTIPLY = _core_.WXK_MULTIPLY
444WXK_ADD = _core_.WXK_ADD
445WXK_SEPARATOR = _core_.WXK_SEPARATOR
446WXK_SUBTRACT = _core_.WXK_SUBTRACT
447WXK_DECIMAL = _core_.WXK_DECIMAL
448WXK_DIVIDE = _core_.WXK_DIVIDE
449WXK_F1 = _core_.WXK_F1
450WXK_F2 = _core_.WXK_F2
451WXK_F3 = _core_.WXK_F3
452WXK_F4 = _core_.WXK_F4
453WXK_F5 = _core_.WXK_F5
454WXK_F6 = _core_.WXK_F6
455WXK_F7 = _core_.WXK_F7
456WXK_F8 = _core_.WXK_F8
457WXK_F9 = _core_.WXK_F9
458WXK_F10 = _core_.WXK_F10
459WXK_F11 = _core_.WXK_F11
460WXK_F12 = _core_.WXK_F12
461WXK_F13 = _core_.WXK_F13
462WXK_F14 = _core_.WXK_F14
463WXK_F15 = _core_.WXK_F15
464WXK_F16 = _core_.WXK_F16
465WXK_F17 = _core_.WXK_F17
466WXK_F18 = _core_.WXK_F18
467WXK_F19 = _core_.WXK_F19
468WXK_F20 = _core_.WXK_F20
469WXK_F21 = _core_.WXK_F21
470WXK_F22 = _core_.WXK_F22
471WXK_F23 = _core_.WXK_F23
472WXK_F24 = _core_.WXK_F24
473WXK_NUMLOCK = _core_.WXK_NUMLOCK
474WXK_SCROLL = _core_.WXK_SCROLL
475WXK_PAGEUP = _core_.WXK_PAGEUP
476WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
477WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
478WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
479WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
480WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
481WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
482WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
483WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
484WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
485WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
486WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
487WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
488WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
489WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
490WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
491WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
492WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
493WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
494WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
495WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
496WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
497WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
498WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
499WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
500WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
501WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
502WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
503WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
504WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
505WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
506WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
88c6b281
RD
507WXK_COMMAND = _core_.WXK_COMMAND
508WXK_SPECIAL1 = _core_.WXK_SPECIAL1
509WXK_SPECIAL2 = _core_.WXK_SPECIAL2
510WXK_SPECIAL3 = _core_.WXK_SPECIAL3
511WXK_SPECIAL4 = _core_.WXK_SPECIAL4
512WXK_SPECIAL5 = _core_.WXK_SPECIAL5
513WXK_SPECIAL6 = _core_.WXK_SPECIAL6
514WXK_SPECIAL7 = _core_.WXK_SPECIAL7
515WXK_SPECIAL8 = _core_.WXK_SPECIAL8
516WXK_SPECIAL9 = _core_.WXK_SPECIAL9
517WXK_SPECIAL10 = _core_.WXK_SPECIAL10
518WXK_SPECIAL11 = _core_.WXK_SPECIAL11
519WXK_SPECIAL12 = _core_.WXK_SPECIAL12
520WXK_SPECIAL13 = _core_.WXK_SPECIAL13
521WXK_SPECIAL14 = _core_.WXK_SPECIAL14
522WXK_SPECIAL15 = _core_.WXK_SPECIAL15
523WXK_SPECIAL16 = _core_.WXK_SPECIAL16
524WXK_SPECIAL17 = _core_.WXK_SPECIAL17
525WXK_SPECIAL18 = _core_.WXK_SPECIAL18
526WXK_SPECIAL19 = _core_.WXK_SPECIAL19
527WXK_SPECIAL20 = _core_.WXK_SPECIAL20
d55e5bfc
RD
528PAPER_NONE = _core_.PAPER_NONE
529PAPER_LETTER = _core_.PAPER_LETTER
530PAPER_LEGAL = _core_.PAPER_LEGAL
531PAPER_A4 = _core_.PAPER_A4
532PAPER_CSHEET = _core_.PAPER_CSHEET
533PAPER_DSHEET = _core_.PAPER_DSHEET
534PAPER_ESHEET = _core_.PAPER_ESHEET
535PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
536PAPER_TABLOID = _core_.PAPER_TABLOID
537PAPER_LEDGER = _core_.PAPER_LEDGER
538PAPER_STATEMENT = _core_.PAPER_STATEMENT
539PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
540PAPER_A3 = _core_.PAPER_A3
541PAPER_A4SMALL = _core_.PAPER_A4SMALL
542PAPER_A5 = _core_.PAPER_A5
543PAPER_B4 = _core_.PAPER_B4
544PAPER_B5 = _core_.PAPER_B5
545PAPER_FOLIO = _core_.PAPER_FOLIO
546PAPER_QUARTO = _core_.PAPER_QUARTO
547PAPER_10X14 = _core_.PAPER_10X14
548PAPER_11X17 = _core_.PAPER_11X17
549PAPER_NOTE = _core_.PAPER_NOTE
550PAPER_ENV_9 = _core_.PAPER_ENV_9
551PAPER_ENV_10 = _core_.PAPER_ENV_10
552PAPER_ENV_11 = _core_.PAPER_ENV_11
553PAPER_ENV_12 = _core_.PAPER_ENV_12
554PAPER_ENV_14 = _core_.PAPER_ENV_14
555PAPER_ENV_DL = _core_.PAPER_ENV_DL
556PAPER_ENV_C5 = _core_.PAPER_ENV_C5
557PAPER_ENV_C3 = _core_.PAPER_ENV_C3
558PAPER_ENV_C4 = _core_.PAPER_ENV_C4
559PAPER_ENV_C6 = _core_.PAPER_ENV_C6
560PAPER_ENV_C65 = _core_.PAPER_ENV_C65
561PAPER_ENV_B4 = _core_.PAPER_ENV_B4
562PAPER_ENV_B5 = _core_.PAPER_ENV_B5
563PAPER_ENV_B6 = _core_.PAPER_ENV_B6
564PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
565PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
566PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
567PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
568PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
569PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
570PAPER_ISO_B4 = _core_.PAPER_ISO_B4
571PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
572PAPER_9X11 = _core_.PAPER_9X11
573PAPER_10X11 = _core_.PAPER_10X11
574PAPER_15X11 = _core_.PAPER_15X11
575PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
576PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
577PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
578PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
579PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
580PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
581PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
582PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
583PAPER_A_PLUS = _core_.PAPER_A_PLUS
584PAPER_B_PLUS = _core_.PAPER_B_PLUS
585PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
586PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
587PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
588PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
589PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
590PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
591PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
592PAPER_A2 = _core_.PAPER_A2
593PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
594PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
034e3677
RD
595PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
596PAPER_A6 = _core_.PAPER_A6
597PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
598PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
599PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
600PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
601PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
602PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
603PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
604PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
605PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
606PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
607PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
608PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
609PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
610PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
611PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
612PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
613PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
614PAPER_B6_JIS = _core_.PAPER_B6_JIS
615PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
616PAPER_12X11 = _core_.PAPER_12X11
617PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
618PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
619PAPER_P16K = _core_.PAPER_P16K
620PAPER_P32K = _core_.PAPER_P32K
621PAPER_P32KBIG = _core_.PAPER_P32KBIG
622PAPER_PENV_1 = _core_.PAPER_PENV_1
623PAPER_PENV_2 = _core_.PAPER_PENV_2
624PAPER_PENV_3 = _core_.PAPER_PENV_3
625PAPER_PENV_4 = _core_.PAPER_PENV_4
626PAPER_PENV_5 = _core_.PAPER_PENV_5
627PAPER_PENV_6 = _core_.PAPER_PENV_6
628PAPER_PENV_7 = _core_.PAPER_PENV_7
629PAPER_PENV_8 = _core_.PAPER_PENV_8
630PAPER_PENV_9 = _core_.PAPER_PENV_9
631PAPER_PENV_10 = _core_.PAPER_PENV_10
632PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
633PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
634PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
635PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
636PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
637PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
638PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
639PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
640PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
641PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
642PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
643PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
644PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
d55e5bfc
RD
645DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
646DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
647DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
648ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
649ITEM_NORMAL = _core_.ITEM_NORMAL
650ITEM_CHECK = _core_.ITEM_CHECK
651ITEM_RADIO = _core_.ITEM_RADIO
652ITEM_MAX = _core_.ITEM_MAX
653HT_NOWHERE = _core_.HT_NOWHERE
654HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
655HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
656HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
657HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
658HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
659HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
660HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
661HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
662HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
663HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
664HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
665HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
666HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
667HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
668HT_MAX = _core_.HT_MAX
669MOD_NONE = _core_.MOD_NONE
670MOD_ALT = _core_.MOD_ALT
671MOD_CONTROL = _core_.MOD_CONTROL
9d7dfdff 672MOD_ALTGR = _core_.MOD_ALTGR
d55e5bfc 673MOD_SHIFT = _core_.MOD_SHIFT
9d7dfdff 674MOD_META = _core_.MOD_META
d55e5bfc 675MOD_WIN = _core_.MOD_WIN
9d7dfdff
RD
676MOD_CMD = _core_.MOD_CMD
677MOD_ALL = _core_.MOD_ALL
d55e5bfc
RD
678UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
679UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
680UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
994453b8
RD
681Layout_Default = _core_.Layout_Default
682Layout_LeftToRight = _core_.Layout_LeftToRight
683Layout_RightToLeft = _core_.Layout_RightToLeft
d55e5bfc
RD
684#---------------------------------------------------------------------------
685
686class Object(object):
687 """
688 The base class for most wx objects, although in wxPython not
689 much functionality is needed nor exposed.
690 """
554f62e9
RD
691 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
692 def __init__(self): raise AttributeError, "No constructor defined"
693 __repr__ = _swig_repr
d55e5bfc
RD
694 def GetClassName(*args, **kwargs):
695 """
696 GetClassName(self) -> String
697
698 Returns the class name of the C++ class using wxRTTI.
699 """
700 return _core_.Object_GetClassName(*args, **kwargs)
701
702 def Destroy(*args, **kwargs):
703 """
704 Destroy(self)
705
706 Deletes the C++ object this Python object is a proxy for.
707 """
7e08d4ef
RD
708 val = _core_.Object_Destroy(*args, **kwargs)
709 args[0].thisown = 0
710 return val
d55e5bfc 711
33d6fd3b 712 ClassName = property(GetClassName,doc="See `GetClassName`")
2131d850 713_core_.Object_swigregister(Object)
d55e5bfc 714_wxPySetDictionary = _core_._wxPySetDictionary
d55e5bfc
RD
715cvar = _core_.cvar
716EmptyString = cvar.EmptyString
717
718#---------------------------------------------------------------------------
719
720BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
721BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
722BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
723BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
724BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
725BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
726BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
727BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
728BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
729BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
730BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
731BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
732BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
733BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
734BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
735BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
736BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
737BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
738BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
739BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
740CURSOR_NONE = _core_.CURSOR_NONE
741CURSOR_ARROW = _core_.CURSOR_ARROW
742CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
743CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
744CURSOR_CHAR = _core_.CURSOR_CHAR
745CURSOR_CROSS = _core_.CURSOR_CROSS
746CURSOR_HAND = _core_.CURSOR_HAND
747CURSOR_IBEAM = _core_.CURSOR_IBEAM
748CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
749CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
750CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
751CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
752CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
753CURSOR_PENCIL = _core_.CURSOR_PENCIL
754CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
755CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
756CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
757CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
758CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
759CURSOR_SIZENS = _core_.CURSOR_SIZENS
760CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
761CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
762CURSOR_SIZING = _core_.CURSOR_SIZING
763CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
764CURSOR_WAIT = _core_.CURSOR_WAIT
765CURSOR_WATCH = _core_.CURSOR_WATCH
766CURSOR_BLANK = _core_.CURSOR_BLANK
767CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
768CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
769CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
770CURSOR_MAX = _core_.CURSOR_MAX
771#---------------------------------------------------------------------------
772
773class Size(object):
774 """
79fccf9d 775 wx.Size is a useful data structure used to represent the size of
554f62e9
RD
776 something. It simply contains integer width and height
777 properties. In most places in wxPython where a wx.Size is
093d3ff1 778 expected a (width, height) tuple can be used instead.
d55e5bfc 779 """
554f62e9
RD
780 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
781 __repr__ = _swig_repr
d55e5bfc
RD
782 width = property(_core_.Size_width_get, _core_.Size_width_set)
783 height = property(_core_.Size_height_get, _core_.Size_height_set)
784 x = width; y = height
554f62e9 785 def __init__(self, *args, **kwargs):
d55e5bfc
RD
786 """
787 __init__(self, int w=0, int h=0) -> Size
788
789 Creates a size object.
790 """
554f62e9
RD
791 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
792 __swig_destroy__ = _core_.delete_Size
793 __del__ = lambda self : None;
d55e5bfc
RD
794 def __eq__(*args, **kwargs):
795 """
e9d6f3a4 796 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
797
798 Test for equality of wx.Size objects.
799 """
800 return _core_.Size___eq__(*args, **kwargs)
801
802 def __ne__(*args, **kwargs):
803 """
e9d6f3a4 804 __ne__(self, PyObject other) -> bool
d55e5bfc 805
e9d6f3a4 806 Test for inequality of wx.Size objects.
d55e5bfc
RD
807 """
808 return _core_.Size___ne__(*args, **kwargs)
809
810 def __add__(*args, **kwargs):
811 """
812 __add__(self, Size sz) -> Size
813
814 Add sz's proprties to this and return the result.
815 """
816 return _core_.Size___add__(*args, **kwargs)
817
818 def __sub__(*args, **kwargs):
819 """
820 __sub__(self, Size sz) -> Size
821
822 Subtract sz's properties from this and return the result.
823 """
824 return _core_.Size___sub__(*args, **kwargs)
825
826 def IncTo(*args, **kwargs):
827 """
828 IncTo(self, Size sz)
829
830 Increments this object so that both of its dimensions are not less
831 than the corresponding dimensions of the size.
832 """
833 return _core_.Size_IncTo(*args, **kwargs)
834
835 def DecTo(*args, **kwargs):
836 """
837 DecTo(self, Size sz)
838
839 Decrements this object so that both of its dimensions are not greater
840 than the corresponding dimensions of the size.
841 """
842 return _core_.Size_DecTo(*args, **kwargs)
843
f5263701
RD
844 def IncBy(*args, **kwargs):
845 """IncBy(self, int dx, int dy)"""
846 return _core_.Size_IncBy(*args, **kwargs)
847
848 def DecBy(*args, **kwargs):
849 """DecBy(self, int dx, int dy)"""
850 return _core_.Size_DecBy(*args, **kwargs)
851
1eeb270e
RD
852 def Scale(*args, **kwargs):
853 """
854 Scale(self, float xscale, float yscale)
855
856 Scales the dimensions of this object by the given factors.
857 """
858 return _core_.Size_Scale(*args, **kwargs)
859
d55e5bfc
RD
860 def Set(*args, **kwargs):
861 """
862 Set(self, int w, int h)
863
864 Set both width and height.
865 """
866 return _core_.Size_Set(*args, **kwargs)
867
868 def SetWidth(*args, **kwargs):
869 """SetWidth(self, int w)"""
870 return _core_.Size_SetWidth(*args, **kwargs)
871
872 def SetHeight(*args, **kwargs):
873 """SetHeight(self, int h)"""
874 return _core_.Size_SetHeight(*args, **kwargs)
875
876 def GetWidth(*args, **kwargs):
877 """GetWidth(self) -> int"""
878 return _core_.Size_GetWidth(*args, **kwargs)
879
880 def GetHeight(*args, **kwargs):
881 """GetHeight(self) -> int"""
882 return _core_.Size_GetHeight(*args, **kwargs)
883
884 def IsFullySpecified(*args, **kwargs):
885 """
886 IsFullySpecified(self) -> bool
887
888 Returns True if both components of the size are non-default values.
889 """
890 return _core_.Size_IsFullySpecified(*args, **kwargs)
891
892 def SetDefaults(*args, **kwargs):
893 """
894 SetDefaults(self, Size size)
895
79fccf9d
RD
896 Combine this size with the other one replacing the default components
897 of this object (i.e. equal to -1) with those of the other.
d55e5bfc
RD
898 """
899 return _core_.Size_SetDefaults(*args, **kwargs)
900
901 def Get(*args, **kwargs):
902 """
903 Get() -> (width,height)
904
905 Returns the width and height properties as a tuple.
906 """
907 return _core_.Size_Get(*args, **kwargs)
908
79fccf9d 909 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
910 def __str__(self): return str(self.Get())
911 def __repr__(self): return 'wx.Size'+str(self.Get())
912 def __len__(self): return len(self.Get())
913 def __getitem__(self, index): return self.Get()[index]
914 def __setitem__(self, index, val):
915 if index == 0: self.width = val
916 elif index == 1: self.height = val
917 else: raise IndexError
918 def __nonzero__(self): return self.Get() != (0,0)
919 __safe_for_unpickling__ = True
920 def __reduce__(self): return (wx.Size, self.Get())
921
2131d850 922_core_.Size_swigregister(Size)
d55e5bfc
RD
923
924#---------------------------------------------------------------------------
925
926class RealPoint(object):
927 """
79fccf9d
RD
928 A data structure for representing a point or position with floating
929 point x and y properties. In wxPython most places that expect a
930 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc 931 """
554f62e9
RD
932 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
933 __repr__ = _swig_repr
d55e5bfc
RD
934 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
935 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
554f62e9 936 def __init__(self, *args, **kwargs):
d55e5bfc
RD
937 """
938 __init__(self, double x=0.0, double y=0.0) -> RealPoint
939
940 Create a wx.RealPoint object
941 """
554f62e9
RD
942 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
943 __swig_destroy__ = _core_.delete_RealPoint
944 __del__ = lambda self : None;
d55e5bfc
RD
945 def __eq__(*args, **kwargs):
946 """
e9d6f3a4 947 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
948
949 Test for equality of wx.RealPoint objects.
950 """
951 return _core_.RealPoint___eq__(*args, **kwargs)
952
953 def __ne__(*args, **kwargs):
954 """
e9d6f3a4 955 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
956
957 Test for inequality of wx.RealPoint objects.
958 """
959 return _core_.RealPoint___ne__(*args, **kwargs)
960
961 def __add__(*args, **kwargs):
962 """
963 __add__(self, RealPoint pt) -> RealPoint
964
965 Add pt's proprties to this and return the result.
966 """
967 return _core_.RealPoint___add__(*args, **kwargs)
968
969 def __sub__(*args, **kwargs):
970 """
971 __sub__(self, RealPoint pt) -> RealPoint
972
973 Subtract pt's proprties from this and return the result
974 """
975 return _core_.RealPoint___sub__(*args, **kwargs)
976
977 def Set(*args, **kwargs):
978 """
979 Set(self, double x, double y)
980
981 Set both the x and y properties
982 """
983 return _core_.RealPoint_Set(*args, **kwargs)
984
985 def Get(*args, **kwargs):
986 """
987 Get() -> (x,y)
988
989 Return the x and y properties as a tuple.
990 """
991 return _core_.RealPoint_Get(*args, **kwargs)
992
79fccf9d 993 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
994 def __str__(self): return str(self.Get())
995 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
996 def __len__(self): return len(self.Get())
997 def __getitem__(self, index): return self.Get()[index]
998 def __setitem__(self, index, val):
999 if index == 0: self.x = val
1000 elif index == 1: self.y = val
1001 else: raise IndexError
1002 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1003 __safe_for_unpickling__ = True
1004 def __reduce__(self): return (wx.RealPoint, self.Get())
1005
2131d850 1006_core_.RealPoint_swigregister(RealPoint)
d55e5bfc
RD
1007
1008#---------------------------------------------------------------------------
1009
1010class Point(object):
1011 """
79fccf9d
RD
1012 A data structure for representing a point or position with integer x
1013 and y properties. Most places in wxPython that expect a wx.Point can
1014 also accept a (x,y) tuple.
d55e5bfc 1015 """
554f62e9
RD
1016 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1017 __repr__ = _swig_repr
d55e5bfc
RD
1018 x = property(_core_.Point_x_get, _core_.Point_x_set)
1019 y = property(_core_.Point_y_get, _core_.Point_y_set)
554f62e9 1020 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1021 """
1022 __init__(self, int x=0, int y=0) -> Point
1023
1024 Create a wx.Point object
1025 """
554f62e9
RD
1026 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1027 __swig_destroy__ = _core_.delete_Point
1028 __del__ = lambda self : None;
d55e5bfc
RD
1029 def __eq__(*args, **kwargs):
1030 """
e9d6f3a4 1031 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
1032
1033 Test for equality of wx.Point objects.
1034 """
1035 return _core_.Point___eq__(*args, **kwargs)
1036
1037 def __ne__(*args, **kwargs):
1038 """
e9d6f3a4 1039 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
1040
1041 Test for inequality of wx.Point objects.
1042 """
1043 return _core_.Point___ne__(*args, **kwargs)
1044
1045 def __add__(*args, **kwargs):
1046 """
1047 __add__(self, Point pt) -> Point
1048
1049 Add pt's proprties to this and return the result.
1050 """
1051 return _core_.Point___add__(*args, **kwargs)
1052
1053 def __sub__(*args, **kwargs):
1054 """
1055 __sub__(self, Point pt) -> Point
1056
1057 Subtract pt's proprties from this and return the result
1058 """
1059 return _core_.Point___sub__(*args, **kwargs)
1060
1061 def __iadd__(*args, **kwargs):
1062 """
1063 __iadd__(self, Point pt) -> Point
1064
1065 Add pt to this object.
1066 """
1067 return _core_.Point___iadd__(*args, **kwargs)
1068
1069 def __isub__(*args, **kwargs):
1070 """
1071 __isub__(self, Point pt) -> Point
1072
1073 Subtract pt from this object.
1074 """
1075 return _core_.Point___isub__(*args, **kwargs)
1076
1077 def Set(*args, **kwargs):
1078 """
1079 Set(self, long x, long y)
1080
1081 Set both the x and y properties
1082 """
1083 return _core_.Point_Set(*args, **kwargs)
1084
1085 def Get(*args, **kwargs):
1086 """
1087 Get() -> (x,y)
1088
1089 Return the x and y properties as a tuple.
1090 """
1091 return _core_.Point_Get(*args, **kwargs)
1092
79fccf9d 1093 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1094 def __str__(self): return str(self.Get())
1095 def __repr__(self): return 'wx.Point'+str(self.Get())
1096 def __len__(self): return len(self.Get())
1097 def __getitem__(self, index): return self.Get()[index]
1098 def __setitem__(self, index, val):
1099 if index == 0: self.x = val
1100 elif index == 1: self.y = val
1101 else: raise IndexError
1102 def __nonzero__(self): return self.Get() != (0,0)
1103 __safe_for_unpickling__ = True
1104 def __reduce__(self): return (wx.Point, self.Get())
1105
2131d850 1106_core_.Point_swigregister(Point)
d55e5bfc
RD
1107
1108#---------------------------------------------------------------------------
1109
1110class Rect(object):
1111 """
79fccf9d
RD
1112 A class for representing and manipulating rectangles. It has x, y,
1113 width and height properties. In wxPython most palces that expect a
1114 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc 1115 """
554f62e9
RD
1116 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1117 __repr__ = _swig_repr
1118 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1119 """
1120 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1121
1122 Create a new Rect object.
1123 """
554f62e9
RD
1124 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1125 __swig_destroy__ = _core_.delete_Rect
1126 __del__ = lambda self : None;
d55e5bfc
RD
1127 def GetX(*args, **kwargs):
1128 """GetX(self) -> int"""
1129 return _core_.Rect_GetX(*args, **kwargs)
1130
1131 def SetX(*args, **kwargs):
1132 """SetX(self, int x)"""
1133 return _core_.Rect_SetX(*args, **kwargs)
1134
1135 def GetY(*args, **kwargs):
1136 """GetY(self) -> int"""
1137 return _core_.Rect_GetY(*args, **kwargs)
1138
1139 def SetY(*args, **kwargs):
1140 """SetY(self, int y)"""
1141 return _core_.Rect_SetY(*args, **kwargs)
1142
1143 def GetWidth(*args, **kwargs):
1144 """GetWidth(self) -> int"""
1145 return _core_.Rect_GetWidth(*args, **kwargs)
1146
1147 def SetWidth(*args, **kwargs):
1148 """SetWidth(self, int w)"""
1149 return _core_.Rect_SetWidth(*args, **kwargs)
1150
1151 def GetHeight(*args, **kwargs):
1152 """GetHeight(self) -> int"""
1153 return _core_.Rect_GetHeight(*args, **kwargs)
1154
1155 def SetHeight(*args, **kwargs):
1156 """SetHeight(self, int h)"""
1157 return _core_.Rect_SetHeight(*args, **kwargs)
1158
1159 def GetPosition(*args, **kwargs):
1160 """GetPosition(self) -> Point"""
1161 return _core_.Rect_GetPosition(*args, **kwargs)
1162
1163 def SetPosition(*args, **kwargs):
1164 """SetPosition(self, Point p)"""
1165 return _core_.Rect_SetPosition(*args, **kwargs)
1166
1167 def GetSize(*args, **kwargs):
1168 """GetSize(self) -> Size"""
1169 return _core_.Rect_GetSize(*args, **kwargs)
1170
1171 def SetSize(*args, **kwargs):
1172 """SetSize(self, Size s)"""
1173 return _core_.Rect_SetSize(*args, **kwargs)
1174
aff4cc5c
RD
1175 def IsEmpty(*args, **kwargs):
1176 """IsEmpty(self) -> bool"""
1177 return _core_.Rect_IsEmpty(*args, **kwargs)
1178
d55e5bfc
RD
1179 def GetTopLeft(*args, **kwargs):
1180 """GetTopLeft(self) -> Point"""
1181 return _core_.Rect_GetTopLeft(*args, **kwargs)
1182
1183 def SetTopLeft(*args, **kwargs):
1184 """SetTopLeft(self, Point p)"""
1185 return _core_.Rect_SetTopLeft(*args, **kwargs)
1186
1187 def GetBottomRight(*args, **kwargs):
1188 """GetBottomRight(self) -> Point"""
1189 return _core_.Rect_GetBottomRight(*args, **kwargs)
1190
1191 def SetBottomRight(*args, **kwargs):
1192 """SetBottomRight(self, Point p)"""
1193 return _core_.Rect_SetBottomRight(*args, **kwargs)
1194
5acb46e0
RD
1195 def GetTopRight(*args, **kwargs):
1196 """GetTopRight(self) -> Point"""
1197 return _core_.Rect_GetTopRight(*args, **kwargs)
1198
1199 def SetTopRight(*args, **kwargs):
1200 """SetTopRight(self, Point p)"""
1201 return _core_.Rect_SetTopRight(*args, **kwargs)
1202
1203 def GetBottomLeft(*args, **kwargs):
1204 """GetBottomLeft(self) -> Point"""
1205 return _core_.Rect_GetBottomLeft(*args, **kwargs)
1206
1207 def SetBottomLeft(*args, **kwargs):
1208 """SetBottomLeft(self, Point p)"""
1209 return _core_.Rect_SetBottomLeft(*args, **kwargs)
1210
d55e5bfc
RD
1211 def GetLeft(*args, **kwargs):
1212 """GetLeft(self) -> int"""
1213 return _core_.Rect_GetLeft(*args, **kwargs)
1214
1215 def GetTop(*args, **kwargs):
1216 """GetTop(self) -> int"""
1217 return _core_.Rect_GetTop(*args, **kwargs)
1218
1219 def GetBottom(*args, **kwargs):
1220 """GetBottom(self) -> int"""
1221 return _core_.Rect_GetBottom(*args, **kwargs)
1222
1223 def GetRight(*args, **kwargs):
1224 """GetRight(self) -> int"""
1225 return _core_.Rect_GetRight(*args, **kwargs)
1226
1227 def SetLeft(*args, **kwargs):
1228 """SetLeft(self, int left)"""
1229 return _core_.Rect_SetLeft(*args, **kwargs)
1230
1231 def SetRight(*args, **kwargs):
1232 """SetRight(self, int right)"""
1233 return _core_.Rect_SetRight(*args, **kwargs)
1234
1235 def SetTop(*args, **kwargs):
1236 """SetTop(self, int top)"""
1237 return _core_.Rect_SetTop(*args, **kwargs)
1238
1239 def SetBottom(*args, **kwargs):
1240 """SetBottom(self, int bottom)"""
1241 return _core_.Rect_SetBottom(*args, **kwargs)
1242
1243 position = property(GetPosition, SetPosition)
1244 size = property(GetSize, SetSize)
1245 left = property(GetLeft, SetLeft)
1246 right = property(GetRight, SetRight)
1247 top = property(GetTop, SetTop)
1248 bottom = property(GetBottom, SetBottom)
1249
1250 def Inflate(*args, **kwargs):
1251 """
1252 Inflate(self, int dx, int dy) -> Rect
1253
091fdbfa
RD
1254 Increases the size of the rectangle.
1255
1256 The left border is moved farther left and the right border is moved
1257 farther right by ``dx``. The upper border is moved farther up and the
1258 bottom border is moved farther down by ``dy``. (Note the the width and
1259 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1260 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1261 opposite happens: the rectangle size decreases in the respective
1262 direction.
1263
1264 The change is made to the rectangle inplace, if instead you need a
1265 copy that is inflated, preserving the original then make the copy
1266 first::
1267
1268 copy = wx.Rect(*original)
1269 copy.Inflate(10,15)
1270
1271
d55e5bfc
RD
1272 """
1273 return _core_.Rect_Inflate(*args, **kwargs)
1274
1275 def Deflate(*args, **kwargs):
1276 """
1277 Deflate(self, int dx, int dy) -> Rect
1278
091fdbfa
RD
1279 Decrease the rectangle size. This method is the opposite of `Inflate`
1280 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1281 `Inflate` for a full description.
d55e5bfc
RD
1282 """
1283 return _core_.Rect_Deflate(*args, **kwargs)
1284
1285 def OffsetXY(*args, **kwargs):
1286 """
1287 OffsetXY(self, int dx, int dy)
1288
79fccf9d
RD
1289 Moves the rectangle by the specified offset. If dx is positive, the
1290 rectangle is moved to the right, if dy is positive, it is moved to the
1291 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc
RD
1292 """
1293 return _core_.Rect_OffsetXY(*args, **kwargs)
1294
1295 def Offset(*args, **kwargs):
1296 """
1297 Offset(self, Point pt)
1298
b1fcee84 1299 Same as `OffsetXY` but uses dx,dy from Point
d55e5bfc
RD
1300 """
1301 return _core_.Rect_Offset(*args, **kwargs)
1302
1303 def Intersect(*args, **kwargs):
1304 """
1305 Intersect(self, Rect rect) -> Rect
1306
b519803b 1307 Returns the intersectsion of this rectangle and rect.
d55e5bfc
RD
1308 """
1309 return _core_.Rect_Intersect(*args, **kwargs)
1310
b519803b
RD
1311 def Union(*args, **kwargs):
1312 """
1313 Union(self, Rect rect) -> Rect
1314
1315 Returns the union of this rectangle and rect.
1316 """
1317 return _core_.Rect_Union(*args, **kwargs)
1318
d55e5bfc
RD
1319 def __add__(*args, **kwargs):
1320 """
1321 __add__(self, Rect rect) -> Rect
1322
1323 Add the properties of rect to this rectangle and return the result.
1324 """
1325 return _core_.Rect___add__(*args, **kwargs)
1326
1327 def __iadd__(*args, **kwargs):
1328 """
1329 __iadd__(self, Rect rect) -> Rect
1330
1331 Add the properties of rect to this rectangle, updating this rectangle.
1332 """
1333 return _core_.Rect___iadd__(*args, **kwargs)
1334
1335 def __eq__(*args, **kwargs):
1336 """
e9d6f3a4 1337 __eq__(self, PyObject other) -> bool
d55e5bfc 1338
e9d6f3a4 1339 Test for equality of wx.Rect objects.
d55e5bfc
RD
1340 """
1341 return _core_.Rect___eq__(*args, **kwargs)
1342
1343 def __ne__(*args, **kwargs):
1344 """
e9d6f3a4 1345 __ne__(self, PyObject other) -> bool
d55e5bfc 1346
e9d6f3a4 1347 Test for inequality of wx.Rect objects.
d55e5bfc
RD
1348 """
1349 return _core_.Rect___ne__(*args, **kwargs)
1350
33d6fd3b 1351 def ContainsXY(*args, **kwargs):
d55e5bfc 1352 """
33d6fd3b 1353 ContainsXY(self, int x, int y) -> bool
d55e5bfc 1354
33d6fd3b 1355 Return True if the point is inside the rect.
d55e5bfc 1356 """
33d6fd3b 1357 return _core_.Rect_ContainsXY(*args, **kwargs)
d55e5bfc 1358
33d6fd3b 1359 def Contains(*args, **kwargs):
d55e5bfc 1360 """
33d6fd3b 1361 Contains(self, Point pt) -> bool
d55e5bfc 1362
33d6fd3b 1363 Return True if the point is inside the rect.
d55e5bfc 1364 """
33d6fd3b 1365 return _core_.Rect_Contains(*args, **kwargs)
d55e5bfc 1366
33d6fd3b 1367 def ContainsRect(*args, **kwargs):
fc46b7f3 1368 """
33d6fd3b 1369 ContainsRect(self, Rect rect) -> bool
fc46b7f3
RD
1370
1371 Returns ``True`` if the given rectangle is completely inside this
1372 rectangle or touches its boundary.
1373 """
33d6fd3b
RD
1374 return _core_.Rect_ContainsRect(*args, **kwargs)
1375
72ef6efb
RD
1376 #Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1377 #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1378 #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1379 Inside = Contains
1380 InsideXY = ContainsXY
1381 InsideRect = ContainsRect
fc46b7f3 1382
d55e5bfc
RD
1383 def Intersects(*args, **kwargs):
1384 """
1385 Intersects(self, Rect rect) -> bool
1386
1387 Returns True if the rectangles have a non empty intersection.
1388 """
1389 return _core_.Rect_Intersects(*args, **kwargs)
1390
b1fcee84
RD
1391 def CenterIn(*args, **kwargs):
1392 """
1393 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1394
1395 Center this rectangle within the one passed to the method, which is
1396 usually, but not necessarily, the larger one.
1397 """
1398 return _core_.Rect_CenterIn(*args, **kwargs)
1399
1400 CentreIn = CenterIn
d55e5bfc
RD
1401 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1402 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1403 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1404 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1405 def Set(*args, **kwargs):
1406 """
1407 Set(self, int x=0, int y=0, int width=0, int height=0)
1408
1409 Set all rectangle properties.
1410 """
1411 return _core_.Rect_Set(*args, **kwargs)
1412
1413 def Get(*args, **kwargs):
1414 """
1415 Get() -> (x,y,width,height)
1416
1417 Return the rectangle properties as a tuple.
1418 """
1419 return _core_.Rect_Get(*args, **kwargs)
1420
79fccf9d 1421 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1422 def __str__(self): return str(self.Get())
1423 def __repr__(self): return 'wx.Rect'+str(self.Get())
1424 def __len__(self): return len(self.Get())
1425 def __getitem__(self, index): return self.Get()[index]
1426 def __setitem__(self, index, val):
1427 if index == 0: self.x = val
1428 elif index == 1: self.y = val
1429 elif index == 2: self.width = val
1430 elif index == 3: self.height = val
1431 else: raise IndexError
1432 def __nonzero__(self): return self.Get() != (0,0,0,0)
1433 __safe_for_unpickling__ = True
1434 def __reduce__(self): return (wx.Rect, self.Get())
1435
33d6fd3b
RD
1436 Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`")
1437 BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`")
5acb46e0 1438 BottomLeft = property(GetBottomLeft,SetBottomLeft,doc="See `GetBottomLeft` and `SetBottomLeft`")
33d6fd3b
RD
1439 Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
1440 Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`")
1441 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
1442 Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`")
1443 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
1444 Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`")
1445 TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`")
5acb46e0 1446 TopRight = property(GetTopRight,SetTopRight,doc="See `GetTopRight` and `SetTopRight`")
33d6fd3b
RD
1447 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
1448 X = property(GetX,SetX,doc="See `GetX` and `SetX`")
1449 Y = property(GetY,SetY,doc="See `GetY` and `SetY`")
1450 Empty = property(IsEmpty,doc="See `IsEmpty`")
2131d850 1451_core_.Rect_swigregister(Rect)
d55e5bfc
RD
1452
1453def RectPP(*args, **kwargs):
1454 """
1455 RectPP(Point topLeft, Point bottomRight) -> Rect
1456
1457 Create a new Rect object from Points representing two corners.
1458 """
1459 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1460 return val
1461
1462def RectPS(*args, **kwargs):
1463 """
1464 RectPS(Point pos, Size size) -> Rect
1465
1466 Create a new Rect from a position and size.
1467 """
1468 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1469 return val
1470
c1cb24a4
RD
1471def RectS(*args, **kwargs):
1472 """
1473 RectS(Size size) -> Rect
1474
1475 Create a new Rect from a size only.
1476 """
1477 val = _core_.new_RectS(*args, **kwargs)
c1cb24a4
RD
1478 return val
1479
d55e5bfc
RD
1480
1481def IntersectRect(*args, **kwargs):
554f62e9 1482 """
d55e5bfc
RD
1483 IntersectRect(Rect r1, Rect r2) -> Rect
1484
1485 Calculate and return the intersection of r1 and r2.
1486 """
554f62e9 1487 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1488#---------------------------------------------------------------------------
1489
1490class Point2D(object):
79fccf9d
RD
1491 """
1492 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1493 with floating point values.
1494 """
554f62e9
RD
1495 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1496 __repr__ = _swig_repr
1497 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1498 """
1499 __init__(self, double x=0.0, double y=0.0) -> Point2D
1500
1501 Create a w.Point2D object.
1502 """
554f62e9 1503 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
d55e5bfc 1504 def GetFloor(*args, **kwargs):
a8eff060
RD
1505 """
1506 GetFloor() -> (x,y)
1507
1508 Convert to integer
1509 """
d55e5bfc
RD
1510 return _core_.Point2D_GetFloor(*args, **kwargs)
1511
1512 def GetRounded(*args, **kwargs):
a8eff060
RD
1513 """
1514 GetRounded() -> (x,y)
1515
1516 Convert to integer
1517 """
d55e5bfc
RD
1518 return _core_.Point2D_GetRounded(*args, **kwargs)
1519
1520 def GetVectorLength(*args, **kwargs):
1521 """GetVectorLength(self) -> double"""
1522 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1523
1524 def GetVectorAngle(*args, **kwargs):
1525 """GetVectorAngle(self) -> double"""
1526 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1527
1528 def SetVectorLength(*args, **kwargs):
1529 """SetVectorLength(self, double length)"""
1530 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1531
1532 def SetVectorAngle(*args, **kwargs):
1533 """SetVectorAngle(self, double degrees)"""
1534 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1535
1536 def SetPolarCoordinates(self, angle, length):
1537 self.SetVectorLength(length)
1538 self.SetVectorAngle(angle)
1539 def Normalize(self):
1540 self.SetVectorLength(1.0)
1541
1542 def GetDistance(*args, **kwargs):
1543 """GetDistance(self, Point2D pt) -> double"""
1544 return _core_.Point2D_GetDistance(*args, **kwargs)
1545
1546 def GetDistanceSquare(*args, **kwargs):
1547 """GetDistanceSquare(self, Point2D pt) -> double"""
1548 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1549
1550 def GetDotProduct(*args, **kwargs):
1551 """GetDotProduct(self, Point2D vec) -> double"""
1552 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1553
1554 def GetCrossProduct(*args, **kwargs):
1555 """GetCrossProduct(self, Point2D vec) -> double"""
1556 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1557
1558 def __neg__(*args, **kwargs):
1559 """
1560 __neg__(self) -> Point2D
1561
1562 the reflection of this point
1563 """
1564 return _core_.Point2D___neg__(*args, **kwargs)
1565
1566 def __iadd__(*args, **kwargs):
1567 """__iadd__(self, Point2D pt) -> Point2D"""
1568 return _core_.Point2D___iadd__(*args, **kwargs)
1569
1570 def __isub__(*args, **kwargs):
1571 """__isub__(self, Point2D pt) -> Point2D"""
1572 return _core_.Point2D___isub__(*args, **kwargs)
1573
1574 def __imul__(*args, **kwargs):
1575 """__imul__(self, Point2D pt) -> Point2D"""
1576 return _core_.Point2D___imul__(*args, **kwargs)
1577
1578 def __idiv__(*args, **kwargs):
1579 """__idiv__(self, Point2D pt) -> Point2D"""
1580 return _core_.Point2D___idiv__(*args, **kwargs)
1581
1582 def __eq__(*args, **kwargs):
1583 """
e9d6f3a4 1584 __eq__(self, PyObject other) -> bool
d55e5bfc 1585
e9d6f3a4 1586 Test for equality of wx.Point2D objects.
d55e5bfc
RD
1587 """
1588 return _core_.Point2D___eq__(*args, **kwargs)
1589
1590 def __ne__(*args, **kwargs):
1591 """
e9d6f3a4 1592 __ne__(self, PyObject other) -> bool
d55e5bfc 1593
e9d6f3a4 1594 Test for inequality of wx.Point2D objects.
d55e5bfc
RD
1595 """
1596 return _core_.Point2D___ne__(*args, **kwargs)
1597
1598 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1599 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1600 def Set(*args, **kwargs):
1601 """Set(self, double x=0, double y=0)"""
1602 return _core_.Point2D_Set(*args, **kwargs)
1603
1604 def Get(*args, **kwargs):
1605 """
1606 Get() -> (x,y)
1607
1608 Return x and y properties as a tuple.
1609 """
1610 return _core_.Point2D_Get(*args, **kwargs)
1611
79fccf9d 1612 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1613 def __str__(self): return str(self.Get())
1614 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1615 def __len__(self): return len(self.Get())
1616 def __getitem__(self, index): return self.Get()[index]
1617 def __setitem__(self, index, val):
1618 if index == 0: self.x = val
1619 elif index == 1: self.y = val
1620 else: raise IndexError
1621 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1622 __safe_for_unpickling__ = True
1623 def __reduce__(self): return (wx.Point2D, self.Get())
1624
33d6fd3b
RD
1625 Floor = property(GetFloor,doc="See `GetFloor`")
1626 Rounded = property(GetRounded,doc="See `GetRounded`")
1627 VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`")
1628 VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`")
2131d850 1629_core_.Point2D_swigregister(Point2D)
d55e5bfc
RD
1630
1631def Point2DCopy(*args, **kwargs):
1632 """
1633 Point2DCopy(Point2D pt) -> Point2D
1634
1635 Create a w.Point2D object.
1636 """
1637 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1638 return val
1639
1640def Point2DFromPoint(*args, **kwargs):
1641 """
1642 Point2DFromPoint(Point pt) -> Point2D
1643
1644 Create a w.Point2D object.
1645 """
1646 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d55e5bfc
RD
1647 return val
1648
1649#---------------------------------------------------------------------------
1650
1651FromStart = _core_.FromStart
1652FromCurrent = _core_.FromCurrent
1653FromEnd = _core_.FromEnd
1654class InputStream(object):
093d3ff1 1655 """Proxy of C++ InputStream class"""
554f62e9
RD
1656 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1657 __repr__ = _swig_repr
1658 def __init__(self, *args, **kwargs):
d55e5bfc 1659 """__init__(self, PyObject p) -> InputStream"""
554f62e9
RD
1660 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1661 __swig_destroy__ = _core_.delete_InputStream
1662 __del__ = lambda self : None;
d55e5bfc
RD
1663 def close(*args, **kwargs):
1664 """close(self)"""
1665 return _core_.InputStream_close(*args, **kwargs)
1666
1667 def flush(*args, **kwargs):
1668 """flush(self)"""
1669 return _core_.InputStream_flush(*args, **kwargs)
1670
1671 def eof(*args, **kwargs):
1672 """eof(self) -> bool"""
1673 return _core_.InputStream_eof(*args, **kwargs)
1674
1675 def read(*args, **kwargs):
1676 """read(self, int size=-1) -> PyObject"""
1677 return _core_.InputStream_read(*args, **kwargs)
1678
1679 def readline(*args, **kwargs):
1680 """readline(self, int size=-1) -> PyObject"""
1681 return _core_.InputStream_readline(*args, **kwargs)
1682
1683 def readlines(*args, **kwargs):
1684 """readlines(self, int sizehint=-1) -> PyObject"""
1685 return _core_.InputStream_readlines(*args, **kwargs)
1686
1687 def seek(*args, **kwargs):
1688 """seek(self, int offset, int whence=0)"""
1689 return _core_.InputStream_seek(*args, **kwargs)
1690
1691 def tell(*args, **kwargs):
1692 """tell(self) -> int"""
1693 return _core_.InputStream_tell(*args, **kwargs)
1694
1695 def Peek(*args, **kwargs):
1696 """Peek(self) -> char"""
1697 return _core_.InputStream_Peek(*args, **kwargs)
1698
1699 def GetC(*args, **kwargs):
1700 """GetC(self) -> char"""
1701 return _core_.InputStream_GetC(*args, **kwargs)
1702
1703 def LastRead(*args, **kwargs):
1704 """LastRead(self) -> size_t"""
1705 return _core_.InputStream_LastRead(*args, **kwargs)
1706
1707 def CanRead(*args, **kwargs):
1708 """CanRead(self) -> bool"""
1709 return _core_.InputStream_CanRead(*args, **kwargs)
1710
1711 def Eof(*args, **kwargs):
1712 """Eof(self) -> bool"""
1713 return _core_.InputStream_Eof(*args, **kwargs)
1714
1715 def Ungetch(*args, **kwargs):
1716 """Ungetch(self, char c) -> bool"""
1717 return _core_.InputStream_Ungetch(*args, **kwargs)
1718
1719 def SeekI(*args, **kwargs):
1720 """SeekI(self, long pos, int mode=FromStart) -> long"""
1721 return _core_.InputStream_SeekI(*args, **kwargs)
1722
1723 def TellI(*args, **kwargs):
1724 """TellI(self) -> long"""
1725 return _core_.InputStream_TellI(*args, **kwargs)
1726
2131d850 1727_core_.InputStream_swigregister(InputStream)
d55e5bfc
RD
1728DefaultPosition = cvar.DefaultPosition
1729DefaultSize = cvar.DefaultSize
1730
1731class OutputStream(object):
093d3ff1 1732 """Proxy of C++ OutputStream class"""
554f62e9
RD
1733 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1734 def __init__(self): raise AttributeError, "No constructor defined"
1735 __repr__ = _swig_repr
d55e5bfc
RD
1736 def write(*args, **kwargs):
1737 """write(self, PyObject obj)"""
1738 return _core_.OutputStream_write(*args, **kwargs)
1739
554f62e9
RD
1740 def LastWrite(*args, **kwargs):
1741 """LastWrite(self) -> size_t"""
1742 return _core_.OutputStream_LastWrite(*args, **kwargs)
d55e5bfc 1743
2131d850 1744_core_.OutputStream_swigregister(OutputStream)
d55e5bfc
RD
1745
1746#---------------------------------------------------------------------------
1747
1748class FSFile(Object):
093d3ff1 1749 """Proxy of C++ FSFile class"""
554f62e9
RD
1750 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1751 __repr__ = _swig_repr
1752 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1753 """
1754 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1755 DateTime modif) -> FSFile
1756 """
554f62e9 1757 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
554f62e9
RD
1758 __swig_destroy__ = _core_.delete_FSFile
1759 __del__ = lambda self : None;
d55e5bfc
RD
1760 def GetStream(*args, **kwargs):
1761 """GetStream(self) -> InputStream"""
1762 return _core_.FSFile_GetStream(*args, **kwargs)
1763
97ab0f6a
RD
1764 def DetachStream(*args, **kwargs):
1765 """DetachStream(self)"""
1766 return _core_.FSFile_DetachStream(*args, **kwargs)
1767
d55e5bfc
RD
1768 def GetMimeType(*args, **kwargs):
1769 """GetMimeType(self) -> String"""
1770 return _core_.FSFile_GetMimeType(*args, **kwargs)
1771
1772 def GetLocation(*args, **kwargs):
1773 """GetLocation(self) -> String"""
1774 return _core_.FSFile_GetLocation(*args, **kwargs)
1775
1776 def GetAnchor(*args, **kwargs):
1777 """GetAnchor(self) -> String"""
1778 return _core_.FSFile_GetAnchor(*args, **kwargs)
1779
1780 def GetModificationTime(*args, **kwargs):
1781 """GetModificationTime(self) -> DateTime"""
1782 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1783
97ab0f6a
RD
1784 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1785 Location = property(GetLocation,doc="See `GetLocation`")
1786 MimeType = property(GetMimeType,doc="See `GetMimeType`")
1787 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
1788 Stream = property(GetStream,doc="See `GetStream`")
2131d850 1789_core_.FSFile_swigregister(FSFile)
d55e5bfc
RD
1790
1791class CPPFileSystemHandler(object):
093d3ff1 1792 """Proxy of C++ CPPFileSystemHandler class"""
554f62e9
RD
1793 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1794 def __init__(self): raise AttributeError, "No constructor defined"
1795 __repr__ = _swig_repr
50f151d7
RD
1796 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1797 __del__ = lambda self : None;
2131d850 1798_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d55e5bfc
RD
1799
1800class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 1801 """Proxy of C++ FileSystemHandler class"""
554f62e9
RD
1802 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1803 __repr__ = _swig_repr
1804 def __init__(self, *args, **kwargs):
d55e5bfc 1805 """__init__(self) -> FileSystemHandler"""
554f62e9 1806 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
d55e5bfc
RD
1807 self._setCallbackInfo(self, FileSystemHandler)
1808
1809 def _setCallbackInfo(*args, **kwargs):
1810 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1811 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1812
1813 def CanOpen(*args, **kwargs):
1814 """CanOpen(self, String location) -> bool"""
1815 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1816
1817 def OpenFile(*args, **kwargs):
1818 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1819 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1820
1821 def FindFirst(*args, **kwargs):
1822 """FindFirst(self, String spec, int flags=0) -> String"""
1823 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1824
1825 def FindNext(*args, **kwargs):
1826 """FindNext(self) -> String"""
1827 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1828
1829 def GetProtocol(*args, **kwargs):
1830 """GetProtocol(self, String location) -> String"""
1831 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1832
1833 def GetLeftLocation(*args, **kwargs):
1834 """GetLeftLocation(self, String location) -> String"""
1835 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1836
1837 def GetAnchor(*args, **kwargs):
1838 """GetAnchor(self, String location) -> String"""
1839 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1840
1841 def GetRightLocation(*args, **kwargs):
1842 """GetRightLocation(self, String location) -> String"""
1843 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1844
1845 def GetMimeTypeFromExt(*args, **kwargs):
1846 """GetMimeTypeFromExt(self, String location) -> String"""
1847 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1848
97ab0f6a
RD
1849 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1850 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
1851 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
1852 Protocol = property(GetProtocol,doc="See `GetProtocol`")
1853 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
2131d850 1854_core_.FileSystemHandler_swigregister(FileSystemHandler)
d55e5bfc
RD
1855
1856class FileSystem(Object):
093d3ff1 1857 """Proxy of C++ FileSystem class"""
554f62e9
RD
1858 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1859 __repr__ = _swig_repr
1860 def __init__(self, *args, **kwargs):
d55e5bfc 1861 """__init__(self) -> FileSystem"""
554f62e9
RD
1862 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1863 __swig_destroy__ = _core_.delete_FileSystem
1864 __del__ = lambda self : None;
d55e5bfc
RD
1865 def ChangePathTo(*args, **kwargs):
1866 """ChangePathTo(self, String location, bool is_dir=False)"""
1867 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1868
1869 def GetPath(*args, **kwargs):
1870 """GetPath(self) -> String"""
1871 return _core_.FileSystem_GetPath(*args, **kwargs)
1872
1873 def OpenFile(*args, **kwargs):
1874 """OpenFile(self, String location) -> FSFile"""
1875 return _core_.FileSystem_OpenFile(*args, **kwargs)
1876
1877 def FindFirst(*args, **kwargs):
1878 """FindFirst(self, String spec, int flags=0) -> String"""
1879 return _core_.FileSystem_FindFirst(*args, **kwargs)
1880
1881 def FindNext(*args, **kwargs):
1882 """FindNext(self) -> String"""
1883 return _core_.FileSystem_FindNext(*args, **kwargs)
1884
1885 def AddHandler(*args, **kwargs):
c24da6d6 1886 """AddHandler(CPPFileSystemHandler handler)"""
d55e5bfc
RD
1887 return _core_.FileSystem_AddHandler(*args, **kwargs)
1888
1889 AddHandler = staticmethod(AddHandler)
97ab0f6a
RD
1890 def RemoveHandler(*args, **kwargs):
1891 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1892 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1893
1894 RemoveHandler = staticmethod(RemoveHandler)
d55e5bfc 1895 def CleanUpHandlers(*args, **kwargs):
c24da6d6 1896 """CleanUpHandlers()"""
d55e5bfc
RD
1897 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1898
1899 CleanUpHandlers = staticmethod(CleanUpHandlers)
1900 def FileNameToURL(*args, **kwargs):
c24da6d6 1901 """FileNameToURL(String filename) -> String"""
d55e5bfc
RD
1902 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1903
1904 FileNameToURL = staticmethod(FileNameToURL)
ae8162c8
RD
1905 def URLToFileName(*args, **kwargs):
1906 """URLToFileName(String url) -> String"""
1907 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1908
1909 URLToFileName = staticmethod(URLToFileName)
97ab0f6a 1910 Path = property(GetPath,doc="See `GetPath`")
2131d850 1911_core_.FileSystem_swigregister(FileSystem)
d55e5bfc
RD
1912
1913def FileSystem_AddHandler(*args, **kwargs):
554f62e9
RD
1914 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1915 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 1916
97ab0f6a
RD
1917def FileSystem_RemoveHandler(*args, **kwargs):
1918 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1919 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1920
554f62e9
RD
1921def FileSystem_CleanUpHandlers(*args):
1922 """FileSystem_CleanUpHandlers()"""
1923 return _core_.FileSystem_CleanUpHandlers(*args)
d55e5bfc
RD
1924
1925def FileSystem_FileNameToURL(*args, **kwargs):
554f62e9
RD
1926 """FileSystem_FileNameToURL(String filename) -> String"""
1927 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 1928
d55e5bfc 1929def FileSystem_URLToFileName(*args, **kwargs):
554f62e9
RD
1930 """FileSystem_URLToFileName(String url) -> String"""
1931 return _core_.FileSystem_URLToFileName(*args, **kwargs)
ae8162c8 1932
d55e5bfc 1933class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 1934 """Proxy of C++ InternetFSHandler class"""
554f62e9
RD
1935 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1936 __repr__ = _swig_repr
1937 def __init__(self, *args, **kwargs):
d55e5bfc 1938 """__init__(self) -> InternetFSHandler"""
554f62e9 1939 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
d55e5bfc
RD
1940 def CanOpen(*args, **kwargs):
1941 """CanOpen(self, String location) -> bool"""
1942 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1943
1944 def OpenFile(*args, **kwargs):
1945 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1946 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1947
2131d850 1948_core_.InternetFSHandler_swigregister(InternetFSHandler)
d55e5bfc
RD
1949
1950class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 1951 """Proxy of C++ ZipFSHandler class"""
554f62e9
RD
1952 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1953 __repr__ = _swig_repr
1954 def __init__(self, *args, **kwargs):
d55e5bfc 1955 """__init__(self) -> ZipFSHandler"""
554f62e9 1956 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
d55e5bfc
RD
1957 def CanOpen(*args, **kwargs):
1958 """CanOpen(self, String location) -> bool"""
1959 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1960
1961 def OpenFile(*args, **kwargs):
1962 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1963 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1964
1965 def FindFirst(*args, **kwargs):
1966 """FindFirst(self, String spec, int flags=0) -> String"""
1967 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1968
1969 def FindNext(*args, **kwargs):
1970 """FindNext(self) -> String"""
1971 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1972
2131d850 1973_core_.ZipFSHandler_swigregister(ZipFSHandler)
d55e5bfc
RD
1974
1975
1976def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
554f62e9
RD
1977 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1978 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d55e5bfc
RD
1979
1980def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
554f62e9
RD
1981 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1982 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d55e5bfc
RD
1983
1984def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
554f62e9
RD
1985 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1986 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
ae8162c8
RD
1987def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1988 """
1989 Add 'file' to the memory filesystem. The dataItem parameter can
1990 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1991 arbitrary data. If a bitmap or image is used then the imgType
1992 parameter should specify what kind of image file it should be
1993 written as, wx.BITMAP_TYPE_PNG, etc.
1994 """
1995 if isinstance(dataItem, wx.Image):
1996 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1997 elif isinstance(dataItem, wx.Bitmap):
1998 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1999 elif type(dataItem) == str:
2000 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2001 else:
2002 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc
RD
2003
2004class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 2005 """Proxy of C++ MemoryFSHandler class"""
554f62e9
RD
2006 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2007 __repr__ = _swig_repr
2008 def __init__(self, *args, **kwargs):
d55e5bfc 2009 """__init__(self) -> MemoryFSHandler"""
554f62e9 2010 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
d55e5bfc 2011 def RemoveFile(*args, **kwargs):
c24da6d6 2012 """RemoveFile(String filename)"""
d55e5bfc
RD
2013 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
2014
2015 RemoveFile = staticmethod(RemoveFile)
2016 AddFile = staticmethod(MemoryFSHandler_AddFile)
2017 def CanOpen(*args, **kwargs):
2018 """CanOpen(self, String location) -> bool"""
2019 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
2020
2021 def OpenFile(*args, **kwargs):
2022 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2023 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
2024
2025 def FindFirst(*args, **kwargs):
2026 """FindFirst(self, String spec, int flags=0) -> String"""
2027 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
2028
2029 def FindNext(*args, **kwargs):
2030 """FindNext(self) -> String"""
2031 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
2032
2131d850 2033_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d55e5bfc
RD
2034
2035def MemoryFSHandler_RemoveFile(*args, **kwargs):
554f62e9
RD
2036 """MemoryFSHandler_RemoveFile(String filename)"""
2037 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 2038
57133d5c
RD
2039IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2040IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2041IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
f5263701
RD
2042IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL
2043IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH
d55e5bfc
RD
2044#---------------------------------------------------------------------------
2045
2046class ImageHandler(Object):
27fb7603
RD
2047 """
2048 This is the base class for implementing image file loading/saving, and
2049 image creation from data. It is used within `wx.Image` and is not
2050 normally seen by the application.
2051 """
554f62e9
RD
2052 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2053 def __init__(self): raise AttributeError, "No constructor defined"
2054 __repr__ = _swig_repr
d55e5bfc
RD
2055 def GetName(*args, **kwargs):
2056 """GetName(self) -> String"""
2057 return _core_.ImageHandler_GetName(*args, **kwargs)
2058
2059 def GetExtension(*args, **kwargs):
2060 """GetExtension(self) -> String"""
2061 return _core_.ImageHandler_GetExtension(*args, **kwargs)
2062
2063 def GetType(*args, **kwargs):
2064 """GetType(self) -> long"""
2065 return _core_.ImageHandler_GetType(*args, **kwargs)
2066
2067 def GetMimeType(*args, **kwargs):
2068 """GetMimeType(self) -> String"""
2069 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
2070
2071 def CanRead(*args, **kwargs):
2072 """CanRead(self, String name) -> bool"""
2073 return _core_.ImageHandler_CanRead(*args, **kwargs)
2074
b02396e8
RD
2075 def CanReadStream(*args, **kwargs):
2076 """CanReadStream(self, InputStream stream) -> bool"""
2077 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2078
d55e5bfc
RD
2079 def SetName(*args, **kwargs):
2080 """SetName(self, String name)"""
2081 return _core_.ImageHandler_SetName(*args, **kwargs)
2082
2083 def SetExtension(*args, **kwargs):
2084 """SetExtension(self, String extension)"""
2085 return _core_.ImageHandler_SetExtension(*args, **kwargs)
2086
2087 def SetType(*args, **kwargs):
2088 """SetType(self, long type)"""
2089 return _core_.ImageHandler_SetType(*args, **kwargs)
2090
2091 def SetMimeType(*args, **kwargs):
2092 """SetMimeType(self, String mimetype)"""
2093 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2094
97ab0f6a
RD
2095 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2096 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2097 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2098 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2131d850 2099_core_.ImageHandler_swigregister(ImageHandler)
d55e5bfc 2100
9d7dfdff
RD
2101class PyImageHandler(ImageHandler):
2102 """
2103 This is the base class for implementing image file loading/saving, and
2104 image creation from data, all written in Python. To create a custom
2105 image handler derive a new class from wx.PyImageHandler and provide
2106 the following methods::
2107
2108 def DoCanRead(self, stream) --> bool
2109 '''Check if this handler can read the image on the stream'''
2110
2111 def LoadFile(self, image, stream, verbose, index) --> bool
2112 '''Load image data from the stream and load it into image.'''
2113
2114 def SaveFile(self, image, stream, verbose) --> bool
2115 '''Save the iamge data in image to the stream using
2116 this handler's image file format.'''
2117
2118 def GetImageCount(self, stream) --> int
2119 '''If this image format can hold more than one image,
2120 how many does the image on the stream have?'''
2121
2122 To activate your handler create an instance of it and pass it to
2123 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2124 `SetExtension` from your constructor.
2125
2126 """
554f62e9
RD
2127 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2128 __repr__ = _swig_repr
2129 def __init__(self, *args, **kwargs):
9d7dfdff
RD
2130 """
2131 __init__(self) -> PyImageHandler
2132
2133 This is the base class for implementing image file loading/saving, and
2134 image creation from data, all written in Python. To create a custom
2135 image handler derive a new class from wx.PyImageHandler and provide
2136 the following methods::
2137
2138 def DoCanRead(self, stream) --> bool
2139 '''Check if this handler can read the image on the stream'''
2140
2141 def LoadFile(self, image, stream, verbose, index) --> bool
2142 '''Load image data from the stream and load it into image.'''
2143
2144 def SaveFile(self, image, stream, verbose) --> bool
2145 '''Save the iamge data in image to the stream using
2146 this handler's image file format.'''
2147
2148 def GetImageCount(self, stream) --> int
2149 '''If this image format can hold more than one image,
2150 how many does the image on the stream have?'''
2151
2152 To activate your handler create an instance of it and pass it to
2153 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2154 `SetExtension` from your constructor.
2155
2156 """
554f62e9 2157 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
9d7dfdff
RD
2158 self._SetSelf(self)
2159
2160 def _SetSelf(*args, **kwargs):
2161 """_SetSelf(self, PyObject self)"""
2162 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2163
2131d850 2164_core_.PyImageHandler_swigregister(PyImageHandler)
9d7dfdff 2165
d55e5bfc 2166class ImageHistogram(object):
093d3ff1 2167 """Proxy of C++ ImageHistogram class"""
554f62e9
RD
2168 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2169 __repr__ = _swig_repr
2170 def __init__(self, *args, **kwargs):
d55e5bfc 2171 """__init__(self) -> ImageHistogram"""
554f62e9 2172 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
d55e5bfc
RD
2173 def MakeKey(*args, **kwargs):
2174 """
7a27cf7c 2175 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2176
2177 Get the key in the histogram for the given RGB values
2178 """
2179 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2180
2181 MakeKey = staticmethod(MakeKey)
2182 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
2183 """
2184 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2185
2186 Find first colour that is not used in the image and has higher RGB
2187 values than startR, startG, startB. Returns a tuple consisting of a
2188 success flag and rgb values.
2189 """
d55e5bfc
RD
2190 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2191
f1cbd8fa
RD
2192 def GetCount(*args, **kwargs):
2193 """
2194 GetCount(self, unsigned long key) -> unsigned long
2195
2196 Returns the pixel count for the given key. Use `MakeKey` to create a
2197 key value from a RGB tripple.
2198 """
2199 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2200
2201 def GetCountRGB(*args, **kwargs):
2202 """
7a27cf7c 2203 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2204
2205 Returns the pixel count for the given RGB values.
2206 """
2207 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2208
2209 def GetCountColour(*args, **kwargs):
2210 """
2211 GetCountColour(self, Colour colour) -> unsigned long
2212
2213 Returns the pixel count for the given `wx.Colour` value.
2214 """
2215 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2216
2131d850 2217_core_.ImageHistogram_swigregister(ImageHistogram)
d55e5bfc
RD
2218
2219def ImageHistogram_MakeKey(*args, **kwargs):
554f62e9 2220 """
7a27cf7c 2221 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2222
2223 Get the key in the histogram for the given RGB values
2224 """
554f62e9 2225 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2226
2f91e3df 2227class Image_RGBValue(object):
9d7dfdff
RD
2228 """
2229 An object that contains values for red, green and blue which represent
2230 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2231 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2232 color space.
2233 """
554f62e9
RD
2234 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2235 __repr__ = _swig_repr
2236 def __init__(self, *args, **kwargs):
9d7dfdff
RD
2237 """
2238 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2239
2240 Constructor.
2241 """
554f62e9 2242 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2f91e3df
KO
2243 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2244 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2245 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2246_core_.Image_RGBValue_swigregister(Image_RGBValue)
2f91e3df
KO
2247
2248class Image_HSVValue(object):
9d7dfdff
RD
2249 """
2250 An object that contains values for hue, saturation and value which
2251 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2252 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2253 color space.
2254 """
554f62e9
RD
2255 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2256 __repr__ = _swig_repr
2257 def __init__(self, *args, **kwargs):
9d7dfdff
RD
2258 """
2259 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2260
2261 Constructor.
2262 """
554f62e9 2263 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2f91e3df
KO
2264 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2265 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2266 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2267_core_.Image_HSVValue_swigregister(Image_HSVValue)
2f91e3df 2268
d55e5bfc 2269class Image(Object):
7a27cf7c
RD
2270 """
2271 A platform-independent image class. An image can be created from
2272 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2273 variety of formats. Functions are available to set and get image
2274 bits, so it can be used for basic image manipulation.
2275
2276 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2277 platform-specific `wx.Bitmap` object must be created from it using the
2278 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2279 device context, using `wx.DC.DrawBitmap`.
2280
2281 One colour value of the image may be used as a mask colour which will
2282 lead to the automatic creation of a `wx.Mask` object associated to the
2283 bitmap object.
2284
2285 wx.Image supports alpha channel data, that is in addition to a byte
2286 for the red, green and blue colour components for each pixel it also
2287 stores a byte representing the pixel opacity. An alpha value of 0
2288 corresponds to a transparent pixel (null opacity) while a value of 255
2289 means that the pixel is 100% opaque.
2290
2291 Unlike RGB data, not all images have an alpha channel and before using
2292 `GetAlpha` you should check if this image contains an alpha channel
2293 with `HasAlpha`. Note that currently only images loaded from PNG files
2294 with transparency information will have an alpha channel.
2295 """
554f62e9
RD
2296 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2297 __repr__ = _swig_repr
2298 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2299 """
2300 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2301
2302 Loads an image from a file.
2303 """
554f62e9
RD
2304 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2305 __swig_destroy__ = _core_.delete_Image
2306 __del__ = lambda self : None;
d55e5bfc 2307 def Create(*args, **kwargs):
7a27cf7c
RD
2308 """
2309 Create(self, int width, int height, bool clear=True)
2310
2311 Creates a fresh image. If clear is ``True``, the new image will be
2312 initialized to black. Otherwise, the image data will be uninitialized.
2313 """
d55e5bfc
RD
2314 return _core_.Image_Create(*args, **kwargs)
2315
2316 def Destroy(*args, **kwargs):
2317 """
2318 Destroy(self)
2319
7a27cf7c 2320 Destroys the image data.
d55e5bfc 2321 """
7e08d4ef
RD
2322 val = _core_.Image_Destroy(*args, **kwargs)
2323 args[0].thisown = 0
2324 return val
d55e5bfc
RD
2325
2326 def Scale(*args, **kwargs):
7a27cf7c 2327 """
f5263701 2328 Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
7a27cf7c
RD
2329
2330 Returns a scaled version of the image. This is also useful for scaling
2331 bitmaps in general as the only other way to scale bitmaps is to blit a
f5263701
RD
2332 `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter
2333 specifies what method to use for resampling the image. It can be
2334 either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling
2335 method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses
2336 bicubic and box averaging resampling methods for upsampling and
2337 downsampling respectively.
7a27cf7c 2338 """
d55e5bfc
RD
2339 return _core_.Image_Scale(*args, **kwargs)
2340
f5263701
RD
2341 def ResampleBox(*args, **kwargs):
2342 """ResampleBox(self, int width, int height) -> Image"""
2343 return _core_.Image_ResampleBox(*args, **kwargs)
2344
2345 def ResampleBicubic(*args, **kwargs):
2346 """ResampleBicubic(self, int width, int height) -> Image"""
2347 return _core_.Image_ResampleBicubic(*args, **kwargs)
2348
2349 def Blur(*args, **kwargs):
2350 """
2351 Blur(self, int radius) -> Image
2352
2353 Blurs the image in both horizontal and vertical directions by the
2354 specified pixel ``radius``. This should not be used when using a
2355 single mask colour for transparency.
2356 """
2357 return _core_.Image_Blur(*args, **kwargs)
2358
2359 def BlurHorizontal(*args, **kwargs):
2360 """
2361 BlurHorizontal(self, int radius) -> Image
2362
2363 Blurs the image in the horizontal direction only. This should not be
2364 used when using a single mask colour for transparency.
2365
2366 """
2367 return _core_.Image_BlurHorizontal(*args, **kwargs)
2368
2369 def BlurVertical(*args, **kwargs):
2370 """
2371 BlurVertical(self, int radius) -> Image
2372
2373 Blurs the image in the vertical direction only. This should not be
2374 used when using a single mask colour for transparency.
2375 """
2376 return _core_.Image_BlurVertical(*args, **kwargs)
2377
d55e5bfc 2378 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2379 """
2380 ShrinkBy(self, int xFactor, int yFactor) -> Image
2381
2382 Return a version of the image scaled smaller by the given factors.
2383 """
d55e5bfc
RD
2384 return _core_.Image_ShrinkBy(*args, **kwargs)
2385
2386 def Rescale(*args, **kwargs):
7a27cf7c 2387 """
f5263701 2388 Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
7a27cf7c
RD
2389
2390 Changes the size of the image in-place by scaling it: after a call to
2391 this function, the image will have the given width and height.
2392
2393 Returns the (modified) image itself.
2394 """
d55e5bfc
RD
2395 return _core_.Image_Rescale(*args, **kwargs)
2396
aff4cc5c 2397 def Resize(*args, **kwargs):
7a27cf7c
RD
2398 """
2399 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2400
2401 Changes the size of the image in-place without scaling it, by adding
2402 either a border with the given colour or cropping as necessary. The
2403 image is pasted into a new image with the given size and background
2404 colour at the position pos relative to the upper left of the new
2405 image. If red = green = blue = -1 then use either the current mask
2406 colour if set or find, use, and set a suitable mask colour for any
2407 newly exposed areas.
2408
2409 Returns the (modified) image itself.
2410 """
aff4cc5c
RD
2411 return _core_.Image_Resize(*args, **kwargs)
2412
d55e5bfc 2413 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2414 """
2415 SetRGB(self, int x, int y, byte r, byte g, byte b)
2416
2417 Sets the pixel at the given coordinate. This routine performs
2418 bounds-checks for the coordinate so it can be considered a safe way to
2419 manipulate the data, but in some cases this might be too slow so that
2420 the data will have to be set directly. In that case you will have to
2421 get access to the image data using the `GetData` method.
2422 """
d55e5bfc
RD
2423 return _core_.Image_SetRGB(*args, **kwargs)
2424
aff4cc5c 2425 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2426 """
2427 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2428
2429 Sets the colour of the pixels within the given rectangle. This routine
2430 performs bounds-checks for the rectangle so it can be considered a
2431 safe way to manipulate the data.
2432 """
aff4cc5c
RD
2433 return _core_.Image_SetRGBRect(*args, **kwargs)
2434
d55e5bfc 2435 def GetRed(*args, **kwargs):
7a27cf7c
RD
2436 """
2437 GetRed(self, int x, int y) -> byte
2438
2439 Returns the red intensity at the given coordinate.
2440 """
d55e5bfc
RD
2441 return _core_.Image_GetRed(*args, **kwargs)
2442
2443 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2444 """
2445 GetGreen(self, int x, int y) -> byte
2446
2447 Returns the green intensity at the given coordinate.
2448 """
d55e5bfc
RD
2449 return _core_.Image_GetGreen(*args, **kwargs)
2450
2451 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2452 """
2453 GetBlue(self, int x, int y) -> byte
2454
2455 Returns the blue intensity at the given coordinate.
2456 """
d55e5bfc
RD
2457 return _core_.Image_GetBlue(*args, **kwargs)
2458
2459 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2460 """
2461 SetAlpha(self, int x, int y, byte alpha)
2462
2463 Sets the alpha value for the given pixel. This function should only be
2464 called if the image has alpha channel data, use `HasAlpha` to check
2465 for this.
2466 """
d55e5bfc
RD
2467 return _core_.Image_SetAlpha(*args, **kwargs)
2468
2469 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2470 """
2471 GetAlpha(self, int x, int y) -> byte
2472
2473 Returns the alpha value for the given pixel. This function may only be
2474 called for the images with alpha channel, use `HasAlpha` to check for
2475 this.
2476
2477 The returned value is the *opacity* of the image, i.e. the value of 0
2478 corresponds to the fully transparent pixels while the value of 255 to
2479 the fully opaque pixels.
2480 """
d55e5bfc
RD
2481 return _core_.Image_GetAlpha(*args, **kwargs)
2482
2483 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2484 """
2485 HasAlpha(self) -> bool
2486
2487 Returns true if this image has alpha channel, false otherwise.
2488 """
d55e5bfc
RD
2489 return _core_.Image_HasAlpha(*args, **kwargs)
2490
68350608
RD
2491 def InitAlpha(*args, **kwargs):
2492 """
2493 InitAlpha(self)
2494
2495 Initializes the image alpha channel data. It is an error to call it if
2496 the image already has alpha data. If it doesn't, alpha data will be by
2497 default initialized to all pixels being fully opaque. But if the image
2498 has a a mask colour, all mask pixels will be completely transparent.
2499 """
2500 return _core_.Image_InitAlpha(*args, **kwargs)
2501
57133d5c
RD
2502 def IsTransparent(*args, **kwargs):
2503 """
7a27cf7c 2504 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
57133d5c 2505
7a27cf7c
RD
2506 Returns ``True`` if this pixel is masked or has an alpha value less
2507 than the spcified threshold.
57133d5c
RD
2508 """
2509 return _core_.Image_IsTransparent(*args, **kwargs)
2510
d55e5bfc 2511 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
2512 """
2513 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2514
2515 Find first colour that is not used in the image and has higher RGB
2516 values than startR, startG, startB. Returns a tuple consisting of a
2517 success flag and rgb values.
2518 """
d55e5bfc
RD
2519 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2520
4cf4100f
RD
2521 def ConvertAlphaToMask(*args, **kwargs):
2522 """
57133d5c 2523 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2524
7a27cf7c
RD
2525 If the image has alpha channel, this method converts it to mask. All
2526 pixels with alpha value less than ``threshold`` are replaced with the
2527 mask colour and the alpha channel is removed. The mask colour is
2528 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2529
2530 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2531 nothing.
2532 """
2533 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2534
8fb0e70a
RD
2535 def ConvertColourToAlpha(*args, **kwargs):
2536 """
7a27cf7c 2537 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2538
2539 This method converts an image where the original alpha information is
2540 only available as a shades of a colour (actually shades of grey)
2541 typically when you draw anti-aliased text into a bitmap. The DC
2542 drawing routines draw grey values on the black background although
2543 they actually mean to draw white with differnt alpha values. This
2544 method reverses it, assuming a black (!) background and white text.
2545 The method will then fill up the whole image with the colour given.
2546 """
2547 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2548
d55e5bfc 2549 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2550 """
2551 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2552
2553 Sets the image's mask so that the pixels that have RGB value of
2554 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2555 by first finding an unused colour in the image, setting this colour as
2556 the mask colour and then using this colour to draw all pixels in the
2557 image who corresponding pixel in mask has given RGB value.
2558
2559 Returns ``False`` if ``mask`` does not have same dimensions as the
2560 image or if there is no unused colour left. Returns ``True`` if the
2561 mask was successfully applied.
2562
2563 Note that this method involves computing the histogram, which is
2564 computationally intensive operation.
2565 """
d55e5bfc
RD
2566 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2567
2568 def CanRead(*args, **kwargs):
7a27cf7c
RD
2569 """
2570 CanRead(String filename) -> bool
2571
2572 Returns True if the image handlers can read this file.
2573 """
d55e5bfc
RD
2574 return _core_.Image_CanRead(*args, **kwargs)
2575
2576 CanRead = staticmethod(CanRead)
2577 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2578 """
2579 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2580
2581 If the image file contains more than one image and the image handler
2582 is capable of retrieving these individually, this function will return
2583 the number of available images.
2584 """
d55e5bfc
RD
2585 return _core_.Image_GetImageCount(*args, **kwargs)
2586
2587 GetImageCount = staticmethod(GetImageCount)
2588 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2589 """
2590 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2591
2592 Loads an image from a file. If no handler type is provided, the
2593 library will try to autodetect the format.
2594 """
d55e5bfc
RD
2595 return _core_.Image_LoadFile(*args, **kwargs)
2596
2597 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2598 """
2599 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2600
2601 Loads an image from a file, specifying the image type with a MIME type
2602 string.
2603 """
d55e5bfc
RD
2604 return _core_.Image_LoadMimeFile(*args, **kwargs)
2605
2606 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2607 """
2608 SaveFile(self, String name, int type) -> bool
2609
2610 Saves an image in the named file.
2611 """
d55e5bfc
RD
2612 return _core_.Image_SaveFile(*args, **kwargs)
2613
2614 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2615 """
2616 SaveMimeFile(self, String name, String mimetype) -> bool
2617
2618 Saves an image in the named file.
2619 """
d55e5bfc
RD
2620 return _core_.Image_SaveMimeFile(*args, **kwargs)
2621
2622 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2623 """
2624 CanReadStream(InputStream stream) -> bool
2625
2626 Returns True if the image handlers can read an image file from the
2627 data currently on the input stream, or a readable Python file-like
2628 object.
2629 """
d55e5bfc
RD
2630 return _core_.Image_CanReadStream(*args, **kwargs)
2631
2632 CanReadStream = staticmethod(CanReadStream)
2633 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2634 """
2635 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2636
2637 Loads an image from an input stream or a readable Python file-like
2638 object. If no handler type is provided, the library will try to
2639 autodetect the format.
2640 """
d55e5bfc
RD
2641 return _core_.Image_LoadStream(*args, **kwargs)
2642
2643 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2644 """
2645 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2646
2647 Loads an image from an input stream or a readable Python file-like
2648 object, using a MIME type string to specify the image file format.
2649 """
d55e5bfc
RD
2650 return _core_.Image_LoadMimeStream(*args, **kwargs)
2651
2652 def Ok(*args, **kwargs):
7a27cf7c
RD
2653 """
2654 Ok(self) -> bool
2655
2656 Returns true if image data is present.
2657 """
d55e5bfc
RD
2658 return _core_.Image_Ok(*args, **kwargs)
2659
2660 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2661 """
2662 GetWidth(self) -> int
2663
2664 Gets the width of the image in pixels.
2665 """
d55e5bfc
RD
2666 return _core_.Image_GetWidth(*args, **kwargs)
2667
2668 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2669 """
2670 GetHeight(self) -> int
2671
2672 Gets the height of the image in pixels.
2673 """
d55e5bfc
RD
2674 return _core_.Image_GetHeight(*args, **kwargs)
2675
2676 def GetSize(*args, **kwargs):
7a27cf7c
RD
2677 """
2678 GetSize(self) -> Size
2679
2680 Returns the size of the image in pixels.
2681 """
d55e5bfc
RD
2682 return _core_.Image_GetSize(*args, **kwargs)
2683
2684 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2685 """
2686 GetSubImage(self, Rect rect) -> Image
2687
2688 Returns a sub image of the current one as long as the rect belongs
2689 entirely to the image.
2690 """
d55e5bfc
RD
2691 return _core_.Image_GetSubImage(*args, **kwargs)
2692
aff4cc5c 2693 def Size(*args, **kwargs):
7a27cf7c
RD
2694 """
2695 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2696
2697 Returns a resized version of this image without scaling it by adding
2698 either a border with the given colour or cropping as necessary. The
2699 image is pasted into a new image with the given size and background
2700 colour at the position ``pos`` relative to the upper left of the new
2701 image. If red = green = blue = -1 then use either the current mask
2702 colour if set or find, use, and set a suitable mask colour for any
2703 newly exposed areas.
2704 """
aff4cc5c
RD
2705 return _core_.Image_Size(*args, **kwargs)
2706
d55e5bfc 2707 def Copy(*args, **kwargs):
7a27cf7c
RD
2708 """
2709 Copy(self) -> Image
2710
2711 Returns an identical copy of the image.
2712 """
d55e5bfc
RD
2713 return _core_.Image_Copy(*args, **kwargs)
2714
2715 def Paste(*args, **kwargs):
7a27cf7c
RD
2716 """
2717 Paste(self, Image image, int x, int y)
2718
2719 Pastes ``image`` into this instance and takes care of the mask colour
2720 and any out of bounds problems.
2721 """
d55e5bfc
RD
2722 return _core_.Image_Paste(*args, **kwargs)
2723
2724 def GetData(*args, **kwargs):
ea939623
RD
2725 """
2726 GetData(self) -> PyObject
2727
2728 Returns a string containing a copy of the RGB bytes of the image.
2729 """
d55e5bfc
RD
2730 return _core_.Image_GetData(*args, **kwargs)
2731
2732 def SetData(*args, **kwargs):
ea939623
RD
2733 """
2734 SetData(self, buffer data)
2735
2736 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2737 either a string or a buffer object holding the data and the length of
2738 the data must be width*height*3.
2739 """
d55e5bfc
RD
2740 return _core_.Image_SetData(*args, **kwargs)
2741
2742 def GetDataBuffer(*args, **kwargs):
ea939623
RD
2743 """
2744 GetDataBuffer(self) -> PyObject
2745
2746 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2747 image data buffer inside the wx.Image. You need to ensure that you do
2748 not use this buffer object after the image has been destroyed.
ea939623 2749 """
d55e5bfc
RD
2750 return _core_.Image_GetDataBuffer(*args, **kwargs)
2751
2752 def SetDataBuffer(*args, **kwargs):
ea939623
RD
2753 """
2754 SetDataBuffer(self, buffer data)
2755
2756 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2757 object. This can save making an extra copy of the data but you must
2758 ensure that the buffer object lives longer than the wx.Image does.
ea939623 2759 """
d55e5bfc
RD
2760 return _core_.Image_SetDataBuffer(*args, **kwargs)
2761
2762 def GetAlphaData(*args, **kwargs):
ea939623
RD
2763 """
2764 GetAlphaData(self) -> PyObject
2765
2766 Returns a string containing a copy of the alpha bytes of the image.
2767 """
d55e5bfc
RD
2768 return _core_.Image_GetAlphaData(*args, **kwargs)
2769
2770 def SetAlphaData(*args, **kwargs):
ea939623
RD
2771 """
2772 SetAlphaData(self, buffer alpha)
2773
2774 Resets the Image's alpha data from a buffer of bytes. Accepts either
2775 a string or a buffer object holding the data and the length of the
2776 data must be width*height.
2777 """
d55e5bfc
RD
2778 return _core_.Image_SetAlphaData(*args, **kwargs)
2779
2780 def GetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
2781 """
2782 GetAlphaBuffer(self) -> PyObject
2783
2784 Returns a writable Python buffer object that is pointing at the Alpha
2785 data buffer inside the wx.Image. You need to ensure that you do not
2786 use this buffer object after the image has been destroyed.
2787 """
d55e5bfc
RD
2788 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2789
2790 def SetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
2791 """
2792 SetAlphaBuffer(self, buffer alpha)
2793
2794 Sets the internal image alpha pointer to point at a Python buffer
2795 object. This can save making an extra copy of the data but you must
2796 ensure that the buffer object lives as long as the wx.Image does.
2797 """
d55e5bfc
RD
2798 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2799
2800 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2801 """
2802 SetMaskColour(self, byte r, byte g, byte b)
2803
2804 Sets the mask colour for this image (and tells the image to use the
2805 mask).
2806 """
d55e5bfc
RD
2807 return _core_.Image_SetMaskColour(*args, **kwargs)
2808
aff4cc5c
RD
2809 def GetOrFindMaskColour(*args, **kwargs):
2810 """
2811 GetOrFindMaskColour() -> (r,g,b)
2812
2813 Get the current mask colour or find a suitable colour.
2814 """
2815 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2816
d55e5bfc 2817 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2818 """
2819 GetMaskRed(self) -> byte
2820
2821 Gets the red component of the mask colour.
2822 """
d55e5bfc
RD
2823 return _core_.Image_GetMaskRed(*args, **kwargs)
2824
2825 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2826 """
2827 GetMaskGreen(self) -> byte
2828
2829 Gets the green component of the mask colour.
2830 """
d55e5bfc
RD
2831 return _core_.Image_GetMaskGreen(*args, **kwargs)
2832
2833 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2834 """
2835 GetMaskBlue(self) -> byte
2836
2837 Gets the blue component of the mask colour.
2838 """
d55e5bfc
RD
2839 return _core_.Image_GetMaskBlue(*args, **kwargs)
2840
2841 def SetMask(*args, **kwargs):
7a27cf7c
RD
2842 """
2843 SetMask(self, bool mask=True)
2844
2845 Specifies whether there is a mask or not. The area of the mask is
2846 determined by the current mask colour.
2847 """
d55e5bfc
RD
2848 return _core_.Image_SetMask(*args, **kwargs)
2849
2850 def HasMask(*args, **kwargs):
7a27cf7c
RD
2851 """
2852 HasMask(self) -> bool
2853
2854 Returns ``True`` if there is a mask active, ``False`` otherwise.
2855 """
d55e5bfc
RD
2856 return _core_.Image_HasMask(*args, **kwargs)
2857
2858 def Rotate(*args, **kwargs):
2859 """
2860 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2861 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2862
2863 Rotates the image about the given point, by ``angle`` radians. Passing
2864 ``True`` to ``interpolating`` results in better image quality, but is
2865 slower. If the image has a mask, then the mask colour is used for the
2866 uncovered pixels in the rotated image background. Otherwise, black
2867 will be used as the fill colour.
2868
2869 Returns the rotated image, leaving this image intact.
d55e5bfc
RD
2870 """
2871 return _core_.Image_Rotate(*args, **kwargs)
2872
2873 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2874 """
2875 Rotate90(self, bool clockwise=True) -> Image
2876
2877 Returns a copy of the image rotated 90 degrees in the direction
2878 indicated by ``clockwise``.
2879 """
d55e5bfc
RD
2880 return _core_.Image_Rotate90(*args, **kwargs)
2881
2882 def Mirror(*args, **kwargs):
7a27cf7c
RD
2883 """
2884 Mirror(self, bool horizontally=True) -> Image
2885
2886 Returns a mirrored copy of the image. The parameter ``horizontally``
2887 indicates the orientation.
2888 """
d55e5bfc
RD
2889 return _core_.Image_Mirror(*args, **kwargs)
2890
2891 def Replace(*args, **kwargs):
2892 """
7a27cf7c
RD
2893 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2894
2895 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2896 ``(r2,g2,b2)``.
d55e5bfc
RD
2897 """
2898 return _core_.Image_Replace(*args, **kwargs)
2899
7449af73
RD
2900 def ConvertToGreyscale(*args, **kwargs):
2901 """
2902 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2903
2904 Convert to greyscale image. Uses the luminance component (Y) of the
2905 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2906 defaults to ITU-T BT.601
2907 """
2908 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2909
d55e5bfc 2910 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2911 """
2912 ConvertToMono(self, byte r, byte g, byte b) -> Image
2913
2914 Returns monochromatic version of the image. The returned image has
2915 white colour where the original has ``(r,g,b)`` colour and black
2916 colour everywhere else.
2917 """
d55e5bfc
RD
2918 return _core_.Image_ConvertToMono(*args, **kwargs)
2919
2920 def SetOption(*args, **kwargs):
7a27cf7c
RD
2921 """
2922 SetOption(self, String name, String value)
2923
2924 Sets an image handler defined option. For example, when saving as a
2925 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2926 number between 0 and 100 (0 is terrible, 100 is very good).
2927 """
d55e5bfc
RD
2928 return _core_.Image_SetOption(*args, **kwargs)
2929
2930 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2931 """
2932 SetOptionInt(self, String name, int value)
2933
2934 Sets an image option as an integer.
2935 """
d55e5bfc
RD
2936 return _core_.Image_SetOptionInt(*args, **kwargs)
2937
2938 def GetOption(*args, **kwargs):
7a27cf7c
RD
2939 """
2940 GetOption(self, String name) -> String
2941
2942 Gets the value of an image handler option.
2943 """
d55e5bfc
RD
2944 return _core_.Image_GetOption(*args, **kwargs)
2945
2946 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2947 """
2948 GetOptionInt(self, String name) -> int
2949
2950 Gets the value of an image handler option as an integer. If the given
2951 option is not present, the function returns 0.
2952 """
d55e5bfc
RD
2953 return _core_.Image_GetOptionInt(*args, **kwargs)
2954
2955 def HasOption(*args, **kwargs):
7a27cf7c
RD
2956 """
2957 HasOption(self, String name) -> bool
2958
2959 Returns true if the given option is present.
2960 """
d55e5bfc
RD
2961 return _core_.Image_HasOption(*args, **kwargs)
2962
2963 def CountColours(*args, **kwargs):
2964 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2965 return _core_.Image_CountColours(*args, **kwargs)
2966
2967 def ComputeHistogram(*args, **kwargs):
2968 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2969 return _core_.Image_ComputeHistogram(*args, **kwargs)
2970
2971 def AddHandler(*args, **kwargs):
c24da6d6 2972 """AddHandler(ImageHandler handler)"""
d55e5bfc
RD
2973 return _core_.Image_AddHandler(*args, **kwargs)
2974
2975 AddHandler = staticmethod(AddHandler)
2976 def InsertHandler(*args, **kwargs):
c24da6d6 2977 """InsertHandler(ImageHandler handler)"""
d55e5bfc
RD
2978 return _core_.Image_InsertHandler(*args, **kwargs)
2979
2980 InsertHandler = staticmethod(InsertHandler)
2981 def RemoveHandler(*args, **kwargs):
c24da6d6 2982 """RemoveHandler(String name) -> bool"""
d55e5bfc
RD
2983 return _core_.Image_RemoveHandler(*args, **kwargs)
2984
2985 RemoveHandler = staticmethod(RemoveHandler)
554f62e9
RD
2986 def GetHandlers(*args, **kwargs):
2987 """GetHandlers() -> PyObject"""
2988 return _core_.Image_GetHandlers(*args, **kwargs)
2989
2990 GetHandlers = staticmethod(GetHandlers)
d55e5bfc 2991 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2992 """
2993 GetImageExtWildcard() -> String
2994
2995 Iterates all registered wxImageHandler objects, and returns a string
2996 containing file extension masks suitable for passing to file open/save
2997 dialog boxes.
2998 """
d55e5bfc
RD
2999 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
3000
3001 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3002 def ConvertToBitmap(*args, **kwargs):
1fbf26be 3003 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
d55e5bfc
RD
3004 return _core_.Image_ConvertToBitmap(*args, **kwargs)
3005
3006 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 3007 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
d55e5bfc
RD
3008 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
3009
2f91e3df
KO
3010 def RotateHue(*args, **kwargs):
3011 """
3012 RotateHue(self, double angle)
3013
3014 Rotates the hue of each pixel of the image. Hue is a double in the
3015 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3016 """
3017 return _core_.Image_RotateHue(*args, **kwargs)
3018
3019 def RGBtoHSV(*args, **kwargs):
9d7dfdff
RD
3020 """
3021 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3022
3023 Converts a color in RGB color space to HSV color space.
3024 """
2f91e3df
KO
3025 return _core_.Image_RGBtoHSV(*args, **kwargs)
3026
3027 RGBtoHSV = staticmethod(RGBtoHSV)
3028 def HSVtoRGB(*args, **kwargs):
9d7dfdff
RD
3029 """
3030 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3031
3032 Converts a color in HSV color space to RGB color space.
3033 """
2f91e3df
KO
3034 return _core_.Image_HSVtoRGB(*args, **kwargs)
3035
3036 HSVtoRGB = staticmethod(HSVtoRGB)
d55e5bfc 3037 def __nonzero__(self): return self.Ok()
97ab0f6a
RD
3038 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
3039 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
3040 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
3041 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
3042 Height = property(GetHeight,doc="See `GetHeight`")
3043 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
3044 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
3045 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
3046 Size = property(GetSize,doc="See `GetSize`")
3047 Width = property(GetWidth,doc="See `GetWidth`")
2131d850 3048_core_.Image_swigregister(Image)
d55e5bfc
RD
3049
3050def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
3051 """
3052 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3053
3054 Loads an image from a file, using a MIME type string (such as
3055 'image/jpeg') to specify image type.
3056 """
d55e5bfc 3057 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
3058 return val
3059
3060def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
3061 """
3062 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3063
3064 Loads an image from an input stream, or any readable Python file-like
3065 object.
3066 """
d55e5bfc 3067 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
3068 return val
3069
3070def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
3071 """
3072 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3073
3074 Loads an image from an input stream, or any readable Python file-like
3075 object, specifying the image format with a MIME type string.
3076 """
d55e5bfc 3077 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
3078 return val
3079
c24da6d6 3080def EmptyImage(*args, **kwargs):
ea939623
RD
3081 """
3082 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3083
3084 Construct an empty image of a given size, optionally setting all
3085 pixels to black.
3086 """
c24da6d6 3087 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
3088 return val
3089
3090def ImageFromBitmap(*args, **kwargs):
ea939623
RD
3091 """
3092 ImageFromBitmap(Bitmap bitmap) -> Image
3093
3094 Construct an Image from a `wx.Bitmap`.
3095 """
d55e5bfc 3096 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
3097 return val
3098
3099def ImageFromData(*args, **kwargs):
ea939623
RD
3100 """
3101 ImageFromData(int width, int height, buffer data) -> Image
3102
3103 Construct an Image from a buffer of RGB bytes. Accepts either a
3104 string or a buffer object holding the data and the length of the data
3105 must be width*height*3.
3106 """
d55e5bfc 3107 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
3108 return val
3109
c9c2cf70 3110def ImageFromDataWithAlpha(*args, **kwargs):
ea939623
RD
3111 """
3112 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3113
3114 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3115 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
3116 length of the data must be width*height*3 bytes, and the length of the
3117 alpha data must be width*height bytes.
ea939623 3118 """
c9c2cf70 3119 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
c9c2cf70
RD
3120 return val
3121
d55e5bfc 3122def Image_CanRead(*args, **kwargs):
554f62e9 3123 """
7a27cf7c
RD
3124 Image_CanRead(String filename) -> bool
3125
3126 Returns True if the image handlers can read this file.
3127 """
554f62e9 3128 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
RD
3129
3130def Image_GetImageCount(*args, **kwargs):
554f62e9 3131 """
7a27cf7c
RD
3132 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3133
3134 If the image file contains more than one image and the image handler
3135 is capable of retrieving these individually, this function will return
3136 the number of available images.
3137 """
554f62e9 3138 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
RD
3139
3140def Image_CanReadStream(*args, **kwargs):
554f62e9 3141 """
7a27cf7c
RD
3142 Image_CanReadStream(InputStream stream) -> bool
3143
3144 Returns True if the image handlers can read an image file from the
3145 data currently on the input stream, or a readable Python file-like
3146 object.
3147 """
554f62e9 3148 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
RD
3149
3150def Image_AddHandler(*args, **kwargs):
554f62e9
RD
3151 """Image_AddHandler(ImageHandler handler)"""
3152 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
3153
3154def Image_InsertHandler(*args, **kwargs):
554f62e9
RD
3155 """Image_InsertHandler(ImageHandler handler)"""
3156 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
3157
3158def Image_RemoveHandler(*args, **kwargs):
554f62e9
RD
3159 """Image_RemoveHandler(String name) -> bool"""
3160 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 3161
554f62e9
RD
3162def Image_GetHandlers(*args):
3163 """Image_GetHandlers() -> PyObject"""
3164 return _core_.Image_GetHandlers(*args)
3165
3166def Image_GetImageExtWildcard(*args):
3167 """
7a27cf7c
RD
3168 Image_GetImageExtWildcard() -> String
3169
3170 Iterates all registered wxImageHandler objects, and returns a string
3171 containing file extension masks suitable for passing to file open/save
3172 dialog boxes.
3173 """
554f62e9 3174 return _core_.Image_GetImageExtWildcard(*args)
d55e5bfc 3175
2f91e3df 3176def Image_RGBtoHSV(*args, **kwargs):
554f62e9 3177 """
9d7dfdff
RD
3178 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3179
3180 Converts a color in RGB color space to HSV color space.
3181 """
554f62e9 3182 return _core_.Image_RGBtoHSV(*args, **kwargs)
2f91e3df
KO
3183
3184def Image_HSVtoRGB(*args, **kwargs):
554f62e9 3185 """
9d7dfdff
RD
3186 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3187
3188 Converts a color in HSV color space to RGB color space.
3189 """
554f62e9 3190 return _core_.Image_HSVtoRGB(*args, **kwargs)
2f91e3df 3191
fc46b7f3
RD
3192
3193def _ImageFromBuffer(*args, **kwargs):
3194 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3195 return _core_._ImageFromBuffer(*args, **kwargs)
3196def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3197 """
3198 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
eec1c382
RD
3199 parameter must be a Python object that implements the buffer interface,
3200 such as a string, array, etc. The dataBuffer object is expected to
3201 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3202 object can optionally be supplied for the image's alpha channel data, and
3203 it is expected to be width*height bytes long.
fc46b7f3
RD
3204
3205 The wx.Image will be created with its data and alpha pointers initialized
3206 to the memory address pointed to by the buffer objects, thus saving the
3207 time needed to copy the image data from the buffer object to the wx.Image.
3208 While this has advantages, it also has the shoot-yourself-in-the-foot
3209 risks associated with sharing a C pointer between two objects.
3210
3211 To help alleviate the risk a reference to the data and alpha buffer
3212 objects are kept with the wx.Image, so that they won't get deleted until
3213 after the wx.Image is deleted. However please be aware that it is not
3214 guaranteed that an object won't move its memory buffer to a new location
3215 when it needs to resize its contents. If that happens then the wx.Image
3216 will end up referring to an invalid memory location and could cause the
3217 application to crash. Therefore care should be taken to not manipulate
3218 the objects used for the data and alpha buffers in a way that would cause
3219 them to change size.
3220 """
fc46b7f3
RD
3221 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3222 image._buffer = dataBuffer
3223 image._alpha = alphaBuffer
3224 return image
3225
a07a67e6
RD
3226def InitAllImageHandlers():
3227 """
3228 The former functionality of InitAllImageHanders is now done internal to
3229 the _core_ extension module and so this function has become a simple NOP.
3230 """
3231 pass
d55e5bfc 3232
d55e5bfc
RD
3233IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3234IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
3235PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3236PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3237PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
d55e5bfc
RD
3238BMP_24BPP = _core_.BMP_24BPP
3239BMP_8BPP = _core_.BMP_8BPP
3240BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3241BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3242BMP_8BPP_RED = _core_.BMP_8BPP_RED
3243BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3244BMP_4BPP = _core_.BMP_4BPP
3245BMP_1BPP = _core_.BMP_1BPP
3246BMP_1BPP_BW = _core_.BMP_1BPP_BW
3247class BMPHandler(ImageHandler):
27fb7603 3248 """A `wx.ImageHandler` for \*.bmp bitmap files."""
554f62e9
RD
3249 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3250 __repr__ = _swig_repr
3251 def __init__(self, *args, **kwargs):
27fb7603
RD
3252 """
3253 __init__(self) -> BMPHandler
3254
3255 A `wx.ImageHandler` for \*.bmp bitmap files.
3256 """
554f62e9 3257 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3258_core_.BMPHandler_swigregister(BMPHandler)
d55e5bfc 3259NullImage = cvar.NullImage
68350608 3260IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3261IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3262IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3263IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3264IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3265IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3266IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3267IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3268IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3269IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3270IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3271IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3272IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
3273IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3274IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc
RD
3275
3276class ICOHandler(BMPHandler):
27fb7603 3277 """A `wx.ImageHandler` for \*.ico icon files."""
554f62e9
RD
3278 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3279 __repr__ = _swig_repr
3280 def __init__(self, *args, **kwargs):
27fb7603
RD
3281 """
3282 __init__(self) -> ICOHandler
3283
3284 A `wx.ImageHandler` for \*.ico icon files.
3285 """
554f62e9 3286 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3287_core_.ICOHandler_swigregister(ICOHandler)
d55e5bfc
RD
3288
3289class CURHandler(ICOHandler):
27fb7603 3290 """A `wx.ImageHandler` for \*.cur cursor files."""
554f62e9
RD
3291 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3292 __repr__ = _swig_repr
3293 def __init__(self, *args, **kwargs):
27fb7603
RD
3294 """
3295 __init__(self) -> CURHandler
3296
3297 A `wx.ImageHandler` for \*.cur cursor files.
3298 """
554f62e9 3299 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3300_core_.CURHandler_swigregister(CURHandler)
d55e5bfc
RD
3301
3302class ANIHandler(CURHandler):
27fb7603 3303 """A `wx.ImageHandler` for \*.ani animated cursor files."""
554f62e9
RD
3304 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3305 __repr__ = _swig_repr
3306 def __init__(self, *args, **kwargs):
27fb7603
RD
3307 """
3308 __init__(self) -> ANIHandler
3309
3310 A `wx.ImageHandler` for \*.ani animated cursor files.
3311 """
554f62e9 3312 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3313_core_.ANIHandler_swigregister(ANIHandler)
d55e5bfc
RD
3314
3315class PNGHandler(ImageHandler):
27fb7603 3316 """A `wx.ImageHandler` for PNG image files."""
554f62e9
RD
3317 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3318 __repr__ = _swig_repr
3319 def __init__(self, *args, **kwargs):
27fb7603
RD
3320 """
3321 __init__(self) -> PNGHandler
3322
3323 A `wx.ImageHandler` for PNG image files.
3324 """
554f62e9 3325 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3326_core_.PNGHandler_swigregister(PNGHandler)
d55e5bfc
RD
3327
3328class GIFHandler(ImageHandler):
27fb7603 3329 """A `wx.ImageHandler` for GIF image files."""
554f62e9
RD
3330 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3331 __repr__ = _swig_repr
3332 def __init__(self, *args, **kwargs):
27fb7603
RD
3333 """
3334 __init__(self) -> GIFHandler
3335
3336 A `wx.ImageHandler` for GIF image files.
3337 """
554f62e9 3338 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3339_core_.GIFHandler_swigregister(GIFHandler)
d55e5bfc
RD
3340
3341class PCXHandler(ImageHandler):
27fb7603 3342 """A `wx.ImageHandler` for PCX imager files."""
554f62e9
RD
3343 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3344 __repr__ = _swig_repr
3345 def __init__(self, *args, **kwargs):
27fb7603
RD
3346 """
3347 __init__(self) -> PCXHandler
3348
3349 A `wx.ImageHandler` for PCX imager files.
3350 """
554f62e9 3351 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3352_core_.PCXHandler_swigregister(PCXHandler)
d55e5bfc
RD
3353
3354class JPEGHandler(ImageHandler):
27fb7603 3355 """A `wx.ImageHandler` for JPEG/JPG image files."""
554f62e9
RD
3356 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3357 __repr__ = _swig_repr
3358 def __init__(self, *args, **kwargs):
27fb7603
RD
3359 """
3360 __init__(self) -> JPEGHandler
3361
3362 A `wx.ImageHandler` for JPEG/JPG image files.
3363 """
554f62e9 3364 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3365_core_.JPEGHandler_swigregister(JPEGHandler)
d55e5bfc
RD
3366
3367class PNMHandler(ImageHandler):
27fb7603 3368 """A `wx.ImageHandler` for PNM image files."""
554f62e9
RD
3369 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3370 __repr__ = _swig_repr
3371 def __init__(self, *args, **kwargs):
27fb7603
RD
3372 """
3373 __init__(self) -> PNMHandler
3374
3375 A `wx.ImageHandler` for PNM image files.
3376 """
554f62e9 3377 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3378_core_.PNMHandler_swigregister(PNMHandler)
d55e5bfc
RD
3379
3380class XPMHandler(ImageHandler):
27fb7603 3381 """A `wx.ImageHandler` for XPM image."""
554f62e9
RD
3382 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3383 __repr__ = _swig_repr
3384 def __init__(self, *args, **kwargs):
27fb7603
RD
3385 """
3386 __init__(self) -> XPMHandler
3387
3388 A `wx.ImageHandler` for XPM image.
3389 """
554f62e9 3390 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3391_core_.XPMHandler_swigregister(XPMHandler)
d55e5bfc
RD
3392
3393class TIFFHandler(ImageHandler):
27fb7603 3394 """A `wx.ImageHandler` for TIFF image files."""
554f62e9
RD
3395 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3396 __repr__ = _swig_repr
3397 def __init__(self, *args, **kwargs):
27fb7603
RD
3398 """
3399 __init__(self) -> TIFFHandler
3400
3401 A `wx.ImageHandler` for TIFF image files.
3402 """
554f62e9 3403 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3404_core_.TIFFHandler_swigregister(TIFFHandler)
d55e5bfc 3405
c0de73ae
RD
3406QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3407QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3408class Quantize(object):
3409 """Performs quantization, or colour reduction, on a wxImage."""
554f62e9
RD
3410 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3411 def __init__(self): raise AttributeError, "No constructor defined"
3412 __repr__ = _swig_repr
c0de73ae
RD
3413 def Quantize(*args, **kwargs):
3414 """
3415 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3416
3417 Reduce the colours in the source image and put the result into the
3418 destination image, setting the palette in the destination if
3419 needed. Both images may be the same, to overwrite the source image.
3420 """
3421 return _core_.Quantize_Quantize(*args, **kwargs)
3422
3423 Quantize = staticmethod(Quantize)
2131d850 3424_core_.Quantize_swigregister(Quantize)
c0de73ae
RD
3425
3426def Quantize_Quantize(*args, **kwargs):
554f62e9 3427 """
c0de73ae
RD
3428 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3429
3430 Reduce the colours in the source image and put the result into the
3431 destination image, setting the palette in the destination if
3432 needed. Both images may be the same, to overwrite the source image.
3433 """
554f62e9 3434 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3435
d55e5bfc
RD
3436#---------------------------------------------------------------------------
3437
3438class EvtHandler(Object):
093d3ff1 3439 """Proxy of C++ EvtHandler class"""
554f62e9
RD
3440 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3441 __repr__ = _swig_repr
3442 def __init__(self, *args, **kwargs):
d55e5bfc 3443 """__init__(self) -> EvtHandler"""
554f62e9 3444 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d49bdf34
RD
3445 self._setOORInfo(self)
3446
d55e5bfc
RD
3447 def GetNextHandler(*args, **kwargs):
3448 """GetNextHandler(self) -> EvtHandler"""
3449 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3450
3451 def GetPreviousHandler(*args, **kwargs):
3452 """GetPreviousHandler(self) -> EvtHandler"""
3453 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3454
3455 def SetNextHandler(*args, **kwargs):
3456 """SetNextHandler(self, EvtHandler handler)"""
3457 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3458
3459 def SetPreviousHandler(*args, **kwargs):
3460 """SetPreviousHandler(self, EvtHandler handler)"""
3461 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3462
3463 def GetEvtHandlerEnabled(*args, **kwargs):
3464 """GetEvtHandlerEnabled(self) -> bool"""
3465 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3466
3467 def SetEvtHandlerEnabled(*args, **kwargs):
3468 """SetEvtHandlerEnabled(self, bool enabled)"""
3469 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3470
3471 def ProcessEvent(*args, **kwargs):
3472 """ProcessEvent(self, Event event) -> bool"""
3473 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3474
3475 def AddPendingEvent(*args, **kwargs):
3476 """AddPendingEvent(self, Event event)"""
3477 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3478
3479 def ProcessPendingEvents(*args, **kwargs):
3480 """ProcessPendingEvents(self)"""
3481 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3482
3483 def Connect(*args, **kwargs):
3484 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3485 return _core_.EvtHandler_Connect(*args, **kwargs)
3486
3487 def Disconnect(*args, **kwargs):
f460c29d 3488 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
d55e5bfc
RD
3489 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3490
3491 def _setOORInfo(*args, **kwargs):
093d3ff1 3492 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3493 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3494 args[0].thisown = 0
3495 return val
d55e5bfc
RD
3496
3497 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3498 """
3499 Bind an event to an event handler.
3500
caef1a4d
RD
3501 :param event: One of the EVT_* objects that specifies the
3502 type of event to bind,
d55e5bfc 3503
caef1a4d
RD
3504 :param handler: A callable object to be invoked when the
3505 event is delivered to self. Pass None to
3506 disconnect an event handler.
d55e5bfc 3507
caef1a4d
RD
3508 :param source: Sometimes the event originates from a
3509 different window than self, but you still
3510 want to catch it in self. (For example, a
3511 button event delivered to a frame.) By
3512 passing the source of the event, the event
3513 handling system is able to differentiate
3514 between the same event type from different
3515 controls.
d55e5bfc 3516
caef1a4d
RD
3517 :param id: Used to spcify the event source by ID instead
3518 of instance.
3519
3520 :param id2: Used when it is desirable to bind a handler
3521 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3522 """
3523 if source is not None:
3524 id = source.GetId()
3525 event.Bind(self, id, id2, handler)
3526
c24da6d6
RD
3527 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3528 """
3529 Disconencts the event handler binding for event from self.
3530 Returns True if successful.
3531 """
3532 if source is not None:
3533 id = source.GetId()
3534 return event.Unbind(self, id, id2)
d55e5bfc 3535
97ab0f6a
RD
3536 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3537 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3538 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
2131d850 3539_core_.EvtHandler_swigregister(EvtHandler)
d55e5bfc
RD
3540
3541#---------------------------------------------------------------------------
3542
3543class PyEventBinder(object):
3544 """
3545 Instances of this class are used to bind specific events to event
3546 handlers.
3547 """
3548 def __init__(self, evtType, expectedIDs=0):
3549 if expectedIDs not in [0, 1, 2]:
3550 raise ValueError, "Invalid number of expectedIDs"
3551 self.expectedIDs = expectedIDs
3552
3553 if type(evtType) == list or type(evtType) == tuple:
3554 self.evtType = evtType
3555 else:
3556 self.evtType = [evtType]
3557
3558
3559 def Bind(self, target, id1, id2, function):
3560 """Bind this set of event types to target."""
3561 for et in self.evtType:
3562 target.Connect(id1, id2, et, function)
3563
c24da6d6
RD
3564
3565 def Unbind(self, target, id1, id2):
3566 """Remove an event binding."""
3567 success = 0
3568 for et in self.evtType:
3569 success += target.Disconnect(id1, id2, et)
3570 return success != 0
3571
d55e5bfc
RD
3572
3573 def __call__(self, *args):
3574 """
3575 For backwards compatibility with the old EVT_* functions.
3576 Should be called with either (window, func), (window, ID,
3577 func) or (window, ID1, ID2, func) parameters depending on the
3578 type of the event.
3579 """
3580 assert len(args) == 2 + self.expectedIDs
3581 id1 = wx.ID_ANY
3582 id2 = wx.ID_ANY
3583 target = args[0]
3584 if self.expectedIDs == 0:
3585 func = args[1]
3586 elif self.expectedIDs == 1:
3587 id1 = args[1]
3588 func = args[2]
3589 elif self.expectedIDs == 2:
3590 id1 = args[1]
3591 id2 = args[2]
3592 func = args[3]
3593 else:
3594 raise ValueError, "Unexpected number of IDs"
3595
3596 self.Bind(target, id1, id2, func)
3597
3598
3599# These two are square pegs that don't fit the PyEventBinder hole...
3600def EVT_COMMAND(win, id, cmd, func):
3601 win.Connect(id, -1, cmd, func)
3602def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3603 win.Connect(id1, id2, cmd, func)
3604
3605
3606#---------------------------------------------------------------------------
3607
3608#---------------------------------------------------------------------------
3609
3610EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3611EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3612
554f62e9 3613def NewEventType(*args):
f460c29d 3614 """NewEventType() -> EventType"""
554f62e9 3615 return _core_.NewEventType(*args)
d55e5bfc
RD
3616wxEVT_NULL = _core_.wxEVT_NULL
3617wxEVT_FIRST = _core_.wxEVT_FIRST
3618wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3619wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3620wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3621wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3622wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3623wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3624wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3625wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3626wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3627wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3628wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3629wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3630wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3631wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3632wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3633wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3634wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3635wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3636wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3637wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3638wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3639wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3640wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3641wxEVT_MOTION = _core_.wxEVT_MOTION
3642wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3643wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3644wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3645wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3646wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3647wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3648wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3649wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3650wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3651wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3652wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3653wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3654wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3655wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3656wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3657wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3658wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3659wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3660wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3661wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3662wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3663wxEVT_CHAR = _core_.wxEVT_CHAR
3664wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3665wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3666wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3667wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3668wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3669wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3670wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3671wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3672wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3673wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3674wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3675wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3676wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3677wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
db67f999
RD
3678wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3679wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
d55e5bfc
RD
3680wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3681wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3682wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3683wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3684wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3685wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3686wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3687wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3688wxEVT_SIZE = _core_.wxEVT_SIZE
3689wxEVT_MOVE = _core_.wxEVT_MOVE
3690wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3691wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3692wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3693wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
d55e5bfc
RD
3694wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3695wxEVT_CREATE = _core_.wxEVT_CREATE
3696wxEVT_DESTROY = _core_.wxEVT_DESTROY
3697wxEVT_SHOW = _core_.wxEVT_SHOW
3698wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3699wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3700wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
0f83f5da 3701wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
d55e5bfc
RD
3702wxEVT_PAINT = _core_.wxEVT_PAINT
3703wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3704wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3705wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3706wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3707wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3708wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3709wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3710wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3711wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3712wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3713wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3714wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3715wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3716wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3717wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3718wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3719wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3720wxEVT_IDLE = _core_.wxEVT_IDLE
3721wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3722wxEVT_SIZING = _core_.wxEVT_SIZING
3723wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 3724wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
3725wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3726wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3727wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
d55e5bfc
RD
3728wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3729wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3730wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3731wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3732wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3733wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3734wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3735#
3736# Create some event binders
3737EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3738EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3739EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3740EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3741EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3742EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3743EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3744EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3745EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3746EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3747EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3748EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3749EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 3750EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d55e5bfc
RD
3751EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3752EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3753EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3754EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3755EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3756EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3757EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3758EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3759EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3760EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 3761EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3762EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3763EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3764EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3765EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3766EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3767EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3768EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3769EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3770EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3771EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3772EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3773EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3774EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3775EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3776EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3777EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
0f83f5da 3778EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
d55e5bfc
RD
3779
3780EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3781EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3782EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3783EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3784EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3785EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3786EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3787EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3788EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3789EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3790EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3791EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3792EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3793
3794EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3795 wxEVT_LEFT_UP,
3796 wxEVT_MIDDLE_DOWN,
3797 wxEVT_MIDDLE_UP,
3798 wxEVT_RIGHT_DOWN,
3799 wxEVT_RIGHT_UP,
3800 wxEVT_MOTION,
3801 wxEVT_LEFT_DCLICK,
3802 wxEVT_MIDDLE_DCLICK,
3803 wxEVT_RIGHT_DCLICK,
3804 wxEVT_ENTER_WINDOW,
3805 wxEVT_LEAVE_WINDOW,
3806 wxEVT_MOUSEWHEEL
3807 ])
3808
3809
3810# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 3811EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d55e5bfc
RD
3812 wxEVT_SCROLLWIN_BOTTOM,
3813 wxEVT_SCROLLWIN_LINEUP,
3814 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 3815 wxEVT_SCROLLWIN_PAGEUP,
d55e5bfc
RD
3816 wxEVT_SCROLLWIN_PAGEDOWN,
3817 wxEVT_SCROLLWIN_THUMBTRACK,
3818 wxEVT_SCROLLWIN_THUMBRELEASE,
3819 ])
3820
3821EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3822EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3823EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3824EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3825EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3826EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3827EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3828EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3829
27fb7603 3830# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
3831EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3832 wxEVT_SCROLL_BOTTOM,
3833 wxEVT_SCROLL_LINEUP,
3834 wxEVT_SCROLL_LINEDOWN,
3835 wxEVT_SCROLL_PAGEUP,
3836 wxEVT_SCROLL_PAGEDOWN,
3837 wxEVT_SCROLL_THUMBTRACK,
3838 wxEVT_SCROLL_THUMBRELEASE,
db67f999 3839 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3840 ])
3841
3842EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3843EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3844EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3845EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3846EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3847EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3848EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3849EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
db67f999
RD
3850EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3851EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 3852
27fb7603 3853# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
3854EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3855 wxEVT_SCROLL_BOTTOM,
3856 wxEVT_SCROLL_LINEUP,
3857 wxEVT_SCROLL_LINEDOWN,
3858 wxEVT_SCROLL_PAGEUP,
3859 wxEVT_SCROLL_PAGEDOWN,
3860 wxEVT_SCROLL_THUMBTRACK,
d55e5bfc 3861 wxEVT_SCROLL_THUMBRELEASE,
db67f999 3862 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3863 ], 1)
3864
3865EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3866EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3867EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3868EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3869EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3870EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3871EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3872EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
db67f999
RD
3873EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3874EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
3875
3876EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3877EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3878EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3879EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3880EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3881EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3882EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3883EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3884EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3885EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3886
3887EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3888EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3889EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3890EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3891EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3892EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3893EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3894EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3895EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3896
3897
3898EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3899EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3900EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3901EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3902EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3903EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3904EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3905
3906EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3907
3908EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3909EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3910
3911EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3912
2131d850
RD
3913EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3914EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3915EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d55e5bfc
RD
3916
3917
3918#---------------------------------------------------------------------------
3919
3920class Event(Object):
27fb7603
RD
3921 """
3922 An event is a structure holding information about an event passed to a
3923 callback or member function. wx.Event is an abstract base class for
3924 other event classes
3925 """
554f62e9
RD
3926 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3927 def __init__(self): raise AttributeError, "No constructor defined"
3928 __repr__ = _swig_repr
3929 __swig_destroy__ = _core_.delete_Event
3930 __del__ = lambda self : None;
d55e5bfc 3931 def SetEventType(*args, **kwargs):
27fb7603 3932 """
f460c29d 3933 SetEventType(self, EventType typ)
27fb7603
RD
3934
3935 Sets the specific type of the event.
3936 """
d55e5bfc
RD
3937 return _core_.Event_SetEventType(*args, **kwargs)
3938
3939 def GetEventType(*args, **kwargs):
27fb7603 3940 """
f460c29d 3941 GetEventType(self) -> EventType
27fb7603
RD
3942
3943 Returns the identifier of the given event type, such as
3944 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3945 """
d55e5bfc
RD
3946 return _core_.Event_GetEventType(*args, **kwargs)
3947
3948 def GetEventObject(*args, **kwargs):
27fb7603
RD
3949 """
3950 GetEventObject(self) -> Object
3951
3952 Returns the object (usually a window) associated with the event, if
3953 any.
3954 """
d55e5bfc
RD
3955 return _core_.Event_GetEventObject(*args, **kwargs)
3956
3957 def SetEventObject(*args, **kwargs):
27fb7603
RD
3958 """
3959 SetEventObject(self, Object obj)
3960
3961 Sets the originating object, or in other words, obj is normally the
3962 object that is sending the event.
3963 """
d55e5bfc
RD
3964 return _core_.Event_SetEventObject(*args, **kwargs)
3965
3966 def GetTimestamp(*args, **kwargs):
3967 """GetTimestamp(self) -> long"""
3968 return _core_.Event_GetTimestamp(*args, **kwargs)
3969
3970 def SetTimestamp(*args, **kwargs):
3971 """SetTimestamp(self, long ts=0)"""
3972 return _core_.Event_SetTimestamp(*args, **kwargs)
3973
3974 def GetId(*args, **kwargs):
27fb7603
RD
3975 """
3976 GetId(self) -> int
3977
3978 Returns the identifier associated with this event, such as a button
3979 command id.
3980 """
d55e5bfc
RD
3981 return _core_.Event_GetId(*args, **kwargs)
3982
3983 def SetId(*args, **kwargs):
27fb7603
RD
3984 """
3985 SetId(self, int Id)
3986
3987 Set's the ID for the event. This is usually the ID of the window that
3988 is sending the event, but it can also be a command id from a menu
3989 item, etc.
3990 """
d55e5bfc
RD
3991 return _core_.Event_SetId(*args, **kwargs)
3992
3993 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
3994 """
3995 IsCommandEvent(self) -> bool
3996
3997 Returns true if the event is or is derived from `wx.CommandEvent` else
3998 it returns false. Note: Exists only for optimization purposes.
3999 """
d55e5bfc
RD
4000 return _core_.Event_IsCommandEvent(*args, **kwargs)
4001
4002 def Skip(*args, **kwargs):
51b83b37
RD
4003 """
4004 Skip(self, bool skip=True)
4005
4006 Called by an event handler, it controls whether additional event
4007 handlers bound to this event will be called after the current event
4008 handler returns. Skip(false) (the default setting) will prevent
4009 additional event handlers from being called and control will be
4010 returned to the sender of the event immediately after the current
4011 handler has finished. Skip(True) will cause the event processing
4012 system to continue searching for a handler function for this event.
4013
4014 """
d55e5bfc
RD
4015 return _core_.Event_Skip(*args, **kwargs)
4016
4017 def GetSkipped(*args, **kwargs):
27fb7603
RD
4018 """
4019 GetSkipped(self) -> bool
4020
4021 Returns true if the event handler should be skipped, false otherwise.
4022 :see: `Skip`
4023 """
d55e5bfc
RD
4024 return _core_.Event_GetSkipped(*args, **kwargs)
4025
4026 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
4027 """
4028 ShouldPropagate(self) -> bool
4029
4030 Test if this event should be propagated to the parent window or not,
4031 i.e. if the propagation level is currently greater than 0.
4032 """
d55e5bfc
RD
4033 return _core_.Event_ShouldPropagate(*args, **kwargs)
4034
4035 def StopPropagation(*args, **kwargs):
27fb7603
RD
4036 """
4037 StopPropagation(self) -> int
4038
4039 Stop the event from propagating to its parent window. Returns the old
4040 propagation level value which may be later passed to
4041 `ResumePropagation` to allow propagating the event again.
4042 """
d55e5bfc
RD
4043 return _core_.Event_StopPropagation(*args, **kwargs)
4044
4045 def ResumePropagation(*args, **kwargs):
27fb7603
RD
4046 """
4047 ResumePropagation(self, int propagationLevel)
4048
4049 Resume the event propagation by restoring the propagation level. (For
4050 example, you can use the value returned by an earlier call to
4051 `StopPropagation`.)
4052
4053 """
d55e5bfc
RD
4054 return _core_.Event_ResumePropagation(*args, **kwargs)
4055
4056 def Clone(*args, **kwargs):
4057 """Clone(self) -> Event"""
4058 return _core_.Event_Clone(*args, **kwargs)
4059
97ab0f6a
RD
4060 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
4061 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
4062 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
4063 Skipped = property(GetSkipped,doc="See `GetSkipped`")
4064 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
2131d850 4065_core_.Event_swigregister(Event)
d55e5bfc
RD
4066
4067#---------------------------------------------------------------------------
4068
4069class PropagationDisabler(object):
27fb7603
RD
4070 """
4071 Helper class to temporarily change an event not to propagate. Simply
4072 create an instance of this class and then whe it is destroyed the
4073 propogation of the event will be restored.
4074 """
554f62e9
RD
4075 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4076 __repr__ = _swig_repr
4077 def __init__(self, *args, **kwargs):
27fb7603
RD
4078 """
4079 __init__(self, Event event) -> PropagationDisabler
4080
4081 Helper class to temporarily change an event not to propagate. Simply
4082 create an instance of this class and then whe it is destroyed the
4083 propogation of the event will be restored.
4084 """
554f62e9
RD
4085 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
4086 __swig_destroy__ = _core_.delete_PropagationDisabler
4087 __del__ = lambda self : None;
2131d850 4088_core_.PropagationDisabler_swigregister(PropagationDisabler)
d55e5bfc
RD
4089
4090class PropagateOnce(object):
27fb7603
RD
4091 """
4092 A helper class that will temporarily lower propagation level of an
4093 event. Simply create an instance of this class and then whe it is
4094 destroyed the propogation of the event will be restored.
4095 """
554f62e9
RD
4096 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4097 __repr__ = _swig_repr
4098 def __init__(self, *args, **kwargs):
27fb7603
RD
4099 """
4100 __init__(self, Event event) -> PropagateOnce
4101
4102 A helper class that will temporarily lower propagation level of an
4103 event. Simply create an instance of this class and then whe it is
4104 destroyed the propogation of the event will be restored.
4105 """
554f62e9
RD
4106 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4107 __swig_destroy__ = _core_.delete_PropagateOnce
4108 __del__ = lambda self : None;
2131d850 4109_core_.PropagateOnce_swigregister(PropagateOnce)
d55e5bfc
RD
4110
4111#---------------------------------------------------------------------------
4112
4113class CommandEvent(Event):
27fb7603
RD
4114 """
4115 This event class contains information about command events, which
4116 originate from a variety of simple controls, as well as menus and
4117 toolbars.
4118 """
554f62e9
RD
4119 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4120 __repr__ = _swig_repr
4121 def __init__(self, *args, **kwargs):
27fb7603 4122 """
f460c29d 4123 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
4124
4125 This event class contains information about command events, which
4126 originate from a variety of simple controls, as well as menus and
4127 toolbars.
4128 """
554f62e9 4129 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
d55e5bfc 4130 def GetSelection(*args, **kwargs):
27fb7603
RD
4131 """
4132 GetSelection(self) -> int
4133
4134 Returns item index for a listbox or choice selection event (not valid
4135 for a deselection).
4136 """
d55e5bfc
RD
4137 return _core_.CommandEvent_GetSelection(*args, **kwargs)
4138
4139 def SetString(*args, **kwargs):
4140 """SetString(self, String s)"""
4141 return _core_.CommandEvent_SetString(*args, **kwargs)
4142
4143 def GetString(*args, **kwargs):
27fb7603
RD
4144 """
4145 GetString(self) -> String
4146
4147 Returns item string for a listbox or choice selection event (not valid
4148 for a deselection).
4149 """
d55e5bfc
RD
4150 return _core_.CommandEvent_GetString(*args, **kwargs)
4151
4152 def IsChecked(*args, **kwargs):
27fb7603
RD
4153 """
4154 IsChecked(self) -> bool
4155
4156 This method can be used with checkbox and menu events: for the
4157 checkboxes, the method returns true for a selection event and false
4158 for a deselection one. For the menu events, this method indicates if
4159 the menu item just has become checked or unchecked (and thus only
4160 makes sense for checkable menu items).
4161 """
d55e5bfc
RD
4162 return _core_.CommandEvent_IsChecked(*args, **kwargs)
4163
4164 Checked = IsChecked
4165 def IsSelection(*args, **kwargs):
27fb7603
RD
4166 """
4167 IsSelection(self) -> bool
4168
4169 For a listbox or similar event, returns true if it is a selection,
4170 false if it is a deselection.
4171 """
d55e5bfc
RD
4172 return _core_.CommandEvent_IsSelection(*args, **kwargs)
4173
4174 def SetExtraLong(*args, **kwargs):
4175 """SetExtraLong(self, long extraLong)"""
4176 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
4177
4178 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4179 """
4180 GetExtraLong(self) -> long
4181
5ba5649b
RD
4182 Returns extra information dependant on the event objects type. If the
4183 event comes from a listbox selection, it is a boolean determining
4184 whether the event was a selection (true) or a deselection (false). A
4185 listbox deselection only occurs for multiple-selection boxes, and in
4186 this case the index and string values are indeterminate and the
4187 listbox must be examined by the application.
27fb7603 4188 """
d55e5bfc
RD
4189 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
4190
4191 def SetInt(*args, **kwargs):
4192 """SetInt(self, int i)"""
4193 return _core_.CommandEvent_SetInt(*args, **kwargs)
4194
4195 def GetInt(*args, **kwargs):
27fb7603 4196 """
f460c29d 4197 GetInt(self) -> int
27fb7603 4198
5ba5649b
RD
4199 Returns the integer identifier corresponding to a listbox, choice or
4200 radiobox selection (only if the event was a selection, not a
4201 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4202 """
d55e5bfc
RD
4203 return _core_.CommandEvent_GetInt(*args, **kwargs)
4204
554f62e9
RD
4205 def GetClientData(*args, **kwargs):
4206 """
4207 GetClientData(self) -> PyObject
4208
4209 Returns the client data object for a listbox or choice selection event, (if any.)
4210 """
4211 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4212
4213 def SetClientData(*args, **kwargs):
4214 """
4215 SetClientData(self, PyObject clientData)
4216
4217 Associate the given client data with the item at position n.
4218 """
4219 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4220
4221 GetClientObject = GetClientData
4222 SetClientObject = SetClientData
4223
d55e5bfc
RD
4224 def Clone(*args, **kwargs):
4225 """Clone(self) -> Event"""
4226 return _core_.CommandEvent_Clone(*args, **kwargs)
4227
226118fc
RD
4228 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4229 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4230 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4231 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4232 Selection = property(GetSelection,doc="See `GetSelection`")
4233 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
2131d850 4234_core_.CommandEvent_swigregister(CommandEvent)
d55e5bfc
RD
4235
4236#---------------------------------------------------------------------------
4237
4238class NotifyEvent(CommandEvent):
27fb7603
RD
4239 """
4240 An instance of this class (or one of its derived classes) is sent from
4241 a control when the control's state is being changed and the control
4242 allows that change to be prevented from happening. The event handler
4243 can call `Veto` or `Allow` to tell the control what to do.
4244 """
554f62e9
RD
4245 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4246 __repr__ = _swig_repr
4247 def __init__(self, *args, **kwargs):
27fb7603 4248 """
f460c29d 4249 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4250
4251 An instance of this class (or one of its derived classes) is sent from
4252 a control when the control's state is being changed and the control
4253 allows that change to be prevented from happening. The event handler
4254 can call `Veto` or `Allow` to tell the control what to do.
4255 """
554f62e9 4256 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
d55e5bfc 4257 def Veto(*args, **kwargs):
27fb7603
RD
4258 """
4259 Veto(self)
4260
4261 Prevents the change announced by this event from happening.
4262
4263 It is in general a good idea to notify the user about the reasons for
4264 vetoing the change because otherwise the applications behaviour (which
4265 just refuses to do what the user wants) might be quite surprising.
4266 """
d55e5bfc
RD
4267 return _core_.NotifyEvent_Veto(*args, **kwargs)
4268
4269 def Allow(*args, **kwargs):
27fb7603
RD
4270 """
4271 Allow(self)
4272
4273 This is the opposite of `Veto`: it explicitly allows the event to be
4274 processed. For most events it is not necessary to call this method as
4275 the events are allowed anyhow but some are forbidden by default (this
4276 will be mentioned in the corresponding event description).
4277 """
d55e5bfc
RD
4278 return _core_.NotifyEvent_Allow(*args, **kwargs)
4279
4280 def IsAllowed(*args, **kwargs):
27fb7603
RD
4281 """
4282 IsAllowed(self) -> bool
4283
4284 Returns true if the change is allowed (`Veto` hasn't been called) or
4285 false otherwise (if it was).
4286 """
d55e5bfc
RD
4287 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4288
2131d850 4289_core_.NotifyEvent_swigregister(NotifyEvent)
d55e5bfc
RD
4290
4291#---------------------------------------------------------------------------
4292
4293class ScrollEvent(CommandEvent):
27fb7603
RD
4294 """
4295 A scroll event holds information about events sent from stand-alone
4296 scrollbars and sliders. Note that scrolled windows do not send
4297 instnaces of this event class, but send the `wx.ScrollWinEvent`
4298 instead.
4299 """
554f62e9
RD
4300 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4301 __repr__ = _swig_repr
4302 def __init__(self, *args, **kwargs):
d55e5bfc 4303 """
f460c29d 4304 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
d55e5bfc
RD
4305 int orient=0) -> ScrollEvent
4306 """
554f62e9 4307 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
d55e5bfc 4308 def GetOrientation(*args, **kwargs):
27fb7603
RD
4309 """
4310 GetOrientation(self) -> int
4311
4312 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4313 the scrollbar.
4314 """
d55e5bfc
RD
4315 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4316
4317 def GetPosition(*args, **kwargs):
27fb7603
RD
4318 """
4319 GetPosition(self) -> int
4320
4321 Returns the position of the scrollbar.
4322 """
d55e5bfc
RD
4323 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4324
4325 def SetOrientation(*args, **kwargs):
4326 """SetOrientation(self, int orient)"""
4327 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4328
4329 def SetPosition(*args, **kwargs):
4330 """SetPosition(self, int pos)"""
4331 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4332
33d6fd3b
RD
4333 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4334 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4335_core_.ScrollEvent_swigregister(ScrollEvent)
d55e5bfc
RD
4336
4337#---------------------------------------------------------------------------
4338
4339class ScrollWinEvent(Event):
27fb7603
RD
4340 """
4341 A wx.ScrollWinEvent holds information about scrolling and is sent from
4342 scrolling windows.
4343 """
554f62e9
RD
4344 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4345 __repr__ = _swig_repr
4346 def __init__(self, *args, **kwargs):
27fb7603 4347 """
f460c29d 4348 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4349
4350 A wx.ScrollWinEvent holds information about scrolling and is sent from
4351 scrolling windows.
4352 """
554f62e9 4353 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
d55e5bfc 4354 def GetOrientation(*args, **kwargs):
27fb7603
RD
4355 """
4356 GetOrientation(self) -> int
4357
4358 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4359 the scrollbar.
4360 """
d55e5bfc
RD
4361 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4362
4363 def GetPosition(*args, **kwargs):
27fb7603
RD
4364 """
4365 GetPosition(self) -> int
4366
4367 Returns the position of the scrollbar for the thumb track and release
4368 events. Note that this field can't be used for the other events, you
4369 need to query the window itself for the current position in that case.
4370 """
d55e5bfc
RD
4371 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4372
4373 def SetOrientation(*args, **kwargs):
4374 """SetOrientation(self, int orient)"""
4375 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4376
4377 def SetPosition(*args, **kwargs):
4378 """SetPosition(self, int pos)"""
4379 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4380
33d6fd3b
RD
4381 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4382 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4383_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d55e5bfc
RD
4384
4385#---------------------------------------------------------------------------
4386
4387MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4388MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4389MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4390MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4391MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4392class MouseEvent(Event):
27fb7603
RD
4393 """
4394 This event class contains information about the events generated by
4395 the mouse: they include mouse buttons press and release events and
4396 mouse move events.
4397
4398 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4399 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4400 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4401 a middle button so a portable application should avoid relying on the
4402 events from it.
4403
4404 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4405 the former returns true when the event corresponds to the left mouse
4406 button click while the latter returns true if the left mouse button is
4407 currently being pressed. For example, when the user is dragging the
4408 mouse you can use `LeftIsDown` to test whether the left mouse button
4409 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4410 `LeftIsDown` will also return true in wxWidgets whatever the
4411 underlying GUI behaviour is (which is platform-dependent). The same
4412 applies, of course, to other mouse buttons as well.
4413 """
554f62e9
RD
4414 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4415 __repr__ = _swig_repr
4416 def __init__(self, *args, **kwargs):
27fb7603 4417 """
f460c29d 4418 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4419
4420 Constructs a wx.MouseEvent. Valid event types are:
4421
4422 * wxEVT_ENTER_WINDOW
4423 * wxEVT_LEAVE_WINDOW
4424 * wxEVT_LEFT_DOWN
4425 * wxEVT_LEFT_UP
4426 * wxEVT_LEFT_DCLICK
4427 * wxEVT_MIDDLE_DOWN
4428 * wxEVT_MIDDLE_UP
4429 * wxEVT_MIDDLE_DCLICK
4430 * wxEVT_RIGHT_DOWN
4431 * wxEVT_RIGHT_UP
4432 * wxEVT_RIGHT_DCLICK
4433 * wxEVT_MOTION
4434 * wxEVT_MOUSEWHEEL
4435 """
554f62e9 4436 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
d55e5bfc 4437 def IsButton(*args, **kwargs):
27fb7603
RD
4438 """
4439 IsButton(self) -> bool
4440
4441 Returns true if the event was a mouse button event (not necessarily a
4442 button down event - that may be tested using `ButtonDown`).
4443 """
d55e5bfc
RD
4444 return _core_.MouseEvent_IsButton(*args, **kwargs)
4445
4446 def ButtonDown(*args, **kwargs):
27fb7603
RD
4447 """
4448 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4449
5ba5649b
RD
4450 If the argument is omitted, this returns true if the event was any
4451 mouse button down event. Otherwise the argument specifies which
4452 button-down event shold be checked for (see `Button` for the possible
4453 values).
27fb7603 4454 """
d55e5bfc
RD
4455 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4456
4457 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4458 """
4459 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4460
4461 If the argument is omitted, this returns true if the event was any
4462 mouse double click event. Otherwise the argument specifies which
4463 double click event to check for (see `Button` for the possible
4464 values).
4465 """
d55e5bfc
RD
4466 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4467
4468 def ButtonUp(*args, **kwargs):
27fb7603
RD
4469 """
4470 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4471
4472 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4473 mouse button up event. Otherwise the argument specifies which button
4474 up event to check for (see `Button` for the possible values).
27fb7603 4475 """
d55e5bfc
RD
4476 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4477
4478 def Button(*args, **kwargs):
27fb7603
RD
4479 """
4480 Button(self, int button) -> bool
4481
4482 Returns true if the identified mouse button is changing state. Valid
4483 values of button are:
4484
4485 ==================== =====================================
4486 wx.MOUSE_BTN_LEFT check if left button was pressed
4487 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4488 wx.MOUSE_BTN_RIGHT check if right button was pressed
4489 wx.MOUSE_BTN_ANY check if any button was pressed
4490 ==================== =====================================
4491
4492 """
d55e5bfc
RD
4493 return _core_.MouseEvent_Button(*args, **kwargs)
4494
4495 def ButtonIsDown(*args, **kwargs):
4496 """ButtonIsDown(self, int but) -> bool"""
4497 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4498
4499 def GetButton(*args, **kwargs):
27fb7603
RD
4500 """
4501 GetButton(self) -> int
4502
4503 Returns the mouse button which generated this event or
4504 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4505 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4506 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4507 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4508 right buttons respectively.
4509 """
d55e5bfc
RD
4510 return _core_.MouseEvent_GetButton(*args, **kwargs)
4511
4512 def ControlDown(*args, **kwargs):
27fb7603
RD
4513 """
4514 ControlDown(self) -> bool
4515
4516 Returns true if the control key was down at the time of the event.
4517 """
d55e5bfc
RD
4518 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4519
4520 def MetaDown(*args, **kwargs):
27fb7603
RD
4521 """
4522 MetaDown(self) -> bool
4523
4524 Returns true if the Meta key was down at the time of the event.
4525 """
d55e5bfc
RD
4526 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4527
4528 def AltDown(*args, **kwargs):
27fb7603
RD
4529 """
4530 AltDown(self) -> bool
4531
4532 Returns true if the Alt key was down at the time of the event.
4533 """
d55e5bfc
RD
4534 return _core_.MouseEvent_AltDown(*args, **kwargs)
4535
4536 def ShiftDown(*args, **kwargs):
27fb7603
RD
4537 """
4538 ShiftDown(self) -> bool
4539
4540 Returns true if the Shift key was down at the time of the event.
4541 """
d55e5bfc
RD
4542 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4543
412d302d
RD
4544 def CmdDown(*args, **kwargs):
4545 """
4546 CmdDown(self) -> bool
4547
4548 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4549 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4550 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4551 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4552 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4553 purpose. So for non-Mac platforms this is the same as `ControlDown`
4554 and Macs this is the same as `MetaDown`.
4555 """
4556 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4557
d55e5bfc 4558 def LeftDown(*args, **kwargs):
27fb7603
RD
4559 """
4560 LeftDown(self) -> bool
4561
4562 Returns true if the left mouse button state changed to down.
4563 """
d55e5bfc
RD
4564 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4565
4566 def MiddleDown(*args, **kwargs):
27fb7603
RD
4567 """
4568 MiddleDown(self) -> bool
4569
4570 Returns true if the middle mouse button state changed to down.
4571 """
d55e5bfc
RD
4572 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4573
4574 def RightDown(*args, **kwargs):
27fb7603
RD
4575 """
4576 RightDown(self) -> bool
4577
4578 Returns true if the right mouse button state changed to down.
4579 """
d55e5bfc
RD
4580 return _core_.MouseEvent_RightDown(*args, **kwargs)
4581
4582 def LeftUp(*args, **kwargs):
27fb7603
RD
4583 """
4584 LeftUp(self) -> bool
4585
4586 Returns true if the left mouse button state changed to up.
4587 """
d55e5bfc
RD
4588 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4589
4590 def MiddleUp(*args, **kwargs):
27fb7603
RD
4591 """
4592 MiddleUp(self) -> bool
4593
4594 Returns true if the middle mouse button state changed to up.
4595 """
d55e5bfc
RD
4596 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4597
4598 def RightUp(*args, **kwargs):
27fb7603
RD
4599 """
4600 RightUp(self) -> bool
4601
4602 Returns true if the right mouse button state changed to up.
4603 """
d55e5bfc
RD
4604 return _core_.MouseEvent_RightUp(*args, **kwargs)
4605
4606 def LeftDClick(*args, **kwargs):
27fb7603
RD
4607 """
4608 LeftDClick(self) -> bool
4609
4610 Returns true if the event was a left button double click.
4611 """
d55e5bfc
RD
4612 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4613
4614 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4615 """
4616 MiddleDClick(self) -> bool
4617
4618 Returns true if the event was a middle button double click.
4619 """
d55e5bfc
RD
4620 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4621
4622 def RightDClick(*args, **kwargs):
27fb7603
RD
4623 """
4624 RightDClick(self) -> bool
4625
4626 Returns true if the event was a right button double click.
4627 """
d55e5bfc
RD
4628 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4629
4630 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4631 """
4632 LeftIsDown(self) -> bool
4633
4634 Returns true if the left mouse button is currently down, independent
4635 of the current event type.
4636
4637 Please notice that it is not the same as LeftDown which returns true
4638 if the left mouse button was just pressed. Rather, it describes the
4639 state of the mouse button before the event happened.
4640
4641 This event is usually used in the mouse event handlers which process
4642 "move mouse" messages to determine whether the user is (still)
4643 dragging the mouse.
4644 """
d55e5bfc
RD
4645 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4646
4647 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4648 """
4649 MiddleIsDown(self) -> bool
4650
4651 Returns true if the middle mouse button is currently down, independent
4652 of the current event type.
4653 """
d55e5bfc
RD
4654 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4655
4656 def RightIsDown(*args, **kwargs):
27fb7603
RD
4657 """
4658 RightIsDown(self) -> bool
4659
4660 Returns true if the right mouse button is currently down, independent
4661 of the current event type.
4662 """
d55e5bfc
RD
4663 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4664
4665 def Dragging(*args, **kwargs):
27fb7603
RD
4666 """
4667 Dragging(self) -> bool
4668
4669 Returns true if this was a dragging event (motion while a button is
4670 depressed).
4671 """
d55e5bfc
RD
4672 return _core_.MouseEvent_Dragging(*args, **kwargs)
4673
4674 def Moving(*args, **kwargs):
27fb7603
RD
4675 """
4676 Moving(self) -> bool
4677
4678 Returns true if this was a motion event and no mouse buttons were
4679 pressed. If any mouse button is held pressed, then this method returns
4680 false and Dragging returns true.
4681 """
d55e5bfc
RD
4682 return _core_.MouseEvent_Moving(*args, **kwargs)
4683
4684 def Entering(*args, **kwargs):
27fb7603
RD
4685 """
4686 Entering(self) -> bool
4687
4688 Returns true if the mouse was entering the window.
4689 """
d55e5bfc
RD
4690 return _core_.MouseEvent_Entering(*args, **kwargs)
4691
4692 def Leaving(*args, **kwargs):
27fb7603
RD
4693 """
4694 Leaving(self) -> bool
4695
4696 Returns true if the mouse was leaving the window.
4697 """
d55e5bfc
RD
4698 return _core_.MouseEvent_Leaving(*args, **kwargs)
4699
4700 def GetPosition(*args, **kwargs):
4701 """
4702 GetPosition(self) -> Point
4703
27fb7603
RD
4704 Returns the pixel position of the mouse in window coordinates when the
4705 event happened.
d55e5bfc
RD
4706 """
4707 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4708
4709 def GetPositionTuple(*args, **kwargs):
4710 """
4711 GetPositionTuple() -> (x,y)
4712
27fb7603
RD
4713 Returns the pixel position of the mouse in window coordinates when the
4714 event happened.
d55e5bfc
RD
4715 """
4716 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4717
4718 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4719 """
4720 GetLogicalPosition(self, DC dc) -> Point
4721
4722 Returns the logical mouse position in pixels (i.e. translated
4723 according to the translation set for the DC, which usually indicates
4724 that the window has been scrolled).
4725 """
d55e5bfc
RD
4726 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4727
4728 def GetX(*args, **kwargs):
27fb7603
RD
4729 """
4730 GetX(self) -> int
4731
4732 Returns X coordinate of the physical mouse event position.
4733 """
d55e5bfc
RD
4734 return _core_.MouseEvent_GetX(*args, **kwargs)
4735
4736 def GetY(*args, **kwargs):
27fb7603
RD
4737 """
4738 GetY(self) -> int
4739
4740 Returns Y coordinate of the physical mouse event position.
4741 """
d55e5bfc
RD
4742 return _core_.MouseEvent_GetY(*args, **kwargs)
4743
4744 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4745 """
4746 GetWheelRotation(self) -> int
4747
4748 Get wheel rotation, positive or negative indicates direction of
4749 rotation. Current devices all send an event when rotation is equal to
4750 +/-WheelDelta, but this allows for finer resolution devices to be
4751 created in the future. Because of this you shouldn't assume that one
4752 event is equal to 1 line or whatever, but you should be able to either
4753 do partial line scrolling or wait until +/-WheelDelta rotation values
4754 have been accumulated before scrolling.
4755 """
d55e5bfc
RD
4756 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4757
4758 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4759 """
4760 GetWheelDelta(self) -> int
4761
4762 Get wheel delta, normally 120. This is the threshold for action to be
4763 taken, and one such action (for example, scrolling one increment)
4764 should occur for each delta.
4765 """
d55e5bfc
RD
4766 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4767
4768 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4769 """
4770 GetLinesPerAction(self) -> int
4771
4772 Returns the configured number of lines (or whatever) to be scrolled
4773 per wheel action. Defaults to three.
4774 """
d55e5bfc
RD
4775 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4776
4777 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4778 """
4779 IsPageScroll(self) -> bool
4780
4781 Returns true if the system has been setup to do page scrolling with
4782 the mouse wheel instead of line scrolling.
4783 """
d55e5bfc
RD
4784 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4785
4786 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4787 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4788 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4789 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4790 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4791 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4792 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4793 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4794 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4795 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4796 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4797 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
57332a5a
RD
4798 Button = property(GetButton,doc="See `GetButton`")
4799 LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`")
4800 LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`")
4801 Position = property(GetPosition,doc="See `GetPosition`")
4802 WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`")
4803 WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`")
4804 X = property(GetX,doc="See `GetX`")
4805 Y = property(GetY,doc="See `GetY`")
2131d850 4806_core_.MouseEvent_swigregister(MouseEvent)
d55e5bfc
RD
4807
4808#---------------------------------------------------------------------------
4809
4810class SetCursorEvent(Event):
5ba5649b
RD
4811 """
4812 A SetCursorEvent is generated when the mouse cursor is about to be set
4813 as a result of mouse motion. This event gives the application the
4814 chance to perform specific mouse cursor processing based on the
4815 current position of the mouse within the window. Use the `SetCursor`
4816 method to specify the cursor you want to be displayed.
4817 """
554f62e9
RD
4818 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4819 __repr__ = _swig_repr
4820 def __init__(self, *args, **kwargs):
5ba5649b
RD
4821 """
4822 __init__(self, int x=0, int y=0) -> SetCursorEvent
4823
4824 Construct a new `wx.SetCursorEvent`.
4825 """
554f62e9 4826 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
d55e5bfc 4827 def GetX(*args, **kwargs):
5ba5649b
RD
4828 """
4829 GetX(self) -> int
4830
4831 Returns the X coordinate of the mouse in client coordinates.
4832 """
d55e5bfc
RD
4833 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4834
4835 def GetY(*args, **kwargs):
5ba5649b
RD
4836 """
4837 GetY(self) -> int
4838
4839 Returns the Y coordinate of the mouse in client coordinates.
4840 """
d55e5bfc
RD
4841 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4842
4843 def SetCursor(*args, **kwargs):
5ba5649b
RD
4844 """
4845 SetCursor(self, Cursor cursor)
4846
4847 Sets the cursor associated with this event.
4848 """
d55e5bfc
RD
4849 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4850
4851 def GetCursor(*args, **kwargs):
5ba5649b
RD
4852 """
4853 GetCursor(self) -> Cursor
4854
4855 Returns a reference to the cursor specified by this event.
4856 """
d55e5bfc
RD
4857 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4858
4859 def HasCursor(*args, **kwargs):
5ba5649b
RD
4860 """
4861 HasCursor(self) -> bool
4862
4863 Returns true if the cursor specified by this event is a valid cursor.
4864 """
d55e5bfc
RD
4865 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4866
33d6fd3b
RD
4867 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
4868 X = property(GetX,doc="See `GetX`")
4869 Y = property(GetY,doc="See `GetY`")
2131d850 4870_core_.SetCursorEvent_swigregister(SetCursorEvent)
d55e5bfc
RD
4871
4872#---------------------------------------------------------------------------
4873
4874class KeyEvent(Event):
5ba5649b
RD
4875 """
4876 This event class contains information about keypress and character
4877 events. These events are only sent to the widget that currently has
4878 the keyboard focus.
4879
4880 Notice that there are three different kinds of keyboard events in
4881 wxWidgets: key down and up events and char events. The difference
4882 between the first two is clear - the first corresponds to a key press
4883 and the second to a key release - otherwise they are identical. Just
4884 note that if the key is maintained in a pressed state you will
4885 typically get a lot of (automatically generated) down events but only
4886 one up so it is wrong to assume that there is one up event
4887 corresponding to each down one.
4888
4889 Both key events provide untranslated key codes while the char event
4890 carries the translated one. The untranslated code for alphanumeric
4891 keys is always an upper case value. For the other keys it is one of
4892 WXK_XXX values from the keycodes table. The translated key is, in
4893 general, the character the user expects to appear as the result of the
4894 key combination when typing the text into a text entry zone, for
4895 example.
4896
4897 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4898 and the standard US keyboard): when the 'A' key is pressed, the key
4899 down event key code is equal to ASCII A == 65. But the char event key
4900 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4901 'A' keys simultaneously , the key code in key down event will still be
4902 just 'A' while the char event key code parameter will now be 'A' as
4903 well.
4904
4905 Although in this simple case it is clear that the correct key code
4906 could be found in the key down event handler by checking the value
4907 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4908 as for non alphanumeric keys or non-US keyboard layouts the
4909 translation is keyboard-layout dependent and can only be done properly
4910 by the system itself.
4911
4912 Another kind of translation is done when the control key is pressed:
4913 for example, for CTRL-A key press the key down event still carries the
4914 same key code 'A' as usual but the char event will have key code of 1,
4915 the ASCII value of this key combination.
4916
4917 You may discover how the other keys on your system behave
4918 interactively by running the KeyEvents sample in the wxPython demo and
4919 pressing some keys while the blue box at the top has the keyboard
4920 focus.
4921
4922 **Note**: If a key down event is caught and the event handler does not
4923 call event.Skip() then the coresponding char event will not
4924 happen. This is by design and enables the programs that handle both
4925 types of events to be a bit simpler.
4926
4927 **Note for Windows programmers**: The key and char events in wxWidgets
4928 are similar to but slightly different from Windows WM_KEYDOWN and
4929 WM_CHAR events. In particular, Alt-x combination will generate a char
4930 event in wxWidgets (unless it is used as an accelerator).
4931
4932 **Tip**: be sure to call event.Skip() for events that you don't
4933 process in key event function, otherwise menu shortcuts may cease to
4934 work under Windows.
4935
4936 """
554f62e9
RD
4937 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4938 __repr__ = _swig_repr
4939 def __init__(self, *args, **kwargs):
5ba5649b 4940 """
f460c29d 4941 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
4942
4943 Construct a new `wx.KeyEvent`. Valid event types are:
4944 *
4945 """
554f62e9 4946 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
4947 def GetModifiers(*args, **kwargs):
4948 """
4949 GetModifiers(self) -> int
4950
4951 Returns a bitmask of the current modifier settings. Can be used to
4952 check if the key event has exactly the given modifiers without having
4953 to explicitly check that the other modifiers are not down. For
4954 example::
4955
4956 if event.GetModifers() == wx.MOD_CONTROL:
4957 DoSomething()
4958
4959 """
4960 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4961
d55e5bfc 4962 def ControlDown(*args, **kwargs):
5ba5649b
RD
4963 """
4964 ControlDown(self) -> bool
4965
4966 Returns ``True`` if the Control key was down at the time of the event.
4967 """
d55e5bfc
RD
4968 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4969
4970 def MetaDown(*args, **kwargs):
5ba5649b
RD
4971 """
4972 MetaDown(self) -> bool
4973
4974 Returns ``True`` if the Meta key was down at the time of the event.
4975 """
d55e5bfc
RD
4976 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4977
4978 def AltDown(*args, **kwargs):
5ba5649b
RD
4979 """
4980 AltDown(self) -> bool
4981
4982 Returns ``True`` if the Alt key was down at the time of the event.
4983 """
d55e5bfc
RD
4984 return _core_.KeyEvent_AltDown(*args, **kwargs)
4985
4986 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4987 """
4988 ShiftDown(self) -> bool
4989
4990 Returns ``True`` if the Shift key was down at the time of the event.
4991 """
d55e5bfc
RD
4992 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4993
412d302d
RD
4994 def CmdDown(*args, **kwargs):
4995 """
4996 CmdDown(self) -> bool
4997
4998 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4999 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 5000 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
5001 because Cmd key is used for the same thing under Mac as Ctrl
5002 elsewhere. The Ctrl still exists, it's just not used for this
5003 purpose. So for non-Mac platforms this is the same as `ControlDown`
5004 and Macs this is the same as `MetaDown`.
5005 """
5006 return _core_.KeyEvent_CmdDown(*args, **kwargs)
5007
d55e5bfc 5008 def HasModifiers(*args, **kwargs):
5ba5649b
RD
5009 """
5010 HasModifiers(self) -> bool
5011
5012 Returns true if either CTRL or ALT keys was down at the time of the
5013 key event. Note that this function does not take into account neither
5014 SHIFT nor META key states (the reason for ignoring the latter is that
5015 it is common for NUMLOCK key to be configured as META under X but the
5016 key presses even while NUMLOCK is on should be still processed
5017 normally).
5018 """
d55e5bfc
RD
5019 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
5020
5021 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
5022 """
5023 GetKeyCode(self) -> int
5024
5025 Returns the virtual key code. ASCII events return normal ASCII values,
5026 while non-ASCII events return values such as WXK_LEFT for the left
5027 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5028 codes.
5029
5030 Note that in Unicode build, the returned value is meaningful only if
5031 the user entered a character that can be represented in current
5032 locale's default charset. You can obtain the corresponding Unicode
5033 character using `GetUnicodeKey`.
5034 """
d55e5bfc
RD
5035 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
5036
19272049 5037 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
5038 """
5039 GetUnicodeKey(self) -> int
5040
5041 Returns the Unicode character corresponding to this key event. This
5042 function is only meaningfule in a Unicode build of wxPython.
5043 """
19272049 5044 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 5045
19272049 5046 GetUniChar = GetUnicodeKey
b850e7f3
RD
5047 def SetUnicodeKey(*args, **kwargs):
5048 """
5049 SetUnicodeKey(self, int uniChar)
5050
5051 Set the Unicode value of the key event, but only if this is a Unicode
5052 build of wxPython.
5053 """
5054 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
5055
d55e5bfc 5056 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
5057 """
5058 GetRawKeyCode(self) -> unsigned int
5059
5060 Returns the raw key code for this event. This is a platform-dependent
5061 scan code which should only be used in advanced
5062 applications. Currently the raw key codes are not supported by all
5063 ports.
5064 """
d55e5bfc
RD
5065 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
5066
5067 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
5068 """
5069 GetRawKeyFlags(self) -> unsigned int
5070
5071 Returns the low level key flags for this event. The flags are
5072 platform-dependent and should only be used in advanced applications.
5073 Currently the raw key flags are not supported by all ports.
5074 """
d55e5bfc
RD
5075 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
5076
5077 def GetPosition(*args, **kwargs):
5078 """
5079 GetPosition(self) -> Point
5080
5ba5649b 5081 Find the position of the event, if applicable.
d55e5bfc
RD
5082 """
5083 return _core_.KeyEvent_GetPosition(*args, **kwargs)
5084
5085 def GetPositionTuple(*args, **kwargs):
5086 """
5087 GetPositionTuple() -> (x,y)
5088
5ba5649b 5089 Find the position of the event, if applicable.
d55e5bfc
RD
5090 """
5091 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
5092
5093 def GetX(*args, **kwargs):
5ba5649b
RD
5094 """
5095 GetX(self) -> int
5096
5097 Returns the X position (in client coordinates) of the event, if
5098 applicable.
5099 """
d55e5bfc
RD
5100 return _core_.KeyEvent_GetX(*args, **kwargs)
5101
5102 def GetY(*args, **kwargs):
5ba5649b
RD
5103 """
5104 GetY(self) -> int
5105
5106 Returns the Y position (in client coordinates) of the event, if
5107 applicable.
5108 """
d55e5bfc
RD
5109 return _core_.KeyEvent_GetY(*args, **kwargs)
5110
5111 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5112 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5113 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5114 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5115 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5116 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5117 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5118 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5119 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5120 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
97ab0f6a
RD
5121 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5122 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5123 Position = property(GetPosition,doc="See `GetPosition`")
5124 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5125 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5126 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5127 X = property(GetX,doc="See `GetX`")
5128 Y = property(GetY,doc="See `GetY`")
2131d850 5129_core_.KeyEvent_swigregister(KeyEvent)
d55e5bfc
RD
5130
5131#---------------------------------------------------------------------------
5132
5133class SizeEvent(Event):
5ba5649b
RD
5134 """
5135 A size event holds information about size change events. The EVT_SIZE
5136 handler function will be called when the window it is bound to has
5137 been resized.
5138
5139 Note that the size passed is of the whole window: call
5140 `wx.Window.GetClientSize` for the area which may be used by the
5141 application.
5142
5143 When a window is resized, usually only a small part of the window is
5144 damaged and and that area is all that is in the update region for the
5145 next paint event. However, if your drawing depends on the size of the
5146 window, you may need to clear the DC explicitly and repaint the whole
5147 window. In which case, you may need to call `wx.Window.Refresh` to
5148 invalidate the entire window.
5149
5150 """
554f62e9
RD
5151 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5152 __repr__ = _swig_repr
5153 def __init__(self, *args, **kwargs):
5ba5649b
RD
5154 """
5155 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5156
5157 Construct a new ``wx.SizeEvent``.
5158 """
554f62e9 5159 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
d55e5bfc 5160 def GetSize(*args, **kwargs):
5ba5649b
RD
5161 """
5162 GetSize(self) -> Size
5163
5164 Returns the entire size of the window generating the size change
5165 event.
5166 """
d55e5bfc
RD
5167 return _core_.SizeEvent_GetSize(*args, **kwargs)
5168
5169 def GetRect(*args, **kwargs):
5170 """GetRect(self) -> Rect"""
5171 return _core_.SizeEvent_GetRect(*args, **kwargs)
5172
5173 def SetRect(*args, **kwargs):
5174 """SetRect(self, Rect rect)"""
5175 return _core_.SizeEvent_SetRect(*args, **kwargs)
5176
5177 def SetSize(*args, **kwargs):
5178 """SetSize(self, Size size)"""
5179 return _core_.SizeEvent_SetSize(*args, **kwargs)
5180
5181 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5182 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
33d6fd3b
RD
5183 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5184 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
2131d850 5185_core_.SizeEvent_swigregister(SizeEvent)
d55e5bfc
RD
5186
5187#---------------------------------------------------------------------------
5188
5189class MoveEvent(Event):
5ba5649b
RD
5190 """
5191 This event object is sent for EVT_MOVE event bindings when a window is
5192 moved to a new position.
5193 """
554f62e9
RD
5194 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5195 __repr__ = _swig_repr
5196 def __init__(self, *args, **kwargs):
5ba5649b
RD
5197 """
5198 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5199
5200 Constructor.
5201 """
554f62e9 5202 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
d55e5bfc 5203 def GetPosition(*args, **kwargs):
5ba5649b
RD
5204 """
5205 GetPosition(self) -> Point
5206
5207 Returns the position of the window generating the move change event.
5208 """
d55e5bfc
RD
5209 return _core_.MoveEvent_GetPosition(*args, **kwargs)
5210
5211 def GetRect(*args, **kwargs):
5212 """GetRect(self) -> Rect"""
5213 return _core_.MoveEvent_GetRect(*args, **kwargs)
5214
5215 def SetRect(*args, **kwargs):
5216 """SetRect(self, Rect rect)"""
5217 return _core_.MoveEvent_SetRect(*args, **kwargs)
5218
5219 def SetPosition(*args, **kwargs):
5220 """SetPosition(self, Point pos)"""
5221 return _core_.MoveEvent_SetPosition(*args, **kwargs)
5222
fef4c27a
RD
5223 m_pos = property(GetPosition, SetPosition)
5224 m_rect = property(GetRect, SetRect)
5225
57332a5a
RD
5226 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
5227 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
2131d850 5228_core_.MoveEvent_swigregister(MoveEvent)
d55e5bfc
RD
5229
5230#---------------------------------------------------------------------------
5231
5232class PaintEvent(Event):
5ba5649b
RD
5233 """
5234 A paint event is sent when a window's contents needs to be repainted.
5235 Note that in an EVT_PAINT handler the application must *always* create
5236 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5237 Windows assumes that the window has not been painted yet and will send
5238 the event again, causing endless refreshes.
5239
5240 You can optimize painting by retrieving the rectangles that have been
5241 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5242 and only repainting these rectangles. The rectangles are in terms of
5243 the client area, and are unscrolled, so you will need to do some
5244 calculations using the current view position to obtain logical,
5245 scrolled units.
5246
5247 """
554f62e9
RD
5248 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5249 __repr__ = _swig_repr
5250 def __init__(self, *args, **kwargs):
d55e5bfc 5251 """__init__(self, int Id=0) -> PaintEvent"""
554f62e9 5252 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5253_core_.PaintEvent_swigregister(PaintEvent)
d55e5bfc
RD
5254
5255class NcPaintEvent(Event):
093d3ff1 5256 """Proxy of C++ NcPaintEvent class"""
554f62e9
RD
5257 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5258 __repr__ = _swig_repr
5259 def __init__(self, *args, **kwargs):
d55e5bfc 5260 """__init__(self, int winid=0) -> NcPaintEvent"""
554f62e9 5261 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5262_core_.NcPaintEvent_swigregister(NcPaintEvent)
d55e5bfc
RD
5263
5264#---------------------------------------------------------------------------
5265
5266class EraseEvent(Event):
5ba5649b
RD
5267 """
5268 An erase event is sent whenever the background of a window needs to be
5269 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5270 binder. On some platforms, such as GTK+, this event is simulated
5271 (simply generated just before the paint event) and may cause flicker.
5272
5273 To paint a custom background use the `GetDC` method and use the returned
5274 device context if it is not ``None``, otherwise create a temporary
5275 `wx.ClientDC` and draw on that.
5276
5277 """
554f62e9
RD
5278 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5279 __repr__ = _swig_repr
5280 def __init__(self, *args, **kwargs):
5ba5649b
RD
5281 """
5282 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5283
5284 Constructor
5285 """
554f62e9 5286 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
d55e5bfc 5287 def GetDC(*args, **kwargs):
5ba5649b
RD
5288 """
5289 GetDC(self) -> DC
5290
5291 Returns the device context the event handler should draw upon. If
5292 ``None`` is returned then create a temporary `wx.ClientDC` and use
5293 that instead.
5294 """
d55e5bfc
RD
5295 return _core_.EraseEvent_GetDC(*args, **kwargs)
5296
97ab0f6a 5297 DC = property(GetDC,doc="See `GetDC`")
2131d850 5298_core_.EraseEvent_swigregister(EraseEvent)
d55e5bfc
RD
5299
5300#---------------------------------------------------------------------------
5301
5302class FocusEvent(Event):
5ba5649b
RD
5303 """
5304 A focus event is sent when a window's focus changes. The window losing
5305 focus receives an EVT_KILL_FOCUS event while the window gaining it
5306 gets an EVT_SET_FOCUS event.
5307
5308 Notice that the set focus event happens both when the user gives focus
5309 to the window (whether using the mouse or keyboard) and when it is
5310 done from the program itself using `wx.Window.SetFocus`.
5311
5312 """
554f62e9
RD
5313 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5314 __repr__ = _swig_repr
5315 def __init__(self, *args, **kwargs):
5ba5649b 5316 """
f460c29d 5317 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5318
5319 Constructor
5320 """
554f62e9 5321 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
d55e5bfc 5322 def GetWindow(*args, **kwargs):
5ba5649b
RD
5323 """
5324 GetWindow(self) -> Window
5325
5326 Returns the other window associated with this event, that is the
5327 window which had the focus before for the EVT_SET_FOCUS event and the
5328 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5329
5330 Warning: the window returned may be None!
5331 """
d55e5bfc
RD
5332 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5333
5334 def SetWindow(*args, **kwargs):
5335 """SetWindow(self, Window win)"""
5336 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5337
97ab0f6a 5338 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 5339_core_.FocusEvent_swigregister(FocusEvent)
d55e5bfc
RD
5340
5341#---------------------------------------------------------------------------
5342
5343class ChildFocusEvent(CommandEvent):
5ba5649b 5344 """
33d6fd3b
RD
5345 A child focus event is sent to a (parent-)window when one of its child
5346 windows gains focus, so that the window could restore the focus back
5347 to its corresponding child if it loses it now and regains later.
5348
5349 Notice that child window is the direct child of the window receiving
5350 the event, and so may not be the actual widget recieving focus if it
5351 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5352 to get the widget that is actually receiving focus.
5ba5649b 5353 """
554f62e9
RD
5354 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5355 __repr__ = _swig_repr
5356 def __init__(self, *args, **kwargs):
5ba5649b
RD
5357 """
5358 __init__(self, Window win=None) -> ChildFocusEvent
5359
5360 Constructor
5361 """
554f62e9 5362 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
d55e5bfc 5363 def GetWindow(*args, **kwargs):
5ba5649b
RD
5364 """
5365 GetWindow(self) -> Window
5366
33d6fd3b
RD
5367 The window, or (grand)parent of the window which has just received the
5368 focus.
5ba5649b 5369 """
d55e5bfc
RD
5370 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5371
226118fc 5372 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 5373_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d55e5bfc
RD
5374
5375#---------------------------------------------------------------------------
5376
5377class ActivateEvent(Event):
5ba5649b
RD
5378 """
5379 An activate event is sent when a top-level window or the entire
5380 application is being activated or deactivated.
5381
5382 A top-level window (a dialog or frame) receives an activate event when
5383 is being activated or deactivated. This is indicated visually by the
5384 title bar changing colour, and a subwindow gaining the keyboard focus.
5385 An application is activated or deactivated when one of its frames
5386 becomes activated, or a frame becomes inactivate resulting in all
5387 application frames being inactive.
5388
5389 Please note that usually you should call event.Skip() in your handlers
5390 for these events so the default handlers will still be called, as not
5391 doing so can result in strange effects.
5392
5393 """
554f62e9
RD
5394 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5395 __repr__ = _swig_repr
5396 def __init__(self, *args, **kwargs):
5ba5649b 5397 """
f460c29d 5398 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5399
5400 Constructor
5401 """
554f62e9 5402 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
d55e5bfc 5403 def GetActive(*args, **kwargs):
5ba5649b
RD
5404 """
5405 GetActive(self) -> bool
5406
5407 Returns true if the application or window is being activated, false
5408 otherwise.
5409 """
d55e5bfc
RD
5410 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5411
226118fc 5412 Active = property(GetActive,doc="See `GetActive`")
2131d850 5413_core_.ActivateEvent_swigregister(ActivateEvent)
d55e5bfc
RD
5414
5415#---------------------------------------------------------------------------
5416
5417class InitDialogEvent(Event):
5ba5649b
RD
5418 """
5419 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5420 any window when `wx.Window.InitDialog` is called. Handlers for this
5421 event can transfer data to the window, or anything else that should be
5422 done before the user begins editing the form. The default handler
5423 calls `wx.Window.TransferDataToWindow`.
5424 """
554f62e9
RD
5425 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5426 __repr__ = _swig_repr
5427 def __init__(self, *args, **kwargs):
5ba5649b
RD
5428 """
5429 __init__(self, int Id=0) -> InitDialogEvent
5430
5431 Constructor
5432 """
554f62e9 5433 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5434_core_.InitDialogEvent_swigregister(InitDialogEvent)
d55e5bfc
RD
5435
5436#---------------------------------------------------------------------------
5437
5438class MenuEvent(Event):
5ba5649b
RD
5439 """
5440 This class is used for a variety of menu-related events. Note that
5441 these do not include menu command events, which are handled by sending
5442 `wx.CommandEvent` objects.
5443
5444 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5445 text in the first field of the status bar.
5446 """
554f62e9
RD
5447 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5448 __repr__ = _swig_repr
5449 def __init__(self, *args, **kwargs):
5ba5649b 5450 """
f460c29d 5451 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5452
5453 Constructor
5454 """
554f62e9 5455 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
d55e5bfc 5456 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5457 """
5458 GetMenuId(self) -> int
5459
5460 Returns the menu identifier associated with the event. This method
5461 should be only used with the HIGHLIGHT events.
5462 """
d55e5bfc
RD
5463 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5464
5465 def IsPopup(*args, **kwargs):
5ba5649b
RD
5466 """
5467 IsPopup(self) -> bool
5468
5469 Returns ``True`` if the menu which is being opened or closed is a
5470 popup menu, ``False`` if it is a normal one. This method should only
5471 be used with the OPEN and CLOSE events.
5472 """
d55e5bfc
RD
5473 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5474
5475 def GetMenu(*args, **kwargs):
5ba5649b
RD
5476 """
5477 GetMenu(self) -> Menu
5478
5479 Returns the menu which is being opened or closed. This method should
5480 only be used with the OPEN and CLOSE events.
5481 """
d55e5bfc
RD
5482 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5483
57332a5a
RD
5484 Menu = property(GetMenu,doc="See `GetMenu`")
5485 MenuId = property(GetMenuId,doc="See `GetMenuId`")
2131d850 5486_core_.MenuEvent_swigregister(MenuEvent)
d55e5bfc
RD
5487
5488#---------------------------------------------------------------------------
5489
5490class CloseEvent(Event):
5ba5649b
RD
5491 """
5492 This event class contains information about window and session close
5493 events.
5494
5495 The handler function for EVT_CLOSE is called when the user has tried
5496 to close a a frame or dialog box using the window manager controls or
5497 the system menu. It can also be invoked by the application itself
5498 programmatically, for example by calling the `wx.Window.Close`
5499 function.
5500
5501 You should check whether the application is forcing the deletion of
5502 the window using `CanVeto`. If it returns ``False``, you must destroy
5503 the window using `wx.Window.Destroy`. If the return value is ``True``,
5504 it is up to you whether you respond by destroying the window or not.
5505 For example you may wish to display a message dialog prompting to save
5506 files or to cancel the close.
5507
5508 If you don't destroy the window, you should call `Veto` to let the
5509 calling code know that you did not destroy the window. This allows the
5510 `wx.Window.Close` function to return ``True`` or ``False`` depending
5511 on whether the close instruction was honored or not.
5512 """
554f62e9
RD
5513 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5514 __repr__ = _swig_repr
5515 def __init__(self, *args, **kwargs):
5ba5649b 5516 """
f460c29d 5517 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5518
5519 Constructor.
5520 """
554f62e9 5521 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
d55e5bfc 5522 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5523 """
5524 SetLoggingOff(self, bool logOff)
5525
5526 Sets the 'logging off' flag.
5527 """
d55e5bfc
RD
5528 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5529
5530 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5531 """
5532 GetLoggingOff(self) -> bool
5533
034e3677
RD
5534 Returns ``True`` if the user is logging off or ``False`` if the
5535 system is shutting down. This method can only be called for end
5536 session and query end session events, it doesn't make sense for close
5537 window event.
5ba5649b 5538 """
d55e5bfc
RD
5539 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5540
5541 def Veto(*args, **kwargs):
5ba5649b
RD
5542 """
5543 Veto(self, bool veto=True)
5544
5545 Call this from your event handler to veto a system shutdown or to
5546 signal to the calling application that a window close did not happen.
5547
5548 You can only veto a shutdown or close if `CanVeto` returns true.
5549 """
d55e5bfc
RD
5550 return _core_.CloseEvent_Veto(*args, **kwargs)
5551
5ba5649b
RD
5552 def GetVeto(*args, **kwargs):
5553 """GetVeto(self) -> bool"""
5554 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5555
d55e5bfc 5556 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5557 """
5558 SetCanVeto(self, bool canVeto)
5559
5560 Sets the 'can veto' flag.
5561 """
d55e5bfc
RD
5562 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5563
5564 def CanVeto(*args, **kwargs):
5ba5649b
RD
5565 """
5566 CanVeto(self) -> bool
d55e5bfc 5567
5ba5649b
RD
5568 Returns true if you can veto a system shutdown or a window close
5569 event. Vetoing a window close event is not possible if the calling
5570 code wishes to force the application to exit, and so this function
5571 must be called to check this.
5572 """
5573 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc 5574
226118fc 5575 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
2131d850 5576_core_.CloseEvent_swigregister(CloseEvent)
d55e5bfc
RD
5577
5578#---------------------------------------------------------------------------
5579
5580class ShowEvent(Event):
5ba5649b 5581 """An EVT_SHOW event is sent when a window is shown or hidden."""
554f62e9
RD
5582 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5583 __repr__ = _swig_repr
5584 def __init__(self, *args, **kwargs):
5ba5649b
RD
5585 """
5586 __init__(self, int winid=0, bool show=False) -> ShowEvent
5587
5588 An EVT_SHOW event is sent when a window is shown or hidden.
5589 """
554f62e9 5590 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
d55e5bfc
RD
5591 def SetShow(*args, **kwargs):
5592 """SetShow(self, bool show)"""
5593 return _core_.ShowEvent_SetShow(*args, **kwargs)
5594
5595 def GetShow(*args, **kwargs):
5596 """GetShow(self) -> bool"""
5597 return _core_.ShowEvent_GetShow(*args, **kwargs)
5598
33d6fd3b 5599 Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`")
2131d850 5600_core_.ShowEvent_swigregister(ShowEvent)
d55e5bfc
RD
5601
5602#---------------------------------------------------------------------------
5603
5604class IconizeEvent(Event):
5ba5649b
RD
5605 """
5606 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5607 restored.
5608 """
554f62e9
RD
5609 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5610 __repr__ = _swig_repr
5611 def __init__(self, *args, **kwargs):
5ba5649b
RD
5612 """
5613 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5614
5615 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5616 restored.
5617 """
554f62e9 5618 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
d55e5bfc 5619 def Iconized(*args, **kwargs):
5ba5649b
RD
5620 """
5621 Iconized(self) -> bool
5622
5623 Returns ``True`` if the frame has been iconized, ``False`` if it has
5624 been restored.
5625 """
d55e5bfc
RD
5626 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5627
2131d850 5628_core_.IconizeEvent_swigregister(IconizeEvent)
d55e5bfc
RD
5629
5630#---------------------------------------------------------------------------
5631
5632class MaximizeEvent(Event):
5ba5649b 5633 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
554f62e9
RD
5634 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5635 __repr__ = _swig_repr
5636 def __init__(self, *args, **kwargs):
5ba5649b
RD
5637 """
5638 __init__(self, int id=0) -> MaximizeEvent
5639
5640 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5641 """
554f62e9 5642 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5643_core_.MaximizeEvent_swigregister(MaximizeEvent)
d55e5bfc
RD
5644
5645#---------------------------------------------------------------------------
5646
5647class DropFilesEvent(Event):
5ba5649b
RD
5648 """
5649 This class is used for drop files events, that is, when files have
5650 been dropped onto the window. This functionality is only available
5651 under Windows. The window must have previously been enabled for
5652 dropping by calling `wx.Window.DragAcceptFiles`.
5653
5654 Important note: this is a separate implementation to the more general
5655 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5656 implementation uses the older, Windows message-based approach of
5657 dropping files.
5658
5659 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5660 events.
5661
5662 """
554f62e9
RD
5663 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5664 def __init__(self): raise AttributeError, "No constructor defined"
5665 __repr__ = _swig_repr
d55e5bfc 5666 def GetPosition(*args, **kwargs):
5ba5649b
RD
5667 """
5668 GetPosition(self) -> Point
5669
5670 Returns the position at which the files were dropped.
5671 """
d55e5bfc
RD
5672 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5673
5674 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5675 """
5676 GetNumberOfFiles(self) -> int
5677
5678 Returns the number of files dropped.
5679 """
d55e5bfc
RD
5680 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5681
5682 def GetFiles(*args, **kwargs):
5ba5649b
RD
5683 """
5684 GetFiles(self) -> PyObject
5685
5686 Returns a list of the filenames that were dropped.
5687 """
d55e5bfc
RD
5688 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5689
226118fc
RD
5690 Files = property(GetFiles,doc="See `GetFiles`")
5691 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
5692 Position = property(GetPosition,doc="See `GetPosition`")
2131d850 5693_core_.DropFilesEvent_swigregister(DropFilesEvent)
d55e5bfc
RD
5694
5695#---------------------------------------------------------------------------
5696
5697UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5698UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5699class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5700 """
5701 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5702 wxWidgets to give an application the chance to update various user
5703 interface elements.
5704
5705 Without update UI events, an application has to work hard to
5706 check/uncheck, enable/disable, and set the text for elements such as
5707 menu items and toolbar buttons. The code for doing this has to be
5708 mixed up with the code that is invoked when an action is invoked for a
5709 menu item or button.
5710
5711 With update UI events, you define an event handler to look at the
5712 state of the application and change UI elements accordingly. wxWidgets
5713 will call your handler functions in idle time, so you don't have to
5714 worry where to call this code. In addition to being a clearer and more
5715 declarative method, it also means you don't have to worry whether
5716 you're updating a toolbar or menubar identifier. The same handler can
5717 update a menu item and toolbar button, if the ID values are the same.
5718
5719 Instead of directly manipulating the menu or button, you call
5720 functions in the event object, such as `Check`. wxWidgets will
5721 determine whether such a call has been made, and which UI element to
5722 update.
5723
5724 These events will work for popup menus as well as menubars. Just
5725 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5726 any UI events for the window that owns the menu.
5727
5728 If you find that the overhead of UI update processing is affecting
5729 your application, you can do one or both of the following:
5730
5731 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5732 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5733 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5734 receive update events. No other windows will receive update
5735 events.
5736
5737 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5738 value to set the delay between updates. You may need to call
5739 `wx.Window.UpdateWindowUI` at critical points, for example when
5740 a dialog is about to be shown, in case the user sees a slight
5741 delay before windows are updated.
5742
5743 Note that although events are sent in idle time, defining a EVT_IDLE
5744 handler for a window does not affect this because the events are sent
5745 from an internal idle handler.
5746
5747 wxWidgets tries to optimize update events on some platforms. On
5748 Windows and GTK+, events for menubar items are only sent when the menu
5749 is about to be shown, and not in idle time.
5750
5751 """
554f62e9
RD
5752 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5753 __repr__ = _swig_repr
5754 def __init__(self, *args, **kwargs):
5ba5649b
RD
5755 """
5756 __init__(self, int commandId=0) -> UpdateUIEvent
5757
5758 Constructor
5759 """
554f62e9 5760 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
d55e5bfc 5761 def GetChecked(*args, **kwargs):
5ba5649b
RD
5762 """
5763 GetChecked(self) -> bool
5764
5765 Returns ``True`` if the UI element should be checked.
5766 """
d55e5bfc
RD
5767 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5768
5769 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5770 """
5771 GetEnabled(self) -> bool
5772
5773 Returns ``True`` if the UI element should be enabled.
5774 """
d55e5bfc
RD
5775 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5776
554f62e9
RD
5777 def GetShown(*args, **kwargs):
5778 """
5779 GetShown(self) -> bool
5780
5781 Returns ``True`` if the UI element should be shown.
5782 """
5783 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5784
d55e5bfc 5785 def GetText(*args, **kwargs):
5ba5649b
RD
5786 """
5787 GetText(self) -> String
5788
5789 Returns the text that should be set for the UI element.
5790 """
d55e5bfc
RD
5791 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5792
5793 def GetSetText(*args, **kwargs):
5ba5649b
RD
5794 """
5795 GetSetText(self) -> bool
5796
5797 Returns ``True`` if the application has called `SetText`. For
5798 wxWidgets internal use only.
5799 """
d55e5bfc
RD
5800 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5801
5802 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5803 """
5804 GetSetChecked(self) -> bool
5805
5806 Returns ``True`` if the application has called `Check`. For wxWidgets
5807 internal use only.
5808 """
d55e5bfc
RD
5809 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5810
5811 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5812 """
5813 GetSetEnabled(self) -> bool
5814
5815 Returns ``True`` if the application has called `Enable`. For wxWidgets
5816 internal use only.
5817 """
d55e5bfc
RD
5818 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5819
554f62e9
RD
5820 def GetSetShown(*args, **kwargs):
5821 """
5822 GetSetShown(self) -> bool
5823
5824 Returns ``True`` if the application has called `Show`. For wxWidgets
5825 internal use only.
5826 """
5827 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5828
d55e5bfc 5829 def Check(*args, **kwargs):
5ba5649b
RD
5830 """
5831 Check(self, bool check)
5832
5833 Check or uncheck the UI element.
5834 """
d55e5bfc
RD
5835 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5836
5837 def Enable(*args, **kwargs):
5ba5649b
RD
5838 """
5839 Enable(self, bool enable)
5840
5841 Enable or disable the UI element.
5842 """
d55e5bfc
RD
5843 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5844
554f62e9
RD
5845 def Show(*args, **kwargs):
5846 """
5847 Show(self, bool show)
5848
5849 Show or hide the UI element.
5850 """
5851 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5852
d55e5bfc 5853 def SetText(*args, **kwargs):
5ba5649b
RD
5854 """
5855 SetText(self, String text)
5856
5857 Sets the text for this UI element.
5858 """
d55e5bfc
RD
5859 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5860
5861 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5862 """
5863 SetUpdateInterval(long updateInterval)
5864
5865 Sets the interval between updates in milliseconds. Set to -1 to
5866 disable updates, or to 0 to update as frequently as possible. The
5867 default is 0.
5868
5869 Use this to reduce the overhead of UI update events if your
5870 application has a lot of windows. If you set the value to -1 or
5871 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5872 at appropriate points in your application, such as when a dialog is
5873 about to be shown.
5874 """
d55e5bfc
RD
5875 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5876
5877 SetUpdateInterval = staticmethod(SetUpdateInterval)
5878 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5879 """
5880 GetUpdateInterval() -> long
5881
5882 Returns the current interval between updates in milliseconds. -1
5883 disables updates, 0 updates as frequently as possible.
5884 """
d55e5bfc
RD
5885 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5886
5887 GetUpdateInterval = staticmethod(GetUpdateInterval)
5888 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5889 """
5890 CanUpdate(Window win) -> bool
5891
5892 Returns ``True`` if it is appropriate to update (send UI update events
5893 to) this window.
5894
5895 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5896 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5897 events were last sent in idle time, and the update interval, to
5898 determine whether events should be sent to this window now. By default
5899 this will always return true because the update mode is initially
5900 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5901 events will be sent as often as possible. You can reduce the frequency
5902 that events are sent by changing the mode and/or setting an update
5903 interval.
5904
5905 """
d55e5bfc
RD
5906 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5907
5908 CanUpdate = staticmethod(CanUpdate)
5909 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5910 """
5911 ResetUpdateTime()
5912
5913 Used internally to reset the last-updated time to the current time. It
5914 is assumed that update events are normally sent in idle time, so this
5915 is called at the end of idle processing.
5916 """
d55e5bfc
RD
5917 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5918
5919 ResetUpdateTime = staticmethod(ResetUpdateTime)
5920 def SetMode(*args, **kwargs):
5ba5649b
RD
5921 """
5922 SetMode(int mode)
5923
5924 Specify how wxWidgets will send update events: to all windows, or only
5925 to those which specify that they will process the events.
5926
5927 The mode may be one of the following values:
5928
5929 ============================= ==========================================
5930 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5931 is the default setting.
5932 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5933 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5934 style set.
5935 ============================= ==========================================
5936
5937 """
d55e5bfc
RD
5938 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5939
5940 SetMode = staticmethod(SetMode)
5941 def GetMode(*args, **kwargs):
5ba5649b
RD
5942 """
5943 GetMode() -> int
5944
5945 Returns a value specifying how wxWidgets will send update events: to
5946 all windows, or only to those which specify that they will process the
5947 events.
5948 """
d55e5bfc
RD
5949 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5950
5951 GetMode = staticmethod(GetMode)
dba7934c
RD
5952 Checked = property(GetChecked,Check,doc="See `GetChecked`")
5953 Enabled = property(GetEnabled,Enable,doc="See `GetEnabled`")
5954 Shown = property(GetShown,Show,doc="See `GetShown`")
5955 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
2131d850 5956_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d55e5bfc
RD
5957
5958def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
554f62e9 5959 """
5ba5649b
RD
5960 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5961
5962 Sets the interval between updates in milliseconds. Set to -1 to
5963 disable updates, or to 0 to update as frequently as possible. The
5964 default is 0.
5965
5966 Use this to reduce the overhead of UI update events if your
5967 application has a lot of windows. If you set the value to -1 or
5968 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5969 at appropriate points in your application, such as when a dialog is
5970 about to be shown.
5971 """
554f62e9 5972 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 5973
554f62e9
RD
5974def UpdateUIEvent_GetUpdateInterval(*args):
5975 """
5ba5649b
RD
5976 UpdateUIEvent_GetUpdateInterval() -> long
5977
5978 Returns the current interval between updates in milliseconds. -1
5979 disables updates, 0 updates as frequently as possible.
5980 """
554f62e9 5981 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d55e5bfc
RD
5982
5983def UpdateUIEvent_CanUpdate(*args, **kwargs):
554f62e9 5984 """
5ba5649b
RD
5985 UpdateUIEvent_CanUpdate(Window win) -> bool
5986
5987 Returns ``True`` if it is appropriate to update (send UI update events
5988 to) this window.
5989
5990 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5991 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5992 events were last sent in idle time, and the update interval, to
5993 determine whether events should be sent to this window now. By default
5994 this will always return true because the update mode is initially
5995 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5996 events will be sent as often as possible. You can reduce the frequency
5997 that events are sent by changing the mode and/or setting an update
5998 interval.
5999
6000 """
554f62e9 6001 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 6002
554f62e9
RD
6003def UpdateUIEvent_ResetUpdateTime(*args):
6004 """
5ba5649b
RD
6005 UpdateUIEvent_ResetUpdateTime()
6006
6007 Used internally to reset the last-updated time to the current time. It
6008 is assumed that update events are normally sent in idle time, so this
6009 is called at the end of idle processing.
6010 """
554f62e9 6011 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d55e5bfc
RD
6012
6013def UpdateUIEvent_SetMode(*args, **kwargs):
554f62e9 6014 """
5ba5649b
RD
6015 UpdateUIEvent_SetMode(int mode)
6016
6017 Specify how wxWidgets will send update events: to all windows, or only
6018 to those which specify that they will process the events.
6019
6020 The mode may be one of the following values:
6021
6022 ============================= ==========================================
6023 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6024 is the default setting.
6025 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6026 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6027 style set.
6028 ============================= ==========================================
6029
6030 """
554f62e9 6031 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 6032
554f62e9
RD
6033def UpdateUIEvent_GetMode(*args):
6034 """
5ba5649b
RD
6035 UpdateUIEvent_GetMode() -> int
6036
6037 Returns a value specifying how wxWidgets will send update events: to
6038 all windows, or only to those which specify that they will process the
6039 events.
6040 """
554f62e9 6041 return _core_.UpdateUIEvent_GetMode(*args)
d55e5bfc
RD
6042
6043#---------------------------------------------------------------------------
6044
6045class SysColourChangedEvent(Event):
5ba5649b
RD
6046 """
6047 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6048 when the user changes the colour settings using the control
6049 panel. This is only applicable under Windows.
6050
6051 The default event handler for this event propagates the event to child
6052 windows, since Windows only sends the events to top-level windows. If
6053 intercepting this event for a top-level window, remember to call
6054 `Skip` so the the base class handler will still be executed, or to
6055 pass the event on to the window's children explicitly.
6056
6057 """
554f62e9
RD
6058 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6059 __repr__ = _swig_repr
6060 def __init__(self, *args, **kwargs):
5ba5649b
RD
6061 """
6062 __init__(self) -> SysColourChangedEvent
6063
6064 Constructor
6065 """
554f62e9 6066 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 6067_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d55e5bfc
RD
6068
6069#---------------------------------------------------------------------------
6070
6071class MouseCaptureChangedEvent(Event):
5ba5649b
RD
6072 """
6073 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6074 a window that loses its mouse capture. This is called even if
6075 `wx.Window.ReleaseMouse` was called by the application code. Handling
6076 this event allows an application to cater for unexpected capture
6077 releases which might otherwise confuse mouse handling code.
6078
6079 This event is implemented under Windows only.
6080 """
554f62e9
RD
6081 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6082 __repr__ = _swig_repr
6083 def __init__(self, *args, **kwargs):
5ba5649b
RD
6084 """
6085 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6086
6087 Constructor
6088 """
554f62e9 6089 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
d55e5bfc 6090 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
6091 """
6092 GetCapturedWindow(self) -> Window
6093
6094 Returns the window that gained the capture, or ``None`` if it was a
6095 non-wxWidgets window.
6096 """
d55e5bfc
RD
6097 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
6098
57332a5a 6099 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
2131d850 6100_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d55e5bfc
RD
6101
6102#---------------------------------------------------------------------------
6103
0f83f5da
RD
6104class MouseCaptureLostEvent(Event):
6105 """
6106 A mouse capture lost event is sent to a window that obtained mouse
6107 capture, which was subsequently loss due to "external" event, for
6108 example when a dialog box is shown or if another application captures
6109 the mouse.
6110
6111 If this happens, this event is sent to all windows that are on the
6112 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6113 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6114 if the capture changes because of a call to CaptureMouse or
6115 ReleaseMouse.
6116
6117 This event is currently emitted under Windows only.
6118
6119 """
6120 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6121 __repr__ = _swig_repr
6122 def __init__(self, *args, **kwargs):
6123 """
6124 __init__(self, int winid=0) -> MouseCaptureLostEvent
6125
6126 A mouse capture lost event is sent to a window that obtained mouse
6127 capture, which was subsequently loss due to "external" event, for
6128 example when a dialog box is shown or if another application captures
6129 the mouse.
6130
6131 If this happens, this event is sent to all windows that are on the
6132 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6133 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6134 if the capture changes because of a call to CaptureMouse or
6135 ReleaseMouse.
6136
6137 This event is currently emitted under Windows only.
6138
6139 """
6140 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6141_core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6142
6143#---------------------------------------------------------------------------
6144
d55e5bfc 6145class DisplayChangedEvent(Event):
5ba5649b
RD
6146 """
6147 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6148 resolution has changed.
6149
6150 This event is implemented under Windows only.
6151 """
554f62e9
RD
6152 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6153 __repr__ = _swig_repr
6154 def __init__(self, *args, **kwargs):
d55e5bfc 6155 """__init__(self) -> DisplayChangedEvent"""
554f62e9 6156 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 6157_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d55e5bfc
RD
6158
6159#---------------------------------------------------------------------------
6160
6161class PaletteChangedEvent(Event):
5ba5649b
RD
6162 """
6163 An EVT_PALETTE_CHANGED event is sent when the system palette has
6164 changed, thereby giving each window a chance to redo their own to
6165 match.
6166
6167 This event is implemented under Windows only.
6168 """
554f62e9
RD
6169 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6170 __repr__ = _swig_repr
6171 def __init__(self, *args, **kwargs):
5ba5649b
RD
6172 """
6173 __init__(self, int id=0) -> PaletteChangedEvent
6174
6175 An EVT_PALETTE_CHANGED event is sent when the system palette has
6176 changed, thereby giving each window a chance to redo their own to
6177 match.
6178
6179 This event is implemented under Windows only.
6180 """
554f62e9 6181 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
d55e5bfc
RD
6182 def SetChangedWindow(*args, **kwargs):
6183 """SetChangedWindow(self, Window win)"""
6184 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
6185
6186 def GetChangedWindow(*args, **kwargs):
6187 """GetChangedWindow(self) -> Window"""
6188 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
6189
33d6fd3b 6190 ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`")
2131d850 6191_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d55e5bfc
RD
6192
6193#---------------------------------------------------------------------------
6194
6195class QueryNewPaletteEvent(Event):
5ba5649b
RD
6196 """
6197 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6198 focus and should re-do its palette.
6199
6200 This event is implemented under Windows only.
6201 """
554f62e9
RD
6202 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6203 __repr__ = _swig_repr
6204 def __init__(self, *args, **kwargs):
5ba5649b
RD
6205 """
6206 __init__(self, int winid=0) -> QueryNewPaletteEvent
6207
6208 Constructor.
6209 """
554f62e9 6210 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
d55e5bfc 6211 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6212 """
6213 SetPaletteRealized(self, bool realized)
6214
6215 App should set this if it changes the palette.
6216 """
d55e5bfc
RD
6217 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
6218
6219 def GetPaletteRealized(*args, **kwargs):
6220 """GetPaletteRealized(self) -> bool"""
6221 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
6222
33d6fd3b 6223 PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`")
2131d850 6224_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d55e5bfc
RD
6225
6226#---------------------------------------------------------------------------
6227
6228class NavigationKeyEvent(Event):
5ba5649b
RD
6229 """
6230 EVT_NAVIGATION_KEY events are used to control moving the focus between
6231 widgets, otherwise known as tab-traversal. You woudl normally not
6232 catch navigation events in applications as there are already
6233 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6234 it useful to send navigation events in certain situations to change
6235 the focus in certain ways, although it's probably easier to just call
6236 `wx.Window.Navigate`.
6237 """
554f62e9
RD
6238 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6239 __repr__ = _swig_repr
6240 def __init__(self, *args, **kwargs):
d55e5bfc 6241 """__init__(self) -> NavigationKeyEvent"""
554f62e9 6242 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
d55e5bfc 6243 def GetDirection(*args, **kwargs):
5ba5649b
RD
6244 """
6245 GetDirection(self) -> bool
6246
6247 Returns ``True`` if the direction is forward, ``False`` otherwise.
6248 """
d55e5bfc
RD
6249 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
6250
6251 def SetDirection(*args, **kwargs):
5ba5649b
RD
6252 """
6253 SetDirection(self, bool forward)
6254
6255 Specify the direction that the navigation should take. Usually the
6256 difference between using Tab and Shift-Tab.
6257 """
d55e5bfc
RD
6258 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
6259
6260 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6261 """
6262 IsWindowChange(self) -> bool
6263
6264 Returns ``True`` if window change is allowed.
6265 """
d55e5bfc
RD
6266 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
6267
6268 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6269 """
6270 SetWindowChange(self, bool ischange)
6271
6272 Specify if the navigation should be able to change parent windows.
6273 For example, changing notebook pages, etc. This is usually implemented
6274 by using Control-Tab.
6275 """
d55e5bfc
RD
6276 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
6277
68350608 6278 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6279 """
6280 IsFromTab(self) -> bool
6281
6282 Returns ``True`` if the navigation event is originated from the Tab
6283 key.
6284 """
68350608
RD
6285 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6286
6287 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6288 """
6289 SetFromTab(self, bool bIs)
6290
6291 Set to true under MSW if the event was generated using the tab key.
6292 This is required for proper navogation over radio buttons.
6293 """
68350608
RD
6294 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6295
908b74cd 6296 def SetFlags(*args, **kwargs):
5ba5649b
RD
6297 """
6298 SetFlags(self, long flags)
6299
6300 Set the navigation flags to a combination of the following:
6301
6302 * wx.NavigationKeyEvent.IsBackward
6303 * wx.NavigationKeyEvent.IsForward
6304 * wx.NavigationKeyEvent.WinChange
6305 * wx.NavigationKeyEvent.FromTab
6306
6307 """
908b74cd
RD
6308 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6309
d55e5bfc 6310 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6311 """
6312 GetCurrentFocus(self) -> Window
6313
6314 Returns the child window which currenty has the focus. May be
6315 ``None``.
6316 """
d55e5bfc
RD
6317 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6318
6319 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6320 """
6321 SetCurrentFocus(self, Window win)
6322
6323 Set the window that has the focus.
6324 """
d55e5bfc
RD
6325 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6326
b0f7404b 6327 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
6328 IsForward = _core_.NavigationKeyEvent_IsForward
6329 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 6330 FromTab = _core_.NavigationKeyEvent_FromTab
57332a5a
RD
6331 CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`")
6332 Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`")
2131d850 6333_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d55e5bfc
RD
6334
6335#---------------------------------------------------------------------------
6336
6337class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6338 """
6339 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6340 underlying GUI object) exists.
6341 """
554f62e9
RD
6342 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6343 __repr__ = _swig_repr
6344 def __init__(self, *args, **kwargs):
5ba5649b
RD
6345 """
6346 __init__(self, Window win=None) -> WindowCreateEvent
6347
6348 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6349 underlying GUI object) exists.
6350 """
554f62e9 6351 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
d55e5bfc 6352 def GetWindow(*args, **kwargs):
5ba5649b
RD
6353 """
6354 GetWindow(self) -> Window
6355
6356 Returns the window that this event refers to.
6357 """
d55e5bfc
RD
6358 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6359
dba7934c 6360 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6361_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d55e5bfc
RD
6362
6363class WindowDestroyEvent(CommandEvent):
5ba5649b 6364 """
9d7dfdff
RD
6365 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6366 when the GUI window is destroyed.
6367
6368 When a class derived from `wx.Window` is destroyed its destructor will
6369 have already run by the time this event is sent. Therefore this event
6370 will not usually be received at all by the window itself. Since it is
6371 received after the destructor has run, an object should not try to
6372 handle its own wx.WindowDestroyEvent, but it can be used to get
6373 notification of the destruction of another window.
5ba5649b 6374 """
554f62e9
RD
6375 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6376 __repr__ = _swig_repr
6377 def __init__(self, *args, **kwargs):
5ba5649b
RD
6378 """
6379 __init__(self, Window win=None) -> WindowDestroyEvent
6380
9d7dfdff
RD
6381 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6382 when the GUI window is destroyed.
6383
6384 When a class derived from `wx.Window` is destroyed its destructor will
6385 have already run by the time this event is sent. Therefore this event
6386 will not usually be received at all by the window itself. Since it is
6387 received after the destructor has run, an object should not try to
6388 handle its own wx.WindowDestroyEvent, but it can be used to get
6389 notification of the destruction of another window.
5ba5649b 6390 """
554f62e9 6391 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
d55e5bfc 6392 def GetWindow(*args, **kwargs):
5ba5649b
RD
6393 """
6394 GetWindow(self) -> Window
6395
6396 Returns the window that this event refers to.
6397 """
d55e5bfc
RD
6398 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6399
dba7934c 6400 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6401_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d55e5bfc
RD
6402
6403#---------------------------------------------------------------------------
6404
6405class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6406 """
6407 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6408 give the application a chance to show a context (popup) menu.
6409 """
554f62e9
RD
6410 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6411 __repr__ = _swig_repr
6412 def __init__(self, *args, **kwargs):
5ba5649b 6413 """
f460c29d 6414 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6415
6416 Constructor.
6417 """
554f62e9 6418 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
d55e5bfc 6419 def GetPosition(*args, **kwargs):
5ba5649b
RD
6420 """
6421 GetPosition(self) -> Point
6422
6423 Returns the position (in screen coordinants) at which the menu should
6424 be shown.
6425 """
d55e5bfc
RD
6426 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6427
6428 def SetPosition(*args, **kwargs):
5ba5649b
RD
6429 """
6430 SetPosition(self, Point pos)
6431
6432 Sets the position at which the menu should be shown.
6433 """
d55e5bfc
RD
6434 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6435
226118fc 6436 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 6437_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d55e5bfc
RD
6438
6439#---------------------------------------------------------------------------
6440
6441IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6442IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6443class IdleEvent(Event):
5ba5649b
RD
6444 """
6445 This class is used for EVT_IDLE events, which are generated and sent
6446 when the application *becomes* idle. In other words, the when the
6447 event queue becomes empty then idle events are sent to all windows (by
6448 default) and as long as none of them call `RequestMore` then there are
6449 no more idle events until after the system event queue has some normal
6450 events and then becomes empty again.
6451
6452 By default, idle events are sent to all windows. If this is causing a
6453 significant overhead in your application, you can call
6454 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6455 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6456 which should receive idle events. Then idle events will only be sent
6457 to those windows and not to any others.
6458 """
554f62e9
RD
6459 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6460 __repr__ = _swig_repr
6461 def __init__(self, *args, **kwargs):
5ba5649b
RD
6462 """
6463 __init__(self) -> IdleEvent
6464
6465 Constructor
6466 """
554f62e9 6467 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
d55e5bfc 6468 def RequestMore(*args, **kwargs):
5ba5649b
RD
6469 """
6470 RequestMore(self, bool needMore=True)
6471
6472 Tells wxWidgets that more processing is required. This function can be
6473 called by an EVT_IDLE handler for a window to indicate that the
6474 application should forward the EVT_IDLE event once more to the
6475 application windows. If no window calls this function during its
6476 EVT_IDLE handler, then the application will remain in a passive event
6477 loop until a new event is posted to the application by the windowing
6478 system.
6479 """
d55e5bfc
RD
6480 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6481
6482 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6483 """
6484 MoreRequested(self) -> bool
6485
6486 Returns ``True`` if the OnIdle function processing this event
6487 requested more processing time.
6488 """
d55e5bfc
RD
6489 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6490
6491 def SetMode(*args, **kwargs):
5ba5649b
RD
6492 """
6493 SetMode(int mode)
6494
6495 Static method for specifying how wxWidgets will send idle events: to
6496 all windows, or only to those which specify that they will process the
6497 events.
6498
6499 The mode can be one of the following values:
6500
6501 ========================= ========================================
6502 wx.IDLE_PROCESS_ALL Send idle events to all windows
6503 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6504 the wx.WS_EX_PROCESS_IDLE extra style
6505 flag set.
6506 ========================= ========================================
6507
6508 """
d55e5bfc
RD
6509 return _core_.IdleEvent_SetMode(*args, **kwargs)
6510
6511 SetMode = staticmethod(SetMode)
6512 def GetMode(*args, **kwargs):
5ba5649b
RD
6513 """
6514 GetMode() -> int
6515
6516 Static method returning a value specifying how wxWidgets will send
6517 idle events: to all windows, or only to those which specify that they
6518 will process the events.
6519 """
d55e5bfc
RD
6520 return _core_.IdleEvent_GetMode(*args, **kwargs)
6521
6522 GetMode = staticmethod(GetMode)
6523 def CanSend(*args, **kwargs):
5ba5649b
RD
6524 """
6525 CanSend(Window win) -> bool
6526
6527 Returns ``True`` if it is appropriate to send idle events to this
6528 window.
6529
6530 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6531 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6532 events should be sent to this window now. By default this will always
6533 return ``True`` because the update mode is initially
6534 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6535 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6536 """
d55e5bfc
RD
6537 return _core_.IdleEvent_CanSend(*args, **kwargs)
6538
6539 CanSend = staticmethod(CanSend)
2131d850 6540_core_.IdleEvent_swigregister(IdleEvent)
d55e5bfc
RD
6541
6542def IdleEvent_SetMode(*args, **kwargs):
554f62e9 6543 """
5ba5649b
RD
6544 IdleEvent_SetMode(int mode)
6545
6546 Static method for specifying how wxWidgets will send idle events: to
6547 all windows, or only to those which specify that they will process the
6548 events.
6549
6550 The mode can be one of the following values:
6551
6552 ========================= ========================================
6553 wx.IDLE_PROCESS_ALL Send idle events to all windows
6554 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6555 the wx.WS_EX_PROCESS_IDLE extra style
6556 flag set.
6557 ========================= ========================================
6558
6559 """
554f62e9 6560 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6561
554f62e9
RD
6562def IdleEvent_GetMode(*args):
6563 """
5ba5649b
RD
6564 IdleEvent_GetMode() -> int
6565
6566 Static method returning a value specifying how wxWidgets will send
6567 idle events: to all windows, or only to those which specify that they
6568 will process the events.
6569 """
554f62e9 6570 return _core_.IdleEvent_GetMode(*args)
d55e5bfc
RD
6571
6572def IdleEvent_CanSend(*args, **kwargs):
554f62e9 6573 """
5ba5649b
RD
6574 IdleEvent_CanSend(Window win) -> bool
6575
6576 Returns ``True`` if it is appropriate to send idle events to this
6577 window.
6578
6579 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6580 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6581 events should be sent to this window now. By default this will always
6582 return ``True`` because the update mode is initially
6583 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6584 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6585 """
554f62e9 6586 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6587
6588#---------------------------------------------------------------------------
6589
2131d850
RD
6590class ClipboardTextEvent(CommandEvent):
6591 """
6592 A Clipboard Text event is sent when a window intercepts a text
6593 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6594 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6595 popup menu command, etc. NOTE : under windows these events are *NOT*
6596 generated automatically for a Rich Edit text control.
6597 """
6598 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6599 __repr__ = _swig_repr
6600 def __init__(self, *args, **kwargs):
6601 """
6602 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6603
6604 A Clipboard Text event is sent when a window intercepts a text
6605 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6606 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6607 popup menu command, etc. NOTE : under windows these events are *NOT*
6608 generated automatically for a Rich Edit text control.
6609 """
6610 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6611_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6612
6613#---------------------------------------------------------------------------
6614
d55e5bfc 6615class PyEvent(Event):
5ba5649b
RD
6616 """
6617 wx.PyEvent can be used as a base class for implementing custom event
6618 types in Python. You should derived from this class instead of
6619 `wx.Event` because this class is Python-aware and is able to transport
6620 its Python bits safely through the wxWidgets event system and have
6621 them still be there when the event handler is invoked.
6622
6623 :see: `wx.PyCommandEvent`
6624
6625 """
554f62e9
RD
6626 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6627 __repr__ = _swig_repr
6628 def __init__(self, *args, **kwargs):
f460c29d 6629 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
554f62e9 6630 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6631 self._SetSelf(self)
d55e5bfc 6632
554f62e9
RD
6633 __swig_destroy__ = _core_.delete_PyEvent
6634 __del__ = lambda self : None;
5ba5649b
RD
6635 def _SetSelf(*args, **kwargs):
6636 """_SetSelf(self, PyObject self)"""
6637 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6638
5ba5649b
RD
6639 def _GetSelf(*args, **kwargs):
6640 """_GetSelf(self) -> PyObject"""
6641 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc 6642
2131d850 6643_core_.PyEvent_swigregister(PyEvent)
d55e5bfc
RD
6644
6645class PyCommandEvent(CommandEvent):
5ba5649b
RD
6646 """
6647 wx.PyCommandEvent can be used as a base class for implementing custom
6648 event types in Python, where the event shoudl travel up to parent
6649 windows looking for a handler. You should derived from this class
6650 instead of `wx.CommandEvent` because this class is Python-aware and is
6651 able to transport its Python bits safely through the wxWidgets event
6652 system and have them still be there when the event handler is invoked.
6653
6654 :see: `wx.PyEvent`
6655
6656 """
554f62e9
RD
6657 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6658 __repr__ = _swig_repr
6659 def __init__(self, *args, **kwargs):
f460c29d 6660 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
554f62e9 6661 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6662 self._SetSelf(self)
d55e5bfc 6663
554f62e9
RD
6664 __swig_destroy__ = _core_.delete_PyCommandEvent
6665 __del__ = lambda self : None;
5ba5649b
RD
6666 def _SetSelf(*args, **kwargs):
6667 """_SetSelf(self, PyObject self)"""
6668 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6669
5ba5649b
RD
6670 def _GetSelf(*args, **kwargs):
6671 """_GetSelf(self) -> PyObject"""
6672 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc 6673
2131d850 6674_core_.PyCommandEvent_swigregister(PyCommandEvent)
d55e5bfc 6675
53aa7709 6676class DateEvent(CommandEvent):
5ba5649b
RD
6677 """
6678 This event class holds information about a date change event and is
6679 used together with `wx.DatePickerCtrl`. It also serves as a base class
6680 for `wx.calendar.CalendarEvent`. Bind these event types with
6681 EVT_DATE_CHANGED.
6682 """
554f62e9
RD
6683 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6684 __repr__ = _swig_repr
6685 def __init__(self, *args, **kwargs):
f460c29d 6686 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
554f62e9 6687 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6688 def GetDate(*args, **kwargs):
5ba5649b
RD
6689 """
6690 GetDate(self) -> DateTime
6691
6692 Returns the date.
6693 """
53aa7709
RD
6694 return _core_.DateEvent_GetDate(*args, **kwargs)
6695
6696 def SetDate(*args, **kwargs):
5ba5649b
RD
6697 """
6698 SetDate(self, DateTime date)
6699
6700 Sets the date carried by the event, normally only used by the library
6701 internally.
6702 """
53aa7709
RD
6703 return _core_.DateEvent_SetDate(*args, **kwargs)
6704
226118fc 6705 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
2131d850 6706_core_.DateEvent_swigregister(DateEvent)
53aa7709
RD
6707
6708wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6709EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6710
d55e5bfc
RD
6711#---------------------------------------------------------------------------
6712
6713PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6714PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6715PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6716PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6717PRINT_WINDOWS = _core_.PRINT_WINDOWS
6718PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6719class PyApp(EvtHandler):
c24da6d6
RD
6720 """
6721 The ``wx.PyApp`` class is an *implementation detail*, please use the
6722 `wx.App` class (or some other derived class) instead.
6723 """
554f62e9
RD
6724 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6725 __repr__ = _swig_repr
6726 def __init__(self, *args, **kwargs):
d55e5bfc
RD
6727 """
6728 __init__(self) -> PyApp
6729
6730 Create a new application object, starting the bootstrap process.
6731 """
554f62e9 6732 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
70b7a5fe
RD
6733 self._setCallbackInfo(self, PyApp, False)
6734 self._setOORInfo(self, False)
d55e5bfc 6735
554f62e9
RD
6736 __swig_destroy__ = _core_.delete_PyApp
6737 __del__ = lambda self : None;
d55e5bfc 6738 def _setCallbackInfo(*args, **kwargs):
70b7a5fe 6739 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
d55e5bfc
RD
6740 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6741
6742 def GetAppName(*args, **kwargs):
6743 """
6744 GetAppName(self) -> String
6745
6746 Get the application name.
6747 """
6748 return _core_.PyApp_GetAppName(*args, **kwargs)
6749
6750 def SetAppName(*args, **kwargs):
6751 """
6752 SetAppName(self, String name)
6753
c24da6d6
RD
6754 Set the application name. This value may be used automatically by
6755 `wx.Config` and such.
d55e5bfc
RD
6756 """
6757 return _core_.PyApp_SetAppName(*args, **kwargs)
6758
6759 def GetClassName(*args, **kwargs):
6760 """
6761 GetClassName(self) -> String
6762
6763 Get the application's class name.
6764 """
6765 return _core_.PyApp_GetClassName(*args, **kwargs)
6766
6767 def SetClassName(*args, **kwargs):
6768 """
6769 SetClassName(self, String name)
6770
c24da6d6
RD
6771 Set the application's class name. This value may be used for
6772 X-resources if applicable for the platform
d55e5bfc
RD
6773 """
6774 return _core_.PyApp_SetClassName(*args, **kwargs)
6775
6776 def GetVendorName(*args, **kwargs):
6777 """
6778 GetVendorName(self) -> String
6779
6780 Get the application's vendor name.
6781 """
6782 return _core_.PyApp_GetVendorName(*args, **kwargs)
6783
6784 def SetVendorName(*args, **kwargs):
6785 """
6786 SetVendorName(self, String name)
6787
c24da6d6
RD
6788 Set the application's vendor name. This value may be used
6789 automatically by `wx.Config` and such.
d55e5bfc
RD
6790 """
6791 return _core_.PyApp_SetVendorName(*args, **kwargs)
6792
6793 def GetTraits(*args, **kwargs):
6794 """
6795 GetTraits(self) -> wxAppTraits
6796
c24da6d6
RD
6797 Return (and create if necessary) the app traits object to which we
6798 delegate for everything which either should be configurable by the
6799 user (then he can change the default behaviour simply by overriding
6800 CreateTraits() and returning his own traits object) or which is
6801 GUI/console dependent as then wx.AppTraits allows us to abstract the
6802 differences behind the common facade.
6803
6804 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc
RD
6805 """
6806 return _core_.PyApp_GetTraits(*args, **kwargs)
6807
6808 def ProcessPendingEvents(*args, **kwargs):
6809 """
6810 ProcessPendingEvents(self)
6811
c24da6d6
RD
6812 Process all events in the Pending Events list -- it is necessary to
6813 call this function to process posted events. This normally happens
6814 during each event loop iteration.
d55e5bfc
RD
6815 """
6816 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6817
6818 def Yield(*args, **kwargs):
6819 """
6820 Yield(self, bool onlyIfNeeded=False) -> bool
6821
c24da6d6
RD
6822 Process all currently pending events right now, instead of waiting
6823 until return to the event loop. It is an error to call ``Yield``
6824 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 6825
c24da6d6 6826 :warning: This function is dangerous as it can lead to unexpected
79fccf9d
RD
6827 reentrancies (i.e. when called from an event handler it may
6828 result in calling the same event handler again), use with
6829 extreme care or, better, don't use at all!
d55e5bfc 6830
c24da6d6 6831 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
79fccf9d 6832
d55e5bfc
RD
6833 """
6834 return _core_.PyApp_Yield(*args, **kwargs)
6835
6836 def WakeUpIdle(*args, **kwargs):
6837 """
6838 WakeUpIdle(self)
6839
c24da6d6
RD
6840 Make sure that idle events are sent again.
6841 :see: `wx.WakeUpIdle`
d55e5bfc
RD
6842 """
6843 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6844
84f85550
RD
6845 def IsMainLoopRunning(*args, **kwargs):
6846 """
6847 IsMainLoopRunning() -> bool
6848
6849 Returns True if we're running the main loop, i.e. if the events can
6850 currently be dispatched.
6851 """
6852 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6853
6854 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
6855 def MainLoop(*args, **kwargs):
6856 """
6857 MainLoop(self) -> int
6858
c24da6d6
RD
6859 Execute the main GUI loop, the function doesn't normally return until
6860 all top level windows have been closed and destroyed.
d55e5bfc
RD
6861 """
6862 return _core_.PyApp_MainLoop(*args, **kwargs)
6863
6864 def Exit(*args, **kwargs):
6865 """
6866 Exit(self)
6867
6868 Exit the main loop thus terminating the application.
c24da6d6 6869 :see: `wx.Exit`
d55e5bfc
RD
6870 """
6871 return _core_.PyApp_Exit(*args, **kwargs)
6872
97ab0f6a
RD
6873 def GetLayoutDirection(*args, **kwargs):
6874 """
994453b8 6875 GetLayoutDirection(self) -> int
97ab0f6a
RD
6876
6877 Return the layout direction for the current locale.
6878 """
6879 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
6880
d55e5bfc
RD
6881 def ExitMainLoop(*args, **kwargs):
6882 """
6883 ExitMainLoop(self)
6884
c24da6d6
RD
6885 Exit the main GUI loop during the next iteration of the main
6886 loop, (i.e. it does not stop the program immediately!)
d55e5bfc
RD
6887 """
6888 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
6889
6890 def Pending(*args, **kwargs):
6891 """
6892 Pending(self) -> bool
6893
6894 Returns True if there are unprocessed events in the event queue.
6895 """
6896 return _core_.PyApp_Pending(*args, **kwargs)
6897
6898 def Dispatch(*args, **kwargs):
6899 """
6900 Dispatch(self) -> bool
6901
6902 Process the first event in the event queue (blocks until an event
6903 appears if there are none currently)
6904 """
6905 return _core_.PyApp_Dispatch(*args, **kwargs)
6906
6907 def ProcessIdle(*args, **kwargs):
6908 """
6909 ProcessIdle(self) -> bool
6910
c24da6d6
RD
6911 Called from the MainLoop when the application becomes idle (there are
6912 no pending events) and sends a `wx.IdleEvent` to all interested
6913 parties. Returns True if more idle events are needed, False if not.
d55e5bfc
RD
6914 """
6915 return _core_.PyApp_ProcessIdle(*args, **kwargs)
6916
6917 def SendIdleEvents(*args, **kwargs):
6918 """
6919 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6920
c24da6d6
RD
6921 Send idle event to window and all subwindows. Returns True if more
6922 idle time is requested.
d55e5bfc
RD
6923 """
6924 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
6925
6926 def IsActive(*args, **kwargs):
6927 """
6928 IsActive(self) -> bool
6929
6930 Return True if our app has focus.
6931 """
6932 return _core_.PyApp_IsActive(*args, **kwargs)
6933
6934 def SetTopWindow(*args, **kwargs):
6935 """
6936 SetTopWindow(self, Window win)
6937
c24da6d6 6938 Set the *main* top level window
d55e5bfc
RD
6939 """
6940 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6941
6942 def GetTopWindow(*args, **kwargs):
6943 """
6944 GetTopWindow(self) -> Window
6945
c24da6d6
RD
6946 Return the *main* top level window (if it hadn't been set previously
6947 with SetTopWindow(), will return just some top level window and, if
6948 there not any, will return None)
d55e5bfc
RD
6949 """
6950 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6951
6952 def SetExitOnFrameDelete(*args, **kwargs):
6953 """
6954 SetExitOnFrameDelete(self, bool flag)
6955
c24da6d6
RD
6956 Control the exit behaviour: by default, the program will exit the main
6957 loop (and so, usually, terminate) when the last top-level program
6958 window is deleted. Beware that if you disable this behaviour (with
6959 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6960 explicitly from somewhere.
d55e5bfc
RD
6961 """
6962 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6963
6964 def GetExitOnFrameDelete(*args, **kwargs):
6965 """
6966 GetExitOnFrameDelete(self) -> bool
6967
6968 Get the current exit behaviour setting.
6969 """
6970 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6971
6972 def SetUseBestVisual(*args, **kwargs):
6973 """
6974 SetUseBestVisual(self, bool flag)
6975
c24da6d6
RD
6976 Set whether the app should try to use the best available visual on
6977 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc
RD
6978 """
6979 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6980
6981 def GetUseBestVisual(*args, **kwargs):
6982 """
6983 GetUseBestVisual(self) -> bool
6984
6985 Get current UseBestVisual setting.
6986 """
6987 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6988
6989 def SetPrintMode(*args, **kwargs):
6990 """SetPrintMode(self, int mode)"""
6991 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6992
6993 def GetPrintMode(*args, **kwargs):
6994 """GetPrintMode(self) -> int"""
6995 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6996
6997 def SetAssertMode(*args, **kwargs):
6998 """
6999 SetAssertMode(self, int mode)
7000
79fccf9d 7001 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc
RD
7002 """
7003 return _core_.PyApp_SetAssertMode(*args, **kwargs)
7004
7005 def GetAssertMode(*args, **kwargs):
7006 """
7007 GetAssertMode(self) -> int
7008
7009 Get the current OnAssert behaviour setting.
7010 """
7011 return _core_.PyApp_GetAssertMode(*args, **kwargs)
7012
7013 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 7014 """GetMacSupportPCMenuShortcuts() -> bool"""
d55e5bfc
RD
7015 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
7016
7017 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7018 def GetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 7019 """GetMacAboutMenuItemId() -> long"""
d55e5bfc
RD
7020 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
7021
7022 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7023 def GetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 7024 """GetMacPreferencesMenuItemId() -> long"""
d55e5bfc
RD
7025 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
7026
7027 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7028 def GetMacExitMenuItemId(*args, **kwargs):
c24da6d6 7029 """GetMacExitMenuItemId() -> long"""
d55e5bfc
RD
7030 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
7031
7032 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7033 def GetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 7034 """GetMacHelpMenuTitleName() -> String"""
d55e5bfc
RD
7035 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
7036
7037 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7038 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 7039 """SetMacSupportPCMenuShortcuts(bool val)"""
d55e5bfc
RD
7040 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
7041
7042 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7043 def SetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 7044 """SetMacAboutMenuItemId(long val)"""
d55e5bfc
RD
7045 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
7046
7047 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7048 def SetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 7049 """SetMacPreferencesMenuItemId(long val)"""
d55e5bfc
RD
7050 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
7051
7052 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7053 def SetMacExitMenuItemId(*args, **kwargs):
c24da6d6 7054 """SetMacExitMenuItemId(long val)"""
d55e5bfc
RD
7055 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
7056
7057 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7058 def SetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 7059 """SetMacHelpMenuTitleName(String val)"""
d55e5bfc
RD
7060 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
7061
7062 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7063 def _BootstrapApp(*args, **kwargs):
7064 """
7065 _BootstrapApp(self)
7066
7067 For internal use only
7068 """
7069 return _core_.PyApp__BootstrapApp(*args, **kwargs)
7070
7071 def GetComCtl32Version(*args, **kwargs):
7072 """
c24da6d6 7073 GetComCtl32Version() -> int
d55e5bfc 7074
c24da6d6
RD
7075 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7076 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc
RD
7077 """
7078 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
7079
7080 GetComCtl32Version = staticmethod(GetComCtl32Version)
33d6fd3b 7081 def IsDisplayAvailable(*args, **kwargs):
fc46b7f3 7082 """
33d6fd3b 7083 IsDisplayAvailable() -> bool
fc46b7f3
RD
7084
7085 Tests if it is possible to create a GUI in the current environment.
7086 This will mean different things on the different platforms.
7087
7088 * On X Windows systems this function will return ``False`` if it is
7089 not able to open a connection to the X display, which can happen
7090 if $DISPLAY is not set, or is not set correctly.
7091
7092 * On Mac OS X a ``False`` return value will mean that wx is not
7093 able to access the window manager, which can happen if logged in
7094 remotely or if running from the normal version of python instead
7095 of the framework version, (i.e., pythonw.)
7096
7097 * On MS Windows...
7098
7099 """
33d6fd3b
RD
7100 return _core_.PyApp_IsDisplayAvailable(*args, **kwargs)
7101
7102 IsDisplayAvailable = staticmethod(IsDisplayAvailable)
7103 AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`")
7104 AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`")
7105 ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`")
7106 ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7107 LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`")
7108 PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`")
7109 TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`")
7110 Traits = property(GetTraits,doc="See `GetTraits`")
7111 UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`")
7112 VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`")
7113 Active = property(IsActive)
2131d850 7114_core_.PyApp_swigregister(PyApp)
d55e5bfc 7115
554f62e9
RD
7116def PyApp_IsMainLoopRunning(*args):
7117 """
84f85550
RD
7118 PyApp_IsMainLoopRunning() -> bool
7119
7120 Returns True if we're running the main loop, i.e. if the events can
7121 currently be dispatched.
7122 """
554f62e9 7123 return _core_.PyApp_IsMainLoopRunning(*args)
84f85550 7124
554f62e9
RD
7125def PyApp_GetMacSupportPCMenuShortcuts(*args):
7126 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7127 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d55e5bfc 7128
554f62e9
RD
7129def PyApp_GetMacAboutMenuItemId(*args):
7130 """PyApp_GetMacAboutMenuItemId() -> long"""
7131 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d55e5bfc 7132
554f62e9
RD
7133def PyApp_GetMacPreferencesMenuItemId(*args):
7134 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7135 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d55e5bfc 7136
554f62e9
RD
7137def PyApp_GetMacExitMenuItemId(*args):
7138 """PyApp_GetMacExitMenuItemId() -> long"""
7139 return _core_.PyApp_GetMacExitMenuItemId(*args)
d55e5bfc 7140
554f62e9
RD
7141def PyApp_GetMacHelpMenuTitleName(*args):
7142 """PyApp_GetMacHelpMenuTitleName() -> String"""
7143 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d55e5bfc
RD
7144
7145def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
554f62e9
RD
7146 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7147 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7148
7149def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
554f62e9
RD
7150 """PyApp_SetMacAboutMenuItemId(long val)"""
7151 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7152
7153def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
554f62e9
RD
7154 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7155 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7156
7157def PyApp_SetMacExitMenuItemId(*args, **kwargs):
554f62e9
RD
7158 """PyApp_SetMacExitMenuItemId(long val)"""
7159 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7160
7161def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
554f62e9
RD
7162 """PyApp_SetMacHelpMenuTitleName(String val)"""
7163 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 7164
554f62e9
RD
7165def PyApp_GetComCtl32Version(*args):
7166 """
d55e5bfc
RD
7167 PyApp_GetComCtl32Version() -> int
7168
c24da6d6
RD
7169 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7170 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 7171 """
554f62e9 7172 return _core_.PyApp_GetComCtl32Version(*args)
d55e5bfc 7173
33d6fd3b 7174def PyApp_IsDisplayAvailable(*args):
fc46b7f3 7175 """
33d6fd3b 7176 PyApp_IsDisplayAvailable() -> bool
fc46b7f3
RD
7177
7178 Tests if it is possible to create a GUI in the current environment.
7179 This will mean different things on the different platforms.
7180
7181 * On X Windows systems this function will return ``False`` if it is
7182 not able to open a connection to the X display, which can happen
7183 if $DISPLAY is not set, or is not set correctly.
7184
7185 * On Mac OS X a ``False`` return value will mean that wx is not
7186 able to access the window manager, which can happen if logged in
7187 remotely or if running from the normal version of python instead
7188 of the framework version, (i.e., pythonw.)
7189
7190 * On MS Windows...
7191
7192 """
33d6fd3b 7193 return _core_.PyApp_IsDisplayAvailable(*args)
fc46b7f3 7194
d55e5bfc
RD
7195#---------------------------------------------------------------------------
7196
7197
554f62e9
RD
7198def Exit(*args):
7199 """
d55e5bfc
RD
7200 Exit()
7201
7202 Force an exit of the application. Convenience for wx.GetApp().Exit()
7203 """
554f62e9 7204 return _core_.Exit(*args)
d55e5bfc 7205
554f62e9
RD
7206def Yield(*args):
7207 """
d55e5bfc
RD
7208 Yield() -> bool
7209
7210 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7211 """
554f62e9 7212 return _core_.Yield(*args)
d55e5bfc 7213
554f62e9
RD
7214def YieldIfNeeded(*args):
7215 """
d55e5bfc
RD
7216 YieldIfNeeded() -> bool
7217
7218 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7219 """
554f62e9 7220 return _core_.YieldIfNeeded(*args)
d55e5bfc
RD
7221
7222def SafeYield(*args, **kwargs):
554f62e9 7223 """
d55e5bfc
RD
7224 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
7225
c24da6d6
RD
7226 This function is similar to `wx.Yield`, except that it disables the
7227 user input to all program windows before calling `wx.Yield` and
7228 re-enables it again afterwards. If ``win`` is not None, this window
7229 will remain enabled, allowing the implementation of some limited user
7230 interaction.
d55e5bfc 7231
c24da6d6 7232 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 7233 """
554f62e9 7234 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 7235
554f62e9
RD
7236def WakeUpIdle(*args):
7237 """
d55e5bfc
RD
7238 WakeUpIdle()
7239
c24da6d6
RD
7240 Cause the message queue to become empty again, so idle events will be
7241 sent.
d55e5bfc 7242 """
554f62e9 7243 return _core_.WakeUpIdle(*args)
d55e5bfc
RD
7244
7245def PostEvent(*args, **kwargs):
554f62e9 7246 """
d55e5bfc
RD
7247 PostEvent(EvtHandler dest, Event event)
7248
c24da6d6
RD
7249 Send an event to a window or other wx.EvtHandler to be processed
7250 later.
d55e5bfc 7251 """
554f62e9 7252 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 7253
554f62e9
RD
7254def App_CleanUp(*args):
7255 """
d55e5bfc
RD
7256 App_CleanUp()
7257
79fccf9d 7258 For internal use only, it is used to cleanup after wxWidgets when
c24da6d6 7259 Python shuts down.
d55e5bfc 7260 """
554f62e9 7261 return _core_.App_CleanUp(*args)
d55e5bfc 7262
554f62e9
RD
7263def GetApp(*args):
7264 """
d55e5bfc
RD
7265 GetApp() -> PyApp
7266
7267 Return a reference to the current wx.App object.
7268 """
554f62e9 7269 return _core_.GetApp(*args)
5cbf236d
RD
7270
7271def SetDefaultPyEncoding(*args, **kwargs):
554f62e9 7272 """
5cbf236d
RD
7273 SetDefaultPyEncoding(string encoding)
7274
7275 Sets the encoding that wxPython will use when it needs to convert a
7276 Python string or unicode object to or from a wxString.
62d32a5f
RD
7277
7278 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7279 but please be aware that the default encoding within the same locale
7280 may be slightly different on different platforms. For example, please
7281 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7282 between the common latin/roman encodings.
5cbf236d 7283 """
554f62e9 7284 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 7285
554f62e9
RD
7286def GetDefaultPyEncoding(*args):
7287 """
5cbf236d
RD
7288 GetDefaultPyEncoding() -> string
7289
7290 Gets the current encoding that wxPython will use when it needs to
7291 convert a Python string or unicode object to or from a wxString.
7292 """
554f62e9 7293 return _core_.GetDefaultPyEncoding(*args)
d55e5bfc
RD
7294#----------------------------------------------------------------------
7295
7296class PyOnDemandOutputWindow:
7297 """
7298 A class that can be used for redirecting Python's stdout and
7299 stderr streams. It will do nothing until something is wrriten to
7300 the stream at which point it will create a Frame with a text area
7301 and write the text there.
7302 """
7303 def __init__(self, title = "wxPython: stdout/stderr"):
7304 self.frame = None
7305 self.title = title
412d302d
RD
7306 self.pos = wx.DefaultPosition
7307 self.size = (450, 300)
d55e5bfc
RD
7308 self.parent = None
7309
7310 def SetParent(self, parent):
7311 """Set the window to be used as the popup Frame's parent."""
7312 self.parent = parent
7313
7314
7315 def CreateOutputWindow(self, st):
412d302d
RD
7316 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7317 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 7318 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7319 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 7320 self.text.AppendText(st)
d55e5bfc 7321 self.frame.Show(True)
2131d850 7322 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
d55e5bfc
RD
7323
7324
7325 def OnCloseWindow(self, event):
7326 if self.frame is not None:
7327 self.frame.Destroy()
7328 self.frame = None
7329 self.text = None
7330
7331
7332 # These methods provide the file-like output behaviour.
7333 def write(self, text):
7334 """
7335 Create the output window if needed and write the string to it.
7336 If not called in the context of the gui thread then uses
7337 CallAfter to do the work there.
7338 """
7339 if self.frame is None:
7340 if not wx.Thread_IsMain():
7341 wx.CallAfter(self.CreateOutputWindow, text)
7342 else:
7343 self.CreateOutputWindow(text)
7344 else:
7345 if not wx.Thread_IsMain():
7346 wx.CallAfter(self.text.AppendText, text)
7347 else:
7348 self.text.AppendText(text)
7349
7350
7351 def close(self):
7352 if self.frame is not None:
7353 wx.CallAfter(self.frame.Close)
7354
7355
19272049
RD
7356 def flush(self):
7357 pass
7358
7359
d55e5bfc
RD
7360
7361#----------------------------------------------------------------------
7362
7363_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
fc46b7f3 7364
d55e5bfc
RD
7365class App(wx.PyApp):
7366 """
c24da6d6
RD
7367 The ``wx.App`` class represents the application and is used to:
7368
7369 * bootstrap the wxPython system and initialize the underlying
7370 gui toolkit
7371 * set and get application-wide properties
7372 * implement the windowing system main message or event loop,
7373 and to dispatch events to window instances
7374 * etc.
7375
7376 Every application must have a ``wx.App`` instance, and all
7377 creation of UI objects should be delayed until after the
7378 ``wx.App`` object has been created in order to ensure that the gui
7379 platform and wxWidgets have been fully initialized.
7380
7381 Normally you would derive from this class and implement an
7382 ``OnInit`` method that creates a frame and then calls
7383 ``self.SetTopWindow(frame)``.
7384
7385 :see: `wx.PySimpleApp` for a simpler app class that can be used
79fccf9d 7386 directly.
d55e5bfc 7387 """
c24da6d6 7388
d55e5bfc
RD
7389 outputWindowClass = PyOnDemandOutputWindow
7390
c24da6d6
RD
7391 def __init__(self, redirect=_defRedirect, filename=None,
7392 useBestVisual=False, clearSigInt=True):
7393 """
7394 Construct a ``wx.App`` object.
7395
7396 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7397 redirected? Defaults to True on Windows and Mac, False
7398 otherwise. If `filename` is None then output will be
7399 redirected to a window that pops up as needed. (You can
7400 control what kind of window is created for the output by
7401 resetting the class variable ``outputWindowClass`` to a
7402 class of your choosing.)
7403
7404 :param filename: The name of a file to redirect output to, if
7405 redirect is True.
7406
7407 :param useBestVisual: Should the app try to use the best
7408 available visual provided by the system (only relevant on
7409 systems that have more than one visual.) This parameter
7410 must be used instead of calling `SetUseBestVisual` later
7411 on because it must be set before the underlying GUI
7412 toolkit is initialized.
7413
7414 :param clearSigInt: Should SIGINT be cleared? This allows the
7415 app to terminate upon a Ctrl-C in the console like other
7416 GUI apps will.
7417
7418 :note: You should override OnInit to do applicaition
7419 initialization to ensure that the system, toolkit and
7420 wxWidgets are fully initialized.
7421 """
fc46b7f3 7422
d55e5bfc
RD
7423 wx.PyApp.__init__(self)
7424
fc46b7f3 7425 # make sure we can create a GUI
33d6fd3b 7426 if not self.IsDisplayAvailable():
fc46b7f3
RD
7427
7428 if wx.Platform == "__WXMAC__":
7429 msg = """This program needs access to the screen.
7430Please run with 'pythonw', not 'python', and only when you are logged
7431in on the main display of your Mac."""
7432
7433 elif wx.Platform == "__WXGTK__":
7434 msg ="Unable to access the X Display, is $DISPLAY set properly?"
d55e5bfc 7435
fc46b7f3
RD
7436 else:
7437 msg = "Unable to create GUI"
7438 # TODO: more description is needed for wxMSW...
7439
7440 raise SystemExit(msg)
7441
d55e5bfc
RD
7442 # This has to be done before OnInit
7443 self.SetUseBestVisual(useBestVisual)
7444
7445 # Set the default handler for SIGINT. This fixes a problem
7446 # where if Ctrl-C is pressed in the console that started this
7447 # app then it will not appear to do anything, (not even send
7448 # KeyboardInterrupt???) but will later segfault on exit. By
7449 # setting the default handler then the app will exit, as
7450 # expected (depending on platform.)
c24da6d6
RD
7451 if clearSigInt:
7452 try:
7453 import signal
7454 signal.signal(signal.SIGINT, signal.SIG_DFL)
7455 except:
7456 pass
d55e5bfc
RD
7457
7458 # Save and redirect the stdio to a window?
7459 self.stdioWin = None
7460 self.saveStdio = (_sys.stdout, _sys.stderr)
7461 if redirect:
7462 self.RedirectStdio(filename)
7463
8fb0e70a
RD
7464 # Use Python's install prefix as the default
7465 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7466
d55e5bfc
RD
7467 # This finishes the initialization of wxWindows and then calls
7468 # the OnInit that should be present in the derived class
7469 self._BootstrapApp()
7470
7471
f460c29d
RD
7472 def OnPreInit(self):
7473 """
7474 Things that must be done after _BootstrapApp has done its
7475 thing, but would be nice if they were already done by the time
7476 that OnInit is called.
7477 """
7478 wx.StockGDI._initStockObjects()
7479
7480
66af7a75
RD
7481 def __del__(self, destroy=wx.PyApp.__del__):
7482 self.RestoreStdio() # Just in case the MainLoop was overridden
7483 destroy(self)
d55e5bfc 7484
70b7a5fe
RD
7485 def Destroy(self):
7486 wx.PyApp.Destroy(self)
7487 self.thisown = 0
d55e5bfc
RD
7488
7489 def SetTopWindow(self, frame):
7490 """Set the \"main\" top level window"""
7491 if self.stdioWin:
7492 self.stdioWin.SetParent(frame)
7493 wx.PyApp.SetTopWindow(self, frame)
7494
7495
7496 def MainLoop(self):
7497 """Execute the main GUI event loop"""
7498 wx.PyApp.MainLoop(self)
7499 self.RestoreStdio()
7500
7501
7502 def RedirectStdio(self, filename=None):
7503 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7504 if filename:
7505 _sys.stdout = _sys.stderr = open(filename, 'a')
7506 else:
7507 self.stdioWin = self.outputWindowClass()
7508 _sys.stdout = _sys.stderr = self.stdioWin
7509
7510
7511 def RestoreStdio(self):
66af7a75
RD
7512 try:
7513 _sys.stdout, _sys.stderr = self.saveStdio
7514 except:
7515 pass
d55e5bfc
RD
7516
7517
412d302d
RD
7518 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7519 """
7520 Set the title, position and/or size of the output window if
f5b96ee1
RD
7521 the stdio has been redirected. This should be called before
7522 any output would cause the output window to be created.
412d302d
RD
7523 """
7524 if self.stdioWin:
7525 if title is not None:
7526 self.stdioWin.title = title
7527 if pos is not None:
7528 self.stdioWin.pos = pos
7529 if size is not None:
7530 self.stdioWin.size = size
7531
7532
7533
d55e5bfc 7534
c24da6d6 7535# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7536App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7537App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7538App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7539App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7540App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7541App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7542App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7543App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7544App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7545App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7546App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7547
7548#----------------------------------------------------------------------------
7549
7550class PySimpleApp(wx.App):
7551 """
7552 A simple application class. You can just create one of these and
7553 then then make your top level windows later, and not have to worry
c24da6d6 7554 about OnInit. For example::
d55e5bfc 7555
c24da6d6
RD
7556 app = wx.PySimpleApp()
7557 frame = wx.Frame(None, title='Hello World')
7558 frame.Show()
7559 app.MainLoop()
7560
7561 :see: `wx.App`
7562 """
7563
7564 def __init__(self, redirect=False, filename=None,
7565 useBestVisual=False, clearSigInt=True):
7566 """
7567 :see: `wx.App.__init__`
7568 """
7569 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7570
7571 def OnInit(self):
d55e5bfc
RD
7572 return True
7573
7574
c24da6d6 7575
d55e5bfc
RD
7576# Is anybody using this one?
7577class PyWidgetTester(wx.App):
7578 def __init__(self, size = (250, 100)):
7579 self.size = size
7580 wx.App.__init__(self, 0)
7581
7582 def OnInit(self):
7583 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7584 self.SetTopWindow(self.frame)
7585 return True
7586
c24da6d6
RD
7587 def SetWidget(self, widgetClass, *args, **kwargs):
7588 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7589 self.frame.Show(True)
7590
7591#----------------------------------------------------------------------------
7592# DO NOT hold any other references to this object. This is how we
c24da6d6 7593# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7594# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
c24da6d6 7595# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7596
7597class __wxPyCleanup:
7598 def __init__(self):
7599 self.cleanup = _core_.App_CleanUp
7600 def __del__(self):
7601 self.cleanup()
7602
7603_sys.__wxPythonCleanup = __wxPyCleanup()
7604
7605## # another possible solution, but it gets called too early...
c24da6d6
RD
7606## import atexit
7607## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7608
7609
7610#----------------------------------------------------------------------------
7611
7612#---------------------------------------------------------------------------
7613
ae8162c8 7614class EventLoop(object):
093d3ff1 7615 """Proxy of C++ EventLoop class"""
554f62e9
RD
7616 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7617 __repr__ = _swig_repr
7618 def __init__(self, *args, **kwargs):
ae8162c8 7619 """__init__(self) -> EventLoop"""
554f62e9
RD
7620 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7621 __swig_destroy__ = _core_.delete_EventLoop
7622 __del__ = lambda self : None;
ae8162c8
RD
7623 def Run(*args, **kwargs):
7624 """Run(self) -> int"""
7625 return _core_.EventLoop_Run(*args, **kwargs)
7626
7627 def Exit(*args, **kwargs):
7628 """Exit(self, int rc=0)"""
7629 return _core_.EventLoop_Exit(*args, **kwargs)
7630
7631 def Pending(*args, **kwargs):
7632 """Pending(self) -> bool"""
7633 return _core_.EventLoop_Pending(*args, **kwargs)
7634
7635 def Dispatch(*args, **kwargs):
7636 """Dispatch(self) -> bool"""
7637 return _core_.EventLoop_Dispatch(*args, **kwargs)
7638
7639 def IsRunning(*args, **kwargs):
7640 """IsRunning(self) -> bool"""
7641 return _core_.EventLoop_IsRunning(*args, **kwargs)
7642
7643 def GetActive(*args, **kwargs):
7644 """GetActive() -> EventLoop"""
7645 return _core_.EventLoop_GetActive(*args, **kwargs)
7646
7647 GetActive = staticmethod(GetActive)
7648 def SetActive(*args, **kwargs):
7649 """SetActive(EventLoop loop)"""
7650 return _core_.EventLoop_SetActive(*args, **kwargs)
7651
7652 SetActive = staticmethod(SetActive)
2131d850 7653_core_.EventLoop_swigregister(EventLoop)
ae8162c8 7654
554f62e9
RD
7655def EventLoop_GetActive(*args):
7656 """EventLoop_GetActive() -> EventLoop"""
7657 return _core_.EventLoop_GetActive(*args)
ae8162c8
RD
7658
7659def EventLoop_SetActive(*args, **kwargs):
554f62e9
RD
7660 """EventLoop_SetActive(EventLoop loop)"""
7661 return _core_.EventLoop_SetActive(*args, **kwargs)
ae8162c8 7662
7449af73
RD
7663class EventLoopActivator(object):
7664 """Proxy of C++ EventLoopActivator class"""
554f62e9
RD
7665 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7666 __repr__ = _swig_repr
7667 def __init__(self, *args, **kwargs):
7449af73 7668 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
554f62e9
RD
7669 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7670 __swig_destroy__ = _core_.delete_EventLoopActivator
7671 __del__ = lambda self : None;
2131d850 7672_core_.EventLoopActivator_swigregister(EventLoopActivator)
7449af73 7673
ae8162c8
RD
7674#---------------------------------------------------------------------------
7675
eec1c382
RD
7676ACCEL_ALT = _core_.ACCEL_ALT
7677ACCEL_CTRL = _core_.ACCEL_CTRL
7678ACCEL_SHIFT = _core_.ACCEL_SHIFT
7679ACCEL_NORMAL = _core_.ACCEL_NORMAL
7680ACCEL_CMD = _core_.ACCEL_CMD
d55e5bfc 7681class AcceleratorEntry(object):
c24da6d6
RD
7682 """
7683 A class used to define items in an `wx.AcceleratorTable`. wxPython
7684 programs can choose to use wx.AcceleratorEntry objects, but using a
7685 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
79fccf9d 7686 as well. See `__init__` for of the tuple values.
c24da6d6
RD
7687
7688 :see: `wx.AcceleratorTable`
7689 """
554f62e9
RD
7690 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7691 __repr__ = _swig_repr
7692 def __init__(self, *args, **kwargs):
c24da6d6
RD
7693 """
7694 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7695
7696 Construct a wx.AcceleratorEntry.
c24da6d6 7697 """
554f62e9
RD
7698 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7699 __swig_destroy__ = _core_.delete_AcceleratorEntry
7700 __del__ = lambda self : None;
d55e5bfc 7701 def Set(*args, **kwargs):
c24da6d6
RD
7702 """
7703 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 7704
c24da6d6
RD
7705 (Re)set the attributes of a wx.AcceleratorEntry.
7706 :see `__init__`
7707 """
7708 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc 7709
97ab0f6a
RD
7710 def Create(*args, **kwargs):
7711 """
7712 Create(String str) -> AcceleratorEntry
7713
7714 Create accelerator corresponding to the specified string, or None if
7715 it coulnd't be parsed.
7716 """
7717 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7718
7719 Create = staticmethod(Create)
d55e5bfc 7720 def GetFlags(*args, **kwargs):
c24da6d6
RD
7721 """
7722 GetFlags(self) -> int
7723
7724 Get the AcceleratorEntry's flags.
7725 """
d55e5bfc
RD
7726 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7727
7728 def GetKeyCode(*args, **kwargs):
c24da6d6
RD
7729 """
7730 GetKeyCode(self) -> int
7731
7732 Get the AcceleratorEntry's keycode.
7733 """
d55e5bfc
RD
7734 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7735
7736 def GetCommand(*args, **kwargs):
c24da6d6
RD
7737 """
7738 GetCommand(self) -> int
7739
7740 Get the AcceleratorEntry's command ID.
7741 """
d55e5bfc
RD
7742 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7743
97ab0f6a
RD
7744 def IsOk(*args, **kwargs):
7745 """IsOk(self) -> bool"""
7746 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
7747
7748 def ToString(*args, **kwargs):
7749 """
7750 ToString(self) -> String
7751
7752 Returns a string representation for the this accelerator. The string
7753 is formatted using the <flags>-<keycode> format where <flags> maybe a
7754 hyphen-separed list of "shift|alt|ctrl"
7755
7756 """
7757 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
7758
7759 def FromString(*args, **kwargs):
7760 """
7761 FromString(self, String str) -> bool
7762
7763 Returns true if the given string correctly initialized this object.
7764 """
7765 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
7766
226118fc
RD
7767 Command = property(GetCommand,doc="See `GetCommand`")
7768 Flags = property(GetFlags,doc="See `GetFlags`")
7769 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
2131d850 7770_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
d55e5bfc 7771
97ab0f6a
RD
7772def AcceleratorEntry_Create(*args, **kwargs):
7773 """
7774 AcceleratorEntry_Create(String str) -> AcceleratorEntry
7775
7776 Create accelerator corresponding to the specified string, or None if
7777 it coulnd't be parsed.
7778 """
7779 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7780
d55e5bfc 7781class AcceleratorTable(Object):
c24da6d6
RD
7782 """
7783 An accelerator table allows the application to specify a table of
7784 keyboard shortcuts for menus or other commands. On Windows, menu or
7785 button commands are supported; on GTK, only menu commands are
7786 supported.
c24da6d6 7787 """
554f62e9
RD
7788 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7789 __repr__ = _swig_repr
7790 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7791 """
7792 __init__(entries) -> AcceleratorTable
7793
c24da6d6
RD
7794 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7795 items or or of 3-tuples (flags, keyCode, cmdID)
7796
7797 :see: `wx.AcceleratorEntry`
d55e5bfc 7798 """
554f62e9
RD
7799 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7800 __swig_destroy__ = _core_.delete_AcceleratorTable
7801 __del__ = lambda self : None;
d55e5bfc
RD
7802 def Ok(*args, **kwargs):
7803 """Ok(self) -> bool"""
7804 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7805
2131d850 7806_core_.AcceleratorTable_swigregister(AcceleratorTable)
d55e5bfc
RD
7807
7808
7809def GetAccelFromString(*args, **kwargs):
554f62e9
RD
7810 """GetAccelFromString(String label) -> AcceleratorEntry"""
7811 return _core_.GetAccelFromString(*args, **kwargs)
d55e5bfc
RD
7812#---------------------------------------------------------------------------
7813
7814class VisualAttributes(object):
7815 """struct containing all the visual attributes of a control"""
554f62e9
RD
7816 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7817 __repr__ = _swig_repr
7818 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7819 """
7820 __init__(self) -> VisualAttributes
7821
7822 struct containing all the visual attributes of a control
7823 """
554f62e9
RD
7824 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7825 __swig_destroy__ = _core_.delete_VisualAttributes
7826 __del__ = lambda self : None;
d55e5bfc
RD
7827 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7828 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7829 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 7830_core_.VisualAttributes_swigregister(VisualAttributes)
d55e5bfc
RD
7831NullAcceleratorTable = cvar.NullAcceleratorTable
7832PanelNameStr = cvar.PanelNameStr
7833
7834WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7835WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7836WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7837WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7838WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7839class Window(EvtHandler):
7840 """
7841 wx.Window is the base class for all windows and represents any visible
7842 object on the screen. All controls, top level windows and so on are
7843 wx.Windows. Sizers and device contexts are not however, as they don't
7844 appear on screen themselves.
7845
7846 """
554f62e9
RD
7847 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7848 __repr__ = _swig_repr
7849 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7850 """
7851 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7852 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7853
7854 Construct and show a generic Window.
7855 """
554f62e9 7856 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d55e5bfc
RD
7857 self._setOORInfo(self)
7858
7859 def Create(*args, **kwargs):
7860 """
7861 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7862 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7863
7864 Create the GUI part of the Window for 2-phase creation mode.
7865 """
7866 return _core_.Window_Create(*args, **kwargs)
7867
7868 def Close(*args, **kwargs):
7869 """
7870 Close(self, bool force=False) -> bool
7871
7872 This function simply generates a EVT_CLOSE event whose handler usually
7873 tries to close the window. It doesn't close the window itself,
7874 however. If force is False (the default) then the window's close
7875 handler will be allowed to veto the destruction of the window.
d55e5bfc
RD
7876 """
7877 return _core_.Window_Close(*args, **kwargs)
7878
7879 def Destroy(*args, **kwargs):
7880 """
7881 Destroy(self) -> bool
7882
7883 Destroys the window safely. Frames and dialogs are not destroyed
7884 immediately when this function is called -- they are added to a list
7885 of windows to be deleted on idle time, when all the window's events
7886 have been processed. This prevents problems with events being sent to
7887 non-existent windows.
7888
7889 Returns True if the window has either been successfully deleted, or it
7890 has been added to the list of windows pending real deletion.
7891 """
7e08d4ef
RD
7892 val = _core_.Window_Destroy(*args, **kwargs)
7893 args[0].thisown = 0
7894 return val
d55e5bfc
RD
7895
7896 def DestroyChildren(*args, **kwargs):
7897 """
7898 DestroyChildren(self) -> bool
7899
79fccf9d
RD
7900 Destroys all children of a window. Called automatically by the
7901 destructor.
d55e5bfc
RD
7902 """
7903 return _core_.Window_DestroyChildren(*args, **kwargs)
7904
7905 def IsBeingDeleted(*args, **kwargs):
7906 """
7907 IsBeingDeleted(self) -> bool
7908
7909 Is the window in the process of being deleted?
7910 """
7911 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7912
d55e5bfc
RD
7913 def SetLabel(*args, **kwargs):
7914 """
7915 SetLabel(self, String label)
7916
7917 Set the text which the window shows in its label if applicable.
7918 """
7919 return _core_.Window_SetLabel(*args, **kwargs)
7920
7921 def GetLabel(*args, **kwargs):
7922 """
7923 GetLabel(self) -> String
7924
79fccf9d
RD
7925 Generic way of getting a label from any window, for identification
7926 purposes. The interpretation of this function differs from class to
7927 class. For frames and dialogs, the value returned is the title. For
7928 buttons or static text controls, it is the button text. This function
7929 can be useful for meta-programs such as testing tools or special-needs
7930 access programs)which need to identify windows by name.
d55e5bfc
RD
7931 """
7932 return _core_.Window_GetLabel(*args, **kwargs)
7933
7934 def SetName(*args, **kwargs):
7935 """
7936 SetName(self, String name)
7937
79fccf9d
RD
7938 Sets the window's name. The window name is used for ressource setting
7939 in X, it is not the same as the window title/label
d55e5bfc
RD
7940 """
7941 return _core_.Window_SetName(*args, **kwargs)
7942
7943 def GetName(*args, **kwargs):
7944 """
7945 GetName(self) -> String
7946
79fccf9d
RD
7947 Returns the windows name. This name is not guaranteed to be unique;
7948 it is up to the programmer to supply an appropriate name in the window
7949 constructor or via wx.Window.SetName.
d55e5bfc
RD
7950 """
7951 return _core_.Window_GetName(*args, **kwargs)
7952
7953 def SetWindowVariant(*args, **kwargs):
7954 """
7955 SetWindowVariant(self, int variant)
7956
79fccf9d
RD
7957 Sets the variant of the window/font size to use for this window, if
7958 the platform supports variants, for example, wxMac.
d55e5bfc
RD
7959 """
7960 return _core_.Window_SetWindowVariant(*args, **kwargs)
7961
7962 def GetWindowVariant(*args, **kwargs):
7963 """GetWindowVariant(self) -> int"""
7964 return _core_.Window_GetWindowVariant(*args, **kwargs)
7965
7966 def SetId(*args, **kwargs):
7967 """
7968 SetId(self, int winid)
7969
7970 Sets the identifier of the window. Each window has an integer
7971 identifier. If the application has not provided one, an identifier
7972 will be generated. Normally, the identifier should be provided on
7973 creation and should not be modified subsequently.
7974 """
7975 return _core_.Window_SetId(*args, **kwargs)
7976
7977 def GetId(*args, **kwargs):
7978 """
7979 GetId(self) -> int
7980
7981 Returns the identifier of the window. Each window has an integer
7982 identifier. If the application has not provided one (or the default Id
7983 -1 is used) then an unique identifier with a negative value will be
7984 generated.
7985 """
7986 return _core_.Window_GetId(*args, **kwargs)
7987
7988 def NewControlId(*args, **kwargs):
7989 """
c24da6d6 7990 NewControlId() -> int
d55e5bfc
RD
7991
7992 Generate a control id for the controls which were not given one.
7993 """
7994 return _core_.Window_NewControlId(*args, **kwargs)
7995
7996 NewControlId = staticmethod(NewControlId)
7997 def NextControlId(*args, **kwargs):
7998 """
c24da6d6 7999 NextControlId(int winid) -> int
d55e5bfc
RD
8000
8001 Get the id of the control following the one with the given
79fccf9d 8002 autogenerated) id
d55e5bfc
RD
8003 """
8004 return _core_.Window_NextControlId(*args, **kwargs)
8005
8006 NextControlId = staticmethod(NextControlId)
8007 def PrevControlId(*args, **kwargs):
8008 """
c24da6d6 8009 PrevControlId(int winid) -> int
d55e5bfc
RD
8010
8011 Get the id of the control preceding the one with the given
79fccf9d 8012 autogenerated) id
d55e5bfc
RD
8013 """
8014 return _core_.Window_PrevControlId(*args, **kwargs)
8015
8016 PrevControlId = staticmethod(PrevControlId)
97ab0f6a
RD
8017 def GetLayoutDirection(*args, **kwargs):
8018 """
994453b8 8019 GetLayoutDirection(self) -> int
97ab0f6a
RD
8020
8021 Get the layout direction (LTR or RTL) for this window. Returns
8022 ``wx.Layout_Default`` if layout direction is not supported.
8023 """
8024 return _core_.Window_GetLayoutDirection(*args, **kwargs)
8025
8026 def SetLayoutDirection(*args, **kwargs):
8027 """
994453b8 8028 SetLayoutDirection(self, int dir)
97ab0f6a
RD
8029
8030 Set the layout direction (LTR or RTL) for this window.
8031 """
8032 return _core_.Window_SetLayoutDirection(*args, **kwargs)
8033
8034 def AdjustForLayoutDirection(*args, **kwargs):
8035 """
8036 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
8037
8038 Mirror coordinates for RTL layout if this window uses it and if the
8039 mirroring is not done automatically like Win32.
8040 """
8041 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
8042
d55e5bfc
RD
8043 def SetSize(*args, **kwargs):
8044 """
8045 SetSize(self, Size size)
8046
8047 Sets the size of the window in pixels.
8048 """
8049 return _core_.Window_SetSize(*args, **kwargs)
8050
8051 def SetDimensions(*args, **kwargs):
8052 """
8053 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
8054
8055 Sets the position and size of the window in pixels. The sizeFlags
8056 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
8057 equal to -1.
8058
8059 ======================== ======================================
8060 wx.SIZE_AUTO A -1 indicates that a class-specific
8061 default should be used.
8062 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8063 -1 values are supplied.
8064 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8065 interpreted as real dimensions, not
8066 default values.
8067 ======================== ======================================
8068
d55e5bfc
RD
8069 """
8070 return _core_.Window_SetDimensions(*args, **kwargs)
8071
8072 def SetRect(*args, **kwargs):
8073 """
8074 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
8075
8076 Sets the position and size of the window in pixels using a wx.Rect.
8077 """
8078 return _core_.Window_SetRect(*args, **kwargs)
8079
8080 def SetSizeWH(*args, **kwargs):
8081 """
8082 SetSizeWH(self, int width, int height)
8083
8084 Sets the size of the window in pixels.
8085 """
8086 return _core_.Window_SetSizeWH(*args, **kwargs)
8087
8088 def Move(*args, **kwargs):
8089 """
8090 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
8091
8092 Moves the window to the given position.
8093 """
8094 return _core_.Window_Move(*args, **kwargs)
8095
8096 SetPosition = Move
8097 def MoveXY(*args, **kwargs):
8098 """
8099 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
8100
8101 Moves the window to the given position.
8102 """
8103 return _core_.Window_MoveXY(*args, **kwargs)
8104
f8167d6e
RD
8105 def SetBestFittingSize(*args, **kwargs):
8106 """
8107 SetBestFittingSize(self, Size size=DefaultSize)
8108
8109 A 'Smart' SetSize that will fill in default size components with the
8110 window's *best size* values. Also set's the minsize for use with sizers.
8111 """
8112 return _core_.Window_SetBestFittingSize(*args, **kwargs)
8113
d55e5bfc
RD
8114 def Raise(*args, **kwargs):
8115 """
8116 Raise(self)
8117
9d7dfdff
RD
8118 Raises the window to the top of the window hierarchy. In current
8119 version of wxWidgets this works both for manage and child windows.
d55e5bfc
RD
8120 """
8121 return _core_.Window_Raise(*args, **kwargs)
8122
8123 def Lower(*args, **kwargs):
8124 """
8125 Lower(self)
8126
9d7dfdff
RD
8127 Lowers the window to the bottom of the window hierarchy. In current
8128 version of wxWidgets this works both for manage and child windows.
d55e5bfc
RD
8129 """
8130 return _core_.Window_Lower(*args, **kwargs)
8131
8132 def SetClientSize(*args, **kwargs):
8133 """
8134 SetClientSize(self, Size size)
8135
8136 This sets the size of the window client area in pixels. Using this
8137 function to size a window tends to be more device-independent than
8138 wx.Window.SetSize, since the application need not worry about what
8139 dimensions the border or title bar have when trying to fit the window
8140 around panel items, for example.
8141 """
8142 return _core_.Window_SetClientSize(*args, **kwargs)
8143
8144 def SetClientSizeWH(*args, **kwargs):
8145 """
8146 SetClientSizeWH(self, int width, int height)
8147
8148 This sets the size of the window client area in pixels. Using this
8149 function to size a window tends to be more device-independent than
8150 wx.Window.SetSize, since the application need not worry about what
8151 dimensions the border or title bar have when trying to fit the window
8152 around panel items, for example.
8153 """
8154 return _core_.Window_SetClientSizeWH(*args, **kwargs)
8155
8156 def SetClientRect(*args, **kwargs):
8157 """
8158 SetClientRect(self, Rect rect)
8159
8160 This sets the size of the window client area in pixels. Using this
8161 function to size a window tends to be more device-independent than
8162 wx.Window.SetSize, since the application need not worry about what
8163 dimensions the border or title bar have when trying to fit the window
8164 around panel items, for example.
8165 """
8166 return _core_.Window_SetClientRect(*args, **kwargs)
8167
8168 def GetPosition(*args, **kwargs):
8169 """
8170 GetPosition(self) -> Point
8171
1c71765a
RD
8172 Get the window's position. Notice that the position is in client
8173 coordinates for child windows and screen coordinates for the top level
8174 ones, use `GetScreenPosition` if you need screen coordinates for all
8175 kinds of windows.
d55e5bfc
RD
8176 """
8177 return _core_.Window_GetPosition(*args, **kwargs)
8178
8179 def GetPositionTuple(*args, **kwargs):
8180 """
8181 GetPositionTuple() -> (x,y)
8182
1c71765a
RD
8183 Get the window's position. Notice that the position is in client
8184 coordinates for child windows and screen coordinates for the top level
8185 ones, use `GetScreenPosition` if you need screen coordinates for all
8186 kinds of windows.
d55e5bfc
RD
8187 """
8188 return _core_.Window_GetPositionTuple(*args, **kwargs)
8189
1c71765a
RD
8190 def GetScreenPosition(*args, **kwargs):
8191 """
8192 GetScreenPosition(self) -> Point
8193
8194 Get the position of the window in screen coordinantes.
8195 """
8196 return _core_.Window_GetScreenPosition(*args, **kwargs)
8197
8198 def GetScreenPositionTuple(*args, **kwargs):
8199 """
8200 GetScreenPositionTuple() -> (x,y)
8201
8202 Get the position of the window in screen coordinantes.
8203 """
8204 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8205
8206 def GetScreenRect(*args, **kwargs):
8207 """
8208 GetScreenRect(self) -> Rect
8209
8210 Returns the size and position of the window in screen coordinantes as
8211 a `wx.Rect` object.
8212 """
8213 return _core_.Window_GetScreenRect(*args, **kwargs)
8214
d55e5bfc
RD
8215 def GetSize(*args, **kwargs):
8216 """
8217 GetSize(self) -> Size
8218
8219 Get the window size.
8220 """
8221 return _core_.Window_GetSize(*args, **kwargs)
8222
8223 def GetSizeTuple(*args, **kwargs):
8224 """
8225 GetSizeTuple() -> (width, height)
8226
8227 Get the window size.
8228 """
8229 return _core_.Window_GetSizeTuple(*args, **kwargs)
8230
8231 def GetRect(*args, **kwargs):
8232 """
8233 GetRect(self) -> Rect
8234
1c71765a 8235 Returns the size and position of the window as a `wx.Rect` object.
d55e5bfc
RD
8236 """
8237 return _core_.Window_GetRect(*args, **kwargs)
8238
8239 def GetClientSize(*args, **kwargs):
8240 """
8241 GetClientSize(self) -> Size
8242
8243 This gets the size of the window's 'client area' in pixels. The client
8244 area is the area which may be drawn on by the programmer, excluding
8245 title bar, border, scrollbars, etc.
8246 """
8247 return _core_.Window_GetClientSize(*args, **kwargs)
8248
8249 def GetClientSizeTuple(*args, **kwargs):
8250 """
8251 GetClientSizeTuple() -> (width, height)
8252
8253 This gets the size of the window's 'client area' in pixels. The client
8254 area is the area which may be drawn on by the programmer, excluding
8255 title bar, border, scrollbars, etc.
8256 """
8257 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
8258
8259 def GetClientAreaOrigin(*args, **kwargs):
8260 """
8261 GetClientAreaOrigin(self) -> Point
8262
8263 Get the origin of the client area of the window relative to the
8264 window's top left corner (the client area may be shifted because of
8265 the borders, scrollbars, other decorations...)
8266 """
8267 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
8268
8269 def GetClientRect(*args, **kwargs):
8270 """
8271 GetClientRect(self) -> Rect
8272
629f3c1b 8273 Get the client area position and size as a `wx.Rect` object.
d55e5bfc
RD
8274 """
8275 return _core_.Window_GetClientRect(*args, **kwargs)
8276
8277 def GetBestSize(*args, **kwargs):
8278 """
8279 GetBestSize(self) -> Size
8280
248ed943 8281 This function returns the best acceptable minimal size for the
79fccf9d
RD
8282 window, if applicable. For example, for a static text control, it will
8283 be the minimal size such that the control label is not truncated. For
8284 windows containing subwindows (suzh aswx.Panel), the size returned by
8285 this function will be the same as the size the window would have had
8286 after calling Fit.
d55e5bfc
RD
8287 """
8288 return _core_.Window_GetBestSize(*args, **kwargs)
8289
8290 def GetBestSizeTuple(*args, **kwargs):
8291 """
8292 GetBestSizeTuple() -> (width, height)
8293
248ed943 8294 This function returns the best acceptable minimal size for the
79fccf9d
RD
8295 window, if applicable. For example, for a static text control, it will
8296 be the minimal size such that the control label is not truncated. For
8297 windows containing subwindows (suzh aswx.Panel), the size returned by
8298 this function will be the same as the size the window would have had
8299 after calling Fit.
d55e5bfc
RD
8300 """
8301 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
8302
a001823c
RD
8303 def InvalidateBestSize(*args, **kwargs):
8304 """
8305 InvalidateBestSize(self)
8306
8307 Reset the cached best size value so it will be recalculated the next
8308 time it is needed.
8309 """
8310 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8311
e2813725
RD
8312 def CacheBestSize(*args, **kwargs):
8313 """
8314 CacheBestSize(self, Size size)
8315
8316 Cache the best size so it doesn't need to be calculated again, (at least until
8317 some properties of the window change.)
8318 """
8319 return _core_.Window_CacheBestSize(*args, **kwargs)
8320
a001823c
RD
8321 def GetBestFittingSize(*args, **kwargs):
8322 """
8323 GetBestFittingSize(self) -> Size
8324
8325 This function will merge the window's best size into the window's
8326 minimum size, giving priority to the min size components, and returns
8327 the results.
8328
8329 """
8330 return _core_.Window_GetBestFittingSize(*args, **kwargs)
8331
d55e5bfc
RD
8332 def GetAdjustedBestSize(*args, **kwargs):
8333 """
8334 GetAdjustedBestSize(self) -> Size
8335
8336 This method is similar to GetBestSize, except in one
8337 thing. GetBestSize should return the minimum untruncated size of the
8338 window, while this method will return the largest of BestSize and any
8339 user specified minimum size. ie. it is the minimum size the window
8340 should currently be drawn at, not the minimal size it can possibly
8341 tolerate.
8342 """
8343 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
8344
8345 def Center(*args, **kwargs):
8346 """
8347 Center(self, int direction=BOTH)
8348
8349 Centers the window. The parameter specifies the direction for
8350 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8351 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8352 on the entire screen and not on its parent window. If it is a
8353 top-level window and has no parent then it will always be centered
8354 relative to the screen.
8355 """
8356 return _core_.Window_Center(*args, **kwargs)
8357
8358 Centre = Center
d55e5bfc
RD
8359 def CenterOnParent(*args, **kwargs):
8360 """
8361 CenterOnParent(self, int dir=BOTH)
8362
8363 Center with respect to the the parent window
8364 """
8365 return _core_.Window_CenterOnParent(*args, **kwargs)
8366
8367 CentreOnParent = CenterOnParent
8368 def Fit(*args, **kwargs):
8369 """
8370 Fit(self)
8371
8372 Sizes the window so that it fits around its subwindows. This function
8373 won't do anything if there are no subwindows and will only really work
8374 correctly if sizers are used for the subwindows layout. Also, if the
8375 window has exactly one subwindow it is better (faster and the result
8376 is more precise as Fit adds some margin to account for fuzziness of
8377 its calculations) to call window.SetClientSize(child.GetSize())
8378 instead of calling Fit.
8379 """
8380 return _core_.Window_Fit(*args, **kwargs)
8381
8382 def FitInside(*args, **kwargs):
8383 """
8384 FitInside(self)
8385
8386 Similar to Fit, but sizes the interior (virtual) size of a
8387 window. Mainly useful with scrolled windows to reset scrollbars after
8388 sizing changes that do not trigger a size event, and/or scrolled
8389 windows without an interior sizer. This function similarly won't do
8390 anything if there are no subwindows.
8391 """
8392 return _core_.Window_FitInside(*args, **kwargs)
8393
03837c5c 8394 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
8395 """
8396 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8397 int incH=-1)
d55e5bfc
RD
8398
8399 Allows specification of minimum and maximum window sizes, and window
8400 size increments. If a pair of values is not set (or set to -1), the
8401 default values will be used. If this function is called, the user
908b74cd
RD
8402 will not be able to size the window outside the given bounds (if it is
8403 a top-level window.) Sizers will also inspect the minimum window size
8404 and will use that value if set when calculating layout.
8405
8406 The resizing increments are only significant under Motif or Xt.
d55e5bfc 8407 """
03837c5c 8408 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 8409
03837c5c
RD
8410 def SetSizeHintsSz(*args, **kwargs):
8411 """
8412 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8413
8414 Allows specification of minimum and maximum window sizes, and window
8415 size increments. If a pair of values is not set (or set to -1), the
8416 default values will be used. If this function is called, the user
8417 will not be able to size the window outside the given bounds (if it is
8418 a top-level window.) Sizers will also inspect the minimum window size
8419 and will use that value if set when calculating layout.
8420
8421 The resizing increments are only significant under Motif or Xt.
8422 """
8423 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8424
8425 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 8426 """
908b74cd 8427 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
8428
8429 Allows specification of minimum and maximum virtual window sizes. If a
8430 pair of values is not set (or set to -1), the default values will be
8431 used. If this function is called, the user will not be able to size
8432 the virtual area of the window outside the given bounds.
8433 """
03837c5c
RD
8434 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8435
8436 def SetVirtualSizeHintsSz(*args, **kwargs):
8437 """
8438 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8439
8440 Allows specification of minimum and maximum virtual window sizes. If a
8441 pair of values is not set (or set to -1), the default values will be
8442 used. If this function is called, the user will not be able to size
8443 the virtual area of the window outside the given bounds.
8444 """
8445 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 8446
908b74cd
RD
8447 def GetMaxSize(*args, **kwargs):
8448 """GetMaxSize(self) -> Size"""
8449 return _core_.Window_GetMaxSize(*args, **kwargs)
8450
8451 def GetMinSize(*args, **kwargs):
8452 """GetMinSize(self) -> Size"""
8453 return _core_.Window_GetMinSize(*args, **kwargs)
8454
8455 def SetMinSize(*args, **kwargs):
8456 """
8457 SetMinSize(self, Size minSize)
8458
8459 A more convenient method than `SetSizeHints` for setting just the
8460 min size.
8461 """
8462 return _core_.Window_SetMinSize(*args, **kwargs)
8463
8464 def SetMaxSize(*args, **kwargs):
8465 """
8466 SetMaxSize(self, Size maxSize)
8467
8468 A more convenient method than `SetSizeHints` for setting just the
8469 max size.
8470 """
8471 return _core_.Window_SetMaxSize(*args, **kwargs)
8472
d55e5bfc
RD
8473 def GetMinWidth(*args, **kwargs):
8474 """GetMinWidth(self) -> int"""
8475 return _core_.Window_GetMinWidth(*args, **kwargs)
8476
8477 def GetMinHeight(*args, **kwargs):
8478 """GetMinHeight(self) -> int"""
8479 return _core_.Window_GetMinHeight(*args, **kwargs)
8480
8481 def GetMaxWidth(*args, **kwargs):
8482 """GetMaxWidth(self) -> int"""
8483 return _core_.Window_GetMaxWidth(*args, **kwargs)
8484
8485 def GetMaxHeight(*args, **kwargs):
8486 """GetMaxHeight(self) -> int"""
8487 return _core_.Window_GetMaxHeight(*args, **kwargs)
8488
d55e5bfc
RD
8489 def SetVirtualSize(*args, **kwargs):
8490 """
8491 SetVirtualSize(self, Size size)
8492
8493 Set the the virtual size of a window in pixels. For most windows this
8494 is just the client area of the window, but for some like scrolled
8495 windows it is more or less independent of the screen window size.
8496 """
8497 return _core_.Window_SetVirtualSize(*args, **kwargs)
8498
8499 def SetVirtualSizeWH(*args, **kwargs):
8500 """
8501 SetVirtualSizeWH(self, int w, int h)
8502
8503 Set the the virtual size of a window in pixels. For most windows this
8504 is just the client area of the window, but for some like scrolled
8505 windows it is more or less independent of the screen window size.
8506 """
8507 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8508
8509 def GetVirtualSize(*args, **kwargs):
8510 """
8511 GetVirtualSize(self) -> Size
8512
8513 Get the the virtual size of the window in pixels. For most windows
8514 this is just the client area of the window, but for some like scrolled
8515 windows it is more or less independent of the screen window size.
8516 """
8517 return _core_.Window_GetVirtualSize(*args, **kwargs)
8518
8519 def GetVirtualSizeTuple(*args, **kwargs):
8520 """
8521 GetVirtualSizeTuple() -> (width, height)
8522
8523 Get the the virtual size of the window in pixels. For most windows
8524 this is just the client area of the window, but for some like scrolled
8525 windows it is more or less independent of the screen window size.
8526 """
8527 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8528
8529 def GetBestVirtualSize(*args, **kwargs):
8530 """
8531 GetBestVirtualSize(self) -> Size
8532
8533 Return the largest of ClientSize and BestSize (as determined by a
8534 sizer, interior children, or other means)
8535 """
8536 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8537
8538 def Show(*args, **kwargs):
8539 """
8540 Show(self, bool show=True) -> bool
8541
8542 Shows or hides the window. You may need to call Raise for a top level
8543 window if you want to bring it to top, although this is not needed if
8544 Show is called immediately after the frame creation. Returns True if
8545 the window has been shown or hidden or False if nothing was done
8546 because it already was in the requested state.
8547 """
8548 return _core_.Window_Show(*args, **kwargs)
8549
8550 def Hide(*args, **kwargs):
8551 """
8552 Hide(self) -> bool
8553
8554 Equivalent to calling Show(False).
8555 """
8556 return _core_.Window_Hide(*args, **kwargs)
8557
8558 def Enable(*args, **kwargs):
8559 """
8560 Enable(self, bool enable=True) -> bool
8561
8562 Enable or disable the window for user input. Note that when a parent
8563 window is disabled, all of its children are disabled as well and they
8564 are reenabled again when the parent is. Returns true if the window
8565 has been enabled or disabled, false if nothing was done, i.e. if the
8566 window had already been in the specified state.
8567 """
8568 return _core_.Window_Enable(*args, **kwargs)
8569
8570 def Disable(*args, **kwargs):
8571 """
8572 Disable(self) -> bool
8573
8574 Disables the window, same as Enable(false).
8575 """
8576 return _core_.Window_Disable(*args, **kwargs)
8577
8578 def IsShown(*args, **kwargs):
8579 """
8580 IsShown(self) -> bool
8581
8582 Returns true if the window is shown, false if it has been hidden.
8583 """
8584 return _core_.Window_IsShown(*args, **kwargs)
8585
8586 def IsEnabled(*args, **kwargs):
8587 """
8588 IsEnabled(self) -> bool
8589
8590 Returns true if the window is enabled for input, false otherwise.
8591 """
8592 return _core_.Window_IsEnabled(*args, **kwargs)
8593
33d6fd3b
RD
8594 def IsShownOnScreen(*args, **kwargs):
8595 """
8596 IsShownOnScreen(self) -> bool
8597
8598 Returns ``True`` if the window is physically visible on the screen,
8599 i.e. it is shown and all its parents up to the toplevel window are
8600 shown as well.
8601 """
8602 return _core_.Window_IsShownOnScreen(*args, **kwargs)
8603
d55e5bfc
RD
8604 def SetWindowStyleFlag(*args, **kwargs):
8605 """
8606 SetWindowStyleFlag(self, long style)
8607
79fccf9d
RD
8608 Sets the style of the window. Please note that some styles cannot be
8609 changed after the window creation and that Refresh() might need to be
8610 called after changing the others for the change to take place
8611 immediately.
d55e5bfc
RD
8612 """
8613 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8614
8615 def GetWindowStyleFlag(*args, **kwargs):
8616 """
8617 GetWindowStyleFlag(self) -> long
8618
8619 Gets the window style that was passed to the constructor or Create
8620 method.
8621 """
8622 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8623
8624 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8625 def HasFlag(*args, **kwargs):
8626 """
8627 HasFlag(self, int flag) -> bool
8628
8629 Test if the given style is set for this window.
8630 """
8631 return _core_.Window_HasFlag(*args, **kwargs)
8632
8633 def IsRetained(*args, **kwargs):
8634 """
8635 IsRetained(self) -> bool
8636
8637 Returns true if the window is retained, false otherwise. Retained
8638 windows are only available on X platforms.
8639 """
8640 return _core_.Window_IsRetained(*args, **kwargs)
8641
8642 def SetExtraStyle(*args, **kwargs):
8643 """
8644 SetExtraStyle(self, long exStyle)
8645
8646 Sets the extra style bits for the window. Extra styles are the less
8647 often used style bits which can't be set with the constructor or with
8648 SetWindowStyleFlag()
8649 """
8650 return _core_.Window_SetExtraStyle(*args, **kwargs)
8651
8652 def GetExtraStyle(*args, **kwargs):
8653 """
8654 GetExtraStyle(self) -> long
8655
8656 Returns the extra style bits for the window.
8657 """
8658 return _core_.Window_GetExtraStyle(*args, **kwargs)
8659
8660 def MakeModal(*args, **kwargs):
8661 """
8662 MakeModal(self, bool modal=True)
8663
8664 Disables all other windows in the application so that the user can
8665 only interact with this window. Passing False will reverse this
8666 effect.
8667 """
8668 return _core_.Window_MakeModal(*args, **kwargs)
8669
8670 def SetThemeEnabled(*args, **kwargs):
8671 """
8672 SetThemeEnabled(self, bool enableTheme)
8673
8674 This function tells a window if it should use the system's "theme"
8675 code to draw the windows' background instead if its own background
8676 drawing code. This will only have an effect on platforms that support
8677 the notion of themes in user defined windows. One such platform is
8678 GTK+ where windows can have (very colourful) backgrounds defined by a
8679 user's selected theme.
8680
8681 Dialogs, notebook pages and the status bar have this flag set to true
8682 by default so that the default look and feel is simulated best.
8683 """
8684 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8685
8686 def GetThemeEnabled(*args, **kwargs):
8687 """
8688 GetThemeEnabled(self) -> bool
8689
8690 Return the themeEnabled flag.
8691 """
8692 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8693
8694 def SetFocus(*args, **kwargs):
8695 """
8696 SetFocus(self)
8697
8698 Set's the focus to this window, allowing it to receive keyboard input.
8699 """
8700 return _core_.Window_SetFocus(*args, **kwargs)
8701
8702 def SetFocusFromKbd(*args, **kwargs):
8703 """
8704 SetFocusFromKbd(self)
8705
8706 Set focus to this window as the result of a keyboard action. Normally
8707 only called internally.
8708 """
8709 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8710
8711 def FindFocus(*args, **kwargs):
8712 """
c24da6d6 8713 FindFocus() -> Window
d55e5bfc
RD
8714
8715 Returns the window or control that currently has the keyboard focus,
8716 or None.
8717 """
8718 return _core_.Window_FindFocus(*args, **kwargs)
8719
8720 FindFocus = staticmethod(FindFocus)
8721 def AcceptsFocus(*args, **kwargs):
8722 """
8723 AcceptsFocus(self) -> bool
8724
8725 Can this window have focus?
8726 """
8727 return _core_.Window_AcceptsFocus(*args, **kwargs)
8728
8729 def AcceptsFocusFromKeyboard(*args, **kwargs):
8730 """
8731 AcceptsFocusFromKeyboard(self) -> bool
8732
8733 Can this window be given focus by keyboard navigation? if not, the
8734 only way to give it focus (provided it accepts it at all) is to click
8735 it.
8736 """
8737 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8738
908b74cd
RD
8739 def Navigate(*args, **kwargs):
8740 """
8741 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8742
a8eff060
RD
8743 Does keyboard navigation from this window to another, by sending a
8744 `wx.NavigationKeyEvent`.
908b74cd
RD
8745 """
8746 return _core_.Window_Navigate(*args, **kwargs)
8747
bf26d883
RD
8748 def MoveAfterInTabOrder(*args, **kwargs):
8749 """
8750 MoveAfterInTabOrder(self, Window win)
8751
8752 Moves this window in the tab navigation order after the specified
8753 sibling window. This means that when the user presses the TAB key on
8754 that other window, the focus switches to this window.
8755
8756 The default tab order is the same as creation order. This function
8757 and `MoveBeforeInTabOrder` allow to change it after creating all the
8758 windows.
8759
8760 """
8761 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8762
8763 def MoveBeforeInTabOrder(*args, **kwargs):
8764 """
8765 MoveBeforeInTabOrder(self, Window win)
8766
8767 Same as `MoveAfterInTabOrder` except that it inserts this window just
8768 before win instead of putting it right after it.
8769 """
8770 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8771
d55e5bfc
RD
8772 def GetChildren(*args, **kwargs):
8773 """
8774 GetChildren(self) -> PyObject
8775
8776 Returns a list of the window's children. NOTE: Currently this is a
8777 copy of the child window list maintained by the window, so the return
8778 value of this function is only valid as long as the window's children
8779 do not change.
8780 """
8781 return _core_.Window_GetChildren(*args, **kwargs)
8782
8783 def GetParent(*args, **kwargs):
8784 """
8785 GetParent(self) -> Window
8786
8787 Returns the parent window of this window, or None if there isn't one.
8788 """
8789 return _core_.Window_GetParent(*args, **kwargs)
8790
8791 def GetGrandParent(*args, **kwargs):
8792 """
8793 GetGrandParent(self) -> Window
8794
79fccf9d
RD
8795 Returns the parent of the parent of this window, or None if there
8796 isn't one.
d55e5bfc
RD
8797 """
8798 return _core_.Window_GetGrandParent(*args, **kwargs)
8799
8800 def IsTopLevel(*args, **kwargs):
8801 """
8802 IsTopLevel(self) -> bool
8803
8804 Returns true if the given window is a top-level one. Currently all
8805 frames and dialogs are always considered to be top-level windows (even
8806 if they have a parent window).
8807 """
8808 return _core_.Window_IsTopLevel(*args, **kwargs)
8809
8810 def Reparent(*args, **kwargs):
8811 """
8812 Reparent(self, Window newParent) -> bool
8813
8814 Reparents the window, i.e the window will be removed from its current
8815 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8816 re-inserted into another. Available on Windows and GTK. Returns True
8817 if the parent was changed, False otherwise (error or newParent ==
8818 oldParent)
8819 """
8820 return _core_.Window_Reparent(*args, **kwargs)
8821
8822 def AddChild(*args, **kwargs):
8823 """
8824 AddChild(self, Window child)
8825
8826 Adds a child window. This is called automatically by window creation
8827 functions so should not be required by the application programmer.
8828 """
8829 return _core_.Window_AddChild(*args, **kwargs)
8830
8831 def RemoveChild(*args, **kwargs):
8832 """
8833 RemoveChild(self, Window child)
8834
8835 Removes a child window. This is called automatically by window
8836 deletion functions so should not be required by the application
8837 programmer.
8838 """
8839 return _core_.Window_RemoveChild(*args, **kwargs)
8840
704eda0c
RD
8841 def SetDoubleBuffered(*args, **kwargs):
8842 """
8843 SetDoubleBuffered(self, bool on)
8844
8845 Currently wxGTK2 only.
8846 """
8847 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8848
d55e5bfc
RD
8849 def FindWindowById(*args, **kwargs):
8850 """
8851 FindWindowById(self, long winid) -> Window
8852
8853 Find a chld of this window by window ID
8854 """
8855 return _core_.Window_FindWindowById(*args, **kwargs)
8856
8857 def FindWindowByName(*args, **kwargs):
8858 """
8859 FindWindowByName(self, String name) -> Window
8860
8861 Find a child of this window by name
8862 """
8863 return _core_.Window_FindWindowByName(*args, **kwargs)
8864
8865 def GetEventHandler(*args, **kwargs):
8866 """
8867 GetEventHandler(self) -> EvtHandler
8868
8869 Returns the event handler for this window. By default, the window is
8870 its own event handler.
8871 """
8872 return _core_.Window_GetEventHandler(*args, **kwargs)
8873
8874 def SetEventHandler(*args, **kwargs):
8875 """
8876 SetEventHandler(self, EvtHandler handler)
8877
8878 Sets the event handler for this window. An event handler is an object
d49bdf34
RD
8879 that is capable of processing the events sent to a window. (In other
8880 words, is able to dispatch the events to handler function.) By
8881 default, the window is its own event handler, but an application may
8882 wish to substitute another, for example to allow central
8883 implementation of event-handling for a variety of different window
8884 classes.
d55e5bfc 8885
79fccf9d 8886 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc 8887 up a chain of event handlers, where an event not handled by one event
d49bdf34 8888 handler is handed off to the next one in the chain.
d55e5bfc
RD
8889 """
8890 return _core_.Window_SetEventHandler(*args, **kwargs)
8891
8892 def PushEventHandler(*args, **kwargs):
8893 """
8894 PushEventHandler(self, EvtHandler handler)
8895
8896 Pushes this event handler onto the event handler stack for the window.
8897 An event handler is an object that is capable of processing the events
d49bdf34
RD
8898 sent to a window. (In other words, is able to dispatch the events to
8899 handler function.) By default, the window is its own event handler,
8900 but an application may wish to substitute another, for example to
8901 allow central implementation of event-handling for a variety of
8902 different window classes.
d55e5bfc
RD
8903
8904 wx.Window.PushEventHandler allows an application to set up a chain of
8905 event handlers, where an event not handled by one event handler is
d49bdf34
RD
8906 handed to the next one in the chain. Use `wx.Window.PopEventHandler`
8907 to remove the event handler. Ownership of the handler is *not* given
8908 to the window, so you should be sure to pop the handler before the
8909 window is destroyed and either let PopEventHandler destroy it, or call
8910 its Destroy method yourself.
d55e5bfc
RD
8911 """
8912 return _core_.Window_PushEventHandler(*args, **kwargs)
8913
8914 def PopEventHandler(*args, **kwargs):
8915 """
8916 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8917
8918 Removes and returns the top-most event handler on the event handler
8919 stack. If deleteHandler is True then the wx.EvtHandler object will be
d49bdf34 8920 destroyed after it is popped, and ``None`` will be returned instead.
d55e5bfc
RD
8921 """
8922 return _core_.Window_PopEventHandler(*args, **kwargs)
8923
8924 def RemoveEventHandler(*args, **kwargs):
8925 """
8926 RemoveEventHandler(self, EvtHandler handler) -> bool
8927
79fccf9d 8928 Find the given handler in the event handler chain and remove (but not
d49bdf34 8929 delete) it from the event handler chain, returns True if it was found
79fccf9d
RD
8930 and False otherwise (this also results in an assert failure so this
8931 function should only be called when the handler is supposed to be
8932 there.)
d55e5bfc
RD
8933 """
8934 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8935
8936 def SetValidator(*args, **kwargs):
8937 """
8938 SetValidator(self, Validator validator)
8939
8940 Deletes the current validator (if any) and sets the window validator,
8941 having called wx.Validator.Clone to create a new validator of this
8942 type.
8943 """
8944 return _core_.Window_SetValidator(*args, **kwargs)
8945
8946 def GetValidator(*args, **kwargs):
8947 """
8948 GetValidator(self) -> Validator
8949
8950 Returns a pointer to the current validator for the window, or None if
8951 there is none.
8952 """
8953 return _core_.Window_GetValidator(*args, **kwargs)
8954
8955 def Validate(*args, **kwargs):
8956 """
8957 Validate(self) -> bool
8958
8959 Validates the current values of the child controls using their
79fccf9d
RD
8960 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8961 style flag set, the method will also call Validate() of all child
8962 windows. Returns false if any of the validations failed.
d55e5bfc
RD
8963 """
8964 return _core_.Window_Validate(*args, **kwargs)
8965
8966 def TransferDataToWindow(*args, **kwargs):
8967 """
8968 TransferDataToWindow(self) -> bool
8969
79fccf9d
RD
8970 Transfers values to child controls from data areas specified by their
8971 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8972 style flag set, the method will also call TransferDataToWindow() of
8973 all child windows.
d55e5bfc
RD
8974 """
8975 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8976
8977 def TransferDataFromWindow(*args, **kwargs):
8978 """
8979 TransferDataFromWindow(self) -> bool
8980
79fccf9d
RD
8981 Transfers values from child controls to data areas specified by their
8982 validators. Returns false if a transfer failed. If the window has
8983 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8984 also call TransferDataFromWindow() of all child windows.
d55e5bfc
RD
8985 """
8986 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8987
8988 def InitDialog(*args, **kwargs):
8989 """
8990 InitDialog(self)
8991
79fccf9d
RD
8992 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8993 to the dialog via validators.
d55e5bfc
RD
8994 """
8995 return _core_.Window_InitDialog(*args, **kwargs)
8996
8997 def SetAcceleratorTable(*args, **kwargs):
8998 """
8999 SetAcceleratorTable(self, AcceleratorTable accel)
9000
9001 Sets the accelerator table for this window.
9002 """
9003 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
9004
9005 def GetAcceleratorTable(*args, **kwargs):
9006 """
9007 GetAcceleratorTable(self) -> AcceleratorTable
9008
9009 Gets the accelerator table for this window.
9010 """
9011 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
9012
9013 def RegisterHotKey(*args, **kwargs):
9014 """
9015 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
9016
9017 Registers a system wide hotkey. Every time the user presses the hotkey
9018 registered here, this window will receive a hotkey event. It will
9019 receive the event even if the application is in the background and
9020 does not have the input focus because the user is working with some
9021 other application. To bind an event handler function to this hotkey
9022 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9023 hotkey was registered successfully.
9024 """
9025 return _core_.Window_RegisterHotKey(*args, **kwargs)
9026
9027 def UnregisterHotKey(*args, **kwargs):
9028 """
9029 UnregisterHotKey(self, int hotkeyId) -> bool
9030
9031 Unregisters a system wide hotkey.
9032 """
9033 return _core_.Window_UnregisterHotKey(*args, **kwargs)
9034
9035 def ConvertDialogPointToPixels(*args, **kwargs):
9036 """
9037 ConvertDialogPointToPixels(self, Point pt) -> Point
9038
9039 Converts a point or size from dialog units to pixels. Dialog units
9040 are used for maintaining a dialog's proportions even if the font
9041 changes. For the x dimension, the dialog units are multiplied by the
9042 average character width and then divided by 4. For the y dimension,
9043 the dialog units are multiplied by the average character height and
9044 then divided by 8.
9045 """
9046 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
9047
9048 def ConvertDialogSizeToPixels(*args, **kwargs):
9049 """
9050 ConvertDialogSizeToPixels(self, Size sz) -> Size
9051
9052 Converts a point or size from dialog units to pixels. Dialog units
9053 are used for maintaining a dialog's proportions even if the font
9054 changes. For the x dimension, the dialog units are multiplied by the
9055 average character width and then divided by 4. For the y dimension,
9056 the dialog units are multiplied by the average character height and
9057 then divided by 8.
9058 """
9059 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
9060
9061 def DLG_PNT(*args, **kwargs):
9062 """
9063 DLG_PNT(self, Point pt) -> Point
9064
9065 Converts a point or size from dialog units to pixels. Dialog units
9066 are used for maintaining a dialog's proportions even if the font
9067 changes. For the x dimension, the dialog units are multiplied by the
9068 average character width and then divided by 4. For the y dimension,
9069 the dialog units are multiplied by the average character height and
9070 then divided by 8.
9071 """
9072 return _core_.Window_DLG_PNT(*args, **kwargs)
9073
9074 def DLG_SZE(*args, **kwargs):
9075 """
9076 DLG_SZE(self, Size sz) -> Size
9077
9078 Converts a point or size from dialog units to pixels. Dialog units
9079 are used for maintaining a dialog's proportions even if the font
9080 changes. For the x dimension, the dialog units are multiplied by the
9081 average character width and then divided by 4. For the y dimension,
9082 the dialog units are multiplied by the average character height and
9083 then divided by 8.
9084 """
9085 return _core_.Window_DLG_SZE(*args, **kwargs)
9086
9087 def ConvertPixelPointToDialog(*args, **kwargs):
9088 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9089 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
9090
9091 def ConvertPixelSizeToDialog(*args, **kwargs):
9092 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9093 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
9094
9095 def WarpPointer(*args, **kwargs):
9096 """
9097 WarpPointer(self, int x, int y)
9098
9099 Moves the pointer to the given position on the window.
9100
9101 NOTE: This function is not supported under Mac because Apple Human
9102 Interface Guidelines forbid moving the mouse cursor programmatically.
9103 """
9104 return _core_.Window_WarpPointer(*args, **kwargs)
9105
9106 def CaptureMouse(*args, **kwargs):
9107 """
9108 CaptureMouse(self)
9109
9110 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9111 release the capture.
9112
9113 Note that wxWindows maintains the stack of windows having captured the
9114 mouse and when the mouse is released the capture returns to the window
9115 which had had captured it previously and it is only really released if
9116 there were no previous window. In particular, this means that you must
0f83f5da
RD
9117 release the mouse as many times as you capture it, unless the window
9118 receives the `wx.MouseCaptureLostEvent` event.
9119
9120 Any application which captures the mouse in the beginning of some
9121 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9122 operation when it receives the event. The event handler must not
9123 recapture mouse.
d55e5bfc
RD
9124 """
9125 return _core_.Window_CaptureMouse(*args, **kwargs)
9126
9127 def ReleaseMouse(*args, **kwargs):
9128 """
9129 ReleaseMouse(self)
9130
9131 Releases mouse input captured with wx.Window.CaptureMouse.
9132 """
9133 return _core_.Window_ReleaseMouse(*args, **kwargs)
9134
9135 def GetCapture(*args, **kwargs):
9136 """
c24da6d6 9137 GetCapture() -> Window
d55e5bfc
RD
9138
9139 Returns the window which currently captures the mouse or None
9140 """
9141 return _core_.Window_GetCapture(*args, **kwargs)
9142
9143 GetCapture = staticmethod(GetCapture)
9144 def HasCapture(*args, **kwargs):
9145 """
9146 HasCapture(self) -> bool
9147
9148 Returns true if this window has the current mouse capture.
9149 """
9150 return _core_.Window_HasCapture(*args, **kwargs)
9151
9152 def Refresh(*args, **kwargs):
9153 """
9154 Refresh(self, bool eraseBackground=True, Rect rect=None)
9155
9156 Mark the specified rectangle (or the whole window) as "dirty" so it
9157 will be repainted. Causes an EVT_PAINT event to be generated and sent
9158 to the window.
9159 """
9160 return _core_.Window_Refresh(*args, **kwargs)
9161
9162 def RefreshRect(*args, **kwargs):
9163 """
fef4c27a 9164 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
9165
9166 Redraws the contents of the given rectangle: the area inside it will
9167 be repainted. This is the same as Refresh but has a nicer syntax.
9168 """
9169 return _core_.Window_RefreshRect(*args, **kwargs)
9170
9171 def Update(*args, **kwargs):
9172 """
9173 Update(self)
9174
9175 Calling this method immediately repaints the invalidated area of the
9176 window instead of waiting for the EVT_PAINT event to happen, (normally
9177 this would usually only happen when the flow of control returns to the
9178 event loop.) Notice that this function doesn't refresh the window and
9179 does nothing if the window has been already repainted. Use Refresh
9180 first if you want to immediately redraw the window (or some portion of
9181 it) unconditionally.
9182 """
9183 return _core_.Window_Update(*args, **kwargs)
9184
9185 def ClearBackground(*args, **kwargs):
9186 """
9187 ClearBackground(self)
9188
9189 Clears the window by filling it with the current background
9190 colour. Does not cause an erase background event to be generated.
9191 """
9192 return _core_.Window_ClearBackground(*args, **kwargs)
9193
9194 def Freeze(*args, **kwargs):
9195 """
9196 Freeze(self)
9197
79fccf9d
RD
9198 Freezes the window or, in other words, prevents any updates from
9199 taking place on screen, the window is not redrawn at all. Thaw must be
9200 called to reenable window redrawing. Calls to Freeze/Thaw may be
9201 nested, with the actual Thaw being delayed until all the nesting has
9202 been undone.
d55e5bfc
RD
9203
9204 This method is useful for visual appearance optimization (for example,
9205 it is a good idea to use it before inserting large amount of text into
9206 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9207 for all controls so it is mostly just a hint to wxWindows and not a
9208 mandatory directive.
9209 """
9210 return _core_.Window_Freeze(*args, **kwargs)
9211
33d6fd3b
RD
9212 def IsFrozen(*args, **kwargs):
9213 """
9214 IsFrozen(self) -> bool
9215
9216 Returns ``True`` if the window has been frozen and not thawed yet.
9217
9218 :see: `Freeze` and `Thaw`
9219 """
9220 return _core_.Window_IsFrozen(*args, **kwargs)
9221
d55e5bfc
RD
9222 def Thaw(*args, **kwargs):
9223 """
9224 Thaw(self)
9225
9226 Reenables window updating after a previous call to Freeze. Calls to
79fccf9d
RD
9227 Freeze/Thaw may be nested, so Thaw must be called the same number of
9228 times that Freeze was before the window will be updated.
d55e5bfc
RD
9229 """
9230 return _core_.Window_Thaw(*args, **kwargs)
9231
9232 def PrepareDC(*args, **kwargs):
9233 """
9234 PrepareDC(self, DC dc)
9235
9236 Call this function to prepare the device context for drawing a
9237 scrolled image. It sets the device origin according to the current
9238 scroll position.
9239 """
9240 return _core_.Window_PrepareDC(*args, **kwargs)
9241
9242 def GetUpdateRegion(*args, **kwargs):
9243 """
9244 GetUpdateRegion(self) -> Region
9245
9246 Returns the region specifying which parts of the window have been
9247 damaged. Should only be called within an EVT_PAINT handler.
9248 """
9249 return _core_.Window_GetUpdateRegion(*args, **kwargs)
9250
9251 def GetUpdateClientRect(*args, **kwargs):
9252 """
9253 GetUpdateClientRect(self) -> Rect
9254
9255 Get the update rectangle region bounding box in client coords.
9256 """
9257 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
9258
9259 def IsExposed(*args, **kwargs):
9260 """
9261 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9262
9263 Returns true if the given point or rectangle area has been exposed
9264 since the last repaint. Call this in an paint event handler to
9265 optimize redrawing by only redrawing those areas, which have been
9266 exposed.
9267 """
9268 return _core_.Window_IsExposed(*args, **kwargs)
9269
9270 def IsExposedPoint(*args, **kwargs):
9271 """
9272 IsExposedPoint(self, Point pt) -> bool
9273
9274 Returns true if the given point or rectangle area has been exposed
9275 since the last repaint. Call this in an paint event handler to
9276 optimize redrawing by only redrawing those areas, which have been
9277 exposed.
9278 """
9279 return _core_.Window_IsExposedPoint(*args, **kwargs)
9280
9281 def IsExposedRect(*args, **kwargs):
9282 """
9283 IsExposedRect(self, Rect rect) -> bool
9284
9285 Returns true if the given point or rectangle area has been exposed
9286 since the last repaint. Call this in an paint event handler to
9287 optimize redrawing by only redrawing those areas, which have been
9288 exposed.
9289 """
9290 return _core_.Window_IsExposedRect(*args, **kwargs)
9291
9292 def GetDefaultAttributes(*args, **kwargs):
9293 """
9294 GetDefaultAttributes(self) -> VisualAttributes
9295
79fccf9d
RD
9296 Get the default attributes for an instance of this class. This is
9297 useful if you want to use the same font or colour in your own control
9298 as in a standard control -- which is a much better idea than hard
9299 coding specific colours or fonts which might look completely out of
caef1a4d 9300 place on the user's system, especially if it uses themes.
d55e5bfc
RD
9301 """
9302 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
9303
9304 def GetClassDefaultAttributes(*args, **kwargs):
9305 """
c24da6d6 9306 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9307
79fccf9d
RD
9308 Get the default attributes for this class. This is useful if you want
9309 to use the same font or colour in your own control as in a standard
9310 control -- which is a much better idea than hard coding specific
caef1a4d
RD
9311 colours or fonts which might look completely out of place on the
9312 user's system, especially if it uses themes.
d55e5bfc
RD
9313
9314 The variant parameter is only relevant under Mac currently and is
79fccf9d 9315 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
9316 the returned font. See `wx.Window.SetWindowVariant` for more about
9317 this.
d55e5bfc
RD
9318 """
9319 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
9320
9321 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9322 def SetBackgroundColour(*args, **kwargs):
9323 """
9324 SetBackgroundColour(self, Colour colour) -> bool
9325
9326 Sets the background colour of the window. Returns True if the colour
9327 was changed. The background colour is usually painted by the default
9328 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9329 automatically under GTK. Using `wx.NullColour` will reset the window
9330 to the default background colour.
d55e5bfc 9331
caef1a4d 9332 Note that setting the background colour may not cause an immediate
f8167d6e 9333 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
9334 calling this function.
9335
f8167d6e
RD
9336 Using this function will disable attempts to use themes for this
9337 window, if the system supports them. Use with care since usually the
9338 themes represent the appearance chosen by the user to be used for all
9339 applications on the system.
d55e5bfc
RD
9340 """
9341 return _core_.Window_SetBackgroundColour(*args, **kwargs)
9342
412d302d
RD
9343 def SetOwnBackgroundColour(*args, **kwargs):
9344 """SetOwnBackgroundColour(self, Colour colour)"""
9345 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9346
9347 def SetForegroundColour(*args, **kwargs):
9348 """
9349 SetForegroundColour(self, Colour colour) -> bool
9350
9351 Sets the foreground colour of the window. Returns True is the colour
9352 was changed. The interpretation of foreground colour is dependent on
9353 the window class; it may be the text colour or other colour, or it may
9354 not be used at all.
9355 """
9356 return _core_.Window_SetForegroundColour(*args, **kwargs)
9357
fa47d7a7
VS
9358 def SetOwnForegroundColour(*args, **kwargs):
9359 """SetOwnForegroundColour(self, Colour colour)"""
9360 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
9361
9362 def GetBackgroundColour(*args, **kwargs):
9363 """
9364 GetBackgroundColour(self) -> Colour
9365
9366 Returns the background colour of the window.
9367 """
9368 return _core_.Window_GetBackgroundColour(*args, **kwargs)
9369
9370 def GetForegroundColour(*args, **kwargs):
9371 """
9372 GetForegroundColour(self) -> Colour
9373
9374 Returns the foreground colour of the window. The interpretation of
9375 foreground colour is dependent on the window class; it may be the text
9376 colour or other colour, or it may not be used at all.
9377 """
9378 return _core_.Window_GetForegroundColour(*args, **kwargs)
9379
dcb8fc74
RD
9380 def InheritsBackgroundColour(*args, **kwargs):
9381 """InheritsBackgroundColour(self) -> bool"""
9382 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9383
9384 def UseBgCol(*args, **kwargs):
9385 """UseBgCol(self) -> bool"""
9386 return _core_.Window_UseBgCol(*args, **kwargs)
9387
0f63ec68
RD
9388 def SetBackgroundStyle(*args, **kwargs):
9389 """
9390 SetBackgroundStyle(self, int style) -> bool
9391
9392 Returns the background style of the window. The background style
9393 indicates how the background of the window is drawn.
9394
9395 ====================== ========================================
9396 wx.BG_STYLE_SYSTEM The background colour or pattern should
9397 be determined by the system
9398 wx.BG_STYLE_COLOUR The background should be a solid colour
9399 wx.BG_STYLE_CUSTOM The background will be implemented by the
9400 application.
9401 ====================== ========================================
9402
9403 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9404 a custom background, such as a tiled bitmap. Currently the style has
9405 no effect on other platforms.
9406
9407 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9408 """
9409 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9410
9411 def GetBackgroundStyle(*args, **kwargs):
9412 """
9413 GetBackgroundStyle(self) -> int
9414
9415 Returns the background style of the window.
9416
9417 :see: `SetBackgroundStyle`
9418 """
9419 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9420
51b83b37
RD
9421 def HasTransparentBackground(*args, **kwargs):
9422 """
9423 HasTransparentBackground(self) -> bool
9424
9425 Returns True if this window's background is transparent (as, for
9426 example, for `wx.StaticText`) and should show the parent window's
9427 background.
9428
9429 This method is mostly used internally by the library itself and you
9430 normally shouldn't have to call it. You may, however, have to override
9431 it in your custom control classes to ensure that background is painted
9432 correctly.
9433 """
9434 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9435
d55e5bfc
RD
9436 def SetCursor(*args, **kwargs):
9437 """
9438 SetCursor(self, Cursor cursor) -> bool
9439
9440 Sets the window's cursor. Notice that the window cursor also sets it
9441 for the children of the window implicitly.
9442
9443 The cursor may be wx.NullCursor in which case the window cursor will
9444 be reset back to default.
9445 """
9446 return _core_.Window_SetCursor(*args, **kwargs)
9447
9448 def GetCursor(*args, **kwargs):
9449 """
9450 GetCursor(self) -> Cursor
9451
9452 Return the cursor associated with this window.
9453 """
9454 return _core_.Window_GetCursor(*args, **kwargs)
9455
9456 def SetFont(*args, **kwargs):
9457 """
9458 SetFont(self, Font font) -> bool
9459
9460 Sets the font for this window.
9461 """
9462 return _core_.Window_SetFont(*args, **kwargs)
9463
fa47d7a7
VS
9464 def SetOwnFont(*args, **kwargs):
9465 """SetOwnFont(self, Font font)"""
9466 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9467
9468 def GetFont(*args, **kwargs):
9469 """
9470 GetFont(self) -> Font
9471
9472 Returns the default font used for this window.
9473 """
9474 return _core_.Window_GetFont(*args, **kwargs)
9475
9476 def SetCaret(*args, **kwargs):
9477 """
9478 SetCaret(self, Caret caret)
9479
9480 Sets the caret associated with the window.
9481 """
9482 return _core_.Window_SetCaret(*args, **kwargs)
9483
9484 def GetCaret(*args, **kwargs):
9485 """
9486 GetCaret(self) -> Caret
9487
9488 Returns the caret associated with the window.
9489 """
9490 return _core_.Window_GetCaret(*args, **kwargs)
9491
9492 def GetCharHeight(*args, **kwargs):
9493 """
9494 GetCharHeight(self) -> int
9495
9496 Get the (average) character size for the current font.
9497 """
9498 return _core_.Window_GetCharHeight(*args, **kwargs)
9499
9500 def GetCharWidth(*args, **kwargs):
9501 """
9502 GetCharWidth(self) -> int
9503
9504 Get the (average) character size for the current font.
9505 """
9506 return _core_.Window_GetCharWidth(*args, **kwargs)
9507
9508 def GetTextExtent(*args, **kwargs):
a8eff060
RD
9509 """
9510 GetTextExtent(String string) -> (width, height)
9511
9512 Get the width and height of the text using the current font.
9513 """
d55e5bfc
RD
9514 return _core_.Window_GetTextExtent(*args, **kwargs)
9515
9516 def GetFullTextExtent(*args, **kwargs):
9517 """
9518 GetFullTextExtent(String string, Font font=None) ->
9519 (width, height, descent, externalLeading)
9520
9521 Get the width, height, decent and leading of the text using the
9522 current or specified font.
9523 """
9524 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9525
9526 def ClientToScreenXY(*args, **kwargs):
9527 """
9528 ClientToScreenXY(int x, int y) -> (x,y)
9529
9530 Converts to screen coordinates from coordinates relative to this window.
9531 """
9532 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9533
9534 def ScreenToClientXY(*args, **kwargs):
9535 """
9536 ScreenToClientXY(int x, int y) -> (x,y)
9537
9538 Converts from screen to client window coordinates.
9539 """
9540 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9541
9542 def ClientToScreen(*args, **kwargs):
9543 """
9544 ClientToScreen(self, Point pt) -> Point
9545
9546 Converts to screen coordinates from coordinates relative to this window.
9547 """
9548 return _core_.Window_ClientToScreen(*args, **kwargs)
9549
9550 def ScreenToClient(*args, **kwargs):
9551 """
9552 ScreenToClient(self, Point pt) -> Point
9553
9554 Converts from screen to client window coordinates.
9555 """
9556 return _core_.Window_ScreenToClient(*args, **kwargs)
9557
9558 def HitTestXY(*args, **kwargs):
9559 """
9560 HitTestXY(self, int x, int y) -> int
9561
9562 Test where the given (in client coords) point lies
9563 """
9564 return _core_.Window_HitTestXY(*args, **kwargs)
9565
9566 def HitTest(*args, **kwargs):
9567 """
9568 HitTest(self, Point pt) -> int
9569
9570 Test where the given (in client coords) point lies
9571 """
9572 return _core_.Window_HitTest(*args, **kwargs)
9573
9574 def GetBorder(*args):
9575 """
9576 GetBorder(self, long flags) -> int
9577 GetBorder(self) -> int
9578
9579 Get border for the flags of this window
9580 """
9581 return _core_.Window_GetBorder(*args)
9582
9583 def UpdateWindowUI(*args, **kwargs):
9584 """
9585 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9586
9587 This function sends EVT_UPDATE_UI events to the window. The particular
9588 implementation depends on the window; for example a wx.ToolBar will
9589 send an update UI event for each toolbar button, and a wx.Frame will
9590 send an update UI event for each menubar menu item. You can call this
9591 function from your application to ensure that your UI is up-to-date at
9592 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9593 concerned). This may be necessary if you have called
5ba5649b 9594 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9595 limit the overhead that wxWindows incurs by sending update UI events
9596 in idle time.
d55e5bfc
RD
9597 """
9598 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9599
9600 def PopupMenuXY(*args, **kwargs):
9601 """
7a0b95b0 9602 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9603
7a0b95b0
RD
9604 Pops up the given menu at the specified coordinates, relative to this window,
9605 and returns control when the user has dismissed the menu. If a menu item is
9606 selected, the corresponding menu event is generated and will be processed as
9607 usual. If the default position is given then the current position of the
9608 mouse cursor will be used.
d55e5bfc
RD
9609 """
9610 return _core_.Window_PopupMenuXY(*args, **kwargs)
9611
9612 def PopupMenu(*args, **kwargs):
9613 """
7a0b95b0 9614 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9615
7a0b95b0
RD
9616 Pops up the given menu at the specified coordinates, relative to this window,
9617 and returns control when the user has dismissed the menu. If a menu item is
9618 selected, the corresponding menu event is generated and will be processed as
9619 usual. If the default position is given then the current position of the
9620 mouse cursor will be used.
d55e5bfc
RD
9621 """
9622 return _core_.Window_PopupMenu(*args, **kwargs)
9623
1eeb270e
RD
9624 def HasMultiplePages(*args, **kwargs):
9625 """HasMultiplePages(self) -> bool"""
9626 return _core_.Window_HasMultiplePages(*args, **kwargs)
9627
d55e5bfc
RD
9628 def GetHandle(*args, **kwargs):
9629 """
9630 GetHandle(self) -> long
9631
9632 Returns the platform-specific handle (as a long integer) of the
9633 physical window. Currently on wxMac it returns the handle of the
9634 toplevel parent of the window.
9635 """
9636 return _core_.Window_GetHandle(*args, **kwargs)
9637
629e65c2
RD
9638 def AssociateHandle(*args, **kwargs):
9639 """
9640 AssociateHandle(self, long handle)
9641
9642 Associate the window with a new native handle
9643 """
9644 return _core_.Window_AssociateHandle(*args, **kwargs)
9645
9646 def DissociateHandle(*args, **kwargs):
9647 """
9648 DissociateHandle(self)
9649
9650 Dissociate the current native handle from the window
9651 """
9652 return _core_.Window_DissociateHandle(*args, **kwargs)
9653
d55e5bfc
RD
9654 def OnPaint(*args, **kwargs):
9655 """OnPaint(self, PaintEvent event)"""
9656 return _core_.Window_OnPaint(*args, **kwargs)
9657
9658 def HasScrollbar(*args, **kwargs):
9659 """
9660 HasScrollbar(self, int orient) -> bool
9661
9662 Does the window have the scrollbar for this orientation?
9663 """
9664 return _core_.Window_HasScrollbar(*args, **kwargs)
9665
9666 def SetScrollbar(*args, **kwargs):
9667 """
79fccf9d 9668 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
9669 bool refresh=True)
9670
9671 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc
RD
9672 """
9673 return _core_.Window_SetScrollbar(*args, **kwargs)
9674
9675 def SetScrollPos(*args, **kwargs):
9676 """
9677 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9678
9679 Sets the position of one of the built-in scrollbars.
9680 """
9681 return _core_.Window_SetScrollPos(*args, **kwargs)
9682
9683 def GetScrollPos(*args, **kwargs):
9684 """
9685 GetScrollPos(self, int orientation) -> int
9686
9687 Returns the built-in scrollbar position.
9688 """
9689 return _core_.Window_GetScrollPos(*args, **kwargs)
9690
9691 def GetScrollThumb(*args, **kwargs):
9692 """
9693 GetScrollThumb(self, int orientation) -> int
9694
9695 Returns the built-in scrollbar thumb size.
9696 """
9697 return _core_.Window_GetScrollThumb(*args, **kwargs)
9698
9699 def GetScrollRange(*args, **kwargs):
9700 """
9701 GetScrollRange(self, int orientation) -> int
9702
9703 Returns the built-in scrollbar range.
9704 """
9705 return _core_.Window_GetScrollRange(*args, **kwargs)
9706
9707 def ScrollWindow(*args, **kwargs):
9708 """
9709 ScrollWindow(self, int dx, int dy, Rect rect=None)
9710
9711 Physically scrolls the pixels in the window and move child windows
9712 accordingly. Use this function to optimise your scrolling
9713 implementations, to minimise the area that must be redrawn. Note that
9714 it is rarely required to call this function from a user program.
d55e5bfc
RD
9715 """
9716 return _core_.Window_ScrollWindow(*args, **kwargs)
9717
9718 def ScrollLines(*args, **kwargs):
9719 """
9720 ScrollLines(self, int lines) -> bool
9721
9722 If the platform and window class supports it, scrolls the window by
9723 the given number of lines down, if lines is positive, or up if lines
9724 is negative. Returns True if the window was scrolled, False if it was
9725 already on top/bottom and nothing was done.
9726 """
9727 return _core_.Window_ScrollLines(*args, **kwargs)
9728
9729 def ScrollPages(*args, **kwargs):
9730 """
9731 ScrollPages(self, int pages) -> bool
9732
79fccf9d 9733 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
9734 the given number of pages down, if pages is positive, or up if pages
9735 is negative. Returns True if the window was scrolled, False if it was
9736 already on top/bottom and nothing was done.
9737 """
9738 return _core_.Window_ScrollPages(*args, **kwargs)
9739
9740 def LineUp(*args, **kwargs):
9741 """
9742 LineUp(self) -> bool
9743
9744 This is just a wrapper for ScrollLines(-1).
9745 """
9746 return _core_.Window_LineUp(*args, **kwargs)
9747
9748 def LineDown(*args, **kwargs):
9749 """
9750 LineDown(self) -> bool
9751
9752 This is just a wrapper for ScrollLines(1).
9753 """
9754 return _core_.Window_LineDown(*args, **kwargs)
9755
9756 def PageUp(*args, **kwargs):
9757 """
9758 PageUp(self) -> bool
9759
9760 This is just a wrapper for ScrollPages(-1).
9761 """
9762 return _core_.Window_PageUp(*args, **kwargs)
9763
9764 def PageDown(*args, **kwargs):
9765 """
9766 PageDown(self) -> bool
9767
9768 This is just a wrapper for ScrollPages(1).
9769 """
9770 return _core_.Window_PageDown(*args, **kwargs)
9771
9772 def SetHelpText(*args, **kwargs):
9773 """
9774 SetHelpText(self, String text)
9775
9776 Sets the help text to be used as context-sensitive help for this
9777 window. Note that the text is actually stored by the current
f52cbe90 9778 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc
RD
9779 """
9780 return _core_.Window_SetHelpText(*args, **kwargs)
9781
9782 def SetHelpTextForId(*args, **kwargs):
9783 """
9784 SetHelpTextForId(self, String text)
9785
9786 Associate this help text with all windows with the same id as this
9787 one.
9788 """
9789 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9790
b850e7f3
RD
9791 def GetHelpTextAtPoint(*args, **kwargs):
9792 """
9793 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9794
9795 Get the help string associated with the given position in this window.
9796
9797 Notice that pt may be invalid if event origin is keyboard or unknown
9798 and this method should return the global window help text then
9799
9800 """
9801 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9802
d55e5bfc
RD
9803 def GetHelpText(*args, **kwargs):
9804 """
9805 GetHelpText(self) -> String
9806
9807 Gets the help text to be used as context-sensitive help for this
9808 window. Note that the text is actually stored by the current
f52cbe90 9809 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc
RD
9810 """
9811 return _core_.Window_GetHelpText(*args, **kwargs)
9812
9813 def SetToolTipString(*args, **kwargs):
9814 """
9815 SetToolTipString(self, String tip)
9816
9817 Attach a tooltip to the window.
9818 """
9819 return _core_.Window_SetToolTipString(*args, **kwargs)
9820
9821 def SetToolTip(*args, **kwargs):
9822 """
9823 SetToolTip(self, ToolTip tip)
9824
9825 Attach a tooltip to the window.
9826 """
9827 return _core_.Window_SetToolTip(*args, **kwargs)
9828
9829 def GetToolTip(*args, **kwargs):
9830 """
9831 GetToolTip(self) -> ToolTip
9832
9833 get the associated tooltip or None if none
9834 """
9835 return _core_.Window_GetToolTip(*args, **kwargs)
9836
9837 def SetDropTarget(*args, **kwargs):
9838 """
9839 SetDropTarget(self, DropTarget dropTarget)
9840
9841 Associates a drop target with this window. If the window already has
9842 a drop target, it is deleted.
9843 """
9844 return _core_.Window_SetDropTarget(*args, **kwargs)
9845
9846 def GetDropTarget(*args, **kwargs):
9847 """
9848 GetDropTarget(self) -> DropTarget
9849
9850 Returns the associated drop target, which may be None.
9851 """
9852 return _core_.Window_GetDropTarget(*args, **kwargs)
9853
9854 def DragAcceptFiles(*args, **kwargs):
9855 """
9856 DragAcceptFiles(self, bool accept)
9857
9858 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
5ba5649b 9859 Only functional on Windows.
d55e5bfc
RD
9860 """
9861 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9862
9863 def SetConstraints(*args, **kwargs):
9864 """
9865 SetConstraints(self, LayoutConstraints constraints)
9866
9867 Sets the window to have the given layout constraints. If an existing
9868 layout constraints object is already owned by the window, it will be
9869 deleted. Pass None to disassociate and delete the window's current
9870 constraints.
9871
9872 You must call SetAutoLayout to tell a window to use the constraints
9873 automatically in its default EVT_SIZE handler; otherwise, you must
9874 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9875 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9876 effect.
9877 """
9878 return _core_.Window_SetConstraints(*args, **kwargs)
9879
9880 def GetConstraints(*args, **kwargs):
9881 """
9882 GetConstraints(self) -> LayoutConstraints
9883
9884 Returns a pointer to the window's layout constraints, or None if there
9885 are none.
9886 """
9887 return _core_.Window_GetConstraints(*args, **kwargs)
9888
9889 def SetAutoLayout(*args, **kwargs):
9890 """
9891 SetAutoLayout(self, bool autoLayout)
9892
9893 Determines whether the Layout function will be called automatically
b1fcee84
RD
9894 when the window is resized. lease note that this only happens for the
9895 windows usually used to contain children, namely `wx.Panel` and
9896 `wx.TopLevelWindow` (and the classes deriving from them).
9897
9898 This method is called implicitly by `SetSizer` but if you use
9899 `SetConstraints` you should call it manually or otherwise the window
9900 layout won't be correctly updated when its size changes.
d55e5bfc
RD
9901 """
9902 return _core_.Window_SetAutoLayout(*args, **kwargs)
9903
9904 def GetAutoLayout(*args, **kwargs):
9905 """
9906 GetAutoLayout(self) -> bool
9907
9908 Returns the current autoLayout setting
9909 """
9910 return _core_.Window_GetAutoLayout(*args, **kwargs)
9911
9912 def Layout(*args, **kwargs):
9913 """
9914 Layout(self) -> bool
9915
9916 Invokes the constraint-based layout algorithm or the sizer-based
9917 algorithm for this window. See SetAutoLayout: when auto layout is on,
9918 this function gets called automatically by the default EVT_SIZE
9919 handler when the window is resized.
9920 """
9921 return _core_.Window_Layout(*args, **kwargs)
9922
9923 def SetSizer(*args, **kwargs):
9924 """
9925 SetSizer(self, Sizer sizer, bool deleteOld=True)
9926
9927 Sets the window to have the given layout sizer. The window will then
9928 own the object, and will take care of its deletion. If an existing
9929 layout sizer object is already owned by the window, it will be deleted
9930 if the deleteOld parameter is true. Note that this function will also
9931 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 9932 non-None, and False otherwise.
d55e5bfc
RD
9933 """
9934 return _core_.Window_SetSizer(*args, **kwargs)
9935
9936 def SetSizerAndFit(*args, **kwargs):
9937 """
9938 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9939
9940 The same as SetSizer, except it also sets the size hints for the
9941 window based on the sizer's minimum size.
9942 """
9943 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9944
9945 def GetSizer(*args, **kwargs):
9946 """
9947 GetSizer(self) -> Sizer
9948
9949 Return the sizer associated with the window by a previous call to
9950 SetSizer or None if there isn't one.
9951 """
9952 return _core_.Window_GetSizer(*args, **kwargs)
9953
9954 def SetContainingSizer(*args, **kwargs):
9955 """
9956 SetContainingSizer(self, Sizer sizer)
9957
9958 This normally does not need to be called by application code. It is
9959 called internally when a window is added to a sizer, and is used so
9960 the window can remove itself from the sizer when it is destroyed.
9961 """
9962 return _core_.Window_SetContainingSizer(*args, **kwargs)
9963
9964 def GetContainingSizer(*args, **kwargs):
9965 """
9966 GetContainingSizer(self) -> Sizer
9967
9968 Return the sizer that this window is a member of, if any, otherwise None.
9969 """
9970 return _core_.Window_GetContainingSizer(*args, **kwargs)
9971
9972 def InheritAttributes(*args, **kwargs):
9973 """
9974 InheritAttributes(self)
9975
79fccf9d
RD
9976 This function is (or should be, in case of custom controls) called
9977 during window creation to intelligently set up the window visual
9978 attributes, that is the font and the foreground and background
9979 colours.
9980
9981 By 'intelligently' the following is meant: by default, all windows use
9982 their own default attributes. However if some of the parent's
9983 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 9984 SetOwnFont) and if the corresponding attribute hadn't been
79fccf9d
RD
9985 explicitly set for this window itself, then this window takes the same
9986 value as used by the parent. In addition, if the window overrides
9987 ShouldInheritColours to return false, the colours will not be changed
9988 no matter what and only the font might.
9989
ec9b55ca
RD
9990 This rather complicated logic is necessary in order to accommodate the
9991 different usage scenarios. The most common one is when all default
79fccf9d
RD
9992 attributes are used and in this case, nothing should be inherited as
9993 in modern GUIs different controls use different fonts (and colours)
9994 than their siblings so they can't inherit the same value from the
9995 parent. However it was also deemed desirable to allow to simply change
9996 the attributes of all children at once by just changing the font or
9997 colour of their common parent, hence in this case we do inherit the
9998 parents attributes.
9999
d55e5bfc
RD
10000 """
10001 return _core_.Window_InheritAttributes(*args, **kwargs)
10002
10003 def ShouldInheritColours(*args, **kwargs):
10004 """
10005 ShouldInheritColours(self) -> bool
10006
10007 Return true from here to allow the colours of this window to be
79fccf9d
RD
10008 changed by InheritAttributes, returning false forbids inheriting them
10009 from the parent window.
d55e5bfc 10010
79fccf9d
RD
10011 The base class version returns false, but this method is overridden in
10012 wxControl where it returns true.
d55e5bfc
RD
10013 """
10014 return _core_.Window_ShouldInheritColours(*args, **kwargs)
10015
fc46b7f3
RD
10016 def CanSetTransparent(*args, **kwargs):
10017 """
10018 CanSetTransparent(self) -> bool
10019
10020 Returns ``True`` if the platform supports setting the transparency for
10021 this window. Note that this method will err on the side of caution,
10022 so it is possible that this will return ``False`` when it is in fact
10023 possible to set the transparency.
10024
10025 NOTE: On X-windows systems the X server must have the composite
10026 extension loaded, and there must be a composite manager program (such
10027 as xcompmgr) running.
10028 """
10029 return _core_.Window_CanSetTransparent(*args, **kwargs)
10030
10031 def SetTransparent(*args, **kwargs):
10032 """
10033 SetTransparent(self, byte alpha) -> bool
10034
10035 Attempt to set the transparency of this window to the ``alpha`` value,
10036 returns True on success. The ``alpha`` value is an integer in the
10037 range of 0 to 255, where 0 is fully transparent and 255 is fully
10038 opaque.
10039 """
10040 return _core_.Window_SetTransparent(*args, **kwargs)
10041
d55e5bfc
RD
10042 def PostCreate(self, pre):
10043 """
10044 Phase 3 of the 2-phase create <wink!>
10045 Call this method after precreating the window with the 2-phase create method.
10046 """
10047 self.this = pre.this
10048 self.thisown = pre.thisown
10049 pre.thisown = 0
10050 if hasattr(self, '_setOORInfo'):
10051 self._setOORInfo(self)
10052 if hasattr(self, '_setCallbackInfo'):
10053 self._setCallbackInfo(self, self.__class__)
10054
7e08d4ef 10055 def SendSizeEvent(self):
0ef86618 10056 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
7e08d4ef 10057
226118fc
RD
10058 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
10059 AdjustedBestSize = property(GetAdjustedBestSize,doc="See `GetAdjustedBestSize`")
10060 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
10061 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10062 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
10063 BestFittingSize = property(GetBestFittingSize,SetBestFittingSize,doc="See `GetBestFittingSize` and `SetBestFittingSize`")
10064 BestSize = property(GetBestSize,doc="See `GetBestSize`")
10065 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
10066 Border = property(GetBorder,doc="See `GetBorder`")
10067 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
10068 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
10069 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
10070 Children = property(GetChildren,doc="See `GetChildren`")
10071 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
10072 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
10073 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
10074 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
10075 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
10076 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
10077 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
10078 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
10079 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10080 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
10081 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10082 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
226118fc
RD
10083 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
10084 Handle = property(GetHandle,doc="See `GetHandle`")
10085 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
226118fc
RD
10086 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10087 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
994453b8 10088 LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`")
226118fc
RD
10089 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
10090 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
10091 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
10092 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
10093 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
10094 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
10095 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
10096 Parent = property(GetParent,doc="See `GetParent`")
10097 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
10098 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
10099 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
10100 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
226118fc
RD
10101 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
10102 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
226118fc
RD
10103 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
10104 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
10105 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
10106 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
10107 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
10108 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
10109 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
10110 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10111 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
97ab0f6a
RD
10112 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
10113 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
10114 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
2131d850 10115_core_.Window_swigregister(Window)
d55e5bfc
RD
10116
10117def PreWindow(*args, **kwargs):
10118 """
10119 PreWindow() -> Window
10120
10121 Precreate a Window for 2-phase creation.
10122 """
10123 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
10124 return val
10125
554f62e9
RD
10126def Window_NewControlId(*args):
10127 """
d55e5bfc
RD
10128 Window_NewControlId() -> int
10129
10130 Generate a control id for the controls which were not given one.
10131 """
554f62e9 10132 return _core_.Window_NewControlId(*args)
d55e5bfc
RD
10133
10134def Window_NextControlId(*args, **kwargs):
554f62e9 10135 """
d55e5bfc
RD
10136 Window_NextControlId(int winid) -> int
10137
10138 Get the id of the control following the one with the given
79fccf9d 10139 autogenerated) id
d55e5bfc 10140 """
554f62e9 10141 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
10142
10143def Window_PrevControlId(*args, **kwargs):
554f62e9 10144 """
d55e5bfc
RD
10145 Window_PrevControlId(int winid) -> int
10146
10147 Get the id of the control preceding the one with the given
79fccf9d 10148 autogenerated) id
d55e5bfc 10149 """
554f62e9 10150 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 10151
554f62e9
RD
10152def Window_FindFocus(*args):
10153 """
d55e5bfc
RD
10154 Window_FindFocus() -> Window
10155
10156 Returns the window or control that currently has the keyboard focus,
10157 or None.
10158 """
554f62e9 10159 return _core_.Window_FindFocus(*args)
d55e5bfc 10160
554f62e9
RD
10161def Window_GetCapture(*args):
10162 """
d55e5bfc
RD
10163 Window_GetCapture() -> Window
10164
10165 Returns the window which currently captures the mouse or None
10166 """
554f62e9 10167 return _core_.Window_GetCapture(*args)
d55e5bfc
RD
10168
10169def Window_GetClassDefaultAttributes(*args, **kwargs):
554f62e9 10170 """
d55e5bfc
RD
10171 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10172
79fccf9d
RD
10173 Get the default attributes for this class. This is useful if you want
10174 to use the same font or colour in your own control as in a standard
10175 control -- which is a much better idea than hard coding specific
caef1a4d
RD
10176 colours or fonts which might look completely out of place on the
10177 user's system, especially if it uses themes.
d55e5bfc
RD
10178
10179 The variant parameter is only relevant under Mac currently and is
79fccf9d 10180 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
10181 the returned font. See `wx.Window.SetWindowVariant` for more about
10182 this.
d55e5bfc 10183 """
554f62e9 10184 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10185
10186def DLG_PNT(win, point_or_x, y=None):
10187 """
10188 Convenience function for converting a Point or (x,y) in
10189 dialog units to pixel units.
10190 """
10191 if y is None:
10192 return win.ConvertDialogPointToPixels(point_or_x)
10193 else:
10194 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10195
10196def DLG_SZE(win, size_width, height=None):
10197 """
10198 Convenience function for converting a Size or (w,h) in
10199 dialog units to pixel units.
10200 """
10201 if height is None:
10202 return win.ConvertDialogSizeToPixels(size_width)
10203 else:
10204 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10205
10206
10207def FindWindowById(*args, **kwargs):
554f62e9 10208 """
d55e5bfc
RD
10209 FindWindowById(long id, Window parent=None) -> Window
10210
10211 Find the first window in the application with the given id. If parent
10212 is None, the search will start from all top-level frames and dialog
10213 boxes; if non-None, the search will be limited to the given window
10214 hierarchy. The search is recursive in both cases.
10215 """
554f62e9 10216 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc
RD
10217
10218def FindWindowByName(*args, **kwargs):
554f62e9 10219 """
d55e5bfc
RD
10220 FindWindowByName(String name, Window parent=None) -> Window
10221
10222 Find a window by its name (as given in a window constructor or Create
10223 function call). If parent is None, the search will start from all
10224 top-level frames and dialog boxes; if non-None, the search will be
10225 limited to the given window hierarchy. The search is recursive in both
10226 cases.
10227
10228 If no window with such name is found, wx.FindWindowByLabel is called.
10229 """
554f62e9 10230 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc
RD
10231
10232def FindWindowByLabel(*args, **kwargs):
554f62e9 10233 """
d55e5bfc
RD
10234 FindWindowByLabel(String label, Window parent=None) -> Window
10235
10236 Find a window by its label. Depending on the type of window, the label
10237 may be a window title or panel item label. If parent is None, the
10238 search will start from all top-level frames and dialog boxes; if
10239 non-None, the search will be limited to the given window
10240 hierarchy. The search is recursive in both cases.
10241 """
554f62e9 10242 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc
RD
10243
10244def Window_FromHWND(*args, **kwargs):
554f62e9
RD
10245 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10246 return _core_.Window_FromHWND(*args, **kwargs)
3215336e 10247
554f62e9
RD
10248def GetTopLevelWindows(*args):
10249 """
3215336e
RD
10250 GetTopLevelWindows() -> PyObject
10251
10252 Returns a list of the the application's top-level windows, (frames,
10253 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10254 by wxWidgets, and so it is only valid as long as no top-level windows
10255 are closed or new top-level windows are created.
10256
10257 """
554f62e9 10258 return _core_.GetTopLevelWindows(*args)
d55e5bfc
RD
10259#---------------------------------------------------------------------------
10260
10261class Validator(EvtHandler):
093d3ff1 10262 """Proxy of C++ Validator class"""
554f62e9
RD
10263 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10264 __repr__ = _swig_repr
10265 def __init__(self, *args, **kwargs):
d55e5bfc 10266 """__init__(self) -> Validator"""
554f62e9 10267 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d55e5bfc
RD
10268 self._setOORInfo(self)
10269
10270 def Clone(*args, **kwargs):
10271 """Clone(self) -> Validator"""
10272 return _core_.Validator_Clone(*args, **kwargs)
10273
10274 def Validate(*args, **kwargs):
10275 """Validate(self, Window parent) -> bool"""
10276 return _core_.Validator_Validate(*args, **kwargs)
10277
10278 def TransferToWindow(*args, **kwargs):
10279 """TransferToWindow(self) -> bool"""
10280 return _core_.Validator_TransferToWindow(*args, **kwargs)
10281
10282 def TransferFromWindow(*args, **kwargs):
10283 """TransferFromWindow(self) -> bool"""
10284 return _core_.Validator_TransferFromWindow(*args, **kwargs)
10285
10286 def GetWindow(*args, **kwargs):
10287 """GetWindow(self) -> Window"""
10288 return _core_.Validator_GetWindow(*args, **kwargs)
10289
10290 def SetWindow(*args, **kwargs):
10291 """SetWindow(self, Window window)"""
10292 return _core_.Validator_SetWindow(*args, **kwargs)
10293
10294 def IsSilent(*args, **kwargs):
c24da6d6 10295 """IsSilent() -> bool"""
d55e5bfc
RD
10296 return _core_.Validator_IsSilent(*args, **kwargs)
10297
10298 IsSilent = staticmethod(IsSilent)
10299 def SetBellOnError(*args, **kwargs):
c24da6d6 10300 """SetBellOnError(int doIt=True)"""
d55e5bfc
RD
10301 return _core_.Validator_SetBellOnError(*args, **kwargs)
10302
10303 SetBellOnError = staticmethod(SetBellOnError)
dba7934c 10304 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 10305_core_.Validator_swigregister(Validator)
d55e5bfc 10306
554f62e9
RD
10307def Validator_IsSilent(*args):
10308 """Validator_IsSilent() -> bool"""
10309 return _core_.Validator_IsSilent(*args)
d55e5bfc
RD
10310
10311def Validator_SetBellOnError(*args, **kwargs):
554f62e9
RD
10312 """Validator_SetBellOnError(int doIt=True)"""
10313 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
10314
10315class PyValidator(Validator):
093d3ff1 10316 """Proxy of C++ PyValidator class"""
554f62e9
RD
10317 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10318 __repr__ = _swig_repr
10319 def __init__(self, *args, **kwargs):
d55e5bfc 10320 """__init__(self) -> PyValidator"""
554f62e9 10321 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
d55e5bfc
RD
10322
10323 self._setCallbackInfo(self, PyValidator, 1)
10324 self._setOORInfo(self)
10325
10326 def _setCallbackInfo(*args, **kwargs):
10327 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
10328 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
10329
2131d850 10330_core_.PyValidator_swigregister(PyValidator)
d55e5bfc
RD
10331
10332#---------------------------------------------------------------------------
10333
10334class Menu(EvtHandler):
093d3ff1 10335 """Proxy of C++ Menu class"""
554f62e9
RD
10336 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10337 __repr__ = _swig_repr
10338 def __init__(self, *args, **kwargs):
d55e5bfc 10339 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
554f62e9 10340 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
d55e5bfc
RD
10341 self._setOORInfo(self)
10342
10343 def Append(*args, **kwargs):
97ab0f6a
RD
10344 """
10345 Append(self, int id, String text=EmptyString, String help=EmptyString,
10346 int kind=ITEM_NORMAL) -> MenuItem
10347 """
d55e5bfc
RD
10348 return _core_.Menu_Append(*args, **kwargs)
10349
10350 def AppendSeparator(*args, **kwargs):
10351 """AppendSeparator(self) -> MenuItem"""
10352 return _core_.Menu_AppendSeparator(*args, **kwargs)
10353
10354 def AppendCheckItem(*args, **kwargs):
10355 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10356 return _core_.Menu_AppendCheckItem(*args, **kwargs)
10357
10358 def AppendRadioItem(*args, **kwargs):
10359 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10360 return _core_.Menu_AppendRadioItem(*args, **kwargs)
10361
10362 def AppendMenu(*args, **kwargs):
10363 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10364 return _core_.Menu_AppendMenu(*args, **kwargs)
10365
50efceee
RD
10366 def AppendSubMenu(*args, **kwargs):
10367 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10368 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10369
d55e5bfc
RD
10370 def AppendItem(*args, **kwargs):
10371 """AppendItem(self, MenuItem item) -> MenuItem"""
10372 return _core_.Menu_AppendItem(*args, **kwargs)
10373
d55e5bfc
RD
10374 def InsertItem(*args, **kwargs):
10375 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10376 return _core_.Menu_InsertItem(*args, **kwargs)
10377
554f62e9
RD
10378 def PrependItem(*args, **kwargs):
10379 """PrependItem(self, MenuItem item) -> MenuItem"""
10380 return _core_.Menu_PrependItem(*args, **kwargs)
10381
10382 def Break(*args, **kwargs):
10383 """Break(self)"""
10384 return _core_.Menu_Break(*args, **kwargs)
10385
d55e5bfc
RD
10386 def Insert(*args, **kwargs):
10387 """
97ab0f6a 10388 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
d55e5bfc
RD
10389 int kind=ITEM_NORMAL) -> MenuItem
10390 """
10391 return _core_.Menu_Insert(*args, **kwargs)
10392
10393 def InsertSeparator(*args, **kwargs):
10394 """InsertSeparator(self, size_t pos) -> MenuItem"""
10395 return _core_.Menu_InsertSeparator(*args, **kwargs)
10396
10397 def InsertCheckItem(*args, **kwargs):
10398 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10399 return _core_.Menu_InsertCheckItem(*args, **kwargs)
10400
10401 def InsertRadioItem(*args, **kwargs):
10402 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10403 return _core_.Menu_InsertRadioItem(*args, **kwargs)
10404
10405 def InsertMenu(*args, **kwargs):
10406 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10407 return _core_.Menu_InsertMenu(*args, **kwargs)
10408
d55e5bfc 10409 def Prepend(*args, **kwargs):
97ab0f6a
RD
10410 """
10411 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10412 int kind=ITEM_NORMAL) -> MenuItem
10413 """
d55e5bfc
RD
10414 return _core_.Menu_Prepend(*args, **kwargs)
10415
10416 def PrependSeparator(*args, **kwargs):
10417 """PrependSeparator(self) -> MenuItem"""
10418 return _core_.Menu_PrependSeparator(*args, **kwargs)
10419
10420 def PrependCheckItem(*args, **kwargs):
10421 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10422 return _core_.Menu_PrependCheckItem(*args, **kwargs)
10423
10424 def PrependRadioItem(*args, **kwargs):
10425 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10426 return _core_.Menu_PrependRadioItem(*args, **kwargs)
10427
10428 def PrependMenu(*args, **kwargs):
10429 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10430 return _core_.Menu_PrependMenu(*args, **kwargs)
10431
10432 def Remove(*args, **kwargs):
10433 """Remove(self, int id) -> MenuItem"""
10434 return _core_.Menu_Remove(*args, **kwargs)
10435
10436 def RemoveItem(*args, **kwargs):
10437 """RemoveItem(self, MenuItem item) -> MenuItem"""
10438 return _core_.Menu_RemoveItem(*args, **kwargs)
10439
10440 def Delete(*args, **kwargs):
10441 """Delete(self, int id) -> bool"""
10442 return _core_.Menu_Delete(*args, **kwargs)
10443
10444 def DeleteItem(*args, **kwargs):
10445 """DeleteItem(self, MenuItem item) -> bool"""
10446 return _core_.Menu_DeleteItem(*args, **kwargs)
10447
10448 def Destroy(*args, **kwargs):
10449 """
10450 Destroy(self)
10451
10452 Deletes the C++ object this Python object is a proxy for.
10453 """
7e08d4ef
RD
10454 val = _core_.Menu_Destroy(*args, **kwargs)
10455 args[0].thisown = 0
10456 return val
d55e5bfc
RD
10457
10458 def DestroyId(*args, **kwargs):
10459 """
10460 DestroyId(self, int id) -> bool
10461
10462 Deletes the C++ object this Python object is a proxy for.
10463 """
7e08d4ef
RD
10464 val = _core_.Menu_DestroyId(*args, **kwargs)
10465 args[0].thisown = 0
10466 return val
d55e5bfc
RD
10467
10468 def DestroyItem(*args, **kwargs):
10469 """
10470 DestroyItem(self, MenuItem item) -> bool
10471
10472 Deletes the C++ object this Python object is a proxy for.
10473 """
7e08d4ef
RD
10474 val = _core_.Menu_DestroyItem(*args, **kwargs)
10475 args[0].thisown = 0
10476 return val
d55e5bfc
RD
10477
10478 def GetMenuItemCount(*args, **kwargs):
10479 """GetMenuItemCount(self) -> size_t"""
10480 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
10481
10482 def GetMenuItems(*args, **kwargs):
10483 """GetMenuItems(self) -> PyObject"""
10484 return _core_.Menu_GetMenuItems(*args, **kwargs)
10485
10486 def FindItem(*args, **kwargs):
10487 """FindItem(self, String item) -> int"""
10488 return _core_.Menu_FindItem(*args, **kwargs)
10489
10490 def FindItemById(*args, **kwargs):
10491 """FindItemById(self, int id) -> MenuItem"""
10492 return _core_.Menu_FindItemById(*args, **kwargs)
10493
10494 def FindItemByPosition(*args, **kwargs):
10495 """FindItemByPosition(self, size_t position) -> MenuItem"""
10496 return _core_.Menu_FindItemByPosition(*args, **kwargs)
10497
10498 def Enable(*args, **kwargs):
10499 """Enable(self, int id, bool enable)"""
10500 return _core_.Menu_Enable(*args, **kwargs)
10501
10502 def IsEnabled(*args, **kwargs):
10503 """IsEnabled(self, int id) -> bool"""
10504 return _core_.Menu_IsEnabled(*args, **kwargs)
10505
10506 def Check(*args, **kwargs):
10507 """Check(self, int id, bool check)"""
10508 return _core_.Menu_Check(*args, **kwargs)
10509
10510 def IsChecked(*args, **kwargs):
10511 """IsChecked(self, int id) -> bool"""
10512 return _core_.Menu_IsChecked(*args, **kwargs)
10513
10514 def SetLabel(*args, **kwargs):
10515 """SetLabel(self, int id, String label)"""
10516 return _core_.Menu_SetLabel(*args, **kwargs)
10517
10518 def GetLabel(*args, **kwargs):
10519 """GetLabel(self, int id) -> String"""
10520 return _core_.Menu_GetLabel(*args, **kwargs)
10521
10522 def SetHelpString(*args, **kwargs):
10523 """SetHelpString(self, int id, String helpString)"""
10524 return _core_.Menu_SetHelpString(*args, **kwargs)
10525
10526 def GetHelpString(*args, **kwargs):
10527 """GetHelpString(self, int id) -> String"""
10528 return _core_.Menu_GetHelpString(*args, **kwargs)
10529
10530 def SetTitle(*args, **kwargs):
10531 """SetTitle(self, String title)"""
10532 return _core_.Menu_SetTitle(*args, **kwargs)
10533
10534 def GetTitle(*args, **kwargs):
10535 """GetTitle(self) -> String"""
10536 return _core_.Menu_GetTitle(*args, **kwargs)
10537
10538 def SetEventHandler(*args, **kwargs):
10539 """SetEventHandler(self, EvtHandler handler)"""
10540 return _core_.Menu_SetEventHandler(*args, **kwargs)
10541
10542 def GetEventHandler(*args, **kwargs):
10543 """GetEventHandler(self) -> EvtHandler"""
10544 return _core_.Menu_GetEventHandler(*args, **kwargs)
10545
10546 def SetInvokingWindow(*args, **kwargs):
10547 """SetInvokingWindow(self, Window win)"""
10548 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
10549
10550 def GetInvokingWindow(*args, **kwargs):
10551 """GetInvokingWindow(self) -> Window"""
10552 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
10553
10554 def GetStyle(*args, **kwargs):
10555 """GetStyle(self) -> long"""
10556 return _core_.Menu_GetStyle(*args, **kwargs)
10557
10558 def UpdateUI(*args, **kwargs):
10559 """UpdateUI(self, EvtHandler source=None)"""
10560 return _core_.Menu_UpdateUI(*args, **kwargs)
10561
10562 def GetMenuBar(*args, **kwargs):
10563 """GetMenuBar(self) -> MenuBar"""
10564 return _core_.Menu_GetMenuBar(*args, **kwargs)
10565
10566 def Attach(*args, **kwargs):
10567 """Attach(self, wxMenuBarBase menubar)"""
10568 return _core_.Menu_Attach(*args, **kwargs)
10569
10570 def Detach(*args, **kwargs):
10571 """Detach(self)"""
10572 return _core_.Menu_Detach(*args, **kwargs)
10573
10574 def IsAttached(*args, **kwargs):
10575 """IsAttached(self) -> bool"""
10576 return _core_.Menu_IsAttached(*args, **kwargs)
10577
10578 def SetParent(*args, **kwargs):
10579 """SetParent(self, Menu parent)"""
10580 return _core_.Menu_SetParent(*args, **kwargs)
10581
10582 def GetParent(*args, **kwargs):
10583 """GetParent(self) -> Menu"""
10584 return _core_.Menu_GetParent(*args, **kwargs)
10585
57332a5a
RD
10586 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10587 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
10588 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
10589 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
10590 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
10591 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
10592 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
10593 Style = property(GetStyle,doc="See `GetStyle`")
10594 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
2131d850 10595_core_.Menu_swigregister(Menu)
d55e5bfc
RD
10596DefaultValidator = cvar.DefaultValidator
10597
10598#---------------------------------------------------------------------------
10599
10600class MenuBar(Window):
093d3ff1 10601 """Proxy of C++ MenuBar class"""
554f62e9
RD
10602 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10603 __repr__ = _swig_repr
10604 def __init__(self, *args, **kwargs):
d55e5bfc 10605 """__init__(self, long style=0) -> MenuBar"""
554f62e9 10606 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d55e5bfc
RD
10607 self._setOORInfo(self)
10608
10609 def Append(*args, **kwargs):
10610 """Append(self, Menu menu, String title) -> bool"""
10611 return _core_.MenuBar_Append(*args, **kwargs)
10612
10613 def Insert(*args, **kwargs):
10614 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10615 return _core_.MenuBar_Insert(*args, **kwargs)
10616
10617 def GetMenuCount(*args, **kwargs):
10618 """GetMenuCount(self) -> size_t"""
10619 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10620
10621 def GetMenu(*args, **kwargs):
10622 """GetMenu(self, size_t pos) -> Menu"""
10623 return _core_.MenuBar_GetMenu(*args, **kwargs)
10624
10625 def Replace(*args, **kwargs):
10626 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10627 return _core_.MenuBar_Replace(*args, **kwargs)
10628
10629 def Remove(*args, **kwargs):
10630 """Remove(self, size_t pos) -> Menu"""
10631 return _core_.MenuBar_Remove(*args, **kwargs)
10632
10633 def EnableTop(*args, **kwargs):
10634 """EnableTop(self, size_t pos, bool enable)"""
10635 return _core_.MenuBar_EnableTop(*args, **kwargs)
10636
10637 def IsEnabledTop(*args, **kwargs):
10638 """IsEnabledTop(self, size_t pos) -> bool"""
10639 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10640
10641 def SetLabelTop(*args, **kwargs):
10642 """SetLabelTop(self, size_t pos, String label)"""
10643 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10644
10645 def GetLabelTop(*args, **kwargs):
10646 """GetLabelTop(self, size_t pos) -> String"""
10647 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10648
10649 def FindMenuItem(*args, **kwargs):
10650 """FindMenuItem(self, String menu, String item) -> int"""
10651 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10652
10653 def FindItemById(*args, **kwargs):
10654 """FindItemById(self, int id) -> MenuItem"""
10655 return _core_.MenuBar_FindItemById(*args, **kwargs)
10656
10657 def FindMenu(*args, **kwargs):
10658 """FindMenu(self, String title) -> int"""
10659 return _core_.MenuBar_FindMenu(*args, **kwargs)
10660
10661 def Enable(*args, **kwargs):
10662 """Enable(self, int id, bool enable)"""
10663 return _core_.MenuBar_Enable(*args, **kwargs)
10664
10665 def Check(*args, **kwargs):
10666 """Check(self, int id, bool check)"""
10667 return _core_.MenuBar_Check(*args, **kwargs)
10668
10669 def IsChecked(*args, **kwargs):
10670 """IsChecked(self, int id) -> bool"""
10671 return _core_.MenuBar_IsChecked(*args, **kwargs)
10672
10673 def IsEnabled(*args, **kwargs):
10674 """IsEnabled(self, int id) -> bool"""
10675 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10676
10677 def SetLabel(*args, **kwargs):
10678 """SetLabel(self, int id, String label)"""
10679 return _core_.MenuBar_SetLabel(*args, **kwargs)
10680
10681 def GetLabel(*args, **kwargs):
10682 """GetLabel(self, int id) -> String"""
10683 return _core_.MenuBar_GetLabel(*args, **kwargs)
10684
10685 def SetHelpString(*args, **kwargs):
10686 """SetHelpString(self, int id, String helpString)"""
10687 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10688
10689 def GetHelpString(*args, **kwargs):
10690 """GetHelpString(self, int id) -> String"""
10691 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10692
10693 def GetFrame(*args, **kwargs):
10694 """GetFrame(self) -> wxFrame"""
10695 return _core_.MenuBar_GetFrame(*args, **kwargs)
10696
10697 def IsAttached(*args, **kwargs):
10698 """IsAttached(self) -> bool"""
10699 return _core_.MenuBar_IsAttached(*args, **kwargs)
10700
10701 def Attach(*args, **kwargs):
10702 """Attach(self, wxFrame frame)"""
10703 return _core_.MenuBar_Attach(*args, **kwargs)
10704
10705 def Detach(*args, **kwargs):
10706 """Detach(self)"""
10707 return _core_.MenuBar_Detach(*args, **kwargs)
10708
587d0f36
RD
10709 def UpdateMenus(*args, **kwargs):
10710 """UpdateMenus(self)"""
10711 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
10712
db67f999
RD
10713 def SetAutoWindowMenu(*args, **kwargs):
10714 """SetAutoWindowMenu(bool enable)"""
10715 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10716
10717 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10718 def GetAutoWindowMenu(*args, **kwargs):
10719 """GetAutoWindowMenu() -> bool"""
10720 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10721
10722 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
97ab0f6a
RD
10723 def GetMenus(self):
10724 """Return a list of (menu, label) items for the menus in the MenuBar. """
10725 return [(self.GetMenu(i), self.GetLabelTop(i))
10726 for i in range(self.GetMenuCount())]
10727
10728 def SetMenus(self, items):
10729 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
10730 for i in range(self.GetMenuCount()-1, -1, -1):
10731 self.Remove(i)
10732 for m, l in items:
10733 self.Append(m, l)
10734
57332a5a
RD
10735 Frame = property(GetFrame,doc="See `GetFrame`")
10736 Menu = property(GetMenu,doc="See `GetMenu`")
10737 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
10738 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
2131d850 10739_core_.MenuBar_swigregister(MenuBar)
d55e5bfc 10740
db67f999 10741def MenuBar_SetAutoWindowMenu(*args, **kwargs):
554f62e9
RD
10742 """MenuBar_SetAutoWindowMenu(bool enable)"""
10743 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
db67f999 10744
554f62e9
RD
10745def MenuBar_GetAutoWindowMenu(*args):
10746 """MenuBar_GetAutoWindowMenu() -> bool"""
10747 return _core_.MenuBar_GetAutoWindowMenu(*args)
db67f999 10748
d55e5bfc
RD
10749#---------------------------------------------------------------------------
10750
10751class MenuItem(Object):
093d3ff1 10752 """Proxy of C++ MenuItem class"""
554f62e9
RD
10753 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10754 __repr__ = _swig_repr
10755 def __init__(self, *args, **kwargs):
d55e5bfc
RD
10756 """
10757 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10758 String help=EmptyString, int kind=ITEM_NORMAL,
10759 Menu subMenu=None) -> MenuItem
10760 """
554f62e9
RD
10761 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10762 __swig_destroy__ = _core_.delete_MenuItem
10763 __del__ = lambda self : None;
d55e5bfc
RD
10764 def GetMenu(*args, **kwargs):
10765 """GetMenu(self) -> Menu"""
10766 return _core_.MenuItem_GetMenu(*args, **kwargs)
10767
10768 def SetMenu(*args, **kwargs):
10769 """SetMenu(self, Menu menu)"""
10770 return _core_.MenuItem_SetMenu(*args, **kwargs)
10771
10772 def SetId(*args, **kwargs):
10773 """SetId(self, int id)"""
10774 return _core_.MenuItem_SetId(*args, **kwargs)
10775
10776 def GetId(*args, **kwargs):
10777 """GetId(self) -> int"""
10778 return _core_.MenuItem_GetId(*args, **kwargs)
10779
10780 def IsSeparator(*args, **kwargs):
10781 """IsSeparator(self) -> bool"""
10782 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10783
10784 def SetText(*args, **kwargs):
10785 """SetText(self, String str)"""
10786 return _core_.MenuItem_SetText(*args, **kwargs)
10787
10788 def GetLabel(*args, **kwargs):
10789 """GetLabel(self) -> String"""
10790 return _core_.MenuItem_GetLabel(*args, **kwargs)
10791
10792 def GetText(*args, **kwargs):
10793 """GetText(self) -> String"""
10794 return _core_.MenuItem_GetText(*args, **kwargs)
10795
10796 def GetLabelFromText(*args, **kwargs):
c24da6d6 10797 """GetLabelFromText(String text) -> String"""
d55e5bfc
RD
10798 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10799
10800 GetLabelFromText = staticmethod(GetLabelFromText)
10801 def GetKind(*args, **kwargs):
10802 """GetKind(self) -> int"""
10803 return _core_.MenuItem_GetKind(*args, **kwargs)
10804
10805 def SetKind(*args, **kwargs):
10806 """SetKind(self, int kind)"""
10807 return _core_.MenuItem_SetKind(*args, **kwargs)
10808
10809 def SetCheckable(*args, **kwargs):
10810 """SetCheckable(self, bool checkable)"""
10811 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10812
10813 def IsCheckable(*args, **kwargs):
10814 """IsCheckable(self) -> bool"""
10815 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10816
10817 def IsSubMenu(*args, **kwargs):
10818 """IsSubMenu(self) -> bool"""
10819 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10820
10821 def SetSubMenu(*args, **kwargs):
10822 """SetSubMenu(self, Menu menu)"""
10823 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10824
10825 def GetSubMenu(*args, **kwargs):
10826 """GetSubMenu(self) -> Menu"""
10827 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10828
10829 def Enable(*args, **kwargs):
10830 """Enable(self, bool enable=True)"""
10831 return _core_.MenuItem_Enable(*args, **kwargs)
10832
10833 def IsEnabled(*args, **kwargs):
10834 """IsEnabled(self) -> bool"""
10835 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10836
10837 def Check(*args, **kwargs):
10838 """Check(self, bool check=True)"""
10839 return _core_.MenuItem_Check(*args, **kwargs)
10840
10841 def IsChecked(*args, **kwargs):
10842 """IsChecked(self) -> bool"""
10843 return _core_.MenuItem_IsChecked(*args, **kwargs)
10844
10845 def Toggle(*args, **kwargs):
10846 """Toggle(self)"""
10847 return _core_.MenuItem_Toggle(*args, **kwargs)
10848
10849 def SetHelp(*args, **kwargs):
10850 """SetHelp(self, String str)"""
10851 return _core_.MenuItem_SetHelp(*args, **kwargs)
10852
10853 def GetHelp(*args, **kwargs):
10854 """GetHelp(self) -> String"""
10855 return _core_.MenuItem_GetHelp(*args, **kwargs)
10856
10857 def GetAccel(*args, **kwargs):
10858 """GetAccel(self) -> AcceleratorEntry"""
10859 return _core_.MenuItem_GetAccel(*args, **kwargs)
10860
10861 def SetAccel(*args, **kwargs):
10862 """SetAccel(self, AcceleratorEntry accel)"""
10863 return _core_.MenuItem_SetAccel(*args, **kwargs)
10864
7449af73
RD
10865 def SetBitmap(*args, **kwargs):
10866 """SetBitmap(self, Bitmap bitmap)"""
10867 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10868
10869 def GetBitmap(*args, **kwargs):
10870 """GetBitmap(self) -> Bitmap"""
10871 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10872
d55e5bfc
RD
10873 def SetFont(*args, **kwargs):
10874 """SetFont(self, Font font)"""
10875 return _core_.MenuItem_SetFont(*args, **kwargs)
10876
10877 def GetFont(*args, **kwargs):
10878 """GetFont(self) -> Font"""
10879 return _core_.MenuItem_GetFont(*args, **kwargs)
10880
10881 def SetTextColour(*args, **kwargs):
10882 """SetTextColour(self, Colour colText)"""
10883 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10884
10885 def GetTextColour(*args, **kwargs):
10886 """GetTextColour(self) -> Colour"""
10887 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10888
10889 def SetBackgroundColour(*args, **kwargs):
10890 """SetBackgroundColour(self, Colour colBack)"""
10891 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10892
10893 def GetBackgroundColour(*args, **kwargs):
10894 """GetBackgroundColour(self) -> Colour"""
10895 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10896
10897 def SetBitmaps(*args, **kwargs):
10898 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10899 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10900
10901 def SetDisabledBitmap(*args, **kwargs):
10902 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10903 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10904
10905 def GetDisabledBitmap(*args, **kwargs):
10906 """GetDisabledBitmap(self) -> Bitmap"""
10907 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10908
10909 def SetMarginWidth(*args, **kwargs):
10910 """SetMarginWidth(self, int nWidth)"""
10911 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10912
10913 def GetMarginWidth(*args, **kwargs):
10914 """GetMarginWidth(self) -> int"""
10915 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10916
10917 def GetDefaultMarginWidth(*args, **kwargs):
c24da6d6 10918 """GetDefaultMarginWidth() -> int"""
d55e5bfc
RD
10919 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10920
10921 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10922 def IsOwnerDrawn(*args, **kwargs):
10923 """IsOwnerDrawn(self) -> bool"""
10924 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10925
10926 def SetOwnerDrawn(*args, **kwargs):
10927 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10928 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10929
10930 def ResetOwnerDrawn(*args, **kwargs):
10931 """ResetOwnerDrawn(self)"""
10932 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10933
57332a5a
RD
10934 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
10935 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10936 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
10937 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
10938 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10939 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
10940 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10941 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
10942 Label = property(GetLabel,doc="See `GetLabel`")
10943 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
10944 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
10945 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
10946 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
10947 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
2131d850 10948_core_.MenuItem_swigregister(MenuItem)
d55e5bfc
RD
10949
10950def MenuItem_GetLabelFromText(*args, **kwargs):
554f62e9
RD
10951 """MenuItem_GetLabelFromText(String text) -> String"""
10952 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 10953
554f62e9
RD
10954def MenuItem_GetDefaultMarginWidth(*args):
10955 """MenuItem_GetDefaultMarginWidth() -> int"""
10956 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d55e5bfc
RD
10957
10958#---------------------------------------------------------------------------
10959
10960class Control(Window):
10961 """
10962 This is the base class for a control or 'widget'.
10963
79fccf9d
RD
10964 A control is generally a small window which processes user input
10965 and/or displays one or more item of data.
d55e5bfc 10966 """
554f62e9
RD
10967 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10968 __repr__ = _swig_repr
10969 def __init__(self, *args, **kwargs):
d55e5bfc 10970 """
248ed943
RD
10971 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10972 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
10973 String name=ControlNameStr) -> Control
10974
79fccf9d
RD
10975 Create a Control. Normally you should only call this from a subclass'
10976 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 10977 """
554f62e9 10978 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d55e5bfc
RD
10979 self._setOORInfo(self)
10980
10981 def Create(*args, **kwargs):
10982 """
248ed943
RD
10983 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10984 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
10985 String name=ControlNameStr) -> bool
10986
10987 Do the 2nd phase and create the GUI control.
10988 """
10989 return _core_.Control_Create(*args, **kwargs)
10990
1eeb270e
RD
10991 def GetAlignment(*args, **kwargs):
10992 """
10993 GetAlignment(self) -> int
10994
10995 Get the control alignment (left/right/centre, top/bottom/centre)
10996 """
10997 return _core_.Control_GetAlignment(*args, **kwargs)
10998
0f83f5da 10999 def GetLabelText(*args, **kwargs):
1eeb270e 11000 """
1eeb270e
RD
11001 GetLabelText(self) -> String
11002
11003 Get just the text of the label, without mnemonic characters ('&')
11004 """
0f83f5da 11005 return _core_.Control_GetLabelText(*args, **kwargs)
1eeb270e 11006
d55e5bfc
RD
11007 def Command(*args, **kwargs):
11008 """
11009 Command(self, CommandEvent event)
11010
79fccf9d
RD
11011 Simulates the effect of the user issuing a command to the item.
11012
11013 :see: `wx.CommandEvent`
11014
d55e5bfc
RD
11015 """
11016 return _core_.Control_Command(*args, **kwargs)
11017
a001823c 11018 def GetClassDefaultAttributes(*args, **kwargs):
f8167d6e 11019 """
a001823c 11020 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
f8167d6e 11021
a001823c
RD
11022 Get the default attributes for this class. This is useful if you want
11023 to use the same font or colour in your own control as in a standard
11024 control -- which is a much better idea than hard coding specific
11025 colours or fonts which might look completely out of place on the
11026 user's system, especially if it uses themes.
f8167d6e 11027
a001823c
RD
11028 The variant parameter is only relevant under Mac currently and is
11029 ignore under other platforms. Under Mac, it will change the size of
11030 the returned font. See `wx.Window.SetWindowVariant` for more about
11031 this.
f8167d6e 11032 """
d55e5bfc
RD
11033 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
11034
11035 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
226118fc 11036 Alignment = property(GetAlignment,doc="See `GetAlignment`")
226118fc 11037 LabelText = property(GetLabelText,doc="See `GetLabelText`")
2131d850 11038_core_.Control_swigregister(Control)
d55e5bfc
RD
11039ControlNameStr = cvar.ControlNameStr
11040
11041def PreControl(*args, **kwargs):
11042 """
11043 PreControl() -> Control
11044
11045 Precreate a Control control for 2-phase creation
11046 """
11047 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
11048 return val
11049
11050def Control_GetClassDefaultAttributes(*args, **kwargs):
554f62e9 11051 """
a001823c
RD
11052 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11053
11054 Get the default attributes for this class. This is useful if you want
11055 to use the same font or colour in your own control as in a standard
11056 control -- which is a much better idea than hard coding specific
11057 colours or fonts which might look completely out of place on the
11058 user's system, especially if it uses themes.
11059
11060 The variant parameter is only relevant under Mac currently and is
11061 ignore under other platforms. Under Mac, it will change the size of
11062 the returned font. See `wx.Window.SetWindowVariant` for more about
11063 this.
11064 """
554f62e9 11065 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
11066
11067#---------------------------------------------------------------------------
11068
11069class ItemContainer(object):
11070 """
53aa7709
RD
11071 The wx.ItemContainer class defines an interface which is implemented
11072 by all controls which have string subitems, each of which may be
11073 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11074 as `wx.ComboBox` which implements an extended interface deriving from
79fccf9d 11075 this one.
d55e5bfc 11076
79fccf9d
RD
11077 It defines the methods for accessing the control's items and although
11078 each of the derived classes implements them differently, they still
11079 all conform to the same interface.
d55e5bfc 11080
79fccf9d
RD
11081 The items in a wx.ItemContainer have (non empty) string labels and,
11082 optionally, client data associated with them.
d55e5bfc
RD
11083
11084 """
554f62e9
RD
11085 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11086 def __init__(self): raise AttributeError, "No constructor defined"
11087 __repr__ = _swig_repr
d55e5bfc
RD
11088 def Append(*args, **kwargs):
11089 """
11090 Append(self, String item, PyObject clientData=None) -> int
11091
79fccf9d
RD
11092 Adds the item to the control, associating the given data with the item
11093 if not None. The return value is the index of the newly added item
11094 which may be different from the last one if the control is sorted (e.g.
11095 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc
RD
11096 """
11097 return _core_.ItemContainer_Append(*args, **kwargs)
11098
11099 def AppendItems(*args, **kwargs):
11100 """
f5b96ee1 11101 AppendItems(self, List strings)
d55e5bfc 11102
79fccf9d
RD
11103 Apend several items at once to the control. Notice that calling this
11104 method may be much faster than appending the items one by one if you
11105 need to add a lot of items.
d55e5bfc
RD
11106 """
11107 return _core_.ItemContainer_AppendItems(*args, **kwargs)
11108
11109 def Insert(*args, **kwargs):
11110 """
50f151d7 11111 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
d55e5bfc 11112
79fccf9d 11113 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
11114 optionally associating some data object with the item.
11115 """
11116 return _core_.ItemContainer_Insert(*args, **kwargs)
11117
11118 def Clear(*args, **kwargs):
11119 """
11120 Clear(self)
11121
11122 Removes all items from the control.
11123 """
11124 return _core_.ItemContainer_Clear(*args, **kwargs)
11125
11126 def Delete(*args, **kwargs):
11127 """
50f151d7 11128 Delete(self, unsigned int n)
d55e5bfc 11129
79fccf9d
RD
11130 Deletes the item at the zero-based index 'n' from the control. Note
11131 that it is an error (signalled by a `wx.PyAssertionError` exception if
11132 enabled) to remove an item with the index negative or greater or equal
11133 than the number of items in the control.
d55e5bfc
RD
11134 """
11135 return _core_.ItemContainer_Delete(*args, **kwargs)
11136
53aa7709
RD
11137 def GetClientData(*args, **kwargs):
11138 """
50f151d7 11139 GetClientData(self, unsigned int n) -> PyObject
53aa7709
RD
11140
11141 Returns the client data associated with the given item, (if any.)
11142 """
11143 return _core_.ItemContainer_GetClientData(*args, **kwargs)
11144
11145 def SetClientData(*args, **kwargs):
11146 """
50f151d7 11147 SetClientData(self, unsigned int n, PyObject clientData)
53aa7709
RD
11148
11149 Associate the given client data with the item at position n.
11150 """
11151 return _core_.ItemContainer_SetClientData(*args, **kwargs)
11152
d55e5bfc
RD
11153 def GetCount(*args, **kwargs):
11154 """
50f151d7 11155 GetCount(self) -> unsigned int
d55e5bfc
RD
11156
11157 Returns the number of items in the control.
11158 """
11159 return _core_.ItemContainer_GetCount(*args, **kwargs)
11160
11161 def IsEmpty(*args, **kwargs):
11162 """
11163 IsEmpty(self) -> bool
11164
11165 Returns True if the control is empty or False if it has some items.
11166 """
11167 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
11168
11169 def GetString(*args, **kwargs):
11170 """
50f151d7 11171 GetString(self, unsigned int n) -> String
d55e5bfc
RD
11172
11173 Returns the label of the item with the given index.
11174 """
11175 return _core_.ItemContainer_GetString(*args, **kwargs)
11176
11177 def GetStrings(*args, **kwargs):
11178 """GetStrings(self) -> wxArrayString"""
11179 return _core_.ItemContainer_GetStrings(*args, **kwargs)
11180
11181 def SetString(*args, **kwargs):
11182 """
50f151d7 11183 SetString(self, unsigned int n, String s)
d55e5bfc
RD
11184
11185 Sets the label for the given item.
11186 """
11187 return _core_.ItemContainer_SetString(*args, **kwargs)
11188
11189 def FindString(*args, **kwargs):
11190 """
11191 FindString(self, String s) -> int
11192
11193 Finds an item whose label matches the given string. Returns the
79fccf9d
RD
11194 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11195 found.
d55e5bfc
RD
11196 """
11197 return _core_.ItemContainer_FindString(*args, **kwargs)
11198
53aa7709 11199 def SetSelection(*args, **kwargs):
d55e5bfc 11200 """
53aa7709 11201 SetSelection(self, int n)
d55e5bfc
RD
11202
11203 Sets the item at index 'n' to be the selected item.
11204 """
53aa7709 11205 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 11206
d55e5bfc
RD
11207 def GetSelection(*args, **kwargs):
11208 """
11209 GetSelection(self) -> int
11210
79fccf9d
RD
11211 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11212 is selected.
d55e5bfc
RD
11213 """
11214 return _core_.ItemContainer_GetSelection(*args, **kwargs)
11215
53aa7709
RD
11216 def SetStringSelection(*args, **kwargs):
11217 """SetStringSelection(self, String s) -> bool"""
11218 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11219
d55e5bfc
RD
11220 def GetStringSelection(*args, **kwargs):
11221 """
11222 GetStringSelection(self) -> String
11223
79fccf9d
RD
11224 Returns the label of the selected item or an empty string if no item
11225 is selected.
d55e5bfc
RD
11226 """
11227 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
11228
53aa7709 11229 def Select(*args, **kwargs):
d55e5bfc 11230 """
53aa7709 11231 Select(self, int n)
d55e5bfc 11232
53aa7709
RD
11233 This is the same as `SetSelection` and exists only because it is
11234 slightly more natural for controls which support multiple selection.
d55e5bfc 11235 """
53aa7709 11236 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc 11237
97ab0f6a
RD
11238 def GetItems(self):
11239 """Return a list of the strings in the control"""
11240 return [self.GetString(i) for i in xrange(self.GetCount())]
11241
11242 def SetItems(self, items):
11243 """Clear and set the strings in the control from a list"""
11244 self.Clear()
11245 for i in items:
11246 self.Append(i)
11247
11248 Count = property(GetCount,doc="See `GetCount`")
11249 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11250 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11251 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11252 Strings = property(GetStrings,doc="See `GetStrings`")
2131d850 11253_core_.ItemContainer_swigregister(ItemContainer)
d55e5bfc
RD
11254
11255#---------------------------------------------------------------------------
11256
11257class ControlWithItems(Control,ItemContainer):
11258 """
79fccf9d
RD
11259 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11260 wx.Control class, and is used for the base class of various controls
11261 that have items.
d55e5bfc 11262 """
554f62e9
RD
11263 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11264 def __init__(self): raise AttributeError, "No constructor defined"
11265 __repr__ = _swig_repr
2131d850 11266_core_.ControlWithItems_swigregister(ControlWithItems)
d55e5bfc
RD
11267
11268#---------------------------------------------------------------------------
11269
11270class SizerItem(Object):
248ed943
RD
11271 """
11272 The wx.SizerItem class is used to track the position, size and other
f460c29d
RD
11273 attributes of each item managed by a `wx.Sizer`. It is not usually
11274 necessary to use this class because the sizer elements can also be
11275 identified by their positions or window or sizer references but
11276 sometimes it may be more convenient to use wx.SizerItem directly.
11277 Also, custom classes derived from `wx.PySizer` will probably need to
11278 use the collection of wx.SizerItems held by wx.Sizer when calculating
11279 layout.
248ed943
RD
11280
11281 :see: `wx.Sizer`, `wx.GBSizerItem`
11282 """
554f62e9
RD
11283 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11284 __repr__ = _swig_repr
11285 def __init__(self, *args, **kwargs):
248ed943
RD
11286 """
11287 __init__(self) -> SizerItem
11288
11289 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11290 size will need to be set before this item can be used in a Sizer.
11291
11292 You will probably never need to create a wx.SizerItem directly as they
11293 are created automatically when the sizer's Add, Insert or Prepend
11294 methods are called.
11295
11296 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11297 """
554f62e9
RD
11298 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11299 __swig_destroy__ = _core_.delete_SizerItem
11300 __del__ = lambda self : None;
d55e5bfc 11301 def DeleteWindows(*args, **kwargs):
248ed943
RD
11302 """
11303 DeleteWindows(self)
11304
11305 Destroy the window or the windows in a subsizer, depending on the type
11306 of item.
11307 """
d55e5bfc
RD
11308 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
11309
11310 def DetachSizer(*args, **kwargs):
248ed943
RD
11311 """
11312 DetachSizer(self)
11313
11314 Enable deleting the SizerItem without destroying the contained sizer.
11315 """
d55e5bfc
RD
11316 return _core_.SizerItem_DetachSizer(*args, **kwargs)
11317
11318 def GetSize(*args, **kwargs):
248ed943
RD
11319 """
11320 GetSize(self) -> Size
11321
11322 Get the current size of the item, as set in the last Layout.
11323 """
d55e5bfc
RD
11324 return _core_.SizerItem_GetSize(*args, **kwargs)
11325
11326 def CalcMin(*args, **kwargs):
248ed943
RD
11327 """
11328 CalcMin(self) -> Size
11329
11330 Calculates the minimum desired size for the item, including any space
11331 needed by borders.
11332 """
d55e5bfc
RD
11333 return _core_.SizerItem_CalcMin(*args, **kwargs)
11334
11335 def SetDimension(*args, **kwargs):
248ed943
RD
11336 """
11337 SetDimension(self, Point pos, Size size)
11338
11339 Set the position and size of the space allocated for this item by the
11340 sizer, and adjust the position and size of the item (window or
11341 subsizer) to be within that space taking alignment and borders into
11342 account.
11343 """
d55e5bfc
RD
11344 return _core_.SizerItem_SetDimension(*args, **kwargs)
11345
11346 def GetMinSize(*args, **kwargs):
248ed943
RD
11347 """
11348 GetMinSize(self) -> Size
11349
11350 Get the minimum size needed for the item.
11351 """
d55e5bfc
RD
11352 return _core_.SizerItem_GetMinSize(*args, **kwargs)
11353
a001823c
RD
11354 def GetMinSizeWithBorder(*args, **kwargs):
11355 """
11356 GetMinSizeWithBorder(self) -> Size
11357
11358 Get the minimum size needed for the item with space for the borders
11359 added, if needed.
11360 """
11361 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
11362
d55e5bfc
RD
11363 def SetInitSize(*args, **kwargs):
11364 """SetInitSize(self, int x, int y)"""
11365 return _core_.SizerItem_SetInitSize(*args, **kwargs)
11366
11367 def SetRatioWH(*args, **kwargs):
248ed943
RD
11368 """
11369 SetRatioWH(self, int width, int height)
11370
11371 Set the ratio item attribute.
11372 """
d55e5bfc
RD
11373 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
11374
11375 def SetRatioSize(*args, **kwargs):
248ed943
RD
11376 """
11377 SetRatioSize(self, Size size)
11378
11379 Set the ratio item attribute.
11380 """
d55e5bfc
RD
11381 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
11382
11383 def SetRatio(*args, **kwargs):
248ed943
RD
11384 """
11385 SetRatio(self, float ratio)
11386
11387 Set the ratio item attribute.
11388 """
d55e5bfc
RD
11389 return _core_.SizerItem_SetRatio(*args, **kwargs)
11390
11391 def GetRatio(*args, **kwargs):
248ed943
RD
11392 """
11393 GetRatio(self) -> float
11394
11395 Set the ratio item attribute.
11396 """
d55e5bfc
RD
11397 return _core_.SizerItem_GetRatio(*args, **kwargs)
11398
c1cb24a4
RD
11399 def GetRect(*args, **kwargs):
11400 """
11401 GetRect(self) -> Rect
11402
11403 Returns the rectangle that the sizer item should occupy
11404 """
11405 return _core_.SizerItem_GetRect(*args, **kwargs)
11406
d55e5bfc 11407 def IsWindow(*args, **kwargs):
248ed943
RD
11408 """
11409 IsWindow(self) -> bool
11410
11411 Is this sizer item a window?
11412 """
d55e5bfc
RD
11413 return _core_.SizerItem_IsWindow(*args, **kwargs)
11414
11415 def IsSizer(*args, **kwargs):
248ed943
RD
11416 """
11417 IsSizer(self) -> bool
11418
11419 Is this sizer item a subsizer?
11420 """
d55e5bfc
RD
11421 return _core_.SizerItem_IsSizer(*args, **kwargs)
11422
11423 def IsSpacer(*args, **kwargs):
248ed943
RD
11424 """
11425 IsSpacer(self) -> bool
11426
11427 Is this sizer item a spacer?
11428 """
d55e5bfc
RD
11429 return _core_.SizerItem_IsSpacer(*args, **kwargs)
11430
11431 def SetProportion(*args, **kwargs):
248ed943
RD
11432 """
11433 SetProportion(self, int proportion)
11434
11435 Set the proportion value for this item.
11436 """
d55e5bfc
RD
11437 return _core_.SizerItem_SetProportion(*args, **kwargs)
11438
11439 def GetProportion(*args, **kwargs):
248ed943
RD
11440 """
11441 GetProportion(self) -> int
11442
11443 Get the proportion value for this item.
11444 """
d55e5bfc
RD
11445 return _core_.SizerItem_GetProportion(*args, **kwargs)
11446
248ed943
RD
11447 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11448 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 11449 def SetFlag(*args, **kwargs):
248ed943
RD
11450 """
11451 SetFlag(self, int flag)
11452
11453 Set the flag value for this item.
11454 """
d55e5bfc
RD
11455 return _core_.SizerItem_SetFlag(*args, **kwargs)
11456
11457 def GetFlag(*args, **kwargs):
248ed943
RD
11458 """
11459 GetFlag(self) -> int
11460
11461 Get the flag value for this item.
11462 """
d55e5bfc
RD
11463 return _core_.SizerItem_GetFlag(*args, **kwargs)
11464
11465 def SetBorder(*args, **kwargs):
248ed943
RD
11466 """
11467 SetBorder(self, int border)
11468
11469 Set the border value for this item.
11470 """
d55e5bfc
RD
11471 return _core_.SizerItem_SetBorder(*args, **kwargs)
11472
11473 def GetBorder(*args, **kwargs):
248ed943
RD
11474 """
11475 GetBorder(self) -> int
11476
11477 Get the border value for this item.
11478 """
d55e5bfc
RD
11479 return _core_.SizerItem_GetBorder(*args, **kwargs)
11480
11481 def GetWindow(*args, **kwargs):
248ed943
RD
11482 """
11483 GetWindow(self) -> Window
11484
11485 Get the window (if any) that is managed by this sizer item.
11486 """
d55e5bfc
RD
11487 return _core_.SizerItem_GetWindow(*args, **kwargs)
11488
11489 def SetWindow(*args, **kwargs):
248ed943
RD
11490 """
11491 SetWindow(self, Window window)
11492
11493 Set the window to be managed by this sizer item.
11494 """
d55e5bfc
RD
11495 return _core_.SizerItem_SetWindow(*args, **kwargs)
11496
11497 def GetSizer(*args, **kwargs):
248ed943
RD
11498 """
11499 GetSizer(self) -> Sizer
11500
11501 Get the subsizer (if any) that is managed by this sizer item.
11502 """
d55e5bfc
RD
11503 return _core_.SizerItem_GetSizer(*args, **kwargs)
11504
11505 def SetSizer(*args, **kwargs):
248ed943
RD
11506 """
11507 SetSizer(self, Sizer sizer)
11508
11509 Set the subsizer to be managed by this sizer item.
11510 """
d55e5bfc
RD
11511 return _core_.SizerItem_SetSizer(*args, **kwargs)
11512
11513 def GetSpacer(*args, **kwargs):
248ed943
RD
11514 """
11515 GetSpacer(self) -> Size
11516
11517 Get the size of the spacer managed by this sizer item.
11518 """
d55e5bfc
RD
11519 return _core_.SizerItem_GetSpacer(*args, **kwargs)
11520
11521 def SetSpacer(*args, **kwargs):
248ed943
RD
11522 """
11523 SetSpacer(self, Size size)
11524
11525 Set the size of the spacer to be managed by this sizer item.
11526 """
d55e5bfc
RD
11527 return _core_.SizerItem_SetSpacer(*args, **kwargs)
11528
11529 def Show(*args, **kwargs):
248ed943
RD
11530 """
11531 Show(self, bool show)
11532
11533 Set the show item attribute, which sizers use to determine if the item
11534 is to be made part of the layout or not. If the item is tracking a
11535 window then it is shown or hidden as needed.
11536 """
d55e5bfc
RD
11537 return _core_.SizerItem_Show(*args, **kwargs)
11538
11539 def IsShown(*args, **kwargs):
248ed943
RD
11540 """
11541 IsShown(self) -> bool
11542
11543 Is the item to be shown in the layout?
11544 """
d55e5bfc
RD
11545 return _core_.SizerItem_IsShown(*args, **kwargs)
11546
11547 def GetPosition(*args, **kwargs):
248ed943
RD
11548 """
11549 GetPosition(self) -> Point
11550
11551 Returns the current position of the item, as set in the last Layout.
11552 """
d55e5bfc
RD
11553 return _core_.SizerItem_GetPosition(*args, **kwargs)
11554
11555 def GetUserData(*args, **kwargs):
248ed943
RD
11556 """
11557 GetUserData(self) -> PyObject
11558
11559 Returns the userData associated with this sizer item, or None if there
11560 isn't any.
11561 """
d55e5bfc
RD
11562 return _core_.SizerItem_GetUserData(*args, **kwargs)
11563
7449af73
RD
11564 def SetUserData(*args, **kwargs):
11565 """
11566 SetUserData(self, PyObject userData)
11567
11568 Associate a Python object with this sizer item.
11569 """
11570 return _core_.SizerItem_SetUserData(*args, **kwargs)
11571
33d6fd3b
RD
11572 Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`")
11573 Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`")
11574 MinSize = property(GetMinSize,doc="See `GetMinSize`")
11575 MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`")
11576 Position = property(GetPosition,doc="See `GetPosition`")
11577 Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`")
11578 Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`")
11579 Rect = property(GetRect,doc="See `GetRect`")
11580 Size = property(GetSize,doc="See `GetSize`")
11581 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
11582 Spacer = property(GetSpacer,SetSpacer,doc="See `GetSpacer` and `SetSpacer`")
11583 UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`")
11584 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 11585_core_.SizerItem_swigregister(SizerItem)
d55e5bfc 11586
248ed943 11587def SizerItemWindow(*args, **kwargs):
d55e5bfc 11588 """
248ed943
RD
11589 SizerItemWindow(Window window, int proportion, int flag, int border,
11590 PyObject userData=None) -> SizerItem
11591
11592 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 11593 """
248ed943 11594 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
11595 return val
11596
248ed943 11597def SizerItemSpacer(*args, **kwargs):
d55e5bfc 11598 """
248ed943
RD
11599 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11600 PyObject userData=None) -> SizerItem
11601
11602 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 11603 """
248ed943 11604 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
11605 return val
11606
11607def SizerItemSizer(*args, **kwargs):
11608 """
11609 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
11610 PyObject userData=None) -> SizerItem
11611
11612 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc
RD
11613 """
11614 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
11615 return val
11616
11617class Sizer(Object):
248ed943
RD
11618 """
11619 wx.Sizer is the abstract base class used for laying out subwindows in
11620 a window. You cannot use wx.Sizer directly; instead, you will have to
11621 use one of the sizer classes derived from it such as `wx.BoxSizer`,
1d5ee749
RD
11622 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11623 `wx.GridBagSizer`.
248ed943
RD
11624
11625 The concept implemented by sizers in wxWidgets is closely related to
11626 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11627 toolkit or the Qt toolkit. It is based upon the idea of the individual
11628 subwindows reporting their minimal required size and their ability to
11629 get stretched if the size of the parent window has changed. This will
11630 most often mean that the programmer does not set the original size of
11631 a dialog in the beginning, rather the dialog will assigned a sizer and
11632 this sizer will be queried about the recommended size. The sizer in
11633 turn will query its children, which can be normal windows or contorls,
11634 empty space or other sizers, so that a hierarchy of sizers can be
11635 constructed. Note that wxSizer does not derive from wxWindow and thus
11636 do not interfere with tab ordering and requires very little resources
11637 compared to a real window on screen.
11638
11639 What makes sizers so well fitted for use in wxWidgets is the fact that
11640 every control reports its own minimal size and the algorithm can
11641 handle differences in font sizes or different window (dialog item)
11642 sizes on different platforms without problems. If for example the
11643 standard font as well as the overall design of Mac widgets requires
11644 more space than on Windows, then the initial size of a dialog using a
11645 sizer will automatically be bigger on Mac than on Windows.
11646 """
554f62e9
RD
11647 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11648 def __init__(self): raise AttributeError, "No constructor defined"
11649 __repr__ = _swig_repr
11650 __swig_destroy__ = _core_.delete_Sizer
11651 __del__ = lambda self : None;
d55e5bfc
RD
11652 def _setOORInfo(*args, **kwargs):
11653 """_setOORInfo(self, PyObject _self)"""
11654 return _core_.Sizer__setOORInfo(*args, **kwargs)
11655
11656 def Add(*args, **kwargs):
11657 """
248ed943 11658 Add(self, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 11659 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11660
11661 Appends a child item to the sizer.
d55e5bfc
RD
11662 """
11663 return _core_.Sizer_Add(*args, **kwargs)
11664
11665 def Insert(*args, **kwargs):
11666 """
248ed943 11667 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 11668 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11669
11670 Inserts a new item into the list of items managed by this sizer before
11671 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc
RD
11672 """
11673 return _core_.Sizer_Insert(*args, **kwargs)
11674
11675 def Prepend(*args, **kwargs):
11676 """
248ed943 11677 Prepend(self, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 11678 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11679
11680 Adds a new item to the begining of the list of sizer items managed by
11681 this sizer. See `Add` for a description of the parameters.
d55e5bfc
RD
11682 """
11683 return _core_.Sizer_Prepend(*args, **kwargs)
11684
11685 def Remove(*args, **kwargs):
248ed943
RD
11686 """
11687 Remove(self, item) -> bool
11688
11689 Removes an item from the sizer and destroys it. This method does not
11690 cause any layout or resizing to take place, call `Layout` to update
11691 the layout on screen after removing a child from the sizer. The
11692 *item* parameter can be either a window, a sizer, or the zero-based
11693 index of an item to remove. Returns True if the child item was found
11694 and removed.
11695 """
d55e5bfc
RD
11696 return _core_.Sizer_Remove(*args, **kwargs)
11697
1a6bba1e 11698 def Detach(*args, **kwargs):
248ed943
RD
11699 """
11700 Detach(self, item) -> bool
11701
11702 Detaches an item from the sizer without destroying it. This method
11703 does not cause any layout or resizing to take place, call `Layout` to
11704 do so. The *item* parameter can be either a window, a sizer, or the
11705 zero-based index of the item to be detached. Returns True if the child item
11706 was found and detached.
11707 """
1a6bba1e
RD
11708 return _core_.Sizer_Detach(*args, **kwargs)
11709
c1cb24a4
RD
11710 def GetItem(*args, **kwargs):
11711 """
11712 GetItem(self, item) -> wx.SizerItem
11713
11714 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11715 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11716 the item to be found.
c1cb24a4
RD
11717 """
11718 return _core_.Sizer_GetItem(*args, **kwargs)
11719
d55e5bfc
RD
11720 def _SetItemMinSize(*args, **kwargs):
11721 """_SetItemMinSize(self, PyObject item, Size size)"""
11722 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11723
97ab0f6a
RD
11724 def _ReplaceWin(*args, **kwargs):
11725 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
11726 return _core_.Sizer__ReplaceWin(*args, **kwargs)
11727
11728 def _ReplaceSizer(*args, **kwargs):
11729 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
11730 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
11731
11732 def _ReplaceItem(*args, **kwargs):
11733 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
11734 return _core_.Sizer__ReplaceItem(*args, **kwargs)
11735
11736 def Replace(self, olditem, item, recursive=False):
11737 """
11738 Detaches the given ``olditem`` from the sizer and replaces it with
11739 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
11740 detached child is destroyed only if it is not a window, (because
11741 windows are owned by their parent, not the sizer.) The
11742 ``recursive`` parameter can be used to search for the given
11743 element recursivly in subsizers.
11744
11745 This method does not cause any layout or resizing to take place,
11746 call `Layout` to do so.
11747
11748 Returns ``True`` if the child item was found and removed.
11749 """
11750 if isinstance(olditem, wx.Window):
11751 return self._ReplaceWin(olditem, item, recursive)
11752 elif isinstnace(olditem, wx.Sizer):
11753 return self._ReplaceSizer(olditem, item, recursive)
11754 elif isinstnace(olditem, int):
11755 return self._ReplaceItem(olditem, item)
11756 else:
11757 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
11758
11759 def SetContainingWindow(*args, **kwargs):
11760 """
11761 SetContainingWindow(self, Window window)
11762
11763 Set (or unset) the window this sizer is used in.
11764 """
11765 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
11766
11767 def GetContainingWindow(*args, **kwargs):
11768 """
11769 GetContainingWindow(self) -> Window
11770
11771 Get the window this sizer is used in.
11772 """
11773 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
11774
248ed943
RD
11775 def SetItemMinSize(self, item, *args):
11776 """
11777 SetItemMinSize(self, item, Size size)
11778
11779 Sets the minimum size that will be allocated for an item in the sizer.
11780 The *item* parameter can be either a window, a sizer, or the
11781 zero-based index of the item. If a window or sizer is given then it
11782 will be searched for recursivly in subsizers if neccessary.
11783 """
11784 if len(args) == 2:
11785 # for backward compatibility accept separate width,height args too
11786 return self._SetItemMinSize(item, args)
11787 else:
11788 return self._SetItemMinSize(item, args[0])
11789
d55e5bfc 11790 def AddItem(*args, **kwargs):
248ed943
RD
11791 """
11792 AddItem(self, SizerItem item)
11793
11794 Adds a `wx.SizerItem` to the sizer.
11795 """
d55e5bfc
RD
11796 return _core_.Sizer_AddItem(*args, **kwargs)
11797
11798 def InsertItem(*args, **kwargs):
248ed943
RD
11799 """
11800 InsertItem(self, int index, SizerItem item)
11801
11802 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11803 """
d55e5bfc
RD
11804 return _core_.Sizer_InsertItem(*args, **kwargs)
11805
11806 def PrependItem(*args, **kwargs):
248ed943
RD
11807 """
11808 PrependItem(self, SizerItem item)
11809
11810 Prepends a `wx.SizerItem` to the sizer.
11811 """
d55e5bfc
RD
11812 return _core_.Sizer_PrependItem(*args, **kwargs)
11813
248ed943 11814 def AddMany(self, items):
c24da6d6
RD
11815 """
11816 AddMany is a convenience method for adding several items
11817 to a sizer at one time. Simply pass it a list of tuples,
11818 where each tuple consists of the parameters that you
11819 would normally pass to the `Add` method.
11820 """
248ed943
RD
11821 for item in items:
11822 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11823 item = (item, )
11824 self.Add(*item)
d55e5bfc 11825
0d2c9713
RD
11826 def AddSpacer(self, *args, **kw):
11827 """AddSpacer(int size) --> SizerItem
11828
11829 Add a spacer that is (size,size) pixels.
11830 """
11831 if args and type(args[0]) == int:
11832 return self.Add( (args[0],args[0] ), 0)
11833 else: # otherwise stay compatible with old AddSpacer
11834 return self.Add(*args, **kw)
11835 def PrependSpacer(self, *args, **kw):
11836 """PrependSpacer(int size) --> SizerItem
11837
11838 Prepend a spacer that is (size, size) pixels."""
11839 if args and type(args[0]) == int:
11840 return self.Prepend( (args[0],args[0] ), 0)
11841 else: # otherwise stay compatible with old PrependSpacer
11842 return self.Prepend(*args, **kw)
11843 def InsertSpacer(self, index, *args, **kw):
11844 """InsertSpacer(int index, int size) --> SizerItem
11845
11846 Insert a spacer at position index that is (size, size) pixels."""
11847 if args and type(args[0]) == int:
11848 return self.Insert( index, (args[0],args[0] ), 0)
11849 else: # otherwise stay compatible with old InsertSpacer
11850 return self.Insert(index, *args, **kw)
11851
11852
11853 def AddStretchSpacer(self, prop=1):
11854 """AddStretchSpacer(int prop=1) --> SizerItem
11855
11856 Add a stretchable spacer."""
11857 return self.Add((0,0), prop)
11858 def PrependStretchSpacer(self, prop=1):
11859 """PrependStretchSpacer(int prop=1) --> SizerItem
11860
11861 Prepend a stretchable spacer."""
11862 return self.Prepend((0,0), prop)
11863 def InsertStretchSpacer(self, index, prop=1):
11864 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
11865
11866 Insert a stretchable spacer."""
11867 return self.Insert(index, (0,0), prop)
11868
11869
d55e5bfc 11870 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
11871 def AddWindow(self, *args, **kw):
11872 """Compatibility alias for `Add`."""
11873 return self.Add(*args, **kw)
11874 def AddSizer(self, *args, **kw):
11875 """Compatibility alias for `Add`."""
11876 return self.Add(*args, **kw)
b9d6a5f3
RD
11877
11878 def PrependWindow(self, *args, **kw):
11879 """Compatibility alias for `Prepend`."""
11880 return self.Prepend(*args, **kw)
11881 def PrependSizer(self, *args, **kw):
11882 """Compatibility alias for `Prepend`."""
11883 return self.Prepend(*args, **kw)
b9d6a5f3
RD
11884
11885 def InsertWindow(self, *args, **kw):
11886 """Compatibility alias for `Insert`."""
11887 return self.Insert(*args, **kw)
11888 def InsertSizer(self, *args, **kw):
11889 """Compatibility alias for `Insert`."""
b9d6a5f3
RD
11890 return self.Insert(*args, **kw)
11891
11892 def RemoveWindow(self, *args, **kw):
11893 """Compatibility alias for `Remove`."""
11894 return self.Remove(*args, **kw)
11895 def RemoveSizer(self, *args, **kw):
11896 """Compatibility alias for `Remove`."""
11897 return self.Remove(*args, **kw)
11898 def RemovePos(self, *args, **kw):
11899 """Compatibility alias for `Remove`."""
11900 return self.Remove(*args, **kw)
d55e5bfc
RD
11901
11902
d55e5bfc 11903 def SetDimension(*args, **kwargs):
248ed943
RD
11904 """
11905 SetDimension(self, int x, int y, int width, int height)
11906
11907 Call this to force the sizer to take the given dimension and thus
11908 force the items owned by the sizer to resize themselves according to
11909 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11910 methods.
11911 """
d55e5bfc
RD
11912 return _core_.Sizer_SetDimension(*args, **kwargs)
11913
11914 def SetMinSize(*args, **kwargs):
248ed943
RD
11915 """
11916 SetMinSize(self, Size size)
11917
11918 Call this to give the sizer a minimal size. Normally, the sizer will
11919 calculate its minimal size based purely on how much space its children
11920 need. After calling this method `GetMinSize` will return either the
11921 minimal size as requested by its children or the minimal size set
11922 here, depending on which is bigger.
11923 """
d55e5bfc
RD
11924 return _core_.Sizer_SetMinSize(*args, **kwargs)
11925
11926 def GetSize(*args, **kwargs):
248ed943
RD
11927 """
11928 GetSize(self) -> Size
11929
11930 Returns the current size of the space managed by the sizer.
11931 """
d55e5bfc
RD
11932 return _core_.Sizer_GetSize(*args, **kwargs)
11933
11934 def GetPosition(*args, **kwargs):
248ed943
RD
11935 """
11936 GetPosition(self) -> Point
11937
11938 Returns the current position of the sizer's managed space.
11939 """
d55e5bfc
RD
11940 return _core_.Sizer_GetPosition(*args, **kwargs)
11941
11942 def GetMinSize(*args, **kwargs):
248ed943
RD
11943 """
11944 GetMinSize(self) -> Size
11945
11946 Returns the minimal size of the sizer. This is either the combined
11947 minimal size of all the children and their borders or the minimal size
11948 set by SetMinSize, depending on which is bigger.
11949 """
d55e5bfc
RD
11950 return _core_.Sizer_GetMinSize(*args, **kwargs)
11951
11952 def GetSizeTuple(self):
1a6bba1e 11953 return self.GetSize().Get()
d55e5bfc 11954 def GetPositionTuple(self):
1a6bba1e 11955 return self.GetPosition().Get()
d55e5bfc 11956 def GetMinSizeTuple(self):
1a6bba1e 11957 return self.GetMinSize().Get()
d55e5bfc
RD
11958
11959 def RecalcSizes(*args, **kwargs):
248ed943
RD
11960 """
11961 RecalcSizes(self)
11962
11963 Using the sizes calculated by `CalcMin` reposition and resize all the
11964 items managed by this sizer. You should not need to call this directly as
11965 it is called by `Layout`.
11966 """
d55e5bfc
RD
11967 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11968
11969 def CalcMin(*args, **kwargs):
248ed943
RD
11970 """
11971 CalcMin(self) -> Size
11972
11973 This method is where the sizer will do the actual calculation of its
11974 children's minimal sizes. You should not need to call this directly as
11975 it is called by `Layout`.
11976 """
d55e5bfc
RD
11977 return _core_.Sizer_CalcMin(*args, **kwargs)
11978
11979 def Layout(*args, **kwargs):
248ed943
RD
11980 """
11981 Layout(self)
11982
11983 This method will force the recalculation and layout of the items
11984 controlled by the sizer using the current space allocated to the
11985 sizer. Normally this is called automatically from the owning window's
11986 EVT_SIZE handler, but it is also useful to call it from user code when
11987 one of the items in a sizer change size, or items are added or
11988 removed.
11989 """
d55e5bfc
RD
11990 return _core_.Sizer_Layout(*args, **kwargs)
11991
11992 def Fit(*args, **kwargs):
248ed943
RD
11993 """
11994 Fit(self, Window window) -> Size
11995
11996 Tell the sizer to resize the *window* to match the sizer's minimal
11997 size. This is commonly done in the constructor of the window itself in
11998 order to set its initial size to match the needs of the children as
11999 determined by the sizer. Returns the new size.
12000
12001 For a top level window this is the total window size, not the client size.
12002 """
d55e5bfc
RD
12003 return _core_.Sizer_Fit(*args, **kwargs)
12004
12005 def FitInside(*args, **kwargs):
248ed943
RD
12006 """
12007 FitInside(self, Window window)
12008
12009 Tell the sizer to resize the *virtual size* of the *window* to match the
12010 sizer's minimal size. This will not alter the on screen size of the
12011 window, but may cause the addition/removal/alteration of scrollbars
12012 required to view the virtual area in windows which manage it.
12013
12014 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12015
12016 """
d55e5bfc
RD
12017 return _core_.Sizer_FitInside(*args, **kwargs)
12018
12019 def SetSizeHints(*args, **kwargs):
248ed943
RD
12020 """
12021 SetSizeHints(self, Window window)
12022
12023 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12024 match the sizer's minimal size. This is commonly done in the
12025 constructor of the window itself if the window is resizable (as are
12026 many dialogs under Unix and frames on probably all platforms) in order
12027 to prevent the window from being sized smaller than the minimal size
12028 required by the sizer.
12029 """
d55e5bfc
RD
12030 return _core_.Sizer_SetSizeHints(*args, **kwargs)
12031
12032 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
12033 """
12034 SetVirtualSizeHints(self, Window window)
12035
12036 Tell the sizer to set the minimal size of the window virtual area to
12037 match the sizer's minimal size. For windows with managed scrollbars
12038 this will set them appropriately.
12039
12040 :see: `wx.ScrolledWindow.SetScrollbars`
12041
12042 """
d55e5bfc
RD
12043 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
12044
12045 def Clear(*args, **kwargs):
248ed943
RD
12046 """
12047 Clear(self, bool deleteWindows=False)
12048
12049 Clear all items from the sizer, optionally destroying the window items
12050 as well.
12051 """
d55e5bfc
RD
12052 return _core_.Sizer_Clear(*args, **kwargs)
12053
12054 def DeleteWindows(*args, **kwargs):
248ed943
RD
12055 """
12056 DeleteWindows(self)
12057
12058 Destroy all windows managed by the sizer.
12059 """
d55e5bfc
RD
12060 return _core_.Sizer_DeleteWindows(*args, **kwargs)
12061
12062 def GetChildren(*args, **kwargs):
248ed943 12063 """
51b83b37 12064 GetChildren(self) -> list
248ed943
RD
12065
12066 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12067 """
d55e5bfc
RD
12068 return _core_.Sizer_GetChildren(*args, **kwargs)
12069
12070 def Show(*args, **kwargs):
248ed943 12071 """
ae8162c8 12072 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 12073
248ed943
RD
12074 Shows or hides an item managed by the sizer. To make a sizer item
12075 disappear or reappear, use Show followed by `Layout`. The *item*
12076 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
12077 the item. Use the recursive parameter to show or hide an item in a
12078 subsizer. Returns True if the item was found.
248ed943
RD
12079 """
12080 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
12081
12082 def IsShown(*args, **kwargs):
248ed943
RD
12083 """
12084 IsShown(self, item)
12085
b1fcee84 12086 Determines if the item is currently shown. To make a sizer
248ed943
RD
12087 item disappear or reappear, use Show followed by `Layout`. The *item*
12088 parameter can be either a window, a sizer, or the zero-based index of
12089 the item.
12090 """
d55e5bfc
RD
12091 return _core_.Sizer_IsShown(*args, **kwargs)
12092
629e65c2 12093 def Hide(self, item, recursive=False):
248ed943 12094 """
27fb7603 12095 A convenience method for `Show` (item, False, recursive).
248ed943 12096 """
06759a38 12097 return self.Show(item, False, recursive)
248ed943 12098
d55e5bfc 12099 def ShowItems(*args, **kwargs):
248ed943
RD
12100 """
12101 ShowItems(self, bool show)
12102
84f85550 12103 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 12104 """
d55e5bfc
RD
12105 return _core_.Sizer_ShowItems(*args, **kwargs)
12106
33d6fd3b
RD
12107 Children = property(GetChildren,doc="See `GetChildren`")
12108 ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`")
12109 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
12110 Position = property(GetPosition,doc="See `GetPosition`")
12111 Size = property(GetSize,doc="See `GetSize`")
2131d850 12112_core_.Sizer_swigregister(Sizer)
d55e5bfc
RD
12113
12114class PySizer(Sizer):
248ed943
RD
12115 """
12116 wx.PySizer is a special version of `wx.Sizer` that has been
12117 instrumented to allow the C++ virtual methods to be overloaded in
12118 Python derived classes. You would derive from this class if you are
12119 wanting to implement a custom sizer in Python code. Simply implement
12120 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12121 For example::
12122
12123 class MySizer(wx.PySizer):
12124 def __init__(self):
12125 wx.PySizer.__init__(self)
12126
12127 def CalcMin(self):
12128 for item in self.GetChildren():
12129 # calculate the total minimum width and height needed
12130 # by all items in the sizer according to this sizer's
12131 # layout algorithm.
12132 ...
12133 return wx.Size(width, height)
12134
12135 def RecalcSizes(self):
12136 # find the space allotted to this sizer
12137 pos = self.GetPosition()
12138 size = self.GetSize()
12139 for item in self.GetChildren():
12140 # Recalculate (if necessary) the position and size of
12141 # each item and then call item.SetDimension to do the
12142 # actual positioning and sizing of the items within the
12143 # space alloted to this sizer.
12144 ...
12145 item.SetDimension(itemPos, itemSize)
12146
12147
12148 When `Layout` is called it first calls `CalcMin` followed by
12149 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 12150 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
12151
12152 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12153
12154
12155 """
554f62e9
RD
12156 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12157 __repr__ = _swig_repr
12158 def __init__(self, *args, **kwargs):
248ed943
RD
12159 """
12160 __init__(self) -> PySizer
12161
12162 Creates a wx.PySizer. Must be called from the __init__ in the derived
12163 class.
12164 """
554f62e9 12165 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
d55e5bfc
RD
12166 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
12167
12168 def _setCallbackInfo(*args, **kwargs):
12169 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
12170 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
12171
2131d850 12172_core_.PySizer_swigregister(PySizer)
d55e5bfc
RD
12173
12174#---------------------------------------------------------------------------
12175
12176class BoxSizer(Sizer):
248ed943
RD
12177 """
12178 The basic idea behind a box sizer is that windows will most often be
12179 laid out in rather simple basic geometry, typically in a row or a
12180 column or nested hierarchies of either. A wx.BoxSizer will lay out
12181 its items in a simple row or column, depending on the orientation
12182 parameter passed to the constructor.
12183 """
554f62e9
RD
12184 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12185 __repr__ = _swig_repr
12186 def __init__(self, *args, **kwargs):
248ed943
RD
12187 """
12188 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12189
12190 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12191 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12192 sizer.
12193 """
554f62e9 12194 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d55e5bfc
RD
12195 self._setOORInfo(self)
12196
12197 def GetOrientation(*args, **kwargs):
248ed943
RD
12198 """
12199 GetOrientation(self) -> int
12200
12201 Returns the current orientation of the sizer.
12202 """
d55e5bfc
RD
12203 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
12204
12205 def SetOrientation(*args, **kwargs):
248ed943
RD
12206 """
12207 SetOrientation(self, int orient)
d55e5bfc 12208
248ed943
RD
12209 Resets the orientation of the sizer.
12210 """
12211 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc 12212
226118fc 12213 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
2131d850 12214_core_.BoxSizer_swigregister(BoxSizer)
d55e5bfc
RD
12215
12216#---------------------------------------------------------------------------
12217
12218class StaticBoxSizer(BoxSizer):
248ed943
RD
12219 """
12220 wx.StaticBoxSizer derives from and functions identically to the
12221 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12222 manages. Note that this static box must be created separately and
12223 passed to the sizer constructor.
12224 """
554f62e9
RD
12225 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12226 __repr__ = _swig_repr
12227 def __init__(self, *args, **kwargs):
248ed943
RD
12228 """
12229 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12230
12231 Constructor. It takes an associated static box and the orientation
12232 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12233 ``wx.HORIZONTAL``.
12234 """
554f62e9 12235 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d55e5bfc
RD
12236 self._setOORInfo(self)
12237
12238 def GetStaticBox(*args, **kwargs):
248ed943
RD
12239 """
12240 GetStaticBox(self) -> StaticBox
d55e5bfc 12241
248ed943
RD
12242 Returns the static box associated with this sizer.
12243 """
12244 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc 12245
33d6fd3b 12246 StaticBox = property(GetStaticBox,doc="See `GetStaticBox`")
2131d850 12247_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d55e5bfc
RD
12248
12249#---------------------------------------------------------------------------
12250
12251class GridSizer(Sizer):
248ed943
RD
12252 """
12253 A grid sizer is a sizer which lays out its children in a
12254 two-dimensional table with all cells having the same size. In other
12255 words, the width of each cell within the grid is the width of the
12256 widest item added to the sizer and the height of each grid cell is the
12257 height of the tallest item. An optional vertical and/or horizontal
12258 gap between items can also be specified (in pixels.)
12259
12260 Items are placed in the cells of the grid in the order they are added,
12261 in row-major order. In other words, the first row is filled first,
12262 then the second, and so on until all items have been added. (If
12263 neccessary, additional rows will be added as items are added.) If you
12264 need to have greater control over the cells that items are placed in
12265 then use the `wx.GridBagSizer`.
12266
12267 """
554f62e9
RD
12268 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12269 __repr__ = _swig_repr
12270 def __init__(self, *args, **kwargs):
248ed943
RD
12271 """
12272 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12273
12274 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12275 of columns and rows in the sizer - if either of the parameters is
12276 zero, it will be calculated to from the total number of children in
12277 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12278 define extra space between all children.
12279 """
554f62e9 12280 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d55e5bfc
RD
12281 self._setOORInfo(self)
12282
d55e5bfc 12283 def SetCols(*args, **kwargs):
248ed943
RD
12284 """
12285 SetCols(self, int cols)
12286
12287 Sets the number of columns in the sizer.
12288 """
d55e5bfc
RD
12289 return _core_.GridSizer_SetCols(*args, **kwargs)
12290
12291 def SetRows(*args, **kwargs):
248ed943
RD
12292 """
12293 SetRows(self, int rows)
12294
12295 Sets the number of rows in the sizer.
12296 """
d55e5bfc
RD
12297 return _core_.GridSizer_SetRows(*args, **kwargs)
12298
12299 def SetVGap(*args, **kwargs):
248ed943
RD
12300 """
12301 SetVGap(self, int gap)
12302
12303 Sets the vertical gap (in pixels) between the cells in the sizer.
12304 """
d55e5bfc
RD
12305 return _core_.GridSizer_SetVGap(*args, **kwargs)
12306
12307 def SetHGap(*args, **kwargs):
248ed943
RD
12308 """
12309 SetHGap(self, int gap)
12310
12311 Sets the horizontal gap (in pixels) between cells in the sizer
12312 """
d55e5bfc
RD
12313 return _core_.GridSizer_SetHGap(*args, **kwargs)
12314
12315 def GetCols(*args, **kwargs):
248ed943
RD
12316 """
12317 GetCols(self) -> int
12318
12319 Returns the number of columns in the sizer.
12320 """
d55e5bfc
RD
12321 return _core_.GridSizer_GetCols(*args, **kwargs)
12322
12323 def GetRows(*args, **kwargs):
248ed943
RD
12324 """
12325 GetRows(self) -> int
12326
12327 Returns the number of rows in the sizer.
12328 """
d55e5bfc
RD
12329 return _core_.GridSizer_GetRows(*args, **kwargs)
12330
12331 def GetVGap(*args, **kwargs):
248ed943
RD
12332 """
12333 GetVGap(self) -> int
12334
12335 Returns the vertical gap (in pixels) between the cells in the sizer.
12336 """
d55e5bfc
RD
12337 return _core_.GridSizer_GetVGap(*args, **kwargs)
12338
12339 def GetHGap(*args, **kwargs):
248ed943
RD
12340 """
12341 GetHGap(self) -> int
12342
12343 Returns the horizontal gap (in pixels) between cells in the sizer.
12344 """
d55e5bfc
RD
12345 return _core_.GridSizer_GetHGap(*args, **kwargs)
12346
554f62e9
RD
12347 def CalcRowsCols(self):
12348 """
12349 CalcRowsCols() -> (rows, cols)
d55e5bfc 12350
554f62e9
RD
12351 Calculates how many rows and columns will be in the sizer based
12352 on the current number of items and also the rows, cols specified
12353 in the constructor.
12354 """
12355 nitems = len(self.GetChildren())
12356 rows = self.GetRows()
12357 cols = self.GetCols()
12358 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
12359 if cols != 0:
12360 rows = (nitems + cols - 1) / cols
12361 elif rows != 0:
12362 cols = (nitems + rows - 1) / rows
12363 return (rows, cols)
12364
97ab0f6a
RD
12365 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
12366 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
12367 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
12368 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
2131d850 12369_core_.GridSizer_swigregister(GridSizer)
d55e5bfc
RD
12370
12371#---------------------------------------------------------------------------
12372
12373FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12374FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12375FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
12376class FlexGridSizer(GridSizer):
248ed943
RD
12377 """
12378 A flex grid sizer is a sizer which lays out its children in a
12379 two-dimensional table with all table cells in one row having the same
12380 height and all cells in one column having the same width, but all
12381 rows or all columns are not necessarily the same height or width as in
12382 the `wx.GridSizer`.
12383
12384 wx.FlexGridSizer can also size items equally in one direction but
12385 unequally ("flexibly") in the other. If the sizer is only flexible
12386 in one direction (this can be changed using `SetFlexibleDirection`), it
12387 needs to be decided how the sizer should grow in the other ("non
12388 flexible") direction in order to fill the available space. The
12389 `SetNonFlexibleGrowMode` method serves this purpose.
12390
12391
12392 """
554f62e9
RD
12393 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12394 __repr__ = _swig_repr
12395 def __init__(self, *args, **kwargs):
248ed943
RD
12396 """
12397 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12398
12399 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12400 number of columns and rows in the sizer - if either of the parameters
12401 is zero, it will be calculated to from the total number of children in
12402 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12403 define extra space between all children.
12404 """
554f62e9 12405 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d55e5bfc
RD
12406 self._setOORInfo(self)
12407
248ed943
RD
12408 def AddGrowableRow(*args, **kwargs):
12409 """
12410 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 12411
248ed943
RD
12412 Specifies that row *idx* (starting from zero) should be grown if there
12413 is extra space available to the sizer.
d55e5bfc 12414
248ed943
RD
12415 The *proportion* parameter has the same meaning as the stretch factor
12416 for the box sizers except that if all proportions are 0, then all
12417 columns are resized equally (instead of not being resized at all).
12418 """
d55e5bfc
RD
12419 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
12420
12421 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
12422 """
12423 RemoveGrowableRow(self, size_t idx)
12424
12425 Specifies that row *idx* is no longer growable.
12426 """
d55e5bfc
RD
12427 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
12428
12429 def AddGrowableCol(*args, **kwargs):
248ed943
RD
12430 """
12431 AddGrowableCol(self, size_t idx, int proportion=0)
12432
12433 Specifies that column *idx* (starting from zero) should be grown if
12434 there is extra space available to the sizer.
12435
12436 The *proportion* parameter has the same meaning as the stretch factor
12437 for the box sizers except that if all proportions are 0, then all
12438 columns are resized equally (instead of not being resized at all).
12439 """
d55e5bfc
RD
12440 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
12441
12442 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
12443 """
12444 RemoveGrowableCol(self, size_t idx)
12445
12446 Specifies that column *idx* is no longer growable.
12447 """
d55e5bfc
RD
12448 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
12449
12450 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
12451 """
12452 SetFlexibleDirection(self, int direction)
12453
12454 Specifies whether the sizer should flexibly resize its columns, rows,
12455 or both. Argument *direction* can be one of the following values. Any
12456 other value is ignored.
12457
12458 ============== =======================================
12459 wx.VERTICAL Rows are flexibly sized.
12460 wx.HORIZONTAL Columns are flexibly sized.
12461 wx.BOTH Both rows and columns are flexibly sized
12462 (this is the default value).
12463 ============== =======================================
12464
12465 Note that this method does not trigger relayout.
12466
12467 """
d55e5bfc
RD
12468 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
12469
12470 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
12471 """
12472 GetFlexibleDirection(self) -> int
12473
12474 Returns a value that specifies whether the sizer
12475 flexibly resizes its columns, rows, or both (default).
12476
12477 :see: `SetFlexibleDirection`
12478 """
d55e5bfc
RD
12479 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
12480
12481 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
12482 """
12483 SetNonFlexibleGrowMode(self, int mode)
12484
12485 Specifies how the sizer should grow in the non-flexible direction if
12486 there is one (so `SetFlexibleDirection` must have been called
12487 previously). Argument *mode* can be one of the following values:
12488
12489 ========================== =================================================
12490 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12491 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12492 `AddGrowableCol` and `AddGrowableRow`. In this
12493 case equal sizing applies to minimum sizes of
12494 columns or rows (this is the default value).
12495 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12496 the non flexible direction, whether they are
12497 growable or not in the flexbile direction.
12498 ========================== =================================================
12499
12500 Note that this method does not trigger relayout.
248ed943 12501 """
d55e5bfc
RD
12502 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
12503
12504 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
12505 """
12506 GetNonFlexibleGrowMode(self) -> int
12507
12508 Returns the value that specifies how the sizer grows in the
12509 non-flexible direction if there is one.
12510
12511 :see: `SetNonFlexibleGrowMode`
12512 """
d55e5bfc
RD
12513 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
12514
12515 def GetRowHeights(*args, **kwargs):
a8eff060
RD
12516 """
12517 GetRowHeights(self) -> list
12518
12519 Returns a list of integers representing the heights of each of the
12520 rows in the sizer.
12521 """
d55e5bfc
RD
12522 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
12523
12524 def GetColWidths(*args, **kwargs):
a8eff060
RD
12525 """
12526 GetColWidths(self) -> list
12527
12528 Returns a list of integers representing the widths of each of the
12529 columns in the sizer.
12530 """
d55e5bfc
RD
12531 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
12532
97ab0f6a
RD
12533 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
12534 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
12535 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
12536 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
2131d850 12537_core_.FlexGridSizer_swigregister(FlexGridSizer)
d55e5bfc 12538
62d32a5f
RD
12539class StdDialogButtonSizer(BoxSizer):
12540 """
12541 A special sizer that knows how to order and position standard buttons
12542 in order to conform to the current platform's standards. You simply
12543 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 12544 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
12545 will take care of the rest.
12546
12547 """
554f62e9
RD
12548 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12549 __repr__ = _swig_repr
12550 def __init__(self, *args, **kwargs):
62d32a5f 12551 """__init__(self) -> StdDialogButtonSizer"""
554f62e9 12552 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
62d32a5f
RD
12553 def AddButton(*args, **kwargs):
12554 """
12555 AddButton(self, wxButton button)
12556
12557 Use this to add the buttons to this sizer. Do not use the `Add`
12558 method in the base class.
12559 """
12560 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
12561
53aa7709 12562 def Realize(*args, **kwargs):
62d32a5f 12563 """
53aa7709 12564 Realize(self)
62d32a5f
RD
12565
12566 This funciton needs to be called after all the buttons have been added
12567 to the sizer. It will reorder them and position them in a platform
12568 specifc manner.
12569 """
53aa7709 12570 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
12571
12572 def SetAffirmativeButton(*args, **kwargs):
12573 """SetAffirmativeButton(self, wxButton button)"""
12574 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
12575
12576 def SetNegativeButton(*args, **kwargs):
12577 """SetNegativeButton(self, wxButton button)"""
12578 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
12579
12580 def SetCancelButton(*args, **kwargs):
12581 """SetCancelButton(self, wxButton button)"""
12582 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
12583
12584 def GetAffirmativeButton(*args, **kwargs):
12585 """GetAffirmativeButton(self) -> wxButton"""
12586 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
12587
12588 def GetApplyButton(*args, **kwargs):
12589 """GetApplyButton(self) -> wxButton"""
12590 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
12591
12592 def GetNegativeButton(*args, **kwargs):
12593 """GetNegativeButton(self) -> wxButton"""
12594 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
12595
12596 def GetCancelButton(*args, **kwargs):
12597 """GetCancelButton(self) -> wxButton"""
12598 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
12599
12600 def GetHelpButton(*args, **kwargs):
12601 """GetHelpButton(self) -> wxButton"""
12602 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
12603
33d6fd3b
RD
12604 AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`")
12605 ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`")
12606 CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`")
12607 HelpButton = property(GetHelpButton,doc="See `GetHelpButton`")
12608 NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`")
2131d850 12609_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
62d32a5f 12610
d55e5bfc
RD
12611#---------------------------------------------------------------------------
12612
12613class GBPosition(object):
248ed943
RD
12614 """
12615 This class represents the position of an item in a virtual grid of
12616 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12617 typemaps that will automatically convert from a 2-element sequence of
12618 integers to a wx.GBPosition, so you can use the more pythonic
12619 representation of the position nearly transparently in Python code.
12620 """
554f62e9
RD
12621 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12622 __repr__ = _swig_repr
12623 def __init__(self, *args, **kwargs):
248ed943
RD
12624 """
12625 __init__(self, int row=0, int col=0) -> GBPosition
12626
12627 This class represents the position of an item in a virtual grid of
12628 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12629 typemaps that will automatically convert from a 2-element sequence of
12630 integers to a wx.GBPosition, so you can use the more pythonic
12631 representation of the position nearly transparently in Python code.
12632 """
554f62e9
RD
12633 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
12634 __swig_destroy__ = _core_.delete_GBPosition
12635 __del__ = lambda self : None;
d55e5bfc
RD
12636 def GetRow(*args, **kwargs):
12637 """GetRow(self) -> int"""
12638 return _core_.GBPosition_GetRow(*args, **kwargs)
12639
12640 def GetCol(*args, **kwargs):
12641 """GetCol(self) -> int"""
12642 return _core_.GBPosition_GetCol(*args, **kwargs)
12643
12644 def SetRow(*args, **kwargs):
12645 """SetRow(self, int row)"""
12646 return _core_.GBPosition_SetRow(*args, **kwargs)
12647
12648 def SetCol(*args, **kwargs):
12649 """SetCol(self, int col)"""
12650 return _core_.GBPosition_SetCol(*args, **kwargs)
12651
12652 def __eq__(*args, **kwargs):
e9d6f3a4
RD
12653 """
12654 __eq__(self, PyObject other) -> bool
12655
12656 Compare GBPosition for equality.
12657 """
d55e5bfc
RD
12658 return _core_.GBPosition___eq__(*args, **kwargs)
12659
12660 def __ne__(*args, **kwargs):
e9d6f3a4
RD
12661 """
12662 __ne__(self, PyObject other) -> bool
12663
12664 Compare GBPosition for inequality.
12665 """
d55e5bfc
RD
12666 return _core_.GBPosition___ne__(*args, **kwargs)
12667
12668 def Set(*args, **kwargs):
12669 """Set(self, int row=0, int col=0)"""
12670 return _core_.GBPosition_Set(*args, **kwargs)
12671
12672 def Get(*args, **kwargs):
12673 """Get(self) -> PyObject"""
12674 return _core_.GBPosition_Get(*args, **kwargs)
12675
79fccf9d 12676 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12677 def __str__(self): return str(self.Get())
12678 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12679 def __len__(self): return len(self.Get())
12680 def __getitem__(self, index): return self.Get()[index]
12681 def __setitem__(self, index, val):
12682 if index == 0: self.SetRow(val)
12683 elif index == 1: self.SetCol(val)
12684 else: raise IndexError
12685 def __nonzero__(self): return self.Get() != (0,0)
12686 __safe_for_unpickling__ = True
12687 def __reduce__(self): return (wx.GBPosition, self.Get())
12688
12689 row = property(GetRow, SetRow)
12690 col = property(GetCol, SetCol)
12691
2131d850 12692_core_.GBPosition_swigregister(GBPosition)
d55e5bfc
RD
12693
12694class GBSpan(object):
248ed943
RD
12695 """
12696 This class is used to hold the row and column spanning attributes of
12697 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12698 automatically convert from a 2-element sequence of integers to a
12699 wx.GBSpan, so you can use the more pythonic representation of the span
12700 nearly transparently in Python code.
12701
12702 """
554f62e9
RD
12703 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12704 __repr__ = _swig_repr
12705 def __init__(self, *args, **kwargs):
248ed943
RD
12706 """
12707 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12708
12709 Construct a new wxGBSpan, optionally setting the rowspan and
12710 colspan. The default is (1,1). (Meaning that the item occupies one
12711 cell in each direction.
12712 """
554f62e9
RD
12713 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12714 __swig_destroy__ = _core_.delete_GBSpan
12715 __del__ = lambda self : None;
d55e5bfc
RD
12716 def GetRowspan(*args, **kwargs):
12717 """GetRowspan(self) -> int"""
12718 return _core_.GBSpan_GetRowspan(*args, **kwargs)
12719
12720 def GetColspan(*args, **kwargs):
12721 """GetColspan(self) -> int"""
12722 return _core_.GBSpan_GetColspan(*args, **kwargs)
12723
12724 def SetRowspan(*args, **kwargs):
12725 """SetRowspan(self, int rowspan)"""
12726 return _core_.GBSpan_SetRowspan(*args, **kwargs)
12727
12728 def SetColspan(*args, **kwargs):
12729 """SetColspan(self, int colspan)"""
12730 return _core_.GBSpan_SetColspan(*args, **kwargs)
12731
12732 def __eq__(*args, **kwargs):
e9d6f3a4
RD
12733 """
12734 __eq__(self, PyObject other) -> bool
12735
12736 Compare wxGBSpan for equality.
12737 """
d55e5bfc
RD
12738 return _core_.GBSpan___eq__(*args, **kwargs)
12739
12740 def __ne__(*args, **kwargs):
e9d6f3a4
RD
12741 """
12742 __ne__(self, PyObject other) -> bool
12743
12744 Compare GBSpan for inequality.
12745 """
d55e5bfc
RD
12746 return _core_.GBSpan___ne__(*args, **kwargs)
12747
12748 def Set(*args, **kwargs):
12749 """Set(self, int rowspan=1, int colspan=1)"""
12750 return _core_.GBSpan_Set(*args, **kwargs)
12751
12752 def Get(*args, **kwargs):
12753 """Get(self) -> PyObject"""
12754 return _core_.GBSpan_Get(*args, **kwargs)
12755
79fccf9d 12756 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12757 def __str__(self): return str(self.Get())
12758 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12759 def __len__(self): return len(self.Get())
12760 def __getitem__(self, index): return self.Get()[index]
12761 def __setitem__(self, index, val):
12762 if index == 0: self.SetRowspan(val)
12763 elif index == 1: self.SetColspan(val)
12764 else: raise IndexError
12765 def __nonzero__(self): return self.Get() != (0,0)
12766 __safe_for_unpickling__ = True
12767 def __reduce__(self): return (wx.GBSpan, self.Get())
12768
12769 rowspan = property(GetRowspan, SetRowspan)
12770 colspan = property(GetColspan, SetColspan)
12771
2131d850 12772_core_.GBSpan_swigregister(GBSpan)
d55e5bfc
RD
12773
12774class GBSizerItem(SizerItem):
248ed943
RD
12775 """
12776 The wx.GBSizerItem class is used to track the additional data about
12777 items in a `wx.GridBagSizer` such as the item's position in the grid
12778 and how many rows or columns it spans.
12779
12780 """
554f62e9
RD
12781 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12782 __repr__ = _swig_repr
12783 def __init__(self, *args, **kwargs):
248ed943
RD
12784 """
12785 __init__(self) -> GBSizerItem
12786
12787 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12788 size will need to be set, as well as a position and span before this
12789 item can be used in a Sizer.
12790
12791 You will probably never need to create a wx.GBSizerItem directly as they
12792 are created automatically when the sizer's Add method is called.
12793 """
554f62e9
RD
12794 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12795 __swig_destroy__ = _core_.delete_GBSizerItem
12796 __del__ = lambda self : None;
d55e5bfc 12797 def GetPos(*args, **kwargs):
248ed943
RD
12798 """
12799 GetPos(self) -> GBPosition
12800
12801 Get the grid position of the item
12802 """
d55e5bfc
RD
12803 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12804
12805 def GetPosTuple(self): return self.GetPos().Get()
12806 def GetSpan(*args, **kwargs):
248ed943
RD
12807 """
12808 GetSpan(self) -> GBSpan
12809
12810 Get the row and column spanning of the item
12811 """
d55e5bfc
RD
12812 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12813
12814 def GetSpanTuple(self): return self.GetSpan().Get()
12815 def SetPos(*args, **kwargs):
248ed943
RD
12816 """
12817 SetPos(self, GBPosition pos) -> bool
12818
12819 If the item is already a member of a sizer then first ensure that
12820 there is no other item that would intersect with this one at the new
12821 position, then set the new position. Returns True if the change is
12822 successful and after the next Layout() the item will be moved.
12823 """
d55e5bfc
RD
12824 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12825
12826 def SetSpan(*args, **kwargs):
248ed943
RD
12827 """
12828 SetSpan(self, GBSpan span) -> bool
12829
12830 If the item is already a member of a sizer then first ensure that
12831 there is no other item that would intersect with this one with its new
12832 spanning size, then set the new spanning. Returns True if the change
12833 is successful and after the next Layout() the item will be resized.
12834
12835 """
d55e5bfc
RD
12836 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12837
248ed943 12838 def Intersects(*args, **kwargs):
d55e5bfc
RD
12839 """
12840 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
12841
12842 Returns True if this item and the other item instersect.
d55e5bfc 12843 """
248ed943
RD
12844 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12845
12846 def IntersectsPos(*args, **kwargs):
12847 """
12848 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12849
12850 Returns True if the given pos/span would intersect with this item.
12851 """
12852 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
12853
12854 def GetEndPos(*args, **kwargs):
248ed943
RD
12855 """
12856 GetEndPos(self) -> GBPosition
12857
12858 Get the row and column of the endpoint of this item.
12859 """
d55e5bfc
RD
12860 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12861
12862 def GetGBSizer(*args, **kwargs):
248ed943
RD
12863 """
12864 GetGBSizer(self) -> GridBagSizer
12865
12866 Get the sizer this item is a member of.
12867 """
d55e5bfc
RD
12868 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12869
12870 def SetGBSizer(*args, **kwargs):
248ed943
RD
12871 """
12872 SetGBSizer(self, GridBagSizer sizer)
12873
12874 Set the sizer this item is a member of.
12875 """
d55e5bfc
RD
12876 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12877
97ab0f6a
RD
12878 EndPos = property(GetEndPos,doc="See `GetEndPos`")
12879 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
12880 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
12881 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
2131d850 12882_core_.GBSizerItem_swigregister(GBSizerItem)
d55e5bfc
RD
12883DefaultSpan = cvar.DefaultSpan
12884
12885def GBSizerItemWindow(*args, **kwargs):
12886 """
12887 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12888 int border, PyObject userData=None) -> GBSizerItem
12889
12890 Construct a `wx.GBSizerItem` for a window.
d55e5bfc
RD
12891 """
12892 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12893 return val
12894
12895def GBSizerItemSizer(*args, **kwargs):
12896 """
12897 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12898 int border, PyObject userData=None) -> GBSizerItem
12899
12900 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc
RD
12901 """
12902 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12903 return val
12904
12905def GBSizerItemSpacer(*args, **kwargs):
12906 """
12907 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
12908 int flag, int border, PyObject userData=None) -> GBSizerItem
12909
12910 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc
RD
12911 """
12912 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12913 return val
12914
12915class GridBagSizer(FlexGridSizer):
248ed943
RD
12916 """
12917 A `wx.Sizer` that can lay out items in a virtual grid like a
12918 `wx.FlexGridSizer` but in this case explicit positioning of the items
12919 is allowed using `wx.GBPosition`, and items can optionally span more
12920 than one row and/or column using `wx.GBSpan`. The total size of the
12921 virtual grid is determined by the largest row and column that items are
12922 positioned at, adjusted for spanning.
12923
12924 """
554f62e9
RD
12925 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12926 __repr__ = _swig_repr
12927 def __init__(self, *args, **kwargs):
248ed943
RD
12928 """
12929 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12930
12931 Constructor, with optional parameters to specify the gap between the
12932 rows and columns.
12933 """
554f62e9 12934 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
c9c2cf70
RD
12935 self._setOORInfo(self)
12936
d55e5bfc
RD
12937 def Add(*args, **kwargs):
12938 """
248ed943 12939 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
c1cb24a4 12940 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
12941
12942 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12943 more than one row or column as specified with *span*. The remaining
12944 args behave similarly to `wx.Sizer.Add`.
12945
12946 Returns True if the item was successfully placed at the given cell
12947 position, False if something was already there.
12948
d55e5bfc
RD
12949 """
12950 return _core_.GridBagSizer_Add(*args, **kwargs)
12951
12952 def AddItem(*args, **kwargs):
248ed943 12953 """
c1cb24a4 12954 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
12955
12956 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12957 the item was successfully placed at its given cell position, False if
12958 something was already there.
12959 """
d55e5bfc
RD
12960 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12961
84f85550
RD
12962 def GetCellSize(*args, **kwargs):
12963 """
12964 GetCellSize(self, int row, int col) -> Size
12965
12966 Get the size of the specified cell, including hgap and
12967 vgap. Only valid after a Layout.
12968 """
12969 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12970
d55e5bfc 12971 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
12972 """
12973 GetEmptyCellSize(self) -> Size
12974
12975 Get the size used for cells in the grid with no item.
12976 """
d55e5bfc
RD
12977 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12978
12979 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
12980 """
12981 SetEmptyCellSize(self, Size sz)
12982
12983 Set the size used for cells in the grid with no item.
12984 """
d55e5bfc
RD
12985 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12986
12987 def GetItemPosition(*args):
12988 """
248ed943
RD
12989 GetItemPosition(self, item) -> GBPosition
12990
12991 Get the grid position of the specified *item* where *item* is either a
12992 window or subsizer that is a member of this sizer, or a zero-based
12993 index of an item.
d55e5bfc
RD
12994 """
12995 return _core_.GridBagSizer_GetItemPosition(*args)
12996
12997 def SetItemPosition(*args):
12998 """
248ed943
RD
12999 SetItemPosition(self, item, GBPosition pos) -> bool
13000
13001 Set the grid position of the specified *item* where *item* is either a
13002 window or subsizer that is a member of this sizer, or a zero-based
13003 index of an item. Returns True on success. If the move is not
13004 allowed (because an item is already there) then False is returned.
13005
d55e5bfc
RD
13006 """
13007 return _core_.GridBagSizer_SetItemPosition(*args)
13008
13009 def GetItemSpan(*args):
13010 """
248ed943
RD
13011 GetItemSpan(self, item) -> GBSpan
13012
13013 Get the row/col spanning of the specified *item* where *item* is
13014 either a window or subsizer that is a member of this sizer, or a
13015 zero-based index of an item.
d55e5bfc
RD
13016 """
13017 return _core_.GridBagSizer_GetItemSpan(*args)
13018
13019 def SetItemSpan(*args):
13020 """
248ed943
RD
13021 SetItemSpan(self, item, GBSpan span) -> bool
13022
13023 Set the row/col spanning of the specified *item* where *item* is
13024 either a window or subsizer that is a member of this sizer, or a
13025 zero-based index of an item. Returns True on success. If the move is
13026 not allowed (because an item is already there) then False is returned.
d55e5bfc
RD
13027 """
13028 return _core_.GridBagSizer_SetItemSpan(*args)
13029
13030 def FindItem(*args):
13031 """
248ed943
RD
13032 FindItem(self, item) -> GBSizerItem
13033
13034 Find the sizer item for the given window or subsizer, returns None if
13035 not found. (non-recursive)
d55e5bfc
RD
13036 """
13037 return _core_.GridBagSizer_FindItem(*args)
13038
13039 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
13040 """
13041 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
13042
13043 Return the sizer item for the given grid cell, or None if there is no
13044 item at that position. (non-recursive)
13045 """
d55e5bfc
RD
13046 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
13047
13048 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
13049 """
13050 FindItemAtPoint(self, Point pt) -> GBSizerItem
13051
13052 Return the sizer item located at the point given in *pt*, or None if
13053 there is no item at that point. The (x,y) coordinates in pt correspond
13054 to the client coordinates of the window using the sizer for
13055 layout. (non-recursive)
13056 """
d55e5bfc
RD
13057 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
13058
248ed943
RD
13059 def CheckForIntersection(*args, **kwargs):
13060 """
13061 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 13062
248ed943
RD
13063 Look at all items and see if any intersect (or would overlap) the
13064 given *item*. Returns True if so, False if there would be no overlap.
13065 If an *excludeItem* is given then it will not be checked for
13066 intersection, for example it may be the item we are checking the
13067 position of.
d55e5bfc 13068
248ed943
RD
13069 """
13070 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 13071
248ed943 13072 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 13073 """
248ed943
RD
13074 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
13075
13076 Look at all items and see if any intersect (or would overlap) the
13077 given position and span. Returns True if so, False if there would be
13078 no overlap. If an *excludeItem* is given then it will not be checked
13079 for intersection, for example it may be the item we are checking the
13080 position of.
d55e5bfc 13081 """
248ed943 13082 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc 13083
2131d850 13084_core_.GridBagSizer_swigregister(GridBagSizer)
d55e5bfc
RD
13085
13086#---------------------------------------------------------------------------
13087
13088Left = _core_.Left
13089Top = _core_.Top
13090Right = _core_.Right
13091Bottom = _core_.Bottom
13092Width = _core_.Width
13093Height = _core_.Height
13094Centre = _core_.Centre
13095Center = _core_.Center
13096CentreX = _core_.CentreX
13097CentreY = _core_.CentreY
13098Unconstrained = _core_.Unconstrained
13099AsIs = _core_.AsIs
13100PercentOf = _core_.PercentOf
13101Above = _core_.Above
13102Below = _core_.Below
13103LeftOf = _core_.LeftOf
13104RightOf = _core_.RightOf
13105SameAs = _core_.SameAs
13106Absolute = _core_.Absolute
13107class IndividualLayoutConstraint(Object):
13108 """
79fccf9d
RD
13109 Objects of this class are stored in the `wx.LayoutConstraints` class as
13110 one of eight possible constraints that a window can be involved in.
13111 You will never need to create an instance of
13112 wx.IndividualLayoutConstraint, rather you should create a
13113 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 13114 that it contains.
d55e5bfc 13115 """
554f62e9
RD
13116 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13117 def __init__(self): raise AttributeError, "No constructor defined"
13118 __repr__ = _swig_repr
d55e5bfc 13119 def Set(*args, **kwargs):
79fccf9d
RD
13120 """
13121 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13122
13123 Sets the properties of the constraint. Normally called by one of the
13124 convenience functions such as Above, RightOf, SameAs.
13125 """
d55e5bfc
RD
13126 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
13127
13128 def LeftOf(*args, **kwargs):
13129 """
13130 LeftOf(self, Window sibling, int marg=0)
13131
79fccf9d
RD
13132 Constrains this edge to be to the left of the given window, with an
13133 optional margin. Implicitly, this is relative to the left edge of the
13134 other window.
d55e5bfc
RD
13135 """
13136 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
13137
13138 def RightOf(*args, **kwargs):
13139 """
13140 RightOf(self, Window sibling, int marg=0)
13141
79fccf9d
RD
13142 Constrains this edge to be to the right of the given window, with an
13143 optional margin. Implicitly, this is relative to the right edge of the
13144 other window.
d55e5bfc
RD
13145 """
13146 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
13147
13148 def Above(*args, **kwargs):
13149 """
13150 Above(self, Window sibling, int marg=0)
13151
79fccf9d
RD
13152 Constrains this edge to be above the given window, with an optional
13153 margin. Implicitly, this is relative to the top edge of the other
13154 window.
d55e5bfc
RD
13155 """
13156 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
13157
13158 def Below(*args, **kwargs):
13159 """
13160 Below(self, Window sibling, int marg=0)
13161
79fccf9d
RD
13162 Constrains this edge to be below the given window, with an optional
13163 margin. Implicitly, this is relative to the bottom edge of the other
13164 window.
d55e5bfc
RD
13165 """
13166 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
13167
13168 def SameAs(*args, **kwargs):
13169 """
13170 SameAs(self, Window otherW, int edge, int marg=0)
13171
79fccf9d
RD
13172 Constrains this edge or dimension to be to the same as the edge of the
13173 given window, with an optional margin.
d55e5bfc
RD
13174 """
13175 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
13176
13177 def PercentOf(*args, **kwargs):
13178 """
13179 PercentOf(self, Window otherW, int wh, int per)
13180
79fccf9d
RD
13181 Constrains this edge or dimension to be to a percentage of the given
13182 window, with an optional margin.
d55e5bfc
RD
13183 """
13184 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
13185
13186 def Absolute(*args, **kwargs):
13187 """
13188 Absolute(self, int val)
13189
79fccf9d 13190 Constrains this edge or dimension to be the given absolute value.
d55e5bfc
RD
13191 """
13192 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
13193
13194 def Unconstrained(*args, **kwargs):
13195 """
13196 Unconstrained(self)
13197
79fccf9d
RD
13198 Sets this edge or dimension to be unconstrained, that is, dependent on
13199 other edges and dimensions from which this value can be deduced.
d55e5bfc
RD
13200 """
13201 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
13202
13203 def AsIs(*args, **kwargs):
13204 """
13205 AsIs(self)
13206
79fccf9d
RD
13207 Sets this edge or constraint to be whatever the window's value is at
13208 the moment. If either of the width and height constraints are *as is*,
13209 the window will not be resized, but moved instead. This is important
13210 when considering panel items which are intended to have a default
13211 size, such as a button, which may take its size from the size of the
13212 button label.
d55e5bfc
RD
13213 """
13214 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
13215
13216 def GetOtherWindow(*args, **kwargs):
13217 """GetOtherWindow(self) -> Window"""
13218 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
13219
13220 def GetMyEdge(*args, **kwargs):
13221 """GetMyEdge(self) -> int"""
13222 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
13223
13224 def SetEdge(*args, **kwargs):
13225 """SetEdge(self, int which)"""
13226 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
13227
13228 def SetValue(*args, **kwargs):
13229 """SetValue(self, int v)"""
13230 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
13231
13232 def GetMargin(*args, **kwargs):
13233 """GetMargin(self) -> int"""
13234 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
13235
13236 def SetMargin(*args, **kwargs):
13237 """SetMargin(self, int m)"""
13238 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
13239
13240 def GetValue(*args, **kwargs):
13241 """GetValue(self) -> int"""
13242 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
13243
13244 def GetPercent(*args, **kwargs):
13245 """GetPercent(self) -> int"""
13246 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
13247
13248 def GetOtherEdge(*args, **kwargs):
13249 """GetOtherEdge(self) -> int"""
13250 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
13251
13252 def GetDone(*args, **kwargs):
13253 """GetDone(self) -> bool"""
13254 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
13255
13256 def SetDone(*args, **kwargs):
13257 """SetDone(self, bool d)"""
13258 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
13259
13260 def GetRelationship(*args, **kwargs):
13261 """GetRelationship(self) -> int"""
13262 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
13263
13264 def SetRelationship(*args, **kwargs):
13265 """SetRelationship(self, int r)"""
13266 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
13267
13268 def ResetIfWin(*args, **kwargs):
13269 """
13270 ResetIfWin(self, Window otherW) -> bool
13271
13272 Reset constraint if it mentions otherWin
13273 """
13274 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
13275
13276 def SatisfyConstraint(*args, **kwargs):
13277 """
13278 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
13279
13280 Try to satisfy constraint
13281 """
13282 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
13283
13284 def GetEdge(*args, **kwargs):
13285 """
13286 GetEdge(self, int which, Window thisWin, Window other) -> int
13287
13288 Get the value of this edge or dimension, or if this
13289 is not determinable, -1.
13290 """
13291 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
13292
97ab0f6a
RD
13293 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
13294 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
13295 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
13296 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
13297 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
13298 Percent = property(GetPercent,doc="See `GetPercent`")
13299 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
13300 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
2131d850 13301_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d55e5bfc
RD
13302
13303class LayoutConstraints(Object):
13304 """
79fccf9d
RD
13305 **Note:** constraints are now deprecated and you should use sizers
13306 instead.
d55e5bfc 13307
79fccf9d
RD
13308 Objects of this class can be associated with a window to define its
13309 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
13310
13311 The class consists of the following eight constraints of class
13312 wx.IndividualLayoutConstraint, some or all of which should be accessed
13313 directly to set the appropriate constraints.
13314
13315 * left: represents the left hand edge of the window
13316 * right: represents the right hand edge of the window
13317 * top: represents the top edge of the window
13318 * bottom: represents the bottom edge of the window
13319 * width: represents the width of the window
13320 * height: represents the height of the window
13321 * centreX: represents the horizontal centre point of the window
13322 * centreY: represents the vertical centre point of the window
13323
79fccf9d
RD
13324 Most constraints are initially set to have the relationship
13325 wxUnconstrained, which means that their values should be calculated by
13326 looking at known constraints. The exceptions are width and height,
13327 which are set to wxAsIs to ensure that if the user does not specify a
13328 constraint, the existing width and height will be used, to be
13329 compatible with panel items which often have take a default size. If
13330 the constraint is ``wx.AsIs``, the dimension will not be changed.
13331
13332 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
13333
13334 """
554f62e9
RD
13335 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13336 __repr__ = _swig_repr
d55e5bfc
RD
13337 left = property(_core_.LayoutConstraints_left_get)
13338 top = property(_core_.LayoutConstraints_top_get)
13339 right = property(_core_.LayoutConstraints_right_get)
13340 bottom = property(_core_.LayoutConstraints_bottom_get)
13341 width = property(_core_.LayoutConstraints_width_get)
13342 height = property(_core_.LayoutConstraints_height_get)
13343 centreX = property(_core_.LayoutConstraints_centreX_get)
13344 centreY = property(_core_.LayoutConstraints_centreY_get)
554f62e9 13345 def __init__(self, *args, **kwargs):
d55e5bfc 13346 """__init__(self) -> LayoutConstraints"""
554f62e9
RD
13347 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
13348 __swig_destroy__ = _core_.delete_LayoutConstraints
13349 __del__ = lambda self : None;
d55e5bfc
RD
13350 def SatisfyConstraints(*args, **kwargs):
13351 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
13352 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
13353
13354 def AreSatisfied(*args, **kwargs):
13355 """AreSatisfied(self) -> bool"""
13356 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
13357
2131d850 13358_core_.LayoutConstraints_swigregister(LayoutConstraints)
d55e5bfc
RD
13359
13360#----------------------------------------------------------------------------
13361
13362# Use Python's bool constants if available, make some if not
13363try:
13364 True
13365except NameError:
13366 __builtins__.True = 1==1
13367 __builtins__.False = 1==0
13368 def bool(value): return not not value
13369 __builtins__.bool = bool
13370
13371
13372
13373# workarounds for bad wxRTTI names
13374__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13375__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13376__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13377
13378
13379#----------------------------------------------------------------------------
13380# Load version numbers from __version__... Ensure that major and minor
0f63ec68 13381# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
13382
13383from __version__ import *
13384__version__ = VERSION_STRING
13385
0f63ec68
RD
13386assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13387assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
13388if RELEASE_VERSION != _core_.RELEASE_VERSION:
13389 import warnings
0f63ec68 13390 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
13391
13392#----------------------------------------------------------------------------
13393
70b7a5fe
RD
13394# Set wxPython's default string<-->unicode conversion encoding from
13395# the locale, but only if Python's default hasn't been changed. (We
13396# assume that if the user has customized it already then that is the
13397# encoding we need to use as well.)
13398#
13399# The encoding selected here is used when string or unicode objects
13400# need to be converted in order to pass them to wxWidgets. Please be
13401# aware that the default encoding within the same locale may be
13402# slightly different on different platforms. For example, please see
62d32a5f
RD
13403# http://www.alanwood.net/demos/charsetdiffs.html for differences
13404# between the common latin/roman encodings.
396fb509
RD
13405
13406default = _sys.getdefaultencoding()
13407if default == 'ascii':
13408 import locale
13409 import codecs
13410 try:
13411 default = locale.getdefaultlocale()[1]
13412 codecs.lookup(default)
70b7a5fe 13413 except (ValueError, LookupError, TypeError):
396fb509
RD
13414 default = _sys.getdefaultencoding()
13415 del locale
13416 del codecs
5cbf236d
RD
13417if default:
13418 wx.SetDefaultPyEncoding(default)
13419del default
5cbf236d
RD
13420
13421#----------------------------------------------------------------------------
13422
d55e5bfc
RD
13423class PyDeadObjectError(AttributeError):
13424 pass
13425
13426class _wxPyDeadObject(object):
13427 """
13428 Instances of wx objects that are OOR capable will have their __class__
13429 changed to this class when the C++ object is deleted. This should help
13430 prevent crashes due to referencing a bogus C++ pointer.
13431 """
13432 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13433 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13434
13435 def __repr__(self):
13436 if not hasattr(self, "_name"):
13437 self._name = "[unknown]"
13438 return self.reprStr % self._name
13439
13440 def __getattr__(self, *args):
13441 if not hasattr(self, "_name"):
13442 self._name = "[unknown]"
13443 raise PyDeadObjectError(self.attrStr % self._name)
13444
13445 def __nonzero__(self):
13446 return 0
13447
13448
13449
13450class PyUnbornObjectError(AttributeError):
13451 pass
13452
13453class _wxPyUnbornObject(object):
13454 """
13455 Some stock objects are created when the wx._core module is
13456 imported, but their C++ instance is not created until the wx.App
13457 object is created and initialized. These object instances will
13458 temporarily have their __class__ changed to this class so an
13459 exception will be raised if they are used before the C++ instance
13460 is ready.
13461 """
13462
13463 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13464 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13465
13466 def __repr__(self):
13467 #if not hasattr(self, "_name"):
13468 # self._name = "[unknown]"
13469 return self.reprStr #% self._name
13470
13471 def __getattr__(self, *args):
13472 #if not hasattr(self, "_name"):
13473 # self._name = "[unknown]"
13474 raise PyUnbornObjectError(self.attrStr) # % self._name )
13475
13476 def __nonzero__(self):
13477 return 0
13478
13479
13480#----------------------------------------------------------------------------
d55e5bfc
RD
13481
13482def CallAfter(callable, *args, **kw):
13483 """
13484 Call the specified function after the current and pending event
13485 handlers have been completed. This is also good for making GUI
0439c23b
RD
13486 method calls from non-GUI threads. Any extra positional or
13487 keyword args are passed on to the callable when it is called.
13488
846c181b 13489 :see: `wx.CallLater`
d55e5bfc
RD
13490 """
13491 app = wx.GetApp()
a001823c 13492 assert app is not None, 'No wx.App created yet'
d55e5bfc 13493
891bb194
RD
13494 if not hasattr(app, "_CallAfterId"):
13495 app._CallAfterId = wx.NewEventType()
13496 app.Connect(-1, -1, app._CallAfterId,
13497 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 13498 evt = wx.PyEvent()
891bb194 13499 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
13500 evt.callable = callable
13501 evt.args = args
13502 evt.kw = kw
13503 wx.PostEvent(app, evt)
13504
d55e5bfc
RD
13505#----------------------------------------------------------------------------
13506
13507
846c181b 13508class CallLater:
d55e5bfc 13509 """
8ac8dba0 13510 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
13511 object once after the given amount of milliseconds, passing any
13512 positional or keyword args. The return value of the callable is
0439c23b 13513 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
13514
13515 If you don't need to get the return value or restart the timer
13516 then there is no need to hold a reference to this object. It will
13517 hold a reference to itself while the timer is running (the timer
13518 has a reference to self.Notify) but the cycle will be broken when
846c181b 13519 the timer completes, automatically cleaning up the wx.CallLater
d55e5bfc 13520 object.
0439c23b
RD
13521
13522 :see: `wx.CallAfter`
d55e5bfc
RD
13523 """
13524 def __init__(self, millis, callable, *args, **kwargs):
13525 self.millis = millis
13526 self.callable = callable
13527 self.SetArgs(*args, **kwargs)
13528 self.runCount = 0
13529 self.running = False
13530 self.hasRun = False
13531 self.result = None
13532 self.timer = None
13533 self.Start()
13534
13535 def __del__(self):
13536 self.Stop()
13537
13538
13539 def Start(self, millis=None, *args, **kwargs):
13540 """
13541 (Re)start the timer
13542 """
13543 self.hasRun = False
13544 if millis is not None:
13545 self.millis = millis
13546 if args or kwargs:
13547 self.SetArgs(*args, **kwargs)
13548 self.Stop()
13549 self.timer = wx.PyTimer(self.Notify)
13550 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
13551 self.running = True
13552 Restart = Start
13553
13554
13555 def Stop(self):
13556 """
13557 Stop and destroy the timer.
13558 """
13559 if self.timer is not None:
13560 self.timer.Stop()
13561 self.timer = None
13562
13563
13564 def GetInterval(self):
13565 if self.timer is not None:
13566 return self.timer.GetInterval()
13567 else:
13568 return 0
13569
13570
13571 def IsRunning(self):
13572 return self.timer is not None and self.timer.IsRunning()
13573
13574
13575 def SetArgs(self, *args, **kwargs):
13576 """
13577 (Re)set the args passed to the callable object. This is
13578 useful in conjunction with Restart if you want to schedule a
13579 new call to the same callable object but with different
13580 parameters.
13581 """
13582 self.args = args
13583 self.kwargs = kwargs
13584
13585
13586 def HasRun(self):
13587 return self.hasRun
13588
13589 def GetResult(self):
13590 return self.result
13591
13592 def Notify(self):
13593 """
13594 The timer has expired so call the callable.
13595 """
13596 if self.callable and getattr(self.callable, 'im_self', True):
13597 self.runCount += 1
13598 self.running = False
13599 self.result = self.callable(*self.args, **self.kwargs)
13600 self.hasRun = True
13601 if not self.running:
13602 # if it wasn't restarted, then cleanup
13603 wx.CallAfter(self.Stop)
13604
97ab0f6a
RD
13605 Interval = property(GetInterval)
13606 Result = property(GetResult)
d55e5bfc
RD
13607
13608
846c181b
RD
13609class FutureCall(CallLater):
13610 """A compatibility alias for `CallLater`."""
13611
d55e5bfc
RD
13612#----------------------------------------------------------------------------
13613# Control which items in this module should be documented by epydoc.
13614# We allow only classes and functions, which will help reduce the size
13615# of the docs by filtering out the zillions of constants, EVT objects,
13616# and etc that don't make much sense by themselves, but are instead
13617# documented (or will be) as part of the classes/functions/methods
13618# where they should be used.
13619
c24da6d6
RD
13620class __DocFilter:
13621 """
13622 A filter for epydoc that only allows non-Ptr classes and
0f83f5da 13623 functions, in order to reduce the clutter in the API docs.
c24da6d6
RD
13624 """
13625 def __init__(self, globals):
13626 self._globals = globals
13627
13628 def __call__(self, name):
13629 import types
13630 obj = self._globals.get(name, None)
0f83f5da
RD
13631
13632 # only document classes and function
c24da6d6
RD
13633 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13634 return False
0f83f5da
RD
13635
13636 # skip other things that are private or will be documented as part of somethign else
554f62e9 13637 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
c24da6d6 13638 return False
0f83f5da
RD
13639
13640 # skip functions that are duplicates of static functions in a class
13641 if name.find('_') != -1:
13642 cls = self._globals.get(name.split('_')[0], None)
13643 methname = name.split('_')[1]
13644 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
13645 return False
13646
c24da6d6 13647 return True
d55e5bfc
RD
13648
13649#----------------------------------------------------------------------------
13650#----------------------------------------------------------------------------
13651
13652# Import other modules in this package that should show up in the
13653# "core" wx namespace
13654from _gdi import *
13655from _windows import *
13656from _controls import *
13657from _misc import *
13658
d55e5bfc
RD
13659#----------------------------------------------------------------------------
13660#----------------------------------------------------------------------------
13661
13662
7449af73 13663