]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/mac/_core.py
Size property conflicts with Size() method
[wxWidgets.git] / wxPython / src / mac / _core.py
CommitLineData
1bd55598 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
5b5c9bc7 4import _core_
1bd55598
RD
5import new
6new_instancemethod = new.instancemethod
36ed4f51 7def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
1bd55598 8 if (name == "thisown"): return self.this.own(value)
36ed4f51 9 if (name == "this"):
1bd55598
RD
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
36ed4f51
RD
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
1bd55598 15 if (not static) or hasattr(self,name):
36ed4f51
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):
1bd55598 24 if (name == "thisown"): return self.this.own()
36ed4f51
RD
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
1bd55598
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
36ed4f51
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):
1bd55598
RD
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
36ed4f51
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
d6c14a4c
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
5b5c9bc7
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
95DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 96DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
5b5c9bc7
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
103CLIP_CHILDREN = _core_.CLIP_CHILDREN
104CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
092f0ed7 105WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
5b5c9bc7
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
129RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
130RB_GROUP = _core_.RB_GROUP
131RB_SINGLE = _core_.RB_SINGLE
132SB_HORIZONTAL = _core_.SB_HORIZONTAL
133SB_VERTICAL = _core_.SB_VERTICAL
134RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
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
5b5c9bc7
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
943e8dfd 174SIZE_FORCE = _core_.SIZE_FORCE
5b5c9bc7
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
943e8dfd 183ID_NONE = _core_.ID_NONE
5b5c9bc7
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
5b5c9bc7
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
5b5c9bc7
RD
206ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
207ID_PREFERENCES = _core_.ID_PREFERENCES
ac5d357a 208ID_EDIT = _core_.ID_EDIT
5b5c9bc7
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
ac5d357a 228ID_FILE = _core_.ID_FILE
5b5c9bc7
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
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
279ID_HIGHEST = _core_.ID_HIGHEST
5b5c9bc7
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
346BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
347BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
348BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
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
5b5c9bc7
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
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
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
5b5c9bc7
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
943e8dfd 672MOD_ALTGR = _core_.MOD_ALTGR
5b5c9bc7 673MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 674MOD_META = _core_.MOD_META
5b5c9bc7 675MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
676MOD_CMD = _core_.MOD_CMD
677MOD_ALL = _core_.MOD_ALL
5b5c9bc7
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
5b5c9bc7 686class Object(object):
d55e5bfc
RD
687 """
688 The base class for most wx objects, although in wxPython not
689 much functionality is needed nor exposed.
690 """
1bd55598
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 """
5b5c9bc7 696 GetClassName(self) -> String
d55e5bfc
RD
697
698 Returns the class name of the C++ class using wxRTTI.
699 """
5b5c9bc7 700 return _core_.Object_GetClassName(*args, **kwargs)
d55e5bfc
RD
701
702 def Destroy(*args, **kwargs):
703 """
704 Destroy(self)
705
706 Deletes the C++ object this Python object is a proxy for.
707 """
b39fe951
RD
708 args[0].this.own(False)
709 return _core_.Object_Destroy(*args, **kwargs)
d55e5bfc 710
33d6fd3b 711 ClassName = property(GetClassName,doc="See `GetClassName`")
2131d850 712_core_.Object_swigregister(Object)
5b5c9bc7 713_wxPySetDictionary = _core_._wxPySetDictionary
5b5c9bc7 714cvar = _core_.cvar
d55e5bfc
RD
715EmptyString = cvar.EmptyString
716
717#---------------------------------------------------------------------------
718
5b5c9bc7
RD
719BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
720BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
721BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
722BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
723BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
724BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
725BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
726BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
727BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
728BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
729BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
730BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
731BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
732BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
733BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
734BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
735BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
736BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
737BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
738BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
739CURSOR_NONE = _core_.CURSOR_NONE
740CURSOR_ARROW = _core_.CURSOR_ARROW
741CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
742CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
743CURSOR_CHAR = _core_.CURSOR_CHAR
744CURSOR_CROSS = _core_.CURSOR_CROSS
745CURSOR_HAND = _core_.CURSOR_HAND
746CURSOR_IBEAM = _core_.CURSOR_IBEAM
747CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
748CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
749CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
750CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
751CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
752CURSOR_PENCIL = _core_.CURSOR_PENCIL
753CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
754CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
755CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
756CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
757CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
758CURSOR_SIZENS = _core_.CURSOR_SIZENS
759CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
760CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
761CURSOR_SIZING = _core_.CURSOR_SIZING
762CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
763CURSOR_WAIT = _core_.CURSOR_WAIT
764CURSOR_WATCH = _core_.CURSOR_WATCH
765CURSOR_BLANK = _core_.CURSOR_BLANK
766CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
767CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
768CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
769CURSOR_MAX = _core_.CURSOR_MAX
d55e5bfc
RD
770#---------------------------------------------------------------------------
771
5b5c9bc7 772class Size(object):
d55e5bfc 773 """
15817c7e 774 wx.Size is a useful data structure used to represent the size of
1bd55598
RD
775 something. It simply contains integer width and height
776 properties. In most places in wxPython where a wx.Size is
36ed4f51 777 expected a (width, height) tuple can be used instead.
d55e5bfc 778 """
1bd55598
RD
779 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
780 __repr__ = _swig_repr
5b5c9bc7
RD
781 width = property(_core_.Size_width_get, _core_.Size_width_set)
782 height = property(_core_.Size_height_get, _core_.Size_height_set)
d55e5bfc 783 x = width; y = height
1bd55598 784 def __init__(self, *args, **kwargs):
d55e5bfc 785 """
5b5c9bc7 786 __init__(self, int w=0, int h=0) -> Size
d55e5bfc
RD
787
788 Creates a size object.
789 """
1bd55598
RD
790 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
791 __swig_destroy__ = _core_.delete_Size
792 __del__ = lambda self : None;
d55e5bfc
RD
793 def __eq__(*args, **kwargs):
794 """
e9d6f3a4 795 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
796
797 Test for equality of wx.Size objects.
798 """
5b5c9bc7 799 return _core_.Size___eq__(*args, **kwargs)
d55e5bfc
RD
800
801 def __ne__(*args, **kwargs):
802 """
e9d6f3a4 803 __ne__(self, PyObject other) -> bool
d55e5bfc 804
e9d6f3a4 805 Test for inequality of wx.Size objects.
d55e5bfc 806 """
5b5c9bc7 807 return _core_.Size___ne__(*args, **kwargs)
d55e5bfc
RD
808
809 def __add__(*args, **kwargs):
810 """
5b5c9bc7 811 __add__(self, Size sz) -> Size
d55e5bfc
RD
812
813 Add sz's proprties to this and return the result.
814 """
5b5c9bc7 815 return _core_.Size___add__(*args, **kwargs)
d55e5bfc
RD
816
817 def __sub__(*args, **kwargs):
818 """
5b5c9bc7 819 __sub__(self, Size sz) -> Size
d55e5bfc
RD
820
821 Subtract sz's properties from this and return the result.
822 """
5b5c9bc7 823 return _core_.Size___sub__(*args, **kwargs)
d55e5bfc
RD
824
825 def IncTo(*args, **kwargs):
826 """
5b5c9bc7 827 IncTo(self, Size sz)
d55e5bfc
RD
828
829 Increments this object so that both of its dimensions are not less
830 than the corresponding dimensions of the size.
831 """
5b5c9bc7 832 return _core_.Size_IncTo(*args, **kwargs)
d55e5bfc
RD
833
834 def DecTo(*args, **kwargs):
835 """
5b5c9bc7 836 DecTo(self, Size sz)
d55e5bfc
RD
837
838 Decrements this object so that both of its dimensions are not greater
839 than the corresponding dimensions of the size.
840 """
5b5c9bc7 841 return _core_.Size_DecTo(*args, **kwargs)
d55e5bfc 842
f5263701
RD
843 def IncBy(*args, **kwargs):
844 """IncBy(self, int dx, int dy)"""
845 return _core_.Size_IncBy(*args, **kwargs)
846
847 def DecBy(*args, **kwargs):
848 """DecBy(self, int dx, int dy)"""
849 return _core_.Size_DecBy(*args, **kwargs)
850
1eeb270e
RD
851 def Scale(*args, **kwargs):
852 """
853 Scale(self, float xscale, float yscale)
854
855 Scales the dimensions of this object by the given factors.
856 """
857 return _core_.Size_Scale(*args, **kwargs)
858
d55e5bfc
RD
859 def Set(*args, **kwargs):
860 """
861 Set(self, int w, int h)
862
863 Set both width and height.
864 """
5b5c9bc7 865 return _core_.Size_Set(*args, **kwargs)
d55e5bfc
RD
866
867 def SetWidth(*args, **kwargs):
868 """SetWidth(self, int w)"""
5b5c9bc7 869 return _core_.Size_SetWidth(*args, **kwargs)
d55e5bfc
RD
870
871 def SetHeight(*args, **kwargs):
872 """SetHeight(self, int h)"""
5b5c9bc7 873 return _core_.Size_SetHeight(*args, **kwargs)
d55e5bfc
RD
874
875 def GetWidth(*args, **kwargs):
876 """GetWidth(self) -> int"""
5b5c9bc7 877 return _core_.Size_GetWidth(*args, **kwargs)
d55e5bfc
RD
878
879 def GetHeight(*args, **kwargs):
880 """GetHeight(self) -> int"""
5b5c9bc7 881 return _core_.Size_GetHeight(*args, **kwargs)
d55e5bfc
RD
882
883 def IsFullySpecified(*args, **kwargs):
884 """
885 IsFullySpecified(self) -> bool
886
887 Returns True if both components of the size are non-default values.
888 """
5b5c9bc7 889 return _core_.Size_IsFullySpecified(*args, **kwargs)
d55e5bfc
RD
890
891 def SetDefaults(*args, **kwargs):
892 """
5b5c9bc7 893 SetDefaults(self, Size size)
d55e5bfc 894
15817c7e
RD
895 Combine this size with the other one replacing the default components
896 of this object (i.e. equal to -1) with those of the other.
d55e5bfc 897 """
5b5c9bc7 898 return _core_.Size_SetDefaults(*args, **kwargs)
d55e5bfc
RD
899
900 def Get(*args, **kwargs):
901 """
902 Get() -> (width,height)
903
904 Returns the width and height properties as a tuple.
905 """
5b5c9bc7 906 return _core_.Size_Get(*args, **kwargs)
d55e5bfc 907
15817c7e 908 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
909 def __str__(self): return str(self.Get())
910 def __repr__(self): return 'wx.Size'+str(self.Get())
911 def __len__(self): return len(self.Get())
912 def __getitem__(self, index): return self.Get()[index]
913 def __setitem__(self, index, val):
914 if index == 0: self.width = val
915 elif index == 1: self.height = val
916 else: raise IndexError
917 def __nonzero__(self): return self.Get() != (0,0)
918 __safe_for_unpickling__ = True
919 def __reduce__(self): return (wx.Size, self.Get())
920
2131d850 921_core_.Size_swigregister(Size)
d55e5bfc
RD
922
923#---------------------------------------------------------------------------
924
5b5c9bc7 925class RealPoint(object):
d55e5bfc 926 """
15817c7e
RD
927 A data structure for representing a point or position with floating
928 point x and y properties. In wxPython most places that expect a
929 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc 930 """
1bd55598
RD
931 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
932 __repr__ = _swig_repr
5b5c9bc7
RD
933 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
934 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
1bd55598 935 def __init__(self, *args, **kwargs):
d55e5bfc 936 """
5b5c9bc7 937 __init__(self, double x=0.0, double y=0.0) -> RealPoint
d55e5bfc
RD
938
939 Create a wx.RealPoint object
940 """
1bd55598
RD
941 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
942 __swig_destroy__ = _core_.delete_RealPoint
943 __del__ = lambda self : None;
d55e5bfc
RD
944 def __eq__(*args, **kwargs):
945 """
e9d6f3a4 946 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
947
948 Test for equality of wx.RealPoint objects.
949 """
5b5c9bc7 950 return _core_.RealPoint___eq__(*args, **kwargs)
d55e5bfc
RD
951
952 def __ne__(*args, **kwargs):
953 """
e9d6f3a4 954 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
955
956 Test for inequality of wx.RealPoint objects.
957 """
5b5c9bc7 958 return _core_.RealPoint___ne__(*args, **kwargs)
d55e5bfc
RD
959
960 def __add__(*args, **kwargs):
961 """
5b5c9bc7 962 __add__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
963
964 Add pt's proprties to this and return the result.
965 """
5b5c9bc7 966 return _core_.RealPoint___add__(*args, **kwargs)
d55e5bfc
RD
967
968 def __sub__(*args, **kwargs):
969 """
5b5c9bc7 970 __sub__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
971
972 Subtract pt's proprties from this and return the result
973 """
5b5c9bc7 974 return _core_.RealPoint___sub__(*args, **kwargs)
d55e5bfc
RD
975
976 def Set(*args, **kwargs):
977 """
978 Set(self, double x, double y)
979
980 Set both the x and y properties
981 """
5b5c9bc7 982 return _core_.RealPoint_Set(*args, **kwargs)
d55e5bfc
RD
983
984 def Get(*args, **kwargs):
985 """
986 Get() -> (x,y)
987
988 Return the x and y properties as a tuple.
989 """
5b5c9bc7 990 return _core_.RealPoint_Get(*args, **kwargs)
d55e5bfc 991
15817c7e 992 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
993 def __str__(self): return str(self.Get())
994 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
995 def __len__(self): return len(self.Get())
996 def __getitem__(self, index): return self.Get()[index]
997 def __setitem__(self, index, val):
998 if index == 0: self.x = val
999 elif index == 1: self.y = val
1000 else: raise IndexError
1001 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1002 __safe_for_unpickling__ = True
1003 def __reduce__(self): return (wx.RealPoint, self.Get())
1004
2131d850 1005_core_.RealPoint_swigregister(RealPoint)
d55e5bfc
RD
1006
1007#---------------------------------------------------------------------------
1008
5b5c9bc7 1009class Point(object):
d55e5bfc 1010 """
15817c7e
RD
1011 A data structure for representing a point or position with integer x
1012 and y properties. Most places in wxPython that expect a wx.Point can
1013 also accept a (x,y) tuple.
d55e5bfc 1014 """
1bd55598
RD
1015 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1016 __repr__ = _swig_repr
5b5c9bc7
RD
1017 x = property(_core_.Point_x_get, _core_.Point_x_set)
1018 y = property(_core_.Point_y_get, _core_.Point_y_set)
1bd55598 1019 def __init__(self, *args, **kwargs):
d55e5bfc 1020 """
5b5c9bc7 1021 __init__(self, int x=0, int y=0) -> Point
d55e5bfc
RD
1022
1023 Create a wx.Point object
1024 """
1bd55598
RD
1025 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1026 __swig_destroy__ = _core_.delete_Point
1027 __del__ = lambda self : None;
d55e5bfc
RD
1028 def __eq__(*args, **kwargs):
1029 """
e9d6f3a4 1030 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
1031
1032 Test for equality of wx.Point objects.
1033 """
5b5c9bc7 1034 return _core_.Point___eq__(*args, **kwargs)
d55e5bfc
RD
1035
1036 def __ne__(*args, **kwargs):
1037 """
e9d6f3a4 1038 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
1039
1040 Test for inequality of wx.Point objects.
1041 """
5b5c9bc7 1042 return _core_.Point___ne__(*args, **kwargs)
d55e5bfc
RD
1043
1044 def __add__(*args, **kwargs):
1045 """
5b5c9bc7 1046 __add__(self, Point pt) -> Point
d55e5bfc
RD
1047
1048 Add pt's proprties to this and return the result.
1049 """
5b5c9bc7 1050 return _core_.Point___add__(*args, **kwargs)
d55e5bfc
RD
1051
1052 def __sub__(*args, **kwargs):
1053 """
5b5c9bc7 1054 __sub__(self, Point pt) -> Point
d55e5bfc
RD
1055
1056 Subtract pt's proprties from this and return the result
1057 """
5b5c9bc7 1058 return _core_.Point___sub__(*args, **kwargs)
d55e5bfc
RD
1059
1060 def __iadd__(*args, **kwargs):
1061 """
5b5c9bc7 1062 __iadd__(self, Point pt) -> Point
d55e5bfc
RD
1063
1064 Add pt to this object.
1065 """
5b5c9bc7 1066 return _core_.Point___iadd__(*args, **kwargs)
d55e5bfc
RD
1067
1068 def __isub__(*args, **kwargs):
1069 """
5b5c9bc7 1070 __isub__(self, Point pt) -> Point
d55e5bfc
RD
1071
1072 Subtract pt from this object.
1073 """
5b5c9bc7 1074 return _core_.Point___isub__(*args, **kwargs)
d55e5bfc
RD
1075
1076 def Set(*args, **kwargs):
1077 """
1078 Set(self, long x, long y)
1079
1080 Set both the x and y properties
1081 """
5b5c9bc7 1082 return _core_.Point_Set(*args, **kwargs)
d55e5bfc
RD
1083
1084 def Get(*args, **kwargs):
1085 """
1086 Get() -> (x,y)
1087
1088 Return the x and y properties as a tuple.
1089 """
5b5c9bc7 1090 return _core_.Point_Get(*args, **kwargs)
d55e5bfc 1091
15817c7e 1092 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1093 def __str__(self): return str(self.Get())
1094 def __repr__(self): return 'wx.Point'+str(self.Get())
1095 def __len__(self): return len(self.Get())
1096 def __getitem__(self, index): return self.Get()[index]
1097 def __setitem__(self, index, val):
1098 if index == 0: self.x = val
1099 elif index == 1: self.y = val
1100 else: raise IndexError
1101 def __nonzero__(self): return self.Get() != (0,0)
1102 __safe_for_unpickling__ = True
1103 def __reduce__(self): return (wx.Point, self.Get())
1104
2131d850 1105_core_.Point_swigregister(Point)
d55e5bfc
RD
1106
1107#---------------------------------------------------------------------------
1108
5b5c9bc7 1109class Rect(object):
d55e5bfc 1110 """
15817c7e
RD
1111 A class for representing and manipulating rectangles. It has x, y,
1112 width and height properties. In wxPython most palces that expect a
1113 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc 1114 """
1bd55598
RD
1115 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1116 __repr__ = _swig_repr
1117 def __init__(self, *args, **kwargs):
d55e5bfc 1118 """
5b5c9bc7 1119 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
d55e5bfc
RD
1120
1121 Create a new Rect object.
1122 """
1bd55598
RD
1123 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1124 __swig_destroy__ = _core_.delete_Rect
1125 __del__ = lambda self : None;
d55e5bfc
RD
1126 def GetX(*args, **kwargs):
1127 """GetX(self) -> int"""
5b5c9bc7 1128 return _core_.Rect_GetX(*args, **kwargs)
d55e5bfc
RD
1129
1130 def SetX(*args, **kwargs):
1131 """SetX(self, int x)"""
5b5c9bc7 1132 return _core_.Rect_SetX(*args, **kwargs)
d55e5bfc
RD
1133
1134 def GetY(*args, **kwargs):
1135 """GetY(self) -> int"""
5b5c9bc7 1136 return _core_.Rect_GetY(*args, **kwargs)
d55e5bfc
RD
1137
1138 def SetY(*args, **kwargs):
1139 """SetY(self, int y)"""
5b5c9bc7 1140 return _core_.Rect_SetY(*args, **kwargs)
d55e5bfc
RD
1141
1142 def GetWidth(*args, **kwargs):
1143 """GetWidth(self) -> int"""
5b5c9bc7 1144 return _core_.Rect_GetWidth(*args, **kwargs)
d55e5bfc
RD
1145
1146 def SetWidth(*args, **kwargs):
1147 """SetWidth(self, int w)"""
5b5c9bc7 1148 return _core_.Rect_SetWidth(*args, **kwargs)
d55e5bfc
RD
1149
1150 def GetHeight(*args, **kwargs):
1151 """GetHeight(self) -> int"""
5b5c9bc7 1152 return _core_.Rect_GetHeight(*args, **kwargs)
d55e5bfc
RD
1153
1154 def SetHeight(*args, **kwargs):
1155 """SetHeight(self, int h)"""
5b5c9bc7 1156 return _core_.Rect_SetHeight(*args, **kwargs)
d55e5bfc
RD
1157
1158 def GetPosition(*args, **kwargs):
5b5c9bc7
RD
1159 """GetPosition(self) -> Point"""
1160 return _core_.Rect_GetPosition(*args, **kwargs)
d55e5bfc
RD
1161
1162 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
1163 """SetPosition(self, Point p)"""
1164 return _core_.Rect_SetPosition(*args, **kwargs)
d55e5bfc
RD
1165
1166 def GetSize(*args, **kwargs):
5b5c9bc7
RD
1167 """GetSize(self) -> Size"""
1168 return _core_.Rect_GetSize(*args, **kwargs)
d55e5bfc
RD
1169
1170 def SetSize(*args, **kwargs):
5b5c9bc7
RD
1171 """SetSize(self, Size s)"""
1172 return _core_.Rect_SetSize(*args, **kwargs)
d55e5bfc 1173
aff4cc5c
RD
1174 def IsEmpty(*args, **kwargs):
1175 """IsEmpty(self) -> bool"""
5b5c9bc7 1176 return _core_.Rect_IsEmpty(*args, **kwargs)
aff4cc5c 1177
d55e5bfc 1178 def GetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1179 """GetTopLeft(self) -> Point"""
1180 return _core_.Rect_GetTopLeft(*args, **kwargs)
d55e5bfc
RD
1181
1182 def SetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1183 """SetTopLeft(self, Point p)"""
1184 return _core_.Rect_SetTopLeft(*args, **kwargs)
d55e5bfc
RD
1185
1186 def GetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1187 """GetBottomRight(self) -> Point"""
1188 return _core_.Rect_GetBottomRight(*args, **kwargs)
d55e5bfc
RD
1189
1190 def SetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1191 """SetBottomRight(self, Point p)"""
1192 return _core_.Rect_SetBottomRight(*args, **kwargs)
d55e5bfc 1193
5acb46e0
RD
1194 def GetTopRight(*args, **kwargs):
1195 """GetTopRight(self) -> Point"""
1196 return _core_.Rect_GetTopRight(*args, **kwargs)
1197
1198 def SetTopRight(*args, **kwargs):
1199 """SetTopRight(self, Point p)"""
1200 return _core_.Rect_SetTopRight(*args, **kwargs)
1201
1202 def GetBottomLeft(*args, **kwargs):
1203 """GetBottomLeft(self) -> Point"""
1204 return _core_.Rect_GetBottomLeft(*args, **kwargs)
1205
1206 def SetBottomLeft(*args, **kwargs):
1207 """SetBottomLeft(self, Point p)"""
1208 return _core_.Rect_SetBottomLeft(*args, **kwargs)
1209
d55e5bfc
RD
1210 def GetLeft(*args, **kwargs):
1211 """GetLeft(self) -> int"""
5b5c9bc7 1212 return _core_.Rect_GetLeft(*args, **kwargs)
d55e5bfc
RD
1213
1214 def GetTop(*args, **kwargs):
1215 """GetTop(self) -> int"""
5b5c9bc7 1216 return _core_.Rect_GetTop(*args, **kwargs)
d55e5bfc
RD
1217
1218 def GetBottom(*args, **kwargs):
1219 """GetBottom(self) -> int"""
5b5c9bc7 1220 return _core_.Rect_GetBottom(*args, **kwargs)
d55e5bfc
RD
1221
1222 def GetRight(*args, **kwargs):
1223 """GetRight(self) -> int"""
5b5c9bc7 1224 return _core_.Rect_GetRight(*args, **kwargs)
d55e5bfc
RD
1225
1226 def SetLeft(*args, **kwargs):
1227 """SetLeft(self, int left)"""
5b5c9bc7 1228 return _core_.Rect_SetLeft(*args, **kwargs)
d55e5bfc
RD
1229
1230 def SetRight(*args, **kwargs):
1231 """SetRight(self, int right)"""
5b5c9bc7 1232 return _core_.Rect_SetRight(*args, **kwargs)
d55e5bfc
RD
1233
1234 def SetTop(*args, **kwargs):
1235 """SetTop(self, int top)"""
5b5c9bc7 1236 return _core_.Rect_SetTop(*args, **kwargs)
d55e5bfc
RD
1237
1238 def SetBottom(*args, **kwargs):
1239 """SetBottom(self, int bottom)"""
5b5c9bc7 1240 return _core_.Rect_SetBottom(*args, **kwargs)
d55e5bfc
RD
1241
1242 position = property(GetPosition, SetPosition)
1243 size = property(GetSize, SetSize)
1244 left = property(GetLeft, SetLeft)
1245 right = property(GetRight, SetRight)
1246 top = property(GetTop, SetTop)
1247 bottom = property(GetBottom, SetBottom)
1248
1249 def Inflate(*args, **kwargs):
1250 """
5b5c9bc7 1251 Inflate(self, int dx, int dy) -> Rect
d55e5bfc 1252
091fdbfa
RD
1253 Increases the size of the rectangle.
1254
1255 The left border is moved farther left and the right border is moved
1256 farther right by ``dx``. The upper border is moved farther up and the
1257 bottom border is moved farther down by ``dy``. (Note the the width and
1258 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1259 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1260 opposite happens: the rectangle size decreases in the respective
1261 direction.
1262
1263 The change is made to the rectangle inplace, if instead you need a
1264 copy that is inflated, preserving the original then make the copy
1265 first::
1266
1267 copy = wx.Rect(*original)
1268 copy.Inflate(10,15)
1269
1270
d55e5bfc 1271 """
5b5c9bc7 1272 return _core_.Rect_Inflate(*args, **kwargs)
d55e5bfc
RD
1273
1274 def Deflate(*args, **kwargs):
1275 """
5b5c9bc7 1276 Deflate(self, int dx, int dy) -> Rect
d55e5bfc 1277
091fdbfa
RD
1278 Decrease the rectangle size. This method is the opposite of `Inflate`
1279 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1280 `Inflate` for a full description.
d55e5bfc 1281 """
5b5c9bc7 1282 return _core_.Rect_Deflate(*args, **kwargs)
d55e5bfc
RD
1283
1284 def OffsetXY(*args, **kwargs):
1285 """
1286 OffsetXY(self, int dx, int dy)
1287
15817c7e
RD
1288 Moves the rectangle by the specified offset. If dx is positive, the
1289 rectangle is moved to the right, if dy is positive, it is moved to the
1290 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc 1291 """
5b5c9bc7 1292 return _core_.Rect_OffsetXY(*args, **kwargs)
d55e5bfc
RD
1293
1294 def Offset(*args, **kwargs):
1295 """
5b5c9bc7 1296 Offset(self, Point pt)
d55e5bfc 1297
b1fcee84 1298 Same as `OffsetXY` but uses dx,dy from Point
d55e5bfc 1299 """
5b5c9bc7 1300 return _core_.Rect_Offset(*args, **kwargs)
d55e5bfc
RD
1301
1302 def Intersect(*args, **kwargs):
1303 """
5b5c9bc7 1304 Intersect(self, Rect rect) -> Rect
d55e5bfc 1305
5cbf236d 1306 Returns the intersectsion of this rectangle and rect.
d55e5bfc 1307 """
5b5c9bc7 1308 return _core_.Rect_Intersect(*args, **kwargs)
d55e5bfc 1309
5cbf236d
RD
1310 def Union(*args, **kwargs):
1311 """
5b5c9bc7 1312 Union(self, Rect rect) -> Rect
5cbf236d
RD
1313
1314 Returns the union of this rectangle and rect.
1315 """
5b5c9bc7 1316 return _core_.Rect_Union(*args, **kwargs)
5cbf236d 1317
d55e5bfc
RD
1318 def __add__(*args, **kwargs):
1319 """
5b5c9bc7 1320 __add__(self, Rect rect) -> Rect
d55e5bfc
RD
1321
1322 Add the properties of rect to this rectangle and return the result.
1323 """
5b5c9bc7 1324 return _core_.Rect___add__(*args, **kwargs)
d55e5bfc
RD
1325
1326 def __iadd__(*args, **kwargs):
1327 """
5b5c9bc7 1328 __iadd__(self, Rect rect) -> Rect
d55e5bfc
RD
1329
1330 Add the properties of rect to this rectangle, updating this rectangle.
1331 """
5b5c9bc7 1332 return _core_.Rect___iadd__(*args, **kwargs)
d55e5bfc
RD
1333
1334 def __eq__(*args, **kwargs):
1335 """
e9d6f3a4 1336 __eq__(self, PyObject other) -> bool
d55e5bfc 1337
e9d6f3a4 1338 Test for equality of wx.Rect objects.
d55e5bfc 1339 """
5b5c9bc7 1340 return _core_.Rect___eq__(*args, **kwargs)
d55e5bfc
RD
1341
1342 def __ne__(*args, **kwargs):
1343 """
e9d6f3a4 1344 __ne__(self, PyObject other) -> bool
d55e5bfc 1345
e9d6f3a4 1346 Test for inequality of wx.Rect objects.
d55e5bfc 1347 """
5b5c9bc7 1348 return _core_.Rect___ne__(*args, **kwargs)
d55e5bfc 1349
33d6fd3b 1350 def ContainsXY(*args, **kwargs):
d55e5bfc 1351 """
33d6fd3b 1352 ContainsXY(self, int x, int y) -> bool
d55e5bfc 1353
33d6fd3b 1354 Return True if the point is inside the rect.
d55e5bfc 1355 """
33d6fd3b 1356 return _core_.Rect_ContainsXY(*args, **kwargs)
d55e5bfc 1357
33d6fd3b 1358 def Contains(*args, **kwargs):
d55e5bfc 1359 """
33d6fd3b 1360 Contains(self, Point pt) -> bool
d55e5bfc 1361
33d6fd3b 1362 Return True if the point is inside the rect.
d55e5bfc 1363 """
33d6fd3b 1364 return _core_.Rect_Contains(*args, **kwargs)
d55e5bfc 1365
33d6fd3b 1366 def ContainsRect(*args, **kwargs):
fc46b7f3 1367 """
33d6fd3b 1368 ContainsRect(self, Rect rect) -> bool
fc46b7f3
RD
1369
1370 Returns ``True`` if the given rectangle is completely inside this
1371 rectangle or touches its boundary.
1372 """
33d6fd3b
RD
1373 return _core_.Rect_ContainsRect(*args, **kwargs)
1374
72ef6efb
RD
1375 #Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1376 #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1377 #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1378 Inside = Contains
1379 InsideXY = ContainsXY
1380 InsideRect = ContainsRect
fc46b7f3 1381
d55e5bfc
RD
1382 def Intersects(*args, **kwargs):
1383 """
5b5c9bc7 1384 Intersects(self, Rect rect) -> bool
d55e5bfc
RD
1385
1386 Returns True if the rectangles have a non empty intersection.
1387 """
5b5c9bc7 1388 return _core_.Rect_Intersects(*args, **kwargs)
d55e5bfc 1389
b1fcee84
RD
1390 def CenterIn(*args, **kwargs):
1391 """
1392 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1393
1394 Center this rectangle within the one passed to the method, which is
1395 usually, but not necessarily, the larger one.
1396 """
1397 return _core_.Rect_CenterIn(*args, **kwargs)
1398
1399 CentreIn = CenterIn
5b5c9bc7
RD
1400 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1401 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1402 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1403 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
d55e5bfc
RD
1404 def Set(*args, **kwargs):
1405 """
1406 Set(self, int x=0, int y=0, int width=0, int height=0)
1407
1408 Set all rectangle properties.
1409 """
5b5c9bc7 1410 return _core_.Rect_Set(*args, **kwargs)
d55e5bfc
RD
1411
1412 def Get(*args, **kwargs):
1413 """
1414 Get() -> (x,y,width,height)
1415
1416 Return the rectangle properties as a tuple.
1417 """
5b5c9bc7 1418 return _core_.Rect_Get(*args, **kwargs)
d55e5bfc 1419
15817c7e 1420 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1421 def __str__(self): return str(self.Get())
1422 def __repr__(self): return 'wx.Rect'+str(self.Get())
1423 def __len__(self): return len(self.Get())
1424 def __getitem__(self, index): return self.Get()[index]
1425 def __setitem__(self, index, val):
1426 if index == 0: self.x = val
1427 elif index == 1: self.y = val
1428 elif index == 2: self.width = val
1429 elif index == 3: self.height = val
1430 else: raise IndexError
1431 def __nonzero__(self): return self.Get() != (0,0,0,0)
1432 __safe_for_unpickling__ = True
1433 def __reduce__(self): return (wx.Rect, self.Get())
1434
33d6fd3b
RD
1435 Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`")
1436 BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`")
5acb46e0 1437 BottomLeft = property(GetBottomLeft,SetBottomLeft,doc="See `GetBottomLeft` and `SetBottomLeft`")
33d6fd3b
RD
1438 Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
1439 Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`")
1440 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
1441 Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`")
1442 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
1443 Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`")
1444 TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`")
5acb46e0 1445 TopRight = property(GetTopRight,SetTopRight,doc="See `GetTopRight` and `SetTopRight`")
33d6fd3b
RD
1446 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
1447 X = property(GetX,SetX,doc="See `GetX` and `SetX`")
1448 Y = property(GetY,SetY,doc="See `GetY` and `SetY`")
1449 Empty = property(IsEmpty,doc="See `IsEmpty`")
2131d850 1450_core_.Rect_swigregister(Rect)
d55e5bfc
RD
1451
1452def RectPP(*args, **kwargs):
1453 """
5b5c9bc7 1454 RectPP(Point topLeft, Point bottomRight) -> Rect
d55e5bfc
RD
1455
1456 Create a new Rect object from Points representing two corners.
1457 """
5b5c9bc7 1458 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1459 return val
1460
1461def RectPS(*args, **kwargs):
1462 """
5b5c9bc7 1463 RectPS(Point pos, Size size) -> Rect
d55e5bfc
RD
1464
1465 Create a new Rect from a position and size.
1466 """
5b5c9bc7 1467 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1468 return val
1469
070c48b4
RD
1470def RectS(*args, **kwargs):
1471 """
5b5c9bc7 1472 RectS(Size size) -> Rect
070c48b4
RD
1473
1474 Create a new Rect from a size only.
1475 """
5b5c9bc7 1476 val = _core_.new_RectS(*args, **kwargs)
070c48b4
RD
1477 return val
1478
d55e5bfc 1479
5b5c9bc7 1480def IntersectRect(*args, **kwargs):
1bd55598 1481 """
d55e5bfc
RD
1482 IntersectRect(Rect r1, Rect r2) -> Rect
1483
1484 Calculate and return the intersection of r1 and r2.
1485 """
1bd55598 1486 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1487#---------------------------------------------------------------------------
1488
5b5c9bc7 1489class Point2D(object):
15817c7e
RD
1490 """
1491 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1492 with floating point values.
1493 """
1bd55598
RD
1494 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1495 __repr__ = _swig_repr
1496 def __init__(self, *args, **kwargs):
d55e5bfc 1497 """
5b5c9bc7 1498 __init__(self, double x=0.0, double y=0.0) -> Point2D
d55e5bfc
RD
1499
1500 Create a w.Point2D object.
1501 """
1bd55598 1502 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
b39fe951
RD
1503 __swig_destroy__ = _core_.delete_Point2D
1504 __del__ = lambda self : None;
d55e5bfc 1505 def GetFloor(*args, **kwargs):
fd2dc343
RD
1506 """
1507 GetFloor() -> (x,y)
1508
1509 Convert to integer
1510 """
5b5c9bc7 1511 return _core_.Point2D_GetFloor(*args, **kwargs)
d55e5bfc
RD
1512
1513 def GetRounded(*args, **kwargs):
fd2dc343
RD
1514 """
1515 GetRounded() -> (x,y)
1516
1517 Convert to integer
1518 """
5b5c9bc7 1519 return _core_.Point2D_GetRounded(*args, **kwargs)
d55e5bfc
RD
1520
1521 def GetVectorLength(*args, **kwargs):
1522 """GetVectorLength(self) -> double"""
5b5c9bc7 1523 return _core_.Point2D_GetVectorLength(*args, **kwargs)
d55e5bfc
RD
1524
1525 def GetVectorAngle(*args, **kwargs):
1526 """GetVectorAngle(self) -> double"""
5b5c9bc7 1527 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1528
1529 def SetVectorLength(*args, **kwargs):
1530 """SetVectorLength(self, double length)"""
5b5c9bc7 1531 return _core_.Point2D_SetVectorLength(*args, **kwargs)
d55e5bfc
RD
1532
1533 def SetVectorAngle(*args, **kwargs):
1534 """SetVectorAngle(self, double degrees)"""
5b5c9bc7 1535 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1536
1537 def SetPolarCoordinates(self, angle, length):
1538 self.SetVectorLength(length)
1539 self.SetVectorAngle(angle)
1540 def Normalize(self):
1541 self.SetVectorLength(1.0)
1542
1543 def GetDistance(*args, **kwargs):
5b5c9bc7
RD
1544 """GetDistance(self, Point2D pt) -> double"""
1545 return _core_.Point2D_GetDistance(*args, **kwargs)
d55e5bfc
RD
1546
1547 def GetDistanceSquare(*args, **kwargs):
5b5c9bc7
RD
1548 """GetDistanceSquare(self, Point2D pt) -> double"""
1549 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
d55e5bfc
RD
1550
1551 def GetDotProduct(*args, **kwargs):
5b5c9bc7
RD
1552 """GetDotProduct(self, Point2D vec) -> double"""
1553 return _core_.Point2D_GetDotProduct(*args, **kwargs)
d55e5bfc
RD
1554
1555 def GetCrossProduct(*args, **kwargs):
5b5c9bc7
RD
1556 """GetCrossProduct(self, Point2D vec) -> double"""
1557 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
d55e5bfc
RD
1558
1559 def __neg__(*args, **kwargs):
1560 """
5b5c9bc7 1561 __neg__(self) -> Point2D
d55e5bfc
RD
1562
1563 the reflection of this point
1564 """
5b5c9bc7 1565 return _core_.Point2D___neg__(*args, **kwargs)
d55e5bfc
RD
1566
1567 def __iadd__(*args, **kwargs):
5b5c9bc7
RD
1568 """__iadd__(self, Point2D pt) -> Point2D"""
1569 return _core_.Point2D___iadd__(*args, **kwargs)
d55e5bfc
RD
1570
1571 def __isub__(*args, **kwargs):
5b5c9bc7
RD
1572 """__isub__(self, Point2D pt) -> Point2D"""
1573 return _core_.Point2D___isub__(*args, **kwargs)
d55e5bfc
RD
1574
1575 def __imul__(*args, **kwargs):
5b5c9bc7
RD
1576 """__imul__(self, Point2D pt) -> Point2D"""
1577 return _core_.Point2D___imul__(*args, **kwargs)
d55e5bfc
RD
1578
1579 def __idiv__(*args, **kwargs):
5b5c9bc7
RD
1580 """__idiv__(self, Point2D pt) -> Point2D"""
1581 return _core_.Point2D___idiv__(*args, **kwargs)
d55e5bfc
RD
1582
1583 def __eq__(*args, **kwargs):
1584 """
e9d6f3a4 1585 __eq__(self, PyObject other) -> bool
d55e5bfc 1586
e9d6f3a4 1587 Test for equality of wx.Point2D objects.
d55e5bfc 1588 """
5b5c9bc7 1589 return _core_.Point2D___eq__(*args, **kwargs)
d55e5bfc
RD
1590
1591 def __ne__(*args, **kwargs):
1592 """
e9d6f3a4 1593 __ne__(self, PyObject other) -> bool
d55e5bfc 1594
e9d6f3a4 1595 Test for inequality of wx.Point2D objects.
d55e5bfc 1596 """
5b5c9bc7 1597 return _core_.Point2D___ne__(*args, **kwargs)
d55e5bfc 1598
5b5c9bc7
RD
1599 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1600 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
d55e5bfc
RD
1601 def Set(*args, **kwargs):
1602 """Set(self, double x=0, double y=0)"""
5b5c9bc7 1603 return _core_.Point2D_Set(*args, **kwargs)
d55e5bfc
RD
1604
1605 def Get(*args, **kwargs):
1606 """
1607 Get() -> (x,y)
1608
1609 Return x and y properties as a tuple.
1610 """
5b5c9bc7 1611 return _core_.Point2D_Get(*args, **kwargs)
d55e5bfc 1612
15817c7e 1613 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1614 def __str__(self): return str(self.Get())
1615 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1616 def __len__(self): return len(self.Get())
1617 def __getitem__(self, index): return self.Get()[index]
1618 def __setitem__(self, index, val):
1619 if index == 0: self.x = val
1620 elif index == 1: self.y = val
1621 else: raise IndexError
1622 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1623 __safe_for_unpickling__ = True
1624 def __reduce__(self): return (wx.Point2D, self.Get())
1625
33d6fd3b
RD
1626 Floor = property(GetFloor,doc="See `GetFloor`")
1627 Rounded = property(GetRounded,doc="See `GetRounded`")
1628 VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`")
1629 VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`")
2131d850 1630_core_.Point2D_swigregister(Point2D)
d55e5bfc
RD
1631
1632def Point2DCopy(*args, **kwargs):
1633 """
5b5c9bc7 1634 Point2DCopy(Point2D pt) -> Point2D
d55e5bfc
RD
1635
1636 Create a w.Point2D object.
1637 """
5b5c9bc7 1638 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1639 return val
1640
1641def Point2DFromPoint(*args, **kwargs):
1642 """
5b5c9bc7 1643 Point2DFromPoint(Point pt) -> Point2D
d55e5bfc
RD
1644
1645 Create a w.Point2D object.
1646 """
5b5c9bc7 1647 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d55e5bfc
RD
1648 return val
1649
1650#---------------------------------------------------------------------------
1651
5b5c9bc7
RD
1652FromStart = _core_.FromStart
1653FromCurrent = _core_.FromCurrent
1654FromEnd = _core_.FromEnd
d55e5bfc 1655class InputStream(object):
36ed4f51 1656 """Proxy of C++ InputStream class"""
1bd55598
RD
1657 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1658 __repr__ = _swig_repr
1659 def __init__(self, *args, **kwargs):
d55e5bfc 1660 """__init__(self, PyObject p) -> InputStream"""
1bd55598
RD
1661 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1662 __swig_destroy__ = _core_.delete_InputStream
1663 __del__ = lambda self : None;
d55e5bfc
RD
1664 def close(*args, **kwargs):
1665 """close(self)"""
5b5c9bc7 1666 return _core_.InputStream_close(*args, **kwargs)
d55e5bfc
RD
1667
1668 def flush(*args, **kwargs):
1669 """flush(self)"""
5b5c9bc7 1670 return _core_.InputStream_flush(*args, **kwargs)
d55e5bfc
RD
1671
1672 def eof(*args, **kwargs):
1673 """eof(self) -> bool"""
5b5c9bc7 1674 return _core_.InputStream_eof(*args, **kwargs)
d55e5bfc
RD
1675
1676 def read(*args, **kwargs):
1677 """read(self, int size=-1) -> PyObject"""
5b5c9bc7 1678 return _core_.InputStream_read(*args, **kwargs)
d55e5bfc
RD
1679
1680 def readline(*args, **kwargs):
1681 """readline(self, int size=-1) -> PyObject"""
5b5c9bc7 1682 return _core_.InputStream_readline(*args, **kwargs)
d55e5bfc
RD
1683
1684 def readlines(*args, **kwargs):
1685 """readlines(self, int sizehint=-1) -> PyObject"""
5b5c9bc7 1686 return _core_.InputStream_readlines(*args, **kwargs)
d55e5bfc
RD
1687
1688 def seek(*args, **kwargs):
1689 """seek(self, int offset, int whence=0)"""
5b5c9bc7 1690 return _core_.InputStream_seek(*args, **kwargs)
d55e5bfc
RD
1691
1692 def tell(*args, **kwargs):
1693 """tell(self) -> int"""
5b5c9bc7 1694 return _core_.InputStream_tell(*args, **kwargs)
d55e5bfc
RD
1695
1696 def Peek(*args, **kwargs):
1697 """Peek(self) -> char"""
5b5c9bc7 1698 return _core_.InputStream_Peek(*args, **kwargs)
d55e5bfc
RD
1699
1700 def GetC(*args, **kwargs):
1701 """GetC(self) -> char"""
5b5c9bc7 1702 return _core_.InputStream_GetC(*args, **kwargs)
d55e5bfc
RD
1703
1704 def LastRead(*args, **kwargs):
1705 """LastRead(self) -> size_t"""
5b5c9bc7 1706 return _core_.InputStream_LastRead(*args, **kwargs)
d55e5bfc
RD
1707
1708 def CanRead(*args, **kwargs):
1709 """CanRead(self) -> bool"""
5b5c9bc7 1710 return _core_.InputStream_CanRead(*args, **kwargs)
d55e5bfc
RD
1711
1712 def Eof(*args, **kwargs):
1713 """Eof(self) -> bool"""
5b5c9bc7 1714 return _core_.InputStream_Eof(*args, **kwargs)
d55e5bfc
RD
1715
1716 def Ungetch(*args, **kwargs):
1717 """Ungetch(self, char c) -> bool"""
5b5c9bc7 1718 return _core_.InputStream_Ungetch(*args, **kwargs)
d55e5bfc
RD
1719
1720 def SeekI(*args, **kwargs):
5b5c9bc7
RD
1721 """SeekI(self, long pos, int mode=FromStart) -> long"""
1722 return _core_.InputStream_SeekI(*args, **kwargs)
d55e5bfc
RD
1723
1724 def TellI(*args, **kwargs):
1725 """TellI(self) -> long"""
5b5c9bc7 1726 return _core_.InputStream_TellI(*args, **kwargs)
d55e5bfc 1727
2131d850 1728_core_.InputStream_swigregister(InputStream)
5b5c9bc7
RD
1729DefaultPosition = cvar.DefaultPosition
1730DefaultSize = cvar.DefaultSize
d55e5bfc 1731
5b5c9bc7
RD
1732class OutputStream(object):
1733 """Proxy of C++ OutputStream class"""
1bd55598
RD
1734 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1735 def __init__(self): raise AttributeError, "No constructor defined"
1736 __repr__ = _swig_repr
d55e5bfc
RD
1737 def write(*args, **kwargs):
1738 """write(self, PyObject obj)"""
5b5c9bc7 1739 return _core_.OutputStream_write(*args, **kwargs)
d55e5bfc 1740
1bd55598
RD
1741 def LastWrite(*args, **kwargs):
1742 """LastWrite(self) -> size_t"""
1743 return _core_.OutputStream_LastWrite(*args, **kwargs)
d55e5bfc 1744
2131d850 1745_core_.OutputStream_swigregister(OutputStream)
d55e5bfc
RD
1746
1747#---------------------------------------------------------------------------
1748
5b5c9bc7
RD
1749class FSFile(Object):
1750 """Proxy of C++ FSFile class"""
1bd55598
RD
1751 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1752 __repr__ = _swig_repr
1753 def __init__(self, *args, **kwargs):
d55e5bfc 1754 """
5b5c9bc7
RD
1755 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1756 DateTime modif) -> FSFile
d55e5bfc 1757 """
1bd55598 1758 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1bd55598
RD
1759 __swig_destroy__ = _core_.delete_FSFile
1760 __del__ = lambda self : None;
d55e5bfc 1761 def GetStream(*args, **kwargs):
5b5c9bc7
RD
1762 """GetStream(self) -> InputStream"""
1763 return _core_.FSFile_GetStream(*args, **kwargs)
d55e5bfc 1764
ac5d357a
RD
1765 def DetachStream(*args, **kwargs):
1766 """DetachStream(self)"""
1767 return _core_.FSFile_DetachStream(*args, **kwargs)
1768
d55e5bfc 1769 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
1770 """GetMimeType(self) -> String"""
1771 return _core_.FSFile_GetMimeType(*args, **kwargs)
d55e5bfc
RD
1772
1773 def GetLocation(*args, **kwargs):
5b5c9bc7
RD
1774 """GetLocation(self) -> String"""
1775 return _core_.FSFile_GetLocation(*args, **kwargs)
d55e5bfc
RD
1776
1777 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1778 """GetAnchor(self) -> String"""
1779 return _core_.FSFile_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1780
1781 def GetModificationTime(*args, **kwargs):
5b5c9bc7
RD
1782 """GetModificationTime(self) -> DateTime"""
1783 return _core_.FSFile_GetModificationTime(*args, **kwargs)
d55e5bfc 1784
ac5d357a
RD
1785 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1786 Location = property(GetLocation,doc="See `GetLocation`")
1787 MimeType = property(GetMimeType,doc="See `GetMimeType`")
1788 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
1789 Stream = property(GetStream,doc="See `GetStream`")
2131d850 1790_core_.FSFile_swigregister(FSFile)
d55e5bfc
RD
1791
1792class CPPFileSystemHandler(object):
36ed4f51 1793 """Proxy of C++ CPPFileSystemHandler class"""
1bd55598
RD
1794 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1795 def __init__(self): raise AttributeError, "No constructor defined"
1796 __repr__ = _swig_repr
50f151d7
RD
1797 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1798 __del__ = lambda self : None;
2131d850 1799_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d55e5bfc
RD
1800
1801class FileSystemHandler(CPPFileSystemHandler):
36ed4f51 1802 """Proxy of C++ FileSystemHandler class"""
1bd55598
RD
1803 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1804 __repr__ = _swig_repr
1805 def __init__(self, *args, **kwargs):
d55e5bfc 1806 """__init__(self) -> FileSystemHandler"""
1bd55598 1807 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
d55e5bfc
RD
1808 self._setCallbackInfo(self, FileSystemHandler)
1809
1810 def _setCallbackInfo(*args, **kwargs):
1811 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 1812 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
1813
1814 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1815 """CanOpen(self, String location) -> bool"""
1816 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1817
1818 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1819 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1820 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1821
1822 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1823 """FindFirst(self, String spec, int flags=0) -> String"""
1824 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1825
1826 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1827 """FindNext(self) -> String"""
1828 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
1829
1830 def GetProtocol(*args, **kwargs):
5b5c9bc7
RD
1831 """GetProtocol(self, String location) -> String"""
1832 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
d55e5bfc
RD
1833
1834 def GetLeftLocation(*args, **kwargs):
5b5c9bc7
RD
1835 """GetLeftLocation(self, String location) -> String"""
1836 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
d55e5bfc
RD
1837
1838 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1839 """GetAnchor(self, String location) -> String"""
1840 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1841
1842 def GetRightLocation(*args, **kwargs):
5b5c9bc7
RD
1843 """GetRightLocation(self, String location) -> String"""
1844 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
d55e5bfc
RD
1845
1846 def GetMimeTypeFromExt(*args, **kwargs):
5b5c9bc7
RD
1847 """GetMimeTypeFromExt(self, String location) -> String"""
1848 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
d55e5bfc 1849
ac5d357a
RD
1850 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1851 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
1852 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
1853 Protocol = property(GetProtocol,doc="See `GetProtocol`")
1854 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
2131d850 1855_core_.FileSystemHandler_swigregister(FileSystemHandler)
d55e5bfc 1856
5b5c9bc7
RD
1857class FileSystem(Object):
1858 """Proxy of C++ FileSystem class"""
1bd55598
RD
1859 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1860 __repr__ = _swig_repr
1861 def __init__(self, *args, **kwargs):
5b5c9bc7 1862 """__init__(self) -> FileSystem"""
1bd55598
RD
1863 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1864 __swig_destroy__ = _core_.delete_FileSystem
1865 __del__ = lambda self : None;
d55e5bfc 1866 def ChangePathTo(*args, **kwargs):
5b5c9bc7
RD
1867 """ChangePathTo(self, String location, bool is_dir=False)"""
1868 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
d55e5bfc
RD
1869
1870 def GetPath(*args, **kwargs):
5b5c9bc7
RD
1871 """GetPath(self) -> String"""
1872 return _core_.FileSystem_GetPath(*args, **kwargs)
d55e5bfc
RD
1873
1874 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1875 """OpenFile(self, String location) -> FSFile"""
1876 return _core_.FileSystem_OpenFile(*args, **kwargs)
d55e5bfc
RD
1877
1878 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1879 """FindFirst(self, String spec, int flags=0) -> String"""
1880 return _core_.FileSystem_FindFirst(*args, **kwargs)
d55e5bfc
RD
1881
1882 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1883 """FindNext(self) -> String"""
1884 return _core_.FileSystem_FindNext(*args, **kwargs)
d55e5bfc
RD
1885
1886 def AddHandler(*args, **kwargs):
d6c14a4c 1887 """AddHandler(CPPFileSystemHandler handler)"""
5b5c9bc7 1888 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc
RD
1889
1890 AddHandler = staticmethod(AddHandler)
ac5d357a
RD
1891 def RemoveHandler(*args, **kwargs):
1892 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1893 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1894
1895 RemoveHandler = staticmethod(RemoveHandler)
d55e5bfc 1896 def CleanUpHandlers(*args, **kwargs):
d6c14a4c 1897 """CleanUpHandlers()"""
5b5c9bc7 1898 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc
RD
1899
1900 CleanUpHandlers = staticmethod(CleanUpHandlers)
1901 def FileNameToURL(*args, **kwargs):
5b5c9bc7
RD
1902 """FileNameToURL(String filename) -> String"""
1903 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc
RD
1904
1905 FileNameToURL = staticmethod(FileNameToURL)
b411df4a 1906 def URLToFileName(*args, **kwargs):
5b5c9bc7
RD
1907 """URLToFileName(String url) -> String"""
1908 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a
RD
1909
1910 URLToFileName = staticmethod(URLToFileName)
ac5d357a 1911 Path = property(GetPath,doc="See `GetPath`")
2131d850 1912_core_.FileSystem_swigregister(FileSystem)
d55e5bfc 1913
5b5c9bc7 1914def FileSystem_AddHandler(*args, **kwargs):
1bd55598
RD
1915 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1916 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 1917
ac5d357a
RD
1918def FileSystem_RemoveHandler(*args, **kwargs):
1919 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1920 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1921
1bd55598
RD
1922def FileSystem_CleanUpHandlers(*args):
1923 """FileSystem_CleanUpHandlers()"""
1924 return _core_.FileSystem_CleanUpHandlers(*args)
d55e5bfc 1925
5b5c9bc7 1926def FileSystem_FileNameToURL(*args, **kwargs):
1bd55598
RD
1927 """FileSystem_FileNameToURL(String filename) -> String"""
1928 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 1929
5b5c9bc7 1930def FileSystem_URLToFileName(*args, **kwargs):
1bd55598
RD
1931 """FileSystem_URLToFileName(String url) -> String"""
1932 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a 1933
5b5c9bc7
RD
1934class InternetFSHandler(CPPFileSystemHandler):
1935 """Proxy of C++ InternetFSHandler class"""
1bd55598
RD
1936 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1937 __repr__ = _swig_repr
1938 def __init__(self, *args, **kwargs):
5b5c9bc7 1939 """__init__(self) -> InternetFSHandler"""
1bd55598 1940 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
d55e5bfc 1941 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1942 """CanOpen(self, String location) -> bool"""
1943 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1944
1945 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1946 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1947 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
d55e5bfc 1948
2131d850 1949_core_.InternetFSHandler_swigregister(InternetFSHandler)
d55e5bfc 1950
5b5c9bc7
RD
1951class ZipFSHandler(CPPFileSystemHandler):
1952 """Proxy of C++ ZipFSHandler class"""
1bd55598
RD
1953 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1954 __repr__ = _swig_repr
1955 def __init__(self, *args, **kwargs):
5b5c9bc7 1956 """__init__(self) -> ZipFSHandler"""
1bd55598 1957 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
d55e5bfc 1958 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1959 """CanOpen(self, String location) -> bool"""
1960 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1961
1962 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1963 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1964 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1965
1966 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1967 """FindFirst(self, String spec, int flags=0) -> String"""
1968 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1969
1970 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1971 """FindNext(self) -> String"""
1972 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
d55e5bfc 1973
2131d850 1974_core_.ZipFSHandler_swigregister(ZipFSHandler)
d55e5bfc
RD
1975
1976
1977def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1bd55598
RD
1978 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1979 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d55e5bfc
RD
1980
1981def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1bd55598
RD
1982 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1983 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d55e5bfc
RD
1984
1985def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1bd55598
RD
1986 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1987 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
b411df4a
RD
1988def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1989 """
1990 Add 'file' to the memory filesystem. The dataItem parameter can
1991 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1992 arbitrary data. If a bitmap or image is used then the imgType
1993 parameter should specify what kind of image file it should be
1994 written as, wx.BITMAP_TYPE_PNG, etc.
1995 """
1996 if isinstance(dataItem, wx.Image):
1997 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1998 elif isinstance(dataItem, wx.Bitmap):
1999 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
2000 elif type(dataItem) == str:
2001 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2002 else:
2003 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc 2004
5b5c9bc7
RD
2005class MemoryFSHandler(CPPFileSystemHandler):
2006 """Proxy of C++ MemoryFSHandler class"""
1bd55598
RD
2007 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2008 __repr__ = _swig_repr
2009 def __init__(self, *args, **kwargs):
5b5c9bc7 2010 """__init__(self) -> MemoryFSHandler"""
1bd55598 2011 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
d55e5bfc 2012 def RemoveFile(*args, **kwargs):
5b5c9bc7
RD
2013 """RemoveFile(String filename)"""
2014 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc
RD
2015
2016 RemoveFile = staticmethod(RemoveFile)
2017 AddFile = staticmethod(MemoryFSHandler_AddFile)
2018 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2019 """CanOpen(self, String location) -> bool"""
2020 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2021
2022 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2023 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2024 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
2025
2026 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2027 """FindFirst(self, String spec, int flags=0) -> String"""
2028 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
2029
2030 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2031 """FindNext(self) -> String"""
2032 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
d55e5bfc 2033
2131d850 2034_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d55e5bfc 2035
5b5c9bc7 2036def MemoryFSHandler_RemoveFile(*args, **kwargs):
1bd55598
RD
2037 """MemoryFSHandler_RemoveFile(String filename)"""
2038 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 2039
5b5c9bc7
RD
2040IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2041IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2042IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
f5263701
RD
2043IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL
2044IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH
d55e5bfc
RD
2045#---------------------------------------------------------------------------
2046
5b5c9bc7 2047class ImageHandler(Object):
27fb7603
RD
2048 """
2049 This is the base class for implementing image file loading/saving, and
2050 image creation from data. It is used within `wx.Image` and is not
2051 normally seen by the application.
2052 """
1bd55598
RD
2053 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2054 def __init__(self): raise AttributeError, "No constructor defined"
2055 __repr__ = _swig_repr
d55e5bfc 2056 def GetName(*args, **kwargs):
5b5c9bc7
RD
2057 """GetName(self) -> String"""
2058 return _core_.ImageHandler_GetName(*args, **kwargs)
d55e5bfc
RD
2059
2060 def GetExtension(*args, **kwargs):
5b5c9bc7
RD
2061 """GetExtension(self) -> String"""
2062 return _core_.ImageHandler_GetExtension(*args, **kwargs)
d55e5bfc
RD
2063
2064 def GetType(*args, **kwargs):
2065 """GetType(self) -> long"""
5b5c9bc7 2066 return _core_.ImageHandler_GetType(*args, **kwargs)
d55e5bfc
RD
2067
2068 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
2069 """GetMimeType(self) -> String"""
2070 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
d55e5bfc
RD
2071
2072 def CanRead(*args, **kwargs):
5b5c9bc7
RD
2073 """CanRead(self, String name) -> bool"""
2074 return _core_.ImageHandler_CanRead(*args, **kwargs)
d55e5bfc 2075
b02396e8
RD
2076 def CanReadStream(*args, **kwargs):
2077 """CanReadStream(self, InputStream stream) -> bool"""
2078 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2079
d55e5bfc 2080 def SetName(*args, **kwargs):
5b5c9bc7
RD
2081 """SetName(self, String name)"""
2082 return _core_.ImageHandler_SetName(*args, **kwargs)
d55e5bfc
RD
2083
2084 def SetExtension(*args, **kwargs):
5b5c9bc7
RD
2085 """SetExtension(self, String extension)"""
2086 return _core_.ImageHandler_SetExtension(*args, **kwargs)
d55e5bfc
RD
2087
2088 def SetType(*args, **kwargs):
2089 """SetType(self, long type)"""
5b5c9bc7 2090 return _core_.ImageHandler_SetType(*args, **kwargs)
d55e5bfc
RD
2091
2092 def SetMimeType(*args, **kwargs):
5b5c9bc7
RD
2093 """SetMimeType(self, String mimetype)"""
2094 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
d55e5bfc 2095
ac5d357a
RD
2096 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2097 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2098 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2099 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2131d850 2100_core_.ImageHandler_swigregister(ImageHandler)
d55e5bfc 2101
943e8dfd
RD
2102class PyImageHandler(ImageHandler):
2103 """
2104 This is the base class for implementing image file loading/saving, and
2105 image creation from data, all written in Python. To create a custom
2106 image handler derive a new class from wx.PyImageHandler and provide
2107 the following methods::
2108
2109 def DoCanRead(self, stream) --> bool
2110 '''Check if this handler can read the image on the stream'''
2111
2112 def LoadFile(self, image, stream, verbose, index) --> bool
2113 '''Load image data from the stream and load it into image.'''
2114
2115 def SaveFile(self, image, stream, verbose) --> bool
2116 '''Save the iamge data in image to the stream using
2117 this handler's image file format.'''
2118
2119 def GetImageCount(self, stream) --> int
2120 '''If this image format can hold more than one image,
2121 how many does the image on the stream have?'''
2122
2123 To activate your handler create an instance of it and pass it to
2124 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2125 `SetExtension` from your constructor.
2126
2127 """
1bd55598
RD
2128 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2129 __repr__ = _swig_repr
2130 def __init__(self, *args, **kwargs):
943e8dfd
RD
2131 """
2132 __init__(self) -> PyImageHandler
2133
2134 This is the base class for implementing image file loading/saving, and
2135 image creation from data, all written in Python. To create a custom
2136 image handler derive a new class from wx.PyImageHandler and provide
2137 the following methods::
2138
2139 def DoCanRead(self, stream) --> bool
2140 '''Check if this handler can read the image on the stream'''
2141
2142 def LoadFile(self, image, stream, verbose, index) --> bool
2143 '''Load image data from the stream and load it into image.'''
2144
2145 def SaveFile(self, image, stream, verbose) --> bool
2146 '''Save the iamge data in image to the stream using
2147 this handler's image file format.'''
2148
2149 def GetImageCount(self, stream) --> int
2150 '''If this image format can hold more than one image,
2151 how many does the image on the stream have?'''
2152
2153 To activate your handler create an instance of it and pass it to
2154 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2155 `SetExtension` from your constructor.
2156
2157 """
1bd55598 2158 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
RD
2159 self._SetSelf(self)
2160
2161 def _SetSelf(*args, **kwargs):
2162 """_SetSelf(self, PyObject self)"""
2163 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2164
2131d850 2165_core_.PyImageHandler_swigregister(PyImageHandler)
943e8dfd 2166
5b5c9bc7
RD
2167class ImageHistogram(object):
2168 """Proxy of C++ ImageHistogram class"""
1bd55598
RD
2169 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2170 __repr__ = _swig_repr
2171 def __init__(self, *args, **kwargs):
5b5c9bc7 2172 """__init__(self) -> ImageHistogram"""
1bd55598 2173 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
d55e5bfc
RD
2174 def MakeKey(*args, **kwargs):
2175 """
7a27cf7c 2176 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2177
2178 Get the key in the histogram for the given RGB values
2179 """
5b5c9bc7 2180 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc
RD
2181
2182 MakeKey = staticmethod(MakeKey)
2183 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2184 """
2185 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2186
2187 Find first colour that is not used in the image and has higher RGB
2188 values than startR, startG, startB. Returns a tuple consisting of a
2189 success flag and rgb values.
2190 """
5b5c9bc7 2191 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2192
f1cbd8fa
RD
2193 def GetCount(*args, **kwargs):
2194 """
2195 GetCount(self, unsigned long key) -> unsigned long
2196
2197 Returns the pixel count for the given key. Use `MakeKey` to create a
2198 key value from a RGB tripple.
2199 """
5b5c9bc7 2200 return _core_.ImageHistogram_GetCount(*args, **kwargs)
f1cbd8fa
RD
2201
2202 def GetCountRGB(*args, **kwargs):
2203 """
7a27cf7c 2204 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2205
2206 Returns the pixel count for the given RGB values.
2207 """
5b5c9bc7 2208 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
f1cbd8fa
RD
2209
2210 def GetCountColour(*args, **kwargs):
2211 """
5b5c9bc7 2212 GetCountColour(self, Colour colour) -> unsigned long
f1cbd8fa
RD
2213
2214 Returns the pixel count for the given `wx.Colour` value.
2215 """
5b5c9bc7 2216 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
f1cbd8fa 2217
2131d850 2218_core_.ImageHistogram_swigregister(ImageHistogram)
d55e5bfc 2219
5b5c9bc7 2220def ImageHistogram_MakeKey(*args, **kwargs):
1bd55598 2221 """
7a27cf7c 2222 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2223
2224 Get the key in the histogram for the given RGB values
2225 """
1bd55598 2226 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2227
943e8dfd
RD
2228class Image_RGBValue(object):
2229 """
2230 An object that contains values for red, green and blue which represent
2231 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2232 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2233 color space.
2234 """
1bd55598
RD
2235 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2236 __repr__ = _swig_repr
2237 def __init__(self, *args, **kwargs):
943e8dfd
RD
2238 """
2239 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2240
2241 Constructor.
2242 """
1bd55598 2243 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
2244 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2245 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2246 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2247_core_.Image_RGBValue_swigregister(Image_RGBValue)
943e8dfd
RD
2248
2249class Image_HSVValue(object):
2250 """
2251 An object that contains values for hue, saturation and value which
2252 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2253 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2254 color space.
2255 """
1bd55598
RD
2256 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2257 __repr__ = _swig_repr
2258 def __init__(self, *args, **kwargs):
943e8dfd
RD
2259 """
2260 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2261
2262 Constructor.
2263 """
1bd55598 2264 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
2265 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2266 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2267 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2268_core_.Image_HSVValue_swigregister(Image_HSVValue)
943e8dfd 2269
5b5c9bc7 2270class Image(Object):
7a27cf7c
RD
2271 """
2272 A platform-independent image class. An image can be created from
2273 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2274 variety of formats. Functions are available to set and get image
2275 bits, so it can be used for basic image manipulation.
2276
2277 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2278 platform-specific `wx.Bitmap` object must be created from it using the
2279 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2280 device context, using `wx.DC.DrawBitmap`.
2281
2282 One colour value of the image may be used as a mask colour which will
2283 lead to the automatic creation of a `wx.Mask` object associated to the
2284 bitmap object.
2285
2286 wx.Image supports alpha channel data, that is in addition to a byte
2287 for the red, green and blue colour components for each pixel it also
2288 stores a byte representing the pixel opacity. An alpha value of 0
2289 corresponds to a transparent pixel (null opacity) while a value of 255
2290 means that the pixel is 100% opaque.
2291
2292 Unlike RGB data, not all images have an alpha channel and before using
2293 `GetAlpha` you should check if this image contains an alpha channel
2294 with `HasAlpha`. Note that currently only images loaded from PNG files
2295 with transparency information will have an alpha channel.
2296 """
1bd55598
RD
2297 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2298 __repr__ = _swig_repr
2299 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2300 """
2301 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2302
2303 Loads an image from a file.
2304 """
1bd55598
RD
2305 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2306 __swig_destroy__ = _core_.delete_Image
2307 __del__ = lambda self : None;
d55e5bfc 2308 def Create(*args, **kwargs):
7a27cf7c
RD
2309 """
2310 Create(self, int width, int height, bool clear=True)
2311
2312 Creates a fresh image. If clear is ``True``, the new image will be
2313 initialized to black. Otherwise, the image data will be uninitialized.
2314 """
5b5c9bc7 2315 return _core_.Image_Create(*args, **kwargs)
d55e5bfc
RD
2316
2317 def Destroy(*args, **kwargs):
2318 """
2319 Destroy(self)
2320
7a27cf7c 2321 Destroys the image data.
d55e5bfc 2322 """
b39fe951
RD
2323 args[0].this.own(False)
2324 return _core_.Image_Destroy(*args, **kwargs)
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 """
5b5c9bc7 2339 return _core_.Image_Scale(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 2384 return _core_.Image_ShrinkBy(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2395 return _core_.Image_Rescale(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 2411 return _core_.Image_Resize(*args, **kwargs)
aff4cc5c 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 """
5b5c9bc7 2423 return _core_.Image_SetRGB(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7 2433 return _core_.Image_SetRGBRect(*args, **kwargs)
aff4cc5c 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 """
5b5c9bc7 2441 return _core_.Image_GetRed(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2449 return _core_.Image_GetGreen(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2457 return _core_.Image_GetBlue(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2467 return _core_.Image_SetAlpha(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2481 return _core_.Image_GetAlpha(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2489 return _core_.Image_HasAlpha(*args, **kwargs)
d55e5bfc 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 """
5b5c9bc7
RD
2500 return _core_.Image_InitAlpha(*args, **kwargs)
2501
2502 def IsTransparent(*args, **kwargs):
2503 """
7a27cf7c 2504 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
5b5c9bc7 2505
7a27cf7c
RD
2506 Returns ``True`` if this pixel is masked or has an alpha value less
2507 than the spcified threshold.
5b5c9bc7
RD
2508 """
2509 return _core_.Image_IsTransparent(*args, **kwargs)
68350608 2510
d55e5bfc 2511 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
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 """
5b5c9bc7 2519 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2520
4cf4100f
RD
2521 def ConvertAlphaToMask(*args, **kwargs):
2522 """
5b5c9bc7 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 """
5b5c9bc7 2533 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
4cf4100f 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 """
5b5c9bc7 2547 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
8fb0e70a 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 """
5b5c9bc7 2566 return _core_.Image_SetMaskFromImage(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2574 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2585 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2595 return _core_.Image_LoadFile(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2604 return _core_.Image_LoadMimeFile(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2612 return _core_.Image_SaveFile(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2620 return _core_.Image_SaveMimeFile(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2630 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2641 return _core_.Image_LoadStream(*args, **kwargs)
d55e5bfc
RD
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 """
5b5c9bc7 2650 return _core_.Image_LoadMimeStream(*args, **kwargs)
d55e5bfc 2651
b39fe951 2652 def IsOk(*args, **kwargs):
7a27cf7c 2653 """
b39fe951 2654 IsOk(self) -> bool
7a27cf7c
RD
2655
2656 Returns true if image data is present.
2657 """
b39fe951 2658 return _core_.Image_IsOk(*args, **kwargs)
d55e5bfc 2659
b39fe951 2660 Ok = IsOk
d55e5bfc 2661 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2662 """
2663 GetWidth(self) -> int
2664
2665 Gets the width of the image in pixels.
2666 """
5b5c9bc7 2667 return _core_.Image_GetWidth(*args, **kwargs)
d55e5bfc
RD
2668
2669 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2670 """
2671 GetHeight(self) -> int
2672
2673 Gets the height of the image in pixels.
2674 """
5b5c9bc7 2675 return _core_.Image_GetHeight(*args, **kwargs)
d55e5bfc
RD
2676
2677 def GetSize(*args, **kwargs):
7a27cf7c
RD
2678 """
2679 GetSize(self) -> Size
2680
2681 Returns the size of the image in pixels.
2682 """
5b5c9bc7 2683 return _core_.Image_GetSize(*args, **kwargs)
d55e5bfc
RD
2684
2685 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2686 """
2687 GetSubImage(self, Rect rect) -> Image
2688
2689 Returns a sub image of the current one as long as the rect belongs
2690 entirely to the image.
2691 """
5b5c9bc7 2692 return _core_.Image_GetSubImage(*args, **kwargs)
d55e5bfc 2693
aff4cc5c 2694 def Size(*args, **kwargs):
7a27cf7c
RD
2695 """
2696 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2697
2698 Returns a resized version of this image without scaling it by adding
2699 either a border with the given colour or cropping as necessary. The
2700 image is pasted into a new image with the given size and background
2701 colour at the position ``pos`` relative to the upper left of the new
2702 image. If red = green = blue = -1 then use either the current mask
2703 colour if set or find, use, and set a suitable mask colour for any
2704 newly exposed areas.
2705 """
5b5c9bc7 2706 return _core_.Image_Size(*args, **kwargs)
aff4cc5c 2707
d55e5bfc 2708 def Copy(*args, **kwargs):
7a27cf7c
RD
2709 """
2710 Copy(self) -> Image
2711
2712 Returns an identical copy of the image.
2713 """
5b5c9bc7 2714 return _core_.Image_Copy(*args, **kwargs)
d55e5bfc
RD
2715
2716 def Paste(*args, **kwargs):
7a27cf7c
RD
2717 """
2718 Paste(self, Image image, int x, int y)
2719
2720 Pastes ``image`` into this instance and takes care of the mask colour
2721 and any out of bounds problems.
2722 """
5b5c9bc7 2723 return _core_.Image_Paste(*args, **kwargs)
d55e5bfc
RD
2724
2725 def GetData(*args, **kwargs):
bb2ef2cc
RD
2726 """
2727 GetData(self) -> PyObject
2728
2729 Returns a string containing a copy of the RGB bytes of the image.
2730 """
5b5c9bc7 2731 return _core_.Image_GetData(*args, **kwargs)
d55e5bfc
RD
2732
2733 def SetData(*args, **kwargs):
bb2ef2cc
RD
2734 """
2735 SetData(self, buffer data)
2736
2737 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2738 either a string or a buffer object holding the data and the length of
2739 the data must be width*height*3.
2740 """
5b5c9bc7 2741 return _core_.Image_SetData(*args, **kwargs)
d55e5bfc
RD
2742
2743 def GetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2744 """
2745 GetDataBuffer(self) -> PyObject
2746
2747 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2748 image data buffer inside the wx.Image. You need to ensure that you do
2749 not use this buffer object after the image has been destroyed.
bb2ef2cc 2750 """
5b5c9bc7 2751 return _core_.Image_GetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2752
2753 def SetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2754 """
2755 SetDataBuffer(self, buffer data)
2756
2757 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2758 object. This can save making an extra copy of the data but you must
2759 ensure that the buffer object lives longer than the wx.Image does.
bb2ef2cc 2760 """
5b5c9bc7 2761 return _core_.Image_SetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2762
2763 def GetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2764 """
2765 GetAlphaData(self) -> PyObject
2766
2767 Returns a string containing a copy of the alpha bytes of the image.
2768 """
5b5c9bc7 2769 return _core_.Image_GetAlphaData(*args, **kwargs)
d55e5bfc
RD
2770
2771 def SetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2772 """
2773 SetAlphaData(self, buffer alpha)
2774
2775 Resets the Image's alpha data from a buffer of bytes. Accepts either
2776 a string or a buffer object holding the data and the length of the
2777 data must be width*height.
2778 """
5b5c9bc7 2779 return _core_.Image_SetAlphaData(*args, **kwargs)
d55e5bfc
RD
2780
2781 def GetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
2782 """
2783 GetAlphaBuffer(self) -> PyObject
2784
2785 Returns a writable Python buffer object that is pointing at the Alpha
2786 data buffer inside the wx.Image. You need to ensure that you do not
2787 use this buffer object after the image has been destroyed.
2788 """
5b5c9bc7 2789 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2790
2791 def SetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
2792 """
2793 SetAlphaBuffer(self, buffer alpha)
2794
2795 Sets the internal image alpha pointer to point at a Python buffer
2796 object. This can save making an extra copy of the data but you must
2797 ensure that the buffer object lives as long as the wx.Image does.
2798 """
5b5c9bc7 2799 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2800
2801 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2802 """
2803 SetMaskColour(self, byte r, byte g, byte b)
2804
2805 Sets the mask colour for this image (and tells the image to use the
2806 mask).
2807 """
5b5c9bc7 2808 return _core_.Image_SetMaskColour(*args, **kwargs)
d55e5bfc 2809
aff4cc5c
RD
2810 def GetOrFindMaskColour(*args, **kwargs):
2811 """
2812 GetOrFindMaskColour() -> (r,g,b)
2813
2814 Get the current mask colour or find a suitable colour.
2815 """
5b5c9bc7 2816 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
aff4cc5c 2817
d55e5bfc 2818 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2819 """
2820 GetMaskRed(self) -> byte
2821
2822 Gets the red component of the mask colour.
2823 """
5b5c9bc7 2824 return _core_.Image_GetMaskRed(*args, **kwargs)
d55e5bfc
RD
2825
2826 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2827 """
2828 GetMaskGreen(self) -> byte
2829
2830 Gets the green component of the mask colour.
2831 """
5b5c9bc7 2832 return _core_.Image_GetMaskGreen(*args, **kwargs)
d55e5bfc
RD
2833
2834 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2835 """
2836 GetMaskBlue(self) -> byte
2837
2838 Gets the blue component of the mask colour.
2839 """
5b5c9bc7 2840 return _core_.Image_GetMaskBlue(*args, **kwargs)
d55e5bfc
RD
2841
2842 def SetMask(*args, **kwargs):
7a27cf7c
RD
2843 """
2844 SetMask(self, bool mask=True)
2845
2846 Specifies whether there is a mask or not. The area of the mask is
2847 determined by the current mask colour.
2848 """
5b5c9bc7 2849 return _core_.Image_SetMask(*args, **kwargs)
d55e5bfc
RD
2850
2851 def HasMask(*args, **kwargs):
7a27cf7c
RD
2852 """
2853 HasMask(self) -> bool
2854
2855 Returns ``True`` if there is a mask active, ``False`` otherwise.
2856 """
5b5c9bc7 2857 return _core_.Image_HasMask(*args, **kwargs)
d55e5bfc
RD
2858
2859 def Rotate(*args, **kwargs):
2860 """
5b5c9bc7
RD
2861 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2862 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2863
2864 Rotates the image about the given point, by ``angle`` radians. Passing
2865 ``True`` to ``interpolating`` results in better image quality, but is
2866 slower. If the image has a mask, then the mask colour is used for the
2867 uncovered pixels in the rotated image background. Otherwise, black
2868 will be used as the fill colour.
2869
2870 Returns the rotated image, leaving this image intact.
d55e5bfc 2871 """
5b5c9bc7 2872 return _core_.Image_Rotate(*args, **kwargs)
d55e5bfc
RD
2873
2874 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2875 """
2876 Rotate90(self, bool clockwise=True) -> Image
2877
2878 Returns a copy of the image rotated 90 degrees in the direction
2879 indicated by ``clockwise``.
2880 """
5b5c9bc7 2881 return _core_.Image_Rotate90(*args, **kwargs)
d55e5bfc
RD
2882
2883 def Mirror(*args, **kwargs):
7a27cf7c
RD
2884 """
2885 Mirror(self, bool horizontally=True) -> Image
2886
2887 Returns a mirrored copy of the image. The parameter ``horizontally``
2888 indicates the orientation.
2889 """
5b5c9bc7 2890 return _core_.Image_Mirror(*args, **kwargs)
d55e5bfc
RD
2891
2892 def Replace(*args, **kwargs):
2893 """
7a27cf7c
RD
2894 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2895
2896 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2897 ``(r2,g2,b2)``.
d55e5bfc 2898 """
5b5c9bc7 2899 return _core_.Image_Replace(*args, **kwargs)
d55e5bfc 2900
32fe5131
RD
2901 def ConvertToGreyscale(*args, **kwargs):
2902 """
2903 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2904
2905 Convert to greyscale image. Uses the luminance component (Y) of the
2906 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2907 defaults to ITU-T BT.601
2908 """
2909 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2910
d55e5bfc 2911 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2912 """
2913 ConvertToMono(self, byte r, byte g, byte b) -> Image
2914
2915 Returns monochromatic version of the image. The returned image has
2916 white colour where the original has ``(r,g,b)`` colour and black
2917 colour everywhere else.
2918 """
5b5c9bc7 2919 return _core_.Image_ConvertToMono(*args, **kwargs)
d55e5bfc
RD
2920
2921 def SetOption(*args, **kwargs):
7a27cf7c
RD
2922 """
2923 SetOption(self, String name, String value)
2924
2925 Sets an image handler defined option. For example, when saving as a
2926 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2927 number between 0 and 100 (0 is terrible, 100 is very good).
2928 """
5b5c9bc7 2929 return _core_.Image_SetOption(*args, **kwargs)
d55e5bfc
RD
2930
2931 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2932 """
2933 SetOptionInt(self, String name, int value)
2934
2935 Sets an image option as an integer.
2936 """
5b5c9bc7 2937 return _core_.Image_SetOptionInt(*args, **kwargs)
d55e5bfc
RD
2938
2939 def GetOption(*args, **kwargs):
7a27cf7c
RD
2940 """
2941 GetOption(self, String name) -> String
2942
2943 Gets the value of an image handler option.
2944 """
5b5c9bc7 2945 return _core_.Image_GetOption(*args, **kwargs)
d55e5bfc
RD
2946
2947 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2948 """
2949 GetOptionInt(self, String name) -> int
2950
2951 Gets the value of an image handler option as an integer. If the given
2952 option is not present, the function returns 0.
2953 """
5b5c9bc7 2954 return _core_.Image_GetOptionInt(*args, **kwargs)
d55e5bfc
RD
2955
2956 def HasOption(*args, **kwargs):
7a27cf7c
RD
2957 """
2958 HasOption(self, String name) -> bool
2959
2960 Returns true if the given option is present.
2961 """
5b5c9bc7 2962 return _core_.Image_HasOption(*args, **kwargs)
d55e5bfc
RD
2963
2964 def CountColours(*args, **kwargs):
2965 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
5b5c9bc7 2966 return _core_.Image_CountColours(*args, **kwargs)
d55e5bfc
RD
2967
2968 def ComputeHistogram(*args, **kwargs):
5b5c9bc7
RD
2969 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2970 return _core_.Image_ComputeHistogram(*args, **kwargs)
d55e5bfc
RD
2971
2972 def AddHandler(*args, **kwargs):
5b5c9bc7
RD
2973 """AddHandler(ImageHandler handler)"""
2974 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
2975
2976 AddHandler = staticmethod(AddHandler)
2977 def InsertHandler(*args, **kwargs):
5b5c9bc7
RD
2978 """InsertHandler(ImageHandler handler)"""
2979 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
2980
2981 InsertHandler = staticmethod(InsertHandler)
2982 def RemoveHandler(*args, **kwargs):
5b5c9bc7
RD
2983 """RemoveHandler(String name) -> bool"""
2984 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc
RD
2985
2986 RemoveHandler = staticmethod(RemoveHandler)
1bd55598
RD
2987 def GetHandlers(*args, **kwargs):
2988 """GetHandlers() -> PyObject"""
2989 return _core_.Image_GetHandlers(*args, **kwargs)
2990
2991 GetHandlers = staticmethod(GetHandlers)
d55e5bfc 2992 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2993 """
2994 GetImageExtWildcard() -> String
2995
2996 Iterates all registered wxImageHandler objects, and returns a string
2997 containing file extension masks suitable for passing to file open/save
2998 dialog boxes.
2999 """
5b5c9bc7 3000 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc
RD
3001
3002 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3003 def ConvertToBitmap(*args, **kwargs):
5b5c9bc7
RD
3004 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
3005 return _core_.Image_ConvertToBitmap(*args, **kwargs)
d55e5bfc
RD
3006
3007 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 3008 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
5b5c9bc7 3009 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
d55e5bfc 3010
943e8dfd
RD
3011 def RotateHue(*args, **kwargs):
3012 """
3013 RotateHue(self, double angle)
3014
3015 Rotates the hue of each pixel of the image. Hue is a double in the
3016 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3017 """
3018 return _core_.Image_RotateHue(*args, **kwargs)
3019
3020 def RGBtoHSV(*args, **kwargs):
3021 """
3022 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3023
3024 Converts a color in RGB color space to HSV color space.
3025 """
3026 return _core_.Image_RGBtoHSV(*args, **kwargs)
3027
3028 RGBtoHSV = staticmethod(RGBtoHSV)
3029 def HSVtoRGB(*args, **kwargs):
3030 """
3031 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3032
3033 Converts a color in HSV color space to RGB color space.
3034 """
3035 return _core_.Image_HSVtoRGB(*args, **kwargs)
3036
3037 HSVtoRGB = staticmethod(HSVtoRGB)
b39fe951 3038 def __nonzero__(self): return self.IsOk()
ac5d357a
RD
3039 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
3040 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
3041 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
3042 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
3043 Height = property(GetHeight,doc="See `GetHeight`")
3044 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
3045 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
3046 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
3047 Size = property(GetSize,doc="See `GetSize`")
3048 Width = property(GetWidth,doc="See `GetWidth`")
2131d850 3049_core_.Image_swigregister(Image)
d55e5bfc
RD
3050
3051def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
3052 """
3053 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3054
3055 Loads an image from a file, using a MIME type string (such as
3056 'image/jpeg') to specify image type.
3057 """
5b5c9bc7 3058 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
3059 return val
3060
3061def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
3062 """
3063 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3064
3065 Loads an image from an input stream, or any readable Python file-like
3066 object.
3067 """
5b5c9bc7 3068 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
3069 return val
3070
3071def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
3072 """
3073 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3074
3075 Loads an image from an input stream, or any readable Python file-like
3076 object, specifying the image format with a MIME type string.
3077 """
5b5c9bc7 3078 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
3079 return val
3080
d6c14a4c 3081def EmptyImage(*args, **kwargs):
bb2ef2cc 3082 """
5b5c9bc7 3083 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
bb2ef2cc
RD
3084
3085 Construct an empty image of a given size, optionally setting all
3086 pixels to black.
3087 """
5b5c9bc7 3088 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
3089 return val
3090
3091def ImageFromBitmap(*args, **kwargs):
bb2ef2cc 3092 """
5b5c9bc7 3093 ImageFromBitmap(Bitmap bitmap) -> Image
bb2ef2cc
RD
3094
3095 Construct an Image from a `wx.Bitmap`.
3096 """
5b5c9bc7 3097 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
3098 return val
3099
3100def ImageFromData(*args, **kwargs):
bb2ef2cc 3101 """
5b5c9bc7 3102 ImageFromData(int width, int height, buffer data) -> Image
bb2ef2cc
RD
3103
3104 Construct an Image from a buffer of RGB bytes. Accepts either a
3105 string or a buffer object holding the data and the length of the data
3106 must be width*height*3.
3107 """
5b5c9bc7 3108 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
3109 return val
3110
03e46024 3111def ImageFromDataWithAlpha(*args, **kwargs):
bb2ef2cc 3112 """
5b5c9bc7 3113 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
bb2ef2cc
RD
3114
3115 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3116 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
3117 length of the data must be width*height*3 bytes, and the length of the
3118 alpha data must be width*height bytes.
bb2ef2cc 3119 """
5b5c9bc7 3120 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
03e46024
RD
3121 return val
3122
5b5c9bc7 3123def Image_CanRead(*args, **kwargs):
1bd55598 3124 """
7a27cf7c
RD
3125 Image_CanRead(String filename) -> bool
3126
3127 Returns True if the image handlers can read this file.
3128 """
1bd55598 3129 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc 3130
5b5c9bc7 3131def Image_GetImageCount(*args, **kwargs):
1bd55598 3132 """
7a27cf7c
RD
3133 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3134
3135 If the image file contains more than one image and the image handler
3136 is capable of retrieving these individually, this function will return
3137 the number of available images.
3138 """
1bd55598 3139 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc 3140
5b5c9bc7 3141def Image_CanReadStream(*args, **kwargs):
1bd55598 3142 """
7a27cf7c
RD
3143 Image_CanReadStream(InputStream stream) -> bool
3144
3145 Returns True if the image handlers can read an image file from the
3146 data currently on the input stream, or a readable Python file-like
3147 object.
3148 """
1bd55598 3149 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc 3150
5b5c9bc7 3151def Image_AddHandler(*args, **kwargs):
1bd55598
RD
3152 """Image_AddHandler(ImageHandler handler)"""
3153 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc 3154
5b5c9bc7 3155def Image_InsertHandler(*args, **kwargs):
1bd55598
RD
3156 """Image_InsertHandler(ImageHandler handler)"""
3157 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc 3158
5b5c9bc7 3159def Image_RemoveHandler(*args, **kwargs):
1bd55598
RD
3160 """Image_RemoveHandler(String name) -> bool"""
3161 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 3162
1bd55598
RD
3163def Image_GetHandlers(*args):
3164 """Image_GetHandlers() -> PyObject"""
3165 return _core_.Image_GetHandlers(*args)
3166
3167def Image_GetImageExtWildcard(*args):
3168 """
7a27cf7c
RD
3169 Image_GetImageExtWildcard() -> String
3170
3171 Iterates all registered wxImageHandler objects, and returns a string
3172 containing file extension masks suitable for passing to file open/save
3173 dialog boxes.
3174 """
1bd55598 3175 return _core_.Image_GetImageExtWildcard(*args)
d55e5bfc 3176
943e8dfd 3177def Image_RGBtoHSV(*args, **kwargs):
1bd55598 3178 """
943e8dfd
RD
3179 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3180
3181 Converts a color in RGB color space to HSV color space.
3182 """
1bd55598 3183 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3184
3185def Image_HSVtoRGB(*args, **kwargs):
1bd55598 3186 """
943e8dfd
RD
3187 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3188
3189 Converts a color in HSV color space to RGB color space.
3190 """
1bd55598 3191 return _core_.Image_HSVtoRGB(*args, **kwargs)
943e8dfd 3192
fc46b7f3
RD
3193
3194def _ImageFromBuffer(*args, **kwargs):
3195 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3196 return _core_._ImageFromBuffer(*args, **kwargs)
3197def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3198 """
3199 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
eec1c382
RD
3200 parameter must be a Python object that implements the buffer interface,
3201 such as a string, array, etc. The dataBuffer object is expected to
3202 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3203 object can optionally be supplied for the image's alpha channel data, and
3204 it is expected to be width*height bytes long.
fc46b7f3
RD
3205
3206 The wx.Image will be created with its data and alpha pointers initialized
3207 to the memory address pointed to by the buffer objects, thus saving the
3208 time needed to copy the image data from the buffer object to the wx.Image.
3209 While this has advantages, it also has the shoot-yourself-in-the-foot
3210 risks associated with sharing a C pointer between two objects.
3211
3212 To help alleviate the risk a reference to the data and alpha buffer
3213 objects are kept with the wx.Image, so that they won't get deleted until
3214 after the wx.Image is deleted. However please be aware that it is not
3215 guaranteed that an object won't move its memory buffer to a new location
3216 when it needs to resize its contents. If that happens then the wx.Image
3217 will end up referring to an invalid memory location and could cause the
3218 application to crash. Therefore care should be taken to not manipulate
3219 the objects used for the data and alpha buffers in a way that would cause
3220 them to change size.
3221 """
fc46b7f3
RD
3222 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3223 image._buffer = dataBuffer
3224 image._alpha = alphaBuffer
3225 return image
3226
68e533f8
RD
3227def InitAllImageHandlers():
3228 """
3229 The former functionality of InitAllImageHanders is now done internal to
3230 the _core_ extension module and so this function has become a simple NOP.
3231 """
3232 pass
d55e5bfc 3233
5b5c9bc7
RD
3234IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3235IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3236PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3237PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3238PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3239BMP_24BPP = _core_.BMP_24BPP
3240BMP_8BPP = _core_.BMP_8BPP
3241BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3242BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3243BMP_8BPP_RED = _core_.BMP_8BPP_RED
3244BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3245BMP_4BPP = _core_.BMP_4BPP
3246BMP_1BPP = _core_.BMP_1BPP
3247BMP_1BPP_BW = _core_.BMP_1BPP_BW
3248class BMPHandler(ImageHandler):
27fb7603 3249 """A `wx.ImageHandler` for \*.bmp bitmap files."""
1bd55598
RD
3250 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3251 __repr__ = _swig_repr
3252 def __init__(self, *args, **kwargs):
27fb7603
RD
3253 """
3254 __init__(self) -> BMPHandler
3255
3256 A `wx.ImageHandler` for \*.bmp bitmap files.
3257 """
1bd55598 3258 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3259_core_.BMPHandler_swigregister(BMPHandler)
5b5c9bc7 3260NullImage = cvar.NullImage
68350608 3261IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3262IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3263IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3264IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3265IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3266IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3267IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3268IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3269IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3270IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3271IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3272IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3273IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
7fbf8399
RD
3274IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3275IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc 3276
5b5c9bc7 3277class ICOHandler(BMPHandler):
27fb7603 3278 """A `wx.ImageHandler` for \*.ico icon files."""
1bd55598
RD
3279 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3280 __repr__ = _swig_repr
3281 def __init__(self, *args, **kwargs):
27fb7603
RD
3282 """
3283 __init__(self) -> ICOHandler
3284
3285 A `wx.ImageHandler` for \*.ico icon files.
3286 """
1bd55598 3287 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3288_core_.ICOHandler_swigregister(ICOHandler)
d55e5bfc 3289
5b5c9bc7 3290class CURHandler(ICOHandler):
27fb7603 3291 """A `wx.ImageHandler` for \*.cur cursor files."""
1bd55598
RD
3292 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3293 __repr__ = _swig_repr
3294 def __init__(self, *args, **kwargs):
27fb7603
RD
3295 """
3296 __init__(self) -> CURHandler
3297
3298 A `wx.ImageHandler` for \*.cur cursor files.
3299 """
1bd55598 3300 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3301_core_.CURHandler_swigregister(CURHandler)
d55e5bfc 3302
5b5c9bc7 3303class ANIHandler(CURHandler):
27fb7603 3304 """A `wx.ImageHandler` for \*.ani animated cursor files."""
1bd55598
RD
3305 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3306 __repr__ = _swig_repr
3307 def __init__(self, *args, **kwargs):
27fb7603
RD
3308 """
3309 __init__(self) -> ANIHandler
3310
3311 A `wx.ImageHandler` for \*.ani animated cursor files.
3312 """
1bd55598 3313 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3314_core_.ANIHandler_swigregister(ANIHandler)
d55e5bfc 3315
5b5c9bc7 3316class PNGHandler(ImageHandler):
27fb7603 3317 """A `wx.ImageHandler` for PNG image files."""
1bd55598
RD
3318 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3319 __repr__ = _swig_repr
3320 def __init__(self, *args, **kwargs):
27fb7603
RD
3321 """
3322 __init__(self) -> PNGHandler
3323
3324 A `wx.ImageHandler` for PNG image files.
3325 """
1bd55598 3326 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3327_core_.PNGHandler_swigregister(PNGHandler)
d55e5bfc 3328
5b5c9bc7 3329class GIFHandler(ImageHandler):
27fb7603 3330 """A `wx.ImageHandler` for GIF image files."""
1bd55598
RD
3331 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3332 __repr__ = _swig_repr
3333 def __init__(self, *args, **kwargs):
27fb7603
RD
3334 """
3335 __init__(self) -> GIFHandler
3336
3337 A `wx.ImageHandler` for GIF image files.
3338 """
1bd55598 3339 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3340_core_.GIFHandler_swigregister(GIFHandler)
d55e5bfc 3341
5b5c9bc7 3342class PCXHandler(ImageHandler):
27fb7603 3343 """A `wx.ImageHandler` for PCX imager files."""
1bd55598
RD
3344 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3345 __repr__ = _swig_repr
3346 def __init__(self, *args, **kwargs):
27fb7603
RD
3347 """
3348 __init__(self) -> PCXHandler
3349
3350 A `wx.ImageHandler` for PCX imager files.
3351 """
1bd55598 3352 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3353_core_.PCXHandler_swigregister(PCXHandler)
d55e5bfc 3354
5b5c9bc7 3355class JPEGHandler(ImageHandler):
27fb7603 3356 """A `wx.ImageHandler` for JPEG/JPG image files."""
1bd55598
RD
3357 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3358 __repr__ = _swig_repr
3359 def __init__(self, *args, **kwargs):
27fb7603
RD
3360 """
3361 __init__(self) -> JPEGHandler
3362
3363 A `wx.ImageHandler` for JPEG/JPG image files.
3364 """
1bd55598 3365 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3366_core_.JPEGHandler_swigregister(JPEGHandler)
d55e5bfc 3367
5b5c9bc7 3368class PNMHandler(ImageHandler):
27fb7603 3369 """A `wx.ImageHandler` for PNM image files."""
1bd55598
RD
3370 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3371 __repr__ = _swig_repr
3372 def __init__(self, *args, **kwargs):
27fb7603
RD
3373 """
3374 __init__(self) -> PNMHandler
3375
3376 A `wx.ImageHandler` for PNM image files.
3377 """
1bd55598 3378 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3379_core_.PNMHandler_swigregister(PNMHandler)
d55e5bfc 3380
5b5c9bc7 3381class XPMHandler(ImageHandler):
27fb7603 3382 """A `wx.ImageHandler` for XPM image."""
1bd55598
RD
3383 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3384 __repr__ = _swig_repr
3385 def __init__(self, *args, **kwargs):
27fb7603
RD
3386 """
3387 __init__(self) -> XPMHandler
3388
3389 A `wx.ImageHandler` for XPM image.
3390 """
1bd55598 3391 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3392_core_.XPMHandler_swigregister(XPMHandler)
d55e5bfc 3393
5b5c9bc7 3394class TIFFHandler(ImageHandler):
27fb7603 3395 """A `wx.ImageHandler` for TIFF image files."""
1bd55598
RD
3396 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3397 __repr__ = _swig_repr
3398 def __init__(self, *args, **kwargs):
27fb7603
RD
3399 """
3400 __init__(self) -> TIFFHandler
3401
3402 A `wx.ImageHandler` for TIFF image files.
3403 """
1bd55598 3404 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3405_core_.TIFFHandler_swigregister(TIFFHandler)
d55e5bfc 3406
5b5c9bc7
RD
3407QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3408QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3409class Quantize(object):
c0de73ae 3410 """Performs quantization, or colour reduction, on a wxImage."""
1bd55598
RD
3411 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3412 def __init__(self): raise AttributeError, "No constructor defined"
3413 __repr__ = _swig_repr
c0de73ae
RD
3414 def Quantize(*args, **kwargs):
3415 """
5b5c9bc7 3416 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3417
3418 Reduce the colours in the source image and put the result into the
3419 destination image, setting the palette in the destination if
3420 needed. Both images may be the same, to overwrite the source image.
3421 """
5b5c9bc7 3422 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae
RD
3423
3424 Quantize = staticmethod(Quantize)
2131d850 3425_core_.Quantize_swigregister(Quantize)
c0de73ae 3426
5b5c9bc7 3427def Quantize_Quantize(*args, **kwargs):
1bd55598 3428 """
5b5c9bc7 3429 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3430
3431 Reduce the colours in the source image and put the result into the
3432 destination image, setting the palette in the destination if
3433 needed. Both images may be the same, to overwrite the source image.
3434 """
1bd55598 3435 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3436
d55e5bfc
RD
3437#---------------------------------------------------------------------------
3438
5b5c9bc7
RD
3439class EvtHandler(Object):
3440 """Proxy of C++ EvtHandler class"""
1bd55598
RD
3441 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3442 __repr__ = _swig_repr
3443 def __init__(self, *args, **kwargs):
5b5c9bc7 3444 """__init__(self) -> EvtHandler"""
1bd55598 3445 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d49bdf34
RD
3446 self._setOORInfo(self)
3447
d55e5bfc 3448 def GetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3449 """GetNextHandler(self) -> EvtHandler"""
3450 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
d55e5bfc
RD
3451
3452 def GetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3453 """GetPreviousHandler(self) -> EvtHandler"""
3454 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3455
3456 def SetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3457 """SetNextHandler(self, EvtHandler handler)"""
3458 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
d55e5bfc
RD
3459
3460 def SetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3461 """SetPreviousHandler(self, EvtHandler handler)"""
3462 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3463
3464 def GetEvtHandlerEnabled(*args, **kwargs):
3465 """GetEvtHandlerEnabled(self) -> bool"""
5b5c9bc7 3466 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3467
3468 def SetEvtHandlerEnabled(*args, **kwargs):
3469 """SetEvtHandlerEnabled(self, bool enabled)"""
5b5c9bc7 3470 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3471
3472 def ProcessEvent(*args, **kwargs):
5b5c9bc7
RD
3473 """ProcessEvent(self, Event event) -> bool"""
3474 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
d55e5bfc
RD
3475
3476 def AddPendingEvent(*args, **kwargs):
5b5c9bc7
RD
3477 """AddPendingEvent(self, Event event)"""
3478 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
d55e5bfc
RD
3479
3480 def ProcessPendingEvents(*args, **kwargs):
3481 """ProcessPendingEvents(self)"""
5b5c9bc7 3482 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
d55e5bfc 3483
b39fe951
RD
3484 def AllowReentrance(*args, **kwargs):
3485 """AllowReentrance(self, bool allow=True)"""
3486 return _core_.EvtHandler_AllowReentrance(*args, **kwargs)
3487
3488 def IsReentranceAllowed(*args, **kwargs):
3489 """IsReentranceAllowed(self) -> bool"""
3490 return _core_.EvtHandler_IsReentranceAllowed(*args, **kwargs)
3491
3492 def IsEventHandlingInProgress(*args, **kwargs):
3493 """IsEventHandlingInProgress(self) -> bool"""
3494 return _core_.EvtHandler_IsEventHandlingInProgress(*args, **kwargs)
3495
d55e5bfc
RD
3496 def Connect(*args, **kwargs):
3497 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
5b5c9bc7 3498 return _core_.EvtHandler_Connect(*args, **kwargs)
d55e5bfc
RD
3499
3500 def Disconnect(*args, **kwargs):
2131d850 3501 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
5b5c9bc7 3502 return _core_.EvtHandler_Disconnect(*args, **kwargs)
d55e5bfc
RD
3503
3504 def _setOORInfo(*args, **kwargs):
36ed4f51 3505 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3506 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3507 args[0].thisown = 0
3508 return val
d55e5bfc
RD
3509
3510 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3511 """
3512 Bind an event to an event handler.
3513
a5ee0656
RD
3514 :param event: One of the EVT_* objects that specifies the
3515 type of event to bind,
d55e5bfc 3516
a5ee0656
RD
3517 :param handler: A callable object to be invoked when the
3518 event is delivered to self. Pass None to
3519 disconnect an event handler.
d55e5bfc 3520
a5ee0656
RD
3521 :param source: Sometimes the event originates from a
3522 different window than self, but you still
3523 want to catch it in self. (For example, a
3524 button event delivered to a frame.) By
3525 passing the source of the event, the event
3526 handling system is able to differentiate
3527 between the same event type from different
3528 controls.
d55e5bfc 3529
a5ee0656
RD
3530 :param id: Used to spcify the event source by ID instead
3531 of instance.
3532
3533 :param id2: Used when it is desirable to bind a handler
3534 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3535 """
3536 if source is not None:
3537 id = source.GetId()
3538 event.Bind(self, id, id2, handler)
3539
d6c14a4c
RD
3540 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3541 """
3542 Disconencts the event handler binding for event from self.
3543 Returns True if successful.
3544 """
3545 if source is not None:
3546 id = source.GetId()
3547 return event.Unbind(self, id, id2)
d55e5bfc 3548
ac5d357a
RD
3549 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3550 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3551 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
2131d850 3552_core_.EvtHandler_swigregister(EvtHandler)
d55e5bfc
RD
3553
3554#---------------------------------------------------------------------------
3555
3556class PyEventBinder(object):
3557 """
3558 Instances of this class are used to bind specific events to event
3559 handlers.
3560 """
3561 def __init__(self, evtType, expectedIDs=0):
3562 if expectedIDs not in [0, 1, 2]:
3563 raise ValueError, "Invalid number of expectedIDs"
3564 self.expectedIDs = expectedIDs
3565
3566 if type(evtType) == list or type(evtType) == tuple:
3567 self.evtType = evtType
3568 else:
3569 self.evtType = [evtType]
3570
3571
3572 def Bind(self, target, id1, id2, function):
3573 """Bind this set of event types to target."""
3574 for et in self.evtType:
3575 target.Connect(id1, id2, et, function)
3576
d6c14a4c
RD
3577
3578 def Unbind(self, target, id1, id2):
3579 """Remove an event binding."""
3580 success = 0
3581 for et in self.evtType:
3582 success += target.Disconnect(id1, id2, et)
3583 return success != 0
3584
d55e5bfc
RD
3585
3586 def __call__(self, *args):
3587 """
3588 For backwards compatibility with the old EVT_* functions.
3589 Should be called with either (window, func), (window, ID,
3590 func) or (window, ID1, ID2, func) parameters depending on the
3591 type of the event.
3592 """
3593 assert len(args) == 2 + self.expectedIDs
3594 id1 = wx.ID_ANY
3595 id2 = wx.ID_ANY
3596 target = args[0]
3597 if self.expectedIDs == 0:
3598 func = args[1]
3599 elif self.expectedIDs == 1:
3600 id1 = args[1]
3601 func = args[2]
3602 elif self.expectedIDs == 2:
3603 id1 = args[1]
3604 id2 = args[2]
3605 func = args[3]
3606 else:
3607 raise ValueError, "Unexpected number of IDs"
3608
3609 self.Bind(target, id1, id2, func)
3610
3611
3612# These two are square pegs that don't fit the PyEventBinder hole...
3613def EVT_COMMAND(win, id, cmd, func):
3614 win.Connect(id, -1, cmd, func)
3615def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3616 win.Connect(id1, id2, cmd, func)
3617
3618
3619#---------------------------------------------------------------------------
3620
3621#---------------------------------------------------------------------------
3622
5b5c9bc7
RD
3623EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3624EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3625
1bd55598 3626def NewEventType(*args):
2131d850 3627 """NewEventType() -> EventType"""
1bd55598 3628 return _core_.NewEventType(*args)
5b5c9bc7
RD
3629wxEVT_NULL = _core_.wxEVT_NULL
3630wxEVT_FIRST = _core_.wxEVT_FIRST
3631wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3632wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3633wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3634wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3635wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3636wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3637wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3638wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3639wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3640wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3641wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3642wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3643wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3644wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3645wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3646wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3647wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3648wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3649wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3650wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3651wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3652wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3653wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3654wxEVT_MOTION = _core_.wxEVT_MOTION
3655wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3656wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3657wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3658wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3659wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3660wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3661wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3662wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3663wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3664wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3665wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3666wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3667wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3668wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3669wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3670wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3671wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3672wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3673wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3674wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3675wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3676wxEVT_CHAR = _core_.wxEVT_CHAR
3677wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3678wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3679wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3680wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3681wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3682wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3683wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3684wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3685wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3686wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3687wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3688wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3689wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3690wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3691wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3692wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
5b5c9bc7
RD
3693wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3694wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3695wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3696wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3697wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3698wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3699wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3700wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3701wxEVT_SIZE = _core_.wxEVT_SIZE
3702wxEVT_MOVE = _core_.wxEVT_MOVE
3703wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3704wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3705wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3706wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
5b5c9bc7
RD
3707wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3708wxEVT_CREATE = _core_.wxEVT_CREATE
3709wxEVT_DESTROY = _core_.wxEVT_DESTROY
3710wxEVT_SHOW = _core_.wxEVT_SHOW
3711wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3712wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3713wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
34e0a3bb 3714wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
5b5c9bc7
RD
3715wxEVT_PAINT = _core_.wxEVT_PAINT
3716wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3717wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3718wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3719wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3720wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3721wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3722wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3723wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3724wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3725wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3726wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3727wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3728wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3729wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3730wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3731wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3732wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3733wxEVT_IDLE = _core_.wxEVT_IDLE
3734wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3735wxEVT_SIZING = _core_.wxEVT_SIZING
3736wxEVT_MOVING = _core_.wxEVT_MOVING
3737wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
3738wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3739wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3740wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
5b5c9bc7
RD
3741wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3742wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3743wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3744wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3745wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3746wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3747wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d55e5bfc
RD
3748#
3749# Create some event binders
3750EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3751EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3752EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3753EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3754EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3755EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3756EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3757EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3758EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3759EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3760EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3761EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3762EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 3763EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d55e5bfc
RD
3764EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3765EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3766EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3767EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3768EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3769EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3770EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3771EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3772EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3773EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 3774EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3775EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3776EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3777EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3778EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3779EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3780EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3781EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3782EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3783EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3784EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3785EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3786EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3787EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3788EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3789EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3790EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
34e0a3bb 3791EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
d55e5bfc
RD
3792
3793EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3794EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3795EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3796EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3797EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3798EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3799EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3800EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3801EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3802EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3803EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3804EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3805EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3806
3807EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3808 wxEVT_LEFT_UP,
3809 wxEVT_MIDDLE_DOWN,
3810 wxEVT_MIDDLE_UP,
3811 wxEVT_RIGHT_DOWN,
3812 wxEVT_RIGHT_UP,
3813 wxEVT_MOTION,
3814 wxEVT_LEFT_DCLICK,
3815 wxEVT_MIDDLE_DCLICK,
3816 wxEVT_RIGHT_DCLICK,
3817 wxEVT_ENTER_WINDOW,
3818 wxEVT_LEAVE_WINDOW,
3819 wxEVT_MOUSEWHEEL
3820 ])
3821
3822
3823# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 3824EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d55e5bfc
RD
3825 wxEVT_SCROLLWIN_BOTTOM,
3826 wxEVT_SCROLLWIN_LINEUP,
3827 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 3828 wxEVT_SCROLLWIN_PAGEUP,
d55e5bfc
RD
3829 wxEVT_SCROLLWIN_PAGEDOWN,
3830 wxEVT_SCROLLWIN_THUMBTRACK,
3831 wxEVT_SCROLLWIN_THUMBRELEASE,
3832 ])
3833
3834EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3835EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3836EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3837EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3838EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3839EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3840EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3841EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3842
27fb7603 3843# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
3844EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3845 wxEVT_SCROLL_BOTTOM,
3846 wxEVT_SCROLL_LINEUP,
3847 wxEVT_SCROLL_LINEDOWN,
3848 wxEVT_SCROLL_PAGEUP,
3849 wxEVT_SCROLL_PAGEDOWN,
3850 wxEVT_SCROLL_THUMBTRACK,
3851 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3852 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3853 ])
3854
3855EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3856EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3857EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3858EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3859EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3860EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3861EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3862EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3863EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3864EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 3865
27fb7603 3866# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
3867EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3868 wxEVT_SCROLL_BOTTOM,
3869 wxEVT_SCROLL_LINEUP,
3870 wxEVT_SCROLL_LINEDOWN,
3871 wxEVT_SCROLL_PAGEUP,
3872 wxEVT_SCROLL_PAGEDOWN,
3873 wxEVT_SCROLL_THUMBTRACK,
d55e5bfc 3874 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3875 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3876 ], 1)
3877
3878EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3879EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3880EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3881EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3882EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3883EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3884EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3885EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3886EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3887EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
3888
3889EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3890EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3891EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3892EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3893EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3894EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3895EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3896EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3897EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3898EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3899
3900EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3901EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3902EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3903EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3904EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3905EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3906EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3907EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3908EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3909
3910
3911EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3912EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3913EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3914EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3915EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3916EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3917EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3918
3919EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3920
3921EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3922EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3923
3924EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3925
2131d850
RD
3926EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3927EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3928EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d55e5bfc
RD
3929
3930
3931#---------------------------------------------------------------------------
3932
5b5c9bc7 3933class Event(Object):
27fb7603
RD
3934 """
3935 An event is a structure holding information about an event passed to a
3936 callback or member function. wx.Event is an abstract base class for
3937 other event classes
3938 """
1bd55598
RD
3939 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3940 def __init__(self): raise AttributeError, "No constructor defined"
3941 __repr__ = _swig_repr
3942 __swig_destroy__ = _core_.delete_Event
3943 __del__ = lambda self : None;
d55e5bfc 3944 def SetEventType(*args, **kwargs):
27fb7603 3945 """
2131d850 3946 SetEventType(self, EventType typ)
27fb7603
RD
3947
3948 Sets the specific type of the event.
3949 """
5b5c9bc7 3950 return _core_.Event_SetEventType(*args, **kwargs)
d55e5bfc
RD
3951
3952 def GetEventType(*args, **kwargs):
27fb7603 3953 """
2131d850 3954 GetEventType(self) -> EventType
27fb7603
RD
3955
3956 Returns the identifier of the given event type, such as
3957 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3958 """
5b5c9bc7 3959 return _core_.Event_GetEventType(*args, **kwargs)
d55e5bfc
RD
3960
3961 def GetEventObject(*args, **kwargs):
27fb7603
RD
3962 """
3963 GetEventObject(self) -> Object
3964
3965 Returns the object (usually a window) associated with the event, if
3966 any.
3967 """
5b5c9bc7 3968 return _core_.Event_GetEventObject(*args, **kwargs)
d55e5bfc
RD
3969
3970 def SetEventObject(*args, **kwargs):
27fb7603
RD
3971 """
3972 SetEventObject(self, Object obj)
3973
3974 Sets the originating object, or in other words, obj is normally the
3975 object that is sending the event.
3976 """
5b5c9bc7 3977 return _core_.Event_SetEventObject(*args, **kwargs)
d55e5bfc
RD
3978
3979 def GetTimestamp(*args, **kwargs):
3980 """GetTimestamp(self) -> long"""
5b5c9bc7 3981 return _core_.Event_GetTimestamp(*args, **kwargs)
d55e5bfc
RD
3982
3983 def SetTimestamp(*args, **kwargs):
3984 """SetTimestamp(self, long ts=0)"""
5b5c9bc7 3985 return _core_.Event_SetTimestamp(*args, **kwargs)
d55e5bfc
RD
3986
3987 def GetId(*args, **kwargs):
27fb7603
RD
3988 """
3989 GetId(self) -> int
3990
3991 Returns the identifier associated with this event, such as a button
3992 command id.
3993 """
5b5c9bc7 3994 return _core_.Event_GetId(*args, **kwargs)
d55e5bfc
RD
3995
3996 def SetId(*args, **kwargs):
27fb7603
RD
3997 """
3998 SetId(self, int Id)
3999
4000 Set's the ID for the event. This is usually the ID of the window that
4001 is sending the event, but it can also be a command id from a menu
4002 item, etc.
4003 """
5b5c9bc7 4004 return _core_.Event_SetId(*args, **kwargs)
d55e5bfc
RD
4005
4006 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
4007 """
4008 IsCommandEvent(self) -> bool
4009
4010 Returns true if the event is or is derived from `wx.CommandEvent` else
4011 it returns false. Note: Exists only for optimization purposes.
4012 """
5b5c9bc7 4013 return _core_.Event_IsCommandEvent(*args, **kwargs)
d55e5bfc
RD
4014
4015 def Skip(*args, **kwargs):
51b83b37
RD
4016 """
4017 Skip(self, bool skip=True)
4018
4019 Called by an event handler, it controls whether additional event
4020 handlers bound to this event will be called after the current event
4021 handler returns. Skip(false) (the default setting) will prevent
4022 additional event handlers from being called and control will be
4023 returned to the sender of the event immediately after the current
4024 handler has finished. Skip(True) will cause the event processing
4025 system to continue searching for a handler function for this event.
4026
4027 """
5b5c9bc7 4028 return _core_.Event_Skip(*args, **kwargs)
d55e5bfc
RD
4029
4030 def GetSkipped(*args, **kwargs):
27fb7603
RD
4031 """
4032 GetSkipped(self) -> bool
4033
4034 Returns true if the event handler should be skipped, false otherwise.
4035 :see: `Skip`
4036 """
5b5c9bc7 4037 return _core_.Event_GetSkipped(*args, **kwargs)
d55e5bfc
RD
4038
4039 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
4040 """
4041 ShouldPropagate(self) -> bool
4042
4043 Test if this event should be propagated to the parent window or not,
4044 i.e. if the propagation level is currently greater than 0.
4045 """
5b5c9bc7 4046 return _core_.Event_ShouldPropagate(*args, **kwargs)
d55e5bfc
RD
4047
4048 def StopPropagation(*args, **kwargs):
27fb7603
RD
4049 """
4050 StopPropagation(self) -> int
4051
4052 Stop the event from propagating to its parent window. Returns the old
4053 propagation level value which may be later passed to
4054 `ResumePropagation` to allow propagating the event again.
4055 """
5b5c9bc7 4056 return _core_.Event_StopPropagation(*args, **kwargs)
d55e5bfc
RD
4057
4058 def ResumePropagation(*args, **kwargs):
27fb7603
RD
4059 """
4060 ResumePropagation(self, int propagationLevel)
4061
4062 Resume the event propagation by restoring the propagation level. (For
4063 example, you can use the value returned by an earlier call to
4064 `StopPropagation`.)
4065
4066 """
5b5c9bc7 4067 return _core_.Event_ResumePropagation(*args, **kwargs)
d55e5bfc
RD
4068
4069 def Clone(*args, **kwargs):
5b5c9bc7
RD
4070 """Clone(self) -> Event"""
4071 return _core_.Event_Clone(*args, **kwargs)
d55e5bfc 4072
ac5d357a
RD
4073 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
4074 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
4075 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
4076 Skipped = property(GetSkipped,doc="See `GetSkipped`")
4077 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
2131d850 4078_core_.Event_swigregister(Event)
d55e5bfc
RD
4079
4080#---------------------------------------------------------------------------
4081
5b5c9bc7 4082class PropagationDisabler(object):
27fb7603
RD
4083 """
4084 Helper class to temporarily change an event not to propagate. Simply
4085 create an instance of this class and then whe it is destroyed the
4086 propogation of the event will be restored.
4087 """
1bd55598
RD
4088 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4089 __repr__ = _swig_repr
4090 def __init__(self, *args, **kwargs):
27fb7603
RD
4091 """
4092 __init__(self, Event event) -> PropagationDisabler
4093
4094 Helper class to temporarily change an event not to propagate. Simply
4095 create an instance of this class and then whe it is destroyed the
4096 propogation of the event will be restored.
4097 """
1bd55598
RD
4098 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
4099 __swig_destroy__ = _core_.delete_PropagationDisabler
4100 __del__ = lambda self : None;
2131d850 4101_core_.PropagationDisabler_swigregister(PropagationDisabler)
d55e5bfc 4102
5b5c9bc7 4103class PropagateOnce(object):
27fb7603
RD
4104 """
4105 A helper class that will temporarily lower propagation level of an
4106 event. Simply create an instance of this class and then whe it is
4107 destroyed the propogation of the event will be restored.
4108 """
1bd55598
RD
4109 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4110 __repr__ = _swig_repr
4111 def __init__(self, *args, **kwargs):
27fb7603
RD
4112 """
4113 __init__(self, Event event) -> PropagateOnce
4114
4115 A helper class that will temporarily lower propagation level of an
4116 event. Simply create an instance of this class and then whe it is
4117 destroyed the propogation of the event will be restored.
4118 """
1bd55598
RD
4119 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4120 __swig_destroy__ = _core_.delete_PropagateOnce
4121 __del__ = lambda self : None;
2131d850 4122_core_.PropagateOnce_swigregister(PropagateOnce)
d55e5bfc
RD
4123
4124#---------------------------------------------------------------------------
4125
5b5c9bc7 4126class CommandEvent(Event):
27fb7603
RD
4127 """
4128 This event class contains information about command events, which
4129 originate from a variety of simple controls, as well as menus and
4130 toolbars.
4131 """
1bd55598
RD
4132 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4133 __repr__ = _swig_repr
4134 def __init__(self, *args, **kwargs):
27fb7603 4135 """
2131d850 4136 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
4137
4138 This event class contains information about command events, which
4139 originate from a variety of simple controls, as well as menus and
4140 toolbars.
4141 """
1bd55598 4142 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
d55e5bfc 4143 def GetSelection(*args, **kwargs):
27fb7603
RD
4144 """
4145 GetSelection(self) -> int
4146
4147 Returns item index for a listbox or choice selection event (not valid
4148 for a deselection).
4149 """
5b5c9bc7 4150 return _core_.CommandEvent_GetSelection(*args, **kwargs)
d55e5bfc
RD
4151
4152 def SetString(*args, **kwargs):
5b5c9bc7
RD
4153 """SetString(self, String s)"""
4154 return _core_.CommandEvent_SetString(*args, **kwargs)
d55e5bfc
RD
4155
4156 def GetString(*args, **kwargs):
27fb7603
RD
4157 """
4158 GetString(self) -> String
4159
4160 Returns item string for a listbox or choice selection event (not valid
4161 for a deselection).
4162 """
5b5c9bc7 4163 return _core_.CommandEvent_GetString(*args, **kwargs)
d55e5bfc
RD
4164
4165 def IsChecked(*args, **kwargs):
27fb7603
RD
4166 """
4167 IsChecked(self) -> bool
4168
4169 This method can be used with checkbox and menu events: for the
4170 checkboxes, the method returns true for a selection event and false
4171 for a deselection one. For the menu events, this method indicates if
4172 the menu item just has become checked or unchecked (and thus only
4173 makes sense for checkable menu items).
4174 """
5b5c9bc7 4175 return _core_.CommandEvent_IsChecked(*args, **kwargs)
d55e5bfc
RD
4176
4177 Checked = IsChecked
4178 def IsSelection(*args, **kwargs):
27fb7603
RD
4179 """
4180 IsSelection(self) -> bool
4181
4182 For a listbox or similar event, returns true if it is a selection,
4183 false if it is a deselection.
4184 """
5b5c9bc7 4185 return _core_.CommandEvent_IsSelection(*args, **kwargs)
d55e5bfc
RD
4186
4187 def SetExtraLong(*args, **kwargs):
4188 """SetExtraLong(self, long extraLong)"""
5b5c9bc7 4189 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
d55e5bfc
RD
4190
4191 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4192 """
4193 GetExtraLong(self) -> long
4194
5ba5649b
RD
4195 Returns extra information dependant on the event objects type. If the
4196 event comes from a listbox selection, it is a boolean determining
4197 whether the event was a selection (true) or a deselection (false). A
4198 listbox deselection only occurs for multiple-selection boxes, and in
4199 this case the index and string values are indeterminate and the
4200 listbox must be examined by the application.
27fb7603 4201 """
5b5c9bc7 4202 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
d55e5bfc
RD
4203
4204 def SetInt(*args, **kwargs):
4205 """SetInt(self, int i)"""
5b5c9bc7 4206 return _core_.CommandEvent_SetInt(*args, **kwargs)
d55e5bfc
RD
4207
4208 def GetInt(*args, **kwargs):
27fb7603 4209 """
2131d850 4210 GetInt(self) -> int
27fb7603 4211
5ba5649b
RD
4212 Returns the integer identifier corresponding to a listbox, choice or
4213 radiobox selection (only if the event was a selection, not a
4214 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4215 """
5b5c9bc7 4216 return _core_.CommandEvent_GetInt(*args, **kwargs)
d55e5bfc 4217
1bd55598
RD
4218 def GetClientData(*args, **kwargs):
4219 """
4220 GetClientData(self) -> PyObject
4221
4222 Returns the client data object for a listbox or choice selection event, (if any.)
4223 """
4224 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4225
4226 def SetClientData(*args, **kwargs):
4227 """
4228 SetClientData(self, PyObject clientData)
4229
4230 Associate the given client data with the item at position n.
4231 """
4232 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4233
4234 GetClientObject = GetClientData
4235 SetClientObject = SetClientData
4236
d55e5bfc 4237 def Clone(*args, **kwargs):
5b5c9bc7
RD
4238 """Clone(self) -> Event"""
4239 return _core_.CommandEvent_Clone(*args, **kwargs)
d55e5bfc 4240
2bf58437
RD
4241 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4242 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4243 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4244 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4245 Selection = property(GetSelection,doc="See `GetSelection`")
4246 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
2131d850 4247_core_.CommandEvent_swigregister(CommandEvent)
d55e5bfc
RD
4248
4249#---------------------------------------------------------------------------
4250
5b5c9bc7 4251class NotifyEvent(CommandEvent):
27fb7603
RD
4252 """
4253 An instance of this class (or one of its derived classes) is sent from
4254 a control when the control's state is being changed and the control
4255 allows that change to be prevented from happening. The event handler
4256 can call `Veto` or `Allow` to tell the control what to do.
4257 """
1bd55598
RD
4258 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4259 __repr__ = _swig_repr
4260 def __init__(self, *args, **kwargs):
27fb7603 4261 """
2131d850 4262 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4263
4264 An instance of this class (or one of its derived classes) is sent from
4265 a control when the control's state is being changed and the control
4266 allows that change to be prevented from happening. The event handler
4267 can call `Veto` or `Allow` to tell the control what to do.
4268 """
1bd55598 4269 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
d55e5bfc 4270 def Veto(*args, **kwargs):
27fb7603
RD
4271 """
4272 Veto(self)
4273
4274 Prevents the change announced by this event from happening.
4275
4276 It is in general a good idea to notify the user about the reasons for
4277 vetoing the change because otherwise the applications behaviour (which
4278 just refuses to do what the user wants) might be quite surprising.
4279 """
5b5c9bc7 4280 return _core_.NotifyEvent_Veto(*args, **kwargs)
d55e5bfc
RD
4281
4282 def Allow(*args, **kwargs):
27fb7603
RD
4283 """
4284 Allow(self)
4285
4286 This is the opposite of `Veto`: it explicitly allows the event to be
4287 processed. For most events it is not necessary to call this method as
4288 the events are allowed anyhow but some are forbidden by default (this
4289 will be mentioned in the corresponding event description).
4290 """
5b5c9bc7 4291 return _core_.NotifyEvent_Allow(*args, **kwargs)
d55e5bfc
RD
4292
4293 def IsAllowed(*args, **kwargs):
27fb7603
RD
4294 """
4295 IsAllowed(self) -> bool
4296
4297 Returns true if the change is allowed (`Veto` hasn't been called) or
4298 false otherwise (if it was).
4299 """
5b5c9bc7 4300 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
d55e5bfc 4301
2131d850 4302_core_.NotifyEvent_swigregister(NotifyEvent)
d55e5bfc
RD
4303
4304#---------------------------------------------------------------------------
4305
5b5c9bc7 4306class ScrollEvent(CommandEvent):
27fb7603
RD
4307 """
4308 A scroll event holds information about events sent from stand-alone
4309 scrollbars and sliders. Note that scrolled windows do not send
4310 instnaces of this event class, but send the `wx.ScrollWinEvent`
4311 instead.
4312 """
1bd55598
RD
4313 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4314 __repr__ = _swig_repr
4315 def __init__(self, *args, **kwargs):
d55e5bfc 4316 """
2131d850 4317 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
5b5c9bc7 4318 int orient=0) -> ScrollEvent
d55e5bfc 4319 """
1bd55598 4320 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
d55e5bfc 4321 def GetOrientation(*args, **kwargs):
27fb7603
RD
4322 """
4323 GetOrientation(self) -> int
4324
4325 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4326 the scrollbar.
4327 """
5b5c9bc7 4328 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4329
4330 def GetPosition(*args, **kwargs):
27fb7603
RD
4331 """
4332 GetPosition(self) -> int
4333
4334 Returns the position of the scrollbar.
4335 """
5b5c9bc7 4336 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4337
4338 def SetOrientation(*args, **kwargs):
4339 """SetOrientation(self, int orient)"""
5b5c9bc7 4340 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4341
4342 def SetPosition(*args, **kwargs):
4343 """SetPosition(self, int pos)"""
5b5c9bc7 4344 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
d55e5bfc 4345
33d6fd3b
RD
4346 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4347 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4348_core_.ScrollEvent_swigregister(ScrollEvent)
d55e5bfc
RD
4349
4350#---------------------------------------------------------------------------
4351
5b5c9bc7 4352class ScrollWinEvent(Event):
27fb7603
RD
4353 """
4354 A wx.ScrollWinEvent holds information about scrolling and is sent from
4355 scrolling windows.
4356 """
1bd55598
RD
4357 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4358 __repr__ = _swig_repr
4359 def __init__(self, *args, **kwargs):
27fb7603 4360 """
2131d850 4361 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4362
4363 A wx.ScrollWinEvent holds information about scrolling and is sent from
4364 scrolling windows.
4365 """
1bd55598 4366 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
d55e5bfc 4367 def GetOrientation(*args, **kwargs):
27fb7603
RD
4368 """
4369 GetOrientation(self) -> int
4370
4371 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4372 the scrollbar.
4373 """
5b5c9bc7 4374 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4375
4376 def GetPosition(*args, **kwargs):
27fb7603
RD
4377 """
4378 GetPosition(self) -> int
4379
4380 Returns the position of the scrollbar for the thumb track and release
4381 events. Note that this field can't be used for the other events, you
4382 need to query the window itself for the current position in that case.
4383 """
5b5c9bc7 4384 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4385
4386 def SetOrientation(*args, **kwargs):
4387 """SetOrientation(self, int orient)"""
5b5c9bc7 4388 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4389
4390 def SetPosition(*args, **kwargs):
4391 """SetPosition(self, int pos)"""
5b5c9bc7 4392 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
d55e5bfc 4393
33d6fd3b
RD
4394 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4395 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4396_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d55e5bfc
RD
4397
4398#---------------------------------------------------------------------------
4399
5b5c9bc7
RD
4400MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4401MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4402MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4403MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4404MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4405class MouseEvent(Event):
27fb7603
RD
4406 """
4407 This event class contains information about the events generated by
4408 the mouse: they include mouse buttons press and release events and
4409 mouse move events.
4410
4411 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4412 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4413 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4414 a middle button so a portable application should avoid relying on the
4415 events from it.
4416
4417 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4418 the former returns true when the event corresponds to the left mouse
4419 button click while the latter returns true if the left mouse button is
4420 currently being pressed. For example, when the user is dragging the
4421 mouse you can use `LeftIsDown` to test whether the left mouse button
4422 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4423 `LeftIsDown` will also return true in wxWidgets whatever the
4424 underlying GUI behaviour is (which is platform-dependent). The same
4425 applies, of course, to other mouse buttons as well.
4426 """
1bd55598
RD
4427 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4428 __repr__ = _swig_repr
4429 def __init__(self, *args, **kwargs):
27fb7603 4430 """
2131d850 4431 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4432
4433 Constructs a wx.MouseEvent. Valid event types are:
4434
4435 * wxEVT_ENTER_WINDOW
4436 * wxEVT_LEAVE_WINDOW
4437 * wxEVT_LEFT_DOWN
4438 * wxEVT_LEFT_UP
4439 * wxEVT_LEFT_DCLICK
4440 * wxEVT_MIDDLE_DOWN
4441 * wxEVT_MIDDLE_UP
4442 * wxEVT_MIDDLE_DCLICK
4443 * wxEVT_RIGHT_DOWN
4444 * wxEVT_RIGHT_UP
4445 * wxEVT_RIGHT_DCLICK
4446 * wxEVT_MOTION
4447 * wxEVT_MOUSEWHEEL
4448 """
1bd55598 4449 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
d55e5bfc 4450 def IsButton(*args, **kwargs):
27fb7603
RD
4451 """
4452 IsButton(self) -> bool
4453
4454 Returns true if the event was a mouse button event (not necessarily a
4455 button down event - that may be tested using `ButtonDown`).
4456 """
5b5c9bc7 4457 return _core_.MouseEvent_IsButton(*args, **kwargs)
d55e5bfc
RD
4458
4459 def ButtonDown(*args, **kwargs):
27fb7603
RD
4460 """
4461 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4462
5ba5649b
RD
4463 If the argument is omitted, this returns true if the event was any
4464 mouse button down event. Otherwise the argument specifies which
4465 button-down event shold be checked for (see `Button` for the possible
4466 values).
27fb7603 4467 """
5b5c9bc7 4468 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
d55e5bfc
RD
4469
4470 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4471 """
4472 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4473
4474 If the argument is omitted, this returns true if the event was any
4475 mouse double click event. Otherwise the argument specifies which
4476 double click event to check for (see `Button` for the possible
4477 values).
4478 """
5b5c9bc7 4479 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
d55e5bfc
RD
4480
4481 def ButtonUp(*args, **kwargs):
27fb7603
RD
4482 """
4483 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4484
4485 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4486 mouse button up event. Otherwise the argument specifies which button
4487 up event to check for (see `Button` for the possible values).
27fb7603 4488 """
5b5c9bc7 4489 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
d55e5bfc
RD
4490
4491 def Button(*args, **kwargs):
27fb7603
RD
4492 """
4493 Button(self, int button) -> bool
4494
4495 Returns true if the identified mouse button is changing state. Valid
4496 values of button are:
4497
4498 ==================== =====================================
4499 wx.MOUSE_BTN_LEFT check if left button was pressed
4500 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4501 wx.MOUSE_BTN_RIGHT check if right button was pressed
4502 wx.MOUSE_BTN_ANY check if any button was pressed
4503 ==================== =====================================
4504
4505 """
5b5c9bc7 4506 return _core_.MouseEvent_Button(*args, **kwargs)
d55e5bfc
RD
4507
4508 def ButtonIsDown(*args, **kwargs):
4509 """ButtonIsDown(self, int but) -> bool"""
5b5c9bc7 4510 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
d55e5bfc
RD
4511
4512 def GetButton(*args, **kwargs):
27fb7603
RD
4513 """
4514 GetButton(self) -> int
4515
4516 Returns the mouse button which generated this event or
4517 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4518 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4519 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4520 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4521 right buttons respectively.
4522 """
5b5c9bc7 4523 return _core_.MouseEvent_GetButton(*args, **kwargs)
d55e5bfc
RD
4524
4525 def ControlDown(*args, **kwargs):
27fb7603
RD
4526 """
4527 ControlDown(self) -> bool
4528
4529 Returns true if the control key was down at the time of the event.
4530 """
5b5c9bc7 4531 return _core_.MouseEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4532
4533 def MetaDown(*args, **kwargs):
27fb7603
RD
4534 """
4535 MetaDown(self) -> bool
4536
4537 Returns true if the Meta key was down at the time of the event.
4538 """
5b5c9bc7 4539 return _core_.MouseEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4540
4541 def AltDown(*args, **kwargs):
27fb7603
RD
4542 """
4543 AltDown(self) -> bool
4544
4545 Returns true if the Alt key was down at the time of the event.
4546 """
5b5c9bc7 4547 return _core_.MouseEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4548
4549 def ShiftDown(*args, **kwargs):
27fb7603
RD
4550 """
4551 ShiftDown(self) -> bool
4552
4553 Returns true if the Shift key was down at the time of the event.
4554 """
5b5c9bc7 4555 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4556
412d302d
RD
4557 def CmdDown(*args, **kwargs):
4558 """
4559 CmdDown(self) -> bool
4560
4561 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4562 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4563 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4564 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4565 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4566 purpose. So for non-Mac platforms this is the same as `ControlDown`
4567 and Macs this is the same as `MetaDown`.
4568 """
5b5c9bc7 4569 return _core_.MouseEvent_CmdDown(*args, **kwargs)
412d302d 4570
d55e5bfc 4571 def LeftDown(*args, **kwargs):
27fb7603
RD
4572 """
4573 LeftDown(self) -> bool
4574
4575 Returns true if the left mouse button state changed to down.
4576 """
5b5c9bc7 4577 return _core_.MouseEvent_LeftDown(*args, **kwargs)
d55e5bfc
RD
4578
4579 def MiddleDown(*args, **kwargs):
27fb7603
RD
4580 """
4581 MiddleDown(self) -> bool
4582
4583 Returns true if the middle mouse button state changed to down.
4584 """
5b5c9bc7 4585 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
d55e5bfc
RD
4586
4587 def RightDown(*args, **kwargs):
27fb7603
RD
4588 """
4589 RightDown(self) -> bool
4590
4591 Returns true if the right mouse button state changed to down.
4592 """
5b5c9bc7 4593 return _core_.MouseEvent_RightDown(*args, **kwargs)
d55e5bfc
RD
4594
4595 def LeftUp(*args, **kwargs):
27fb7603
RD
4596 """
4597 LeftUp(self) -> bool
4598
4599 Returns true if the left mouse button state changed to up.
4600 """
5b5c9bc7 4601 return _core_.MouseEvent_LeftUp(*args, **kwargs)
d55e5bfc
RD
4602
4603 def MiddleUp(*args, **kwargs):
27fb7603
RD
4604 """
4605 MiddleUp(self) -> bool
4606
4607 Returns true if the middle mouse button state changed to up.
4608 """
5b5c9bc7 4609 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
d55e5bfc
RD
4610
4611 def RightUp(*args, **kwargs):
27fb7603
RD
4612 """
4613 RightUp(self) -> bool
4614
4615 Returns true if the right mouse button state changed to up.
4616 """
5b5c9bc7 4617 return _core_.MouseEvent_RightUp(*args, **kwargs)
d55e5bfc
RD
4618
4619 def LeftDClick(*args, **kwargs):
27fb7603
RD
4620 """
4621 LeftDClick(self) -> bool
4622
4623 Returns true if the event was a left button double click.
4624 """
5b5c9bc7 4625 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
d55e5bfc
RD
4626
4627 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4628 """
4629 MiddleDClick(self) -> bool
4630
4631 Returns true if the event was a middle button double click.
4632 """
5b5c9bc7 4633 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
d55e5bfc
RD
4634
4635 def RightDClick(*args, **kwargs):
27fb7603
RD
4636 """
4637 RightDClick(self) -> bool
4638
4639 Returns true if the event was a right button double click.
4640 """
5b5c9bc7 4641 return _core_.MouseEvent_RightDClick(*args, **kwargs)
d55e5bfc
RD
4642
4643 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4644 """
4645 LeftIsDown(self) -> bool
4646
4647 Returns true if the left mouse button is currently down, independent
4648 of the current event type.
4649
4650 Please notice that it is not the same as LeftDown which returns true
4651 if the left mouse button was just pressed. Rather, it describes the
4652 state of the mouse button before the event happened.
4653
4654 This event is usually used in the mouse event handlers which process
4655 "move mouse" messages to determine whether the user is (still)
4656 dragging the mouse.
4657 """
5b5c9bc7 4658 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
d55e5bfc
RD
4659
4660 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4661 """
4662 MiddleIsDown(self) -> bool
4663
4664 Returns true if the middle mouse button is currently down, independent
4665 of the current event type.
4666 """
5b5c9bc7 4667 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
d55e5bfc
RD
4668
4669 def RightIsDown(*args, **kwargs):
27fb7603
RD
4670 """
4671 RightIsDown(self) -> bool
4672
4673 Returns true if the right mouse button is currently down, independent
4674 of the current event type.
4675 """
5b5c9bc7 4676 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
d55e5bfc
RD
4677
4678 def Dragging(*args, **kwargs):
27fb7603
RD
4679 """
4680 Dragging(self) -> bool
4681
4682 Returns true if this was a dragging event (motion while a button is
4683 depressed).
4684 """
5b5c9bc7 4685 return _core_.MouseEvent_Dragging(*args, **kwargs)
d55e5bfc
RD
4686
4687 def Moving(*args, **kwargs):
27fb7603
RD
4688 """
4689 Moving(self) -> bool
4690
4691 Returns true if this was a motion event and no mouse buttons were
4692 pressed. If any mouse button is held pressed, then this method returns
4693 false and Dragging returns true.
4694 """
5b5c9bc7 4695 return _core_.MouseEvent_Moving(*args, **kwargs)
d55e5bfc
RD
4696
4697 def Entering(*args, **kwargs):
27fb7603
RD
4698 """
4699 Entering(self) -> bool
4700
4701 Returns true if the mouse was entering the window.
4702 """
5b5c9bc7 4703 return _core_.MouseEvent_Entering(*args, **kwargs)
d55e5bfc
RD
4704
4705 def Leaving(*args, **kwargs):
27fb7603
RD
4706 """
4707 Leaving(self) -> bool
4708
4709 Returns true if the mouse was leaving the window.
4710 """
5b5c9bc7 4711 return _core_.MouseEvent_Leaving(*args, **kwargs)
d55e5bfc
RD
4712
4713 def GetPosition(*args, **kwargs):
4714 """
5b5c9bc7 4715 GetPosition(self) -> Point
d55e5bfc 4716
27fb7603
RD
4717 Returns the pixel position of the mouse in window coordinates when the
4718 event happened.
d55e5bfc 4719 """
5b5c9bc7 4720 return _core_.MouseEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4721
4722 def GetPositionTuple(*args, **kwargs):
4723 """
4724 GetPositionTuple() -> (x,y)
4725
27fb7603
RD
4726 Returns the pixel position of the mouse in window coordinates when the
4727 event happened.
d55e5bfc 4728 """
5b5c9bc7 4729 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4730
4731 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4732 """
4733 GetLogicalPosition(self, DC dc) -> Point
4734
4735 Returns the logical mouse position in pixels (i.e. translated
4736 according to the translation set for the DC, which usually indicates
4737 that the window has been scrolled).
4738 """
5b5c9bc7 4739 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
d55e5bfc
RD
4740
4741 def GetX(*args, **kwargs):
27fb7603
RD
4742 """
4743 GetX(self) -> int
4744
4745 Returns X coordinate of the physical mouse event position.
4746 """
5b5c9bc7 4747 return _core_.MouseEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4748
4749 def GetY(*args, **kwargs):
27fb7603
RD
4750 """
4751 GetY(self) -> int
4752
4753 Returns Y coordinate of the physical mouse event position.
4754 """
5b5c9bc7 4755 return _core_.MouseEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4756
4757 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4758 """
4759 GetWheelRotation(self) -> int
4760
4761 Get wheel rotation, positive or negative indicates direction of
4762 rotation. Current devices all send an event when rotation is equal to
4763 +/-WheelDelta, but this allows for finer resolution devices to be
4764 created in the future. Because of this you shouldn't assume that one
4765 event is equal to 1 line or whatever, but you should be able to either
4766 do partial line scrolling or wait until +/-WheelDelta rotation values
4767 have been accumulated before scrolling.
4768 """
5b5c9bc7 4769 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
d55e5bfc
RD
4770
4771 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4772 """
4773 GetWheelDelta(self) -> int
4774
4775 Get wheel delta, normally 120. This is the threshold for action to be
4776 taken, and one such action (for example, scrolling one increment)
4777 should occur for each delta.
4778 """
5b5c9bc7 4779 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
d55e5bfc
RD
4780
4781 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4782 """
4783 GetLinesPerAction(self) -> int
4784
4785 Returns the configured number of lines (or whatever) to be scrolled
4786 per wheel action. Defaults to three.
4787 """
5b5c9bc7 4788 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
d55e5bfc
RD
4789
4790 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4791 """
4792 IsPageScroll(self) -> bool
4793
4794 Returns true if the system has been setup to do page scrolling with
4795 the mouse wheel instead of line scrolling.
4796 """
5b5c9bc7
RD
4797 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4798
4799 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4800 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4801 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4802 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4803 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4804 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4805 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4806 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4807 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4808 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4809 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4810 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
57332a5a
RD
4811 Button = property(GetButton,doc="See `GetButton`")
4812 LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`")
4813 LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`")
4814 Position = property(GetPosition,doc="See `GetPosition`")
4815 WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`")
4816 WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`")
4817 X = property(GetX,doc="See `GetX`")
4818 Y = property(GetY,doc="See `GetY`")
2131d850 4819_core_.MouseEvent_swigregister(MouseEvent)
d55e5bfc
RD
4820
4821#---------------------------------------------------------------------------
4822
5b5c9bc7 4823class SetCursorEvent(Event):
5ba5649b
RD
4824 """
4825 A SetCursorEvent is generated when the mouse cursor is about to be set
4826 as a result of mouse motion. This event gives the application the
4827 chance to perform specific mouse cursor processing based on the
4828 current position of the mouse within the window. Use the `SetCursor`
4829 method to specify the cursor you want to be displayed.
4830 """
1bd55598
RD
4831 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4832 __repr__ = _swig_repr
4833 def __init__(self, *args, **kwargs):
5ba5649b
RD
4834 """
4835 __init__(self, int x=0, int y=0) -> SetCursorEvent
4836
4837 Construct a new `wx.SetCursorEvent`.
4838 """
1bd55598 4839 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
d55e5bfc 4840 def GetX(*args, **kwargs):
5ba5649b
RD
4841 """
4842 GetX(self) -> int
4843
4844 Returns the X coordinate of the mouse in client coordinates.
4845 """
5b5c9bc7 4846 return _core_.SetCursorEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4847
4848 def GetY(*args, **kwargs):
5ba5649b
RD
4849 """
4850 GetY(self) -> int
4851
4852 Returns the Y coordinate of the mouse in client coordinates.
4853 """
5b5c9bc7 4854 return _core_.SetCursorEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4855
4856 def SetCursor(*args, **kwargs):
5ba5649b
RD
4857 """
4858 SetCursor(self, Cursor cursor)
4859
4860 Sets the cursor associated with this event.
4861 """
5b5c9bc7 4862 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
d55e5bfc
RD
4863
4864 def GetCursor(*args, **kwargs):
5ba5649b
RD
4865 """
4866 GetCursor(self) -> Cursor
4867
4868 Returns a reference to the cursor specified by this event.
4869 """
5b5c9bc7 4870 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
d55e5bfc
RD
4871
4872 def HasCursor(*args, **kwargs):
5ba5649b
RD
4873 """
4874 HasCursor(self) -> bool
4875
4876 Returns true if the cursor specified by this event is a valid cursor.
4877 """
5b5c9bc7 4878 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
d55e5bfc 4879
33d6fd3b
RD
4880 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
4881 X = property(GetX,doc="See `GetX`")
4882 Y = property(GetY,doc="See `GetY`")
2131d850 4883_core_.SetCursorEvent_swigregister(SetCursorEvent)
d55e5bfc
RD
4884
4885#---------------------------------------------------------------------------
4886
5b5c9bc7 4887class KeyEvent(Event):
5ba5649b
RD
4888 """
4889 This event class contains information about keypress and character
4890 events. These events are only sent to the widget that currently has
4891 the keyboard focus.
4892
4893 Notice that there are three different kinds of keyboard events in
4894 wxWidgets: key down and up events and char events. The difference
4895 between the first two is clear - the first corresponds to a key press
4896 and the second to a key release - otherwise they are identical. Just
4897 note that if the key is maintained in a pressed state you will
4898 typically get a lot of (automatically generated) down events but only
4899 one up so it is wrong to assume that there is one up event
4900 corresponding to each down one.
4901
4902 Both key events provide untranslated key codes while the char event
4903 carries the translated one. The untranslated code for alphanumeric
4904 keys is always an upper case value. For the other keys it is one of
4905 WXK_XXX values from the keycodes table. The translated key is, in
4906 general, the character the user expects to appear as the result of the
4907 key combination when typing the text into a text entry zone, for
4908 example.
4909
4910 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4911 and the standard US keyboard): when the 'A' key is pressed, the key
4912 down event key code is equal to ASCII A == 65. But the char event key
4913 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4914 'A' keys simultaneously , the key code in key down event will still be
4915 just 'A' while the char event key code parameter will now be 'A' as
4916 well.
4917
4918 Although in this simple case it is clear that the correct key code
4919 could be found in the key down event handler by checking the value
4920 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4921 as for non alphanumeric keys or non-US keyboard layouts the
4922 translation is keyboard-layout dependent and can only be done properly
4923 by the system itself.
4924
4925 Another kind of translation is done when the control key is pressed:
4926 for example, for CTRL-A key press the key down event still carries the
4927 same key code 'A' as usual but the char event will have key code of 1,
4928 the ASCII value of this key combination.
4929
4930 You may discover how the other keys on your system behave
4931 interactively by running the KeyEvents sample in the wxPython demo and
4932 pressing some keys while the blue box at the top has the keyboard
4933 focus.
4934
4935 **Note**: If a key down event is caught and the event handler does not
4936 call event.Skip() then the coresponding char event will not
4937 happen. This is by design and enables the programs that handle both
4938 types of events to be a bit simpler.
4939
4940 **Note for Windows programmers**: The key and char events in wxWidgets
4941 are similar to but slightly different from Windows WM_KEYDOWN and
4942 WM_CHAR events. In particular, Alt-x combination will generate a char
4943 event in wxWidgets (unless it is used as an accelerator).
4944
4945 **Tip**: be sure to call event.Skip() for events that you don't
4946 process in key event function, otherwise menu shortcuts may cease to
4947 work under Windows.
4948
4949 """
1bd55598
RD
4950 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4951 __repr__ = _swig_repr
4952 def __init__(self, *args, **kwargs):
5ba5649b 4953 """
2131d850 4954 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
4955
4956 Construct a new `wx.KeyEvent`. Valid event types are:
4957 *
4958 """
1bd55598 4959 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
4960 def GetModifiers(*args, **kwargs):
4961 """
4962 GetModifiers(self) -> int
4963
4964 Returns a bitmask of the current modifier settings. Can be used to
4965 check if the key event has exactly the given modifiers without having
4966 to explicitly check that the other modifiers are not down. For
4967 example::
4968
4969 if event.GetModifers() == wx.MOD_CONTROL:
4970 DoSomething()
4971
4972 """
4973 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4974
d55e5bfc 4975 def ControlDown(*args, **kwargs):
5ba5649b
RD
4976 """
4977 ControlDown(self) -> bool
4978
4979 Returns ``True`` if the Control key was down at the time of the event.
4980 """
5b5c9bc7 4981 return _core_.KeyEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4982
4983 def MetaDown(*args, **kwargs):
5ba5649b
RD
4984 """
4985 MetaDown(self) -> bool
4986
4987 Returns ``True`` if the Meta key was down at the time of the event.
4988 """
5b5c9bc7 4989 return _core_.KeyEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4990
4991 def AltDown(*args, **kwargs):
5ba5649b
RD
4992 """
4993 AltDown(self) -> bool
4994
4995 Returns ``True`` if the Alt key was down at the time of the event.
4996 """
5b5c9bc7 4997 return _core_.KeyEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4998
4999 def ShiftDown(*args, **kwargs):
5ba5649b
RD
5000 """
5001 ShiftDown(self) -> bool
5002
5003 Returns ``True`` if the Shift key was down at the time of the event.
5004 """
5b5c9bc7 5005 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
d55e5bfc 5006
412d302d
RD
5007 def CmdDown(*args, **kwargs):
5008 """
5009 CmdDown(self) -> bool
5010
5011 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5012 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 5013 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
5014 because Cmd key is used for the same thing under Mac as Ctrl
5015 elsewhere. The Ctrl still exists, it's just not used for this
5016 purpose. So for non-Mac platforms this is the same as `ControlDown`
5017 and Macs this is the same as `MetaDown`.
5018 """
5b5c9bc7 5019 return _core_.KeyEvent_CmdDown(*args, **kwargs)
412d302d 5020
d55e5bfc 5021 def HasModifiers(*args, **kwargs):
5ba5649b
RD
5022 """
5023 HasModifiers(self) -> bool
5024
5025 Returns true if either CTRL or ALT keys was down at the time of the
5026 key event. Note that this function does not take into account neither
5027 SHIFT nor META key states (the reason for ignoring the latter is that
5028 it is common for NUMLOCK key to be configured as META under X but the
5029 key presses even while NUMLOCK is on should be still processed
5030 normally).
5031 """
5b5c9bc7 5032 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
d55e5bfc
RD
5033
5034 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
5035 """
5036 GetKeyCode(self) -> int
5037
5038 Returns the virtual key code. ASCII events return normal ASCII values,
5039 while non-ASCII events return values such as WXK_LEFT for the left
5040 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5041 codes.
5042
5043 Note that in Unicode build, the returned value is meaningful only if
5044 the user entered a character that can be represented in current
5045 locale's default charset. You can obtain the corresponding Unicode
5046 character using `GetUnicodeKey`.
5047 """
5b5c9bc7 5048 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
d55e5bfc 5049
bb4524c4 5050 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
5051 """
5052 GetUnicodeKey(self) -> int
5053
5054 Returns the Unicode character corresponding to this key event. This
5055 function is only meaningfule in a Unicode build of wxPython.
5056 """
5b5c9bc7 5057 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 5058
bb4524c4 5059 GetUniChar = GetUnicodeKey
b850e7f3
RD
5060 def SetUnicodeKey(*args, **kwargs):
5061 """
5062 SetUnicodeKey(self, int uniChar)
5063
5064 Set the Unicode value of the key event, but only if this is a Unicode
5065 build of wxPython.
5066 """
5067 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
5068
d55e5bfc 5069 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
5070 """
5071 GetRawKeyCode(self) -> unsigned int
5072
5073 Returns the raw key code for this event. This is a platform-dependent
5074 scan code which should only be used in advanced
5075 applications. Currently the raw key codes are not supported by all
5076 ports.
5077 """
5b5c9bc7 5078 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
d55e5bfc
RD
5079
5080 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
5081 """
5082 GetRawKeyFlags(self) -> unsigned int
5083
5084 Returns the low level key flags for this event. The flags are
5085 platform-dependent and should only be used in advanced applications.
5086 Currently the raw key flags are not supported by all ports.
5087 """
5b5c9bc7 5088 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
d55e5bfc
RD
5089
5090 def GetPosition(*args, **kwargs):
5091 """
5b5c9bc7 5092 GetPosition(self) -> Point
d55e5bfc 5093
5ba5649b 5094 Find the position of the event, if applicable.
d55e5bfc 5095 """
5b5c9bc7 5096 return _core_.KeyEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5097
5098 def GetPositionTuple(*args, **kwargs):
5099 """
5100 GetPositionTuple() -> (x,y)
5101
5ba5649b 5102 Find the position of the event, if applicable.
d55e5bfc 5103 """
5b5c9bc7 5104 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
5105
5106 def GetX(*args, **kwargs):
5ba5649b
RD
5107 """
5108 GetX(self) -> int
5109
5110 Returns the X position (in client coordinates) of the event, if
5111 applicable.
5112 """
5b5c9bc7 5113 return _core_.KeyEvent_GetX(*args, **kwargs)
d55e5bfc
RD
5114
5115 def GetY(*args, **kwargs):
5ba5649b
RD
5116 """
5117 GetY(self) -> int
5118
5119 Returns the Y position (in client coordinates) of the event, if
5120 applicable.
5121 """
5b5c9bc7
RD
5122 return _core_.KeyEvent_GetY(*args, **kwargs)
5123
5124 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5125 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5126 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5127 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5128 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5129 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5130 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5131 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5132 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5133 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
ac5d357a
RD
5134 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5135 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5136 Position = property(GetPosition,doc="See `GetPosition`")
5137 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5138 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5139 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5140 X = property(GetX,doc="See `GetX`")
5141 Y = property(GetY,doc="See `GetY`")
2131d850 5142_core_.KeyEvent_swigregister(KeyEvent)
d55e5bfc
RD
5143
5144#---------------------------------------------------------------------------
5145
5b5c9bc7 5146class SizeEvent(Event):
5ba5649b
RD
5147 """
5148 A size event holds information about size change events. The EVT_SIZE
5149 handler function will be called when the window it is bound to has
5150 been resized.
5151
5152 Note that the size passed is of the whole window: call
5153 `wx.Window.GetClientSize` for the area which may be used by the
5154 application.
5155
5156 When a window is resized, usually only a small part of the window is
5157 damaged and and that area is all that is in the update region for the
5158 next paint event. However, if your drawing depends on the size of the
5159 window, you may need to clear the DC explicitly and repaint the whole
5160 window. In which case, you may need to call `wx.Window.Refresh` to
5161 invalidate the entire window.
5162
5163 """
1bd55598
RD
5164 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5165 __repr__ = _swig_repr
5166 def __init__(self, *args, **kwargs):
5ba5649b
RD
5167 """
5168 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5169
5170 Construct a new ``wx.SizeEvent``.
5171 """
1bd55598 5172 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
d55e5bfc 5173 def GetSize(*args, **kwargs):
5ba5649b
RD
5174 """
5175 GetSize(self) -> Size
5176
5177 Returns the entire size of the window generating the size change
5178 event.
5179 """
5b5c9bc7 5180 return _core_.SizeEvent_GetSize(*args, **kwargs)
d55e5bfc
RD
5181
5182 def GetRect(*args, **kwargs):
5b5c9bc7
RD
5183 """GetRect(self) -> Rect"""
5184 return _core_.SizeEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
5185
5186 def SetRect(*args, **kwargs):
5b5c9bc7
RD
5187 """SetRect(self, Rect rect)"""
5188 return _core_.SizeEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
5189
5190 def SetSize(*args, **kwargs):
5b5c9bc7
RD
5191 """SetSize(self, Size size)"""
5192 return _core_.SizeEvent_SetSize(*args, **kwargs)
d55e5bfc 5193
5b5c9bc7
RD
5194 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5195 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
33d6fd3b
RD
5196 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5197 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
2131d850 5198_core_.SizeEvent_swigregister(SizeEvent)
d55e5bfc
RD
5199
5200#---------------------------------------------------------------------------
5201
5b5c9bc7 5202class MoveEvent(Event):
5ba5649b
RD
5203 """
5204 This event object is sent for EVT_MOVE event bindings when a window is
5205 moved to a new position.
5206 """
1bd55598
RD
5207 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5208 __repr__ = _swig_repr
5209 def __init__(self, *args, **kwargs):
5ba5649b
RD
5210 """
5211 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5212
5213 Constructor.
5214 """
1bd55598 5215 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
d55e5bfc 5216 def GetPosition(*args, **kwargs):
5ba5649b
RD
5217 """
5218 GetPosition(self) -> Point
5219
5220 Returns the position of the window generating the move change event.
5221 """
5b5c9bc7 5222 return _core_.MoveEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5223
5224 def GetRect(*args, **kwargs):
5b5c9bc7
RD
5225 """GetRect(self) -> Rect"""
5226 return _core_.MoveEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
5227
5228 def SetRect(*args, **kwargs):
5b5c9bc7
RD
5229 """SetRect(self, Rect rect)"""
5230 return _core_.MoveEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
5231
5232 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
5233 """SetPosition(self, Point pos)"""
5234 return _core_.MoveEvent_SetPosition(*args, **kwargs)
d55e5bfc 5235
fef4c27a
RD
5236 m_pos = property(GetPosition, SetPosition)
5237 m_rect = property(GetRect, SetRect)
5238
57332a5a
RD
5239 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
5240 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
2131d850 5241_core_.MoveEvent_swigregister(MoveEvent)
d55e5bfc
RD
5242
5243#---------------------------------------------------------------------------
5244
5b5c9bc7 5245class PaintEvent(Event):
5ba5649b
RD
5246 """
5247 A paint event is sent when a window's contents needs to be repainted.
5248 Note that in an EVT_PAINT handler the application must *always* create
5249 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5250 Windows assumes that the window has not been painted yet and will send
5251 the event again, causing endless refreshes.
5252
5253 You can optimize painting by retrieving the rectangles that have been
5254 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5255 and only repainting these rectangles. The rectangles are in terms of
5256 the client area, and are unscrolled, so you will need to do some
5257 calculations using the current view position to obtain logical,
5258 scrolled units.
5259
5260 """
1bd55598
RD
5261 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5262 __repr__ = _swig_repr
5263 def __init__(self, *args, **kwargs):
5b5c9bc7 5264 """__init__(self, int Id=0) -> PaintEvent"""
1bd55598 5265 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5266_core_.PaintEvent_swigregister(PaintEvent)
d55e5bfc 5267
5b5c9bc7
RD
5268class NcPaintEvent(Event):
5269 """Proxy of C++ NcPaintEvent class"""
1bd55598
RD
5270 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5271 __repr__ = _swig_repr
5272 def __init__(self, *args, **kwargs):
5b5c9bc7 5273 """__init__(self, int winid=0) -> NcPaintEvent"""
1bd55598 5274 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5275_core_.NcPaintEvent_swigregister(NcPaintEvent)
d55e5bfc
RD
5276
5277#---------------------------------------------------------------------------
5278
5b5c9bc7 5279class EraseEvent(Event):
5ba5649b
RD
5280 """
5281 An erase event is sent whenever the background of a window needs to be
5282 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5283 binder. On some platforms, such as GTK+, this event is simulated
5284 (simply generated just before the paint event) and may cause flicker.
5285
5286 To paint a custom background use the `GetDC` method and use the returned
5287 device context if it is not ``None``, otherwise create a temporary
5288 `wx.ClientDC` and draw on that.
5289
5290 """
1bd55598
RD
5291 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5292 __repr__ = _swig_repr
5293 def __init__(self, *args, **kwargs):
5ba5649b
RD
5294 """
5295 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5296
5297 Constructor
5298 """
1bd55598 5299 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
d55e5bfc 5300 def GetDC(*args, **kwargs):
5ba5649b
RD
5301 """
5302 GetDC(self) -> DC
5303
5304 Returns the device context the event handler should draw upon. If
5305 ``None`` is returned then create a temporary `wx.ClientDC` and use
5306 that instead.
5307 """
5b5c9bc7 5308 return _core_.EraseEvent_GetDC(*args, **kwargs)
d55e5bfc 5309
ac5d357a 5310 DC = property(GetDC,doc="See `GetDC`")
2131d850 5311_core_.EraseEvent_swigregister(EraseEvent)
d55e5bfc
RD
5312
5313#---------------------------------------------------------------------------
5314
5b5c9bc7 5315class FocusEvent(Event):
5ba5649b
RD
5316 """
5317 A focus event is sent when a window's focus changes. The window losing
5318 focus receives an EVT_KILL_FOCUS event while the window gaining it
5319 gets an EVT_SET_FOCUS event.
5320
5321 Notice that the set focus event happens both when the user gives focus
5322 to the window (whether using the mouse or keyboard) and when it is
5323 done from the program itself using `wx.Window.SetFocus`.
5324
5325 """
1bd55598
RD
5326 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5327 __repr__ = _swig_repr
5328 def __init__(self, *args, **kwargs):
5ba5649b 5329 """
2131d850 5330 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5331
5332 Constructor
5333 """
1bd55598 5334 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
d55e5bfc 5335 def GetWindow(*args, **kwargs):
5ba5649b
RD
5336 """
5337 GetWindow(self) -> Window
5338
5339 Returns the other window associated with this event, that is the
5340 window which had the focus before for the EVT_SET_FOCUS event and the
5341 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5342
5343 Warning: the window returned may be None!
5344 """
5b5c9bc7 5345 return _core_.FocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
5346
5347 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
5348 """SetWindow(self, Window win)"""
5349 return _core_.FocusEvent_SetWindow(*args, **kwargs)
d55e5bfc 5350
ac5d357a 5351 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 5352_core_.FocusEvent_swigregister(FocusEvent)
d55e5bfc
RD
5353
5354#---------------------------------------------------------------------------
5355
5b5c9bc7 5356class ChildFocusEvent(CommandEvent):
5ba5649b 5357 """
33d6fd3b
RD
5358 A child focus event is sent to a (parent-)window when one of its child
5359 windows gains focus, so that the window could restore the focus back
5360 to its corresponding child if it loses it now and regains later.
5361
5362 Notice that child window is the direct child of the window receiving
5363 the event, and so may not be the actual widget recieving focus if it
5364 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5365 to get the widget that is actually receiving focus.
5ba5649b 5366 """
1bd55598
RD
5367 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5368 __repr__ = _swig_repr
5369 def __init__(self, *args, **kwargs):
5ba5649b
RD
5370 """
5371 __init__(self, Window win=None) -> ChildFocusEvent
5372
5373 Constructor
5374 """
1bd55598 5375 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
d55e5bfc 5376 def GetWindow(*args, **kwargs):
5ba5649b
RD
5377 """
5378 GetWindow(self) -> Window
5379
33d6fd3b
RD
5380 The window, or (grand)parent of the window which has just received the
5381 focus.
5ba5649b 5382 """
5b5c9bc7 5383 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
d55e5bfc 5384
2bf58437 5385 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 5386_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d55e5bfc
RD
5387
5388#---------------------------------------------------------------------------
5389
5b5c9bc7 5390class ActivateEvent(Event):
5ba5649b
RD
5391 """
5392 An activate event is sent when a top-level window or the entire
5393 application is being activated or deactivated.
5394
5395 A top-level window (a dialog or frame) receives an activate event when
5396 is being activated or deactivated. This is indicated visually by the
5397 title bar changing colour, and a subwindow gaining the keyboard focus.
5398 An application is activated or deactivated when one of its frames
5399 becomes activated, or a frame becomes inactivate resulting in all
5400 application frames being inactive.
5401
5402 Please note that usually you should call event.Skip() in your handlers
5403 for these events so the default handlers will still be called, as not
5404 doing so can result in strange effects.
5405
5406 """
1bd55598
RD
5407 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5408 __repr__ = _swig_repr
5409 def __init__(self, *args, **kwargs):
5ba5649b 5410 """
2131d850 5411 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5412
5413 Constructor
5414 """
1bd55598 5415 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
d55e5bfc 5416 def GetActive(*args, **kwargs):
5ba5649b
RD
5417 """
5418 GetActive(self) -> bool
5419
5420 Returns true if the application or window is being activated, false
5421 otherwise.
5422 """
5b5c9bc7 5423 return _core_.ActivateEvent_GetActive(*args, **kwargs)
d55e5bfc 5424
2bf58437 5425 Active = property(GetActive,doc="See `GetActive`")
2131d850 5426_core_.ActivateEvent_swigregister(ActivateEvent)
d55e5bfc
RD
5427
5428#---------------------------------------------------------------------------
5429
5b5c9bc7 5430class InitDialogEvent(Event):
5ba5649b
RD
5431 """
5432 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5433 any window when `wx.Window.InitDialog` is called. Handlers for this
5434 event can transfer data to the window, or anything else that should be
5435 done before the user begins editing the form. The default handler
5436 calls `wx.Window.TransferDataToWindow`.
5437 """
1bd55598
RD
5438 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5439 __repr__ = _swig_repr
5440 def __init__(self, *args, **kwargs):
5ba5649b
RD
5441 """
5442 __init__(self, int Id=0) -> InitDialogEvent
5443
5444 Constructor
5445 """
1bd55598 5446 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5447_core_.InitDialogEvent_swigregister(InitDialogEvent)
d55e5bfc
RD
5448
5449#---------------------------------------------------------------------------
5450
5b5c9bc7 5451class MenuEvent(Event):
5ba5649b
RD
5452 """
5453 This class is used for a variety of menu-related events. Note that
5454 these do not include menu command events, which are handled by sending
5455 `wx.CommandEvent` objects.
5456
5457 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5458 text in the first field of the status bar.
5459 """
1bd55598
RD
5460 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5461 __repr__ = _swig_repr
5462 def __init__(self, *args, **kwargs):
5ba5649b 5463 """
2131d850 5464 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5465
5466 Constructor
5467 """
1bd55598 5468 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
d55e5bfc 5469 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5470 """
5471 GetMenuId(self) -> int
5472
5473 Returns the menu identifier associated with the event. This method
5474 should be only used with the HIGHLIGHT events.
5475 """
5b5c9bc7 5476 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
d55e5bfc
RD
5477
5478 def IsPopup(*args, **kwargs):
5ba5649b
RD
5479 """
5480 IsPopup(self) -> bool
5481
5482 Returns ``True`` if the menu which is being opened or closed is a
5483 popup menu, ``False`` if it is a normal one. This method should only
5484 be used with the OPEN and CLOSE events.
5485 """
5b5c9bc7 5486 return _core_.MenuEvent_IsPopup(*args, **kwargs)
d55e5bfc
RD
5487
5488 def GetMenu(*args, **kwargs):
5ba5649b
RD
5489 """
5490 GetMenu(self) -> Menu
5491
5492 Returns the menu which is being opened or closed. This method should
5493 only be used with the OPEN and CLOSE events.
5494 """
5b5c9bc7 5495 return _core_.MenuEvent_GetMenu(*args, **kwargs)
d55e5bfc 5496
57332a5a
RD
5497 Menu = property(GetMenu,doc="See `GetMenu`")
5498 MenuId = property(GetMenuId,doc="See `GetMenuId`")
2131d850 5499_core_.MenuEvent_swigregister(MenuEvent)
d55e5bfc
RD
5500
5501#---------------------------------------------------------------------------
5502
5b5c9bc7 5503class CloseEvent(Event):
5ba5649b
RD
5504 """
5505 This event class contains information about window and session close
5506 events.
5507
5508 The handler function for EVT_CLOSE is called when the user has tried
5509 to close a a frame or dialog box using the window manager controls or
5510 the system menu. It can also be invoked by the application itself
5511 programmatically, for example by calling the `wx.Window.Close`
5512 function.
5513
5514 You should check whether the application is forcing the deletion of
5515 the window using `CanVeto`. If it returns ``False``, you must destroy
5516 the window using `wx.Window.Destroy`. If the return value is ``True``,
5517 it is up to you whether you respond by destroying the window or not.
5518 For example you may wish to display a message dialog prompting to save
5519 files or to cancel the close.
5520
5521 If you don't destroy the window, you should call `Veto` to let the
5522 calling code know that you did not destroy the window. This allows the
5523 `wx.Window.Close` function to return ``True`` or ``False`` depending
5524 on whether the close instruction was honored or not.
5525 """
1bd55598
RD
5526 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5527 __repr__ = _swig_repr
5528 def __init__(self, *args, **kwargs):
5ba5649b 5529 """
2131d850 5530 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5531
5532 Constructor.
5533 """
1bd55598 5534 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
d55e5bfc 5535 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5536 """
5537 SetLoggingOff(self, bool logOff)
5538
5539 Sets the 'logging off' flag.
5540 """
5b5c9bc7 5541 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5542
5543 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5544 """
5545 GetLoggingOff(self) -> bool
5546
034e3677
RD
5547 Returns ``True`` if the user is logging off or ``False`` if the
5548 system is shutting down. This method can only be called for end
5549 session and query end session events, it doesn't make sense for close
5550 window event.
5ba5649b 5551 """
5b5c9bc7 5552 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5553
5554 def Veto(*args, **kwargs):
5ba5649b
RD
5555 """
5556 Veto(self, bool veto=True)
5557
5558 Call this from your event handler to veto a system shutdown or to
5559 signal to the calling application that a window close did not happen.
5560
5561 You can only veto a shutdown or close if `CanVeto` returns true.
5562 """
5b5c9bc7 5563 return _core_.CloseEvent_Veto(*args, **kwargs)
d55e5bfc 5564
5ba5649b
RD
5565 def GetVeto(*args, **kwargs):
5566 """GetVeto(self) -> bool"""
5567 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5568
d55e5bfc 5569 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5570 """
5571 SetCanVeto(self, bool canVeto)
5572
5573 Sets the 'can veto' flag.
5574 """
5b5c9bc7 5575 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
d55e5bfc
RD
5576
5577 def CanVeto(*args, **kwargs):
5ba5649b
RD
5578 """
5579 CanVeto(self) -> bool
d55e5bfc 5580
5ba5649b
RD
5581 Returns true if you can veto a system shutdown or a window close
5582 event. Vetoing a window close event is not possible if the calling
5583 code wishes to force the application to exit, and so this function
5584 must be called to check this.
5585 """
5586 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc 5587
2bf58437 5588 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
2131d850 5589_core_.CloseEvent_swigregister(CloseEvent)
d55e5bfc
RD
5590
5591#---------------------------------------------------------------------------
5592
5b5c9bc7 5593class ShowEvent(Event):
5ba5649b 5594 """An EVT_SHOW event is sent when a window is shown or hidden."""
1bd55598
RD
5595 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5596 __repr__ = _swig_repr
5597 def __init__(self, *args, **kwargs):
5ba5649b
RD
5598 """
5599 __init__(self, int winid=0, bool show=False) -> ShowEvent
5600
5601 An EVT_SHOW event is sent when a window is shown or hidden.
5602 """
1bd55598 5603 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
d55e5bfc
RD
5604 def SetShow(*args, **kwargs):
5605 """SetShow(self, bool show)"""
5b5c9bc7 5606 return _core_.ShowEvent_SetShow(*args, **kwargs)
d55e5bfc
RD
5607
5608 def GetShow(*args, **kwargs):
5609 """GetShow(self) -> bool"""
5b5c9bc7 5610 return _core_.ShowEvent_GetShow(*args, **kwargs)
d55e5bfc 5611
33d6fd3b 5612 Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`")
2131d850 5613_core_.ShowEvent_swigregister(ShowEvent)
d55e5bfc
RD
5614
5615#---------------------------------------------------------------------------
5616
5b5c9bc7 5617class IconizeEvent(Event):
5ba5649b
RD
5618 """
5619 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5620 restored.
5621 """
1bd55598
RD
5622 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5623 __repr__ = _swig_repr
5624 def __init__(self, *args, **kwargs):
5ba5649b
RD
5625 """
5626 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5627
5628 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5629 restored.
5630 """
1bd55598 5631 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
d55e5bfc 5632 def Iconized(*args, **kwargs):
5ba5649b
RD
5633 """
5634 Iconized(self) -> bool
5635
5636 Returns ``True`` if the frame has been iconized, ``False`` if it has
5637 been restored.
5638 """
5b5c9bc7 5639 return _core_.IconizeEvent_Iconized(*args, **kwargs)
d55e5bfc 5640
2131d850 5641_core_.IconizeEvent_swigregister(IconizeEvent)
d55e5bfc
RD
5642
5643#---------------------------------------------------------------------------
5644
5b5c9bc7 5645class MaximizeEvent(Event):
5ba5649b 5646 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
1bd55598
RD
5647 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5648 __repr__ = _swig_repr
5649 def __init__(self, *args, **kwargs):
5ba5649b
RD
5650 """
5651 __init__(self, int id=0) -> MaximizeEvent
5652
5653 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5654 """
1bd55598 5655 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5656_core_.MaximizeEvent_swigregister(MaximizeEvent)
d55e5bfc
RD
5657
5658#---------------------------------------------------------------------------
5659
5b5c9bc7 5660class DropFilesEvent(Event):
5ba5649b
RD
5661 """
5662 This class is used for drop files events, that is, when files have
5663 been dropped onto the window. This functionality is only available
5664 under Windows. The window must have previously been enabled for
5665 dropping by calling `wx.Window.DragAcceptFiles`.
5666
5667 Important note: this is a separate implementation to the more general
5668 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5669 implementation uses the older, Windows message-based approach of
5670 dropping files.
5671
5672 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5673 events.
5674
5675 """
1bd55598
RD
5676 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5677 def __init__(self): raise AttributeError, "No constructor defined"
5678 __repr__ = _swig_repr
d55e5bfc 5679 def GetPosition(*args, **kwargs):
5ba5649b
RD
5680 """
5681 GetPosition(self) -> Point
5682
5683 Returns the position at which the files were dropped.
5684 """
5b5c9bc7 5685 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5686
5687 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5688 """
5689 GetNumberOfFiles(self) -> int
5690
5691 Returns the number of files dropped.
5692 """
5b5c9bc7 5693 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
d55e5bfc
RD
5694
5695 def GetFiles(*args, **kwargs):
5ba5649b
RD
5696 """
5697 GetFiles(self) -> PyObject
5698
5699 Returns a list of the filenames that were dropped.
5700 """
5b5c9bc7 5701 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
d55e5bfc 5702
2bf58437
RD
5703 Files = property(GetFiles,doc="See `GetFiles`")
5704 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
5705 Position = property(GetPosition,doc="See `GetPosition`")
2131d850 5706_core_.DropFilesEvent_swigregister(DropFilesEvent)
d55e5bfc
RD
5707
5708#---------------------------------------------------------------------------
5709
5b5c9bc7
RD
5710UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5711UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5712class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5713 """
5714 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5715 wxWidgets to give an application the chance to update various user
5716 interface elements.
5717
5718 Without update UI events, an application has to work hard to
5719 check/uncheck, enable/disable, and set the text for elements such as
5720 menu items and toolbar buttons. The code for doing this has to be
5721 mixed up with the code that is invoked when an action is invoked for a
5722 menu item or button.
5723
5724 With update UI events, you define an event handler to look at the
5725 state of the application and change UI elements accordingly. wxWidgets
5726 will call your handler functions in idle time, so you don't have to
5727 worry where to call this code. In addition to being a clearer and more
5728 declarative method, it also means you don't have to worry whether
5729 you're updating a toolbar or menubar identifier. The same handler can
5730 update a menu item and toolbar button, if the ID values are the same.
5731
5732 Instead of directly manipulating the menu or button, you call
5733 functions in the event object, such as `Check`. wxWidgets will
5734 determine whether such a call has been made, and which UI element to
5735 update.
5736
5737 These events will work for popup menus as well as menubars. Just
5738 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5739 any UI events for the window that owns the menu.
5740
5741 If you find that the overhead of UI update processing is affecting
5742 your application, you can do one or both of the following:
5743
5744 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5745 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5746 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5747 receive update events. No other windows will receive update
5748 events.
5749
5750 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5751 value to set the delay between updates. You may need to call
5752 `wx.Window.UpdateWindowUI` at critical points, for example when
5753 a dialog is about to be shown, in case the user sees a slight
5754 delay before windows are updated.
5755
5756 Note that although events are sent in idle time, defining a EVT_IDLE
5757 handler for a window does not affect this because the events are sent
5758 from an internal idle handler.
5759
5760 wxWidgets tries to optimize update events on some platforms. On
5761 Windows and GTK+, events for menubar items are only sent when the menu
5762 is about to be shown, and not in idle time.
5763
5764 """
1bd55598
RD
5765 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5766 __repr__ = _swig_repr
5767 def __init__(self, *args, **kwargs):
5ba5649b
RD
5768 """
5769 __init__(self, int commandId=0) -> UpdateUIEvent
5770
5771 Constructor
5772 """
1bd55598 5773 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
d55e5bfc 5774 def GetChecked(*args, **kwargs):
5ba5649b
RD
5775 """
5776 GetChecked(self) -> bool
5777
5778 Returns ``True`` if the UI element should be checked.
5779 """
5b5c9bc7 5780 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
d55e5bfc
RD
5781
5782 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5783 """
5784 GetEnabled(self) -> bool
5785
5786 Returns ``True`` if the UI element should be enabled.
5787 """
5b5c9bc7 5788 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
d55e5bfc 5789
b1fcee84
RD
5790 def GetShown(*args, **kwargs):
5791 """
5792 GetShown(self) -> bool
5793
5794 Returns ``True`` if the UI element should be shown.
5795 """
5796 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5797
d55e5bfc 5798 def GetText(*args, **kwargs):
5ba5649b
RD
5799 """
5800 GetText(self) -> String
5801
5802 Returns the text that should be set for the UI element.
5803 """
5b5c9bc7 5804 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
d55e5bfc
RD
5805
5806 def GetSetText(*args, **kwargs):
5ba5649b
RD
5807 """
5808 GetSetText(self) -> bool
5809
5810 Returns ``True`` if the application has called `SetText`. For
5811 wxWidgets internal use only.
5812 """
5b5c9bc7 5813 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
d55e5bfc
RD
5814
5815 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5816 """
5817 GetSetChecked(self) -> bool
5818
5819 Returns ``True`` if the application has called `Check`. For wxWidgets
5820 internal use only.
5821 """
5b5c9bc7 5822 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
d55e5bfc
RD
5823
5824 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5825 """
5826 GetSetEnabled(self) -> bool
5827
5828 Returns ``True`` if the application has called `Enable`. For wxWidgets
5829 internal use only.
5830 """
5b5c9bc7 5831 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
d55e5bfc 5832
b1fcee84
RD
5833 def GetSetShown(*args, **kwargs):
5834 """
5835 GetSetShown(self) -> bool
5836
5837 Returns ``True`` if the application has called `Show`. For wxWidgets
5838 internal use only.
5839 """
5840 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5841
d55e5bfc 5842 def Check(*args, **kwargs):
5ba5649b
RD
5843 """
5844 Check(self, bool check)
5845
5846 Check or uncheck the UI element.
5847 """
5b5c9bc7 5848 return _core_.UpdateUIEvent_Check(*args, **kwargs)
d55e5bfc
RD
5849
5850 def Enable(*args, **kwargs):
5ba5649b
RD
5851 """
5852 Enable(self, bool enable)
5853
5854 Enable or disable the UI element.
5855 """
5b5c9bc7 5856 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
d55e5bfc 5857
b1fcee84
RD
5858 def Show(*args, **kwargs):
5859 """
5860 Show(self, bool show)
5861
5862 Show or hide the UI element.
5863 """
5864 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5865
d55e5bfc 5866 def SetText(*args, **kwargs):
5ba5649b
RD
5867 """
5868 SetText(self, String text)
5869
5870 Sets the text for this UI element.
5871 """
5b5c9bc7 5872 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
d55e5bfc
RD
5873
5874 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5875 """
5876 SetUpdateInterval(long updateInterval)
5877
5878 Sets the interval between updates in milliseconds. Set to -1 to
5879 disable updates, or to 0 to update as frequently as possible. The
5880 default is 0.
5881
5882 Use this to reduce the overhead of UI update events if your
5883 application has a lot of windows. If you set the value to -1 or
5884 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5885 at appropriate points in your application, such as when a dialog is
5886 about to be shown.
5887 """
5b5c9bc7 5888 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5889
5890 SetUpdateInterval = staticmethod(SetUpdateInterval)
5891 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5892 """
5893 GetUpdateInterval() -> long
5894
5895 Returns the current interval between updates in milliseconds. -1
5896 disables updates, 0 updates as frequently as possible.
5897 """
5b5c9bc7 5898 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5899
5900 GetUpdateInterval = staticmethod(GetUpdateInterval)
5901 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5902 """
5903 CanUpdate(Window win) -> bool
5904
5905 Returns ``True`` if it is appropriate to update (send UI update events
5906 to) this window.
5907
5908 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5909 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5910 events were last sent in idle time, and the update interval, to
5911 determine whether events should be sent to this window now. By default
5912 this will always return true because the update mode is initially
5913 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5914 events will be sent as often as possible. You can reduce the frequency
5915 that events are sent by changing the mode and/or setting an update
5916 interval.
5917
5918 """
5b5c9bc7 5919 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc
RD
5920
5921 CanUpdate = staticmethod(CanUpdate)
5922 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5923 """
5924 ResetUpdateTime()
5925
5926 Used internally to reset the last-updated time to the current time. It
5927 is assumed that update events are normally sent in idle time, so this
5928 is called at the end of idle processing.
5929 """
5b5c9bc7 5930 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc
RD
5931
5932 ResetUpdateTime = staticmethod(ResetUpdateTime)
5933 def SetMode(*args, **kwargs):
5ba5649b
RD
5934 """
5935 SetMode(int mode)
5936
5937 Specify how wxWidgets will send update events: to all windows, or only
5938 to those which specify that they will process the events.
5939
5940 The mode may be one of the following values:
5941
5942 ============================= ==========================================
5943 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5944 is the default setting.
5945 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5946 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5947 style set.
5948 ============================= ==========================================
5949
5950 """
5b5c9bc7 5951 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
5952
5953 SetMode = staticmethod(SetMode)
5954 def GetMode(*args, **kwargs):
5ba5649b
RD
5955 """
5956 GetMode() -> int
5957
5958 Returns a value specifying how wxWidgets will send update events: to
5959 all windows, or only to those which specify that they will process the
5960 events.
5961 """
5b5c9bc7 5962 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
5963
5964 GetMode = staticmethod(GetMode)
dba7934c
RD
5965 Checked = property(GetChecked,Check,doc="See `GetChecked`")
5966 Enabled = property(GetEnabled,Enable,doc="See `GetEnabled`")
5967 Shown = property(GetShown,Show,doc="See `GetShown`")
5968 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
2131d850 5969_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d55e5bfc 5970
5b5c9bc7 5971def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
1bd55598 5972 """
5ba5649b
RD
5973 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5974
5975 Sets the interval between updates in milliseconds. Set to -1 to
5976 disable updates, or to 0 to update as frequently as possible. The
5977 default is 0.
5978
5979 Use this to reduce the overhead of UI update events if your
5980 application has a lot of windows. If you set the value to -1 or
5981 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5982 at appropriate points in your application, such as when a dialog is
5983 about to be shown.
5984 """
1bd55598 5985 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 5986
1bd55598
RD
5987def UpdateUIEvent_GetUpdateInterval(*args):
5988 """
5ba5649b
RD
5989 UpdateUIEvent_GetUpdateInterval() -> long
5990
5991 Returns the current interval between updates in milliseconds. -1
5992 disables updates, 0 updates as frequently as possible.
5993 """
1bd55598 5994 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d55e5bfc 5995
5b5c9bc7 5996def UpdateUIEvent_CanUpdate(*args, **kwargs):
1bd55598 5997 """
5ba5649b
RD
5998 UpdateUIEvent_CanUpdate(Window win) -> bool
5999
6000 Returns ``True`` if it is appropriate to update (send UI update events
6001 to) this window.
6002
6003 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6004 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6005 events were last sent in idle time, and the update interval, to
6006 determine whether events should be sent to this window now. By default
6007 this will always return true because the update mode is initially
6008 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6009 events will be sent as often as possible. You can reduce the frequency
6010 that events are sent by changing the mode and/or setting an update
6011 interval.
6012
6013 """
1bd55598 6014 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 6015
1bd55598
RD
6016def UpdateUIEvent_ResetUpdateTime(*args):
6017 """
5ba5649b
RD
6018 UpdateUIEvent_ResetUpdateTime()
6019
6020 Used internally to reset the last-updated time to the current time. It
6021 is assumed that update events are normally sent in idle time, so this
6022 is called at the end of idle processing.
6023 """
1bd55598 6024 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d55e5bfc 6025
5b5c9bc7 6026def UpdateUIEvent_SetMode(*args, **kwargs):
1bd55598 6027 """
5ba5649b
RD
6028 UpdateUIEvent_SetMode(int mode)
6029
6030 Specify how wxWidgets will send update events: to all windows, or only
6031 to those which specify that they will process the events.
6032
6033 The mode may be one of the following values:
6034
6035 ============================= ==========================================
6036 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6037 is the default setting.
6038 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6039 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6040 style set.
6041 ============================= ==========================================
6042
6043 """
1bd55598 6044 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 6045
1bd55598
RD
6046def UpdateUIEvent_GetMode(*args):
6047 """
5ba5649b
RD
6048 UpdateUIEvent_GetMode() -> int
6049
6050 Returns a value specifying how wxWidgets will send update events: to
6051 all windows, or only to those which specify that they will process the
6052 events.
6053 """
1bd55598 6054 return _core_.UpdateUIEvent_GetMode(*args)
d55e5bfc
RD
6055
6056#---------------------------------------------------------------------------
6057
5b5c9bc7 6058class SysColourChangedEvent(Event):
5ba5649b
RD
6059 """
6060 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6061 when the user changes the colour settings using the control
6062 panel. This is only applicable under Windows.
6063
6064 The default event handler for this event propagates the event to child
6065 windows, since Windows only sends the events to top-level windows. If
6066 intercepting this event for a top-level window, remember to call
6067 `Skip` so the the base class handler will still be executed, or to
6068 pass the event on to the window's children explicitly.
6069
6070 """
1bd55598
RD
6071 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6072 __repr__ = _swig_repr
6073 def __init__(self, *args, **kwargs):
5ba5649b
RD
6074 """
6075 __init__(self) -> SysColourChangedEvent
6076
6077 Constructor
6078 """
1bd55598 6079 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 6080_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d55e5bfc
RD
6081
6082#---------------------------------------------------------------------------
6083
5b5c9bc7 6084class MouseCaptureChangedEvent(Event):
5ba5649b
RD
6085 """
6086 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6087 a window that loses its mouse capture. This is called even if
6088 `wx.Window.ReleaseMouse` was called by the application code. Handling
6089 this event allows an application to cater for unexpected capture
6090 releases which might otherwise confuse mouse handling code.
6091
6092 This event is implemented under Windows only.
6093 """
1bd55598
RD
6094 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6095 __repr__ = _swig_repr
6096 def __init__(self, *args, **kwargs):
5ba5649b
RD
6097 """
6098 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6099
6100 Constructor
6101 """
1bd55598 6102 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
d55e5bfc 6103 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
6104 """
6105 GetCapturedWindow(self) -> Window
6106
6107 Returns the window that gained the capture, or ``None`` if it was a
6108 non-wxWidgets window.
6109 """
5b5c9bc7 6110 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
d55e5bfc 6111
57332a5a 6112 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
2131d850 6113_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d55e5bfc
RD
6114
6115#---------------------------------------------------------------------------
6116
34e0a3bb
RD
6117class MouseCaptureLostEvent(Event):
6118 """
6119 A mouse capture lost event is sent to a window that obtained mouse
6120 capture, which was subsequently loss due to "external" event, for
6121 example when a dialog box is shown or if another application captures
6122 the mouse.
6123
6124 If this happens, this event is sent to all windows that are on the
6125 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6126 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6127 if the capture changes because of a call to CaptureMouse or
6128 ReleaseMouse.
6129
6130 This event is currently emitted under Windows only.
6131
6132 """
6133 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6134 __repr__ = _swig_repr
6135 def __init__(self, *args, **kwargs):
6136 """
6137 __init__(self, int winid=0) -> MouseCaptureLostEvent
6138
6139 A mouse capture lost event is sent to a window that obtained mouse
6140 capture, which was subsequently loss due to "external" event, for
6141 example when a dialog box is shown or if another application captures
6142 the mouse.
6143
6144 If this happens, this event is sent to all windows that are on the
6145 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6146 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6147 if the capture changes because of a call to CaptureMouse or
6148 ReleaseMouse.
6149
6150 This event is currently emitted under Windows only.
6151
6152 """
6153 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6154_core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6155
6156#---------------------------------------------------------------------------
6157
5b5c9bc7 6158class DisplayChangedEvent(Event):
5ba5649b
RD
6159 """
6160 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6161 resolution has changed.
6162
6163 This event is implemented under Windows only.
6164 """
1bd55598
RD
6165 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6166 __repr__ = _swig_repr
6167 def __init__(self, *args, **kwargs):
5b5c9bc7 6168 """__init__(self) -> DisplayChangedEvent"""
1bd55598 6169 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 6170_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d55e5bfc
RD
6171
6172#---------------------------------------------------------------------------
6173
5b5c9bc7 6174class PaletteChangedEvent(Event):
5ba5649b
RD
6175 """
6176 An EVT_PALETTE_CHANGED event is sent when the system palette has
6177 changed, thereby giving each window a chance to redo their own to
6178 match.
6179
6180 This event is implemented under Windows only.
6181 """
1bd55598
RD
6182 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6183 __repr__ = _swig_repr
6184 def __init__(self, *args, **kwargs):
5ba5649b
RD
6185 """
6186 __init__(self, int id=0) -> PaletteChangedEvent
6187
6188 An EVT_PALETTE_CHANGED event is sent when the system palette has
6189 changed, thereby giving each window a chance to redo their own to
6190 match.
6191
6192 This event is implemented under Windows only.
6193 """
1bd55598 6194 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
d55e5bfc 6195 def SetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
6196 """SetChangedWindow(self, Window win)"""
6197 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
d55e5bfc
RD
6198
6199 def GetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
6200 """GetChangedWindow(self) -> Window"""
6201 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
d55e5bfc 6202
33d6fd3b 6203 ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`")
2131d850 6204_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d55e5bfc
RD
6205
6206#---------------------------------------------------------------------------
6207
5b5c9bc7 6208class QueryNewPaletteEvent(Event):
5ba5649b
RD
6209 """
6210 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6211 focus and should re-do its palette.
6212
6213 This event is implemented under Windows only.
6214 """
1bd55598
RD
6215 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6216 __repr__ = _swig_repr
6217 def __init__(self, *args, **kwargs):
5ba5649b
RD
6218 """
6219 __init__(self, int winid=0) -> QueryNewPaletteEvent
6220
6221 Constructor.
6222 """
1bd55598 6223 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
d55e5bfc 6224 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6225 """
6226 SetPaletteRealized(self, bool realized)
6227
6228 App should set this if it changes the palette.
6229 """
5b5c9bc7 6230 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
6231
6232 def GetPaletteRealized(*args, **kwargs):
6233 """GetPaletteRealized(self) -> bool"""
5b5c9bc7 6234 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
d55e5bfc 6235
33d6fd3b 6236 PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`")
2131d850 6237_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d55e5bfc
RD
6238
6239#---------------------------------------------------------------------------
6240
5b5c9bc7 6241class NavigationKeyEvent(Event):
5ba5649b
RD
6242 """
6243 EVT_NAVIGATION_KEY events are used to control moving the focus between
6244 widgets, otherwise known as tab-traversal. You woudl normally not
6245 catch navigation events in applications as there are already
6246 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6247 it useful to send navigation events in certain situations to change
6248 the focus in certain ways, although it's probably easier to just call
6249 `wx.Window.Navigate`.
6250 """
1bd55598
RD
6251 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6252 __repr__ = _swig_repr
6253 def __init__(self, *args, **kwargs):
5b5c9bc7 6254 """__init__(self) -> NavigationKeyEvent"""
1bd55598 6255 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
d55e5bfc 6256 def GetDirection(*args, **kwargs):
5ba5649b
RD
6257 """
6258 GetDirection(self) -> bool
6259
6260 Returns ``True`` if the direction is forward, ``False`` otherwise.
6261 """
5b5c9bc7 6262 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
d55e5bfc
RD
6263
6264 def SetDirection(*args, **kwargs):
5ba5649b
RD
6265 """
6266 SetDirection(self, bool forward)
6267
6268 Specify the direction that the navigation should take. Usually the
6269 difference between using Tab and Shift-Tab.
6270 """
5b5c9bc7 6271 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
d55e5bfc
RD
6272
6273 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6274 """
6275 IsWindowChange(self) -> bool
6276
6277 Returns ``True`` if window change is allowed.
6278 """
5b5c9bc7 6279 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
d55e5bfc
RD
6280
6281 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6282 """
6283 SetWindowChange(self, bool ischange)
6284
6285 Specify if the navigation should be able to change parent windows.
6286 For example, changing notebook pages, etc. This is usually implemented
6287 by using Control-Tab.
6288 """
5b5c9bc7 6289 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
d55e5bfc 6290
68350608 6291 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6292 """
6293 IsFromTab(self) -> bool
6294
6295 Returns ``True`` if the navigation event is originated from the Tab
6296 key.
6297 """
5b5c9bc7 6298 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
68350608
RD
6299
6300 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6301 """
6302 SetFromTab(self, bool bIs)
6303
6304 Set to true under MSW if the event was generated using the tab key.
6305 This is required for proper navogation over radio buttons.
6306 """
5b5c9bc7 6307 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
68350608 6308
908b74cd 6309 def SetFlags(*args, **kwargs):
5ba5649b
RD
6310 """
6311 SetFlags(self, long flags)
6312
6313 Set the navigation flags to a combination of the following:
6314
6315 * wx.NavigationKeyEvent.IsBackward
6316 * wx.NavigationKeyEvent.IsForward
6317 * wx.NavigationKeyEvent.WinChange
6318 * wx.NavigationKeyEvent.FromTab
6319
6320 """
5b5c9bc7 6321 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
908b74cd 6322
d55e5bfc 6323 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6324 """
6325 GetCurrentFocus(self) -> Window
6326
6327 Returns the child window which currenty has the focus. May be
6328 ``None``.
6329 """
5b5c9bc7 6330 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
d55e5bfc
RD
6331
6332 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6333 """
6334 SetCurrentFocus(self, Window win)
6335
6336 Set the window that has the focus.
6337 """
5b5c9bc7 6338 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
d55e5bfc 6339
5b5c9bc7
RD
6340 IsBackward = _core_.NavigationKeyEvent_IsBackward
6341 IsForward = _core_.NavigationKeyEvent_IsForward
6342 WinChange = _core_.NavigationKeyEvent_WinChange
6343 FromTab = _core_.NavigationKeyEvent_FromTab
57332a5a
RD
6344 CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`")
6345 Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`")
2131d850 6346_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d55e5bfc
RD
6347
6348#---------------------------------------------------------------------------
6349
5b5c9bc7 6350class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6351 """
6352 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6353 underlying GUI object) exists.
6354 """
1bd55598
RD
6355 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6356 __repr__ = _swig_repr
6357 def __init__(self, *args, **kwargs):
5ba5649b
RD
6358 """
6359 __init__(self, Window win=None) -> WindowCreateEvent
6360
6361 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6362 underlying GUI object) exists.
6363 """
1bd55598 6364 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
d55e5bfc 6365 def GetWindow(*args, **kwargs):
5ba5649b
RD
6366 """
6367 GetWindow(self) -> Window
6368
6369 Returns the window that this event refers to.
6370 """
5b5c9bc7 6371 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
d55e5bfc 6372
dba7934c 6373 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6374_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d55e5bfc 6375
5b5c9bc7 6376class WindowDestroyEvent(CommandEvent):
5ba5649b 6377 """
943e8dfd
RD
6378 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6379 when the GUI window is destroyed.
6380
6381 When a class derived from `wx.Window` is destroyed its destructor will
6382 have already run by the time this event is sent. Therefore this event
6383 will not usually be received at all by the window itself. Since it is
6384 received after the destructor has run, an object should not try to
6385 handle its own wx.WindowDestroyEvent, but it can be used to get
6386 notification of the destruction of another window.
5ba5649b 6387 """
1bd55598
RD
6388 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6389 __repr__ = _swig_repr
6390 def __init__(self, *args, **kwargs):
5ba5649b
RD
6391 """
6392 __init__(self, Window win=None) -> WindowDestroyEvent
6393
943e8dfd
RD
6394 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6395 when the GUI window is destroyed.
6396
6397 When a class derived from `wx.Window` is destroyed its destructor will
6398 have already run by the time this event is sent. Therefore this event
6399 will not usually be received at all by the window itself. Since it is
6400 received after the destructor has run, an object should not try to
6401 handle its own wx.WindowDestroyEvent, but it can be used to get
6402 notification of the destruction of another window.
5ba5649b 6403 """
1bd55598 6404 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
d55e5bfc 6405 def GetWindow(*args, **kwargs):
5ba5649b
RD
6406 """
6407 GetWindow(self) -> Window
6408
6409 Returns the window that this event refers to.
6410 """
5b5c9bc7 6411 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
d55e5bfc 6412
dba7934c 6413 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6414_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d55e5bfc
RD
6415
6416#---------------------------------------------------------------------------
6417
5b5c9bc7 6418class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6419 """
6420 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6421 give the application a chance to show a context (popup) menu.
6422 """
1bd55598
RD
6423 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6424 __repr__ = _swig_repr
6425 def __init__(self, *args, **kwargs):
5ba5649b 6426 """
2131d850 6427 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6428
6429 Constructor.
6430 """
1bd55598 6431 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
d55e5bfc 6432 def GetPosition(*args, **kwargs):
5ba5649b
RD
6433 """
6434 GetPosition(self) -> Point
6435
6436 Returns the position (in screen coordinants) at which the menu should
6437 be shown.
6438 """
5b5c9bc7 6439 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
6440
6441 def SetPosition(*args, **kwargs):
5ba5649b
RD
6442 """
6443 SetPosition(self, Point pos)
6444
6445 Sets the position at which the menu should be shown.
6446 """
5b5c9bc7 6447 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
d55e5bfc 6448
2bf58437 6449 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 6450_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d55e5bfc
RD
6451
6452#---------------------------------------------------------------------------
6453
5b5c9bc7
RD
6454IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6455IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6456class IdleEvent(Event):
5ba5649b
RD
6457 """
6458 This class is used for EVT_IDLE events, which are generated and sent
6459 when the application *becomes* idle. In other words, the when the
6460 event queue becomes empty then idle events are sent to all windows (by
6461 default) and as long as none of them call `RequestMore` then there are
6462 no more idle events until after the system event queue has some normal
6463 events and then becomes empty again.
6464
6465 By default, idle events are sent to all windows. If this is causing a
6466 significant overhead in your application, you can call
6467 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6468 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6469 which should receive idle events. Then idle events will only be sent
6470 to those windows and not to any others.
6471 """
1bd55598
RD
6472 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6473 __repr__ = _swig_repr
6474 def __init__(self, *args, **kwargs):
5ba5649b
RD
6475 """
6476 __init__(self) -> IdleEvent
6477
6478 Constructor
6479 """
1bd55598 6480 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
d55e5bfc 6481 def RequestMore(*args, **kwargs):
5ba5649b
RD
6482 """
6483 RequestMore(self, bool needMore=True)
6484
6485 Tells wxWidgets that more processing is required. This function can be
6486 called by an EVT_IDLE handler for a window to indicate that the
6487 application should forward the EVT_IDLE event once more to the
6488 application windows. If no window calls this function during its
6489 EVT_IDLE handler, then the application will remain in a passive event
6490 loop until a new event is posted to the application by the windowing
6491 system.
6492 """
5b5c9bc7 6493 return _core_.IdleEvent_RequestMore(*args, **kwargs)
d55e5bfc
RD
6494
6495 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6496 """
6497 MoreRequested(self) -> bool
6498
6499 Returns ``True`` if the OnIdle function processing this event
6500 requested more processing time.
6501 """
5b5c9bc7 6502 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
d55e5bfc
RD
6503
6504 def SetMode(*args, **kwargs):
5ba5649b
RD
6505 """
6506 SetMode(int mode)
6507
6508 Static method for specifying how wxWidgets will send idle events: to
6509 all windows, or only to those which specify that they will process the
6510 events.
6511
6512 The mode can be one of the following values:
6513
6514 ========================= ========================================
6515 wx.IDLE_PROCESS_ALL Send idle events to all windows
6516 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6517 the wx.WS_EX_PROCESS_IDLE extra style
6518 flag set.
6519 ========================= ========================================
6520
6521 """
5b5c9bc7 6522 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
6523
6524 SetMode = staticmethod(SetMode)
6525 def GetMode(*args, **kwargs):
5ba5649b
RD
6526 """
6527 GetMode() -> int
6528
6529 Static method returning a value specifying how wxWidgets will send
6530 idle events: to all windows, or only to those which specify that they
6531 will process the events.
6532 """
5b5c9bc7 6533 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6534
6535 GetMode = staticmethod(GetMode)
6536 def CanSend(*args, **kwargs):
5ba5649b
RD
6537 """
6538 CanSend(Window win) -> bool
6539
6540 Returns ``True`` if it is appropriate to send idle events to this
6541 window.
6542
6543 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6544 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6545 events should be sent to this window now. By default this will always
6546 return ``True`` because the update mode is initially
6547 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6548 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6549 """
5b5c9bc7 6550 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6551
6552 CanSend = staticmethod(CanSend)
2131d850 6553_core_.IdleEvent_swigregister(IdleEvent)
d55e5bfc 6554
5b5c9bc7 6555def IdleEvent_SetMode(*args, **kwargs):
1bd55598 6556 """
5ba5649b
RD
6557 IdleEvent_SetMode(int mode)
6558
6559 Static method for specifying how wxWidgets will send idle events: to
6560 all windows, or only to those which specify that they will process the
6561 events.
6562
6563 The mode can be one of the following values:
6564
6565 ========================= ========================================
6566 wx.IDLE_PROCESS_ALL Send idle events to all windows
6567 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6568 the wx.WS_EX_PROCESS_IDLE extra style
6569 flag set.
6570 ========================= ========================================
6571
6572 """
1bd55598 6573 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6574
1bd55598
RD
6575def IdleEvent_GetMode(*args):
6576 """
5ba5649b
RD
6577 IdleEvent_GetMode() -> int
6578
6579 Static method returning a value specifying how wxWidgets will send
6580 idle events: to all windows, or only to those which specify that they
6581 will process the events.
6582 """
1bd55598 6583 return _core_.IdleEvent_GetMode(*args)
d55e5bfc 6584
5b5c9bc7 6585def IdleEvent_CanSend(*args, **kwargs):
1bd55598 6586 """
5ba5649b
RD
6587 IdleEvent_CanSend(Window win) -> bool
6588
6589 Returns ``True`` if it is appropriate to send idle events to this
6590 window.
6591
6592 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6593 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6594 events should be sent to this window now. By default this will always
6595 return ``True`` because the update mode is initially
6596 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6597 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6598 """
1bd55598 6599 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6600
6601#---------------------------------------------------------------------------
6602
2131d850
RD
6603class ClipboardTextEvent(CommandEvent):
6604 """
6605 A Clipboard Text event is sent when a window intercepts a text
6606 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6607 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6608 popup menu command, etc. NOTE : under windows these events are *NOT*
6609 generated automatically for a Rich Edit text control.
6610 """
6611 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6612 __repr__ = _swig_repr
6613 def __init__(self, *args, **kwargs):
6614 """
6615 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6616
6617 A Clipboard Text event is sent when a window intercepts a text
6618 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6619 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6620 popup menu command, etc. NOTE : under windows these events are *NOT*
6621 generated automatically for a Rich Edit text control.
6622 """
6623 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6624_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6625
6626#---------------------------------------------------------------------------
6627
5b5c9bc7 6628class PyEvent(Event):
5ba5649b
RD
6629 """
6630 wx.PyEvent can be used as a base class for implementing custom event
6631 types in Python. You should derived from this class instead of
6632 `wx.Event` because this class is Python-aware and is able to transport
6633 its Python bits safely through the wxWidgets event system and have
6634 them still be there when the event handler is invoked.
6635
6636 :see: `wx.PyCommandEvent`
6637
6638 """
1bd55598
RD
6639 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6640 __repr__ = _swig_repr
6641 def __init__(self, *args, **kwargs):
2131d850 6642 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
1bd55598 6643 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6644 self._SetSelf(self)
d55e5bfc 6645
1bd55598
RD
6646 __swig_destroy__ = _core_.delete_PyEvent
6647 __del__ = lambda self : None;
5ba5649b
RD
6648 def _SetSelf(*args, **kwargs):
6649 """_SetSelf(self, PyObject self)"""
6650 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6651
5ba5649b
RD
6652 def _GetSelf(*args, **kwargs):
6653 """_GetSelf(self) -> PyObject"""
6654 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc 6655
2131d850 6656_core_.PyEvent_swigregister(PyEvent)
d55e5bfc 6657
5b5c9bc7 6658class PyCommandEvent(CommandEvent):
5ba5649b
RD
6659 """
6660 wx.PyCommandEvent can be used as a base class for implementing custom
6661 event types in Python, where the event shoudl travel up to parent
6662 windows looking for a handler. You should derived from this class
6663 instead of `wx.CommandEvent` because this class is Python-aware and is
6664 able to transport its Python bits safely through the wxWidgets event
6665 system and have them still be there when the event handler is invoked.
6666
6667 :see: `wx.PyEvent`
6668
6669 """
1bd55598
RD
6670 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6671 __repr__ = _swig_repr
6672 def __init__(self, *args, **kwargs):
2131d850 6673 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
1bd55598 6674 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6675 self._SetSelf(self)
d55e5bfc 6676
1bd55598
RD
6677 __swig_destroy__ = _core_.delete_PyCommandEvent
6678 __del__ = lambda self : None;
5ba5649b
RD
6679 def _SetSelf(*args, **kwargs):
6680 """_SetSelf(self, PyObject self)"""
6681 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6682
5ba5649b
RD
6683 def _GetSelf(*args, **kwargs):
6684 """_GetSelf(self) -> PyObject"""
6685 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc 6686
2131d850 6687_core_.PyCommandEvent_swigregister(PyCommandEvent)
d55e5bfc 6688
5b5c9bc7 6689class DateEvent(CommandEvent):
5ba5649b
RD
6690 """
6691 This event class holds information about a date change event and is
6692 used together with `wx.DatePickerCtrl`. It also serves as a base class
6693 for `wx.calendar.CalendarEvent`. Bind these event types with
6694 EVT_DATE_CHANGED.
6695 """
1bd55598
RD
6696 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6697 __repr__ = _swig_repr
6698 def __init__(self, *args, **kwargs):
2131d850 6699 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
1bd55598 6700 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6701 def GetDate(*args, **kwargs):
5ba5649b
RD
6702 """
6703 GetDate(self) -> DateTime
6704
6705 Returns the date.
6706 """
5b5c9bc7 6707 return _core_.DateEvent_GetDate(*args, **kwargs)
53aa7709
RD
6708
6709 def SetDate(*args, **kwargs):
5ba5649b
RD
6710 """
6711 SetDate(self, DateTime date)
6712
6713 Sets the date carried by the event, normally only used by the library
6714 internally.
6715 """
5b5c9bc7 6716 return _core_.DateEvent_SetDate(*args, **kwargs)
53aa7709 6717
2bf58437 6718 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
2131d850 6719_core_.DateEvent_swigregister(DateEvent)
53aa7709 6720
5b5c9bc7 6721wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
53aa7709
RD
6722EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6723
d55e5bfc
RD
6724#---------------------------------------------------------------------------
6725
5b5c9bc7
RD
6726PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6727PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6728PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6729PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6730PRINT_WINDOWS = _core_.PRINT_WINDOWS
6731PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6732class PyApp(EvtHandler):
d6c14a4c
RD
6733 """
6734 The ``wx.PyApp`` class is an *implementation detail*, please use the
6735 `wx.App` class (or some other derived class) instead.
6736 """
1bd55598
RD
6737 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6738 __repr__ = _swig_repr
6739 def __init__(self, *args, **kwargs):
d55e5bfc 6740 """
5b5c9bc7 6741 __init__(self) -> PyApp
d55e5bfc
RD
6742
6743 Create a new application object, starting the bootstrap process.
6744 """
1bd55598 6745 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
7993762b
RD
6746 self._setCallbackInfo(self, PyApp, False)
6747 self._setOORInfo(self, False)
d55e5bfc 6748
1bd55598
RD
6749 __swig_destroy__ = _core_.delete_PyApp
6750 __del__ = lambda self : None;
d55e5bfc 6751 def _setCallbackInfo(*args, **kwargs):
7993762b 6752 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
5b5c9bc7 6753 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
6754
6755 def GetAppName(*args, **kwargs):
6756 """
5b5c9bc7 6757 GetAppName(self) -> String
d55e5bfc
RD
6758
6759 Get the application name.
6760 """
5b5c9bc7 6761 return _core_.PyApp_GetAppName(*args, **kwargs)
d55e5bfc
RD
6762
6763 def SetAppName(*args, **kwargs):
6764 """
5b5c9bc7 6765 SetAppName(self, String name)
d55e5bfc 6766
d6c14a4c
RD
6767 Set the application name. This value may be used automatically by
6768 `wx.Config` and such.
d55e5bfc 6769 """
5b5c9bc7 6770 return _core_.PyApp_SetAppName(*args, **kwargs)
d55e5bfc
RD
6771
6772 def GetClassName(*args, **kwargs):
6773 """
5b5c9bc7 6774 GetClassName(self) -> String
d55e5bfc
RD
6775
6776 Get the application's class name.
6777 """
5b5c9bc7 6778 return _core_.PyApp_GetClassName(*args, **kwargs)
d55e5bfc
RD
6779
6780 def SetClassName(*args, **kwargs):
6781 """
5b5c9bc7 6782 SetClassName(self, String name)
d55e5bfc 6783
d6c14a4c
RD
6784 Set the application's class name. This value may be used for
6785 X-resources if applicable for the platform
d55e5bfc 6786 """
5b5c9bc7 6787 return _core_.PyApp_SetClassName(*args, **kwargs)
d55e5bfc
RD
6788
6789 def GetVendorName(*args, **kwargs):
6790 """
5b5c9bc7 6791 GetVendorName(self) -> String
d55e5bfc
RD
6792
6793 Get the application's vendor name.
6794 """
5b5c9bc7 6795 return _core_.PyApp_GetVendorName(*args, **kwargs)
d55e5bfc
RD
6796
6797 def SetVendorName(*args, **kwargs):
6798 """
5b5c9bc7 6799 SetVendorName(self, String name)
d55e5bfc 6800
d6c14a4c
RD
6801 Set the application's vendor name. This value may be used
6802 automatically by `wx.Config` and such.
d55e5bfc 6803 """
5b5c9bc7 6804 return _core_.PyApp_SetVendorName(*args, **kwargs)
d55e5bfc
RD
6805
6806 def GetTraits(*args, **kwargs):
6807 """
6808 GetTraits(self) -> wxAppTraits
6809
d6c14a4c
RD
6810 Return (and create if necessary) the app traits object to which we
6811 delegate for everything which either should be configurable by the
6812 user (then he can change the default behaviour simply by overriding
6813 CreateTraits() and returning his own traits object) or which is
6814 GUI/console dependent as then wx.AppTraits allows us to abstract the
6815 differences behind the common facade.
6816
6817 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc 6818 """
5b5c9bc7 6819 return _core_.PyApp_GetTraits(*args, **kwargs)
d55e5bfc
RD
6820
6821 def ProcessPendingEvents(*args, **kwargs):
6822 """
6823 ProcessPendingEvents(self)
6824
d6c14a4c
RD
6825 Process all events in the Pending Events list -- it is necessary to
6826 call this function to process posted events. This normally happens
6827 during each event loop iteration.
d55e5bfc 6828 """
5b5c9bc7 6829 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
6830
6831 def Yield(*args, **kwargs):
6832 """
6833 Yield(self, bool onlyIfNeeded=False) -> bool
6834
d6c14a4c
RD
6835 Process all currently pending events right now, instead of waiting
6836 until return to the event loop. It is an error to call ``Yield``
6837 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 6838
d6c14a4c 6839 :warning: This function is dangerous as it can lead to unexpected
15817c7e
RD
6840 reentrancies (i.e. when called from an event handler it may
6841 result in calling the same event handler again), use with
6842 extreme care or, better, don't use at all!
d55e5bfc 6843
d6c14a4c 6844 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
15817c7e 6845
d55e5bfc 6846 """
5b5c9bc7 6847 return _core_.PyApp_Yield(*args, **kwargs)
d55e5bfc
RD
6848
6849 def WakeUpIdle(*args, **kwargs):
6850 """
6851 WakeUpIdle(self)
6852
d6c14a4c
RD
6853 Make sure that idle events are sent again.
6854 :see: `wx.WakeUpIdle`
d55e5bfc 6855 """
5b5c9bc7 6856 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
d55e5bfc 6857
84f85550
RD
6858 def IsMainLoopRunning(*args, **kwargs):
6859 """
6860 IsMainLoopRunning() -> bool
6861
6862 Returns True if we're running the main loop, i.e. if the events can
6863 currently be dispatched.
6864 """
5b5c9bc7 6865 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550
RD
6866
6867 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
6868 def MainLoop(*args, **kwargs):
6869 """
6870 MainLoop(self) -> int
6871
d6c14a4c
RD
6872 Execute the main GUI loop, the function doesn't normally return until
6873 all top level windows have been closed and destroyed.
d55e5bfc 6874 """
5b5c9bc7 6875 return _core_.PyApp_MainLoop(*args, **kwargs)
d55e5bfc
RD
6876
6877 def Exit(*args, **kwargs):
6878 """
6879 Exit(self)
6880
6881 Exit the main loop thus terminating the application.
d6c14a4c 6882 :see: `wx.Exit`
d55e5bfc 6883 """
5b5c9bc7 6884 return _core_.PyApp_Exit(*args, **kwargs)
d55e5bfc 6885
ac5d357a
RD
6886 def GetLayoutDirection(*args, **kwargs):
6887 """
994453b8 6888 GetLayoutDirection(self) -> int
ac5d357a
RD
6889
6890 Return the layout direction for the current locale.
6891 """
6892 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
6893
d55e5bfc
RD
6894 def ExitMainLoop(*args, **kwargs):
6895 """
6896 ExitMainLoop(self)
6897
d6c14a4c
RD
6898 Exit the main GUI loop during the next iteration of the main
6899 loop, (i.e. it does not stop the program immediately!)
d55e5bfc 6900 """
5b5c9bc7 6901 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
d55e5bfc
RD
6902
6903 def Pending(*args, **kwargs):
6904 """
6905 Pending(self) -> bool
6906
6907 Returns True if there are unprocessed events in the event queue.
6908 """
5b5c9bc7 6909 return _core_.PyApp_Pending(*args, **kwargs)
d55e5bfc
RD
6910
6911 def Dispatch(*args, **kwargs):
6912 """
6913 Dispatch(self) -> bool
6914
6915 Process the first event in the event queue (blocks until an event
6916 appears if there are none currently)
6917 """
5b5c9bc7 6918 return _core_.PyApp_Dispatch(*args, **kwargs)
d55e5bfc
RD
6919
6920 def ProcessIdle(*args, **kwargs):
6921 """
6922 ProcessIdle(self) -> bool
6923
d6c14a4c
RD
6924 Called from the MainLoop when the application becomes idle (there are
6925 no pending events) and sends a `wx.IdleEvent` to all interested
6926 parties. Returns True if more idle events are needed, False if not.
d55e5bfc 6927 """
5b5c9bc7 6928 return _core_.PyApp_ProcessIdle(*args, **kwargs)
d55e5bfc
RD
6929
6930 def SendIdleEvents(*args, **kwargs):
6931 """
5b5c9bc7 6932 SendIdleEvents(self, Window win, IdleEvent event) -> bool
d55e5bfc 6933
d6c14a4c
RD
6934 Send idle event to window and all subwindows. Returns True if more
6935 idle time is requested.
d55e5bfc 6936 """
5b5c9bc7 6937 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
d55e5bfc
RD
6938
6939 def IsActive(*args, **kwargs):
6940 """
6941 IsActive(self) -> bool
6942
6943 Return True if our app has focus.
6944 """
5b5c9bc7 6945 return _core_.PyApp_IsActive(*args, **kwargs)
d55e5bfc
RD
6946
6947 def SetTopWindow(*args, **kwargs):
6948 """
5b5c9bc7 6949 SetTopWindow(self, Window win)
d55e5bfc 6950
d6c14a4c 6951 Set the *main* top level window
d55e5bfc 6952 """
5b5c9bc7 6953 return _core_.PyApp_SetTopWindow(*args, **kwargs)
d55e5bfc
RD
6954
6955 def GetTopWindow(*args, **kwargs):
6956 """
5b5c9bc7 6957 GetTopWindow(self) -> Window
d55e5bfc 6958
d6c14a4c
RD
6959 Return the *main* top level window (if it hadn't been set previously
6960 with SetTopWindow(), will return just some top level window and, if
6961 there not any, will return None)
d55e5bfc 6962 """
5b5c9bc7 6963 return _core_.PyApp_GetTopWindow(*args, **kwargs)
d55e5bfc
RD
6964
6965 def SetExitOnFrameDelete(*args, **kwargs):
6966 """
6967 SetExitOnFrameDelete(self, bool flag)
6968
d6c14a4c
RD
6969 Control the exit behaviour: by default, the program will exit the main
6970 loop (and so, usually, terminate) when the last top-level program
6971 window is deleted. Beware that if you disable this behaviour (with
6972 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6973 explicitly from somewhere.
d55e5bfc 6974 """
5b5c9bc7 6975 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6976
6977 def GetExitOnFrameDelete(*args, **kwargs):
6978 """
6979 GetExitOnFrameDelete(self) -> bool
6980
6981 Get the current exit behaviour setting.
6982 """
5b5c9bc7 6983 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6984
6985 def SetUseBestVisual(*args, **kwargs):
6986 """
6987 SetUseBestVisual(self, bool flag)
6988
d6c14a4c
RD
6989 Set whether the app should try to use the best available visual on
6990 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc 6991 """
5b5c9bc7 6992 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
6993
6994 def GetUseBestVisual(*args, **kwargs):
6995 """
6996 GetUseBestVisual(self) -> bool
6997
6998 Get current UseBestVisual setting.
6999 """
5b5c9bc7 7000 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
7001
7002 def SetPrintMode(*args, **kwargs):
7003 """SetPrintMode(self, int mode)"""
5b5c9bc7 7004 return _core_.PyApp_SetPrintMode(*args, **kwargs)
d55e5bfc
RD
7005
7006 def GetPrintMode(*args, **kwargs):
7007 """GetPrintMode(self) -> int"""
5b5c9bc7 7008 return _core_.PyApp_GetPrintMode(*args, **kwargs)
d55e5bfc
RD
7009
7010 def SetAssertMode(*args, **kwargs):
7011 """
7012 SetAssertMode(self, int mode)
7013
15817c7e 7014 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc 7015 """
5b5c9bc7 7016 return _core_.PyApp_SetAssertMode(*args, **kwargs)
d55e5bfc
RD
7017
7018 def GetAssertMode(*args, **kwargs):
7019 """
7020 GetAssertMode(self) -> int
7021
7022 Get the current OnAssert behaviour setting.
7023 """
5b5c9bc7 7024 return _core_.PyApp_GetAssertMode(*args, **kwargs)
d55e5bfc
RD
7025
7026 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 7027 """GetMacSupportPCMenuShortcuts() -> bool"""
5b5c9bc7 7028 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7029
7030 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7031 def GetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 7032 """GetMacAboutMenuItemId() -> long"""
5b5c9bc7 7033 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7034
7035 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7036 def GetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 7037 """GetMacPreferencesMenuItemId() -> long"""
5b5c9bc7 7038 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7039
7040 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7041 def GetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 7042 """GetMacExitMenuItemId() -> long"""
5b5c9bc7 7043 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7044
7045 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7046 def GetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
7047 """GetMacHelpMenuTitleName() -> String"""
7048 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
7049
7050 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7051 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 7052 """SetMacSupportPCMenuShortcuts(bool val)"""
5b5c9bc7 7053 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7054
7055 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7056 def SetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 7057 """SetMacAboutMenuItemId(long val)"""
5b5c9bc7 7058 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7059
7060 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7061 def SetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 7062 """SetMacPreferencesMenuItemId(long val)"""
5b5c9bc7 7063 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7064
7065 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7066 def SetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 7067 """SetMacExitMenuItemId(long val)"""
5b5c9bc7 7068 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7069
7070 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7071 def SetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
7072 """SetMacHelpMenuTitleName(String val)"""
7073 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
7074
7075 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7076 def _BootstrapApp(*args, **kwargs):
7077 """
7078 _BootstrapApp(self)
7079
7080 For internal use only
7081 """
5b5c9bc7 7082 return _core_.PyApp__BootstrapApp(*args, **kwargs)
d55e5bfc
RD
7083
7084 def GetComCtl32Version(*args, **kwargs):
7085 """
d6c14a4c 7086 GetComCtl32Version() -> int
d55e5bfc 7087
d6c14a4c
RD
7088 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7089 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 7090 """
5b5c9bc7 7091 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
7092
7093 GetComCtl32Version = staticmethod(GetComCtl32Version)
33d6fd3b 7094 def IsDisplayAvailable(*args, **kwargs):
fc46b7f3 7095 """
33d6fd3b 7096 IsDisplayAvailable() -> bool
fc46b7f3
RD
7097
7098 Tests if it is possible to create a GUI in the current environment.
7099 This will mean different things on the different platforms.
7100
7101 * On X Windows systems this function will return ``False`` if it is
7102 not able to open a connection to the X display, which can happen
7103 if $DISPLAY is not set, or is not set correctly.
7104
7105 * On Mac OS X a ``False`` return value will mean that wx is not
7106 able to access the window manager, which can happen if logged in
7107 remotely or if running from the normal version of python instead
7108 of the framework version, (i.e., pythonw.)
7109
7110 * On MS Windows...
7111
7112 """
33d6fd3b
RD
7113 return _core_.PyApp_IsDisplayAvailable(*args, **kwargs)
7114
7115 IsDisplayAvailable = staticmethod(IsDisplayAvailable)
7116 AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`")
7117 AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`")
7118 ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`")
7119 ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7120 LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`")
7121 PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`")
7122 TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`")
7123 Traits = property(GetTraits,doc="See `GetTraits`")
7124 UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`")
7125 VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`")
7126 Active = property(IsActive)
2131d850 7127_core_.PyApp_swigregister(PyApp)
d55e5bfc 7128
1bd55598
RD
7129def PyApp_IsMainLoopRunning(*args):
7130 """
5b5c9bc7 7131 PyApp_IsMainLoopRunning() -> bool
84f85550
RD
7132
7133 Returns True if we're running the main loop, i.e. if the events can
7134 currently be dispatched.
7135 """
1bd55598 7136 return _core_.PyApp_IsMainLoopRunning(*args)
84f85550 7137
1bd55598
RD
7138def PyApp_GetMacSupportPCMenuShortcuts(*args):
7139 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7140 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d55e5bfc 7141
1bd55598
RD
7142def PyApp_GetMacAboutMenuItemId(*args):
7143 """PyApp_GetMacAboutMenuItemId() -> long"""
7144 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d55e5bfc 7145
1bd55598
RD
7146def PyApp_GetMacPreferencesMenuItemId(*args):
7147 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7148 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d55e5bfc 7149
1bd55598
RD
7150def PyApp_GetMacExitMenuItemId(*args):
7151 """PyApp_GetMacExitMenuItemId() -> long"""
7152 return _core_.PyApp_GetMacExitMenuItemId(*args)
d55e5bfc 7153
1bd55598
RD
7154def PyApp_GetMacHelpMenuTitleName(*args):
7155 """PyApp_GetMacHelpMenuTitleName() -> String"""
7156 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d55e5bfc 7157
5b5c9bc7 7158def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
1bd55598
RD
7159 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7160 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 7161
5b5c9bc7 7162def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
1bd55598
RD
7163 """PyApp_SetMacAboutMenuItemId(long val)"""
7164 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 7165
5b5c9bc7 7166def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
1bd55598
RD
7167 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7168 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 7169
5b5c9bc7 7170def PyApp_SetMacExitMenuItemId(*args, **kwargs):
1bd55598
RD
7171 """PyApp_SetMacExitMenuItemId(long val)"""
7172 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 7173
5b5c9bc7 7174def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
1bd55598
RD
7175 """PyApp_SetMacHelpMenuTitleName(String val)"""
7176 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 7177
1bd55598
RD
7178def PyApp_GetComCtl32Version(*args):
7179 """
5b5c9bc7 7180 PyApp_GetComCtl32Version() -> int
d55e5bfc 7181
d6c14a4c
RD
7182 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7183 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 7184 """
1bd55598 7185 return _core_.PyApp_GetComCtl32Version(*args)
d55e5bfc 7186
33d6fd3b 7187def PyApp_IsDisplayAvailable(*args):
fc46b7f3 7188 """
33d6fd3b 7189 PyApp_IsDisplayAvailable() -> bool
fc46b7f3
RD
7190
7191 Tests if it is possible to create a GUI in the current environment.
7192 This will mean different things on the different platforms.
7193
7194 * On X Windows systems this function will return ``False`` if it is
7195 not able to open a connection to the X display, which can happen
7196 if $DISPLAY is not set, or is not set correctly.
7197
7198 * On Mac OS X a ``False`` return value will mean that wx is not
7199 able to access the window manager, which can happen if logged in
7200 remotely or if running from the normal version of python instead
7201 of the framework version, (i.e., pythonw.)
7202
7203 * On MS Windows...
7204
7205 """
33d6fd3b 7206 return _core_.PyApp_IsDisplayAvailable(*args)
fc46b7f3 7207
d55e5bfc
RD
7208#---------------------------------------------------------------------------
7209
7210
1bd55598
RD
7211def Exit(*args):
7212 """
5b5c9bc7 7213 Exit()
d55e5bfc
RD
7214
7215 Force an exit of the application. Convenience for wx.GetApp().Exit()
7216 """
1bd55598 7217 return _core_.Exit(*args)
d55e5bfc 7218
1bd55598
RD
7219def Yield(*args):
7220 """
5b5c9bc7 7221 Yield() -> bool
d55e5bfc
RD
7222
7223 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7224 """
1bd55598 7225 return _core_.Yield(*args)
d55e5bfc 7226
1bd55598
RD
7227def YieldIfNeeded(*args):
7228 """
5b5c9bc7 7229 YieldIfNeeded() -> bool
d55e5bfc
RD
7230
7231 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7232 """
1bd55598 7233 return _core_.YieldIfNeeded(*args)
d55e5bfc 7234
5b5c9bc7 7235def SafeYield(*args, **kwargs):
1bd55598 7236 """
5b5c9bc7 7237 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
d55e5bfc 7238
d6c14a4c
RD
7239 This function is similar to `wx.Yield`, except that it disables the
7240 user input to all program windows before calling `wx.Yield` and
7241 re-enables it again afterwards. If ``win`` is not None, this window
7242 will remain enabled, allowing the implementation of some limited user
7243 interaction.
d55e5bfc 7244
d6c14a4c 7245 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 7246 """
1bd55598 7247 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 7248
1bd55598
RD
7249def WakeUpIdle(*args):
7250 """
5b5c9bc7 7251 WakeUpIdle()
d55e5bfc 7252
d6c14a4c
RD
7253 Cause the message queue to become empty again, so idle events will be
7254 sent.
d55e5bfc 7255 """
1bd55598 7256 return _core_.WakeUpIdle(*args)
d55e5bfc 7257
5b5c9bc7 7258def PostEvent(*args, **kwargs):
1bd55598 7259 """
5b5c9bc7 7260 PostEvent(EvtHandler dest, Event event)
d55e5bfc 7261
d6c14a4c
RD
7262 Send an event to a window or other wx.EvtHandler to be processed
7263 later.
d55e5bfc 7264 """
1bd55598 7265 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 7266
1bd55598
RD
7267def App_CleanUp(*args):
7268 """
5b5c9bc7 7269 App_CleanUp()
d55e5bfc 7270
15817c7e 7271 For internal use only, it is used to cleanup after wxWidgets when
d6c14a4c 7272 Python shuts down.
d55e5bfc 7273 """
1bd55598 7274 return _core_.App_CleanUp(*args)
d55e5bfc 7275
1bd55598
RD
7276def GetApp(*args):
7277 """
5b5c9bc7 7278 GetApp() -> PyApp
d55e5bfc
RD
7279
7280 Return a reference to the current wx.App object.
7281 """
1bd55598 7282 return _core_.GetApp(*args)
5cbf236d 7283
5b5c9bc7 7284def SetDefaultPyEncoding(*args, **kwargs):
1bd55598 7285 """
5cbf236d
RD
7286 SetDefaultPyEncoding(string encoding)
7287
7288 Sets the encoding that wxPython will use when it needs to convert a
7289 Python string or unicode object to or from a wxString.
62d32a5f
RD
7290
7291 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7292 but please be aware that the default encoding within the same locale
7293 may be slightly different on different platforms. For example, please
7294 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7295 between the common latin/roman encodings.
5cbf236d 7296 """
1bd55598 7297 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 7298
1bd55598
RD
7299def GetDefaultPyEncoding(*args):
7300 """
5cbf236d
RD
7301 GetDefaultPyEncoding() -> string
7302
7303 Gets the current encoding that wxPython will use when it needs to
7304 convert a Python string or unicode object to or from a wxString.
7305 """
1bd55598 7306 return _core_.GetDefaultPyEncoding(*args)
d55e5bfc
RD
7307#----------------------------------------------------------------------
7308
7309class PyOnDemandOutputWindow:
7310 """
7311 A class that can be used for redirecting Python's stdout and
7312 stderr streams. It will do nothing until something is wrriten to
7313 the stream at which point it will create a Frame with a text area
7314 and write the text there.
7315 """
7316 def __init__(self, title = "wxPython: stdout/stderr"):
7317 self.frame = None
7318 self.title = title
412d302d
RD
7319 self.pos = wx.DefaultPosition
7320 self.size = (450, 300)
d55e5bfc
RD
7321 self.parent = None
7322
7323 def SetParent(self, parent):
7324 """Set the window to be used as the popup Frame's parent."""
7325 self.parent = parent
7326
7327
7328 def CreateOutputWindow(self, st):
412d302d
RD
7329 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7330 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 7331 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7332 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 7333 self.text.AppendText(st)
d55e5bfc 7334 self.frame.Show(True)
2131d850 7335 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
d55e5bfc
RD
7336
7337
7338 def OnCloseWindow(self, event):
7339 if self.frame is not None:
7340 self.frame.Destroy()
7341 self.frame = None
7342 self.text = None
7343
7344
7345 # These methods provide the file-like output behaviour.
7346 def write(self, text):
7347 """
7348 Create the output window if needed and write the string to it.
7349 If not called in the context of the gui thread then uses
7350 CallAfter to do the work there.
7351 """
7352 if self.frame is None:
7353 if not wx.Thread_IsMain():
7354 wx.CallAfter(self.CreateOutputWindow, text)
7355 else:
7356 self.CreateOutputWindow(text)
7357 else:
7358 if not wx.Thread_IsMain():
7359 wx.CallAfter(self.text.AppendText, text)
7360 else:
7361 self.text.AppendText(text)
7362
7363
7364 def close(self):
7365 if self.frame is not None:
7366 wx.CallAfter(self.frame.Close)
7367
7368
bb4524c4
RD
7369 def flush(self):
7370 pass
7371
7372
d55e5bfc
RD
7373
7374#----------------------------------------------------------------------
7375
7376_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
fc46b7f3 7377
d55e5bfc
RD
7378class App(wx.PyApp):
7379 """
d6c14a4c
RD
7380 The ``wx.App`` class represents the application and is used to:
7381
7382 * bootstrap the wxPython system and initialize the underlying
7383 gui toolkit
7384 * set and get application-wide properties
7385 * implement the windowing system main message or event loop,
7386 and to dispatch events to window instances
7387 * etc.
7388
7389 Every application must have a ``wx.App`` instance, and all
7390 creation of UI objects should be delayed until after the
7391 ``wx.App`` object has been created in order to ensure that the gui
7392 platform and wxWidgets have been fully initialized.
7393
7394 Normally you would derive from this class and implement an
7395 ``OnInit`` method that creates a frame and then calls
7396 ``self.SetTopWindow(frame)``.
7397
7398 :see: `wx.PySimpleApp` for a simpler app class that can be used
15817c7e 7399 directly.
d55e5bfc 7400 """
d6c14a4c 7401
d55e5bfc
RD
7402 outputWindowClass = PyOnDemandOutputWindow
7403
d6c14a4c
RD
7404 def __init__(self, redirect=_defRedirect, filename=None,
7405 useBestVisual=False, clearSigInt=True):
7406 """
7407 Construct a ``wx.App`` object.
7408
7409 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7410 redirected? Defaults to True on Windows and Mac, False
7411 otherwise. If `filename` is None then output will be
7412 redirected to a window that pops up as needed. (You can
7413 control what kind of window is created for the output by
7414 resetting the class variable ``outputWindowClass`` to a
7415 class of your choosing.)
7416
7417 :param filename: The name of a file to redirect output to, if
7418 redirect is True.
7419
7420 :param useBestVisual: Should the app try to use the best
7421 available visual provided by the system (only relevant on
7422 systems that have more than one visual.) This parameter
7423 must be used instead of calling `SetUseBestVisual` later
7424 on because it must be set before the underlying GUI
7425 toolkit is initialized.
7426
7427 :param clearSigInt: Should SIGINT be cleared? This allows the
7428 app to terminate upon a Ctrl-C in the console like other
7429 GUI apps will.
7430
7431 :note: You should override OnInit to do applicaition
7432 initialization to ensure that the system, toolkit and
7433 wxWidgets are fully initialized.
7434 """
fc46b7f3 7435
d55e5bfc
RD
7436 wx.PyApp.__init__(self)
7437
fc46b7f3 7438 # make sure we can create a GUI
33d6fd3b 7439 if not self.IsDisplayAvailable():
fc46b7f3
RD
7440
7441 if wx.Platform == "__WXMAC__":
7442 msg = """This program needs access to the screen.
7443Please run with 'pythonw', not 'python', and only when you are logged
7444in on the main display of your Mac."""
7445
7446 elif wx.Platform == "__WXGTK__":
7447 msg ="Unable to access the X Display, is $DISPLAY set properly?"
d55e5bfc 7448
fc46b7f3
RD
7449 else:
7450 msg = "Unable to create GUI"
7451 # TODO: more description is needed for wxMSW...
7452
7453 raise SystemExit(msg)
7454
d55e5bfc
RD
7455 # This has to be done before OnInit
7456 self.SetUseBestVisual(useBestVisual)
7457
7458 # Set the default handler for SIGINT. This fixes a problem
7459 # where if Ctrl-C is pressed in the console that started this
7460 # app then it will not appear to do anything, (not even send
7461 # KeyboardInterrupt???) but will later segfault on exit. By
7462 # setting the default handler then the app will exit, as
7463 # expected (depending on platform.)
d6c14a4c
RD
7464 if clearSigInt:
7465 try:
7466 import signal
7467 signal.signal(signal.SIGINT, signal.SIG_DFL)
7468 except:
7469 pass
d55e5bfc
RD
7470
7471 # Save and redirect the stdio to a window?
7472 self.stdioWin = None
7473 self.saveStdio = (_sys.stdout, _sys.stderr)
7474 if redirect:
7475 self.RedirectStdio(filename)
7476
8fb0e70a
RD
7477 # Use Python's install prefix as the default
7478 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7479
d55e5bfc
RD
7480 # This finishes the initialization of wxWindows and then calls
7481 # the OnInit that should be present in the derived class
7482 self._BootstrapApp()
7483
7484
2131d850
RD
7485 def OnPreInit(self):
7486 """
7487 Things that must be done after _BootstrapApp has done its
7488 thing, but would be nice if they were already done by the time
7489 that OnInit is called.
7490 """
7491 wx.StockGDI._initStockObjects()
7492
7493
66af7a75
RD
7494 def __del__(self, destroy=wx.PyApp.__del__):
7495 self.RestoreStdio() # Just in case the MainLoop was overridden
7496 destroy(self)
d55e5bfc 7497
7993762b 7498 def Destroy(self):
b39fe951 7499 self.this.own(False)
7993762b 7500 wx.PyApp.Destroy(self)
d55e5bfc
RD
7501
7502 def SetTopWindow(self, frame):
7503 """Set the \"main\" top level window"""
7504 if self.stdioWin:
7505 self.stdioWin.SetParent(frame)
7506 wx.PyApp.SetTopWindow(self, frame)
7507
7508
7509 def MainLoop(self):
7510 """Execute the main GUI event loop"""
7511 wx.PyApp.MainLoop(self)
7512 self.RestoreStdio()
7513
7514
7515 def RedirectStdio(self, filename=None):
7516 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7517 if filename:
7518 _sys.stdout = _sys.stderr = open(filename, 'a')
7519 else:
7520 self.stdioWin = self.outputWindowClass()
7521 _sys.stdout = _sys.stderr = self.stdioWin
7522
7523
7524 def RestoreStdio(self):
66af7a75
RD
7525 try:
7526 _sys.stdout, _sys.stderr = self.saveStdio
7527 except:
7528 pass
d55e5bfc
RD
7529
7530
412d302d
RD
7531 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7532 """
7533 Set the title, position and/or size of the output window if
f5b96ee1
RD
7534 the stdio has been redirected. This should be called before
7535 any output would cause the output window to be created.
412d302d
RD
7536 """
7537 if self.stdioWin:
7538 if title is not None:
7539 self.stdioWin.title = title
7540 if pos is not None:
7541 self.stdioWin.pos = pos
7542 if size is not None:
7543 self.stdioWin.size = size
7544
7545
7546
d55e5bfc 7547
d6c14a4c 7548# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7549App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7550App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7551App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7552App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7553App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7554App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7555App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7556App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7557App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7558App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7559App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7560
7561#----------------------------------------------------------------------------
7562
7563class PySimpleApp(wx.App):
7564 """
7565 A simple application class. You can just create one of these and
7566 then then make your top level windows later, and not have to worry
d6c14a4c 7567 about OnInit. For example::
d55e5bfc 7568
d6c14a4c
RD
7569 app = wx.PySimpleApp()
7570 frame = wx.Frame(None, title='Hello World')
7571 frame.Show()
7572 app.MainLoop()
7573
7574 :see: `wx.App`
7575 """
7576
7577 def __init__(self, redirect=False, filename=None,
7578 useBestVisual=False, clearSigInt=True):
7579 """
7580 :see: `wx.App.__init__`
7581 """
7582 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7583
7584 def OnInit(self):
d55e5bfc
RD
7585 return True
7586
7587
d6c14a4c 7588
d55e5bfc
RD
7589# Is anybody using this one?
7590class PyWidgetTester(wx.App):
7591 def __init__(self, size = (250, 100)):
7592 self.size = size
7593 wx.App.__init__(self, 0)
7594
7595 def OnInit(self):
7596 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7597 self.SetTopWindow(self.frame)
7598 return True
7599
d6c14a4c
RD
7600 def SetWidget(self, widgetClass, *args, **kwargs):
7601 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7602 self.frame.Show(True)
7603
7604#----------------------------------------------------------------------------
7605# DO NOT hold any other references to this object. This is how we
d6c14a4c 7606# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7607# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
d6c14a4c 7608# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7609
7610class __wxPyCleanup:
7611 def __init__(self):
7612 self.cleanup = _core_.App_CleanUp
7613 def __del__(self):
7614 self.cleanup()
7615
7616_sys.__wxPythonCleanup = __wxPyCleanup()
7617
7618## # another possible solution, but it gets called too early...
d6c14a4c
RD
7619## import atexit
7620## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7621
7622
7623#----------------------------------------------------------------------------
7624
7625#---------------------------------------------------------------------------
7626
5b5c9bc7
RD
7627class EventLoop(object):
7628 """Proxy of C++ EventLoop class"""
1bd55598
RD
7629 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7630 __repr__ = _swig_repr
7631 def __init__(self, *args, **kwargs):
5b5c9bc7 7632 """__init__(self) -> EventLoop"""
1bd55598
RD
7633 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7634 __swig_destroy__ = _core_.delete_EventLoop
7635 __del__ = lambda self : None;
b411df4a
RD
7636 def Run(*args, **kwargs):
7637 """Run(self) -> int"""
5b5c9bc7 7638 return _core_.EventLoop_Run(*args, **kwargs)
b411df4a
RD
7639
7640 def Exit(*args, **kwargs):
7641 """Exit(self, int rc=0)"""
5b5c9bc7 7642 return _core_.EventLoop_Exit(*args, **kwargs)
b411df4a
RD
7643
7644 def Pending(*args, **kwargs):
7645 """Pending(self) -> bool"""
5b5c9bc7 7646 return _core_.EventLoop_Pending(*args, **kwargs)
b411df4a
RD
7647
7648 def Dispatch(*args, **kwargs):
7649 """Dispatch(self) -> bool"""
5b5c9bc7 7650 return _core_.EventLoop_Dispatch(*args, **kwargs)
b411df4a
RD
7651
7652 def IsRunning(*args, **kwargs):
7653 """IsRunning(self) -> bool"""
5b5c9bc7 7654 return _core_.EventLoop_IsRunning(*args, **kwargs)
b411df4a
RD
7655
7656 def GetActive(*args, **kwargs):
5b5c9bc7
RD
7657 """GetActive() -> EventLoop"""
7658 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a
RD
7659
7660 GetActive = staticmethod(GetActive)
7661 def SetActive(*args, **kwargs):
5b5c9bc7
RD
7662 """SetActive(EventLoop loop)"""
7663 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a
RD
7664
7665 SetActive = staticmethod(SetActive)
2131d850 7666_core_.EventLoop_swigregister(EventLoop)
b411df4a 7667
1bd55598
RD
7668def EventLoop_GetActive(*args):
7669 """EventLoop_GetActive() -> EventLoop"""
7670 return _core_.EventLoop_GetActive(*args)
b411df4a 7671
5b5c9bc7 7672def EventLoop_SetActive(*args, **kwargs):
1bd55598
RD
7673 """EventLoop_SetActive(EventLoop loop)"""
7674 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a 7675
32fe5131
RD
7676class EventLoopActivator(object):
7677 """Proxy of C++ EventLoopActivator class"""
1bd55598
RD
7678 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7679 __repr__ = _swig_repr
7680 def __init__(self, *args, **kwargs):
32fe5131 7681 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
1bd55598
RD
7682 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7683 __swig_destroy__ = _core_.delete_EventLoopActivator
7684 __del__ = lambda self : None;
2131d850 7685_core_.EventLoopActivator_swigregister(EventLoopActivator)
32fe5131 7686
b411df4a
RD
7687#---------------------------------------------------------------------------
7688
eec1c382
RD
7689ACCEL_ALT = _core_.ACCEL_ALT
7690ACCEL_CTRL = _core_.ACCEL_CTRL
7691ACCEL_SHIFT = _core_.ACCEL_SHIFT
7692ACCEL_NORMAL = _core_.ACCEL_NORMAL
7693ACCEL_CMD = _core_.ACCEL_CMD
5b5c9bc7 7694class AcceleratorEntry(object):
d6c14a4c
RD
7695 """
7696 A class used to define items in an `wx.AcceleratorTable`. wxPython
7697 programs can choose to use wx.AcceleratorEntry objects, but using a
7698 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
15817c7e 7699 as well. See `__init__` for of the tuple values.
d6c14a4c
RD
7700
7701 :see: `wx.AcceleratorTable`
7702 """
1bd55598
RD
7703 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7704 __repr__ = _swig_repr
7705 def __init__(self, *args, **kwargs):
d6c14a4c 7706 """
5b5c9bc7 7707 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
d6c14a4c
RD
7708
7709 Construct a wx.AcceleratorEntry.
d6c14a4c 7710 """
1bd55598
RD
7711 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7712 __swig_destroy__ = _core_.delete_AcceleratorEntry
7713 __del__ = lambda self : None;
d55e5bfc 7714 def Set(*args, **kwargs):
d6c14a4c
RD
7715 """
7716 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 7717
d6c14a4c
RD
7718 (Re)set the attributes of a wx.AcceleratorEntry.
7719 :see `__init__`
7720 """
5b5c9bc7 7721 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc 7722
ac5d357a
RD
7723 def Create(*args, **kwargs):
7724 """
7725 Create(String str) -> AcceleratorEntry
7726
7727 Create accelerator corresponding to the specified string, or None if
7728 it coulnd't be parsed.
7729 """
7730 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7731
7732 Create = staticmethod(Create)
d55e5bfc 7733 def GetFlags(*args, **kwargs):
d6c14a4c
RD
7734 """
7735 GetFlags(self) -> int
7736
7737 Get the AcceleratorEntry's flags.
7738 """
5b5c9bc7 7739 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
d55e5bfc
RD
7740
7741 def GetKeyCode(*args, **kwargs):
d6c14a4c
RD
7742 """
7743 GetKeyCode(self) -> int
7744
7745 Get the AcceleratorEntry's keycode.
7746 """
5b5c9bc7 7747 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
7748
7749 def GetCommand(*args, **kwargs):
d6c14a4c
RD
7750 """
7751 GetCommand(self) -> int
7752
7753 Get the AcceleratorEntry's command ID.
7754 """
5b5c9bc7 7755 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
d55e5bfc 7756
ac5d357a
RD
7757 def IsOk(*args, **kwargs):
7758 """IsOk(self) -> bool"""
7759 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
7760
7761 def ToString(*args, **kwargs):
7762 """
7763 ToString(self) -> String
7764
7765 Returns a string representation for the this accelerator. The string
7766 is formatted using the <flags>-<keycode> format where <flags> maybe a
7767 hyphen-separed list of "shift|alt|ctrl"
7768
7769 """
7770 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
7771
7772 def FromString(*args, **kwargs):
7773 """
7774 FromString(self, String str) -> bool
7775
7776 Returns true if the given string correctly initialized this object.
7777 """
7778 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
7779
2bf58437
RD
7780 Command = property(GetCommand,doc="See `GetCommand`")
7781 Flags = property(GetFlags,doc="See `GetFlags`")
7782 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
2131d850 7783_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
d55e5bfc 7784
ac5d357a
RD
7785def AcceleratorEntry_Create(*args, **kwargs):
7786 """
7787 AcceleratorEntry_Create(String str) -> AcceleratorEntry
7788
7789 Create accelerator corresponding to the specified string, or None if
7790 it coulnd't be parsed.
7791 """
7792 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7793
5b5c9bc7 7794class AcceleratorTable(Object):
d6c14a4c
RD
7795 """
7796 An accelerator table allows the application to specify a table of
7797 keyboard shortcuts for menus or other commands. On Windows, menu or
7798 button commands are supported; on GTK, only menu commands are
7799 supported.
d6c14a4c 7800 """
1bd55598
RD
7801 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7802 __repr__ = _swig_repr
7803 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7804 """
7805 __init__(entries) -> AcceleratorTable
7806
d6c14a4c
RD
7807 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7808 items or or of 3-tuples (flags, keyCode, cmdID)
7809
7810 :see: `wx.AcceleratorEntry`
d55e5bfc 7811 """
1bd55598
RD
7812 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7813 __swig_destroy__ = _core_.delete_AcceleratorTable
7814 __del__ = lambda self : None;
b39fe951
RD
7815 def IsOk(*args, **kwargs):
7816 """IsOk(self) -> bool"""
7817 return _core_.AcceleratorTable_IsOk(*args, **kwargs)
d55e5bfc 7818
b39fe951 7819 Ok = IsOk
2131d850 7820_core_.AcceleratorTable_swigregister(AcceleratorTable)
d55e5bfc
RD
7821
7822
5b5c9bc7 7823def GetAccelFromString(*args, **kwargs):
1bd55598
RD
7824 """GetAccelFromString(String label) -> AcceleratorEntry"""
7825 return _core_.GetAccelFromString(*args, **kwargs)
d55e5bfc
RD
7826#---------------------------------------------------------------------------
7827
5b5c9bc7 7828class VisualAttributes(object):
d55e5bfc 7829 """struct containing all the visual attributes of a control"""
1bd55598
RD
7830 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7831 __repr__ = _swig_repr
7832 def __init__(self, *args, **kwargs):
d55e5bfc 7833 """
5b5c9bc7 7834 __init__(self) -> VisualAttributes
d55e5bfc
RD
7835
7836 struct containing all the visual attributes of a control
7837 """
1bd55598
RD
7838 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7839 __swig_destroy__ = _core_.delete_VisualAttributes
7840 __del__ = lambda self : None;
5b5c9bc7
RD
7841 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7842 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7843 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 7844_core_.VisualAttributes_swigregister(VisualAttributes)
5b5c9bc7 7845NullAcceleratorTable = cvar.NullAcceleratorTable
d55e5bfc
RD
7846PanelNameStr = cvar.PanelNameStr
7847
5b5c9bc7
RD
7848WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7849WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7850WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7851WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7852WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7853class Window(EvtHandler):
d55e5bfc
RD
7854 """
7855 wx.Window is the base class for all windows and represents any visible
7856 object on the screen. All controls, top level windows and so on are
7857 wx.Windows. Sizers and device contexts are not however, as they don't
7858 appear on screen themselves.
7859
7860 """
1bd55598
RD
7861 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7862 __repr__ = _swig_repr
7863 def __init__(self, *args, **kwargs):
d55e5bfc 7864 """
5b5c9bc7
RD
7865 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7866 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
d55e5bfc
RD
7867
7868 Construct and show a generic Window.
7869 """
1bd55598 7870 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d55e5bfc
RD
7871 self._setOORInfo(self)
7872
7873 def Create(*args, **kwargs):
7874 """
5b5c9bc7
RD
7875 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7876 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
d55e5bfc
RD
7877
7878 Create the GUI part of the Window for 2-phase creation mode.
7879 """
5b5c9bc7 7880 return _core_.Window_Create(*args, **kwargs)
d55e5bfc
RD
7881
7882 def Close(*args, **kwargs):
7883 """
7884 Close(self, bool force=False) -> bool
7885
7886 This function simply generates a EVT_CLOSE event whose handler usually
7887 tries to close the window. It doesn't close the window itself,
7888 however. If force is False (the default) then the window's close
7889 handler will be allowed to veto the destruction of the window.
d55e5bfc 7890 """
5b5c9bc7 7891 return _core_.Window_Close(*args, **kwargs)
d55e5bfc
RD
7892
7893 def Destroy(*args, **kwargs):
7894 """
7895 Destroy(self) -> bool
7896
7897 Destroys the window safely. Frames and dialogs are not destroyed
7898 immediately when this function is called -- they are added to a list
7899 of windows to be deleted on idle time, when all the window's events
7900 have been processed. This prevents problems with events being sent to
7901 non-existent windows.
7902
7903 Returns True if the window has either been successfully deleted, or it
7904 has been added to the list of windows pending real deletion.
7905 """
b39fe951
RD
7906 args[0].this.own(False)
7907 return _core_.Window_Destroy(*args, **kwargs)
d55e5bfc
RD
7908
7909 def DestroyChildren(*args, **kwargs):
7910 """
7911 DestroyChildren(self) -> bool
7912
15817c7e
RD
7913 Destroys all children of a window. Called automatically by the
7914 destructor.
d55e5bfc 7915 """
5b5c9bc7 7916 return _core_.Window_DestroyChildren(*args, **kwargs)
d55e5bfc
RD
7917
7918 def IsBeingDeleted(*args, **kwargs):
7919 """
7920 IsBeingDeleted(self) -> bool
7921
7922 Is the window in the process of being deleted?
7923 """
5b5c9bc7 7924 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d55e5bfc 7925
d55e5bfc
RD
7926 def SetLabel(*args, **kwargs):
7927 """
5b5c9bc7 7928 SetLabel(self, String label)
d55e5bfc
RD
7929
7930 Set the text which the window shows in its label if applicable.
7931 """
5b5c9bc7 7932 return _core_.Window_SetLabel(*args, **kwargs)
d55e5bfc
RD
7933
7934 def GetLabel(*args, **kwargs):
7935 """
5b5c9bc7 7936 GetLabel(self) -> String
d55e5bfc 7937
15817c7e
RD
7938 Generic way of getting a label from any window, for identification
7939 purposes. The interpretation of this function differs from class to
7940 class. For frames and dialogs, the value returned is the title. For
7941 buttons or static text controls, it is the button text. This function
7942 can be useful for meta-programs such as testing tools or special-needs
7943 access programs)which need to identify windows by name.
d55e5bfc 7944 """
5b5c9bc7 7945 return _core_.Window_GetLabel(*args, **kwargs)
d55e5bfc
RD
7946
7947 def SetName(*args, **kwargs):
7948 """
5b5c9bc7 7949 SetName(self, String name)
d55e5bfc 7950
15817c7e
RD
7951 Sets the window's name. The window name is used for ressource setting
7952 in X, it is not the same as the window title/label
d55e5bfc 7953 """
5b5c9bc7 7954 return _core_.Window_SetName(*args, **kwargs)
d55e5bfc
RD
7955
7956 def GetName(*args, **kwargs):
7957 """
5b5c9bc7 7958 GetName(self) -> String
d55e5bfc 7959
15817c7e
RD
7960 Returns the windows name. This name is not guaranteed to be unique;
7961 it is up to the programmer to supply an appropriate name in the window
7962 constructor or via wx.Window.SetName.
d55e5bfc 7963 """
5b5c9bc7 7964 return _core_.Window_GetName(*args, **kwargs)
d55e5bfc
RD
7965
7966 def SetWindowVariant(*args, **kwargs):
7967 """
7968 SetWindowVariant(self, int variant)
7969
15817c7e
RD
7970 Sets the variant of the window/font size to use for this window, if
7971 the platform supports variants, for example, wxMac.
d55e5bfc 7972 """
5b5c9bc7 7973 return _core_.Window_SetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7974
7975 def GetWindowVariant(*args, **kwargs):
7976 """GetWindowVariant(self) -> int"""
5b5c9bc7 7977 return _core_.Window_GetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7978
7979 def SetId(*args, **kwargs):
7980 """
7981 SetId(self, int winid)
7982
7983 Sets the identifier of the window. Each window has an integer
7984 identifier. If the application has not provided one, an identifier
7985 will be generated. Normally, the identifier should be provided on
7986 creation and should not be modified subsequently.
7987 """
5b5c9bc7 7988 return _core_.Window_SetId(*args, **kwargs)
d55e5bfc
RD
7989
7990 def GetId(*args, **kwargs):
7991 """
7992 GetId(self) -> int
7993
7994 Returns the identifier of the window. Each window has an integer
7995 identifier. If the application has not provided one (or the default Id
7996 -1 is used) then an unique identifier with a negative value will be
7997 generated.
7998 """
5b5c9bc7 7999 return _core_.Window_GetId(*args, **kwargs)
d55e5bfc
RD
8000
8001 def NewControlId(*args, **kwargs):
8002 """
d6c14a4c 8003 NewControlId() -> int
d55e5bfc
RD
8004
8005 Generate a control id for the controls which were not given one.
8006 """
5b5c9bc7 8007 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc
RD
8008
8009 NewControlId = staticmethod(NewControlId)
8010 def NextControlId(*args, **kwargs):
8011 """
d6c14a4c 8012 NextControlId(int winid) -> int
d55e5bfc
RD
8013
8014 Get the id of the control following the one with the given
15817c7e 8015 autogenerated) id
d55e5bfc 8016 """
5b5c9bc7 8017 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
8018
8019 NextControlId = staticmethod(NextControlId)
8020 def PrevControlId(*args, **kwargs):
8021 """
d6c14a4c 8022 PrevControlId(int winid) -> int
d55e5bfc
RD
8023
8024 Get the id of the control preceding the one with the given
15817c7e 8025 autogenerated) id
d55e5bfc 8026 """
5b5c9bc7 8027 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc
RD
8028
8029 PrevControlId = staticmethod(PrevControlId)
ac5d357a
RD
8030 def GetLayoutDirection(*args, **kwargs):
8031 """
994453b8 8032 GetLayoutDirection(self) -> int
ac5d357a
RD
8033
8034 Get the layout direction (LTR or RTL) for this window. Returns
8035 ``wx.Layout_Default`` if layout direction is not supported.
8036 """
8037 return _core_.Window_GetLayoutDirection(*args, **kwargs)
8038
8039 def SetLayoutDirection(*args, **kwargs):
8040 """
994453b8 8041 SetLayoutDirection(self, int dir)
ac5d357a
RD
8042
8043 Set the layout direction (LTR or RTL) for this window.
8044 """
8045 return _core_.Window_SetLayoutDirection(*args, **kwargs)
8046
8047 def AdjustForLayoutDirection(*args, **kwargs):
8048 """
8049 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
8050
8051 Mirror coordinates for RTL layout if this window uses it and if the
8052 mirroring is not done automatically like Win32.
8053 """
8054 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
8055
d55e5bfc
RD
8056 def SetSize(*args, **kwargs):
8057 """
5b5c9bc7 8058 SetSize(self, Size size)
d55e5bfc
RD
8059
8060 Sets the size of the window in pixels.
8061 """
5b5c9bc7 8062 return _core_.Window_SetSize(*args, **kwargs)
d55e5bfc
RD
8063
8064 def SetDimensions(*args, **kwargs):
8065 """
5b5c9bc7 8066 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
8067
8068 Sets the position and size of the window in pixels. The sizeFlags
8069 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
8070 equal to -1.
8071
8072 ======================== ======================================
8073 wx.SIZE_AUTO A -1 indicates that a class-specific
8074 default should be used.
8075 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8076 -1 values are supplied.
8077 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8078 interpreted as real dimensions, not
8079 default values.
8080 ======================== ======================================
8081
d55e5bfc 8082 """
5b5c9bc7 8083 return _core_.Window_SetDimensions(*args, **kwargs)
d55e5bfc
RD
8084
8085 def SetRect(*args, **kwargs):
8086 """
5b5c9bc7 8087 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
8088
8089 Sets the position and size of the window in pixels using a wx.Rect.
8090 """
5b5c9bc7 8091 return _core_.Window_SetRect(*args, **kwargs)
d55e5bfc
RD
8092
8093 def SetSizeWH(*args, **kwargs):
8094 """
8095 SetSizeWH(self, int width, int height)
8096
8097 Sets the size of the window in pixels.
8098 """
5b5c9bc7 8099 return _core_.Window_SetSizeWH(*args, **kwargs)
d55e5bfc
RD
8100
8101 def Move(*args, **kwargs):
8102 """
5b5c9bc7 8103 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
8104
8105 Moves the window to the given position.
8106 """
5b5c9bc7 8107 return _core_.Window_Move(*args, **kwargs)
d55e5bfc
RD
8108
8109 SetPosition = Move
8110 def MoveXY(*args, **kwargs):
8111 """
5b5c9bc7 8112 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
8113
8114 Moves the window to the given position.
8115 """
5b5c9bc7 8116 return _core_.Window_MoveXY(*args, **kwargs)
d55e5bfc 8117
f8167d6e
RD
8118 def SetBestFittingSize(*args, **kwargs):
8119 """
5b5c9bc7 8120 SetBestFittingSize(self, Size size=DefaultSize)
f8167d6e
RD
8121
8122 A 'Smart' SetSize that will fill in default size components with the
8123 window's *best size* values. Also set's the minsize for use with sizers.
8124 """
5b5c9bc7 8125 return _core_.Window_SetBestFittingSize(*args, **kwargs)
f8167d6e 8126
d55e5bfc
RD
8127 def Raise(*args, **kwargs):
8128 """
8129 Raise(self)
8130
943e8dfd
RD
8131 Raises the window to the top of the window hierarchy. In current
8132 version of wxWidgets this works both for manage and child windows.
d55e5bfc 8133 """
5b5c9bc7 8134 return _core_.Window_Raise(*args, **kwargs)
d55e5bfc
RD
8135
8136 def Lower(*args, **kwargs):
8137 """
8138 Lower(self)
8139
943e8dfd
RD
8140 Lowers the window to the bottom of the window hierarchy. In current
8141 version of wxWidgets this works both for manage and child windows.
d55e5bfc 8142 """
5b5c9bc7 8143 return _core_.Window_Lower(*args, **kwargs)
d55e5bfc
RD
8144
8145 def SetClientSize(*args, **kwargs):
8146 """
5b5c9bc7 8147 SetClientSize(self, Size size)
d55e5bfc
RD
8148
8149 This sets the size of the window client area in pixels. Using this
8150 function to size a window tends to be more device-independent than
8151 wx.Window.SetSize, since the application need not worry about what
8152 dimensions the border or title bar have when trying to fit the window
8153 around panel items, for example.
8154 """
5b5c9bc7 8155 return _core_.Window_SetClientSize(*args, **kwargs)
d55e5bfc
RD
8156
8157 def SetClientSizeWH(*args, **kwargs):
8158 """
8159 SetClientSizeWH(self, int width, int height)
8160
8161 This sets the size of the window client area in pixels. Using this
8162 function to size a window tends to be more device-independent than
8163 wx.Window.SetSize, since the application need not worry about what
8164 dimensions the border or title bar have when trying to fit the window
8165 around panel items, for example.
8166 """
5b5c9bc7 8167 return _core_.Window_SetClientSizeWH(*args, **kwargs)
d55e5bfc
RD
8168
8169 def SetClientRect(*args, **kwargs):
8170 """
5b5c9bc7 8171 SetClientRect(self, Rect rect)
d55e5bfc
RD
8172
8173 This sets the size of the window client area in pixels. Using this
8174 function to size a window tends to be more device-independent than
8175 wx.Window.SetSize, since the application need not worry about what
8176 dimensions the border or title bar have when trying to fit the window
8177 around panel items, for example.
8178 """
5b5c9bc7 8179 return _core_.Window_SetClientRect(*args, **kwargs)
d55e5bfc
RD
8180
8181 def GetPosition(*args, **kwargs):
8182 """
5b5c9bc7 8183 GetPosition(self) -> Point
d55e5bfc 8184
1c71765a
RD
8185 Get the window's position. Notice that the position is in client
8186 coordinates for child windows and screen coordinates for the top level
8187 ones, use `GetScreenPosition` if you need screen coordinates for all
8188 kinds of windows.
d55e5bfc 8189 """
5b5c9bc7 8190 return _core_.Window_GetPosition(*args, **kwargs)
d55e5bfc
RD
8191
8192 def GetPositionTuple(*args, **kwargs):
8193 """
8194 GetPositionTuple() -> (x,y)
8195
1c71765a
RD
8196 Get the window's position. Notice that the position is in client
8197 coordinates for child windows and screen coordinates for the top level
8198 ones, use `GetScreenPosition` if you need screen coordinates for all
8199 kinds of windows.
d55e5bfc 8200 """
5b5c9bc7 8201 return _core_.Window_GetPositionTuple(*args, **kwargs)
d55e5bfc 8202
1c71765a
RD
8203 def GetScreenPosition(*args, **kwargs):
8204 """
8205 GetScreenPosition(self) -> Point
8206
8207 Get the position of the window in screen coordinantes.
8208 """
8209 return _core_.Window_GetScreenPosition(*args, **kwargs)
8210
8211 def GetScreenPositionTuple(*args, **kwargs):
8212 """
8213 GetScreenPositionTuple() -> (x,y)
8214
8215 Get the position of the window in screen coordinantes.
8216 """
8217 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8218
8219 def GetScreenRect(*args, **kwargs):
8220 """
8221 GetScreenRect(self) -> Rect
8222
8223 Returns the size and position of the window in screen coordinantes as
8224 a `wx.Rect` object.
8225 """
8226 return _core_.Window_GetScreenRect(*args, **kwargs)
8227
d55e5bfc
RD
8228 def GetSize(*args, **kwargs):
8229 """
5b5c9bc7 8230 GetSize(self) -> Size
d55e5bfc
RD
8231
8232 Get the window size.
8233 """
5b5c9bc7 8234 return _core_.Window_GetSize(*args, **kwargs)
d55e5bfc
RD
8235
8236 def GetSizeTuple(*args, **kwargs):
8237 """
8238 GetSizeTuple() -> (width, height)
8239
8240 Get the window size.
8241 """
5b5c9bc7 8242 return _core_.Window_GetSizeTuple(*args, **kwargs)
d55e5bfc
RD
8243
8244 def GetRect(*args, **kwargs):
8245 """
5b5c9bc7 8246 GetRect(self) -> Rect
d55e5bfc 8247
1c71765a 8248 Returns the size and position of the window as a `wx.Rect` object.
d55e5bfc 8249 """
5b5c9bc7 8250 return _core_.Window_GetRect(*args, **kwargs)
d55e5bfc
RD
8251
8252 def GetClientSize(*args, **kwargs):
8253 """
5b5c9bc7 8254 GetClientSize(self) -> Size
d55e5bfc
RD
8255
8256 This gets the size of the window's 'client area' in pixels. The client
8257 area is the area which may be drawn on by the programmer, excluding
8258 title bar, border, scrollbars, etc.
8259 """
5b5c9bc7 8260 return _core_.Window_GetClientSize(*args, **kwargs)
d55e5bfc
RD
8261
8262 def GetClientSizeTuple(*args, **kwargs):
8263 """
8264 GetClientSizeTuple() -> (width, height)
8265
8266 This gets the size of the window's 'client area' in pixels. The client
8267 area is the area which may be drawn on by the programmer, excluding
8268 title bar, border, scrollbars, etc.
8269 """
5b5c9bc7 8270 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
d55e5bfc
RD
8271
8272 def GetClientAreaOrigin(*args, **kwargs):
8273 """
5b5c9bc7 8274 GetClientAreaOrigin(self) -> Point
d55e5bfc
RD
8275
8276 Get the origin of the client area of the window relative to the
8277 window's top left corner (the client area may be shifted because of
8278 the borders, scrollbars, other decorations...)
8279 """
5b5c9bc7 8280 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
d55e5bfc
RD
8281
8282 def GetClientRect(*args, **kwargs):
8283 """
5b5c9bc7 8284 GetClientRect(self) -> Rect
d55e5bfc 8285
0439c23b 8286 Get the client area position and size as a `wx.Rect` object.
d55e5bfc 8287 """
5b5c9bc7 8288 return _core_.Window_GetClientRect(*args, **kwargs)
d55e5bfc
RD
8289
8290 def GetBestSize(*args, **kwargs):
8291 """
5b5c9bc7 8292 GetBestSize(self) -> Size
d55e5bfc 8293
bfddbb17 8294 This function returns the best acceptable minimal size for the
15817c7e
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 8300 """
5b5c9bc7 8301 return _core_.Window_GetBestSize(*args, **kwargs)
d55e5bfc
RD
8302
8303 def GetBestSizeTuple(*args, **kwargs):
8304 """
8305 GetBestSizeTuple() -> (width, height)
8306
bfddbb17 8307 This function returns the best acceptable minimal size for the
15817c7e
RD
8308 window, if applicable. For example, for a static text control, it will
8309 be the minimal size such that the control label is not truncated. For
8310 windows containing subwindows (suzh aswx.Panel), the size returned by
8311 this function will be the same as the size the window would have had
8312 after calling Fit.
d55e5bfc 8313 """
5b5c9bc7 8314 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
d55e5bfc 8315
a001823c
RD
8316 def InvalidateBestSize(*args, **kwargs):
8317 """
8318 InvalidateBestSize(self)
8319
8320 Reset the cached best size value so it will be recalculated the next
8321 time it is needed.
8322 """
5b5c9bc7 8323 return _core_.Window_InvalidateBestSize(*args, **kwargs)
a001823c 8324
e2813725
RD
8325 def CacheBestSize(*args, **kwargs):
8326 """
8327 CacheBestSize(self, Size size)
8328
8329 Cache the best size so it doesn't need to be calculated again, (at least until
8330 some properties of the window change.)
8331 """
8332 return _core_.Window_CacheBestSize(*args, **kwargs)
8333
a001823c
RD
8334 def GetBestFittingSize(*args, **kwargs):
8335 """
5b5c9bc7 8336 GetBestFittingSize(self) -> Size
a001823c
RD
8337
8338 This function will merge the window's best size into the window's
8339 minimum size, giving priority to the min size components, and returns
8340 the results.
8341
8342 """
5b5c9bc7 8343 return _core_.Window_GetBestFittingSize(*args, **kwargs)
a001823c 8344
d55e5bfc
RD
8345 def GetAdjustedBestSize(*args, **kwargs):
8346 """
5b5c9bc7 8347 GetAdjustedBestSize(self) -> Size
d55e5bfc
RD
8348
8349 This method is similar to GetBestSize, except in one
8350 thing. GetBestSize should return the minimum untruncated size of the
8351 window, while this method will return the largest of BestSize and any
8352 user specified minimum size. ie. it is the minimum size the window
8353 should currently be drawn at, not the minimal size it can possibly
8354 tolerate.
8355 """
5b5c9bc7 8356 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
d55e5bfc
RD
8357
8358 def Center(*args, **kwargs):
8359 """
5b5c9bc7 8360 Center(self, int direction=BOTH)
d55e5bfc
RD
8361
8362 Centers the window. The parameter specifies the direction for
8363 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8364 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8365 on the entire screen and not on its parent window. If it is a
8366 top-level window and has no parent then it will always be centered
8367 relative to the screen.
8368 """
5b5c9bc7 8369 return _core_.Window_Center(*args, **kwargs)
d55e5bfc
RD
8370
8371 Centre = Center
d55e5bfc
RD
8372 def CenterOnParent(*args, **kwargs):
8373 """
5b5c9bc7 8374 CenterOnParent(self, int dir=BOTH)
d55e5bfc
RD
8375
8376 Center with respect to the the parent window
8377 """
5b5c9bc7 8378 return _core_.Window_CenterOnParent(*args, **kwargs)
d55e5bfc
RD
8379
8380 CentreOnParent = CenterOnParent
8381 def Fit(*args, **kwargs):
8382 """
8383 Fit(self)
8384
8385 Sizes the window so that it fits around its subwindows. This function
8386 won't do anything if there are no subwindows and will only really work
8387 correctly if sizers are used for the subwindows layout. Also, if the
8388 window has exactly one subwindow it is better (faster and the result
8389 is more precise as Fit adds some margin to account for fuzziness of
8390 its calculations) to call window.SetClientSize(child.GetSize())
8391 instead of calling Fit.
8392 """
5b5c9bc7 8393 return _core_.Window_Fit(*args, **kwargs)
d55e5bfc
RD
8394
8395 def FitInside(*args, **kwargs):
8396 """
8397 FitInside(self)
8398
8399 Similar to Fit, but sizes the interior (virtual) size of a
8400 window. Mainly useful with scrolled windows to reset scrollbars after
8401 sizing changes that do not trigger a size event, and/or scrolled
8402 windows without an interior sizer. This function similarly won't do
8403 anything if there are no subwindows.
8404 """
5b5c9bc7 8405 return _core_.Window_FitInside(*args, **kwargs)
d55e5bfc 8406
03837c5c 8407 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
8408 """
8409 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8410 int incH=-1)
d55e5bfc
RD
8411
8412 Allows specification of minimum and maximum window sizes, and window
8413 size increments. If a pair of values is not set (or set to -1), the
8414 default values will be used. If this function is called, the user
908b74cd
RD
8415 will not be able to size the window outside the given bounds (if it is
8416 a top-level window.) Sizers will also inspect the minimum window size
8417 and will use that value if set when calculating layout.
8418
8419 The resizing increments are only significant under Motif or Xt.
d55e5bfc 8420 """
5b5c9bc7 8421 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 8422
03837c5c
RD
8423 def SetSizeHintsSz(*args, **kwargs):
8424 """
5b5c9bc7 8425 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
03837c5c
RD
8426
8427 Allows specification of minimum and maximum window sizes, and window
8428 size increments. If a pair of values is not set (or set to -1), the
8429 default values will be used. If this function is called, the user
8430 will not be able to size the window outside the given bounds (if it is
8431 a top-level window.) Sizers will also inspect the minimum window size
8432 and will use that value if set when calculating layout.
8433
8434 The resizing increments are only significant under Motif or Xt.
8435 """
5b5c9bc7 8436 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
03837c5c
RD
8437
8438 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 8439 """
908b74cd 8440 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
8441
8442 Allows specification of minimum and maximum virtual window sizes. If a
8443 pair of values is not set (or set to -1), the default values will be
8444 used. If this function is called, the user will not be able to size
8445 the virtual area of the window outside the given bounds.
8446 """
5b5c9bc7 8447 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
03837c5c
RD
8448
8449 def SetVirtualSizeHintsSz(*args, **kwargs):
8450 """
5b5c9bc7 8451 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
03837c5c
RD
8452
8453 Allows specification of minimum and maximum virtual window sizes. If a
8454 pair of values is not set (or set to -1), the default values will be
8455 used. If this function is called, the user will not be able to size
8456 the virtual area of the window outside the given bounds.
8457 """
5b5c9bc7 8458 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 8459
908b74cd 8460 def GetMaxSize(*args, **kwargs):
5b5c9bc7
RD
8461 """GetMaxSize(self) -> Size"""
8462 return _core_.Window_GetMaxSize(*args, **kwargs)
908b74cd
RD
8463
8464 def GetMinSize(*args, **kwargs):
5b5c9bc7
RD
8465 """GetMinSize(self) -> Size"""
8466 return _core_.Window_GetMinSize(*args, **kwargs)
908b74cd
RD
8467
8468 def SetMinSize(*args, **kwargs):
8469 """
5b5c9bc7 8470 SetMinSize(self, Size minSize)
908b74cd
RD
8471
8472 A more convenient method than `SetSizeHints` for setting just the
8473 min size.
8474 """
5b5c9bc7 8475 return _core_.Window_SetMinSize(*args, **kwargs)
908b74cd
RD
8476
8477 def SetMaxSize(*args, **kwargs):
8478 """
5b5c9bc7 8479 SetMaxSize(self, Size maxSize)
908b74cd
RD
8480
8481 A more convenient method than `SetSizeHints` for setting just the
8482 max size.
8483 """
5b5c9bc7 8484 return _core_.Window_SetMaxSize(*args, **kwargs)
908b74cd 8485
d55e5bfc
RD
8486 def GetMinWidth(*args, **kwargs):
8487 """GetMinWidth(self) -> int"""
5b5c9bc7 8488 return _core_.Window_GetMinWidth(*args, **kwargs)
d55e5bfc
RD
8489
8490 def GetMinHeight(*args, **kwargs):
8491 """GetMinHeight(self) -> int"""
5b5c9bc7 8492 return _core_.Window_GetMinHeight(*args, **kwargs)
d55e5bfc
RD
8493
8494 def GetMaxWidth(*args, **kwargs):
8495 """GetMaxWidth(self) -> int"""
5b5c9bc7 8496 return _core_.Window_GetMaxWidth(*args, **kwargs)
d55e5bfc
RD
8497
8498 def GetMaxHeight(*args, **kwargs):
8499 """GetMaxHeight(self) -> int"""
5b5c9bc7 8500 return _core_.Window_GetMaxHeight(*args, **kwargs)
d55e5bfc 8501
d55e5bfc
RD
8502 def SetVirtualSize(*args, **kwargs):
8503 """
5b5c9bc7 8504 SetVirtualSize(self, Size size)
d55e5bfc
RD
8505
8506 Set the the virtual size of a window in pixels. For most windows this
8507 is just the client area of the window, but for some like scrolled
8508 windows it is more or less independent of the screen window size.
8509 """
5b5c9bc7 8510 return _core_.Window_SetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8511
8512 def SetVirtualSizeWH(*args, **kwargs):
8513 """
8514 SetVirtualSizeWH(self, int w, int h)
8515
8516 Set the the virtual size of a window in pixels. For most windows this
8517 is just the client area of the window, but for some like scrolled
8518 windows it is more or less independent of the screen window size.
8519 """
5b5c9bc7 8520 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
d55e5bfc
RD
8521
8522 def GetVirtualSize(*args, **kwargs):
8523 """
5b5c9bc7 8524 GetVirtualSize(self) -> Size
d55e5bfc
RD
8525
8526 Get the the virtual size of the window in pixels. For most windows
8527 this is just the client area of the window, but for some like scrolled
8528 windows it is more or less independent of the screen window size.
8529 """
5b5c9bc7 8530 return _core_.Window_GetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8531
8532 def GetVirtualSizeTuple(*args, **kwargs):
8533 """
8534 GetVirtualSizeTuple() -> (width, height)
8535
8536 Get the the virtual size of the window in pixels. For most windows
8537 this is just the client area of the window, but for some like scrolled
8538 windows it is more or less independent of the screen window size.
8539 """
5b5c9bc7 8540 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
d55e5bfc
RD
8541
8542 def GetBestVirtualSize(*args, **kwargs):
8543 """
5b5c9bc7 8544 GetBestVirtualSize(self) -> Size
d55e5bfc
RD
8545
8546 Return the largest of ClientSize and BestSize (as determined by a
8547 sizer, interior children, or other means)
8548 """
5b5c9bc7 8549 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
d55e5bfc
RD
8550
8551 def Show(*args, **kwargs):
8552 """
8553 Show(self, bool show=True) -> bool
8554
8555 Shows or hides the window. You may need to call Raise for a top level
8556 window if you want to bring it to top, although this is not needed if
8557 Show is called immediately after the frame creation. Returns True if
8558 the window has been shown or hidden or False if nothing was done
8559 because it already was in the requested state.
8560 """
5b5c9bc7 8561 return _core_.Window_Show(*args, **kwargs)
d55e5bfc
RD
8562
8563 def Hide(*args, **kwargs):
8564 """
8565 Hide(self) -> bool
8566
8567 Equivalent to calling Show(False).
8568 """
5b5c9bc7 8569 return _core_.Window_Hide(*args, **kwargs)
d55e5bfc
RD
8570
8571 def Enable(*args, **kwargs):
8572 """
8573 Enable(self, bool enable=True) -> bool
8574
8575 Enable or disable the window for user input. Note that when a parent
8576 window is disabled, all of its children are disabled as well and they
8577 are reenabled again when the parent is. Returns true if the window
8578 has been enabled or disabled, false if nothing was done, i.e. if the
8579 window had already been in the specified state.
8580 """
5b5c9bc7 8581 return _core_.Window_Enable(*args, **kwargs)
d55e5bfc
RD
8582
8583 def Disable(*args, **kwargs):
8584 """
8585 Disable(self) -> bool
8586
8587 Disables the window, same as Enable(false).
8588 """
5b5c9bc7 8589 return _core_.Window_Disable(*args, **kwargs)
d55e5bfc
RD
8590
8591 def IsShown(*args, **kwargs):
8592 """
8593 IsShown(self) -> bool
8594
8595 Returns true if the window is shown, false if it has been hidden.
8596 """
5b5c9bc7 8597 return _core_.Window_IsShown(*args, **kwargs)
d55e5bfc
RD
8598
8599 def IsEnabled(*args, **kwargs):
8600 """
8601 IsEnabled(self) -> bool
8602
8603 Returns true if the window is enabled for input, false otherwise.
8604 """
5b5c9bc7 8605 return _core_.Window_IsEnabled(*args, **kwargs)
d55e5bfc 8606
33d6fd3b
RD
8607 def IsShownOnScreen(*args, **kwargs):
8608 """
8609 IsShownOnScreen(self) -> bool
8610
8611 Returns ``True`` if the window is physically visible on the screen,
8612 i.e. it is shown and all its parents up to the toplevel window are
8613 shown as well.
8614 """
8615 return _core_.Window_IsShownOnScreen(*args, **kwargs)
8616
d55e5bfc
RD
8617 def SetWindowStyleFlag(*args, **kwargs):
8618 """
8619 SetWindowStyleFlag(self, long style)
8620
15817c7e
RD
8621 Sets the style of the window. Please note that some styles cannot be
8622 changed after the window creation and that Refresh() might need to be
8623 called after changing the others for the change to take place
8624 immediately.
d55e5bfc 8625 """
5b5c9bc7 8626 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8627
8628 def GetWindowStyleFlag(*args, **kwargs):
8629 """
8630 GetWindowStyleFlag(self) -> long
8631
8632 Gets the window style that was passed to the constructor or Create
8633 method.
8634 """
5b5c9bc7 8635 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8636
8637 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8638 def HasFlag(*args, **kwargs):
8639 """
8640 HasFlag(self, int flag) -> bool
8641
8642 Test if the given style is set for this window.
8643 """
5b5c9bc7 8644 return _core_.Window_HasFlag(*args, **kwargs)
d55e5bfc
RD
8645
8646 def IsRetained(*args, **kwargs):
8647 """
8648 IsRetained(self) -> bool
8649
8650 Returns true if the window is retained, false otherwise. Retained
8651 windows are only available on X platforms.
8652 """
5b5c9bc7 8653 return _core_.Window_IsRetained(*args, **kwargs)
d55e5bfc
RD
8654
8655 def SetExtraStyle(*args, **kwargs):
8656 """
8657 SetExtraStyle(self, long exStyle)
8658
8659 Sets the extra style bits for the window. Extra styles are the less
8660 often used style bits which can't be set with the constructor or with
8661 SetWindowStyleFlag()
8662 """
5b5c9bc7 8663 return _core_.Window_SetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8664
8665 def GetExtraStyle(*args, **kwargs):
8666 """
8667 GetExtraStyle(self) -> long
8668
8669 Returns the extra style bits for the window.
8670 """
5b5c9bc7 8671 return _core_.Window_GetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8672
8673 def MakeModal(*args, **kwargs):
8674 """
8675 MakeModal(self, bool modal=True)
8676
8677 Disables all other windows in the application so that the user can
8678 only interact with this window. Passing False will reverse this
8679 effect.
8680 """
5b5c9bc7 8681 return _core_.Window_MakeModal(*args, **kwargs)
d55e5bfc
RD
8682
8683 def SetThemeEnabled(*args, **kwargs):
8684 """
8685 SetThemeEnabled(self, bool enableTheme)
8686
8687 This function tells a window if it should use the system's "theme"
8688 code to draw the windows' background instead if its own background
8689 drawing code. This will only have an effect on platforms that support
8690 the notion of themes in user defined windows. One such platform is
8691 GTK+ where windows can have (very colourful) backgrounds defined by a
8692 user's selected theme.
8693
8694 Dialogs, notebook pages and the status bar have this flag set to true
8695 by default so that the default look and feel is simulated best.
8696 """
5b5c9bc7 8697 return _core_.Window_SetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8698
8699 def GetThemeEnabled(*args, **kwargs):
8700 """
8701 GetThemeEnabled(self) -> bool
8702
8703 Return the themeEnabled flag.
8704 """
5b5c9bc7 8705 return _core_.Window_GetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8706
8707 def SetFocus(*args, **kwargs):
8708 """
8709 SetFocus(self)
8710
8711 Set's the focus to this window, allowing it to receive keyboard input.
8712 """
5b5c9bc7 8713 return _core_.Window_SetFocus(*args, **kwargs)
d55e5bfc
RD
8714
8715 def SetFocusFromKbd(*args, **kwargs):
8716 """
8717 SetFocusFromKbd(self)
8718
8719 Set focus to this window as the result of a keyboard action. Normally
8720 only called internally.
8721 """
5b5c9bc7 8722 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
d55e5bfc
RD
8723
8724 def FindFocus(*args, **kwargs):
8725 """
5b5c9bc7 8726 FindFocus() -> Window
d55e5bfc
RD
8727
8728 Returns the window or control that currently has the keyboard focus,
8729 or None.
8730 """
5b5c9bc7 8731 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc
RD
8732
8733 FindFocus = staticmethod(FindFocus)
8734 def AcceptsFocus(*args, **kwargs):
8735 """
8736 AcceptsFocus(self) -> bool
8737
8738 Can this window have focus?
8739 """
5b5c9bc7 8740 return _core_.Window_AcceptsFocus(*args, **kwargs)
d55e5bfc
RD
8741
8742 def AcceptsFocusFromKeyboard(*args, **kwargs):
8743 """
8744 AcceptsFocusFromKeyboard(self) -> bool
8745
8746 Can this window be given focus by keyboard navigation? if not, the
8747 only way to give it focus (provided it accepts it at all) is to click
8748 it.
8749 """
5b5c9bc7 8750 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
d55e5bfc 8751
908b74cd
RD
8752 def Navigate(*args, **kwargs):
8753 """
8754 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8755
fd2dc343
RD
8756 Does keyboard navigation from this window to another, by sending a
8757 `wx.NavigationKeyEvent`.
908b74cd 8758 """
5b5c9bc7 8759 return _core_.Window_Navigate(*args, **kwargs)
908b74cd 8760
bf26d883
RD
8761 def MoveAfterInTabOrder(*args, **kwargs):
8762 """
5b5c9bc7 8763 MoveAfterInTabOrder(self, Window win)
bf26d883
RD
8764
8765 Moves this window in the tab navigation order after the specified
8766 sibling window. This means that when the user presses the TAB key on
8767 that other window, the focus switches to this window.
8768
8769 The default tab order is the same as creation order. This function
8770 and `MoveBeforeInTabOrder` allow to change it after creating all the
8771 windows.
8772
8773 """
5b5c9bc7 8774 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
bf26d883
RD
8775
8776 def MoveBeforeInTabOrder(*args, **kwargs):
8777 """
5b5c9bc7 8778 MoveBeforeInTabOrder(self, Window win)
bf26d883
RD
8779
8780 Same as `MoveAfterInTabOrder` except that it inserts this window just
8781 before win instead of putting it right after it.
8782 """
5b5c9bc7 8783 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
bf26d883 8784
d55e5bfc
RD
8785 def GetChildren(*args, **kwargs):
8786 """
8787 GetChildren(self) -> PyObject
8788
8789 Returns a list of the window's children. NOTE: Currently this is a
8790 copy of the child window list maintained by the window, so the return
8791 value of this function is only valid as long as the window's children
8792 do not change.
8793 """
5b5c9bc7 8794 return _core_.Window_GetChildren(*args, **kwargs)
d55e5bfc
RD
8795
8796 def GetParent(*args, **kwargs):
8797 """
5b5c9bc7 8798 GetParent(self) -> Window
d55e5bfc
RD
8799
8800 Returns the parent window of this window, or None if there isn't one.
8801 """
5b5c9bc7 8802 return _core_.Window_GetParent(*args, **kwargs)
d55e5bfc
RD
8803
8804 def GetGrandParent(*args, **kwargs):
8805 """
5b5c9bc7 8806 GetGrandParent(self) -> Window
d55e5bfc 8807
15817c7e
RD
8808 Returns the parent of the parent of this window, or None if there
8809 isn't one.
d55e5bfc 8810 """
5b5c9bc7 8811 return _core_.Window_GetGrandParent(*args, **kwargs)
d55e5bfc
RD
8812
8813 def IsTopLevel(*args, **kwargs):
8814 """
8815 IsTopLevel(self) -> bool
8816
8817 Returns true if the given window is a top-level one. Currently all
8818 frames and dialogs are always considered to be top-level windows (even
8819 if they have a parent window).
8820 """
5b5c9bc7 8821 return _core_.Window_IsTopLevel(*args, **kwargs)
d55e5bfc
RD
8822
8823 def Reparent(*args, **kwargs):
8824 """
5b5c9bc7 8825 Reparent(self, Window newParent) -> bool
d55e5bfc
RD
8826
8827 Reparents the window, i.e the window will be removed from its current
8828 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8829 re-inserted into another. Available on Windows and GTK. Returns True
8830 if the parent was changed, False otherwise (error or newParent ==
8831 oldParent)
8832 """
5b5c9bc7 8833 return _core_.Window_Reparent(*args, **kwargs)
d55e5bfc
RD
8834
8835 def AddChild(*args, **kwargs):
8836 """
5b5c9bc7 8837 AddChild(self, Window child)
d55e5bfc
RD
8838
8839 Adds a child window. This is called automatically by window creation
8840 functions so should not be required by the application programmer.
8841 """
5b5c9bc7 8842 return _core_.Window_AddChild(*args, **kwargs)
d55e5bfc
RD
8843
8844 def RemoveChild(*args, **kwargs):
8845 """
5b5c9bc7 8846 RemoveChild(self, Window child)
d55e5bfc
RD
8847
8848 Removes a child window. This is called automatically by window
8849 deletion functions so should not be required by the application
8850 programmer.
8851 """
5b5c9bc7 8852 return _core_.Window_RemoveChild(*args, **kwargs)
d55e5bfc 8853
704eda0c
RD
8854 def SetDoubleBuffered(*args, **kwargs):
8855 """
8856 SetDoubleBuffered(self, bool on)
8857
8858 Currently wxGTK2 only.
8859 """
8860 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8861
d55e5bfc
RD
8862 def FindWindowById(*args, **kwargs):
8863 """
5b5c9bc7 8864 FindWindowById(self, long winid) -> Window
d55e5bfc
RD
8865
8866 Find a chld of this window by window ID
8867 """
5b5c9bc7 8868 return _core_.Window_FindWindowById(*args, **kwargs)
d55e5bfc
RD
8869
8870 def FindWindowByName(*args, **kwargs):
8871 """
5b5c9bc7 8872 FindWindowByName(self, String name) -> Window
d55e5bfc
RD
8873
8874 Find a child of this window by name
8875 """
5b5c9bc7 8876 return _core_.Window_FindWindowByName(*args, **kwargs)
d55e5bfc
RD
8877
8878 def GetEventHandler(*args, **kwargs):
8879 """
5b5c9bc7 8880 GetEventHandler(self) -> EvtHandler
d55e5bfc
RD
8881
8882 Returns the event handler for this window. By default, the window is
8883 its own event handler.
8884 """
5b5c9bc7 8885 return _core_.Window_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
8886
8887 def SetEventHandler(*args, **kwargs):
8888 """
5b5c9bc7 8889 SetEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8890
8891 Sets the event handler for this window. An event handler is an object
d49bdf34
RD
8892 that is capable of processing the events sent to a window. (In other
8893 words, is able to dispatch the events to handler function.) By
8894 default, the window is its own event handler, but an application may
8895 wish to substitute another, for example to allow central
8896 implementation of event-handling for a variety of different window
8897 classes.
d55e5bfc 8898
15817c7e 8899 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc 8900 up a chain of event handlers, where an event not handled by one event
d49bdf34 8901 handler is handed off to the next one in the chain.
d55e5bfc 8902 """
5b5c9bc7 8903 return _core_.Window_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
8904
8905 def PushEventHandler(*args, **kwargs):
8906 """
5b5c9bc7 8907 PushEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8908
8909 Pushes this event handler onto the event handler stack for the window.
8910 An event handler is an object that is capable of processing the events
d49bdf34
RD
8911 sent to a window. (In other words, is able to dispatch the events to
8912 handler function.) By default, the window is its own event handler,
8913 but an application may wish to substitute another, for example to
8914 allow central implementation of event-handling for a variety of
8915 different window classes.
d55e5bfc
RD
8916
8917 wx.Window.PushEventHandler allows an application to set up a chain of
8918 event handlers, where an event not handled by one event handler is
d49bdf34
RD
8919 handed to the next one in the chain. Use `wx.Window.PopEventHandler`
8920 to remove the event handler. Ownership of the handler is *not* given
8921 to the window, so you should be sure to pop the handler before the
8922 window is destroyed and either let PopEventHandler destroy it, or call
8923 its Destroy method yourself.
d55e5bfc 8924 """
5b5c9bc7 8925 return _core_.Window_PushEventHandler(*args, **kwargs)
d55e5bfc
RD
8926
8927 def PopEventHandler(*args, **kwargs):
8928 """
5b5c9bc7 8929 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
d55e5bfc
RD
8930
8931 Removes and returns the top-most event handler on the event handler
8932 stack. If deleteHandler is True then the wx.EvtHandler object will be
d49bdf34 8933 destroyed after it is popped, and ``None`` will be returned instead.
d55e5bfc 8934 """
5b5c9bc7 8935 return _core_.Window_PopEventHandler(*args, **kwargs)
d55e5bfc
RD
8936
8937 def RemoveEventHandler(*args, **kwargs):
8938 """
5b5c9bc7 8939 RemoveEventHandler(self, EvtHandler handler) -> bool
d55e5bfc 8940
15817c7e 8941 Find the given handler in the event handler chain and remove (but not
d49bdf34 8942 delete) it from the event handler chain, returns True if it was found
15817c7e
RD
8943 and False otherwise (this also results in an assert failure so this
8944 function should only be called when the handler is supposed to be
8945 there.)
d55e5bfc 8946 """
5b5c9bc7 8947 return _core_.Window_RemoveEventHandler(*args, **kwargs)
d55e5bfc
RD
8948
8949 def SetValidator(*args, **kwargs):
8950 """
5b5c9bc7 8951 SetValidator(self, Validator validator)
d55e5bfc
RD
8952
8953 Deletes the current validator (if any) and sets the window validator,
8954 having called wx.Validator.Clone to create a new validator of this
8955 type.
8956 """
5b5c9bc7 8957 return _core_.Window_SetValidator(*args, **kwargs)
d55e5bfc
RD
8958
8959 def GetValidator(*args, **kwargs):
8960 """
5b5c9bc7 8961 GetValidator(self) -> Validator
d55e5bfc
RD
8962
8963 Returns a pointer to the current validator for the window, or None if
8964 there is none.
8965 """
5b5c9bc7 8966 return _core_.Window_GetValidator(*args, **kwargs)
d55e5bfc
RD
8967
8968 def Validate(*args, **kwargs):
8969 """
8970 Validate(self) -> bool
8971
8972 Validates the current values of the child controls using their
15817c7e
RD
8973 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8974 style flag set, the method will also call Validate() of all child
8975 windows. Returns false if any of the validations failed.
d55e5bfc 8976 """
5b5c9bc7 8977 return _core_.Window_Validate(*args, **kwargs)
d55e5bfc
RD
8978
8979 def TransferDataToWindow(*args, **kwargs):
8980 """
8981 TransferDataToWindow(self) -> bool
8982
15817c7e
RD
8983 Transfers values to child controls from data areas specified by their
8984 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8985 style flag set, the method will also call TransferDataToWindow() of
8986 all child windows.
d55e5bfc 8987 """
5b5c9bc7 8988 return _core_.Window_TransferDataToWindow(*args, **kwargs)
d55e5bfc
RD
8989
8990 def TransferDataFromWindow(*args, **kwargs):
8991 """
8992 TransferDataFromWindow(self) -> bool
8993
15817c7e
RD
8994 Transfers values from child controls to data areas specified by their
8995 validators. Returns false if a transfer failed. If the window has
8996 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8997 also call TransferDataFromWindow() of all child windows.
d55e5bfc 8998 """
5b5c9bc7 8999 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
d55e5bfc
RD
9000
9001 def InitDialog(*args, **kwargs):
9002 """
9003 InitDialog(self)
9004
15817c7e
RD
9005 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9006 to the dialog via validators.
d55e5bfc 9007 """
5b5c9bc7 9008 return _core_.Window_InitDialog(*args, **kwargs)
d55e5bfc
RD
9009
9010 def SetAcceleratorTable(*args, **kwargs):
9011 """
5b5c9bc7 9012 SetAcceleratorTable(self, AcceleratorTable accel)
d55e5bfc
RD
9013
9014 Sets the accelerator table for this window.
9015 """
5b5c9bc7 9016 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
9017
9018 def GetAcceleratorTable(*args, **kwargs):
9019 """
5b5c9bc7 9020 GetAcceleratorTable(self) -> AcceleratorTable
d55e5bfc
RD
9021
9022 Gets the accelerator table for this window.
9023 """
5b5c9bc7 9024 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
9025
9026 def RegisterHotKey(*args, **kwargs):
9027 """
9028 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
9029
9030 Registers a system wide hotkey. Every time the user presses the hotkey
9031 registered here, this window will receive a hotkey event. It will
9032 receive the event even if the application is in the background and
9033 does not have the input focus because the user is working with some
9034 other application. To bind an event handler function to this hotkey
9035 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9036 hotkey was registered successfully.
9037 """
5b5c9bc7 9038 return _core_.Window_RegisterHotKey(*args, **kwargs)
d55e5bfc
RD
9039
9040 def UnregisterHotKey(*args, **kwargs):
9041 """
9042 UnregisterHotKey(self, int hotkeyId) -> bool
9043
9044 Unregisters a system wide hotkey.
9045 """
5b5c9bc7 9046 return _core_.Window_UnregisterHotKey(*args, **kwargs)
d55e5bfc
RD
9047
9048 def ConvertDialogPointToPixels(*args, **kwargs):
9049 """
5b5c9bc7 9050 ConvertDialogPointToPixels(self, Point pt) -> Point
d55e5bfc
RD
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 """
5b5c9bc7 9059 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
d55e5bfc
RD
9060
9061 def ConvertDialogSizeToPixels(*args, **kwargs):
9062 """
5b5c9bc7 9063 ConvertDialogSizeToPixels(self, Size sz) -> Size
d55e5bfc
RD
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 """
5b5c9bc7 9072 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
d55e5bfc
RD
9073
9074 def DLG_PNT(*args, **kwargs):
9075 """
5b5c9bc7 9076 DLG_PNT(self, Point pt) -> Point
d55e5bfc
RD
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 """
5b5c9bc7 9085 return _core_.Window_DLG_PNT(*args, **kwargs)
d55e5bfc
RD
9086
9087 def DLG_SZE(*args, **kwargs):
9088 """
5b5c9bc7 9089 DLG_SZE(self, Size sz) -> Size
d55e5bfc
RD
9090
9091 Converts a point or size from dialog units to pixels. Dialog units
9092 are used for maintaining a dialog's proportions even if the font
9093 changes. For the x dimension, the dialog units are multiplied by the
9094 average character width and then divided by 4. For the y dimension,
9095 the dialog units are multiplied by the average character height and
9096 then divided by 8.
9097 """
5b5c9bc7 9098 return _core_.Window_DLG_SZE(*args, **kwargs)
d55e5bfc
RD
9099
9100 def ConvertPixelPointToDialog(*args, **kwargs):
5b5c9bc7
RD
9101 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9102 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
d55e5bfc
RD
9103
9104 def ConvertPixelSizeToDialog(*args, **kwargs):
5b5c9bc7
RD
9105 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9106 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
d55e5bfc
RD
9107
9108 def WarpPointer(*args, **kwargs):
9109 """
9110 WarpPointer(self, int x, int y)
9111
9112 Moves the pointer to the given position on the window.
9113
9114 NOTE: This function is not supported under Mac because Apple Human
9115 Interface Guidelines forbid moving the mouse cursor programmatically.
9116 """
5b5c9bc7 9117 return _core_.Window_WarpPointer(*args, **kwargs)
d55e5bfc
RD
9118
9119 def CaptureMouse(*args, **kwargs):
9120 """
9121 CaptureMouse(self)
9122
9123 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9124 release the capture.
9125
9126 Note that wxWindows maintains the stack of windows having captured the
9127 mouse and when the mouse is released the capture returns to the window
9128 which had had captured it previously and it is only really released if
9129 there were no previous window. In particular, this means that you must
34e0a3bb
RD
9130 release the mouse as many times as you capture it, unless the window
9131 receives the `wx.MouseCaptureLostEvent` event.
9132
9133 Any application which captures the mouse in the beginning of some
9134 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9135 operation when it receives the event. The event handler must not
9136 recapture mouse.
d55e5bfc 9137 """
5b5c9bc7 9138 return _core_.Window_CaptureMouse(*args, **kwargs)
d55e5bfc
RD
9139
9140 def ReleaseMouse(*args, **kwargs):
9141 """
9142 ReleaseMouse(self)
9143
9144 Releases mouse input captured with wx.Window.CaptureMouse.
9145 """
5b5c9bc7 9146 return _core_.Window_ReleaseMouse(*args, **kwargs)
d55e5bfc
RD
9147
9148 def GetCapture(*args, **kwargs):
9149 """
5b5c9bc7 9150 GetCapture() -> Window
d55e5bfc
RD
9151
9152 Returns the window which currently captures the mouse or None
9153 """
5b5c9bc7 9154 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc
RD
9155
9156 GetCapture = staticmethod(GetCapture)
9157 def HasCapture(*args, **kwargs):
9158 """
9159 HasCapture(self) -> bool
9160
9161 Returns true if this window has the current mouse capture.
9162 """
5b5c9bc7 9163 return _core_.Window_HasCapture(*args, **kwargs)
d55e5bfc
RD
9164
9165 def Refresh(*args, **kwargs):
9166 """
5b5c9bc7 9167 Refresh(self, bool eraseBackground=True, Rect rect=None)
d55e5bfc
RD
9168
9169 Mark the specified rectangle (or the whole window) as "dirty" so it
9170 will be repainted. Causes an EVT_PAINT event to be generated and sent
9171 to the window.
9172 """
5b5c9bc7 9173 return _core_.Window_Refresh(*args, **kwargs)
d55e5bfc
RD
9174
9175 def RefreshRect(*args, **kwargs):
9176 """
5b5c9bc7 9177 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
9178
9179 Redraws the contents of the given rectangle: the area inside it will
9180 be repainted. This is the same as Refresh but has a nicer syntax.
9181 """
5b5c9bc7 9182 return _core_.Window_RefreshRect(*args, **kwargs)
d55e5bfc
RD
9183
9184 def Update(*args, **kwargs):
9185 """
9186 Update(self)
9187
9188 Calling this method immediately repaints the invalidated area of the
9189 window instead of waiting for the EVT_PAINT event to happen, (normally
9190 this would usually only happen when the flow of control returns to the
9191 event loop.) Notice that this function doesn't refresh the window and
9192 does nothing if the window has been already repainted. Use Refresh
9193 first if you want to immediately redraw the window (or some portion of
9194 it) unconditionally.
9195 """
5b5c9bc7 9196 return _core_.Window_Update(*args, **kwargs)
d55e5bfc
RD
9197
9198 def ClearBackground(*args, **kwargs):
9199 """
9200 ClearBackground(self)
9201
9202 Clears the window by filling it with the current background
9203 colour. Does not cause an erase background event to be generated.
9204 """
5b5c9bc7 9205 return _core_.Window_ClearBackground(*args, **kwargs)
d55e5bfc
RD
9206
9207 def Freeze(*args, **kwargs):
9208 """
9209 Freeze(self)
9210
15817c7e
RD
9211 Freezes the window or, in other words, prevents any updates from
9212 taking place on screen, the window is not redrawn at all. Thaw must be
9213 called to reenable window redrawing. Calls to Freeze/Thaw may be
9214 nested, with the actual Thaw being delayed until all the nesting has
9215 been undone.
d55e5bfc
RD
9216
9217 This method is useful for visual appearance optimization (for example,
9218 it is a good idea to use it before inserting large amount of text into
9219 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9220 for all controls so it is mostly just a hint to wxWindows and not a
9221 mandatory directive.
9222 """
5b5c9bc7 9223 return _core_.Window_Freeze(*args, **kwargs)
d55e5bfc 9224
33d6fd3b
RD
9225 def IsFrozen(*args, **kwargs):
9226 """
9227 IsFrozen(self) -> bool
9228
9229 Returns ``True`` if the window has been frozen and not thawed yet.
9230
9231 :see: `Freeze` and `Thaw`
9232 """
9233 return _core_.Window_IsFrozen(*args, **kwargs)
9234
d55e5bfc
RD
9235 def Thaw(*args, **kwargs):
9236 """
9237 Thaw(self)
9238
9239 Reenables window updating after a previous call to Freeze. Calls to
15817c7e
RD
9240 Freeze/Thaw may be nested, so Thaw must be called the same number of
9241 times that Freeze was before the window will be updated.
d55e5bfc 9242 """
5b5c9bc7 9243 return _core_.Window_Thaw(*args, **kwargs)
d55e5bfc
RD
9244
9245 def PrepareDC(*args, **kwargs):
9246 """
5b5c9bc7 9247 PrepareDC(self, DC dc)
d55e5bfc
RD
9248
9249 Call this function to prepare the device context for drawing a
9250 scrolled image. It sets the device origin according to the current
9251 scroll position.
9252 """
5b5c9bc7 9253 return _core_.Window_PrepareDC(*args, **kwargs)
d55e5bfc 9254
b39fe951
RD
9255 def IsDoubleBuffered(*args, **kwargs):
9256 """
9257 IsDoubleBuffered(self) -> bool
9258
9259 Returns ``True`` if the window contents is double-buffered by the
9260 system, i.e. if any drawing done on the window is really done on a
9261 temporary backing surface and transferred to the screen all at once
9262 later.
9263 """
9264 return _core_.Window_IsDoubleBuffered(*args, **kwargs)
9265
d55e5bfc
RD
9266 def GetUpdateRegion(*args, **kwargs):
9267 """
5b5c9bc7 9268 GetUpdateRegion(self) -> Region
d55e5bfc
RD
9269
9270 Returns the region specifying which parts of the window have been
9271 damaged. Should only be called within an EVT_PAINT handler.
9272 """
5b5c9bc7 9273 return _core_.Window_GetUpdateRegion(*args, **kwargs)
d55e5bfc
RD
9274
9275 def GetUpdateClientRect(*args, **kwargs):
9276 """
5b5c9bc7 9277 GetUpdateClientRect(self) -> Rect
d55e5bfc
RD
9278
9279 Get the update rectangle region bounding box in client coords.
9280 """
5b5c9bc7 9281 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
d55e5bfc
RD
9282
9283 def IsExposed(*args, **kwargs):
9284 """
9285 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9286
9287 Returns true if the given point or rectangle area has been exposed
9288 since the last repaint. Call this in an paint event handler to
9289 optimize redrawing by only redrawing those areas, which have been
9290 exposed.
9291 """
5b5c9bc7 9292 return _core_.Window_IsExposed(*args, **kwargs)
d55e5bfc
RD
9293
9294 def IsExposedPoint(*args, **kwargs):
9295 """
5b5c9bc7 9296 IsExposedPoint(self, Point pt) -> bool
d55e5bfc
RD
9297
9298 Returns true if the given point or rectangle area has been exposed
9299 since the last repaint. Call this in an paint event handler to
9300 optimize redrawing by only redrawing those areas, which have been
9301 exposed.
9302 """
5b5c9bc7 9303 return _core_.Window_IsExposedPoint(*args, **kwargs)
d55e5bfc
RD
9304
9305 def IsExposedRect(*args, **kwargs):
9306 """
5b5c9bc7 9307 IsExposedRect(self, Rect rect) -> bool
d55e5bfc
RD
9308
9309 Returns true if the given point or rectangle area has been exposed
9310 since the last repaint. Call this in an paint event handler to
9311 optimize redrawing by only redrawing those areas, which have been
9312 exposed.
9313 """
5b5c9bc7 9314 return _core_.Window_IsExposedRect(*args, **kwargs)
d55e5bfc
RD
9315
9316 def GetDefaultAttributes(*args, **kwargs):
9317 """
5b5c9bc7 9318 GetDefaultAttributes(self) -> VisualAttributes
d55e5bfc 9319
15817c7e
RD
9320 Get the default attributes for an instance of this class. This is
9321 useful if you want to use the same font or colour in your own control
9322 as in a standard control -- which is a much better idea than hard
9323 coding specific colours or fonts which might look completely out of
a5ee0656 9324 place on the user's system, especially if it uses themes.
d55e5bfc 9325 """
5b5c9bc7 9326 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9327
9328 def GetClassDefaultAttributes(*args, **kwargs):
9329 """
5b5c9bc7 9330 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9331
15817c7e
RD
9332 Get the default attributes for this class. This is useful if you want
9333 to use the same font or colour in your own control as in a standard
9334 control -- which is a much better idea than hard coding specific
a5ee0656
RD
9335 colours or fonts which might look completely out of place on the
9336 user's system, especially if it uses themes.
d55e5bfc
RD
9337
9338 The variant parameter is only relevant under Mac currently and is
15817c7e 9339 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
9340 the returned font. See `wx.Window.SetWindowVariant` for more about
9341 this.
d55e5bfc 9342 """
5b5c9bc7 9343 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9344
9345 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9346 def SetBackgroundColour(*args, **kwargs):
9347 """
5b5c9bc7 9348 SetBackgroundColour(self, Colour colour) -> bool
d55e5bfc
RD
9349
9350 Sets the background colour of the window. Returns True if the colour
9351 was changed. The background colour is usually painted by the default
9352 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9353 automatically under GTK. Using `wx.NullColour` will reset the window
9354 to the default background colour.
d55e5bfc 9355
a5ee0656 9356 Note that setting the background colour may not cause an immediate
f8167d6e 9357 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
9358 calling this function.
9359
f8167d6e
RD
9360 Using this function will disable attempts to use themes for this
9361 window, if the system supports them. Use with care since usually the
9362 themes represent the appearance chosen by the user to be used for all
9363 applications on the system.
d55e5bfc 9364 """
5b5c9bc7 9365 return _core_.Window_SetBackgroundColour(*args, **kwargs)
d55e5bfc 9366
412d302d 9367 def SetOwnBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
9368 """SetOwnBackgroundColour(self, Colour colour)"""
9369 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9370
9371 def SetForegroundColour(*args, **kwargs):
9372 """
5b5c9bc7 9373 SetForegroundColour(self, Colour colour) -> bool
d55e5bfc
RD
9374
9375 Sets the foreground colour of the window. Returns True is the colour
9376 was changed. The interpretation of foreground colour is dependent on
9377 the window class; it may be the text colour or other colour, or it may
9378 not be used at all.
9379 """
5b5c9bc7 9380 return _core_.Window_SetForegroundColour(*args, **kwargs)
d55e5bfc 9381
fa47d7a7 9382 def SetOwnForegroundColour(*args, **kwargs):
5b5c9bc7
RD
9383 """SetOwnForegroundColour(self, Colour colour)"""
9384 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
9385
9386 def GetBackgroundColour(*args, **kwargs):
9387 """
5b5c9bc7 9388 GetBackgroundColour(self) -> Colour
d55e5bfc
RD
9389
9390 Returns the background colour of the window.
9391 """
5b5c9bc7 9392 return _core_.Window_GetBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9393
9394 def GetForegroundColour(*args, **kwargs):
9395 """
5b5c9bc7 9396 GetForegroundColour(self) -> Colour
d55e5bfc
RD
9397
9398 Returns the foreground colour of the window. The interpretation of
9399 foreground colour is dependent on the window class; it may be the text
9400 colour or other colour, or it may not be used at all.
9401 """
5b5c9bc7 9402 return _core_.Window_GetForegroundColour(*args, **kwargs)
d55e5bfc 9403
dcb8fc74
RD
9404 def InheritsBackgroundColour(*args, **kwargs):
9405 """InheritsBackgroundColour(self) -> bool"""
5b5c9bc7 9406 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
dcb8fc74
RD
9407
9408 def UseBgCol(*args, **kwargs):
9409 """UseBgCol(self) -> bool"""
5b5c9bc7 9410 return _core_.Window_UseBgCol(*args, **kwargs)
dcb8fc74 9411
0f63ec68
RD
9412 def SetBackgroundStyle(*args, **kwargs):
9413 """
9414 SetBackgroundStyle(self, int style) -> bool
9415
9416 Returns the background style of the window. The background style
9417 indicates how the background of the window is drawn.
9418
9419 ====================== ========================================
9420 wx.BG_STYLE_SYSTEM The background colour or pattern should
9421 be determined by the system
9422 wx.BG_STYLE_COLOUR The background should be a solid colour
9423 wx.BG_STYLE_CUSTOM The background will be implemented by the
9424 application.
9425 ====================== ========================================
9426
9427 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9428 a custom background, such as a tiled bitmap. Currently the style has
9429 no effect on other platforms.
9430
9431 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9432 """
5b5c9bc7 9433 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
0f63ec68
RD
9434
9435 def GetBackgroundStyle(*args, **kwargs):
9436 """
9437 GetBackgroundStyle(self) -> int
9438
9439 Returns the background style of the window.
9440
9441 :see: `SetBackgroundStyle`
9442 """
5b5c9bc7 9443 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
0f63ec68 9444
51b83b37
RD
9445 def HasTransparentBackground(*args, **kwargs):
9446 """
9447 HasTransparentBackground(self) -> bool
9448
9449 Returns True if this window's background is transparent (as, for
9450 example, for `wx.StaticText`) and should show the parent window's
9451 background.
9452
9453 This method is mostly used internally by the library itself and you
9454 normally shouldn't have to call it. You may, however, have to override
9455 it in your custom control classes to ensure that background is painted
9456 correctly.
9457 """
5b5c9bc7 9458 return _core_.Window_HasTransparentBackground(*args, **kwargs)
51b83b37 9459
d55e5bfc
RD
9460 def SetCursor(*args, **kwargs):
9461 """
5b5c9bc7 9462 SetCursor(self, Cursor cursor) -> bool
d55e5bfc
RD
9463
9464 Sets the window's cursor. Notice that the window cursor also sets it
9465 for the children of the window implicitly.
9466
9467 The cursor may be wx.NullCursor in which case the window cursor will
9468 be reset back to default.
9469 """
5b5c9bc7 9470 return _core_.Window_SetCursor(*args, **kwargs)
d55e5bfc
RD
9471
9472 def GetCursor(*args, **kwargs):
9473 """
5b5c9bc7 9474 GetCursor(self) -> Cursor
d55e5bfc
RD
9475
9476 Return the cursor associated with this window.
9477 """
5b5c9bc7 9478 return _core_.Window_GetCursor(*args, **kwargs)
d55e5bfc
RD
9479
9480 def SetFont(*args, **kwargs):
9481 """
5b5c9bc7 9482 SetFont(self, Font font) -> bool
d55e5bfc
RD
9483
9484 Sets the font for this window.
9485 """
5b5c9bc7 9486 return _core_.Window_SetFont(*args, **kwargs)
d55e5bfc 9487
fa47d7a7 9488 def SetOwnFont(*args, **kwargs):
5b5c9bc7
RD
9489 """SetOwnFont(self, Font font)"""
9490 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9491
9492 def GetFont(*args, **kwargs):
9493 """
5b5c9bc7 9494 GetFont(self) -> Font
d55e5bfc
RD
9495
9496 Returns the default font used for this window.
9497 """
5b5c9bc7 9498 return _core_.Window_GetFont(*args, **kwargs)
d55e5bfc
RD
9499
9500 def SetCaret(*args, **kwargs):
9501 """
5b5c9bc7 9502 SetCaret(self, Caret caret)
d55e5bfc
RD
9503
9504 Sets the caret associated with the window.
9505 """
5b5c9bc7 9506 return _core_.Window_SetCaret(*args, **kwargs)
d55e5bfc
RD
9507
9508 def GetCaret(*args, **kwargs):
9509 """
5b5c9bc7 9510 GetCaret(self) -> Caret
d55e5bfc
RD
9511
9512 Returns the caret associated with the window.
9513 """
5b5c9bc7 9514 return _core_.Window_GetCaret(*args, **kwargs)
d55e5bfc
RD
9515
9516 def GetCharHeight(*args, **kwargs):
9517 """
9518 GetCharHeight(self) -> int
9519
9520 Get the (average) character size for the current font.
9521 """
5b5c9bc7 9522 return _core_.Window_GetCharHeight(*args, **kwargs)
d55e5bfc
RD
9523
9524 def GetCharWidth(*args, **kwargs):
9525 """
9526 GetCharWidth(self) -> int
9527
9528 Get the (average) character size for the current font.
9529 """
5b5c9bc7 9530 return _core_.Window_GetCharWidth(*args, **kwargs)
d55e5bfc
RD
9531
9532 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9533 """
9534 GetTextExtent(String string) -> (width, height)
9535
9536 Get the width and height of the text using the current font.
9537 """
5b5c9bc7 9538 return _core_.Window_GetTextExtent(*args, **kwargs)
d55e5bfc
RD
9539
9540 def GetFullTextExtent(*args, **kwargs):
9541 """
9542 GetFullTextExtent(String string, Font font=None) ->
9543 (width, height, descent, externalLeading)
9544
9545 Get the width, height, decent and leading of the text using the
9546 current or specified font.
9547 """
5b5c9bc7 9548 return _core_.Window_GetFullTextExtent(*args, **kwargs)
d55e5bfc
RD
9549
9550 def ClientToScreenXY(*args, **kwargs):
9551 """
9552 ClientToScreenXY(int x, int y) -> (x,y)
9553
9554 Converts to screen coordinates from coordinates relative to this window.
9555 """
5b5c9bc7 9556 return _core_.Window_ClientToScreenXY(*args, **kwargs)
d55e5bfc
RD
9557
9558 def ScreenToClientXY(*args, **kwargs):
9559 """
9560 ScreenToClientXY(int x, int y) -> (x,y)
9561
9562 Converts from screen to client window coordinates.
9563 """
5b5c9bc7 9564 return _core_.Window_ScreenToClientXY(*args, **kwargs)
d55e5bfc
RD
9565
9566 def ClientToScreen(*args, **kwargs):
9567 """
5b5c9bc7 9568 ClientToScreen(self, Point pt) -> Point
d55e5bfc
RD
9569
9570 Converts to screen coordinates from coordinates relative to this window.
9571 """
5b5c9bc7 9572 return _core_.Window_ClientToScreen(*args, **kwargs)
d55e5bfc
RD
9573
9574 def ScreenToClient(*args, **kwargs):
9575 """
5b5c9bc7 9576 ScreenToClient(self, Point pt) -> Point
d55e5bfc
RD
9577
9578 Converts from screen to client window coordinates.
9579 """
5b5c9bc7 9580 return _core_.Window_ScreenToClient(*args, **kwargs)
d55e5bfc
RD
9581
9582 def HitTestXY(*args, **kwargs):
9583 """
9584 HitTestXY(self, int x, int y) -> int
9585
9586 Test where the given (in client coords) point lies
9587 """
5b5c9bc7 9588 return _core_.Window_HitTestXY(*args, **kwargs)
d55e5bfc
RD
9589
9590 def HitTest(*args, **kwargs):
9591 """
5b5c9bc7 9592 HitTest(self, Point pt) -> int
d55e5bfc
RD
9593
9594 Test where the given (in client coords) point lies
9595 """
5b5c9bc7 9596 return _core_.Window_HitTest(*args, **kwargs)
d55e5bfc
RD
9597
9598 def GetBorder(*args):
9599 """
9600 GetBorder(self, long flags) -> int
9601 GetBorder(self) -> int
9602
9603 Get border for the flags of this window
9604 """
5b5c9bc7 9605 return _core_.Window_GetBorder(*args)
d55e5bfc
RD
9606
9607 def UpdateWindowUI(*args, **kwargs):
9608 """
5b5c9bc7 9609 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
d55e5bfc
RD
9610
9611 This function sends EVT_UPDATE_UI events to the window. The particular
9612 implementation depends on the window; for example a wx.ToolBar will
9613 send an update UI event for each toolbar button, and a wx.Frame will
9614 send an update UI event for each menubar menu item. You can call this
9615 function from your application to ensure that your UI is up-to-date at
9616 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9617 concerned). This may be necessary if you have called
5ba5649b 9618 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9619 limit the overhead that wxWindows incurs by sending update UI events
9620 in idle time.
d55e5bfc 9621 """
5b5c9bc7 9622 return _core_.Window_UpdateWindowUI(*args, **kwargs)
d55e5bfc
RD
9623
9624 def PopupMenuXY(*args, **kwargs):
9625 """
5b5c9bc7 9626 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9627
b0503257
RD
9628 Pops up the given menu at the specified coordinates, relative to this window,
9629 and returns control when the user has dismissed the menu. If a menu item is
9630 selected, the corresponding menu event is generated and will be processed as
9631 usual. If the default position is given then the current position of the
9632 mouse cursor will be used.
d55e5bfc 9633 """
5b5c9bc7 9634 return _core_.Window_PopupMenuXY(*args, **kwargs)
d55e5bfc
RD
9635
9636 def PopupMenu(*args, **kwargs):
9637 """
5b5c9bc7 9638 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9639
b0503257
RD
9640 Pops up the given menu at the specified coordinates, relative to this window,
9641 and returns control when the user has dismissed the menu. If a menu item is
9642 selected, the corresponding menu event is generated and will be processed as
9643 usual. If the default position is given then the current position of the
9644 mouse cursor will be used.
d55e5bfc 9645 """
5b5c9bc7 9646 return _core_.Window_PopupMenu(*args, **kwargs)
d55e5bfc 9647
1eeb270e
RD
9648 def HasMultiplePages(*args, **kwargs):
9649 """HasMultiplePages(self) -> bool"""
9650 return _core_.Window_HasMultiplePages(*args, **kwargs)
9651
d55e5bfc
RD
9652 def GetHandle(*args, **kwargs):
9653 """
9654 GetHandle(self) -> long
9655
9656 Returns the platform-specific handle (as a long integer) of the
9657 physical window. Currently on wxMac it returns the handle of the
9658 toplevel parent of the window.
9659 """
5b5c9bc7 9660 return _core_.Window_GetHandle(*args, **kwargs)
d55e5bfc 9661
629e65c2
RD
9662 def AssociateHandle(*args, **kwargs):
9663 """
9664 AssociateHandle(self, long handle)
9665
9666 Associate the window with a new native handle
9667 """
5b5c9bc7 9668 return _core_.Window_AssociateHandle(*args, **kwargs)
629e65c2
RD
9669
9670 def DissociateHandle(*args, **kwargs):
9671 """
9672 DissociateHandle(self)
9673
9674 Dissociate the current native handle from the window
9675 """
5b5c9bc7 9676 return _core_.Window_DissociateHandle(*args, **kwargs)
629e65c2 9677
d55e5bfc
RD
9678 def HasScrollbar(*args, **kwargs):
9679 """
9680 HasScrollbar(self, int orient) -> bool
9681
9682 Does the window have the scrollbar for this orientation?
9683 """
5b5c9bc7 9684 return _core_.Window_HasScrollbar(*args, **kwargs)
d55e5bfc
RD
9685
9686 def SetScrollbar(*args, **kwargs):
9687 """
15817c7e 9688 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
9689 bool refresh=True)
9690
9691 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc 9692 """
5b5c9bc7 9693 return _core_.Window_SetScrollbar(*args, **kwargs)
d55e5bfc
RD
9694
9695 def SetScrollPos(*args, **kwargs):
9696 """
9697 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9698
9699 Sets the position of one of the built-in scrollbars.
9700 """
5b5c9bc7 9701 return _core_.Window_SetScrollPos(*args, **kwargs)
d55e5bfc
RD
9702
9703 def GetScrollPos(*args, **kwargs):
9704 """
9705 GetScrollPos(self, int orientation) -> int
9706
9707 Returns the built-in scrollbar position.
9708 """
5b5c9bc7 9709 return _core_.Window_GetScrollPos(*args, **kwargs)
d55e5bfc
RD
9710
9711 def GetScrollThumb(*args, **kwargs):
9712 """
9713 GetScrollThumb(self, int orientation) -> int
9714
9715 Returns the built-in scrollbar thumb size.
9716 """
5b5c9bc7 9717 return _core_.Window_GetScrollThumb(*args, **kwargs)
d55e5bfc
RD
9718
9719 def GetScrollRange(*args, **kwargs):
9720 """
9721 GetScrollRange(self, int orientation) -> int
9722
9723 Returns the built-in scrollbar range.
9724 """
5b5c9bc7 9725 return _core_.Window_GetScrollRange(*args, **kwargs)
d55e5bfc
RD
9726
9727 def ScrollWindow(*args, **kwargs):
9728 """
5b5c9bc7 9729 ScrollWindow(self, int dx, int dy, Rect rect=None)
d55e5bfc
RD
9730
9731 Physically scrolls the pixels in the window and move child windows
9732 accordingly. Use this function to optimise your scrolling
9733 implementations, to minimise the area that must be redrawn. Note that
9734 it is rarely required to call this function from a user program.
d55e5bfc 9735 """
5b5c9bc7 9736 return _core_.Window_ScrollWindow(*args, **kwargs)
d55e5bfc
RD
9737
9738 def ScrollLines(*args, **kwargs):
9739 """
9740 ScrollLines(self, int lines) -> bool
9741
9742 If the platform and window class supports it, scrolls the window by
9743 the given number of lines down, if lines is positive, or up if lines
9744 is negative. Returns True if the window was scrolled, False if it was
9745 already on top/bottom and nothing was done.
9746 """
5b5c9bc7 9747 return _core_.Window_ScrollLines(*args, **kwargs)
d55e5bfc
RD
9748
9749 def ScrollPages(*args, **kwargs):
9750 """
9751 ScrollPages(self, int pages) -> bool
9752
15817c7e 9753 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
9754 the given number of pages down, if pages is positive, or up if pages
9755 is negative. Returns True if the window was scrolled, False if it was
9756 already on top/bottom and nothing was done.
9757 """
5b5c9bc7 9758 return _core_.Window_ScrollPages(*args, **kwargs)
d55e5bfc
RD
9759
9760 def LineUp(*args, **kwargs):
9761 """
9762 LineUp(self) -> bool
9763
9764 This is just a wrapper for ScrollLines(-1).
9765 """
5b5c9bc7 9766 return _core_.Window_LineUp(*args, **kwargs)
d55e5bfc
RD
9767
9768 def LineDown(*args, **kwargs):
9769 """
9770 LineDown(self) -> bool
9771
9772 This is just a wrapper for ScrollLines(1).
9773 """
5b5c9bc7 9774 return _core_.Window_LineDown(*args, **kwargs)
d55e5bfc
RD
9775
9776 def PageUp(*args, **kwargs):
9777 """
9778 PageUp(self) -> bool
9779
9780 This is just a wrapper for ScrollPages(-1).
9781 """
5b5c9bc7 9782 return _core_.Window_PageUp(*args, **kwargs)
d55e5bfc
RD
9783
9784 def PageDown(*args, **kwargs):
9785 """
9786 PageDown(self) -> bool
9787
9788 This is just a wrapper for ScrollPages(1).
9789 """
5b5c9bc7 9790 return _core_.Window_PageDown(*args, **kwargs)
d55e5bfc
RD
9791
9792 def SetHelpText(*args, **kwargs):
9793 """
5b5c9bc7 9794 SetHelpText(self, String text)
d55e5bfc
RD
9795
9796 Sets the help text to be used as context-sensitive help for this
9797 window. Note that the text is actually stored by the current
f52cbe90 9798 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 9799 """
5b5c9bc7 9800 return _core_.Window_SetHelpText(*args, **kwargs)
d55e5bfc
RD
9801
9802 def SetHelpTextForId(*args, **kwargs):
9803 """
5b5c9bc7 9804 SetHelpTextForId(self, String text)
d55e5bfc
RD
9805
9806 Associate this help text with all windows with the same id as this
9807 one.
9808 """
5b5c9bc7 9809 return _core_.Window_SetHelpTextForId(*args, **kwargs)
d55e5bfc 9810
b850e7f3
RD
9811 def GetHelpTextAtPoint(*args, **kwargs):
9812 """
9813 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9814
9815 Get the help string associated with the given position in this window.
9816
9817 Notice that pt may be invalid if event origin is keyboard or unknown
9818 and this method should return the global window help text then
9819
9820 """
9821 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9822
d55e5bfc
RD
9823 def GetHelpText(*args, **kwargs):
9824 """
5b5c9bc7 9825 GetHelpText(self) -> String
d55e5bfc
RD
9826
9827 Gets the help text to be used as context-sensitive help for this
9828 window. Note that the text is actually stored by the current
f52cbe90 9829 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 9830 """
5b5c9bc7 9831 return _core_.Window_GetHelpText(*args, **kwargs)
d55e5bfc
RD
9832
9833 def SetToolTipString(*args, **kwargs):
9834 """
5b5c9bc7 9835 SetToolTipString(self, String tip)
d55e5bfc
RD
9836
9837 Attach a tooltip to the window.
9838 """
5b5c9bc7 9839 return _core_.Window_SetToolTipString(*args, **kwargs)
d55e5bfc
RD
9840
9841 def SetToolTip(*args, **kwargs):
9842 """
5b5c9bc7 9843 SetToolTip(self, ToolTip tip)
d55e5bfc
RD
9844
9845 Attach a tooltip to the window.
9846 """
5b5c9bc7 9847 return _core_.Window_SetToolTip(*args, **kwargs)
d55e5bfc
RD
9848
9849 def GetToolTip(*args, **kwargs):
9850 """
5b5c9bc7 9851 GetToolTip(self) -> ToolTip
d55e5bfc
RD
9852
9853 get the associated tooltip or None if none
9854 """
5b5c9bc7 9855 return _core_.Window_GetToolTip(*args, **kwargs)
d55e5bfc
RD
9856
9857 def SetDropTarget(*args, **kwargs):
9858 """
5b5c9bc7 9859 SetDropTarget(self, DropTarget dropTarget)
d55e5bfc
RD
9860
9861 Associates a drop target with this window. If the window already has
9862 a drop target, it is deleted.
9863 """
5b5c9bc7 9864 return _core_.Window_SetDropTarget(*args, **kwargs)
d55e5bfc
RD
9865
9866 def GetDropTarget(*args, **kwargs):
9867 """
5b5c9bc7 9868 GetDropTarget(self) -> DropTarget
d55e5bfc
RD
9869
9870 Returns the associated drop target, which may be None.
9871 """
5b5c9bc7 9872 return _core_.Window_GetDropTarget(*args, **kwargs)
d55e5bfc 9873
5ba5649b
RD
9874 def DragAcceptFiles(*args, **kwargs):
9875 """
9876 DragAcceptFiles(self, bool accept)
9877
9878 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9879 Only functional on Windows.
9880 """
9881 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9882
d55e5bfc
RD
9883 def SetConstraints(*args, **kwargs):
9884 """
5b5c9bc7 9885 SetConstraints(self, LayoutConstraints constraints)
d55e5bfc
RD
9886
9887 Sets the window to have the given layout constraints. If an existing
9888 layout constraints object is already owned by the window, it will be
9889 deleted. Pass None to disassociate and delete the window's current
9890 constraints.
9891
9892 You must call SetAutoLayout to tell a window to use the constraints
9893 automatically in its default EVT_SIZE handler; otherwise, you must
9894 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9895 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9896 effect.
9897 """
5b5c9bc7 9898 return _core_.Window_SetConstraints(*args, **kwargs)
d55e5bfc
RD
9899
9900 def GetConstraints(*args, **kwargs):
9901 """
5b5c9bc7 9902 GetConstraints(self) -> LayoutConstraints
d55e5bfc
RD
9903
9904 Returns a pointer to the window's layout constraints, or None if there
9905 are none.
9906 """
5b5c9bc7 9907 return _core_.Window_GetConstraints(*args, **kwargs)
d55e5bfc
RD
9908
9909 def SetAutoLayout(*args, **kwargs):
9910 """
9911 SetAutoLayout(self, bool autoLayout)
9912
9913 Determines whether the Layout function will be called automatically
b1fcee84
RD
9914 when the window is resized. lease note that this only happens for the
9915 windows usually used to contain children, namely `wx.Panel` and
9916 `wx.TopLevelWindow` (and the classes deriving from them).
9917
9918 This method is called implicitly by `SetSizer` but if you use
9919 `SetConstraints` you should call it manually or otherwise the window
9920 layout won't be correctly updated when its size changes.
d55e5bfc 9921 """
5b5c9bc7 9922 return _core_.Window_SetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9923
9924 def GetAutoLayout(*args, **kwargs):
9925 """
9926 GetAutoLayout(self) -> bool
9927
9928 Returns the current autoLayout setting
9929 """
5b5c9bc7 9930 return _core_.Window_GetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9931
9932 def Layout(*args, **kwargs):
9933 """
9934 Layout(self) -> bool
9935
9936 Invokes the constraint-based layout algorithm or the sizer-based
9937 algorithm for this window. See SetAutoLayout: when auto layout is on,
9938 this function gets called automatically by the default EVT_SIZE
9939 handler when the window is resized.
9940 """
5b5c9bc7 9941 return _core_.Window_Layout(*args, **kwargs)
d55e5bfc
RD
9942
9943 def SetSizer(*args, **kwargs):
9944 """
5b5c9bc7 9945 SetSizer(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9946
9947 Sets the window to have the given layout sizer. The window will then
9948 own the object, and will take care of its deletion. If an existing
9949 layout sizer object is already owned by the window, it will be deleted
9950 if the deleteOld parameter is true. Note that this function will also
9951 call SetAutoLayout implicitly with a True parameter if the sizer is
b411df4a 9952 non-None, and False otherwise.
d55e5bfc 9953 """
5b5c9bc7 9954 return _core_.Window_SetSizer(*args, **kwargs)
d55e5bfc
RD
9955
9956 def SetSizerAndFit(*args, **kwargs):
9957 """
5b5c9bc7 9958 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9959
9960 The same as SetSizer, except it also sets the size hints for the
9961 window based on the sizer's minimum size.
9962 """
5b5c9bc7 9963 return _core_.Window_SetSizerAndFit(*args, **kwargs)
d55e5bfc
RD
9964
9965 def GetSizer(*args, **kwargs):
9966 """
5b5c9bc7 9967 GetSizer(self) -> Sizer
d55e5bfc
RD
9968
9969 Return the sizer associated with the window by a previous call to
9970 SetSizer or None if there isn't one.
9971 """
5b5c9bc7 9972 return _core_.Window_GetSizer(*args, **kwargs)
d55e5bfc
RD
9973
9974 def SetContainingSizer(*args, **kwargs):
9975 """
5b5c9bc7 9976 SetContainingSizer(self, Sizer sizer)
d55e5bfc
RD
9977
9978 This normally does not need to be called by application code. It is
9979 called internally when a window is added to a sizer, and is used so
9980 the window can remove itself from the sizer when it is destroyed.
9981 """
5b5c9bc7 9982 return _core_.Window_SetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9983
9984 def GetContainingSizer(*args, **kwargs):
9985 """
5b5c9bc7 9986 GetContainingSizer(self) -> Sizer
d55e5bfc
RD
9987
9988 Return the sizer that this window is a member of, if any, otherwise None.
9989 """
5b5c9bc7 9990 return _core_.Window_GetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9991
9992 def InheritAttributes(*args, **kwargs):
9993 """
9994 InheritAttributes(self)
9995
15817c7e
RD
9996 This function is (or should be, in case of custom controls) called
9997 during window creation to intelligently set up the window visual
9998 attributes, that is the font and the foreground and background
9999 colours.
10000
10001 By 'intelligently' the following is meant: by default, all windows use
10002 their own default attributes. However if some of the parent's
10003 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 10004 SetOwnFont) and if the corresponding attribute hadn't been
15817c7e
RD
10005 explicitly set for this window itself, then this window takes the same
10006 value as used by the parent. In addition, if the window overrides
10007 ShouldInheritColours to return false, the colours will not be changed
10008 no matter what and only the font might.
10009
a7bb0a9d
RD
10010 This rather complicated logic is necessary in order to accommodate the
10011 different usage scenarios. The most common one is when all default
15817c7e
RD
10012 attributes are used and in this case, nothing should be inherited as
10013 in modern GUIs different controls use different fonts (and colours)
10014 than their siblings so they can't inherit the same value from the
10015 parent. However it was also deemed desirable to allow to simply change
10016 the attributes of all children at once by just changing the font or
10017 colour of their common parent, hence in this case we do inherit the
10018 parents attributes.
10019
d55e5bfc 10020 """
5b5c9bc7 10021 return _core_.Window_InheritAttributes(*args, **kwargs)
d55e5bfc
RD
10022
10023 def ShouldInheritColours(*args, **kwargs):
10024 """
10025 ShouldInheritColours(self) -> bool
10026
10027 Return true from here to allow the colours of this window to be
15817c7e
RD
10028 changed by InheritAttributes, returning false forbids inheriting them
10029 from the parent window.
d55e5bfc 10030
15817c7e
RD
10031 The base class version returns false, but this method is overridden in
10032 wxControl where it returns true.
d55e5bfc 10033 """
5b5c9bc7 10034 return _core_.Window_ShouldInheritColours(*args, **kwargs)
d55e5bfc 10035
fc46b7f3
RD
10036 def CanSetTransparent(*args, **kwargs):
10037 """
10038 CanSetTransparent(self) -> bool
10039
10040 Returns ``True`` if the platform supports setting the transparency for
10041 this window. Note that this method will err on the side of caution,
10042 so it is possible that this will return ``False`` when it is in fact
10043 possible to set the transparency.
10044
10045 NOTE: On X-windows systems the X server must have the composite
10046 extension loaded, and there must be a composite manager program (such
10047 as xcompmgr) running.
10048 """
10049 return _core_.Window_CanSetTransparent(*args, **kwargs)
10050
10051 def SetTransparent(*args, **kwargs):
10052 """
10053 SetTransparent(self, byte alpha) -> bool
10054
10055 Attempt to set the transparency of this window to the ``alpha`` value,
10056 returns True on success. The ``alpha`` value is an integer in the
10057 range of 0 to 255, where 0 is fully transparent and 255 is fully
10058 opaque.
10059 """
10060 return _core_.Window_SetTransparent(*args, **kwargs)
10061
d55e5bfc
RD
10062 def PostCreate(self, pre):
10063 """
10064 Phase 3 of the 2-phase create <wink!>
10065 Call this method after precreating the window with the 2-phase create method.
10066 """
10067 self.this = pre.this
10068 self.thisown = pre.thisown
10069 pre.thisown = 0
10070 if hasattr(self, '_setOORInfo'):
10071 self._setOORInfo(self)
10072 if hasattr(self, '_setCallbackInfo'):
10073 self._setCallbackInfo(self, self.__class__)
10074
7e08d4ef 10075 def SendSizeEvent(self):
92515dfc 10076 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
7e08d4ef 10077
2bf58437
RD
10078 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
10079 AdjustedBestSize = property(GetAdjustedBestSize,doc="See `GetAdjustedBestSize`")
10080 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
10081 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10082 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
10083 BestFittingSize = property(GetBestFittingSize,SetBestFittingSize,doc="See `GetBestFittingSize` and `SetBestFittingSize`")
10084 BestSize = property(GetBestSize,doc="See `GetBestSize`")
10085 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
10086 Border = property(GetBorder,doc="See `GetBorder`")
10087 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
10088 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
10089 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
10090 Children = property(GetChildren,doc="See `GetChildren`")
10091 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
10092 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
10093 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
10094 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
10095 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
10096 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
10097 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
10098 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
10099 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10100 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
10101 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10102 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
2bf58437
RD
10103 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
10104 Handle = property(GetHandle,doc="See `GetHandle`")
10105 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
2bf58437
RD
10106 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10107 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
994453b8 10108 LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`")
2bf58437
RD
10109 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
10110 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
10111 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
10112 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
10113 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
10114 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
10115 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
10116 Parent = property(GetParent,doc="See `GetParent`")
10117 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
10118 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
10119 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
10120 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
2bf58437
RD
10121 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
10122 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
2bf58437
RD
10123 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
10124 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
10125 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
10126 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
10127 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
10128 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
10129 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
10130 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10131 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
ac5d357a
RD
10132 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
10133 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
10134 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
2131d850 10135_core_.Window_swigregister(Window)
d55e5bfc
RD
10136
10137def PreWindow(*args, **kwargs):
10138 """
5b5c9bc7 10139 PreWindow() -> Window
d55e5bfc
RD
10140
10141 Precreate a Window for 2-phase creation.
10142 """
5b5c9bc7 10143 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
10144 return val
10145
1bd55598
RD
10146def Window_NewControlId(*args):
10147 """
5b5c9bc7 10148 Window_NewControlId() -> int
d55e5bfc
RD
10149
10150 Generate a control id for the controls which were not given one.
10151 """
1bd55598 10152 return _core_.Window_NewControlId(*args)
d55e5bfc 10153
5b5c9bc7 10154def Window_NextControlId(*args, **kwargs):
1bd55598 10155 """
5b5c9bc7 10156 Window_NextControlId(int winid) -> int
d55e5bfc
RD
10157
10158 Get the id of the control following the one with the given
15817c7e 10159 autogenerated) id
d55e5bfc 10160 """
1bd55598 10161 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc 10162
5b5c9bc7 10163def Window_PrevControlId(*args, **kwargs):
1bd55598 10164 """
5b5c9bc7 10165 Window_PrevControlId(int winid) -> int
d55e5bfc
RD
10166
10167 Get the id of the control preceding the one with the given
15817c7e 10168 autogenerated) id
d55e5bfc 10169 """
1bd55598 10170 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 10171
1bd55598
RD
10172def Window_FindFocus(*args):
10173 """
5b5c9bc7 10174 Window_FindFocus() -> Window
d55e5bfc
RD
10175
10176 Returns the window or control that currently has the keyboard focus,
10177 or None.
10178 """
1bd55598 10179 return _core_.Window_FindFocus(*args)
d55e5bfc 10180
1bd55598
RD
10181def Window_GetCapture(*args):
10182 """
5b5c9bc7 10183 Window_GetCapture() -> Window
d55e5bfc
RD
10184
10185 Returns the window which currently captures the mouse or None
10186 """
1bd55598 10187 return _core_.Window_GetCapture(*args)
d55e5bfc 10188
5b5c9bc7 10189def Window_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 10190 """
5b5c9bc7 10191 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 10192
15817c7e
RD
10193 Get the default attributes for this class. This is useful if you want
10194 to use the same font or colour in your own control as in a standard
10195 control -- which is a much better idea than hard coding specific
a5ee0656
RD
10196 colours or fonts which might look completely out of place on the
10197 user's system, especially if it uses themes.
d55e5bfc
RD
10198
10199 The variant parameter is only relevant under Mac currently and is
15817c7e 10200 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
10201 the returned font. See `wx.Window.SetWindowVariant` for more about
10202 this.
d55e5bfc 10203 """
1bd55598 10204 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10205
10206def DLG_PNT(win, point_or_x, y=None):
10207 """
10208 Convenience function for converting a Point or (x,y) in
10209 dialog units to pixel units.
10210 """
10211 if y is None:
10212 return win.ConvertDialogPointToPixels(point_or_x)
10213 else:
10214 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10215
10216def DLG_SZE(win, size_width, height=None):
10217 """
10218 Convenience function for converting a Size or (w,h) in
10219 dialog units to pixel units.
10220 """
10221 if height is None:
10222 return win.ConvertDialogSizeToPixels(size_width)
10223 else:
10224 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10225
10226
5b5c9bc7 10227def FindWindowById(*args, **kwargs):
1bd55598 10228 """
5b5c9bc7 10229 FindWindowById(long id, Window parent=None) -> Window
d55e5bfc
RD
10230
10231 Find the first window in the application with the given id. If parent
10232 is None, the search will start from all top-level frames and dialog
10233 boxes; if non-None, the search will be limited to the given window
10234 hierarchy. The search is recursive in both cases.
10235 """
1bd55598 10236 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc 10237
5b5c9bc7 10238def FindWindowByName(*args, **kwargs):
1bd55598 10239 """
5b5c9bc7 10240 FindWindowByName(String name, Window parent=None) -> Window
d55e5bfc
RD
10241
10242 Find a window by its name (as given in a window constructor or Create
10243 function call). If parent is None, the search will start from all
10244 top-level frames and dialog boxes; if non-None, the search will be
10245 limited to the given window hierarchy. The search is recursive in both
10246 cases.
10247
10248 If no window with such name is found, wx.FindWindowByLabel is called.
10249 """
1bd55598 10250 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc 10251
5b5c9bc7 10252def FindWindowByLabel(*args, **kwargs):
1bd55598 10253 """
5b5c9bc7 10254 FindWindowByLabel(String label, Window parent=None) -> Window
d55e5bfc
RD
10255
10256 Find a window by its label. Depending on the type of window, the label
10257 may be a window title or panel item label. If parent is None, the
10258 search will start from all top-level frames and dialog boxes; if
10259 non-None, the search will be limited to the given window
10260 hierarchy. The search is recursive in both cases.
10261 """
1bd55598 10262 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc 10263
5b5c9bc7 10264def Window_FromHWND(*args, **kwargs):
1bd55598
RD
10265 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10266 return _core_.Window_FromHWND(*args, **kwargs)
3215336e 10267
1bd55598
RD
10268def GetTopLevelWindows(*args):
10269 """
3215336e
RD
10270 GetTopLevelWindows() -> PyObject
10271
10272 Returns a list of the the application's top-level windows, (frames,
10273 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10274 by wxWidgets, and so it is only valid as long as no top-level windows
10275 are closed or new top-level windows are created.
10276
10277 """
1bd55598 10278 return _core_.GetTopLevelWindows(*args)
d55e5bfc
RD
10279#---------------------------------------------------------------------------
10280
5b5c9bc7
RD
10281class Validator(EvtHandler):
10282 """Proxy of C++ Validator class"""
1bd55598
RD
10283 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10284 __repr__ = _swig_repr
10285 def __init__(self, *args, **kwargs):
5b5c9bc7 10286 """__init__(self) -> Validator"""
1bd55598 10287 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d55e5bfc
RD
10288 self._setOORInfo(self)
10289
10290 def Clone(*args, **kwargs):
5b5c9bc7
RD
10291 """Clone(self) -> Validator"""
10292 return _core_.Validator_Clone(*args, **kwargs)
d55e5bfc
RD
10293
10294 def Validate(*args, **kwargs):
5b5c9bc7
RD
10295 """Validate(self, Window parent) -> bool"""
10296 return _core_.Validator_Validate(*args, **kwargs)
d55e5bfc
RD
10297
10298 def TransferToWindow(*args, **kwargs):
10299 """TransferToWindow(self) -> bool"""
5b5c9bc7 10300 return _core_.Validator_TransferToWindow(*args, **kwargs)
d55e5bfc
RD
10301
10302 def TransferFromWindow(*args, **kwargs):
10303 """TransferFromWindow(self) -> bool"""
5b5c9bc7 10304 return _core_.Validator_TransferFromWindow(*args, **kwargs)
d55e5bfc
RD
10305
10306 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
10307 """GetWindow(self) -> Window"""
10308 return _core_.Validator_GetWindow(*args, **kwargs)
d55e5bfc
RD
10309
10310 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
10311 """SetWindow(self, Window window)"""
10312 return _core_.Validator_SetWindow(*args, **kwargs)
d55e5bfc
RD
10313
10314 def IsSilent(*args, **kwargs):
d6c14a4c 10315 """IsSilent() -> bool"""
5b5c9bc7 10316 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc
RD
10317
10318 IsSilent = staticmethod(IsSilent)
10319 def SetBellOnError(*args, **kwargs):
d6c14a4c 10320 """SetBellOnError(int doIt=True)"""
5b5c9bc7 10321 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
10322
10323 SetBellOnError = staticmethod(SetBellOnError)
dba7934c 10324 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 10325_core_.Validator_swigregister(Validator)
d55e5bfc 10326
1bd55598
RD
10327def Validator_IsSilent(*args):
10328 """Validator_IsSilent() -> bool"""
10329 return _core_.Validator_IsSilent(*args)
d55e5bfc 10330
5b5c9bc7 10331def Validator_SetBellOnError(*args, **kwargs):
1bd55598
RD
10332 """Validator_SetBellOnError(int doIt=True)"""
10333 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc 10334
5b5c9bc7
RD
10335class PyValidator(Validator):
10336 """Proxy of C++ PyValidator class"""
1bd55598
RD
10337 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10338 __repr__ = _swig_repr
10339 def __init__(self, *args, **kwargs):
5b5c9bc7 10340 """__init__(self) -> PyValidator"""
1bd55598 10341 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
d55e5bfc
RD
10342
10343 self._setCallbackInfo(self, PyValidator, 1)
10344 self._setOORInfo(self)
10345
10346 def _setCallbackInfo(*args, **kwargs):
10347 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
5b5c9bc7 10348 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
d55e5bfc 10349
2131d850 10350_core_.PyValidator_swigregister(PyValidator)
d55e5bfc
RD
10351
10352#---------------------------------------------------------------------------
10353
5b5c9bc7
RD
10354class Menu(EvtHandler):
10355 """Proxy of C++ Menu class"""
1bd55598
RD
10356 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10357 __repr__ = _swig_repr
10358 def __init__(self, *args, **kwargs):
5b5c9bc7 10359 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
1bd55598 10360 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
d55e5bfc
RD
10361 self._setOORInfo(self)
10362
10363 def Append(*args, **kwargs):
ac5d357a
RD
10364 """
10365 Append(self, int id, String text=EmptyString, String help=EmptyString,
10366 int kind=ITEM_NORMAL) -> MenuItem
10367 """
5b5c9bc7 10368 return _core_.Menu_Append(*args, **kwargs)
d55e5bfc
RD
10369
10370 def AppendSeparator(*args, **kwargs):
5b5c9bc7
RD
10371 """AppendSeparator(self) -> MenuItem"""
10372 return _core_.Menu_AppendSeparator(*args, **kwargs)
d55e5bfc
RD
10373
10374 def AppendCheckItem(*args, **kwargs):
5b5c9bc7
RD
10375 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10376 return _core_.Menu_AppendCheckItem(*args, **kwargs)
d55e5bfc
RD
10377
10378 def AppendRadioItem(*args, **kwargs):
5b5c9bc7
RD
10379 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10380 return _core_.Menu_AppendRadioItem(*args, **kwargs)
d55e5bfc
RD
10381
10382 def AppendMenu(*args, **kwargs):
5b5c9bc7
RD
10383 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10384 return _core_.Menu_AppendMenu(*args, **kwargs)
d55e5bfc 10385
da91cb0f
RD
10386 def AppendSubMenu(*args, **kwargs):
10387 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10388 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10389
d55e5bfc 10390 def AppendItem(*args, **kwargs):
5b5c9bc7
RD
10391 """AppendItem(self, MenuItem item) -> MenuItem"""
10392 return _core_.Menu_AppendItem(*args, **kwargs)
d55e5bfc 10393
d55e5bfc 10394 def InsertItem(*args, **kwargs):
5b5c9bc7
RD
10395 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10396 return _core_.Menu_InsertItem(*args, **kwargs)
d55e5bfc 10397
1bd55598
RD
10398 def PrependItem(*args, **kwargs):
10399 """PrependItem(self, MenuItem item) -> MenuItem"""
10400 return _core_.Menu_PrependItem(*args, **kwargs)
10401
10402 def Break(*args, **kwargs):
10403 """Break(self)"""
10404 return _core_.Menu_Break(*args, **kwargs)
10405
d55e5bfc
RD
10406 def Insert(*args, **kwargs):
10407 """
ac5d357a 10408 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
5b5c9bc7 10409 int kind=ITEM_NORMAL) -> MenuItem
d55e5bfc 10410 """
5b5c9bc7 10411 return _core_.Menu_Insert(*args, **kwargs)
d55e5bfc
RD
10412
10413 def InsertSeparator(*args, **kwargs):
5b5c9bc7
RD
10414 """InsertSeparator(self, size_t pos) -> MenuItem"""
10415 return _core_.Menu_InsertSeparator(*args, **kwargs)
d55e5bfc
RD
10416
10417 def InsertCheckItem(*args, **kwargs):
5b5c9bc7
RD
10418 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10419 return _core_.Menu_InsertCheckItem(*args, **kwargs)
d55e5bfc
RD
10420
10421 def InsertRadioItem(*args, **kwargs):
5b5c9bc7
RD
10422 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10423 return _core_.Menu_InsertRadioItem(*args, **kwargs)
d55e5bfc
RD
10424
10425 def InsertMenu(*args, **kwargs):
5b5c9bc7
RD
10426 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10427 return _core_.Menu_InsertMenu(*args, **kwargs)
d55e5bfc 10428
d55e5bfc 10429 def Prepend(*args, **kwargs):
ac5d357a
RD
10430 """
10431 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10432 int kind=ITEM_NORMAL) -> MenuItem
10433 """
5b5c9bc7 10434 return _core_.Menu_Prepend(*args, **kwargs)
d55e5bfc
RD
10435
10436 def PrependSeparator(*args, **kwargs):
5b5c9bc7
RD
10437 """PrependSeparator(self) -> MenuItem"""
10438 return _core_.Menu_PrependSeparator(*args, **kwargs)
d55e5bfc
RD
10439
10440 def PrependCheckItem(*args, **kwargs):
5b5c9bc7
RD
10441 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10442 return _core_.Menu_PrependCheckItem(*args, **kwargs)
d55e5bfc
RD
10443
10444 def PrependRadioItem(*args, **kwargs):
5b5c9bc7
RD
10445 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10446 return _core_.Menu_PrependRadioItem(*args, **kwargs)
d55e5bfc
RD
10447
10448 def PrependMenu(*args, **kwargs):
5b5c9bc7
RD
10449 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10450 return _core_.Menu_PrependMenu(*args, **kwargs)
d55e5bfc
RD
10451
10452 def Remove(*args, **kwargs):
5b5c9bc7
RD
10453 """Remove(self, int id) -> MenuItem"""
10454 return _core_.Menu_Remove(*args, **kwargs)
d55e5bfc
RD
10455
10456 def RemoveItem(*args, **kwargs):
5b5c9bc7
RD
10457 """RemoveItem(self, MenuItem item) -> MenuItem"""
10458 return _core_.Menu_RemoveItem(*args, **kwargs)
d55e5bfc
RD
10459
10460 def Delete(*args, **kwargs):
10461 """Delete(self, int id) -> bool"""
5b5c9bc7 10462 return _core_.Menu_Delete(*args, **kwargs)
d55e5bfc
RD
10463
10464 def DeleteItem(*args, **kwargs):
5b5c9bc7
RD
10465 """DeleteItem(self, MenuItem item) -> bool"""
10466 return _core_.Menu_DeleteItem(*args, **kwargs)
d55e5bfc
RD
10467
10468 def Destroy(*args, **kwargs):
10469 """
10470 Destroy(self)
10471
10472 Deletes the C++ object this Python object is a proxy for.
10473 """
b39fe951
RD
10474 args[0].this.own(False)
10475 return _core_.Menu_Destroy(*args, **kwargs)
d55e5bfc
RD
10476
10477 def DestroyId(*args, **kwargs):
b39fe951
RD
10478 """DestroyId(self, int id) -> bool"""
10479 return _core_.Menu_DestroyId(*args, **kwargs)
d55e5bfc
RD
10480
10481 def DestroyItem(*args, **kwargs):
b39fe951
RD
10482 """DestroyItem(self, MenuItem item) -> bool"""
10483 return _core_.Menu_DestroyItem(*args, **kwargs)
d55e5bfc
RD
10484
10485 def GetMenuItemCount(*args, **kwargs):
10486 """GetMenuItemCount(self) -> size_t"""
5b5c9bc7 10487 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
d55e5bfc
RD
10488
10489 def GetMenuItems(*args, **kwargs):
10490 """GetMenuItems(self) -> PyObject"""
5b5c9bc7 10491 return _core_.Menu_GetMenuItems(*args, **kwargs)
d55e5bfc
RD
10492
10493 def FindItem(*args, **kwargs):
5b5c9bc7
RD
10494 """FindItem(self, String item) -> int"""
10495 return _core_.Menu_FindItem(*args, **kwargs)
d55e5bfc
RD
10496
10497 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10498 """FindItemById(self, int id) -> MenuItem"""
10499 return _core_.Menu_FindItemById(*args, **kwargs)
d55e5bfc
RD
10500
10501 def FindItemByPosition(*args, **kwargs):
5b5c9bc7
RD
10502 """FindItemByPosition(self, size_t position) -> MenuItem"""
10503 return _core_.Menu_FindItemByPosition(*args, **kwargs)
d55e5bfc
RD
10504
10505 def Enable(*args, **kwargs):
10506 """Enable(self, int id, bool enable)"""
5b5c9bc7 10507 return _core_.Menu_Enable(*args, **kwargs)
d55e5bfc
RD
10508
10509 def IsEnabled(*args, **kwargs):
10510 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10511 return _core_.Menu_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10512
10513 def Check(*args, **kwargs):
10514 """Check(self, int id, bool check)"""
5b5c9bc7 10515 return _core_.Menu_Check(*args, **kwargs)
d55e5bfc
RD
10516
10517 def IsChecked(*args, **kwargs):
10518 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10519 return _core_.Menu_IsChecked(*args, **kwargs)
d55e5bfc
RD
10520
10521 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10522 """SetLabel(self, int id, String label)"""
10523 return _core_.Menu_SetLabel(*args, **kwargs)
d55e5bfc
RD
10524
10525 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10526 """GetLabel(self, int id) -> String"""
10527 return _core_.Menu_GetLabel(*args, **kwargs)
d55e5bfc
RD
10528
10529 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10530 """SetHelpString(self, int id, String helpString)"""
10531 return _core_.Menu_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10532
10533 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10534 """GetHelpString(self, int id) -> String"""
10535 return _core_.Menu_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10536
10537 def SetTitle(*args, **kwargs):
5b5c9bc7
RD
10538 """SetTitle(self, String title)"""
10539 return _core_.Menu_SetTitle(*args, **kwargs)
d55e5bfc
RD
10540
10541 def GetTitle(*args, **kwargs):
5b5c9bc7
RD
10542 """GetTitle(self) -> String"""
10543 return _core_.Menu_GetTitle(*args, **kwargs)
d55e5bfc
RD
10544
10545 def SetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10546 """SetEventHandler(self, EvtHandler handler)"""
10547 return _core_.Menu_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
10548
10549 def GetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10550 """GetEventHandler(self) -> EvtHandler"""
10551 return _core_.Menu_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
10552
10553 def SetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10554 """SetInvokingWindow(self, Window win)"""
10555 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10556
10557 def GetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10558 """GetInvokingWindow(self) -> Window"""
10559 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10560
10561 def GetStyle(*args, **kwargs):
10562 """GetStyle(self) -> long"""
5b5c9bc7 10563 return _core_.Menu_GetStyle(*args, **kwargs)
d55e5bfc
RD
10564
10565 def UpdateUI(*args, **kwargs):
5b5c9bc7
RD
10566 """UpdateUI(self, EvtHandler source=None)"""
10567 return _core_.Menu_UpdateUI(*args, **kwargs)
d55e5bfc
RD
10568
10569 def GetMenuBar(*args, **kwargs):
5b5c9bc7
RD
10570 """GetMenuBar(self) -> MenuBar"""
10571 return _core_.Menu_GetMenuBar(*args, **kwargs)
d55e5bfc
RD
10572
10573 def Attach(*args, **kwargs):
10574 """Attach(self, wxMenuBarBase menubar)"""
5b5c9bc7 10575 return _core_.Menu_Attach(*args, **kwargs)
d55e5bfc
RD
10576
10577 def Detach(*args, **kwargs):
10578 """Detach(self)"""
5b5c9bc7 10579 return _core_.Menu_Detach(*args, **kwargs)
d55e5bfc
RD
10580
10581 def IsAttached(*args, **kwargs):
10582 """IsAttached(self) -> bool"""
5b5c9bc7 10583 return _core_.Menu_IsAttached(*args, **kwargs)
d55e5bfc
RD
10584
10585 def SetParent(*args, **kwargs):
5b5c9bc7
RD
10586 """SetParent(self, Menu parent)"""
10587 return _core_.Menu_SetParent(*args, **kwargs)
d55e5bfc
RD
10588
10589 def GetParent(*args, **kwargs):
5b5c9bc7
RD
10590 """GetParent(self) -> Menu"""
10591 return _core_.Menu_GetParent(*args, **kwargs)
d55e5bfc 10592
57332a5a
RD
10593 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10594 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
10595 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
10596 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
10597 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
10598 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
10599 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
10600 Style = property(GetStyle,doc="See `GetStyle`")
10601 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
2131d850 10602_core_.Menu_swigregister(Menu)
5b5c9bc7 10603DefaultValidator = cvar.DefaultValidator
d55e5bfc
RD
10604
10605#---------------------------------------------------------------------------
10606
5b5c9bc7
RD
10607class MenuBar(Window):
10608 """Proxy of C++ MenuBar class"""
1bd55598
RD
10609 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10610 __repr__ = _swig_repr
10611 def __init__(self, *args, **kwargs):
5b5c9bc7 10612 """__init__(self, long style=0) -> MenuBar"""
1bd55598 10613 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d55e5bfc
RD
10614 self._setOORInfo(self)
10615
10616 def Append(*args, **kwargs):
5b5c9bc7
RD
10617 """Append(self, Menu menu, String title) -> bool"""
10618 return _core_.MenuBar_Append(*args, **kwargs)
d55e5bfc
RD
10619
10620 def Insert(*args, **kwargs):
5b5c9bc7
RD
10621 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10622 return _core_.MenuBar_Insert(*args, **kwargs)
d55e5bfc
RD
10623
10624 def GetMenuCount(*args, **kwargs):
10625 """GetMenuCount(self) -> size_t"""
5b5c9bc7 10626 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
d55e5bfc
RD
10627
10628 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10629 """GetMenu(self, size_t pos) -> Menu"""
10630 return _core_.MenuBar_GetMenu(*args, **kwargs)
d55e5bfc
RD
10631
10632 def Replace(*args, **kwargs):
5b5c9bc7
RD
10633 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10634 return _core_.MenuBar_Replace(*args, **kwargs)
d55e5bfc
RD
10635
10636 def Remove(*args, **kwargs):
5b5c9bc7
RD
10637 """Remove(self, size_t pos) -> Menu"""
10638 return _core_.MenuBar_Remove(*args, **kwargs)
d55e5bfc
RD
10639
10640 def EnableTop(*args, **kwargs):
10641 """EnableTop(self, size_t pos, bool enable)"""
5b5c9bc7 10642 return _core_.MenuBar_EnableTop(*args, **kwargs)
d55e5bfc
RD
10643
10644 def IsEnabledTop(*args, **kwargs):
10645 """IsEnabledTop(self, size_t pos) -> bool"""
5b5c9bc7 10646 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
d55e5bfc
RD
10647
10648 def SetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10649 """SetLabelTop(self, size_t pos, String label)"""
10650 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
d55e5bfc
RD
10651
10652 def GetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10653 """GetLabelTop(self, size_t pos) -> String"""
10654 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
d55e5bfc
RD
10655
10656 def FindMenuItem(*args, **kwargs):
5b5c9bc7
RD
10657 """FindMenuItem(self, String menu, String item) -> int"""
10658 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
d55e5bfc
RD
10659
10660 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10661 """FindItemById(self, int id) -> MenuItem"""
10662 return _core_.MenuBar_FindItemById(*args, **kwargs)
d55e5bfc
RD
10663
10664 def FindMenu(*args, **kwargs):
5b5c9bc7
RD
10665 """FindMenu(self, String title) -> int"""
10666 return _core_.MenuBar_FindMenu(*args, **kwargs)
d55e5bfc
RD
10667
10668 def Enable(*args, **kwargs):
10669 """Enable(self, int id, bool enable)"""
5b5c9bc7 10670 return _core_.MenuBar_Enable(*args, **kwargs)
d55e5bfc
RD
10671
10672 def Check(*args, **kwargs):
10673 """Check(self, int id, bool check)"""
5b5c9bc7 10674 return _core_.MenuBar_Check(*args, **kwargs)
d55e5bfc
RD
10675
10676 def IsChecked(*args, **kwargs):
10677 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10678 return _core_.MenuBar_IsChecked(*args, **kwargs)
d55e5bfc
RD
10679
10680 def IsEnabled(*args, **kwargs):
10681 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10682 return _core_.MenuBar_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10683
10684 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10685 """SetLabel(self, int id, String label)"""
10686 return _core_.MenuBar_SetLabel(*args, **kwargs)
d55e5bfc
RD
10687
10688 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10689 """GetLabel(self, int id) -> String"""
10690 return _core_.MenuBar_GetLabel(*args, **kwargs)
d55e5bfc
RD
10691
10692 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10693 """SetHelpString(self, int id, String helpString)"""
10694 return _core_.MenuBar_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10695
10696 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10697 """GetHelpString(self, int id) -> String"""
10698 return _core_.MenuBar_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10699
10700 def GetFrame(*args, **kwargs):
10701 """GetFrame(self) -> wxFrame"""
5b5c9bc7 10702 return _core_.MenuBar_GetFrame(*args, **kwargs)
d55e5bfc
RD
10703
10704 def IsAttached(*args, **kwargs):
10705 """IsAttached(self) -> bool"""
5b5c9bc7 10706 return _core_.MenuBar_IsAttached(*args, **kwargs)
d55e5bfc
RD
10707
10708 def Attach(*args, **kwargs):
10709 """Attach(self, wxFrame frame)"""
5b5c9bc7 10710 return _core_.MenuBar_Attach(*args, **kwargs)
d55e5bfc
RD
10711
10712 def Detach(*args, **kwargs):
10713 """Detach(self)"""
5b5c9bc7 10714 return _core_.MenuBar_Detach(*args, **kwargs)
d55e5bfc 10715
587d0f36
RD
10716 def UpdateMenus(*args, **kwargs):
10717 """UpdateMenus(self)"""
10718 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
10719
4f433fef
RD
10720 def SetAutoWindowMenu(*args, **kwargs):
10721 """SetAutoWindowMenu(bool enable)"""
10722 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10723
10724 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10725 def GetAutoWindowMenu(*args, **kwargs):
10726 """GetAutoWindowMenu() -> bool"""
10727 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10728
10729 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
ac5d357a
RD
10730 def GetMenus(self):
10731 """Return a list of (menu, label) items for the menus in the MenuBar. """
10732 return [(self.GetMenu(i), self.GetLabelTop(i))
10733 for i in range(self.GetMenuCount())]
10734
10735 def SetMenus(self, items):
10736 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
10737 for i in range(self.GetMenuCount()-1, -1, -1):
10738 self.Remove(i)
10739 for m, l in items:
10740 self.Append(m, l)
10741
57332a5a
RD
10742 Frame = property(GetFrame,doc="See `GetFrame`")
10743 Menu = property(GetMenu,doc="See `GetMenu`")
10744 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
10745 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
2131d850 10746_core_.MenuBar_swigregister(MenuBar)
d55e5bfc 10747
4f433fef 10748def MenuBar_SetAutoWindowMenu(*args, **kwargs):
1bd55598
RD
10749 """MenuBar_SetAutoWindowMenu(bool enable)"""
10750 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 10751
1bd55598
RD
10752def MenuBar_GetAutoWindowMenu(*args):
10753 """MenuBar_GetAutoWindowMenu() -> bool"""
10754 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 10755
d55e5bfc
RD
10756#---------------------------------------------------------------------------
10757
5b5c9bc7
RD
10758class MenuItem(Object):
10759 """Proxy of C++ MenuItem class"""
1bd55598
RD
10760 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10761 __repr__ = _swig_repr
10762 def __init__(self, *args, **kwargs):
d55e5bfc 10763 """
5b5c9bc7
RD
10764 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10765 String help=EmptyString, int kind=ITEM_NORMAL,
10766 Menu subMenu=None) -> MenuItem
d55e5bfc 10767 """
1bd55598
RD
10768 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10769 __swig_destroy__ = _core_.delete_MenuItem
10770 __del__ = lambda self : None;
d55e5bfc 10771 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10772 """GetMenu(self) -> Menu"""
10773 return _core_.MenuItem_GetMenu(*args, **kwargs)
d55e5bfc
RD
10774
10775 def SetMenu(*args, **kwargs):
5b5c9bc7
RD
10776 """SetMenu(self, Menu menu)"""
10777 return _core_.MenuItem_SetMenu(*args, **kwargs)
d55e5bfc
RD
10778
10779 def SetId(*args, **kwargs):
10780 """SetId(self, int id)"""
5b5c9bc7 10781 return _core_.MenuItem_SetId(*args, **kwargs)
d55e5bfc
RD
10782
10783 def GetId(*args, **kwargs):
10784 """GetId(self) -> int"""
5b5c9bc7 10785 return _core_.MenuItem_GetId(*args, **kwargs)
d55e5bfc
RD
10786
10787 def IsSeparator(*args, **kwargs):
10788 """IsSeparator(self) -> bool"""
5b5c9bc7 10789 return _core_.MenuItem_IsSeparator(*args, **kwargs)
d55e5bfc
RD
10790
10791 def SetText(*args, **kwargs):
5b5c9bc7
RD
10792 """SetText(self, String str)"""
10793 return _core_.MenuItem_SetText(*args, **kwargs)
d55e5bfc
RD
10794
10795 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10796 """GetLabel(self) -> String"""
10797 return _core_.MenuItem_GetLabel(*args, **kwargs)
d55e5bfc
RD
10798
10799 def GetText(*args, **kwargs):
5b5c9bc7
RD
10800 """GetText(self) -> String"""
10801 return _core_.MenuItem_GetText(*args, **kwargs)
d55e5bfc
RD
10802
10803 def GetLabelFromText(*args, **kwargs):
5b5c9bc7
RD
10804 """GetLabelFromText(String text) -> String"""
10805 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc
RD
10806
10807 GetLabelFromText = staticmethod(GetLabelFromText)
10808 def GetKind(*args, **kwargs):
10809 """GetKind(self) -> int"""
5b5c9bc7 10810 return _core_.MenuItem_GetKind(*args, **kwargs)
d55e5bfc
RD
10811
10812 def SetKind(*args, **kwargs):
10813 """SetKind(self, int kind)"""
5b5c9bc7 10814 return _core_.MenuItem_SetKind(*args, **kwargs)
d55e5bfc
RD
10815
10816 def SetCheckable(*args, **kwargs):
10817 """SetCheckable(self, bool checkable)"""
5b5c9bc7 10818 return _core_.MenuItem_SetCheckable(*args, **kwargs)
d55e5bfc
RD
10819
10820 def IsCheckable(*args, **kwargs):
10821 """IsCheckable(self) -> bool"""
5b5c9bc7 10822 return _core_.MenuItem_IsCheckable(*args, **kwargs)
d55e5bfc
RD
10823
10824 def IsSubMenu(*args, **kwargs):
10825 """IsSubMenu(self) -> bool"""
5b5c9bc7 10826 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
d55e5bfc
RD
10827
10828 def SetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10829 """SetSubMenu(self, Menu menu)"""
10830 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
d55e5bfc
RD
10831
10832 def GetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10833 """GetSubMenu(self) -> Menu"""
10834 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
d55e5bfc
RD
10835
10836 def Enable(*args, **kwargs):
10837 """Enable(self, bool enable=True)"""
5b5c9bc7 10838 return _core_.MenuItem_Enable(*args, **kwargs)
d55e5bfc
RD
10839
10840 def IsEnabled(*args, **kwargs):
10841 """IsEnabled(self) -> bool"""
5b5c9bc7 10842 return _core_.MenuItem_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10843
10844 def Check(*args, **kwargs):
10845 """Check(self, bool check=True)"""
5b5c9bc7 10846 return _core_.MenuItem_Check(*args, **kwargs)
d55e5bfc
RD
10847
10848 def IsChecked(*args, **kwargs):
10849 """IsChecked(self) -> bool"""
5b5c9bc7 10850 return _core_.MenuItem_IsChecked(*args, **kwargs)
d55e5bfc
RD
10851
10852 def Toggle(*args, **kwargs):
10853 """Toggle(self)"""
5b5c9bc7 10854 return _core_.MenuItem_Toggle(*args, **kwargs)
d55e5bfc
RD
10855
10856 def SetHelp(*args, **kwargs):
5b5c9bc7
RD
10857 """SetHelp(self, String str)"""
10858 return _core_.MenuItem_SetHelp(*args, **kwargs)
d55e5bfc
RD
10859
10860 def GetHelp(*args, **kwargs):
5b5c9bc7
RD
10861 """GetHelp(self) -> String"""
10862 return _core_.MenuItem_GetHelp(*args, **kwargs)
d55e5bfc
RD
10863
10864 def GetAccel(*args, **kwargs):
5b5c9bc7
RD
10865 """GetAccel(self) -> AcceleratorEntry"""
10866 return _core_.MenuItem_GetAccel(*args, **kwargs)
d55e5bfc
RD
10867
10868 def SetAccel(*args, **kwargs):
5b5c9bc7
RD
10869 """SetAccel(self, AcceleratorEntry accel)"""
10870 return _core_.MenuItem_SetAccel(*args, **kwargs)
d55e5bfc 10871
32fe5131
RD
10872 def SetBitmap(*args, **kwargs):
10873 """SetBitmap(self, Bitmap bitmap)"""
10874 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10875
10876 def GetBitmap(*args, **kwargs):
10877 """GetBitmap(self) -> Bitmap"""
10878 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10879
c1280d1e 10880 def SetFont(*args, **kwargs):
5b5c9bc7
RD
10881 """SetFont(self, Font font)"""
10882 return _core_.MenuItem_SetFont(*args, **kwargs)
c1280d1e
RD
10883
10884 def GetFont(*args, **kwargs):
5b5c9bc7
RD
10885 """GetFont(self) -> Font"""
10886 return _core_.MenuItem_GetFont(*args, **kwargs)
c1280d1e
RD
10887
10888 def SetTextColour(*args, **kwargs):
5b5c9bc7
RD
10889 """SetTextColour(self, Colour colText)"""
10890 return _core_.MenuItem_SetTextColour(*args, **kwargs)
c1280d1e
RD
10891
10892 def GetTextColour(*args, **kwargs):
5b5c9bc7
RD
10893 """GetTextColour(self) -> Colour"""
10894 return _core_.MenuItem_GetTextColour(*args, **kwargs)
c1280d1e
RD
10895
10896 def SetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10897 """SetBackgroundColour(self, Colour colBack)"""
10898 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10899
10900 def GetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10901 """GetBackgroundColour(self) -> Colour"""
10902 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10903
10904 def SetBitmaps(*args, **kwargs):
5b5c9bc7
RD
10905 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10906 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
c1280d1e
RD
10907
10908 def SetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10909 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10910 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10911
10912 def GetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10913 """GetDisabledBitmap(self) -> Bitmap"""
10914 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10915
10916 def SetMarginWidth(*args, **kwargs):
10917 """SetMarginWidth(self, int nWidth)"""
5b5c9bc7 10918 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
c1280d1e
RD
10919
10920 def GetMarginWidth(*args, **kwargs):
10921 """GetMarginWidth(self) -> int"""
5b5c9bc7 10922 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
c1280d1e 10923
d55e5bfc 10924 def GetDefaultMarginWidth(*args, **kwargs):
d6c14a4c 10925 """GetDefaultMarginWidth() -> int"""
5b5c9bc7 10926 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
10927
10928 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10929 def IsOwnerDrawn(*args, **kwargs):
10930 """IsOwnerDrawn(self) -> bool"""
5b5c9bc7 10931 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10932
10933 def SetOwnerDrawn(*args, **kwargs):
10934 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
5b5c9bc7 10935 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10936
10937 def ResetOwnerDrawn(*args, **kwargs):
10938 """ResetOwnerDrawn(self)"""
5b5c9bc7 10939 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
c1280d1e 10940
57332a5a
RD
10941 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
10942 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10943 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
10944 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
10945 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10946 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
10947 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10948 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
10949 Label = property(GetLabel,doc="See `GetLabel`")
10950 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
10951 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
10952 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
10953 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
10954 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
2131d850 10955_core_.MenuItem_swigregister(MenuItem)
d55e5bfc 10956
5b5c9bc7 10957def MenuItem_GetLabelFromText(*args, **kwargs):
1bd55598
RD
10958 """MenuItem_GetLabelFromText(String text) -> String"""
10959 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 10960
1bd55598
RD
10961def MenuItem_GetDefaultMarginWidth(*args):
10962 """MenuItem_GetDefaultMarginWidth() -> int"""
10963 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d55e5bfc
RD
10964
10965#---------------------------------------------------------------------------
10966
5b5c9bc7 10967class Control(Window):
d55e5bfc
RD
10968 """
10969 This is the base class for a control or 'widget'.
10970
15817c7e
RD
10971 A control is generally a small window which processes user input
10972 and/or displays one or more item of data.
d55e5bfc 10973 """
1bd55598
RD
10974 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10975 __repr__ = _swig_repr
10976 def __init__(self, *args, **kwargs):
d55e5bfc 10977 """
5b5c9bc7
RD
10978 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10979 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10980 String name=ControlNameStr) -> Control
d55e5bfc 10981
15817c7e
RD
10982 Create a Control. Normally you should only call this from a subclass'
10983 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 10984 """
1bd55598 10985 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d55e5bfc
RD
10986 self._setOORInfo(self)
10987
10988 def Create(*args, **kwargs):
10989 """
5b5c9bc7
RD
10990 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10991 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10992 String name=ControlNameStr) -> bool
d55e5bfc
RD
10993
10994 Do the 2nd phase and create the GUI control.
10995 """
5b5c9bc7 10996 return _core_.Control_Create(*args, **kwargs)
d55e5bfc 10997
1eeb270e
RD
10998 def GetAlignment(*args, **kwargs):
10999 """
11000 GetAlignment(self) -> int
11001
11002 Get the control alignment (left/right/centre, top/bottom/centre)
11003 """
11004 return _core_.Control_GetAlignment(*args, **kwargs)
11005
34e0a3bb 11006 def GetLabelText(*args, **kwargs):
1eeb270e 11007 """
1eeb270e
RD
11008 GetLabelText(self) -> String
11009
11010 Get just the text of the label, without mnemonic characters ('&')
11011 """
34e0a3bb 11012 return _core_.Control_GetLabelText(*args, **kwargs)
1eeb270e 11013
d55e5bfc
RD
11014 def Command(*args, **kwargs):
11015 """
5b5c9bc7 11016 Command(self, CommandEvent event)
d55e5bfc 11017
15817c7e
RD
11018 Simulates the effect of the user issuing a command to the item.
11019
11020 :see: `wx.CommandEvent`
11021
d55e5bfc 11022 """
5b5c9bc7 11023 return _core_.Control_Command(*args, **kwargs)
d55e5bfc 11024
d55e5bfc 11025 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0 11026 """
5b5c9bc7 11027 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
11028
11029 Get the default attributes for this class. This is useful if you want
11030 to use the same font or colour in your own control as in a standard
11031 control -- which is a much better idea than hard coding specific
11032 colours or fonts which might look completely out of place on the
11033 user's system, especially if it uses themes.
11034
11035 The variant parameter is only relevant under Mac currently and is
11036 ignore under other platforms. Under Mac, it will change the size of
11037 the returned font. See `wx.Window.SetWindowVariant` for more about
11038 this.
11039 """
5b5c9bc7 11040 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
11041
11042 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2bf58437 11043 Alignment = property(GetAlignment,doc="See `GetAlignment`")
2bf58437 11044 LabelText = property(GetLabelText,doc="See `GetLabelText`")
2131d850 11045_core_.Control_swigregister(Control)
d55e5bfc
RD
11046ControlNameStr = cvar.ControlNameStr
11047
11048def PreControl(*args, **kwargs):
11049 """
5b5c9bc7 11050 PreControl() -> Control
d55e5bfc
RD
11051
11052 Precreate a Control control for 2-phase creation
11053 """
5b5c9bc7 11054 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
11055 return val
11056
5b5c9bc7 11057def Control_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 11058 """
5b5c9bc7 11059 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
11060
11061 Get the default attributes for this class. This is useful if you want
11062 to use the same font or colour in your own control as in a standard
11063 control -- which is a much better idea than hard coding specific
11064 colours or fonts which might look completely out of place on the
11065 user's system, especially if it uses themes.
11066
11067 The variant parameter is only relevant under Mac currently and is
11068 ignore under other platforms. Under Mac, it will change the size of
11069 the returned font. See `wx.Window.SetWindowVariant` for more about
11070 this.
11071 """
1bd55598 11072 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
11073
11074#---------------------------------------------------------------------------
11075
5b5c9bc7 11076class ItemContainer(object):
d55e5bfc 11077 """
53aa7709
RD
11078 The wx.ItemContainer class defines an interface which is implemented
11079 by all controls which have string subitems, each of which may be
11080 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11081 as `wx.ComboBox` which implements an extended interface deriving from
15817c7e 11082 this one.
d55e5bfc 11083
15817c7e
RD
11084 It defines the methods for accessing the control's items and although
11085 each of the derived classes implements them differently, they still
11086 all conform to the same interface.
d55e5bfc 11087
15817c7e
RD
11088 The items in a wx.ItemContainer have (non empty) string labels and,
11089 optionally, client data associated with them.
d55e5bfc
RD
11090
11091 """
1bd55598
RD
11092 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11093 def __init__(self): raise AttributeError, "No constructor defined"
11094 __repr__ = _swig_repr
d55e5bfc
RD
11095 def Append(*args, **kwargs):
11096 """
5b5c9bc7 11097 Append(self, String item, PyObject clientData=None) -> int
d55e5bfc 11098
15817c7e
RD
11099 Adds the item to the control, associating the given data with the item
11100 if not None. The return value is the index of the newly added item
11101 which may be different from the last one if the control is sorted (e.g.
11102 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc 11103 """
5b5c9bc7 11104 return _core_.ItemContainer_Append(*args, **kwargs)
d55e5bfc
RD
11105
11106 def AppendItems(*args, **kwargs):
11107 """
f5b96ee1 11108 AppendItems(self, List strings)
d55e5bfc 11109
15817c7e
RD
11110 Apend several items at once to the control. Notice that calling this
11111 method may be much faster than appending the items one by one if you
11112 need to add a lot of items.
d55e5bfc 11113 """
5b5c9bc7 11114 return _core_.ItemContainer_AppendItems(*args, **kwargs)
d55e5bfc
RD
11115
11116 def Insert(*args, **kwargs):
11117 """
50f151d7 11118 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
d55e5bfc 11119
15817c7e 11120 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
11121 optionally associating some data object with the item.
11122 """
5b5c9bc7 11123 return _core_.ItemContainer_Insert(*args, **kwargs)
d55e5bfc
RD
11124
11125 def Clear(*args, **kwargs):
11126 """
11127 Clear(self)
11128
11129 Removes all items from the control.
11130 """
5b5c9bc7 11131 return _core_.ItemContainer_Clear(*args, **kwargs)
d55e5bfc
RD
11132
11133 def Delete(*args, **kwargs):
11134 """
50f151d7 11135 Delete(self, unsigned int n)
d55e5bfc 11136
15817c7e
RD
11137 Deletes the item at the zero-based index 'n' from the control. Note
11138 that it is an error (signalled by a `wx.PyAssertionError` exception if
11139 enabled) to remove an item with the index negative or greater or equal
11140 than the number of items in the control.
d55e5bfc 11141 """
5b5c9bc7 11142 return _core_.ItemContainer_Delete(*args, **kwargs)
d55e5bfc 11143
53aa7709
RD
11144 def GetClientData(*args, **kwargs):
11145 """
50f151d7 11146 GetClientData(self, unsigned int n) -> PyObject
53aa7709
RD
11147
11148 Returns the client data associated with the given item, (if any.)
11149 """
5b5c9bc7 11150 return _core_.ItemContainer_GetClientData(*args, **kwargs)
53aa7709
RD
11151
11152 def SetClientData(*args, **kwargs):
11153 """
50f151d7 11154 SetClientData(self, unsigned int n, PyObject clientData)
53aa7709
RD
11155
11156 Associate the given client data with the item at position n.
11157 """
5b5c9bc7 11158 return _core_.ItemContainer_SetClientData(*args, **kwargs)
53aa7709 11159
d55e5bfc
RD
11160 def GetCount(*args, **kwargs):
11161 """
50f151d7 11162 GetCount(self) -> unsigned int
d55e5bfc
RD
11163
11164 Returns the number of items in the control.
11165 """
5b5c9bc7 11166 return _core_.ItemContainer_GetCount(*args, **kwargs)
d55e5bfc
RD
11167
11168 def IsEmpty(*args, **kwargs):
11169 """
11170 IsEmpty(self) -> bool
11171
11172 Returns True if the control is empty or False if it has some items.
11173 """
5b5c9bc7 11174 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
d55e5bfc
RD
11175
11176 def GetString(*args, **kwargs):
11177 """
50f151d7 11178 GetString(self, unsigned int n) -> String
d55e5bfc
RD
11179
11180 Returns the label of the item with the given index.
11181 """
5b5c9bc7 11182 return _core_.ItemContainer_GetString(*args, **kwargs)
d55e5bfc
RD
11183
11184 def GetStrings(*args, **kwargs):
11185 """GetStrings(self) -> wxArrayString"""
5b5c9bc7 11186 return _core_.ItemContainer_GetStrings(*args, **kwargs)
d55e5bfc
RD
11187
11188 def SetString(*args, **kwargs):
11189 """
50f151d7 11190 SetString(self, unsigned int n, String s)
d55e5bfc
RD
11191
11192 Sets the label for the given item.
11193 """
5b5c9bc7 11194 return _core_.ItemContainer_SetString(*args, **kwargs)
d55e5bfc
RD
11195
11196 def FindString(*args, **kwargs):
11197 """
5b5c9bc7 11198 FindString(self, String s) -> int
d55e5bfc
RD
11199
11200 Finds an item whose label matches the given string. Returns the
15817c7e
RD
11201 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11202 found.
d55e5bfc 11203 """
5b5c9bc7 11204 return _core_.ItemContainer_FindString(*args, **kwargs)
d55e5bfc 11205
53aa7709 11206 def SetSelection(*args, **kwargs):
d55e5bfc 11207 """
53aa7709 11208 SetSelection(self, int n)
d55e5bfc
RD
11209
11210 Sets the item at index 'n' to be the selected item.
11211 """
5b5c9bc7 11212 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 11213
d55e5bfc
RD
11214 def GetSelection(*args, **kwargs):
11215 """
11216 GetSelection(self) -> int
11217
15817c7e
RD
11218 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11219 is selected.
d55e5bfc 11220 """
5b5c9bc7 11221 return _core_.ItemContainer_GetSelection(*args, **kwargs)
d55e5bfc 11222
53aa7709 11223 def SetStringSelection(*args, **kwargs):
5b5c9bc7
RD
11224 """SetStringSelection(self, String s) -> bool"""
11225 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
53aa7709 11226
d55e5bfc
RD
11227 def GetStringSelection(*args, **kwargs):
11228 """
5b5c9bc7 11229 GetStringSelection(self) -> String
d55e5bfc 11230
15817c7e
RD
11231 Returns the label of the selected item or an empty string if no item
11232 is selected.
d55e5bfc 11233 """
5b5c9bc7 11234 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
d55e5bfc 11235
53aa7709 11236 def Select(*args, **kwargs):
d55e5bfc 11237 """
53aa7709 11238 Select(self, int n)
d55e5bfc 11239
53aa7709
RD
11240 This is the same as `SetSelection` and exists only because it is
11241 slightly more natural for controls which support multiple selection.
d55e5bfc 11242 """
5b5c9bc7 11243 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc 11244
ac5d357a
RD
11245 def GetItems(self):
11246 """Return a list of the strings in the control"""
11247 return [self.GetString(i) for i in xrange(self.GetCount())]
11248
11249 def SetItems(self, items):
11250 """Clear and set the strings in the control from a list"""
11251 self.Clear()
11252 for i in items:
11253 self.Append(i)
11254
11255 Count = property(GetCount,doc="See `GetCount`")
11256 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11257 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11258 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11259 Strings = property(GetStrings,doc="See `GetStrings`")
2131d850 11260_core_.ItemContainer_swigregister(ItemContainer)
d55e5bfc
RD
11261
11262#---------------------------------------------------------------------------
11263
5b5c9bc7 11264class ControlWithItems(Control,ItemContainer):
d55e5bfc 11265 """
15817c7e
RD
11266 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11267 wx.Control class, and is used for the base class of various controls
11268 that have items.
d55e5bfc 11269 """
1bd55598
RD
11270 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11271 def __init__(self): raise AttributeError, "No constructor defined"
11272 __repr__ = _swig_repr
2131d850 11273_core_.ControlWithItems_swigregister(ControlWithItems)
d55e5bfc
RD
11274
11275#---------------------------------------------------------------------------
11276
5b5c9bc7 11277class SizerItem(Object):
bfddbb17
RD
11278 """
11279 The wx.SizerItem class is used to track the position, size and other
2131d850
RD
11280 attributes of each item managed by a `wx.Sizer`. It is not usually
11281 necessary to use this class because the sizer elements can also be
11282 identified by their positions or window or sizer references but
11283 sometimes it may be more convenient to use wx.SizerItem directly.
11284 Also, custom classes derived from `wx.PySizer` will probably need to
11285 use the collection of wx.SizerItems held by wx.Sizer when calculating
11286 layout.
bfddbb17
RD
11287
11288 :see: `wx.Sizer`, `wx.GBSizerItem`
11289 """
1bd55598
RD
11290 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11291 __repr__ = _swig_repr
11292 def __init__(self, *args, **kwargs):
bfddbb17 11293 """
5b5c9bc7 11294 __init__(self) -> SizerItem
bfddbb17
RD
11295
11296 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11297 size will need to be set before this item can be used in a Sizer.
11298
11299 You will probably never need to create a wx.SizerItem directly as they
11300 are created automatically when the sizer's Add, Insert or Prepend
11301 methods are called.
11302
11303 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11304 """
1bd55598
RD
11305 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11306 __swig_destroy__ = _core_.delete_SizerItem
11307 __del__ = lambda self : None;
d55e5bfc 11308 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
11309 """
11310 DeleteWindows(self)
11311
11312 Destroy the window or the windows in a subsizer, depending on the type
11313 of item.
11314 """
5b5c9bc7 11315 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
11316
11317 def DetachSizer(*args, **kwargs):
bfddbb17
RD
11318 """
11319 DetachSizer(self)
11320
11321 Enable deleting the SizerItem without destroying the contained sizer.
11322 """
5b5c9bc7 11323 return _core_.SizerItem_DetachSizer(*args, **kwargs)
d55e5bfc
RD
11324
11325 def GetSize(*args, **kwargs):
bfddbb17 11326 """
5b5c9bc7 11327 GetSize(self) -> Size
bfddbb17
RD
11328
11329 Get the current size of the item, as set in the last Layout.
11330 """
5b5c9bc7 11331 return _core_.SizerItem_GetSize(*args, **kwargs)
d55e5bfc
RD
11332
11333 def CalcMin(*args, **kwargs):
bfddbb17 11334 """
5b5c9bc7 11335 CalcMin(self) -> Size
bfddbb17
RD
11336
11337 Calculates the minimum desired size for the item, including any space
11338 needed by borders.
11339 """
5b5c9bc7 11340 return _core_.SizerItem_CalcMin(*args, **kwargs)
d55e5bfc
RD
11341
11342 def SetDimension(*args, **kwargs):
bfddbb17 11343 """
5b5c9bc7 11344 SetDimension(self, Point pos, Size size)
bfddbb17
RD
11345
11346 Set the position and size of the space allocated for this item by the
11347 sizer, and adjust the position and size of the item (window or
11348 subsizer) to be within that space taking alignment and borders into
11349 account.
11350 """
5b5c9bc7 11351 return _core_.SizerItem_SetDimension(*args, **kwargs)
d55e5bfc
RD
11352
11353 def GetMinSize(*args, **kwargs):
bfddbb17 11354 """
5b5c9bc7 11355 GetMinSize(self) -> Size
bfddbb17
RD
11356
11357 Get the minimum size needed for the item.
11358 """
5b5c9bc7 11359 return _core_.SizerItem_GetMinSize(*args, **kwargs)
d55e5bfc 11360
a001823c
RD
11361 def GetMinSizeWithBorder(*args, **kwargs):
11362 """
5b5c9bc7 11363 GetMinSizeWithBorder(self) -> Size
a001823c
RD
11364
11365 Get the minimum size needed for the item with space for the borders
11366 added, if needed.
11367 """
5b5c9bc7 11368 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
a001823c 11369
d55e5bfc
RD
11370 def SetInitSize(*args, **kwargs):
11371 """SetInitSize(self, int x, int y)"""
5b5c9bc7 11372 return _core_.SizerItem_SetInitSize(*args, **kwargs)
d55e5bfc
RD
11373
11374 def SetRatioWH(*args, **kwargs):
bfddbb17
RD
11375 """
11376 SetRatioWH(self, int width, int height)
11377
11378 Set the ratio item attribute.
11379 """
5b5c9bc7 11380 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
d55e5bfc
RD
11381
11382 def SetRatioSize(*args, **kwargs):
bfddbb17 11383 """
5b5c9bc7 11384 SetRatioSize(self, Size size)
bfddbb17
RD
11385
11386 Set the ratio item attribute.
11387 """
5b5c9bc7 11388 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
d55e5bfc
RD
11389
11390 def SetRatio(*args, **kwargs):
bfddbb17
RD
11391 """
11392 SetRatio(self, float ratio)
11393
11394 Set the ratio item attribute.
11395 """
5b5c9bc7 11396 return _core_.SizerItem_SetRatio(*args, **kwargs)
d55e5bfc
RD
11397
11398 def GetRatio(*args, **kwargs):
bfddbb17
RD
11399 """
11400 GetRatio(self) -> float
11401
11402 Set the ratio item attribute.
11403 """
5b5c9bc7 11404 return _core_.SizerItem_GetRatio(*args, **kwargs)
d55e5bfc 11405
070c48b4
RD
11406 def GetRect(*args, **kwargs):
11407 """
5b5c9bc7 11408 GetRect(self) -> Rect
070c48b4
RD
11409
11410 Returns the rectangle that the sizer item should occupy
11411 """
5b5c9bc7 11412 return _core_.SizerItem_GetRect(*args, **kwargs)
070c48b4 11413
d55e5bfc 11414 def IsWindow(*args, **kwargs):
bfddbb17
RD
11415 """
11416 IsWindow(self) -> bool
11417
11418 Is this sizer item a window?
11419 """
5b5c9bc7 11420 return _core_.SizerItem_IsWindow(*args, **kwargs)
d55e5bfc
RD
11421
11422 def IsSizer(*args, **kwargs):
bfddbb17
RD
11423 """
11424 IsSizer(self) -> bool
11425
11426 Is this sizer item a subsizer?
11427 """
5b5c9bc7 11428 return _core_.SizerItem_IsSizer(*args, **kwargs)
d55e5bfc
RD
11429
11430 def IsSpacer(*args, **kwargs):
bfddbb17
RD
11431 """
11432 IsSpacer(self) -> bool
11433
11434 Is this sizer item a spacer?
11435 """
5b5c9bc7 11436 return _core_.SizerItem_IsSpacer(*args, **kwargs)
d55e5bfc
RD
11437
11438 def SetProportion(*args, **kwargs):
bfddbb17
RD
11439 """
11440 SetProportion(self, int proportion)
11441
11442 Set the proportion value for this item.
11443 """
5b5c9bc7 11444 return _core_.SizerItem_SetProportion(*args, **kwargs)
d55e5bfc
RD
11445
11446 def GetProportion(*args, **kwargs):
bfddbb17
RD
11447 """
11448 GetProportion(self) -> int
11449
11450 Get the proportion value for this item.
11451 """
5b5c9bc7 11452 return _core_.SizerItem_GetProportion(*args, **kwargs)
d55e5bfc 11453
bfddbb17
RD
11454 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11455 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 11456 def SetFlag(*args, **kwargs):
bfddbb17
RD
11457 """
11458 SetFlag(self, int flag)
11459
11460 Set the flag value for this item.
11461 """
5b5c9bc7 11462 return _core_.SizerItem_SetFlag(*args, **kwargs)
d55e5bfc
RD
11463
11464 def GetFlag(*args, **kwargs):
bfddbb17
RD
11465 """
11466 GetFlag(self) -> int
11467
11468 Get the flag value for this item.
11469 """
5b5c9bc7 11470 return _core_.SizerItem_GetFlag(*args, **kwargs)
d55e5bfc
RD
11471
11472 def SetBorder(*args, **kwargs):
bfddbb17
RD
11473 """
11474 SetBorder(self, int border)
11475
11476 Set the border value for this item.
11477 """
5b5c9bc7 11478 return _core_.SizerItem_SetBorder(*args, **kwargs)
d55e5bfc
RD
11479
11480 def GetBorder(*args, **kwargs):
bfddbb17
RD
11481 """
11482 GetBorder(self) -> int
11483
11484 Get the border value for this item.
11485 """
5b5c9bc7 11486 return _core_.SizerItem_GetBorder(*args, **kwargs)
d55e5bfc
RD
11487
11488 def GetWindow(*args, **kwargs):
bfddbb17 11489 """
5b5c9bc7 11490 GetWindow(self) -> Window
bfddbb17
RD
11491
11492 Get the window (if any) that is managed by this sizer item.
11493 """
5b5c9bc7 11494 return _core_.SizerItem_GetWindow(*args, **kwargs)
d55e5bfc
RD
11495
11496 def SetWindow(*args, **kwargs):
bfddbb17 11497 """
5b5c9bc7 11498 SetWindow(self, Window window)
bfddbb17
RD
11499
11500 Set the window to be managed by this sizer item.
11501 """
5b5c9bc7 11502 return _core_.SizerItem_SetWindow(*args, **kwargs)
d55e5bfc
RD
11503
11504 def GetSizer(*args, **kwargs):
bfddbb17 11505 """
5b5c9bc7 11506 GetSizer(self) -> Sizer
bfddbb17
RD
11507
11508 Get the subsizer (if any) that is managed by this sizer item.
11509 """
5b5c9bc7 11510 return _core_.SizerItem_GetSizer(*args, **kwargs)
d55e5bfc
RD
11511
11512 def SetSizer(*args, **kwargs):
bfddbb17 11513 """
5b5c9bc7 11514 SetSizer(self, Sizer sizer)
bfddbb17
RD
11515
11516 Set the subsizer to be managed by this sizer item.
11517 """
5b5c9bc7 11518 return _core_.SizerItem_SetSizer(*args, **kwargs)
d55e5bfc
RD
11519
11520 def GetSpacer(*args, **kwargs):
bfddbb17 11521 """
5b5c9bc7 11522 GetSpacer(self) -> Size
bfddbb17
RD
11523
11524 Get the size of the spacer managed by this sizer item.
11525 """
5b5c9bc7 11526 return _core_.SizerItem_GetSpacer(*args, **kwargs)
d55e5bfc
RD
11527
11528 def SetSpacer(*args, **kwargs):
bfddbb17 11529 """
5b5c9bc7 11530 SetSpacer(self, Size size)
bfddbb17
RD
11531
11532 Set the size of the spacer to be managed by this sizer item.
11533 """
5b5c9bc7 11534 return _core_.SizerItem_SetSpacer(*args, **kwargs)
d55e5bfc
RD
11535
11536 def Show(*args, **kwargs):
bfddbb17
RD
11537 """
11538 Show(self, bool show)
11539
11540 Set the show item attribute, which sizers use to determine if the item
11541 is to be made part of the layout or not. If the item is tracking a
11542 window then it is shown or hidden as needed.
11543 """
5b5c9bc7 11544 return _core_.SizerItem_Show(*args, **kwargs)
d55e5bfc
RD
11545
11546 def IsShown(*args, **kwargs):
bfddbb17
RD
11547 """
11548 IsShown(self) -> bool
11549
11550 Is the item to be shown in the layout?
11551 """
5b5c9bc7 11552 return _core_.SizerItem_IsShown(*args, **kwargs)
d55e5bfc
RD
11553
11554 def GetPosition(*args, **kwargs):
bfddbb17 11555 """
5b5c9bc7 11556 GetPosition(self) -> Point
bfddbb17
RD
11557
11558 Returns the current position of the item, as set in the last Layout.
11559 """
5b5c9bc7 11560 return _core_.SizerItem_GetPosition(*args, **kwargs)
d55e5bfc
RD
11561
11562 def GetUserData(*args, **kwargs):
bfddbb17
RD
11563 """
11564 GetUserData(self) -> PyObject
11565
11566 Returns the userData associated with this sizer item, or None if there
11567 isn't any.
11568 """
5b5c9bc7 11569 return _core_.SizerItem_GetUserData(*args, **kwargs)
d55e5bfc 11570
32fe5131
RD
11571 def SetUserData(*args, **kwargs):
11572 """
11573 SetUserData(self, PyObject userData)
11574
11575 Associate a Python object with this sizer item.
11576 """
11577 return _core_.SizerItem_SetUserData(*args, **kwargs)
11578
33d6fd3b
RD
11579 Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`")
11580 Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`")
11581 MinSize = property(GetMinSize,doc="See `GetMinSize`")
11582 MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`")
11583 Position = property(GetPosition,doc="See `GetPosition`")
11584 Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`")
11585 Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`")
11586 Rect = property(GetRect,doc="See `GetRect`")
11587 Size = property(GetSize,doc="See `GetSize`")
11588 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
11589 Spacer = property(GetSpacer,SetSpacer,doc="See `GetSpacer` and `SetSpacer`")
11590 UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`")
11591 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 11592_core_.SizerItem_swigregister(SizerItem)
d55e5bfc 11593
bfddbb17 11594def SizerItemWindow(*args, **kwargs):
d55e5bfc 11595 """
5b5c9bc7
RD
11596 SizerItemWindow(Window window, int proportion, int flag, int border,
11597 PyObject userData=None) -> SizerItem
bfddbb17
RD
11598
11599 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 11600 """
5b5c9bc7 11601 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
11602 return val
11603
bfddbb17 11604def SizerItemSpacer(*args, **kwargs):
d55e5bfc 11605 """
bfddbb17 11606 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
5b5c9bc7 11607 PyObject userData=None) -> SizerItem
bfddbb17
RD
11608
11609 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 11610 """
5b5c9bc7 11611 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
11612 return val
11613
11614def SizerItemSizer(*args, **kwargs):
11615 """
5b5c9bc7
RD
11616 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11617 PyObject userData=None) -> SizerItem
bfddbb17
RD
11618
11619 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc 11620 """
5b5c9bc7 11621 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
11622 return val
11623
5b5c9bc7 11624class Sizer(Object):
bfddbb17
RD
11625 """
11626 wx.Sizer is the abstract base class used for laying out subwindows in
11627 a window. You cannot use wx.Sizer directly; instead, you will have to
11628 use one of the sizer classes derived from it such as `wx.BoxSizer`,
1d5ee749
RD
11629 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11630 `wx.GridBagSizer`.
bfddbb17
RD
11631
11632 The concept implemented by sizers in wxWidgets is closely related to
11633 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11634 toolkit or the Qt toolkit. It is based upon the idea of the individual
11635 subwindows reporting their minimal required size and their ability to
11636 get stretched if the size of the parent window has changed. This will
11637 most often mean that the programmer does not set the original size of
11638 a dialog in the beginning, rather the dialog will assigned a sizer and
11639 this sizer will be queried about the recommended size. The sizer in
11640 turn will query its children, which can be normal windows or contorls,
11641 empty space or other sizers, so that a hierarchy of sizers can be
11642 constructed. Note that wxSizer does not derive from wxWindow and thus
11643 do not interfere with tab ordering and requires very little resources
11644 compared to a real window on screen.
11645
11646 What makes sizers so well fitted for use in wxWidgets is the fact that
11647 every control reports its own minimal size and the algorithm can
11648 handle differences in font sizes or different window (dialog item)
11649 sizes on different platforms without problems. If for example the
11650 standard font as well as the overall design of Mac widgets requires
11651 more space than on Windows, then the initial size of a dialog using a
11652 sizer will automatically be bigger on Mac than on Windows.
11653 """
1bd55598
RD
11654 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11655 def __init__(self): raise AttributeError, "No constructor defined"
11656 __repr__ = _swig_repr
11657 __swig_destroy__ = _core_.delete_Sizer
11658 __del__ = lambda self : None;
d55e5bfc
RD
11659 def _setOORInfo(*args, **kwargs):
11660 """_setOORInfo(self, PyObject _self)"""
5b5c9bc7 11661 return _core_.Sizer__setOORInfo(*args, **kwargs)
d55e5bfc
RD
11662
11663 def Add(*args, **kwargs):
11664 """
bfddbb17 11665 Add(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11666 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11667
11668 Appends a child item to the sizer.
d55e5bfc 11669 """
5b5c9bc7 11670 return _core_.Sizer_Add(*args, **kwargs)
d55e5bfc
RD
11671
11672 def Insert(*args, **kwargs):
11673 """
bfddbb17 11674 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
070c48b4 11675 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11676
11677 Inserts a new item into the list of items managed by this sizer before
11678 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc 11679 """
5b5c9bc7 11680 return _core_.Sizer_Insert(*args, **kwargs)
d55e5bfc
RD
11681
11682 def Prepend(*args, **kwargs):
11683 """
bfddbb17 11684 Prepend(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11685 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11686
11687 Adds a new item to the begining of the list of sizer items managed by
11688 this sizer. See `Add` for a description of the parameters.
d55e5bfc 11689 """
5b5c9bc7 11690 return _core_.Sizer_Prepend(*args, **kwargs)
d55e5bfc
RD
11691
11692 def Remove(*args, **kwargs):
bfddbb17
RD
11693 """
11694 Remove(self, item) -> bool
11695
11696 Removes an item from the sizer and destroys it. This method does not
11697 cause any layout or resizing to take place, call `Layout` to update
11698 the layout on screen after removing a child from the sizer. The
11699 *item* parameter can be either a window, a sizer, or the zero-based
11700 index of an item to remove. Returns True if the child item was found
11701 and removed.
11702 """
5b5c9bc7 11703 return _core_.Sizer_Remove(*args, **kwargs)
d55e5bfc 11704
1a6bba1e 11705 def Detach(*args, **kwargs):
bfddbb17
RD
11706 """
11707 Detach(self, item) -> bool
11708
11709 Detaches an item from the sizer without destroying it. This method
11710 does not cause any layout or resizing to take place, call `Layout` to
11711 do so. The *item* parameter can be either a window, a sizer, or the
11712 zero-based index of the item to be detached. Returns True if the child item
11713 was found and detached.
11714 """
5b5c9bc7 11715 return _core_.Sizer_Detach(*args, **kwargs)
1a6bba1e 11716
070c48b4
RD
11717 def GetItem(*args, **kwargs):
11718 """
11719 GetItem(self, item) -> wx.SizerItem
11720
11721 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11722 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11723 the item to be found.
070c48b4 11724 """
5b5c9bc7 11725 return _core_.Sizer_GetItem(*args, **kwargs)
070c48b4 11726
d55e5bfc 11727 def _SetItemMinSize(*args, **kwargs):
5b5c9bc7
RD
11728 """_SetItemMinSize(self, PyObject item, Size size)"""
11729 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
d55e5bfc 11730
ac5d357a
RD
11731 def _ReplaceWin(*args, **kwargs):
11732 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
11733 return _core_.Sizer__ReplaceWin(*args, **kwargs)
11734
11735 def _ReplaceSizer(*args, **kwargs):
11736 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
11737 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
11738
11739 def _ReplaceItem(*args, **kwargs):
11740 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
11741 return _core_.Sizer__ReplaceItem(*args, **kwargs)
11742
11743 def Replace(self, olditem, item, recursive=False):
11744 """
11745 Detaches the given ``olditem`` from the sizer and replaces it with
11746 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
11747 detached child is destroyed only if it is not a window, (because
11748 windows are owned by their parent, not the sizer.) The
11749 ``recursive`` parameter can be used to search for the given
11750 element recursivly in subsizers.
11751
11752 This method does not cause any layout or resizing to take place,
11753 call `Layout` to do so.
11754
11755 Returns ``True`` if the child item was found and removed.
11756 """
11757 if isinstance(olditem, wx.Window):
11758 return self._ReplaceWin(olditem, item, recursive)
11759 elif isinstnace(olditem, wx.Sizer):
11760 return self._ReplaceSizer(olditem, item, recursive)
11761 elif isinstnace(olditem, int):
11762 return self._ReplaceItem(olditem, item)
11763 else:
11764 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
11765
11766 def SetContainingWindow(*args, **kwargs):
11767 """
11768 SetContainingWindow(self, Window window)
11769
11770 Set (or unset) the window this sizer is used in.
11771 """
11772 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
11773
11774 def GetContainingWindow(*args, **kwargs):
11775 """
11776 GetContainingWindow(self) -> Window
11777
11778 Get the window this sizer is used in.
11779 """
11780 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
11781
bfddbb17
RD
11782 def SetItemMinSize(self, item, *args):
11783 """
11784 SetItemMinSize(self, item, Size size)
11785
11786 Sets the minimum size that will be allocated for an item in the sizer.
11787 The *item* parameter can be either a window, a sizer, or the
11788 zero-based index of the item. If a window or sizer is given then it
11789 will be searched for recursivly in subsizers if neccessary.
11790 """
11791 if len(args) == 2:
11792 # for backward compatibility accept separate width,height args too
11793 return self._SetItemMinSize(item, args)
11794 else:
11795 return self._SetItemMinSize(item, args[0])
11796
d55e5bfc 11797 def AddItem(*args, **kwargs):
bfddbb17
RD
11798 """
11799 AddItem(self, SizerItem item)
11800
11801 Adds a `wx.SizerItem` to the sizer.
11802 """
5b5c9bc7 11803 return _core_.Sizer_AddItem(*args, **kwargs)
d55e5bfc
RD
11804
11805 def InsertItem(*args, **kwargs):
bfddbb17
RD
11806 """
11807 InsertItem(self, int index, SizerItem item)
11808
11809 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11810 """
5b5c9bc7 11811 return _core_.Sizer_InsertItem(*args, **kwargs)
d55e5bfc
RD
11812
11813 def PrependItem(*args, **kwargs):
bfddbb17
RD
11814 """
11815 PrependItem(self, SizerItem item)
11816
11817 Prepends a `wx.SizerItem` to the sizer.
11818 """
5b5c9bc7 11819 return _core_.Sizer_PrependItem(*args, **kwargs)
d55e5bfc 11820
bfddbb17 11821 def AddMany(self, items):
d6c14a4c
RD
11822 """
11823 AddMany is a convenience method for adding several items
11824 to a sizer at one time. Simply pass it a list of tuples,
11825 where each tuple consists of the parameters that you
11826 would normally pass to the `Add` method.
11827 """
bfddbb17
RD
11828 for item in items:
11829 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11830 item = (item, )
11831 self.Add(*item)
d55e5bfc 11832
0d2c9713
RD
11833 def AddSpacer(self, *args, **kw):
11834 """AddSpacer(int size) --> SizerItem
11835
11836 Add a spacer that is (size,size) pixels.
11837 """
11838 if args and type(args[0]) == int:
11839 return self.Add( (args[0],args[0] ), 0)
11840 else: # otherwise stay compatible with old AddSpacer
11841 return self.Add(*args, **kw)
11842 def PrependSpacer(self, *args, **kw):
11843 """PrependSpacer(int size) --> SizerItem
11844
11845 Prepend a spacer that is (size, size) pixels."""
11846 if args and type(args[0]) == int:
11847 return self.Prepend( (args[0],args[0] ), 0)
11848 else: # otherwise stay compatible with old PrependSpacer
11849 return self.Prepend(*args, **kw)
11850 def InsertSpacer(self, index, *args, **kw):
11851 """InsertSpacer(int index, int size) --> SizerItem
11852
11853 Insert a spacer at position index that is (size, size) pixels."""
11854 if args and type(args[0]) == int:
11855 return self.Insert( index, (args[0],args[0] ), 0)
11856 else: # otherwise stay compatible with old InsertSpacer
11857 return self.Insert(index, *args, **kw)
11858
11859
11860 def AddStretchSpacer(self, prop=1):
11861 """AddStretchSpacer(int prop=1) --> SizerItem
11862
11863 Add a stretchable spacer."""
11864 return self.Add((0,0), prop)
11865 def PrependStretchSpacer(self, prop=1):
11866 """PrependStretchSpacer(int prop=1) --> SizerItem
11867
11868 Prepend a stretchable spacer."""
11869 return self.Prepend((0,0), prop)
11870 def InsertStretchSpacer(self, index, prop=1):
11871 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
11872
11873 Insert a stretchable spacer."""
11874 return self.Insert(index, (0,0), prop)
11875
11876
d55e5bfc 11877 # for backwards compatibility only, please do not use in new code
7fbf8399
RD
11878 def AddWindow(self, *args, **kw):
11879 """Compatibility alias for `Add`."""
11880 return self.Add(*args, **kw)
11881 def AddSizer(self, *args, **kw):
11882 """Compatibility alias for `Add`."""
11883 return self.Add(*args, **kw)
7fbf8399
RD
11884
11885 def PrependWindow(self, *args, **kw):
11886 """Compatibility alias for `Prepend`."""
11887 return self.Prepend(*args, **kw)
11888 def PrependSizer(self, *args, **kw):
11889 """Compatibility alias for `Prepend`."""
11890 return self.Prepend(*args, **kw)
7fbf8399
RD
11891
11892 def InsertWindow(self, *args, **kw):
11893 """Compatibility alias for `Insert`."""
11894 return self.Insert(*args, **kw)
11895 def InsertSizer(self, *args, **kw):
11896 """Compatibility alias for `Insert`."""
7fbf8399
RD
11897 return self.Insert(*args, **kw)
11898
11899 def RemoveWindow(self, *args, **kw):
11900 """Compatibility alias for `Remove`."""
11901 return self.Remove(*args, **kw)
11902 def RemoveSizer(self, *args, **kw):
11903 """Compatibility alias for `Remove`."""
11904 return self.Remove(*args, **kw)
11905 def RemovePos(self, *args, **kw):
11906 """Compatibility alias for `Remove`."""
11907 return self.Remove(*args, **kw)
d55e5bfc
RD
11908
11909
d55e5bfc 11910 def SetDimension(*args, **kwargs):
bfddbb17
RD
11911 """
11912 SetDimension(self, int x, int y, int width, int height)
11913
11914 Call this to force the sizer to take the given dimension and thus
11915 force the items owned by the sizer to resize themselves according to
11916 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11917 methods.
11918 """
5b5c9bc7 11919 return _core_.Sizer_SetDimension(*args, **kwargs)
d55e5bfc
RD
11920
11921 def SetMinSize(*args, **kwargs):
bfddbb17 11922 """
5b5c9bc7 11923 SetMinSize(self, Size size)
bfddbb17
RD
11924
11925 Call this to give the sizer a minimal size. Normally, the sizer will
11926 calculate its minimal size based purely on how much space its children
11927 need. After calling this method `GetMinSize` will return either the
11928 minimal size as requested by its children or the minimal size set
11929 here, depending on which is bigger.
11930 """
5b5c9bc7 11931 return _core_.Sizer_SetMinSize(*args, **kwargs)
d55e5bfc
RD
11932
11933 def GetSize(*args, **kwargs):
bfddbb17 11934 """
5b5c9bc7 11935 GetSize(self) -> Size
bfddbb17
RD
11936
11937 Returns the current size of the space managed by the sizer.
11938 """
5b5c9bc7 11939 return _core_.Sizer_GetSize(*args, **kwargs)
d55e5bfc
RD
11940
11941 def GetPosition(*args, **kwargs):
bfddbb17 11942 """
5b5c9bc7 11943 GetPosition(self) -> Point
bfddbb17
RD
11944
11945 Returns the current position of the sizer's managed space.
11946 """
5b5c9bc7 11947 return _core_.Sizer_GetPosition(*args, **kwargs)
d55e5bfc
RD
11948
11949 def GetMinSize(*args, **kwargs):
bfddbb17 11950 """
5b5c9bc7 11951 GetMinSize(self) -> Size
bfddbb17
RD
11952
11953 Returns the minimal size of the sizer. This is either the combined
11954 minimal size of all the children and their borders or the minimal size
11955 set by SetMinSize, depending on which is bigger.
11956 """
5b5c9bc7 11957 return _core_.Sizer_GetMinSize(*args, **kwargs)
d55e5bfc
RD
11958
11959 def GetSizeTuple(self):
1a6bba1e 11960 return self.GetSize().Get()
d55e5bfc 11961 def GetPositionTuple(self):
1a6bba1e 11962 return self.GetPosition().Get()
d55e5bfc 11963 def GetMinSizeTuple(self):
1a6bba1e 11964 return self.GetMinSize().Get()
d55e5bfc
RD
11965
11966 def RecalcSizes(*args, **kwargs):
bfddbb17
RD
11967 """
11968 RecalcSizes(self)
11969
11970 Using the sizes calculated by `CalcMin` reposition and resize all the
11971 items managed by this sizer. You should not need to call this directly as
11972 it is called by `Layout`.
11973 """
5b5c9bc7 11974 return _core_.Sizer_RecalcSizes(*args, **kwargs)
d55e5bfc
RD
11975
11976 def CalcMin(*args, **kwargs):
bfddbb17 11977 """
5b5c9bc7 11978 CalcMin(self) -> Size
bfddbb17
RD
11979
11980 This method is where the sizer will do the actual calculation of its
11981 children's minimal sizes. You should not need to call this directly as
11982 it is called by `Layout`.
11983 """
5b5c9bc7 11984 return _core_.Sizer_CalcMin(*args, **kwargs)
d55e5bfc
RD
11985
11986 def Layout(*args, **kwargs):
bfddbb17
RD
11987 """
11988 Layout(self)
11989
11990 This method will force the recalculation and layout of the items
11991 controlled by the sizer using the current space allocated to the
11992 sizer. Normally this is called automatically from the owning window's
11993 EVT_SIZE handler, but it is also useful to call it from user code when
11994 one of the items in a sizer change size, or items are added or
11995 removed.
11996 """
5b5c9bc7 11997 return _core_.Sizer_Layout(*args, **kwargs)
d55e5bfc
RD
11998
11999 def Fit(*args, **kwargs):
bfddbb17 12000 """
5b5c9bc7 12001 Fit(self, Window window) -> Size
bfddbb17
RD
12002
12003 Tell the sizer to resize the *window* to match the sizer's minimal
12004 size. This is commonly done in the constructor of the window itself in
12005 order to set its initial size to match the needs of the children as
12006 determined by the sizer. Returns the new size.
12007
12008 For a top level window this is the total window size, not the client size.
12009 """
5b5c9bc7 12010 return _core_.Sizer_Fit(*args, **kwargs)
d55e5bfc
RD
12011
12012 def FitInside(*args, **kwargs):
bfddbb17 12013 """
5b5c9bc7 12014 FitInside(self, Window window)
bfddbb17
RD
12015
12016 Tell the sizer to resize the *virtual size* of the *window* to match the
12017 sizer's minimal size. This will not alter the on screen size of the
12018 window, but may cause the addition/removal/alteration of scrollbars
12019 required to view the virtual area in windows which manage it.
12020
12021 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12022
12023 """
5b5c9bc7 12024 return _core_.Sizer_FitInside(*args, **kwargs)
d55e5bfc
RD
12025
12026 def SetSizeHints(*args, **kwargs):
bfddbb17 12027 """
5b5c9bc7 12028 SetSizeHints(self, Window window)
bfddbb17
RD
12029
12030 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12031 match the sizer's minimal size. This is commonly done in the
12032 constructor of the window itself if the window is resizable (as are
12033 many dialogs under Unix and frames on probably all platforms) in order
12034 to prevent the window from being sized smaller than the minimal size
12035 required by the sizer.
12036 """
5b5c9bc7 12037 return _core_.Sizer_SetSizeHints(*args, **kwargs)
d55e5bfc
RD
12038
12039 def SetVirtualSizeHints(*args, **kwargs):
bfddbb17 12040 """
5b5c9bc7 12041 SetVirtualSizeHints(self, Window window)
bfddbb17
RD
12042
12043 Tell the sizer to set the minimal size of the window virtual area to
12044 match the sizer's minimal size. For windows with managed scrollbars
12045 this will set them appropriately.
12046
12047 :see: `wx.ScrolledWindow.SetScrollbars`
12048
12049 """
5b5c9bc7 12050 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
d55e5bfc
RD
12051
12052 def Clear(*args, **kwargs):
bfddbb17
RD
12053 """
12054 Clear(self, bool deleteWindows=False)
12055
12056 Clear all items from the sizer, optionally destroying the window items
12057 as well.
12058 """
5b5c9bc7 12059 return _core_.Sizer_Clear(*args, **kwargs)
d55e5bfc
RD
12060
12061 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
12062 """
12063 DeleteWindows(self)
12064
12065 Destroy all windows managed by the sizer.
12066 """
5b5c9bc7 12067 return _core_.Sizer_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
12068
12069 def GetChildren(*args, **kwargs):
bfddbb17 12070 """
51b83b37 12071 GetChildren(self) -> list
bfddbb17
RD
12072
12073 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12074 """
5b5c9bc7 12075 return _core_.Sizer_GetChildren(*args, **kwargs)
d55e5bfc
RD
12076
12077 def Show(*args, **kwargs):
bfddbb17 12078 """
b411df4a 12079 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 12080
bfddbb17
RD
12081 Shows or hides an item managed by the sizer. To make a sizer item
12082 disappear or reappear, use Show followed by `Layout`. The *item*
12083 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
12084 the item. Use the recursive parameter to show or hide an item in a
12085 subsizer. Returns True if the item was found.
bfddbb17 12086 """
5b5c9bc7 12087 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
12088
12089 def IsShown(*args, **kwargs):
bfddbb17
RD
12090 """
12091 IsShown(self, item)
12092
b1fcee84 12093 Determines if the item is currently shown. To make a sizer
bfddbb17
RD
12094 item disappear or reappear, use Show followed by `Layout`. The *item*
12095 parameter can be either a window, a sizer, or the zero-based index of
12096 the item.
12097 """
5b5c9bc7 12098 return _core_.Sizer_IsShown(*args, **kwargs)
d55e5bfc 12099
629e65c2 12100 def Hide(self, item, recursive=False):
bfddbb17 12101 """
27fb7603 12102 A convenience method for `Show` (item, False, recursive).
bfddbb17 12103 """
06759a38 12104 return self.Show(item, False, recursive)
bfddbb17 12105
d55e5bfc 12106 def ShowItems(*args, **kwargs):
bfddbb17
RD
12107 """
12108 ShowItems(self, bool show)
12109
84f85550 12110 Recursively call `wx.SizerItem.Show` on all sizer items.
bfddbb17 12111 """
5b5c9bc7 12112 return _core_.Sizer_ShowItems(*args, **kwargs)
d55e5bfc 12113
33d6fd3b
RD
12114 Children = property(GetChildren,doc="See `GetChildren`")
12115 ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`")
12116 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
12117 Position = property(GetPosition,doc="See `GetPosition`")
12118 Size = property(GetSize,doc="See `GetSize`")
2131d850 12119_core_.Sizer_swigregister(Sizer)
d55e5bfc 12120
5b5c9bc7 12121class PySizer(Sizer):
bfddbb17
RD
12122 """
12123 wx.PySizer is a special version of `wx.Sizer` that has been
12124 instrumented to allow the C++ virtual methods to be overloaded in
12125 Python derived classes. You would derive from this class if you are
12126 wanting to implement a custom sizer in Python code. Simply implement
12127 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12128 For example::
12129
12130 class MySizer(wx.PySizer):
12131 def __init__(self):
12132 wx.PySizer.__init__(self)
12133
12134 def CalcMin(self):
12135 for item in self.GetChildren():
12136 # calculate the total minimum width and height needed
12137 # by all items in the sizer according to this sizer's
12138 # layout algorithm.
12139 ...
12140 return wx.Size(width, height)
12141
12142 def RecalcSizes(self):
12143 # find the space allotted to this sizer
12144 pos = self.GetPosition()
12145 size = self.GetSize()
12146 for item in self.GetChildren():
12147 # Recalculate (if necessary) the position and size of
12148 # each item and then call item.SetDimension to do the
12149 # actual positioning and sizing of the items within the
12150 # space alloted to this sizer.
12151 ...
12152 item.SetDimension(itemPos, itemSize)
12153
12154
12155 When `Layout` is called it first calls `CalcMin` followed by
12156 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 12157 `CalcMin` and reusing them in `RecalcSizes`.
bfddbb17
RD
12158
12159 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12160
12161
12162 """
1bd55598
RD
12163 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12164 __repr__ = _swig_repr
12165 def __init__(self, *args, **kwargs):
bfddbb17 12166 """
5b5c9bc7 12167 __init__(self) -> PySizer
bfddbb17
RD
12168
12169 Creates a wx.PySizer. Must be called from the __init__ in the derived
12170 class.
12171 """
1bd55598 12172 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
d55e5bfc
RD
12173 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
12174
12175 def _setCallbackInfo(*args, **kwargs):
12176 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 12177 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
d55e5bfc 12178
2131d850 12179_core_.PySizer_swigregister(PySizer)
d55e5bfc
RD
12180
12181#---------------------------------------------------------------------------
12182
5b5c9bc7 12183class BoxSizer(Sizer):
bfddbb17
RD
12184 """
12185 The basic idea behind a box sizer is that windows will most often be
12186 laid out in rather simple basic geometry, typically in a row or a
12187 column or nested hierarchies of either. A wx.BoxSizer will lay out
12188 its items in a simple row or column, depending on the orientation
12189 parameter passed to the constructor.
12190 """
1bd55598
RD
12191 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12192 __repr__ = _swig_repr
12193 def __init__(self, *args, **kwargs):
bfddbb17 12194 """
5b5c9bc7 12195 __init__(self, int orient=HORIZONTAL) -> BoxSizer
bfddbb17
RD
12196
12197 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12198 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12199 sizer.
12200 """
1bd55598 12201 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d55e5bfc
RD
12202 self._setOORInfo(self)
12203
12204 def GetOrientation(*args, **kwargs):
bfddbb17
RD
12205 """
12206 GetOrientation(self) -> int
12207
12208 Returns the current orientation of the sizer.
12209 """
5b5c9bc7 12210 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
d55e5bfc
RD
12211
12212 def SetOrientation(*args, **kwargs):
bfddbb17
RD
12213 """
12214 SetOrientation(self, int orient)
d55e5bfc 12215
bfddbb17
RD
12216 Resets the orientation of the sizer.
12217 """
5b5c9bc7 12218 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc 12219
2bf58437 12220 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
2131d850 12221_core_.BoxSizer_swigregister(BoxSizer)
d55e5bfc
RD
12222
12223#---------------------------------------------------------------------------
12224
5b5c9bc7 12225class StaticBoxSizer(BoxSizer):
bfddbb17
RD
12226 """
12227 wx.StaticBoxSizer derives from and functions identically to the
12228 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12229 manages. Note that this static box must be created separately and
12230 passed to the sizer constructor.
12231 """
1bd55598
RD
12232 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12233 __repr__ = _swig_repr
12234 def __init__(self, *args, **kwargs):
bfddbb17 12235 """
5b5c9bc7 12236 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
bfddbb17
RD
12237
12238 Constructor. It takes an associated static box and the orientation
12239 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12240 ``wx.HORIZONTAL``.
12241 """
1bd55598 12242 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d55e5bfc
RD
12243 self._setOORInfo(self)
12244
12245 def GetStaticBox(*args, **kwargs):
bfddbb17 12246 """
5b5c9bc7 12247 GetStaticBox(self) -> StaticBox
d55e5bfc 12248
bfddbb17
RD
12249 Returns the static box associated with this sizer.
12250 """
5b5c9bc7 12251 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc 12252
33d6fd3b 12253 StaticBox = property(GetStaticBox,doc="See `GetStaticBox`")
2131d850 12254_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d55e5bfc
RD
12255
12256#---------------------------------------------------------------------------
12257
5b5c9bc7 12258class GridSizer(Sizer):
bfddbb17
RD
12259 """
12260 A grid sizer is a sizer which lays out its children in a
12261 two-dimensional table with all cells having the same size. In other
12262 words, the width of each cell within the grid is the width of the
12263 widest item added to the sizer and the height of each grid cell is the
12264 height of the tallest item. An optional vertical and/or horizontal
12265 gap between items can also be specified (in pixels.)
12266
12267 Items are placed in the cells of the grid in the order they are added,
12268 in row-major order. In other words, the first row is filled first,
12269 then the second, and so on until all items have been added. (If
12270 neccessary, additional rows will be added as items are added.) If you
12271 need to have greater control over the cells that items are placed in
12272 then use the `wx.GridBagSizer`.
12273
12274 """
1bd55598
RD
12275 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12276 __repr__ = _swig_repr
12277 def __init__(self, *args, **kwargs):
bfddbb17 12278 """
5b5c9bc7 12279 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
bfddbb17
RD
12280
12281 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12282 of columns and rows in the sizer - if either of the parameters is
12283 zero, it will be calculated to from the total number of children in
12284 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12285 define extra space between all children.
12286 """
1bd55598 12287 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d55e5bfc
RD
12288 self._setOORInfo(self)
12289
d55e5bfc 12290 def SetCols(*args, **kwargs):
bfddbb17
RD
12291 """
12292 SetCols(self, int cols)
12293
12294 Sets the number of columns in the sizer.
12295 """
5b5c9bc7 12296 return _core_.GridSizer_SetCols(*args, **kwargs)
d55e5bfc
RD
12297
12298 def SetRows(*args, **kwargs):
bfddbb17
RD
12299 """
12300 SetRows(self, int rows)
12301
12302 Sets the number of rows in the sizer.
12303 """
5b5c9bc7 12304 return _core_.GridSizer_SetRows(*args, **kwargs)
d55e5bfc
RD
12305
12306 def SetVGap(*args, **kwargs):
bfddbb17
RD
12307 """
12308 SetVGap(self, int gap)
12309
12310 Sets the vertical gap (in pixels) between the cells in the sizer.
12311 """
5b5c9bc7 12312 return _core_.GridSizer_SetVGap(*args, **kwargs)
d55e5bfc
RD
12313
12314 def SetHGap(*args, **kwargs):
bfddbb17
RD
12315 """
12316 SetHGap(self, int gap)
12317
12318 Sets the horizontal gap (in pixels) between cells in the sizer
12319 """
5b5c9bc7 12320 return _core_.GridSizer_SetHGap(*args, **kwargs)
d55e5bfc
RD
12321
12322 def GetCols(*args, **kwargs):
bfddbb17
RD
12323 """
12324 GetCols(self) -> int
12325
12326 Returns the number of columns in the sizer.
12327 """
5b5c9bc7 12328 return _core_.GridSizer_GetCols(*args, **kwargs)
d55e5bfc
RD
12329
12330 def GetRows(*args, **kwargs):
bfddbb17
RD
12331 """
12332 GetRows(self) -> int
12333
12334 Returns the number of rows in the sizer.
12335 """
5b5c9bc7 12336 return _core_.GridSizer_GetRows(*args, **kwargs)
d55e5bfc
RD
12337
12338 def GetVGap(*args, **kwargs):
bfddbb17
RD
12339 """
12340 GetVGap(self) -> int
12341
12342 Returns the vertical gap (in pixels) between the cells in the sizer.
12343 """
5b5c9bc7 12344 return _core_.GridSizer_GetVGap(*args, **kwargs)
d55e5bfc
RD
12345
12346 def GetHGap(*args, **kwargs):
bfddbb17
RD
12347 """
12348 GetHGap(self) -> int
12349
12350 Returns the horizontal gap (in pixels) between cells in the sizer.
12351 """
5b5c9bc7 12352 return _core_.GridSizer_GetHGap(*args, **kwargs)
d55e5bfc 12353
1bd55598
RD
12354 def CalcRowsCols(self):
12355 """
12356 CalcRowsCols() -> (rows, cols)
12357
12358 Calculates how many rows and columns will be in the sizer based
12359 on the current number of items and also the rows, cols specified
12360 in the constructor.
12361 """
12362 nitems = len(self.GetChildren())
12363 rows = self.GetRows()
12364 cols = self.GetCols()
12365 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
12366 if cols != 0:
12367 rows = (nitems + cols - 1) / cols
12368 elif rows != 0:
12369 cols = (nitems + rows - 1) / rows
12370 return (rows, cols)
d55e5bfc 12371
ac5d357a
RD
12372 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
12373 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
12374 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
12375 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
2131d850 12376_core_.GridSizer_swigregister(GridSizer)
d55e5bfc
RD
12377
12378#---------------------------------------------------------------------------
12379
5b5c9bc7
RD
12380FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12381FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12382FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
12383class FlexGridSizer(GridSizer):
bfddbb17
RD
12384 """
12385 A flex grid sizer is a sizer which lays out its children in a
12386 two-dimensional table with all table cells in one row having the same
12387 height and all cells in one column having the same width, but all
12388 rows or all columns are not necessarily the same height or width as in
12389 the `wx.GridSizer`.
12390
12391 wx.FlexGridSizer can also size items equally in one direction but
12392 unequally ("flexibly") in the other. If the sizer is only flexible
12393 in one direction (this can be changed using `SetFlexibleDirection`), it
12394 needs to be decided how the sizer should grow in the other ("non
12395 flexible") direction in order to fill the available space. The
12396 `SetNonFlexibleGrowMode` method serves this purpose.
12397
12398
12399 """
1bd55598
RD
12400 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12401 __repr__ = _swig_repr
12402 def __init__(self, *args, **kwargs):
bfddbb17 12403 """
5b5c9bc7 12404 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
bfddbb17
RD
12405
12406 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12407 number of columns and rows in the sizer - if either of the parameters
12408 is zero, it will be calculated to from the total number of children in
12409 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12410 define extra space between all children.
12411 """
1bd55598 12412 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d55e5bfc
RD
12413 self._setOORInfo(self)
12414
bfddbb17
RD
12415 def AddGrowableRow(*args, **kwargs):
12416 """
12417 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 12418
bfddbb17
RD
12419 Specifies that row *idx* (starting from zero) should be grown if there
12420 is extra space available to the sizer.
d55e5bfc 12421
bfddbb17
RD
12422 The *proportion* parameter has the same meaning as the stretch factor
12423 for the box sizers except that if all proportions are 0, then all
12424 columns are resized equally (instead of not being resized at all).
12425 """
5b5c9bc7 12426 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
d55e5bfc
RD
12427
12428 def RemoveGrowableRow(*args, **kwargs):
bfddbb17
RD
12429 """
12430 RemoveGrowableRow(self, size_t idx)
12431
12432 Specifies that row *idx* is no longer growable.
12433 """
5b5c9bc7 12434 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
d55e5bfc
RD
12435
12436 def AddGrowableCol(*args, **kwargs):
bfddbb17
RD
12437 """
12438 AddGrowableCol(self, size_t idx, int proportion=0)
12439
12440 Specifies that column *idx* (starting from zero) should be grown if
12441 there is extra space available to the sizer.
12442
12443 The *proportion* parameter has the same meaning as the stretch factor
12444 for the box sizers except that if all proportions are 0, then all
12445 columns are resized equally (instead of not being resized at all).
12446 """
5b5c9bc7 12447 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
d55e5bfc
RD
12448
12449 def RemoveGrowableCol(*args, **kwargs):
bfddbb17
RD
12450 """
12451 RemoveGrowableCol(self, size_t idx)
12452
12453 Specifies that column *idx* is no longer growable.
12454 """
5b5c9bc7 12455 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
d55e5bfc
RD
12456
12457 def SetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
12458 """
12459 SetFlexibleDirection(self, int direction)
12460
12461 Specifies whether the sizer should flexibly resize its columns, rows,
12462 or both. Argument *direction* can be one of the following values. Any
12463 other value is ignored.
12464
12465 ============== =======================================
12466 wx.VERTICAL Rows are flexibly sized.
12467 wx.HORIZONTAL Columns are flexibly sized.
12468 wx.BOTH Both rows and columns are flexibly sized
12469 (this is the default value).
12470 ============== =======================================
12471
12472 Note that this method does not trigger relayout.
12473
12474 """
5b5c9bc7 12475 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
12476
12477 def GetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
12478 """
12479 GetFlexibleDirection(self) -> int
12480
12481 Returns a value that specifies whether the sizer
12482 flexibly resizes its columns, rows, or both (default).
12483
12484 :see: `SetFlexibleDirection`
12485 """
5b5c9bc7 12486 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
12487
12488 def SetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
12489 """
12490 SetNonFlexibleGrowMode(self, int mode)
12491
12492 Specifies how the sizer should grow in the non-flexible direction if
12493 there is one (so `SetFlexibleDirection` must have been called
12494 previously). Argument *mode* can be one of the following values:
12495
12496 ========================== =================================================
12497 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12498 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12499 `AddGrowableCol` and `AddGrowableRow`. In this
12500 case equal sizing applies to minimum sizes of
12501 columns or rows (this is the default value).
12502 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12503 the non flexible direction, whether they are
12504 growable or not in the flexbile direction.
12505 ========================== =================================================
12506
12507 Note that this method does not trigger relayout.
bfddbb17 12508 """
5b5c9bc7 12509 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
12510
12511 def GetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
12512 """
12513 GetNonFlexibleGrowMode(self) -> int
12514
12515 Returns the value that specifies how the sizer grows in the
12516 non-flexible direction if there is one.
12517
12518 :see: `SetNonFlexibleGrowMode`
12519 """
5b5c9bc7 12520 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
12521
12522 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
12523 """
12524 GetRowHeights(self) -> list
12525
12526 Returns a list of integers representing the heights of each of the
12527 rows in the sizer.
12528 """
5b5c9bc7 12529 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
d55e5bfc
RD
12530
12531 def GetColWidths(*args, **kwargs):
fd2dc343
RD
12532 """
12533 GetColWidths(self) -> list
12534
12535 Returns a list of integers representing the widths of each of the
12536 columns in the sizer.
12537 """
5b5c9bc7 12538 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
d55e5bfc 12539
ac5d357a
RD
12540 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
12541 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
12542 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
12543 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
2131d850 12544_core_.FlexGridSizer_swigregister(FlexGridSizer)
d55e5bfc 12545
5b5c9bc7 12546class StdDialogButtonSizer(BoxSizer):
62d32a5f
RD
12547 """
12548 A special sizer that knows how to order and position standard buttons
12549 in order to conform to the current platform's standards. You simply
12550 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 12551 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
12552 will take care of the rest.
12553
12554 """
1bd55598
RD
12555 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12556 __repr__ = _swig_repr
12557 def __init__(self, *args, **kwargs):
5b5c9bc7 12558 """__init__(self) -> StdDialogButtonSizer"""
1bd55598 12559 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
62d32a5f
RD
12560 def AddButton(*args, **kwargs):
12561 """
12562 AddButton(self, wxButton button)
12563
12564 Use this to add the buttons to this sizer. Do not use the `Add`
12565 method in the base class.
12566 """
5b5c9bc7 12567 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
62d32a5f 12568
53aa7709 12569 def Realize(*args, **kwargs):
62d32a5f 12570 """
53aa7709 12571 Realize(self)
62d32a5f
RD
12572
12573 This funciton needs to be called after all the buttons have been added
12574 to the sizer. It will reorder them and position them in a platform
12575 specifc manner.
12576 """
5b5c9bc7 12577 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
12578
12579 def SetAffirmativeButton(*args, **kwargs):
12580 """SetAffirmativeButton(self, wxButton button)"""
5b5c9bc7 12581 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
51b83b37
RD
12582
12583 def SetNegativeButton(*args, **kwargs):
12584 """SetNegativeButton(self, wxButton button)"""
5b5c9bc7 12585 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
51b83b37
RD
12586
12587 def SetCancelButton(*args, **kwargs):
12588 """SetCancelButton(self, wxButton button)"""
5b5c9bc7 12589 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
12590
12591 def GetAffirmativeButton(*args, **kwargs):
12592 """GetAffirmativeButton(self) -> wxButton"""
5b5c9bc7 12593 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
62d32a5f
RD
12594
12595 def GetApplyButton(*args, **kwargs):
12596 """GetApplyButton(self) -> wxButton"""
5b5c9bc7 12597 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
62d32a5f
RD
12598
12599 def GetNegativeButton(*args, **kwargs):
12600 """GetNegativeButton(self) -> wxButton"""
5b5c9bc7 12601 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
62d32a5f
RD
12602
12603 def GetCancelButton(*args, **kwargs):
12604 """GetCancelButton(self) -> wxButton"""
5b5c9bc7 12605 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
62d32a5f
RD
12606
12607 def GetHelpButton(*args, **kwargs):
12608 """GetHelpButton(self) -> wxButton"""
5b5c9bc7 12609 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
62d32a5f 12610
33d6fd3b
RD
12611 AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`")
12612 ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`")
12613 CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`")
12614 HelpButton = property(GetHelpButton,doc="See `GetHelpButton`")
12615 NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`")
2131d850 12616_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
62d32a5f 12617
d55e5bfc
RD
12618#---------------------------------------------------------------------------
12619
5b5c9bc7 12620class GBPosition(object):
bfddbb17
RD
12621 """
12622 This class represents the position of an item in a virtual grid of
12623 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12624 typemaps that will automatically convert from a 2-element sequence of
12625 integers to a wx.GBPosition, so you can use the more pythonic
12626 representation of the position nearly transparently in Python code.
12627 """
1bd55598
RD
12628 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12629 __repr__ = _swig_repr
12630 def __init__(self, *args, **kwargs):
bfddbb17 12631 """
5b5c9bc7 12632 __init__(self, int row=0, int col=0) -> GBPosition
bfddbb17
RD
12633
12634 This class represents the position of an item in a virtual grid of
12635 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12636 typemaps that will automatically convert from a 2-element sequence of
12637 integers to a wx.GBPosition, so you can use the more pythonic
12638 representation of the position nearly transparently in Python code.
12639 """
1bd55598
RD
12640 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
12641 __swig_destroy__ = _core_.delete_GBPosition
12642 __del__ = lambda self : None;
d55e5bfc
RD
12643 def GetRow(*args, **kwargs):
12644 """GetRow(self) -> int"""
5b5c9bc7 12645 return _core_.GBPosition_GetRow(*args, **kwargs)
d55e5bfc
RD
12646
12647 def GetCol(*args, **kwargs):
12648 """GetCol(self) -> int"""
5b5c9bc7 12649 return _core_.GBPosition_GetCol(*args, **kwargs)
d55e5bfc
RD
12650
12651 def SetRow(*args, **kwargs):
12652 """SetRow(self, int row)"""
5b5c9bc7 12653 return _core_.GBPosition_SetRow(*args, **kwargs)
d55e5bfc
RD
12654
12655 def SetCol(*args, **kwargs):
12656 """SetCol(self, int col)"""
5b5c9bc7 12657 return _core_.GBPosition_SetCol(*args, **kwargs)
d55e5bfc
RD
12658
12659 def __eq__(*args, **kwargs):
e9d6f3a4
RD
12660 """
12661 __eq__(self, PyObject other) -> bool
12662
12663 Compare GBPosition for equality.
12664 """
5b5c9bc7 12665 return _core_.GBPosition___eq__(*args, **kwargs)
d55e5bfc
RD
12666
12667 def __ne__(*args, **kwargs):
e9d6f3a4
RD
12668 """
12669 __ne__(self, PyObject other) -> bool
12670
12671 Compare GBPosition for inequality.
12672 """
5b5c9bc7 12673 return _core_.GBPosition___ne__(*args, **kwargs)
d55e5bfc
RD
12674
12675 def Set(*args, **kwargs):
12676 """Set(self, int row=0, int col=0)"""
5b5c9bc7 12677 return _core_.GBPosition_Set(*args, **kwargs)
d55e5bfc
RD
12678
12679 def Get(*args, **kwargs):
12680 """Get(self) -> PyObject"""
5b5c9bc7 12681 return _core_.GBPosition_Get(*args, **kwargs)
d55e5bfc 12682
15817c7e 12683 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12684 def __str__(self): return str(self.Get())
12685 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12686 def __len__(self): return len(self.Get())
12687 def __getitem__(self, index): return self.Get()[index]
12688 def __setitem__(self, index, val):
12689 if index == 0: self.SetRow(val)
12690 elif index == 1: self.SetCol(val)
12691 else: raise IndexError
12692 def __nonzero__(self): return self.Get() != (0,0)
12693 __safe_for_unpickling__ = True
12694 def __reduce__(self): return (wx.GBPosition, self.Get())
12695
12696 row = property(GetRow, SetRow)
12697 col = property(GetCol, SetCol)
12698
2131d850 12699_core_.GBPosition_swigregister(GBPosition)
d55e5bfc 12700
5b5c9bc7 12701class GBSpan(object):
bfddbb17
RD
12702 """
12703 This class is used to hold the row and column spanning attributes of
12704 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12705 automatically convert from a 2-element sequence of integers to a
12706 wx.GBSpan, so you can use the more pythonic representation of the span
12707 nearly transparently in Python code.
12708
12709 """
1bd55598
RD
12710 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12711 __repr__ = _swig_repr
12712 def __init__(self, *args, **kwargs):
bfddbb17 12713 """
5b5c9bc7 12714 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
bfddbb17
RD
12715
12716 Construct a new wxGBSpan, optionally setting the rowspan and
12717 colspan. The default is (1,1). (Meaning that the item occupies one
12718 cell in each direction.
12719 """
1bd55598
RD
12720 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12721 __swig_destroy__ = _core_.delete_GBSpan
12722 __del__ = lambda self : None;
d55e5bfc
RD
12723 def GetRowspan(*args, **kwargs):
12724 """GetRowspan(self) -> int"""
5b5c9bc7 12725 return _core_.GBSpan_GetRowspan(*args, **kwargs)
d55e5bfc
RD
12726
12727 def GetColspan(*args, **kwargs):
12728 """GetColspan(self) -> int"""
5b5c9bc7 12729 return _core_.GBSpan_GetColspan(*args, **kwargs)
d55e5bfc
RD
12730
12731 def SetRowspan(*args, **kwargs):
12732 """SetRowspan(self, int rowspan)"""
5b5c9bc7 12733 return _core_.GBSpan_SetRowspan(*args, **kwargs)
d55e5bfc
RD
12734
12735 def SetColspan(*args, **kwargs):
12736 """SetColspan(self, int colspan)"""
5b5c9bc7 12737 return _core_.GBSpan_SetColspan(*args, **kwargs)
d55e5bfc
RD
12738
12739 def __eq__(*args, **kwargs):
e9d6f3a4
RD
12740 """
12741 __eq__(self, PyObject other) -> bool
12742
12743 Compare wxGBSpan for equality.
12744 """
5b5c9bc7 12745 return _core_.GBSpan___eq__(*args, **kwargs)
d55e5bfc
RD
12746
12747 def __ne__(*args, **kwargs):
e9d6f3a4
RD
12748 """
12749 __ne__(self, PyObject other) -> bool
12750
12751 Compare GBSpan for inequality.
12752 """
5b5c9bc7 12753 return _core_.GBSpan___ne__(*args, **kwargs)
d55e5bfc
RD
12754
12755 def Set(*args, **kwargs):
12756 """Set(self, int rowspan=1, int colspan=1)"""
5b5c9bc7 12757 return _core_.GBSpan_Set(*args, **kwargs)
d55e5bfc
RD
12758
12759 def Get(*args, **kwargs):
12760 """Get(self) -> PyObject"""
5b5c9bc7 12761 return _core_.GBSpan_Get(*args, **kwargs)
d55e5bfc 12762
15817c7e 12763 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12764 def __str__(self): return str(self.Get())
12765 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12766 def __len__(self): return len(self.Get())
12767 def __getitem__(self, index): return self.Get()[index]
12768 def __setitem__(self, index, val):
12769 if index == 0: self.SetRowspan(val)
12770 elif index == 1: self.SetColspan(val)
12771 else: raise IndexError
12772 def __nonzero__(self): return self.Get() != (0,0)
12773 __safe_for_unpickling__ = True
12774 def __reduce__(self): return (wx.GBSpan, self.Get())
12775
12776 rowspan = property(GetRowspan, SetRowspan)
12777 colspan = property(GetColspan, SetColspan)
12778
2131d850 12779_core_.GBSpan_swigregister(GBSpan)
d55e5bfc 12780
5b5c9bc7 12781class GBSizerItem(SizerItem):
bfddbb17
RD
12782 """
12783 The wx.GBSizerItem class is used to track the additional data about
12784 items in a `wx.GridBagSizer` such as the item's position in the grid
12785 and how many rows or columns it spans.
12786
12787 """
1bd55598
RD
12788 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12789 __repr__ = _swig_repr
12790 def __init__(self, *args, **kwargs):
bfddbb17 12791 """
5b5c9bc7 12792 __init__(self) -> GBSizerItem
bfddbb17
RD
12793
12794 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12795 size will need to be set, as well as a position and span before this
12796 item can be used in a Sizer.
12797
12798 You will probably never need to create a wx.GBSizerItem directly as they
12799 are created automatically when the sizer's Add method is called.
12800 """
1bd55598
RD
12801 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12802 __swig_destroy__ = _core_.delete_GBSizerItem
12803 __del__ = lambda self : None;
d55e5bfc 12804 def GetPos(*args, **kwargs):
bfddbb17 12805 """
5b5c9bc7 12806 GetPos(self) -> GBPosition
bfddbb17
RD
12807
12808 Get the grid position of the item
12809 """
5b5c9bc7 12810 return _core_.GBSizerItem_GetPos(*args, **kwargs)
d55e5bfc
RD
12811
12812 def GetPosTuple(self): return self.GetPos().Get()
12813 def GetSpan(*args, **kwargs):
bfddbb17 12814 """
5b5c9bc7 12815 GetSpan(self) -> GBSpan
bfddbb17
RD
12816
12817 Get the row and column spanning of the item
12818 """
5b5c9bc7 12819 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
d55e5bfc
RD
12820
12821 def GetSpanTuple(self): return self.GetSpan().Get()
12822 def SetPos(*args, **kwargs):
bfddbb17 12823 """
5b5c9bc7 12824 SetPos(self, GBPosition pos) -> bool
bfddbb17
RD
12825
12826 If the item is already a member of a sizer then first ensure that
12827 there is no other item that would intersect with this one at the new
12828 position, then set the new position. Returns True if the change is
12829 successful and after the next Layout() the item will be moved.
12830 """
5b5c9bc7 12831 return _core_.GBSizerItem_SetPos(*args, **kwargs)
d55e5bfc
RD
12832
12833 def SetSpan(*args, **kwargs):
bfddbb17 12834 """
5b5c9bc7 12835 SetSpan(self, GBSpan span) -> bool
bfddbb17
RD
12836
12837 If the item is already a member of a sizer then first ensure that
12838 there is no other item that would intersect with this one with its new
12839 spanning size, then set the new spanning. Returns True if the change
12840 is successful and after the next Layout() the item will be resized.
12841
12842 """
5b5c9bc7 12843 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
d55e5bfc 12844
bfddbb17 12845 def Intersects(*args, **kwargs):
d55e5bfc 12846 """
5b5c9bc7 12847 Intersects(self, GBSizerItem other) -> bool
bfddbb17
RD
12848
12849 Returns True if this item and the other item instersect.
d55e5bfc 12850 """
5b5c9bc7 12851 return _core_.GBSizerItem_Intersects(*args, **kwargs)
bfddbb17
RD
12852
12853 def IntersectsPos(*args, **kwargs):
12854 """
5b5c9bc7 12855 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
bfddbb17
RD
12856
12857 Returns True if the given pos/span would intersect with this item.
12858 """
5b5c9bc7 12859 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
12860
12861 def GetEndPos(*args, **kwargs):
bfddbb17 12862 """
5b5c9bc7 12863 GetEndPos(self) -> GBPosition
bfddbb17
RD
12864
12865 Get the row and column of the endpoint of this item.
12866 """
5b5c9bc7 12867 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
d55e5bfc
RD
12868
12869 def GetGBSizer(*args, **kwargs):
bfddbb17 12870 """
5b5c9bc7 12871 GetGBSizer(self) -> GridBagSizer
bfddbb17
RD
12872
12873 Get the sizer this item is a member of.
12874 """
5b5c9bc7 12875 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
d55e5bfc
RD
12876
12877 def SetGBSizer(*args, **kwargs):
bfddbb17 12878 """
5b5c9bc7 12879 SetGBSizer(self, GridBagSizer sizer)
bfddbb17
RD
12880
12881 Set the sizer this item is a member of.
12882 """
5b5c9bc7 12883 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
d55e5bfc 12884
ac5d357a
RD
12885 EndPos = property(GetEndPos,doc="See `GetEndPos`")
12886 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
12887 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
12888 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
2131d850 12889_core_.GBSizerItem_swigregister(GBSizerItem)
5b5c9bc7 12890DefaultSpan = cvar.DefaultSpan
d55e5bfc
RD
12891
12892def GBSizerItemWindow(*args, **kwargs):
12893 """
5b5c9bc7
RD
12894 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12895 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12896
12897 Construct a `wx.GBSizerItem` for a window.
d55e5bfc 12898 """
5b5c9bc7 12899 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12900 return val
12901
12902def GBSizerItemSizer(*args, **kwargs):
12903 """
5b5c9bc7
RD
12904 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12905 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12906
12907 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc 12908 """
5b5c9bc7 12909 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12910 return val
12911
12912def GBSizerItemSpacer(*args, **kwargs):
12913 """
5b5c9bc7
RD
12914 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12915 int flag, int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12916
12917 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc 12918 """
5b5c9bc7 12919 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12920 return val
12921
5b5c9bc7 12922class GridBagSizer(FlexGridSizer):
bfddbb17
RD
12923 """
12924 A `wx.Sizer` that can lay out items in a virtual grid like a
12925 `wx.FlexGridSizer` but in this case explicit positioning of the items
12926 is allowed using `wx.GBPosition`, and items can optionally span more
12927 than one row and/or column using `wx.GBSpan`. The total size of the
12928 virtual grid is determined by the largest row and column that items are
12929 positioned at, adjusted for spanning.
12930
12931 """
1bd55598
RD
12932 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12933 __repr__ = _swig_repr
12934 def __init__(self, *args, **kwargs):
bfddbb17 12935 """
5b5c9bc7 12936 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
bfddbb17
RD
12937
12938 Constructor, with optional parameters to specify the gap between the
12939 rows and columns.
12940 """
1bd55598 12941 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
03e46024
RD
12942 self._setOORInfo(self)
12943
d55e5bfc
RD
12944 def Add(*args, **kwargs):
12945 """
bfddbb17 12946 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
070c48b4 12947 int border=0, userData=None) -> wx.GBSizerItem
bfddbb17
RD
12948
12949 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12950 more than one row or column as specified with *span*. The remaining
12951 args behave similarly to `wx.Sizer.Add`.
12952
12953 Returns True if the item was successfully placed at the given cell
12954 position, False if something was already there.
12955
d55e5bfc 12956 """
5b5c9bc7 12957 return _core_.GridBagSizer_Add(*args, **kwargs)
d55e5bfc
RD
12958
12959 def AddItem(*args, **kwargs):
bfddbb17 12960 """
070c48b4 12961 Add(self, GBSizerItem item) -> wx.GBSizerItem
bfddbb17
RD
12962
12963 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12964 the item was successfully placed at its given cell position, False if
12965 something was already there.
12966 """
5b5c9bc7 12967 return _core_.GridBagSizer_AddItem(*args, **kwargs)
d55e5bfc 12968
84f85550
RD
12969 def GetCellSize(*args, **kwargs):
12970 """
5b5c9bc7 12971 GetCellSize(self, int row, int col) -> Size
84f85550
RD
12972
12973 Get the size of the specified cell, including hgap and
12974 vgap. Only valid after a Layout.
12975 """
5b5c9bc7 12976 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
84f85550 12977
d55e5bfc 12978 def GetEmptyCellSize(*args, **kwargs):
bfddbb17 12979 """
5b5c9bc7 12980 GetEmptyCellSize(self) -> Size
bfddbb17
RD
12981
12982 Get the size used for cells in the grid with no item.
12983 """
5b5c9bc7 12984 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12985
12986 def SetEmptyCellSize(*args, **kwargs):
bfddbb17 12987 """
5b5c9bc7 12988 SetEmptyCellSize(self, Size sz)
bfddbb17
RD
12989
12990 Set the size used for cells in the grid with no item.
12991 """
5b5c9bc7 12992 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12993
12994 def GetItemPosition(*args):
12995 """
bfddbb17
RD
12996 GetItemPosition(self, item) -> GBPosition
12997
12998 Get the grid position of the specified *item* where *item* is either a
12999 window or subsizer that is a member of this sizer, or a zero-based
13000 index of an item.
d55e5bfc 13001 """
5b5c9bc7 13002 return _core_.GridBagSizer_GetItemPosition(*args)
d55e5bfc
RD
13003
13004 def SetItemPosition(*args):
13005 """
bfddbb17
RD
13006 SetItemPosition(self, item, GBPosition pos) -> bool
13007
13008 Set the grid position of the specified *item* where *item* is either a
13009 window or subsizer that is a member of this sizer, or a zero-based
13010 index of an item. Returns True on success. If the move is not
13011 allowed (because an item is already there) then False is returned.
13012
d55e5bfc 13013 """
5b5c9bc7 13014 return _core_.GridBagSizer_SetItemPosition(*args)
d55e5bfc
RD
13015
13016 def GetItemSpan(*args):
13017 """
bfddbb17
RD
13018 GetItemSpan(self, item) -> GBSpan
13019
13020 Get the row/col spanning of the specified *item* where *item* is
13021 either a window or subsizer that is a member of this sizer, or a
13022 zero-based index of an item.
d55e5bfc 13023 """
5b5c9bc7 13024 return _core_.GridBagSizer_GetItemSpan(*args)
d55e5bfc
RD
13025
13026 def SetItemSpan(*args):
13027 """
bfddbb17
RD
13028 SetItemSpan(self, item, GBSpan span) -> bool
13029
13030 Set the row/col spanning of the specified *item* where *item* is
13031 either a window or subsizer that is a member of this sizer, or a
13032 zero-based index of an item. Returns True on success. If the move is
13033 not allowed (because an item is already there) then False is returned.
d55e5bfc 13034 """
5b5c9bc7 13035 return _core_.GridBagSizer_SetItemSpan(*args)
d55e5bfc
RD
13036
13037 def FindItem(*args):
13038 """
bfddbb17
RD
13039 FindItem(self, item) -> GBSizerItem
13040
13041 Find the sizer item for the given window or subsizer, returns None if
13042 not found. (non-recursive)
d55e5bfc 13043 """
5b5c9bc7 13044 return _core_.GridBagSizer_FindItem(*args)
d55e5bfc
RD
13045
13046 def FindItemAtPosition(*args, **kwargs):
bfddbb17 13047 """
5b5c9bc7 13048 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
bfddbb17
RD
13049
13050 Return the sizer item for the given grid cell, or None if there is no
13051 item at that position. (non-recursive)
13052 """
5b5c9bc7 13053 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
d55e5bfc
RD
13054
13055 def FindItemAtPoint(*args, **kwargs):
bfddbb17 13056 """
5b5c9bc7 13057 FindItemAtPoint(self, Point pt) -> GBSizerItem
bfddbb17
RD
13058
13059 Return the sizer item located at the point given in *pt*, or None if
13060 there is no item at that point. The (x,y) coordinates in pt correspond
13061 to the client coordinates of the window using the sizer for
13062 layout. (non-recursive)
13063 """
5b5c9bc7 13064 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
d55e5bfc 13065
bfddbb17
RD
13066 def CheckForIntersection(*args, **kwargs):
13067 """
5b5c9bc7 13068 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 13069
bfddbb17
RD
13070 Look at all items and see if any intersect (or would overlap) the
13071 given *item*. Returns True if so, False if there would be no overlap.
13072 If an *excludeItem* is given then it will not be checked for
13073 intersection, for example it may be the item we are checking the
13074 position of.
d55e5bfc 13075
bfddbb17 13076 """
5b5c9bc7 13077 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 13078
bfddbb17 13079 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 13080 """
5b5c9bc7 13081 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
bfddbb17
RD
13082
13083 Look at all items and see if any intersect (or would overlap) the
13084 given position and span. Returns True if so, False if there would be
13085 no overlap. If an *excludeItem* is given then it will not be checked
13086 for intersection, for example it may be the item we are checking the
13087 position of.
d55e5bfc 13088 """
5b5c9bc7 13089 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc 13090
2131d850 13091_core_.GridBagSizer_swigregister(GridBagSizer)
d55e5bfc
RD
13092
13093#---------------------------------------------------------------------------
13094
5b5c9bc7
RD
13095Left = _core_.Left
13096Top = _core_.Top
13097Right = _core_.Right
13098Bottom = _core_.Bottom
13099Width = _core_.Width
13100Height = _core_.Height
13101Centre = _core_.Centre
13102Center = _core_.Center
13103CentreX = _core_.CentreX
13104CentreY = _core_.CentreY
13105Unconstrained = _core_.Unconstrained
13106AsIs = _core_.AsIs
13107PercentOf = _core_.PercentOf
13108Above = _core_.Above
13109Below = _core_.Below
13110LeftOf = _core_.LeftOf
13111RightOf = _core_.RightOf
13112SameAs = _core_.SameAs
13113Absolute = _core_.Absolute
13114class IndividualLayoutConstraint(Object):
d55e5bfc 13115 """
15817c7e
RD
13116 Objects of this class are stored in the `wx.LayoutConstraints` class as
13117 one of eight possible constraints that a window can be involved in.
13118 You will never need to create an instance of
13119 wx.IndividualLayoutConstraint, rather you should create a
13120 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 13121 that it contains.
d55e5bfc 13122 """
1bd55598
RD
13123 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13124 def __init__(self): raise AttributeError, "No constructor defined"
13125 __repr__ = _swig_repr
d55e5bfc 13126 def Set(*args, **kwargs):
15817c7e 13127 """
5b5c9bc7 13128 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
15817c7e
RD
13129
13130 Sets the properties of the constraint. Normally called by one of the
13131 convenience functions such as Above, RightOf, SameAs.
13132 """
5b5c9bc7 13133 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
d55e5bfc
RD
13134
13135 def LeftOf(*args, **kwargs):
13136 """
5b5c9bc7 13137 LeftOf(self, Window sibling, int marg=0)
d55e5bfc 13138
15817c7e
RD
13139 Constrains this edge to be to the left of the given window, with an
13140 optional margin. Implicitly, this is relative to the left edge of the
13141 other window.
d55e5bfc 13142 """
5b5c9bc7 13143 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
d55e5bfc
RD
13144
13145 def RightOf(*args, **kwargs):
13146 """
5b5c9bc7 13147 RightOf(self, Window sibling, int marg=0)
d55e5bfc 13148
15817c7e
RD
13149 Constrains this edge to be to the right of the given window, with an
13150 optional margin. Implicitly, this is relative to the right edge of the
13151 other window.
d55e5bfc 13152 """
5b5c9bc7 13153 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
d55e5bfc
RD
13154
13155 def Above(*args, **kwargs):
13156 """
5b5c9bc7 13157 Above(self, Window sibling, int marg=0)
d55e5bfc 13158
15817c7e
RD
13159 Constrains this edge to be above the given window, with an optional
13160 margin. Implicitly, this is relative to the top edge of the other
13161 window.
d55e5bfc 13162 """
5b5c9bc7 13163 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
d55e5bfc
RD
13164
13165 def Below(*args, **kwargs):
13166 """
5b5c9bc7 13167 Below(self, Window sibling, int marg=0)
d55e5bfc 13168
15817c7e
RD
13169 Constrains this edge to be below the given window, with an optional
13170 margin. Implicitly, this is relative to the bottom edge of the other
13171 window.
d55e5bfc 13172 """
5b5c9bc7 13173 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
d55e5bfc
RD
13174
13175 def SameAs(*args, **kwargs):
13176 """
5b5c9bc7 13177 SameAs(self, Window otherW, int edge, int marg=0)
d55e5bfc 13178
15817c7e
RD
13179 Constrains this edge or dimension to be to the same as the edge of the
13180 given window, with an optional margin.
d55e5bfc 13181 """
5b5c9bc7 13182 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
d55e5bfc
RD
13183
13184 def PercentOf(*args, **kwargs):
13185 """
5b5c9bc7 13186 PercentOf(self, Window otherW, int wh, int per)
d55e5bfc 13187
15817c7e
RD
13188 Constrains this edge or dimension to be to a percentage of the given
13189 window, with an optional margin.
d55e5bfc 13190 """
5b5c9bc7 13191 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
d55e5bfc
RD
13192
13193 def Absolute(*args, **kwargs):
13194 """
13195 Absolute(self, int val)
13196
15817c7e 13197 Constrains this edge or dimension to be the given absolute value.
d55e5bfc 13198 """
5b5c9bc7 13199 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
d55e5bfc
RD
13200
13201 def Unconstrained(*args, **kwargs):
13202 """
13203 Unconstrained(self)
13204
15817c7e
RD
13205 Sets this edge or dimension to be unconstrained, that is, dependent on
13206 other edges and dimensions from which this value can be deduced.
d55e5bfc 13207 """
5b5c9bc7 13208 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
d55e5bfc
RD
13209
13210 def AsIs(*args, **kwargs):
13211 """
13212 AsIs(self)
13213
15817c7e
RD
13214 Sets this edge or constraint to be whatever the window's value is at
13215 the moment. If either of the width and height constraints are *as is*,
13216 the window will not be resized, but moved instead. This is important
13217 when considering panel items which are intended to have a default
13218 size, such as a button, which may take its size from the size of the
13219 button label.
d55e5bfc 13220 """
5b5c9bc7 13221 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
d55e5bfc
RD
13222
13223 def GetOtherWindow(*args, **kwargs):
5b5c9bc7
RD
13224 """GetOtherWindow(self) -> Window"""
13225 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
d55e5bfc
RD
13226
13227 def GetMyEdge(*args, **kwargs):
13228 """GetMyEdge(self) -> int"""
5b5c9bc7 13229 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
d55e5bfc
RD
13230
13231 def SetEdge(*args, **kwargs):
13232 """SetEdge(self, int which)"""
5b5c9bc7 13233 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
d55e5bfc
RD
13234
13235 def SetValue(*args, **kwargs):
13236 """SetValue(self, int v)"""
5b5c9bc7 13237 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
d55e5bfc
RD
13238
13239 def GetMargin(*args, **kwargs):
13240 """GetMargin(self) -> int"""
5b5c9bc7 13241 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
d55e5bfc
RD
13242
13243 def SetMargin(*args, **kwargs):
13244 """SetMargin(self, int m)"""
5b5c9bc7 13245 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
d55e5bfc
RD
13246
13247 def GetValue(*args, **kwargs):
13248 """GetValue(self) -> int"""
5b5c9bc7 13249 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
d55e5bfc
RD
13250
13251 def GetPercent(*args, **kwargs):
13252 """GetPercent(self) -> int"""
5b5c9bc7 13253 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
d55e5bfc
RD
13254
13255 def GetOtherEdge(*args, **kwargs):
13256 """GetOtherEdge(self) -> int"""
5b5c9bc7 13257 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
d55e5bfc
RD
13258
13259 def GetDone(*args, **kwargs):
13260 """GetDone(self) -> bool"""
5b5c9bc7 13261 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
d55e5bfc
RD
13262
13263 def SetDone(*args, **kwargs):
13264 """SetDone(self, bool d)"""
5b5c9bc7 13265 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
d55e5bfc
RD
13266
13267 def GetRelationship(*args, **kwargs):
13268 """GetRelationship(self) -> int"""
5b5c9bc7 13269 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
d55e5bfc
RD
13270
13271 def SetRelationship(*args, **kwargs):
13272 """SetRelationship(self, int r)"""
5b5c9bc7 13273 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
d55e5bfc
RD
13274
13275 def ResetIfWin(*args, **kwargs):
13276 """
5b5c9bc7 13277 ResetIfWin(self, Window otherW) -> bool
d55e5bfc
RD
13278
13279 Reset constraint if it mentions otherWin
13280 """
5b5c9bc7 13281 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
d55e5bfc
RD
13282
13283 def SatisfyConstraint(*args, **kwargs):
13284 """
5b5c9bc7 13285 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
d55e5bfc
RD
13286
13287 Try to satisfy constraint
13288 """
5b5c9bc7 13289 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
d55e5bfc
RD
13290
13291 def GetEdge(*args, **kwargs):
13292 """
5b5c9bc7 13293 GetEdge(self, int which, Window thisWin, Window other) -> int
d55e5bfc
RD
13294
13295 Get the value of this edge or dimension, or if this
13296 is not determinable, -1.
13297 """
5b5c9bc7 13298 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
d55e5bfc 13299
ac5d357a
RD
13300 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
13301 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
13302 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
13303 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
13304 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
13305 Percent = property(GetPercent,doc="See `GetPercent`")
13306 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
13307 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
2131d850 13308_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d55e5bfc 13309
5b5c9bc7 13310class LayoutConstraints(Object):
d55e5bfc 13311 """
15817c7e
RD
13312 **Note:** constraints are now deprecated and you should use sizers
13313 instead.
d55e5bfc 13314
15817c7e
RD
13315 Objects of this class can be associated with a window to define its
13316 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
13317
13318 The class consists of the following eight constraints of class
13319 wx.IndividualLayoutConstraint, some or all of which should be accessed
13320 directly to set the appropriate constraints.
13321
13322 * left: represents the left hand edge of the window
13323 * right: represents the right hand edge of the window
13324 * top: represents the top edge of the window
13325 * bottom: represents the bottom edge of the window
13326 * width: represents the width of the window
13327 * height: represents the height of the window
13328 * centreX: represents the horizontal centre point of the window
13329 * centreY: represents the vertical centre point of the window
13330
15817c7e
RD
13331 Most constraints are initially set to have the relationship
13332 wxUnconstrained, which means that their values should be calculated by
13333 looking at known constraints. The exceptions are width and height,
13334 which are set to wxAsIs to ensure that if the user does not specify a
13335 constraint, the existing width and height will be used, to be
13336 compatible with panel items which often have take a default size. If
13337 the constraint is ``wx.AsIs``, the dimension will not be changed.
13338
13339 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
13340
13341 """
1bd55598
RD
13342 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13343 __repr__ = _swig_repr
5b5c9bc7
RD
13344 left = property(_core_.LayoutConstraints_left_get)
13345 top = property(_core_.LayoutConstraints_top_get)
13346 right = property(_core_.LayoutConstraints_right_get)
13347 bottom = property(_core_.LayoutConstraints_bottom_get)
13348 width = property(_core_.LayoutConstraints_width_get)
13349 height = property(_core_.LayoutConstraints_height_get)
13350 centreX = property(_core_.LayoutConstraints_centreX_get)
13351 centreY = property(_core_.LayoutConstraints_centreY_get)
1bd55598 13352 def __init__(self, *args, **kwargs):
5b5c9bc7 13353 """__init__(self) -> LayoutConstraints"""
1bd55598
RD
13354 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
13355 __swig_destroy__ = _core_.delete_LayoutConstraints
13356 __del__ = lambda self : None;
d55e5bfc
RD
13357 def SatisfyConstraints(*args, **kwargs):
13358 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
5b5c9bc7 13359 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
d55e5bfc
RD
13360
13361 def AreSatisfied(*args, **kwargs):
13362 """AreSatisfied(self) -> bool"""
5b5c9bc7 13363 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
d55e5bfc 13364
2131d850 13365_core_.LayoutConstraints_swigregister(LayoutConstraints)
d55e5bfc
RD
13366
13367#----------------------------------------------------------------------------
13368
13369# Use Python's bool constants if available, make some if not
13370try:
13371 True
13372except NameError:
13373 __builtins__.True = 1==1
13374 __builtins__.False = 1==0
13375 def bool(value): return not not value
13376 __builtins__.bool = bool
13377
13378
13379
13380# workarounds for bad wxRTTI names
13381__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13382__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13383__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13384
13385
13386#----------------------------------------------------------------------------
13387# Load version numbers from __version__... Ensure that major and minor
0f63ec68 13388# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
13389
13390from __version__ import *
13391__version__ = VERSION_STRING
13392
0f63ec68
RD
13393assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13394assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
13395if RELEASE_VERSION != _core_.RELEASE_VERSION:
13396 import warnings
0f63ec68 13397 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
13398
13399#----------------------------------------------------------------------------
13400
7993762b
RD
13401# Set wxPython's default string<-->unicode conversion encoding from
13402# the locale, but only if Python's default hasn't been changed. (We
13403# assume that if the user has customized it already then that is the
13404# encoding we need to use as well.)
13405#
13406# The encoding selected here is used when string or unicode objects
13407# need to be converted in order to pass them to wxWidgets. Please be
13408# aware that the default encoding within the same locale may be
13409# slightly different on different platforms. For example, please see
62d32a5f
RD
13410# http://www.alanwood.net/demos/charsetdiffs.html for differences
13411# between the common latin/roman encodings.
3837a853
RD
13412
13413default = _sys.getdefaultencoding()
13414if default == 'ascii':
13415 import locale
13416 import codecs
13417 try:
13418 default = locale.getdefaultlocale()[1]
13419 codecs.lookup(default)
7993762b 13420 except (ValueError, LookupError, TypeError):
3837a853
RD
13421 default = _sys.getdefaultencoding()
13422 del locale
13423 del codecs
5cbf236d
RD
13424if default:
13425 wx.SetDefaultPyEncoding(default)
13426del default
5cbf236d
RD
13427
13428#----------------------------------------------------------------------------
13429
d55e5bfc
RD
13430class PyDeadObjectError(AttributeError):
13431 pass
13432
13433class _wxPyDeadObject(object):
13434 """
13435 Instances of wx objects that are OOR capable will have their __class__
13436 changed to this class when the C++ object is deleted. This should help
13437 prevent crashes due to referencing a bogus C++ pointer.
13438 """
13439 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13440 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13441
13442 def __repr__(self):
13443 if not hasattr(self, "_name"):
13444 self._name = "[unknown]"
13445 return self.reprStr % self._name
13446
13447 def __getattr__(self, *args):
13448 if not hasattr(self, "_name"):
13449 self._name = "[unknown]"
13450 raise PyDeadObjectError(self.attrStr % self._name)
13451
13452 def __nonzero__(self):
13453 return 0
13454
13455
13456
13457class PyUnbornObjectError(AttributeError):
13458 pass
13459
13460class _wxPyUnbornObject(object):
13461 """
13462 Some stock objects are created when the wx._core module is
13463 imported, but their C++ instance is not created until the wx.App
13464 object is created and initialized. These object instances will
13465 temporarily have their __class__ changed to this class so an
13466 exception will be raised if they are used before the C++ instance
13467 is ready.
13468 """
13469
13470 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13471 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13472
13473 def __repr__(self):
13474 #if not hasattr(self, "_name"):
13475 # self._name = "[unknown]"
13476 return self.reprStr #% self._name
13477
13478 def __getattr__(self, *args):
13479 #if not hasattr(self, "_name"):
13480 # self._name = "[unknown]"
13481 raise PyUnbornObjectError(self.attrStr) # % self._name )
13482
13483 def __nonzero__(self):
13484 return 0
13485
13486
13487#----------------------------------------------------------------------------
d55e5bfc
RD
13488
13489def CallAfter(callable, *args, **kw):
13490 """
13491 Call the specified function after the current and pending event
13492 handlers have been completed. This is also good for making GUI
0439c23b
RD
13493 method calls from non-GUI threads. Any extra positional or
13494 keyword args are passed on to the callable when it is called.
13495
846c181b 13496 :see: `wx.CallLater`
d55e5bfc
RD
13497 """
13498 app = wx.GetApp()
a001823c 13499 assert app is not None, 'No wx.App created yet'
d55e5bfc 13500
891bb194
RD
13501 if not hasattr(app, "_CallAfterId"):
13502 app._CallAfterId = wx.NewEventType()
13503 app.Connect(-1, -1, app._CallAfterId,
13504 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 13505 evt = wx.PyEvent()
891bb194 13506 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
13507 evt.callable = callable
13508 evt.args = args
13509 evt.kw = kw
13510 wx.PostEvent(app, evt)
13511
d55e5bfc
RD
13512#----------------------------------------------------------------------------
13513
13514
846c181b 13515class CallLater:
d55e5bfc 13516 """
6e0de3df 13517 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
13518 object once after the given amount of milliseconds, passing any
13519 positional or keyword args. The return value of the callable is
0439c23b 13520 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
13521
13522 If you don't need to get the return value or restart the timer
13523 then there is no need to hold a reference to this object. It will
13524 hold a reference to itself while the timer is running (the timer
13525 has a reference to self.Notify) but the cycle will be broken when
846c181b 13526 the timer completes, automatically cleaning up the wx.CallLater
d55e5bfc 13527 object.
0439c23b
RD
13528
13529 :see: `wx.CallAfter`
d55e5bfc
RD
13530 """
13531 def __init__(self, millis, callable, *args, **kwargs):
13532 self.millis = millis
13533 self.callable = callable
13534 self.SetArgs(*args, **kwargs)
13535 self.runCount = 0
13536 self.running = False
13537 self.hasRun = False
13538 self.result = None
13539 self.timer = None
13540 self.Start()
13541
13542 def __del__(self):
13543 self.Stop()
13544
13545
13546 def Start(self, millis=None, *args, **kwargs):
13547 """
13548 (Re)start the timer
13549 """
13550 self.hasRun = False
13551 if millis is not None:
13552 self.millis = millis
13553 if args or kwargs:
13554 self.SetArgs(*args, **kwargs)
13555 self.Stop()
13556 self.timer = wx.PyTimer(self.Notify)
13557 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
13558 self.running = True
13559 Restart = Start
13560
13561
13562 def Stop(self):
13563 """
13564 Stop and destroy the timer.
13565 """
13566 if self.timer is not None:
13567 self.timer.Stop()
13568 self.timer = None
13569
13570
13571 def GetInterval(self):
13572 if self.timer is not None:
13573 return self.timer.GetInterval()
13574 else:
13575 return 0
13576
13577
13578 def IsRunning(self):
13579 return self.timer is not None and self.timer.IsRunning()
13580
13581
13582 def SetArgs(self, *args, **kwargs):
13583 """
13584 (Re)set the args passed to the callable object. This is
13585 useful in conjunction with Restart if you want to schedule a
13586 new call to the same callable object but with different
13587 parameters.
13588 """
13589 self.args = args
13590 self.kwargs = kwargs
13591
13592
13593 def HasRun(self):
13594 return self.hasRun
13595
13596 def GetResult(self):
13597 return self.result
13598
13599 def Notify(self):
13600 """
13601 The timer has expired so call the callable.
13602 """
13603 if self.callable and getattr(self.callable, 'im_self', True):
13604 self.runCount += 1
13605 self.running = False
13606 self.result = self.callable(*self.args, **self.kwargs)
13607 self.hasRun = True
13608 if not self.running:
13609 # if it wasn't restarted, then cleanup
13610 wx.CallAfter(self.Stop)
13611
ac5d357a
RD
13612 Interval = property(GetInterval)
13613 Result = property(GetResult)
d55e5bfc
RD
13614
13615
846c181b
RD
13616class FutureCall(CallLater):
13617 """A compatibility alias for `CallLater`."""
13618
d55e5bfc
RD
13619#----------------------------------------------------------------------------
13620# Control which items in this module should be documented by epydoc.
13621# We allow only classes and functions, which will help reduce the size
13622# of the docs by filtering out the zillions of constants, EVT objects,
13623# and etc that don't make much sense by themselves, but are instead
13624# documented (or will be) as part of the classes/functions/methods
13625# where they should be used.
13626
d6c14a4c
RD
13627class __DocFilter:
13628 """
13629 A filter for epydoc that only allows non-Ptr classes and
34e0a3bb 13630 functions, in order to reduce the clutter in the API docs.
d6c14a4c
RD
13631 """
13632 def __init__(self, globals):
13633 self._globals = globals
13634
13635 def __call__(self, name):
13636 import types
13637 obj = self._globals.get(name, None)
34e0a3bb
RD
13638
13639 # only document classes and function
d6c14a4c
RD
13640 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13641 return False
34e0a3bb
RD
13642
13643 # skip other things that are private or will be documented as part of somethign else
1bd55598 13644 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
d6c14a4c 13645 return False
34e0a3bb
RD
13646
13647 # skip functions that are duplicates of static functions in a class
13648 if name.find('_') != -1:
13649 cls = self._globals.get(name.split('_')[0], None)
13650 methname = name.split('_')[1]
13651 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
13652 return False
13653
d6c14a4c 13654 return True
d55e5bfc
RD
13655
13656#----------------------------------------------------------------------------
13657#----------------------------------------------------------------------------
13658
13659# Import other modules in this package that should show up in the
13660# "core" wx namespace
13661from _gdi import *
13662from _windows import *
13663from _controls import *
13664from _misc import *
13665
d55e5bfc
RD
13666#----------------------------------------------------------------------------
13667#----------------------------------------------------------------------------
13668
13669
32fe5131 13670