]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/mac/_core.py
IsExposed() needs to reverse the direction in RTL.
[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 """
7e08d4ef
RD
708 val = _core_.Object_Destroy(*args, **kwargs)
709 args[0].thisown = 0
710 return val
d55e5bfc 711
33d6fd3b 712 ClassName = property(GetClassName,doc="See `GetClassName`")
2131d850 713_core_.Object_swigregister(Object)
5b5c9bc7 714_wxPySetDictionary = _core_._wxPySetDictionary
5b5c9bc7 715cvar = _core_.cvar
d55e5bfc
RD
716EmptyString = cvar.EmptyString
717
718#---------------------------------------------------------------------------
719
5b5c9bc7
RD
720BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
721BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
722BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
723BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
724BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
725BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
726BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
727BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
728BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
729BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
730BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
731BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
732BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
733BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
734BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
735BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
736BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
737BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
738BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
739BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
740CURSOR_NONE = _core_.CURSOR_NONE
741CURSOR_ARROW = _core_.CURSOR_ARROW
742CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
743CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
744CURSOR_CHAR = _core_.CURSOR_CHAR
745CURSOR_CROSS = _core_.CURSOR_CROSS
746CURSOR_HAND = _core_.CURSOR_HAND
747CURSOR_IBEAM = _core_.CURSOR_IBEAM
748CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
749CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
750CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
751CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
752CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
753CURSOR_PENCIL = _core_.CURSOR_PENCIL
754CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
755CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
756CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
757CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
758CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
759CURSOR_SIZENS = _core_.CURSOR_SIZENS
760CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
761CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
762CURSOR_SIZING = _core_.CURSOR_SIZING
763CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
764CURSOR_WAIT = _core_.CURSOR_WAIT
765CURSOR_WATCH = _core_.CURSOR_WATCH
766CURSOR_BLANK = _core_.CURSOR_BLANK
767CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
768CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
769CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
770CURSOR_MAX = _core_.CURSOR_MAX
d55e5bfc
RD
771#---------------------------------------------------------------------------
772
5b5c9bc7 773class Size(object):
d55e5bfc 774 """
15817c7e 775 wx.Size is a useful data structure used to represent the size of
1bd55598
RD
776 something. It simply contains integer width and height
777 properties. In most places in wxPython where a wx.Size is
36ed4f51 778 expected a (width, height) tuple can be used instead.
d55e5bfc 779 """
1bd55598
RD
780 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
781 __repr__ = _swig_repr
5b5c9bc7
RD
782 width = property(_core_.Size_width_get, _core_.Size_width_set)
783 height = property(_core_.Size_height_get, _core_.Size_height_set)
d55e5bfc 784 x = width; y = height
1bd55598 785 def __init__(self, *args, **kwargs):
d55e5bfc 786 """
5b5c9bc7 787 __init__(self, int w=0, int h=0) -> Size
d55e5bfc
RD
788
789 Creates a size object.
790 """
1bd55598
RD
791 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
792 __swig_destroy__ = _core_.delete_Size
793 __del__ = lambda self : None;
d55e5bfc
RD
794 def __eq__(*args, **kwargs):
795 """
e9d6f3a4 796 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
797
798 Test for equality of wx.Size objects.
799 """
5b5c9bc7 800 return _core_.Size___eq__(*args, **kwargs)
d55e5bfc
RD
801
802 def __ne__(*args, **kwargs):
803 """
e9d6f3a4 804 __ne__(self, PyObject other) -> bool
d55e5bfc 805
e9d6f3a4 806 Test for inequality of wx.Size objects.
d55e5bfc 807 """
5b5c9bc7 808 return _core_.Size___ne__(*args, **kwargs)
d55e5bfc
RD
809
810 def __add__(*args, **kwargs):
811 """
5b5c9bc7 812 __add__(self, Size sz) -> Size
d55e5bfc
RD
813
814 Add sz's proprties to this and return the result.
815 """
5b5c9bc7 816 return _core_.Size___add__(*args, **kwargs)
d55e5bfc
RD
817
818 def __sub__(*args, **kwargs):
819 """
5b5c9bc7 820 __sub__(self, Size sz) -> Size
d55e5bfc
RD
821
822 Subtract sz's properties from this and return the result.
823 """
5b5c9bc7 824 return _core_.Size___sub__(*args, **kwargs)
d55e5bfc
RD
825
826 def IncTo(*args, **kwargs):
827 """
5b5c9bc7 828 IncTo(self, Size sz)
d55e5bfc
RD
829
830 Increments this object so that both of its dimensions are not less
831 than the corresponding dimensions of the size.
832 """
5b5c9bc7 833 return _core_.Size_IncTo(*args, **kwargs)
d55e5bfc
RD
834
835 def DecTo(*args, **kwargs):
836 """
5b5c9bc7 837 DecTo(self, Size sz)
d55e5bfc
RD
838
839 Decrements this object so that both of its dimensions are not greater
840 than the corresponding dimensions of the size.
841 """
5b5c9bc7 842 return _core_.Size_DecTo(*args, **kwargs)
d55e5bfc 843
f5263701
RD
844 def IncBy(*args, **kwargs):
845 """IncBy(self, int dx, int dy)"""
846 return _core_.Size_IncBy(*args, **kwargs)
847
848 def DecBy(*args, **kwargs):
849 """DecBy(self, int dx, int dy)"""
850 return _core_.Size_DecBy(*args, **kwargs)
851
1eeb270e
RD
852 def Scale(*args, **kwargs):
853 """
854 Scale(self, float xscale, float yscale)
855
856 Scales the dimensions of this object by the given factors.
857 """
858 return _core_.Size_Scale(*args, **kwargs)
859
d55e5bfc
RD
860 def Set(*args, **kwargs):
861 """
862 Set(self, int w, int h)
863
864 Set both width and height.
865 """
5b5c9bc7 866 return _core_.Size_Set(*args, **kwargs)
d55e5bfc
RD
867
868 def SetWidth(*args, **kwargs):
869 """SetWidth(self, int w)"""
5b5c9bc7 870 return _core_.Size_SetWidth(*args, **kwargs)
d55e5bfc
RD
871
872 def SetHeight(*args, **kwargs):
873 """SetHeight(self, int h)"""
5b5c9bc7 874 return _core_.Size_SetHeight(*args, **kwargs)
d55e5bfc
RD
875
876 def GetWidth(*args, **kwargs):
877 """GetWidth(self) -> int"""
5b5c9bc7 878 return _core_.Size_GetWidth(*args, **kwargs)
d55e5bfc
RD
879
880 def GetHeight(*args, **kwargs):
881 """GetHeight(self) -> int"""
5b5c9bc7 882 return _core_.Size_GetHeight(*args, **kwargs)
d55e5bfc
RD
883
884 def IsFullySpecified(*args, **kwargs):
885 """
886 IsFullySpecified(self) -> bool
887
888 Returns True if both components of the size are non-default values.
889 """
5b5c9bc7 890 return _core_.Size_IsFullySpecified(*args, **kwargs)
d55e5bfc
RD
891
892 def SetDefaults(*args, **kwargs):
893 """
5b5c9bc7 894 SetDefaults(self, Size size)
d55e5bfc 895
15817c7e
RD
896 Combine this size with the other one replacing the default components
897 of this object (i.e. equal to -1) with those of the other.
d55e5bfc 898 """
5b5c9bc7 899 return _core_.Size_SetDefaults(*args, **kwargs)
d55e5bfc
RD
900
901 def Get(*args, **kwargs):
902 """
903 Get() -> (width,height)
904
905 Returns the width and height properties as a tuple.
906 """
5b5c9bc7 907 return _core_.Size_Get(*args, **kwargs)
d55e5bfc 908
15817c7e 909 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
910 def __str__(self): return str(self.Get())
911 def __repr__(self): return 'wx.Size'+str(self.Get())
912 def __len__(self): return len(self.Get())
913 def __getitem__(self, index): return self.Get()[index]
914 def __setitem__(self, index, val):
915 if index == 0: self.width = val
916 elif index == 1: self.height = val
917 else: raise IndexError
918 def __nonzero__(self): return self.Get() != (0,0)
919 __safe_for_unpickling__ = True
920 def __reduce__(self): return (wx.Size, self.Get())
921
2131d850 922_core_.Size_swigregister(Size)
d55e5bfc
RD
923
924#---------------------------------------------------------------------------
925
5b5c9bc7 926class RealPoint(object):
d55e5bfc 927 """
15817c7e
RD
928 A data structure for representing a point or position with floating
929 point x and y properties. In wxPython most places that expect a
930 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc 931 """
1bd55598
RD
932 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
933 __repr__ = _swig_repr
5b5c9bc7
RD
934 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
935 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
1bd55598 936 def __init__(self, *args, **kwargs):
d55e5bfc 937 """
5b5c9bc7 938 __init__(self, double x=0.0, double y=0.0) -> RealPoint
d55e5bfc
RD
939
940 Create a wx.RealPoint object
941 """
1bd55598
RD
942 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
943 __swig_destroy__ = _core_.delete_RealPoint
944 __del__ = lambda self : None;
d55e5bfc
RD
945 def __eq__(*args, **kwargs):
946 """
e9d6f3a4 947 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
948
949 Test for equality of wx.RealPoint objects.
950 """
5b5c9bc7 951 return _core_.RealPoint___eq__(*args, **kwargs)
d55e5bfc
RD
952
953 def __ne__(*args, **kwargs):
954 """
e9d6f3a4 955 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
956
957 Test for inequality of wx.RealPoint objects.
958 """
5b5c9bc7 959 return _core_.RealPoint___ne__(*args, **kwargs)
d55e5bfc
RD
960
961 def __add__(*args, **kwargs):
962 """
5b5c9bc7 963 __add__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
964
965 Add pt's proprties to this and return the result.
966 """
5b5c9bc7 967 return _core_.RealPoint___add__(*args, **kwargs)
d55e5bfc
RD
968
969 def __sub__(*args, **kwargs):
970 """
5b5c9bc7 971 __sub__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
972
973 Subtract pt's proprties from this and return the result
974 """
5b5c9bc7 975 return _core_.RealPoint___sub__(*args, **kwargs)
d55e5bfc
RD
976
977 def Set(*args, **kwargs):
978 """
979 Set(self, double x, double y)
980
981 Set both the x and y properties
982 """
5b5c9bc7 983 return _core_.RealPoint_Set(*args, **kwargs)
d55e5bfc
RD
984
985 def Get(*args, **kwargs):
986 """
987 Get() -> (x,y)
988
989 Return the x and y properties as a tuple.
990 """
5b5c9bc7 991 return _core_.RealPoint_Get(*args, **kwargs)
d55e5bfc 992
15817c7e 993 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
994 def __str__(self): return str(self.Get())
995 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
996 def __len__(self): return len(self.Get())
997 def __getitem__(self, index): return self.Get()[index]
998 def __setitem__(self, index, val):
999 if index == 0: self.x = val
1000 elif index == 1: self.y = val
1001 else: raise IndexError
1002 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1003 __safe_for_unpickling__ = True
1004 def __reduce__(self): return (wx.RealPoint, self.Get())
1005
2131d850 1006_core_.RealPoint_swigregister(RealPoint)
d55e5bfc
RD
1007
1008#---------------------------------------------------------------------------
1009
5b5c9bc7 1010class Point(object):
d55e5bfc 1011 """
15817c7e
RD
1012 A data structure for representing a point or position with integer x
1013 and y properties. Most places in wxPython that expect a wx.Point can
1014 also accept a (x,y) tuple.
d55e5bfc 1015 """
1bd55598
RD
1016 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1017 __repr__ = _swig_repr
5b5c9bc7
RD
1018 x = property(_core_.Point_x_get, _core_.Point_x_set)
1019 y = property(_core_.Point_y_get, _core_.Point_y_set)
1bd55598 1020 def __init__(self, *args, **kwargs):
d55e5bfc 1021 """
5b5c9bc7 1022 __init__(self, int x=0, int y=0) -> Point
d55e5bfc
RD
1023
1024 Create a wx.Point object
1025 """
1bd55598
RD
1026 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1027 __swig_destroy__ = _core_.delete_Point
1028 __del__ = lambda self : None;
d55e5bfc
RD
1029 def __eq__(*args, **kwargs):
1030 """
e9d6f3a4 1031 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
1032
1033 Test for equality of wx.Point objects.
1034 """
5b5c9bc7 1035 return _core_.Point___eq__(*args, **kwargs)
d55e5bfc
RD
1036
1037 def __ne__(*args, **kwargs):
1038 """
e9d6f3a4 1039 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
1040
1041 Test for inequality of wx.Point objects.
1042 """
5b5c9bc7 1043 return _core_.Point___ne__(*args, **kwargs)
d55e5bfc
RD
1044
1045 def __add__(*args, **kwargs):
1046 """
5b5c9bc7 1047 __add__(self, Point pt) -> Point
d55e5bfc
RD
1048
1049 Add pt's proprties to this and return the result.
1050 """
5b5c9bc7 1051 return _core_.Point___add__(*args, **kwargs)
d55e5bfc
RD
1052
1053 def __sub__(*args, **kwargs):
1054 """
5b5c9bc7 1055 __sub__(self, Point pt) -> Point
d55e5bfc
RD
1056
1057 Subtract pt's proprties from this and return the result
1058 """
5b5c9bc7 1059 return _core_.Point___sub__(*args, **kwargs)
d55e5bfc
RD
1060
1061 def __iadd__(*args, **kwargs):
1062 """
5b5c9bc7 1063 __iadd__(self, Point pt) -> Point
d55e5bfc
RD
1064
1065 Add pt to this object.
1066 """
5b5c9bc7 1067 return _core_.Point___iadd__(*args, **kwargs)
d55e5bfc
RD
1068
1069 def __isub__(*args, **kwargs):
1070 """
5b5c9bc7 1071 __isub__(self, Point pt) -> Point
d55e5bfc
RD
1072
1073 Subtract pt from this object.
1074 """
5b5c9bc7 1075 return _core_.Point___isub__(*args, **kwargs)
d55e5bfc
RD
1076
1077 def Set(*args, **kwargs):
1078 """
1079 Set(self, long x, long y)
1080
1081 Set both the x and y properties
1082 """
5b5c9bc7 1083 return _core_.Point_Set(*args, **kwargs)
d55e5bfc
RD
1084
1085 def Get(*args, **kwargs):
1086 """
1087 Get() -> (x,y)
1088
1089 Return the x and y properties as a tuple.
1090 """
5b5c9bc7 1091 return _core_.Point_Get(*args, **kwargs)
d55e5bfc 1092
15817c7e 1093 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1094 def __str__(self): return str(self.Get())
1095 def __repr__(self): return 'wx.Point'+str(self.Get())
1096 def __len__(self): return len(self.Get())
1097 def __getitem__(self, index): return self.Get()[index]
1098 def __setitem__(self, index, val):
1099 if index == 0: self.x = val
1100 elif index == 1: self.y = val
1101 else: raise IndexError
1102 def __nonzero__(self): return self.Get() != (0,0)
1103 __safe_for_unpickling__ = True
1104 def __reduce__(self): return (wx.Point, self.Get())
1105
2131d850 1106_core_.Point_swigregister(Point)
d55e5bfc
RD
1107
1108#---------------------------------------------------------------------------
1109
5b5c9bc7 1110class Rect(object):
d55e5bfc 1111 """
15817c7e
RD
1112 A class for representing and manipulating rectangles. It has x, y,
1113 width and height properties. In wxPython most palces that expect a
1114 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc 1115 """
1bd55598
RD
1116 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1117 __repr__ = _swig_repr
1118 def __init__(self, *args, **kwargs):
d55e5bfc 1119 """
5b5c9bc7 1120 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
d55e5bfc
RD
1121
1122 Create a new Rect object.
1123 """
1bd55598
RD
1124 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1125 __swig_destroy__ = _core_.delete_Rect
1126 __del__ = lambda self : None;
d55e5bfc
RD
1127 def GetX(*args, **kwargs):
1128 """GetX(self) -> int"""
5b5c9bc7 1129 return _core_.Rect_GetX(*args, **kwargs)
d55e5bfc
RD
1130
1131 def SetX(*args, **kwargs):
1132 """SetX(self, int x)"""
5b5c9bc7 1133 return _core_.Rect_SetX(*args, **kwargs)
d55e5bfc
RD
1134
1135 def GetY(*args, **kwargs):
1136 """GetY(self) -> int"""
5b5c9bc7 1137 return _core_.Rect_GetY(*args, **kwargs)
d55e5bfc
RD
1138
1139 def SetY(*args, **kwargs):
1140 """SetY(self, int y)"""
5b5c9bc7 1141 return _core_.Rect_SetY(*args, **kwargs)
d55e5bfc
RD
1142
1143 def GetWidth(*args, **kwargs):
1144 """GetWidth(self) -> int"""
5b5c9bc7 1145 return _core_.Rect_GetWidth(*args, **kwargs)
d55e5bfc
RD
1146
1147 def SetWidth(*args, **kwargs):
1148 """SetWidth(self, int w)"""
5b5c9bc7 1149 return _core_.Rect_SetWidth(*args, **kwargs)
d55e5bfc
RD
1150
1151 def GetHeight(*args, **kwargs):
1152 """GetHeight(self) -> int"""
5b5c9bc7 1153 return _core_.Rect_GetHeight(*args, **kwargs)
d55e5bfc
RD
1154
1155 def SetHeight(*args, **kwargs):
1156 """SetHeight(self, int h)"""
5b5c9bc7 1157 return _core_.Rect_SetHeight(*args, **kwargs)
d55e5bfc
RD
1158
1159 def GetPosition(*args, **kwargs):
5b5c9bc7
RD
1160 """GetPosition(self) -> Point"""
1161 return _core_.Rect_GetPosition(*args, **kwargs)
d55e5bfc
RD
1162
1163 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
1164 """SetPosition(self, Point p)"""
1165 return _core_.Rect_SetPosition(*args, **kwargs)
d55e5bfc
RD
1166
1167 def GetSize(*args, **kwargs):
5b5c9bc7
RD
1168 """GetSize(self) -> Size"""
1169 return _core_.Rect_GetSize(*args, **kwargs)
d55e5bfc
RD
1170
1171 def SetSize(*args, **kwargs):
5b5c9bc7
RD
1172 """SetSize(self, Size s)"""
1173 return _core_.Rect_SetSize(*args, **kwargs)
d55e5bfc 1174
aff4cc5c
RD
1175 def IsEmpty(*args, **kwargs):
1176 """IsEmpty(self) -> bool"""
5b5c9bc7 1177 return _core_.Rect_IsEmpty(*args, **kwargs)
aff4cc5c 1178
d55e5bfc 1179 def GetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1180 """GetTopLeft(self) -> Point"""
1181 return _core_.Rect_GetTopLeft(*args, **kwargs)
d55e5bfc
RD
1182
1183 def SetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1184 """SetTopLeft(self, Point p)"""
1185 return _core_.Rect_SetTopLeft(*args, **kwargs)
d55e5bfc
RD
1186
1187 def GetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1188 """GetBottomRight(self) -> Point"""
1189 return _core_.Rect_GetBottomRight(*args, **kwargs)
d55e5bfc
RD
1190
1191 def SetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1192 """SetBottomRight(self, Point p)"""
1193 return _core_.Rect_SetBottomRight(*args, **kwargs)
d55e5bfc 1194
5acb46e0
RD
1195 def GetTopRight(*args, **kwargs):
1196 """GetTopRight(self) -> Point"""
1197 return _core_.Rect_GetTopRight(*args, **kwargs)
1198
1199 def SetTopRight(*args, **kwargs):
1200 """SetTopRight(self, Point p)"""
1201 return _core_.Rect_SetTopRight(*args, **kwargs)
1202
1203 def GetBottomLeft(*args, **kwargs):
1204 """GetBottomLeft(self) -> Point"""
1205 return _core_.Rect_GetBottomLeft(*args, **kwargs)
1206
1207 def SetBottomLeft(*args, **kwargs):
1208 """SetBottomLeft(self, Point p)"""
1209 return _core_.Rect_SetBottomLeft(*args, **kwargs)
1210
d55e5bfc
RD
1211 def GetLeft(*args, **kwargs):
1212 """GetLeft(self) -> int"""
5b5c9bc7 1213 return _core_.Rect_GetLeft(*args, **kwargs)
d55e5bfc
RD
1214
1215 def GetTop(*args, **kwargs):
1216 """GetTop(self) -> int"""
5b5c9bc7 1217 return _core_.Rect_GetTop(*args, **kwargs)
d55e5bfc
RD
1218
1219 def GetBottom(*args, **kwargs):
1220 """GetBottom(self) -> int"""
5b5c9bc7 1221 return _core_.Rect_GetBottom(*args, **kwargs)
d55e5bfc
RD
1222
1223 def GetRight(*args, **kwargs):
1224 """GetRight(self) -> int"""
5b5c9bc7 1225 return _core_.Rect_GetRight(*args, **kwargs)
d55e5bfc
RD
1226
1227 def SetLeft(*args, **kwargs):
1228 """SetLeft(self, int left)"""
5b5c9bc7 1229 return _core_.Rect_SetLeft(*args, **kwargs)
d55e5bfc
RD
1230
1231 def SetRight(*args, **kwargs):
1232 """SetRight(self, int right)"""
5b5c9bc7 1233 return _core_.Rect_SetRight(*args, **kwargs)
d55e5bfc
RD
1234
1235 def SetTop(*args, **kwargs):
1236 """SetTop(self, int top)"""
5b5c9bc7 1237 return _core_.Rect_SetTop(*args, **kwargs)
d55e5bfc
RD
1238
1239 def SetBottom(*args, **kwargs):
1240 """SetBottom(self, int bottom)"""
5b5c9bc7 1241 return _core_.Rect_SetBottom(*args, **kwargs)
d55e5bfc
RD
1242
1243 position = property(GetPosition, SetPosition)
1244 size = property(GetSize, SetSize)
1245 left = property(GetLeft, SetLeft)
1246 right = property(GetRight, SetRight)
1247 top = property(GetTop, SetTop)
1248 bottom = property(GetBottom, SetBottom)
1249
1250 def Inflate(*args, **kwargs):
1251 """
5b5c9bc7 1252 Inflate(self, int dx, int dy) -> Rect
d55e5bfc 1253
091fdbfa
RD
1254 Increases the size of the rectangle.
1255
1256 The left border is moved farther left and the right border is moved
1257 farther right by ``dx``. The upper border is moved farther up and the
1258 bottom border is moved farther down by ``dy``. (Note the the width and
1259 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1260 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1261 opposite happens: the rectangle size decreases in the respective
1262 direction.
1263
1264 The change is made to the rectangle inplace, if instead you need a
1265 copy that is inflated, preserving the original then make the copy
1266 first::
1267
1268 copy = wx.Rect(*original)
1269 copy.Inflate(10,15)
1270
1271
d55e5bfc 1272 """
5b5c9bc7 1273 return _core_.Rect_Inflate(*args, **kwargs)
d55e5bfc
RD
1274
1275 def Deflate(*args, **kwargs):
1276 """
5b5c9bc7 1277 Deflate(self, int dx, int dy) -> Rect
d55e5bfc 1278
091fdbfa
RD
1279 Decrease the rectangle size. This method is the opposite of `Inflate`
1280 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1281 `Inflate` for a full description.
d55e5bfc 1282 """
5b5c9bc7 1283 return _core_.Rect_Deflate(*args, **kwargs)
d55e5bfc
RD
1284
1285 def OffsetXY(*args, **kwargs):
1286 """
1287 OffsetXY(self, int dx, int dy)
1288
15817c7e
RD
1289 Moves the rectangle by the specified offset. If dx is positive, the
1290 rectangle is moved to the right, if dy is positive, it is moved to the
1291 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc 1292 """
5b5c9bc7 1293 return _core_.Rect_OffsetXY(*args, **kwargs)
d55e5bfc
RD
1294
1295 def Offset(*args, **kwargs):
1296 """
5b5c9bc7 1297 Offset(self, Point pt)
d55e5bfc 1298
b1fcee84 1299 Same as `OffsetXY` but uses dx,dy from Point
d55e5bfc 1300 """
5b5c9bc7 1301 return _core_.Rect_Offset(*args, **kwargs)
d55e5bfc
RD
1302
1303 def Intersect(*args, **kwargs):
1304 """
5b5c9bc7 1305 Intersect(self, Rect rect) -> Rect
d55e5bfc 1306
5cbf236d 1307 Returns the intersectsion of this rectangle and rect.
d55e5bfc 1308 """
5b5c9bc7 1309 return _core_.Rect_Intersect(*args, **kwargs)
d55e5bfc 1310
5cbf236d
RD
1311 def Union(*args, **kwargs):
1312 """
5b5c9bc7 1313 Union(self, Rect rect) -> Rect
5cbf236d
RD
1314
1315 Returns the union of this rectangle and rect.
1316 """
5b5c9bc7 1317 return _core_.Rect_Union(*args, **kwargs)
5cbf236d 1318
d55e5bfc
RD
1319 def __add__(*args, **kwargs):
1320 """
5b5c9bc7 1321 __add__(self, Rect rect) -> Rect
d55e5bfc
RD
1322
1323 Add the properties of rect to this rectangle and return the result.
1324 """
5b5c9bc7 1325 return _core_.Rect___add__(*args, **kwargs)
d55e5bfc
RD
1326
1327 def __iadd__(*args, **kwargs):
1328 """
5b5c9bc7 1329 __iadd__(self, Rect rect) -> Rect
d55e5bfc
RD
1330
1331 Add the properties of rect to this rectangle, updating this rectangle.
1332 """
5b5c9bc7 1333 return _core_.Rect___iadd__(*args, **kwargs)
d55e5bfc
RD
1334
1335 def __eq__(*args, **kwargs):
1336 """
e9d6f3a4 1337 __eq__(self, PyObject other) -> bool
d55e5bfc 1338
e9d6f3a4 1339 Test for equality of wx.Rect objects.
d55e5bfc 1340 """
5b5c9bc7 1341 return _core_.Rect___eq__(*args, **kwargs)
d55e5bfc
RD
1342
1343 def __ne__(*args, **kwargs):
1344 """
e9d6f3a4 1345 __ne__(self, PyObject other) -> bool
d55e5bfc 1346
e9d6f3a4 1347 Test for inequality of wx.Rect objects.
d55e5bfc 1348 """
5b5c9bc7 1349 return _core_.Rect___ne__(*args, **kwargs)
d55e5bfc 1350
33d6fd3b 1351 def ContainsXY(*args, **kwargs):
d55e5bfc 1352 """
33d6fd3b 1353 ContainsXY(self, int x, int y) -> bool
d55e5bfc 1354
33d6fd3b 1355 Return True if the point is inside the rect.
d55e5bfc 1356 """
33d6fd3b 1357 return _core_.Rect_ContainsXY(*args, **kwargs)
d55e5bfc 1358
33d6fd3b 1359 def Contains(*args, **kwargs):
d55e5bfc 1360 """
33d6fd3b 1361 Contains(self, Point pt) -> bool
d55e5bfc 1362
33d6fd3b 1363 Return True if the point is inside the rect.
d55e5bfc 1364 """
33d6fd3b 1365 return _core_.Rect_Contains(*args, **kwargs)
d55e5bfc 1366
33d6fd3b 1367 def ContainsRect(*args, **kwargs):
fc46b7f3 1368 """
33d6fd3b 1369 ContainsRect(self, Rect rect) -> bool
fc46b7f3
RD
1370
1371 Returns ``True`` if the given rectangle is completely inside this
1372 rectangle or touches its boundary.
1373 """
33d6fd3b
RD
1374 return _core_.Rect_ContainsRect(*args, **kwargs)
1375
72ef6efb
RD
1376 #Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1377 #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1378 #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1379 Inside = Contains
1380 InsideXY = ContainsXY
1381 InsideRect = ContainsRect
fc46b7f3 1382
d55e5bfc
RD
1383 def Intersects(*args, **kwargs):
1384 """
5b5c9bc7 1385 Intersects(self, Rect rect) -> bool
d55e5bfc
RD
1386
1387 Returns True if the rectangles have a non empty intersection.
1388 """
5b5c9bc7 1389 return _core_.Rect_Intersects(*args, **kwargs)
d55e5bfc 1390
b1fcee84
RD
1391 def CenterIn(*args, **kwargs):
1392 """
1393 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1394
1395 Center this rectangle within the one passed to the method, which is
1396 usually, but not necessarily, the larger one.
1397 """
1398 return _core_.Rect_CenterIn(*args, **kwargs)
1399
1400 CentreIn = CenterIn
5b5c9bc7
RD
1401 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1402 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1403 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1404 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
d55e5bfc
RD
1405 def Set(*args, **kwargs):
1406 """
1407 Set(self, int x=0, int y=0, int width=0, int height=0)
1408
1409 Set all rectangle properties.
1410 """
5b5c9bc7 1411 return _core_.Rect_Set(*args, **kwargs)
d55e5bfc
RD
1412
1413 def Get(*args, **kwargs):
1414 """
1415 Get() -> (x,y,width,height)
1416
1417 Return the rectangle properties as a tuple.
1418 """
5b5c9bc7 1419 return _core_.Rect_Get(*args, **kwargs)
d55e5bfc 1420
15817c7e 1421 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1422 def __str__(self): return str(self.Get())
1423 def __repr__(self): return 'wx.Rect'+str(self.Get())
1424 def __len__(self): return len(self.Get())
1425 def __getitem__(self, index): return self.Get()[index]
1426 def __setitem__(self, index, val):
1427 if index == 0: self.x = val
1428 elif index == 1: self.y = val
1429 elif index == 2: self.width = val
1430 elif index == 3: self.height = val
1431 else: raise IndexError
1432 def __nonzero__(self): return self.Get() != (0,0,0,0)
1433 __safe_for_unpickling__ = True
1434 def __reduce__(self): return (wx.Rect, self.Get())
1435
33d6fd3b
RD
1436 Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`")
1437 BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`")
5acb46e0 1438 BottomLeft = property(GetBottomLeft,SetBottomLeft,doc="See `GetBottomLeft` and `SetBottomLeft`")
33d6fd3b
RD
1439 Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
1440 Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`")
1441 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
1442 Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`")
1443 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
1444 Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`")
1445 TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`")
5acb46e0 1446 TopRight = property(GetTopRight,SetTopRight,doc="See `GetTopRight` and `SetTopRight`")
33d6fd3b
RD
1447 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
1448 X = property(GetX,SetX,doc="See `GetX` and `SetX`")
1449 Y = property(GetY,SetY,doc="See `GetY` and `SetY`")
1450 Empty = property(IsEmpty,doc="See `IsEmpty`")
2131d850 1451_core_.Rect_swigregister(Rect)
d55e5bfc
RD
1452
1453def RectPP(*args, **kwargs):
1454 """
5b5c9bc7 1455 RectPP(Point topLeft, Point bottomRight) -> Rect
d55e5bfc
RD
1456
1457 Create a new Rect object from Points representing two corners.
1458 """
5b5c9bc7 1459 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1460 return val
1461
1462def RectPS(*args, **kwargs):
1463 """
5b5c9bc7 1464 RectPS(Point pos, Size size) -> Rect
d55e5bfc
RD
1465
1466 Create a new Rect from a position and size.
1467 """
5b5c9bc7 1468 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1469 return val
1470
070c48b4
RD
1471def RectS(*args, **kwargs):
1472 """
5b5c9bc7 1473 RectS(Size size) -> Rect
070c48b4
RD
1474
1475 Create a new Rect from a size only.
1476 """
5b5c9bc7 1477 val = _core_.new_RectS(*args, **kwargs)
070c48b4
RD
1478 return val
1479
d55e5bfc 1480
5b5c9bc7 1481def IntersectRect(*args, **kwargs):
1bd55598 1482 """
d55e5bfc
RD
1483 IntersectRect(Rect r1, Rect r2) -> Rect
1484
1485 Calculate and return the intersection of r1 and r2.
1486 """
1bd55598 1487 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1488#---------------------------------------------------------------------------
1489
5b5c9bc7 1490class Point2D(object):
15817c7e
RD
1491 """
1492 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1493 with floating point values.
1494 """
1bd55598
RD
1495 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1496 __repr__ = _swig_repr
1497 def __init__(self, *args, **kwargs):
d55e5bfc 1498 """
5b5c9bc7 1499 __init__(self, double x=0.0, double y=0.0) -> Point2D
d55e5bfc
RD
1500
1501 Create a w.Point2D object.
1502 """
1bd55598 1503 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
d55e5bfc 1504 def GetFloor(*args, **kwargs):
fd2dc343
RD
1505 """
1506 GetFloor() -> (x,y)
1507
1508 Convert to integer
1509 """
5b5c9bc7 1510 return _core_.Point2D_GetFloor(*args, **kwargs)
d55e5bfc
RD
1511
1512 def GetRounded(*args, **kwargs):
fd2dc343
RD
1513 """
1514 GetRounded() -> (x,y)
1515
1516 Convert to integer
1517 """
5b5c9bc7 1518 return _core_.Point2D_GetRounded(*args, **kwargs)
d55e5bfc
RD
1519
1520 def GetVectorLength(*args, **kwargs):
1521 """GetVectorLength(self) -> double"""
5b5c9bc7 1522 return _core_.Point2D_GetVectorLength(*args, **kwargs)
d55e5bfc
RD
1523
1524 def GetVectorAngle(*args, **kwargs):
1525 """GetVectorAngle(self) -> double"""
5b5c9bc7 1526 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1527
1528 def SetVectorLength(*args, **kwargs):
1529 """SetVectorLength(self, double length)"""
5b5c9bc7 1530 return _core_.Point2D_SetVectorLength(*args, **kwargs)
d55e5bfc
RD
1531
1532 def SetVectorAngle(*args, **kwargs):
1533 """SetVectorAngle(self, double degrees)"""
5b5c9bc7 1534 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1535
1536 def SetPolarCoordinates(self, angle, length):
1537 self.SetVectorLength(length)
1538 self.SetVectorAngle(angle)
1539 def Normalize(self):
1540 self.SetVectorLength(1.0)
1541
1542 def GetDistance(*args, **kwargs):
5b5c9bc7
RD
1543 """GetDistance(self, Point2D pt) -> double"""
1544 return _core_.Point2D_GetDistance(*args, **kwargs)
d55e5bfc
RD
1545
1546 def GetDistanceSquare(*args, **kwargs):
5b5c9bc7
RD
1547 """GetDistanceSquare(self, Point2D pt) -> double"""
1548 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
d55e5bfc
RD
1549
1550 def GetDotProduct(*args, **kwargs):
5b5c9bc7
RD
1551 """GetDotProduct(self, Point2D vec) -> double"""
1552 return _core_.Point2D_GetDotProduct(*args, **kwargs)
d55e5bfc
RD
1553
1554 def GetCrossProduct(*args, **kwargs):
5b5c9bc7
RD
1555 """GetCrossProduct(self, Point2D vec) -> double"""
1556 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
d55e5bfc
RD
1557
1558 def __neg__(*args, **kwargs):
1559 """
5b5c9bc7 1560 __neg__(self) -> Point2D
d55e5bfc
RD
1561
1562 the reflection of this point
1563 """
5b5c9bc7 1564 return _core_.Point2D___neg__(*args, **kwargs)
d55e5bfc
RD
1565
1566 def __iadd__(*args, **kwargs):
5b5c9bc7
RD
1567 """__iadd__(self, Point2D pt) -> Point2D"""
1568 return _core_.Point2D___iadd__(*args, **kwargs)
d55e5bfc
RD
1569
1570 def __isub__(*args, **kwargs):
5b5c9bc7
RD
1571 """__isub__(self, Point2D pt) -> Point2D"""
1572 return _core_.Point2D___isub__(*args, **kwargs)
d55e5bfc
RD
1573
1574 def __imul__(*args, **kwargs):
5b5c9bc7
RD
1575 """__imul__(self, Point2D pt) -> Point2D"""
1576 return _core_.Point2D___imul__(*args, **kwargs)
d55e5bfc
RD
1577
1578 def __idiv__(*args, **kwargs):
5b5c9bc7
RD
1579 """__idiv__(self, Point2D pt) -> Point2D"""
1580 return _core_.Point2D___idiv__(*args, **kwargs)
d55e5bfc
RD
1581
1582 def __eq__(*args, **kwargs):
1583 """
e9d6f3a4 1584 __eq__(self, PyObject other) -> bool
d55e5bfc 1585
e9d6f3a4 1586 Test for equality of wx.Point2D objects.
d55e5bfc 1587 """
5b5c9bc7 1588 return _core_.Point2D___eq__(*args, **kwargs)
d55e5bfc
RD
1589
1590 def __ne__(*args, **kwargs):
1591 """
e9d6f3a4 1592 __ne__(self, PyObject other) -> bool
d55e5bfc 1593
e9d6f3a4 1594 Test for inequality of wx.Point2D objects.
d55e5bfc 1595 """
5b5c9bc7 1596 return _core_.Point2D___ne__(*args, **kwargs)
d55e5bfc 1597
5b5c9bc7
RD
1598 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1599 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
d55e5bfc
RD
1600 def Set(*args, **kwargs):
1601 """Set(self, double x=0, double y=0)"""
5b5c9bc7 1602 return _core_.Point2D_Set(*args, **kwargs)
d55e5bfc
RD
1603
1604 def Get(*args, **kwargs):
1605 """
1606 Get() -> (x,y)
1607
1608 Return x and y properties as a tuple.
1609 """
5b5c9bc7 1610 return _core_.Point2D_Get(*args, **kwargs)
d55e5bfc 1611
15817c7e 1612 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1613 def __str__(self): return str(self.Get())
1614 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1615 def __len__(self): return len(self.Get())
1616 def __getitem__(self, index): return self.Get()[index]
1617 def __setitem__(self, index, val):
1618 if index == 0: self.x = val
1619 elif index == 1: self.y = val
1620 else: raise IndexError
1621 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1622 __safe_for_unpickling__ = True
1623 def __reduce__(self): return (wx.Point2D, self.Get())
1624
33d6fd3b
RD
1625 Floor = property(GetFloor,doc="See `GetFloor`")
1626 Rounded = property(GetRounded,doc="See `GetRounded`")
1627 VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`")
1628 VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`")
2131d850 1629_core_.Point2D_swigregister(Point2D)
d55e5bfc
RD
1630
1631def Point2DCopy(*args, **kwargs):
1632 """
5b5c9bc7 1633 Point2DCopy(Point2D pt) -> Point2D
d55e5bfc
RD
1634
1635 Create a w.Point2D object.
1636 """
5b5c9bc7 1637 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1638 return val
1639
1640def Point2DFromPoint(*args, **kwargs):
1641 """
5b5c9bc7 1642 Point2DFromPoint(Point pt) -> Point2D
d55e5bfc
RD
1643
1644 Create a w.Point2D object.
1645 """
5b5c9bc7 1646 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d55e5bfc
RD
1647 return val
1648
1649#---------------------------------------------------------------------------
1650
5b5c9bc7
RD
1651FromStart = _core_.FromStart
1652FromCurrent = _core_.FromCurrent
1653FromEnd = _core_.FromEnd
d55e5bfc 1654class InputStream(object):
36ed4f51 1655 """Proxy of C++ InputStream class"""
1bd55598
RD
1656 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1657 __repr__ = _swig_repr
1658 def __init__(self, *args, **kwargs):
d55e5bfc 1659 """__init__(self, PyObject p) -> InputStream"""
1bd55598
RD
1660 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1661 __swig_destroy__ = _core_.delete_InputStream
1662 __del__ = lambda self : None;
d55e5bfc
RD
1663 def close(*args, **kwargs):
1664 """close(self)"""
5b5c9bc7 1665 return _core_.InputStream_close(*args, **kwargs)
d55e5bfc
RD
1666
1667 def flush(*args, **kwargs):
1668 """flush(self)"""
5b5c9bc7 1669 return _core_.InputStream_flush(*args, **kwargs)
d55e5bfc
RD
1670
1671 def eof(*args, **kwargs):
1672 """eof(self) -> bool"""
5b5c9bc7 1673 return _core_.InputStream_eof(*args, **kwargs)
d55e5bfc
RD
1674
1675 def read(*args, **kwargs):
1676 """read(self, int size=-1) -> PyObject"""
5b5c9bc7 1677 return _core_.InputStream_read(*args, **kwargs)
d55e5bfc
RD
1678
1679 def readline(*args, **kwargs):
1680 """readline(self, int size=-1) -> PyObject"""
5b5c9bc7 1681 return _core_.InputStream_readline(*args, **kwargs)
d55e5bfc
RD
1682
1683 def readlines(*args, **kwargs):
1684 """readlines(self, int sizehint=-1) -> PyObject"""
5b5c9bc7 1685 return _core_.InputStream_readlines(*args, **kwargs)
d55e5bfc
RD
1686
1687 def seek(*args, **kwargs):
1688 """seek(self, int offset, int whence=0)"""
5b5c9bc7 1689 return _core_.InputStream_seek(*args, **kwargs)
d55e5bfc
RD
1690
1691 def tell(*args, **kwargs):
1692 """tell(self) -> int"""
5b5c9bc7 1693 return _core_.InputStream_tell(*args, **kwargs)
d55e5bfc
RD
1694
1695 def Peek(*args, **kwargs):
1696 """Peek(self) -> char"""
5b5c9bc7 1697 return _core_.InputStream_Peek(*args, **kwargs)
d55e5bfc
RD
1698
1699 def GetC(*args, **kwargs):
1700 """GetC(self) -> char"""
5b5c9bc7 1701 return _core_.InputStream_GetC(*args, **kwargs)
d55e5bfc
RD
1702
1703 def LastRead(*args, **kwargs):
1704 """LastRead(self) -> size_t"""
5b5c9bc7 1705 return _core_.InputStream_LastRead(*args, **kwargs)
d55e5bfc
RD
1706
1707 def CanRead(*args, **kwargs):
1708 """CanRead(self) -> bool"""
5b5c9bc7 1709 return _core_.InputStream_CanRead(*args, **kwargs)
d55e5bfc
RD
1710
1711 def Eof(*args, **kwargs):
1712 """Eof(self) -> bool"""
5b5c9bc7 1713 return _core_.InputStream_Eof(*args, **kwargs)
d55e5bfc
RD
1714
1715 def Ungetch(*args, **kwargs):
1716 """Ungetch(self, char c) -> bool"""
5b5c9bc7 1717 return _core_.InputStream_Ungetch(*args, **kwargs)
d55e5bfc
RD
1718
1719 def SeekI(*args, **kwargs):
5b5c9bc7
RD
1720 """SeekI(self, long pos, int mode=FromStart) -> long"""
1721 return _core_.InputStream_SeekI(*args, **kwargs)
d55e5bfc
RD
1722
1723 def TellI(*args, **kwargs):
1724 """TellI(self) -> long"""
5b5c9bc7 1725 return _core_.InputStream_TellI(*args, **kwargs)
d55e5bfc 1726
2131d850 1727_core_.InputStream_swigregister(InputStream)
5b5c9bc7
RD
1728DefaultPosition = cvar.DefaultPosition
1729DefaultSize = cvar.DefaultSize
d55e5bfc 1730
5b5c9bc7
RD
1731class OutputStream(object):
1732 """Proxy of C++ OutputStream class"""
1bd55598
RD
1733 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1734 def __init__(self): raise AttributeError, "No constructor defined"
1735 __repr__ = _swig_repr
d55e5bfc
RD
1736 def write(*args, **kwargs):
1737 """write(self, PyObject obj)"""
5b5c9bc7 1738 return _core_.OutputStream_write(*args, **kwargs)
d55e5bfc 1739
1bd55598
RD
1740 def LastWrite(*args, **kwargs):
1741 """LastWrite(self) -> size_t"""
1742 return _core_.OutputStream_LastWrite(*args, **kwargs)
d55e5bfc 1743
2131d850 1744_core_.OutputStream_swigregister(OutputStream)
d55e5bfc
RD
1745
1746#---------------------------------------------------------------------------
1747
5b5c9bc7
RD
1748class FSFile(Object):
1749 """Proxy of C++ FSFile class"""
1bd55598
RD
1750 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1751 __repr__ = _swig_repr
1752 def __init__(self, *args, **kwargs):
d55e5bfc 1753 """
5b5c9bc7
RD
1754 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1755 DateTime modif) -> FSFile
d55e5bfc 1756 """
1bd55598 1757 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1bd55598
RD
1758 __swig_destroy__ = _core_.delete_FSFile
1759 __del__ = lambda self : None;
d55e5bfc 1760 def GetStream(*args, **kwargs):
5b5c9bc7
RD
1761 """GetStream(self) -> InputStream"""
1762 return _core_.FSFile_GetStream(*args, **kwargs)
d55e5bfc 1763
ac5d357a
RD
1764 def DetachStream(*args, **kwargs):
1765 """DetachStream(self)"""
1766 return _core_.FSFile_DetachStream(*args, **kwargs)
1767
d55e5bfc 1768 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
1769 """GetMimeType(self) -> String"""
1770 return _core_.FSFile_GetMimeType(*args, **kwargs)
d55e5bfc
RD
1771
1772 def GetLocation(*args, **kwargs):
5b5c9bc7
RD
1773 """GetLocation(self) -> String"""
1774 return _core_.FSFile_GetLocation(*args, **kwargs)
d55e5bfc
RD
1775
1776 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1777 """GetAnchor(self) -> String"""
1778 return _core_.FSFile_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1779
1780 def GetModificationTime(*args, **kwargs):
5b5c9bc7
RD
1781 """GetModificationTime(self) -> DateTime"""
1782 return _core_.FSFile_GetModificationTime(*args, **kwargs)
d55e5bfc 1783
ac5d357a
RD
1784 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1785 Location = property(GetLocation,doc="See `GetLocation`")
1786 MimeType = property(GetMimeType,doc="See `GetMimeType`")
1787 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
1788 Stream = property(GetStream,doc="See `GetStream`")
2131d850 1789_core_.FSFile_swigregister(FSFile)
d55e5bfc
RD
1790
1791class CPPFileSystemHandler(object):
36ed4f51 1792 """Proxy of C++ CPPFileSystemHandler class"""
1bd55598
RD
1793 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1794 def __init__(self): raise AttributeError, "No constructor defined"
1795 __repr__ = _swig_repr
50f151d7
RD
1796 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1797 __del__ = lambda self : None;
2131d850 1798_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d55e5bfc
RD
1799
1800class FileSystemHandler(CPPFileSystemHandler):
36ed4f51 1801 """Proxy of C++ FileSystemHandler class"""
1bd55598
RD
1802 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1803 __repr__ = _swig_repr
1804 def __init__(self, *args, **kwargs):
d55e5bfc 1805 """__init__(self) -> FileSystemHandler"""
1bd55598 1806 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
d55e5bfc
RD
1807 self._setCallbackInfo(self, FileSystemHandler)
1808
1809 def _setCallbackInfo(*args, **kwargs):
1810 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 1811 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
1812
1813 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1814 """CanOpen(self, String location) -> bool"""
1815 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1816
1817 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1818 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1819 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1820
1821 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1822 """FindFirst(self, String spec, int flags=0) -> String"""
1823 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1824
1825 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1826 """FindNext(self) -> String"""
1827 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
1828
1829 def GetProtocol(*args, **kwargs):
5b5c9bc7
RD
1830 """GetProtocol(self, String location) -> String"""
1831 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
d55e5bfc
RD
1832
1833 def GetLeftLocation(*args, **kwargs):
5b5c9bc7
RD
1834 """GetLeftLocation(self, String location) -> String"""
1835 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
d55e5bfc
RD
1836
1837 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1838 """GetAnchor(self, String location) -> String"""
1839 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1840
1841 def GetRightLocation(*args, **kwargs):
5b5c9bc7
RD
1842 """GetRightLocation(self, String location) -> String"""
1843 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
d55e5bfc
RD
1844
1845 def GetMimeTypeFromExt(*args, **kwargs):
5b5c9bc7
RD
1846 """GetMimeTypeFromExt(self, String location) -> String"""
1847 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
d55e5bfc 1848
ac5d357a
RD
1849 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1850 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
1851 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
1852 Protocol = property(GetProtocol,doc="See `GetProtocol`")
1853 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
2131d850 1854_core_.FileSystemHandler_swigregister(FileSystemHandler)
d55e5bfc 1855
5b5c9bc7
RD
1856class FileSystem(Object):
1857 """Proxy of C++ FileSystem class"""
1bd55598
RD
1858 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1859 __repr__ = _swig_repr
1860 def __init__(self, *args, **kwargs):
5b5c9bc7 1861 """__init__(self) -> FileSystem"""
1bd55598
RD
1862 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1863 __swig_destroy__ = _core_.delete_FileSystem
1864 __del__ = lambda self : None;
d55e5bfc 1865 def ChangePathTo(*args, **kwargs):
5b5c9bc7
RD
1866 """ChangePathTo(self, String location, bool is_dir=False)"""
1867 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
d55e5bfc
RD
1868
1869 def GetPath(*args, **kwargs):
5b5c9bc7
RD
1870 """GetPath(self) -> String"""
1871 return _core_.FileSystem_GetPath(*args, **kwargs)
d55e5bfc
RD
1872
1873 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1874 """OpenFile(self, String location) -> FSFile"""
1875 return _core_.FileSystem_OpenFile(*args, **kwargs)
d55e5bfc
RD
1876
1877 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1878 """FindFirst(self, String spec, int flags=0) -> String"""
1879 return _core_.FileSystem_FindFirst(*args, **kwargs)
d55e5bfc
RD
1880
1881 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1882 """FindNext(self) -> String"""
1883 return _core_.FileSystem_FindNext(*args, **kwargs)
d55e5bfc
RD
1884
1885 def AddHandler(*args, **kwargs):
d6c14a4c 1886 """AddHandler(CPPFileSystemHandler handler)"""
5b5c9bc7 1887 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc
RD
1888
1889 AddHandler = staticmethod(AddHandler)
ac5d357a
RD
1890 def RemoveHandler(*args, **kwargs):
1891 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1892 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1893
1894 RemoveHandler = staticmethod(RemoveHandler)
d55e5bfc 1895 def CleanUpHandlers(*args, **kwargs):
d6c14a4c 1896 """CleanUpHandlers()"""
5b5c9bc7 1897 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc
RD
1898
1899 CleanUpHandlers = staticmethod(CleanUpHandlers)
1900 def FileNameToURL(*args, **kwargs):
5b5c9bc7
RD
1901 """FileNameToURL(String filename) -> String"""
1902 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc
RD
1903
1904 FileNameToURL = staticmethod(FileNameToURL)
b411df4a 1905 def URLToFileName(*args, **kwargs):
5b5c9bc7
RD
1906 """URLToFileName(String url) -> String"""
1907 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a
RD
1908
1909 URLToFileName = staticmethod(URLToFileName)
ac5d357a 1910 Path = property(GetPath,doc="See `GetPath`")
2131d850 1911_core_.FileSystem_swigregister(FileSystem)
d55e5bfc 1912
5b5c9bc7 1913def FileSystem_AddHandler(*args, **kwargs):
1bd55598
RD
1914 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1915 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 1916
ac5d357a
RD
1917def FileSystem_RemoveHandler(*args, **kwargs):
1918 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1919 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1920
1bd55598
RD
1921def FileSystem_CleanUpHandlers(*args):
1922 """FileSystem_CleanUpHandlers()"""
1923 return _core_.FileSystem_CleanUpHandlers(*args)
d55e5bfc 1924
5b5c9bc7 1925def FileSystem_FileNameToURL(*args, **kwargs):
1bd55598
RD
1926 """FileSystem_FileNameToURL(String filename) -> String"""
1927 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 1928
5b5c9bc7 1929def FileSystem_URLToFileName(*args, **kwargs):
1bd55598
RD
1930 """FileSystem_URLToFileName(String url) -> String"""
1931 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a 1932
5b5c9bc7
RD
1933class InternetFSHandler(CPPFileSystemHandler):
1934 """Proxy of C++ InternetFSHandler class"""
1bd55598
RD
1935 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1936 __repr__ = _swig_repr
1937 def __init__(self, *args, **kwargs):
5b5c9bc7 1938 """__init__(self) -> InternetFSHandler"""
1bd55598 1939 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
d55e5bfc 1940 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1941 """CanOpen(self, String location) -> bool"""
1942 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1943
1944 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1945 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1946 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
d55e5bfc 1947
2131d850 1948_core_.InternetFSHandler_swigregister(InternetFSHandler)
d55e5bfc 1949
5b5c9bc7
RD
1950class ZipFSHandler(CPPFileSystemHandler):
1951 """Proxy of C++ ZipFSHandler class"""
1bd55598
RD
1952 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1953 __repr__ = _swig_repr
1954 def __init__(self, *args, **kwargs):
5b5c9bc7 1955 """__init__(self) -> ZipFSHandler"""
1bd55598 1956 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
d55e5bfc 1957 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1958 """CanOpen(self, String location) -> bool"""
1959 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1960
1961 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1962 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1963 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1964
1965 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1966 """FindFirst(self, String spec, int flags=0) -> String"""
1967 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1968
1969 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1970 """FindNext(self) -> String"""
1971 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
d55e5bfc 1972
2131d850 1973_core_.ZipFSHandler_swigregister(ZipFSHandler)
d55e5bfc
RD
1974
1975
1976def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1bd55598
RD
1977 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1978 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d55e5bfc
RD
1979
1980def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1bd55598
RD
1981 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1982 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d55e5bfc
RD
1983
1984def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1bd55598
RD
1985 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1986 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
b411df4a
RD
1987def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1988 """
1989 Add 'file' to the memory filesystem. The dataItem parameter can
1990 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1991 arbitrary data. If a bitmap or image is used then the imgType
1992 parameter should specify what kind of image file it should be
1993 written as, wx.BITMAP_TYPE_PNG, etc.
1994 """
1995 if isinstance(dataItem, wx.Image):
1996 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1997 elif isinstance(dataItem, wx.Bitmap):
1998 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1999 elif type(dataItem) == str:
2000 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2001 else:
2002 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc 2003
5b5c9bc7
RD
2004class MemoryFSHandler(CPPFileSystemHandler):
2005 """Proxy of C++ MemoryFSHandler class"""
1bd55598
RD
2006 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2007 __repr__ = _swig_repr
2008 def __init__(self, *args, **kwargs):
5b5c9bc7 2009 """__init__(self) -> MemoryFSHandler"""
1bd55598 2010 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
d55e5bfc 2011 def RemoveFile(*args, **kwargs):
5b5c9bc7
RD
2012 """RemoveFile(String filename)"""
2013 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc
RD
2014
2015 RemoveFile = staticmethod(RemoveFile)
2016 AddFile = staticmethod(MemoryFSHandler_AddFile)
2017 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2018 """CanOpen(self, String location) -> bool"""
2019 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2020
2021 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2022 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2023 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
2024
2025 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2026 """FindFirst(self, String spec, int flags=0) -> String"""
2027 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
2028
2029 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2030 """FindNext(self) -> String"""
2031 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
d55e5bfc 2032
2131d850 2033_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d55e5bfc 2034
5b5c9bc7 2035def MemoryFSHandler_RemoveFile(*args, **kwargs):
1bd55598
RD
2036 """MemoryFSHandler_RemoveFile(String filename)"""
2037 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 2038
5b5c9bc7
RD
2039IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2040IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2041IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
f5263701
RD
2042IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL
2043IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH
d55e5bfc
RD
2044#---------------------------------------------------------------------------
2045
5b5c9bc7 2046class ImageHandler(Object):
27fb7603
RD
2047 """
2048 This is the base class for implementing image file loading/saving, and
2049 image creation from data. It is used within `wx.Image` and is not
2050 normally seen by the application.
2051 """
1bd55598
RD
2052 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2053 def __init__(self): raise AttributeError, "No constructor defined"
2054 __repr__ = _swig_repr
d55e5bfc 2055 def GetName(*args, **kwargs):
5b5c9bc7
RD
2056 """GetName(self) -> String"""
2057 return _core_.ImageHandler_GetName(*args, **kwargs)
d55e5bfc
RD
2058
2059 def GetExtension(*args, **kwargs):
5b5c9bc7
RD
2060 """GetExtension(self) -> String"""
2061 return _core_.ImageHandler_GetExtension(*args, **kwargs)
d55e5bfc
RD
2062
2063 def GetType(*args, **kwargs):
2064 """GetType(self) -> long"""
5b5c9bc7 2065 return _core_.ImageHandler_GetType(*args, **kwargs)
d55e5bfc
RD
2066
2067 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
2068 """GetMimeType(self) -> String"""
2069 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
d55e5bfc
RD
2070
2071 def CanRead(*args, **kwargs):
5b5c9bc7
RD
2072 """CanRead(self, String name) -> bool"""
2073 return _core_.ImageHandler_CanRead(*args, **kwargs)
d55e5bfc 2074
b02396e8
RD
2075 def CanReadStream(*args, **kwargs):
2076 """CanReadStream(self, InputStream stream) -> bool"""
2077 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2078
d55e5bfc 2079 def SetName(*args, **kwargs):
5b5c9bc7
RD
2080 """SetName(self, String name)"""
2081 return _core_.ImageHandler_SetName(*args, **kwargs)
d55e5bfc
RD
2082
2083 def SetExtension(*args, **kwargs):
5b5c9bc7
RD
2084 """SetExtension(self, String extension)"""
2085 return _core_.ImageHandler_SetExtension(*args, **kwargs)
d55e5bfc
RD
2086
2087 def SetType(*args, **kwargs):
2088 """SetType(self, long type)"""
5b5c9bc7 2089 return _core_.ImageHandler_SetType(*args, **kwargs)
d55e5bfc
RD
2090
2091 def SetMimeType(*args, **kwargs):
5b5c9bc7
RD
2092 """SetMimeType(self, String mimetype)"""
2093 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
d55e5bfc 2094
ac5d357a
RD
2095 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2096 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2097 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2098 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2131d850 2099_core_.ImageHandler_swigregister(ImageHandler)
d55e5bfc 2100
943e8dfd
RD
2101class PyImageHandler(ImageHandler):
2102 """
2103 This is the base class for implementing image file loading/saving, and
2104 image creation from data, all written in Python. To create a custom
2105 image handler derive a new class from wx.PyImageHandler and provide
2106 the following methods::
2107
2108 def DoCanRead(self, stream) --> bool
2109 '''Check if this handler can read the image on the stream'''
2110
2111 def LoadFile(self, image, stream, verbose, index) --> bool
2112 '''Load image data from the stream and load it into image.'''
2113
2114 def SaveFile(self, image, stream, verbose) --> bool
2115 '''Save the iamge data in image to the stream using
2116 this handler's image file format.'''
2117
2118 def GetImageCount(self, stream) --> int
2119 '''If this image format can hold more than one image,
2120 how many does the image on the stream have?'''
2121
2122 To activate your handler create an instance of it and pass it to
2123 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2124 `SetExtension` from your constructor.
2125
2126 """
1bd55598
RD
2127 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2128 __repr__ = _swig_repr
2129 def __init__(self, *args, **kwargs):
943e8dfd
RD
2130 """
2131 __init__(self) -> PyImageHandler
2132
2133 This is the base class for implementing image file loading/saving, and
2134 image creation from data, all written in Python. To create a custom
2135 image handler derive a new class from wx.PyImageHandler and provide
2136 the following methods::
2137
2138 def DoCanRead(self, stream) --> bool
2139 '''Check if this handler can read the image on the stream'''
2140
2141 def LoadFile(self, image, stream, verbose, index) --> bool
2142 '''Load image data from the stream and load it into image.'''
2143
2144 def SaveFile(self, image, stream, verbose) --> bool
2145 '''Save the iamge data in image to the stream using
2146 this handler's image file format.'''
2147
2148 def GetImageCount(self, stream) --> int
2149 '''If this image format can hold more than one image,
2150 how many does the image on the stream have?'''
2151
2152 To activate your handler create an instance of it and pass it to
2153 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2154 `SetExtension` from your constructor.
2155
2156 """
1bd55598 2157 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
RD
2158 self._SetSelf(self)
2159
2160 def _SetSelf(*args, **kwargs):
2161 """_SetSelf(self, PyObject self)"""
2162 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2163
2131d850 2164_core_.PyImageHandler_swigregister(PyImageHandler)
943e8dfd 2165
5b5c9bc7
RD
2166class ImageHistogram(object):
2167 """Proxy of C++ ImageHistogram class"""
1bd55598
RD
2168 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2169 __repr__ = _swig_repr
2170 def __init__(self, *args, **kwargs):
5b5c9bc7 2171 """__init__(self) -> ImageHistogram"""
1bd55598 2172 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
d55e5bfc
RD
2173 def MakeKey(*args, **kwargs):
2174 """
7a27cf7c 2175 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2176
2177 Get the key in the histogram for the given RGB values
2178 """
5b5c9bc7 2179 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc
RD
2180
2181 MakeKey = staticmethod(MakeKey)
2182 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2183 """
2184 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2185
2186 Find first colour that is not used in the image and has higher RGB
2187 values than startR, startG, startB. Returns a tuple consisting of a
2188 success flag and rgb values.
2189 """
5b5c9bc7 2190 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2191
f1cbd8fa
RD
2192 def GetCount(*args, **kwargs):
2193 """
2194 GetCount(self, unsigned long key) -> unsigned long
2195
2196 Returns the pixel count for the given key. Use `MakeKey` to create a
2197 key value from a RGB tripple.
2198 """
5b5c9bc7 2199 return _core_.ImageHistogram_GetCount(*args, **kwargs)
f1cbd8fa
RD
2200
2201 def GetCountRGB(*args, **kwargs):
2202 """
7a27cf7c 2203 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2204
2205 Returns the pixel count for the given RGB values.
2206 """
5b5c9bc7 2207 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
f1cbd8fa
RD
2208
2209 def GetCountColour(*args, **kwargs):
2210 """
5b5c9bc7 2211 GetCountColour(self, Colour colour) -> unsigned long
f1cbd8fa
RD
2212
2213 Returns the pixel count for the given `wx.Colour` value.
2214 """
5b5c9bc7 2215 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
f1cbd8fa 2216
2131d850 2217_core_.ImageHistogram_swigregister(ImageHistogram)
d55e5bfc 2218
5b5c9bc7 2219def ImageHistogram_MakeKey(*args, **kwargs):
1bd55598 2220 """
7a27cf7c 2221 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2222
2223 Get the key in the histogram for the given RGB values
2224 """
1bd55598 2225 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2226
943e8dfd
RD
2227class Image_RGBValue(object):
2228 """
2229 An object that contains values for red, green and blue which represent
2230 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2231 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2232 color space.
2233 """
1bd55598
RD
2234 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2235 __repr__ = _swig_repr
2236 def __init__(self, *args, **kwargs):
943e8dfd
RD
2237 """
2238 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2239
2240 Constructor.
2241 """
1bd55598 2242 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
2243 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2244 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2245 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2246_core_.Image_RGBValue_swigregister(Image_RGBValue)
943e8dfd
RD
2247
2248class Image_HSVValue(object):
2249 """
2250 An object that contains values for hue, saturation and value which
2251 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2252 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2253 color space.
2254 """
1bd55598
RD
2255 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2256 __repr__ = _swig_repr
2257 def __init__(self, *args, **kwargs):
943e8dfd
RD
2258 """
2259 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2260
2261 Constructor.
2262 """
1bd55598 2263 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
2264 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2265 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2266 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2267_core_.Image_HSVValue_swigregister(Image_HSVValue)
943e8dfd 2268
5b5c9bc7 2269class Image(Object):
7a27cf7c
RD
2270 """
2271 A platform-independent image class. An image can be created from
2272 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2273 variety of formats. Functions are available to set and get image
2274 bits, so it can be used for basic image manipulation.
2275
2276 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2277 platform-specific `wx.Bitmap` object must be created from it using the
2278 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2279 device context, using `wx.DC.DrawBitmap`.
2280
2281 One colour value of the image may be used as a mask colour which will
2282 lead to the automatic creation of a `wx.Mask` object associated to the
2283 bitmap object.
2284
2285 wx.Image supports alpha channel data, that is in addition to a byte
2286 for the red, green and blue colour components for each pixel it also
2287 stores a byte representing the pixel opacity. An alpha value of 0
2288 corresponds to a transparent pixel (null opacity) while a value of 255
2289 means that the pixel is 100% opaque.
2290
2291 Unlike RGB data, not all images have an alpha channel and before using
2292 `GetAlpha` you should check if this image contains an alpha channel
2293 with `HasAlpha`. Note that currently only images loaded from PNG files
2294 with transparency information will have an alpha channel.
2295 """
1bd55598
RD
2296 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2297 __repr__ = _swig_repr
2298 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2299 """
2300 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2301
2302 Loads an image from a file.
2303 """
1bd55598
RD
2304 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2305 __swig_destroy__ = _core_.delete_Image
2306 __del__ = lambda self : None;
d55e5bfc 2307 def Create(*args, **kwargs):
7a27cf7c
RD
2308 """
2309 Create(self, int width, int height, bool clear=True)
2310
2311 Creates a fresh image. If clear is ``True``, the new image will be
2312 initialized to black. Otherwise, the image data will be uninitialized.
2313 """
5b5c9bc7 2314 return _core_.Image_Create(*args, **kwargs)
d55e5bfc
RD
2315
2316 def Destroy(*args, **kwargs):
2317 """
2318 Destroy(self)
2319
7a27cf7c 2320 Destroys the image data.
d55e5bfc 2321 """
7e08d4ef
RD
2322 val = _core_.Image_Destroy(*args, **kwargs)
2323 args[0].thisown = 0
2324 return val
d55e5bfc
RD
2325
2326 def Scale(*args, **kwargs):
7a27cf7c 2327 """
f5263701 2328 Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
7a27cf7c
RD
2329
2330 Returns a scaled version of the image. This is also useful for scaling
2331 bitmaps in general as the only other way to scale bitmaps is to blit a
f5263701
RD
2332 `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter
2333 specifies what method to use for resampling the image. It can be
2334 either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling
2335 method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses
2336 bicubic and box averaging resampling methods for upsampling and
2337 downsampling respectively.
7a27cf7c 2338 """
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
RD
2651
2652 def Ok(*args, **kwargs):
7a27cf7c
RD
2653 """
2654 Ok(self) -> bool
2655
2656 Returns true if image data is present.
2657 """
5b5c9bc7 2658 return _core_.Image_Ok(*args, **kwargs)
d55e5bfc
RD
2659
2660 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2661 """
2662 GetWidth(self) -> int
2663
2664 Gets the width of the image in pixels.
2665 """
5b5c9bc7 2666 return _core_.Image_GetWidth(*args, **kwargs)
d55e5bfc
RD
2667
2668 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2669 """
2670 GetHeight(self) -> int
2671
2672 Gets the height of the image in pixels.
2673 """
5b5c9bc7 2674 return _core_.Image_GetHeight(*args, **kwargs)
d55e5bfc
RD
2675
2676 def GetSize(*args, **kwargs):
7a27cf7c
RD
2677 """
2678 GetSize(self) -> Size
2679
2680 Returns the size of the image in pixels.
2681 """
5b5c9bc7 2682 return _core_.Image_GetSize(*args, **kwargs)
d55e5bfc
RD
2683
2684 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2685 """
2686 GetSubImage(self, Rect rect) -> Image
2687
2688 Returns a sub image of the current one as long as the rect belongs
2689 entirely to the image.
2690 """
5b5c9bc7 2691 return _core_.Image_GetSubImage(*args, **kwargs)
d55e5bfc 2692
aff4cc5c 2693 def Size(*args, **kwargs):
7a27cf7c
RD
2694 """
2695 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2696
2697 Returns a resized version of this image without scaling it by adding
2698 either a border with the given colour or cropping as necessary. The
2699 image is pasted into a new image with the given size and background
2700 colour at the position ``pos`` relative to the upper left of the new
2701 image. If red = green = blue = -1 then use either the current mask
2702 colour if set or find, use, and set a suitable mask colour for any
2703 newly exposed areas.
2704 """
5b5c9bc7 2705 return _core_.Image_Size(*args, **kwargs)
aff4cc5c 2706
d55e5bfc 2707 def Copy(*args, **kwargs):
7a27cf7c
RD
2708 """
2709 Copy(self) -> Image
2710
2711 Returns an identical copy of the image.
2712 """
5b5c9bc7 2713 return _core_.Image_Copy(*args, **kwargs)
d55e5bfc
RD
2714
2715 def Paste(*args, **kwargs):
7a27cf7c
RD
2716 """
2717 Paste(self, Image image, int x, int y)
2718
2719 Pastes ``image`` into this instance and takes care of the mask colour
2720 and any out of bounds problems.
2721 """
5b5c9bc7 2722 return _core_.Image_Paste(*args, **kwargs)
d55e5bfc
RD
2723
2724 def GetData(*args, **kwargs):
bb2ef2cc
RD
2725 """
2726 GetData(self) -> PyObject
2727
2728 Returns a string containing a copy of the RGB bytes of the image.
2729 """
5b5c9bc7 2730 return _core_.Image_GetData(*args, **kwargs)
d55e5bfc
RD
2731
2732 def SetData(*args, **kwargs):
bb2ef2cc
RD
2733 """
2734 SetData(self, buffer data)
2735
2736 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2737 either a string or a buffer object holding the data and the length of
2738 the data must be width*height*3.
2739 """
5b5c9bc7 2740 return _core_.Image_SetData(*args, **kwargs)
d55e5bfc
RD
2741
2742 def GetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2743 """
2744 GetDataBuffer(self) -> PyObject
2745
2746 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2747 image data buffer inside the wx.Image. You need to ensure that you do
2748 not use this buffer object after the image has been destroyed.
bb2ef2cc 2749 """
5b5c9bc7 2750 return _core_.Image_GetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2751
2752 def SetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2753 """
2754 SetDataBuffer(self, buffer data)
2755
2756 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2757 object. This can save making an extra copy of the data but you must
2758 ensure that the buffer object lives longer than the wx.Image does.
bb2ef2cc 2759 """
5b5c9bc7 2760 return _core_.Image_SetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2761
2762 def GetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2763 """
2764 GetAlphaData(self) -> PyObject
2765
2766 Returns a string containing a copy of the alpha bytes of the image.
2767 """
5b5c9bc7 2768 return _core_.Image_GetAlphaData(*args, **kwargs)
d55e5bfc
RD
2769
2770 def SetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2771 """
2772 SetAlphaData(self, buffer alpha)
2773
2774 Resets the Image's alpha data from a buffer of bytes. Accepts either
2775 a string or a buffer object holding the data and the length of the
2776 data must be width*height.
2777 """
5b5c9bc7 2778 return _core_.Image_SetAlphaData(*args, **kwargs)
d55e5bfc
RD
2779
2780 def GetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
2781 """
2782 GetAlphaBuffer(self) -> PyObject
2783
2784 Returns a writable Python buffer object that is pointing at the Alpha
2785 data buffer inside the wx.Image. You need to ensure that you do not
2786 use this buffer object after the image has been destroyed.
2787 """
5b5c9bc7 2788 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2789
2790 def SetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
2791 """
2792 SetAlphaBuffer(self, buffer alpha)
2793
2794 Sets the internal image alpha pointer to point at a Python buffer
2795 object. This can save making an extra copy of the data but you must
2796 ensure that the buffer object lives as long as the wx.Image does.
2797 """
5b5c9bc7 2798 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2799
2800 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2801 """
2802 SetMaskColour(self, byte r, byte g, byte b)
2803
2804 Sets the mask colour for this image (and tells the image to use the
2805 mask).
2806 """
5b5c9bc7 2807 return _core_.Image_SetMaskColour(*args, **kwargs)
d55e5bfc 2808
aff4cc5c
RD
2809 def GetOrFindMaskColour(*args, **kwargs):
2810 """
2811 GetOrFindMaskColour() -> (r,g,b)
2812
2813 Get the current mask colour or find a suitable colour.
2814 """
5b5c9bc7 2815 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
aff4cc5c 2816
d55e5bfc 2817 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2818 """
2819 GetMaskRed(self) -> byte
2820
2821 Gets the red component of the mask colour.
2822 """
5b5c9bc7 2823 return _core_.Image_GetMaskRed(*args, **kwargs)
d55e5bfc
RD
2824
2825 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2826 """
2827 GetMaskGreen(self) -> byte
2828
2829 Gets the green component of the mask colour.
2830 """
5b5c9bc7 2831 return _core_.Image_GetMaskGreen(*args, **kwargs)
d55e5bfc
RD
2832
2833 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2834 """
2835 GetMaskBlue(self) -> byte
2836
2837 Gets the blue component of the mask colour.
2838 """
5b5c9bc7 2839 return _core_.Image_GetMaskBlue(*args, **kwargs)
d55e5bfc
RD
2840
2841 def SetMask(*args, **kwargs):
7a27cf7c
RD
2842 """
2843 SetMask(self, bool mask=True)
2844
2845 Specifies whether there is a mask or not. The area of the mask is
2846 determined by the current mask colour.
2847 """
5b5c9bc7 2848 return _core_.Image_SetMask(*args, **kwargs)
d55e5bfc
RD
2849
2850 def HasMask(*args, **kwargs):
7a27cf7c
RD
2851 """
2852 HasMask(self) -> bool
2853
2854 Returns ``True`` if there is a mask active, ``False`` otherwise.
2855 """
5b5c9bc7 2856 return _core_.Image_HasMask(*args, **kwargs)
d55e5bfc
RD
2857
2858 def Rotate(*args, **kwargs):
2859 """
5b5c9bc7
RD
2860 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2861 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2862
2863 Rotates the image about the given point, by ``angle`` radians. Passing
2864 ``True`` to ``interpolating`` results in better image quality, but is
2865 slower. If the image has a mask, then the mask colour is used for the
2866 uncovered pixels in the rotated image background. Otherwise, black
2867 will be used as the fill colour.
2868
2869 Returns the rotated image, leaving this image intact.
d55e5bfc 2870 """
5b5c9bc7 2871 return _core_.Image_Rotate(*args, **kwargs)
d55e5bfc
RD
2872
2873 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2874 """
2875 Rotate90(self, bool clockwise=True) -> Image
2876
2877 Returns a copy of the image rotated 90 degrees in the direction
2878 indicated by ``clockwise``.
2879 """
5b5c9bc7 2880 return _core_.Image_Rotate90(*args, **kwargs)
d55e5bfc
RD
2881
2882 def Mirror(*args, **kwargs):
7a27cf7c
RD
2883 """
2884 Mirror(self, bool horizontally=True) -> Image
2885
2886 Returns a mirrored copy of the image. The parameter ``horizontally``
2887 indicates the orientation.
2888 """
5b5c9bc7 2889 return _core_.Image_Mirror(*args, **kwargs)
d55e5bfc
RD
2890
2891 def Replace(*args, **kwargs):
2892 """
7a27cf7c
RD
2893 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2894
2895 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2896 ``(r2,g2,b2)``.
d55e5bfc 2897 """
5b5c9bc7 2898 return _core_.Image_Replace(*args, **kwargs)
d55e5bfc 2899
32fe5131
RD
2900 def ConvertToGreyscale(*args, **kwargs):
2901 """
2902 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2903
2904 Convert to greyscale image. Uses the luminance component (Y) of the
2905 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2906 defaults to ITU-T BT.601
2907 """
2908 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2909
d55e5bfc 2910 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2911 """
2912 ConvertToMono(self, byte r, byte g, byte b) -> Image
2913
2914 Returns monochromatic version of the image. The returned image has
2915 white colour where the original has ``(r,g,b)`` colour and black
2916 colour everywhere else.
2917 """
5b5c9bc7 2918 return _core_.Image_ConvertToMono(*args, **kwargs)
d55e5bfc
RD
2919
2920 def SetOption(*args, **kwargs):
7a27cf7c
RD
2921 """
2922 SetOption(self, String name, String value)
2923
2924 Sets an image handler defined option. For example, when saving as a
2925 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2926 number between 0 and 100 (0 is terrible, 100 is very good).
2927 """
5b5c9bc7 2928 return _core_.Image_SetOption(*args, **kwargs)
d55e5bfc
RD
2929
2930 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2931 """
2932 SetOptionInt(self, String name, int value)
2933
2934 Sets an image option as an integer.
2935 """
5b5c9bc7 2936 return _core_.Image_SetOptionInt(*args, **kwargs)
d55e5bfc
RD
2937
2938 def GetOption(*args, **kwargs):
7a27cf7c
RD
2939 """
2940 GetOption(self, String name) -> String
2941
2942 Gets the value of an image handler option.
2943 """
5b5c9bc7 2944 return _core_.Image_GetOption(*args, **kwargs)
d55e5bfc
RD
2945
2946 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2947 """
2948 GetOptionInt(self, String name) -> int
2949
2950 Gets the value of an image handler option as an integer. If the given
2951 option is not present, the function returns 0.
2952 """
5b5c9bc7 2953 return _core_.Image_GetOptionInt(*args, **kwargs)
d55e5bfc
RD
2954
2955 def HasOption(*args, **kwargs):
7a27cf7c
RD
2956 """
2957 HasOption(self, String name) -> bool
2958
2959 Returns true if the given option is present.
2960 """
5b5c9bc7 2961 return _core_.Image_HasOption(*args, **kwargs)
d55e5bfc
RD
2962
2963 def CountColours(*args, **kwargs):
2964 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
5b5c9bc7 2965 return _core_.Image_CountColours(*args, **kwargs)
d55e5bfc
RD
2966
2967 def ComputeHistogram(*args, **kwargs):
5b5c9bc7
RD
2968 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2969 return _core_.Image_ComputeHistogram(*args, **kwargs)
d55e5bfc
RD
2970
2971 def AddHandler(*args, **kwargs):
5b5c9bc7
RD
2972 """AddHandler(ImageHandler handler)"""
2973 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
2974
2975 AddHandler = staticmethod(AddHandler)
2976 def InsertHandler(*args, **kwargs):
5b5c9bc7
RD
2977 """InsertHandler(ImageHandler handler)"""
2978 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
2979
2980 InsertHandler = staticmethod(InsertHandler)
2981 def RemoveHandler(*args, **kwargs):
5b5c9bc7
RD
2982 """RemoveHandler(String name) -> bool"""
2983 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc
RD
2984
2985 RemoveHandler = staticmethod(RemoveHandler)
1bd55598
RD
2986 def GetHandlers(*args, **kwargs):
2987 """GetHandlers() -> PyObject"""
2988 return _core_.Image_GetHandlers(*args, **kwargs)
2989
2990 GetHandlers = staticmethod(GetHandlers)
d55e5bfc 2991 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2992 """
2993 GetImageExtWildcard() -> String
2994
2995 Iterates all registered wxImageHandler objects, and returns a string
2996 containing file extension masks suitable for passing to file open/save
2997 dialog boxes.
2998 """
5b5c9bc7 2999 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc
RD
3000
3001 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3002 def ConvertToBitmap(*args, **kwargs):
5b5c9bc7
RD
3003 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
3004 return _core_.Image_ConvertToBitmap(*args, **kwargs)
d55e5bfc
RD
3005
3006 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 3007 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
5b5c9bc7 3008 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
d55e5bfc 3009
943e8dfd
RD
3010 def RotateHue(*args, **kwargs):
3011 """
3012 RotateHue(self, double angle)
3013
3014 Rotates the hue of each pixel of the image. Hue is a double in the
3015 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3016 """
3017 return _core_.Image_RotateHue(*args, **kwargs)
3018
3019 def RGBtoHSV(*args, **kwargs):
3020 """
3021 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3022
3023 Converts a color in RGB color space to HSV color space.
3024 """
3025 return _core_.Image_RGBtoHSV(*args, **kwargs)
3026
3027 RGBtoHSV = staticmethod(RGBtoHSV)
3028 def HSVtoRGB(*args, **kwargs):
3029 """
3030 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3031
3032 Converts a color in HSV color space to RGB color space.
3033 """
3034 return _core_.Image_HSVtoRGB(*args, **kwargs)
3035
3036 HSVtoRGB = staticmethod(HSVtoRGB)
d55e5bfc 3037 def __nonzero__(self): return self.Ok()
ac5d357a
RD
3038 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
3039 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
3040 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
3041 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
3042 Height = property(GetHeight,doc="See `GetHeight`")
3043 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
3044 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
3045 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
3046 Size = property(GetSize,doc="See `GetSize`")
3047 Width = property(GetWidth,doc="See `GetWidth`")
2131d850 3048_core_.Image_swigregister(Image)
d55e5bfc
RD
3049
3050def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
3051 """
3052 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3053
3054 Loads an image from a file, using a MIME type string (such as
3055 'image/jpeg') to specify image type.
3056 """
5b5c9bc7 3057 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
3058 return val
3059
3060def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
3061 """
3062 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3063
3064 Loads an image from an input stream, or any readable Python file-like
3065 object.
3066 """
5b5c9bc7 3067 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
3068 return val
3069
3070def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
3071 """
3072 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3073
3074 Loads an image from an input stream, or any readable Python file-like
3075 object, specifying the image format with a MIME type string.
3076 """
5b5c9bc7 3077 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
3078 return val
3079
d6c14a4c 3080def EmptyImage(*args, **kwargs):
bb2ef2cc 3081 """
5b5c9bc7 3082 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
bb2ef2cc
RD
3083
3084 Construct an empty image of a given size, optionally setting all
3085 pixels to black.
3086 """
5b5c9bc7 3087 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
3088 return val
3089
3090def ImageFromBitmap(*args, **kwargs):
bb2ef2cc 3091 """
5b5c9bc7 3092 ImageFromBitmap(Bitmap bitmap) -> Image
bb2ef2cc
RD
3093
3094 Construct an Image from a `wx.Bitmap`.
3095 """
5b5c9bc7 3096 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
3097 return val
3098
3099def ImageFromData(*args, **kwargs):
bb2ef2cc 3100 """
5b5c9bc7 3101 ImageFromData(int width, int height, buffer data) -> Image
bb2ef2cc
RD
3102
3103 Construct an Image from a buffer of RGB bytes. Accepts either a
3104 string or a buffer object holding the data and the length of the data
3105 must be width*height*3.
3106 """
5b5c9bc7 3107 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
3108 return val
3109
03e46024 3110def ImageFromDataWithAlpha(*args, **kwargs):
bb2ef2cc 3111 """
5b5c9bc7 3112 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
bb2ef2cc
RD
3113
3114 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3115 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
3116 length of the data must be width*height*3 bytes, and the length of the
3117 alpha data must be width*height bytes.
bb2ef2cc 3118 """
5b5c9bc7 3119 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
03e46024
RD
3120 return val
3121
5b5c9bc7 3122def Image_CanRead(*args, **kwargs):
1bd55598 3123 """
7a27cf7c
RD
3124 Image_CanRead(String filename) -> bool
3125
3126 Returns True if the image handlers can read this file.
3127 """
1bd55598 3128 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc 3129
5b5c9bc7 3130def Image_GetImageCount(*args, **kwargs):
1bd55598 3131 """
7a27cf7c
RD
3132 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3133
3134 If the image file contains more than one image and the image handler
3135 is capable of retrieving these individually, this function will return
3136 the number of available images.
3137 """
1bd55598 3138 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc 3139
5b5c9bc7 3140def Image_CanReadStream(*args, **kwargs):
1bd55598 3141 """
7a27cf7c
RD
3142 Image_CanReadStream(InputStream stream) -> bool
3143
3144 Returns True if the image handlers can read an image file from the
3145 data currently on the input stream, or a readable Python file-like
3146 object.
3147 """
1bd55598 3148 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc 3149
5b5c9bc7 3150def Image_AddHandler(*args, **kwargs):
1bd55598
RD
3151 """Image_AddHandler(ImageHandler handler)"""
3152 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc 3153
5b5c9bc7 3154def Image_InsertHandler(*args, **kwargs):
1bd55598
RD
3155 """Image_InsertHandler(ImageHandler handler)"""
3156 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc 3157
5b5c9bc7 3158def Image_RemoveHandler(*args, **kwargs):
1bd55598
RD
3159 """Image_RemoveHandler(String name) -> bool"""
3160 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 3161
1bd55598
RD
3162def Image_GetHandlers(*args):
3163 """Image_GetHandlers() -> PyObject"""
3164 return _core_.Image_GetHandlers(*args)
3165
3166def Image_GetImageExtWildcard(*args):
3167 """
7a27cf7c
RD
3168 Image_GetImageExtWildcard() -> String
3169
3170 Iterates all registered wxImageHandler objects, and returns a string
3171 containing file extension masks suitable for passing to file open/save
3172 dialog boxes.
3173 """
1bd55598 3174 return _core_.Image_GetImageExtWildcard(*args)
d55e5bfc 3175
943e8dfd 3176def Image_RGBtoHSV(*args, **kwargs):
1bd55598 3177 """
943e8dfd
RD
3178 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3179
3180 Converts a color in RGB color space to HSV color space.
3181 """
1bd55598 3182 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3183
3184def Image_HSVtoRGB(*args, **kwargs):
1bd55598 3185 """
943e8dfd
RD
3186 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3187
3188 Converts a color in HSV color space to RGB color space.
3189 """
1bd55598 3190 return _core_.Image_HSVtoRGB(*args, **kwargs)
943e8dfd 3191
fc46b7f3
RD
3192
3193def _ImageFromBuffer(*args, **kwargs):
3194 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3195 return _core_._ImageFromBuffer(*args, **kwargs)
3196def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3197 """
3198 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
eec1c382
RD
3199 parameter must be a Python object that implements the buffer interface,
3200 such as a string, array, etc. The dataBuffer object is expected to
3201 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3202 object can optionally be supplied for the image's alpha channel data, and
3203 it is expected to be width*height bytes long.
fc46b7f3
RD
3204
3205 The wx.Image will be created with its data and alpha pointers initialized
3206 to the memory address pointed to by the buffer objects, thus saving the
3207 time needed to copy the image data from the buffer object to the wx.Image.
3208 While this has advantages, it also has the shoot-yourself-in-the-foot
3209 risks associated with sharing a C pointer between two objects.
3210
3211 To help alleviate the risk a reference to the data and alpha buffer
3212 objects are kept with the wx.Image, so that they won't get deleted until
3213 after the wx.Image is deleted. However please be aware that it is not
3214 guaranteed that an object won't move its memory buffer to a new location
3215 when it needs to resize its contents. If that happens then the wx.Image
3216 will end up referring to an invalid memory location and could cause the
3217 application to crash. Therefore care should be taken to not manipulate
3218 the objects used for the data and alpha buffers in a way that would cause
3219 them to change size.
3220 """
fc46b7f3
RD
3221 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3222 image._buffer = dataBuffer
3223 image._alpha = alphaBuffer
3224 return image
3225
68e533f8
RD
3226def InitAllImageHandlers():
3227 """
3228 The former functionality of InitAllImageHanders is now done internal to
3229 the _core_ extension module and so this function has become a simple NOP.
3230 """
3231 pass
d55e5bfc 3232
5b5c9bc7
RD
3233IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3234IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3235PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3236PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3237PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3238BMP_24BPP = _core_.BMP_24BPP
3239BMP_8BPP = _core_.BMP_8BPP
3240BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3241BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3242BMP_8BPP_RED = _core_.BMP_8BPP_RED
3243BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3244BMP_4BPP = _core_.BMP_4BPP
3245BMP_1BPP = _core_.BMP_1BPP
3246BMP_1BPP_BW = _core_.BMP_1BPP_BW
3247class BMPHandler(ImageHandler):
27fb7603 3248 """A `wx.ImageHandler` for \*.bmp bitmap files."""
1bd55598
RD
3249 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3250 __repr__ = _swig_repr
3251 def __init__(self, *args, **kwargs):
27fb7603
RD
3252 """
3253 __init__(self) -> BMPHandler
3254
3255 A `wx.ImageHandler` for \*.bmp bitmap files.
3256 """
1bd55598 3257 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3258_core_.BMPHandler_swigregister(BMPHandler)
5b5c9bc7 3259NullImage = cvar.NullImage
68350608 3260IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3261IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3262IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3263IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3264IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3265IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3266IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3267IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3268IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3269IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3270IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3271IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3272IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
7fbf8399
RD
3273IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3274IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc 3275
5b5c9bc7 3276class ICOHandler(BMPHandler):
27fb7603 3277 """A `wx.ImageHandler` for \*.ico icon files."""
1bd55598
RD
3278 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3279 __repr__ = _swig_repr
3280 def __init__(self, *args, **kwargs):
27fb7603
RD
3281 """
3282 __init__(self) -> ICOHandler
3283
3284 A `wx.ImageHandler` for \*.ico icon files.
3285 """
1bd55598 3286 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3287_core_.ICOHandler_swigregister(ICOHandler)
d55e5bfc 3288
5b5c9bc7 3289class CURHandler(ICOHandler):
27fb7603 3290 """A `wx.ImageHandler` for \*.cur cursor files."""
1bd55598
RD
3291 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3292 __repr__ = _swig_repr
3293 def __init__(self, *args, **kwargs):
27fb7603
RD
3294 """
3295 __init__(self) -> CURHandler
3296
3297 A `wx.ImageHandler` for \*.cur cursor files.
3298 """
1bd55598 3299 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3300_core_.CURHandler_swigregister(CURHandler)
d55e5bfc 3301
5b5c9bc7 3302class ANIHandler(CURHandler):
27fb7603 3303 """A `wx.ImageHandler` for \*.ani animated cursor files."""
1bd55598
RD
3304 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3305 __repr__ = _swig_repr
3306 def __init__(self, *args, **kwargs):
27fb7603
RD
3307 """
3308 __init__(self) -> ANIHandler
3309
3310 A `wx.ImageHandler` for \*.ani animated cursor files.
3311 """
1bd55598 3312 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3313_core_.ANIHandler_swigregister(ANIHandler)
d55e5bfc 3314
5b5c9bc7 3315class PNGHandler(ImageHandler):
27fb7603 3316 """A `wx.ImageHandler` for PNG image files."""
1bd55598
RD
3317 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3318 __repr__ = _swig_repr
3319 def __init__(self, *args, **kwargs):
27fb7603
RD
3320 """
3321 __init__(self) -> PNGHandler
3322
3323 A `wx.ImageHandler` for PNG image files.
3324 """
1bd55598 3325 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3326_core_.PNGHandler_swigregister(PNGHandler)
d55e5bfc 3327
5b5c9bc7 3328class GIFHandler(ImageHandler):
27fb7603 3329 """A `wx.ImageHandler` for GIF image files."""
1bd55598
RD
3330 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3331 __repr__ = _swig_repr
3332 def __init__(self, *args, **kwargs):
27fb7603
RD
3333 """
3334 __init__(self) -> GIFHandler
3335
3336 A `wx.ImageHandler` for GIF image files.
3337 """
1bd55598 3338 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3339_core_.GIFHandler_swigregister(GIFHandler)
d55e5bfc 3340
5b5c9bc7 3341class PCXHandler(ImageHandler):
27fb7603 3342 """A `wx.ImageHandler` for PCX imager files."""
1bd55598
RD
3343 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3344 __repr__ = _swig_repr
3345 def __init__(self, *args, **kwargs):
27fb7603
RD
3346 """
3347 __init__(self) -> PCXHandler
3348
3349 A `wx.ImageHandler` for PCX imager files.
3350 """
1bd55598 3351 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3352_core_.PCXHandler_swigregister(PCXHandler)
d55e5bfc 3353
5b5c9bc7 3354class JPEGHandler(ImageHandler):
27fb7603 3355 """A `wx.ImageHandler` for JPEG/JPG image files."""
1bd55598
RD
3356 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3357 __repr__ = _swig_repr
3358 def __init__(self, *args, **kwargs):
27fb7603
RD
3359 """
3360 __init__(self) -> JPEGHandler
3361
3362 A `wx.ImageHandler` for JPEG/JPG image files.
3363 """
1bd55598 3364 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3365_core_.JPEGHandler_swigregister(JPEGHandler)
d55e5bfc 3366
5b5c9bc7 3367class PNMHandler(ImageHandler):
27fb7603 3368 """A `wx.ImageHandler` for PNM image files."""
1bd55598
RD
3369 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3370 __repr__ = _swig_repr
3371 def __init__(self, *args, **kwargs):
27fb7603
RD
3372 """
3373 __init__(self) -> PNMHandler
3374
3375 A `wx.ImageHandler` for PNM image files.
3376 """
1bd55598 3377 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3378_core_.PNMHandler_swigregister(PNMHandler)
d55e5bfc 3379
5b5c9bc7 3380class XPMHandler(ImageHandler):
27fb7603 3381 """A `wx.ImageHandler` for XPM image."""
1bd55598
RD
3382 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3383 __repr__ = _swig_repr
3384 def __init__(self, *args, **kwargs):
27fb7603
RD
3385 """
3386 __init__(self) -> XPMHandler
3387
3388 A `wx.ImageHandler` for XPM image.
3389 """
1bd55598 3390 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3391_core_.XPMHandler_swigregister(XPMHandler)
d55e5bfc 3392
5b5c9bc7 3393class TIFFHandler(ImageHandler):
27fb7603 3394 """A `wx.ImageHandler` for TIFF image files."""
1bd55598
RD
3395 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3396 __repr__ = _swig_repr
3397 def __init__(self, *args, **kwargs):
27fb7603
RD
3398 """
3399 __init__(self) -> TIFFHandler
3400
3401 A `wx.ImageHandler` for TIFF image files.
3402 """
1bd55598 3403 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3404_core_.TIFFHandler_swigregister(TIFFHandler)
d55e5bfc 3405
5b5c9bc7
RD
3406QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3407QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3408class Quantize(object):
c0de73ae 3409 """Performs quantization, or colour reduction, on a wxImage."""
1bd55598
RD
3410 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3411 def __init__(self): raise AttributeError, "No constructor defined"
3412 __repr__ = _swig_repr
c0de73ae
RD
3413 def Quantize(*args, **kwargs):
3414 """
5b5c9bc7 3415 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3416
3417 Reduce the colours in the source image and put the result into the
3418 destination image, setting the palette in the destination if
3419 needed. Both images may be the same, to overwrite the source image.
3420 """
5b5c9bc7 3421 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae
RD
3422
3423 Quantize = staticmethod(Quantize)
2131d850 3424_core_.Quantize_swigregister(Quantize)
c0de73ae 3425
5b5c9bc7 3426def Quantize_Quantize(*args, **kwargs):
1bd55598 3427 """
5b5c9bc7 3428 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3429
3430 Reduce the colours in the source image and put the result into the
3431 destination image, setting the palette in the destination if
3432 needed. Both images may be the same, to overwrite the source image.
3433 """
1bd55598 3434 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3435
d55e5bfc
RD
3436#---------------------------------------------------------------------------
3437
5b5c9bc7
RD
3438class EvtHandler(Object):
3439 """Proxy of C++ EvtHandler class"""
1bd55598
RD
3440 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3441 __repr__ = _swig_repr
3442 def __init__(self, *args, **kwargs):
5b5c9bc7 3443 """__init__(self) -> EvtHandler"""
1bd55598 3444 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d49bdf34
RD
3445 self._setOORInfo(self)
3446
d55e5bfc 3447 def GetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3448 """GetNextHandler(self) -> EvtHandler"""
3449 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
d55e5bfc
RD
3450
3451 def GetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3452 """GetPreviousHandler(self) -> EvtHandler"""
3453 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3454
3455 def SetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3456 """SetNextHandler(self, EvtHandler handler)"""
3457 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
d55e5bfc
RD
3458
3459 def SetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3460 """SetPreviousHandler(self, EvtHandler handler)"""
3461 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3462
3463 def GetEvtHandlerEnabled(*args, **kwargs):
3464 """GetEvtHandlerEnabled(self) -> bool"""
5b5c9bc7 3465 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3466
3467 def SetEvtHandlerEnabled(*args, **kwargs):
3468 """SetEvtHandlerEnabled(self, bool enabled)"""
5b5c9bc7 3469 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3470
3471 def ProcessEvent(*args, **kwargs):
5b5c9bc7
RD
3472 """ProcessEvent(self, Event event) -> bool"""
3473 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
d55e5bfc
RD
3474
3475 def AddPendingEvent(*args, **kwargs):
5b5c9bc7
RD
3476 """AddPendingEvent(self, Event event)"""
3477 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
d55e5bfc
RD
3478
3479 def ProcessPendingEvents(*args, **kwargs):
3480 """ProcessPendingEvents(self)"""
5b5c9bc7 3481 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
3482
3483 def Connect(*args, **kwargs):
3484 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
5b5c9bc7 3485 return _core_.EvtHandler_Connect(*args, **kwargs)
d55e5bfc
RD
3486
3487 def Disconnect(*args, **kwargs):
2131d850 3488 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
5b5c9bc7 3489 return _core_.EvtHandler_Disconnect(*args, **kwargs)
d55e5bfc
RD
3490
3491 def _setOORInfo(*args, **kwargs):
36ed4f51 3492 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3493 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3494 args[0].thisown = 0
3495 return val
d55e5bfc
RD
3496
3497 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3498 """
3499 Bind an event to an event handler.
3500
a5ee0656
RD
3501 :param event: One of the EVT_* objects that specifies the
3502 type of event to bind,
d55e5bfc 3503
a5ee0656
RD
3504 :param handler: A callable object to be invoked when the
3505 event is delivered to self. Pass None to
3506 disconnect an event handler.
d55e5bfc 3507
a5ee0656
RD
3508 :param source: Sometimes the event originates from a
3509 different window than self, but you still
3510 want to catch it in self. (For example, a
3511 button event delivered to a frame.) By
3512 passing the source of the event, the event
3513 handling system is able to differentiate
3514 between the same event type from different
3515 controls.
d55e5bfc 3516
a5ee0656
RD
3517 :param id: Used to spcify the event source by ID instead
3518 of instance.
3519
3520 :param id2: Used when it is desirable to bind a handler
3521 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3522 """
3523 if source is not None:
3524 id = source.GetId()
3525 event.Bind(self, id, id2, handler)
3526
d6c14a4c
RD
3527 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3528 """
3529 Disconencts the event handler binding for event from self.
3530 Returns True if successful.
3531 """
3532 if source is not None:
3533 id = source.GetId()
3534 return event.Unbind(self, id, id2)
d55e5bfc 3535
ac5d357a
RD
3536 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3537 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3538 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
2131d850 3539_core_.EvtHandler_swigregister(EvtHandler)
d55e5bfc
RD
3540
3541#---------------------------------------------------------------------------
3542
3543class PyEventBinder(object):
3544 """
3545 Instances of this class are used to bind specific events to event
3546 handlers.
3547 """
3548 def __init__(self, evtType, expectedIDs=0):
3549 if expectedIDs not in [0, 1, 2]:
3550 raise ValueError, "Invalid number of expectedIDs"
3551 self.expectedIDs = expectedIDs
3552
3553 if type(evtType) == list or type(evtType) == tuple:
3554 self.evtType = evtType
3555 else:
3556 self.evtType = [evtType]
3557
3558
3559 def Bind(self, target, id1, id2, function):
3560 """Bind this set of event types to target."""
3561 for et in self.evtType:
3562 target.Connect(id1, id2, et, function)
3563
d6c14a4c
RD
3564
3565 def Unbind(self, target, id1, id2):
3566 """Remove an event binding."""
3567 success = 0
3568 for et in self.evtType:
3569 success += target.Disconnect(id1, id2, et)
3570 return success != 0
3571
d55e5bfc
RD
3572
3573 def __call__(self, *args):
3574 """
3575 For backwards compatibility with the old EVT_* functions.
3576 Should be called with either (window, func), (window, ID,
3577 func) or (window, ID1, ID2, func) parameters depending on the
3578 type of the event.
3579 """
3580 assert len(args) == 2 + self.expectedIDs
3581 id1 = wx.ID_ANY
3582 id2 = wx.ID_ANY
3583 target = args[0]
3584 if self.expectedIDs == 0:
3585 func = args[1]
3586 elif self.expectedIDs == 1:
3587 id1 = args[1]
3588 func = args[2]
3589 elif self.expectedIDs == 2:
3590 id1 = args[1]
3591 id2 = args[2]
3592 func = args[3]
3593 else:
3594 raise ValueError, "Unexpected number of IDs"
3595
3596 self.Bind(target, id1, id2, func)
3597
3598
3599# These two are square pegs that don't fit the PyEventBinder hole...
3600def EVT_COMMAND(win, id, cmd, func):
3601 win.Connect(id, -1, cmd, func)
3602def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3603 win.Connect(id1, id2, cmd, func)
3604
3605
3606#---------------------------------------------------------------------------
3607
3608#---------------------------------------------------------------------------
3609
5b5c9bc7
RD
3610EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3611EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3612
1bd55598 3613def NewEventType(*args):
2131d850 3614 """NewEventType() -> EventType"""
1bd55598 3615 return _core_.NewEventType(*args)
5b5c9bc7
RD
3616wxEVT_NULL = _core_.wxEVT_NULL
3617wxEVT_FIRST = _core_.wxEVT_FIRST
3618wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3619wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3620wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3621wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3622wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3623wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3624wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3625wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3626wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3627wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3628wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3629wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3630wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3631wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3632wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3633wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3634wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3635wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3636wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3637wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3638wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3639wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3640wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3641wxEVT_MOTION = _core_.wxEVT_MOTION
3642wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3643wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3644wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3645wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3646wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3647wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3648wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3649wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3650wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3651wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3652wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3653wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3654wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3655wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3656wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3657wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3658wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3659wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3660wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3661wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3662wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3663wxEVT_CHAR = _core_.wxEVT_CHAR
3664wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3665wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3666wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3667wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3668wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3669wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3670wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3671wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3672wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3673wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3674wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3675wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3676wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3677wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3678wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3679wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
5b5c9bc7
RD
3680wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3681wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3682wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3683wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3684wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3685wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3686wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3687wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3688wxEVT_SIZE = _core_.wxEVT_SIZE
3689wxEVT_MOVE = _core_.wxEVT_MOVE
3690wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3691wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3692wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3693wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
5b5c9bc7
RD
3694wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3695wxEVT_CREATE = _core_.wxEVT_CREATE
3696wxEVT_DESTROY = _core_.wxEVT_DESTROY
3697wxEVT_SHOW = _core_.wxEVT_SHOW
3698wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3699wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3700wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
34e0a3bb 3701wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
5b5c9bc7
RD
3702wxEVT_PAINT = _core_.wxEVT_PAINT
3703wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3704wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3705wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3706wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3707wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3708wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3709wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3710wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3711wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3712wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3713wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3714wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3715wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3716wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3717wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3718wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3719wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3720wxEVT_IDLE = _core_.wxEVT_IDLE
3721wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3722wxEVT_SIZING = _core_.wxEVT_SIZING
3723wxEVT_MOVING = _core_.wxEVT_MOVING
3724wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
3725wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3726wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3727wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
5b5c9bc7
RD
3728wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3729wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3730wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3731wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3732wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3733wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3734wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d55e5bfc
RD
3735#
3736# Create some event binders
3737EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3738EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3739EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3740EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3741EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3742EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3743EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3744EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3745EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3746EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3747EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3748EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3749EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 3750EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d55e5bfc
RD
3751EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3752EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3753EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3754EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3755EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3756EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3757EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3758EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3759EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3760EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 3761EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3762EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3763EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3764EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3765EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3766EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3767EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3768EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3769EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3770EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3771EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3772EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3773EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3774EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3775EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3776EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3777EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
34e0a3bb 3778EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
d55e5bfc
RD
3779
3780EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3781EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3782EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3783EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3784EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3785EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3786EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3787EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3788EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3789EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3790EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3791EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3792EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3793
3794EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3795 wxEVT_LEFT_UP,
3796 wxEVT_MIDDLE_DOWN,
3797 wxEVT_MIDDLE_UP,
3798 wxEVT_RIGHT_DOWN,
3799 wxEVT_RIGHT_UP,
3800 wxEVT_MOTION,
3801 wxEVT_LEFT_DCLICK,
3802 wxEVT_MIDDLE_DCLICK,
3803 wxEVT_RIGHT_DCLICK,
3804 wxEVT_ENTER_WINDOW,
3805 wxEVT_LEAVE_WINDOW,
3806 wxEVT_MOUSEWHEEL
3807 ])
3808
3809
3810# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 3811EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d55e5bfc
RD
3812 wxEVT_SCROLLWIN_BOTTOM,
3813 wxEVT_SCROLLWIN_LINEUP,
3814 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 3815 wxEVT_SCROLLWIN_PAGEUP,
d55e5bfc
RD
3816 wxEVT_SCROLLWIN_PAGEDOWN,
3817 wxEVT_SCROLLWIN_THUMBTRACK,
3818 wxEVT_SCROLLWIN_THUMBRELEASE,
3819 ])
3820
3821EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3822EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3823EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3824EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3825EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3826EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3827EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3828EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3829
27fb7603 3830# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
3831EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3832 wxEVT_SCROLL_BOTTOM,
3833 wxEVT_SCROLL_LINEUP,
3834 wxEVT_SCROLL_LINEDOWN,
3835 wxEVT_SCROLL_PAGEUP,
3836 wxEVT_SCROLL_PAGEDOWN,
3837 wxEVT_SCROLL_THUMBTRACK,
3838 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3839 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3840 ])
3841
3842EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3843EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3844EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3845EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3846EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3847EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3848EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3849EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3850EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3851EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 3852
27fb7603 3853# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
3854EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3855 wxEVT_SCROLL_BOTTOM,
3856 wxEVT_SCROLL_LINEUP,
3857 wxEVT_SCROLL_LINEDOWN,
3858 wxEVT_SCROLL_PAGEUP,
3859 wxEVT_SCROLL_PAGEDOWN,
3860 wxEVT_SCROLL_THUMBTRACK,
d55e5bfc 3861 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3862 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3863 ], 1)
3864
3865EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3866EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3867EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3868EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3869EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3870EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3871EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3872EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3873EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3874EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
3875
3876EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3877EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3878EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3879EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3880EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3881EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3882EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3883EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3884EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3885EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3886
3887EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3888EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3889EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3890EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3891EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3892EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3893EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3894EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3895EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3896
3897
3898EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3899EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3900EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3901EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3902EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3903EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3904EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3905
3906EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3907
3908EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3909EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3910
3911EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3912
2131d850
RD
3913EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3914EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3915EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d55e5bfc
RD
3916
3917
3918#---------------------------------------------------------------------------
3919
5b5c9bc7 3920class Event(Object):
27fb7603
RD
3921 """
3922 An event is a structure holding information about an event passed to a
3923 callback or member function. wx.Event is an abstract base class for
3924 other event classes
3925 """
1bd55598
RD
3926 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3927 def __init__(self): raise AttributeError, "No constructor defined"
3928 __repr__ = _swig_repr
3929 __swig_destroy__ = _core_.delete_Event
3930 __del__ = lambda self : None;
d55e5bfc 3931 def SetEventType(*args, **kwargs):
27fb7603 3932 """
2131d850 3933 SetEventType(self, EventType typ)
27fb7603
RD
3934
3935 Sets the specific type of the event.
3936 """
5b5c9bc7 3937 return _core_.Event_SetEventType(*args, **kwargs)
d55e5bfc
RD
3938
3939 def GetEventType(*args, **kwargs):
27fb7603 3940 """
2131d850 3941 GetEventType(self) -> EventType
27fb7603
RD
3942
3943 Returns the identifier of the given event type, such as
3944 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3945 """
5b5c9bc7 3946 return _core_.Event_GetEventType(*args, **kwargs)
d55e5bfc
RD
3947
3948 def GetEventObject(*args, **kwargs):
27fb7603
RD
3949 """
3950 GetEventObject(self) -> Object
3951
3952 Returns the object (usually a window) associated with the event, if
3953 any.
3954 """
5b5c9bc7 3955 return _core_.Event_GetEventObject(*args, **kwargs)
d55e5bfc
RD
3956
3957 def SetEventObject(*args, **kwargs):
27fb7603
RD
3958 """
3959 SetEventObject(self, Object obj)
3960
3961 Sets the originating object, or in other words, obj is normally the
3962 object that is sending the event.
3963 """
5b5c9bc7 3964 return _core_.Event_SetEventObject(*args, **kwargs)
d55e5bfc
RD
3965
3966 def GetTimestamp(*args, **kwargs):
3967 """GetTimestamp(self) -> long"""
5b5c9bc7 3968 return _core_.Event_GetTimestamp(*args, **kwargs)
d55e5bfc
RD
3969
3970 def SetTimestamp(*args, **kwargs):
3971 """SetTimestamp(self, long ts=0)"""
5b5c9bc7 3972 return _core_.Event_SetTimestamp(*args, **kwargs)
d55e5bfc
RD
3973
3974 def GetId(*args, **kwargs):
27fb7603
RD
3975 """
3976 GetId(self) -> int
3977
3978 Returns the identifier associated with this event, such as a button
3979 command id.
3980 """
5b5c9bc7 3981 return _core_.Event_GetId(*args, **kwargs)
d55e5bfc
RD
3982
3983 def SetId(*args, **kwargs):
27fb7603
RD
3984 """
3985 SetId(self, int Id)
3986
3987 Set's the ID for the event. This is usually the ID of the window that
3988 is sending the event, but it can also be a command id from a menu
3989 item, etc.
3990 """
5b5c9bc7 3991 return _core_.Event_SetId(*args, **kwargs)
d55e5bfc
RD
3992
3993 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
3994 """
3995 IsCommandEvent(self) -> bool
3996
3997 Returns true if the event is or is derived from `wx.CommandEvent` else
3998 it returns false. Note: Exists only for optimization purposes.
3999 """
5b5c9bc7 4000 return _core_.Event_IsCommandEvent(*args, **kwargs)
d55e5bfc
RD
4001
4002 def Skip(*args, **kwargs):
51b83b37
RD
4003 """
4004 Skip(self, bool skip=True)
4005
4006 Called by an event handler, it controls whether additional event
4007 handlers bound to this event will be called after the current event
4008 handler returns. Skip(false) (the default setting) will prevent
4009 additional event handlers from being called and control will be
4010 returned to the sender of the event immediately after the current
4011 handler has finished. Skip(True) will cause the event processing
4012 system to continue searching for a handler function for this event.
4013
4014 """
5b5c9bc7 4015 return _core_.Event_Skip(*args, **kwargs)
d55e5bfc
RD
4016
4017 def GetSkipped(*args, **kwargs):
27fb7603
RD
4018 """
4019 GetSkipped(self) -> bool
4020
4021 Returns true if the event handler should be skipped, false otherwise.
4022 :see: `Skip`
4023 """
5b5c9bc7 4024 return _core_.Event_GetSkipped(*args, **kwargs)
d55e5bfc
RD
4025
4026 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
4027 """
4028 ShouldPropagate(self) -> bool
4029
4030 Test if this event should be propagated to the parent window or not,
4031 i.e. if the propagation level is currently greater than 0.
4032 """
5b5c9bc7 4033 return _core_.Event_ShouldPropagate(*args, **kwargs)
d55e5bfc
RD
4034
4035 def StopPropagation(*args, **kwargs):
27fb7603
RD
4036 """
4037 StopPropagation(self) -> int
4038
4039 Stop the event from propagating to its parent window. Returns the old
4040 propagation level value which may be later passed to
4041 `ResumePropagation` to allow propagating the event again.
4042 """
5b5c9bc7 4043 return _core_.Event_StopPropagation(*args, **kwargs)
d55e5bfc
RD
4044
4045 def ResumePropagation(*args, **kwargs):
27fb7603
RD
4046 """
4047 ResumePropagation(self, int propagationLevel)
4048
4049 Resume the event propagation by restoring the propagation level. (For
4050 example, you can use the value returned by an earlier call to
4051 `StopPropagation`.)
4052
4053 """
5b5c9bc7 4054 return _core_.Event_ResumePropagation(*args, **kwargs)
d55e5bfc
RD
4055
4056 def Clone(*args, **kwargs):
5b5c9bc7
RD
4057 """Clone(self) -> Event"""
4058 return _core_.Event_Clone(*args, **kwargs)
d55e5bfc 4059
ac5d357a
RD
4060 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
4061 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
4062 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
4063 Skipped = property(GetSkipped,doc="See `GetSkipped`")
4064 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
2131d850 4065_core_.Event_swigregister(Event)
d55e5bfc
RD
4066
4067#---------------------------------------------------------------------------
4068
5b5c9bc7 4069class PropagationDisabler(object):
27fb7603
RD
4070 """
4071 Helper class to temporarily change an event not to propagate. Simply
4072 create an instance of this class and then whe it is destroyed the
4073 propogation of the event will be restored.
4074 """
1bd55598
RD
4075 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4076 __repr__ = _swig_repr
4077 def __init__(self, *args, **kwargs):
27fb7603
RD
4078 """
4079 __init__(self, Event event) -> PropagationDisabler
4080
4081 Helper class to temporarily change an event not to propagate. Simply
4082 create an instance of this class and then whe it is destroyed the
4083 propogation of the event will be restored.
4084 """
1bd55598
RD
4085 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
4086 __swig_destroy__ = _core_.delete_PropagationDisabler
4087 __del__ = lambda self : None;
2131d850 4088_core_.PropagationDisabler_swigregister(PropagationDisabler)
d55e5bfc 4089
5b5c9bc7 4090class PropagateOnce(object):
27fb7603
RD
4091 """
4092 A helper class that will temporarily lower propagation level of an
4093 event. Simply create an instance of this class and then whe it is
4094 destroyed the propogation of the event will be restored.
4095 """
1bd55598
RD
4096 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4097 __repr__ = _swig_repr
4098 def __init__(self, *args, **kwargs):
27fb7603
RD
4099 """
4100 __init__(self, Event event) -> PropagateOnce
4101
4102 A helper class that will temporarily lower propagation level of an
4103 event. Simply create an instance of this class and then whe it is
4104 destroyed the propogation of the event will be restored.
4105 """
1bd55598
RD
4106 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4107 __swig_destroy__ = _core_.delete_PropagateOnce
4108 __del__ = lambda self : None;
2131d850 4109_core_.PropagateOnce_swigregister(PropagateOnce)
d55e5bfc
RD
4110
4111#---------------------------------------------------------------------------
4112
5b5c9bc7 4113class CommandEvent(Event):
27fb7603
RD
4114 """
4115 This event class contains information about command events, which
4116 originate from a variety of simple controls, as well as menus and
4117 toolbars.
4118 """
1bd55598
RD
4119 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4120 __repr__ = _swig_repr
4121 def __init__(self, *args, **kwargs):
27fb7603 4122 """
2131d850 4123 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
4124
4125 This event class contains information about command events, which
4126 originate from a variety of simple controls, as well as menus and
4127 toolbars.
4128 """
1bd55598 4129 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
d55e5bfc 4130 def GetSelection(*args, **kwargs):
27fb7603
RD
4131 """
4132 GetSelection(self) -> int
4133
4134 Returns item index for a listbox or choice selection event (not valid
4135 for a deselection).
4136 """
5b5c9bc7 4137 return _core_.CommandEvent_GetSelection(*args, **kwargs)
d55e5bfc
RD
4138
4139 def SetString(*args, **kwargs):
5b5c9bc7
RD
4140 """SetString(self, String s)"""
4141 return _core_.CommandEvent_SetString(*args, **kwargs)
d55e5bfc
RD
4142
4143 def GetString(*args, **kwargs):
27fb7603
RD
4144 """
4145 GetString(self) -> String
4146
4147 Returns item string for a listbox or choice selection event (not valid
4148 for a deselection).
4149 """
5b5c9bc7 4150 return _core_.CommandEvent_GetString(*args, **kwargs)
d55e5bfc
RD
4151
4152 def IsChecked(*args, **kwargs):
27fb7603
RD
4153 """
4154 IsChecked(self) -> bool
4155
4156 This method can be used with checkbox and menu events: for the
4157 checkboxes, the method returns true for a selection event and false
4158 for a deselection one. For the menu events, this method indicates if
4159 the menu item just has become checked or unchecked (and thus only
4160 makes sense for checkable menu items).
4161 """
5b5c9bc7 4162 return _core_.CommandEvent_IsChecked(*args, **kwargs)
d55e5bfc
RD
4163
4164 Checked = IsChecked
4165 def IsSelection(*args, **kwargs):
27fb7603
RD
4166 """
4167 IsSelection(self) -> bool
4168
4169 For a listbox or similar event, returns true if it is a selection,
4170 false if it is a deselection.
4171 """
5b5c9bc7 4172 return _core_.CommandEvent_IsSelection(*args, **kwargs)
d55e5bfc
RD
4173
4174 def SetExtraLong(*args, **kwargs):
4175 """SetExtraLong(self, long extraLong)"""
5b5c9bc7 4176 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
d55e5bfc
RD
4177
4178 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4179 """
4180 GetExtraLong(self) -> long
4181
5ba5649b
RD
4182 Returns extra information dependant on the event objects type. If the
4183 event comes from a listbox selection, it is a boolean determining
4184 whether the event was a selection (true) or a deselection (false). A
4185 listbox deselection only occurs for multiple-selection boxes, and in
4186 this case the index and string values are indeterminate and the
4187 listbox must be examined by the application.
27fb7603 4188 """
5b5c9bc7 4189 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
d55e5bfc
RD
4190
4191 def SetInt(*args, **kwargs):
4192 """SetInt(self, int i)"""
5b5c9bc7 4193 return _core_.CommandEvent_SetInt(*args, **kwargs)
d55e5bfc
RD
4194
4195 def GetInt(*args, **kwargs):
27fb7603 4196 """
2131d850 4197 GetInt(self) -> int
27fb7603 4198
5ba5649b
RD
4199 Returns the integer identifier corresponding to a listbox, choice or
4200 radiobox selection (only if the event was a selection, not a
4201 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4202 """
5b5c9bc7 4203 return _core_.CommandEvent_GetInt(*args, **kwargs)
d55e5bfc 4204
1bd55598
RD
4205 def GetClientData(*args, **kwargs):
4206 """
4207 GetClientData(self) -> PyObject
4208
4209 Returns the client data object for a listbox or choice selection event, (if any.)
4210 """
4211 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4212
4213 def SetClientData(*args, **kwargs):
4214 """
4215 SetClientData(self, PyObject clientData)
4216
4217 Associate the given client data with the item at position n.
4218 """
4219 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4220
4221 GetClientObject = GetClientData
4222 SetClientObject = SetClientData
4223
d55e5bfc 4224 def Clone(*args, **kwargs):
5b5c9bc7
RD
4225 """Clone(self) -> Event"""
4226 return _core_.CommandEvent_Clone(*args, **kwargs)
d55e5bfc 4227
2bf58437
RD
4228 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4229 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4230 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4231 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4232 Selection = property(GetSelection,doc="See `GetSelection`")
4233 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
2131d850 4234_core_.CommandEvent_swigregister(CommandEvent)
d55e5bfc
RD
4235
4236#---------------------------------------------------------------------------
4237
5b5c9bc7 4238class NotifyEvent(CommandEvent):
27fb7603
RD
4239 """
4240 An instance of this class (or one of its derived classes) is sent from
4241 a control when the control's state is being changed and the control
4242 allows that change to be prevented from happening. The event handler
4243 can call `Veto` or `Allow` to tell the control what to do.
4244 """
1bd55598
RD
4245 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4246 __repr__ = _swig_repr
4247 def __init__(self, *args, **kwargs):
27fb7603 4248 """
2131d850 4249 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4250
4251 An instance of this class (or one of its derived classes) is sent from
4252 a control when the control's state is being changed and the control
4253 allows that change to be prevented from happening. The event handler
4254 can call `Veto` or `Allow` to tell the control what to do.
4255 """
1bd55598 4256 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
d55e5bfc 4257 def Veto(*args, **kwargs):
27fb7603
RD
4258 """
4259 Veto(self)
4260
4261 Prevents the change announced by this event from happening.
4262
4263 It is in general a good idea to notify the user about the reasons for
4264 vetoing the change because otherwise the applications behaviour (which
4265 just refuses to do what the user wants) might be quite surprising.
4266 """
5b5c9bc7 4267 return _core_.NotifyEvent_Veto(*args, **kwargs)
d55e5bfc
RD
4268
4269 def Allow(*args, **kwargs):
27fb7603
RD
4270 """
4271 Allow(self)
4272
4273 This is the opposite of `Veto`: it explicitly allows the event to be
4274 processed. For most events it is not necessary to call this method as
4275 the events are allowed anyhow but some are forbidden by default (this
4276 will be mentioned in the corresponding event description).
4277 """
5b5c9bc7 4278 return _core_.NotifyEvent_Allow(*args, **kwargs)
d55e5bfc
RD
4279
4280 def IsAllowed(*args, **kwargs):
27fb7603
RD
4281 """
4282 IsAllowed(self) -> bool
4283
4284 Returns true if the change is allowed (`Veto` hasn't been called) or
4285 false otherwise (if it was).
4286 """
5b5c9bc7 4287 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
d55e5bfc 4288
2131d850 4289_core_.NotifyEvent_swigregister(NotifyEvent)
d55e5bfc
RD
4290
4291#---------------------------------------------------------------------------
4292
5b5c9bc7 4293class ScrollEvent(CommandEvent):
27fb7603
RD
4294 """
4295 A scroll event holds information about events sent from stand-alone
4296 scrollbars and sliders. Note that scrolled windows do not send
4297 instnaces of this event class, but send the `wx.ScrollWinEvent`
4298 instead.
4299 """
1bd55598
RD
4300 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4301 __repr__ = _swig_repr
4302 def __init__(self, *args, **kwargs):
d55e5bfc 4303 """
2131d850 4304 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
5b5c9bc7 4305 int orient=0) -> ScrollEvent
d55e5bfc 4306 """
1bd55598 4307 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
d55e5bfc 4308 def GetOrientation(*args, **kwargs):
27fb7603
RD
4309 """
4310 GetOrientation(self) -> int
4311
4312 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4313 the scrollbar.
4314 """
5b5c9bc7 4315 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4316
4317 def GetPosition(*args, **kwargs):
27fb7603
RD
4318 """
4319 GetPosition(self) -> int
4320
4321 Returns the position of the scrollbar.
4322 """
5b5c9bc7 4323 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4324
4325 def SetOrientation(*args, **kwargs):
4326 """SetOrientation(self, int orient)"""
5b5c9bc7 4327 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4328
4329 def SetPosition(*args, **kwargs):
4330 """SetPosition(self, int pos)"""
5b5c9bc7 4331 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
d55e5bfc 4332
33d6fd3b
RD
4333 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4334 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4335_core_.ScrollEvent_swigregister(ScrollEvent)
d55e5bfc
RD
4336
4337#---------------------------------------------------------------------------
4338
5b5c9bc7 4339class ScrollWinEvent(Event):
27fb7603
RD
4340 """
4341 A wx.ScrollWinEvent holds information about scrolling and is sent from
4342 scrolling windows.
4343 """
1bd55598
RD
4344 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4345 __repr__ = _swig_repr
4346 def __init__(self, *args, **kwargs):
27fb7603 4347 """
2131d850 4348 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4349
4350 A wx.ScrollWinEvent holds information about scrolling and is sent from
4351 scrolling windows.
4352 """
1bd55598 4353 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
d55e5bfc 4354 def GetOrientation(*args, **kwargs):
27fb7603
RD
4355 """
4356 GetOrientation(self) -> int
4357
4358 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4359 the scrollbar.
4360 """
5b5c9bc7 4361 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4362
4363 def GetPosition(*args, **kwargs):
27fb7603
RD
4364 """
4365 GetPosition(self) -> int
4366
4367 Returns the position of the scrollbar for the thumb track and release
4368 events. Note that this field can't be used for the other events, you
4369 need to query the window itself for the current position in that case.
4370 """
5b5c9bc7 4371 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4372
4373 def SetOrientation(*args, **kwargs):
4374 """SetOrientation(self, int orient)"""
5b5c9bc7 4375 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4376
4377 def SetPosition(*args, **kwargs):
4378 """SetPosition(self, int pos)"""
5b5c9bc7 4379 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
d55e5bfc 4380
33d6fd3b
RD
4381 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4382 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4383_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d55e5bfc
RD
4384
4385#---------------------------------------------------------------------------
4386
5b5c9bc7
RD
4387MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4388MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4389MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4390MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4391MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4392class MouseEvent(Event):
27fb7603
RD
4393 """
4394 This event class contains information about the events generated by
4395 the mouse: they include mouse buttons press and release events and
4396 mouse move events.
4397
4398 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4399 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4400 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4401 a middle button so a portable application should avoid relying on the
4402 events from it.
4403
4404 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4405 the former returns true when the event corresponds to the left mouse
4406 button click while the latter returns true if the left mouse button is
4407 currently being pressed. For example, when the user is dragging the
4408 mouse you can use `LeftIsDown` to test whether the left mouse button
4409 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4410 `LeftIsDown` will also return true in wxWidgets whatever the
4411 underlying GUI behaviour is (which is platform-dependent). The same
4412 applies, of course, to other mouse buttons as well.
4413 """
1bd55598
RD
4414 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4415 __repr__ = _swig_repr
4416 def __init__(self, *args, **kwargs):
27fb7603 4417 """
2131d850 4418 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4419
4420 Constructs a wx.MouseEvent. Valid event types are:
4421
4422 * wxEVT_ENTER_WINDOW
4423 * wxEVT_LEAVE_WINDOW
4424 * wxEVT_LEFT_DOWN
4425 * wxEVT_LEFT_UP
4426 * wxEVT_LEFT_DCLICK
4427 * wxEVT_MIDDLE_DOWN
4428 * wxEVT_MIDDLE_UP
4429 * wxEVT_MIDDLE_DCLICK
4430 * wxEVT_RIGHT_DOWN
4431 * wxEVT_RIGHT_UP
4432 * wxEVT_RIGHT_DCLICK
4433 * wxEVT_MOTION
4434 * wxEVT_MOUSEWHEEL
4435 """
1bd55598 4436 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
d55e5bfc 4437 def IsButton(*args, **kwargs):
27fb7603
RD
4438 """
4439 IsButton(self) -> bool
4440
4441 Returns true if the event was a mouse button event (not necessarily a
4442 button down event - that may be tested using `ButtonDown`).
4443 """
5b5c9bc7 4444 return _core_.MouseEvent_IsButton(*args, **kwargs)
d55e5bfc
RD
4445
4446 def ButtonDown(*args, **kwargs):
27fb7603
RD
4447 """
4448 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4449
5ba5649b
RD
4450 If the argument is omitted, this returns true if the event was any
4451 mouse button down event. Otherwise the argument specifies which
4452 button-down event shold be checked for (see `Button` for the possible
4453 values).
27fb7603 4454 """
5b5c9bc7 4455 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
d55e5bfc
RD
4456
4457 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4458 """
4459 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4460
4461 If the argument is omitted, this returns true if the event was any
4462 mouse double click event. Otherwise the argument specifies which
4463 double click event to check for (see `Button` for the possible
4464 values).
4465 """
5b5c9bc7 4466 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
d55e5bfc
RD
4467
4468 def ButtonUp(*args, **kwargs):
27fb7603
RD
4469 """
4470 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4471
4472 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4473 mouse button up event. Otherwise the argument specifies which button
4474 up event to check for (see `Button` for the possible values).
27fb7603 4475 """
5b5c9bc7 4476 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
d55e5bfc
RD
4477
4478 def Button(*args, **kwargs):
27fb7603
RD
4479 """
4480 Button(self, int button) -> bool
4481
4482 Returns true if the identified mouse button is changing state. Valid
4483 values of button are:
4484
4485 ==================== =====================================
4486 wx.MOUSE_BTN_LEFT check if left button was pressed
4487 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4488 wx.MOUSE_BTN_RIGHT check if right button was pressed
4489 wx.MOUSE_BTN_ANY check if any button was pressed
4490 ==================== =====================================
4491
4492 """
5b5c9bc7 4493 return _core_.MouseEvent_Button(*args, **kwargs)
d55e5bfc
RD
4494
4495 def ButtonIsDown(*args, **kwargs):
4496 """ButtonIsDown(self, int but) -> bool"""
5b5c9bc7 4497 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
d55e5bfc
RD
4498
4499 def GetButton(*args, **kwargs):
27fb7603
RD
4500 """
4501 GetButton(self) -> int
4502
4503 Returns the mouse button which generated this event or
4504 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4505 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4506 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4507 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4508 right buttons respectively.
4509 """
5b5c9bc7 4510 return _core_.MouseEvent_GetButton(*args, **kwargs)
d55e5bfc
RD
4511
4512 def ControlDown(*args, **kwargs):
27fb7603
RD
4513 """
4514 ControlDown(self) -> bool
4515
4516 Returns true if the control key was down at the time of the event.
4517 """
5b5c9bc7 4518 return _core_.MouseEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4519
4520 def MetaDown(*args, **kwargs):
27fb7603
RD
4521 """
4522 MetaDown(self) -> bool
4523
4524 Returns true if the Meta key was down at the time of the event.
4525 """
5b5c9bc7 4526 return _core_.MouseEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4527
4528 def AltDown(*args, **kwargs):
27fb7603
RD
4529 """
4530 AltDown(self) -> bool
4531
4532 Returns true if the Alt key was down at the time of the event.
4533 """
5b5c9bc7 4534 return _core_.MouseEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4535
4536 def ShiftDown(*args, **kwargs):
27fb7603
RD
4537 """
4538 ShiftDown(self) -> bool
4539
4540 Returns true if the Shift key was down at the time of the event.
4541 """
5b5c9bc7 4542 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4543
412d302d
RD
4544 def CmdDown(*args, **kwargs):
4545 """
4546 CmdDown(self) -> bool
4547
4548 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4549 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4550 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4551 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4552 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4553 purpose. So for non-Mac platforms this is the same as `ControlDown`
4554 and Macs this is the same as `MetaDown`.
4555 """
5b5c9bc7 4556 return _core_.MouseEvent_CmdDown(*args, **kwargs)
412d302d 4557
d55e5bfc 4558 def LeftDown(*args, **kwargs):
27fb7603
RD
4559 """
4560 LeftDown(self) -> bool
4561
4562 Returns true if the left mouse button state changed to down.
4563 """
5b5c9bc7 4564 return _core_.MouseEvent_LeftDown(*args, **kwargs)
d55e5bfc
RD
4565
4566 def MiddleDown(*args, **kwargs):
27fb7603
RD
4567 """
4568 MiddleDown(self) -> bool
4569
4570 Returns true if the middle mouse button state changed to down.
4571 """
5b5c9bc7 4572 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
d55e5bfc
RD
4573
4574 def RightDown(*args, **kwargs):
27fb7603
RD
4575 """
4576 RightDown(self) -> bool
4577
4578 Returns true if the right mouse button state changed to down.
4579 """
5b5c9bc7 4580 return _core_.MouseEvent_RightDown(*args, **kwargs)
d55e5bfc
RD
4581
4582 def LeftUp(*args, **kwargs):
27fb7603
RD
4583 """
4584 LeftUp(self) -> bool
4585
4586 Returns true if the left mouse button state changed to up.
4587 """
5b5c9bc7 4588 return _core_.MouseEvent_LeftUp(*args, **kwargs)
d55e5bfc
RD
4589
4590 def MiddleUp(*args, **kwargs):
27fb7603
RD
4591 """
4592 MiddleUp(self) -> bool
4593
4594 Returns true if the middle mouse button state changed to up.
4595 """
5b5c9bc7 4596 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
d55e5bfc
RD
4597
4598 def RightUp(*args, **kwargs):
27fb7603
RD
4599 """
4600 RightUp(self) -> bool
4601
4602 Returns true if the right mouse button state changed to up.
4603 """
5b5c9bc7 4604 return _core_.MouseEvent_RightUp(*args, **kwargs)
d55e5bfc
RD
4605
4606 def LeftDClick(*args, **kwargs):
27fb7603
RD
4607 """
4608 LeftDClick(self) -> bool
4609
4610 Returns true if the event was a left button double click.
4611 """
5b5c9bc7 4612 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
d55e5bfc
RD
4613
4614 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4615 """
4616 MiddleDClick(self) -> bool
4617
4618 Returns true if the event was a middle button double click.
4619 """
5b5c9bc7 4620 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
d55e5bfc
RD
4621
4622 def RightDClick(*args, **kwargs):
27fb7603
RD
4623 """
4624 RightDClick(self) -> bool
4625
4626 Returns true if the event was a right button double click.
4627 """
5b5c9bc7 4628 return _core_.MouseEvent_RightDClick(*args, **kwargs)
d55e5bfc
RD
4629
4630 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4631 """
4632 LeftIsDown(self) -> bool
4633
4634 Returns true if the left mouse button is currently down, independent
4635 of the current event type.
4636
4637 Please notice that it is not the same as LeftDown which returns true
4638 if the left mouse button was just pressed. Rather, it describes the
4639 state of the mouse button before the event happened.
4640
4641 This event is usually used in the mouse event handlers which process
4642 "move mouse" messages to determine whether the user is (still)
4643 dragging the mouse.
4644 """
5b5c9bc7 4645 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
d55e5bfc
RD
4646
4647 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4648 """
4649 MiddleIsDown(self) -> bool
4650
4651 Returns true if the middle mouse button is currently down, independent
4652 of the current event type.
4653 """
5b5c9bc7 4654 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
d55e5bfc
RD
4655
4656 def RightIsDown(*args, **kwargs):
27fb7603
RD
4657 """
4658 RightIsDown(self) -> bool
4659
4660 Returns true if the right mouse button is currently down, independent
4661 of the current event type.
4662 """
5b5c9bc7 4663 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
d55e5bfc
RD
4664
4665 def Dragging(*args, **kwargs):
27fb7603
RD
4666 """
4667 Dragging(self) -> bool
4668
4669 Returns true if this was a dragging event (motion while a button is
4670 depressed).
4671 """
5b5c9bc7 4672 return _core_.MouseEvent_Dragging(*args, **kwargs)
d55e5bfc
RD
4673
4674 def Moving(*args, **kwargs):
27fb7603
RD
4675 """
4676 Moving(self) -> bool
4677
4678 Returns true if this was a motion event and no mouse buttons were
4679 pressed. If any mouse button is held pressed, then this method returns
4680 false and Dragging returns true.
4681 """
5b5c9bc7 4682 return _core_.MouseEvent_Moving(*args, **kwargs)
d55e5bfc
RD
4683
4684 def Entering(*args, **kwargs):
27fb7603
RD
4685 """
4686 Entering(self) -> bool
4687
4688 Returns true if the mouse was entering the window.
4689 """
5b5c9bc7 4690 return _core_.MouseEvent_Entering(*args, **kwargs)
d55e5bfc
RD
4691
4692 def Leaving(*args, **kwargs):
27fb7603
RD
4693 """
4694 Leaving(self) -> bool
4695
4696 Returns true if the mouse was leaving the window.
4697 """
5b5c9bc7 4698 return _core_.MouseEvent_Leaving(*args, **kwargs)
d55e5bfc
RD
4699
4700 def GetPosition(*args, **kwargs):
4701 """
5b5c9bc7 4702 GetPosition(self) -> Point
d55e5bfc 4703
27fb7603
RD
4704 Returns the pixel position of the mouse in window coordinates when the
4705 event happened.
d55e5bfc 4706 """
5b5c9bc7 4707 return _core_.MouseEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4708
4709 def GetPositionTuple(*args, **kwargs):
4710 """
4711 GetPositionTuple() -> (x,y)
4712
27fb7603
RD
4713 Returns the pixel position of the mouse in window coordinates when the
4714 event happened.
d55e5bfc 4715 """
5b5c9bc7 4716 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4717
4718 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4719 """
4720 GetLogicalPosition(self, DC dc) -> Point
4721
4722 Returns the logical mouse position in pixels (i.e. translated
4723 according to the translation set for the DC, which usually indicates
4724 that the window has been scrolled).
4725 """
5b5c9bc7 4726 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
d55e5bfc
RD
4727
4728 def GetX(*args, **kwargs):
27fb7603
RD
4729 """
4730 GetX(self) -> int
4731
4732 Returns X coordinate of the physical mouse event position.
4733 """
5b5c9bc7 4734 return _core_.MouseEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4735
4736 def GetY(*args, **kwargs):
27fb7603
RD
4737 """
4738 GetY(self) -> int
4739
4740 Returns Y coordinate of the physical mouse event position.
4741 """
5b5c9bc7 4742 return _core_.MouseEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4743
4744 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4745 """
4746 GetWheelRotation(self) -> int
4747
4748 Get wheel rotation, positive or negative indicates direction of
4749 rotation. Current devices all send an event when rotation is equal to
4750 +/-WheelDelta, but this allows for finer resolution devices to be
4751 created in the future. Because of this you shouldn't assume that one
4752 event is equal to 1 line or whatever, but you should be able to either
4753 do partial line scrolling or wait until +/-WheelDelta rotation values
4754 have been accumulated before scrolling.
4755 """
5b5c9bc7 4756 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
d55e5bfc
RD
4757
4758 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4759 """
4760 GetWheelDelta(self) -> int
4761
4762 Get wheel delta, normally 120. This is the threshold for action to be
4763 taken, and one such action (for example, scrolling one increment)
4764 should occur for each delta.
4765 """
5b5c9bc7 4766 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
d55e5bfc
RD
4767
4768 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4769 """
4770 GetLinesPerAction(self) -> int
4771
4772 Returns the configured number of lines (or whatever) to be scrolled
4773 per wheel action. Defaults to three.
4774 """
5b5c9bc7 4775 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
d55e5bfc
RD
4776
4777 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4778 """
4779 IsPageScroll(self) -> bool
4780
4781 Returns true if the system has been setup to do page scrolling with
4782 the mouse wheel instead of line scrolling.
4783 """
5b5c9bc7
RD
4784 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4785
4786 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4787 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4788 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4789 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4790 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4791 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4792 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4793 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4794 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4795 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4796 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4797 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
57332a5a
RD
4798 Button = property(GetButton,doc="See `GetButton`")
4799 LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`")
4800 LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`")
4801 Position = property(GetPosition,doc="See `GetPosition`")
4802 WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`")
4803 WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`")
4804 X = property(GetX,doc="See `GetX`")
4805 Y = property(GetY,doc="See `GetY`")
2131d850 4806_core_.MouseEvent_swigregister(MouseEvent)
d55e5bfc
RD
4807
4808#---------------------------------------------------------------------------
4809
5b5c9bc7 4810class SetCursorEvent(Event):
5ba5649b
RD
4811 """
4812 A SetCursorEvent is generated when the mouse cursor is about to be set
4813 as a result of mouse motion. This event gives the application the
4814 chance to perform specific mouse cursor processing based on the
4815 current position of the mouse within the window. Use the `SetCursor`
4816 method to specify the cursor you want to be displayed.
4817 """
1bd55598
RD
4818 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4819 __repr__ = _swig_repr
4820 def __init__(self, *args, **kwargs):
5ba5649b
RD
4821 """
4822 __init__(self, int x=0, int y=0) -> SetCursorEvent
4823
4824 Construct a new `wx.SetCursorEvent`.
4825 """
1bd55598 4826 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
d55e5bfc 4827 def GetX(*args, **kwargs):
5ba5649b
RD
4828 """
4829 GetX(self) -> int
4830
4831 Returns the X coordinate of the mouse in client coordinates.
4832 """
5b5c9bc7 4833 return _core_.SetCursorEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4834
4835 def GetY(*args, **kwargs):
5ba5649b
RD
4836 """
4837 GetY(self) -> int
4838
4839 Returns the Y coordinate of the mouse in client coordinates.
4840 """
5b5c9bc7 4841 return _core_.SetCursorEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4842
4843 def SetCursor(*args, **kwargs):
5ba5649b
RD
4844 """
4845 SetCursor(self, Cursor cursor)
4846
4847 Sets the cursor associated with this event.
4848 """
5b5c9bc7 4849 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
d55e5bfc
RD
4850
4851 def GetCursor(*args, **kwargs):
5ba5649b
RD
4852 """
4853 GetCursor(self) -> Cursor
4854
4855 Returns a reference to the cursor specified by this event.
4856 """
5b5c9bc7 4857 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
d55e5bfc
RD
4858
4859 def HasCursor(*args, **kwargs):
5ba5649b
RD
4860 """
4861 HasCursor(self) -> bool
4862
4863 Returns true if the cursor specified by this event is a valid cursor.
4864 """
5b5c9bc7 4865 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
d55e5bfc 4866
33d6fd3b
RD
4867 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
4868 X = property(GetX,doc="See `GetX`")
4869 Y = property(GetY,doc="See `GetY`")
2131d850 4870_core_.SetCursorEvent_swigregister(SetCursorEvent)
d55e5bfc
RD
4871
4872#---------------------------------------------------------------------------
4873
5b5c9bc7 4874class KeyEvent(Event):
5ba5649b
RD
4875 """
4876 This event class contains information about keypress and character
4877 events. These events are only sent to the widget that currently has
4878 the keyboard focus.
4879
4880 Notice that there are three different kinds of keyboard events in
4881 wxWidgets: key down and up events and char events. The difference
4882 between the first two is clear - the first corresponds to a key press
4883 and the second to a key release - otherwise they are identical. Just
4884 note that if the key is maintained in a pressed state you will
4885 typically get a lot of (automatically generated) down events but only
4886 one up so it is wrong to assume that there is one up event
4887 corresponding to each down one.
4888
4889 Both key events provide untranslated key codes while the char event
4890 carries the translated one. The untranslated code for alphanumeric
4891 keys is always an upper case value. For the other keys it is one of
4892 WXK_XXX values from the keycodes table. The translated key is, in
4893 general, the character the user expects to appear as the result of the
4894 key combination when typing the text into a text entry zone, for
4895 example.
4896
4897 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4898 and the standard US keyboard): when the 'A' key is pressed, the key
4899 down event key code is equal to ASCII A == 65. But the char event key
4900 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4901 'A' keys simultaneously , the key code in key down event will still be
4902 just 'A' while the char event key code parameter will now be 'A' as
4903 well.
4904
4905 Although in this simple case it is clear that the correct key code
4906 could be found in the key down event handler by checking the value
4907 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4908 as for non alphanumeric keys or non-US keyboard layouts the
4909 translation is keyboard-layout dependent and can only be done properly
4910 by the system itself.
4911
4912 Another kind of translation is done when the control key is pressed:
4913 for example, for CTRL-A key press the key down event still carries the
4914 same key code 'A' as usual but the char event will have key code of 1,
4915 the ASCII value of this key combination.
4916
4917 You may discover how the other keys on your system behave
4918 interactively by running the KeyEvents sample in the wxPython demo and
4919 pressing some keys while the blue box at the top has the keyboard
4920 focus.
4921
4922 **Note**: If a key down event is caught and the event handler does not
4923 call event.Skip() then the coresponding char event will not
4924 happen. This is by design and enables the programs that handle both
4925 types of events to be a bit simpler.
4926
4927 **Note for Windows programmers**: The key and char events in wxWidgets
4928 are similar to but slightly different from Windows WM_KEYDOWN and
4929 WM_CHAR events. In particular, Alt-x combination will generate a char
4930 event in wxWidgets (unless it is used as an accelerator).
4931
4932 **Tip**: be sure to call event.Skip() for events that you don't
4933 process in key event function, otherwise menu shortcuts may cease to
4934 work under Windows.
4935
4936 """
1bd55598
RD
4937 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4938 __repr__ = _swig_repr
4939 def __init__(self, *args, **kwargs):
5ba5649b 4940 """
2131d850 4941 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
4942
4943 Construct a new `wx.KeyEvent`. Valid event types are:
4944 *
4945 """
1bd55598 4946 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
4947 def GetModifiers(*args, **kwargs):
4948 """
4949 GetModifiers(self) -> int
4950
4951 Returns a bitmask of the current modifier settings. Can be used to
4952 check if the key event has exactly the given modifiers without having
4953 to explicitly check that the other modifiers are not down. For
4954 example::
4955
4956 if event.GetModifers() == wx.MOD_CONTROL:
4957 DoSomething()
4958
4959 """
4960 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4961
d55e5bfc 4962 def ControlDown(*args, **kwargs):
5ba5649b
RD
4963 """
4964 ControlDown(self) -> bool
4965
4966 Returns ``True`` if the Control key was down at the time of the event.
4967 """
5b5c9bc7 4968 return _core_.KeyEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4969
4970 def MetaDown(*args, **kwargs):
5ba5649b
RD
4971 """
4972 MetaDown(self) -> bool
4973
4974 Returns ``True`` if the Meta key was down at the time of the event.
4975 """
5b5c9bc7 4976 return _core_.KeyEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4977
4978 def AltDown(*args, **kwargs):
5ba5649b
RD
4979 """
4980 AltDown(self) -> bool
4981
4982 Returns ``True`` if the Alt key was down at the time of the event.
4983 """
5b5c9bc7 4984 return _core_.KeyEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4985
4986 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4987 """
4988 ShiftDown(self) -> bool
4989
4990 Returns ``True`` if the Shift key was down at the time of the event.
4991 """
5b5c9bc7 4992 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4993
412d302d
RD
4994 def CmdDown(*args, **kwargs):
4995 """
4996 CmdDown(self) -> bool
4997
4998 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4999 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 5000 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
5001 because Cmd key is used for the same thing under Mac as Ctrl
5002 elsewhere. The Ctrl still exists, it's just not used for this
5003 purpose. So for non-Mac platforms this is the same as `ControlDown`
5004 and Macs this is the same as `MetaDown`.
5005 """
5b5c9bc7 5006 return _core_.KeyEvent_CmdDown(*args, **kwargs)
412d302d 5007
d55e5bfc 5008 def HasModifiers(*args, **kwargs):
5ba5649b
RD
5009 """
5010 HasModifiers(self) -> bool
5011
5012 Returns true if either CTRL or ALT keys was down at the time of the
5013 key event. Note that this function does not take into account neither
5014 SHIFT nor META key states (the reason for ignoring the latter is that
5015 it is common for NUMLOCK key to be configured as META under X but the
5016 key presses even while NUMLOCK is on should be still processed
5017 normally).
5018 """
5b5c9bc7 5019 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
d55e5bfc
RD
5020
5021 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
5022 """
5023 GetKeyCode(self) -> int
5024
5025 Returns the virtual key code. ASCII events return normal ASCII values,
5026 while non-ASCII events return values such as WXK_LEFT for the left
5027 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5028 codes.
5029
5030 Note that in Unicode build, the returned value is meaningful only if
5031 the user entered a character that can be represented in current
5032 locale's default charset. You can obtain the corresponding Unicode
5033 character using `GetUnicodeKey`.
5034 """
5b5c9bc7 5035 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
d55e5bfc 5036
bb4524c4 5037 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
5038 """
5039 GetUnicodeKey(self) -> int
5040
5041 Returns the Unicode character corresponding to this key event. This
5042 function is only meaningfule in a Unicode build of wxPython.
5043 """
5b5c9bc7 5044 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 5045
bb4524c4 5046 GetUniChar = GetUnicodeKey
b850e7f3
RD
5047 def SetUnicodeKey(*args, **kwargs):
5048 """
5049 SetUnicodeKey(self, int uniChar)
5050
5051 Set the Unicode value of the key event, but only if this is a Unicode
5052 build of wxPython.
5053 """
5054 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
5055
d55e5bfc 5056 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
5057 """
5058 GetRawKeyCode(self) -> unsigned int
5059
5060 Returns the raw key code for this event. This is a platform-dependent
5061 scan code which should only be used in advanced
5062 applications. Currently the raw key codes are not supported by all
5063 ports.
5064 """
5b5c9bc7 5065 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
d55e5bfc
RD
5066
5067 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
5068 """
5069 GetRawKeyFlags(self) -> unsigned int
5070
5071 Returns the low level key flags for this event. The flags are
5072 platform-dependent and should only be used in advanced applications.
5073 Currently the raw key flags are not supported by all ports.
5074 """
5b5c9bc7 5075 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
d55e5bfc
RD
5076
5077 def GetPosition(*args, **kwargs):
5078 """
5b5c9bc7 5079 GetPosition(self) -> Point
d55e5bfc 5080
5ba5649b 5081 Find the position of the event, if applicable.
d55e5bfc 5082 """
5b5c9bc7 5083 return _core_.KeyEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5084
5085 def GetPositionTuple(*args, **kwargs):
5086 """
5087 GetPositionTuple() -> (x,y)
5088
5ba5649b 5089 Find the position of the event, if applicable.
d55e5bfc 5090 """
5b5c9bc7 5091 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
5092
5093 def GetX(*args, **kwargs):
5ba5649b
RD
5094 """
5095 GetX(self) -> int
5096
5097 Returns the X position (in client coordinates) of the event, if
5098 applicable.
5099 """
5b5c9bc7 5100 return _core_.KeyEvent_GetX(*args, **kwargs)
d55e5bfc
RD
5101
5102 def GetY(*args, **kwargs):
5ba5649b
RD
5103 """
5104 GetY(self) -> int
5105
5106 Returns the Y position (in client coordinates) of the event, if
5107 applicable.
5108 """
5b5c9bc7
RD
5109 return _core_.KeyEvent_GetY(*args, **kwargs)
5110
5111 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5112 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5113 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5114 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5115 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5116 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5117 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5118 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5119 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5120 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
ac5d357a
RD
5121 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5122 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5123 Position = property(GetPosition,doc="See `GetPosition`")
5124 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5125 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5126 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5127 X = property(GetX,doc="See `GetX`")
5128 Y = property(GetY,doc="See `GetY`")
2131d850 5129_core_.KeyEvent_swigregister(KeyEvent)
d55e5bfc
RD
5130
5131#---------------------------------------------------------------------------
5132
5b5c9bc7 5133class SizeEvent(Event):
5ba5649b
RD
5134 """
5135 A size event holds information about size change events. The EVT_SIZE
5136 handler function will be called when the window it is bound to has
5137 been resized.
5138
5139 Note that the size passed is of the whole window: call
5140 `wx.Window.GetClientSize` for the area which may be used by the
5141 application.
5142
5143 When a window is resized, usually only a small part of the window is
5144 damaged and and that area is all that is in the update region for the
5145 next paint event. However, if your drawing depends on the size of the
5146 window, you may need to clear the DC explicitly and repaint the whole
5147 window. In which case, you may need to call `wx.Window.Refresh` to
5148 invalidate the entire window.
5149
5150 """
1bd55598
RD
5151 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5152 __repr__ = _swig_repr
5153 def __init__(self, *args, **kwargs):
5ba5649b
RD
5154 """
5155 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5156
5157 Construct a new ``wx.SizeEvent``.
5158 """
1bd55598 5159 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
d55e5bfc 5160 def GetSize(*args, **kwargs):
5ba5649b
RD
5161 """
5162 GetSize(self) -> Size
5163
5164 Returns the entire size of the window generating the size change
5165 event.
5166 """
5b5c9bc7 5167 return _core_.SizeEvent_GetSize(*args, **kwargs)
d55e5bfc
RD
5168
5169 def GetRect(*args, **kwargs):
5b5c9bc7
RD
5170 """GetRect(self) -> Rect"""
5171 return _core_.SizeEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
5172
5173 def SetRect(*args, **kwargs):
5b5c9bc7
RD
5174 """SetRect(self, Rect rect)"""
5175 return _core_.SizeEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
5176
5177 def SetSize(*args, **kwargs):
5b5c9bc7
RD
5178 """SetSize(self, Size size)"""
5179 return _core_.SizeEvent_SetSize(*args, **kwargs)
d55e5bfc 5180
5b5c9bc7
RD
5181 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5182 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
33d6fd3b
RD
5183 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5184 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
2131d850 5185_core_.SizeEvent_swigregister(SizeEvent)
d55e5bfc
RD
5186
5187#---------------------------------------------------------------------------
5188
5b5c9bc7 5189class MoveEvent(Event):
5ba5649b
RD
5190 """
5191 This event object is sent for EVT_MOVE event bindings when a window is
5192 moved to a new position.
5193 """
1bd55598
RD
5194 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5195 __repr__ = _swig_repr
5196 def __init__(self, *args, **kwargs):
5ba5649b
RD
5197 """
5198 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5199
5200 Constructor.
5201 """
1bd55598 5202 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
d55e5bfc 5203 def GetPosition(*args, **kwargs):
5ba5649b
RD
5204 """
5205 GetPosition(self) -> Point
5206
5207 Returns the position of the window generating the move change event.
5208 """
5b5c9bc7 5209 return _core_.MoveEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5210
5211 def GetRect(*args, **kwargs):
5b5c9bc7
RD
5212 """GetRect(self) -> Rect"""
5213 return _core_.MoveEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
5214
5215 def SetRect(*args, **kwargs):
5b5c9bc7
RD
5216 """SetRect(self, Rect rect)"""
5217 return _core_.MoveEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
5218
5219 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
5220 """SetPosition(self, Point pos)"""
5221 return _core_.MoveEvent_SetPosition(*args, **kwargs)
d55e5bfc 5222
fef4c27a
RD
5223 m_pos = property(GetPosition, SetPosition)
5224 m_rect = property(GetRect, SetRect)
5225
57332a5a
RD
5226 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
5227 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
2131d850 5228_core_.MoveEvent_swigregister(MoveEvent)
d55e5bfc
RD
5229
5230#---------------------------------------------------------------------------
5231
5b5c9bc7 5232class PaintEvent(Event):
5ba5649b
RD
5233 """
5234 A paint event is sent when a window's contents needs to be repainted.
5235 Note that in an EVT_PAINT handler the application must *always* create
5236 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5237 Windows assumes that the window has not been painted yet and will send
5238 the event again, causing endless refreshes.
5239
5240 You can optimize painting by retrieving the rectangles that have been
5241 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5242 and only repainting these rectangles. The rectangles are in terms of
5243 the client area, and are unscrolled, so you will need to do some
5244 calculations using the current view position to obtain logical,
5245 scrolled units.
5246
5247 """
1bd55598
RD
5248 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5249 __repr__ = _swig_repr
5250 def __init__(self, *args, **kwargs):
5b5c9bc7 5251 """__init__(self, int Id=0) -> PaintEvent"""
1bd55598 5252 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5253_core_.PaintEvent_swigregister(PaintEvent)
d55e5bfc 5254
5b5c9bc7
RD
5255class NcPaintEvent(Event):
5256 """Proxy of C++ NcPaintEvent class"""
1bd55598
RD
5257 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5258 __repr__ = _swig_repr
5259 def __init__(self, *args, **kwargs):
5b5c9bc7 5260 """__init__(self, int winid=0) -> NcPaintEvent"""
1bd55598 5261 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5262_core_.NcPaintEvent_swigregister(NcPaintEvent)
d55e5bfc
RD
5263
5264#---------------------------------------------------------------------------
5265
5b5c9bc7 5266class EraseEvent(Event):
5ba5649b
RD
5267 """
5268 An erase event is sent whenever the background of a window needs to be
5269 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5270 binder. On some platforms, such as GTK+, this event is simulated
5271 (simply generated just before the paint event) and may cause flicker.
5272
5273 To paint a custom background use the `GetDC` method and use the returned
5274 device context if it is not ``None``, otherwise create a temporary
5275 `wx.ClientDC` and draw on that.
5276
5277 """
1bd55598
RD
5278 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5279 __repr__ = _swig_repr
5280 def __init__(self, *args, **kwargs):
5ba5649b
RD
5281 """
5282 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5283
5284 Constructor
5285 """
1bd55598 5286 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
d55e5bfc 5287 def GetDC(*args, **kwargs):
5ba5649b
RD
5288 """
5289 GetDC(self) -> DC
5290
5291 Returns the device context the event handler should draw upon. If
5292 ``None`` is returned then create a temporary `wx.ClientDC` and use
5293 that instead.
5294 """
5b5c9bc7 5295 return _core_.EraseEvent_GetDC(*args, **kwargs)
d55e5bfc 5296
ac5d357a 5297 DC = property(GetDC,doc="See `GetDC`")
2131d850 5298_core_.EraseEvent_swigregister(EraseEvent)
d55e5bfc
RD
5299
5300#---------------------------------------------------------------------------
5301
5b5c9bc7 5302class FocusEvent(Event):
5ba5649b
RD
5303 """
5304 A focus event is sent when a window's focus changes. The window losing
5305 focus receives an EVT_KILL_FOCUS event while the window gaining it
5306 gets an EVT_SET_FOCUS event.
5307
5308 Notice that the set focus event happens both when the user gives focus
5309 to the window (whether using the mouse or keyboard) and when it is
5310 done from the program itself using `wx.Window.SetFocus`.
5311
5312 """
1bd55598
RD
5313 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5314 __repr__ = _swig_repr
5315 def __init__(self, *args, **kwargs):
5ba5649b 5316 """
2131d850 5317 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5318
5319 Constructor
5320 """
1bd55598 5321 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
d55e5bfc 5322 def GetWindow(*args, **kwargs):
5ba5649b
RD
5323 """
5324 GetWindow(self) -> Window
5325
5326 Returns the other window associated with this event, that is the
5327 window which had the focus before for the EVT_SET_FOCUS event and the
5328 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5329
5330 Warning: the window returned may be None!
5331 """
5b5c9bc7 5332 return _core_.FocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
5333
5334 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
5335 """SetWindow(self, Window win)"""
5336 return _core_.FocusEvent_SetWindow(*args, **kwargs)
d55e5bfc 5337
ac5d357a 5338 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 5339_core_.FocusEvent_swigregister(FocusEvent)
d55e5bfc
RD
5340
5341#---------------------------------------------------------------------------
5342
5b5c9bc7 5343class ChildFocusEvent(CommandEvent):
5ba5649b 5344 """
33d6fd3b
RD
5345 A child focus event is sent to a (parent-)window when one of its child
5346 windows gains focus, so that the window could restore the focus back
5347 to its corresponding child if it loses it now and regains later.
5348
5349 Notice that child window is the direct child of the window receiving
5350 the event, and so may not be the actual widget recieving focus if it
5351 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5352 to get the widget that is actually receiving focus.
5ba5649b 5353 """
1bd55598
RD
5354 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5355 __repr__ = _swig_repr
5356 def __init__(self, *args, **kwargs):
5ba5649b
RD
5357 """
5358 __init__(self, Window win=None) -> ChildFocusEvent
5359
5360 Constructor
5361 """
1bd55598 5362 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
d55e5bfc 5363 def GetWindow(*args, **kwargs):
5ba5649b
RD
5364 """
5365 GetWindow(self) -> Window
5366
33d6fd3b
RD
5367 The window, or (grand)parent of the window which has just received the
5368 focus.
5ba5649b 5369 """
5b5c9bc7 5370 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
d55e5bfc 5371
2bf58437 5372 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 5373_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d55e5bfc
RD
5374
5375#---------------------------------------------------------------------------
5376
5b5c9bc7 5377class ActivateEvent(Event):
5ba5649b
RD
5378 """
5379 An activate event is sent when a top-level window or the entire
5380 application is being activated or deactivated.
5381
5382 A top-level window (a dialog or frame) receives an activate event when
5383 is being activated or deactivated. This is indicated visually by the
5384 title bar changing colour, and a subwindow gaining the keyboard focus.
5385 An application is activated or deactivated when one of its frames
5386 becomes activated, or a frame becomes inactivate resulting in all
5387 application frames being inactive.
5388
5389 Please note that usually you should call event.Skip() in your handlers
5390 for these events so the default handlers will still be called, as not
5391 doing so can result in strange effects.
5392
5393 """
1bd55598
RD
5394 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5395 __repr__ = _swig_repr
5396 def __init__(self, *args, **kwargs):
5ba5649b 5397 """
2131d850 5398 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5399
5400 Constructor
5401 """
1bd55598 5402 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
d55e5bfc 5403 def GetActive(*args, **kwargs):
5ba5649b
RD
5404 """
5405 GetActive(self) -> bool
5406
5407 Returns true if the application or window is being activated, false
5408 otherwise.
5409 """
5b5c9bc7 5410 return _core_.ActivateEvent_GetActive(*args, **kwargs)
d55e5bfc 5411
2bf58437 5412 Active = property(GetActive,doc="See `GetActive`")
2131d850 5413_core_.ActivateEvent_swigregister(ActivateEvent)
d55e5bfc
RD
5414
5415#---------------------------------------------------------------------------
5416
5b5c9bc7 5417class InitDialogEvent(Event):
5ba5649b
RD
5418 """
5419 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5420 any window when `wx.Window.InitDialog` is called. Handlers for this
5421 event can transfer data to the window, or anything else that should be
5422 done before the user begins editing the form. The default handler
5423 calls `wx.Window.TransferDataToWindow`.
5424 """
1bd55598
RD
5425 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5426 __repr__ = _swig_repr
5427 def __init__(self, *args, **kwargs):
5ba5649b
RD
5428 """
5429 __init__(self, int Id=0) -> InitDialogEvent
5430
5431 Constructor
5432 """
1bd55598 5433 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5434_core_.InitDialogEvent_swigregister(InitDialogEvent)
d55e5bfc
RD
5435
5436#---------------------------------------------------------------------------
5437
5b5c9bc7 5438class MenuEvent(Event):
5ba5649b
RD
5439 """
5440 This class is used for a variety of menu-related events. Note that
5441 these do not include menu command events, which are handled by sending
5442 `wx.CommandEvent` objects.
5443
5444 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5445 text in the first field of the status bar.
5446 """
1bd55598
RD
5447 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5448 __repr__ = _swig_repr
5449 def __init__(self, *args, **kwargs):
5ba5649b 5450 """
2131d850 5451 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5452
5453 Constructor
5454 """
1bd55598 5455 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
d55e5bfc 5456 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5457 """
5458 GetMenuId(self) -> int
5459
5460 Returns the menu identifier associated with the event. This method
5461 should be only used with the HIGHLIGHT events.
5462 """
5b5c9bc7 5463 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
d55e5bfc
RD
5464
5465 def IsPopup(*args, **kwargs):
5ba5649b
RD
5466 """
5467 IsPopup(self) -> bool
5468
5469 Returns ``True`` if the menu which is being opened or closed is a
5470 popup menu, ``False`` if it is a normal one. This method should only
5471 be used with the OPEN and CLOSE events.
5472 """
5b5c9bc7 5473 return _core_.MenuEvent_IsPopup(*args, **kwargs)
d55e5bfc
RD
5474
5475 def GetMenu(*args, **kwargs):
5ba5649b
RD
5476 """
5477 GetMenu(self) -> Menu
5478
5479 Returns the menu which is being opened or closed. This method should
5480 only be used with the OPEN and CLOSE events.
5481 """
5b5c9bc7 5482 return _core_.MenuEvent_GetMenu(*args, **kwargs)
d55e5bfc 5483
57332a5a
RD
5484 Menu = property(GetMenu,doc="See `GetMenu`")
5485 MenuId = property(GetMenuId,doc="See `GetMenuId`")
2131d850 5486_core_.MenuEvent_swigregister(MenuEvent)
d55e5bfc
RD
5487
5488#---------------------------------------------------------------------------
5489
5b5c9bc7 5490class CloseEvent(Event):
5ba5649b
RD
5491 """
5492 This event class contains information about window and session close
5493 events.
5494
5495 The handler function for EVT_CLOSE is called when the user has tried
5496 to close a a frame or dialog box using the window manager controls or
5497 the system menu. It can also be invoked by the application itself
5498 programmatically, for example by calling the `wx.Window.Close`
5499 function.
5500
5501 You should check whether the application is forcing the deletion of
5502 the window using `CanVeto`. If it returns ``False``, you must destroy
5503 the window using `wx.Window.Destroy`. If the return value is ``True``,
5504 it is up to you whether you respond by destroying the window or not.
5505 For example you may wish to display a message dialog prompting to save
5506 files or to cancel the close.
5507
5508 If you don't destroy the window, you should call `Veto` to let the
5509 calling code know that you did not destroy the window. This allows the
5510 `wx.Window.Close` function to return ``True`` or ``False`` depending
5511 on whether the close instruction was honored or not.
5512 """
1bd55598
RD
5513 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5514 __repr__ = _swig_repr
5515 def __init__(self, *args, **kwargs):
5ba5649b 5516 """
2131d850 5517 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5518
5519 Constructor.
5520 """
1bd55598 5521 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
d55e5bfc 5522 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5523 """
5524 SetLoggingOff(self, bool logOff)
5525
5526 Sets the 'logging off' flag.
5527 """
5b5c9bc7 5528 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5529
5530 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5531 """
5532 GetLoggingOff(self) -> bool
5533
034e3677
RD
5534 Returns ``True`` if the user is logging off or ``False`` if the
5535 system is shutting down. This method can only be called for end
5536 session and query end session events, it doesn't make sense for close
5537 window event.
5ba5649b 5538 """
5b5c9bc7 5539 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5540
5541 def Veto(*args, **kwargs):
5ba5649b
RD
5542 """
5543 Veto(self, bool veto=True)
5544
5545 Call this from your event handler to veto a system shutdown or to
5546 signal to the calling application that a window close did not happen.
5547
5548 You can only veto a shutdown or close if `CanVeto` returns true.
5549 """
5b5c9bc7 5550 return _core_.CloseEvent_Veto(*args, **kwargs)
d55e5bfc 5551
5ba5649b
RD
5552 def GetVeto(*args, **kwargs):
5553 """GetVeto(self) -> bool"""
5554 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5555
d55e5bfc 5556 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5557 """
5558 SetCanVeto(self, bool canVeto)
5559
5560 Sets the 'can veto' flag.
5561 """
5b5c9bc7 5562 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
d55e5bfc
RD
5563
5564 def CanVeto(*args, **kwargs):
5ba5649b
RD
5565 """
5566 CanVeto(self) -> bool
d55e5bfc 5567
5ba5649b
RD
5568 Returns true if you can veto a system shutdown or a window close
5569 event. Vetoing a window close event is not possible if the calling
5570 code wishes to force the application to exit, and so this function
5571 must be called to check this.
5572 """
5573 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc 5574
2bf58437 5575 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
2131d850 5576_core_.CloseEvent_swigregister(CloseEvent)
d55e5bfc
RD
5577
5578#---------------------------------------------------------------------------
5579
5b5c9bc7 5580class ShowEvent(Event):
5ba5649b 5581 """An EVT_SHOW event is sent when a window is shown or hidden."""
1bd55598
RD
5582 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5583 __repr__ = _swig_repr
5584 def __init__(self, *args, **kwargs):
5ba5649b
RD
5585 """
5586 __init__(self, int winid=0, bool show=False) -> ShowEvent
5587
5588 An EVT_SHOW event is sent when a window is shown or hidden.
5589 """
1bd55598 5590 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
d55e5bfc
RD
5591 def SetShow(*args, **kwargs):
5592 """SetShow(self, bool show)"""
5b5c9bc7 5593 return _core_.ShowEvent_SetShow(*args, **kwargs)
d55e5bfc
RD
5594
5595 def GetShow(*args, **kwargs):
5596 """GetShow(self) -> bool"""
5b5c9bc7 5597 return _core_.ShowEvent_GetShow(*args, **kwargs)
d55e5bfc 5598
33d6fd3b 5599 Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`")
2131d850 5600_core_.ShowEvent_swigregister(ShowEvent)
d55e5bfc
RD
5601
5602#---------------------------------------------------------------------------
5603
5b5c9bc7 5604class IconizeEvent(Event):
5ba5649b
RD
5605 """
5606 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5607 restored.
5608 """
1bd55598
RD
5609 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5610 __repr__ = _swig_repr
5611 def __init__(self, *args, **kwargs):
5ba5649b
RD
5612 """
5613 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5614
5615 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5616 restored.
5617 """
1bd55598 5618 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
d55e5bfc 5619 def Iconized(*args, **kwargs):
5ba5649b
RD
5620 """
5621 Iconized(self) -> bool
5622
5623 Returns ``True`` if the frame has been iconized, ``False`` if it has
5624 been restored.
5625 """
5b5c9bc7 5626 return _core_.IconizeEvent_Iconized(*args, **kwargs)
d55e5bfc 5627
2131d850 5628_core_.IconizeEvent_swigregister(IconizeEvent)
d55e5bfc
RD
5629
5630#---------------------------------------------------------------------------
5631
5b5c9bc7 5632class MaximizeEvent(Event):
5ba5649b 5633 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
1bd55598
RD
5634 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5635 __repr__ = _swig_repr
5636 def __init__(self, *args, **kwargs):
5ba5649b
RD
5637 """
5638 __init__(self, int id=0) -> MaximizeEvent
5639
5640 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5641 """
1bd55598 5642 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5643_core_.MaximizeEvent_swigregister(MaximizeEvent)
d55e5bfc
RD
5644
5645#---------------------------------------------------------------------------
5646
5b5c9bc7 5647class DropFilesEvent(Event):
5ba5649b
RD
5648 """
5649 This class is used for drop files events, that is, when files have
5650 been dropped onto the window. This functionality is only available
5651 under Windows. The window must have previously been enabled for
5652 dropping by calling `wx.Window.DragAcceptFiles`.
5653
5654 Important note: this is a separate implementation to the more general
5655 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5656 implementation uses the older, Windows message-based approach of
5657 dropping files.
5658
5659 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5660 events.
5661
5662 """
1bd55598
RD
5663 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5664 def __init__(self): raise AttributeError, "No constructor defined"
5665 __repr__ = _swig_repr
d55e5bfc 5666 def GetPosition(*args, **kwargs):
5ba5649b
RD
5667 """
5668 GetPosition(self) -> Point
5669
5670 Returns the position at which the files were dropped.
5671 """
5b5c9bc7 5672 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5673
5674 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5675 """
5676 GetNumberOfFiles(self) -> int
5677
5678 Returns the number of files dropped.
5679 """
5b5c9bc7 5680 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
d55e5bfc
RD
5681
5682 def GetFiles(*args, **kwargs):
5ba5649b
RD
5683 """
5684 GetFiles(self) -> PyObject
5685
5686 Returns a list of the filenames that were dropped.
5687 """
5b5c9bc7 5688 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
d55e5bfc 5689
2bf58437
RD
5690 Files = property(GetFiles,doc="See `GetFiles`")
5691 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
5692 Position = property(GetPosition,doc="See `GetPosition`")
2131d850 5693_core_.DropFilesEvent_swigregister(DropFilesEvent)
d55e5bfc
RD
5694
5695#---------------------------------------------------------------------------
5696
5b5c9bc7
RD
5697UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5698UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5699class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5700 """
5701 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5702 wxWidgets to give an application the chance to update various user
5703 interface elements.
5704
5705 Without update UI events, an application has to work hard to
5706 check/uncheck, enable/disable, and set the text for elements such as
5707 menu items and toolbar buttons. The code for doing this has to be
5708 mixed up with the code that is invoked when an action is invoked for a
5709 menu item or button.
5710
5711 With update UI events, you define an event handler to look at the
5712 state of the application and change UI elements accordingly. wxWidgets
5713 will call your handler functions in idle time, so you don't have to
5714 worry where to call this code. In addition to being a clearer and more
5715 declarative method, it also means you don't have to worry whether
5716 you're updating a toolbar or menubar identifier. The same handler can
5717 update a menu item and toolbar button, if the ID values are the same.
5718
5719 Instead of directly manipulating the menu or button, you call
5720 functions in the event object, such as `Check`. wxWidgets will
5721 determine whether such a call has been made, and which UI element to
5722 update.
5723
5724 These events will work for popup menus as well as menubars. Just
5725 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5726 any UI events for the window that owns the menu.
5727
5728 If you find that the overhead of UI update processing is affecting
5729 your application, you can do one or both of the following:
5730
5731 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5732 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5733 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5734 receive update events. No other windows will receive update
5735 events.
5736
5737 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5738 value to set the delay between updates. You may need to call
5739 `wx.Window.UpdateWindowUI` at critical points, for example when
5740 a dialog is about to be shown, in case the user sees a slight
5741 delay before windows are updated.
5742
5743 Note that although events are sent in idle time, defining a EVT_IDLE
5744 handler for a window does not affect this because the events are sent
5745 from an internal idle handler.
5746
5747 wxWidgets tries to optimize update events on some platforms. On
5748 Windows and GTK+, events for menubar items are only sent when the menu
5749 is about to be shown, and not in idle time.
5750
5751 """
1bd55598
RD
5752 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5753 __repr__ = _swig_repr
5754 def __init__(self, *args, **kwargs):
5ba5649b
RD
5755 """
5756 __init__(self, int commandId=0) -> UpdateUIEvent
5757
5758 Constructor
5759 """
1bd55598 5760 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
d55e5bfc 5761 def GetChecked(*args, **kwargs):
5ba5649b
RD
5762 """
5763 GetChecked(self) -> bool
5764
5765 Returns ``True`` if the UI element should be checked.
5766 """
5b5c9bc7 5767 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
d55e5bfc
RD
5768
5769 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5770 """
5771 GetEnabled(self) -> bool
5772
5773 Returns ``True`` if the UI element should be enabled.
5774 """
5b5c9bc7 5775 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
d55e5bfc 5776
b1fcee84
RD
5777 def GetShown(*args, **kwargs):
5778 """
5779 GetShown(self) -> bool
5780
5781 Returns ``True`` if the UI element should be shown.
5782 """
5783 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5784
d55e5bfc 5785 def GetText(*args, **kwargs):
5ba5649b
RD
5786 """
5787 GetText(self) -> String
5788
5789 Returns the text that should be set for the UI element.
5790 """
5b5c9bc7 5791 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
d55e5bfc
RD
5792
5793 def GetSetText(*args, **kwargs):
5ba5649b
RD
5794 """
5795 GetSetText(self) -> bool
5796
5797 Returns ``True`` if the application has called `SetText`. For
5798 wxWidgets internal use only.
5799 """
5b5c9bc7 5800 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
d55e5bfc
RD
5801
5802 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5803 """
5804 GetSetChecked(self) -> bool
5805
5806 Returns ``True`` if the application has called `Check`. For wxWidgets
5807 internal use only.
5808 """
5b5c9bc7 5809 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
d55e5bfc
RD
5810
5811 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5812 """
5813 GetSetEnabled(self) -> bool
5814
5815 Returns ``True`` if the application has called `Enable`. For wxWidgets
5816 internal use only.
5817 """
5b5c9bc7 5818 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
d55e5bfc 5819
b1fcee84
RD
5820 def GetSetShown(*args, **kwargs):
5821 """
5822 GetSetShown(self) -> bool
5823
5824 Returns ``True`` if the application has called `Show`. For wxWidgets
5825 internal use only.
5826 """
5827 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5828
d55e5bfc 5829 def Check(*args, **kwargs):
5ba5649b
RD
5830 """
5831 Check(self, bool check)
5832
5833 Check or uncheck the UI element.
5834 """
5b5c9bc7 5835 return _core_.UpdateUIEvent_Check(*args, **kwargs)
d55e5bfc
RD
5836
5837 def Enable(*args, **kwargs):
5ba5649b
RD
5838 """
5839 Enable(self, bool enable)
5840
5841 Enable or disable the UI element.
5842 """
5b5c9bc7 5843 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
d55e5bfc 5844
b1fcee84
RD
5845 def Show(*args, **kwargs):
5846 """
5847 Show(self, bool show)
5848
5849 Show or hide the UI element.
5850 """
5851 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5852
d55e5bfc 5853 def SetText(*args, **kwargs):
5ba5649b
RD
5854 """
5855 SetText(self, String text)
5856
5857 Sets the text for this UI element.
5858 """
5b5c9bc7 5859 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
d55e5bfc
RD
5860
5861 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5862 """
5863 SetUpdateInterval(long updateInterval)
5864
5865 Sets the interval between updates in milliseconds. Set to -1 to
5866 disable updates, or to 0 to update as frequently as possible. The
5867 default is 0.
5868
5869 Use this to reduce the overhead of UI update events if your
5870 application has a lot of windows. If you set the value to -1 or
5871 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5872 at appropriate points in your application, such as when a dialog is
5873 about to be shown.
5874 """
5b5c9bc7 5875 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5876
5877 SetUpdateInterval = staticmethod(SetUpdateInterval)
5878 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5879 """
5880 GetUpdateInterval() -> long
5881
5882 Returns the current interval between updates in milliseconds. -1
5883 disables updates, 0 updates as frequently as possible.
5884 """
5b5c9bc7 5885 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5886
5887 GetUpdateInterval = staticmethod(GetUpdateInterval)
5888 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5889 """
5890 CanUpdate(Window win) -> bool
5891
5892 Returns ``True`` if it is appropriate to update (send UI update events
5893 to) this window.
5894
5895 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5896 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5897 events were last sent in idle time, and the update interval, to
5898 determine whether events should be sent to this window now. By default
5899 this will always return true because the update mode is initially
5900 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5901 events will be sent as often as possible. You can reduce the frequency
5902 that events are sent by changing the mode and/or setting an update
5903 interval.
5904
5905 """
5b5c9bc7 5906 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc
RD
5907
5908 CanUpdate = staticmethod(CanUpdate)
5909 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5910 """
5911 ResetUpdateTime()
5912
5913 Used internally to reset the last-updated time to the current time. It
5914 is assumed that update events are normally sent in idle time, so this
5915 is called at the end of idle processing.
5916 """
5b5c9bc7 5917 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc
RD
5918
5919 ResetUpdateTime = staticmethod(ResetUpdateTime)
5920 def SetMode(*args, **kwargs):
5ba5649b
RD
5921 """
5922 SetMode(int mode)
5923
5924 Specify how wxWidgets will send update events: to all windows, or only
5925 to those which specify that they will process the events.
5926
5927 The mode may be one of the following values:
5928
5929 ============================= ==========================================
5930 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5931 is the default setting.
5932 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5933 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5934 style set.
5935 ============================= ==========================================
5936
5937 """
5b5c9bc7 5938 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
5939
5940 SetMode = staticmethod(SetMode)
5941 def GetMode(*args, **kwargs):
5ba5649b
RD
5942 """
5943 GetMode() -> int
5944
5945 Returns a value specifying how wxWidgets will send update events: to
5946 all windows, or only to those which specify that they will process the
5947 events.
5948 """
5b5c9bc7 5949 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
5950
5951 GetMode = staticmethod(GetMode)
dba7934c
RD
5952 Checked = property(GetChecked,Check,doc="See `GetChecked`")
5953 Enabled = property(GetEnabled,Enable,doc="See `GetEnabled`")
5954 Shown = property(GetShown,Show,doc="See `GetShown`")
5955 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
2131d850 5956_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d55e5bfc 5957
5b5c9bc7 5958def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
1bd55598 5959 """
5ba5649b
RD
5960 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5961
5962 Sets the interval between updates in milliseconds. Set to -1 to
5963 disable updates, or to 0 to update as frequently as possible. The
5964 default is 0.
5965
5966 Use this to reduce the overhead of UI update events if your
5967 application has a lot of windows. If you set the value to -1 or
5968 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5969 at appropriate points in your application, such as when a dialog is
5970 about to be shown.
5971 """
1bd55598 5972 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 5973
1bd55598
RD
5974def UpdateUIEvent_GetUpdateInterval(*args):
5975 """
5ba5649b
RD
5976 UpdateUIEvent_GetUpdateInterval() -> long
5977
5978 Returns the current interval between updates in milliseconds. -1
5979 disables updates, 0 updates as frequently as possible.
5980 """
1bd55598 5981 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d55e5bfc 5982
5b5c9bc7 5983def UpdateUIEvent_CanUpdate(*args, **kwargs):
1bd55598 5984 """
5ba5649b
RD
5985 UpdateUIEvent_CanUpdate(Window win) -> bool
5986
5987 Returns ``True`` if it is appropriate to update (send UI update events
5988 to) this window.
5989
5990 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5991 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5992 events were last sent in idle time, and the update interval, to
5993 determine whether events should be sent to this window now. By default
5994 this will always return true because the update mode is initially
5995 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5996 events will be sent as often as possible. You can reduce the frequency
5997 that events are sent by changing the mode and/or setting an update
5998 interval.
5999
6000 """
1bd55598 6001 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 6002
1bd55598
RD
6003def UpdateUIEvent_ResetUpdateTime(*args):
6004 """
5ba5649b
RD
6005 UpdateUIEvent_ResetUpdateTime()
6006
6007 Used internally to reset the last-updated time to the current time. It
6008 is assumed that update events are normally sent in idle time, so this
6009 is called at the end of idle processing.
6010 """
1bd55598 6011 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d55e5bfc 6012
5b5c9bc7 6013def UpdateUIEvent_SetMode(*args, **kwargs):
1bd55598 6014 """
5ba5649b
RD
6015 UpdateUIEvent_SetMode(int mode)
6016
6017 Specify how wxWidgets will send update events: to all windows, or only
6018 to those which specify that they will process the events.
6019
6020 The mode may be one of the following values:
6021
6022 ============================= ==========================================
6023 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6024 is the default setting.
6025 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6026 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6027 style set.
6028 ============================= ==========================================
6029
6030 """
1bd55598 6031 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 6032
1bd55598
RD
6033def UpdateUIEvent_GetMode(*args):
6034 """
5ba5649b
RD
6035 UpdateUIEvent_GetMode() -> int
6036
6037 Returns a value specifying how wxWidgets will send update events: to
6038 all windows, or only to those which specify that they will process the
6039 events.
6040 """
1bd55598 6041 return _core_.UpdateUIEvent_GetMode(*args)
d55e5bfc
RD
6042
6043#---------------------------------------------------------------------------
6044
5b5c9bc7 6045class SysColourChangedEvent(Event):
5ba5649b
RD
6046 """
6047 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6048 when the user changes the colour settings using the control
6049 panel. This is only applicable under Windows.
6050
6051 The default event handler for this event propagates the event to child
6052 windows, since Windows only sends the events to top-level windows. If
6053 intercepting this event for a top-level window, remember to call
6054 `Skip` so the the base class handler will still be executed, or to
6055 pass the event on to the window's children explicitly.
6056
6057 """
1bd55598
RD
6058 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6059 __repr__ = _swig_repr
6060 def __init__(self, *args, **kwargs):
5ba5649b
RD
6061 """
6062 __init__(self) -> SysColourChangedEvent
6063
6064 Constructor
6065 """
1bd55598 6066 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 6067_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d55e5bfc
RD
6068
6069#---------------------------------------------------------------------------
6070
5b5c9bc7 6071class MouseCaptureChangedEvent(Event):
5ba5649b
RD
6072 """
6073 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6074 a window that loses its mouse capture. This is called even if
6075 `wx.Window.ReleaseMouse` was called by the application code. Handling
6076 this event allows an application to cater for unexpected capture
6077 releases which might otherwise confuse mouse handling code.
6078
6079 This event is implemented under Windows only.
6080 """
1bd55598
RD
6081 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6082 __repr__ = _swig_repr
6083 def __init__(self, *args, **kwargs):
5ba5649b
RD
6084 """
6085 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6086
6087 Constructor
6088 """
1bd55598 6089 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
d55e5bfc 6090 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
6091 """
6092 GetCapturedWindow(self) -> Window
6093
6094 Returns the window that gained the capture, or ``None`` if it was a
6095 non-wxWidgets window.
6096 """
5b5c9bc7 6097 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
d55e5bfc 6098
57332a5a 6099 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
2131d850 6100_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d55e5bfc
RD
6101
6102#---------------------------------------------------------------------------
6103
34e0a3bb
RD
6104class MouseCaptureLostEvent(Event):
6105 """
6106 A mouse capture lost event is sent to a window that obtained mouse
6107 capture, which was subsequently loss due to "external" event, for
6108 example when a dialog box is shown or if another application captures
6109 the mouse.
6110
6111 If this happens, this event is sent to all windows that are on the
6112 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6113 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6114 if the capture changes because of a call to CaptureMouse or
6115 ReleaseMouse.
6116
6117 This event is currently emitted under Windows only.
6118
6119 """
6120 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6121 __repr__ = _swig_repr
6122 def __init__(self, *args, **kwargs):
6123 """
6124 __init__(self, int winid=0) -> MouseCaptureLostEvent
6125
6126 A mouse capture lost event is sent to a window that obtained mouse
6127 capture, which was subsequently loss due to "external" event, for
6128 example when a dialog box is shown or if another application captures
6129 the mouse.
6130
6131 If this happens, this event is sent to all windows that are on the
6132 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6133 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6134 if the capture changes because of a call to CaptureMouse or
6135 ReleaseMouse.
6136
6137 This event is currently emitted under Windows only.
6138
6139 """
6140 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6141_core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6142
6143#---------------------------------------------------------------------------
6144
5b5c9bc7 6145class DisplayChangedEvent(Event):
5ba5649b
RD
6146 """
6147 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6148 resolution has changed.
6149
6150 This event is implemented under Windows only.
6151 """
1bd55598
RD
6152 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6153 __repr__ = _swig_repr
6154 def __init__(self, *args, **kwargs):
5b5c9bc7 6155 """__init__(self) -> DisplayChangedEvent"""
1bd55598 6156 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 6157_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d55e5bfc
RD
6158
6159#---------------------------------------------------------------------------
6160
5b5c9bc7 6161class PaletteChangedEvent(Event):
5ba5649b
RD
6162 """
6163 An EVT_PALETTE_CHANGED event is sent when the system palette has
6164 changed, thereby giving each window a chance to redo their own to
6165 match.
6166
6167 This event is implemented under Windows only.
6168 """
1bd55598
RD
6169 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6170 __repr__ = _swig_repr
6171 def __init__(self, *args, **kwargs):
5ba5649b
RD
6172 """
6173 __init__(self, int id=0) -> PaletteChangedEvent
6174
6175 An EVT_PALETTE_CHANGED event is sent when the system palette has
6176 changed, thereby giving each window a chance to redo their own to
6177 match.
6178
6179 This event is implemented under Windows only.
6180 """
1bd55598 6181 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
d55e5bfc 6182 def SetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
6183 """SetChangedWindow(self, Window win)"""
6184 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
d55e5bfc
RD
6185
6186 def GetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
6187 """GetChangedWindow(self) -> Window"""
6188 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
d55e5bfc 6189
33d6fd3b 6190 ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`")
2131d850 6191_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d55e5bfc
RD
6192
6193#---------------------------------------------------------------------------
6194
5b5c9bc7 6195class QueryNewPaletteEvent(Event):
5ba5649b
RD
6196 """
6197 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6198 focus and should re-do its palette.
6199
6200 This event is implemented under Windows only.
6201 """
1bd55598
RD
6202 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6203 __repr__ = _swig_repr
6204 def __init__(self, *args, **kwargs):
5ba5649b
RD
6205 """
6206 __init__(self, int winid=0) -> QueryNewPaletteEvent
6207
6208 Constructor.
6209 """
1bd55598 6210 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
d55e5bfc 6211 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6212 """
6213 SetPaletteRealized(self, bool realized)
6214
6215 App should set this if it changes the palette.
6216 """
5b5c9bc7 6217 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
6218
6219 def GetPaletteRealized(*args, **kwargs):
6220 """GetPaletteRealized(self) -> bool"""
5b5c9bc7 6221 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
d55e5bfc 6222
33d6fd3b 6223 PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`")
2131d850 6224_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d55e5bfc
RD
6225
6226#---------------------------------------------------------------------------
6227
5b5c9bc7 6228class NavigationKeyEvent(Event):
5ba5649b
RD
6229 """
6230 EVT_NAVIGATION_KEY events are used to control moving the focus between
6231 widgets, otherwise known as tab-traversal. You woudl normally not
6232 catch navigation events in applications as there are already
6233 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6234 it useful to send navigation events in certain situations to change
6235 the focus in certain ways, although it's probably easier to just call
6236 `wx.Window.Navigate`.
6237 """
1bd55598
RD
6238 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6239 __repr__ = _swig_repr
6240 def __init__(self, *args, **kwargs):
5b5c9bc7 6241 """__init__(self) -> NavigationKeyEvent"""
1bd55598 6242 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
d55e5bfc 6243 def GetDirection(*args, **kwargs):
5ba5649b
RD
6244 """
6245 GetDirection(self) -> bool
6246
6247 Returns ``True`` if the direction is forward, ``False`` otherwise.
6248 """
5b5c9bc7 6249 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
d55e5bfc
RD
6250
6251 def SetDirection(*args, **kwargs):
5ba5649b
RD
6252 """
6253 SetDirection(self, bool forward)
6254
6255 Specify the direction that the navigation should take. Usually the
6256 difference between using Tab and Shift-Tab.
6257 """
5b5c9bc7 6258 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
d55e5bfc
RD
6259
6260 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6261 """
6262 IsWindowChange(self) -> bool
6263
6264 Returns ``True`` if window change is allowed.
6265 """
5b5c9bc7 6266 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
d55e5bfc
RD
6267
6268 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6269 """
6270 SetWindowChange(self, bool ischange)
6271
6272 Specify if the navigation should be able to change parent windows.
6273 For example, changing notebook pages, etc. This is usually implemented
6274 by using Control-Tab.
6275 """
5b5c9bc7 6276 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
d55e5bfc 6277
68350608 6278 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6279 """
6280 IsFromTab(self) -> bool
6281
6282 Returns ``True`` if the navigation event is originated from the Tab
6283 key.
6284 """
5b5c9bc7 6285 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
68350608
RD
6286
6287 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6288 """
6289 SetFromTab(self, bool bIs)
6290
6291 Set to true under MSW if the event was generated using the tab key.
6292 This is required for proper navogation over radio buttons.
6293 """
5b5c9bc7 6294 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
68350608 6295
908b74cd 6296 def SetFlags(*args, **kwargs):
5ba5649b
RD
6297 """
6298 SetFlags(self, long flags)
6299
6300 Set the navigation flags to a combination of the following:
6301
6302 * wx.NavigationKeyEvent.IsBackward
6303 * wx.NavigationKeyEvent.IsForward
6304 * wx.NavigationKeyEvent.WinChange
6305 * wx.NavigationKeyEvent.FromTab
6306
6307 """
5b5c9bc7 6308 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
908b74cd 6309
d55e5bfc 6310 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6311 """
6312 GetCurrentFocus(self) -> Window
6313
6314 Returns the child window which currenty has the focus. May be
6315 ``None``.
6316 """
5b5c9bc7 6317 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
d55e5bfc
RD
6318
6319 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6320 """
6321 SetCurrentFocus(self, Window win)
6322
6323 Set the window that has the focus.
6324 """
5b5c9bc7 6325 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
d55e5bfc 6326
5b5c9bc7
RD
6327 IsBackward = _core_.NavigationKeyEvent_IsBackward
6328 IsForward = _core_.NavigationKeyEvent_IsForward
6329 WinChange = _core_.NavigationKeyEvent_WinChange
6330 FromTab = _core_.NavigationKeyEvent_FromTab
57332a5a
RD
6331 CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`")
6332 Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`")
2131d850 6333_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d55e5bfc
RD
6334
6335#---------------------------------------------------------------------------
6336
5b5c9bc7 6337class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6338 """
6339 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6340 underlying GUI object) exists.
6341 """
1bd55598
RD
6342 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6343 __repr__ = _swig_repr
6344 def __init__(self, *args, **kwargs):
5ba5649b
RD
6345 """
6346 __init__(self, Window win=None) -> WindowCreateEvent
6347
6348 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6349 underlying GUI object) exists.
6350 """
1bd55598 6351 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
d55e5bfc 6352 def GetWindow(*args, **kwargs):
5ba5649b
RD
6353 """
6354 GetWindow(self) -> Window
6355
6356 Returns the window that this event refers to.
6357 """
5b5c9bc7 6358 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
d55e5bfc 6359
dba7934c 6360 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6361_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d55e5bfc 6362
5b5c9bc7 6363class WindowDestroyEvent(CommandEvent):
5ba5649b 6364 """
943e8dfd
RD
6365 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6366 when the GUI window is destroyed.
6367
6368 When a class derived from `wx.Window` is destroyed its destructor will
6369 have already run by the time this event is sent. Therefore this event
6370 will not usually be received at all by the window itself. Since it is
6371 received after the destructor has run, an object should not try to
6372 handle its own wx.WindowDestroyEvent, but it can be used to get
6373 notification of the destruction of another window.
5ba5649b 6374 """
1bd55598
RD
6375 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6376 __repr__ = _swig_repr
6377 def __init__(self, *args, **kwargs):
5ba5649b
RD
6378 """
6379 __init__(self, Window win=None) -> WindowDestroyEvent
6380
943e8dfd
RD
6381 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6382 when the GUI window is destroyed.
6383
6384 When a class derived from `wx.Window` is destroyed its destructor will
6385 have already run by the time this event is sent. Therefore this event
6386 will not usually be received at all by the window itself. Since it is
6387 received after the destructor has run, an object should not try to
6388 handle its own wx.WindowDestroyEvent, but it can be used to get
6389 notification of the destruction of another window.
5ba5649b 6390 """
1bd55598 6391 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
d55e5bfc 6392 def GetWindow(*args, **kwargs):
5ba5649b
RD
6393 """
6394 GetWindow(self) -> Window
6395
6396 Returns the window that this event refers to.
6397 """
5b5c9bc7 6398 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
d55e5bfc 6399
dba7934c 6400 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6401_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d55e5bfc
RD
6402
6403#---------------------------------------------------------------------------
6404
5b5c9bc7 6405class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6406 """
6407 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6408 give the application a chance to show a context (popup) menu.
6409 """
1bd55598
RD
6410 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6411 __repr__ = _swig_repr
6412 def __init__(self, *args, **kwargs):
5ba5649b 6413 """
2131d850 6414 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6415
6416 Constructor.
6417 """
1bd55598 6418 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
d55e5bfc 6419 def GetPosition(*args, **kwargs):
5ba5649b
RD
6420 """
6421 GetPosition(self) -> Point
6422
6423 Returns the position (in screen coordinants) at which the menu should
6424 be shown.
6425 """
5b5c9bc7 6426 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
6427
6428 def SetPosition(*args, **kwargs):
5ba5649b
RD
6429 """
6430 SetPosition(self, Point pos)
6431
6432 Sets the position at which the menu should be shown.
6433 """
5b5c9bc7 6434 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
d55e5bfc 6435
2bf58437 6436 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 6437_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d55e5bfc
RD
6438
6439#---------------------------------------------------------------------------
6440
5b5c9bc7
RD
6441IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6442IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6443class IdleEvent(Event):
5ba5649b
RD
6444 """
6445 This class is used for EVT_IDLE events, which are generated and sent
6446 when the application *becomes* idle. In other words, the when the
6447 event queue becomes empty then idle events are sent to all windows (by
6448 default) and as long as none of them call `RequestMore` then there are
6449 no more idle events until after the system event queue has some normal
6450 events and then becomes empty again.
6451
6452 By default, idle events are sent to all windows. If this is causing a
6453 significant overhead in your application, you can call
6454 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6455 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6456 which should receive idle events. Then idle events will only be sent
6457 to those windows and not to any others.
6458 """
1bd55598
RD
6459 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6460 __repr__ = _swig_repr
6461 def __init__(self, *args, **kwargs):
5ba5649b
RD
6462 """
6463 __init__(self) -> IdleEvent
6464
6465 Constructor
6466 """
1bd55598 6467 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
d55e5bfc 6468 def RequestMore(*args, **kwargs):
5ba5649b
RD
6469 """
6470 RequestMore(self, bool needMore=True)
6471
6472 Tells wxWidgets that more processing is required. This function can be
6473 called by an EVT_IDLE handler for a window to indicate that the
6474 application should forward the EVT_IDLE event once more to the
6475 application windows. If no window calls this function during its
6476 EVT_IDLE handler, then the application will remain in a passive event
6477 loop until a new event is posted to the application by the windowing
6478 system.
6479 """
5b5c9bc7 6480 return _core_.IdleEvent_RequestMore(*args, **kwargs)
d55e5bfc
RD
6481
6482 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6483 """
6484 MoreRequested(self) -> bool
6485
6486 Returns ``True`` if the OnIdle function processing this event
6487 requested more processing time.
6488 """
5b5c9bc7 6489 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
d55e5bfc
RD
6490
6491 def SetMode(*args, **kwargs):
5ba5649b
RD
6492 """
6493 SetMode(int mode)
6494
6495 Static method for specifying how wxWidgets will send idle events: to
6496 all windows, or only to those which specify that they will process the
6497 events.
6498
6499 The mode can be one of the following values:
6500
6501 ========================= ========================================
6502 wx.IDLE_PROCESS_ALL Send idle events to all windows
6503 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6504 the wx.WS_EX_PROCESS_IDLE extra style
6505 flag set.
6506 ========================= ========================================
6507
6508 """
5b5c9bc7 6509 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
6510
6511 SetMode = staticmethod(SetMode)
6512 def GetMode(*args, **kwargs):
5ba5649b
RD
6513 """
6514 GetMode() -> int
6515
6516 Static method returning a value specifying how wxWidgets will send
6517 idle events: to all windows, or only to those which specify that they
6518 will process the events.
6519 """
5b5c9bc7 6520 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6521
6522 GetMode = staticmethod(GetMode)
6523 def CanSend(*args, **kwargs):
5ba5649b
RD
6524 """
6525 CanSend(Window win) -> bool
6526
6527 Returns ``True`` if it is appropriate to send idle events to this
6528 window.
6529
6530 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6531 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6532 events should be sent to this window now. By default this will always
6533 return ``True`` because the update mode is initially
6534 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6535 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6536 """
5b5c9bc7 6537 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6538
6539 CanSend = staticmethod(CanSend)
2131d850 6540_core_.IdleEvent_swigregister(IdleEvent)
d55e5bfc 6541
5b5c9bc7 6542def IdleEvent_SetMode(*args, **kwargs):
1bd55598 6543 """
5ba5649b
RD
6544 IdleEvent_SetMode(int mode)
6545
6546 Static method for specifying how wxWidgets will send idle events: to
6547 all windows, or only to those which specify that they will process the
6548 events.
6549
6550 The mode can be one of the following values:
6551
6552 ========================= ========================================
6553 wx.IDLE_PROCESS_ALL Send idle events to all windows
6554 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6555 the wx.WS_EX_PROCESS_IDLE extra style
6556 flag set.
6557 ========================= ========================================
6558
6559 """
1bd55598 6560 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6561
1bd55598
RD
6562def IdleEvent_GetMode(*args):
6563 """
5ba5649b
RD
6564 IdleEvent_GetMode() -> int
6565
6566 Static method returning a value specifying how wxWidgets will send
6567 idle events: to all windows, or only to those which specify that they
6568 will process the events.
6569 """
1bd55598 6570 return _core_.IdleEvent_GetMode(*args)
d55e5bfc 6571
5b5c9bc7 6572def IdleEvent_CanSend(*args, **kwargs):
1bd55598 6573 """
5ba5649b
RD
6574 IdleEvent_CanSend(Window win) -> bool
6575
6576 Returns ``True`` if it is appropriate to send idle events to this
6577 window.
6578
6579 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6580 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6581 events should be sent to this window now. By default this will always
6582 return ``True`` because the update mode is initially
6583 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6584 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6585 """
1bd55598 6586 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6587
6588#---------------------------------------------------------------------------
6589
2131d850
RD
6590class ClipboardTextEvent(CommandEvent):
6591 """
6592 A Clipboard Text event is sent when a window intercepts a text
6593 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6594 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6595 popup menu command, etc. NOTE : under windows these events are *NOT*
6596 generated automatically for a Rich Edit text control.
6597 """
6598 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6599 __repr__ = _swig_repr
6600 def __init__(self, *args, **kwargs):
6601 """
6602 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6603
6604 A Clipboard Text event is sent when a window intercepts a text
6605 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6606 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6607 popup menu command, etc. NOTE : under windows these events are *NOT*
6608 generated automatically for a Rich Edit text control.
6609 """
6610 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6611_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6612
6613#---------------------------------------------------------------------------
6614
5b5c9bc7 6615class PyEvent(Event):
5ba5649b
RD
6616 """
6617 wx.PyEvent can be used as a base class for implementing custom event
6618 types in Python. You should derived from this class instead of
6619 `wx.Event` because this class is Python-aware and is able to transport
6620 its Python bits safely through the wxWidgets event system and have
6621 them still be there when the event handler is invoked.
6622
6623 :see: `wx.PyCommandEvent`
6624
6625 """
1bd55598
RD
6626 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6627 __repr__ = _swig_repr
6628 def __init__(self, *args, **kwargs):
2131d850 6629 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
1bd55598 6630 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6631 self._SetSelf(self)
d55e5bfc 6632
1bd55598
RD
6633 __swig_destroy__ = _core_.delete_PyEvent
6634 __del__ = lambda self : None;
5ba5649b
RD
6635 def _SetSelf(*args, **kwargs):
6636 """_SetSelf(self, PyObject self)"""
6637 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6638
5ba5649b
RD
6639 def _GetSelf(*args, **kwargs):
6640 """_GetSelf(self) -> PyObject"""
6641 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc 6642
2131d850 6643_core_.PyEvent_swigregister(PyEvent)
d55e5bfc 6644
5b5c9bc7 6645class PyCommandEvent(CommandEvent):
5ba5649b
RD
6646 """
6647 wx.PyCommandEvent can be used as a base class for implementing custom
6648 event types in Python, where the event shoudl travel up to parent
6649 windows looking for a handler. You should derived from this class
6650 instead of `wx.CommandEvent` because this class is Python-aware and is
6651 able to transport its Python bits safely through the wxWidgets event
6652 system and have them still be there when the event handler is invoked.
6653
6654 :see: `wx.PyEvent`
6655
6656 """
1bd55598
RD
6657 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6658 __repr__ = _swig_repr
6659 def __init__(self, *args, **kwargs):
2131d850 6660 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
1bd55598 6661 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6662 self._SetSelf(self)
d55e5bfc 6663
1bd55598
RD
6664 __swig_destroy__ = _core_.delete_PyCommandEvent
6665 __del__ = lambda self : None;
5ba5649b
RD
6666 def _SetSelf(*args, **kwargs):
6667 """_SetSelf(self, PyObject self)"""
6668 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6669
5ba5649b
RD
6670 def _GetSelf(*args, **kwargs):
6671 """_GetSelf(self) -> PyObject"""
6672 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc 6673
2131d850 6674_core_.PyCommandEvent_swigregister(PyCommandEvent)
d55e5bfc 6675
5b5c9bc7 6676class DateEvent(CommandEvent):
5ba5649b
RD
6677 """
6678 This event class holds information about a date change event and is
6679 used together with `wx.DatePickerCtrl`. It also serves as a base class
6680 for `wx.calendar.CalendarEvent`. Bind these event types with
6681 EVT_DATE_CHANGED.
6682 """
1bd55598
RD
6683 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6684 __repr__ = _swig_repr
6685 def __init__(self, *args, **kwargs):
2131d850 6686 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
1bd55598 6687 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6688 def GetDate(*args, **kwargs):
5ba5649b
RD
6689 """
6690 GetDate(self) -> DateTime
6691
6692 Returns the date.
6693 """
5b5c9bc7 6694 return _core_.DateEvent_GetDate(*args, **kwargs)
53aa7709
RD
6695
6696 def SetDate(*args, **kwargs):
5ba5649b
RD
6697 """
6698 SetDate(self, DateTime date)
6699
6700 Sets the date carried by the event, normally only used by the library
6701 internally.
6702 """
5b5c9bc7 6703 return _core_.DateEvent_SetDate(*args, **kwargs)
53aa7709 6704
2bf58437 6705 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
2131d850 6706_core_.DateEvent_swigregister(DateEvent)
53aa7709 6707
5b5c9bc7 6708wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
53aa7709
RD
6709EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6710
d55e5bfc
RD
6711#---------------------------------------------------------------------------
6712
5b5c9bc7
RD
6713PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6714PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6715PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6716PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6717PRINT_WINDOWS = _core_.PRINT_WINDOWS
6718PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6719class PyApp(EvtHandler):
d6c14a4c
RD
6720 """
6721 The ``wx.PyApp`` class is an *implementation detail*, please use the
6722 `wx.App` class (or some other derived class) instead.
6723 """
1bd55598
RD
6724 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6725 __repr__ = _swig_repr
6726 def __init__(self, *args, **kwargs):
d55e5bfc 6727 """
5b5c9bc7 6728 __init__(self) -> PyApp
d55e5bfc
RD
6729
6730 Create a new application object, starting the bootstrap process.
6731 """
1bd55598 6732 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
7993762b
RD
6733 self._setCallbackInfo(self, PyApp, False)
6734 self._setOORInfo(self, False)
d55e5bfc 6735
1bd55598
RD
6736 __swig_destroy__ = _core_.delete_PyApp
6737 __del__ = lambda self : None;
d55e5bfc 6738 def _setCallbackInfo(*args, **kwargs):
7993762b 6739 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
5b5c9bc7 6740 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
6741
6742 def GetAppName(*args, **kwargs):
6743 """
5b5c9bc7 6744 GetAppName(self) -> String
d55e5bfc
RD
6745
6746 Get the application name.
6747 """
5b5c9bc7 6748 return _core_.PyApp_GetAppName(*args, **kwargs)
d55e5bfc
RD
6749
6750 def SetAppName(*args, **kwargs):
6751 """
5b5c9bc7 6752 SetAppName(self, String name)
d55e5bfc 6753
d6c14a4c
RD
6754 Set the application name. This value may be used automatically by
6755 `wx.Config` and such.
d55e5bfc 6756 """
5b5c9bc7 6757 return _core_.PyApp_SetAppName(*args, **kwargs)
d55e5bfc
RD
6758
6759 def GetClassName(*args, **kwargs):
6760 """
5b5c9bc7 6761 GetClassName(self) -> String
d55e5bfc
RD
6762
6763 Get the application's class name.
6764 """
5b5c9bc7 6765 return _core_.PyApp_GetClassName(*args, **kwargs)
d55e5bfc
RD
6766
6767 def SetClassName(*args, **kwargs):
6768 """
5b5c9bc7 6769 SetClassName(self, String name)
d55e5bfc 6770
d6c14a4c
RD
6771 Set the application's class name. This value may be used for
6772 X-resources if applicable for the platform
d55e5bfc 6773 """
5b5c9bc7 6774 return _core_.PyApp_SetClassName(*args, **kwargs)
d55e5bfc
RD
6775
6776 def GetVendorName(*args, **kwargs):
6777 """
5b5c9bc7 6778 GetVendorName(self) -> String
d55e5bfc
RD
6779
6780 Get the application's vendor name.
6781 """
5b5c9bc7 6782 return _core_.PyApp_GetVendorName(*args, **kwargs)
d55e5bfc
RD
6783
6784 def SetVendorName(*args, **kwargs):
6785 """
5b5c9bc7 6786 SetVendorName(self, String name)
d55e5bfc 6787
d6c14a4c
RD
6788 Set the application's vendor name. This value may be used
6789 automatically by `wx.Config` and such.
d55e5bfc 6790 """
5b5c9bc7 6791 return _core_.PyApp_SetVendorName(*args, **kwargs)
d55e5bfc
RD
6792
6793 def GetTraits(*args, **kwargs):
6794 """
6795 GetTraits(self) -> wxAppTraits
6796
d6c14a4c
RD
6797 Return (and create if necessary) the app traits object to which we
6798 delegate for everything which either should be configurable by the
6799 user (then he can change the default behaviour simply by overriding
6800 CreateTraits() and returning his own traits object) or which is
6801 GUI/console dependent as then wx.AppTraits allows us to abstract the
6802 differences behind the common facade.
6803
6804 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc 6805 """
5b5c9bc7 6806 return _core_.PyApp_GetTraits(*args, **kwargs)
d55e5bfc
RD
6807
6808 def ProcessPendingEvents(*args, **kwargs):
6809 """
6810 ProcessPendingEvents(self)
6811
d6c14a4c
RD
6812 Process all events in the Pending Events list -- it is necessary to
6813 call this function to process posted events. This normally happens
6814 during each event loop iteration.
d55e5bfc 6815 """
5b5c9bc7 6816 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
6817
6818 def Yield(*args, **kwargs):
6819 """
6820 Yield(self, bool onlyIfNeeded=False) -> bool
6821
d6c14a4c
RD
6822 Process all currently pending events right now, instead of waiting
6823 until return to the event loop. It is an error to call ``Yield``
6824 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 6825
d6c14a4c 6826 :warning: This function is dangerous as it can lead to unexpected
15817c7e
RD
6827 reentrancies (i.e. when called from an event handler it may
6828 result in calling the same event handler again), use with
6829 extreme care or, better, don't use at all!
d55e5bfc 6830
d6c14a4c 6831 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
15817c7e 6832
d55e5bfc 6833 """
5b5c9bc7 6834 return _core_.PyApp_Yield(*args, **kwargs)
d55e5bfc
RD
6835
6836 def WakeUpIdle(*args, **kwargs):
6837 """
6838 WakeUpIdle(self)
6839
d6c14a4c
RD
6840 Make sure that idle events are sent again.
6841 :see: `wx.WakeUpIdle`
d55e5bfc 6842 """
5b5c9bc7 6843 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
d55e5bfc 6844
84f85550
RD
6845 def IsMainLoopRunning(*args, **kwargs):
6846 """
6847 IsMainLoopRunning() -> bool
6848
6849 Returns True if we're running the main loop, i.e. if the events can
6850 currently be dispatched.
6851 """
5b5c9bc7 6852 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550
RD
6853
6854 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
6855 def MainLoop(*args, **kwargs):
6856 """
6857 MainLoop(self) -> int
6858
d6c14a4c
RD
6859 Execute the main GUI loop, the function doesn't normally return until
6860 all top level windows have been closed and destroyed.
d55e5bfc 6861 """
5b5c9bc7 6862 return _core_.PyApp_MainLoop(*args, **kwargs)
d55e5bfc
RD
6863
6864 def Exit(*args, **kwargs):
6865 """
6866 Exit(self)
6867
6868 Exit the main loop thus terminating the application.
d6c14a4c 6869 :see: `wx.Exit`
d55e5bfc 6870 """
5b5c9bc7 6871 return _core_.PyApp_Exit(*args, **kwargs)
d55e5bfc 6872
ac5d357a
RD
6873 def GetLayoutDirection(*args, **kwargs):
6874 """
994453b8 6875 GetLayoutDirection(self) -> int
ac5d357a
RD
6876
6877 Return the layout direction for the current locale.
6878 """
6879 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
6880
d55e5bfc
RD
6881 def ExitMainLoop(*args, **kwargs):
6882 """
6883 ExitMainLoop(self)
6884
d6c14a4c
RD
6885 Exit the main GUI loop during the next iteration of the main
6886 loop, (i.e. it does not stop the program immediately!)
d55e5bfc 6887 """
5b5c9bc7 6888 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
d55e5bfc
RD
6889
6890 def Pending(*args, **kwargs):
6891 """
6892 Pending(self) -> bool
6893
6894 Returns True if there are unprocessed events in the event queue.
6895 """
5b5c9bc7 6896 return _core_.PyApp_Pending(*args, **kwargs)
d55e5bfc
RD
6897
6898 def Dispatch(*args, **kwargs):
6899 """
6900 Dispatch(self) -> bool
6901
6902 Process the first event in the event queue (blocks until an event
6903 appears if there are none currently)
6904 """
5b5c9bc7 6905 return _core_.PyApp_Dispatch(*args, **kwargs)
d55e5bfc
RD
6906
6907 def ProcessIdle(*args, **kwargs):
6908 """
6909 ProcessIdle(self) -> bool
6910
d6c14a4c
RD
6911 Called from the MainLoop when the application becomes idle (there are
6912 no pending events) and sends a `wx.IdleEvent` to all interested
6913 parties. Returns True if more idle events are needed, False if not.
d55e5bfc 6914 """
5b5c9bc7 6915 return _core_.PyApp_ProcessIdle(*args, **kwargs)
d55e5bfc
RD
6916
6917 def SendIdleEvents(*args, **kwargs):
6918 """
5b5c9bc7 6919 SendIdleEvents(self, Window win, IdleEvent event) -> bool
d55e5bfc 6920
d6c14a4c
RD
6921 Send idle event to window and all subwindows. Returns True if more
6922 idle time is requested.
d55e5bfc 6923 """
5b5c9bc7 6924 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
d55e5bfc
RD
6925
6926 def IsActive(*args, **kwargs):
6927 """
6928 IsActive(self) -> bool
6929
6930 Return True if our app has focus.
6931 """
5b5c9bc7 6932 return _core_.PyApp_IsActive(*args, **kwargs)
d55e5bfc
RD
6933
6934 def SetTopWindow(*args, **kwargs):
6935 """
5b5c9bc7 6936 SetTopWindow(self, Window win)
d55e5bfc 6937
d6c14a4c 6938 Set the *main* top level window
d55e5bfc 6939 """
5b5c9bc7 6940 return _core_.PyApp_SetTopWindow(*args, **kwargs)
d55e5bfc
RD
6941
6942 def GetTopWindow(*args, **kwargs):
6943 """
5b5c9bc7 6944 GetTopWindow(self) -> Window
d55e5bfc 6945
d6c14a4c
RD
6946 Return the *main* top level window (if it hadn't been set previously
6947 with SetTopWindow(), will return just some top level window and, if
6948 there not any, will return None)
d55e5bfc 6949 """
5b5c9bc7 6950 return _core_.PyApp_GetTopWindow(*args, **kwargs)
d55e5bfc
RD
6951
6952 def SetExitOnFrameDelete(*args, **kwargs):
6953 """
6954 SetExitOnFrameDelete(self, bool flag)
6955
d6c14a4c
RD
6956 Control the exit behaviour: by default, the program will exit the main
6957 loop (and so, usually, terminate) when the last top-level program
6958 window is deleted. Beware that if you disable this behaviour (with
6959 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6960 explicitly from somewhere.
d55e5bfc 6961 """
5b5c9bc7 6962 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6963
6964 def GetExitOnFrameDelete(*args, **kwargs):
6965 """
6966 GetExitOnFrameDelete(self) -> bool
6967
6968 Get the current exit behaviour setting.
6969 """
5b5c9bc7 6970 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6971
6972 def SetUseBestVisual(*args, **kwargs):
6973 """
6974 SetUseBestVisual(self, bool flag)
6975
d6c14a4c
RD
6976 Set whether the app should try to use the best available visual on
6977 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc 6978 """
5b5c9bc7 6979 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
6980
6981 def GetUseBestVisual(*args, **kwargs):
6982 """
6983 GetUseBestVisual(self) -> bool
6984
6985 Get current UseBestVisual setting.
6986 """
5b5c9bc7 6987 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
6988
6989 def SetPrintMode(*args, **kwargs):
6990 """SetPrintMode(self, int mode)"""
5b5c9bc7 6991 return _core_.PyApp_SetPrintMode(*args, **kwargs)
d55e5bfc
RD
6992
6993 def GetPrintMode(*args, **kwargs):
6994 """GetPrintMode(self) -> int"""
5b5c9bc7 6995 return _core_.PyApp_GetPrintMode(*args, **kwargs)
d55e5bfc
RD
6996
6997 def SetAssertMode(*args, **kwargs):
6998 """
6999 SetAssertMode(self, int mode)
7000
15817c7e 7001 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc 7002 """
5b5c9bc7 7003 return _core_.PyApp_SetAssertMode(*args, **kwargs)
d55e5bfc
RD
7004
7005 def GetAssertMode(*args, **kwargs):
7006 """
7007 GetAssertMode(self) -> int
7008
7009 Get the current OnAssert behaviour setting.
7010 """
5b5c9bc7 7011 return _core_.PyApp_GetAssertMode(*args, **kwargs)
d55e5bfc
RD
7012
7013 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 7014 """GetMacSupportPCMenuShortcuts() -> bool"""
5b5c9bc7 7015 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7016
7017 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7018 def GetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 7019 """GetMacAboutMenuItemId() -> long"""
5b5c9bc7 7020 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7021
7022 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7023 def GetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 7024 """GetMacPreferencesMenuItemId() -> long"""
5b5c9bc7 7025 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7026
7027 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7028 def GetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 7029 """GetMacExitMenuItemId() -> long"""
5b5c9bc7 7030 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7031
7032 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7033 def GetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
7034 """GetMacHelpMenuTitleName() -> String"""
7035 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
7036
7037 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7038 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 7039 """SetMacSupportPCMenuShortcuts(bool val)"""
5b5c9bc7 7040 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7041
7042 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7043 def SetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 7044 """SetMacAboutMenuItemId(long val)"""
5b5c9bc7 7045 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7046
7047 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7048 def SetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 7049 """SetMacPreferencesMenuItemId(long val)"""
5b5c9bc7 7050 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7051
7052 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7053 def SetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 7054 """SetMacExitMenuItemId(long val)"""
5b5c9bc7 7055 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7056
7057 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7058 def SetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
7059 """SetMacHelpMenuTitleName(String val)"""
7060 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
7061
7062 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7063 def _BootstrapApp(*args, **kwargs):
7064 """
7065 _BootstrapApp(self)
7066
7067 For internal use only
7068 """
5b5c9bc7 7069 return _core_.PyApp__BootstrapApp(*args, **kwargs)
d55e5bfc
RD
7070
7071 def GetComCtl32Version(*args, **kwargs):
7072 """
d6c14a4c 7073 GetComCtl32Version() -> int
d55e5bfc 7074
d6c14a4c
RD
7075 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7076 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 7077 """
5b5c9bc7 7078 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
7079
7080 GetComCtl32Version = staticmethod(GetComCtl32Version)
33d6fd3b 7081 def IsDisplayAvailable(*args, **kwargs):
fc46b7f3 7082 """
33d6fd3b 7083 IsDisplayAvailable() -> bool
fc46b7f3
RD
7084
7085 Tests if it is possible to create a GUI in the current environment.
7086 This will mean different things on the different platforms.
7087
7088 * On X Windows systems this function will return ``False`` if it is
7089 not able to open a connection to the X display, which can happen
7090 if $DISPLAY is not set, or is not set correctly.
7091
7092 * On Mac OS X a ``False`` return value will mean that wx is not
7093 able to access the window manager, which can happen if logged in
7094 remotely or if running from the normal version of python instead
7095 of the framework version, (i.e., pythonw.)
7096
7097 * On MS Windows...
7098
7099 """
33d6fd3b
RD
7100 return _core_.PyApp_IsDisplayAvailable(*args, **kwargs)
7101
7102 IsDisplayAvailable = staticmethod(IsDisplayAvailable)
7103 AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`")
7104 AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`")
7105 ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`")
7106 ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7107 LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`")
7108 PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`")
7109 TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`")
7110 Traits = property(GetTraits,doc="See `GetTraits`")
7111 UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`")
7112 VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`")
7113 Active = property(IsActive)
2131d850 7114_core_.PyApp_swigregister(PyApp)
d55e5bfc 7115
1bd55598
RD
7116def PyApp_IsMainLoopRunning(*args):
7117 """
5b5c9bc7 7118 PyApp_IsMainLoopRunning() -> bool
84f85550
RD
7119
7120 Returns True if we're running the main loop, i.e. if the events can
7121 currently be dispatched.
7122 """
1bd55598 7123 return _core_.PyApp_IsMainLoopRunning(*args)
84f85550 7124
1bd55598
RD
7125def PyApp_GetMacSupportPCMenuShortcuts(*args):
7126 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7127 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d55e5bfc 7128
1bd55598
RD
7129def PyApp_GetMacAboutMenuItemId(*args):
7130 """PyApp_GetMacAboutMenuItemId() -> long"""
7131 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d55e5bfc 7132
1bd55598
RD
7133def PyApp_GetMacPreferencesMenuItemId(*args):
7134 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7135 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d55e5bfc 7136
1bd55598
RD
7137def PyApp_GetMacExitMenuItemId(*args):
7138 """PyApp_GetMacExitMenuItemId() -> long"""
7139 return _core_.PyApp_GetMacExitMenuItemId(*args)
d55e5bfc 7140
1bd55598
RD
7141def PyApp_GetMacHelpMenuTitleName(*args):
7142 """PyApp_GetMacHelpMenuTitleName() -> String"""
7143 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d55e5bfc 7144
5b5c9bc7 7145def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
1bd55598
RD
7146 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7147 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 7148
5b5c9bc7 7149def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
1bd55598
RD
7150 """PyApp_SetMacAboutMenuItemId(long val)"""
7151 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 7152
5b5c9bc7 7153def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
1bd55598
RD
7154 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7155 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 7156
5b5c9bc7 7157def PyApp_SetMacExitMenuItemId(*args, **kwargs):
1bd55598
RD
7158 """PyApp_SetMacExitMenuItemId(long val)"""
7159 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 7160
5b5c9bc7 7161def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
1bd55598
RD
7162 """PyApp_SetMacHelpMenuTitleName(String val)"""
7163 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 7164
1bd55598
RD
7165def PyApp_GetComCtl32Version(*args):
7166 """
5b5c9bc7 7167 PyApp_GetComCtl32Version() -> int
d55e5bfc 7168
d6c14a4c
RD
7169 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7170 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 7171 """
1bd55598 7172 return _core_.PyApp_GetComCtl32Version(*args)
d55e5bfc 7173
33d6fd3b 7174def PyApp_IsDisplayAvailable(*args):
fc46b7f3 7175 """
33d6fd3b 7176 PyApp_IsDisplayAvailable() -> bool
fc46b7f3
RD
7177
7178 Tests if it is possible to create a GUI in the current environment.
7179 This will mean different things on the different platforms.
7180
7181 * On X Windows systems this function will return ``False`` if it is
7182 not able to open a connection to the X display, which can happen
7183 if $DISPLAY is not set, or is not set correctly.
7184
7185 * On Mac OS X a ``False`` return value will mean that wx is not
7186 able to access the window manager, which can happen if logged in
7187 remotely or if running from the normal version of python instead
7188 of the framework version, (i.e., pythonw.)
7189
7190 * On MS Windows...
7191
7192 """
33d6fd3b 7193 return _core_.PyApp_IsDisplayAvailable(*args)
fc46b7f3 7194
d55e5bfc
RD
7195#---------------------------------------------------------------------------
7196
7197
1bd55598
RD
7198def Exit(*args):
7199 """
5b5c9bc7 7200 Exit()
d55e5bfc
RD
7201
7202 Force an exit of the application. Convenience for wx.GetApp().Exit()
7203 """
1bd55598 7204 return _core_.Exit(*args)
d55e5bfc 7205
1bd55598
RD
7206def Yield(*args):
7207 """
5b5c9bc7 7208 Yield() -> bool
d55e5bfc
RD
7209
7210 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7211 """
1bd55598 7212 return _core_.Yield(*args)
d55e5bfc 7213
1bd55598
RD
7214def YieldIfNeeded(*args):
7215 """
5b5c9bc7 7216 YieldIfNeeded() -> bool
d55e5bfc
RD
7217
7218 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7219 """
1bd55598 7220 return _core_.YieldIfNeeded(*args)
d55e5bfc 7221
5b5c9bc7 7222def SafeYield(*args, **kwargs):
1bd55598 7223 """
5b5c9bc7 7224 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
d55e5bfc 7225
d6c14a4c
RD
7226 This function is similar to `wx.Yield`, except that it disables the
7227 user input to all program windows before calling `wx.Yield` and
7228 re-enables it again afterwards. If ``win`` is not None, this window
7229 will remain enabled, allowing the implementation of some limited user
7230 interaction.
d55e5bfc 7231
d6c14a4c 7232 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 7233 """
1bd55598 7234 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 7235
1bd55598
RD
7236def WakeUpIdle(*args):
7237 """
5b5c9bc7 7238 WakeUpIdle()
d55e5bfc 7239
d6c14a4c
RD
7240 Cause the message queue to become empty again, so idle events will be
7241 sent.
d55e5bfc 7242 """
1bd55598 7243 return _core_.WakeUpIdle(*args)
d55e5bfc 7244
5b5c9bc7 7245def PostEvent(*args, **kwargs):
1bd55598 7246 """
5b5c9bc7 7247 PostEvent(EvtHandler dest, Event event)
d55e5bfc 7248
d6c14a4c
RD
7249 Send an event to a window or other wx.EvtHandler to be processed
7250 later.
d55e5bfc 7251 """
1bd55598 7252 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 7253
1bd55598
RD
7254def App_CleanUp(*args):
7255 """
5b5c9bc7 7256 App_CleanUp()
d55e5bfc 7257
15817c7e 7258 For internal use only, it is used to cleanup after wxWidgets when
d6c14a4c 7259 Python shuts down.
d55e5bfc 7260 """
1bd55598 7261 return _core_.App_CleanUp(*args)
d55e5bfc 7262
1bd55598
RD
7263def GetApp(*args):
7264 """
5b5c9bc7 7265 GetApp() -> PyApp
d55e5bfc
RD
7266
7267 Return a reference to the current wx.App object.
7268 """
1bd55598 7269 return _core_.GetApp(*args)
5cbf236d 7270
5b5c9bc7 7271def SetDefaultPyEncoding(*args, **kwargs):
1bd55598 7272 """
5cbf236d
RD
7273 SetDefaultPyEncoding(string encoding)
7274
7275 Sets the encoding that wxPython will use when it needs to convert a
7276 Python string or unicode object to or from a wxString.
62d32a5f
RD
7277
7278 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7279 but please be aware that the default encoding within the same locale
7280 may be slightly different on different platforms. For example, please
7281 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7282 between the common latin/roman encodings.
5cbf236d 7283 """
1bd55598 7284 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 7285
1bd55598
RD
7286def GetDefaultPyEncoding(*args):
7287 """
5cbf236d
RD
7288 GetDefaultPyEncoding() -> string
7289
7290 Gets the current encoding that wxPython will use when it needs to
7291 convert a Python string or unicode object to or from a wxString.
7292 """
1bd55598 7293 return _core_.GetDefaultPyEncoding(*args)
d55e5bfc
RD
7294#----------------------------------------------------------------------
7295
7296class PyOnDemandOutputWindow:
7297 """
7298 A class that can be used for redirecting Python's stdout and
7299 stderr streams. It will do nothing until something is wrriten to
7300 the stream at which point it will create a Frame with a text area
7301 and write the text there.
7302 """
7303 def __init__(self, title = "wxPython: stdout/stderr"):
7304 self.frame = None
7305 self.title = title
412d302d
RD
7306 self.pos = wx.DefaultPosition
7307 self.size = (450, 300)
d55e5bfc
RD
7308 self.parent = None
7309
7310 def SetParent(self, parent):
7311 """Set the window to be used as the popup Frame's parent."""
7312 self.parent = parent
7313
7314
7315 def CreateOutputWindow(self, st):
412d302d
RD
7316 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7317 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 7318 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7319 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 7320 self.text.AppendText(st)
d55e5bfc 7321 self.frame.Show(True)
2131d850 7322 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
d55e5bfc
RD
7323
7324
7325 def OnCloseWindow(self, event):
7326 if self.frame is not None:
7327 self.frame.Destroy()
7328 self.frame = None
7329 self.text = None
7330
7331
7332 # These methods provide the file-like output behaviour.
7333 def write(self, text):
7334 """
7335 Create the output window if needed and write the string to it.
7336 If not called in the context of the gui thread then uses
7337 CallAfter to do the work there.
7338 """
7339 if self.frame is None:
7340 if not wx.Thread_IsMain():
7341 wx.CallAfter(self.CreateOutputWindow, text)
7342 else:
7343 self.CreateOutputWindow(text)
7344 else:
7345 if not wx.Thread_IsMain():
7346 wx.CallAfter(self.text.AppendText, text)
7347 else:
7348 self.text.AppendText(text)
7349
7350
7351 def close(self):
7352 if self.frame is not None:
7353 wx.CallAfter(self.frame.Close)
7354
7355
bb4524c4
RD
7356 def flush(self):
7357 pass
7358
7359
d55e5bfc
RD
7360
7361#----------------------------------------------------------------------
7362
7363_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
fc46b7f3 7364
d55e5bfc
RD
7365class App(wx.PyApp):
7366 """
d6c14a4c
RD
7367 The ``wx.App`` class represents the application and is used to:
7368
7369 * bootstrap the wxPython system and initialize the underlying
7370 gui toolkit
7371 * set and get application-wide properties
7372 * implement the windowing system main message or event loop,
7373 and to dispatch events to window instances
7374 * etc.
7375
7376 Every application must have a ``wx.App`` instance, and all
7377 creation of UI objects should be delayed until after the
7378 ``wx.App`` object has been created in order to ensure that the gui
7379 platform and wxWidgets have been fully initialized.
7380
7381 Normally you would derive from this class and implement an
7382 ``OnInit`` method that creates a frame and then calls
7383 ``self.SetTopWindow(frame)``.
7384
7385 :see: `wx.PySimpleApp` for a simpler app class that can be used
15817c7e 7386 directly.
d55e5bfc 7387 """
d6c14a4c 7388
d55e5bfc
RD
7389 outputWindowClass = PyOnDemandOutputWindow
7390
d6c14a4c
RD
7391 def __init__(self, redirect=_defRedirect, filename=None,
7392 useBestVisual=False, clearSigInt=True):
7393 """
7394 Construct a ``wx.App`` object.
7395
7396 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7397 redirected? Defaults to True on Windows and Mac, False
7398 otherwise. If `filename` is None then output will be
7399 redirected to a window that pops up as needed. (You can
7400 control what kind of window is created for the output by
7401 resetting the class variable ``outputWindowClass`` to a
7402 class of your choosing.)
7403
7404 :param filename: The name of a file to redirect output to, if
7405 redirect is True.
7406
7407 :param useBestVisual: Should the app try to use the best
7408 available visual provided by the system (only relevant on
7409 systems that have more than one visual.) This parameter
7410 must be used instead of calling `SetUseBestVisual` later
7411 on because it must be set before the underlying GUI
7412 toolkit is initialized.
7413
7414 :param clearSigInt: Should SIGINT be cleared? This allows the
7415 app to terminate upon a Ctrl-C in the console like other
7416 GUI apps will.
7417
7418 :note: You should override OnInit to do applicaition
7419 initialization to ensure that the system, toolkit and
7420 wxWidgets are fully initialized.
7421 """
fc46b7f3 7422
d55e5bfc
RD
7423 wx.PyApp.__init__(self)
7424
fc46b7f3 7425 # make sure we can create a GUI
33d6fd3b 7426 if not self.IsDisplayAvailable():
fc46b7f3
RD
7427
7428 if wx.Platform == "__WXMAC__":
7429 msg = """This program needs access to the screen.
7430Please run with 'pythonw', not 'python', and only when you are logged
7431in on the main display of your Mac."""
7432
7433 elif wx.Platform == "__WXGTK__":
7434 msg ="Unable to access the X Display, is $DISPLAY set properly?"
d55e5bfc 7435
fc46b7f3
RD
7436 else:
7437 msg = "Unable to create GUI"
7438 # TODO: more description is needed for wxMSW...
7439
7440 raise SystemExit(msg)
7441
d55e5bfc
RD
7442 # This has to be done before OnInit
7443 self.SetUseBestVisual(useBestVisual)
7444
7445 # Set the default handler for SIGINT. This fixes a problem
7446 # where if Ctrl-C is pressed in the console that started this
7447 # app then it will not appear to do anything, (not even send
7448 # KeyboardInterrupt???) but will later segfault on exit. By
7449 # setting the default handler then the app will exit, as
7450 # expected (depending on platform.)
d6c14a4c
RD
7451 if clearSigInt:
7452 try:
7453 import signal
7454 signal.signal(signal.SIGINT, signal.SIG_DFL)
7455 except:
7456 pass
d55e5bfc
RD
7457
7458 # Save and redirect the stdio to a window?
7459 self.stdioWin = None
7460 self.saveStdio = (_sys.stdout, _sys.stderr)
7461 if redirect:
7462 self.RedirectStdio(filename)
7463
8fb0e70a
RD
7464 # Use Python's install prefix as the default
7465 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7466
d55e5bfc
RD
7467 # This finishes the initialization of wxWindows and then calls
7468 # the OnInit that should be present in the derived class
7469 self._BootstrapApp()
7470
7471
2131d850
RD
7472 def OnPreInit(self):
7473 """
7474 Things that must be done after _BootstrapApp has done its
7475 thing, but would be nice if they were already done by the time
7476 that OnInit is called.
7477 """
7478 wx.StockGDI._initStockObjects()
7479
7480
66af7a75
RD
7481 def __del__(self, destroy=wx.PyApp.__del__):
7482 self.RestoreStdio() # Just in case the MainLoop was overridden
7483 destroy(self)
d55e5bfc 7484
7993762b
RD
7485 def Destroy(self):
7486 wx.PyApp.Destroy(self)
7487 self.thisown = 0
d55e5bfc
RD
7488
7489 def SetTopWindow(self, frame):
7490 """Set the \"main\" top level window"""
7491 if self.stdioWin:
7492 self.stdioWin.SetParent(frame)
7493 wx.PyApp.SetTopWindow(self, frame)
7494
7495
7496 def MainLoop(self):
7497 """Execute the main GUI event loop"""
7498 wx.PyApp.MainLoop(self)
7499 self.RestoreStdio()
7500
7501
7502 def RedirectStdio(self, filename=None):
7503 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7504 if filename:
7505 _sys.stdout = _sys.stderr = open(filename, 'a')
7506 else:
7507 self.stdioWin = self.outputWindowClass()
7508 _sys.stdout = _sys.stderr = self.stdioWin
7509
7510
7511 def RestoreStdio(self):
66af7a75
RD
7512 try:
7513 _sys.stdout, _sys.stderr = self.saveStdio
7514 except:
7515 pass
d55e5bfc
RD
7516
7517
412d302d
RD
7518 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7519 """
7520 Set the title, position and/or size of the output window if
f5b96ee1
RD
7521 the stdio has been redirected. This should be called before
7522 any output would cause the output window to be created.
412d302d
RD
7523 """
7524 if self.stdioWin:
7525 if title is not None:
7526 self.stdioWin.title = title
7527 if pos is not None:
7528 self.stdioWin.pos = pos
7529 if size is not None:
7530 self.stdioWin.size = size
7531
7532
7533
d55e5bfc 7534
d6c14a4c 7535# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7536App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7537App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7538App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7539App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7540App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7541App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7542App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7543App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7544App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7545App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7546App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7547
7548#----------------------------------------------------------------------------
7549
7550class PySimpleApp(wx.App):
7551 """
7552 A simple application class. You can just create one of these and
7553 then then make your top level windows later, and not have to worry
d6c14a4c 7554 about OnInit. For example::
d55e5bfc 7555
d6c14a4c
RD
7556 app = wx.PySimpleApp()
7557 frame = wx.Frame(None, title='Hello World')
7558 frame.Show()
7559 app.MainLoop()
7560
7561 :see: `wx.App`
7562 """
7563
7564 def __init__(self, redirect=False, filename=None,
7565 useBestVisual=False, clearSigInt=True):
7566 """
7567 :see: `wx.App.__init__`
7568 """
7569 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7570
7571 def OnInit(self):
d55e5bfc
RD
7572 return True
7573
7574
d6c14a4c 7575
d55e5bfc
RD
7576# Is anybody using this one?
7577class PyWidgetTester(wx.App):
7578 def __init__(self, size = (250, 100)):
7579 self.size = size
7580 wx.App.__init__(self, 0)
7581
7582 def OnInit(self):
7583 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7584 self.SetTopWindow(self.frame)
7585 return True
7586
d6c14a4c
RD
7587 def SetWidget(self, widgetClass, *args, **kwargs):
7588 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7589 self.frame.Show(True)
7590
7591#----------------------------------------------------------------------------
7592# DO NOT hold any other references to this object. This is how we
d6c14a4c 7593# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7594# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
d6c14a4c 7595# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7596
7597class __wxPyCleanup:
7598 def __init__(self):
7599 self.cleanup = _core_.App_CleanUp
7600 def __del__(self):
7601 self.cleanup()
7602
7603_sys.__wxPythonCleanup = __wxPyCleanup()
7604
7605## # another possible solution, but it gets called too early...
d6c14a4c
RD
7606## import atexit
7607## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7608
7609
7610#----------------------------------------------------------------------------
7611
7612#---------------------------------------------------------------------------
7613
5b5c9bc7
RD
7614class EventLoop(object):
7615 """Proxy of C++ EventLoop class"""
1bd55598
RD
7616 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7617 __repr__ = _swig_repr
7618 def __init__(self, *args, **kwargs):
5b5c9bc7 7619 """__init__(self) -> EventLoop"""
1bd55598
RD
7620 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7621 __swig_destroy__ = _core_.delete_EventLoop
7622 __del__ = lambda self : None;
b411df4a
RD
7623 def Run(*args, **kwargs):
7624 """Run(self) -> int"""
5b5c9bc7 7625 return _core_.EventLoop_Run(*args, **kwargs)
b411df4a
RD
7626
7627 def Exit(*args, **kwargs):
7628 """Exit(self, int rc=0)"""
5b5c9bc7 7629 return _core_.EventLoop_Exit(*args, **kwargs)
b411df4a
RD
7630
7631 def Pending(*args, **kwargs):
7632 """Pending(self) -> bool"""
5b5c9bc7 7633 return _core_.EventLoop_Pending(*args, **kwargs)
b411df4a
RD
7634
7635 def Dispatch(*args, **kwargs):
7636 """Dispatch(self) -> bool"""
5b5c9bc7 7637 return _core_.EventLoop_Dispatch(*args, **kwargs)
b411df4a
RD
7638
7639 def IsRunning(*args, **kwargs):
7640 """IsRunning(self) -> bool"""
5b5c9bc7 7641 return _core_.EventLoop_IsRunning(*args, **kwargs)
b411df4a
RD
7642
7643 def GetActive(*args, **kwargs):
5b5c9bc7
RD
7644 """GetActive() -> EventLoop"""
7645 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a
RD
7646
7647 GetActive = staticmethod(GetActive)
7648 def SetActive(*args, **kwargs):
5b5c9bc7
RD
7649 """SetActive(EventLoop loop)"""
7650 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a
RD
7651
7652 SetActive = staticmethod(SetActive)
2131d850 7653_core_.EventLoop_swigregister(EventLoop)
b411df4a 7654
1bd55598
RD
7655def EventLoop_GetActive(*args):
7656 """EventLoop_GetActive() -> EventLoop"""
7657 return _core_.EventLoop_GetActive(*args)
b411df4a 7658
5b5c9bc7 7659def EventLoop_SetActive(*args, **kwargs):
1bd55598
RD
7660 """EventLoop_SetActive(EventLoop loop)"""
7661 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a 7662
32fe5131
RD
7663class EventLoopActivator(object):
7664 """Proxy of C++ EventLoopActivator class"""
1bd55598
RD
7665 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7666 __repr__ = _swig_repr
7667 def __init__(self, *args, **kwargs):
32fe5131 7668 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
1bd55598
RD
7669 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7670 __swig_destroy__ = _core_.delete_EventLoopActivator
7671 __del__ = lambda self : None;
2131d850 7672_core_.EventLoopActivator_swigregister(EventLoopActivator)
32fe5131 7673
b411df4a
RD
7674#---------------------------------------------------------------------------
7675
eec1c382
RD
7676ACCEL_ALT = _core_.ACCEL_ALT
7677ACCEL_CTRL = _core_.ACCEL_CTRL
7678ACCEL_SHIFT = _core_.ACCEL_SHIFT
7679ACCEL_NORMAL = _core_.ACCEL_NORMAL
7680ACCEL_CMD = _core_.ACCEL_CMD
5b5c9bc7 7681class AcceleratorEntry(object):
d6c14a4c
RD
7682 """
7683 A class used to define items in an `wx.AcceleratorTable`. wxPython
7684 programs can choose to use wx.AcceleratorEntry objects, but using a
7685 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
15817c7e 7686 as well. See `__init__` for of the tuple values.
d6c14a4c
RD
7687
7688 :see: `wx.AcceleratorTable`
7689 """
1bd55598
RD
7690 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7691 __repr__ = _swig_repr
7692 def __init__(self, *args, **kwargs):
d6c14a4c 7693 """
5b5c9bc7 7694 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
d6c14a4c
RD
7695
7696 Construct a wx.AcceleratorEntry.
d6c14a4c 7697 """
1bd55598
RD
7698 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7699 __swig_destroy__ = _core_.delete_AcceleratorEntry
7700 __del__ = lambda self : None;
d55e5bfc 7701 def Set(*args, **kwargs):
d6c14a4c
RD
7702 """
7703 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 7704
d6c14a4c
RD
7705 (Re)set the attributes of a wx.AcceleratorEntry.
7706 :see `__init__`
7707 """
5b5c9bc7 7708 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc 7709
ac5d357a
RD
7710 def Create(*args, **kwargs):
7711 """
7712 Create(String str) -> AcceleratorEntry
7713
7714 Create accelerator corresponding to the specified string, or None if
7715 it coulnd't be parsed.
7716 """
7717 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7718
7719 Create = staticmethod(Create)
d55e5bfc 7720 def GetFlags(*args, **kwargs):
d6c14a4c
RD
7721 """
7722 GetFlags(self) -> int
7723
7724 Get the AcceleratorEntry's flags.
7725 """
5b5c9bc7 7726 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
d55e5bfc
RD
7727
7728 def GetKeyCode(*args, **kwargs):
d6c14a4c
RD
7729 """
7730 GetKeyCode(self) -> int
7731
7732 Get the AcceleratorEntry's keycode.
7733 """
5b5c9bc7 7734 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
7735
7736 def GetCommand(*args, **kwargs):
d6c14a4c
RD
7737 """
7738 GetCommand(self) -> int
7739
7740 Get the AcceleratorEntry's command ID.
7741 """
5b5c9bc7 7742 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
d55e5bfc 7743
ac5d357a
RD
7744 def IsOk(*args, **kwargs):
7745 """IsOk(self) -> bool"""
7746 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
7747
7748 def ToString(*args, **kwargs):
7749 """
7750 ToString(self) -> String
7751
7752 Returns a string representation for the this accelerator. The string
7753 is formatted using the <flags>-<keycode> format where <flags> maybe a
7754 hyphen-separed list of "shift|alt|ctrl"
7755
7756 """
7757 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
7758
7759 def FromString(*args, **kwargs):
7760 """
7761 FromString(self, String str) -> bool
7762
7763 Returns true if the given string correctly initialized this object.
7764 """
7765 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
7766
2bf58437
RD
7767 Command = property(GetCommand,doc="See `GetCommand`")
7768 Flags = property(GetFlags,doc="See `GetFlags`")
7769 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
2131d850 7770_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
d55e5bfc 7771
ac5d357a
RD
7772def AcceleratorEntry_Create(*args, **kwargs):
7773 """
7774 AcceleratorEntry_Create(String str) -> AcceleratorEntry
7775
7776 Create accelerator corresponding to the specified string, or None if
7777 it coulnd't be parsed.
7778 """
7779 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7780
5b5c9bc7 7781class AcceleratorTable(Object):
d6c14a4c
RD
7782 """
7783 An accelerator table allows the application to specify a table of
7784 keyboard shortcuts for menus or other commands. On Windows, menu or
7785 button commands are supported; on GTK, only menu commands are
7786 supported.
d6c14a4c 7787 """
1bd55598
RD
7788 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7789 __repr__ = _swig_repr
7790 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7791 """
7792 __init__(entries) -> AcceleratorTable
7793
d6c14a4c
RD
7794 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7795 items or or of 3-tuples (flags, keyCode, cmdID)
7796
7797 :see: `wx.AcceleratorEntry`
d55e5bfc 7798 """
1bd55598
RD
7799 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7800 __swig_destroy__ = _core_.delete_AcceleratorTable
7801 __del__ = lambda self : None;
d55e5bfc
RD
7802 def Ok(*args, **kwargs):
7803 """Ok(self) -> bool"""
5b5c9bc7 7804 return _core_.AcceleratorTable_Ok(*args, **kwargs)
d55e5bfc 7805
2131d850 7806_core_.AcceleratorTable_swigregister(AcceleratorTable)
d55e5bfc
RD
7807
7808
5b5c9bc7 7809def GetAccelFromString(*args, **kwargs):
1bd55598
RD
7810 """GetAccelFromString(String label) -> AcceleratorEntry"""
7811 return _core_.GetAccelFromString(*args, **kwargs)
d55e5bfc
RD
7812#---------------------------------------------------------------------------
7813
5b5c9bc7 7814class VisualAttributes(object):
d55e5bfc 7815 """struct containing all the visual attributes of a control"""
1bd55598
RD
7816 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7817 __repr__ = _swig_repr
7818 def __init__(self, *args, **kwargs):
d55e5bfc 7819 """
5b5c9bc7 7820 __init__(self) -> VisualAttributes
d55e5bfc
RD
7821
7822 struct containing all the visual attributes of a control
7823 """
1bd55598
RD
7824 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7825 __swig_destroy__ = _core_.delete_VisualAttributes
7826 __del__ = lambda self : None;
5b5c9bc7
RD
7827 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7828 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7829 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 7830_core_.VisualAttributes_swigregister(VisualAttributes)
5b5c9bc7 7831NullAcceleratorTable = cvar.NullAcceleratorTable
d55e5bfc
RD
7832PanelNameStr = cvar.PanelNameStr
7833
5b5c9bc7
RD
7834WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7835WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7836WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7837WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7838WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7839class Window(EvtHandler):
d55e5bfc
RD
7840 """
7841 wx.Window is the base class for all windows and represents any visible
7842 object on the screen. All controls, top level windows and so on are
7843 wx.Windows. Sizers and device contexts are not however, as they don't
7844 appear on screen themselves.
7845
7846 """
1bd55598
RD
7847 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7848 __repr__ = _swig_repr
7849 def __init__(self, *args, **kwargs):
d55e5bfc 7850 """
5b5c9bc7
RD
7851 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7852 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
d55e5bfc
RD
7853
7854 Construct and show a generic Window.
7855 """
1bd55598 7856 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d55e5bfc
RD
7857 self._setOORInfo(self)
7858
7859 def Create(*args, **kwargs):
7860 """
5b5c9bc7
RD
7861 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7862 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
d55e5bfc
RD
7863
7864 Create the GUI part of the Window for 2-phase creation mode.
7865 """
5b5c9bc7 7866 return _core_.Window_Create(*args, **kwargs)
d55e5bfc
RD
7867
7868 def Close(*args, **kwargs):
7869 """
7870 Close(self, bool force=False) -> bool
7871
7872 This function simply generates a EVT_CLOSE event whose handler usually
7873 tries to close the window. It doesn't close the window itself,
7874 however. If force is False (the default) then the window's close
7875 handler will be allowed to veto the destruction of the window.
d55e5bfc 7876 """
5b5c9bc7 7877 return _core_.Window_Close(*args, **kwargs)
d55e5bfc
RD
7878
7879 def Destroy(*args, **kwargs):
7880 """
7881 Destroy(self) -> bool
7882
7883 Destroys the window safely. Frames and dialogs are not destroyed
7884 immediately when this function is called -- they are added to a list
7885 of windows to be deleted on idle time, when all the window's events
7886 have been processed. This prevents problems with events being sent to
7887 non-existent windows.
7888
7889 Returns True if the window has either been successfully deleted, or it
7890 has been added to the list of windows pending real deletion.
7891 """
7e08d4ef
RD
7892 val = _core_.Window_Destroy(*args, **kwargs)
7893 args[0].thisown = 0
7894 return val
d55e5bfc
RD
7895
7896 def DestroyChildren(*args, **kwargs):
7897 """
7898 DestroyChildren(self) -> bool
7899
15817c7e
RD
7900 Destroys all children of a window. Called automatically by the
7901 destructor.
d55e5bfc 7902 """
5b5c9bc7 7903 return _core_.Window_DestroyChildren(*args, **kwargs)
d55e5bfc
RD
7904
7905 def IsBeingDeleted(*args, **kwargs):
7906 """
7907 IsBeingDeleted(self) -> bool
7908
7909 Is the window in the process of being deleted?
7910 """
5b5c9bc7 7911 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d55e5bfc 7912
d55e5bfc
RD
7913 def SetLabel(*args, **kwargs):
7914 """
5b5c9bc7 7915 SetLabel(self, String label)
d55e5bfc
RD
7916
7917 Set the text which the window shows in its label if applicable.
7918 """
5b5c9bc7 7919 return _core_.Window_SetLabel(*args, **kwargs)
d55e5bfc
RD
7920
7921 def GetLabel(*args, **kwargs):
7922 """
5b5c9bc7 7923 GetLabel(self) -> String
d55e5bfc 7924
15817c7e
RD
7925 Generic way of getting a label from any window, for identification
7926 purposes. The interpretation of this function differs from class to
7927 class. For frames and dialogs, the value returned is the title. For
7928 buttons or static text controls, it is the button text. This function
7929 can be useful for meta-programs such as testing tools or special-needs
7930 access programs)which need to identify windows by name.
d55e5bfc 7931 """
5b5c9bc7 7932 return _core_.Window_GetLabel(*args, **kwargs)
d55e5bfc
RD
7933
7934 def SetName(*args, **kwargs):
7935 """
5b5c9bc7 7936 SetName(self, String name)
d55e5bfc 7937
15817c7e
RD
7938 Sets the window's name. The window name is used for ressource setting
7939 in X, it is not the same as the window title/label
d55e5bfc 7940 """
5b5c9bc7 7941 return _core_.Window_SetName(*args, **kwargs)
d55e5bfc
RD
7942
7943 def GetName(*args, **kwargs):
7944 """
5b5c9bc7 7945 GetName(self) -> String
d55e5bfc 7946
15817c7e
RD
7947 Returns the windows name. This name is not guaranteed to be unique;
7948 it is up to the programmer to supply an appropriate name in the window
7949 constructor or via wx.Window.SetName.
d55e5bfc 7950 """
5b5c9bc7 7951 return _core_.Window_GetName(*args, **kwargs)
d55e5bfc
RD
7952
7953 def SetWindowVariant(*args, **kwargs):
7954 """
7955 SetWindowVariant(self, int variant)
7956
15817c7e
RD
7957 Sets the variant of the window/font size to use for this window, if
7958 the platform supports variants, for example, wxMac.
d55e5bfc 7959 """
5b5c9bc7 7960 return _core_.Window_SetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7961
7962 def GetWindowVariant(*args, **kwargs):
7963 """GetWindowVariant(self) -> int"""
5b5c9bc7 7964 return _core_.Window_GetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7965
7966 def SetId(*args, **kwargs):
7967 """
7968 SetId(self, int winid)
7969
7970 Sets the identifier of the window. Each window has an integer
7971 identifier. If the application has not provided one, an identifier
7972 will be generated. Normally, the identifier should be provided on
7973 creation and should not be modified subsequently.
7974 """
5b5c9bc7 7975 return _core_.Window_SetId(*args, **kwargs)
d55e5bfc
RD
7976
7977 def GetId(*args, **kwargs):
7978 """
7979 GetId(self) -> int
7980
7981 Returns the identifier of the window. Each window has an integer
7982 identifier. If the application has not provided one (or the default Id
7983 -1 is used) then an unique identifier with a negative value will be
7984 generated.
7985 """
5b5c9bc7 7986 return _core_.Window_GetId(*args, **kwargs)
d55e5bfc
RD
7987
7988 def NewControlId(*args, **kwargs):
7989 """
d6c14a4c 7990 NewControlId() -> int
d55e5bfc
RD
7991
7992 Generate a control id for the controls which were not given one.
7993 """
5b5c9bc7 7994 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc
RD
7995
7996 NewControlId = staticmethod(NewControlId)
7997 def NextControlId(*args, **kwargs):
7998 """
d6c14a4c 7999 NextControlId(int winid) -> int
d55e5bfc
RD
8000
8001 Get the id of the control following the one with the given
15817c7e 8002 autogenerated) id
d55e5bfc 8003 """
5b5c9bc7 8004 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
8005
8006 NextControlId = staticmethod(NextControlId)
8007 def PrevControlId(*args, **kwargs):
8008 """
d6c14a4c 8009 PrevControlId(int winid) -> int
d55e5bfc
RD
8010
8011 Get the id of the control preceding the one with the given
15817c7e 8012 autogenerated) id
d55e5bfc 8013 """
5b5c9bc7 8014 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc
RD
8015
8016 PrevControlId = staticmethod(PrevControlId)
ac5d357a
RD
8017 def GetLayoutDirection(*args, **kwargs):
8018 """
994453b8 8019 GetLayoutDirection(self) -> int
ac5d357a
RD
8020
8021 Get the layout direction (LTR or RTL) for this window. Returns
8022 ``wx.Layout_Default`` if layout direction is not supported.
8023 """
8024 return _core_.Window_GetLayoutDirection(*args, **kwargs)
8025
8026 def SetLayoutDirection(*args, **kwargs):
8027 """
994453b8 8028 SetLayoutDirection(self, int dir)
ac5d357a
RD
8029
8030 Set the layout direction (LTR or RTL) for this window.
8031 """
8032 return _core_.Window_SetLayoutDirection(*args, **kwargs)
8033
8034 def AdjustForLayoutDirection(*args, **kwargs):
8035 """
8036 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
8037
8038 Mirror coordinates for RTL layout if this window uses it and if the
8039 mirroring is not done automatically like Win32.
8040 """
8041 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
8042
d55e5bfc
RD
8043 def SetSize(*args, **kwargs):
8044 """
5b5c9bc7 8045 SetSize(self, Size size)
d55e5bfc
RD
8046
8047 Sets the size of the window in pixels.
8048 """
5b5c9bc7 8049 return _core_.Window_SetSize(*args, **kwargs)
d55e5bfc
RD
8050
8051 def SetDimensions(*args, **kwargs):
8052 """
5b5c9bc7 8053 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
8054
8055 Sets the position and size of the window in pixels. The sizeFlags
8056 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
8057 equal to -1.
8058
8059 ======================== ======================================
8060 wx.SIZE_AUTO A -1 indicates that a class-specific
8061 default should be used.
8062 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8063 -1 values are supplied.
8064 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8065 interpreted as real dimensions, not
8066 default values.
8067 ======================== ======================================
8068
d55e5bfc 8069 """
5b5c9bc7 8070 return _core_.Window_SetDimensions(*args, **kwargs)
d55e5bfc
RD
8071
8072 def SetRect(*args, **kwargs):
8073 """
5b5c9bc7 8074 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
8075
8076 Sets the position and size of the window in pixels using a wx.Rect.
8077 """
5b5c9bc7 8078 return _core_.Window_SetRect(*args, **kwargs)
d55e5bfc
RD
8079
8080 def SetSizeWH(*args, **kwargs):
8081 """
8082 SetSizeWH(self, int width, int height)
8083
8084 Sets the size of the window in pixels.
8085 """
5b5c9bc7 8086 return _core_.Window_SetSizeWH(*args, **kwargs)
d55e5bfc
RD
8087
8088 def Move(*args, **kwargs):
8089 """
5b5c9bc7 8090 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
8091
8092 Moves the window to the given position.
8093 """
5b5c9bc7 8094 return _core_.Window_Move(*args, **kwargs)
d55e5bfc
RD
8095
8096 SetPosition = Move
8097 def MoveXY(*args, **kwargs):
8098 """
5b5c9bc7 8099 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
8100
8101 Moves the window to the given position.
8102 """
5b5c9bc7 8103 return _core_.Window_MoveXY(*args, **kwargs)
d55e5bfc 8104
f8167d6e
RD
8105 def SetBestFittingSize(*args, **kwargs):
8106 """
5b5c9bc7 8107 SetBestFittingSize(self, Size size=DefaultSize)
f8167d6e
RD
8108
8109 A 'Smart' SetSize that will fill in default size components with the
8110 window's *best size* values. Also set's the minsize for use with sizers.
8111 """
5b5c9bc7 8112 return _core_.Window_SetBestFittingSize(*args, **kwargs)
f8167d6e 8113
d55e5bfc
RD
8114 def Raise(*args, **kwargs):
8115 """
8116 Raise(self)
8117
943e8dfd
RD
8118 Raises the window to the top of the window hierarchy. In current
8119 version of wxWidgets this works both for manage and child windows.
d55e5bfc 8120 """
5b5c9bc7 8121 return _core_.Window_Raise(*args, **kwargs)
d55e5bfc
RD
8122
8123 def Lower(*args, **kwargs):
8124 """
8125 Lower(self)
8126
943e8dfd
RD
8127 Lowers the window to the bottom of the window hierarchy. In current
8128 version of wxWidgets this works both for manage and child windows.
d55e5bfc 8129 """
5b5c9bc7 8130 return _core_.Window_Lower(*args, **kwargs)
d55e5bfc
RD
8131
8132 def SetClientSize(*args, **kwargs):
8133 """
5b5c9bc7 8134 SetClientSize(self, Size size)
d55e5bfc
RD
8135
8136 This sets the size of the window client area in pixels. Using this
8137 function to size a window tends to be more device-independent than
8138 wx.Window.SetSize, since the application need not worry about what
8139 dimensions the border or title bar have when trying to fit the window
8140 around panel items, for example.
8141 """
5b5c9bc7 8142 return _core_.Window_SetClientSize(*args, **kwargs)
d55e5bfc
RD
8143
8144 def SetClientSizeWH(*args, **kwargs):
8145 """
8146 SetClientSizeWH(self, int width, int height)
8147
8148 This sets the size of the window client area in pixels. Using this
8149 function to size a window tends to be more device-independent than
8150 wx.Window.SetSize, since the application need not worry about what
8151 dimensions the border or title bar have when trying to fit the window
8152 around panel items, for example.
8153 """
5b5c9bc7 8154 return _core_.Window_SetClientSizeWH(*args, **kwargs)
d55e5bfc
RD
8155
8156 def SetClientRect(*args, **kwargs):
8157 """
5b5c9bc7 8158 SetClientRect(self, Rect rect)
d55e5bfc
RD
8159
8160 This sets the size of the window client area in pixels. Using this
8161 function to size a window tends to be more device-independent than
8162 wx.Window.SetSize, since the application need not worry about what
8163 dimensions the border or title bar have when trying to fit the window
8164 around panel items, for example.
8165 """
5b5c9bc7 8166 return _core_.Window_SetClientRect(*args, **kwargs)
d55e5bfc
RD
8167
8168 def GetPosition(*args, **kwargs):
8169 """
5b5c9bc7 8170 GetPosition(self) -> Point
d55e5bfc 8171
1c71765a
RD
8172 Get the window's position. Notice that the position is in client
8173 coordinates for child windows and screen coordinates for the top level
8174 ones, use `GetScreenPosition` if you need screen coordinates for all
8175 kinds of windows.
d55e5bfc 8176 """
5b5c9bc7 8177 return _core_.Window_GetPosition(*args, **kwargs)
d55e5bfc
RD
8178
8179 def GetPositionTuple(*args, **kwargs):
8180 """
8181 GetPositionTuple() -> (x,y)
8182
1c71765a
RD
8183 Get the window's position. Notice that the position is in client
8184 coordinates for child windows and screen coordinates for the top level
8185 ones, use `GetScreenPosition` if you need screen coordinates for all
8186 kinds of windows.
d55e5bfc 8187 """
5b5c9bc7 8188 return _core_.Window_GetPositionTuple(*args, **kwargs)
d55e5bfc 8189
1c71765a
RD
8190 def GetScreenPosition(*args, **kwargs):
8191 """
8192 GetScreenPosition(self) -> Point
8193
8194 Get the position of the window in screen coordinantes.
8195 """
8196 return _core_.Window_GetScreenPosition(*args, **kwargs)
8197
8198 def GetScreenPositionTuple(*args, **kwargs):
8199 """
8200 GetScreenPositionTuple() -> (x,y)
8201
8202 Get the position of the window in screen coordinantes.
8203 """
8204 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8205
8206 def GetScreenRect(*args, **kwargs):
8207 """
8208 GetScreenRect(self) -> Rect
8209
8210 Returns the size and position of the window in screen coordinantes as
8211 a `wx.Rect` object.
8212 """
8213 return _core_.Window_GetScreenRect(*args, **kwargs)
8214
d55e5bfc
RD
8215 def GetSize(*args, **kwargs):
8216 """
5b5c9bc7 8217 GetSize(self) -> Size
d55e5bfc
RD
8218
8219 Get the window size.
8220 """
5b5c9bc7 8221 return _core_.Window_GetSize(*args, **kwargs)
d55e5bfc
RD
8222
8223 def GetSizeTuple(*args, **kwargs):
8224 """
8225 GetSizeTuple() -> (width, height)
8226
8227 Get the window size.
8228 """
5b5c9bc7 8229 return _core_.Window_GetSizeTuple(*args, **kwargs)
d55e5bfc
RD
8230
8231 def GetRect(*args, **kwargs):
8232 """
5b5c9bc7 8233 GetRect(self) -> Rect
d55e5bfc 8234
1c71765a 8235 Returns the size and position of the window as a `wx.Rect` object.
d55e5bfc 8236 """
5b5c9bc7 8237 return _core_.Window_GetRect(*args, **kwargs)
d55e5bfc
RD
8238
8239 def GetClientSize(*args, **kwargs):
8240 """
5b5c9bc7 8241 GetClientSize(self) -> Size
d55e5bfc
RD
8242
8243 This gets the size of the window's 'client area' in pixels. The client
8244 area is the area which may be drawn on by the programmer, excluding
8245 title bar, border, scrollbars, etc.
8246 """
5b5c9bc7 8247 return _core_.Window_GetClientSize(*args, **kwargs)
d55e5bfc
RD
8248
8249 def GetClientSizeTuple(*args, **kwargs):
8250 """
8251 GetClientSizeTuple() -> (width, height)
8252
8253 This gets the size of the window's 'client area' in pixels. The client
8254 area is the area which may be drawn on by the programmer, excluding
8255 title bar, border, scrollbars, etc.
8256 """
5b5c9bc7 8257 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
d55e5bfc
RD
8258
8259 def GetClientAreaOrigin(*args, **kwargs):
8260 """
5b5c9bc7 8261 GetClientAreaOrigin(self) -> Point
d55e5bfc
RD
8262
8263 Get the origin of the client area of the window relative to the
8264 window's top left corner (the client area may be shifted because of
8265 the borders, scrollbars, other decorations...)
8266 """
5b5c9bc7 8267 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
d55e5bfc
RD
8268
8269 def GetClientRect(*args, **kwargs):
8270 """
5b5c9bc7 8271 GetClientRect(self) -> Rect
d55e5bfc 8272
0439c23b 8273 Get the client area position and size as a `wx.Rect` object.
d55e5bfc 8274 """
5b5c9bc7 8275 return _core_.Window_GetClientRect(*args, **kwargs)
d55e5bfc
RD
8276
8277 def GetBestSize(*args, **kwargs):
8278 """
5b5c9bc7 8279 GetBestSize(self) -> Size
d55e5bfc 8280
bfddbb17 8281 This function returns the best acceptable minimal size for the
15817c7e
RD
8282 window, if applicable. For example, for a static text control, it will
8283 be the minimal size such that the control label is not truncated. For
8284 windows containing subwindows (suzh aswx.Panel), the size returned by
8285 this function will be the same as the size the window would have had
8286 after calling Fit.
d55e5bfc 8287 """
5b5c9bc7 8288 return _core_.Window_GetBestSize(*args, **kwargs)
d55e5bfc
RD
8289
8290 def GetBestSizeTuple(*args, **kwargs):
8291 """
8292 GetBestSizeTuple() -> (width, height)
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_GetBestSizeTuple(*args, **kwargs)
d55e5bfc 8302
a001823c
RD
8303 def InvalidateBestSize(*args, **kwargs):
8304 """
8305 InvalidateBestSize(self)
8306
8307 Reset the cached best size value so it will be recalculated the next
8308 time it is needed.
8309 """
5b5c9bc7 8310 return _core_.Window_InvalidateBestSize(*args, **kwargs)
a001823c 8311
e2813725
RD
8312 def CacheBestSize(*args, **kwargs):
8313 """
8314 CacheBestSize(self, Size size)
8315
8316 Cache the best size so it doesn't need to be calculated again, (at least until
8317 some properties of the window change.)
8318 """
8319 return _core_.Window_CacheBestSize(*args, **kwargs)
8320
a001823c
RD
8321 def GetBestFittingSize(*args, **kwargs):
8322 """
5b5c9bc7 8323 GetBestFittingSize(self) -> Size
a001823c
RD
8324
8325 This function will merge the window's best size into the window's
8326 minimum size, giving priority to the min size components, and returns
8327 the results.
8328
8329 """
5b5c9bc7 8330 return _core_.Window_GetBestFittingSize(*args, **kwargs)
a001823c 8331
d55e5bfc
RD
8332 def GetAdjustedBestSize(*args, **kwargs):
8333 """
5b5c9bc7 8334 GetAdjustedBestSize(self) -> Size
d55e5bfc
RD
8335
8336 This method is similar to GetBestSize, except in one
8337 thing. GetBestSize should return the minimum untruncated size of the
8338 window, while this method will return the largest of BestSize and any
8339 user specified minimum size. ie. it is the minimum size the window
8340 should currently be drawn at, not the minimal size it can possibly
8341 tolerate.
8342 """
5b5c9bc7 8343 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
d55e5bfc
RD
8344
8345 def Center(*args, **kwargs):
8346 """
5b5c9bc7 8347 Center(self, int direction=BOTH)
d55e5bfc
RD
8348
8349 Centers the window. The parameter specifies the direction for
8350 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8351 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8352 on the entire screen and not on its parent window. If it is a
8353 top-level window and has no parent then it will always be centered
8354 relative to the screen.
8355 """
5b5c9bc7 8356 return _core_.Window_Center(*args, **kwargs)
d55e5bfc
RD
8357
8358 Centre = Center
d55e5bfc
RD
8359 def CenterOnParent(*args, **kwargs):
8360 """
5b5c9bc7 8361 CenterOnParent(self, int dir=BOTH)
d55e5bfc
RD
8362
8363 Center with respect to the the parent window
8364 """
5b5c9bc7 8365 return _core_.Window_CenterOnParent(*args, **kwargs)
d55e5bfc
RD
8366
8367 CentreOnParent = CenterOnParent
8368 def Fit(*args, **kwargs):
8369 """
8370 Fit(self)
8371
8372 Sizes the window so that it fits around its subwindows. This function
8373 won't do anything if there are no subwindows and will only really work
8374 correctly if sizers are used for the subwindows layout. Also, if the
8375 window has exactly one subwindow it is better (faster and the result
8376 is more precise as Fit adds some margin to account for fuzziness of
8377 its calculations) to call window.SetClientSize(child.GetSize())
8378 instead of calling Fit.
8379 """
5b5c9bc7 8380 return _core_.Window_Fit(*args, **kwargs)
d55e5bfc
RD
8381
8382 def FitInside(*args, **kwargs):
8383 """
8384 FitInside(self)
8385
8386 Similar to Fit, but sizes the interior (virtual) size of a
8387 window. Mainly useful with scrolled windows to reset scrollbars after
8388 sizing changes that do not trigger a size event, and/or scrolled
8389 windows without an interior sizer. This function similarly won't do
8390 anything if there are no subwindows.
8391 """
5b5c9bc7 8392 return _core_.Window_FitInside(*args, **kwargs)
d55e5bfc 8393
03837c5c 8394 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
8395 """
8396 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8397 int incH=-1)
d55e5bfc
RD
8398
8399 Allows specification of minimum and maximum window sizes, and window
8400 size increments. If a pair of values is not set (or set to -1), the
8401 default values will be used. If this function is called, the user
908b74cd
RD
8402 will not be able to size the window outside the given bounds (if it is
8403 a top-level window.) Sizers will also inspect the minimum window size
8404 and will use that value if set when calculating layout.
8405
8406 The resizing increments are only significant under Motif or Xt.
d55e5bfc 8407 """
5b5c9bc7 8408 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 8409
03837c5c
RD
8410 def SetSizeHintsSz(*args, **kwargs):
8411 """
5b5c9bc7 8412 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
03837c5c
RD
8413
8414 Allows specification of minimum and maximum window sizes, and window
8415 size increments. If a pair of values is not set (or set to -1), the
8416 default values will be used. If this function is called, the user
8417 will not be able to size the window outside the given bounds (if it is
8418 a top-level window.) Sizers will also inspect the minimum window size
8419 and will use that value if set when calculating layout.
8420
8421 The resizing increments are only significant under Motif or Xt.
8422 """
5b5c9bc7 8423 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
03837c5c
RD
8424
8425 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 8426 """
908b74cd 8427 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
8428
8429 Allows specification of minimum and maximum virtual window sizes. If a
8430 pair of values is not set (or set to -1), the default values will be
8431 used. If this function is called, the user will not be able to size
8432 the virtual area of the window outside the given bounds.
8433 """
5b5c9bc7 8434 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
03837c5c
RD
8435
8436 def SetVirtualSizeHintsSz(*args, **kwargs):
8437 """
5b5c9bc7 8438 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
03837c5c
RD
8439
8440 Allows specification of minimum and maximum virtual window sizes. If a
8441 pair of values is not set (or set to -1), the default values will be
8442 used. If this function is called, the user will not be able to size
8443 the virtual area of the window outside the given bounds.
8444 """
5b5c9bc7 8445 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 8446
908b74cd 8447 def GetMaxSize(*args, **kwargs):
5b5c9bc7
RD
8448 """GetMaxSize(self) -> Size"""
8449 return _core_.Window_GetMaxSize(*args, **kwargs)
908b74cd
RD
8450
8451 def GetMinSize(*args, **kwargs):
5b5c9bc7
RD
8452 """GetMinSize(self) -> Size"""
8453 return _core_.Window_GetMinSize(*args, **kwargs)
908b74cd
RD
8454
8455 def SetMinSize(*args, **kwargs):
8456 """
5b5c9bc7 8457 SetMinSize(self, Size minSize)
908b74cd
RD
8458
8459 A more convenient method than `SetSizeHints` for setting just the
8460 min size.
8461 """
5b5c9bc7 8462 return _core_.Window_SetMinSize(*args, **kwargs)
908b74cd
RD
8463
8464 def SetMaxSize(*args, **kwargs):
8465 """
5b5c9bc7 8466 SetMaxSize(self, Size maxSize)
908b74cd
RD
8467
8468 A more convenient method than `SetSizeHints` for setting just the
8469 max size.
8470 """
5b5c9bc7 8471 return _core_.Window_SetMaxSize(*args, **kwargs)
908b74cd 8472
d55e5bfc
RD
8473 def GetMinWidth(*args, **kwargs):
8474 """GetMinWidth(self) -> int"""
5b5c9bc7 8475 return _core_.Window_GetMinWidth(*args, **kwargs)
d55e5bfc
RD
8476
8477 def GetMinHeight(*args, **kwargs):
8478 """GetMinHeight(self) -> int"""
5b5c9bc7 8479 return _core_.Window_GetMinHeight(*args, **kwargs)
d55e5bfc
RD
8480
8481 def GetMaxWidth(*args, **kwargs):
8482 """GetMaxWidth(self) -> int"""
5b5c9bc7 8483 return _core_.Window_GetMaxWidth(*args, **kwargs)
d55e5bfc
RD
8484
8485 def GetMaxHeight(*args, **kwargs):
8486 """GetMaxHeight(self) -> int"""
5b5c9bc7 8487 return _core_.Window_GetMaxHeight(*args, **kwargs)
d55e5bfc 8488
d55e5bfc
RD
8489 def SetVirtualSize(*args, **kwargs):
8490 """
5b5c9bc7 8491 SetVirtualSize(self, Size size)
d55e5bfc
RD
8492
8493 Set the the virtual size of a window in pixels. For most windows this
8494 is just the client area of the window, but for some like scrolled
8495 windows it is more or less independent of the screen window size.
8496 """
5b5c9bc7 8497 return _core_.Window_SetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8498
8499 def SetVirtualSizeWH(*args, **kwargs):
8500 """
8501 SetVirtualSizeWH(self, int w, int h)
8502
8503 Set the the virtual size of a window in pixels. For most windows this
8504 is just the client area of the window, but for some like scrolled
8505 windows it is more or less independent of the screen window size.
8506 """
5b5c9bc7 8507 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
d55e5bfc
RD
8508
8509 def GetVirtualSize(*args, **kwargs):
8510 """
5b5c9bc7 8511 GetVirtualSize(self) -> Size
d55e5bfc
RD
8512
8513 Get the the virtual size of the window in pixels. For most windows
8514 this is just the client area of the window, but for some like scrolled
8515 windows it is more or less independent of the screen window size.
8516 """
5b5c9bc7 8517 return _core_.Window_GetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8518
8519 def GetVirtualSizeTuple(*args, **kwargs):
8520 """
8521 GetVirtualSizeTuple() -> (width, height)
8522
8523 Get the the virtual size of the window in pixels. For most windows
8524 this is just the client area of the window, but for some like scrolled
8525 windows it is more or less independent of the screen window size.
8526 """
5b5c9bc7 8527 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
d55e5bfc
RD
8528
8529 def GetBestVirtualSize(*args, **kwargs):
8530 """
5b5c9bc7 8531 GetBestVirtualSize(self) -> Size
d55e5bfc
RD
8532
8533 Return the largest of ClientSize and BestSize (as determined by a
8534 sizer, interior children, or other means)
8535 """
5b5c9bc7 8536 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
d55e5bfc
RD
8537
8538 def Show(*args, **kwargs):
8539 """
8540 Show(self, bool show=True) -> bool
8541
8542 Shows or hides the window. You may need to call Raise for a top level
8543 window if you want to bring it to top, although this is not needed if
8544 Show is called immediately after the frame creation. Returns True if
8545 the window has been shown or hidden or False if nothing was done
8546 because it already was in the requested state.
8547 """
5b5c9bc7 8548 return _core_.Window_Show(*args, **kwargs)
d55e5bfc
RD
8549
8550 def Hide(*args, **kwargs):
8551 """
8552 Hide(self) -> bool
8553
8554 Equivalent to calling Show(False).
8555 """
5b5c9bc7 8556 return _core_.Window_Hide(*args, **kwargs)
d55e5bfc
RD
8557
8558 def Enable(*args, **kwargs):
8559 """
8560 Enable(self, bool enable=True) -> bool
8561
8562 Enable or disable the window for user input. Note that when a parent
8563 window is disabled, all of its children are disabled as well and they
8564 are reenabled again when the parent is. Returns true if the window
8565 has been enabled or disabled, false if nothing was done, i.e. if the
8566 window had already been in the specified state.
8567 """
5b5c9bc7 8568 return _core_.Window_Enable(*args, **kwargs)
d55e5bfc
RD
8569
8570 def Disable(*args, **kwargs):
8571 """
8572 Disable(self) -> bool
8573
8574 Disables the window, same as Enable(false).
8575 """
5b5c9bc7 8576 return _core_.Window_Disable(*args, **kwargs)
d55e5bfc
RD
8577
8578 def IsShown(*args, **kwargs):
8579 """
8580 IsShown(self) -> bool
8581
8582 Returns true if the window is shown, false if it has been hidden.
8583 """
5b5c9bc7 8584 return _core_.Window_IsShown(*args, **kwargs)
d55e5bfc
RD
8585
8586 def IsEnabled(*args, **kwargs):
8587 """
8588 IsEnabled(self) -> bool
8589
8590 Returns true if the window is enabled for input, false otherwise.
8591 """
5b5c9bc7 8592 return _core_.Window_IsEnabled(*args, **kwargs)
d55e5bfc 8593
33d6fd3b
RD
8594 def IsShownOnScreen(*args, **kwargs):
8595 """
8596 IsShownOnScreen(self) -> bool
8597
8598 Returns ``True`` if the window is physically visible on the screen,
8599 i.e. it is shown and all its parents up to the toplevel window are
8600 shown as well.
8601 """
8602 return _core_.Window_IsShownOnScreen(*args, **kwargs)
8603
d55e5bfc
RD
8604 def SetWindowStyleFlag(*args, **kwargs):
8605 """
8606 SetWindowStyleFlag(self, long style)
8607
15817c7e
RD
8608 Sets the style of the window. Please note that some styles cannot be
8609 changed after the window creation and that Refresh() might need to be
8610 called after changing the others for the change to take place
8611 immediately.
d55e5bfc 8612 """
5b5c9bc7 8613 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8614
8615 def GetWindowStyleFlag(*args, **kwargs):
8616 """
8617 GetWindowStyleFlag(self) -> long
8618
8619 Gets the window style that was passed to the constructor or Create
8620 method.
8621 """
5b5c9bc7 8622 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8623
8624 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8625 def HasFlag(*args, **kwargs):
8626 """
8627 HasFlag(self, int flag) -> bool
8628
8629 Test if the given style is set for this window.
8630 """
5b5c9bc7 8631 return _core_.Window_HasFlag(*args, **kwargs)
d55e5bfc
RD
8632
8633 def IsRetained(*args, **kwargs):
8634 """
8635 IsRetained(self) -> bool
8636
8637 Returns true if the window is retained, false otherwise. Retained
8638 windows are only available on X platforms.
8639 """
5b5c9bc7 8640 return _core_.Window_IsRetained(*args, **kwargs)
d55e5bfc
RD
8641
8642 def SetExtraStyle(*args, **kwargs):
8643 """
8644 SetExtraStyle(self, long exStyle)
8645
8646 Sets the extra style bits for the window. Extra styles are the less
8647 often used style bits which can't be set with the constructor or with
8648 SetWindowStyleFlag()
8649 """
5b5c9bc7 8650 return _core_.Window_SetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8651
8652 def GetExtraStyle(*args, **kwargs):
8653 """
8654 GetExtraStyle(self) -> long
8655
8656 Returns the extra style bits for the window.
8657 """
5b5c9bc7 8658 return _core_.Window_GetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8659
8660 def MakeModal(*args, **kwargs):
8661 """
8662 MakeModal(self, bool modal=True)
8663
8664 Disables all other windows in the application so that the user can
8665 only interact with this window. Passing False will reverse this
8666 effect.
8667 """
5b5c9bc7 8668 return _core_.Window_MakeModal(*args, **kwargs)
d55e5bfc
RD
8669
8670 def SetThemeEnabled(*args, **kwargs):
8671 """
8672 SetThemeEnabled(self, bool enableTheme)
8673
8674 This function tells a window if it should use the system's "theme"
8675 code to draw the windows' background instead if its own background
8676 drawing code. This will only have an effect on platforms that support
8677 the notion of themes in user defined windows. One such platform is
8678 GTK+ where windows can have (very colourful) backgrounds defined by a
8679 user's selected theme.
8680
8681 Dialogs, notebook pages and the status bar have this flag set to true
8682 by default so that the default look and feel is simulated best.
8683 """
5b5c9bc7 8684 return _core_.Window_SetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8685
8686 def GetThemeEnabled(*args, **kwargs):
8687 """
8688 GetThemeEnabled(self) -> bool
8689
8690 Return the themeEnabled flag.
8691 """
5b5c9bc7 8692 return _core_.Window_GetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8693
8694 def SetFocus(*args, **kwargs):
8695 """
8696 SetFocus(self)
8697
8698 Set's the focus to this window, allowing it to receive keyboard input.
8699 """
5b5c9bc7 8700 return _core_.Window_SetFocus(*args, **kwargs)
d55e5bfc
RD
8701
8702 def SetFocusFromKbd(*args, **kwargs):
8703 """
8704 SetFocusFromKbd(self)
8705
8706 Set focus to this window as the result of a keyboard action. Normally
8707 only called internally.
8708 """
5b5c9bc7 8709 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
d55e5bfc
RD
8710
8711 def FindFocus(*args, **kwargs):
8712 """
5b5c9bc7 8713 FindFocus() -> Window
d55e5bfc
RD
8714
8715 Returns the window or control that currently has the keyboard focus,
8716 or None.
8717 """
5b5c9bc7 8718 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc
RD
8719
8720 FindFocus = staticmethod(FindFocus)
8721 def AcceptsFocus(*args, **kwargs):
8722 """
8723 AcceptsFocus(self) -> bool
8724
8725 Can this window have focus?
8726 """
5b5c9bc7 8727 return _core_.Window_AcceptsFocus(*args, **kwargs)
d55e5bfc
RD
8728
8729 def AcceptsFocusFromKeyboard(*args, **kwargs):
8730 """
8731 AcceptsFocusFromKeyboard(self) -> bool
8732
8733 Can this window be given focus by keyboard navigation? if not, the
8734 only way to give it focus (provided it accepts it at all) is to click
8735 it.
8736 """
5b5c9bc7 8737 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
d55e5bfc 8738
908b74cd
RD
8739 def Navigate(*args, **kwargs):
8740 """
8741 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8742
fd2dc343
RD
8743 Does keyboard navigation from this window to another, by sending a
8744 `wx.NavigationKeyEvent`.
908b74cd 8745 """
5b5c9bc7 8746 return _core_.Window_Navigate(*args, **kwargs)
908b74cd 8747
bf26d883
RD
8748 def MoveAfterInTabOrder(*args, **kwargs):
8749 """
5b5c9bc7 8750 MoveAfterInTabOrder(self, Window win)
bf26d883
RD
8751
8752 Moves this window in the tab navigation order after the specified
8753 sibling window. This means that when the user presses the TAB key on
8754 that other window, the focus switches to this window.
8755
8756 The default tab order is the same as creation order. This function
8757 and `MoveBeforeInTabOrder` allow to change it after creating all the
8758 windows.
8759
8760 """
5b5c9bc7 8761 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
bf26d883
RD
8762
8763 def MoveBeforeInTabOrder(*args, **kwargs):
8764 """
5b5c9bc7 8765 MoveBeforeInTabOrder(self, Window win)
bf26d883
RD
8766
8767 Same as `MoveAfterInTabOrder` except that it inserts this window just
8768 before win instead of putting it right after it.
8769 """
5b5c9bc7 8770 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
bf26d883 8771
d55e5bfc
RD
8772 def GetChildren(*args, **kwargs):
8773 """
8774 GetChildren(self) -> PyObject
8775
8776 Returns a list of the window's children. NOTE: Currently this is a
8777 copy of the child window list maintained by the window, so the return
8778 value of this function is only valid as long as the window's children
8779 do not change.
8780 """
5b5c9bc7 8781 return _core_.Window_GetChildren(*args, **kwargs)
d55e5bfc
RD
8782
8783 def GetParent(*args, **kwargs):
8784 """
5b5c9bc7 8785 GetParent(self) -> Window
d55e5bfc
RD
8786
8787 Returns the parent window of this window, or None if there isn't one.
8788 """
5b5c9bc7 8789 return _core_.Window_GetParent(*args, **kwargs)
d55e5bfc
RD
8790
8791 def GetGrandParent(*args, **kwargs):
8792 """
5b5c9bc7 8793 GetGrandParent(self) -> Window
d55e5bfc 8794
15817c7e
RD
8795 Returns the parent of the parent of this window, or None if there
8796 isn't one.
d55e5bfc 8797 """
5b5c9bc7 8798 return _core_.Window_GetGrandParent(*args, **kwargs)
d55e5bfc
RD
8799
8800 def IsTopLevel(*args, **kwargs):
8801 """
8802 IsTopLevel(self) -> bool
8803
8804 Returns true if the given window is a top-level one. Currently all
8805 frames and dialogs are always considered to be top-level windows (even
8806 if they have a parent window).
8807 """
5b5c9bc7 8808 return _core_.Window_IsTopLevel(*args, **kwargs)
d55e5bfc
RD
8809
8810 def Reparent(*args, **kwargs):
8811 """
5b5c9bc7 8812 Reparent(self, Window newParent) -> bool
d55e5bfc
RD
8813
8814 Reparents the window, i.e the window will be removed from its current
8815 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8816 re-inserted into another. Available on Windows and GTK. Returns True
8817 if the parent was changed, False otherwise (error or newParent ==
8818 oldParent)
8819 """
5b5c9bc7 8820 return _core_.Window_Reparent(*args, **kwargs)
d55e5bfc
RD
8821
8822 def AddChild(*args, **kwargs):
8823 """
5b5c9bc7 8824 AddChild(self, Window child)
d55e5bfc
RD
8825
8826 Adds a child window. This is called automatically by window creation
8827 functions so should not be required by the application programmer.
8828 """
5b5c9bc7 8829 return _core_.Window_AddChild(*args, **kwargs)
d55e5bfc
RD
8830
8831 def RemoveChild(*args, **kwargs):
8832 """
5b5c9bc7 8833 RemoveChild(self, Window child)
d55e5bfc
RD
8834
8835 Removes a child window. This is called automatically by window
8836 deletion functions so should not be required by the application
8837 programmer.
8838 """
5b5c9bc7 8839 return _core_.Window_RemoveChild(*args, **kwargs)
d55e5bfc 8840
704eda0c
RD
8841 def SetDoubleBuffered(*args, **kwargs):
8842 """
8843 SetDoubleBuffered(self, bool on)
8844
8845 Currently wxGTK2 only.
8846 """
8847 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8848
d55e5bfc
RD
8849 def FindWindowById(*args, **kwargs):
8850 """
5b5c9bc7 8851 FindWindowById(self, long winid) -> Window
d55e5bfc
RD
8852
8853 Find a chld of this window by window ID
8854 """
5b5c9bc7 8855 return _core_.Window_FindWindowById(*args, **kwargs)
d55e5bfc
RD
8856
8857 def FindWindowByName(*args, **kwargs):
8858 """
5b5c9bc7 8859 FindWindowByName(self, String name) -> Window
d55e5bfc
RD
8860
8861 Find a child of this window by name
8862 """
5b5c9bc7 8863 return _core_.Window_FindWindowByName(*args, **kwargs)
d55e5bfc
RD
8864
8865 def GetEventHandler(*args, **kwargs):
8866 """
5b5c9bc7 8867 GetEventHandler(self) -> EvtHandler
d55e5bfc
RD
8868
8869 Returns the event handler for this window. By default, the window is
8870 its own event handler.
8871 """
5b5c9bc7 8872 return _core_.Window_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
8873
8874 def SetEventHandler(*args, **kwargs):
8875 """
5b5c9bc7 8876 SetEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8877
8878 Sets the event handler for this window. An event handler is an object
d49bdf34
RD
8879 that is capable of processing the events sent to a window. (In other
8880 words, is able to dispatch the events to handler function.) By
8881 default, the window is its own event handler, but an application may
8882 wish to substitute another, for example to allow central
8883 implementation of event-handling for a variety of different window
8884 classes.
d55e5bfc 8885
15817c7e 8886 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc 8887 up a chain of event handlers, where an event not handled by one event
d49bdf34 8888 handler is handed off to the next one in the chain.
d55e5bfc 8889 """
5b5c9bc7 8890 return _core_.Window_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
8891
8892 def PushEventHandler(*args, **kwargs):
8893 """
5b5c9bc7 8894 PushEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8895
8896 Pushes this event handler onto the event handler stack for the window.
8897 An event handler is an object that is capable of processing the events
d49bdf34
RD
8898 sent to a window. (In other words, is able to dispatch the events to
8899 handler function.) By default, the window is its own event handler,
8900 but an application may wish to substitute another, for example to
8901 allow central implementation of event-handling for a variety of
8902 different window classes.
d55e5bfc
RD
8903
8904 wx.Window.PushEventHandler allows an application to set up a chain of
8905 event handlers, where an event not handled by one event handler is
d49bdf34
RD
8906 handed to the next one in the chain. Use `wx.Window.PopEventHandler`
8907 to remove the event handler. Ownership of the handler is *not* given
8908 to the window, so you should be sure to pop the handler before the
8909 window is destroyed and either let PopEventHandler destroy it, or call
8910 its Destroy method yourself.
d55e5bfc 8911 """
5b5c9bc7 8912 return _core_.Window_PushEventHandler(*args, **kwargs)
d55e5bfc
RD
8913
8914 def PopEventHandler(*args, **kwargs):
8915 """
5b5c9bc7 8916 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
d55e5bfc
RD
8917
8918 Removes and returns the top-most event handler on the event handler
8919 stack. If deleteHandler is True then the wx.EvtHandler object will be
d49bdf34 8920 destroyed after it is popped, and ``None`` will be returned instead.
d55e5bfc 8921 """
5b5c9bc7 8922 return _core_.Window_PopEventHandler(*args, **kwargs)
d55e5bfc
RD
8923
8924 def RemoveEventHandler(*args, **kwargs):
8925 """
5b5c9bc7 8926 RemoveEventHandler(self, EvtHandler handler) -> bool
d55e5bfc 8927
15817c7e 8928 Find the given handler in the event handler chain and remove (but not
d49bdf34 8929 delete) it from the event handler chain, returns True if it was found
15817c7e
RD
8930 and False otherwise (this also results in an assert failure so this
8931 function should only be called when the handler is supposed to be
8932 there.)
d55e5bfc 8933 """
5b5c9bc7 8934 return _core_.Window_RemoveEventHandler(*args, **kwargs)
d55e5bfc
RD
8935
8936 def SetValidator(*args, **kwargs):
8937 """
5b5c9bc7 8938 SetValidator(self, Validator validator)
d55e5bfc
RD
8939
8940 Deletes the current validator (if any) and sets the window validator,
8941 having called wx.Validator.Clone to create a new validator of this
8942 type.
8943 """
5b5c9bc7 8944 return _core_.Window_SetValidator(*args, **kwargs)
d55e5bfc
RD
8945
8946 def GetValidator(*args, **kwargs):
8947 """
5b5c9bc7 8948 GetValidator(self) -> Validator
d55e5bfc
RD
8949
8950 Returns a pointer to the current validator for the window, or None if
8951 there is none.
8952 """
5b5c9bc7 8953 return _core_.Window_GetValidator(*args, **kwargs)
d55e5bfc
RD
8954
8955 def Validate(*args, **kwargs):
8956 """
8957 Validate(self) -> bool
8958
8959 Validates the current values of the child controls using their
15817c7e
RD
8960 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8961 style flag set, the method will also call Validate() of all child
8962 windows. Returns false if any of the validations failed.
d55e5bfc 8963 """
5b5c9bc7 8964 return _core_.Window_Validate(*args, **kwargs)
d55e5bfc
RD
8965
8966 def TransferDataToWindow(*args, **kwargs):
8967 """
8968 TransferDataToWindow(self) -> bool
8969
15817c7e
RD
8970 Transfers values to child controls from data areas specified by their
8971 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8972 style flag set, the method will also call TransferDataToWindow() of
8973 all child windows.
d55e5bfc 8974 """
5b5c9bc7 8975 return _core_.Window_TransferDataToWindow(*args, **kwargs)
d55e5bfc
RD
8976
8977 def TransferDataFromWindow(*args, **kwargs):
8978 """
8979 TransferDataFromWindow(self) -> bool
8980
15817c7e
RD
8981 Transfers values from child controls to data areas specified by their
8982 validators. Returns false if a transfer failed. If the window has
8983 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8984 also call TransferDataFromWindow() of all child windows.
d55e5bfc 8985 """
5b5c9bc7 8986 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
d55e5bfc
RD
8987
8988 def InitDialog(*args, **kwargs):
8989 """
8990 InitDialog(self)
8991
15817c7e
RD
8992 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8993 to the dialog via validators.
d55e5bfc 8994 """
5b5c9bc7 8995 return _core_.Window_InitDialog(*args, **kwargs)
d55e5bfc
RD
8996
8997 def SetAcceleratorTable(*args, **kwargs):
8998 """
5b5c9bc7 8999 SetAcceleratorTable(self, AcceleratorTable accel)
d55e5bfc
RD
9000
9001 Sets the accelerator table for this window.
9002 """
5b5c9bc7 9003 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
9004
9005 def GetAcceleratorTable(*args, **kwargs):
9006 """
5b5c9bc7 9007 GetAcceleratorTable(self) -> AcceleratorTable
d55e5bfc
RD
9008
9009 Gets the accelerator table for this window.
9010 """
5b5c9bc7 9011 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
9012
9013 def RegisterHotKey(*args, **kwargs):
9014 """
9015 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
9016
9017 Registers a system wide hotkey. Every time the user presses the hotkey
9018 registered here, this window will receive a hotkey event. It will
9019 receive the event even if the application is in the background and
9020 does not have the input focus because the user is working with some
9021 other application. To bind an event handler function to this hotkey
9022 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9023 hotkey was registered successfully.
9024 """
5b5c9bc7 9025 return _core_.Window_RegisterHotKey(*args, **kwargs)
d55e5bfc
RD
9026
9027 def UnregisterHotKey(*args, **kwargs):
9028 """
9029 UnregisterHotKey(self, int hotkeyId) -> bool
9030
9031 Unregisters a system wide hotkey.
9032 """
5b5c9bc7 9033 return _core_.Window_UnregisterHotKey(*args, **kwargs)
d55e5bfc
RD
9034
9035 def ConvertDialogPointToPixels(*args, **kwargs):
9036 """
5b5c9bc7 9037 ConvertDialogPointToPixels(self, Point pt) -> Point
d55e5bfc
RD
9038
9039 Converts a point or size from dialog units to pixels. Dialog units
9040 are used for maintaining a dialog's proportions even if the font
9041 changes. For the x dimension, the dialog units are multiplied by the
9042 average character width and then divided by 4. For the y dimension,
9043 the dialog units are multiplied by the average character height and
9044 then divided by 8.
9045 """
5b5c9bc7 9046 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
d55e5bfc
RD
9047
9048 def ConvertDialogSizeToPixels(*args, **kwargs):
9049 """
5b5c9bc7 9050 ConvertDialogSizeToPixels(self, Size sz) -> Size
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_ConvertDialogSizeToPixels(*args, **kwargs)
d55e5bfc
RD
9060
9061 def DLG_PNT(*args, **kwargs):
9062 """
5b5c9bc7 9063 DLG_PNT(self, Point pt) -> Point
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_DLG_PNT(*args, **kwargs)
d55e5bfc
RD
9073
9074 def DLG_SZE(*args, **kwargs):
9075 """
5b5c9bc7 9076 DLG_SZE(self, Size sz) -> Size
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_SZE(*args, **kwargs)
d55e5bfc
RD
9086
9087 def ConvertPixelPointToDialog(*args, **kwargs):
5b5c9bc7
RD
9088 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9089 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
d55e5bfc
RD
9090
9091 def ConvertPixelSizeToDialog(*args, **kwargs):
5b5c9bc7
RD
9092 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9093 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
d55e5bfc
RD
9094
9095 def WarpPointer(*args, **kwargs):
9096 """
9097 WarpPointer(self, int x, int y)
9098
9099 Moves the pointer to the given position on the window.
9100
9101 NOTE: This function is not supported under Mac because Apple Human
9102 Interface Guidelines forbid moving the mouse cursor programmatically.
9103 """
5b5c9bc7 9104 return _core_.Window_WarpPointer(*args, **kwargs)
d55e5bfc
RD
9105
9106 def CaptureMouse(*args, **kwargs):
9107 """
9108 CaptureMouse(self)
9109
9110 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9111 release the capture.
9112
9113 Note that wxWindows maintains the stack of windows having captured the
9114 mouse and when the mouse is released the capture returns to the window
9115 which had had captured it previously and it is only really released if
9116 there were no previous window. In particular, this means that you must
34e0a3bb
RD
9117 release the mouse as many times as you capture it, unless the window
9118 receives the `wx.MouseCaptureLostEvent` event.
9119
9120 Any application which captures the mouse in the beginning of some
9121 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9122 operation when it receives the event. The event handler must not
9123 recapture mouse.
d55e5bfc 9124 """
5b5c9bc7 9125 return _core_.Window_CaptureMouse(*args, **kwargs)
d55e5bfc
RD
9126
9127 def ReleaseMouse(*args, **kwargs):
9128 """
9129 ReleaseMouse(self)
9130
9131 Releases mouse input captured with wx.Window.CaptureMouse.
9132 """
5b5c9bc7 9133 return _core_.Window_ReleaseMouse(*args, **kwargs)
d55e5bfc
RD
9134
9135 def GetCapture(*args, **kwargs):
9136 """
5b5c9bc7 9137 GetCapture() -> Window
d55e5bfc
RD
9138
9139 Returns the window which currently captures the mouse or None
9140 """
5b5c9bc7 9141 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc
RD
9142
9143 GetCapture = staticmethod(GetCapture)
9144 def HasCapture(*args, **kwargs):
9145 """
9146 HasCapture(self) -> bool
9147
9148 Returns true if this window has the current mouse capture.
9149 """
5b5c9bc7 9150 return _core_.Window_HasCapture(*args, **kwargs)
d55e5bfc
RD
9151
9152 def Refresh(*args, **kwargs):
9153 """
5b5c9bc7 9154 Refresh(self, bool eraseBackground=True, Rect rect=None)
d55e5bfc
RD
9155
9156 Mark the specified rectangle (or the whole window) as "dirty" so it
9157 will be repainted. Causes an EVT_PAINT event to be generated and sent
9158 to the window.
9159 """
5b5c9bc7 9160 return _core_.Window_Refresh(*args, **kwargs)
d55e5bfc
RD
9161
9162 def RefreshRect(*args, **kwargs):
9163 """
5b5c9bc7 9164 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
9165
9166 Redraws the contents of the given rectangle: the area inside it will
9167 be repainted. This is the same as Refresh but has a nicer syntax.
9168 """
5b5c9bc7 9169 return _core_.Window_RefreshRect(*args, **kwargs)
d55e5bfc
RD
9170
9171 def Update(*args, **kwargs):
9172 """
9173 Update(self)
9174
9175 Calling this method immediately repaints the invalidated area of the
9176 window instead of waiting for the EVT_PAINT event to happen, (normally
9177 this would usually only happen when the flow of control returns to the
9178 event loop.) Notice that this function doesn't refresh the window and
9179 does nothing if the window has been already repainted. Use Refresh
9180 first if you want to immediately redraw the window (or some portion of
9181 it) unconditionally.
9182 """
5b5c9bc7 9183 return _core_.Window_Update(*args, **kwargs)
d55e5bfc
RD
9184
9185 def ClearBackground(*args, **kwargs):
9186 """
9187 ClearBackground(self)
9188
9189 Clears the window by filling it with the current background
9190 colour. Does not cause an erase background event to be generated.
9191 """
5b5c9bc7 9192 return _core_.Window_ClearBackground(*args, **kwargs)
d55e5bfc
RD
9193
9194 def Freeze(*args, **kwargs):
9195 """
9196 Freeze(self)
9197
15817c7e
RD
9198 Freezes the window or, in other words, prevents any updates from
9199 taking place on screen, the window is not redrawn at all. Thaw must be
9200 called to reenable window redrawing. Calls to Freeze/Thaw may be
9201 nested, with the actual Thaw being delayed until all the nesting has
9202 been undone.
d55e5bfc
RD
9203
9204 This method is useful for visual appearance optimization (for example,
9205 it is a good idea to use it before inserting large amount of text into
9206 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9207 for all controls so it is mostly just a hint to wxWindows and not a
9208 mandatory directive.
9209 """
5b5c9bc7 9210 return _core_.Window_Freeze(*args, **kwargs)
d55e5bfc 9211
33d6fd3b
RD
9212 def IsFrozen(*args, **kwargs):
9213 """
9214 IsFrozen(self) -> bool
9215
9216 Returns ``True`` if the window has been frozen and not thawed yet.
9217
9218 :see: `Freeze` and `Thaw`
9219 """
9220 return _core_.Window_IsFrozen(*args, **kwargs)
9221
d55e5bfc
RD
9222 def Thaw(*args, **kwargs):
9223 """
9224 Thaw(self)
9225
9226 Reenables window updating after a previous call to Freeze. Calls to
15817c7e
RD
9227 Freeze/Thaw may be nested, so Thaw must be called the same number of
9228 times that Freeze was before the window will be updated.
d55e5bfc 9229 """
5b5c9bc7 9230 return _core_.Window_Thaw(*args, **kwargs)
d55e5bfc
RD
9231
9232 def PrepareDC(*args, **kwargs):
9233 """
5b5c9bc7 9234 PrepareDC(self, DC dc)
d55e5bfc
RD
9235
9236 Call this function to prepare the device context for drawing a
9237 scrolled image. It sets the device origin according to the current
9238 scroll position.
9239 """
5b5c9bc7 9240 return _core_.Window_PrepareDC(*args, **kwargs)
d55e5bfc
RD
9241
9242 def GetUpdateRegion(*args, **kwargs):
9243 """
5b5c9bc7 9244 GetUpdateRegion(self) -> Region
d55e5bfc
RD
9245
9246 Returns the region specifying which parts of the window have been
9247 damaged. Should only be called within an EVT_PAINT handler.
9248 """
5b5c9bc7 9249 return _core_.Window_GetUpdateRegion(*args, **kwargs)
d55e5bfc
RD
9250
9251 def GetUpdateClientRect(*args, **kwargs):
9252 """
5b5c9bc7 9253 GetUpdateClientRect(self) -> Rect
d55e5bfc
RD
9254
9255 Get the update rectangle region bounding box in client coords.
9256 """
5b5c9bc7 9257 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
d55e5bfc
RD
9258
9259 def IsExposed(*args, **kwargs):
9260 """
9261 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9262
9263 Returns true if the given point or rectangle area has been exposed
9264 since the last repaint. Call this in an paint event handler to
9265 optimize redrawing by only redrawing those areas, which have been
9266 exposed.
9267 """
5b5c9bc7 9268 return _core_.Window_IsExposed(*args, **kwargs)
d55e5bfc
RD
9269
9270 def IsExposedPoint(*args, **kwargs):
9271 """
5b5c9bc7 9272 IsExposedPoint(self, Point pt) -> bool
d55e5bfc
RD
9273
9274 Returns true if the given point or rectangle area has been exposed
9275 since the last repaint. Call this in an paint event handler to
9276 optimize redrawing by only redrawing those areas, which have been
9277 exposed.
9278 """
5b5c9bc7 9279 return _core_.Window_IsExposedPoint(*args, **kwargs)
d55e5bfc
RD
9280
9281 def IsExposedRect(*args, **kwargs):
9282 """
5b5c9bc7 9283 IsExposedRect(self, Rect rect) -> bool
d55e5bfc
RD
9284
9285 Returns true if the given point or rectangle area has been exposed
9286 since the last repaint. Call this in an paint event handler to
9287 optimize redrawing by only redrawing those areas, which have been
9288 exposed.
9289 """
5b5c9bc7 9290 return _core_.Window_IsExposedRect(*args, **kwargs)
d55e5bfc
RD
9291
9292 def GetDefaultAttributes(*args, **kwargs):
9293 """
5b5c9bc7 9294 GetDefaultAttributes(self) -> VisualAttributes
d55e5bfc 9295
15817c7e
RD
9296 Get the default attributes for an instance of this class. This is
9297 useful if you want to use the same font or colour in your own control
9298 as in a standard control -- which is a much better idea than hard
9299 coding specific colours or fonts which might look completely out of
a5ee0656 9300 place on the user's system, especially if it uses themes.
d55e5bfc 9301 """
5b5c9bc7 9302 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9303
9304 def GetClassDefaultAttributes(*args, **kwargs):
9305 """
5b5c9bc7 9306 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9307
15817c7e
RD
9308 Get the default attributes for this class. This is useful if you want
9309 to use the same font or colour in your own control as in a standard
9310 control -- which is a much better idea than hard coding specific
a5ee0656
RD
9311 colours or fonts which might look completely out of place on the
9312 user's system, especially if it uses themes.
d55e5bfc
RD
9313
9314 The variant parameter is only relevant under Mac currently and is
15817c7e 9315 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
9316 the returned font. See `wx.Window.SetWindowVariant` for more about
9317 this.
d55e5bfc 9318 """
5b5c9bc7 9319 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9320
9321 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9322 def SetBackgroundColour(*args, **kwargs):
9323 """
5b5c9bc7 9324 SetBackgroundColour(self, Colour colour) -> bool
d55e5bfc
RD
9325
9326 Sets the background colour of the window. Returns True if the colour
9327 was changed. The background colour is usually painted by the default
9328 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9329 automatically under GTK. Using `wx.NullColour` will reset the window
9330 to the default background colour.
d55e5bfc 9331
a5ee0656 9332 Note that setting the background colour may not cause an immediate
f8167d6e 9333 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
9334 calling this function.
9335
f8167d6e
RD
9336 Using this function will disable attempts to use themes for this
9337 window, if the system supports them. Use with care since usually the
9338 themes represent the appearance chosen by the user to be used for all
9339 applications on the system.
d55e5bfc 9340 """
5b5c9bc7 9341 return _core_.Window_SetBackgroundColour(*args, **kwargs)
d55e5bfc 9342
412d302d 9343 def SetOwnBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
9344 """SetOwnBackgroundColour(self, Colour colour)"""
9345 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9346
9347 def SetForegroundColour(*args, **kwargs):
9348 """
5b5c9bc7 9349 SetForegroundColour(self, Colour colour) -> bool
d55e5bfc
RD
9350
9351 Sets the foreground colour of the window. Returns True is the colour
9352 was changed. The interpretation of foreground colour is dependent on
9353 the window class; it may be the text colour or other colour, or it may
9354 not be used at all.
9355 """
5b5c9bc7 9356 return _core_.Window_SetForegroundColour(*args, **kwargs)
d55e5bfc 9357
fa47d7a7 9358 def SetOwnForegroundColour(*args, **kwargs):
5b5c9bc7
RD
9359 """SetOwnForegroundColour(self, Colour colour)"""
9360 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
9361
9362 def GetBackgroundColour(*args, **kwargs):
9363 """
5b5c9bc7 9364 GetBackgroundColour(self) -> Colour
d55e5bfc
RD
9365
9366 Returns the background colour of the window.
9367 """
5b5c9bc7 9368 return _core_.Window_GetBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9369
9370 def GetForegroundColour(*args, **kwargs):
9371 """
5b5c9bc7 9372 GetForegroundColour(self) -> Colour
d55e5bfc
RD
9373
9374 Returns the foreground colour of the window. The interpretation of
9375 foreground colour is dependent on the window class; it may be the text
9376 colour or other colour, or it may not be used at all.
9377 """
5b5c9bc7 9378 return _core_.Window_GetForegroundColour(*args, **kwargs)
d55e5bfc 9379
dcb8fc74
RD
9380 def InheritsBackgroundColour(*args, **kwargs):
9381 """InheritsBackgroundColour(self) -> bool"""
5b5c9bc7 9382 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
dcb8fc74
RD
9383
9384 def UseBgCol(*args, **kwargs):
9385 """UseBgCol(self) -> bool"""
5b5c9bc7 9386 return _core_.Window_UseBgCol(*args, **kwargs)
dcb8fc74 9387
0f63ec68
RD
9388 def SetBackgroundStyle(*args, **kwargs):
9389 """
9390 SetBackgroundStyle(self, int style) -> bool
9391
9392 Returns the background style of the window. The background style
9393 indicates how the background of the window is drawn.
9394
9395 ====================== ========================================
9396 wx.BG_STYLE_SYSTEM The background colour or pattern should
9397 be determined by the system
9398 wx.BG_STYLE_COLOUR The background should be a solid colour
9399 wx.BG_STYLE_CUSTOM The background will be implemented by the
9400 application.
9401 ====================== ========================================
9402
9403 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9404 a custom background, such as a tiled bitmap. Currently the style has
9405 no effect on other platforms.
9406
9407 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9408 """
5b5c9bc7 9409 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
0f63ec68
RD
9410
9411 def GetBackgroundStyle(*args, **kwargs):
9412 """
9413 GetBackgroundStyle(self) -> int
9414
9415 Returns the background style of the window.
9416
9417 :see: `SetBackgroundStyle`
9418 """
5b5c9bc7 9419 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
0f63ec68 9420
51b83b37
RD
9421 def HasTransparentBackground(*args, **kwargs):
9422 """
9423 HasTransparentBackground(self) -> bool
9424
9425 Returns True if this window's background is transparent (as, for
9426 example, for `wx.StaticText`) and should show the parent window's
9427 background.
9428
9429 This method is mostly used internally by the library itself and you
9430 normally shouldn't have to call it. You may, however, have to override
9431 it in your custom control classes to ensure that background is painted
9432 correctly.
9433 """
5b5c9bc7 9434 return _core_.Window_HasTransparentBackground(*args, **kwargs)
51b83b37 9435
d55e5bfc
RD
9436 def SetCursor(*args, **kwargs):
9437 """
5b5c9bc7 9438 SetCursor(self, Cursor cursor) -> bool
d55e5bfc
RD
9439
9440 Sets the window's cursor. Notice that the window cursor also sets it
9441 for the children of the window implicitly.
9442
9443 The cursor may be wx.NullCursor in which case the window cursor will
9444 be reset back to default.
9445 """
5b5c9bc7 9446 return _core_.Window_SetCursor(*args, **kwargs)
d55e5bfc
RD
9447
9448 def GetCursor(*args, **kwargs):
9449 """
5b5c9bc7 9450 GetCursor(self) -> Cursor
d55e5bfc
RD
9451
9452 Return the cursor associated with this window.
9453 """
5b5c9bc7 9454 return _core_.Window_GetCursor(*args, **kwargs)
d55e5bfc
RD
9455
9456 def SetFont(*args, **kwargs):
9457 """
5b5c9bc7 9458 SetFont(self, Font font) -> bool
d55e5bfc
RD
9459
9460 Sets the font for this window.
9461 """
5b5c9bc7 9462 return _core_.Window_SetFont(*args, **kwargs)
d55e5bfc 9463
fa47d7a7 9464 def SetOwnFont(*args, **kwargs):
5b5c9bc7
RD
9465 """SetOwnFont(self, Font font)"""
9466 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9467
9468 def GetFont(*args, **kwargs):
9469 """
5b5c9bc7 9470 GetFont(self) -> Font
d55e5bfc
RD
9471
9472 Returns the default font used for this window.
9473 """
5b5c9bc7 9474 return _core_.Window_GetFont(*args, **kwargs)
d55e5bfc
RD
9475
9476 def SetCaret(*args, **kwargs):
9477 """
5b5c9bc7 9478 SetCaret(self, Caret caret)
d55e5bfc
RD
9479
9480 Sets the caret associated with the window.
9481 """
5b5c9bc7 9482 return _core_.Window_SetCaret(*args, **kwargs)
d55e5bfc
RD
9483
9484 def GetCaret(*args, **kwargs):
9485 """
5b5c9bc7 9486 GetCaret(self) -> Caret
d55e5bfc
RD
9487
9488 Returns the caret associated with the window.
9489 """
5b5c9bc7 9490 return _core_.Window_GetCaret(*args, **kwargs)
d55e5bfc
RD
9491
9492 def GetCharHeight(*args, **kwargs):
9493 """
9494 GetCharHeight(self) -> int
9495
9496 Get the (average) character size for the current font.
9497 """
5b5c9bc7 9498 return _core_.Window_GetCharHeight(*args, **kwargs)
d55e5bfc
RD
9499
9500 def GetCharWidth(*args, **kwargs):
9501 """
9502 GetCharWidth(self) -> int
9503
9504 Get the (average) character size for the current font.
9505 """
5b5c9bc7 9506 return _core_.Window_GetCharWidth(*args, **kwargs)
d55e5bfc
RD
9507
9508 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9509 """
9510 GetTextExtent(String string) -> (width, height)
9511
9512 Get the width and height of the text using the current font.
9513 """
5b5c9bc7 9514 return _core_.Window_GetTextExtent(*args, **kwargs)
d55e5bfc
RD
9515
9516 def GetFullTextExtent(*args, **kwargs):
9517 """
9518 GetFullTextExtent(String string, Font font=None) ->
9519 (width, height, descent, externalLeading)
9520
9521 Get the width, height, decent and leading of the text using the
9522 current or specified font.
9523 """
5b5c9bc7 9524 return _core_.Window_GetFullTextExtent(*args, **kwargs)
d55e5bfc
RD
9525
9526 def ClientToScreenXY(*args, **kwargs):
9527 """
9528 ClientToScreenXY(int x, int y) -> (x,y)
9529
9530 Converts to screen coordinates from coordinates relative to this window.
9531 """
5b5c9bc7 9532 return _core_.Window_ClientToScreenXY(*args, **kwargs)
d55e5bfc
RD
9533
9534 def ScreenToClientXY(*args, **kwargs):
9535 """
9536 ScreenToClientXY(int x, int y) -> (x,y)
9537
9538 Converts from screen to client window coordinates.
9539 """
5b5c9bc7 9540 return _core_.Window_ScreenToClientXY(*args, **kwargs)
d55e5bfc
RD
9541
9542 def ClientToScreen(*args, **kwargs):
9543 """
5b5c9bc7 9544 ClientToScreen(self, Point pt) -> Point
d55e5bfc
RD
9545
9546 Converts to screen coordinates from coordinates relative to this window.
9547 """
5b5c9bc7 9548 return _core_.Window_ClientToScreen(*args, **kwargs)
d55e5bfc
RD
9549
9550 def ScreenToClient(*args, **kwargs):
9551 """
5b5c9bc7 9552 ScreenToClient(self, Point pt) -> Point
d55e5bfc
RD
9553
9554 Converts from screen to client window coordinates.
9555 """
5b5c9bc7 9556 return _core_.Window_ScreenToClient(*args, **kwargs)
d55e5bfc
RD
9557
9558 def HitTestXY(*args, **kwargs):
9559 """
9560 HitTestXY(self, int x, int y) -> int
9561
9562 Test where the given (in client coords) point lies
9563 """
5b5c9bc7 9564 return _core_.Window_HitTestXY(*args, **kwargs)
d55e5bfc
RD
9565
9566 def HitTest(*args, **kwargs):
9567 """
5b5c9bc7 9568 HitTest(self, Point pt) -> int
d55e5bfc
RD
9569
9570 Test where the given (in client coords) point lies
9571 """
5b5c9bc7 9572 return _core_.Window_HitTest(*args, **kwargs)
d55e5bfc
RD
9573
9574 def GetBorder(*args):
9575 """
9576 GetBorder(self, long flags) -> int
9577 GetBorder(self) -> int
9578
9579 Get border for the flags of this window
9580 """
5b5c9bc7 9581 return _core_.Window_GetBorder(*args)
d55e5bfc
RD
9582
9583 def UpdateWindowUI(*args, **kwargs):
9584 """
5b5c9bc7 9585 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
d55e5bfc
RD
9586
9587 This function sends EVT_UPDATE_UI events to the window. The particular
9588 implementation depends on the window; for example a wx.ToolBar will
9589 send an update UI event for each toolbar button, and a wx.Frame will
9590 send an update UI event for each menubar menu item. You can call this
9591 function from your application to ensure that your UI is up-to-date at
9592 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9593 concerned). This may be necessary if you have called
5ba5649b 9594 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9595 limit the overhead that wxWindows incurs by sending update UI events
9596 in idle time.
d55e5bfc 9597 """
5b5c9bc7 9598 return _core_.Window_UpdateWindowUI(*args, **kwargs)
d55e5bfc
RD
9599
9600 def PopupMenuXY(*args, **kwargs):
9601 """
5b5c9bc7 9602 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9603
b0503257
RD
9604 Pops up the given menu at the specified coordinates, relative to this window,
9605 and returns control when the user has dismissed the menu. If a menu item is
9606 selected, the corresponding menu event is generated and will be processed as
9607 usual. If the default position is given then the current position of the
9608 mouse cursor will be used.
d55e5bfc 9609 """
5b5c9bc7 9610 return _core_.Window_PopupMenuXY(*args, **kwargs)
d55e5bfc
RD
9611
9612 def PopupMenu(*args, **kwargs):
9613 """
5b5c9bc7 9614 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9615
b0503257
RD
9616 Pops up the given menu at the specified coordinates, relative to this window,
9617 and returns control when the user has dismissed the menu. If a menu item is
9618 selected, the corresponding menu event is generated and will be processed as
9619 usual. If the default position is given then the current position of the
9620 mouse cursor will be used.
d55e5bfc 9621 """
5b5c9bc7 9622 return _core_.Window_PopupMenu(*args, **kwargs)
d55e5bfc 9623
1eeb270e
RD
9624 def HasMultiplePages(*args, **kwargs):
9625 """HasMultiplePages(self) -> bool"""
9626 return _core_.Window_HasMultiplePages(*args, **kwargs)
9627
d55e5bfc
RD
9628 def GetHandle(*args, **kwargs):
9629 """
9630 GetHandle(self) -> long
9631
9632 Returns the platform-specific handle (as a long integer) of the
9633 physical window. Currently on wxMac it returns the handle of the
9634 toplevel parent of the window.
9635 """
5b5c9bc7 9636 return _core_.Window_GetHandle(*args, **kwargs)
d55e5bfc 9637
629e65c2
RD
9638 def AssociateHandle(*args, **kwargs):
9639 """
9640 AssociateHandle(self, long handle)
9641
9642 Associate the window with a new native handle
9643 """
5b5c9bc7 9644 return _core_.Window_AssociateHandle(*args, **kwargs)
629e65c2
RD
9645
9646 def DissociateHandle(*args, **kwargs):
9647 """
9648 DissociateHandle(self)
9649
9650 Dissociate the current native handle from the window
9651 """
5b5c9bc7 9652 return _core_.Window_DissociateHandle(*args, **kwargs)
629e65c2 9653
d55e5bfc
RD
9654 def HasScrollbar(*args, **kwargs):
9655 """
9656 HasScrollbar(self, int orient) -> bool
9657
9658 Does the window have the scrollbar for this orientation?
9659 """
5b5c9bc7 9660 return _core_.Window_HasScrollbar(*args, **kwargs)
d55e5bfc
RD
9661
9662 def SetScrollbar(*args, **kwargs):
9663 """
15817c7e 9664 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
9665 bool refresh=True)
9666
9667 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc 9668 """
5b5c9bc7 9669 return _core_.Window_SetScrollbar(*args, **kwargs)
d55e5bfc
RD
9670
9671 def SetScrollPos(*args, **kwargs):
9672 """
9673 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9674
9675 Sets the position of one of the built-in scrollbars.
9676 """
5b5c9bc7 9677 return _core_.Window_SetScrollPos(*args, **kwargs)
d55e5bfc
RD
9678
9679 def GetScrollPos(*args, **kwargs):
9680 """
9681 GetScrollPos(self, int orientation) -> int
9682
9683 Returns the built-in scrollbar position.
9684 """
5b5c9bc7 9685 return _core_.Window_GetScrollPos(*args, **kwargs)
d55e5bfc
RD
9686
9687 def GetScrollThumb(*args, **kwargs):
9688 """
9689 GetScrollThumb(self, int orientation) -> int
9690
9691 Returns the built-in scrollbar thumb size.
9692 """
5b5c9bc7 9693 return _core_.Window_GetScrollThumb(*args, **kwargs)
d55e5bfc
RD
9694
9695 def GetScrollRange(*args, **kwargs):
9696 """
9697 GetScrollRange(self, int orientation) -> int
9698
9699 Returns the built-in scrollbar range.
9700 """
5b5c9bc7 9701 return _core_.Window_GetScrollRange(*args, **kwargs)
d55e5bfc
RD
9702
9703 def ScrollWindow(*args, **kwargs):
9704 """
5b5c9bc7 9705 ScrollWindow(self, int dx, int dy, Rect rect=None)
d55e5bfc
RD
9706
9707 Physically scrolls the pixels in the window and move child windows
9708 accordingly. Use this function to optimise your scrolling
9709 implementations, to minimise the area that must be redrawn. Note that
9710 it is rarely required to call this function from a user program.
d55e5bfc 9711 """
5b5c9bc7 9712 return _core_.Window_ScrollWindow(*args, **kwargs)
d55e5bfc
RD
9713
9714 def ScrollLines(*args, **kwargs):
9715 """
9716 ScrollLines(self, int lines) -> bool
9717
9718 If the platform and window class supports it, scrolls the window by
9719 the given number of lines down, if lines is positive, or up if lines
9720 is negative. Returns True if the window was scrolled, False if it was
9721 already on top/bottom and nothing was done.
9722 """
5b5c9bc7 9723 return _core_.Window_ScrollLines(*args, **kwargs)
d55e5bfc
RD
9724
9725 def ScrollPages(*args, **kwargs):
9726 """
9727 ScrollPages(self, int pages) -> bool
9728
15817c7e 9729 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
9730 the given number of pages down, if pages is positive, or up if pages
9731 is negative. Returns True if the window was scrolled, False if it was
9732 already on top/bottom and nothing was done.
9733 """
5b5c9bc7 9734 return _core_.Window_ScrollPages(*args, **kwargs)
d55e5bfc
RD
9735
9736 def LineUp(*args, **kwargs):
9737 """
9738 LineUp(self) -> bool
9739
9740 This is just a wrapper for ScrollLines(-1).
9741 """
5b5c9bc7 9742 return _core_.Window_LineUp(*args, **kwargs)
d55e5bfc
RD
9743
9744 def LineDown(*args, **kwargs):
9745 """
9746 LineDown(self) -> bool
9747
9748 This is just a wrapper for ScrollLines(1).
9749 """
5b5c9bc7 9750 return _core_.Window_LineDown(*args, **kwargs)
d55e5bfc
RD
9751
9752 def PageUp(*args, **kwargs):
9753 """
9754 PageUp(self) -> bool
9755
9756 This is just a wrapper for ScrollPages(-1).
9757 """
5b5c9bc7 9758 return _core_.Window_PageUp(*args, **kwargs)
d55e5bfc
RD
9759
9760 def PageDown(*args, **kwargs):
9761 """
9762 PageDown(self) -> bool
9763
9764 This is just a wrapper for ScrollPages(1).
9765 """
5b5c9bc7 9766 return _core_.Window_PageDown(*args, **kwargs)
d55e5bfc
RD
9767
9768 def SetHelpText(*args, **kwargs):
9769 """
5b5c9bc7 9770 SetHelpText(self, String text)
d55e5bfc
RD
9771
9772 Sets the help text to be used as context-sensitive help for this
9773 window. Note that the text is actually stored by the current
f52cbe90 9774 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 9775 """
5b5c9bc7 9776 return _core_.Window_SetHelpText(*args, **kwargs)
d55e5bfc
RD
9777
9778 def SetHelpTextForId(*args, **kwargs):
9779 """
5b5c9bc7 9780 SetHelpTextForId(self, String text)
d55e5bfc
RD
9781
9782 Associate this help text with all windows with the same id as this
9783 one.
9784 """
5b5c9bc7 9785 return _core_.Window_SetHelpTextForId(*args, **kwargs)
d55e5bfc 9786
b850e7f3
RD
9787 def GetHelpTextAtPoint(*args, **kwargs):
9788 """
9789 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9790
9791 Get the help string associated with the given position in this window.
9792
9793 Notice that pt may be invalid if event origin is keyboard or unknown
9794 and this method should return the global window help text then
9795
9796 """
9797 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9798
d55e5bfc
RD
9799 def GetHelpText(*args, **kwargs):
9800 """
5b5c9bc7 9801 GetHelpText(self) -> String
d55e5bfc
RD
9802
9803 Gets the help text to be used as context-sensitive help for this
9804 window. Note that the text is actually stored by the current
f52cbe90 9805 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 9806 """
5b5c9bc7 9807 return _core_.Window_GetHelpText(*args, **kwargs)
d55e5bfc
RD
9808
9809 def SetToolTipString(*args, **kwargs):
9810 """
5b5c9bc7 9811 SetToolTipString(self, String tip)
d55e5bfc
RD
9812
9813 Attach a tooltip to the window.
9814 """
5b5c9bc7 9815 return _core_.Window_SetToolTipString(*args, **kwargs)
d55e5bfc
RD
9816
9817 def SetToolTip(*args, **kwargs):
9818 """
5b5c9bc7 9819 SetToolTip(self, ToolTip tip)
d55e5bfc
RD
9820
9821 Attach a tooltip to the window.
9822 """
5b5c9bc7 9823 return _core_.Window_SetToolTip(*args, **kwargs)
d55e5bfc
RD
9824
9825 def GetToolTip(*args, **kwargs):
9826 """
5b5c9bc7 9827 GetToolTip(self) -> ToolTip
d55e5bfc
RD
9828
9829 get the associated tooltip or None if none
9830 """
5b5c9bc7 9831 return _core_.Window_GetToolTip(*args, **kwargs)
d55e5bfc
RD
9832
9833 def SetDropTarget(*args, **kwargs):
9834 """
5b5c9bc7 9835 SetDropTarget(self, DropTarget dropTarget)
d55e5bfc
RD
9836
9837 Associates a drop target with this window. If the window already has
9838 a drop target, it is deleted.
9839 """
5b5c9bc7 9840 return _core_.Window_SetDropTarget(*args, **kwargs)
d55e5bfc
RD
9841
9842 def GetDropTarget(*args, **kwargs):
9843 """
5b5c9bc7 9844 GetDropTarget(self) -> DropTarget
d55e5bfc
RD
9845
9846 Returns the associated drop target, which may be None.
9847 """
5b5c9bc7 9848 return _core_.Window_GetDropTarget(*args, **kwargs)
d55e5bfc 9849
5ba5649b
RD
9850 def DragAcceptFiles(*args, **kwargs):
9851 """
9852 DragAcceptFiles(self, bool accept)
9853
9854 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9855 Only functional on Windows.
9856 """
9857 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9858
d55e5bfc
RD
9859 def SetConstraints(*args, **kwargs):
9860 """
5b5c9bc7 9861 SetConstraints(self, LayoutConstraints constraints)
d55e5bfc
RD
9862
9863 Sets the window to have the given layout constraints. If an existing
9864 layout constraints object is already owned by the window, it will be
9865 deleted. Pass None to disassociate and delete the window's current
9866 constraints.
9867
9868 You must call SetAutoLayout to tell a window to use the constraints
9869 automatically in its default EVT_SIZE handler; otherwise, you must
9870 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9871 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9872 effect.
9873 """
5b5c9bc7 9874 return _core_.Window_SetConstraints(*args, **kwargs)
d55e5bfc
RD
9875
9876 def GetConstraints(*args, **kwargs):
9877 """
5b5c9bc7 9878 GetConstraints(self) -> LayoutConstraints
d55e5bfc
RD
9879
9880 Returns a pointer to the window's layout constraints, or None if there
9881 are none.
9882 """
5b5c9bc7 9883 return _core_.Window_GetConstraints(*args, **kwargs)
d55e5bfc
RD
9884
9885 def SetAutoLayout(*args, **kwargs):
9886 """
9887 SetAutoLayout(self, bool autoLayout)
9888
9889 Determines whether the Layout function will be called automatically
b1fcee84
RD
9890 when the window is resized. lease note that this only happens for the
9891 windows usually used to contain children, namely `wx.Panel` and
9892 `wx.TopLevelWindow` (and the classes deriving from them).
9893
9894 This method is called implicitly by `SetSizer` but if you use
9895 `SetConstraints` you should call it manually or otherwise the window
9896 layout won't be correctly updated when its size changes.
d55e5bfc 9897 """
5b5c9bc7 9898 return _core_.Window_SetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9899
9900 def GetAutoLayout(*args, **kwargs):
9901 """
9902 GetAutoLayout(self) -> bool
9903
9904 Returns the current autoLayout setting
9905 """
5b5c9bc7 9906 return _core_.Window_GetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9907
9908 def Layout(*args, **kwargs):
9909 """
9910 Layout(self) -> bool
9911
9912 Invokes the constraint-based layout algorithm or the sizer-based
9913 algorithm for this window. See SetAutoLayout: when auto layout is on,
9914 this function gets called automatically by the default EVT_SIZE
9915 handler when the window is resized.
9916 """
5b5c9bc7 9917 return _core_.Window_Layout(*args, **kwargs)
d55e5bfc
RD
9918
9919 def SetSizer(*args, **kwargs):
9920 """
5b5c9bc7 9921 SetSizer(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9922
9923 Sets the window to have the given layout sizer. The window will then
9924 own the object, and will take care of its deletion. If an existing
9925 layout sizer object is already owned by the window, it will be deleted
9926 if the deleteOld parameter is true. Note that this function will also
9927 call SetAutoLayout implicitly with a True parameter if the sizer is
b411df4a 9928 non-None, and False otherwise.
d55e5bfc 9929 """
5b5c9bc7 9930 return _core_.Window_SetSizer(*args, **kwargs)
d55e5bfc
RD
9931
9932 def SetSizerAndFit(*args, **kwargs):
9933 """
5b5c9bc7 9934 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9935
9936 The same as SetSizer, except it also sets the size hints for the
9937 window based on the sizer's minimum size.
9938 """
5b5c9bc7 9939 return _core_.Window_SetSizerAndFit(*args, **kwargs)
d55e5bfc
RD
9940
9941 def GetSizer(*args, **kwargs):
9942 """
5b5c9bc7 9943 GetSizer(self) -> Sizer
d55e5bfc
RD
9944
9945 Return the sizer associated with the window by a previous call to
9946 SetSizer or None if there isn't one.
9947 """
5b5c9bc7 9948 return _core_.Window_GetSizer(*args, **kwargs)
d55e5bfc
RD
9949
9950 def SetContainingSizer(*args, **kwargs):
9951 """
5b5c9bc7 9952 SetContainingSizer(self, Sizer sizer)
d55e5bfc
RD
9953
9954 This normally does not need to be called by application code. It is
9955 called internally when a window is added to a sizer, and is used so
9956 the window can remove itself from the sizer when it is destroyed.
9957 """
5b5c9bc7 9958 return _core_.Window_SetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9959
9960 def GetContainingSizer(*args, **kwargs):
9961 """
5b5c9bc7 9962 GetContainingSizer(self) -> Sizer
d55e5bfc
RD
9963
9964 Return the sizer that this window is a member of, if any, otherwise None.
9965 """
5b5c9bc7 9966 return _core_.Window_GetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9967
9968 def InheritAttributes(*args, **kwargs):
9969 """
9970 InheritAttributes(self)
9971
15817c7e
RD
9972 This function is (or should be, in case of custom controls) called
9973 during window creation to intelligently set up the window visual
9974 attributes, that is the font and the foreground and background
9975 colours.
9976
9977 By 'intelligently' the following is meant: by default, all windows use
9978 their own default attributes. However if some of the parent's
9979 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 9980 SetOwnFont) and if the corresponding attribute hadn't been
15817c7e
RD
9981 explicitly set for this window itself, then this window takes the same
9982 value as used by the parent. In addition, if the window overrides
9983 ShouldInheritColours to return false, the colours will not be changed
9984 no matter what and only the font might.
9985
a7bb0a9d
RD
9986 This rather complicated logic is necessary in order to accommodate the
9987 different usage scenarios. The most common one is when all default
15817c7e
RD
9988 attributes are used and in this case, nothing should be inherited as
9989 in modern GUIs different controls use different fonts (and colours)
9990 than their siblings so they can't inherit the same value from the
9991 parent. However it was also deemed desirable to allow to simply change
9992 the attributes of all children at once by just changing the font or
9993 colour of their common parent, hence in this case we do inherit the
9994 parents attributes.
9995
d55e5bfc 9996 """
5b5c9bc7 9997 return _core_.Window_InheritAttributes(*args, **kwargs)
d55e5bfc
RD
9998
9999 def ShouldInheritColours(*args, **kwargs):
10000 """
10001 ShouldInheritColours(self) -> bool
10002
10003 Return true from here to allow the colours of this window to be
15817c7e
RD
10004 changed by InheritAttributes, returning false forbids inheriting them
10005 from the parent window.
d55e5bfc 10006
15817c7e
RD
10007 The base class version returns false, but this method is overridden in
10008 wxControl where it returns true.
d55e5bfc 10009 """
5b5c9bc7 10010 return _core_.Window_ShouldInheritColours(*args, **kwargs)
d55e5bfc 10011
fc46b7f3
RD
10012 def CanSetTransparent(*args, **kwargs):
10013 """
10014 CanSetTransparent(self) -> bool
10015
10016 Returns ``True`` if the platform supports setting the transparency for
10017 this window. Note that this method will err on the side of caution,
10018 so it is possible that this will return ``False`` when it is in fact
10019 possible to set the transparency.
10020
10021 NOTE: On X-windows systems the X server must have the composite
10022 extension loaded, and there must be a composite manager program (such
10023 as xcompmgr) running.
10024 """
10025 return _core_.Window_CanSetTransparent(*args, **kwargs)
10026
10027 def SetTransparent(*args, **kwargs):
10028 """
10029 SetTransparent(self, byte alpha) -> bool
10030
10031 Attempt to set the transparency of this window to the ``alpha`` value,
10032 returns True on success. The ``alpha`` value is an integer in the
10033 range of 0 to 255, where 0 is fully transparent and 255 is fully
10034 opaque.
10035 """
10036 return _core_.Window_SetTransparent(*args, **kwargs)
10037
d55e5bfc
RD
10038 def PostCreate(self, pre):
10039 """
10040 Phase 3 of the 2-phase create <wink!>
10041 Call this method after precreating the window with the 2-phase create method.
10042 """
10043 self.this = pre.this
10044 self.thisown = pre.thisown
10045 pre.thisown = 0
10046 if hasattr(self, '_setOORInfo'):
10047 self._setOORInfo(self)
10048 if hasattr(self, '_setCallbackInfo'):
10049 self._setCallbackInfo(self, self.__class__)
10050
7e08d4ef 10051 def SendSizeEvent(self):
92515dfc 10052 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
7e08d4ef 10053
2bf58437
RD
10054 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
10055 AdjustedBestSize = property(GetAdjustedBestSize,doc="See `GetAdjustedBestSize`")
10056 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
10057 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10058 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
10059 BestFittingSize = property(GetBestFittingSize,SetBestFittingSize,doc="See `GetBestFittingSize` and `SetBestFittingSize`")
10060 BestSize = property(GetBestSize,doc="See `GetBestSize`")
10061 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
10062 Border = property(GetBorder,doc="See `GetBorder`")
10063 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
10064 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
10065 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
10066 Children = property(GetChildren,doc="See `GetChildren`")
10067 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
10068 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
10069 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
10070 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
10071 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
10072 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
10073 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
10074 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
10075 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10076 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
10077 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10078 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
2bf58437
RD
10079 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
10080 Handle = property(GetHandle,doc="See `GetHandle`")
10081 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
2bf58437
RD
10082 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10083 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
994453b8 10084 LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`")
2bf58437
RD
10085 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
10086 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
10087 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
10088 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
10089 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
10090 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
10091 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
10092 Parent = property(GetParent,doc="See `GetParent`")
10093 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
10094 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
10095 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
10096 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
2bf58437
RD
10097 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
10098 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
2bf58437
RD
10099 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
10100 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
10101 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
10102 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
10103 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
10104 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
10105 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
10106 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10107 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
ac5d357a
RD
10108 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
10109 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
10110 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
2131d850 10111_core_.Window_swigregister(Window)
d55e5bfc
RD
10112
10113def PreWindow(*args, **kwargs):
10114 """
5b5c9bc7 10115 PreWindow() -> Window
d55e5bfc
RD
10116
10117 Precreate a Window for 2-phase creation.
10118 """
5b5c9bc7 10119 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
10120 return val
10121
1bd55598
RD
10122def Window_NewControlId(*args):
10123 """
5b5c9bc7 10124 Window_NewControlId() -> int
d55e5bfc
RD
10125
10126 Generate a control id for the controls which were not given one.
10127 """
1bd55598 10128 return _core_.Window_NewControlId(*args)
d55e5bfc 10129
5b5c9bc7 10130def Window_NextControlId(*args, **kwargs):
1bd55598 10131 """
5b5c9bc7 10132 Window_NextControlId(int winid) -> int
d55e5bfc
RD
10133
10134 Get the id of the control following the one with the given
15817c7e 10135 autogenerated) id
d55e5bfc 10136 """
1bd55598 10137 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc 10138
5b5c9bc7 10139def Window_PrevControlId(*args, **kwargs):
1bd55598 10140 """
5b5c9bc7 10141 Window_PrevControlId(int winid) -> int
d55e5bfc
RD
10142
10143 Get the id of the control preceding the one with the given
15817c7e 10144 autogenerated) id
d55e5bfc 10145 """
1bd55598 10146 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 10147
1bd55598
RD
10148def Window_FindFocus(*args):
10149 """
5b5c9bc7 10150 Window_FindFocus() -> Window
d55e5bfc
RD
10151
10152 Returns the window or control that currently has the keyboard focus,
10153 or None.
10154 """
1bd55598 10155 return _core_.Window_FindFocus(*args)
d55e5bfc 10156
1bd55598
RD
10157def Window_GetCapture(*args):
10158 """
5b5c9bc7 10159 Window_GetCapture() -> Window
d55e5bfc
RD
10160
10161 Returns the window which currently captures the mouse or None
10162 """
1bd55598 10163 return _core_.Window_GetCapture(*args)
d55e5bfc 10164
5b5c9bc7 10165def Window_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 10166 """
5b5c9bc7 10167 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 10168
15817c7e
RD
10169 Get the default attributes for this class. This is useful if you want
10170 to use the same font or colour in your own control as in a standard
10171 control -- which is a much better idea than hard coding specific
a5ee0656
RD
10172 colours or fonts which might look completely out of place on the
10173 user's system, especially if it uses themes.
d55e5bfc
RD
10174
10175 The variant parameter is only relevant under Mac currently and is
15817c7e 10176 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
10177 the returned font. See `wx.Window.SetWindowVariant` for more about
10178 this.
d55e5bfc 10179 """
1bd55598 10180 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10181
10182def DLG_PNT(win, point_or_x, y=None):
10183 """
10184 Convenience function for converting a Point or (x,y) in
10185 dialog units to pixel units.
10186 """
10187 if y is None:
10188 return win.ConvertDialogPointToPixels(point_or_x)
10189 else:
10190 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10191
10192def DLG_SZE(win, size_width, height=None):
10193 """
10194 Convenience function for converting a Size or (w,h) in
10195 dialog units to pixel units.
10196 """
10197 if height is None:
10198 return win.ConvertDialogSizeToPixels(size_width)
10199 else:
10200 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10201
10202
5b5c9bc7 10203def FindWindowById(*args, **kwargs):
1bd55598 10204 """
5b5c9bc7 10205 FindWindowById(long id, Window parent=None) -> Window
d55e5bfc
RD
10206
10207 Find the first window in the application with the given id. If parent
10208 is None, the search will start from all top-level frames and dialog
10209 boxes; if non-None, the search will be limited to the given window
10210 hierarchy. The search is recursive in both cases.
10211 """
1bd55598 10212 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc 10213
5b5c9bc7 10214def FindWindowByName(*args, **kwargs):
1bd55598 10215 """
5b5c9bc7 10216 FindWindowByName(String name, Window parent=None) -> Window
d55e5bfc
RD
10217
10218 Find a window by its name (as given in a window constructor or Create
10219 function call). If parent is None, the search will start from all
10220 top-level frames and dialog boxes; if non-None, the search will be
10221 limited to the given window hierarchy. The search is recursive in both
10222 cases.
10223
10224 If no window with such name is found, wx.FindWindowByLabel is called.
10225 """
1bd55598 10226 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc 10227
5b5c9bc7 10228def FindWindowByLabel(*args, **kwargs):
1bd55598 10229 """
5b5c9bc7 10230 FindWindowByLabel(String label, Window parent=None) -> Window
d55e5bfc
RD
10231
10232 Find a window by its label. Depending on the type of window, the label
10233 may be a window title or panel item label. If parent is None, the
10234 search will start from all top-level frames and dialog boxes; if
10235 non-None, the search will be limited to the given window
10236 hierarchy. The search is recursive in both cases.
10237 """
1bd55598 10238 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc 10239
5b5c9bc7 10240def Window_FromHWND(*args, **kwargs):
1bd55598
RD
10241 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10242 return _core_.Window_FromHWND(*args, **kwargs)
3215336e 10243
1bd55598
RD
10244def GetTopLevelWindows(*args):
10245 """
3215336e
RD
10246 GetTopLevelWindows() -> PyObject
10247
10248 Returns a list of the the application's top-level windows, (frames,
10249 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10250 by wxWidgets, and so it is only valid as long as no top-level windows
10251 are closed or new top-level windows are created.
10252
10253 """
1bd55598 10254 return _core_.GetTopLevelWindows(*args)
d55e5bfc
RD
10255#---------------------------------------------------------------------------
10256
5b5c9bc7
RD
10257class Validator(EvtHandler):
10258 """Proxy of C++ Validator class"""
1bd55598
RD
10259 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10260 __repr__ = _swig_repr
10261 def __init__(self, *args, **kwargs):
5b5c9bc7 10262 """__init__(self) -> Validator"""
1bd55598 10263 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d55e5bfc
RD
10264 self._setOORInfo(self)
10265
10266 def Clone(*args, **kwargs):
5b5c9bc7
RD
10267 """Clone(self) -> Validator"""
10268 return _core_.Validator_Clone(*args, **kwargs)
d55e5bfc
RD
10269
10270 def Validate(*args, **kwargs):
5b5c9bc7
RD
10271 """Validate(self, Window parent) -> bool"""
10272 return _core_.Validator_Validate(*args, **kwargs)
d55e5bfc
RD
10273
10274 def TransferToWindow(*args, **kwargs):
10275 """TransferToWindow(self) -> bool"""
5b5c9bc7 10276 return _core_.Validator_TransferToWindow(*args, **kwargs)
d55e5bfc
RD
10277
10278 def TransferFromWindow(*args, **kwargs):
10279 """TransferFromWindow(self) -> bool"""
5b5c9bc7 10280 return _core_.Validator_TransferFromWindow(*args, **kwargs)
d55e5bfc
RD
10281
10282 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
10283 """GetWindow(self) -> Window"""
10284 return _core_.Validator_GetWindow(*args, **kwargs)
d55e5bfc
RD
10285
10286 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
10287 """SetWindow(self, Window window)"""
10288 return _core_.Validator_SetWindow(*args, **kwargs)
d55e5bfc
RD
10289
10290 def IsSilent(*args, **kwargs):
d6c14a4c 10291 """IsSilent() -> bool"""
5b5c9bc7 10292 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc
RD
10293
10294 IsSilent = staticmethod(IsSilent)
10295 def SetBellOnError(*args, **kwargs):
d6c14a4c 10296 """SetBellOnError(int doIt=True)"""
5b5c9bc7 10297 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
10298
10299 SetBellOnError = staticmethod(SetBellOnError)
dba7934c 10300 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 10301_core_.Validator_swigregister(Validator)
d55e5bfc 10302
1bd55598
RD
10303def Validator_IsSilent(*args):
10304 """Validator_IsSilent() -> bool"""
10305 return _core_.Validator_IsSilent(*args)
d55e5bfc 10306
5b5c9bc7 10307def Validator_SetBellOnError(*args, **kwargs):
1bd55598
RD
10308 """Validator_SetBellOnError(int doIt=True)"""
10309 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc 10310
5b5c9bc7
RD
10311class PyValidator(Validator):
10312 """Proxy of C++ PyValidator class"""
1bd55598
RD
10313 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10314 __repr__ = _swig_repr
10315 def __init__(self, *args, **kwargs):
5b5c9bc7 10316 """__init__(self) -> PyValidator"""
1bd55598 10317 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
d55e5bfc
RD
10318
10319 self._setCallbackInfo(self, PyValidator, 1)
10320 self._setOORInfo(self)
10321
10322 def _setCallbackInfo(*args, **kwargs):
10323 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
5b5c9bc7 10324 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
d55e5bfc 10325
2131d850 10326_core_.PyValidator_swigregister(PyValidator)
d55e5bfc
RD
10327
10328#---------------------------------------------------------------------------
10329
5b5c9bc7
RD
10330class Menu(EvtHandler):
10331 """Proxy of C++ Menu class"""
1bd55598
RD
10332 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10333 __repr__ = _swig_repr
10334 def __init__(self, *args, **kwargs):
5b5c9bc7 10335 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
1bd55598 10336 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
d55e5bfc
RD
10337 self._setOORInfo(self)
10338
10339 def Append(*args, **kwargs):
ac5d357a
RD
10340 """
10341 Append(self, int id, String text=EmptyString, String help=EmptyString,
10342 int kind=ITEM_NORMAL) -> MenuItem
10343 """
5b5c9bc7 10344 return _core_.Menu_Append(*args, **kwargs)
d55e5bfc
RD
10345
10346 def AppendSeparator(*args, **kwargs):
5b5c9bc7
RD
10347 """AppendSeparator(self) -> MenuItem"""
10348 return _core_.Menu_AppendSeparator(*args, **kwargs)
d55e5bfc
RD
10349
10350 def AppendCheckItem(*args, **kwargs):
5b5c9bc7
RD
10351 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10352 return _core_.Menu_AppendCheckItem(*args, **kwargs)
d55e5bfc
RD
10353
10354 def AppendRadioItem(*args, **kwargs):
5b5c9bc7
RD
10355 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10356 return _core_.Menu_AppendRadioItem(*args, **kwargs)
d55e5bfc
RD
10357
10358 def AppendMenu(*args, **kwargs):
5b5c9bc7
RD
10359 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10360 return _core_.Menu_AppendMenu(*args, **kwargs)
d55e5bfc 10361
da91cb0f
RD
10362 def AppendSubMenu(*args, **kwargs):
10363 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10364 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10365
d55e5bfc 10366 def AppendItem(*args, **kwargs):
5b5c9bc7
RD
10367 """AppendItem(self, MenuItem item) -> MenuItem"""
10368 return _core_.Menu_AppendItem(*args, **kwargs)
d55e5bfc 10369
d55e5bfc 10370 def InsertItem(*args, **kwargs):
5b5c9bc7
RD
10371 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10372 return _core_.Menu_InsertItem(*args, **kwargs)
d55e5bfc 10373
1bd55598
RD
10374 def PrependItem(*args, **kwargs):
10375 """PrependItem(self, MenuItem item) -> MenuItem"""
10376 return _core_.Menu_PrependItem(*args, **kwargs)
10377
10378 def Break(*args, **kwargs):
10379 """Break(self)"""
10380 return _core_.Menu_Break(*args, **kwargs)
10381
d55e5bfc
RD
10382 def Insert(*args, **kwargs):
10383 """
ac5d357a 10384 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
5b5c9bc7 10385 int kind=ITEM_NORMAL) -> MenuItem
d55e5bfc 10386 """
5b5c9bc7 10387 return _core_.Menu_Insert(*args, **kwargs)
d55e5bfc
RD
10388
10389 def InsertSeparator(*args, **kwargs):
5b5c9bc7
RD
10390 """InsertSeparator(self, size_t pos) -> MenuItem"""
10391 return _core_.Menu_InsertSeparator(*args, **kwargs)
d55e5bfc
RD
10392
10393 def InsertCheckItem(*args, **kwargs):
5b5c9bc7
RD
10394 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10395 return _core_.Menu_InsertCheckItem(*args, **kwargs)
d55e5bfc
RD
10396
10397 def InsertRadioItem(*args, **kwargs):
5b5c9bc7
RD
10398 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10399 return _core_.Menu_InsertRadioItem(*args, **kwargs)
d55e5bfc
RD
10400
10401 def InsertMenu(*args, **kwargs):
5b5c9bc7
RD
10402 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10403 return _core_.Menu_InsertMenu(*args, **kwargs)
d55e5bfc 10404
d55e5bfc 10405 def Prepend(*args, **kwargs):
ac5d357a
RD
10406 """
10407 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10408 int kind=ITEM_NORMAL) -> MenuItem
10409 """
5b5c9bc7 10410 return _core_.Menu_Prepend(*args, **kwargs)
d55e5bfc
RD
10411
10412 def PrependSeparator(*args, **kwargs):
5b5c9bc7
RD
10413 """PrependSeparator(self) -> MenuItem"""
10414 return _core_.Menu_PrependSeparator(*args, **kwargs)
d55e5bfc
RD
10415
10416 def PrependCheckItem(*args, **kwargs):
5b5c9bc7
RD
10417 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10418 return _core_.Menu_PrependCheckItem(*args, **kwargs)
d55e5bfc
RD
10419
10420 def PrependRadioItem(*args, **kwargs):
5b5c9bc7
RD
10421 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10422 return _core_.Menu_PrependRadioItem(*args, **kwargs)
d55e5bfc
RD
10423
10424 def PrependMenu(*args, **kwargs):
5b5c9bc7
RD
10425 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10426 return _core_.Menu_PrependMenu(*args, **kwargs)
d55e5bfc
RD
10427
10428 def Remove(*args, **kwargs):
5b5c9bc7
RD
10429 """Remove(self, int id) -> MenuItem"""
10430 return _core_.Menu_Remove(*args, **kwargs)
d55e5bfc
RD
10431
10432 def RemoveItem(*args, **kwargs):
5b5c9bc7
RD
10433 """RemoveItem(self, MenuItem item) -> MenuItem"""
10434 return _core_.Menu_RemoveItem(*args, **kwargs)
d55e5bfc
RD
10435
10436 def Delete(*args, **kwargs):
10437 """Delete(self, int id) -> bool"""
5b5c9bc7 10438 return _core_.Menu_Delete(*args, **kwargs)
d55e5bfc
RD
10439
10440 def DeleteItem(*args, **kwargs):
5b5c9bc7
RD
10441 """DeleteItem(self, MenuItem item) -> bool"""
10442 return _core_.Menu_DeleteItem(*args, **kwargs)
d55e5bfc
RD
10443
10444 def Destroy(*args, **kwargs):
10445 """
10446 Destroy(self)
10447
10448 Deletes the C++ object this Python object is a proxy for.
10449 """
7e08d4ef
RD
10450 val = _core_.Menu_Destroy(*args, **kwargs)
10451 args[0].thisown = 0
10452 return val
d55e5bfc
RD
10453
10454 def DestroyId(*args, **kwargs):
10455 """
10456 DestroyId(self, int id) -> bool
10457
10458 Deletes the C++ object this Python object is a proxy for.
10459 """
7e08d4ef
RD
10460 val = _core_.Menu_DestroyId(*args, **kwargs)
10461 args[0].thisown = 0
10462 return val
d55e5bfc
RD
10463
10464 def DestroyItem(*args, **kwargs):
10465 """
5b5c9bc7 10466 DestroyItem(self, MenuItem item) -> bool
d55e5bfc
RD
10467
10468 Deletes the C++ object this Python object is a proxy for.
10469 """
7e08d4ef
RD
10470 val = _core_.Menu_DestroyItem(*args, **kwargs)
10471 args[0].thisown = 0
10472 return val
d55e5bfc
RD
10473
10474 def GetMenuItemCount(*args, **kwargs):
10475 """GetMenuItemCount(self) -> size_t"""
5b5c9bc7 10476 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
d55e5bfc
RD
10477
10478 def GetMenuItems(*args, **kwargs):
10479 """GetMenuItems(self) -> PyObject"""
5b5c9bc7 10480 return _core_.Menu_GetMenuItems(*args, **kwargs)
d55e5bfc
RD
10481
10482 def FindItem(*args, **kwargs):
5b5c9bc7
RD
10483 """FindItem(self, String item) -> int"""
10484 return _core_.Menu_FindItem(*args, **kwargs)
d55e5bfc
RD
10485
10486 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10487 """FindItemById(self, int id) -> MenuItem"""
10488 return _core_.Menu_FindItemById(*args, **kwargs)
d55e5bfc
RD
10489
10490 def FindItemByPosition(*args, **kwargs):
5b5c9bc7
RD
10491 """FindItemByPosition(self, size_t position) -> MenuItem"""
10492 return _core_.Menu_FindItemByPosition(*args, **kwargs)
d55e5bfc
RD
10493
10494 def Enable(*args, **kwargs):
10495 """Enable(self, int id, bool enable)"""
5b5c9bc7 10496 return _core_.Menu_Enable(*args, **kwargs)
d55e5bfc
RD
10497
10498 def IsEnabled(*args, **kwargs):
10499 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10500 return _core_.Menu_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10501
10502 def Check(*args, **kwargs):
10503 """Check(self, int id, bool check)"""
5b5c9bc7 10504 return _core_.Menu_Check(*args, **kwargs)
d55e5bfc
RD
10505
10506 def IsChecked(*args, **kwargs):
10507 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10508 return _core_.Menu_IsChecked(*args, **kwargs)
d55e5bfc
RD
10509
10510 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10511 """SetLabel(self, int id, String label)"""
10512 return _core_.Menu_SetLabel(*args, **kwargs)
d55e5bfc
RD
10513
10514 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10515 """GetLabel(self, int id) -> String"""
10516 return _core_.Menu_GetLabel(*args, **kwargs)
d55e5bfc
RD
10517
10518 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10519 """SetHelpString(self, int id, String helpString)"""
10520 return _core_.Menu_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10521
10522 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10523 """GetHelpString(self, int id) -> String"""
10524 return _core_.Menu_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10525
10526 def SetTitle(*args, **kwargs):
5b5c9bc7
RD
10527 """SetTitle(self, String title)"""
10528 return _core_.Menu_SetTitle(*args, **kwargs)
d55e5bfc
RD
10529
10530 def GetTitle(*args, **kwargs):
5b5c9bc7
RD
10531 """GetTitle(self) -> String"""
10532 return _core_.Menu_GetTitle(*args, **kwargs)
d55e5bfc
RD
10533
10534 def SetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10535 """SetEventHandler(self, EvtHandler handler)"""
10536 return _core_.Menu_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
10537
10538 def GetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10539 """GetEventHandler(self) -> EvtHandler"""
10540 return _core_.Menu_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
10541
10542 def SetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10543 """SetInvokingWindow(self, Window win)"""
10544 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10545
10546 def GetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10547 """GetInvokingWindow(self) -> Window"""
10548 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10549
10550 def GetStyle(*args, **kwargs):
10551 """GetStyle(self) -> long"""
5b5c9bc7 10552 return _core_.Menu_GetStyle(*args, **kwargs)
d55e5bfc
RD
10553
10554 def UpdateUI(*args, **kwargs):
5b5c9bc7
RD
10555 """UpdateUI(self, EvtHandler source=None)"""
10556 return _core_.Menu_UpdateUI(*args, **kwargs)
d55e5bfc
RD
10557
10558 def GetMenuBar(*args, **kwargs):
5b5c9bc7
RD
10559 """GetMenuBar(self) -> MenuBar"""
10560 return _core_.Menu_GetMenuBar(*args, **kwargs)
d55e5bfc
RD
10561
10562 def Attach(*args, **kwargs):
10563 """Attach(self, wxMenuBarBase menubar)"""
5b5c9bc7 10564 return _core_.Menu_Attach(*args, **kwargs)
d55e5bfc
RD
10565
10566 def Detach(*args, **kwargs):
10567 """Detach(self)"""
5b5c9bc7 10568 return _core_.Menu_Detach(*args, **kwargs)
d55e5bfc
RD
10569
10570 def IsAttached(*args, **kwargs):
10571 """IsAttached(self) -> bool"""
5b5c9bc7 10572 return _core_.Menu_IsAttached(*args, **kwargs)
d55e5bfc
RD
10573
10574 def SetParent(*args, **kwargs):
5b5c9bc7
RD
10575 """SetParent(self, Menu parent)"""
10576 return _core_.Menu_SetParent(*args, **kwargs)
d55e5bfc
RD
10577
10578 def GetParent(*args, **kwargs):
5b5c9bc7
RD
10579 """GetParent(self) -> Menu"""
10580 return _core_.Menu_GetParent(*args, **kwargs)
d55e5bfc 10581
57332a5a
RD
10582 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10583 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
10584 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
10585 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
10586 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
10587 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
10588 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
10589 Style = property(GetStyle,doc="See `GetStyle`")
10590 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
2131d850 10591_core_.Menu_swigregister(Menu)
5b5c9bc7 10592DefaultValidator = cvar.DefaultValidator
d55e5bfc
RD
10593
10594#---------------------------------------------------------------------------
10595
5b5c9bc7
RD
10596class MenuBar(Window):
10597 """Proxy of C++ MenuBar class"""
1bd55598
RD
10598 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10599 __repr__ = _swig_repr
10600 def __init__(self, *args, **kwargs):
5b5c9bc7 10601 """__init__(self, long style=0) -> MenuBar"""
1bd55598 10602 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d55e5bfc
RD
10603 self._setOORInfo(self)
10604
10605 def Append(*args, **kwargs):
5b5c9bc7
RD
10606 """Append(self, Menu menu, String title) -> bool"""
10607 return _core_.MenuBar_Append(*args, **kwargs)
d55e5bfc
RD
10608
10609 def Insert(*args, **kwargs):
5b5c9bc7
RD
10610 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10611 return _core_.MenuBar_Insert(*args, **kwargs)
d55e5bfc
RD
10612
10613 def GetMenuCount(*args, **kwargs):
10614 """GetMenuCount(self) -> size_t"""
5b5c9bc7 10615 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
d55e5bfc
RD
10616
10617 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10618 """GetMenu(self, size_t pos) -> Menu"""
10619 return _core_.MenuBar_GetMenu(*args, **kwargs)
d55e5bfc
RD
10620
10621 def Replace(*args, **kwargs):
5b5c9bc7
RD
10622 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10623 return _core_.MenuBar_Replace(*args, **kwargs)
d55e5bfc
RD
10624
10625 def Remove(*args, **kwargs):
5b5c9bc7
RD
10626 """Remove(self, size_t pos) -> Menu"""
10627 return _core_.MenuBar_Remove(*args, **kwargs)
d55e5bfc
RD
10628
10629 def EnableTop(*args, **kwargs):
10630 """EnableTop(self, size_t pos, bool enable)"""
5b5c9bc7 10631 return _core_.MenuBar_EnableTop(*args, **kwargs)
d55e5bfc
RD
10632
10633 def IsEnabledTop(*args, **kwargs):
10634 """IsEnabledTop(self, size_t pos) -> bool"""
5b5c9bc7 10635 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
d55e5bfc
RD
10636
10637 def SetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10638 """SetLabelTop(self, size_t pos, String label)"""
10639 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
d55e5bfc
RD
10640
10641 def GetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10642 """GetLabelTop(self, size_t pos) -> String"""
10643 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
d55e5bfc
RD
10644
10645 def FindMenuItem(*args, **kwargs):
5b5c9bc7
RD
10646 """FindMenuItem(self, String menu, String item) -> int"""
10647 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
d55e5bfc
RD
10648
10649 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10650 """FindItemById(self, int id) -> MenuItem"""
10651 return _core_.MenuBar_FindItemById(*args, **kwargs)
d55e5bfc
RD
10652
10653 def FindMenu(*args, **kwargs):
5b5c9bc7
RD
10654 """FindMenu(self, String title) -> int"""
10655 return _core_.MenuBar_FindMenu(*args, **kwargs)
d55e5bfc
RD
10656
10657 def Enable(*args, **kwargs):
10658 """Enable(self, int id, bool enable)"""
5b5c9bc7 10659 return _core_.MenuBar_Enable(*args, **kwargs)
d55e5bfc
RD
10660
10661 def Check(*args, **kwargs):
10662 """Check(self, int id, bool check)"""
5b5c9bc7 10663 return _core_.MenuBar_Check(*args, **kwargs)
d55e5bfc
RD
10664
10665 def IsChecked(*args, **kwargs):
10666 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10667 return _core_.MenuBar_IsChecked(*args, **kwargs)
d55e5bfc
RD
10668
10669 def IsEnabled(*args, **kwargs):
10670 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10671 return _core_.MenuBar_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10672
10673 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10674 """SetLabel(self, int id, String label)"""
10675 return _core_.MenuBar_SetLabel(*args, **kwargs)
d55e5bfc
RD
10676
10677 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10678 """GetLabel(self, int id) -> String"""
10679 return _core_.MenuBar_GetLabel(*args, **kwargs)
d55e5bfc
RD
10680
10681 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10682 """SetHelpString(self, int id, String helpString)"""
10683 return _core_.MenuBar_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10684
10685 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10686 """GetHelpString(self, int id) -> String"""
10687 return _core_.MenuBar_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10688
10689 def GetFrame(*args, **kwargs):
10690 """GetFrame(self) -> wxFrame"""
5b5c9bc7 10691 return _core_.MenuBar_GetFrame(*args, **kwargs)
d55e5bfc
RD
10692
10693 def IsAttached(*args, **kwargs):
10694 """IsAttached(self) -> bool"""
5b5c9bc7 10695 return _core_.MenuBar_IsAttached(*args, **kwargs)
d55e5bfc
RD
10696
10697 def Attach(*args, **kwargs):
10698 """Attach(self, wxFrame frame)"""
5b5c9bc7 10699 return _core_.MenuBar_Attach(*args, **kwargs)
d55e5bfc
RD
10700
10701 def Detach(*args, **kwargs):
10702 """Detach(self)"""
5b5c9bc7 10703 return _core_.MenuBar_Detach(*args, **kwargs)
d55e5bfc 10704
587d0f36
RD
10705 def UpdateMenus(*args, **kwargs):
10706 """UpdateMenus(self)"""
10707 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
10708
4f433fef
RD
10709 def SetAutoWindowMenu(*args, **kwargs):
10710 """SetAutoWindowMenu(bool enable)"""
10711 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10712
10713 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10714 def GetAutoWindowMenu(*args, **kwargs):
10715 """GetAutoWindowMenu() -> bool"""
10716 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10717
10718 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
ac5d357a
RD
10719 def GetMenus(self):
10720 """Return a list of (menu, label) items for the menus in the MenuBar. """
10721 return [(self.GetMenu(i), self.GetLabelTop(i))
10722 for i in range(self.GetMenuCount())]
10723
10724 def SetMenus(self, items):
10725 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
10726 for i in range(self.GetMenuCount()-1, -1, -1):
10727 self.Remove(i)
10728 for m, l in items:
10729 self.Append(m, l)
10730
57332a5a
RD
10731 Frame = property(GetFrame,doc="See `GetFrame`")
10732 Menu = property(GetMenu,doc="See `GetMenu`")
10733 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
10734 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
2131d850 10735_core_.MenuBar_swigregister(MenuBar)
d55e5bfc 10736
4f433fef 10737def MenuBar_SetAutoWindowMenu(*args, **kwargs):
1bd55598
RD
10738 """MenuBar_SetAutoWindowMenu(bool enable)"""
10739 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 10740
1bd55598
RD
10741def MenuBar_GetAutoWindowMenu(*args):
10742 """MenuBar_GetAutoWindowMenu() -> bool"""
10743 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 10744
d55e5bfc
RD
10745#---------------------------------------------------------------------------
10746
5b5c9bc7
RD
10747class MenuItem(Object):
10748 """Proxy of C++ MenuItem class"""
1bd55598
RD
10749 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10750 __repr__ = _swig_repr
10751 def __init__(self, *args, **kwargs):
d55e5bfc 10752 """
5b5c9bc7
RD
10753 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10754 String help=EmptyString, int kind=ITEM_NORMAL,
10755 Menu subMenu=None) -> MenuItem
d55e5bfc 10756 """
1bd55598
RD
10757 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10758 __swig_destroy__ = _core_.delete_MenuItem
10759 __del__ = lambda self : None;
d55e5bfc 10760 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10761 """GetMenu(self) -> Menu"""
10762 return _core_.MenuItem_GetMenu(*args, **kwargs)
d55e5bfc
RD
10763
10764 def SetMenu(*args, **kwargs):
5b5c9bc7
RD
10765 """SetMenu(self, Menu menu)"""
10766 return _core_.MenuItem_SetMenu(*args, **kwargs)
d55e5bfc
RD
10767
10768 def SetId(*args, **kwargs):
10769 """SetId(self, int id)"""
5b5c9bc7 10770 return _core_.MenuItem_SetId(*args, **kwargs)
d55e5bfc
RD
10771
10772 def GetId(*args, **kwargs):
10773 """GetId(self) -> int"""
5b5c9bc7 10774 return _core_.MenuItem_GetId(*args, **kwargs)
d55e5bfc
RD
10775
10776 def IsSeparator(*args, **kwargs):
10777 """IsSeparator(self) -> bool"""
5b5c9bc7 10778 return _core_.MenuItem_IsSeparator(*args, **kwargs)
d55e5bfc
RD
10779
10780 def SetText(*args, **kwargs):
5b5c9bc7
RD
10781 """SetText(self, String str)"""
10782 return _core_.MenuItem_SetText(*args, **kwargs)
d55e5bfc
RD
10783
10784 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10785 """GetLabel(self) -> String"""
10786 return _core_.MenuItem_GetLabel(*args, **kwargs)
d55e5bfc
RD
10787
10788 def GetText(*args, **kwargs):
5b5c9bc7
RD
10789 """GetText(self) -> String"""
10790 return _core_.MenuItem_GetText(*args, **kwargs)
d55e5bfc
RD
10791
10792 def GetLabelFromText(*args, **kwargs):
5b5c9bc7
RD
10793 """GetLabelFromText(String text) -> String"""
10794 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc
RD
10795
10796 GetLabelFromText = staticmethod(GetLabelFromText)
10797 def GetKind(*args, **kwargs):
10798 """GetKind(self) -> int"""
5b5c9bc7 10799 return _core_.MenuItem_GetKind(*args, **kwargs)
d55e5bfc
RD
10800
10801 def SetKind(*args, **kwargs):
10802 """SetKind(self, int kind)"""
5b5c9bc7 10803 return _core_.MenuItem_SetKind(*args, **kwargs)
d55e5bfc
RD
10804
10805 def SetCheckable(*args, **kwargs):
10806 """SetCheckable(self, bool checkable)"""
5b5c9bc7 10807 return _core_.MenuItem_SetCheckable(*args, **kwargs)
d55e5bfc
RD
10808
10809 def IsCheckable(*args, **kwargs):
10810 """IsCheckable(self) -> bool"""
5b5c9bc7 10811 return _core_.MenuItem_IsCheckable(*args, **kwargs)
d55e5bfc
RD
10812
10813 def IsSubMenu(*args, **kwargs):
10814 """IsSubMenu(self) -> bool"""
5b5c9bc7 10815 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
d55e5bfc
RD
10816
10817 def SetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10818 """SetSubMenu(self, Menu menu)"""
10819 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
d55e5bfc
RD
10820
10821 def GetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10822 """GetSubMenu(self) -> Menu"""
10823 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
d55e5bfc
RD
10824
10825 def Enable(*args, **kwargs):
10826 """Enable(self, bool enable=True)"""
5b5c9bc7 10827 return _core_.MenuItem_Enable(*args, **kwargs)
d55e5bfc
RD
10828
10829 def IsEnabled(*args, **kwargs):
10830 """IsEnabled(self) -> bool"""
5b5c9bc7 10831 return _core_.MenuItem_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10832
10833 def Check(*args, **kwargs):
10834 """Check(self, bool check=True)"""
5b5c9bc7 10835 return _core_.MenuItem_Check(*args, **kwargs)
d55e5bfc
RD
10836
10837 def IsChecked(*args, **kwargs):
10838 """IsChecked(self) -> bool"""
5b5c9bc7 10839 return _core_.MenuItem_IsChecked(*args, **kwargs)
d55e5bfc
RD
10840
10841 def Toggle(*args, **kwargs):
10842 """Toggle(self)"""
5b5c9bc7 10843 return _core_.MenuItem_Toggle(*args, **kwargs)
d55e5bfc
RD
10844
10845 def SetHelp(*args, **kwargs):
5b5c9bc7
RD
10846 """SetHelp(self, String str)"""
10847 return _core_.MenuItem_SetHelp(*args, **kwargs)
d55e5bfc
RD
10848
10849 def GetHelp(*args, **kwargs):
5b5c9bc7
RD
10850 """GetHelp(self) -> String"""
10851 return _core_.MenuItem_GetHelp(*args, **kwargs)
d55e5bfc
RD
10852
10853 def GetAccel(*args, **kwargs):
5b5c9bc7
RD
10854 """GetAccel(self) -> AcceleratorEntry"""
10855 return _core_.MenuItem_GetAccel(*args, **kwargs)
d55e5bfc
RD
10856
10857 def SetAccel(*args, **kwargs):
5b5c9bc7
RD
10858 """SetAccel(self, AcceleratorEntry accel)"""
10859 return _core_.MenuItem_SetAccel(*args, **kwargs)
d55e5bfc 10860
32fe5131
RD
10861 def SetBitmap(*args, **kwargs):
10862 """SetBitmap(self, Bitmap bitmap)"""
10863 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10864
10865 def GetBitmap(*args, **kwargs):
10866 """GetBitmap(self) -> Bitmap"""
10867 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10868
c1280d1e 10869 def SetFont(*args, **kwargs):
5b5c9bc7
RD
10870 """SetFont(self, Font font)"""
10871 return _core_.MenuItem_SetFont(*args, **kwargs)
c1280d1e
RD
10872
10873 def GetFont(*args, **kwargs):
5b5c9bc7
RD
10874 """GetFont(self) -> Font"""
10875 return _core_.MenuItem_GetFont(*args, **kwargs)
c1280d1e
RD
10876
10877 def SetTextColour(*args, **kwargs):
5b5c9bc7
RD
10878 """SetTextColour(self, Colour colText)"""
10879 return _core_.MenuItem_SetTextColour(*args, **kwargs)
c1280d1e
RD
10880
10881 def GetTextColour(*args, **kwargs):
5b5c9bc7
RD
10882 """GetTextColour(self) -> Colour"""
10883 return _core_.MenuItem_GetTextColour(*args, **kwargs)
c1280d1e
RD
10884
10885 def SetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10886 """SetBackgroundColour(self, Colour colBack)"""
10887 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10888
10889 def GetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10890 """GetBackgroundColour(self) -> Colour"""
10891 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10892
10893 def SetBitmaps(*args, **kwargs):
5b5c9bc7
RD
10894 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10895 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
c1280d1e
RD
10896
10897 def SetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10898 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10899 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10900
10901 def GetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10902 """GetDisabledBitmap(self) -> Bitmap"""
10903 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10904
10905 def SetMarginWidth(*args, **kwargs):
10906 """SetMarginWidth(self, int nWidth)"""
5b5c9bc7 10907 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
c1280d1e
RD
10908
10909 def GetMarginWidth(*args, **kwargs):
10910 """GetMarginWidth(self) -> int"""
5b5c9bc7 10911 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
c1280d1e 10912
d55e5bfc 10913 def GetDefaultMarginWidth(*args, **kwargs):
d6c14a4c 10914 """GetDefaultMarginWidth() -> int"""
5b5c9bc7 10915 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
10916
10917 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10918 def IsOwnerDrawn(*args, **kwargs):
10919 """IsOwnerDrawn(self) -> bool"""
5b5c9bc7 10920 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10921
10922 def SetOwnerDrawn(*args, **kwargs):
10923 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
5b5c9bc7 10924 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10925
10926 def ResetOwnerDrawn(*args, **kwargs):
10927 """ResetOwnerDrawn(self)"""
5b5c9bc7 10928 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
c1280d1e 10929
57332a5a
RD
10930 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
10931 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10932 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
10933 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
10934 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10935 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
10936 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10937 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
10938 Label = property(GetLabel,doc="See `GetLabel`")
10939 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
10940 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
10941 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
10942 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
10943 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
2131d850 10944_core_.MenuItem_swigregister(MenuItem)
d55e5bfc 10945
5b5c9bc7 10946def MenuItem_GetLabelFromText(*args, **kwargs):
1bd55598
RD
10947 """MenuItem_GetLabelFromText(String text) -> String"""
10948 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 10949
1bd55598
RD
10950def MenuItem_GetDefaultMarginWidth(*args):
10951 """MenuItem_GetDefaultMarginWidth() -> int"""
10952 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d55e5bfc
RD
10953
10954#---------------------------------------------------------------------------
10955
5b5c9bc7 10956class Control(Window):
d55e5bfc
RD
10957 """
10958 This is the base class for a control or 'widget'.
10959
15817c7e
RD
10960 A control is generally a small window which processes user input
10961 and/or displays one or more item of data.
d55e5bfc 10962 """
1bd55598
RD
10963 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10964 __repr__ = _swig_repr
10965 def __init__(self, *args, **kwargs):
d55e5bfc 10966 """
5b5c9bc7
RD
10967 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10968 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10969 String name=ControlNameStr) -> Control
d55e5bfc 10970
15817c7e
RD
10971 Create a Control. Normally you should only call this from a subclass'
10972 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 10973 """
1bd55598 10974 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d55e5bfc
RD
10975 self._setOORInfo(self)
10976
10977 def Create(*args, **kwargs):
10978 """
5b5c9bc7
RD
10979 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10980 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10981 String name=ControlNameStr) -> bool
d55e5bfc
RD
10982
10983 Do the 2nd phase and create the GUI control.
10984 """
5b5c9bc7 10985 return _core_.Control_Create(*args, **kwargs)
d55e5bfc 10986
1eeb270e
RD
10987 def GetAlignment(*args, **kwargs):
10988 """
10989 GetAlignment(self) -> int
10990
10991 Get the control alignment (left/right/centre, top/bottom/centre)
10992 """
10993 return _core_.Control_GetAlignment(*args, **kwargs)
10994
34e0a3bb 10995 def GetLabelText(*args, **kwargs):
1eeb270e 10996 """
1eeb270e
RD
10997 GetLabelText(self) -> String
10998
10999 Get just the text of the label, without mnemonic characters ('&')
11000 """
34e0a3bb 11001 return _core_.Control_GetLabelText(*args, **kwargs)
1eeb270e 11002
d55e5bfc
RD
11003 def Command(*args, **kwargs):
11004 """
5b5c9bc7 11005 Command(self, CommandEvent event)
d55e5bfc 11006
15817c7e
RD
11007 Simulates the effect of the user issuing a command to the item.
11008
11009 :see: `wx.CommandEvent`
11010
d55e5bfc 11011 """
5b5c9bc7 11012 return _core_.Control_Command(*args, **kwargs)
d55e5bfc 11013
d55e5bfc 11014 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0 11015 """
5b5c9bc7 11016 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
11017
11018 Get the default attributes for this class. This is useful if you want
11019 to use the same font or colour in your own control as in a standard
11020 control -- which is a much better idea than hard coding specific
11021 colours or fonts which might look completely out of place on the
11022 user's system, especially if it uses themes.
11023
11024 The variant parameter is only relevant under Mac currently and is
11025 ignore under other platforms. Under Mac, it will change the size of
11026 the returned font. See `wx.Window.SetWindowVariant` for more about
11027 this.
11028 """
5b5c9bc7 11029 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
11030
11031 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2bf58437 11032 Alignment = property(GetAlignment,doc="See `GetAlignment`")
2bf58437 11033 LabelText = property(GetLabelText,doc="See `GetLabelText`")
2131d850 11034_core_.Control_swigregister(Control)
d55e5bfc
RD
11035ControlNameStr = cvar.ControlNameStr
11036
11037def PreControl(*args, **kwargs):
11038 """
5b5c9bc7 11039 PreControl() -> Control
d55e5bfc
RD
11040
11041 Precreate a Control control for 2-phase creation
11042 """
5b5c9bc7 11043 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
11044 return val
11045
5b5c9bc7 11046def Control_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 11047 """
5b5c9bc7 11048 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
11049
11050 Get the default attributes for this class. This is useful if you want
11051 to use the same font or colour in your own control as in a standard
11052 control -- which is a much better idea than hard coding specific
11053 colours or fonts which might look completely out of place on the
11054 user's system, especially if it uses themes.
11055
11056 The variant parameter is only relevant under Mac currently and is
11057 ignore under other platforms. Under Mac, it will change the size of
11058 the returned font. See `wx.Window.SetWindowVariant` for more about
11059 this.
11060 """
1bd55598 11061 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
11062
11063#---------------------------------------------------------------------------
11064
5b5c9bc7 11065class ItemContainer(object):
d55e5bfc 11066 """
53aa7709
RD
11067 The wx.ItemContainer class defines an interface which is implemented
11068 by all controls which have string subitems, each of which may be
11069 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11070 as `wx.ComboBox` which implements an extended interface deriving from
15817c7e 11071 this one.
d55e5bfc 11072
15817c7e
RD
11073 It defines the methods for accessing the control's items and although
11074 each of the derived classes implements them differently, they still
11075 all conform to the same interface.
d55e5bfc 11076
15817c7e
RD
11077 The items in a wx.ItemContainer have (non empty) string labels and,
11078 optionally, client data associated with them.
d55e5bfc
RD
11079
11080 """
1bd55598
RD
11081 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11082 def __init__(self): raise AttributeError, "No constructor defined"
11083 __repr__ = _swig_repr
d55e5bfc
RD
11084 def Append(*args, **kwargs):
11085 """
5b5c9bc7 11086 Append(self, String item, PyObject clientData=None) -> int
d55e5bfc 11087
15817c7e
RD
11088 Adds the item to the control, associating the given data with the item
11089 if not None. The return value is the index of the newly added item
11090 which may be different from the last one if the control is sorted (e.g.
11091 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc 11092 """
5b5c9bc7 11093 return _core_.ItemContainer_Append(*args, **kwargs)
d55e5bfc
RD
11094
11095 def AppendItems(*args, **kwargs):
11096 """
f5b96ee1 11097 AppendItems(self, List strings)
d55e5bfc 11098
15817c7e
RD
11099 Apend several items at once to the control. Notice that calling this
11100 method may be much faster than appending the items one by one if you
11101 need to add a lot of items.
d55e5bfc 11102 """
5b5c9bc7 11103 return _core_.ItemContainer_AppendItems(*args, **kwargs)
d55e5bfc
RD
11104
11105 def Insert(*args, **kwargs):
11106 """
50f151d7 11107 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
d55e5bfc 11108
15817c7e 11109 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
11110 optionally associating some data object with the item.
11111 """
5b5c9bc7 11112 return _core_.ItemContainer_Insert(*args, **kwargs)
d55e5bfc
RD
11113
11114 def Clear(*args, **kwargs):
11115 """
11116 Clear(self)
11117
11118 Removes all items from the control.
11119 """
5b5c9bc7 11120 return _core_.ItemContainer_Clear(*args, **kwargs)
d55e5bfc
RD
11121
11122 def Delete(*args, **kwargs):
11123 """
50f151d7 11124 Delete(self, unsigned int n)
d55e5bfc 11125
15817c7e
RD
11126 Deletes the item at the zero-based index 'n' from the control. Note
11127 that it is an error (signalled by a `wx.PyAssertionError` exception if
11128 enabled) to remove an item with the index negative or greater or equal
11129 than the number of items in the control.
d55e5bfc 11130 """
5b5c9bc7 11131 return _core_.ItemContainer_Delete(*args, **kwargs)
d55e5bfc 11132
53aa7709
RD
11133 def GetClientData(*args, **kwargs):
11134 """
50f151d7 11135 GetClientData(self, unsigned int n) -> PyObject
53aa7709
RD
11136
11137 Returns the client data associated with the given item, (if any.)
11138 """
5b5c9bc7 11139 return _core_.ItemContainer_GetClientData(*args, **kwargs)
53aa7709
RD
11140
11141 def SetClientData(*args, **kwargs):
11142 """
50f151d7 11143 SetClientData(self, unsigned int n, PyObject clientData)
53aa7709
RD
11144
11145 Associate the given client data with the item at position n.
11146 """
5b5c9bc7 11147 return _core_.ItemContainer_SetClientData(*args, **kwargs)
53aa7709 11148
d55e5bfc
RD
11149 def GetCount(*args, **kwargs):
11150 """
50f151d7 11151 GetCount(self) -> unsigned int
d55e5bfc
RD
11152
11153 Returns the number of items in the control.
11154 """
5b5c9bc7 11155 return _core_.ItemContainer_GetCount(*args, **kwargs)
d55e5bfc
RD
11156
11157 def IsEmpty(*args, **kwargs):
11158 """
11159 IsEmpty(self) -> bool
11160
11161 Returns True if the control is empty or False if it has some items.
11162 """
5b5c9bc7 11163 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
d55e5bfc
RD
11164
11165 def GetString(*args, **kwargs):
11166 """
50f151d7 11167 GetString(self, unsigned int n) -> String
d55e5bfc
RD
11168
11169 Returns the label of the item with the given index.
11170 """
5b5c9bc7 11171 return _core_.ItemContainer_GetString(*args, **kwargs)
d55e5bfc
RD
11172
11173 def GetStrings(*args, **kwargs):
11174 """GetStrings(self) -> wxArrayString"""
5b5c9bc7 11175 return _core_.ItemContainer_GetStrings(*args, **kwargs)
d55e5bfc
RD
11176
11177 def SetString(*args, **kwargs):
11178 """
50f151d7 11179 SetString(self, unsigned int n, String s)
d55e5bfc
RD
11180
11181 Sets the label for the given item.
11182 """
5b5c9bc7 11183 return _core_.ItemContainer_SetString(*args, **kwargs)
d55e5bfc
RD
11184
11185 def FindString(*args, **kwargs):
11186 """
5b5c9bc7 11187 FindString(self, String s) -> int
d55e5bfc
RD
11188
11189 Finds an item whose label matches the given string. Returns the
15817c7e
RD
11190 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11191 found.
d55e5bfc 11192 """
5b5c9bc7 11193 return _core_.ItemContainer_FindString(*args, **kwargs)
d55e5bfc 11194
53aa7709 11195 def SetSelection(*args, **kwargs):
d55e5bfc 11196 """
53aa7709 11197 SetSelection(self, int n)
d55e5bfc
RD
11198
11199 Sets the item at index 'n' to be the selected item.
11200 """
5b5c9bc7 11201 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 11202
d55e5bfc
RD
11203 def GetSelection(*args, **kwargs):
11204 """
11205 GetSelection(self) -> int
11206
15817c7e
RD
11207 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11208 is selected.
d55e5bfc 11209 """
5b5c9bc7 11210 return _core_.ItemContainer_GetSelection(*args, **kwargs)
d55e5bfc 11211
53aa7709 11212 def SetStringSelection(*args, **kwargs):
5b5c9bc7
RD
11213 """SetStringSelection(self, String s) -> bool"""
11214 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
53aa7709 11215
d55e5bfc
RD
11216 def GetStringSelection(*args, **kwargs):
11217 """
5b5c9bc7 11218 GetStringSelection(self) -> String
d55e5bfc 11219
15817c7e
RD
11220 Returns the label of the selected item or an empty string if no item
11221 is selected.
d55e5bfc 11222 """
5b5c9bc7 11223 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
d55e5bfc 11224
53aa7709 11225 def Select(*args, **kwargs):
d55e5bfc 11226 """
53aa7709 11227 Select(self, int n)
d55e5bfc 11228
53aa7709
RD
11229 This is the same as `SetSelection` and exists only because it is
11230 slightly more natural for controls which support multiple selection.
d55e5bfc 11231 """
5b5c9bc7 11232 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc 11233
ac5d357a
RD
11234 def GetItems(self):
11235 """Return a list of the strings in the control"""
11236 return [self.GetString(i) for i in xrange(self.GetCount())]
11237
11238 def SetItems(self, items):
11239 """Clear and set the strings in the control from a list"""
11240 self.Clear()
11241 for i in items:
11242 self.Append(i)
11243
11244 Count = property(GetCount,doc="See `GetCount`")
11245 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11246 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11247 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11248 Strings = property(GetStrings,doc="See `GetStrings`")
2131d850 11249_core_.ItemContainer_swigregister(ItemContainer)
d55e5bfc
RD
11250
11251#---------------------------------------------------------------------------
11252
5b5c9bc7 11253class ControlWithItems(Control,ItemContainer):
d55e5bfc 11254 """
15817c7e
RD
11255 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11256 wx.Control class, and is used for the base class of various controls
11257 that have items.
d55e5bfc 11258 """
1bd55598
RD
11259 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11260 def __init__(self): raise AttributeError, "No constructor defined"
11261 __repr__ = _swig_repr
2131d850 11262_core_.ControlWithItems_swigregister(ControlWithItems)
d55e5bfc
RD
11263
11264#---------------------------------------------------------------------------
11265
5b5c9bc7 11266class SizerItem(Object):
bfddbb17
RD
11267 """
11268 The wx.SizerItem class is used to track the position, size and other
2131d850
RD
11269 attributes of each item managed by a `wx.Sizer`. It is not usually
11270 necessary to use this class because the sizer elements can also be
11271 identified by their positions or window or sizer references but
11272 sometimes it may be more convenient to use wx.SizerItem directly.
11273 Also, custom classes derived from `wx.PySizer` will probably need to
11274 use the collection of wx.SizerItems held by wx.Sizer when calculating
11275 layout.
bfddbb17
RD
11276
11277 :see: `wx.Sizer`, `wx.GBSizerItem`
11278 """
1bd55598
RD
11279 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11280 __repr__ = _swig_repr
11281 def __init__(self, *args, **kwargs):
bfddbb17 11282 """
5b5c9bc7 11283 __init__(self) -> SizerItem
bfddbb17
RD
11284
11285 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11286 size will need to be set before this item can be used in a Sizer.
11287
11288 You will probably never need to create a wx.SizerItem directly as they
11289 are created automatically when the sizer's Add, Insert or Prepend
11290 methods are called.
11291
11292 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11293 """
1bd55598
RD
11294 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11295 __swig_destroy__ = _core_.delete_SizerItem
11296 __del__ = lambda self : None;
d55e5bfc 11297 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
11298 """
11299 DeleteWindows(self)
11300
11301 Destroy the window or the windows in a subsizer, depending on the type
11302 of item.
11303 """
5b5c9bc7 11304 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
11305
11306 def DetachSizer(*args, **kwargs):
bfddbb17
RD
11307 """
11308 DetachSizer(self)
11309
11310 Enable deleting the SizerItem without destroying the contained sizer.
11311 """
5b5c9bc7 11312 return _core_.SizerItem_DetachSizer(*args, **kwargs)
d55e5bfc
RD
11313
11314 def GetSize(*args, **kwargs):
bfddbb17 11315 """
5b5c9bc7 11316 GetSize(self) -> Size
bfddbb17
RD
11317
11318 Get the current size of the item, as set in the last Layout.
11319 """
5b5c9bc7 11320 return _core_.SizerItem_GetSize(*args, **kwargs)
d55e5bfc
RD
11321
11322 def CalcMin(*args, **kwargs):
bfddbb17 11323 """
5b5c9bc7 11324 CalcMin(self) -> Size
bfddbb17
RD
11325
11326 Calculates the minimum desired size for the item, including any space
11327 needed by borders.
11328 """
5b5c9bc7 11329 return _core_.SizerItem_CalcMin(*args, **kwargs)
d55e5bfc
RD
11330
11331 def SetDimension(*args, **kwargs):
bfddbb17 11332 """
5b5c9bc7 11333 SetDimension(self, Point pos, Size size)
bfddbb17
RD
11334
11335 Set the position and size of the space allocated for this item by the
11336 sizer, and adjust the position and size of the item (window or
11337 subsizer) to be within that space taking alignment and borders into
11338 account.
11339 """
5b5c9bc7 11340 return _core_.SizerItem_SetDimension(*args, **kwargs)
d55e5bfc
RD
11341
11342 def GetMinSize(*args, **kwargs):
bfddbb17 11343 """
5b5c9bc7 11344 GetMinSize(self) -> Size
bfddbb17
RD
11345
11346 Get the minimum size needed for the item.
11347 """
5b5c9bc7 11348 return _core_.SizerItem_GetMinSize(*args, **kwargs)
d55e5bfc 11349
a001823c
RD
11350 def GetMinSizeWithBorder(*args, **kwargs):
11351 """
5b5c9bc7 11352 GetMinSizeWithBorder(self) -> Size
a001823c
RD
11353
11354 Get the minimum size needed for the item with space for the borders
11355 added, if needed.
11356 """
5b5c9bc7 11357 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
a001823c 11358
d55e5bfc
RD
11359 def SetInitSize(*args, **kwargs):
11360 """SetInitSize(self, int x, int y)"""
5b5c9bc7 11361 return _core_.SizerItem_SetInitSize(*args, **kwargs)
d55e5bfc
RD
11362
11363 def SetRatioWH(*args, **kwargs):
bfddbb17
RD
11364 """
11365 SetRatioWH(self, int width, int height)
11366
11367 Set the ratio item attribute.
11368 """
5b5c9bc7 11369 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
d55e5bfc
RD
11370
11371 def SetRatioSize(*args, **kwargs):
bfddbb17 11372 """
5b5c9bc7 11373 SetRatioSize(self, Size size)
bfddbb17
RD
11374
11375 Set the ratio item attribute.
11376 """
5b5c9bc7 11377 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
d55e5bfc
RD
11378
11379 def SetRatio(*args, **kwargs):
bfddbb17
RD
11380 """
11381 SetRatio(self, float ratio)
11382
11383 Set the ratio item attribute.
11384 """
5b5c9bc7 11385 return _core_.SizerItem_SetRatio(*args, **kwargs)
d55e5bfc
RD
11386
11387 def GetRatio(*args, **kwargs):
bfddbb17
RD
11388 """
11389 GetRatio(self) -> float
11390
11391 Set the ratio item attribute.
11392 """
5b5c9bc7 11393 return _core_.SizerItem_GetRatio(*args, **kwargs)
d55e5bfc 11394
070c48b4
RD
11395 def GetRect(*args, **kwargs):
11396 """
5b5c9bc7 11397 GetRect(self) -> Rect
070c48b4
RD
11398
11399 Returns the rectangle that the sizer item should occupy
11400 """
5b5c9bc7 11401 return _core_.SizerItem_GetRect(*args, **kwargs)
070c48b4 11402
d55e5bfc 11403 def IsWindow(*args, **kwargs):
bfddbb17
RD
11404 """
11405 IsWindow(self) -> bool
11406
11407 Is this sizer item a window?
11408 """
5b5c9bc7 11409 return _core_.SizerItem_IsWindow(*args, **kwargs)
d55e5bfc
RD
11410
11411 def IsSizer(*args, **kwargs):
bfddbb17
RD
11412 """
11413 IsSizer(self) -> bool
11414
11415 Is this sizer item a subsizer?
11416 """
5b5c9bc7 11417 return _core_.SizerItem_IsSizer(*args, **kwargs)
d55e5bfc
RD
11418
11419 def IsSpacer(*args, **kwargs):
bfddbb17
RD
11420 """
11421 IsSpacer(self) -> bool
11422
11423 Is this sizer item a spacer?
11424 """
5b5c9bc7 11425 return _core_.SizerItem_IsSpacer(*args, **kwargs)
d55e5bfc
RD
11426
11427 def SetProportion(*args, **kwargs):
bfddbb17
RD
11428 """
11429 SetProportion(self, int proportion)
11430
11431 Set the proportion value for this item.
11432 """
5b5c9bc7 11433 return _core_.SizerItem_SetProportion(*args, **kwargs)
d55e5bfc
RD
11434
11435 def GetProportion(*args, **kwargs):
bfddbb17
RD
11436 """
11437 GetProportion(self) -> int
11438
11439 Get the proportion value for this item.
11440 """
5b5c9bc7 11441 return _core_.SizerItem_GetProportion(*args, **kwargs)
d55e5bfc 11442
bfddbb17
RD
11443 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11444 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 11445 def SetFlag(*args, **kwargs):
bfddbb17
RD
11446 """
11447 SetFlag(self, int flag)
11448
11449 Set the flag value for this item.
11450 """
5b5c9bc7 11451 return _core_.SizerItem_SetFlag(*args, **kwargs)
d55e5bfc
RD
11452
11453 def GetFlag(*args, **kwargs):
bfddbb17
RD
11454 """
11455 GetFlag(self) -> int
11456
11457 Get the flag value for this item.
11458 """
5b5c9bc7 11459 return _core_.SizerItem_GetFlag(*args, **kwargs)
d55e5bfc
RD
11460
11461 def SetBorder(*args, **kwargs):
bfddbb17
RD
11462 """
11463 SetBorder(self, int border)
11464
11465 Set the border value for this item.
11466 """
5b5c9bc7 11467 return _core_.SizerItem_SetBorder(*args, **kwargs)
d55e5bfc
RD
11468
11469 def GetBorder(*args, **kwargs):
bfddbb17
RD
11470 """
11471 GetBorder(self) -> int
11472
11473 Get the border value for this item.
11474 """
5b5c9bc7 11475 return _core_.SizerItem_GetBorder(*args, **kwargs)
d55e5bfc
RD
11476
11477 def GetWindow(*args, **kwargs):
bfddbb17 11478 """
5b5c9bc7 11479 GetWindow(self) -> Window
bfddbb17
RD
11480
11481 Get the window (if any) that is managed by this sizer item.
11482 """
5b5c9bc7 11483 return _core_.SizerItem_GetWindow(*args, **kwargs)
d55e5bfc
RD
11484
11485 def SetWindow(*args, **kwargs):
bfddbb17 11486 """
5b5c9bc7 11487 SetWindow(self, Window window)
bfddbb17
RD
11488
11489 Set the window to be managed by this sizer item.
11490 """
5b5c9bc7 11491 return _core_.SizerItem_SetWindow(*args, **kwargs)
d55e5bfc
RD
11492
11493 def GetSizer(*args, **kwargs):
bfddbb17 11494 """
5b5c9bc7 11495 GetSizer(self) -> Sizer
bfddbb17
RD
11496
11497 Get the subsizer (if any) that is managed by this sizer item.
11498 """
5b5c9bc7 11499 return _core_.SizerItem_GetSizer(*args, **kwargs)
d55e5bfc
RD
11500
11501 def SetSizer(*args, **kwargs):
bfddbb17 11502 """
5b5c9bc7 11503 SetSizer(self, Sizer sizer)
bfddbb17
RD
11504
11505 Set the subsizer to be managed by this sizer item.
11506 """
5b5c9bc7 11507 return _core_.SizerItem_SetSizer(*args, **kwargs)
d55e5bfc
RD
11508
11509 def GetSpacer(*args, **kwargs):
bfddbb17 11510 """
5b5c9bc7 11511 GetSpacer(self) -> Size
bfddbb17
RD
11512
11513 Get the size of the spacer managed by this sizer item.
11514 """
5b5c9bc7 11515 return _core_.SizerItem_GetSpacer(*args, **kwargs)
d55e5bfc
RD
11516
11517 def SetSpacer(*args, **kwargs):
bfddbb17 11518 """
5b5c9bc7 11519 SetSpacer(self, Size size)
bfddbb17
RD
11520
11521 Set the size of the spacer to be managed by this sizer item.
11522 """
5b5c9bc7 11523 return _core_.SizerItem_SetSpacer(*args, **kwargs)
d55e5bfc
RD
11524
11525 def Show(*args, **kwargs):
bfddbb17
RD
11526 """
11527 Show(self, bool show)
11528
11529 Set the show item attribute, which sizers use to determine if the item
11530 is to be made part of the layout or not. If the item is tracking a
11531 window then it is shown or hidden as needed.
11532 """
5b5c9bc7 11533 return _core_.SizerItem_Show(*args, **kwargs)
d55e5bfc
RD
11534
11535 def IsShown(*args, **kwargs):
bfddbb17
RD
11536 """
11537 IsShown(self) -> bool
11538
11539 Is the item to be shown in the layout?
11540 """
5b5c9bc7 11541 return _core_.SizerItem_IsShown(*args, **kwargs)
d55e5bfc
RD
11542
11543 def GetPosition(*args, **kwargs):
bfddbb17 11544 """
5b5c9bc7 11545 GetPosition(self) -> Point
bfddbb17
RD
11546
11547 Returns the current position of the item, as set in the last Layout.
11548 """
5b5c9bc7 11549 return _core_.SizerItem_GetPosition(*args, **kwargs)
d55e5bfc
RD
11550
11551 def GetUserData(*args, **kwargs):
bfddbb17
RD
11552 """
11553 GetUserData(self) -> PyObject
11554
11555 Returns the userData associated with this sizer item, or None if there
11556 isn't any.
11557 """
5b5c9bc7 11558 return _core_.SizerItem_GetUserData(*args, **kwargs)
d55e5bfc 11559
32fe5131
RD
11560 def SetUserData(*args, **kwargs):
11561 """
11562 SetUserData(self, PyObject userData)
11563
11564 Associate a Python object with this sizer item.
11565 """
11566 return _core_.SizerItem_SetUserData(*args, **kwargs)
11567
33d6fd3b
RD
11568 Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`")
11569 Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`")
11570 MinSize = property(GetMinSize,doc="See `GetMinSize`")
11571 MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`")
11572 Position = property(GetPosition,doc="See `GetPosition`")
11573 Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`")
11574 Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`")
11575 Rect = property(GetRect,doc="See `GetRect`")
11576 Size = property(GetSize,doc="See `GetSize`")
11577 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
11578 Spacer = property(GetSpacer,SetSpacer,doc="See `GetSpacer` and `SetSpacer`")
11579 UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`")
11580 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 11581_core_.SizerItem_swigregister(SizerItem)
d55e5bfc 11582
bfddbb17 11583def SizerItemWindow(*args, **kwargs):
d55e5bfc 11584 """
5b5c9bc7
RD
11585 SizerItemWindow(Window window, int proportion, int flag, int border,
11586 PyObject userData=None) -> SizerItem
bfddbb17
RD
11587
11588 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 11589 """
5b5c9bc7 11590 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
11591 return val
11592
bfddbb17 11593def SizerItemSpacer(*args, **kwargs):
d55e5bfc 11594 """
bfddbb17 11595 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
5b5c9bc7 11596 PyObject userData=None) -> SizerItem
bfddbb17
RD
11597
11598 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 11599 """
5b5c9bc7 11600 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
11601 return val
11602
11603def SizerItemSizer(*args, **kwargs):
11604 """
5b5c9bc7
RD
11605 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11606 PyObject userData=None) -> SizerItem
bfddbb17
RD
11607
11608 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc 11609 """
5b5c9bc7 11610 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
11611 return val
11612
5b5c9bc7 11613class Sizer(Object):
bfddbb17
RD
11614 """
11615 wx.Sizer is the abstract base class used for laying out subwindows in
11616 a window. You cannot use wx.Sizer directly; instead, you will have to
11617 use one of the sizer classes derived from it such as `wx.BoxSizer`,
1d5ee749
RD
11618 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11619 `wx.GridBagSizer`.
bfddbb17
RD
11620
11621 The concept implemented by sizers in wxWidgets is closely related to
11622 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11623 toolkit or the Qt toolkit. It is based upon the idea of the individual
11624 subwindows reporting their minimal required size and their ability to
11625 get stretched if the size of the parent window has changed. This will
11626 most often mean that the programmer does not set the original size of
11627 a dialog in the beginning, rather the dialog will assigned a sizer and
11628 this sizer will be queried about the recommended size. The sizer in
11629 turn will query its children, which can be normal windows or contorls,
11630 empty space or other sizers, so that a hierarchy of sizers can be
11631 constructed. Note that wxSizer does not derive from wxWindow and thus
11632 do not interfere with tab ordering and requires very little resources
11633 compared to a real window on screen.
11634
11635 What makes sizers so well fitted for use in wxWidgets is the fact that
11636 every control reports its own minimal size and the algorithm can
11637 handle differences in font sizes or different window (dialog item)
11638 sizes on different platforms without problems. If for example the
11639 standard font as well as the overall design of Mac widgets requires
11640 more space than on Windows, then the initial size of a dialog using a
11641 sizer will automatically be bigger on Mac than on Windows.
11642 """
1bd55598
RD
11643 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11644 def __init__(self): raise AttributeError, "No constructor defined"
11645 __repr__ = _swig_repr
11646 __swig_destroy__ = _core_.delete_Sizer
11647 __del__ = lambda self : None;
d55e5bfc
RD
11648 def _setOORInfo(*args, **kwargs):
11649 """_setOORInfo(self, PyObject _self)"""
5b5c9bc7 11650 return _core_.Sizer__setOORInfo(*args, **kwargs)
d55e5bfc
RD
11651
11652 def Add(*args, **kwargs):
11653 """
bfddbb17 11654 Add(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11655 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11656
11657 Appends a child item to the sizer.
d55e5bfc 11658 """
5b5c9bc7 11659 return _core_.Sizer_Add(*args, **kwargs)
d55e5bfc
RD
11660
11661 def Insert(*args, **kwargs):
11662 """
bfddbb17 11663 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
070c48b4 11664 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11665
11666 Inserts a new item into the list of items managed by this sizer before
11667 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc 11668 """
5b5c9bc7 11669 return _core_.Sizer_Insert(*args, **kwargs)
d55e5bfc
RD
11670
11671 def Prepend(*args, **kwargs):
11672 """
bfddbb17 11673 Prepend(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11674 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11675
11676 Adds a new item to the begining of the list of sizer items managed by
11677 this sizer. See `Add` for a description of the parameters.
d55e5bfc 11678 """
5b5c9bc7 11679 return _core_.Sizer_Prepend(*args, **kwargs)
d55e5bfc
RD
11680
11681 def Remove(*args, **kwargs):
bfddbb17
RD
11682 """
11683 Remove(self, item) -> bool
11684
11685 Removes an item from the sizer and destroys it. This method does not
11686 cause any layout or resizing to take place, call `Layout` to update
11687 the layout on screen after removing a child from the sizer. The
11688 *item* parameter can be either a window, a sizer, or the zero-based
11689 index of an item to remove. Returns True if the child item was found
11690 and removed.
11691 """
5b5c9bc7 11692 return _core_.Sizer_Remove(*args, **kwargs)
d55e5bfc 11693
1a6bba1e 11694 def Detach(*args, **kwargs):
bfddbb17
RD
11695 """
11696 Detach(self, item) -> bool
11697
11698 Detaches an item from the sizer without destroying it. This method
11699 does not cause any layout or resizing to take place, call `Layout` to
11700 do so. The *item* parameter can be either a window, a sizer, or the
11701 zero-based index of the item to be detached. Returns True if the child item
11702 was found and detached.
11703 """
5b5c9bc7 11704 return _core_.Sizer_Detach(*args, **kwargs)
1a6bba1e 11705
070c48b4
RD
11706 def GetItem(*args, **kwargs):
11707 """
11708 GetItem(self, item) -> wx.SizerItem
11709
11710 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11711 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11712 the item to be found.
070c48b4 11713 """
5b5c9bc7 11714 return _core_.Sizer_GetItem(*args, **kwargs)
070c48b4 11715
d55e5bfc 11716 def _SetItemMinSize(*args, **kwargs):
5b5c9bc7
RD
11717 """_SetItemMinSize(self, PyObject item, Size size)"""
11718 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
d55e5bfc 11719
ac5d357a
RD
11720 def _ReplaceWin(*args, **kwargs):
11721 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
11722 return _core_.Sizer__ReplaceWin(*args, **kwargs)
11723
11724 def _ReplaceSizer(*args, **kwargs):
11725 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
11726 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
11727
11728 def _ReplaceItem(*args, **kwargs):
11729 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
11730 return _core_.Sizer__ReplaceItem(*args, **kwargs)
11731
11732 def Replace(self, olditem, item, recursive=False):
11733 """
11734 Detaches the given ``olditem`` from the sizer and replaces it with
11735 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
11736 detached child is destroyed only if it is not a window, (because
11737 windows are owned by their parent, not the sizer.) The
11738 ``recursive`` parameter can be used to search for the given
11739 element recursivly in subsizers.
11740
11741 This method does not cause any layout or resizing to take place,
11742 call `Layout` to do so.
11743
11744 Returns ``True`` if the child item was found and removed.
11745 """
11746 if isinstance(olditem, wx.Window):
11747 return self._ReplaceWin(olditem, item, recursive)
11748 elif isinstnace(olditem, wx.Sizer):
11749 return self._ReplaceSizer(olditem, item, recursive)
11750 elif isinstnace(olditem, int):
11751 return self._ReplaceItem(olditem, item)
11752 else:
11753 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
11754
11755 def SetContainingWindow(*args, **kwargs):
11756 """
11757 SetContainingWindow(self, Window window)
11758
11759 Set (or unset) the window this sizer is used in.
11760 """
11761 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
11762
11763 def GetContainingWindow(*args, **kwargs):
11764 """
11765 GetContainingWindow(self) -> Window
11766
11767 Get the window this sizer is used in.
11768 """
11769 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
11770
bfddbb17
RD
11771 def SetItemMinSize(self, item, *args):
11772 """
11773 SetItemMinSize(self, item, Size size)
11774
11775 Sets the minimum size that will be allocated for an item in the sizer.
11776 The *item* parameter can be either a window, a sizer, or the
11777 zero-based index of the item. If a window or sizer is given then it
11778 will be searched for recursivly in subsizers if neccessary.
11779 """
11780 if len(args) == 2:
11781 # for backward compatibility accept separate width,height args too
11782 return self._SetItemMinSize(item, args)
11783 else:
11784 return self._SetItemMinSize(item, args[0])
11785
d55e5bfc 11786 def AddItem(*args, **kwargs):
bfddbb17
RD
11787 """
11788 AddItem(self, SizerItem item)
11789
11790 Adds a `wx.SizerItem` to the sizer.
11791 """
5b5c9bc7 11792 return _core_.Sizer_AddItem(*args, **kwargs)
d55e5bfc
RD
11793
11794 def InsertItem(*args, **kwargs):
bfddbb17
RD
11795 """
11796 InsertItem(self, int index, SizerItem item)
11797
11798 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11799 """
5b5c9bc7 11800 return _core_.Sizer_InsertItem(*args, **kwargs)
d55e5bfc
RD
11801
11802 def PrependItem(*args, **kwargs):
bfddbb17
RD
11803 """
11804 PrependItem(self, SizerItem item)
11805
11806 Prepends a `wx.SizerItem` to the sizer.
11807 """
5b5c9bc7 11808 return _core_.Sizer_PrependItem(*args, **kwargs)
d55e5bfc 11809
bfddbb17 11810 def AddMany(self, items):
d6c14a4c
RD
11811 """
11812 AddMany is a convenience method for adding several items
11813 to a sizer at one time. Simply pass it a list of tuples,
11814 where each tuple consists of the parameters that you
11815 would normally pass to the `Add` method.
11816 """
bfddbb17
RD
11817 for item in items:
11818 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11819 item = (item, )
11820 self.Add(*item)
d55e5bfc 11821
0d2c9713
RD
11822 def AddSpacer(self, *args, **kw):
11823 """AddSpacer(int size) --> SizerItem
11824
11825 Add a spacer that is (size,size) pixels.
11826 """
11827 if args and type(args[0]) == int:
11828 return self.Add( (args[0],args[0] ), 0)
11829 else: # otherwise stay compatible with old AddSpacer
11830 return self.Add(*args, **kw)
11831 def PrependSpacer(self, *args, **kw):
11832 """PrependSpacer(int size) --> SizerItem
11833
11834 Prepend a spacer that is (size, size) pixels."""
11835 if args and type(args[0]) == int:
11836 return self.Prepend( (args[0],args[0] ), 0)
11837 else: # otherwise stay compatible with old PrependSpacer
11838 return self.Prepend(*args, **kw)
11839 def InsertSpacer(self, index, *args, **kw):
11840 """InsertSpacer(int index, int size) --> SizerItem
11841
11842 Insert a spacer at position index that is (size, size) pixels."""
11843 if args and type(args[0]) == int:
11844 return self.Insert( index, (args[0],args[0] ), 0)
11845 else: # otherwise stay compatible with old InsertSpacer
11846 return self.Insert(index, *args, **kw)
11847
11848
11849 def AddStretchSpacer(self, prop=1):
11850 """AddStretchSpacer(int prop=1) --> SizerItem
11851
11852 Add a stretchable spacer."""
11853 return self.Add((0,0), prop)
11854 def PrependStretchSpacer(self, prop=1):
11855 """PrependStretchSpacer(int prop=1) --> SizerItem
11856
11857 Prepend a stretchable spacer."""
11858 return self.Prepend((0,0), prop)
11859 def InsertStretchSpacer(self, index, prop=1):
11860 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
11861
11862 Insert a stretchable spacer."""
11863 return self.Insert(index, (0,0), prop)
11864
11865
d55e5bfc 11866 # for backwards compatibility only, please do not use in new code
7fbf8399
RD
11867 def AddWindow(self, *args, **kw):
11868 """Compatibility alias for `Add`."""
11869 return self.Add(*args, **kw)
11870 def AddSizer(self, *args, **kw):
11871 """Compatibility alias for `Add`."""
11872 return self.Add(*args, **kw)
7fbf8399
RD
11873
11874 def PrependWindow(self, *args, **kw):
11875 """Compatibility alias for `Prepend`."""
11876 return self.Prepend(*args, **kw)
11877 def PrependSizer(self, *args, **kw):
11878 """Compatibility alias for `Prepend`."""
11879 return self.Prepend(*args, **kw)
7fbf8399
RD
11880
11881 def InsertWindow(self, *args, **kw):
11882 """Compatibility alias for `Insert`."""
11883 return self.Insert(*args, **kw)
11884 def InsertSizer(self, *args, **kw):
11885 """Compatibility alias for `Insert`."""
7fbf8399
RD
11886 return self.Insert(*args, **kw)
11887
11888 def RemoveWindow(self, *args, **kw):
11889 """Compatibility alias for `Remove`."""
11890 return self.Remove(*args, **kw)
11891 def RemoveSizer(self, *args, **kw):
11892 """Compatibility alias for `Remove`."""
11893 return self.Remove(*args, **kw)
11894 def RemovePos(self, *args, **kw):
11895 """Compatibility alias for `Remove`."""
11896 return self.Remove(*args, **kw)
d55e5bfc
RD
11897
11898
d55e5bfc 11899 def SetDimension(*args, **kwargs):
bfddbb17
RD
11900 """
11901 SetDimension(self, int x, int y, int width, int height)
11902
11903 Call this to force the sizer to take the given dimension and thus
11904 force the items owned by the sizer to resize themselves according to
11905 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11906 methods.
11907 """
5b5c9bc7 11908 return _core_.Sizer_SetDimension(*args, **kwargs)
d55e5bfc
RD
11909
11910 def SetMinSize(*args, **kwargs):
bfddbb17 11911 """
5b5c9bc7 11912 SetMinSize(self, Size size)
bfddbb17
RD
11913
11914 Call this to give the sizer a minimal size. Normally, the sizer will
11915 calculate its minimal size based purely on how much space its children
11916 need. After calling this method `GetMinSize` will return either the
11917 minimal size as requested by its children or the minimal size set
11918 here, depending on which is bigger.
11919 """
5b5c9bc7 11920 return _core_.Sizer_SetMinSize(*args, **kwargs)
d55e5bfc
RD
11921
11922 def GetSize(*args, **kwargs):
bfddbb17 11923 """
5b5c9bc7 11924 GetSize(self) -> Size
bfddbb17
RD
11925
11926 Returns the current size of the space managed by the sizer.
11927 """
5b5c9bc7 11928 return _core_.Sizer_GetSize(*args, **kwargs)
d55e5bfc
RD
11929
11930 def GetPosition(*args, **kwargs):
bfddbb17 11931 """
5b5c9bc7 11932 GetPosition(self) -> Point
bfddbb17
RD
11933
11934 Returns the current position of the sizer's managed space.
11935 """
5b5c9bc7 11936 return _core_.Sizer_GetPosition(*args, **kwargs)
d55e5bfc
RD
11937
11938 def GetMinSize(*args, **kwargs):
bfddbb17 11939 """
5b5c9bc7 11940 GetMinSize(self) -> Size
bfddbb17
RD
11941
11942 Returns the minimal size of the sizer. This is either the combined
11943 minimal size of all the children and their borders or the minimal size
11944 set by SetMinSize, depending on which is bigger.
11945 """
5b5c9bc7 11946 return _core_.Sizer_GetMinSize(*args, **kwargs)
d55e5bfc
RD
11947
11948 def GetSizeTuple(self):
1a6bba1e 11949 return self.GetSize().Get()
d55e5bfc 11950 def GetPositionTuple(self):
1a6bba1e 11951 return self.GetPosition().Get()
d55e5bfc 11952 def GetMinSizeTuple(self):
1a6bba1e 11953 return self.GetMinSize().Get()
d55e5bfc
RD
11954
11955 def RecalcSizes(*args, **kwargs):
bfddbb17
RD
11956 """
11957 RecalcSizes(self)
11958
11959 Using the sizes calculated by `CalcMin` reposition and resize all the
11960 items managed by this sizer. You should not need to call this directly as
11961 it is called by `Layout`.
11962 """
5b5c9bc7 11963 return _core_.Sizer_RecalcSizes(*args, **kwargs)
d55e5bfc
RD
11964
11965 def CalcMin(*args, **kwargs):
bfddbb17 11966 """
5b5c9bc7 11967 CalcMin(self) -> Size
bfddbb17
RD
11968
11969 This method is where the sizer will do the actual calculation of its
11970 children's minimal sizes. You should not need to call this directly as
11971 it is called by `Layout`.
11972 """
5b5c9bc7 11973 return _core_.Sizer_CalcMin(*args, **kwargs)
d55e5bfc
RD
11974
11975 def Layout(*args, **kwargs):
bfddbb17
RD
11976 """
11977 Layout(self)
11978
11979 This method will force the recalculation and layout of the items
11980 controlled by the sizer using the current space allocated to the
11981 sizer. Normally this is called automatically from the owning window's
11982 EVT_SIZE handler, but it is also useful to call it from user code when
11983 one of the items in a sizer change size, or items are added or
11984 removed.
11985 """
5b5c9bc7 11986 return _core_.Sizer_Layout(*args, **kwargs)
d55e5bfc
RD
11987
11988 def Fit(*args, **kwargs):
bfddbb17 11989 """
5b5c9bc7 11990 Fit(self, Window window) -> Size
bfddbb17
RD
11991
11992 Tell the sizer to resize the *window* to match the sizer's minimal
11993 size. This is commonly done in the constructor of the window itself in
11994 order to set its initial size to match the needs of the children as
11995 determined by the sizer. Returns the new size.
11996
11997 For a top level window this is the total window size, not the client size.
11998 """
5b5c9bc7 11999 return _core_.Sizer_Fit(*args, **kwargs)
d55e5bfc
RD
12000
12001 def FitInside(*args, **kwargs):
bfddbb17 12002 """
5b5c9bc7 12003 FitInside(self, Window window)
bfddbb17
RD
12004
12005 Tell the sizer to resize the *virtual size* of the *window* to match the
12006 sizer's minimal size. This will not alter the on screen size of the
12007 window, but may cause the addition/removal/alteration of scrollbars
12008 required to view the virtual area in windows which manage it.
12009
12010 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12011
12012 """
5b5c9bc7 12013 return _core_.Sizer_FitInside(*args, **kwargs)
d55e5bfc
RD
12014
12015 def SetSizeHints(*args, **kwargs):
bfddbb17 12016 """
5b5c9bc7 12017 SetSizeHints(self, Window window)
bfddbb17
RD
12018
12019 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12020 match the sizer's minimal size. This is commonly done in the
12021 constructor of the window itself if the window is resizable (as are
12022 many dialogs under Unix and frames on probably all platforms) in order
12023 to prevent the window from being sized smaller than the minimal size
12024 required by the sizer.
12025 """
5b5c9bc7 12026 return _core_.Sizer_SetSizeHints(*args, **kwargs)
d55e5bfc
RD
12027
12028 def SetVirtualSizeHints(*args, **kwargs):
bfddbb17 12029 """
5b5c9bc7 12030 SetVirtualSizeHints(self, Window window)
bfddbb17
RD
12031
12032 Tell the sizer to set the minimal size of the window virtual area to
12033 match the sizer's minimal size. For windows with managed scrollbars
12034 this will set them appropriately.
12035
12036 :see: `wx.ScrolledWindow.SetScrollbars`
12037
12038 """
5b5c9bc7 12039 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
d55e5bfc
RD
12040
12041 def Clear(*args, **kwargs):
bfddbb17
RD
12042 """
12043 Clear(self, bool deleteWindows=False)
12044
12045 Clear all items from the sizer, optionally destroying the window items
12046 as well.
12047 """
5b5c9bc7 12048 return _core_.Sizer_Clear(*args, **kwargs)
d55e5bfc
RD
12049
12050 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
12051 """
12052 DeleteWindows(self)
12053
12054 Destroy all windows managed by the sizer.
12055 """
5b5c9bc7 12056 return _core_.Sizer_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
12057
12058 def GetChildren(*args, **kwargs):
bfddbb17 12059 """
51b83b37 12060 GetChildren(self) -> list
bfddbb17
RD
12061
12062 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12063 """
5b5c9bc7 12064 return _core_.Sizer_GetChildren(*args, **kwargs)
d55e5bfc
RD
12065
12066 def Show(*args, **kwargs):
bfddbb17 12067 """
b411df4a 12068 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 12069
bfddbb17
RD
12070 Shows or hides an item managed by the sizer. To make a sizer item
12071 disappear or reappear, use Show followed by `Layout`. The *item*
12072 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
12073 the item. Use the recursive parameter to show or hide an item in a
12074 subsizer. Returns True if the item was found.
bfddbb17 12075 """
5b5c9bc7 12076 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
12077
12078 def IsShown(*args, **kwargs):
bfddbb17
RD
12079 """
12080 IsShown(self, item)
12081
b1fcee84 12082 Determines if the item is currently shown. To make a sizer
bfddbb17
RD
12083 item disappear or reappear, use Show followed by `Layout`. The *item*
12084 parameter can be either a window, a sizer, or the zero-based index of
12085 the item.
12086 """
5b5c9bc7 12087 return _core_.Sizer_IsShown(*args, **kwargs)
d55e5bfc 12088
629e65c2 12089 def Hide(self, item, recursive=False):
bfddbb17 12090 """
27fb7603 12091 A convenience method for `Show` (item, False, recursive).
bfddbb17 12092 """
06759a38 12093 return self.Show(item, False, recursive)
bfddbb17 12094
d55e5bfc 12095 def ShowItems(*args, **kwargs):
bfddbb17
RD
12096 """
12097 ShowItems(self, bool show)
12098
84f85550 12099 Recursively call `wx.SizerItem.Show` on all sizer items.
bfddbb17 12100 """
5b5c9bc7 12101 return _core_.Sizer_ShowItems(*args, **kwargs)
d55e5bfc 12102
33d6fd3b
RD
12103 Children = property(GetChildren,doc="See `GetChildren`")
12104 ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`")
12105 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
12106 Position = property(GetPosition,doc="See `GetPosition`")
12107 Size = property(GetSize,doc="See `GetSize`")
2131d850 12108_core_.Sizer_swigregister(Sizer)
d55e5bfc 12109
5b5c9bc7 12110class PySizer(Sizer):
bfddbb17
RD
12111 """
12112 wx.PySizer is a special version of `wx.Sizer` that has been
12113 instrumented to allow the C++ virtual methods to be overloaded in
12114 Python derived classes. You would derive from this class if you are
12115 wanting to implement a custom sizer in Python code. Simply implement
12116 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12117 For example::
12118
12119 class MySizer(wx.PySizer):
12120 def __init__(self):
12121 wx.PySizer.__init__(self)
12122
12123 def CalcMin(self):
12124 for item in self.GetChildren():
12125 # calculate the total minimum width and height needed
12126 # by all items in the sizer according to this sizer's
12127 # layout algorithm.
12128 ...
12129 return wx.Size(width, height)
12130
12131 def RecalcSizes(self):
12132 # find the space allotted to this sizer
12133 pos = self.GetPosition()
12134 size = self.GetSize()
12135 for item in self.GetChildren():
12136 # Recalculate (if necessary) the position and size of
12137 # each item and then call item.SetDimension to do the
12138 # actual positioning and sizing of the items within the
12139 # space alloted to this sizer.
12140 ...
12141 item.SetDimension(itemPos, itemSize)
12142
12143
12144 When `Layout` is called it first calls `CalcMin` followed by
12145 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 12146 `CalcMin` and reusing them in `RecalcSizes`.
bfddbb17
RD
12147
12148 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12149
12150
12151 """
1bd55598
RD
12152 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12153 __repr__ = _swig_repr
12154 def __init__(self, *args, **kwargs):
bfddbb17 12155 """
5b5c9bc7 12156 __init__(self) -> PySizer
bfddbb17
RD
12157
12158 Creates a wx.PySizer. Must be called from the __init__ in the derived
12159 class.
12160 """
1bd55598 12161 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
d55e5bfc
RD
12162 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
12163
12164 def _setCallbackInfo(*args, **kwargs):
12165 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 12166 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
d55e5bfc 12167
2131d850 12168_core_.PySizer_swigregister(PySizer)
d55e5bfc
RD
12169
12170#---------------------------------------------------------------------------
12171
5b5c9bc7 12172class BoxSizer(Sizer):
bfddbb17
RD
12173 """
12174 The basic idea behind a box sizer is that windows will most often be
12175 laid out in rather simple basic geometry, typically in a row or a
12176 column or nested hierarchies of either. A wx.BoxSizer will lay out
12177 its items in a simple row or column, depending on the orientation
12178 parameter passed to the constructor.
12179 """
1bd55598
RD
12180 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12181 __repr__ = _swig_repr
12182 def __init__(self, *args, **kwargs):
bfddbb17 12183 """
5b5c9bc7 12184 __init__(self, int orient=HORIZONTAL) -> BoxSizer
bfddbb17
RD
12185
12186 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12187 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12188 sizer.
12189 """
1bd55598 12190 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d55e5bfc
RD
12191 self._setOORInfo(self)
12192
12193 def GetOrientation(*args, **kwargs):
bfddbb17
RD
12194 """
12195 GetOrientation(self) -> int
12196
12197 Returns the current orientation of the sizer.
12198 """
5b5c9bc7 12199 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
d55e5bfc
RD
12200
12201 def SetOrientation(*args, **kwargs):
bfddbb17
RD
12202 """
12203 SetOrientation(self, int orient)
d55e5bfc 12204
bfddbb17
RD
12205 Resets the orientation of the sizer.
12206 """
5b5c9bc7 12207 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc 12208
2bf58437 12209 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
2131d850 12210_core_.BoxSizer_swigregister(BoxSizer)
d55e5bfc
RD
12211
12212#---------------------------------------------------------------------------
12213
5b5c9bc7 12214class StaticBoxSizer(BoxSizer):
bfddbb17
RD
12215 """
12216 wx.StaticBoxSizer derives from and functions identically to the
12217 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12218 manages. Note that this static box must be created separately and
12219 passed to the sizer constructor.
12220 """
1bd55598
RD
12221 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12222 __repr__ = _swig_repr
12223 def __init__(self, *args, **kwargs):
bfddbb17 12224 """
5b5c9bc7 12225 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
bfddbb17
RD
12226
12227 Constructor. It takes an associated static box and the orientation
12228 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12229 ``wx.HORIZONTAL``.
12230 """
1bd55598 12231 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d55e5bfc
RD
12232 self._setOORInfo(self)
12233
12234 def GetStaticBox(*args, **kwargs):
bfddbb17 12235 """
5b5c9bc7 12236 GetStaticBox(self) -> StaticBox
d55e5bfc 12237
bfddbb17
RD
12238 Returns the static box associated with this sizer.
12239 """
5b5c9bc7 12240 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc 12241
33d6fd3b 12242 StaticBox = property(GetStaticBox,doc="See `GetStaticBox`")
2131d850 12243_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d55e5bfc
RD
12244
12245#---------------------------------------------------------------------------
12246
5b5c9bc7 12247class GridSizer(Sizer):
bfddbb17
RD
12248 """
12249 A grid sizer is a sizer which lays out its children in a
12250 two-dimensional table with all cells having the same size. In other
12251 words, the width of each cell within the grid is the width of the
12252 widest item added to the sizer and the height of each grid cell is the
12253 height of the tallest item. An optional vertical and/or horizontal
12254 gap between items can also be specified (in pixels.)
12255
12256 Items are placed in the cells of the grid in the order they are added,
12257 in row-major order. In other words, the first row is filled first,
12258 then the second, and so on until all items have been added. (If
12259 neccessary, additional rows will be added as items are added.) If you
12260 need to have greater control over the cells that items are placed in
12261 then use the `wx.GridBagSizer`.
12262
12263 """
1bd55598
RD
12264 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12265 __repr__ = _swig_repr
12266 def __init__(self, *args, **kwargs):
bfddbb17 12267 """
5b5c9bc7 12268 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
bfddbb17
RD
12269
12270 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12271 of columns and rows in the sizer - if either of the parameters is
12272 zero, it will be calculated to from the total number of children in
12273 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12274 define extra space between all children.
12275 """
1bd55598 12276 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d55e5bfc
RD
12277 self._setOORInfo(self)
12278
d55e5bfc 12279 def SetCols(*args, **kwargs):
bfddbb17
RD
12280 """
12281 SetCols(self, int cols)
12282
12283 Sets the number of columns in the sizer.
12284 """
5b5c9bc7 12285 return _core_.GridSizer_SetCols(*args, **kwargs)
d55e5bfc
RD
12286
12287 def SetRows(*args, **kwargs):
bfddbb17
RD
12288 """
12289 SetRows(self, int rows)
12290
12291 Sets the number of rows in the sizer.
12292 """
5b5c9bc7 12293 return _core_.GridSizer_SetRows(*args, **kwargs)
d55e5bfc
RD
12294
12295 def SetVGap(*args, **kwargs):
bfddbb17
RD
12296 """
12297 SetVGap(self, int gap)
12298
12299 Sets the vertical gap (in pixels) between the cells in the sizer.
12300 """
5b5c9bc7 12301 return _core_.GridSizer_SetVGap(*args, **kwargs)
d55e5bfc
RD
12302
12303 def SetHGap(*args, **kwargs):
bfddbb17
RD
12304 """
12305 SetHGap(self, int gap)
12306
12307 Sets the horizontal gap (in pixels) between cells in the sizer
12308 """
5b5c9bc7 12309 return _core_.GridSizer_SetHGap(*args, **kwargs)
d55e5bfc
RD
12310
12311 def GetCols(*args, **kwargs):
bfddbb17
RD
12312 """
12313 GetCols(self) -> int
12314
12315 Returns the number of columns in the sizer.
12316 """
5b5c9bc7 12317 return _core_.GridSizer_GetCols(*args, **kwargs)
d55e5bfc
RD
12318
12319 def GetRows(*args, **kwargs):
bfddbb17
RD
12320 """
12321 GetRows(self) -> int
12322
12323 Returns the number of rows in the sizer.
12324 """
5b5c9bc7 12325 return _core_.GridSizer_GetRows(*args, **kwargs)
d55e5bfc
RD
12326
12327 def GetVGap(*args, **kwargs):
bfddbb17
RD
12328 """
12329 GetVGap(self) -> int
12330
12331 Returns the vertical gap (in pixels) between the cells in the sizer.
12332 """
5b5c9bc7 12333 return _core_.GridSizer_GetVGap(*args, **kwargs)
d55e5bfc
RD
12334
12335 def GetHGap(*args, **kwargs):
bfddbb17
RD
12336 """
12337 GetHGap(self) -> int
12338
12339 Returns the horizontal gap (in pixels) between cells in the sizer.
12340 """
5b5c9bc7 12341 return _core_.GridSizer_GetHGap(*args, **kwargs)
d55e5bfc 12342
1bd55598
RD
12343 def CalcRowsCols(self):
12344 """
12345 CalcRowsCols() -> (rows, cols)
12346
12347 Calculates how many rows and columns will be in the sizer based
12348 on the current number of items and also the rows, cols specified
12349 in the constructor.
12350 """
12351 nitems = len(self.GetChildren())
12352 rows = self.GetRows()
12353 cols = self.GetCols()
12354 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
12355 if cols != 0:
12356 rows = (nitems + cols - 1) / cols
12357 elif rows != 0:
12358 cols = (nitems + rows - 1) / rows
12359 return (rows, cols)
d55e5bfc 12360
ac5d357a
RD
12361 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
12362 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
12363 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
12364 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
2131d850 12365_core_.GridSizer_swigregister(GridSizer)
d55e5bfc
RD
12366
12367#---------------------------------------------------------------------------
12368
5b5c9bc7
RD
12369FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12370FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12371FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
12372class FlexGridSizer(GridSizer):
bfddbb17
RD
12373 """
12374 A flex grid sizer is a sizer which lays out its children in a
12375 two-dimensional table with all table cells in one row having the same
12376 height and all cells in one column having the same width, but all
12377 rows or all columns are not necessarily the same height or width as in
12378 the `wx.GridSizer`.
12379
12380 wx.FlexGridSizer can also size items equally in one direction but
12381 unequally ("flexibly") in the other. If the sizer is only flexible
12382 in one direction (this can be changed using `SetFlexibleDirection`), it
12383 needs to be decided how the sizer should grow in the other ("non
12384 flexible") direction in order to fill the available space. The
12385 `SetNonFlexibleGrowMode` method serves this purpose.
12386
12387
12388 """
1bd55598
RD
12389 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12390 __repr__ = _swig_repr
12391 def __init__(self, *args, **kwargs):
bfddbb17 12392 """
5b5c9bc7 12393 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
bfddbb17
RD
12394
12395 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12396 number of columns and rows in the sizer - if either of the parameters
12397 is zero, it will be calculated to from the total number of children in
12398 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12399 define extra space between all children.
12400 """
1bd55598 12401 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d55e5bfc
RD
12402 self._setOORInfo(self)
12403
bfddbb17
RD
12404 def AddGrowableRow(*args, **kwargs):
12405 """
12406 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 12407
bfddbb17
RD
12408 Specifies that row *idx* (starting from zero) should be grown if there
12409 is extra space available to the sizer.
d55e5bfc 12410
bfddbb17
RD
12411 The *proportion* parameter has the same meaning as the stretch factor
12412 for the box sizers except that if all proportions are 0, then all
12413 columns are resized equally (instead of not being resized at all).
12414 """
5b5c9bc7 12415 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
d55e5bfc
RD
12416
12417 def RemoveGrowableRow(*args, **kwargs):
bfddbb17
RD
12418 """
12419 RemoveGrowableRow(self, size_t idx)
12420
12421 Specifies that row *idx* is no longer growable.
12422 """
5b5c9bc7 12423 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
d55e5bfc
RD
12424
12425 def AddGrowableCol(*args, **kwargs):
bfddbb17
RD
12426 """
12427 AddGrowableCol(self, size_t idx, int proportion=0)
12428
12429 Specifies that column *idx* (starting from zero) should be grown if
12430 there is extra space available to the sizer.
12431
12432 The *proportion* parameter has the same meaning as the stretch factor
12433 for the box sizers except that if all proportions are 0, then all
12434 columns are resized equally (instead of not being resized at all).
12435 """
5b5c9bc7 12436 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
d55e5bfc
RD
12437
12438 def RemoveGrowableCol(*args, **kwargs):
bfddbb17
RD
12439 """
12440 RemoveGrowableCol(self, size_t idx)
12441
12442 Specifies that column *idx* is no longer growable.
12443 """
5b5c9bc7 12444 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
d55e5bfc
RD
12445
12446 def SetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
12447 """
12448 SetFlexibleDirection(self, int direction)
12449
12450 Specifies whether the sizer should flexibly resize its columns, rows,
12451 or both. Argument *direction* can be one of the following values. Any
12452 other value is ignored.
12453
12454 ============== =======================================
12455 wx.VERTICAL Rows are flexibly sized.
12456 wx.HORIZONTAL Columns are flexibly sized.
12457 wx.BOTH Both rows and columns are flexibly sized
12458 (this is the default value).
12459 ============== =======================================
12460
12461 Note that this method does not trigger relayout.
12462
12463 """
5b5c9bc7 12464 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
12465
12466 def GetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
12467 """
12468 GetFlexibleDirection(self) -> int
12469
12470 Returns a value that specifies whether the sizer
12471 flexibly resizes its columns, rows, or both (default).
12472
12473 :see: `SetFlexibleDirection`
12474 """
5b5c9bc7 12475 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
12476
12477 def SetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
12478 """
12479 SetNonFlexibleGrowMode(self, int mode)
12480
12481 Specifies how the sizer should grow in the non-flexible direction if
12482 there is one (so `SetFlexibleDirection` must have been called
12483 previously). Argument *mode* can be one of the following values:
12484
12485 ========================== =================================================
12486 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12487 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12488 `AddGrowableCol` and `AddGrowableRow`. In this
12489 case equal sizing applies to minimum sizes of
12490 columns or rows (this is the default value).
12491 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12492 the non flexible direction, whether they are
12493 growable or not in the flexbile direction.
12494 ========================== =================================================
12495
12496 Note that this method does not trigger relayout.
bfddbb17 12497 """
5b5c9bc7 12498 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
12499
12500 def GetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
12501 """
12502 GetNonFlexibleGrowMode(self) -> int
12503
12504 Returns the value that specifies how the sizer grows in the
12505 non-flexible direction if there is one.
12506
12507 :see: `SetNonFlexibleGrowMode`
12508 """
5b5c9bc7 12509 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
12510
12511 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
12512 """
12513 GetRowHeights(self) -> list
12514
12515 Returns a list of integers representing the heights of each of the
12516 rows in the sizer.
12517 """
5b5c9bc7 12518 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
d55e5bfc
RD
12519
12520 def GetColWidths(*args, **kwargs):
fd2dc343
RD
12521 """
12522 GetColWidths(self) -> list
12523
12524 Returns a list of integers representing the widths of each of the
12525 columns in the sizer.
12526 """
5b5c9bc7 12527 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
d55e5bfc 12528
ac5d357a
RD
12529 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
12530 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
12531 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
12532 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
2131d850 12533_core_.FlexGridSizer_swigregister(FlexGridSizer)
d55e5bfc 12534
5b5c9bc7 12535class StdDialogButtonSizer(BoxSizer):
62d32a5f
RD
12536 """
12537 A special sizer that knows how to order and position standard buttons
12538 in order to conform to the current platform's standards. You simply
12539 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 12540 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
12541 will take care of the rest.
12542
12543 """
1bd55598
RD
12544 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12545 __repr__ = _swig_repr
12546 def __init__(self, *args, **kwargs):
5b5c9bc7 12547 """__init__(self) -> StdDialogButtonSizer"""
1bd55598 12548 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
62d32a5f
RD
12549 def AddButton(*args, **kwargs):
12550 """
12551 AddButton(self, wxButton button)
12552
12553 Use this to add the buttons to this sizer. Do not use the `Add`
12554 method in the base class.
12555 """
5b5c9bc7 12556 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
62d32a5f 12557
53aa7709 12558 def Realize(*args, **kwargs):
62d32a5f 12559 """
53aa7709 12560 Realize(self)
62d32a5f
RD
12561
12562 This funciton needs to be called after all the buttons have been added
12563 to the sizer. It will reorder them and position them in a platform
12564 specifc manner.
12565 """
5b5c9bc7 12566 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
12567
12568 def SetAffirmativeButton(*args, **kwargs):
12569 """SetAffirmativeButton(self, wxButton button)"""
5b5c9bc7 12570 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
51b83b37
RD
12571
12572 def SetNegativeButton(*args, **kwargs):
12573 """SetNegativeButton(self, wxButton button)"""
5b5c9bc7 12574 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
51b83b37
RD
12575
12576 def SetCancelButton(*args, **kwargs):
12577 """SetCancelButton(self, wxButton button)"""
5b5c9bc7 12578 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
12579
12580 def GetAffirmativeButton(*args, **kwargs):
12581 """GetAffirmativeButton(self) -> wxButton"""
5b5c9bc7 12582 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
62d32a5f
RD
12583
12584 def GetApplyButton(*args, **kwargs):
12585 """GetApplyButton(self) -> wxButton"""
5b5c9bc7 12586 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
62d32a5f
RD
12587
12588 def GetNegativeButton(*args, **kwargs):
12589 """GetNegativeButton(self) -> wxButton"""
5b5c9bc7 12590 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
62d32a5f
RD
12591
12592 def GetCancelButton(*args, **kwargs):
12593 """GetCancelButton(self) -> wxButton"""
5b5c9bc7 12594 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
62d32a5f
RD
12595
12596 def GetHelpButton(*args, **kwargs):
12597 """GetHelpButton(self) -> wxButton"""
5b5c9bc7 12598 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
62d32a5f 12599
33d6fd3b
RD
12600 AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`")
12601 ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`")
12602 CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`")
12603 HelpButton = property(GetHelpButton,doc="See `GetHelpButton`")
12604 NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`")
2131d850 12605_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
62d32a5f 12606
d55e5bfc
RD
12607#---------------------------------------------------------------------------
12608
5b5c9bc7 12609class GBPosition(object):
bfddbb17
RD
12610 """
12611 This class represents the position of an item in a virtual grid of
12612 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12613 typemaps that will automatically convert from a 2-element sequence of
12614 integers to a wx.GBPosition, so you can use the more pythonic
12615 representation of the position nearly transparently in Python code.
12616 """
1bd55598
RD
12617 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12618 __repr__ = _swig_repr
12619 def __init__(self, *args, **kwargs):
bfddbb17 12620 """
5b5c9bc7 12621 __init__(self, int row=0, int col=0) -> GBPosition
bfddbb17
RD
12622
12623 This class represents the position of an item in a virtual grid of
12624 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12625 typemaps that will automatically convert from a 2-element sequence of
12626 integers to a wx.GBPosition, so you can use the more pythonic
12627 representation of the position nearly transparently in Python code.
12628 """
1bd55598
RD
12629 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
12630 __swig_destroy__ = _core_.delete_GBPosition
12631 __del__ = lambda self : None;
d55e5bfc
RD
12632 def GetRow(*args, **kwargs):
12633 """GetRow(self) -> int"""
5b5c9bc7 12634 return _core_.GBPosition_GetRow(*args, **kwargs)
d55e5bfc
RD
12635
12636 def GetCol(*args, **kwargs):
12637 """GetCol(self) -> int"""
5b5c9bc7 12638 return _core_.GBPosition_GetCol(*args, **kwargs)
d55e5bfc
RD
12639
12640 def SetRow(*args, **kwargs):
12641 """SetRow(self, int row)"""
5b5c9bc7 12642 return _core_.GBPosition_SetRow(*args, **kwargs)
d55e5bfc
RD
12643
12644 def SetCol(*args, **kwargs):
12645 """SetCol(self, int col)"""
5b5c9bc7 12646 return _core_.GBPosition_SetCol(*args, **kwargs)
d55e5bfc
RD
12647
12648 def __eq__(*args, **kwargs):
e9d6f3a4
RD
12649 """
12650 __eq__(self, PyObject other) -> bool
12651
12652 Compare GBPosition for equality.
12653 """
5b5c9bc7 12654 return _core_.GBPosition___eq__(*args, **kwargs)
d55e5bfc
RD
12655
12656 def __ne__(*args, **kwargs):
e9d6f3a4
RD
12657 """
12658 __ne__(self, PyObject other) -> bool
12659
12660 Compare GBPosition for inequality.
12661 """
5b5c9bc7 12662 return _core_.GBPosition___ne__(*args, **kwargs)
d55e5bfc
RD
12663
12664 def Set(*args, **kwargs):
12665 """Set(self, int row=0, int col=0)"""
5b5c9bc7 12666 return _core_.GBPosition_Set(*args, **kwargs)
d55e5bfc
RD
12667
12668 def Get(*args, **kwargs):
12669 """Get(self) -> PyObject"""
5b5c9bc7 12670 return _core_.GBPosition_Get(*args, **kwargs)
d55e5bfc 12671
15817c7e 12672 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12673 def __str__(self): return str(self.Get())
12674 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12675 def __len__(self): return len(self.Get())
12676 def __getitem__(self, index): return self.Get()[index]
12677 def __setitem__(self, index, val):
12678 if index == 0: self.SetRow(val)
12679 elif index == 1: self.SetCol(val)
12680 else: raise IndexError
12681 def __nonzero__(self): return self.Get() != (0,0)
12682 __safe_for_unpickling__ = True
12683 def __reduce__(self): return (wx.GBPosition, self.Get())
12684
12685 row = property(GetRow, SetRow)
12686 col = property(GetCol, SetCol)
12687
2131d850 12688_core_.GBPosition_swigregister(GBPosition)
d55e5bfc 12689
5b5c9bc7 12690class GBSpan(object):
bfddbb17
RD
12691 """
12692 This class is used to hold the row and column spanning attributes of
12693 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12694 automatically convert from a 2-element sequence of integers to a
12695 wx.GBSpan, so you can use the more pythonic representation of the span
12696 nearly transparently in Python code.
12697
12698 """
1bd55598
RD
12699 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12700 __repr__ = _swig_repr
12701 def __init__(self, *args, **kwargs):
bfddbb17 12702 """
5b5c9bc7 12703 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
bfddbb17
RD
12704
12705 Construct a new wxGBSpan, optionally setting the rowspan and
12706 colspan. The default is (1,1). (Meaning that the item occupies one
12707 cell in each direction.
12708 """
1bd55598
RD
12709 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12710 __swig_destroy__ = _core_.delete_GBSpan
12711 __del__ = lambda self : None;
d55e5bfc
RD
12712 def GetRowspan(*args, **kwargs):
12713 """GetRowspan(self) -> int"""
5b5c9bc7 12714 return _core_.GBSpan_GetRowspan(*args, **kwargs)
d55e5bfc
RD
12715
12716 def GetColspan(*args, **kwargs):
12717 """GetColspan(self) -> int"""
5b5c9bc7 12718 return _core_.GBSpan_GetColspan(*args, **kwargs)
d55e5bfc
RD
12719
12720 def SetRowspan(*args, **kwargs):
12721 """SetRowspan(self, int rowspan)"""
5b5c9bc7 12722 return _core_.GBSpan_SetRowspan(*args, **kwargs)
d55e5bfc
RD
12723
12724 def SetColspan(*args, **kwargs):
12725 """SetColspan(self, int colspan)"""
5b5c9bc7 12726 return _core_.GBSpan_SetColspan(*args, **kwargs)
d55e5bfc
RD
12727
12728 def __eq__(*args, **kwargs):
e9d6f3a4
RD
12729 """
12730 __eq__(self, PyObject other) -> bool
12731
12732 Compare wxGBSpan for equality.
12733 """
5b5c9bc7 12734 return _core_.GBSpan___eq__(*args, **kwargs)
d55e5bfc
RD
12735
12736 def __ne__(*args, **kwargs):
e9d6f3a4
RD
12737 """
12738 __ne__(self, PyObject other) -> bool
12739
12740 Compare GBSpan for inequality.
12741 """
5b5c9bc7 12742 return _core_.GBSpan___ne__(*args, **kwargs)
d55e5bfc
RD
12743
12744 def Set(*args, **kwargs):
12745 """Set(self, int rowspan=1, int colspan=1)"""
5b5c9bc7 12746 return _core_.GBSpan_Set(*args, **kwargs)
d55e5bfc
RD
12747
12748 def Get(*args, **kwargs):
12749 """Get(self) -> PyObject"""
5b5c9bc7 12750 return _core_.GBSpan_Get(*args, **kwargs)
d55e5bfc 12751
15817c7e 12752 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12753 def __str__(self): return str(self.Get())
12754 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12755 def __len__(self): return len(self.Get())
12756 def __getitem__(self, index): return self.Get()[index]
12757 def __setitem__(self, index, val):
12758 if index == 0: self.SetRowspan(val)
12759 elif index == 1: self.SetColspan(val)
12760 else: raise IndexError
12761 def __nonzero__(self): return self.Get() != (0,0)
12762 __safe_for_unpickling__ = True
12763 def __reduce__(self): return (wx.GBSpan, self.Get())
12764
12765 rowspan = property(GetRowspan, SetRowspan)
12766 colspan = property(GetColspan, SetColspan)
12767
2131d850 12768_core_.GBSpan_swigregister(GBSpan)
d55e5bfc 12769
5b5c9bc7 12770class GBSizerItem(SizerItem):
bfddbb17
RD
12771 """
12772 The wx.GBSizerItem class is used to track the additional data about
12773 items in a `wx.GridBagSizer` such as the item's position in the grid
12774 and how many rows or columns it spans.
12775
12776 """
1bd55598
RD
12777 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12778 __repr__ = _swig_repr
12779 def __init__(self, *args, **kwargs):
bfddbb17 12780 """
5b5c9bc7 12781 __init__(self) -> GBSizerItem
bfddbb17
RD
12782
12783 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12784 size will need to be set, as well as a position and span before this
12785 item can be used in a Sizer.
12786
12787 You will probably never need to create a wx.GBSizerItem directly as they
12788 are created automatically when the sizer's Add method is called.
12789 """
1bd55598
RD
12790 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12791 __swig_destroy__ = _core_.delete_GBSizerItem
12792 __del__ = lambda self : None;
d55e5bfc 12793 def GetPos(*args, **kwargs):
bfddbb17 12794 """
5b5c9bc7 12795 GetPos(self) -> GBPosition
bfddbb17
RD
12796
12797 Get the grid position of the item
12798 """
5b5c9bc7 12799 return _core_.GBSizerItem_GetPos(*args, **kwargs)
d55e5bfc
RD
12800
12801 def GetPosTuple(self): return self.GetPos().Get()
12802 def GetSpan(*args, **kwargs):
bfddbb17 12803 """
5b5c9bc7 12804 GetSpan(self) -> GBSpan
bfddbb17
RD
12805
12806 Get the row and column spanning of the item
12807 """
5b5c9bc7 12808 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
d55e5bfc
RD
12809
12810 def GetSpanTuple(self): return self.GetSpan().Get()
12811 def SetPos(*args, **kwargs):
bfddbb17 12812 """
5b5c9bc7 12813 SetPos(self, GBPosition pos) -> bool
bfddbb17
RD
12814
12815 If the item is already a member of a sizer then first ensure that
12816 there is no other item that would intersect with this one at the new
12817 position, then set the new position. Returns True if the change is
12818 successful and after the next Layout() the item will be moved.
12819 """
5b5c9bc7 12820 return _core_.GBSizerItem_SetPos(*args, **kwargs)
d55e5bfc
RD
12821
12822 def SetSpan(*args, **kwargs):
bfddbb17 12823 """
5b5c9bc7 12824 SetSpan(self, GBSpan span) -> 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 with its new
12828 spanning size, then set the new spanning. Returns True if the change
12829 is successful and after the next Layout() the item will be resized.
12830
12831 """
5b5c9bc7 12832 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
d55e5bfc 12833
bfddbb17 12834 def Intersects(*args, **kwargs):
d55e5bfc 12835 """
5b5c9bc7 12836 Intersects(self, GBSizerItem other) -> bool
bfddbb17
RD
12837
12838 Returns True if this item and the other item instersect.
d55e5bfc 12839 """
5b5c9bc7 12840 return _core_.GBSizerItem_Intersects(*args, **kwargs)
bfddbb17
RD
12841
12842 def IntersectsPos(*args, **kwargs):
12843 """
5b5c9bc7 12844 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
bfddbb17
RD
12845
12846 Returns True if the given pos/span would intersect with this item.
12847 """
5b5c9bc7 12848 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
12849
12850 def GetEndPos(*args, **kwargs):
bfddbb17 12851 """
5b5c9bc7 12852 GetEndPos(self) -> GBPosition
bfddbb17
RD
12853
12854 Get the row and column of the endpoint of this item.
12855 """
5b5c9bc7 12856 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
d55e5bfc
RD
12857
12858 def GetGBSizer(*args, **kwargs):
bfddbb17 12859 """
5b5c9bc7 12860 GetGBSizer(self) -> GridBagSizer
bfddbb17
RD
12861
12862 Get the sizer this item is a member of.
12863 """
5b5c9bc7 12864 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
d55e5bfc
RD
12865
12866 def SetGBSizer(*args, **kwargs):
bfddbb17 12867 """
5b5c9bc7 12868 SetGBSizer(self, GridBagSizer sizer)
bfddbb17
RD
12869
12870 Set the sizer this item is a member of.
12871 """
5b5c9bc7 12872 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
d55e5bfc 12873
ac5d357a
RD
12874 EndPos = property(GetEndPos,doc="See `GetEndPos`")
12875 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
12876 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
12877 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
2131d850 12878_core_.GBSizerItem_swigregister(GBSizerItem)
5b5c9bc7 12879DefaultSpan = cvar.DefaultSpan
d55e5bfc
RD
12880
12881def GBSizerItemWindow(*args, **kwargs):
12882 """
5b5c9bc7
RD
12883 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12884 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12885
12886 Construct a `wx.GBSizerItem` for a window.
d55e5bfc 12887 """
5b5c9bc7 12888 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12889 return val
12890
12891def GBSizerItemSizer(*args, **kwargs):
12892 """
5b5c9bc7
RD
12893 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12894 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12895
12896 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc 12897 """
5b5c9bc7 12898 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12899 return val
12900
12901def GBSizerItemSpacer(*args, **kwargs):
12902 """
5b5c9bc7
RD
12903 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12904 int flag, int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12905
12906 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc 12907 """
5b5c9bc7 12908 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12909 return val
12910
5b5c9bc7 12911class GridBagSizer(FlexGridSizer):
bfddbb17
RD
12912 """
12913 A `wx.Sizer` that can lay out items in a virtual grid like a
12914 `wx.FlexGridSizer` but in this case explicit positioning of the items
12915 is allowed using `wx.GBPosition`, and items can optionally span more
12916 than one row and/or column using `wx.GBSpan`. The total size of the
12917 virtual grid is determined by the largest row and column that items are
12918 positioned at, adjusted for spanning.
12919
12920 """
1bd55598
RD
12921 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12922 __repr__ = _swig_repr
12923 def __init__(self, *args, **kwargs):
bfddbb17 12924 """
5b5c9bc7 12925 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
bfddbb17
RD
12926
12927 Constructor, with optional parameters to specify the gap between the
12928 rows and columns.
12929 """
1bd55598 12930 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
03e46024
RD
12931 self._setOORInfo(self)
12932
d55e5bfc
RD
12933 def Add(*args, **kwargs):
12934 """
bfddbb17 12935 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
070c48b4 12936 int border=0, userData=None) -> wx.GBSizerItem
bfddbb17
RD
12937
12938 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12939 more than one row or column as specified with *span*. The remaining
12940 args behave similarly to `wx.Sizer.Add`.
12941
12942 Returns True if the item was successfully placed at the given cell
12943 position, False if something was already there.
12944
d55e5bfc 12945 """
5b5c9bc7 12946 return _core_.GridBagSizer_Add(*args, **kwargs)
d55e5bfc
RD
12947
12948 def AddItem(*args, **kwargs):
bfddbb17 12949 """
070c48b4 12950 Add(self, GBSizerItem item) -> wx.GBSizerItem
bfddbb17
RD
12951
12952 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12953 the item was successfully placed at its given cell position, False if
12954 something was already there.
12955 """
5b5c9bc7 12956 return _core_.GridBagSizer_AddItem(*args, **kwargs)
d55e5bfc 12957
84f85550
RD
12958 def GetCellSize(*args, **kwargs):
12959 """
5b5c9bc7 12960 GetCellSize(self, int row, int col) -> Size
84f85550
RD
12961
12962 Get the size of the specified cell, including hgap and
12963 vgap. Only valid after a Layout.
12964 """
5b5c9bc7 12965 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
84f85550 12966
d55e5bfc 12967 def GetEmptyCellSize(*args, **kwargs):
bfddbb17 12968 """
5b5c9bc7 12969 GetEmptyCellSize(self) -> Size
bfddbb17
RD
12970
12971 Get the size used for cells in the grid with no item.
12972 """
5b5c9bc7 12973 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12974
12975 def SetEmptyCellSize(*args, **kwargs):
bfddbb17 12976 """
5b5c9bc7 12977 SetEmptyCellSize(self, Size sz)
bfddbb17
RD
12978
12979 Set the size used for cells in the grid with no item.
12980 """
5b5c9bc7 12981 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12982
12983 def GetItemPosition(*args):
12984 """
bfddbb17
RD
12985 GetItemPosition(self, item) -> GBPosition
12986
12987 Get the grid position of the specified *item* where *item* is either a
12988 window or subsizer that is a member of this sizer, or a zero-based
12989 index of an item.
d55e5bfc 12990 """
5b5c9bc7 12991 return _core_.GridBagSizer_GetItemPosition(*args)
d55e5bfc
RD
12992
12993 def SetItemPosition(*args):
12994 """
bfddbb17
RD
12995 SetItemPosition(self, item, GBPosition pos) -> bool
12996
12997 Set the grid position of the specified *item* where *item* is either a
12998 window or subsizer that is a member of this sizer, or a zero-based
12999 index of an item. Returns True on success. If the move is not
13000 allowed (because an item is already there) then False is returned.
13001
d55e5bfc 13002 """
5b5c9bc7 13003 return _core_.GridBagSizer_SetItemPosition(*args)
d55e5bfc
RD
13004
13005 def GetItemSpan(*args):
13006 """
bfddbb17
RD
13007 GetItemSpan(self, item) -> GBSpan
13008
13009 Get the row/col spanning of the specified *item* where *item* is
13010 either a window or subsizer that is a member of this sizer, or a
13011 zero-based index of an item.
d55e5bfc 13012 """
5b5c9bc7 13013 return _core_.GridBagSizer_GetItemSpan(*args)
d55e5bfc
RD
13014
13015 def SetItemSpan(*args):
13016 """
bfddbb17
RD
13017 SetItemSpan(self, item, GBSpan span) -> bool
13018
13019 Set the row/col spanning of the specified *item* where *item* is
13020 either a window or subsizer that is a member of this sizer, or a
13021 zero-based index of an item. Returns True on success. If the move is
13022 not allowed (because an item is already there) then False is returned.
d55e5bfc 13023 """
5b5c9bc7 13024 return _core_.GridBagSizer_SetItemSpan(*args)
d55e5bfc
RD
13025
13026 def FindItem(*args):
13027 """
bfddbb17
RD
13028 FindItem(self, item) -> GBSizerItem
13029
13030 Find the sizer item for the given window or subsizer, returns None if
13031 not found. (non-recursive)
d55e5bfc 13032 """
5b5c9bc7 13033 return _core_.GridBagSizer_FindItem(*args)
d55e5bfc
RD
13034
13035 def FindItemAtPosition(*args, **kwargs):
bfddbb17 13036 """
5b5c9bc7 13037 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
bfddbb17
RD
13038
13039 Return the sizer item for the given grid cell, or None if there is no
13040 item at that position. (non-recursive)
13041 """
5b5c9bc7 13042 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
d55e5bfc
RD
13043
13044 def FindItemAtPoint(*args, **kwargs):
bfddbb17 13045 """
5b5c9bc7 13046 FindItemAtPoint(self, Point pt) -> GBSizerItem
bfddbb17
RD
13047
13048 Return the sizer item located at the point given in *pt*, or None if
13049 there is no item at that point. The (x,y) coordinates in pt correspond
13050 to the client coordinates of the window using the sizer for
13051 layout. (non-recursive)
13052 """
5b5c9bc7 13053 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
d55e5bfc 13054
bfddbb17
RD
13055 def CheckForIntersection(*args, **kwargs):
13056 """
5b5c9bc7 13057 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 13058
bfddbb17
RD
13059 Look at all items and see if any intersect (or would overlap) the
13060 given *item*. Returns True if so, False if there would be no overlap.
13061 If an *excludeItem* is given then it will not be checked for
13062 intersection, for example it may be the item we are checking the
13063 position of.
d55e5bfc 13064
bfddbb17 13065 """
5b5c9bc7 13066 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 13067
bfddbb17 13068 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 13069 """
5b5c9bc7 13070 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
bfddbb17
RD
13071
13072 Look at all items and see if any intersect (or would overlap) the
13073 given position and span. Returns True if so, False if there would be
13074 no overlap. If an *excludeItem* is given then it will not be checked
13075 for intersection, for example it may be the item we are checking the
13076 position of.
d55e5bfc 13077 """
5b5c9bc7 13078 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc 13079
2131d850 13080_core_.GridBagSizer_swigregister(GridBagSizer)
d55e5bfc
RD
13081
13082#---------------------------------------------------------------------------
13083
5b5c9bc7
RD
13084Left = _core_.Left
13085Top = _core_.Top
13086Right = _core_.Right
13087Bottom = _core_.Bottom
13088Width = _core_.Width
13089Height = _core_.Height
13090Centre = _core_.Centre
13091Center = _core_.Center
13092CentreX = _core_.CentreX
13093CentreY = _core_.CentreY
13094Unconstrained = _core_.Unconstrained
13095AsIs = _core_.AsIs
13096PercentOf = _core_.PercentOf
13097Above = _core_.Above
13098Below = _core_.Below
13099LeftOf = _core_.LeftOf
13100RightOf = _core_.RightOf
13101SameAs = _core_.SameAs
13102Absolute = _core_.Absolute
13103class IndividualLayoutConstraint(Object):
d55e5bfc 13104 """
15817c7e
RD
13105 Objects of this class are stored in the `wx.LayoutConstraints` class as
13106 one of eight possible constraints that a window can be involved in.
13107 You will never need to create an instance of
13108 wx.IndividualLayoutConstraint, rather you should create a
13109 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 13110 that it contains.
d55e5bfc 13111 """
1bd55598
RD
13112 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13113 def __init__(self): raise AttributeError, "No constructor defined"
13114 __repr__ = _swig_repr
d55e5bfc 13115 def Set(*args, **kwargs):
15817c7e 13116 """
5b5c9bc7 13117 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
15817c7e
RD
13118
13119 Sets the properties of the constraint. Normally called by one of the
13120 convenience functions such as Above, RightOf, SameAs.
13121 """
5b5c9bc7 13122 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
d55e5bfc
RD
13123
13124 def LeftOf(*args, **kwargs):
13125 """
5b5c9bc7 13126 LeftOf(self, Window sibling, int marg=0)
d55e5bfc 13127
15817c7e
RD
13128 Constrains this edge to be to the left of the given window, with an
13129 optional margin. Implicitly, this is relative to the left edge of the
13130 other window.
d55e5bfc 13131 """
5b5c9bc7 13132 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
d55e5bfc
RD
13133
13134 def RightOf(*args, **kwargs):
13135 """
5b5c9bc7 13136 RightOf(self, Window sibling, int marg=0)
d55e5bfc 13137
15817c7e
RD
13138 Constrains this edge to be to the right of the given window, with an
13139 optional margin. Implicitly, this is relative to the right edge of the
13140 other window.
d55e5bfc 13141 """
5b5c9bc7 13142 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
d55e5bfc
RD
13143
13144 def Above(*args, **kwargs):
13145 """
5b5c9bc7 13146 Above(self, Window sibling, int marg=0)
d55e5bfc 13147
15817c7e
RD
13148 Constrains this edge to be above the given window, with an optional
13149 margin. Implicitly, this is relative to the top edge of the other
13150 window.
d55e5bfc 13151 """
5b5c9bc7 13152 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
d55e5bfc
RD
13153
13154 def Below(*args, **kwargs):
13155 """
5b5c9bc7 13156 Below(self, Window sibling, int marg=0)
d55e5bfc 13157
15817c7e
RD
13158 Constrains this edge to be below the given window, with an optional
13159 margin. Implicitly, this is relative to the bottom edge of the other
13160 window.
d55e5bfc 13161 """
5b5c9bc7 13162 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
d55e5bfc
RD
13163
13164 def SameAs(*args, **kwargs):
13165 """
5b5c9bc7 13166 SameAs(self, Window otherW, int edge, int marg=0)
d55e5bfc 13167
15817c7e
RD
13168 Constrains this edge or dimension to be to the same as the edge of the
13169 given window, with an optional margin.
d55e5bfc 13170 """
5b5c9bc7 13171 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
d55e5bfc
RD
13172
13173 def PercentOf(*args, **kwargs):
13174 """
5b5c9bc7 13175 PercentOf(self, Window otherW, int wh, int per)
d55e5bfc 13176
15817c7e
RD
13177 Constrains this edge or dimension to be to a percentage of the given
13178 window, with an optional margin.
d55e5bfc 13179 """
5b5c9bc7 13180 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
d55e5bfc
RD
13181
13182 def Absolute(*args, **kwargs):
13183 """
13184 Absolute(self, int val)
13185
15817c7e 13186 Constrains this edge or dimension to be the given absolute value.
d55e5bfc 13187 """
5b5c9bc7 13188 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
d55e5bfc
RD
13189
13190 def Unconstrained(*args, **kwargs):
13191 """
13192 Unconstrained(self)
13193
15817c7e
RD
13194 Sets this edge or dimension to be unconstrained, that is, dependent on
13195 other edges and dimensions from which this value can be deduced.
d55e5bfc 13196 """
5b5c9bc7 13197 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
d55e5bfc
RD
13198
13199 def AsIs(*args, **kwargs):
13200 """
13201 AsIs(self)
13202
15817c7e
RD
13203 Sets this edge or constraint to be whatever the window's value is at
13204 the moment. If either of the width and height constraints are *as is*,
13205 the window will not be resized, but moved instead. This is important
13206 when considering panel items which are intended to have a default
13207 size, such as a button, which may take its size from the size of the
13208 button label.
d55e5bfc 13209 """
5b5c9bc7 13210 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
d55e5bfc
RD
13211
13212 def GetOtherWindow(*args, **kwargs):
5b5c9bc7
RD
13213 """GetOtherWindow(self) -> Window"""
13214 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
d55e5bfc
RD
13215
13216 def GetMyEdge(*args, **kwargs):
13217 """GetMyEdge(self) -> int"""
5b5c9bc7 13218 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
d55e5bfc
RD
13219
13220 def SetEdge(*args, **kwargs):
13221 """SetEdge(self, int which)"""
5b5c9bc7 13222 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
d55e5bfc
RD
13223
13224 def SetValue(*args, **kwargs):
13225 """SetValue(self, int v)"""
5b5c9bc7 13226 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
d55e5bfc
RD
13227
13228 def GetMargin(*args, **kwargs):
13229 """GetMargin(self) -> int"""
5b5c9bc7 13230 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
d55e5bfc
RD
13231
13232 def SetMargin(*args, **kwargs):
13233 """SetMargin(self, int m)"""
5b5c9bc7 13234 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
d55e5bfc
RD
13235
13236 def GetValue(*args, **kwargs):
13237 """GetValue(self) -> int"""
5b5c9bc7 13238 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
d55e5bfc
RD
13239
13240 def GetPercent(*args, **kwargs):
13241 """GetPercent(self) -> int"""
5b5c9bc7 13242 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
d55e5bfc
RD
13243
13244 def GetOtherEdge(*args, **kwargs):
13245 """GetOtherEdge(self) -> int"""
5b5c9bc7 13246 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
d55e5bfc
RD
13247
13248 def GetDone(*args, **kwargs):
13249 """GetDone(self) -> bool"""
5b5c9bc7 13250 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
d55e5bfc
RD
13251
13252 def SetDone(*args, **kwargs):
13253 """SetDone(self, bool d)"""
5b5c9bc7 13254 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
d55e5bfc
RD
13255
13256 def GetRelationship(*args, **kwargs):
13257 """GetRelationship(self) -> int"""
5b5c9bc7 13258 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
d55e5bfc
RD
13259
13260 def SetRelationship(*args, **kwargs):
13261 """SetRelationship(self, int r)"""
5b5c9bc7 13262 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
d55e5bfc
RD
13263
13264 def ResetIfWin(*args, **kwargs):
13265 """
5b5c9bc7 13266 ResetIfWin(self, Window otherW) -> bool
d55e5bfc
RD
13267
13268 Reset constraint if it mentions otherWin
13269 """
5b5c9bc7 13270 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
d55e5bfc
RD
13271
13272 def SatisfyConstraint(*args, **kwargs):
13273 """
5b5c9bc7 13274 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
d55e5bfc
RD
13275
13276 Try to satisfy constraint
13277 """
5b5c9bc7 13278 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
d55e5bfc
RD
13279
13280 def GetEdge(*args, **kwargs):
13281 """
5b5c9bc7 13282 GetEdge(self, int which, Window thisWin, Window other) -> int
d55e5bfc
RD
13283
13284 Get the value of this edge or dimension, or if this
13285 is not determinable, -1.
13286 """
5b5c9bc7 13287 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
d55e5bfc 13288
ac5d357a
RD
13289 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
13290 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
13291 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
13292 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
13293 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
13294 Percent = property(GetPercent,doc="See `GetPercent`")
13295 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
13296 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
2131d850 13297_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d55e5bfc 13298
5b5c9bc7 13299class LayoutConstraints(Object):
d55e5bfc 13300 """
15817c7e
RD
13301 **Note:** constraints are now deprecated and you should use sizers
13302 instead.
d55e5bfc 13303
15817c7e
RD
13304 Objects of this class can be associated with a window to define its
13305 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
13306
13307 The class consists of the following eight constraints of class
13308 wx.IndividualLayoutConstraint, some or all of which should be accessed
13309 directly to set the appropriate constraints.
13310
13311 * left: represents the left hand edge of the window
13312 * right: represents the right hand edge of the window
13313 * top: represents the top edge of the window
13314 * bottom: represents the bottom edge of the window
13315 * width: represents the width of the window
13316 * height: represents the height of the window
13317 * centreX: represents the horizontal centre point of the window
13318 * centreY: represents the vertical centre point of the window
13319
15817c7e
RD
13320 Most constraints are initially set to have the relationship
13321 wxUnconstrained, which means that their values should be calculated by
13322 looking at known constraints. The exceptions are width and height,
13323 which are set to wxAsIs to ensure that if the user does not specify a
13324 constraint, the existing width and height will be used, to be
13325 compatible with panel items which often have take a default size. If
13326 the constraint is ``wx.AsIs``, the dimension will not be changed.
13327
13328 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
13329
13330 """
1bd55598
RD
13331 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13332 __repr__ = _swig_repr
5b5c9bc7
RD
13333 left = property(_core_.LayoutConstraints_left_get)
13334 top = property(_core_.LayoutConstraints_top_get)
13335 right = property(_core_.LayoutConstraints_right_get)
13336 bottom = property(_core_.LayoutConstraints_bottom_get)
13337 width = property(_core_.LayoutConstraints_width_get)
13338 height = property(_core_.LayoutConstraints_height_get)
13339 centreX = property(_core_.LayoutConstraints_centreX_get)
13340 centreY = property(_core_.LayoutConstraints_centreY_get)
1bd55598 13341 def __init__(self, *args, **kwargs):
5b5c9bc7 13342 """__init__(self) -> LayoutConstraints"""
1bd55598
RD
13343 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
13344 __swig_destroy__ = _core_.delete_LayoutConstraints
13345 __del__ = lambda self : None;
d55e5bfc
RD
13346 def SatisfyConstraints(*args, **kwargs):
13347 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
5b5c9bc7 13348 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
d55e5bfc
RD
13349
13350 def AreSatisfied(*args, **kwargs):
13351 """AreSatisfied(self) -> bool"""
5b5c9bc7 13352 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
d55e5bfc 13353
2131d850 13354_core_.LayoutConstraints_swigregister(LayoutConstraints)
d55e5bfc
RD
13355
13356#----------------------------------------------------------------------------
13357
13358# Use Python's bool constants if available, make some if not
13359try:
13360 True
13361except NameError:
13362 __builtins__.True = 1==1
13363 __builtins__.False = 1==0
13364 def bool(value): return not not value
13365 __builtins__.bool = bool
13366
13367
13368
13369# workarounds for bad wxRTTI names
13370__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13371__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13372__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13373
13374
13375#----------------------------------------------------------------------------
13376# Load version numbers from __version__... Ensure that major and minor
0f63ec68 13377# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
13378
13379from __version__ import *
13380__version__ = VERSION_STRING
13381
0f63ec68
RD
13382assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13383assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
13384if RELEASE_VERSION != _core_.RELEASE_VERSION:
13385 import warnings
0f63ec68 13386 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
13387
13388#----------------------------------------------------------------------------
13389
7993762b
RD
13390# Set wxPython's default string<-->unicode conversion encoding from
13391# the locale, but only if Python's default hasn't been changed. (We
13392# assume that if the user has customized it already then that is the
13393# encoding we need to use as well.)
13394#
13395# The encoding selected here is used when string or unicode objects
13396# need to be converted in order to pass them to wxWidgets. Please be
13397# aware that the default encoding within the same locale may be
13398# slightly different on different platforms. For example, please see
62d32a5f
RD
13399# http://www.alanwood.net/demos/charsetdiffs.html for differences
13400# between the common latin/roman encodings.
3837a853
RD
13401
13402default = _sys.getdefaultencoding()
13403if default == 'ascii':
13404 import locale
13405 import codecs
13406 try:
13407 default = locale.getdefaultlocale()[1]
13408 codecs.lookup(default)
7993762b 13409 except (ValueError, LookupError, TypeError):
3837a853
RD
13410 default = _sys.getdefaultencoding()
13411 del locale
13412 del codecs
5cbf236d
RD
13413if default:
13414 wx.SetDefaultPyEncoding(default)
13415del default
5cbf236d
RD
13416
13417#----------------------------------------------------------------------------
13418
d55e5bfc
RD
13419class PyDeadObjectError(AttributeError):
13420 pass
13421
13422class _wxPyDeadObject(object):
13423 """
13424 Instances of wx objects that are OOR capable will have their __class__
13425 changed to this class when the C++ object is deleted. This should help
13426 prevent crashes due to referencing a bogus C++ pointer.
13427 """
13428 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13429 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13430
13431 def __repr__(self):
13432 if not hasattr(self, "_name"):
13433 self._name = "[unknown]"
13434 return self.reprStr % self._name
13435
13436 def __getattr__(self, *args):
13437 if not hasattr(self, "_name"):
13438 self._name = "[unknown]"
13439 raise PyDeadObjectError(self.attrStr % self._name)
13440
13441 def __nonzero__(self):
13442 return 0
13443
13444
13445
13446class PyUnbornObjectError(AttributeError):
13447 pass
13448
13449class _wxPyUnbornObject(object):
13450 """
13451 Some stock objects are created when the wx._core module is
13452 imported, but their C++ instance is not created until the wx.App
13453 object is created and initialized. These object instances will
13454 temporarily have their __class__ changed to this class so an
13455 exception will be raised if they are used before the C++ instance
13456 is ready.
13457 """
13458
13459 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13460 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13461
13462 def __repr__(self):
13463 #if not hasattr(self, "_name"):
13464 # self._name = "[unknown]"
13465 return self.reprStr #% self._name
13466
13467 def __getattr__(self, *args):
13468 #if not hasattr(self, "_name"):
13469 # self._name = "[unknown]"
13470 raise PyUnbornObjectError(self.attrStr) # % self._name )
13471
13472 def __nonzero__(self):
13473 return 0
13474
13475
13476#----------------------------------------------------------------------------
d55e5bfc
RD
13477
13478def CallAfter(callable, *args, **kw):
13479 """
13480 Call the specified function after the current and pending event
13481 handlers have been completed. This is also good for making GUI
0439c23b
RD
13482 method calls from non-GUI threads. Any extra positional or
13483 keyword args are passed on to the callable when it is called.
13484
846c181b 13485 :see: `wx.CallLater`
d55e5bfc
RD
13486 """
13487 app = wx.GetApp()
a001823c 13488 assert app is not None, 'No wx.App created yet'
d55e5bfc 13489
891bb194
RD
13490 if not hasattr(app, "_CallAfterId"):
13491 app._CallAfterId = wx.NewEventType()
13492 app.Connect(-1, -1, app._CallAfterId,
13493 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 13494 evt = wx.PyEvent()
891bb194 13495 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
13496 evt.callable = callable
13497 evt.args = args
13498 evt.kw = kw
13499 wx.PostEvent(app, evt)
13500
d55e5bfc
RD
13501#----------------------------------------------------------------------------
13502
13503
846c181b 13504class CallLater:
d55e5bfc 13505 """
6e0de3df 13506 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
13507 object once after the given amount of milliseconds, passing any
13508 positional or keyword args. The return value of the callable is
0439c23b 13509 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
13510
13511 If you don't need to get the return value or restart the timer
13512 then there is no need to hold a reference to this object. It will
13513 hold a reference to itself while the timer is running (the timer
13514 has a reference to self.Notify) but the cycle will be broken when
846c181b 13515 the timer completes, automatically cleaning up the wx.CallLater
d55e5bfc 13516 object.
0439c23b
RD
13517
13518 :see: `wx.CallAfter`
d55e5bfc
RD
13519 """
13520 def __init__(self, millis, callable, *args, **kwargs):
13521 self.millis = millis
13522 self.callable = callable
13523 self.SetArgs(*args, **kwargs)
13524 self.runCount = 0
13525 self.running = False
13526 self.hasRun = False
13527 self.result = None
13528 self.timer = None
13529 self.Start()
13530
13531 def __del__(self):
13532 self.Stop()
13533
13534
13535 def Start(self, millis=None, *args, **kwargs):
13536 """
13537 (Re)start the timer
13538 """
13539 self.hasRun = False
13540 if millis is not None:
13541 self.millis = millis
13542 if args or kwargs:
13543 self.SetArgs(*args, **kwargs)
13544 self.Stop()
13545 self.timer = wx.PyTimer(self.Notify)
13546 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
13547 self.running = True
13548 Restart = Start
13549
13550
13551 def Stop(self):
13552 """
13553 Stop and destroy the timer.
13554 """
13555 if self.timer is not None:
13556 self.timer.Stop()
13557 self.timer = None
13558
13559
13560 def GetInterval(self):
13561 if self.timer is not None:
13562 return self.timer.GetInterval()
13563 else:
13564 return 0
13565
13566
13567 def IsRunning(self):
13568 return self.timer is not None and self.timer.IsRunning()
13569
13570
13571 def SetArgs(self, *args, **kwargs):
13572 """
13573 (Re)set the args passed to the callable object. This is
13574 useful in conjunction with Restart if you want to schedule a
13575 new call to the same callable object but with different
13576 parameters.
13577 """
13578 self.args = args
13579 self.kwargs = kwargs
13580
13581
13582 def HasRun(self):
13583 return self.hasRun
13584
13585 def GetResult(self):
13586 return self.result
13587
13588 def Notify(self):
13589 """
13590 The timer has expired so call the callable.
13591 """
13592 if self.callable and getattr(self.callable, 'im_self', True):
13593 self.runCount += 1
13594 self.running = False
13595 self.result = self.callable(*self.args, **self.kwargs)
13596 self.hasRun = True
13597 if not self.running:
13598 # if it wasn't restarted, then cleanup
13599 wx.CallAfter(self.Stop)
13600
ac5d357a
RD
13601 Interval = property(GetInterval)
13602 Result = property(GetResult)
d55e5bfc
RD
13603
13604
846c181b
RD
13605class FutureCall(CallLater):
13606 """A compatibility alias for `CallLater`."""
13607
d55e5bfc
RD
13608#----------------------------------------------------------------------------
13609# Control which items in this module should be documented by epydoc.
13610# We allow only classes and functions, which will help reduce the size
13611# of the docs by filtering out the zillions of constants, EVT objects,
13612# and etc that don't make much sense by themselves, but are instead
13613# documented (or will be) as part of the classes/functions/methods
13614# where they should be used.
13615
d6c14a4c
RD
13616class __DocFilter:
13617 """
13618 A filter for epydoc that only allows non-Ptr classes and
34e0a3bb 13619 functions, in order to reduce the clutter in the API docs.
d6c14a4c
RD
13620 """
13621 def __init__(self, globals):
13622 self._globals = globals
13623
13624 def __call__(self, name):
13625 import types
13626 obj = self._globals.get(name, None)
34e0a3bb
RD
13627
13628 # only document classes and function
d6c14a4c
RD
13629 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13630 return False
34e0a3bb
RD
13631
13632 # skip other things that are private or will be documented as part of somethign else
1bd55598 13633 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
d6c14a4c 13634 return False
34e0a3bb
RD
13635
13636 # skip functions that are duplicates of static functions in a class
13637 if name.find('_') != -1:
13638 cls = self._globals.get(name.split('_')[0], None)
13639 methname = name.split('_')[1]
13640 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
13641 return False
13642
d6c14a4c 13643 return True
d55e5bfc
RD
13644
13645#----------------------------------------------------------------------------
13646#----------------------------------------------------------------------------
13647
13648# Import other modules in this package that should show up in the
13649# "core" wx namespace
13650from _gdi import *
13651from _windows import *
13652from _controls import *
13653from _misc import *
13654
d55e5bfc
RD
13655#----------------------------------------------------------------------------
13656#----------------------------------------------------------------------------
13657
13658
32fe5131 13659