]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gtk/_core.py
Stop the timer when the sample is destroyed
[wxWidgets.git] / wxPython / src / gtk / _core.py
CommitLineData
0085ce49 1# This file was created automatically by SWIG 1.3.29.
d14a1e28
RD
2# Don't modify this file, modify the SWIG interface instead.
3
54f9ee45 4import _core_
0085ce49
RD
5import new
6new_instancemethod = new.instancemethod
093d3ff1 7def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
0085ce49 8 if (name == "thisown"): return self.this.own(value)
093d3ff1 9 if (name == "this"):
0085ce49
RD
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
093d3ff1
RD
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
0085ce49 15 if (not static) or hasattr(self,name):
093d3ff1
RD
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
0085ce49 24 if (name == "thisown"): return self.this.own()
093d3ff1
RD
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
0085ce49
RD
29def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
093d3ff1
RD
34import types
35try:
36 _object = types.ObjectType
37 _newclass = 1
38except AttributeError:
39 class _object : pass
40 _newclass = 0
41del types
42
43
44def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
0085ce49
RD
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
093d3ff1
RD
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
d14a1e28
RD
54#// Give a reference to the dictionary of this module to the C++ extension
55#// code.
54f9ee45 56_core_._wxPySetDictionary(vars())
d14a1e28
RD
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
66c033b4
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
54f9ee45
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
bcd0d7b6 95DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 96DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
54f9ee45
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
54f9ee45
RD
103CLIP_CHILDREN = _core_.CLIP_CHILDREN
104CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
092f0ed7 105WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
54f9ee45
RD
106ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
107RETAINED = _core_.RETAINED
108BACKINGSTORE = _core_.BACKINGSTORE
109COLOURED = _core_.COLOURED
110FIXED_LENGTH = _core_.FIXED_LENGTH
111LB_NEEDED_SB = _core_.LB_NEEDED_SB
112LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
113LB_SORT = _core_.LB_SORT
114LB_SINGLE = _core_.LB_SINGLE
115LB_MULTIPLE = _core_.LB_MULTIPLE
116LB_EXTENDED = _core_.LB_EXTENDED
117LB_OWNERDRAW = _core_.LB_OWNERDRAW
118LB_HSCROLL = _core_.LB_HSCROLL
119PROCESS_ENTER = _core_.PROCESS_ENTER
120PASSWORD = _core_.PASSWORD
121CB_SIMPLE = _core_.CB_SIMPLE
122CB_DROPDOWN = _core_.CB_DROPDOWN
123CB_SORT = _core_.CB_SORT
124CB_READONLY = _core_.CB_READONLY
125RA_HORIZONTAL = _core_.RA_HORIZONTAL
126RA_VERTICAL = _core_.RA_VERTICAL
127RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
128RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
fef4c27a 129RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
54f9ee45
RD
130RB_GROUP = _core_.RB_GROUP
131RB_SINGLE = _core_.RB_SINGLE
54f9ee45
RD
132SB_HORIZONTAL = _core_.SB_HORIZONTAL
133SB_VERTICAL = _core_.SB_VERTICAL
fef4c27a 134RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
54f9ee45
RD
135ST_SIZEGRIP = _core_.ST_SIZEGRIP
136ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
e9d6f3a4
RD
137ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
138ST_DOTS_END = _core_.ST_DOTS_END
54f9ee45
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
54f9ee45
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
54f9ee45
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
54f9ee45
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
10044bf1
RD
204ID_HELP_INDEX = _core_.ID_HELP_INDEX
205ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
54f9ee45
RD
206ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
207ID_PREFERENCES = _core_.ID_PREFERENCES
97ab0f6a 208ID_EDIT = _core_.ID_EDIT
54f9ee45
RD
209ID_CUT = _core_.ID_CUT
210ID_COPY = _core_.ID_COPY
211ID_PASTE = _core_.ID_PASTE
212ID_CLEAR = _core_.ID_CLEAR
213ID_FIND = _core_.ID_FIND
214ID_DUPLICATE = _core_.ID_DUPLICATE
215ID_SELECTALL = _core_.ID_SELECTALL
216ID_DELETE = _core_.ID_DELETE
217ID_REPLACE = _core_.ID_REPLACE
218ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
219ID_PROPERTIES = _core_.ID_PROPERTIES
220ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
221ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
222ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
223ID_VIEW_LIST = _core_.ID_VIEW_LIST
224ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
225ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
226ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
227ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
97ab0f6a 228ID_FILE = _core_.ID_FILE
54f9ee45
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
7bc1e663
RD
256ID_ADD = _core_.ID_ADD
257ID_REMOVE = _core_.ID_REMOVE
258ID_UP = _core_.ID_UP
259ID_DOWN = _core_.ID_DOWN
260ID_HOME = _core_.ID_HOME
261ID_REFRESH = _core_.ID_REFRESH
262ID_STOP = _core_.ID_STOP
263ID_INDEX = _core_.ID_INDEX
264ID_BOLD = _core_.ID_BOLD
265ID_ITALIC = _core_.ID_ITALIC
266ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
267ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
268ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
269ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
270ID_UNDERLINE = _core_.ID_UNDERLINE
271ID_INDENT = _core_.ID_INDENT
272ID_UNINDENT = _core_.ID_UNINDENT
273ID_ZOOM_100 = _core_.ID_ZOOM_100
274ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
275ID_ZOOM_IN = _core_.ID_ZOOM_IN
276ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
277ID_UNDELETE = _core_.ID_UNDELETE
278ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
54f9ee45 279ID_HIGHEST = _core_.ID_HIGHEST
54f9ee45
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
7bc1e663
RD
346BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
347BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
348BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
54f9ee45
RD
349DEFAULT = _core_.DEFAULT
350DECORATIVE = _core_.DECORATIVE
351ROMAN = _core_.ROMAN
352SCRIPT = _core_.SCRIPT
353SWISS = _core_.SWISS
354MODERN = _core_.MODERN
355TELETYPE = _core_.TELETYPE
356VARIABLE = _core_.VARIABLE
357FIXED = _core_.FIXED
358NORMAL = _core_.NORMAL
359LIGHT = _core_.LIGHT
360BOLD = _core_.BOLD
361ITALIC = _core_.ITALIC
362SLANT = _core_.SLANT
363SOLID = _core_.SOLID
364DOT = _core_.DOT
365LONG_DASH = _core_.LONG_DASH
366SHORT_DASH = _core_.SHORT_DASH
367DOT_DASH = _core_.DOT_DASH
368USER_DASH = _core_.USER_DASH
369TRANSPARENT = _core_.TRANSPARENT
370STIPPLE = _core_.STIPPLE
d04418a7
RD
371STIPPLE_MASK = _core_.STIPPLE_MASK
372STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
54f9ee45
RD
373BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
374CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
375FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
376CROSS_HATCH = _core_.CROSS_HATCH
377HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
378VERTICAL_HATCH = _core_.VERTICAL_HATCH
379JOIN_BEVEL = _core_.JOIN_BEVEL
380JOIN_MITER = _core_.JOIN_MITER
381JOIN_ROUND = _core_.JOIN_ROUND
382CAP_ROUND = _core_.CAP_ROUND
383CAP_PROJECTING = _core_.CAP_PROJECTING
384CAP_BUTT = _core_.CAP_BUTT
385CLEAR = _core_.CLEAR
386XOR = _core_.XOR
387INVERT = _core_.INVERT
388OR_REVERSE = _core_.OR_REVERSE
389AND_REVERSE = _core_.AND_REVERSE
390COPY = _core_.COPY
391AND = _core_.AND
392AND_INVERT = _core_.AND_INVERT
393NO_OP = _core_.NO_OP
394NOR = _core_.NOR
395EQUIV = _core_.EQUIV
396SRC_INVERT = _core_.SRC_INVERT
397OR_INVERT = _core_.OR_INVERT
398NAND = _core_.NAND
399OR = _core_.OR
400SET = _core_.SET
401WXK_BACK = _core_.WXK_BACK
402WXK_TAB = _core_.WXK_TAB
403WXK_RETURN = _core_.WXK_RETURN
404WXK_ESCAPE = _core_.WXK_ESCAPE
405WXK_SPACE = _core_.WXK_SPACE
406WXK_DELETE = _core_.WXK_DELETE
407WXK_START = _core_.WXK_START
408WXK_LBUTTON = _core_.WXK_LBUTTON
409WXK_RBUTTON = _core_.WXK_RBUTTON
410WXK_CANCEL = _core_.WXK_CANCEL
411WXK_MBUTTON = _core_.WXK_MBUTTON
412WXK_CLEAR = _core_.WXK_CLEAR
413WXK_SHIFT = _core_.WXK_SHIFT
414WXK_ALT = _core_.WXK_ALT
415WXK_CONTROL = _core_.WXK_CONTROL
416WXK_MENU = _core_.WXK_MENU
417WXK_PAUSE = _core_.WXK_PAUSE
418WXK_CAPITAL = _core_.WXK_CAPITAL
419WXK_PRIOR = _core_.WXK_PRIOR
420WXK_NEXT = _core_.WXK_NEXT
421WXK_END = _core_.WXK_END
422WXK_HOME = _core_.WXK_HOME
423WXK_LEFT = _core_.WXK_LEFT
424WXK_UP = _core_.WXK_UP
425WXK_RIGHT = _core_.WXK_RIGHT
426WXK_DOWN = _core_.WXK_DOWN
427WXK_SELECT = _core_.WXK_SELECT
428WXK_PRINT = _core_.WXK_PRINT
429WXK_EXECUTE = _core_.WXK_EXECUTE
430WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
431WXK_INSERT = _core_.WXK_INSERT
432WXK_HELP = _core_.WXK_HELP
433WXK_NUMPAD0 = _core_.WXK_NUMPAD0
434WXK_NUMPAD1 = _core_.WXK_NUMPAD1
435WXK_NUMPAD2 = _core_.WXK_NUMPAD2
436WXK_NUMPAD3 = _core_.WXK_NUMPAD3
437WXK_NUMPAD4 = _core_.WXK_NUMPAD4
438WXK_NUMPAD5 = _core_.WXK_NUMPAD5
439WXK_NUMPAD6 = _core_.WXK_NUMPAD6
440WXK_NUMPAD7 = _core_.WXK_NUMPAD7
441WXK_NUMPAD8 = _core_.WXK_NUMPAD8
442WXK_NUMPAD9 = _core_.WXK_NUMPAD9
443WXK_MULTIPLY = _core_.WXK_MULTIPLY
444WXK_ADD = _core_.WXK_ADD
445WXK_SEPARATOR = _core_.WXK_SEPARATOR
446WXK_SUBTRACT = _core_.WXK_SUBTRACT
447WXK_DECIMAL = _core_.WXK_DECIMAL
448WXK_DIVIDE = _core_.WXK_DIVIDE
449WXK_F1 = _core_.WXK_F1
450WXK_F2 = _core_.WXK_F2
451WXK_F3 = _core_.WXK_F3
452WXK_F4 = _core_.WXK_F4
453WXK_F5 = _core_.WXK_F5
454WXK_F6 = _core_.WXK_F6
455WXK_F7 = _core_.WXK_F7
456WXK_F8 = _core_.WXK_F8
457WXK_F9 = _core_.WXK_F9
458WXK_F10 = _core_.WXK_F10
459WXK_F11 = _core_.WXK_F11
460WXK_F12 = _core_.WXK_F12
461WXK_F13 = _core_.WXK_F13
462WXK_F14 = _core_.WXK_F14
463WXK_F15 = _core_.WXK_F15
464WXK_F16 = _core_.WXK_F16
465WXK_F17 = _core_.WXK_F17
466WXK_F18 = _core_.WXK_F18
467WXK_F19 = _core_.WXK_F19
468WXK_F20 = _core_.WXK_F20
469WXK_F21 = _core_.WXK_F21
470WXK_F22 = _core_.WXK_F22
471WXK_F23 = _core_.WXK_F23
472WXK_F24 = _core_.WXK_F24
473WXK_NUMLOCK = _core_.WXK_NUMLOCK
474WXK_SCROLL = _core_.WXK_SCROLL
475WXK_PAGEUP = _core_.WXK_PAGEUP
476WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
477WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
478WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
479WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
480WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
481WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
482WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
483WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
484WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
485WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
486WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
487WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
488WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
489WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
490WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
491WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
492WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
493WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
494WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
495WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
496WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
497WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
498WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
499WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
500WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
501WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
502WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
503WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
504WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
505WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
506WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
88c6b281
RD
507WXK_COMMAND = _core_.WXK_COMMAND
508WXK_SPECIAL1 = _core_.WXK_SPECIAL1
509WXK_SPECIAL2 = _core_.WXK_SPECIAL2
510WXK_SPECIAL3 = _core_.WXK_SPECIAL3
511WXK_SPECIAL4 = _core_.WXK_SPECIAL4
512WXK_SPECIAL5 = _core_.WXK_SPECIAL5
513WXK_SPECIAL6 = _core_.WXK_SPECIAL6
514WXK_SPECIAL7 = _core_.WXK_SPECIAL7
515WXK_SPECIAL8 = _core_.WXK_SPECIAL8
516WXK_SPECIAL9 = _core_.WXK_SPECIAL9
517WXK_SPECIAL10 = _core_.WXK_SPECIAL10
518WXK_SPECIAL11 = _core_.WXK_SPECIAL11
519WXK_SPECIAL12 = _core_.WXK_SPECIAL12
520WXK_SPECIAL13 = _core_.WXK_SPECIAL13
521WXK_SPECIAL14 = _core_.WXK_SPECIAL14
522WXK_SPECIAL15 = _core_.WXK_SPECIAL15
523WXK_SPECIAL16 = _core_.WXK_SPECIAL16
524WXK_SPECIAL17 = _core_.WXK_SPECIAL17
525WXK_SPECIAL18 = _core_.WXK_SPECIAL18
526WXK_SPECIAL19 = _core_.WXK_SPECIAL19
527WXK_SPECIAL20 = _core_.WXK_SPECIAL20
54f9ee45
RD
528PAPER_NONE = _core_.PAPER_NONE
529PAPER_LETTER = _core_.PAPER_LETTER
530PAPER_LEGAL = _core_.PAPER_LEGAL
531PAPER_A4 = _core_.PAPER_A4
532PAPER_CSHEET = _core_.PAPER_CSHEET
533PAPER_DSHEET = _core_.PAPER_DSHEET
534PAPER_ESHEET = _core_.PAPER_ESHEET
535PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
536PAPER_TABLOID = _core_.PAPER_TABLOID
537PAPER_LEDGER = _core_.PAPER_LEDGER
538PAPER_STATEMENT = _core_.PAPER_STATEMENT
539PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
540PAPER_A3 = _core_.PAPER_A3
541PAPER_A4SMALL = _core_.PAPER_A4SMALL
542PAPER_A5 = _core_.PAPER_A5
543PAPER_B4 = _core_.PAPER_B4
544PAPER_B5 = _core_.PAPER_B5
545PAPER_FOLIO = _core_.PAPER_FOLIO
546PAPER_QUARTO = _core_.PAPER_QUARTO
547PAPER_10X14 = _core_.PAPER_10X14
548PAPER_11X17 = _core_.PAPER_11X17
549PAPER_NOTE = _core_.PAPER_NOTE
550PAPER_ENV_9 = _core_.PAPER_ENV_9
551PAPER_ENV_10 = _core_.PAPER_ENV_10
552PAPER_ENV_11 = _core_.PAPER_ENV_11
553PAPER_ENV_12 = _core_.PAPER_ENV_12
554PAPER_ENV_14 = _core_.PAPER_ENV_14
555PAPER_ENV_DL = _core_.PAPER_ENV_DL
556PAPER_ENV_C5 = _core_.PAPER_ENV_C5
557PAPER_ENV_C3 = _core_.PAPER_ENV_C3
558PAPER_ENV_C4 = _core_.PAPER_ENV_C4
559PAPER_ENV_C6 = _core_.PAPER_ENV_C6
560PAPER_ENV_C65 = _core_.PAPER_ENV_C65
561PAPER_ENV_B4 = _core_.PAPER_ENV_B4
562PAPER_ENV_B5 = _core_.PAPER_ENV_B5
563PAPER_ENV_B6 = _core_.PAPER_ENV_B6
564PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
565PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
566PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
567PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
568PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
569PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
570PAPER_ISO_B4 = _core_.PAPER_ISO_B4
571PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
572PAPER_9X11 = _core_.PAPER_9X11
573PAPER_10X11 = _core_.PAPER_10X11
574PAPER_15X11 = _core_.PAPER_15X11
575PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
576PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
577PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
578PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
579PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
580PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
581PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
582PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
583PAPER_A_PLUS = _core_.PAPER_A_PLUS
584PAPER_B_PLUS = _core_.PAPER_B_PLUS
585PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
586PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
587PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
588PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
589PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
590PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
591PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
592PAPER_A2 = _core_.PAPER_A2
593PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
594PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
6c75a4cf
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
54f9ee45
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
54f9ee45 673MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 674MOD_META = _core_.MOD_META
54f9ee45 675MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
676MOD_CMD = _core_.MOD_CMD
677MOD_ALL = _core_.MOD_ALL
54f9ee45
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
d14a1e28
RD
684#---------------------------------------------------------------------------
685
686class Object(object):
0df68c9f
RD
687 """
688 The base class for most wx objects, although in wxPython not
689 much functionality is needed nor exposed.
690 """
0085ce49
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
e811c8ce 694 def GetClassName(*args, **kwargs):
0df68c9f 695 """
a95a7133 696 GetClassName(self) -> String
e811c8ce 697
a95a7133 698 Returns the class name of the C++ class using wxRTTI.
0df68c9f 699 """
54f9ee45 700 return _core_.Object_GetClassName(*args, **kwargs)
e811c8ce
RD
701
702 def Destroy(*args, **kwargs):
0df68c9f 703 """
a95a7133 704 Destroy(self)
e811c8ce 705
0df68c9f
RD
706 Deletes the C++ object this Python object is a proxy for.
707 """
b39fe951
RD
708 args[0].this.own(False)
709 return _core_.Object_Destroy(*args, **kwargs)
e811c8ce 710
33d6fd3b 711 ClassName = property(GetClassName,doc="See `GetClassName`")
2131d850 712_core_.Object_swigregister(Object)
54f9ee45 713_wxPySetDictionary = _core_._wxPySetDictionary
54f9ee45 714cvar = _core_.cvar
196addbf 715EmptyString = cvar.EmptyString
d14a1e28
RD
716
717#---------------------------------------------------------------------------
718
54f9ee45
RD
719BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
720BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
721BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
722BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
723BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
724BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
725BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
726BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
727BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
728BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
729BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
730BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
731BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
732BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
733BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
734BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
735BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
736BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
737BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
738BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
739CURSOR_NONE = _core_.CURSOR_NONE
740CURSOR_ARROW = _core_.CURSOR_ARROW
741CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
742CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
743CURSOR_CHAR = _core_.CURSOR_CHAR
744CURSOR_CROSS = _core_.CURSOR_CROSS
745CURSOR_HAND = _core_.CURSOR_HAND
746CURSOR_IBEAM = _core_.CURSOR_IBEAM
747CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
748CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
749CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
750CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
751CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
752CURSOR_PENCIL = _core_.CURSOR_PENCIL
753CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
754CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
755CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
756CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
757CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
758CURSOR_SIZENS = _core_.CURSOR_SIZENS
759CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
760CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
761CURSOR_SIZING = _core_.CURSOR_SIZING
762CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
763CURSOR_WAIT = _core_.CURSOR_WAIT
764CURSOR_WATCH = _core_.CURSOR_WATCH
765CURSOR_BLANK = _core_.CURSOR_BLANK
766CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
767CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
768CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
769CURSOR_MAX = _core_.CURSOR_MAX
d14a1e28
RD
770#---------------------------------------------------------------------------
771
772class Size(object):
0df68c9f 773 """
41e2b43e 774 wx.Size is a useful data structure used to represent the size of
0085ce49
RD
775 something. It simply contains integer width and height
776 properties. In most places in wxPython where a wx.Size is
093d3ff1 777 expected a (width, height) tuple can be used instead.
0df68c9f 778 """
0085ce49
RD
779 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
780 __repr__ = _swig_repr
54f9ee45
RD
781 width = property(_core_.Size_width_get, _core_.Size_width_set)
782 height = property(_core_.Size_height_get, _core_.Size_height_set)
242b7b46 783 x = width; y = height
0085ce49 784 def __init__(self, *args, **kwargs):
0df68c9f 785 """
a95a7133 786 __init__(self, int w=0, int h=0) -> Size
e811c8ce 787
0df68c9f
RD
788 Creates a size object.
789 """
0085ce49
RD
790 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
791 __swig_destroy__ = _core_.delete_Size
792 __del__ = lambda self : None;
e811c8ce 793 def __eq__(*args, **kwargs):
0df68c9f 794 """
e9d6f3a4 795 __eq__(self, PyObject other) -> bool
e811c8ce 796
0df68c9f
RD
797 Test for equality of wx.Size objects.
798 """
54f9ee45 799 return _core_.Size___eq__(*args, **kwargs)
e811c8ce
RD
800
801 def __ne__(*args, **kwargs):
0df68c9f 802 """
e9d6f3a4 803 __ne__(self, PyObject other) -> bool
e811c8ce 804
e9d6f3a4 805 Test for inequality of wx.Size objects.
0df68c9f 806 """
54f9ee45 807 return _core_.Size___ne__(*args, **kwargs)
e811c8ce
RD
808
809 def __add__(*args, **kwargs):
0df68c9f 810 """
a95a7133 811 __add__(self, Size sz) -> Size
e811c8ce 812
0df68c9f
RD
813 Add sz's proprties to this and return the result.
814 """
54f9ee45 815 return _core_.Size___add__(*args, **kwargs)
e811c8ce
RD
816
817 def __sub__(*args, **kwargs):
0df68c9f 818 """
a95a7133 819 __sub__(self, Size sz) -> Size
e811c8ce 820
0df68c9f
RD
821 Subtract sz's properties from this and return the result.
822 """
54f9ee45 823 return _core_.Size___sub__(*args, **kwargs)
e811c8ce
RD
824
825 def IncTo(*args, **kwargs):
0df68c9f 826 """
a95a7133 827 IncTo(self, Size sz)
e811c8ce 828
0df68c9f
RD
829 Increments this object so that both of its dimensions are not less
830 than the corresponding dimensions of the size.
831 """
54f9ee45 832 return _core_.Size_IncTo(*args, **kwargs)
e811c8ce
RD
833
834 def DecTo(*args, **kwargs):
0df68c9f 835 """
a95a7133 836 DecTo(self, Size sz)
e811c8ce 837
0df68c9f
RD
838 Decrements this object so that both of its dimensions are not greater
839 than the corresponding dimensions of the size.
840 """
54f9ee45 841 return _core_.Size_DecTo(*args, **kwargs)
e811c8ce 842
f5263701
RD
843 def IncBy(*args, **kwargs):
844 """IncBy(self, int dx, int dy)"""
845 return _core_.Size_IncBy(*args, **kwargs)
846
847 def DecBy(*args, **kwargs):
848 """DecBy(self, int dx, int dy)"""
849 return _core_.Size_DecBy(*args, **kwargs)
850
10044bf1
RD
851 def Scale(*args, **kwargs):
852 """
853 Scale(self, float xscale, float yscale)
854
855 Scales the dimensions of this object by the given factors.
856 """
857 return _core_.Size_Scale(*args, **kwargs)
858
e811c8ce 859 def Set(*args, **kwargs):
0df68c9f 860 """
a95a7133 861 Set(self, int w, int h)
e811c8ce 862
0df68c9f
RD
863 Set both width and height.
864 """
54f9ee45 865 return _core_.Size_Set(*args, **kwargs)
e811c8ce
RD
866
867 def SetWidth(*args, **kwargs):
a95a7133 868 """SetWidth(self, int w)"""
54f9ee45 869 return _core_.Size_SetWidth(*args, **kwargs)
e811c8ce
RD
870
871 def SetHeight(*args, **kwargs):
a95a7133 872 """SetHeight(self, int h)"""
54f9ee45 873 return _core_.Size_SetHeight(*args, **kwargs)
e811c8ce
RD
874
875 def GetWidth(*args, **kwargs):
a95a7133 876 """GetWidth(self) -> int"""
54f9ee45 877 return _core_.Size_GetWidth(*args, **kwargs)
e811c8ce
RD
878
879 def GetHeight(*args, **kwargs):
a95a7133 880 """GetHeight(self) -> int"""
54f9ee45 881 return _core_.Size_GetHeight(*args, **kwargs)
e811c8ce 882
74a57fcd
RD
883 def IsFullySpecified(*args, **kwargs):
884 """
a95a7133 885 IsFullySpecified(self) -> bool
74a57fcd
RD
886
887 Returns True if both components of the size are non-default values.
888 """
54f9ee45 889 return _core_.Size_IsFullySpecified(*args, **kwargs)
74a57fcd
RD
890
891 def SetDefaults(*args, **kwargs):
892 """
a95a7133 893 SetDefaults(self, Size size)
74a57fcd 894
41e2b43e
RD
895 Combine this size with the other one replacing the default components
896 of this object (i.e. equal to -1) with those of the other.
74a57fcd 897 """
54f9ee45 898 return _core_.Size_SetDefaults(*args, **kwargs)
74a57fcd 899
e811c8ce 900 def Get(*args, **kwargs):
0df68c9f
RD
901 """
902 Get() -> (width,height)
e811c8ce 903
0df68c9f
RD
904 Returns the width and height properties as a tuple.
905 """
54f9ee45 906 return _core_.Size_Get(*args, **kwargs)
e811c8ce 907
41e2b43e 908 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
909 def __str__(self): return str(self.Get())
910 def __repr__(self): return 'wx.Size'+str(self.Get())
911 def __len__(self): return len(self.Get())
912 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
913 def __setitem__(self, index, val):
914 if index == 0: self.width = val
915 elif index == 1: self.height = val
916 else: raise IndexError
e811c8ce 917 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
918 __safe_for_unpickling__ = True
919 def __reduce__(self): return (wx.Size, self.Get())
d14a1e28 920
2131d850 921_core_.Size_swigregister(Size)
d14a1e28
RD
922
923#---------------------------------------------------------------------------
924
925class RealPoint(object):
0df68c9f 926 """
41e2b43e
RD
927 A data structure for representing a point or position with floating
928 point x and y properties. In wxPython most places that expect a
929 wx.RealPoint can also accept a (x,y) tuple.
0df68c9f 930 """
0085ce49
RD
931 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
932 __repr__ = _swig_repr
54f9ee45
RD
933 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
934 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
0085ce49 935 def __init__(self, *args, **kwargs):
0df68c9f 936 """
a95a7133 937 __init__(self, double x=0.0, double y=0.0) -> RealPoint
e811c8ce 938
0df68c9f
RD
939 Create a wx.RealPoint object
940 """
0085ce49
RD
941 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
942 __swig_destroy__ = _core_.delete_RealPoint
943 __del__ = lambda self : None;
e811c8ce 944 def __eq__(*args, **kwargs):
0df68c9f 945 """
e9d6f3a4 946 __eq__(self, PyObject other) -> bool
e811c8ce 947
0df68c9f
RD
948 Test for equality of wx.RealPoint objects.
949 """
54f9ee45 950 return _core_.RealPoint___eq__(*args, **kwargs)
e811c8ce
RD
951
952 def __ne__(*args, **kwargs):
0df68c9f 953 """
e9d6f3a4 954 __ne__(self, PyObject other) -> bool
e811c8ce 955
0df68c9f
RD
956 Test for inequality of wx.RealPoint objects.
957 """
54f9ee45 958 return _core_.RealPoint___ne__(*args, **kwargs)
e811c8ce
RD
959
960 def __add__(*args, **kwargs):
0df68c9f 961 """
a95a7133 962 __add__(self, RealPoint pt) -> RealPoint
e811c8ce 963
0df68c9f
RD
964 Add pt's proprties to this and return the result.
965 """
54f9ee45 966 return _core_.RealPoint___add__(*args, **kwargs)
e811c8ce
RD
967
968 def __sub__(*args, **kwargs):
0df68c9f 969 """
a95a7133 970 __sub__(self, RealPoint pt) -> RealPoint
e811c8ce 971
0df68c9f
RD
972 Subtract pt's proprties from this and return the result
973 """
54f9ee45 974 return _core_.RealPoint___sub__(*args, **kwargs)
e811c8ce
RD
975
976 def Set(*args, **kwargs):
0df68c9f 977 """
a95a7133 978 Set(self, double x, double y)
e811c8ce 979
0df68c9f
RD
980 Set both the x and y properties
981 """
54f9ee45 982 return _core_.RealPoint_Set(*args, **kwargs)
e811c8ce
RD
983
984 def Get(*args, **kwargs):
0df68c9f
RD
985 """
986 Get() -> (x,y)
e811c8ce 987
0df68c9f
RD
988 Return the x and y properties as a tuple.
989 """
54f9ee45 990 return _core_.RealPoint_Get(*args, **kwargs)
e811c8ce 991
41e2b43e 992 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
993 def __str__(self): return str(self.Get())
994 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
995 def __len__(self): return len(self.Get())
996 def __getitem__(self, index): return self.Get()[index]
d14a1e28 997 def __setitem__(self, index, val):
e811c8ce
RD
998 if index == 0: self.x = val
999 elif index == 1: self.y = val
d14a1e28 1000 else: raise IndexError
e811c8ce 1001 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1002 __safe_for_unpickling__ = True
1003 def __reduce__(self): return (wx.RealPoint, self.Get())
d14a1e28 1004
2131d850 1005_core_.RealPoint_swigregister(RealPoint)
d14a1e28
RD
1006
1007#---------------------------------------------------------------------------
1008
1009class Point(object):
0df68c9f 1010 """
41e2b43e
RD
1011 A data structure for representing a point or position with integer x
1012 and y properties. Most places in wxPython that expect a wx.Point can
1013 also accept a (x,y) tuple.
0df68c9f 1014 """
0085ce49
RD
1015 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1016 __repr__ = _swig_repr
54f9ee45
RD
1017 x = property(_core_.Point_x_get, _core_.Point_x_set)
1018 y = property(_core_.Point_y_get, _core_.Point_y_set)
0085ce49 1019 def __init__(self, *args, **kwargs):
0df68c9f 1020 """
a95a7133 1021 __init__(self, int x=0, int y=0) -> Point
e811c8ce 1022
0df68c9f
RD
1023 Create a wx.Point object
1024 """
0085ce49
RD
1025 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1026 __swig_destroy__ = _core_.delete_Point
1027 __del__ = lambda self : None;
e811c8ce 1028 def __eq__(*args, **kwargs):
0df68c9f 1029 """
e9d6f3a4 1030 __eq__(self, PyObject other) -> bool
e811c8ce 1031
0df68c9f
RD
1032 Test for equality of wx.Point objects.
1033 """
54f9ee45 1034 return _core_.Point___eq__(*args, **kwargs)
e811c8ce
RD
1035
1036 def __ne__(*args, **kwargs):
0df68c9f 1037 """
e9d6f3a4 1038 __ne__(self, PyObject other) -> bool
e811c8ce 1039
0df68c9f
RD
1040 Test for inequality of wx.Point objects.
1041 """
54f9ee45 1042 return _core_.Point___ne__(*args, **kwargs)
e811c8ce
RD
1043
1044 def __add__(*args, **kwargs):
0df68c9f 1045 """
a95a7133 1046 __add__(self, Point pt) -> Point
e811c8ce 1047
0df68c9f
RD
1048 Add pt's proprties to this and return the result.
1049 """
54f9ee45 1050 return _core_.Point___add__(*args, **kwargs)
e811c8ce
RD
1051
1052 def __sub__(*args, **kwargs):
0df68c9f 1053 """
a95a7133 1054 __sub__(self, Point pt) -> Point
e811c8ce 1055
0df68c9f
RD
1056 Subtract pt's proprties from this and return the result
1057 """
54f9ee45 1058 return _core_.Point___sub__(*args, **kwargs)
e811c8ce
RD
1059
1060 def __iadd__(*args, **kwargs):
0df68c9f 1061 """
a95a7133 1062 __iadd__(self, Point pt) -> Point
e811c8ce 1063
0df68c9f
RD
1064 Add pt to this object.
1065 """
54f9ee45 1066 return _core_.Point___iadd__(*args, **kwargs)
e811c8ce
RD
1067
1068 def __isub__(*args, **kwargs):
0df68c9f 1069 """
a95a7133 1070 __isub__(self, Point pt) -> Point
e811c8ce 1071
0df68c9f
RD
1072 Subtract pt from this object.
1073 """
54f9ee45 1074 return _core_.Point___isub__(*args, **kwargs)
e811c8ce
RD
1075
1076 def Set(*args, **kwargs):
0df68c9f 1077 """
a95a7133 1078 Set(self, long x, long y)
e811c8ce 1079
0df68c9f
RD
1080 Set both the x and y properties
1081 """
54f9ee45 1082 return _core_.Point_Set(*args, **kwargs)
e811c8ce
RD
1083
1084 def Get(*args, **kwargs):
0df68c9f
RD
1085 """
1086 Get() -> (x,y)
e811c8ce 1087
0df68c9f
RD
1088 Return the x and y properties as a tuple.
1089 """
54f9ee45 1090 return _core_.Point_Get(*args, **kwargs)
e811c8ce 1091
41e2b43e 1092 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1093 def __str__(self): return str(self.Get())
1094 def __repr__(self): return 'wx.Point'+str(self.Get())
1095 def __len__(self): return len(self.Get())
1096 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1097 def __setitem__(self, index, val):
1098 if index == 0: self.x = val
1099 elif index == 1: self.y = val
1100 else: raise IndexError
e811c8ce 1101 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
1102 __safe_for_unpickling__ = True
1103 def __reduce__(self): return (wx.Point, self.Get())
d14a1e28 1104
2131d850 1105_core_.Point_swigregister(Point)
d14a1e28
RD
1106
1107#---------------------------------------------------------------------------
1108
1109class Rect(object):
0df68c9f 1110 """
41e2b43e
RD
1111 A class for representing and manipulating rectangles. It has x, y,
1112 width and height properties. In wxPython most palces that expect a
1113 wx.Rect can also accept a (x,y,width,height) tuple.
0df68c9f 1114 """
0085ce49
RD
1115 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1116 __repr__ = _swig_repr
1117 def __init__(self, *args, **kwargs):
0df68c9f 1118 """
a95a7133 1119 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
e811c8ce 1120
0df68c9f
RD
1121 Create a new Rect object.
1122 """
0085ce49
RD
1123 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1124 __swig_destroy__ = _core_.delete_Rect
1125 __del__ = lambda self : None;
e811c8ce 1126 def GetX(*args, **kwargs):
a95a7133 1127 """GetX(self) -> int"""
54f9ee45 1128 return _core_.Rect_GetX(*args, **kwargs)
e811c8ce
RD
1129
1130 def SetX(*args, **kwargs):
a95a7133 1131 """SetX(self, int x)"""
54f9ee45 1132 return _core_.Rect_SetX(*args, **kwargs)
e811c8ce
RD
1133
1134 def GetY(*args, **kwargs):
a95a7133 1135 """GetY(self) -> int"""
54f9ee45 1136 return _core_.Rect_GetY(*args, **kwargs)
e811c8ce
RD
1137
1138 def SetY(*args, **kwargs):
a95a7133 1139 """SetY(self, int y)"""
54f9ee45 1140 return _core_.Rect_SetY(*args, **kwargs)
e811c8ce
RD
1141
1142 def GetWidth(*args, **kwargs):
a95a7133 1143 """GetWidth(self) -> int"""
54f9ee45 1144 return _core_.Rect_GetWidth(*args, **kwargs)
e811c8ce
RD
1145
1146 def SetWidth(*args, **kwargs):
a95a7133 1147 """SetWidth(self, int w)"""
54f9ee45 1148 return _core_.Rect_SetWidth(*args, **kwargs)
e811c8ce
RD
1149
1150 def GetHeight(*args, **kwargs):
a95a7133 1151 """GetHeight(self) -> int"""
54f9ee45 1152 return _core_.Rect_GetHeight(*args, **kwargs)
e811c8ce
RD
1153
1154 def SetHeight(*args, **kwargs):
a95a7133 1155 """SetHeight(self, int h)"""
54f9ee45 1156 return _core_.Rect_SetHeight(*args, **kwargs)
e811c8ce
RD
1157
1158 def GetPosition(*args, **kwargs):
a95a7133 1159 """GetPosition(self) -> Point"""
54f9ee45 1160 return _core_.Rect_GetPosition(*args, **kwargs)
e811c8ce
RD
1161
1162 def SetPosition(*args, **kwargs):
a95a7133 1163 """SetPosition(self, Point p)"""
54f9ee45 1164 return _core_.Rect_SetPosition(*args, **kwargs)
e811c8ce
RD
1165
1166 def GetSize(*args, **kwargs):
a95a7133 1167 """GetSize(self) -> Size"""
54f9ee45 1168 return _core_.Rect_GetSize(*args, **kwargs)
e811c8ce
RD
1169
1170 def SetSize(*args, **kwargs):
a95a7133 1171 """SetSize(self, Size s)"""
54f9ee45 1172 return _core_.Rect_SetSize(*args, **kwargs)
e811c8ce 1173
aff4cc5c
RD
1174 def IsEmpty(*args, **kwargs):
1175 """IsEmpty(self) -> bool"""
1176 return _core_.Rect_IsEmpty(*args, **kwargs)
1177
c9c7117a 1178 def GetTopLeft(*args, **kwargs):
a95a7133 1179 """GetTopLeft(self) -> Point"""
54f9ee45 1180 return _core_.Rect_GetTopLeft(*args, **kwargs)
c9c7117a
RD
1181
1182 def SetTopLeft(*args, **kwargs):
a95a7133 1183 """SetTopLeft(self, Point p)"""
54f9ee45 1184 return _core_.Rect_SetTopLeft(*args, **kwargs)
c9c7117a
RD
1185
1186 def GetBottomRight(*args, **kwargs):
a95a7133 1187 """GetBottomRight(self) -> Point"""
54f9ee45 1188 return _core_.Rect_GetBottomRight(*args, **kwargs)
c9c7117a
RD
1189
1190 def SetBottomRight(*args, **kwargs):
a95a7133 1191 """SetBottomRight(self, Point p)"""
54f9ee45 1192 return _core_.Rect_SetBottomRight(*args, **kwargs)
c9c7117a 1193
5acb46e0
RD
1194 def GetTopRight(*args, **kwargs):
1195 """GetTopRight(self) -> Point"""
1196 return _core_.Rect_GetTopRight(*args, **kwargs)
1197
1198 def SetTopRight(*args, **kwargs):
1199 """SetTopRight(self, Point p)"""
1200 return _core_.Rect_SetTopRight(*args, **kwargs)
1201
1202 def GetBottomLeft(*args, **kwargs):
1203 """GetBottomLeft(self) -> Point"""
1204 return _core_.Rect_GetBottomLeft(*args, **kwargs)
1205
1206 def SetBottomLeft(*args, **kwargs):
1207 """SetBottomLeft(self, Point p)"""
1208 return _core_.Rect_SetBottomLeft(*args, **kwargs)
1209
e811c8ce 1210 def GetLeft(*args, **kwargs):
a95a7133 1211 """GetLeft(self) -> int"""
54f9ee45 1212 return _core_.Rect_GetLeft(*args, **kwargs)
e811c8ce
RD
1213
1214 def GetTop(*args, **kwargs):
a95a7133 1215 """GetTop(self) -> int"""
54f9ee45 1216 return _core_.Rect_GetTop(*args, **kwargs)
e811c8ce
RD
1217
1218 def GetBottom(*args, **kwargs):
a95a7133 1219 """GetBottom(self) -> int"""
54f9ee45 1220 return _core_.Rect_GetBottom(*args, **kwargs)
e811c8ce
RD
1221
1222 def GetRight(*args, **kwargs):
a95a7133 1223 """GetRight(self) -> int"""
54f9ee45 1224 return _core_.Rect_GetRight(*args, **kwargs)
e811c8ce
RD
1225
1226 def SetLeft(*args, **kwargs):
a95a7133 1227 """SetLeft(self, int left)"""
54f9ee45 1228 return _core_.Rect_SetLeft(*args, **kwargs)
e811c8ce
RD
1229
1230 def SetRight(*args, **kwargs):
a95a7133 1231 """SetRight(self, int right)"""
54f9ee45 1232 return _core_.Rect_SetRight(*args, **kwargs)
e811c8ce
RD
1233
1234 def SetTop(*args, **kwargs):
a95a7133 1235 """SetTop(self, int top)"""
54f9ee45 1236 return _core_.Rect_SetTop(*args, **kwargs)
e811c8ce
RD
1237
1238 def SetBottom(*args, **kwargs):
a95a7133 1239 """SetBottom(self, int bottom)"""
54f9ee45 1240 return _core_.Rect_SetBottom(*args, **kwargs)
e811c8ce
RD
1241
1242 position = property(GetPosition, SetPosition)
1243 size = property(GetSize, SetSize)
1244 left = property(GetLeft, SetLeft)
1245 right = property(GetRight, SetRight)
1246 top = property(GetTop, SetTop)
1247 bottom = property(GetBottom, SetBottom)
1248
1249 def Inflate(*args, **kwargs):
0df68c9f 1250 """
a95a7133 1251 Inflate(self, int dx, int dy) -> Rect
e811c8ce 1252
8e738329
RD
1253 Increases the size of the rectangle.
1254
1255 The left border is moved farther left and the right border is moved
1256 farther right by ``dx``. The upper border is moved farther up and the
1257 bottom border is moved farther down by ``dy``. (Note the the width and
1258 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1259 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1260 opposite happens: the rectangle size decreases in the respective
1261 direction.
1262
1263 The change is made to the rectangle inplace, if instead you need a
1264 copy that is inflated, preserving the original then make the copy
1265 first::
1266
1267 copy = wx.Rect(*original)
1268 copy.Inflate(10,15)
1269
1270
0df68c9f 1271 """
54f9ee45 1272 return _core_.Rect_Inflate(*args, **kwargs)
e811c8ce
RD
1273
1274 def Deflate(*args, **kwargs):
0df68c9f 1275 """
a95a7133 1276 Deflate(self, int dx, int dy) -> Rect
e811c8ce 1277
8e738329
RD
1278 Decrease the rectangle size. This method is the opposite of `Inflate`
1279 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1280 `Inflate` for a full description.
0df68c9f 1281 """
54f9ee45 1282 return _core_.Rect_Deflate(*args, **kwargs)
e811c8ce
RD
1283
1284 def OffsetXY(*args, **kwargs):
0df68c9f 1285 """
a95a7133 1286 OffsetXY(self, int dx, int dy)
e811c8ce 1287
41e2b43e
RD
1288 Moves the rectangle by the specified offset. If dx is positive, the
1289 rectangle is moved to the right, if dy is positive, it is moved to the
1290 bottom, otherwise it is moved to the left or top respectively.
0df68c9f 1291 """
54f9ee45 1292 return _core_.Rect_OffsetXY(*args, **kwargs)
e811c8ce
RD
1293
1294 def Offset(*args, **kwargs):
0df68c9f 1295 """
a95a7133 1296 Offset(self, Point pt)
e811c8ce 1297
b1fcee84 1298 Same as `OffsetXY` but uses dx,dy from Point
0df68c9f 1299 """
54f9ee45 1300 return _core_.Rect_Offset(*args, **kwargs)
e811c8ce
RD
1301
1302 def Intersect(*args, **kwargs):
0df68c9f 1303 """
a95a7133 1304 Intersect(self, Rect rect) -> Rect
e811c8ce 1305
5cbf236d 1306 Returns the intersectsion of this rectangle and rect.
0df68c9f 1307 """
54f9ee45 1308 return _core_.Rect_Intersect(*args, **kwargs)
e811c8ce 1309
5cbf236d
RD
1310 def Union(*args, **kwargs):
1311 """
1312 Union(self, Rect rect) -> Rect
1313
1314 Returns the union of this rectangle and rect.
1315 """
1316 return _core_.Rect_Union(*args, **kwargs)
1317
e811c8ce 1318 def __add__(*args, **kwargs):
0df68c9f 1319 """
a95a7133 1320 __add__(self, Rect rect) -> Rect
e811c8ce 1321
0df68c9f
RD
1322 Add the properties of rect to this rectangle and return the result.
1323 """
54f9ee45 1324 return _core_.Rect___add__(*args, **kwargs)
e811c8ce
RD
1325
1326 def __iadd__(*args, **kwargs):
0df68c9f 1327 """
a95a7133 1328 __iadd__(self, Rect rect) -> Rect
e811c8ce 1329
0df68c9f
RD
1330 Add the properties of rect to this rectangle, updating this rectangle.
1331 """
54f9ee45 1332 return _core_.Rect___iadd__(*args, **kwargs)
e811c8ce
RD
1333
1334 def __eq__(*args, **kwargs):
0df68c9f 1335 """
e9d6f3a4 1336 __eq__(self, PyObject other) -> bool
e811c8ce 1337
e9d6f3a4 1338 Test for equality of wx.Rect objects.
0df68c9f 1339 """
54f9ee45 1340 return _core_.Rect___eq__(*args, **kwargs)
e811c8ce
RD
1341
1342 def __ne__(*args, **kwargs):
0df68c9f 1343 """
e9d6f3a4 1344 __ne__(self, PyObject other) -> bool
e811c8ce 1345
e9d6f3a4 1346 Test for inequality of wx.Rect objects.
0df68c9f 1347 """
54f9ee45 1348 return _core_.Rect___ne__(*args, **kwargs)
e811c8ce 1349
33d6fd3b 1350 def ContainsXY(*args, **kwargs):
0df68c9f 1351 """
33d6fd3b 1352 ContainsXY(self, int x, int y) -> bool
e811c8ce 1353
33d6fd3b 1354 Return True if the point is inside the rect.
0df68c9f 1355 """
33d6fd3b 1356 return _core_.Rect_ContainsXY(*args, **kwargs)
e811c8ce 1357
33d6fd3b 1358 def Contains(*args, **kwargs):
0df68c9f 1359 """
33d6fd3b 1360 Contains(self, Point pt) -> bool
e811c8ce 1361
33d6fd3b 1362 Return True if the point is inside the rect.
0df68c9f 1363 """
33d6fd3b 1364 return _core_.Rect_Contains(*args, **kwargs)
e811c8ce 1365
33d6fd3b 1366 def ContainsRect(*args, **kwargs):
fc46b7f3 1367 """
33d6fd3b 1368 ContainsRect(self, Rect rect) -> bool
fc46b7f3
RD
1369
1370 Returns ``True`` if the given rectangle is completely inside this
1371 rectangle or touches its boundary.
1372 """
33d6fd3b
RD
1373 return _core_.Rect_ContainsRect(*args, **kwargs)
1374
72ef6efb
RD
1375 #Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1376 #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1377 #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1378 Inside = Contains
1379 InsideXY = ContainsXY
1380 InsideRect = ContainsRect
fc46b7f3 1381
e811c8ce 1382 def Intersects(*args, **kwargs):
0df68c9f 1383 """
a95a7133 1384 Intersects(self, Rect rect) -> bool
e811c8ce 1385
0df68c9f
RD
1386 Returns True if the rectangles have a non empty intersection.
1387 """
54f9ee45 1388 return _core_.Rect_Intersects(*args, **kwargs)
e811c8ce 1389
b1fcee84
RD
1390 def CenterIn(*args, **kwargs):
1391 """
1392 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1393
1394 Center this rectangle within the one passed to the method, which is
1395 usually, but not necessarily, the larger one.
1396 """
1397 return _core_.Rect_CenterIn(*args, **kwargs)
1398
1399 CentreIn = CenterIn
54f9ee45
RD
1400 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1401 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1402 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1403 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
e811c8ce 1404 def Set(*args, **kwargs):
0df68c9f 1405 """
a95a7133 1406 Set(self, int x=0, int y=0, int width=0, int height=0)
e811c8ce 1407
0df68c9f
RD
1408 Set all rectangle properties.
1409 """
54f9ee45 1410 return _core_.Rect_Set(*args, **kwargs)
e811c8ce
RD
1411
1412 def Get(*args, **kwargs):
0df68c9f
RD
1413 """
1414 Get() -> (x,y,width,height)
e811c8ce 1415
0df68c9f
RD
1416 Return the rectangle properties as a tuple.
1417 """
54f9ee45 1418 return _core_.Rect_Get(*args, **kwargs)
e811c8ce 1419
41e2b43e 1420 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1421 def __str__(self): return str(self.Get())
1422 def __repr__(self): return 'wx.Rect'+str(self.Get())
1423 def __len__(self): return len(self.Get())
1424 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1425 def __setitem__(self, index, val):
1426 if index == 0: self.x = val
1427 elif index == 1: self.y = val
1428 elif index == 2: self.width = val
1429 elif index == 3: self.height = val
1430 else: raise IndexError
e811c8ce 1431 def __nonzero__(self): return self.Get() != (0,0,0,0)
74e96f3d
RD
1432 __safe_for_unpickling__ = True
1433 def __reduce__(self): return (wx.Rect, self.Get())
d14a1e28 1434
33d6fd3b
RD
1435 Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`")
1436 BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`")
5acb46e0 1437 BottomLeft = property(GetBottomLeft,SetBottomLeft,doc="See `GetBottomLeft` and `SetBottomLeft`")
33d6fd3b
RD
1438 Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
1439 Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`")
1440 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
1441 Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`")
1442 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
1443 Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`")
1444 TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`")
5acb46e0 1445 TopRight = property(GetTopRight,SetTopRight,doc="See `GetTopRight` and `SetTopRight`")
33d6fd3b
RD
1446 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
1447 X = property(GetX,SetX,doc="See `GetX` and `SetX`")
1448 Y = property(GetY,SetY,doc="See `GetY` and `SetY`")
1449 Empty = property(IsEmpty,doc="See `IsEmpty`")
2131d850 1450_core_.Rect_swigregister(Rect)
d14a1e28
RD
1451
1452def RectPP(*args, **kwargs):
0df68c9f
RD
1453 """
1454 RectPP(Point topLeft, Point bottomRight) -> Rect
e811c8ce 1455
0df68c9f
RD
1456 Create a new Rect object from Points representing two corners.
1457 """
54f9ee45 1458 val = _core_.new_RectPP(*args, **kwargs)
d14a1e28
RD
1459 return val
1460
1461def RectPS(*args, **kwargs):
0df68c9f
RD
1462 """
1463 RectPS(Point pos, Size size) -> Rect
e811c8ce 1464
0df68c9f
RD
1465 Create a new Rect from a position and size.
1466 """
54f9ee45 1467 val = _core_.new_RectPS(*args, **kwargs)
d14a1e28
RD
1468 return val
1469
d3b6e4ff
RD
1470def RectS(*args, **kwargs):
1471 """
1472 RectS(Size size) -> Rect
1473
1474 Create a new Rect from a size only.
1475 """
1476 val = _core_.new_RectS(*args, **kwargs)
d3b6e4ff
RD
1477 return val
1478
d14a1e28 1479
e811c8ce 1480def IntersectRect(*args, **kwargs):
0085ce49 1481 """
0df68c9f 1482 IntersectRect(Rect r1, Rect r2) -> Rect
e811c8ce 1483
0df68c9f
RD
1484 Calculate and return the intersection of r1 and r2.
1485 """
0085ce49 1486 return _core_.IntersectRect(*args, **kwargs)
d14a1e28
RD
1487#---------------------------------------------------------------------------
1488
1489class Point2D(object):
41e2b43e
RD
1490 """
1491 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1492 with floating point values.
1493 """
0085ce49
RD
1494 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1495 __repr__ = _swig_repr
1496 def __init__(self, *args, **kwargs):
0df68c9f 1497 """
a95a7133 1498 __init__(self, double x=0.0, double y=0.0) -> Point2D
e811c8ce 1499
0df68c9f
RD
1500 Create a w.Point2D object.
1501 """
0085ce49 1502 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
b39fe951
RD
1503 __swig_destroy__ = _core_.delete_Point2D
1504 __del__ = lambda self : None;
e811c8ce 1505 def GetFloor(*args, **kwargs):
fd2dc343
RD
1506 """
1507 GetFloor() -> (x,y)
1508
1509 Convert to integer
1510 """
54f9ee45 1511 return _core_.Point2D_GetFloor(*args, **kwargs)
e811c8ce
RD
1512
1513 def GetRounded(*args, **kwargs):
fd2dc343
RD
1514 """
1515 GetRounded() -> (x,y)
1516
1517 Convert to integer
1518 """
54f9ee45 1519 return _core_.Point2D_GetRounded(*args, **kwargs)
e811c8ce
RD
1520
1521 def GetVectorLength(*args, **kwargs):
a95a7133 1522 """GetVectorLength(self) -> double"""
54f9ee45 1523 return _core_.Point2D_GetVectorLength(*args, **kwargs)
e811c8ce
RD
1524
1525 def GetVectorAngle(*args, **kwargs):
a95a7133 1526 """GetVectorAngle(self) -> double"""
54f9ee45 1527 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
e811c8ce
RD
1528
1529 def SetVectorLength(*args, **kwargs):
a95a7133 1530 """SetVectorLength(self, double length)"""
54f9ee45 1531 return _core_.Point2D_SetVectorLength(*args, **kwargs)
e811c8ce
RD
1532
1533 def SetVectorAngle(*args, **kwargs):
a95a7133 1534 """SetVectorAngle(self, double degrees)"""
54f9ee45 1535 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
e811c8ce 1536
d14a1e28
RD
1537 def SetPolarCoordinates(self, angle, length):
1538 self.SetVectorLength(length)
1539 self.SetVectorAngle(angle)
1540 def Normalize(self):
1541 self.SetVectorLength(1.0)
1542
e811c8ce 1543 def GetDistance(*args, **kwargs):
a95a7133 1544 """GetDistance(self, Point2D pt) -> double"""
54f9ee45 1545 return _core_.Point2D_GetDistance(*args, **kwargs)
e811c8ce
RD
1546
1547 def GetDistanceSquare(*args, **kwargs):
a95a7133 1548 """GetDistanceSquare(self, Point2D pt) -> double"""
54f9ee45 1549 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
e811c8ce
RD
1550
1551 def GetDotProduct(*args, **kwargs):
a95a7133 1552 """GetDotProduct(self, Point2D vec) -> double"""
54f9ee45 1553 return _core_.Point2D_GetDotProduct(*args, **kwargs)
e811c8ce
RD
1554
1555 def GetCrossProduct(*args, **kwargs):
a95a7133 1556 """GetCrossProduct(self, Point2D vec) -> double"""
54f9ee45 1557 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
e811c8ce
RD
1558
1559 def __neg__(*args, **kwargs):
0df68c9f 1560 """
a95a7133 1561 __neg__(self) -> Point2D
e811c8ce 1562
0df68c9f
RD
1563 the reflection of this point
1564 """
54f9ee45 1565 return _core_.Point2D___neg__(*args, **kwargs)
e811c8ce
RD
1566
1567 def __iadd__(*args, **kwargs):
a95a7133 1568 """__iadd__(self, Point2D pt) -> Point2D"""
54f9ee45 1569 return _core_.Point2D___iadd__(*args, **kwargs)
e811c8ce
RD
1570
1571 def __isub__(*args, **kwargs):
a95a7133 1572 """__isub__(self, Point2D pt) -> Point2D"""
54f9ee45 1573 return _core_.Point2D___isub__(*args, **kwargs)
e811c8ce
RD
1574
1575 def __imul__(*args, **kwargs):
a95a7133 1576 """__imul__(self, Point2D pt) -> Point2D"""
54f9ee45 1577 return _core_.Point2D___imul__(*args, **kwargs)
e811c8ce
RD
1578
1579 def __idiv__(*args, **kwargs):
a95a7133 1580 """__idiv__(self, Point2D pt) -> Point2D"""
54f9ee45 1581 return _core_.Point2D___idiv__(*args, **kwargs)
e811c8ce
RD
1582
1583 def __eq__(*args, **kwargs):
0df68c9f 1584 """
e9d6f3a4 1585 __eq__(self, PyObject other) -> bool
e811c8ce 1586
e9d6f3a4 1587 Test for equality of wx.Point2D objects.
0df68c9f 1588 """
54f9ee45 1589 return _core_.Point2D___eq__(*args, **kwargs)
e811c8ce
RD
1590
1591 def __ne__(*args, **kwargs):
0df68c9f 1592 """
e9d6f3a4 1593 __ne__(self, PyObject other) -> bool
e811c8ce 1594
e9d6f3a4 1595 Test for inequality of wx.Point2D objects.
0df68c9f 1596 """
54f9ee45 1597 return _core_.Point2D___ne__(*args, **kwargs)
e811c8ce 1598
54f9ee45
RD
1599 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1600 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
e811c8ce 1601 def Set(*args, **kwargs):
a95a7133 1602 """Set(self, double x=0, double y=0)"""
54f9ee45 1603 return _core_.Point2D_Set(*args, **kwargs)
e811c8ce
RD
1604
1605 def Get(*args, **kwargs):
0df68c9f
RD
1606 """
1607 Get() -> (x,y)
e811c8ce 1608
0df68c9f
RD
1609 Return x and y properties as a tuple.
1610 """
54f9ee45 1611 return _core_.Point2D_Get(*args, **kwargs)
e811c8ce 1612
41e2b43e 1613 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1614 def __str__(self): return str(self.Get())
1615 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1616 def __len__(self): return len(self.Get())
1617 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1618 def __setitem__(self, index, val):
e811c8ce
RD
1619 if index == 0: self.x = val
1620 elif index == 1: self.y = val
d14a1e28 1621 else: raise IndexError
e811c8ce 1622 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1623 __safe_for_unpickling__ = True
1624 def __reduce__(self): return (wx.Point2D, self.Get())
d14a1e28 1625
33d6fd3b
RD
1626 Floor = property(GetFloor,doc="See `GetFloor`")
1627 Rounded = property(GetRounded,doc="See `GetRounded`")
1628 VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`")
1629 VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`")
2131d850 1630_core_.Point2D_swigregister(Point2D)
d14a1e28
RD
1631
1632def Point2DCopy(*args, **kwargs):
0df68c9f
RD
1633 """
1634 Point2DCopy(Point2D pt) -> Point2D
e811c8ce 1635
0df68c9f
RD
1636 Create a w.Point2D object.
1637 """
54f9ee45 1638 val = _core_.new_Point2DCopy(*args, **kwargs)
d14a1e28
RD
1639 return val
1640
1641def Point2DFromPoint(*args, **kwargs):
0df68c9f
RD
1642 """
1643 Point2DFromPoint(Point pt) -> Point2D
e811c8ce 1644
0df68c9f
RD
1645 Create a w.Point2D object.
1646 """
54f9ee45 1647 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d14a1e28
RD
1648 return val
1649
1650#---------------------------------------------------------------------------
1651
54f9ee45
RD
1652FromStart = _core_.FromStart
1653FromCurrent = _core_.FromCurrent
1654FromEnd = _core_.FromEnd
d14a1e28 1655class InputStream(object):
093d3ff1 1656 """Proxy of C++ InputStream class"""
0085ce49
RD
1657 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1658 __repr__ = _swig_repr
1659 def __init__(self, *args, **kwargs):
a95a7133 1660 """__init__(self, PyObject p) -> InputStream"""
0085ce49
RD
1661 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1662 __swig_destroy__ = _core_.delete_InputStream
1663 __del__ = lambda self : None;
e811c8ce 1664 def close(*args, **kwargs):
a95a7133 1665 """close(self)"""
54f9ee45 1666 return _core_.InputStream_close(*args, **kwargs)
e811c8ce
RD
1667
1668 def flush(*args, **kwargs):
a95a7133 1669 """flush(self)"""
54f9ee45 1670 return _core_.InputStream_flush(*args, **kwargs)
e811c8ce
RD
1671
1672 def eof(*args, **kwargs):
a95a7133 1673 """eof(self) -> bool"""
54f9ee45 1674 return _core_.InputStream_eof(*args, **kwargs)
e811c8ce
RD
1675
1676 def read(*args, **kwargs):
a95a7133 1677 """read(self, int size=-1) -> PyObject"""
54f9ee45 1678 return _core_.InputStream_read(*args, **kwargs)
e811c8ce
RD
1679
1680 def readline(*args, **kwargs):
a95a7133 1681 """readline(self, int size=-1) -> PyObject"""
54f9ee45 1682 return _core_.InputStream_readline(*args, **kwargs)
e811c8ce
RD
1683
1684 def readlines(*args, **kwargs):
a95a7133 1685 """readlines(self, int sizehint=-1) -> PyObject"""
54f9ee45 1686 return _core_.InputStream_readlines(*args, **kwargs)
e811c8ce
RD
1687
1688 def seek(*args, **kwargs):
a95a7133 1689 """seek(self, int offset, int whence=0)"""
54f9ee45 1690 return _core_.InputStream_seek(*args, **kwargs)
e811c8ce
RD
1691
1692 def tell(*args, **kwargs):
a95a7133 1693 """tell(self) -> int"""
54f9ee45 1694 return _core_.InputStream_tell(*args, **kwargs)
e811c8ce
RD
1695
1696 def Peek(*args, **kwargs):
a95a7133 1697 """Peek(self) -> char"""
54f9ee45 1698 return _core_.InputStream_Peek(*args, **kwargs)
e811c8ce
RD
1699
1700 def GetC(*args, **kwargs):
a95a7133 1701 """GetC(self) -> char"""
54f9ee45 1702 return _core_.InputStream_GetC(*args, **kwargs)
e811c8ce
RD
1703
1704 def LastRead(*args, **kwargs):
a95a7133 1705 """LastRead(self) -> size_t"""
54f9ee45 1706 return _core_.InputStream_LastRead(*args, **kwargs)
e811c8ce
RD
1707
1708 def CanRead(*args, **kwargs):
a95a7133 1709 """CanRead(self) -> bool"""
54f9ee45 1710 return _core_.InputStream_CanRead(*args, **kwargs)
e811c8ce
RD
1711
1712 def Eof(*args, **kwargs):
a95a7133 1713 """Eof(self) -> bool"""
54f9ee45 1714 return _core_.InputStream_Eof(*args, **kwargs)
e811c8ce
RD
1715
1716 def Ungetch(*args, **kwargs):
a95a7133 1717 """Ungetch(self, char c) -> bool"""
54f9ee45 1718 return _core_.InputStream_Ungetch(*args, **kwargs)
e811c8ce
RD
1719
1720 def SeekI(*args, **kwargs):
a95a7133 1721 """SeekI(self, long pos, int mode=FromStart) -> long"""
54f9ee45 1722 return _core_.InputStream_SeekI(*args, **kwargs)
e811c8ce
RD
1723
1724 def TellI(*args, **kwargs):
a95a7133 1725 """TellI(self) -> long"""
54f9ee45 1726 return _core_.InputStream_TellI(*args, **kwargs)
e811c8ce 1727
2131d850 1728_core_.InputStream_swigregister(InputStream)
d14a1e28
RD
1729DefaultPosition = cvar.DefaultPosition
1730DefaultSize = cvar.DefaultSize
1731
1732class OutputStream(object):
093d3ff1 1733 """Proxy of C++ OutputStream class"""
0085ce49
RD
1734 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1735 def __init__(self): raise AttributeError, "No constructor defined"
1736 __repr__ = _swig_repr
e811c8ce 1737 def write(*args, **kwargs):
a95a7133 1738 """write(self, PyObject obj)"""
54f9ee45 1739 return _core_.OutputStream_write(*args, **kwargs)
e811c8ce 1740
0085ce49
RD
1741 def LastWrite(*args, **kwargs):
1742 """LastWrite(self) -> size_t"""
1743 return _core_.OutputStream_LastWrite(*args, **kwargs)
d14a1e28 1744
2131d850 1745_core_.OutputStream_swigregister(OutputStream)
d14a1e28
RD
1746
1747#---------------------------------------------------------------------------
1748
1749class FSFile(Object):
093d3ff1 1750 """Proxy of C++ FSFile class"""
0085ce49
RD
1751 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1752 __repr__ = _swig_repr
1753 def __init__(self, *args, **kwargs):
0df68c9f 1754 """
a95a7133 1755 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
196addbf 1756 DateTime modif) -> FSFile
0df68c9f 1757 """
0085ce49 1758 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
0085ce49
RD
1759 __swig_destroy__ = _core_.delete_FSFile
1760 __del__ = lambda self : None;
e811c8ce 1761 def GetStream(*args, **kwargs):
a95a7133 1762 """GetStream(self) -> InputStream"""
54f9ee45 1763 return _core_.FSFile_GetStream(*args, **kwargs)
e811c8ce 1764
97ab0f6a
RD
1765 def DetachStream(*args, **kwargs):
1766 """DetachStream(self)"""
1767 return _core_.FSFile_DetachStream(*args, **kwargs)
1768
e811c8ce 1769 def GetMimeType(*args, **kwargs):
a95a7133 1770 """GetMimeType(self) -> String"""
54f9ee45 1771 return _core_.FSFile_GetMimeType(*args, **kwargs)
e811c8ce
RD
1772
1773 def GetLocation(*args, **kwargs):
a95a7133 1774 """GetLocation(self) -> String"""
54f9ee45 1775 return _core_.FSFile_GetLocation(*args, **kwargs)
e811c8ce
RD
1776
1777 def GetAnchor(*args, **kwargs):
a95a7133 1778 """GetAnchor(self) -> String"""
54f9ee45 1779 return _core_.FSFile_GetAnchor(*args, **kwargs)
e811c8ce
RD
1780
1781 def GetModificationTime(*args, **kwargs):
a95a7133 1782 """GetModificationTime(self) -> DateTime"""
54f9ee45 1783 return _core_.FSFile_GetModificationTime(*args, **kwargs)
e811c8ce 1784
97ab0f6a
RD
1785 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1786 Location = property(GetLocation,doc="See `GetLocation`")
1787 MimeType = property(GetMimeType,doc="See `GetMimeType`")
1788 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
1789 Stream = property(GetStream,doc="See `GetStream`")
2131d850 1790_core_.FSFile_swigregister(FSFile)
d14a1e28
RD
1791
1792class CPPFileSystemHandler(object):
093d3ff1 1793 """Proxy of C++ CPPFileSystemHandler class"""
0085ce49
RD
1794 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1795 def __init__(self): raise AttributeError, "No constructor defined"
1796 __repr__ = _swig_repr
50f151d7
RD
1797 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1798 __del__ = lambda self : None;
2131d850 1799_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d14a1e28
RD
1800
1801class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 1802 """Proxy of C++ FileSystemHandler class"""
0085ce49
RD
1803 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1804 __repr__ = _swig_repr
1805 def __init__(self, *args, **kwargs):
a95a7133 1806 """__init__(self) -> FileSystemHandler"""
0085ce49 1807 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
d14a1e28 1808 self._setCallbackInfo(self, FileSystemHandler)
e811c8ce
RD
1809
1810 def _setCallbackInfo(*args, **kwargs):
a95a7133 1811 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 1812 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
1813
1814 def CanOpen(*args, **kwargs):
a95a7133 1815 """CanOpen(self, String location) -> bool"""
54f9ee45 1816 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1817
1818 def OpenFile(*args, **kwargs):
a95a7133 1819 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1820 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1821
1822 def FindFirst(*args, **kwargs):
a95a7133 1823 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1824 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1825
1826 def FindNext(*args, **kwargs):
a95a7133 1827 """FindNext(self) -> String"""
54f9ee45 1828 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
e811c8ce
RD
1829
1830 def GetProtocol(*args, **kwargs):
a95a7133 1831 """GetProtocol(self, String location) -> String"""
54f9ee45 1832 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
e811c8ce
RD
1833
1834 def GetLeftLocation(*args, **kwargs):
a95a7133 1835 """GetLeftLocation(self, String location) -> String"""
54f9ee45 1836 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
e811c8ce
RD
1837
1838 def GetAnchor(*args, **kwargs):
a95a7133 1839 """GetAnchor(self, String location) -> String"""
54f9ee45 1840 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
e811c8ce
RD
1841
1842 def GetRightLocation(*args, **kwargs):
a95a7133 1843 """GetRightLocation(self, String location) -> String"""
54f9ee45 1844 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
e811c8ce
RD
1845
1846 def GetMimeTypeFromExt(*args, **kwargs):
a95a7133 1847 """GetMimeTypeFromExt(self, String location) -> String"""
54f9ee45 1848 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
e811c8ce 1849
97ab0f6a
RD
1850 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1851 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
1852 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
1853 Protocol = property(GetProtocol,doc="See `GetProtocol`")
1854 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
2131d850 1855_core_.FileSystemHandler_swigregister(FileSystemHandler)
d14a1e28
RD
1856
1857class FileSystem(Object):
093d3ff1 1858 """Proxy of C++ FileSystem class"""
0085ce49
RD
1859 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1860 __repr__ = _swig_repr
1861 def __init__(self, *args, **kwargs):
a95a7133 1862 """__init__(self) -> FileSystem"""
0085ce49
RD
1863 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1864 __swig_destroy__ = _core_.delete_FileSystem
1865 __del__ = lambda self : None;
e811c8ce 1866 def ChangePathTo(*args, **kwargs):
a95a7133 1867 """ChangePathTo(self, String location, bool is_dir=False)"""
54f9ee45 1868 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
e811c8ce
RD
1869
1870 def GetPath(*args, **kwargs):
a95a7133 1871 """GetPath(self) -> String"""
54f9ee45 1872 return _core_.FileSystem_GetPath(*args, **kwargs)
e811c8ce
RD
1873
1874 def OpenFile(*args, **kwargs):
a95a7133 1875 """OpenFile(self, String location) -> FSFile"""
54f9ee45 1876 return _core_.FileSystem_OpenFile(*args, **kwargs)
e811c8ce
RD
1877
1878 def FindFirst(*args, **kwargs):
a95a7133 1879 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1880 return _core_.FileSystem_FindFirst(*args, **kwargs)
e811c8ce
RD
1881
1882 def FindNext(*args, **kwargs):
a95a7133 1883 """FindNext(self) -> String"""
54f9ee45 1884 return _core_.FileSystem_FindNext(*args, **kwargs)
e811c8ce
RD
1885
1886 def AddHandler(*args, **kwargs):
66c033b4 1887 """AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 1888 return _core_.FileSystem_AddHandler(*args, **kwargs)
e811c8ce
RD
1889
1890 AddHandler = staticmethod(AddHandler)
97ab0f6a
RD
1891 def RemoveHandler(*args, **kwargs):
1892 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1893 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1894
1895 RemoveHandler = staticmethod(RemoveHandler)
e811c8ce 1896 def CleanUpHandlers(*args, **kwargs):
66c033b4 1897 """CleanUpHandlers()"""
54f9ee45 1898 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
e811c8ce
RD
1899
1900 CleanUpHandlers = staticmethod(CleanUpHandlers)
1901 def FileNameToURL(*args, **kwargs):
66c033b4 1902 """FileNameToURL(String filename) -> String"""
54f9ee45 1903 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
e811c8ce
RD
1904
1905 FileNameToURL = staticmethod(FileNameToURL)
2ef75293
RD
1906 def URLToFileName(*args, **kwargs):
1907 """URLToFileName(String url) -> String"""
1908 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1909
1910 URLToFileName = staticmethod(URLToFileName)
97ab0f6a 1911 Path = property(GetPath,doc="See `GetPath`")
2131d850 1912_core_.FileSystem_swigregister(FileSystem)
d14a1e28 1913
e811c8ce 1914def FileSystem_AddHandler(*args, **kwargs):
0085ce49
RD
1915 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1916 return _core_.FileSystem_AddHandler(*args, **kwargs)
d14a1e28 1917
97ab0f6a
RD
1918def FileSystem_RemoveHandler(*args, **kwargs):
1919 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1920 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1921
0085ce49
RD
1922def FileSystem_CleanUpHandlers(*args):
1923 """FileSystem_CleanUpHandlers()"""
1924 return _core_.FileSystem_CleanUpHandlers(*args)
d14a1e28 1925
e811c8ce 1926def FileSystem_FileNameToURL(*args, **kwargs):
0085ce49
RD
1927 """FileSystem_FileNameToURL(String filename) -> String"""
1928 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d14a1e28 1929
e811c8ce 1930def FileSystem_URLToFileName(*args, **kwargs):
0085ce49
RD
1931 """FileSystem_URLToFileName(String url) -> String"""
1932 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2ef75293 1933
d14a1e28 1934class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 1935 """Proxy of C++ InternetFSHandler class"""
0085ce49
RD
1936 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1937 __repr__ = _swig_repr
1938 def __init__(self, *args, **kwargs):
a95a7133 1939 """__init__(self) -> InternetFSHandler"""
0085ce49 1940 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
e811c8ce 1941 def CanOpen(*args, **kwargs):
a95a7133 1942 """CanOpen(self, String location) -> bool"""
54f9ee45 1943 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1944
1945 def OpenFile(*args, **kwargs):
a95a7133 1946 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1947 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
e811c8ce 1948
2131d850 1949_core_.InternetFSHandler_swigregister(InternetFSHandler)
d14a1e28
RD
1950
1951class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 1952 """Proxy of C++ ZipFSHandler class"""
0085ce49
RD
1953 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1954 __repr__ = _swig_repr
1955 def __init__(self, *args, **kwargs):
a95a7133 1956 """__init__(self) -> ZipFSHandler"""
0085ce49 1957 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
e811c8ce 1958 def CanOpen(*args, **kwargs):
a95a7133 1959 """CanOpen(self, String location) -> bool"""
54f9ee45 1960 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1961
1962 def OpenFile(*args, **kwargs):
a95a7133 1963 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1964 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1965
1966 def FindFirst(*args, **kwargs):
a95a7133 1967 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1968 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1969
1970 def FindNext(*args, **kwargs):
a95a7133 1971 """FindNext(self) -> String"""
54f9ee45 1972 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
e811c8ce 1973
2131d850 1974_core_.ZipFSHandler_swigregister(ZipFSHandler)
d14a1e28
RD
1975
1976
e811c8ce 1977def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
0085ce49
RD
1978 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1979 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d14a1e28 1980
e811c8ce 1981def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
0085ce49
RD
1982 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1983 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d14a1e28 1984
e811c8ce 1985def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
0085ce49
RD
1986 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1987 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
2ef75293
RD
1988def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1989 """
1990 Add 'file' to the memory filesystem. The dataItem parameter can
1991 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1992 arbitrary data. If a bitmap or image is used then the imgType
1993 parameter should specify what kind of image file it should be
1994 written as, wx.BITMAP_TYPE_PNG, etc.
1995 """
1996 if isinstance(dataItem, wx.Image):
1997 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1998 elif isinstance(dataItem, wx.Bitmap):
1999 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
2000 elif type(dataItem) == str:
2001 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2002 else:
2003 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d14a1e28
RD
2004
2005class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 2006 """Proxy of C++ MemoryFSHandler class"""
0085ce49
RD
2007 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2008 __repr__ = _swig_repr
2009 def __init__(self, *args, **kwargs):
a95a7133 2010 """__init__(self) -> MemoryFSHandler"""
0085ce49 2011 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
e811c8ce 2012 def RemoveFile(*args, **kwargs):
66c033b4 2013 """RemoveFile(String filename)"""
54f9ee45 2014 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
e811c8ce
RD
2015
2016 RemoveFile = staticmethod(RemoveFile)
d14a1e28 2017 AddFile = staticmethod(MemoryFSHandler_AddFile)
e811c8ce 2018 def CanOpen(*args, **kwargs):
a95a7133 2019 """CanOpen(self, String location) -> bool"""
54f9ee45 2020 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
2021
2022 def OpenFile(*args, **kwargs):
a95a7133 2023 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 2024 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
2025
2026 def FindFirst(*args, **kwargs):
a95a7133 2027 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 2028 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
2029
2030 def FindNext(*args, **kwargs):
a95a7133 2031 """FindNext(self) -> String"""
54f9ee45 2032 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
e811c8ce 2033
2131d850 2034_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d14a1e28 2035
e811c8ce 2036def MemoryFSHandler_RemoveFile(*args, **kwargs):
0085ce49
RD
2037 """MemoryFSHandler_RemoveFile(String filename)"""
2038 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d14a1e28 2039
bcd0d7b6
RD
2040IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2041IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2042IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
f5263701
RD
2043IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL
2044IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH
d14a1e28
RD
2045#---------------------------------------------------------------------------
2046
2047class ImageHandler(Object):
27fb7603
RD
2048 """
2049 This is the base class for implementing image file loading/saving, and
2050 image creation from data. It is used within `wx.Image` and is not
2051 normally seen by the application.
2052 """
0085ce49
RD
2053 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2054 def __init__(self): raise AttributeError, "No constructor defined"
2055 __repr__ = _swig_repr
e811c8ce 2056 def GetName(*args, **kwargs):
a95a7133 2057 """GetName(self) -> String"""
54f9ee45 2058 return _core_.ImageHandler_GetName(*args, **kwargs)
e811c8ce
RD
2059
2060 def GetExtension(*args, **kwargs):
a95a7133 2061 """GetExtension(self) -> String"""
54f9ee45 2062 return _core_.ImageHandler_GetExtension(*args, **kwargs)
e811c8ce
RD
2063
2064 def GetType(*args, **kwargs):
a95a7133 2065 """GetType(self) -> long"""
54f9ee45 2066 return _core_.ImageHandler_GetType(*args, **kwargs)
e811c8ce
RD
2067
2068 def GetMimeType(*args, **kwargs):
a95a7133 2069 """GetMimeType(self) -> String"""
54f9ee45 2070 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
e811c8ce
RD
2071
2072 def CanRead(*args, **kwargs):
a95a7133 2073 """CanRead(self, String name) -> bool"""
54f9ee45 2074 return _core_.ImageHandler_CanRead(*args, **kwargs)
e811c8ce 2075
b02396e8
RD
2076 def CanReadStream(*args, **kwargs):
2077 """CanReadStream(self, InputStream stream) -> bool"""
2078 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2079
e811c8ce 2080 def SetName(*args, **kwargs):
a95a7133 2081 """SetName(self, String name)"""
54f9ee45 2082 return _core_.ImageHandler_SetName(*args, **kwargs)
e811c8ce
RD
2083
2084 def SetExtension(*args, **kwargs):
a95a7133 2085 """SetExtension(self, String extension)"""
54f9ee45 2086 return _core_.ImageHandler_SetExtension(*args, **kwargs)
e811c8ce
RD
2087
2088 def SetType(*args, **kwargs):
a95a7133 2089 """SetType(self, long type)"""
54f9ee45 2090 return _core_.ImageHandler_SetType(*args, **kwargs)
e811c8ce
RD
2091
2092 def SetMimeType(*args, **kwargs):
a95a7133 2093 """SetMimeType(self, String mimetype)"""
54f9ee45 2094 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
e811c8ce 2095
97ab0f6a
RD
2096 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2097 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2098 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2099 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2131d850 2100_core_.ImageHandler_swigregister(ImageHandler)
d14a1e28 2101
943e8dfd
RD
2102class PyImageHandler(ImageHandler):
2103 """
2104 This is the base class for implementing image file loading/saving, and
2105 image creation from data, all written in Python. To create a custom
2106 image handler derive a new class from wx.PyImageHandler and provide
2107 the following methods::
2108
2109 def DoCanRead(self, stream) --> bool
2110 '''Check if this handler can read the image on the stream'''
2111
2112 def LoadFile(self, image, stream, verbose, index) --> bool
2113 '''Load image data from the stream and load it into image.'''
2114
2115 def SaveFile(self, image, stream, verbose) --> bool
2116 '''Save the iamge data in image to the stream using
2117 this handler's image file format.'''
2118
2119 def GetImageCount(self, stream) --> int
2120 '''If this image format can hold more than one image,
2121 how many does the image on the stream have?'''
2122
2123 To activate your handler create an instance of it and pass it to
2124 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2125 `SetExtension` from your constructor.
2126
2127 """
0085ce49
RD
2128 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2129 __repr__ = _swig_repr
2130 def __init__(self, *args, **kwargs):
943e8dfd
RD
2131 """
2132 __init__(self) -> PyImageHandler
2133
2134 This is the base class for implementing image file loading/saving, and
2135 image creation from data, all written in Python. To create a custom
2136 image handler derive a new class from wx.PyImageHandler and provide
2137 the following methods::
2138
2139 def DoCanRead(self, stream) --> bool
2140 '''Check if this handler can read the image on the stream'''
2141
2142 def LoadFile(self, image, stream, verbose, index) --> bool
2143 '''Load image data from the stream and load it into image.'''
2144
2145 def SaveFile(self, image, stream, verbose) --> bool
2146 '''Save the iamge data in image to the stream using
2147 this handler's image file format.'''
2148
2149 def GetImageCount(self, stream) --> int
2150 '''If this image format can hold more than one image,
2151 how many does the image on the stream have?'''
2152
2153 To activate your handler create an instance of it and pass it to
2154 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2155 `SetExtension` from your constructor.
2156
2157 """
0085ce49 2158 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
RD
2159 self._SetSelf(self)
2160
2161 def _SetSelf(*args, **kwargs):
2162 """_SetSelf(self, PyObject self)"""
2163 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2164
2131d850 2165_core_.PyImageHandler_swigregister(PyImageHandler)
943e8dfd 2166
d14a1e28 2167class ImageHistogram(object):
093d3ff1 2168 """Proxy of C++ ImageHistogram class"""
0085ce49
RD
2169 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2170 __repr__ = _swig_repr
2171 def __init__(self, *args, **kwargs):
a95a7133 2172 """__init__(self) -> ImageHistogram"""
0085ce49 2173 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
e811c8ce 2174 def MakeKey(*args, **kwargs):
0df68c9f 2175 """
7a27cf7c 2176 MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2177
0df68c9f
RD
2178 Get the key in the histogram for the given RGB values
2179 """
54f9ee45 2180 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
e811c8ce
RD
2181
2182 MakeKey = staticmethod(MakeKey)
2183 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2184 """
2185 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2186
2187 Find first colour that is not used in the image and has higher RGB
2188 values than startR, startG, startB. Returns a tuple consisting of a
2189 success flag and rgb values.
2190 """
54f9ee45 2191 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2192
f1cbd8fa
RD
2193 def GetCount(*args, **kwargs):
2194 """
2195 GetCount(self, unsigned long key) -> unsigned long
2196
2197 Returns the pixel count for the given key. Use `MakeKey` to create a
2198 key value from a RGB tripple.
2199 """
2200 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2201
2202 def GetCountRGB(*args, **kwargs):
2203 """
7a27cf7c 2204 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2205
2206 Returns the pixel count for the given RGB values.
2207 """
2208 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2209
2210 def GetCountColour(*args, **kwargs):
2211 """
2212 GetCountColour(self, Colour colour) -> unsigned long
2213
2214 Returns the pixel count for the given `wx.Colour` value.
2215 """
2216 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2217
2131d850 2218_core_.ImageHistogram_swigregister(ImageHistogram)
d14a1e28 2219
e811c8ce 2220def ImageHistogram_MakeKey(*args, **kwargs):
0085ce49 2221 """
7a27cf7c 2222 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2223
0df68c9f
RD
2224 Get the key in the histogram for the given RGB values
2225 """
0085ce49 2226 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d14a1e28 2227
943e8dfd
RD
2228class Image_RGBValue(object):
2229 """
2230 An object that contains values for red, green and blue which represent
2231 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2232 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2233 color space.
2234 """
0085ce49
RD
2235 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2236 __repr__ = _swig_repr
2237 def __init__(self, *args, **kwargs):
943e8dfd
RD
2238 """
2239 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2240
2241 Constructor.
2242 """
0085ce49 2243 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
2244 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2245 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2246 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2247_core_.Image_RGBValue_swigregister(Image_RGBValue)
943e8dfd
RD
2248
2249class Image_HSVValue(object):
2250 """
2251 An object that contains values for hue, saturation and value which
2252 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2253 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2254 color space.
2255 """
0085ce49
RD
2256 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2257 __repr__ = _swig_repr
2258 def __init__(self, *args, **kwargs):
943e8dfd
RD
2259 """
2260 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2261
2262 Constructor.
2263 """
0085ce49 2264 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
2265 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2266 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2267 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2268_core_.Image_HSVValue_swigregister(Image_HSVValue)
943e8dfd 2269
d14a1e28 2270class Image(Object):
7a27cf7c
RD
2271 """
2272 A platform-independent image class. An image can be created from
2273 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2274 variety of formats. Functions are available to set and get image
2275 bits, so it can be used for basic image manipulation.
2276
2277 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2278 platform-specific `wx.Bitmap` object must be created from it using the
2279 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2280 device context, using `wx.DC.DrawBitmap`.
2281
2282 One colour value of the image may be used as a mask colour which will
2283 lead to the automatic creation of a `wx.Mask` object associated to the
2284 bitmap object.
2285
2286 wx.Image supports alpha channel data, that is in addition to a byte
2287 for the red, green and blue colour components for each pixel it also
2288 stores a byte representing the pixel opacity. An alpha value of 0
2289 corresponds to a transparent pixel (null opacity) while a value of 255
2290 means that the pixel is 100% opaque.
2291
2292 Unlike RGB data, not all images have an alpha channel and before using
2293 `GetAlpha` you should check if this image contains an alpha channel
2294 with `HasAlpha`. Note that currently only images loaded from PNG files
2295 with transparency information will have an alpha channel.
2296 """
0085ce49
RD
2297 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2298 __repr__ = _swig_repr
2299 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2300 """
2301 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2302
2303 Loads an image from a file.
2304 """
0085ce49
RD
2305 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2306 __swig_destroy__ = _core_.delete_Image
2307 __del__ = lambda self : None;
e811c8ce 2308 def Create(*args, **kwargs):
7a27cf7c
RD
2309 """
2310 Create(self, int width, int height, bool clear=True)
2311
2312 Creates a fresh image. If clear is ``True``, the new image will be
2313 initialized to black. Otherwise, the image data will be uninitialized.
2314 """
54f9ee45 2315 return _core_.Image_Create(*args, **kwargs)
e811c8ce
RD
2316
2317 def Destroy(*args, **kwargs):
0df68c9f 2318 """
a95a7133 2319 Destroy(self)
e811c8ce 2320
7a27cf7c 2321 Destroys the image data.
0df68c9f 2322 """
b39fe951
RD
2323 args[0].this.own(False)
2324 return _core_.Image_Destroy(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2339 return _core_.Image_Scale(*args, **kwargs)
e811c8ce 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
e811c8ce 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 """
54f9ee45 2384 return _core_.Image_ShrinkBy(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2395 return _core_.Image_Rescale(*args, **kwargs)
e811c8ce 2396
aff4cc5c 2397 def Resize(*args, **kwargs):
7a27cf7c
RD
2398 """
2399 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2400
2401 Changes the size of the image in-place without scaling it, by adding
2402 either a border with the given colour or cropping as necessary. The
2403 image is pasted into a new image with the given size and background
2404 colour at the position pos relative to the upper left of the new
2405 image. If red = green = blue = -1 then use either the current mask
2406 colour if set or find, use, and set a suitable mask colour for any
2407 newly exposed areas.
2408
2409 Returns the (modified) image itself.
2410 """
aff4cc5c
RD
2411 return _core_.Image_Resize(*args, **kwargs)
2412
e811c8ce 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 """
54f9ee45 2423 return _core_.Image_SetRGB(*args, **kwargs)
e811c8ce 2424
aff4cc5c 2425 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2426 """
2427 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2428
2429 Sets the colour of the pixels within the given rectangle. This routine
2430 performs bounds-checks for the rectangle so it can be considered a
2431 safe way to manipulate the data.
2432 """
aff4cc5c
RD
2433 return _core_.Image_SetRGBRect(*args, **kwargs)
2434
e811c8ce 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 """
54f9ee45 2441 return _core_.Image_GetRed(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2449 return _core_.Image_GetGreen(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2457 return _core_.Image_GetBlue(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2467 return _core_.Image_SetAlpha(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2481 return _core_.Image_GetAlpha(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2489 return _core_.Image_HasAlpha(*args, **kwargs)
e811c8ce 2490
68350608
RD
2491 def InitAlpha(*args, **kwargs):
2492 """
2493 InitAlpha(self)
2494
2495 Initializes the image alpha channel data. It is an error to call it if
2496 the image already has alpha data. If it doesn't, alpha data will be by
2497 default initialized to all pixels being fully opaque. But if the image
2498 has a a mask colour, all mask pixels will be completely transparent.
2499 """
2500 return _core_.Image_InitAlpha(*args, **kwargs)
2501
bcd0d7b6
RD
2502 def IsTransparent(*args, **kwargs):
2503 """
7a27cf7c 2504 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
bcd0d7b6 2505
7a27cf7c
RD
2506 Returns ``True`` if this pixel is masked or has an alpha value less
2507 than the spcified threshold.
bcd0d7b6
RD
2508 """
2509 return _core_.Image_IsTransparent(*args, **kwargs)
2510
e811c8ce 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 """
54f9ee45 2519 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2520
4cf4100f
RD
2521 def ConvertAlphaToMask(*args, **kwargs):
2522 """
bcd0d7b6 2523 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2524
7a27cf7c
RD
2525 If the image has alpha channel, this method converts it to mask. All
2526 pixels with alpha value less than ``threshold`` are replaced with the
2527 mask colour and the alpha channel is removed. The mask colour is
2528 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2529
2530 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2531 nothing.
2532 """
2533 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2534
8fb0e70a
RD
2535 def ConvertColourToAlpha(*args, **kwargs):
2536 """
7a27cf7c 2537 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2538
2539 This method converts an image where the original alpha information is
2540 only available as a shades of a colour (actually shades of grey)
2541 typically when you draw anti-aliased text into a bitmap. The DC
2542 drawing routines draw grey values on the black background although
2543 they actually mean to draw white with differnt alpha values. This
2544 method reverses it, assuming a black (!) background and white text.
2545 The method will then fill up the whole image with the colour given.
2546 """
2547 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2548
e811c8ce 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 """
54f9ee45 2566 return _core_.Image_SetMaskFromImage(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2574 return _core_.Image_CanRead(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2585 return _core_.Image_GetImageCount(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2595 return _core_.Image_LoadFile(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2604 return _core_.Image_LoadMimeFile(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2612 return _core_.Image_SaveFile(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2620 return _core_.Image_SaveMimeFile(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2630 return _core_.Image_CanReadStream(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2641 return _core_.Image_LoadStream(*args, **kwargs)
e811c8ce
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 """
54f9ee45 2650 return _core_.Image_LoadMimeStream(*args, **kwargs)
e811c8ce 2651
b39fe951 2652 def IsOk(*args, **kwargs):
7a27cf7c 2653 """
b39fe951 2654 IsOk(self) -> bool
7a27cf7c
RD
2655
2656 Returns true if image data is present.
2657 """
b39fe951 2658 return _core_.Image_IsOk(*args, **kwargs)
e811c8ce 2659
b39fe951 2660 Ok = IsOk
e811c8ce 2661 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2662 """
2663 GetWidth(self) -> int
2664
2665 Gets the width of the image in pixels.
2666 """
54f9ee45 2667 return _core_.Image_GetWidth(*args, **kwargs)
e811c8ce
RD
2668
2669 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2670 """
2671 GetHeight(self) -> int
2672
2673 Gets the height of the image in pixels.
2674 """
54f9ee45 2675 return _core_.Image_GetHeight(*args, **kwargs)
e811c8ce 2676
b2df227b 2677 def GetSize(*args, **kwargs):
7a27cf7c
RD
2678 """
2679 GetSize(self) -> Size
2680
2681 Returns the size of the image in pixels.
2682 """
54f9ee45 2683 return _core_.Image_GetSize(*args, **kwargs)
b2df227b 2684
e811c8ce 2685 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2686 """
2687 GetSubImage(self, Rect rect) -> Image
2688
2689 Returns a sub image of the current one as long as the rect belongs
2690 entirely to the image.
2691 """
54f9ee45 2692 return _core_.Image_GetSubImage(*args, **kwargs)
e811c8ce 2693
aff4cc5c 2694 def Size(*args, **kwargs):
7a27cf7c
RD
2695 """
2696 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2697
2698 Returns a resized version of this image without scaling it by adding
2699 either a border with the given colour or cropping as necessary. The
2700 image is pasted into a new image with the given size and background
2701 colour at the position ``pos`` relative to the upper left of the new
2702 image. If red = green = blue = -1 then use either the current mask
2703 colour if set or find, use, and set a suitable mask colour for any
2704 newly exposed areas.
2705 """
aff4cc5c
RD
2706 return _core_.Image_Size(*args, **kwargs)
2707
e811c8ce 2708 def Copy(*args, **kwargs):
7a27cf7c
RD
2709 """
2710 Copy(self) -> Image
2711
2712 Returns an identical copy of the image.
2713 """
54f9ee45 2714 return _core_.Image_Copy(*args, **kwargs)
e811c8ce
RD
2715
2716 def Paste(*args, **kwargs):
7a27cf7c
RD
2717 """
2718 Paste(self, Image image, int x, int y)
2719
2720 Pastes ``image`` into this instance and takes care of the mask colour
2721 and any out of bounds problems.
2722 """
54f9ee45 2723 return _core_.Image_Paste(*args, **kwargs)
e811c8ce
RD
2724
2725 def GetData(*args, **kwargs):
61d07ac7
RD
2726 """
2727 GetData(self) -> PyObject
2728
2729 Returns a string containing a copy of the RGB bytes of the image.
2730 """
54f9ee45 2731 return _core_.Image_GetData(*args, **kwargs)
e811c8ce
RD
2732
2733 def SetData(*args, **kwargs):
61d07ac7
RD
2734 """
2735 SetData(self, buffer data)
2736
2737 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2738 either a string or a buffer object holding the data and the length of
2739 the data must be width*height*3.
2740 """
54f9ee45 2741 return _core_.Image_SetData(*args, **kwargs)
e811c8ce
RD
2742
2743 def GetDataBuffer(*args, **kwargs):
61d07ac7
RD
2744 """
2745 GetDataBuffer(self) -> PyObject
2746
2747 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2748 image data buffer inside the wx.Image. You need to ensure that you do
2749 not use this buffer object after the image has been destroyed.
61d07ac7 2750 """
54f9ee45 2751 return _core_.Image_GetDataBuffer(*args, **kwargs)
e811c8ce
RD
2752
2753 def SetDataBuffer(*args, **kwargs):
61d07ac7
RD
2754 """
2755 SetDataBuffer(self, buffer data)
2756
2757 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2758 object. This can save making an extra copy of the data but you must
2759 ensure that the buffer object lives longer than the wx.Image does.
61d07ac7 2760 """
54f9ee45 2761 return _core_.Image_SetDataBuffer(*args, **kwargs)
e811c8ce
RD
2762
2763 def GetAlphaData(*args, **kwargs):
61d07ac7
RD
2764 """
2765 GetAlphaData(self) -> PyObject
2766
2767 Returns a string containing a copy of the alpha bytes of the image.
2768 """
54f9ee45 2769 return _core_.Image_GetAlphaData(*args, **kwargs)
e811c8ce
RD
2770
2771 def SetAlphaData(*args, **kwargs):
61d07ac7
RD
2772 """
2773 SetAlphaData(self, buffer alpha)
2774
2775 Resets the Image's alpha data from a buffer of bytes. Accepts either
2776 a string or a buffer object holding the data and the length of the
2777 data must be width*height.
2778 """
54f9ee45 2779 return _core_.Image_SetAlphaData(*args, **kwargs)
e811c8ce
RD
2780
2781 def GetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
2782 """
2783 GetAlphaBuffer(self) -> PyObject
2784
2785 Returns a writable Python buffer object that is pointing at the Alpha
2786 data buffer inside the wx.Image. You need to ensure that you do not
2787 use this buffer object after the image has been destroyed.
2788 """
54f9ee45 2789 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2790
2791 def SetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
2792 """
2793 SetAlphaBuffer(self, buffer alpha)
2794
2795 Sets the internal image alpha pointer to point at a Python buffer
2796 object. This can save making an extra copy of the data but you must
2797 ensure that the buffer object lives as long as the wx.Image does.
2798 """
54f9ee45 2799 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2800
2801 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2802 """
2803 SetMaskColour(self, byte r, byte g, byte b)
2804
2805 Sets the mask colour for this image (and tells the image to use the
2806 mask).
2807 """
54f9ee45 2808 return _core_.Image_SetMaskColour(*args, **kwargs)
e811c8ce 2809
aff4cc5c
RD
2810 def GetOrFindMaskColour(*args, **kwargs):
2811 """
2812 GetOrFindMaskColour() -> (r,g,b)
2813
2814 Get the current mask colour or find a suitable colour.
2815 """
2816 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2817
e811c8ce 2818 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2819 """
2820 GetMaskRed(self) -> byte
2821
2822 Gets the red component of the mask colour.
2823 """
54f9ee45 2824 return _core_.Image_GetMaskRed(*args, **kwargs)
e811c8ce
RD
2825
2826 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2827 """
2828 GetMaskGreen(self) -> byte
2829
2830 Gets the green component of the mask colour.
2831 """
54f9ee45 2832 return _core_.Image_GetMaskGreen(*args, **kwargs)
e811c8ce
RD
2833
2834 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2835 """
2836 GetMaskBlue(self) -> byte
2837
2838 Gets the blue component of the mask colour.
2839 """
54f9ee45 2840 return _core_.Image_GetMaskBlue(*args, **kwargs)
e811c8ce
RD
2841
2842 def SetMask(*args, **kwargs):
7a27cf7c
RD
2843 """
2844 SetMask(self, bool mask=True)
2845
2846 Specifies whether there is a mask or not. The area of the mask is
2847 determined by the current mask colour.
2848 """
54f9ee45 2849 return _core_.Image_SetMask(*args, **kwargs)
e811c8ce
RD
2850
2851 def HasMask(*args, **kwargs):
7a27cf7c
RD
2852 """
2853 HasMask(self) -> bool
2854
2855 Returns ``True`` if there is a mask active, ``False`` otherwise.
2856 """
54f9ee45 2857 return _core_.Image_HasMask(*args, **kwargs)
e811c8ce
RD
2858
2859 def Rotate(*args, **kwargs):
0df68c9f 2860 """
a95a7133 2861 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
0df68c9f 2862 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2863
2864 Rotates the image about the given point, by ``angle`` radians. Passing
2865 ``True`` to ``interpolating`` results in better image quality, but is
2866 slower. If the image has a mask, then the mask colour is used for the
2867 uncovered pixels in the rotated image background. Otherwise, black
2868 will be used as the fill colour.
2869
2870 Returns the rotated image, leaving this image intact.
0df68c9f 2871 """
54f9ee45 2872 return _core_.Image_Rotate(*args, **kwargs)
e811c8ce
RD
2873
2874 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2875 """
2876 Rotate90(self, bool clockwise=True) -> Image
2877
2878 Returns a copy of the image rotated 90 degrees in the direction
2879 indicated by ``clockwise``.
2880 """
54f9ee45 2881 return _core_.Image_Rotate90(*args, **kwargs)
e811c8ce
RD
2882
2883 def Mirror(*args, **kwargs):
7a27cf7c
RD
2884 """
2885 Mirror(self, bool horizontally=True) -> Image
2886
2887 Returns a mirrored copy of the image. The parameter ``horizontally``
2888 indicates the orientation.
2889 """
54f9ee45 2890 return _core_.Image_Mirror(*args, **kwargs)
e811c8ce
RD
2891
2892 def Replace(*args, **kwargs):
0df68c9f 2893 """
7a27cf7c
RD
2894 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2895
2896 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2897 ``(r2,g2,b2)``.
0df68c9f 2898 """
54f9ee45 2899 return _core_.Image_Replace(*args, **kwargs)
e811c8ce 2900
32fe5131
RD
2901 def ConvertToGreyscale(*args, **kwargs):
2902 """
2903 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2904
2905 Convert to greyscale image. Uses the luminance component (Y) of the
2906 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2907 defaults to ITU-T BT.601
2908 """
2909 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2910
e811c8ce 2911 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2912 """
2913 ConvertToMono(self, byte r, byte g, byte b) -> Image
2914
2915 Returns monochromatic version of the image. The returned image has
2916 white colour where the original has ``(r,g,b)`` colour and black
2917 colour everywhere else.
2918 """
54f9ee45 2919 return _core_.Image_ConvertToMono(*args, **kwargs)
e811c8ce
RD
2920
2921 def SetOption(*args, **kwargs):
7a27cf7c
RD
2922 """
2923 SetOption(self, String name, String value)
2924
2925 Sets an image handler defined option. For example, when saving as a
2926 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2927 number between 0 and 100 (0 is terrible, 100 is very good).
2928 """
54f9ee45 2929 return _core_.Image_SetOption(*args, **kwargs)
e811c8ce
RD
2930
2931 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2932 """
2933 SetOptionInt(self, String name, int value)
2934
2935 Sets an image option as an integer.
2936 """
54f9ee45 2937 return _core_.Image_SetOptionInt(*args, **kwargs)
e811c8ce
RD
2938
2939 def GetOption(*args, **kwargs):
7a27cf7c
RD
2940 """
2941 GetOption(self, String name) -> String
2942
2943 Gets the value of an image handler option.
2944 """
54f9ee45 2945 return _core_.Image_GetOption(*args, **kwargs)
e811c8ce
RD
2946
2947 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2948 """
2949 GetOptionInt(self, String name) -> int
2950
2951 Gets the value of an image handler option as an integer. If the given
2952 option is not present, the function returns 0.
2953 """
54f9ee45 2954 return _core_.Image_GetOptionInt(*args, **kwargs)
e811c8ce
RD
2955
2956 def HasOption(*args, **kwargs):
7a27cf7c
RD
2957 """
2958 HasOption(self, String name) -> bool
2959
2960 Returns true if the given option is present.
2961 """
54f9ee45 2962 return _core_.Image_HasOption(*args, **kwargs)
e811c8ce
RD
2963
2964 def CountColours(*args, **kwargs):
a95a7133 2965 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
54f9ee45 2966 return _core_.Image_CountColours(*args, **kwargs)
e811c8ce
RD
2967
2968 def ComputeHistogram(*args, **kwargs):
a95a7133 2969 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
54f9ee45 2970 return _core_.Image_ComputeHistogram(*args, **kwargs)
e811c8ce
RD
2971
2972 def AddHandler(*args, **kwargs):
66c033b4 2973 """AddHandler(ImageHandler handler)"""
54f9ee45 2974 return _core_.Image_AddHandler(*args, **kwargs)
e811c8ce
RD
2975
2976 AddHandler = staticmethod(AddHandler)
2977 def InsertHandler(*args, **kwargs):
66c033b4 2978 """InsertHandler(ImageHandler handler)"""
54f9ee45 2979 return _core_.Image_InsertHandler(*args, **kwargs)
e811c8ce
RD
2980
2981 InsertHandler = staticmethod(InsertHandler)
2982 def RemoveHandler(*args, **kwargs):
66c033b4 2983 """RemoveHandler(String name) -> bool"""
54f9ee45 2984 return _core_.Image_RemoveHandler(*args, **kwargs)
e811c8ce
RD
2985
2986 RemoveHandler = staticmethod(RemoveHandler)
0085ce49
RD
2987 def GetHandlers(*args, **kwargs):
2988 """GetHandlers() -> PyObject"""
2989 return _core_.Image_GetHandlers(*args, **kwargs)
2990
2991 GetHandlers = staticmethod(GetHandlers)
e811c8ce 2992 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2993 """
2994 GetImageExtWildcard() -> String
2995
2996 Iterates all registered wxImageHandler objects, and returns a string
2997 containing file extension masks suitable for passing to file open/save
2998 dialog boxes.
2999 """
54f9ee45 3000 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
e811c8ce
RD
3001
3002 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3003 def ConvertToBitmap(*args, **kwargs):
1fbf26be 3004 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
54f9ee45 3005 return _core_.Image_ConvertToBitmap(*args, **kwargs)
e811c8ce
RD
3006
3007 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 3008 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
54f9ee45 3009 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
e811c8ce 3010
943e8dfd
RD
3011 def RotateHue(*args, **kwargs):
3012 """
3013 RotateHue(self, double angle)
3014
3015 Rotates the hue of each pixel of the image. Hue is a double in the
3016 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3017 """
3018 return _core_.Image_RotateHue(*args, **kwargs)
3019
3020 def RGBtoHSV(*args, **kwargs):
3021 """
3022 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3023
3024 Converts a color in RGB color space to HSV color space.
3025 """
3026 return _core_.Image_RGBtoHSV(*args, **kwargs)
3027
3028 RGBtoHSV = staticmethod(RGBtoHSV)
3029 def HSVtoRGB(*args, **kwargs):
3030 """
3031 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3032
3033 Converts a color in HSV color space to RGB color space.
3034 """
3035 return _core_.Image_HSVtoRGB(*args, **kwargs)
3036
3037 HSVtoRGB = staticmethod(HSVtoRGB)
b39fe951 3038 def __nonzero__(self): return self.IsOk()
97ab0f6a
RD
3039 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
3040 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
3041 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
3042 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
3043 Height = property(GetHeight,doc="See `GetHeight`")
3044 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
3045 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
3046 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
97ab0f6a 3047 Width = property(GetWidth,doc="See `GetWidth`")
2131d850 3048_core_.Image_swigregister(Image)
d14a1e28
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 """
54f9ee45 3057 val = _core_.new_ImageFromMime(*args, **kwargs)
d14a1e28
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 """
54f9ee45 3067 val = _core_.new_ImageFromStream(*args, **kwargs)
d14a1e28
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 """
54f9ee45 3077 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d14a1e28
RD
3078 return val
3079
66c033b4 3080def EmptyImage(*args, **kwargs):
61d07ac7
RD
3081 """
3082 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
3083
3084 Construct an empty image of a given size, optionally setting all
3085 pixels to black.
3086 """
66c033b4 3087 val = _core_.new_EmptyImage(*args, **kwargs)
d14a1e28
RD
3088 return val
3089
3090def ImageFromBitmap(*args, **kwargs):
61d07ac7
RD
3091 """
3092 ImageFromBitmap(Bitmap bitmap) -> Image
3093
3094 Construct an Image from a `wx.Bitmap`.
3095 """
54f9ee45 3096 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d14a1e28
RD
3097 return val
3098
3099def ImageFromData(*args, **kwargs):
61d07ac7
RD
3100 """
3101 ImageFromData(int width, int height, buffer data) -> Image
3102
3103 Construct an Image from a buffer of RGB bytes. Accepts either a
3104 string or a buffer object holding the data and the length of the data
3105 must be width*height*3.
3106 """
54f9ee45 3107 val = _core_.new_ImageFromData(*args, **kwargs)
d14a1e28
RD
3108 return val
3109
1823fbb4 3110def ImageFromDataWithAlpha(*args, **kwargs):
61d07ac7
RD
3111 """
3112 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3113
3114 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3115 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
3116 length of the data must be width*height*3 bytes, and the length of the
3117 alpha data must be width*height bytes.
61d07ac7 3118 """
1823fbb4 3119 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
1823fbb4
RD
3120 return val
3121
e811c8ce 3122def Image_CanRead(*args, **kwargs):
0085ce49 3123 """
7a27cf7c
RD
3124 Image_CanRead(String filename) -> bool
3125
3126 Returns True if the image handlers can read this file.
3127 """
0085ce49 3128 return _core_.Image_CanRead(*args, **kwargs)
d14a1e28 3129
e811c8ce 3130def Image_GetImageCount(*args, **kwargs):
0085ce49 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 """
0085ce49 3138 return _core_.Image_GetImageCount(*args, **kwargs)
d14a1e28 3139
e811c8ce 3140def Image_CanReadStream(*args, **kwargs):
0085ce49 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 """
0085ce49 3148 return _core_.Image_CanReadStream(*args, **kwargs)
d14a1e28 3149
e811c8ce 3150def Image_AddHandler(*args, **kwargs):
0085ce49
RD
3151 """Image_AddHandler(ImageHandler handler)"""
3152 return _core_.Image_AddHandler(*args, **kwargs)
d14a1e28 3153
e811c8ce 3154def Image_InsertHandler(*args, **kwargs):
0085ce49
RD
3155 """Image_InsertHandler(ImageHandler handler)"""
3156 return _core_.Image_InsertHandler(*args, **kwargs)
d14a1e28 3157
e811c8ce 3158def Image_RemoveHandler(*args, **kwargs):
0085ce49
RD
3159 """Image_RemoveHandler(String name) -> bool"""
3160 return _core_.Image_RemoveHandler(*args, **kwargs)
d14a1e28 3161
0085ce49
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 """
0085ce49 3174 return _core_.Image_GetImageExtWildcard(*args)
d14a1e28 3175
943e8dfd 3176def Image_RGBtoHSV(*args, **kwargs):
0085ce49 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 """
0085ce49 3182 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3183
3184def Image_HSVtoRGB(*args, **kwargs):
0085ce49 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 """
0085ce49 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
5e4ca4a8
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
d14a1e28 3232
54f9ee45
RD
3233IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3234IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
3235PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3236PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3237PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
54f9ee45
RD
3238BMP_24BPP = _core_.BMP_24BPP
3239BMP_8BPP = _core_.BMP_8BPP
3240BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3241BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3242BMP_8BPP_RED = _core_.BMP_8BPP_RED
3243BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3244BMP_4BPP = _core_.BMP_4BPP
3245BMP_1BPP = _core_.BMP_1BPP
3246BMP_1BPP_BW = _core_.BMP_1BPP_BW
d14a1e28 3247class BMPHandler(ImageHandler):
27fb7603 3248 """A `wx.ImageHandler` for \*.bmp bitmap files."""
0085ce49
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 """
0085ce49 3257 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3258_core_.BMPHandler_swigregister(BMPHandler)
d14a1e28 3259NullImage = cvar.NullImage
0c243d93 3260IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d14a1e28
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
0c243d93
RD
3265IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3266IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d14a1e28 3267IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3268IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
0c243d93
RD
3269IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3270IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3271IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3272IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
3273IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3274IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d14a1e28
RD
3275
3276class ICOHandler(BMPHandler):
27fb7603 3277 """A `wx.ImageHandler` for \*.ico icon files."""
0085ce49
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 """
0085ce49 3286 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3287_core_.ICOHandler_swigregister(ICOHandler)
d14a1e28
RD
3288
3289class CURHandler(ICOHandler):
27fb7603 3290 """A `wx.ImageHandler` for \*.cur cursor files."""
0085ce49
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 """
0085ce49 3299 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3300_core_.CURHandler_swigregister(CURHandler)
d14a1e28
RD
3301
3302class ANIHandler(CURHandler):
27fb7603 3303 """A `wx.ImageHandler` for \*.ani animated cursor files."""
0085ce49
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 """
0085ce49 3312 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3313_core_.ANIHandler_swigregister(ANIHandler)
d14a1e28
RD
3314
3315class PNGHandler(ImageHandler):
27fb7603 3316 """A `wx.ImageHandler` for PNG image files."""
0085ce49
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 """
0085ce49 3325 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3326_core_.PNGHandler_swigregister(PNGHandler)
d14a1e28
RD
3327
3328class GIFHandler(ImageHandler):
27fb7603 3329 """A `wx.ImageHandler` for GIF image files."""
0085ce49
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 """
0085ce49 3338 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3339_core_.GIFHandler_swigregister(GIFHandler)
d14a1e28
RD
3340
3341class PCXHandler(ImageHandler):
27fb7603 3342 """A `wx.ImageHandler` for PCX imager files."""
0085ce49
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 """
0085ce49 3351 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3352_core_.PCXHandler_swigregister(PCXHandler)
d14a1e28
RD
3353
3354class JPEGHandler(ImageHandler):
27fb7603 3355 """A `wx.ImageHandler` for JPEG/JPG image files."""
0085ce49
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 """
0085ce49 3364 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3365_core_.JPEGHandler_swigregister(JPEGHandler)
d14a1e28
RD
3366
3367class PNMHandler(ImageHandler):
27fb7603 3368 """A `wx.ImageHandler` for PNM image files."""
0085ce49
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 """
0085ce49 3377 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3378_core_.PNMHandler_swigregister(PNMHandler)
d14a1e28
RD
3379
3380class XPMHandler(ImageHandler):
27fb7603 3381 """A `wx.ImageHandler` for XPM image."""
0085ce49
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 """
0085ce49 3390 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3391_core_.XPMHandler_swigregister(XPMHandler)
d14a1e28
RD
3392
3393class TIFFHandler(ImageHandler):
27fb7603 3394 """A `wx.ImageHandler` for TIFF image files."""
0085ce49
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 """
0085ce49 3403 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3404_core_.TIFFHandler_swigregister(TIFFHandler)
d14a1e28 3405
c0de73ae
RD
3406QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3407QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3408class Quantize(object):
3409 """Performs quantization, or colour reduction, on a wxImage."""
0085ce49
RD
3410 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3411 def __init__(self): raise AttributeError, "No constructor defined"
3412 __repr__ = _swig_repr
c0de73ae
RD
3413 def Quantize(*args, **kwargs):
3414 """
3415 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3416
3417 Reduce the colours in the source image and put the result into the
3418 destination image, setting the palette in the destination if
3419 needed. Both images may be the same, to overwrite the source image.
3420 """
3421 return _core_.Quantize_Quantize(*args, **kwargs)
3422
3423 Quantize = staticmethod(Quantize)
2131d850 3424_core_.Quantize_swigregister(Quantize)
c0de73ae
RD
3425
3426def Quantize_Quantize(*args, **kwargs):
0085ce49 3427 """
c0de73ae
RD
3428 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3429
3430 Reduce the colours in the source image and put the result into the
3431 destination image, setting the palette in the destination if
3432 needed. Both images may be the same, to overwrite the source image.
3433 """
0085ce49 3434 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3435
d14a1e28
RD
3436#---------------------------------------------------------------------------
3437
3438class EvtHandler(Object):
093d3ff1 3439 """Proxy of C++ EvtHandler class"""
0085ce49
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):
a95a7133 3443 """__init__(self) -> EvtHandler"""
0085ce49 3444 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d49bdf34
RD
3445 self._setOORInfo(self)
3446
e811c8ce 3447 def GetNextHandler(*args, **kwargs):
a95a7133 3448 """GetNextHandler(self) -> EvtHandler"""
54f9ee45 3449 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
e811c8ce
RD
3450
3451 def GetPreviousHandler(*args, **kwargs):
a95a7133 3452 """GetPreviousHandler(self) -> EvtHandler"""
54f9ee45 3453 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3454
3455 def SetNextHandler(*args, **kwargs):
a95a7133 3456 """SetNextHandler(self, EvtHandler handler)"""
54f9ee45 3457 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
e811c8ce
RD
3458
3459 def SetPreviousHandler(*args, **kwargs):
a95a7133 3460 """SetPreviousHandler(self, EvtHandler handler)"""
54f9ee45 3461 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3462
3463 def GetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3464 """GetEvtHandlerEnabled(self) -> bool"""
54f9ee45 3465 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3466
3467 def SetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3468 """SetEvtHandlerEnabled(self, bool enabled)"""
54f9ee45 3469 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3470
3471 def ProcessEvent(*args, **kwargs):
a95a7133 3472 """ProcessEvent(self, Event event) -> bool"""
54f9ee45 3473 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
e811c8ce
RD
3474
3475 def AddPendingEvent(*args, **kwargs):
a95a7133 3476 """AddPendingEvent(self, Event event)"""
54f9ee45 3477 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
e811c8ce
RD
3478
3479 def ProcessPendingEvents(*args, **kwargs):
a95a7133 3480 """ProcessPendingEvents(self)"""
54f9ee45 3481 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
e811c8ce 3482
b39fe951
RD
3483 def AllowReentrance(*args, **kwargs):
3484 """AllowReentrance(self, bool allow=True)"""
3485 return _core_.EvtHandler_AllowReentrance(*args, **kwargs)
3486
3487 def IsReentranceAllowed(*args, **kwargs):
3488 """IsReentranceAllowed(self) -> bool"""
3489 return _core_.EvtHandler_IsReentranceAllowed(*args, **kwargs)
3490
3491 def IsEventHandlingInProgress(*args, **kwargs):
3492 """IsEventHandlingInProgress(self) -> bool"""
3493 return _core_.EvtHandler_IsEventHandlingInProgress(*args, **kwargs)
3494
e811c8ce 3495 def Connect(*args, **kwargs):
a95a7133 3496 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
54f9ee45 3497 return _core_.EvtHandler_Connect(*args, **kwargs)
e811c8ce
RD
3498
3499 def Disconnect(*args, **kwargs):
2131d850 3500 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
54f9ee45 3501 return _core_.EvtHandler_Disconnect(*args, **kwargs)
e811c8ce
RD
3502
3503 def _setOORInfo(*args, **kwargs):
689b42ee 3504 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3505 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3506 args[0].thisown = 0
3507 return val
e811c8ce 3508
d14a1e28
RD
3509 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3510 """
3511 Bind an event to an event handler.
3512
db3e571a
RD
3513 :param event: One of the EVT_* objects that specifies the
3514 type of event to bind,
d14a1e28 3515
db3e571a
RD
3516 :param handler: A callable object to be invoked when the
3517 event is delivered to self. Pass None to
3518 disconnect an event handler.
d14a1e28 3519
db3e571a
RD
3520 :param source: Sometimes the event originates from a
3521 different window than self, but you still
3522 want to catch it in self. (For example, a
3523 button event delivered to a frame.) By
3524 passing the source of the event, the event
3525 handling system is able to differentiate
3526 between the same event type from different
3527 controls.
d14a1e28 3528
db3e571a
RD
3529 :param id: Used to spcify the event source by ID instead
3530 of instance.
3531
3532 :param id2: Used when it is desirable to bind a handler
3533 to a range of IDs, such as with EVT_MENU_RANGE.
d14a1e28
RD
3534 """
3535 if source is not None:
3536 id = source.GetId()
3537 event.Bind(self, id, id2, handler)
3538
66c033b4
RD
3539 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3540 """
3541 Disconencts the event handler binding for event from self.
3542 Returns True if successful.
3543 """
3544 if source is not None:
3545 id = source.GetId()
3546 return event.Unbind(self, id, id2)
d14a1e28 3547
97ab0f6a
RD
3548 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3549 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3550 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
2131d850 3551_core_.EvtHandler_swigregister(EvtHandler)
d14a1e28
RD
3552
3553#---------------------------------------------------------------------------
3554
3555class PyEventBinder(object):
3556 """
3557 Instances of this class are used to bind specific events to event
3558 handlers.
3559 """
3560 def __init__(self, evtType, expectedIDs=0):
3561 if expectedIDs not in [0, 1, 2]:
3562 raise ValueError, "Invalid number of expectedIDs"
3563 self.expectedIDs = expectedIDs
3564
3565 if type(evtType) == list or type(evtType) == tuple:
3566 self.evtType = evtType
3567 else:
3568 self.evtType = [evtType]
3569
3570
3571 def Bind(self, target, id1, id2, function):
3572 """Bind this set of event types to target."""
3573 for et in self.evtType:
3574 target.Connect(id1, id2, et, function)
3575
66c033b4
RD
3576
3577 def Unbind(self, target, id1, id2):
3578 """Remove an event binding."""
3579 success = 0
3580 for et in self.evtType:
3581 success += target.Disconnect(id1, id2, et)
3582 return success != 0
3583
d14a1e28
RD
3584
3585 def __call__(self, *args):
3586 """
3587 For backwards compatibility with the old EVT_* functions.
3588 Should be called with either (window, func), (window, ID,
3589 func) or (window, ID1, ID2, func) parameters depending on the
3590 type of the event.
3591 """
3592 assert len(args) == 2 + self.expectedIDs
3593 id1 = wx.ID_ANY
3594 id2 = wx.ID_ANY
3595 target = args[0]
3596 if self.expectedIDs == 0:
3597 func = args[1]
3598 elif self.expectedIDs == 1:
3599 id1 = args[1]
3600 func = args[2]
3601 elif self.expectedIDs == 2:
3602 id1 = args[1]
3603 id2 = args[2]
3604 func = args[3]
3605 else:
3606 raise ValueError, "Unexpected number of IDs"
3607
3608 self.Bind(target, id1, id2, func)
3609
3610
3611# These two are square pegs that don't fit the PyEventBinder hole...
3612def EVT_COMMAND(win, id, cmd, func):
3613 win.Connect(id, -1, cmd, func)
3614def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3615 win.Connect(id1, id2, cmd, func)
3616
3617
3618#---------------------------------------------------------------------------
3619
3620#---------------------------------------------------------------------------
3621
54f9ee45
RD
3622EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3623EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
d14a1e28 3624
0085ce49 3625def NewEventType(*args):
2131d850 3626 """NewEventType() -> EventType"""
0085ce49 3627 return _core_.NewEventType(*args)
54f9ee45
RD
3628wxEVT_NULL = _core_.wxEVT_NULL
3629wxEVT_FIRST = _core_.wxEVT_FIRST
3630wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3631wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3632wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3633wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3634wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3635wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3636wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3637wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3638wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3639wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3640wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3641wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3642wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3643wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3644wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3645wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3646wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3647wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3648wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3649wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3650wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3651wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3652wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3653wxEVT_MOTION = _core_.wxEVT_MOTION
3654wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3655wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3656wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3657wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3658wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3659wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3660wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3661wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3662wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3663wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3664wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3665wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3666wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3667wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3668wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3669wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3670wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3671wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3672wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3673wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3674wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3675wxEVT_CHAR = _core_.wxEVT_CHAR
3676wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3677wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3678wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3679wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3680wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3681wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3682wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3683wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3684wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3685wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3686wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3687wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3688wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3689wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3690wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3691wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
54f9ee45
RD
3692wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3693wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3694wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3695wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3696wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3697wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3698wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3699wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3700wxEVT_SIZE = _core_.wxEVT_SIZE
3701wxEVT_MOVE = _core_.wxEVT_MOVE
3702wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3703wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3704wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3705wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
54f9ee45
RD
3706wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3707wxEVT_CREATE = _core_.wxEVT_CREATE
3708wxEVT_DESTROY = _core_.wxEVT_DESTROY
3709wxEVT_SHOW = _core_.wxEVT_SHOW
3710wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3711wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3712wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
34e0a3bb 3713wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
54f9ee45
RD
3714wxEVT_PAINT = _core_.wxEVT_PAINT
3715wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3716wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3717wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3718wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3719wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3720wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3721wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3722wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3723wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3724wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3725wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3726wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3727wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3728wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3729wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3730wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3731wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3732wxEVT_IDLE = _core_.wxEVT_IDLE
3733wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3734wxEVT_SIZING = _core_.wxEVT_SIZING
3735wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 3736wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
3737wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3738wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3739wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
54f9ee45
RD
3740wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3741wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3742wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3743wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3744wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3745wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3746wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d14a1e28
RD
3747#
3748# Create some event binders
3749EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3750EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3751EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3752EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3753EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3754EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3755EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3756EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3757EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3758EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3759EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3760EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3761EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 3762EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d14a1e28
RD
3763EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3764EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3765EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3766EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3767EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3768EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3769EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3770EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3771EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3772EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 3773EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d14a1e28
RD
3774EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3775EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3776EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3777EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3778EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3779EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3780EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3781EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3782EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3783EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3784EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3785EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3786EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3787EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3788EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3789EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
34e0a3bb 3790EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
d14a1e28
RD
3791
3792EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3793EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3794EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3795EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3796EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3797EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3798EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3799EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3800EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3801EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3802EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3803EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3804EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3805
3806EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3807 wxEVT_LEFT_UP,
3808 wxEVT_MIDDLE_DOWN,
3809 wxEVT_MIDDLE_UP,
3810 wxEVT_RIGHT_DOWN,
3811 wxEVT_RIGHT_UP,
3812 wxEVT_MOTION,
3813 wxEVT_LEFT_DCLICK,
3814 wxEVT_MIDDLE_DCLICK,
3815 wxEVT_RIGHT_DCLICK,
3816 wxEVT_ENTER_WINDOW,
3817 wxEVT_LEAVE_WINDOW,
3818 wxEVT_MOUSEWHEEL
3819 ])
3820
3821
3822# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 3823EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d14a1e28
RD
3824 wxEVT_SCROLLWIN_BOTTOM,
3825 wxEVT_SCROLLWIN_LINEUP,
3826 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 3827 wxEVT_SCROLLWIN_PAGEUP,
d14a1e28
RD
3828 wxEVT_SCROLLWIN_PAGEDOWN,
3829 wxEVT_SCROLLWIN_THUMBTRACK,
3830 wxEVT_SCROLLWIN_THUMBRELEASE,
3831 ])
3832
3833EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3834EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3835EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3836EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3837EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3838EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3839EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3840EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3841
27fb7603 3842# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
3843EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3844 wxEVT_SCROLL_BOTTOM,
3845 wxEVT_SCROLL_LINEUP,
3846 wxEVT_SCROLL_LINEDOWN,
3847 wxEVT_SCROLL_PAGEUP,
3848 wxEVT_SCROLL_PAGEDOWN,
3849 wxEVT_SCROLL_THUMBTRACK,
3850 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3851 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
3852 ])
3853
3854EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3855EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3856EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3857EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3858EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3859EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3860EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3861EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3862EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3863EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 3864
27fb7603 3865# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
3866EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3867 wxEVT_SCROLL_BOTTOM,
3868 wxEVT_SCROLL_LINEUP,
3869 wxEVT_SCROLL_LINEDOWN,
3870 wxEVT_SCROLL_PAGEUP,
3871 wxEVT_SCROLL_PAGEDOWN,
3872 wxEVT_SCROLL_THUMBTRACK,
d14a1e28 3873 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3874 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
3875 ], 1)
3876
3877EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3878EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3879EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3880EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3881EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3882EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3883EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3884EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3885EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3886EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d14a1e28 3887
d14a1e28
RD
3888EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3889EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3890EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3891EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3892EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3893EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3894EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3895EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3896EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3897EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3898
3899EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3900EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3901EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3902EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3903EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3904EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3905EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3906EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3907EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3908
3909
3910EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3911EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3912EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3913EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3914EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3915EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3916EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3917
3918EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3919
3920EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3921EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3922
3923EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3924
2131d850
RD
3925EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3926EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3927EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d14a1e28
RD
3928
3929
3930#---------------------------------------------------------------------------
3931
3932class Event(Object):
27fb7603
RD
3933 """
3934 An event is a structure holding information about an event passed to a
3935 callback or member function. wx.Event is an abstract base class for
3936 other event classes
3937 """
0085ce49
RD
3938 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3939 def __init__(self): raise AttributeError, "No constructor defined"
3940 __repr__ = _swig_repr
3941 __swig_destroy__ = _core_.delete_Event
3942 __del__ = lambda self : None;
e811c8ce 3943 def SetEventType(*args, **kwargs):
27fb7603 3944 """
2131d850 3945 SetEventType(self, EventType typ)
27fb7603
RD
3946
3947 Sets the specific type of the event.
3948 """
54f9ee45 3949 return _core_.Event_SetEventType(*args, **kwargs)
e811c8ce
RD
3950
3951 def GetEventType(*args, **kwargs):
27fb7603 3952 """
2131d850 3953 GetEventType(self) -> EventType
27fb7603
RD
3954
3955 Returns the identifier of the given event type, such as
3956 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3957 """
54f9ee45 3958 return _core_.Event_GetEventType(*args, **kwargs)
e811c8ce
RD
3959
3960 def GetEventObject(*args, **kwargs):
27fb7603
RD
3961 """
3962 GetEventObject(self) -> Object
3963
3964 Returns the object (usually a window) associated with the event, if
3965 any.
3966 """
54f9ee45 3967 return _core_.Event_GetEventObject(*args, **kwargs)
e811c8ce
RD
3968
3969 def SetEventObject(*args, **kwargs):
27fb7603
RD
3970 """
3971 SetEventObject(self, Object obj)
3972
3973 Sets the originating object, or in other words, obj is normally the
3974 object that is sending the event.
3975 """
54f9ee45 3976 return _core_.Event_SetEventObject(*args, **kwargs)
e811c8ce
RD
3977
3978 def GetTimestamp(*args, **kwargs):
a95a7133 3979 """GetTimestamp(self) -> long"""
54f9ee45 3980 return _core_.Event_GetTimestamp(*args, **kwargs)
e811c8ce
RD
3981
3982 def SetTimestamp(*args, **kwargs):
a95a7133 3983 """SetTimestamp(self, long ts=0)"""
54f9ee45 3984 return _core_.Event_SetTimestamp(*args, **kwargs)
e811c8ce
RD
3985
3986 def GetId(*args, **kwargs):
27fb7603
RD
3987 """
3988 GetId(self) -> int
3989
3990 Returns the identifier associated with this event, such as a button
3991 command id.
3992 """
54f9ee45 3993 return _core_.Event_GetId(*args, **kwargs)
e811c8ce
RD
3994
3995 def SetId(*args, **kwargs):
27fb7603
RD
3996 """
3997 SetId(self, int Id)
3998
3999 Set's the ID for the event. This is usually the ID of the window that
4000 is sending the event, but it can also be a command id from a menu
4001 item, etc.
4002 """
54f9ee45 4003 return _core_.Event_SetId(*args, **kwargs)
e811c8ce
RD
4004
4005 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
4006 """
4007 IsCommandEvent(self) -> bool
4008
4009 Returns true if the event is or is derived from `wx.CommandEvent` else
4010 it returns false. Note: Exists only for optimization purposes.
4011 """
54f9ee45 4012 return _core_.Event_IsCommandEvent(*args, **kwargs)
e811c8ce
RD
4013
4014 def Skip(*args, **kwargs):
51b83b37
RD
4015 """
4016 Skip(self, bool skip=True)
4017
4018 Called by an event handler, it controls whether additional event
4019 handlers bound to this event will be called after the current event
4020 handler returns. Skip(false) (the default setting) will prevent
4021 additional event handlers from being called and control will be
4022 returned to the sender of the event immediately after the current
4023 handler has finished. Skip(True) will cause the event processing
4024 system to continue searching for a handler function for this event.
4025
4026 """
54f9ee45 4027 return _core_.Event_Skip(*args, **kwargs)
e811c8ce
RD
4028
4029 def GetSkipped(*args, **kwargs):
27fb7603
RD
4030 """
4031 GetSkipped(self) -> bool
4032
4033 Returns true if the event handler should be skipped, false otherwise.
4034 :see: `Skip`
4035 """
54f9ee45 4036 return _core_.Event_GetSkipped(*args, **kwargs)
e811c8ce
RD
4037
4038 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
4039 """
4040 ShouldPropagate(self) -> bool
4041
4042 Test if this event should be propagated to the parent window or not,
4043 i.e. if the propagation level is currently greater than 0.
4044 """
54f9ee45 4045 return _core_.Event_ShouldPropagate(*args, **kwargs)
e811c8ce
RD
4046
4047 def StopPropagation(*args, **kwargs):
27fb7603
RD
4048 """
4049 StopPropagation(self) -> int
4050
4051 Stop the event from propagating to its parent window. Returns the old
4052 propagation level value which may be later passed to
4053 `ResumePropagation` to allow propagating the event again.
4054 """
54f9ee45 4055 return _core_.Event_StopPropagation(*args, **kwargs)
e811c8ce
RD
4056
4057 def ResumePropagation(*args, **kwargs):
27fb7603
RD
4058 """
4059 ResumePropagation(self, int propagationLevel)
4060
4061 Resume the event propagation by restoring the propagation level. (For
4062 example, you can use the value returned by an earlier call to
4063 `StopPropagation`.)
4064
4065 """
54f9ee45 4066 return _core_.Event_ResumePropagation(*args, **kwargs)
e811c8ce
RD
4067
4068 def Clone(*args, **kwargs):
a95a7133 4069 """Clone(self) -> Event"""
54f9ee45 4070 return _core_.Event_Clone(*args, **kwargs)
e811c8ce 4071
97ab0f6a
RD
4072 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
4073 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
4074 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
4075 Skipped = property(GetSkipped,doc="See `GetSkipped`")
4076 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
2131d850 4077_core_.Event_swigregister(Event)
d14a1e28
RD
4078
4079#---------------------------------------------------------------------------
4080
4081class PropagationDisabler(object):
27fb7603
RD
4082 """
4083 Helper class to temporarily change an event not to propagate. Simply
4084 create an instance of this class and then whe it is destroyed the
4085 propogation of the event will be restored.
4086 """
0085ce49
RD
4087 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4088 __repr__ = _swig_repr
4089 def __init__(self, *args, **kwargs):
27fb7603
RD
4090 """
4091 __init__(self, Event event) -> PropagationDisabler
4092
4093 Helper class to temporarily change an event not to propagate. Simply
4094 create an instance of this class and then whe it is destroyed the
4095 propogation of the event will be restored.
4096 """
0085ce49
RD
4097 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
4098 __swig_destroy__ = _core_.delete_PropagationDisabler
4099 __del__ = lambda self : None;
2131d850 4100_core_.PropagationDisabler_swigregister(PropagationDisabler)
d14a1e28
RD
4101
4102class PropagateOnce(object):
27fb7603
RD
4103 """
4104 A helper class that will temporarily lower propagation level of an
4105 event. Simply create an instance of this class and then whe it is
4106 destroyed the propogation of the event will be restored.
4107 """
0085ce49
RD
4108 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4109 __repr__ = _swig_repr
4110 def __init__(self, *args, **kwargs):
27fb7603
RD
4111 """
4112 __init__(self, Event event) -> PropagateOnce
4113
4114 A helper class that will temporarily lower propagation level of an
4115 event. Simply create an instance of this class and then whe it is
4116 destroyed the propogation of the event will be restored.
4117 """
0085ce49
RD
4118 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4119 __swig_destroy__ = _core_.delete_PropagateOnce
4120 __del__ = lambda self : None;
2131d850 4121_core_.PropagateOnce_swigregister(PropagateOnce)
d14a1e28
RD
4122
4123#---------------------------------------------------------------------------
4124
4125class CommandEvent(Event):
27fb7603
RD
4126 """
4127 This event class contains information about command events, which
4128 originate from a variety of simple controls, as well as menus and
4129 toolbars.
4130 """
0085ce49
RD
4131 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4132 __repr__ = _swig_repr
4133 def __init__(self, *args, **kwargs):
27fb7603 4134 """
2131d850 4135 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
4136
4137 This event class contains information about command events, which
4138 originate from a variety of simple controls, as well as menus and
4139 toolbars.
4140 """
0085ce49 4141 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
e811c8ce 4142 def GetSelection(*args, **kwargs):
27fb7603
RD
4143 """
4144 GetSelection(self) -> int
4145
4146 Returns item index for a listbox or choice selection event (not valid
4147 for a deselection).
4148 """
54f9ee45 4149 return _core_.CommandEvent_GetSelection(*args, **kwargs)
e811c8ce
RD
4150
4151 def SetString(*args, **kwargs):
a95a7133 4152 """SetString(self, String s)"""
54f9ee45 4153 return _core_.CommandEvent_SetString(*args, **kwargs)
e811c8ce
RD
4154
4155 def GetString(*args, **kwargs):
27fb7603
RD
4156 """
4157 GetString(self) -> String
4158
4159 Returns item string for a listbox or choice selection event (not valid
4160 for a deselection).
4161 """
54f9ee45 4162 return _core_.CommandEvent_GetString(*args, **kwargs)
e811c8ce
RD
4163
4164 def IsChecked(*args, **kwargs):
27fb7603
RD
4165 """
4166 IsChecked(self) -> bool
4167
4168 This method can be used with checkbox and menu events: for the
4169 checkboxes, the method returns true for a selection event and false
4170 for a deselection one. For the menu events, this method indicates if
4171 the menu item just has become checked or unchecked (and thus only
4172 makes sense for checkable menu items).
4173 """
54f9ee45 4174 return _core_.CommandEvent_IsChecked(*args, **kwargs)
e811c8ce 4175
242b7b46 4176 Checked = IsChecked
e811c8ce 4177 def IsSelection(*args, **kwargs):
27fb7603
RD
4178 """
4179 IsSelection(self) -> bool
4180
4181 For a listbox or similar event, returns true if it is a selection,
4182 false if it is a deselection.
4183 """
54f9ee45 4184 return _core_.CommandEvent_IsSelection(*args, **kwargs)
e811c8ce
RD
4185
4186 def SetExtraLong(*args, **kwargs):
a95a7133 4187 """SetExtraLong(self, long extraLong)"""
54f9ee45 4188 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
e811c8ce
RD
4189
4190 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4191 """
4192 GetExtraLong(self) -> long
4193
5ba5649b
RD
4194 Returns extra information dependant on the event objects type. If the
4195 event comes from a listbox selection, it is a boolean determining
4196 whether the event was a selection (true) or a deselection (false). A
4197 listbox deselection only occurs for multiple-selection boxes, and in
4198 this case the index and string values are indeterminate and the
4199 listbox must be examined by the application.
27fb7603 4200 """
54f9ee45 4201 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
e811c8ce
RD
4202
4203 def SetInt(*args, **kwargs):
a95a7133 4204 """SetInt(self, int i)"""
54f9ee45 4205 return _core_.CommandEvent_SetInt(*args, **kwargs)
e811c8ce
RD
4206
4207 def GetInt(*args, **kwargs):
27fb7603 4208 """
01f6b6d3 4209 GetInt(self) -> int
27fb7603 4210
5ba5649b
RD
4211 Returns the integer identifier corresponding to a listbox, choice or
4212 radiobox selection (only if the event was a selection, not a
4213 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4214 """
54f9ee45 4215 return _core_.CommandEvent_GetInt(*args, **kwargs)
e811c8ce 4216
0085ce49
RD
4217 def GetClientData(*args, **kwargs):
4218 """
4219 GetClientData(self) -> PyObject
4220
4221 Returns the client data object for a listbox or choice selection event, (if any.)
4222 """
4223 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4224
4225 def SetClientData(*args, **kwargs):
4226 """
4227 SetClientData(self, PyObject clientData)
4228
4229 Associate the given client data with the item at position n.
4230 """
4231 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4232
4233 GetClientObject = GetClientData
4234 SetClientObject = SetClientData
4235
e811c8ce 4236 def Clone(*args, **kwargs):
a95a7133 4237 """Clone(self) -> Event"""
54f9ee45 4238 return _core_.CommandEvent_Clone(*args, **kwargs)
e811c8ce 4239
2bf58437
RD
4240 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4241 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4242 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4243 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4244 Selection = property(GetSelection,doc="See `GetSelection`")
4245 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
2131d850 4246_core_.CommandEvent_swigregister(CommandEvent)
d14a1e28
RD
4247
4248#---------------------------------------------------------------------------
4249
4250class NotifyEvent(CommandEvent):
27fb7603
RD
4251 """
4252 An instance of this class (or one of its derived classes) is sent from
4253 a control when the control's state is being changed and the control
4254 allows that change to be prevented from happening. The event handler
4255 can call `Veto` or `Allow` to tell the control what to do.
4256 """
0085ce49
RD
4257 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4258 __repr__ = _swig_repr
4259 def __init__(self, *args, **kwargs):
27fb7603 4260 """
2131d850 4261 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4262
4263 An instance of this class (or one of its derived classes) is sent from
4264 a control when the control's state is being changed and the control
4265 allows that change to be prevented from happening. The event handler
4266 can call `Veto` or `Allow` to tell the control what to do.
4267 """
0085ce49 4268 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
e811c8ce 4269 def Veto(*args, **kwargs):
27fb7603
RD
4270 """
4271 Veto(self)
4272
4273 Prevents the change announced by this event from happening.
4274
4275 It is in general a good idea to notify the user about the reasons for
4276 vetoing the change because otherwise the applications behaviour (which
4277 just refuses to do what the user wants) might be quite surprising.
4278 """
54f9ee45 4279 return _core_.NotifyEvent_Veto(*args, **kwargs)
e811c8ce
RD
4280
4281 def Allow(*args, **kwargs):
27fb7603
RD
4282 """
4283 Allow(self)
4284
4285 This is the opposite of `Veto`: it explicitly allows the event to be
4286 processed. For most events it is not necessary to call this method as
4287 the events are allowed anyhow but some are forbidden by default (this
4288 will be mentioned in the corresponding event description).
4289 """
54f9ee45 4290 return _core_.NotifyEvent_Allow(*args, **kwargs)
e811c8ce
RD
4291
4292 def IsAllowed(*args, **kwargs):
27fb7603
RD
4293 """
4294 IsAllowed(self) -> bool
4295
4296 Returns true if the change is allowed (`Veto` hasn't been called) or
4297 false otherwise (if it was).
4298 """
54f9ee45 4299 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
e811c8ce 4300
2131d850 4301_core_.NotifyEvent_swigregister(NotifyEvent)
d14a1e28
RD
4302
4303#---------------------------------------------------------------------------
4304
4305class ScrollEvent(CommandEvent):
27fb7603
RD
4306 """
4307 A scroll event holds information about events sent from stand-alone
4308 scrollbars and sliders. Note that scrolled windows do not send
4309 instnaces of this event class, but send the `wx.ScrollWinEvent`
4310 instead.
4311 """
0085ce49
RD
4312 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4313 __repr__ = _swig_repr
4314 def __init__(self, *args, **kwargs):
0df68c9f 4315 """
2131d850 4316 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
0df68c9f
RD
4317 int orient=0) -> ScrollEvent
4318 """
0085ce49 4319 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
e811c8ce 4320 def GetOrientation(*args, **kwargs):
27fb7603
RD
4321 """
4322 GetOrientation(self) -> int
4323
4324 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4325 the scrollbar.
4326 """
54f9ee45 4327 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4328
4329 def GetPosition(*args, **kwargs):
27fb7603
RD
4330 """
4331 GetPosition(self) -> int
4332
4333 Returns the position of the scrollbar.
4334 """
54f9ee45 4335 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4336
4337 def SetOrientation(*args, **kwargs):
a95a7133 4338 """SetOrientation(self, int orient)"""
54f9ee45 4339 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4340
4341 def SetPosition(*args, **kwargs):
a95a7133 4342 """SetPosition(self, int pos)"""
54f9ee45 4343 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
e811c8ce 4344
33d6fd3b
RD
4345 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4346 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4347_core_.ScrollEvent_swigregister(ScrollEvent)
d14a1e28
RD
4348
4349#---------------------------------------------------------------------------
4350
4351class ScrollWinEvent(Event):
27fb7603
RD
4352 """
4353 A wx.ScrollWinEvent holds information about scrolling and is sent from
4354 scrolling windows.
4355 """
0085ce49
RD
4356 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4357 __repr__ = _swig_repr
4358 def __init__(self, *args, **kwargs):
27fb7603 4359 """
2131d850 4360 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4361
4362 A wx.ScrollWinEvent holds information about scrolling and is sent from
4363 scrolling windows.
4364 """
0085ce49 4365 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
e811c8ce 4366 def GetOrientation(*args, **kwargs):
27fb7603
RD
4367 """
4368 GetOrientation(self) -> int
4369
4370 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4371 the scrollbar.
4372 """
54f9ee45 4373 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4374
4375 def GetPosition(*args, **kwargs):
27fb7603
RD
4376 """
4377 GetPosition(self) -> int
4378
4379 Returns the position of the scrollbar for the thumb track and release
4380 events. Note that this field can't be used for the other events, you
4381 need to query the window itself for the current position in that case.
4382 """
54f9ee45 4383 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4384
4385 def SetOrientation(*args, **kwargs):
a95a7133 4386 """SetOrientation(self, int orient)"""
54f9ee45 4387 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4388
4389 def SetPosition(*args, **kwargs):
a95a7133 4390 """SetPosition(self, int pos)"""
54f9ee45 4391 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
e811c8ce 4392
33d6fd3b
RD
4393 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4394 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4395_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d14a1e28
RD
4396
4397#---------------------------------------------------------------------------
4398
54f9ee45
RD
4399MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4400MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4401MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4402MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4403MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
d14a1e28 4404class MouseEvent(Event):
27fb7603
RD
4405 """
4406 This event class contains information about the events generated by
4407 the mouse: they include mouse buttons press and release events and
4408 mouse move events.
4409
4410 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4411 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4412 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4413 a middle button so a portable application should avoid relying on the
4414 events from it.
4415
4416 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4417 the former returns true when the event corresponds to the left mouse
4418 button click while the latter returns true if the left mouse button is
4419 currently being pressed. For example, when the user is dragging the
4420 mouse you can use `LeftIsDown` to test whether the left mouse button
4421 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4422 `LeftIsDown` will also return true in wxWidgets whatever the
4423 underlying GUI behaviour is (which is platform-dependent). The same
4424 applies, of course, to other mouse buttons as well.
4425 """
0085ce49
RD
4426 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4427 __repr__ = _swig_repr
4428 def __init__(self, *args, **kwargs):
27fb7603 4429 """
2131d850 4430 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4431
4432 Constructs a wx.MouseEvent. Valid event types are:
4433
4434 * wxEVT_ENTER_WINDOW
4435 * wxEVT_LEAVE_WINDOW
4436 * wxEVT_LEFT_DOWN
4437 * wxEVT_LEFT_UP
4438 * wxEVT_LEFT_DCLICK
4439 * wxEVT_MIDDLE_DOWN
4440 * wxEVT_MIDDLE_UP
4441 * wxEVT_MIDDLE_DCLICK
4442 * wxEVT_RIGHT_DOWN
4443 * wxEVT_RIGHT_UP
4444 * wxEVT_RIGHT_DCLICK
4445 * wxEVT_MOTION
4446 * wxEVT_MOUSEWHEEL
4447 """
0085ce49 4448 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
e811c8ce 4449 def IsButton(*args, **kwargs):
27fb7603
RD
4450 """
4451 IsButton(self) -> bool
4452
4453 Returns true if the event was a mouse button event (not necessarily a
4454 button down event - that may be tested using `ButtonDown`).
4455 """
54f9ee45 4456 return _core_.MouseEvent_IsButton(*args, **kwargs)
e811c8ce
RD
4457
4458 def ButtonDown(*args, **kwargs):
27fb7603
RD
4459 """
4460 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4461
5ba5649b
RD
4462 If the argument is omitted, this returns true if the event was any
4463 mouse button down event. Otherwise the argument specifies which
4464 button-down event shold be checked for (see `Button` for the possible
4465 values).
27fb7603 4466 """
54f9ee45 4467 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
e811c8ce
RD
4468
4469 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4470 """
4471 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4472
4473 If the argument is omitted, this returns true if the event was any
4474 mouse double click event. Otherwise the argument specifies which
4475 double click event to check for (see `Button` for the possible
4476 values).
4477 """
54f9ee45 4478 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
e811c8ce
RD
4479
4480 def ButtonUp(*args, **kwargs):
27fb7603
RD
4481 """
4482 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4483
4484 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4485 mouse button up event. Otherwise the argument specifies which button
4486 up event to check for (see `Button` for the possible values).
27fb7603 4487 """
54f9ee45 4488 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
e811c8ce
RD
4489
4490 def Button(*args, **kwargs):
27fb7603
RD
4491 """
4492 Button(self, int button) -> bool
4493
4494 Returns true if the identified mouse button is changing state. Valid
4495 values of button are:
4496
4497 ==================== =====================================
4498 wx.MOUSE_BTN_LEFT check if left button was pressed
4499 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4500 wx.MOUSE_BTN_RIGHT check if right button was pressed
4501 wx.MOUSE_BTN_ANY check if any button was pressed
4502 ==================== =====================================
4503
4504 """
54f9ee45 4505 return _core_.MouseEvent_Button(*args, **kwargs)
e811c8ce
RD
4506
4507 def ButtonIsDown(*args, **kwargs):
a95a7133 4508 """ButtonIsDown(self, int but) -> bool"""
54f9ee45 4509 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
e811c8ce
RD
4510
4511 def GetButton(*args, **kwargs):
27fb7603
RD
4512 """
4513 GetButton(self) -> int
4514
4515 Returns the mouse button which generated this event or
4516 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4517 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4518 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4519 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4520 right buttons respectively.
4521 """
54f9ee45 4522 return _core_.MouseEvent_GetButton(*args, **kwargs)
e811c8ce
RD
4523
4524 def ControlDown(*args, **kwargs):
27fb7603
RD
4525 """
4526 ControlDown(self) -> bool
4527
4528 Returns true if the control key was down at the time of the event.
4529 """
54f9ee45 4530 return _core_.MouseEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
4531
4532 def MetaDown(*args, **kwargs):
27fb7603
RD
4533 """
4534 MetaDown(self) -> bool
4535
4536 Returns true if the Meta key was down at the time of the event.
4537 """
54f9ee45 4538 return _core_.MouseEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
4539
4540 def AltDown(*args, **kwargs):
27fb7603
RD
4541 """
4542 AltDown(self) -> bool
4543
4544 Returns true if the Alt key was down at the time of the event.
4545 """
54f9ee45 4546 return _core_.MouseEvent_AltDown(*args, **kwargs)
e811c8ce
RD
4547
4548 def ShiftDown(*args, **kwargs):
27fb7603
RD
4549 """
4550 ShiftDown(self) -> bool
4551
4552 Returns true if the Shift key was down at the time of the event.
4553 """
54f9ee45 4554 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
e811c8ce 4555
412d302d
RD
4556 def CmdDown(*args, **kwargs):
4557 """
4558 CmdDown(self) -> bool
4559
4560 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4561 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4562 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4563 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4564 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4565 purpose. So for non-Mac platforms this is the same as `ControlDown`
4566 and Macs this is the same as `MetaDown`.
4567 """
4568 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4569
e811c8ce 4570 def LeftDown(*args, **kwargs):
27fb7603
RD
4571 """
4572 LeftDown(self) -> bool
4573
4574 Returns true if the left mouse button state changed to down.
4575 """
54f9ee45 4576 return _core_.MouseEvent_LeftDown(*args, **kwargs)
e811c8ce
RD
4577
4578 def MiddleDown(*args, **kwargs):
27fb7603
RD
4579 """
4580 MiddleDown(self) -> bool
4581
4582 Returns true if the middle mouse button state changed to down.
4583 """
54f9ee45 4584 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
e811c8ce
RD
4585
4586 def RightDown(*args, **kwargs):
27fb7603
RD
4587 """
4588 RightDown(self) -> bool
4589
4590 Returns true if the right mouse button state changed to down.
4591 """
54f9ee45 4592 return _core_.MouseEvent_RightDown(*args, **kwargs)
e811c8ce
RD
4593
4594 def LeftUp(*args, **kwargs):
27fb7603
RD
4595 """
4596 LeftUp(self) -> bool
4597
4598 Returns true if the left mouse button state changed to up.
4599 """
54f9ee45 4600 return _core_.MouseEvent_LeftUp(*args, **kwargs)
e811c8ce
RD
4601
4602 def MiddleUp(*args, **kwargs):
27fb7603
RD
4603 """
4604 MiddleUp(self) -> bool
4605
4606 Returns true if the middle mouse button state changed to up.
4607 """
54f9ee45 4608 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
e811c8ce
RD
4609
4610 def RightUp(*args, **kwargs):
27fb7603
RD
4611 """
4612 RightUp(self) -> bool
4613
4614 Returns true if the right mouse button state changed to up.
4615 """
54f9ee45 4616 return _core_.MouseEvent_RightUp(*args, **kwargs)
e811c8ce
RD
4617
4618 def LeftDClick(*args, **kwargs):
27fb7603
RD
4619 """
4620 LeftDClick(self) -> bool
4621
4622 Returns true if the event was a left button double click.
4623 """
54f9ee45 4624 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
e811c8ce
RD
4625
4626 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4627 """
4628 MiddleDClick(self) -> bool
4629
4630 Returns true if the event was a middle button double click.
4631 """
54f9ee45 4632 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
e811c8ce
RD
4633
4634 def RightDClick(*args, **kwargs):
27fb7603
RD
4635 """
4636 RightDClick(self) -> bool
4637
4638 Returns true if the event was a right button double click.
4639 """
54f9ee45 4640 return _core_.MouseEvent_RightDClick(*args, **kwargs)
e811c8ce
RD
4641
4642 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4643 """
4644 LeftIsDown(self) -> bool
4645
4646 Returns true if the left mouse button is currently down, independent
4647 of the current event type.
4648
4649 Please notice that it is not the same as LeftDown which returns true
4650 if the left mouse button was just pressed. Rather, it describes the
4651 state of the mouse button before the event happened.
4652
4653 This event is usually used in the mouse event handlers which process
4654 "move mouse" messages to determine whether the user is (still)
4655 dragging the mouse.
4656 """
54f9ee45 4657 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
e811c8ce
RD
4658
4659 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4660 """
4661 MiddleIsDown(self) -> bool
4662
4663 Returns true if the middle mouse button is currently down, independent
4664 of the current event type.
4665 """
54f9ee45 4666 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
e811c8ce
RD
4667
4668 def RightIsDown(*args, **kwargs):
27fb7603
RD
4669 """
4670 RightIsDown(self) -> bool
4671
4672 Returns true if the right mouse button is currently down, independent
4673 of the current event type.
4674 """
54f9ee45 4675 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
e811c8ce
RD
4676
4677 def Dragging(*args, **kwargs):
27fb7603
RD
4678 """
4679 Dragging(self) -> bool
4680
4681 Returns true if this was a dragging event (motion while a button is
4682 depressed).
4683 """
54f9ee45 4684 return _core_.MouseEvent_Dragging(*args, **kwargs)
e811c8ce
RD
4685
4686 def Moving(*args, **kwargs):
27fb7603
RD
4687 """
4688 Moving(self) -> bool
4689
4690 Returns true if this was a motion event and no mouse buttons were
4691 pressed. If any mouse button is held pressed, then this method returns
4692 false and Dragging returns true.
4693 """
54f9ee45 4694 return _core_.MouseEvent_Moving(*args, **kwargs)
e811c8ce
RD
4695
4696 def Entering(*args, **kwargs):
27fb7603
RD
4697 """
4698 Entering(self) -> bool
4699
4700 Returns true if the mouse was entering the window.
4701 """
54f9ee45 4702 return _core_.MouseEvent_Entering(*args, **kwargs)
e811c8ce
RD
4703
4704 def Leaving(*args, **kwargs):
27fb7603
RD
4705 """
4706 Leaving(self) -> bool
4707
4708 Returns true if the mouse was leaving the window.
4709 """
54f9ee45 4710 return _core_.MouseEvent_Leaving(*args, **kwargs)
e811c8ce
RD
4711
4712 def GetPosition(*args, **kwargs):
0df68c9f 4713 """
a95a7133 4714 GetPosition(self) -> Point
e811c8ce 4715
27fb7603
RD
4716 Returns the pixel position of the mouse in window coordinates when the
4717 event happened.
0df68c9f 4718 """
54f9ee45 4719 return _core_.MouseEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4720
4721 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
4722 """
4723 GetPositionTuple() -> (x,y)
e811c8ce 4724
27fb7603
RD
4725 Returns the pixel position of the mouse in window coordinates when the
4726 event happened.
0df68c9f 4727 """
54f9ee45 4728 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
4729
4730 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4731 """
4732 GetLogicalPosition(self, DC dc) -> Point
4733
4734 Returns the logical mouse position in pixels (i.e. translated
4735 according to the translation set for the DC, which usually indicates
4736 that the window has been scrolled).
4737 """
54f9ee45 4738 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
e811c8ce
RD
4739
4740 def GetX(*args, **kwargs):
27fb7603
RD
4741 """
4742 GetX(self) -> int
4743
4744 Returns X coordinate of the physical mouse event position.
4745 """
54f9ee45 4746 return _core_.MouseEvent_GetX(*args, **kwargs)
e811c8ce
RD
4747
4748 def GetY(*args, **kwargs):
27fb7603
RD
4749 """
4750 GetY(self) -> int
4751
4752 Returns Y coordinate of the physical mouse event position.
4753 """
54f9ee45 4754 return _core_.MouseEvent_GetY(*args, **kwargs)
e811c8ce
RD
4755
4756 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4757 """
4758 GetWheelRotation(self) -> int
4759
4760 Get wheel rotation, positive or negative indicates direction of
4761 rotation. Current devices all send an event when rotation is equal to
4762 +/-WheelDelta, but this allows for finer resolution devices to be
4763 created in the future. Because of this you shouldn't assume that one
4764 event is equal to 1 line or whatever, but you should be able to either
4765 do partial line scrolling or wait until +/-WheelDelta rotation values
4766 have been accumulated before scrolling.
4767 """
54f9ee45 4768 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
e811c8ce
RD
4769
4770 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4771 """
4772 GetWheelDelta(self) -> int
4773
4774 Get wheel delta, normally 120. This is the threshold for action to be
4775 taken, and one such action (for example, scrolling one increment)
4776 should occur for each delta.
4777 """
54f9ee45 4778 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
e811c8ce
RD
4779
4780 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4781 """
4782 GetLinesPerAction(self) -> int
4783
4784 Returns the configured number of lines (or whatever) to be scrolled
4785 per wheel action. Defaults to three.
4786 """
54f9ee45 4787 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
e811c8ce
RD
4788
4789 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4790 """
4791 IsPageScroll(self) -> bool
4792
4793 Returns true if the system has been setup to do page scrolling with
4794 the mouse wheel instead of line scrolling.
4795 """
54f9ee45
RD
4796 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4797
4798 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4799 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4800 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4801 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4802 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4803 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4804 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4805 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4806 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4807 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4808 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4809 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
57332a5a
RD
4810 Button = property(GetButton,doc="See `GetButton`")
4811 LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`")
4812 LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`")
4813 Position = property(GetPosition,doc="See `GetPosition`")
4814 WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`")
4815 WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`")
4816 X = property(GetX,doc="See `GetX`")
4817 Y = property(GetY,doc="See `GetY`")
2131d850 4818_core_.MouseEvent_swigregister(MouseEvent)
d14a1e28
RD
4819
4820#---------------------------------------------------------------------------
4821
4822class SetCursorEvent(Event):
5ba5649b
RD
4823 """
4824 A SetCursorEvent is generated when the mouse cursor is about to be set
4825 as a result of mouse motion. This event gives the application the
4826 chance to perform specific mouse cursor processing based on the
4827 current position of the mouse within the window. Use the `SetCursor`
4828 method to specify the cursor you want to be displayed.
4829 """
0085ce49
RD
4830 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4831 __repr__ = _swig_repr
4832 def __init__(self, *args, **kwargs):
5ba5649b
RD
4833 """
4834 __init__(self, int x=0, int y=0) -> SetCursorEvent
4835
4836 Construct a new `wx.SetCursorEvent`.
4837 """
0085ce49 4838 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
e811c8ce 4839 def GetX(*args, **kwargs):
5ba5649b
RD
4840 """
4841 GetX(self) -> int
4842
4843 Returns the X coordinate of the mouse in client coordinates.
4844 """
54f9ee45 4845 return _core_.SetCursorEvent_GetX(*args, **kwargs)
e811c8ce
RD
4846
4847 def GetY(*args, **kwargs):
5ba5649b
RD
4848 """
4849 GetY(self) -> int
4850
4851 Returns the Y coordinate of the mouse in client coordinates.
4852 """
54f9ee45 4853 return _core_.SetCursorEvent_GetY(*args, **kwargs)
e811c8ce
RD
4854
4855 def SetCursor(*args, **kwargs):
5ba5649b
RD
4856 """
4857 SetCursor(self, Cursor cursor)
4858
4859 Sets the cursor associated with this event.
4860 """
54f9ee45 4861 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
e811c8ce
RD
4862
4863 def GetCursor(*args, **kwargs):
5ba5649b
RD
4864 """
4865 GetCursor(self) -> Cursor
4866
4867 Returns a reference to the cursor specified by this event.
4868 """
54f9ee45 4869 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
e811c8ce
RD
4870
4871 def HasCursor(*args, **kwargs):
5ba5649b
RD
4872 """
4873 HasCursor(self) -> bool
4874
4875 Returns true if the cursor specified by this event is a valid cursor.
4876 """
54f9ee45 4877 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
e811c8ce 4878
33d6fd3b
RD
4879 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
4880 X = property(GetX,doc="See `GetX`")
4881 Y = property(GetY,doc="See `GetY`")
2131d850 4882_core_.SetCursorEvent_swigregister(SetCursorEvent)
d14a1e28
RD
4883
4884#---------------------------------------------------------------------------
4885
4886class KeyEvent(Event):
5ba5649b
RD
4887 """
4888 This event class contains information about keypress and character
4889 events. These events are only sent to the widget that currently has
4890 the keyboard focus.
4891
4892 Notice that there are three different kinds of keyboard events in
4893 wxWidgets: key down and up events and char events. The difference
4894 between the first two is clear - the first corresponds to a key press
4895 and the second to a key release - otherwise they are identical. Just
4896 note that if the key is maintained in a pressed state you will
4897 typically get a lot of (automatically generated) down events but only
4898 one up so it is wrong to assume that there is one up event
4899 corresponding to each down one.
4900
4901 Both key events provide untranslated key codes while the char event
4902 carries the translated one. The untranslated code for alphanumeric
4903 keys is always an upper case value. For the other keys it is one of
4904 WXK_XXX values from the keycodes table. The translated key is, in
4905 general, the character the user expects to appear as the result of the
4906 key combination when typing the text into a text entry zone, for
4907 example.
4908
4909 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4910 and the standard US keyboard): when the 'A' key is pressed, the key
4911 down event key code is equal to ASCII A == 65. But the char event key
4912 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4913 'A' keys simultaneously , the key code in key down event will still be
4914 just 'A' while the char event key code parameter will now be 'A' as
4915 well.
4916
4917 Although in this simple case it is clear that the correct key code
4918 could be found in the key down event handler by checking the value
4919 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4920 as for non alphanumeric keys or non-US keyboard layouts the
4921 translation is keyboard-layout dependent and can only be done properly
4922 by the system itself.
4923
4924 Another kind of translation is done when the control key is pressed:
4925 for example, for CTRL-A key press the key down event still carries the
4926 same key code 'A' as usual but the char event will have key code of 1,
4927 the ASCII value of this key combination.
4928
4929 You may discover how the other keys on your system behave
4930 interactively by running the KeyEvents sample in the wxPython demo and
4931 pressing some keys while the blue box at the top has the keyboard
4932 focus.
4933
4934 **Note**: If a key down event is caught and the event handler does not
4935 call event.Skip() then the coresponding char event will not
4936 happen. This is by design and enables the programs that handle both
4937 types of events to be a bit simpler.
4938
4939 **Note for Windows programmers**: The key and char events in wxWidgets
4940 are similar to but slightly different from Windows WM_KEYDOWN and
4941 WM_CHAR events. In particular, Alt-x combination will generate a char
4942 event in wxWidgets (unless it is used as an accelerator).
4943
4944 **Tip**: be sure to call event.Skip() for events that you don't
4945 process in key event function, otherwise menu shortcuts may cease to
4946 work under Windows.
4947
4948 """
0085ce49
RD
4949 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4950 __repr__ = _swig_repr
4951 def __init__(self, *args, **kwargs):
5ba5649b 4952 """
2131d850 4953 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
4954
4955 Construct a new `wx.KeyEvent`. Valid event types are:
4956 *
4957 """
0085ce49 4958 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
4959 def GetModifiers(*args, **kwargs):
4960 """
4961 GetModifiers(self) -> int
4962
4963 Returns a bitmask of the current modifier settings. Can be used to
4964 check if the key event has exactly the given modifiers without having
4965 to explicitly check that the other modifiers are not down. For
4966 example::
4967
4968 if event.GetModifers() == wx.MOD_CONTROL:
4969 DoSomething()
4970
4971 """
4972 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4973
e811c8ce 4974 def ControlDown(*args, **kwargs):
5ba5649b
RD
4975 """
4976 ControlDown(self) -> bool
4977
4978 Returns ``True`` if the Control key was down at the time of the event.
4979 """
54f9ee45 4980 return _core_.KeyEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
4981
4982 def MetaDown(*args, **kwargs):
5ba5649b
RD
4983 """
4984 MetaDown(self) -> bool
4985
4986 Returns ``True`` if the Meta key was down at the time of the event.
4987 """
54f9ee45 4988 return _core_.KeyEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
4989
4990 def AltDown(*args, **kwargs):
5ba5649b
RD
4991 """
4992 AltDown(self) -> bool
4993
4994 Returns ``True`` if the Alt key was down at the time of the event.
4995 """
54f9ee45 4996 return _core_.KeyEvent_AltDown(*args, **kwargs)
e811c8ce
RD
4997
4998 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4999 """
5000 ShiftDown(self) -> bool
5001
5002 Returns ``True`` if the Shift key was down at the time of the event.
5003 """
54f9ee45 5004 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
e811c8ce 5005
412d302d
RD
5006 def CmdDown(*args, **kwargs):
5007 """
5008 CmdDown(self) -> bool
5009
5010 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5011 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 5012 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
5013 because Cmd key is used for the same thing under Mac as Ctrl
5014 elsewhere. The Ctrl still exists, it's just not used for this
5015 purpose. So for non-Mac platforms this is the same as `ControlDown`
5016 and Macs this is the same as `MetaDown`.
5017 """
5018 return _core_.KeyEvent_CmdDown(*args, **kwargs)
5019
e811c8ce 5020 def HasModifiers(*args, **kwargs):
5ba5649b
RD
5021 """
5022 HasModifiers(self) -> bool
5023
5024 Returns true if either CTRL or ALT keys was down at the time of the
5025 key event. Note that this function does not take into account neither
5026 SHIFT nor META key states (the reason for ignoring the latter is that
5027 it is common for NUMLOCK key to be configured as META under X but the
5028 key presses even while NUMLOCK is on should be still processed
5029 normally).
5030 """
54f9ee45 5031 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
e811c8ce
RD
5032
5033 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
5034 """
5035 GetKeyCode(self) -> int
5036
5037 Returns the virtual key code. ASCII events return normal ASCII values,
5038 while non-ASCII events return values such as WXK_LEFT for the left
5039 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5040 codes.
5041
5042 Note that in Unicode build, the returned value is meaningful only if
5043 the user entered a character that can be represented in current
5044 locale's default charset. You can obtain the corresponding Unicode
5045 character using `GetUnicodeKey`.
5046 """
54f9ee45 5047 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
e811c8ce 5048
19272049 5049 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
5050 """
5051 GetUnicodeKey(self) -> int
5052
5053 Returns the Unicode character corresponding to this key event. This
5054 function is only meaningfule in a Unicode build of wxPython.
5055 """
19272049 5056 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
e811c8ce 5057
19272049 5058 GetUniChar = GetUnicodeKey
b850e7f3
RD
5059 def SetUnicodeKey(*args, **kwargs):
5060 """
5061 SetUnicodeKey(self, int uniChar)
5062
5063 Set the Unicode value of the key event, but only if this is a Unicode
5064 build of wxPython.
5065 """
5066 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
5067
e811c8ce 5068 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
5069 """
5070 GetRawKeyCode(self) -> unsigned int
5071
5072 Returns the raw key code for this event. This is a platform-dependent
5073 scan code which should only be used in advanced
5074 applications. Currently the raw key codes are not supported by all
5075 ports.
5076 """
54f9ee45 5077 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
e811c8ce
RD
5078
5079 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
5080 """
5081 GetRawKeyFlags(self) -> unsigned int
5082
5083 Returns the low level key flags for this event. The flags are
5084 platform-dependent and should only be used in advanced applications.
5085 Currently the raw key flags are not supported by all ports.
5086 """
54f9ee45 5087 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
e811c8ce
RD
5088
5089 def GetPosition(*args, **kwargs):
0df68c9f 5090 """
a95a7133 5091 GetPosition(self) -> Point
e811c8ce 5092
5ba5649b 5093 Find the position of the event, if applicable.
0df68c9f 5094 """
54f9ee45 5095 return _core_.KeyEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5096
5097 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
5098 """
5099 GetPositionTuple() -> (x,y)
e811c8ce 5100
5ba5649b 5101 Find the position of the event, if applicable.
0df68c9f 5102 """
54f9ee45 5103 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
5104
5105 def GetX(*args, **kwargs):
5ba5649b
RD
5106 """
5107 GetX(self) -> int
5108
5109 Returns the X position (in client coordinates) of the event, if
5110 applicable.
5111 """
54f9ee45 5112 return _core_.KeyEvent_GetX(*args, **kwargs)
e811c8ce
RD
5113
5114 def GetY(*args, **kwargs):
5ba5649b
RD
5115 """
5116 GetY(self) -> int
5117
5118 Returns the Y position (in client coordinates) of the event, if
5119 applicable.
5120 """
54f9ee45
RD
5121 return _core_.KeyEvent_GetY(*args, **kwargs)
5122
5123 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5124 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5125 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5126 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5127 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5128 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5129 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5130 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5131 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5132 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
97ab0f6a
RD
5133 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5134 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5135 Position = property(GetPosition,doc="See `GetPosition`")
5136 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5137 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5138 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5139 X = property(GetX,doc="See `GetX`")
5140 Y = property(GetY,doc="See `GetY`")
2131d850 5141_core_.KeyEvent_swigregister(KeyEvent)
d14a1e28
RD
5142
5143#---------------------------------------------------------------------------
5144
5145class SizeEvent(Event):
5ba5649b
RD
5146 """
5147 A size event holds information about size change events. The EVT_SIZE
5148 handler function will be called when the window it is bound to has
5149 been resized.
5150
5151 Note that the size passed is of the whole window: call
5152 `wx.Window.GetClientSize` for the area which may be used by the
5153 application.
5154
5155 When a window is resized, usually only a small part of the window is
5156 damaged and and that area is all that is in the update region for the
5157 next paint event. However, if your drawing depends on the size of the
5158 window, you may need to clear the DC explicitly and repaint the whole
5159 window. In which case, you may need to call `wx.Window.Refresh` to
5160 invalidate the entire window.
5161
5162 """
0085ce49
RD
5163 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5164 __repr__ = _swig_repr
5165 def __init__(self, *args, **kwargs):
5ba5649b
RD
5166 """
5167 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5168
5169 Construct a new ``wx.SizeEvent``.
5170 """
0085ce49 5171 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
e811c8ce 5172 def GetSize(*args, **kwargs):
5ba5649b
RD
5173 """
5174 GetSize(self) -> Size
5175
5176 Returns the entire size of the window generating the size change
5177 event.
5178 """
54f9ee45 5179 return _core_.SizeEvent_GetSize(*args, **kwargs)
e811c8ce
RD
5180
5181 def GetRect(*args, **kwargs):
a95a7133 5182 """GetRect(self) -> Rect"""
54f9ee45 5183 return _core_.SizeEvent_GetRect(*args, **kwargs)
e811c8ce
RD
5184
5185 def SetRect(*args, **kwargs):
a95a7133 5186 """SetRect(self, Rect rect)"""
54f9ee45 5187 return _core_.SizeEvent_SetRect(*args, **kwargs)
e811c8ce
RD
5188
5189 def SetSize(*args, **kwargs):
a95a7133 5190 """SetSize(self, Size size)"""
54f9ee45 5191 return _core_.SizeEvent_SetSize(*args, **kwargs)
e811c8ce 5192
54f9ee45
RD
5193 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5194 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
33d6fd3b
RD
5195 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5196 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
2131d850 5197_core_.SizeEvent_swigregister(SizeEvent)
d14a1e28
RD
5198
5199#---------------------------------------------------------------------------
5200
5201class MoveEvent(Event):
5ba5649b
RD
5202 """
5203 This event object is sent for EVT_MOVE event bindings when a window is
5204 moved to a new position.
5205 """
0085ce49
RD
5206 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5207 __repr__ = _swig_repr
5208 def __init__(self, *args, **kwargs):
5ba5649b
RD
5209 """
5210 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5211
5212 Constructor.
5213 """
0085ce49 5214 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
e811c8ce 5215 def GetPosition(*args, **kwargs):
5ba5649b
RD
5216 """
5217 GetPosition(self) -> Point
5218
5219 Returns the position of the window generating the move change event.
5220 """
54f9ee45 5221 return _core_.MoveEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5222
5223 def GetRect(*args, **kwargs):
a95a7133 5224 """GetRect(self) -> Rect"""
54f9ee45 5225 return _core_.MoveEvent_GetRect(*args, **kwargs)
e811c8ce
RD
5226
5227 def SetRect(*args, **kwargs):
a95a7133 5228 """SetRect(self, Rect rect)"""
54f9ee45 5229 return _core_.MoveEvent_SetRect(*args, **kwargs)
e811c8ce
RD
5230
5231 def SetPosition(*args, **kwargs):
a95a7133 5232 """SetPosition(self, Point pos)"""
54f9ee45 5233 return _core_.MoveEvent_SetPosition(*args, **kwargs)
e811c8ce 5234
7557b9b5
RD
5235 m_pos = property(GetPosition, SetPosition)
5236 m_rect = property(GetRect, SetRect)
5237
57332a5a
RD
5238 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
5239 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
2131d850 5240_core_.MoveEvent_swigregister(MoveEvent)
d14a1e28
RD
5241
5242#---------------------------------------------------------------------------
5243
5244class PaintEvent(Event):
5ba5649b
RD
5245 """
5246 A paint event is sent when a window's contents needs to be repainted.
5247 Note that in an EVT_PAINT handler the application must *always* create
5248 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5249 Windows assumes that the window has not been painted yet and will send
5250 the event again, causing endless refreshes.
5251
5252 You can optimize painting by retrieving the rectangles that have been
5253 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5254 and only repainting these rectangles. The rectangles are in terms of
5255 the client area, and are unscrolled, so you will need to do some
5256 calculations using the current view position to obtain logical,
5257 scrolled units.
5258
5259 """
0085ce49
RD
5260 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5261 __repr__ = _swig_repr
5262 def __init__(self, *args, **kwargs):
a95a7133 5263 """__init__(self, int Id=0) -> PaintEvent"""
0085ce49 5264 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5265_core_.PaintEvent_swigregister(PaintEvent)
d14a1e28
RD
5266
5267class NcPaintEvent(Event):
093d3ff1 5268 """Proxy of C++ NcPaintEvent class"""
0085ce49
RD
5269 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5270 __repr__ = _swig_repr
5271 def __init__(self, *args, **kwargs):
a95a7133 5272 """__init__(self, int winid=0) -> NcPaintEvent"""
0085ce49 5273 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5274_core_.NcPaintEvent_swigregister(NcPaintEvent)
d14a1e28
RD
5275
5276#---------------------------------------------------------------------------
5277
5278class EraseEvent(Event):
5ba5649b
RD
5279 """
5280 An erase event is sent whenever the background of a window needs to be
5281 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5282 binder. On some platforms, such as GTK+, this event is simulated
5283 (simply generated just before the paint event) and may cause flicker.
5284
5285 To paint a custom background use the `GetDC` method and use the returned
5286 device context if it is not ``None``, otherwise create a temporary
5287 `wx.ClientDC` and draw on that.
5288
5289 """
0085ce49
RD
5290 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5291 __repr__ = _swig_repr
5292 def __init__(self, *args, **kwargs):
5ba5649b
RD
5293 """
5294 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5295
5296 Constructor
5297 """
0085ce49 5298 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
e811c8ce 5299 def GetDC(*args, **kwargs):
5ba5649b
RD
5300 """
5301 GetDC(self) -> DC
5302
5303 Returns the device context the event handler should draw upon. If
5304 ``None`` is returned then create a temporary `wx.ClientDC` and use
5305 that instead.
5306 """
54f9ee45 5307 return _core_.EraseEvent_GetDC(*args, **kwargs)
e811c8ce 5308
97ab0f6a 5309 DC = property(GetDC,doc="See `GetDC`")
2131d850 5310_core_.EraseEvent_swigregister(EraseEvent)
d14a1e28
RD
5311
5312#---------------------------------------------------------------------------
5313
5314class FocusEvent(Event):
5ba5649b
RD
5315 """
5316 A focus event is sent when a window's focus changes. The window losing
5317 focus receives an EVT_KILL_FOCUS event while the window gaining it
5318 gets an EVT_SET_FOCUS event.
5319
5320 Notice that the set focus event happens both when the user gives focus
5321 to the window (whether using the mouse or keyboard) and when it is
5322 done from the program itself using `wx.Window.SetFocus`.
5323
5324 """
0085ce49
RD
5325 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5326 __repr__ = _swig_repr
5327 def __init__(self, *args, **kwargs):
5ba5649b 5328 """
2131d850 5329 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5330
5331 Constructor
5332 """
0085ce49 5333 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
e811c8ce 5334 def GetWindow(*args, **kwargs):
5ba5649b
RD
5335 """
5336 GetWindow(self) -> Window
5337
5338 Returns the other window associated with this event, that is the
5339 window which had the focus before for the EVT_SET_FOCUS event and the
5340 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5341
5342 Warning: the window returned may be None!
5343 """
54f9ee45 5344 return _core_.FocusEvent_GetWindow(*args, **kwargs)
e811c8ce
RD
5345
5346 def SetWindow(*args, **kwargs):
a95a7133 5347 """SetWindow(self, Window win)"""
54f9ee45 5348 return _core_.FocusEvent_SetWindow(*args, **kwargs)
e811c8ce 5349
97ab0f6a 5350 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 5351_core_.FocusEvent_swigregister(FocusEvent)
d14a1e28
RD
5352
5353#---------------------------------------------------------------------------
5354
5355class ChildFocusEvent(CommandEvent):
5ba5649b 5356 """
33d6fd3b
RD
5357 A child focus event is sent to a (parent-)window when one of its child
5358 windows gains focus, so that the window could restore the focus back
5359 to its corresponding child if it loses it now and regains later.
5360
5361 Notice that child window is the direct child of the window receiving
5362 the event, and so may not be the actual widget recieving focus if it
5363 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5364 to get the widget that is actually receiving focus.
5ba5649b 5365 """
0085ce49
RD
5366 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5367 __repr__ = _swig_repr
5368 def __init__(self, *args, **kwargs):
5ba5649b
RD
5369 """
5370 __init__(self, Window win=None) -> ChildFocusEvent
5371
5372 Constructor
5373 """
0085ce49 5374 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
e811c8ce 5375 def GetWindow(*args, **kwargs):
5ba5649b
RD
5376 """
5377 GetWindow(self) -> Window
5378
33d6fd3b
RD
5379 The window, or (grand)parent of the window which has just received the
5380 focus.
5ba5649b 5381 """
54f9ee45 5382 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
e811c8ce 5383
2bf58437 5384 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 5385_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d14a1e28
RD
5386
5387#---------------------------------------------------------------------------
5388
5389class ActivateEvent(Event):
5ba5649b
RD
5390 """
5391 An activate event is sent when a top-level window or the entire
5392 application is being activated or deactivated.
5393
5394 A top-level window (a dialog or frame) receives an activate event when
5395 is being activated or deactivated. This is indicated visually by the
5396 title bar changing colour, and a subwindow gaining the keyboard focus.
5397 An application is activated or deactivated when one of its frames
5398 becomes activated, or a frame becomes inactivate resulting in all
5399 application frames being inactive.
5400
5401 Please note that usually you should call event.Skip() in your handlers
5402 for these events so the default handlers will still be called, as not
5403 doing so can result in strange effects.
5404
5405 """
0085ce49
RD
5406 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5407 __repr__ = _swig_repr
5408 def __init__(self, *args, **kwargs):
5ba5649b 5409 """
2131d850 5410 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5411
5412 Constructor
5413 """
0085ce49 5414 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
e811c8ce 5415 def GetActive(*args, **kwargs):
5ba5649b
RD
5416 """
5417 GetActive(self) -> bool
5418
5419 Returns true if the application or window is being activated, false
5420 otherwise.
5421 """
54f9ee45 5422 return _core_.ActivateEvent_GetActive(*args, **kwargs)
e811c8ce 5423
2bf58437 5424 Active = property(GetActive,doc="See `GetActive`")
2131d850 5425_core_.ActivateEvent_swigregister(ActivateEvent)
d14a1e28
RD
5426
5427#---------------------------------------------------------------------------
5428
5429class InitDialogEvent(Event):
5ba5649b
RD
5430 """
5431 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5432 any window when `wx.Window.InitDialog` is called. Handlers for this
5433 event can transfer data to the window, or anything else that should be
5434 done before the user begins editing the form. The default handler
5435 calls `wx.Window.TransferDataToWindow`.
5436 """
0085ce49
RD
5437 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5438 __repr__ = _swig_repr
5439 def __init__(self, *args, **kwargs):
5ba5649b
RD
5440 """
5441 __init__(self, int Id=0) -> InitDialogEvent
5442
5443 Constructor
5444 """
0085ce49 5445 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5446_core_.InitDialogEvent_swigregister(InitDialogEvent)
d14a1e28
RD
5447
5448#---------------------------------------------------------------------------
5449
5450class MenuEvent(Event):
5ba5649b
RD
5451 """
5452 This class is used for a variety of menu-related events. Note that
5453 these do not include menu command events, which are handled by sending
5454 `wx.CommandEvent` objects.
5455
5456 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5457 text in the first field of the status bar.
5458 """
0085ce49
RD
5459 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5460 __repr__ = _swig_repr
5461 def __init__(self, *args, **kwargs):
5ba5649b 5462 """
2131d850 5463 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5464
5465 Constructor
5466 """
0085ce49 5467 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
e811c8ce 5468 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5469 """
5470 GetMenuId(self) -> int
5471
5472 Returns the menu identifier associated with the event. This method
5473 should be only used with the HIGHLIGHT events.
5474 """
54f9ee45 5475 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
e811c8ce
RD
5476
5477 def IsPopup(*args, **kwargs):
5ba5649b
RD
5478 """
5479 IsPopup(self) -> bool
5480
5481 Returns ``True`` if the menu which is being opened or closed is a
5482 popup menu, ``False`` if it is a normal one. This method should only
5483 be used with the OPEN and CLOSE events.
5484 """
54f9ee45 5485 return _core_.MenuEvent_IsPopup(*args, **kwargs)
e811c8ce
RD
5486
5487 def GetMenu(*args, **kwargs):
5ba5649b
RD
5488 """
5489 GetMenu(self) -> Menu
5490
5491 Returns the menu which is being opened or closed. This method should
5492 only be used with the OPEN and CLOSE events.
5493 """
54f9ee45 5494 return _core_.MenuEvent_GetMenu(*args, **kwargs)
e811c8ce 5495
57332a5a
RD
5496 Menu = property(GetMenu,doc="See `GetMenu`")
5497 MenuId = property(GetMenuId,doc="See `GetMenuId`")
2131d850 5498_core_.MenuEvent_swigregister(MenuEvent)
d14a1e28
RD
5499
5500#---------------------------------------------------------------------------
5501
5502class CloseEvent(Event):
5ba5649b
RD
5503 """
5504 This event class contains information about window and session close
5505 events.
5506
5507 The handler function for EVT_CLOSE is called when the user has tried
5508 to close a a frame or dialog box using the window manager controls or
5509 the system menu. It can also be invoked by the application itself
5510 programmatically, for example by calling the `wx.Window.Close`
5511 function.
5512
5513 You should check whether the application is forcing the deletion of
5514 the window using `CanVeto`. If it returns ``False``, you must destroy
5515 the window using `wx.Window.Destroy`. If the return value is ``True``,
5516 it is up to you whether you respond by destroying the window or not.
5517 For example you may wish to display a message dialog prompting to save
5518 files or to cancel the close.
5519
5520 If you don't destroy the window, you should call `Veto` to let the
5521 calling code know that you did not destroy the window. This allows the
5522 `wx.Window.Close` function to return ``True`` or ``False`` depending
5523 on whether the close instruction was honored or not.
5524 """
0085ce49
RD
5525 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5526 __repr__ = _swig_repr
5527 def __init__(self, *args, **kwargs):
5ba5649b 5528 """
2131d850 5529 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5530
5531 Constructor.
5532 """
0085ce49 5533 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
e811c8ce 5534 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5535 """
5536 SetLoggingOff(self, bool logOff)
5537
5538 Sets the 'logging off' flag.
5539 """
54f9ee45 5540 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
e811c8ce
RD
5541
5542 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5543 """
5544 GetLoggingOff(self) -> bool
5545
6c75a4cf
RD
5546 Returns ``True`` if the user is logging off or ``False`` if the
5547 system is shutting down. This method can only be called for end
5548 session and query end session events, it doesn't make sense for close
5549 window event.
5ba5649b 5550 """
54f9ee45 5551 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
e811c8ce
RD
5552
5553 def Veto(*args, **kwargs):
5ba5649b
RD
5554 """
5555 Veto(self, bool veto=True)
5556
5557 Call this from your event handler to veto a system shutdown or to
5558 signal to the calling application that a window close did not happen.
5559
5560 You can only veto a shutdown or close if `CanVeto` returns true.
5561 """
54f9ee45 5562 return _core_.CloseEvent_Veto(*args, **kwargs)
e811c8ce 5563
5ba5649b
RD
5564 def GetVeto(*args, **kwargs):
5565 """GetVeto(self) -> bool"""
5566 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5567
e811c8ce 5568 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5569 """
5570 SetCanVeto(self, bool canVeto)
5571
5572 Sets the 'can veto' flag.
5573 """
54f9ee45 5574 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
e811c8ce
RD
5575
5576 def CanVeto(*args, **kwargs):
5ba5649b
RD
5577 """
5578 CanVeto(self) -> bool
e811c8ce 5579
5ba5649b
RD
5580 Returns true if you can veto a system shutdown or a window close
5581 event. Vetoing a window close event is not possible if the calling
5582 code wishes to force the application to exit, and so this function
5583 must be called to check this.
5584 """
5585 return _core_.CloseEvent_CanVeto(*args, **kwargs)
e811c8ce 5586
2bf58437 5587 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
2131d850 5588_core_.CloseEvent_swigregister(CloseEvent)
d14a1e28
RD
5589
5590#---------------------------------------------------------------------------
5591
5592class ShowEvent(Event):
5ba5649b 5593 """An EVT_SHOW event is sent when a window is shown or hidden."""
0085ce49
RD
5594 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5595 __repr__ = _swig_repr
5596 def __init__(self, *args, **kwargs):
5ba5649b
RD
5597 """
5598 __init__(self, int winid=0, bool show=False) -> ShowEvent
5599
5600 An EVT_SHOW event is sent when a window is shown or hidden.
5601 """
0085ce49 5602 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
e811c8ce 5603 def SetShow(*args, **kwargs):
a95a7133 5604 """SetShow(self, bool show)"""
54f9ee45 5605 return _core_.ShowEvent_SetShow(*args, **kwargs)
e811c8ce
RD
5606
5607 def GetShow(*args, **kwargs):
a95a7133 5608 """GetShow(self) -> bool"""
54f9ee45 5609 return _core_.ShowEvent_GetShow(*args, **kwargs)
e811c8ce 5610
33d6fd3b 5611 Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`")
2131d850 5612_core_.ShowEvent_swigregister(ShowEvent)
d14a1e28
RD
5613
5614#---------------------------------------------------------------------------
5615
5616class IconizeEvent(Event):
5ba5649b
RD
5617 """
5618 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5619 restored.
5620 """
0085ce49
RD
5621 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5622 __repr__ = _swig_repr
5623 def __init__(self, *args, **kwargs):
5ba5649b
RD
5624 """
5625 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5626
5627 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5628 restored.
5629 """
0085ce49 5630 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
e811c8ce 5631 def Iconized(*args, **kwargs):
5ba5649b
RD
5632 """
5633 Iconized(self) -> bool
5634
5635 Returns ``True`` if the frame has been iconized, ``False`` if it has
5636 been restored.
5637 """
54f9ee45 5638 return _core_.IconizeEvent_Iconized(*args, **kwargs)
e811c8ce 5639
2131d850 5640_core_.IconizeEvent_swigregister(IconizeEvent)
d14a1e28
RD
5641
5642#---------------------------------------------------------------------------
5643
5644class MaximizeEvent(Event):
5ba5649b 5645 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
0085ce49
RD
5646 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5647 __repr__ = _swig_repr
5648 def __init__(self, *args, **kwargs):
5ba5649b
RD
5649 """
5650 __init__(self, int id=0) -> MaximizeEvent
5651
5652 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5653 """
0085ce49 5654 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5655_core_.MaximizeEvent_swigregister(MaximizeEvent)
d14a1e28
RD
5656
5657#---------------------------------------------------------------------------
5658
5659class DropFilesEvent(Event):
5ba5649b
RD
5660 """
5661 This class is used for drop files events, that is, when files have
5662 been dropped onto the window. This functionality is only available
5663 under Windows. The window must have previously been enabled for
5664 dropping by calling `wx.Window.DragAcceptFiles`.
5665
5666 Important note: this is a separate implementation to the more general
5667 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5668 implementation uses the older, Windows message-based approach of
5669 dropping files.
5670
5671 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5672 events.
5673
5674 """
0085ce49
RD
5675 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5676 def __init__(self): raise AttributeError, "No constructor defined"
5677 __repr__ = _swig_repr
e811c8ce 5678 def GetPosition(*args, **kwargs):
5ba5649b
RD
5679 """
5680 GetPosition(self) -> Point
5681
5682 Returns the position at which the files were dropped.
5683 """
54f9ee45 5684 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5685
5686 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5687 """
5688 GetNumberOfFiles(self) -> int
5689
5690 Returns the number of files dropped.
5691 """
54f9ee45 5692 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
e811c8ce
RD
5693
5694 def GetFiles(*args, **kwargs):
5ba5649b
RD
5695 """
5696 GetFiles(self) -> PyObject
5697
5698 Returns a list of the filenames that were dropped.
5699 """
54f9ee45 5700 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
e811c8ce 5701
2bf58437
RD
5702 Files = property(GetFiles,doc="See `GetFiles`")
5703 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
5704 Position = property(GetPosition,doc="See `GetPosition`")
2131d850 5705_core_.DropFilesEvent_swigregister(DropFilesEvent)
d14a1e28
RD
5706
5707#---------------------------------------------------------------------------
5708
54f9ee45
RD
5709UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5710UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
d14a1e28 5711class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5712 """
5713 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5714 wxWidgets to give an application the chance to update various user
5715 interface elements.
5716
5717 Without update UI events, an application has to work hard to
5718 check/uncheck, enable/disable, and set the text for elements such as
5719 menu items and toolbar buttons. The code for doing this has to be
5720 mixed up with the code that is invoked when an action is invoked for a
5721 menu item or button.
5722
5723 With update UI events, you define an event handler to look at the
5724 state of the application and change UI elements accordingly. wxWidgets
5725 will call your handler functions in idle time, so you don't have to
5726 worry where to call this code. In addition to being a clearer and more
5727 declarative method, it also means you don't have to worry whether
5728 you're updating a toolbar or menubar identifier. The same handler can
5729 update a menu item and toolbar button, if the ID values are the same.
5730
5731 Instead of directly manipulating the menu or button, you call
5732 functions in the event object, such as `Check`. wxWidgets will
5733 determine whether such a call has been made, and which UI element to
5734 update.
5735
5736 These events will work for popup menus as well as menubars. Just
5737 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5738 any UI events for the window that owns the menu.
5739
5740 If you find that the overhead of UI update processing is affecting
5741 your application, you can do one or both of the following:
5742
5743 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5744 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5745 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5746 receive update events. No other windows will receive update
5747 events.
5748
5749 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5750 value to set the delay between updates. You may need to call
5751 `wx.Window.UpdateWindowUI` at critical points, for example when
5752 a dialog is about to be shown, in case the user sees a slight
5753 delay before windows are updated.
5754
5755 Note that although events are sent in idle time, defining a EVT_IDLE
5756 handler for a window does not affect this because the events are sent
5757 from an internal idle handler.
5758
5759 wxWidgets tries to optimize update events on some platforms. On
5760 Windows and GTK+, events for menubar items are only sent when the menu
5761 is about to be shown, and not in idle time.
5762
5763 """
0085ce49
RD
5764 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5765 __repr__ = _swig_repr
5766 def __init__(self, *args, **kwargs):
5ba5649b
RD
5767 """
5768 __init__(self, int commandId=0) -> UpdateUIEvent
5769
5770 Constructor
5771 """
0085ce49 5772 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
e811c8ce 5773 def GetChecked(*args, **kwargs):
5ba5649b
RD
5774 """
5775 GetChecked(self) -> bool
5776
5777 Returns ``True`` if the UI element should be checked.
5778 """
54f9ee45 5779 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
e811c8ce
RD
5780
5781 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5782 """
5783 GetEnabled(self) -> bool
5784
5785 Returns ``True`` if the UI element should be enabled.
5786 """
54f9ee45 5787 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
e811c8ce 5788
b1fcee84
RD
5789 def GetShown(*args, **kwargs):
5790 """
5791 GetShown(self) -> bool
5792
5793 Returns ``True`` if the UI element should be shown.
5794 """
5795 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5796
e811c8ce 5797 def GetText(*args, **kwargs):
5ba5649b
RD
5798 """
5799 GetText(self) -> String
5800
5801 Returns the text that should be set for the UI element.
5802 """
54f9ee45 5803 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
e811c8ce
RD
5804
5805 def GetSetText(*args, **kwargs):
5ba5649b
RD
5806 """
5807 GetSetText(self) -> bool
5808
5809 Returns ``True`` if the application has called `SetText`. For
5810 wxWidgets internal use only.
5811 """
54f9ee45 5812 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
e811c8ce
RD
5813
5814 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5815 """
5816 GetSetChecked(self) -> bool
5817
5818 Returns ``True`` if the application has called `Check`. For wxWidgets
5819 internal use only.
5820 """
54f9ee45 5821 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
e811c8ce
RD
5822
5823 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5824 """
5825 GetSetEnabled(self) -> bool
5826
5827 Returns ``True`` if the application has called `Enable`. For wxWidgets
5828 internal use only.
5829 """
54f9ee45 5830 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
e811c8ce 5831
b1fcee84
RD
5832 def GetSetShown(*args, **kwargs):
5833 """
5834 GetSetShown(self) -> bool
5835
5836 Returns ``True`` if the application has called `Show`. For wxWidgets
5837 internal use only.
5838 """
5839 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5840
e811c8ce 5841 def Check(*args, **kwargs):
5ba5649b
RD
5842 """
5843 Check(self, bool check)
5844
5845 Check or uncheck the UI element.
5846 """
54f9ee45 5847 return _core_.UpdateUIEvent_Check(*args, **kwargs)
e811c8ce
RD
5848
5849 def Enable(*args, **kwargs):
5ba5649b
RD
5850 """
5851 Enable(self, bool enable)
5852
5853 Enable or disable the UI element.
5854 """
54f9ee45 5855 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
e811c8ce 5856
b1fcee84
RD
5857 def Show(*args, **kwargs):
5858 """
5859 Show(self, bool show)
5860
5861 Show or hide the UI element.
5862 """
5863 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5864
e811c8ce 5865 def SetText(*args, **kwargs):
5ba5649b
RD
5866 """
5867 SetText(self, String text)
5868
5869 Sets the text for this UI element.
5870 """
54f9ee45 5871 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
e811c8ce
RD
5872
5873 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5874 """
5875 SetUpdateInterval(long updateInterval)
5876
5877 Sets the interval between updates in milliseconds. Set to -1 to
5878 disable updates, or to 0 to update as frequently as possible. The
5879 default is 0.
5880
5881 Use this to reduce the overhead of UI update events if your
5882 application has a lot of windows. If you set the value to -1 or
5883 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5884 at appropriate points in your application, such as when a dialog is
5885 about to be shown.
5886 """
54f9ee45 5887 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
e811c8ce
RD
5888
5889 SetUpdateInterval = staticmethod(SetUpdateInterval)
5890 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5891 """
5892 GetUpdateInterval() -> long
5893
5894 Returns the current interval between updates in milliseconds. -1
5895 disables updates, 0 updates as frequently as possible.
5896 """
54f9ee45 5897 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
e811c8ce
RD
5898
5899 GetUpdateInterval = staticmethod(GetUpdateInterval)
5900 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5901 """
5902 CanUpdate(Window win) -> bool
5903
5904 Returns ``True`` if it is appropriate to update (send UI update events
5905 to) this window.
5906
5907 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5908 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5909 events were last sent in idle time, and the update interval, to
5910 determine whether events should be sent to this window now. By default
5911 this will always return true because the update mode is initially
5912 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5913 events will be sent as often as possible. You can reduce the frequency
5914 that events are sent by changing the mode and/or setting an update
5915 interval.
5916
5917 """
54f9ee45 5918 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
e811c8ce
RD
5919
5920 CanUpdate = staticmethod(CanUpdate)
5921 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5922 """
5923 ResetUpdateTime()
5924
5925 Used internally to reset the last-updated time to the current time. It
5926 is assumed that update events are normally sent in idle time, so this
5927 is called at the end of idle processing.
5928 """
54f9ee45 5929 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
e811c8ce
RD
5930
5931 ResetUpdateTime = staticmethod(ResetUpdateTime)
5932 def SetMode(*args, **kwargs):
5ba5649b
RD
5933 """
5934 SetMode(int mode)
5935
5936 Specify how wxWidgets will send update events: to all windows, or only
5937 to those which specify that they will process the events.
5938
5939 The mode may be one of the following values:
5940
5941 ============================= ==========================================
5942 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5943 is the default setting.
5944 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5945 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5946 style set.
5947 ============================= ==========================================
5948
5949 """
54f9ee45 5950 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
e811c8ce
RD
5951
5952 SetMode = staticmethod(SetMode)
5953 def GetMode(*args, **kwargs):
5ba5649b
RD
5954 """
5955 GetMode() -> int
5956
5957 Returns a value specifying how wxWidgets will send update events: to
5958 all windows, or only to those which specify that they will process the
5959 events.
5960 """
54f9ee45 5961 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
e811c8ce
RD
5962
5963 GetMode = staticmethod(GetMode)
dba7934c
RD
5964 Checked = property(GetChecked,Check,doc="See `GetChecked`")
5965 Enabled = property(GetEnabled,Enable,doc="See `GetEnabled`")
5966 Shown = property(GetShown,Show,doc="See `GetShown`")
5967 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
2131d850 5968_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d14a1e28 5969
e811c8ce 5970def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
0085ce49 5971 """
5ba5649b
RD
5972 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5973
5974 Sets the interval between updates in milliseconds. Set to -1 to
5975 disable updates, or to 0 to update as frequently as possible. The
5976 default is 0.
5977
5978 Use this to reduce the overhead of UI update events if your
5979 application has a lot of windows. If you set the value to -1 or
5980 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5981 at appropriate points in your application, such as when a dialog is
5982 about to be shown.
5983 """
0085ce49 5984 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d14a1e28 5985
0085ce49
RD
5986def UpdateUIEvent_GetUpdateInterval(*args):
5987 """
5ba5649b
RD
5988 UpdateUIEvent_GetUpdateInterval() -> long
5989
5990 Returns the current interval between updates in milliseconds. -1
5991 disables updates, 0 updates as frequently as possible.
5992 """
0085ce49 5993 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d14a1e28 5994
e811c8ce 5995def UpdateUIEvent_CanUpdate(*args, **kwargs):
0085ce49 5996 """
5ba5649b
RD
5997 UpdateUIEvent_CanUpdate(Window win) -> bool
5998
5999 Returns ``True`` if it is appropriate to update (send UI update events
6000 to) this window.
6001
6002 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6003 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6004 events were last sent in idle time, and the update interval, to
6005 determine whether events should be sent to this window now. By default
6006 this will always return true because the update mode is initially
6007 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6008 events will be sent as often as possible. You can reduce the frequency
6009 that events are sent by changing the mode and/or setting an update
6010 interval.
6011
6012 """
0085ce49 6013 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d14a1e28 6014
0085ce49
RD
6015def UpdateUIEvent_ResetUpdateTime(*args):
6016 """
5ba5649b
RD
6017 UpdateUIEvent_ResetUpdateTime()
6018
6019 Used internally to reset the last-updated time to the current time. It
6020 is assumed that update events are normally sent in idle time, so this
6021 is called at the end of idle processing.
6022 """
0085ce49 6023 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d14a1e28 6024
e811c8ce 6025def UpdateUIEvent_SetMode(*args, **kwargs):
0085ce49 6026 """
5ba5649b
RD
6027 UpdateUIEvent_SetMode(int mode)
6028
6029 Specify how wxWidgets will send update events: to all windows, or only
6030 to those which specify that they will process the events.
6031
6032 The mode may be one of the following values:
6033
6034 ============================= ==========================================
6035 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6036 is the default setting.
6037 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6038 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6039 style set.
6040 ============================= ==========================================
6041
6042 """
0085ce49 6043 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d14a1e28 6044
0085ce49
RD
6045def UpdateUIEvent_GetMode(*args):
6046 """
5ba5649b
RD
6047 UpdateUIEvent_GetMode() -> int
6048
6049 Returns a value specifying how wxWidgets will send update events: to
6050 all windows, or only to those which specify that they will process the
6051 events.
6052 """
0085ce49 6053 return _core_.UpdateUIEvent_GetMode(*args)
d14a1e28
RD
6054
6055#---------------------------------------------------------------------------
6056
6057class SysColourChangedEvent(Event):
5ba5649b
RD
6058 """
6059 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6060 when the user changes the colour settings using the control
6061 panel. This is only applicable under Windows.
6062
6063 The default event handler for this event propagates the event to child
6064 windows, since Windows only sends the events to top-level windows. If
6065 intercepting this event for a top-level window, remember to call
6066 `Skip` so the the base class handler will still be executed, or to
6067 pass the event on to the window's children explicitly.
6068
6069 """
0085ce49
RD
6070 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6071 __repr__ = _swig_repr
6072 def __init__(self, *args, **kwargs):
5ba5649b
RD
6073 """
6074 __init__(self) -> SysColourChangedEvent
6075
6076 Constructor
6077 """
0085ce49 6078 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 6079_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d14a1e28
RD
6080
6081#---------------------------------------------------------------------------
6082
6083class MouseCaptureChangedEvent(Event):
5ba5649b
RD
6084 """
6085 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6086 a window that loses its mouse capture. This is called even if
6087 `wx.Window.ReleaseMouse` was called by the application code. Handling
6088 this event allows an application to cater for unexpected capture
6089 releases which might otherwise confuse mouse handling code.
6090
6091 This event is implemented under Windows only.
6092 """
0085ce49
RD
6093 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6094 __repr__ = _swig_repr
6095 def __init__(self, *args, **kwargs):
5ba5649b
RD
6096 """
6097 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6098
6099 Constructor
6100 """
0085ce49 6101 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
e811c8ce 6102 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
6103 """
6104 GetCapturedWindow(self) -> Window
6105
6106 Returns the window that gained the capture, or ``None`` if it was a
6107 non-wxWidgets window.
6108 """
54f9ee45 6109 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
e811c8ce 6110
57332a5a 6111 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
2131d850 6112_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d14a1e28
RD
6113
6114#---------------------------------------------------------------------------
6115
34e0a3bb
RD
6116class MouseCaptureLostEvent(Event):
6117 """
6118 A mouse capture lost event is sent to a window that obtained mouse
6119 capture, which was subsequently loss due to "external" event, for
6120 example when a dialog box is shown or if another application captures
6121 the mouse.
6122
6123 If this happens, this event is sent to all windows that are on the
6124 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6125 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6126 if the capture changes because of a call to CaptureMouse or
6127 ReleaseMouse.
6128
6129 This event is currently emitted under Windows only.
6130
6131 """
6132 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6133 __repr__ = _swig_repr
6134 def __init__(self, *args, **kwargs):
6135 """
6136 __init__(self, int winid=0) -> MouseCaptureLostEvent
6137
6138 A mouse capture lost event is sent to a window that obtained mouse
6139 capture, which was subsequently loss due to "external" event, for
6140 example when a dialog box is shown or if another application captures
6141 the mouse.
6142
6143 If this happens, this event is sent to all windows that are on the
6144 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6145 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6146 if the capture changes because of a call to CaptureMouse or
6147 ReleaseMouse.
6148
6149 This event is currently emitted under Windows only.
6150
6151 """
6152 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6153_core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6154
6155#---------------------------------------------------------------------------
6156
d14a1e28 6157class DisplayChangedEvent(Event):
5ba5649b
RD
6158 """
6159 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6160 resolution has changed.
6161
6162 This event is implemented under Windows only.
6163 """
0085ce49
RD
6164 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6165 __repr__ = _swig_repr
6166 def __init__(self, *args, **kwargs):
a95a7133 6167 """__init__(self) -> DisplayChangedEvent"""
0085ce49 6168 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 6169_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d14a1e28
RD
6170
6171#---------------------------------------------------------------------------
6172
6173class PaletteChangedEvent(Event):
5ba5649b
RD
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 """
0085ce49
RD
6181 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6182 __repr__ = _swig_repr
6183 def __init__(self, *args, **kwargs):
5ba5649b
RD
6184 """
6185 __init__(self, int id=0) -> PaletteChangedEvent
6186
6187 An EVT_PALETTE_CHANGED event is sent when the system palette has
6188 changed, thereby giving each window a chance to redo their own to
6189 match.
6190
6191 This event is implemented under Windows only.
6192 """
0085ce49 6193 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
e811c8ce 6194 def SetChangedWindow(*args, **kwargs):
a95a7133 6195 """SetChangedWindow(self, Window win)"""
54f9ee45 6196 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
e811c8ce
RD
6197
6198 def GetChangedWindow(*args, **kwargs):
a95a7133 6199 """GetChangedWindow(self) -> Window"""
54f9ee45 6200 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
e811c8ce 6201
33d6fd3b 6202 ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`")
2131d850 6203_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d14a1e28
RD
6204
6205#---------------------------------------------------------------------------
6206
6207class QueryNewPaletteEvent(Event):
5ba5649b
RD
6208 """
6209 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6210 focus and should re-do its palette.
6211
6212 This event is implemented under Windows only.
6213 """
0085ce49
RD
6214 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6215 __repr__ = _swig_repr
6216 def __init__(self, *args, **kwargs):
5ba5649b
RD
6217 """
6218 __init__(self, int winid=0) -> QueryNewPaletteEvent
6219
6220 Constructor.
6221 """
0085ce49 6222 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
e811c8ce 6223 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6224 """
6225 SetPaletteRealized(self, bool realized)
6226
6227 App should set this if it changes the palette.
6228 """
54f9ee45 6229 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
e811c8ce
RD
6230
6231 def GetPaletteRealized(*args, **kwargs):
a95a7133 6232 """GetPaletteRealized(self) -> bool"""
54f9ee45 6233 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
e811c8ce 6234
33d6fd3b 6235 PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`")
2131d850 6236_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d14a1e28
RD
6237
6238#---------------------------------------------------------------------------
6239
6240class NavigationKeyEvent(Event):
5ba5649b
RD
6241 """
6242 EVT_NAVIGATION_KEY events are used to control moving the focus between
6243 widgets, otherwise known as tab-traversal. You woudl normally not
6244 catch navigation events in applications as there are already
6245 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6246 it useful to send navigation events in certain situations to change
6247 the focus in certain ways, although it's probably easier to just call
6248 `wx.Window.Navigate`.
6249 """
0085ce49
RD
6250 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6251 __repr__ = _swig_repr
6252 def __init__(self, *args, **kwargs):
a95a7133 6253 """__init__(self) -> NavigationKeyEvent"""
0085ce49 6254 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
e811c8ce 6255 def GetDirection(*args, **kwargs):
5ba5649b
RD
6256 """
6257 GetDirection(self) -> bool
6258
6259 Returns ``True`` if the direction is forward, ``False`` otherwise.
6260 """
54f9ee45 6261 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
e811c8ce
RD
6262
6263 def SetDirection(*args, **kwargs):
5ba5649b
RD
6264 """
6265 SetDirection(self, bool forward)
6266
6267 Specify the direction that the navigation should take. Usually the
6268 difference between using Tab and Shift-Tab.
6269 """
54f9ee45 6270 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
e811c8ce
RD
6271
6272 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6273 """
6274 IsWindowChange(self) -> bool
6275
6276 Returns ``True`` if window change is allowed.
6277 """
54f9ee45 6278 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
e811c8ce
RD
6279
6280 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6281 """
6282 SetWindowChange(self, bool ischange)
6283
6284 Specify if the navigation should be able to change parent windows.
6285 For example, changing notebook pages, etc. This is usually implemented
6286 by using Control-Tab.
6287 """
54f9ee45 6288 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
e811c8ce 6289
68350608 6290 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6291 """
6292 IsFromTab(self) -> bool
6293
6294 Returns ``True`` if the navigation event is originated from the Tab
6295 key.
6296 """
68350608
RD
6297 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6298
6299 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6300 """
6301 SetFromTab(self, bool bIs)
6302
6303 Set to true under MSW if the event was generated using the tab key.
6304 This is required for proper navogation over radio buttons.
6305 """
68350608
RD
6306 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6307
908b74cd 6308 def SetFlags(*args, **kwargs):
5ba5649b
RD
6309 """
6310 SetFlags(self, long flags)
6311
6312 Set the navigation flags to a combination of the following:
6313
6314 * wx.NavigationKeyEvent.IsBackward
6315 * wx.NavigationKeyEvent.IsForward
6316 * wx.NavigationKeyEvent.WinChange
6317 * wx.NavigationKeyEvent.FromTab
6318
6319 """
908b74cd
RD
6320 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6321
e811c8ce 6322 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6323 """
6324 GetCurrentFocus(self) -> Window
6325
6326 Returns the child window which currenty has the focus. May be
6327 ``None``.
6328 """
54f9ee45 6329 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
e811c8ce
RD
6330
6331 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6332 """
6333 SetCurrentFocus(self, Window win)
6334
6335 Set the window that has the focus.
6336 """
54f9ee45 6337 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
e811c8ce 6338
b0f7404b 6339 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
6340 IsForward = _core_.NavigationKeyEvent_IsForward
6341 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 6342 FromTab = _core_.NavigationKeyEvent_FromTab
57332a5a
RD
6343 CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`")
6344 Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`")
2131d850 6345_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d14a1e28
RD
6346
6347#---------------------------------------------------------------------------
6348
6349class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6350 """
6351 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6352 underlying GUI object) exists.
6353 """
0085ce49
RD
6354 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6355 __repr__ = _swig_repr
6356 def __init__(self, *args, **kwargs):
5ba5649b
RD
6357 """
6358 __init__(self, Window win=None) -> WindowCreateEvent
6359
6360 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6361 underlying GUI object) exists.
6362 """
0085ce49 6363 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
e811c8ce 6364 def GetWindow(*args, **kwargs):
5ba5649b
RD
6365 """
6366 GetWindow(self) -> Window
6367
6368 Returns the window that this event refers to.
6369 """
54f9ee45 6370 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
e811c8ce 6371
dba7934c 6372 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6373_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d14a1e28
RD
6374
6375class WindowDestroyEvent(CommandEvent):
5ba5649b 6376 """
943e8dfd
RD
6377 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6378 when the GUI window is destroyed.
6379
6380 When a class derived from `wx.Window` is destroyed its destructor will
6381 have already run by the time this event is sent. Therefore this event
6382 will not usually be received at all by the window itself. Since it is
6383 received after the destructor has run, an object should not try to
6384 handle its own wx.WindowDestroyEvent, but it can be used to get
6385 notification of the destruction of another window.
5ba5649b 6386 """
0085ce49
RD
6387 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6388 __repr__ = _swig_repr
6389 def __init__(self, *args, **kwargs):
5ba5649b
RD
6390 """
6391 __init__(self, Window win=None) -> WindowDestroyEvent
6392
943e8dfd
RD
6393 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6394 when the GUI window is destroyed.
6395
6396 When a class derived from `wx.Window` is destroyed its destructor will
6397 have already run by the time this event is sent. Therefore this event
6398 will not usually be received at all by the window itself. Since it is
6399 received after the destructor has run, an object should not try to
6400 handle its own wx.WindowDestroyEvent, but it can be used to get
6401 notification of the destruction of another window.
5ba5649b 6402 """
0085ce49 6403 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
e811c8ce 6404 def GetWindow(*args, **kwargs):
5ba5649b
RD
6405 """
6406 GetWindow(self) -> Window
6407
6408 Returns the window that this event refers to.
6409 """
54f9ee45 6410 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
e811c8ce 6411
dba7934c 6412 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6413_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d14a1e28
RD
6414
6415#---------------------------------------------------------------------------
6416
6417class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6418 """
6419 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6420 give the application a chance to show a context (popup) menu.
6421 """
0085ce49
RD
6422 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6423 __repr__ = _swig_repr
6424 def __init__(self, *args, **kwargs):
5ba5649b 6425 """
2131d850 6426 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6427
6428 Constructor.
6429 """
0085ce49 6430 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
e811c8ce 6431 def GetPosition(*args, **kwargs):
5ba5649b
RD
6432 """
6433 GetPosition(self) -> Point
6434
6435 Returns the position (in screen coordinants) at which the menu should
6436 be shown.
6437 """
54f9ee45 6438 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
6439
6440 def SetPosition(*args, **kwargs):
5ba5649b
RD
6441 """
6442 SetPosition(self, Point pos)
6443
6444 Sets the position at which the menu should be shown.
6445 """
54f9ee45 6446 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
e811c8ce 6447
2bf58437 6448 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 6449_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d14a1e28
RD
6450
6451#---------------------------------------------------------------------------
6452
54f9ee45
RD
6453IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6454IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
d14a1e28 6455class IdleEvent(Event):
5ba5649b
RD
6456 """
6457 This class is used for EVT_IDLE events, which are generated and sent
6458 when the application *becomes* idle. In other words, the when the
6459 event queue becomes empty then idle events are sent to all windows (by
6460 default) and as long as none of them call `RequestMore` then there are
6461 no more idle events until after the system event queue has some normal
6462 events and then becomes empty again.
6463
6464 By default, idle events are sent to all windows. If this is causing a
6465 significant overhead in your application, you can call
6466 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6467 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6468 which should receive idle events. Then idle events will only be sent
6469 to those windows and not to any others.
6470 """
0085ce49
RD
6471 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6472 __repr__ = _swig_repr
6473 def __init__(self, *args, **kwargs):
5ba5649b
RD
6474 """
6475 __init__(self) -> IdleEvent
6476
6477 Constructor
6478 """
0085ce49 6479 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
e811c8ce 6480 def RequestMore(*args, **kwargs):
5ba5649b
RD
6481 """
6482 RequestMore(self, bool needMore=True)
6483
6484 Tells wxWidgets that more processing is required. This function can be
6485 called by an EVT_IDLE handler for a window to indicate that the
6486 application should forward the EVT_IDLE event once more to the
6487 application windows. If no window calls this function during its
6488 EVT_IDLE handler, then the application will remain in a passive event
6489 loop until a new event is posted to the application by the windowing
6490 system.
6491 """
54f9ee45 6492 return _core_.IdleEvent_RequestMore(*args, **kwargs)
e811c8ce
RD
6493
6494 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6495 """
6496 MoreRequested(self) -> bool
6497
6498 Returns ``True`` if the OnIdle function processing this event
6499 requested more processing time.
6500 """
54f9ee45 6501 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
e811c8ce
RD
6502
6503 def SetMode(*args, **kwargs):
5ba5649b
RD
6504 """
6505 SetMode(int mode)
6506
6507 Static method for specifying how wxWidgets will send idle events: to
6508 all windows, or only to those which specify that they will process the
6509 events.
6510
6511 The mode can be one of the following values:
6512
6513 ========================= ========================================
6514 wx.IDLE_PROCESS_ALL Send idle events to all windows
6515 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6516 the wx.WS_EX_PROCESS_IDLE extra style
6517 flag set.
6518 ========================= ========================================
6519
6520 """
54f9ee45 6521 return _core_.IdleEvent_SetMode(*args, **kwargs)
e811c8ce
RD
6522
6523 SetMode = staticmethod(SetMode)
6524 def GetMode(*args, **kwargs):
5ba5649b
RD
6525 """
6526 GetMode() -> int
6527
6528 Static method returning a value specifying how wxWidgets will send
6529 idle events: to all windows, or only to those which specify that they
6530 will process the events.
6531 """
54f9ee45 6532 return _core_.IdleEvent_GetMode(*args, **kwargs)
e811c8ce
RD
6533
6534 GetMode = staticmethod(GetMode)
6535 def CanSend(*args, **kwargs):
5ba5649b
RD
6536 """
6537 CanSend(Window win) -> bool
6538
6539 Returns ``True`` if it is appropriate to send idle events to this
6540 window.
6541
6542 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6543 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6544 events should be sent to this window now. By default this will always
6545 return ``True`` because the update mode is initially
6546 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6547 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6548 """
54f9ee45 6549 return _core_.IdleEvent_CanSend(*args, **kwargs)
e811c8ce
RD
6550
6551 CanSend = staticmethod(CanSend)
2131d850 6552_core_.IdleEvent_swigregister(IdleEvent)
d14a1e28 6553
e811c8ce 6554def IdleEvent_SetMode(*args, **kwargs):
0085ce49 6555 """
5ba5649b
RD
6556 IdleEvent_SetMode(int mode)
6557
6558 Static method for specifying how wxWidgets will send idle events: to
6559 all windows, or only to those which specify that they will process the
6560 events.
6561
6562 The mode can be one of the following values:
6563
6564 ========================= ========================================
6565 wx.IDLE_PROCESS_ALL Send idle events to all windows
6566 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6567 the wx.WS_EX_PROCESS_IDLE extra style
6568 flag set.
6569 ========================= ========================================
6570
6571 """
0085ce49 6572 return _core_.IdleEvent_SetMode(*args, **kwargs)
d14a1e28 6573
0085ce49
RD
6574def IdleEvent_GetMode(*args):
6575 """
5ba5649b
RD
6576 IdleEvent_GetMode() -> int
6577
6578 Static method returning a value specifying how wxWidgets will send
6579 idle events: to all windows, or only to those which specify that they
6580 will process the events.
6581 """
0085ce49 6582 return _core_.IdleEvent_GetMode(*args)
d14a1e28 6583
e811c8ce 6584def IdleEvent_CanSend(*args, **kwargs):
0085ce49 6585 """
5ba5649b
RD
6586 IdleEvent_CanSend(Window win) -> bool
6587
6588 Returns ``True`` if it is appropriate to send idle events to this
6589 window.
6590
6591 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6592 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6593 events should be sent to this window now. By default this will always
6594 return ``True`` because the update mode is initially
6595 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6596 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6597 """
0085ce49 6598 return _core_.IdleEvent_CanSend(*args, **kwargs)
d14a1e28
RD
6599
6600#---------------------------------------------------------------------------
6601
2131d850
RD
6602class ClipboardTextEvent(CommandEvent):
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 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6611 __repr__ = _swig_repr
6612 def __init__(self, *args, **kwargs):
6613 """
6614 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6615
6616 A Clipboard Text event is sent when a window intercepts a text
6617 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6618 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6619 popup menu command, etc. NOTE : under windows these events are *NOT*
6620 generated automatically for a Rich Edit text control.
6621 """
6622 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6623_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6624
6625#---------------------------------------------------------------------------
6626
d14a1e28 6627class PyEvent(Event):
5ba5649b
RD
6628 """
6629 wx.PyEvent can be used as a base class for implementing custom event
6630 types in Python. You should derived from this class instead of
6631 `wx.Event` because this class is Python-aware and is able to transport
6632 its Python bits safely through the wxWidgets event system and have
6633 them still be there when the event handler is invoked.
6634
6635 :see: `wx.PyCommandEvent`
6636
6637 """
0085ce49
RD
6638 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6639 __repr__ = _swig_repr
6640 def __init__(self, *args, **kwargs):
2131d850 6641 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
0085ce49 6642 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6643 self._SetSelf(self)
e811c8ce 6644
0085ce49
RD
6645 __swig_destroy__ = _core_.delete_PyEvent
6646 __del__ = lambda self : None;
5ba5649b
RD
6647 def _SetSelf(*args, **kwargs):
6648 """_SetSelf(self, PyObject self)"""
6649 return _core_.PyEvent__SetSelf(*args, **kwargs)
e811c8ce 6650
5ba5649b
RD
6651 def _GetSelf(*args, **kwargs):
6652 """_GetSelf(self) -> PyObject"""
6653 return _core_.PyEvent__GetSelf(*args, **kwargs)
e811c8ce 6654
2131d850 6655_core_.PyEvent_swigregister(PyEvent)
d14a1e28
RD
6656
6657class PyCommandEvent(CommandEvent):
5ba5649b
RD
6658 """
6659 wx.PyCommandEvent can be used as a base class for implementing custom
6660 event types in Python, where the event shoudl travel up to parent
6661 windows looking for a handler. You should derived from this class
6662 instead of `wx.CommandEvent` because this class is Python-aware and is
6663 able to transport its Python bits safely through the wxWidgets event
6664 system and have them still be there when the event handler is invoked.
6665
6666 :see: `wx.PyEvent`
6667
6668 """
0085ce49
RD
6669 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6670 __repr__ = _swig_repr
6671 def __init__(self, *args, **kwargs):
2131d850 6672 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
0085ce49 6673 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6674 self._SetSelf(self)
e811c8ce 6675
0085ce49
RD
6676 __swig_destroy__ = _core_.delete_PyCommandEvent
6677 __del__ = lambda self : None;
5ba5649b
RD
6678 def _SetSelf(*args, **kwargs):
6679 """_SetSelf(self, PyObject self)"""
6680 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
e811c8ce 6681
5ba5649b
RD
6682 def _GetSelf(*args, **kwargs):
6683 """_GetSelf(self) -> PyObject"""
6684 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
e811c8ce 6685
2131d850 6686_core_.PyCommandEvent_swigregister(PyCommandEvent)
d14a1e28 6687
53aa7709 6688class DateEvent(CommandEvent):
5ba5649b
RD
6689 """
6690 This event class holds information about a date change event and is
6691 used together with `wx.DatePickerCtrl`. It also serves as a base class
6692 for `wx.calendar.CalendarEvent`. Bind these event types with
6693 EVT_DATE_CHANGED.
6694 """
0085ce49
RD
6695 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6696 __repr__ = _swig_repr
6697 def __init__(self, *args, **kwargs):
2131d850 6698 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
0085ce49 6699 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6700 def GetDate(*args, **kwargs):
5ba5649b
RD
6701 """
6702 GetDate(self) -> DateTime
6703
6704 Returns the date.
6705 """
53aa7709
RD
6706 return _core_.DateEvent_GetDate(*args, **kwargs)
6707
6708 def SetDate(*args, **kwargs):
5ba5649b
RD
6709 """
6710 SetDate(self, DateTime date)
6711
6712 Sets the date carried by the event, normally only used by the library
6713 internally.
6714 """
53aa7709
RD
6715 return _core_.DateEvent_SetDate(*args, **kwargs)
6716
2bf58437 6717 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
2131d850 6718_core_.DateEvent_swigregister(DateEvent)
53aa7709
RD
6719
6720wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6721EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6722
d14a1e28
RD
6723#---------------------------------------------------------------------------
6724
54f9ee45
RD
6725PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6726PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6727PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6728PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6729PRINT_WINDOWS = _core_.PRINT_WINDOWS
6730PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
d14a1e28 6731class PyApp(EvtHandler):
66c033b4
RD
6732 """
6733 The ``wx.PyApp`` class is an *implementation detail*, please use the
6734 `wx.App` class (or some other derived class) instead.
6735 """
0085ce49
RD
6736 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6737 __repr__ = _swig_repr
6738 def __init__(self, *args, **kwargs):
98e665d3 6739 """
a95a7133 6740 __init__(self) -> PyApp
98e665d3
RD
6741
6742 Create a new application object, starting the bootstrap process.
6743 """
0085ce49 6744 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
70b7a5fe
RD
6745 self._setCallbackInfo(self, PyApp, False)
6746 self._setOORInfo(self, False)
e811c8ce 6747
0085ce49
RD
6748 __swig_destroy__ = _core_.delete_PyApp
6749 __del__ = lambda self : None;
e811c8ce 6750 def _setCallbackInfo(*args, **kwargs):
70b7a5fe 6751 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
54f9ee45 6752 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
6753
6754 def GetAppName(*args, **kwargs):
0df68c9f 6755 """
a95a7133 6756 GetAppName(self) -> String
6c3b4aae 6757
0df68c9f
RD
6758 Get the application name.
6759 """
54f9ee45 6760 return _core_.PyApp_GetAppName(*args, **kwargs)
e811c8ce
RD
6761
6762 def SetAppName(*args, **kwargs):
0df68c9f 6763 """
a95a7133 6764 SetAppName(self, String name)
6c3b4aae 6765
66c033b4
RD
6766 Set the application name. This value may be used automatically by
6767 `wx.Config` and such.
0df68c9f 6768 """
54f9ee45 6769 return _core_.PyApp_SetAppName(*args, **kwargs)
e811c8ce
RD
6770
6771 def GetClassName(*args, **kwargs):
0df68c9f 6772 """
a95a7133 6773 GetClassName(self) -> String
e811c8ce 6774
0df68c9f
RD
6775 Get the application's class name.
6776 """
54f9ee45 6777 return _core_.PyApp_GetClassName(*args, **kwargs)
e811c8ce
RD
6778
6779 def SetClassName(*args, **kwargs):
0df68c9f 6780 """
a95a7133 6781 SetClassName(self, String name)
6c3b4aae 6782
66c033b4
RD
6783 Set the application's class name. This value may be used for
6784 X-resources if applicable for the platform
0df68c9f 6785 """
54f9ee45 6786 return _core_.PyApp_SetClassName(*args, **kwargs)
e811c8ce
RD
6787
6788 def GetVendorName(*args, **kwargs):
0df68c9f 6789 """
a95a7133 6790 GetVendorName(self) -> String
6c3b4aae 6791
0df68c9f
RD
6792 Get the application's vendor name.
6793 """
54f9ee45 6794 return _core_.PyApp_GetVendorName(*args, **kwargs)
e811c8ce
RD
6795
6796 def SetVendorName(*args, **kwargs):
0df68c9f 6797 """
a95a7133 6798 SetVendorName(self, String name)
6c3b4aae 6799
66c033b4
RD
6800 Set the application's vendor name. This value may be used
6801 automatically by `wx.Config` and such.
0df68c9f 6802 """
54f9ee45 6803 return _core_.PyApp_SetVendorName(*args, **kwargs)
e811c8ce
RD
6804
6805 def GetTraits(*args, **kwargs):
0df68c9f 6806 """
a95a7133 6807 GetTraits(self) -> wxAppTraits
6c3b4aae 6808
66c033b4
RD
6809 Return (and create if necessary) the app traits object to which we
6810 delegate for everything which either should be configurable by the
6811 user (then he can change the default behaviour simply by overriding
6812 CreateTraits() and returning his own traits object) or which is
6813 GUI/console dependent as then wx.AppTraits allows us to abstract the
6814 differences behind the common facade.
6815
6816 :todo: Add support for overriding CreateAppTraits in wxPython.
0df68c9f 6817 """
54f9ee45 6818 return _core_.PyApp_GetTraits(*args, **kwargs)
e811c8ce
RD
6819
6820 def ProcessPendingEvents(*args, **kwargs):
0df68c9f 6821 """
a95a7133 6822 ProcessPendingEvents(self)
6c3b4aae 6823
66c033b4
RD
6824 Process all events in the Pending Events list -- it is necessary to
6825 call this function to process posted events. This normally happens
6826 during each event loop iteration.
0df68c9f 6827 """
54f9ee45 6828 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
6829
6830 def Yield(*args, **kwargs):
0df68c9f 6831 """
a95a7133 6832 Yield(self, bool onlyIfNeeded=False) -> bool
6c3b4aae 6833
66c033b4
RD
6834 Process all currently pending events right now, instead of waiting
6835 until return to the event loop. It is an error to call ``Yield``
6836 recursively unless the value of ``onlyIfNeeded`` is True.
6c3b4aae 6837
66c033b4 6838 :warning: This function is dangerous as it can lead to unexpected
41e2b43e
RD
6839 reentrancies (i.e. when called from an event handler it may
6840 result in calling the same event handler again), use with
6841 extreme care or, better, don't use at all!
0df68c9f 6842
66c033b4 6843 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
41e2b43e 6844
0df68c9f 6845 """
54f9ee45 6846 return _core_.PyApp_Yield(*args, **kwargs)
e811c8ce
RD
6847
6848 def WakeUpIdle(*args, **kwargs):
0df68c9f 6849 """
a95a7133 6850 WakeUpIdle(self)
6c3b4aae 6851
66c033b4
RD
6852 Make sure that idle events are sent again.
6853 :see: `wx.WakeUpIdle`
0df68c9f 6854 """
54f9ee45 6855 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
e811c8ce 6856
1fc3b23a
RD
6857 def IsMainLoopRunning(*args, **kwargs):
6858 """
6859 IsMainLoopRunning() -> bool
6860
6861 Returns True if we're running the main loop, i.e. if the events can
6862 currently be dispatched.
6863 """
6864 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6865
6866 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
e811c8ce 6867 def MainLoop(*args, **kwargs):
0df68c9f 6868 """
a95a7133 6869 MainLoop(self) -> int
6c3b4aae 6870
66c033b4
RD
6871 Execute the main GUI loop, the function doesn't normally return until
6872 all top level windows have been closed and destroyed.
0df68c9f 6873 """
54f9ee45 6874 return _core_.PyApp_MainLoop(*args, **kwargs)
e811c8ce
RD
6875
6876 def Exit(*args, **kwargs):
0df68c9f 6877 """
a95a7133 6878 Exit(self)
6c3b4aae 6879
0df68c9f 6880 Exit the main loop thus terminating the application.
66c033b4 6881 :see: `wx.Exit`
0df68c9f 6882 """
54f9ee45 6883 return _core_.PyApp_Exit(*args, **kwargs)
e811c8ce 6884
97ab0f6a
RD
6885 def GetLayoutDirection(*args, **kwargs):
6886 """
994453b8 6887 GetLayoutDirection(self) -> int
97ab0f6a
RD
6888
6889 Return the layout direction for the current locale.
6890 """
6891 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
6892
e811c8ce 6893 def ExitMainLoop(*args, **kwargs):
0df68c9f 6894 """
a95a7133 6895 ExitMainLoop(self)
6c3b4aae 6896
66c033b4
RD
6897 Exit the main GUI loop during the next iteration of the main
6898 loop, (i.e. it does not stop the program immediately!)
0df68c9f 6899 """
54f9ee45 6900 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
e811c8ce
RD
6901
6902 def Pending(*args, **kwargs):
0df68c9f 6903 """
a95a7133 6904 Pending(self) -> bool
6c3b4aae 6905
0df68c9f
RD
6906 Returns True if there are unprocessed events in the event queue.
6907 """
54f9ee45 6908 return _core_.PyApp_Pending(*args, **kwargs)
e811c8ce
RD
6909
6910 def Dispatch(*args, **kwargs):
0df68c9f 6911 """
a95a7133 6912 Dispatch(self) -> bool
6c3b4aae 6913
0df68c9f
RD
6914 Process the first event in the event queue (blocks until an event
6915 appears if there are none currently)
6916 """
54f9ee45 6917 return _core_.PyApp_Dispatch(*args, **kwargs)
e811c8ce
RD
6918
6919 def ProcessIdle(*args, **kwargs):
0df68c9f 6920 """
a95a7133 6921 ProcessIdle(self) -> bool
6c3b4aae 6922
66c033b4
RD
6923 Called from the MainLoop when the application becomes idle (there are
6924 no pending events) and sends a `wx.IdleEvent` to all interested
6925 parties. Returns True if more idle events are needed, False if not.
0df68c9f 6926 """
54f9ee45 6927 return _core_.PyApp_ProcessIdle(*args, **kwargs)
e811c8ce
RD
6928
6929 def SendIdleEvents(*args, **kwargs):
0df68c9f 6930 """
a95a7133 6931 SendIdleEvents(self, Window win, IdleEvent event) -> bool
e811c8ce 6932
66c033b4
RD
6933 Send idle event to window and all subwindows. Returns True if more
6934 idle time is requested.
0df68c9f 6935 """
54f9ee45 6936 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
e811c8ce
RD
6937
6938 def IsActive(*args, **kwargs):
0df68c9f 6939 """
a95a7133 6940 IsActive(self) -> bool
6c3b4aae 6941
0df68c9f
RD
6942 Return True if our app has focus.
6943 """
54f9ee45 6944 return _core_.PyApp_IsActive(*args, **kwargs)
e811c8ce
RD
6945
6946 def SetTopWindow(*args, **kwargs):
0df68c9f 6947 """
a95a7133 6948 SetTopWindow(self, Window win)
6c3b4aae 6949
66c033b4 6950 Set the *main* top level window
0df68c9f 6951 """
54f9ee45 6952 return _core_.PyApp_SetTopWindow(*args, **kwargs)
e811c8ce
RD
6953
6954 def GetTopWindow(*args, **kwargs):
0df68c9f 6955 """
a95a7133 6956 GetTopWindow(self) -> Window
6c3b4aae 6957
66c033b4
RD
6958 Return the *main* top level window (if it hadn't been set previously
6959 with SetTopWindow(), will return just some top level window and, if
6960 there not any, will return None)
0df68c9f 6961 """
54f9ee45 6962 return _core_.PyApp_GetTopWindow(*args, **kwargs)
e811c8ce
RD
6963
6964 def SetExitOnFrameDelete(*args, **kwargs):
0df68c9f 6965 """
a95a7133 6966 SetExitOnFrameDelete(self, bool flag)
0df68c9f 6967
66c033b4
RD
6968 Control the exit behaviour: by default, the program will exit the main
6969 loop (and so, usually, terminate) when the last top-level program
6970 window is deleted. Beware that if you disable this behaviour (with
6971 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6972 explicitly from somewhere.
0df68c9f 6973 """
54f9ee45 6974 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
6975
6976 def GetExitOnFrameDelete(*args, **kwargs):
0df68c9f 6977 """
a95a7133 6978 GetExitOnFrameDelete(self) -> bool
6c3b4aae 6979
0df68c9f
RD
6980 Get the current exit behaviour setting.
6981 """
54f9ee45 6982 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
6983
6984 def SetUseBestVisual(*args, **kwargs):
0df68c9f 6985 """
a95a7133 6986 SetUseBestVisual(self, bool flag)
6c3b4aae 6987
66c033b4
RD
6988 Set whether the app should try to use the best available visual on
6989 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
0df68c9f 6990 """
54f9ee45 6991 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
e811c8ce
RD
6992
6993 def GetUseBestVisual(*args, **kwargs):
0df68c9f 6994 """
a95a7133 6995 GetUseBestVisual(self) -> bool
6c3b4aae 6996
0df68c9f
RD
6997 Get current UseBestVisual setting.
6998 """
54f9ee45 6999 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
e811c8ce
RD
7000
7001 def SetPrintMode(*args, **kwargs):
a95a7133 7002 """SetPrintMode(self, int mode)"""
54f9ee45 7003 return _core_.PyApp_SetPrintMode(*args, **kwargs)
e811c8ce
RD
7004
7005 def GetPrintMode(*args, **kwargs):
a95a7133 7006 """GetPrintMode(self) -> int"""
54f9ee45 7007 return _core_.PyApp_GetPrintMode(*args, **kwargs)
e811c8ce 7008
e811c8ce 7009 def SetAssertMode(*args, **kwargs):
0df68c9f 7010 """
a95a7133 7011 SetAssertMode(self, int mode)
6c3b4aae 7012
41e2b43e 7013 Set the OnAssert behaviour for debug and hybrid builds.
0df68c9f 7014 """
54f9ee45 7015 return _core_.PyApp_SetAssertMode(*args, **kwargs)
e811c8ce 7016
6c3b4aae 7017 def GetAssertMode(*args, **kwargs):
0df68c9f 7018 """
a95a7133 7019 GetAssertMode(self) -> int
6c3b4aae 7020
0df68c9f
RD
7021 Get the current OnAssert behaviour setting.
7022 """
54f9ee45 7023 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6c3b4aae 7024
e811c8ce 7025 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 7026 """GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 7027 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
7028
7029 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7030 def GetMacAboutMenuItemId(*args, **kwargs):
66c033b4 7031 """GetMacAboutMenuItemId() -> long"""
54f9ee45 7032 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
7033
7034 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7035 def GetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 7036 """GetMacPreferencesMenuItemId() -> long"""
54f9ee45 7037 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
7038
7039 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7040 def GetMacExitMenuItemId(*args, **kwargs):
66c033b4 7041 """GetMacExitMenuItemId() -> long"""
54f9ee45 7042 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
7043
7044 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7045 def GetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 7046 """GetMacHelpMenuTitleName() -> String"""
54f9ee45 7047 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
7048
7049 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7050 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 7051 """SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 7052 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
7053
7054 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7055 def SetMacAboutMenuItemId(*args, **kwargs):
66c033b4 7056 """SetMacAboutMenuItemId(long val)"""
54f9ee45 7057 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
7058
7059 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7060 def SetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 7061 """SetMacPreferencesMenuItemId(long val)"""
54f9ee45 7062 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
7063
7064 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7065 def SetMacExitMenuItemId(*args, **kwargs):
66c033b4 7066 """SetMacExitMenuItemId(long val)"""
54f9ee45 7067 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
7068
7069 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7070 def SetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 7071 """SetMacHelpMenuTitleName(String val)"""
54f9ee45 7072 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
7073
7074 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7075 def _BootstrapApp(*args, **kwargs):
0df68c9f 7076 """
a95a7133 7077 _BootstrapApp(self)
6c3b4aae 7078
0df68c9f
RD
7079 For internal use only
7080 """
54f9ee45 7081 return _core_.PyApp__BootstrapApp(*args, **kwargs)
e811c8ce
RD
7082
7083 def GetComCtl32Version(*args, **kwargs):
0df68c9f 7084 """
66c033b4 7085 GetComCtl32Version() -> int
6c3b4aae 7086
66c033b4
RD
7087 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7088 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 7089 """
54f9ee45 7090 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
e811c8ce
RD
7091
7092 GetComCtl32Version = staticmethod(GetComCtl32Version)
33d6fd3b 7093 def IsDisplayAvailable(*args, **kwargs):
fc46b7f3 7094 """
33d6fd3b 7095 IsDisplayAvailable() -> bool
fc46b7f3
RD
7096
7097 Tests if it is possible to create a GUI in the current environment.
7098 This will mean different things on the different platforms.
7099
7100 * On X Windows systems this function will return ``False`` if it is
7101 not able to open a connection to the X display, which can happen
7102 if $DISPLAY is not set, or is not set correctly.
7103
7104 * On Mac OS X a ``False`` return value will mean that wx is not
7105 able to access the window manager, which can happen if logged in
7106 remotely or if running from the normal version of python instead
7107 of the framework version, (i.e., pythonw.)
7108
7109 * On MS Windows...
7110
7111 """
33d6fd3b
RD
7112 return _core_.PyApp_IsDisplayAvailable(*args, **kwargs)
7113
7114 IsDisplayAvailable = staticmethod(IsDisplayAvailable)
7115 AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`")
7116 AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`")
7117 ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`")
7118 ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7119 LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`")
7120 PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`")
7121 TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`")
7122 Traits = property(GetTraits,doc="See `GetTraits`")
7123 UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`")
7124 VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`")
7125 Active = property(IsActive)
2131d850 7126_core_.PyApp_swigregister(PyApp)
d14a1e28 7127
0085ce49
RD
7128def PyApp_IsMainLoopRunning(*args):
7129 """
1fc3b23a
RD
7130 PyApp_IsMainLoopRunning() -> bool
7131
7132 Returns True if we're running the main loop, i.e. if the events can
7133 currently be dispatched.
7134 """
0085ce49 7135 return _core_.PyApp_IsMainLoopRunning(*args)
1fc3b23a 7136
0085ce49
RD
7137def PyApp_GetMacSupportPCMenuShortcuts(*args):
7138 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7139 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d14a1e28 7140
0085ce49
RD
7141def PyApp_GetMacAboutMenuItemId(*args):
7142 """PyApp_GetMacAboutMenuItemId() -> long"""
7143 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d14a1e28 7144
0085ce49
RD
7145def PyApp_GetMacPreferencesMenuItemId(*args):
7146 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7147 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d14a1e28 7148
0085ce49
RD
7149def PyApp_GetMacExitMenuItemId(*args):
7150 """PyApp_GetMacExitMenuItemId() -> long"""
7151 return _core_.PyApp_GetMacExitMenuItemId(*args)
d14a1e28 7152
0085ce49
RD
7153def PyApp_GetMacHelpMenuTitleName(*args):
7154 """PyApp_GetMacHelpMenuTitleName() -> String"""
7155 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d14a1e28 7156
e811c8ce 7157def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
0085ce49
RD
7158 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7159 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 7160
e811c8ce 7161def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
0085ce49
RD
7162 """PyApp_SetMacAboutMenuItemId(long val)"""
7163 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 7164
e811c8ce 7165def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
0085ce49
RD
7166 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7167 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 7168
e811c8ce 7169def PyApp_SetMacExitMenuItemId(*args, **kwargs):
0085ce49
RD
7170 """PyApp_SetMacExitMenuItemId(long val)"""
7171 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d14a1e28 7172
e811c8ce 7173def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
0085ce49
RD
7174 """PyApp_SetMacHelpMenuTitleName(String val)"""
7175 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 7176
0085ce49
RD
7177def PyApp_GetComCtl32Version(*args):
7178 """
0df68c9f 7179 PyApp_GetComCtl32Version() -> int
6c3b4aae 7180
66c033b4
RD
7181 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7182 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 7183 """
0085ce49 7184 return _core_.PyApp_GetComCtl32Version(*args)
d14a1e28 7185
33d6fd3b 7186def PyApp_IsDisplayAvailable(*args):
fc46b7f3 7187 """
33d6fd3b 7188 PyApp_IsDisplayAvailable() -> bool
fc46b7f3
RD
7189
7190 Tests if it is possible to create a GUI in the current environment.
7191 This will mean different things on the different platforms.
7192
7193 * On X Windows systems this function will return ``False`` if it is
7194 not able to open a connection to the X display, which can happen
7195 if $DISPLAY is not set, or is not set correctly.
7196
7197 * On Mac OS X a ``False`` return value will mean that wx is not
7198 able to access the window manager, which can happen if logged in
7199 remotely or if running from the normal version of python instead
7200 of the framework version, (i.e., pythonw.)
7201
7202 * On MS Windows...
7203
7204 """
33d6fd3b 7205 return _core_.PyApp_IsDisplayAvailable(*args)
fc46b7f3 7206
d14a1e28
RD
7207#---------------------------------------------------------------------------
7208
7209
0085ce49
RD
7210def Exit(*args):
7211 """
0df68c9f 7212 Exit()
6c3b4aae 7213
0df68c9f
RD
7214 Force an exit of the application. Convenience for wx.GetApp().Exit()
7215 """
0085ce49 7216 return _core_.Exit(*args)
d14a1e28 7217
0085ce49
RD
7218def Yield(*args):
7219 """
0df68c9f 7220 Yield() -> bool
6c3b4aae 7221
0df68c9f
RD
7222 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7223 """
0085ce49 7224 return _core_.Yield(*args)
d14a1e28 7225
0085ce49
RD
7226def YieldIfNeeded(*args):
7227 """
0df68c9f 7228 YieldIfNeeded() -> bool
6c3b4aae 7229
0df68c9f
RD
7230 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7231 """
0085ce49 7232 return _core_.YieldIfNeeded(*args)
d14a1e28 7233
e811c8ce 7234def SafeYield(*args, **kwargs):
0085ce49 7235 """
0df68c9f 7236 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6c3b4aae 7237
66c033b4
RD
7238 This function is similar to `wx.Yield`, except that it disables the
7239 user input to all program windows before calling `wx.Yield` and
7240 re-enables it again afterwards. If ``win`` is not None, this window
7241 will remain enabled, allowing the implementation of some limited user
7242 interaction.
6c3b4aae 7243
66c033b4 7244 :Returns: the result of the call to `wx.Yield`.
0df68c9f 7245 """
0085ce49 7246 return _core_.SafeYield(*args, **kwargs)
d14a1e28 7247
0085ce49
RD
7248def WakeUpIdle(*args):
7249 """
0df68c9f 7250 WakeUpIdle()
6c3b4aae 7251
66c033b4
RD
7252 Cause the message queue to become empty again, so idle events will be
7253 sent.
0df68c9f 7254 """
0085ce49 7255 return _core_.WakeUpIdle(*args)
d14a1e28 7256
e811c8ce 7257def PostEvent(*args, **kwargs):
0085ce49 7258 """
0df68c9f 7259 PostEvent(EvtHandler dest, Event event)
6c3b4aae 7260
66c033b4
RD
7261 Send an event to a window or other wx.EvtHandler to be processed
7262 later.
0df68c9f 7263 """
0085ce49 7264 return _core_.PostEvent(*args, **kwargs)
d14a1e28 7265
0085ce49
RD
7266def App_CleanUp(*args):
7267 """
0df68c9f 7268 App_CleanUp()
6c3b4aae 7269
41e2b43e 7270 For internal use only, it is used to cleanup after wxWidgets when
66c033b4 7271 Python shuts down.
0df68c9f 7272 """
0085ce49 7273 return _core_.App_CleanUp(*args)
d14a1e28 7274
0085ce49
RD
7275def GetApp(*args):
7276 """
0df68c9f 7277 GetApp() -> PyApp
6c3b4aae 7278
196addbf 7279 Return a reference to the current wx.App object.
0df68c9f 7280 """
0085ce49 7281 return _core_.GetApp(*args)
5cbf236d
RD
7282
7283def SetDefaultPyEncoding(*args, **kwargs):
0085ce49 7284 """
5cbf236d
RD
7285 SetDefaultPyEncoding(string encoding)
7286
7287 Sets the encoding that wxPython will use when it needs to convert a
7288 Python string or unicode object to or from a wxString.
e505d15e
RD
7289
7290 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7291 but please be aware that the default encoding within the same locale
7292 may be slightly different on different platforms. For example, please
7293 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7294 between the common latin/roman encodings.
5cbf236d 7295 """
0085ce49 7296 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 7297
0085ce49
RD
7298def GetDefaultPyEncoding(*args):
7299 """
5cbf236d
RD
7300 GetDefaultPyEncoding() -> string
7301
7302 Gets the current encoding that wxPython will use when it needs to
7303 convert a Python string or unicode object to or from a wxString.
7304 """
0085ce49 7305 return _core_.GetDefaultPyEncoding(*args)
d14a1e28
RD
7306#----------------------------------------------------------------------
7307
7308class PyOnDemandOutputWindow:
6c3b4aae
RD
7309 """
7310 A class that can be used for redirecting Python's stdout and
7311 stderr streams. It will do nothing until something is wrriten to
7312 the stream at which point it will create a Frame with a text area
7313 and write the text there.
7314 """
d14a1e28
RD
7315 def __init__(self, title = "wxPython: stdout/stderr"):
7316 self.frame = None
7317 self.title = title
412d302d
RD
7318 self.pos = wx.DefaultPosition
7319 self.size = (450, 300)
d14a1e28
RD
7320 self.parent = None
7321
7322 def SetParent(self, parent):
6c3b4aae 7323 """Set the window to be used as the popup Frame's parent."""
d14a1e28
RD
7324 self.parent = parent
7325
6c3b4aae
RD
7326
7327 def CreateOutputWindow(self, st):
412d302d
RD
7328 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7329 style=wx.DEFAULT_FRAME_STYLE)
196addbf 7330 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7331 style=wx.TE_MULTILINE|wx.TE_READONLY)
d1e20054 7332 self.text.AppendText(st)
6c3b4aae 7333 self.frame.Show(True)
2131d850 7334 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
6c3b4aae 7335
d14a1e28 7336
7409c0c6
RD
7337 def OnCloseWindow(self, event):
7338 if self.frame is not None:
7339 self.frame.Destroy()
7340 self.frame = None
7341 self.text = None
7342
7343
d14a1e28 7344 # These methods provide the file-like output behaviour.
6c3b4aae
RD
7345 def write(self, text):
7346 """
7347 Create the output window if needed and write the string to it.
7348 If not called in the context of the gui thread then uses
7349 CallAfter to do the work there.
7350 """
7351 if self.frame is None:
7352 if not wx.Thread_IsMain():
7353 wx.CallAfter(self.CreateOutputWindow, text)
7354 else:
7355 self.CreateOutputWindow(text)
7356 else:
7357 if not wx.Thread_IsMain():
7358 wx.CallAfter(self.text.AppendText, text)
7359 else:
7360 self.text.AppendText(text)
7361
d14a1e28
RD
7362
7363 def close(self):
6c3b4aae
RD
7364 if self.frame is not None:
7365 wx.CallAfter(self.frame.Close)
7366
d14a1e28 7367
19272049
RD
7368 def flush(self):
7369 pass
7370
7371
d14a1e28
RD
7372
7373#----------------------------------------------------------------------
d14a1e28
RD
7374
7375_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
fc46b7f3 7376
d14a1e28 7377class App(wx.PyApp):
6c3b4aae 7378 """
66c033b4
RD
7379 The ``wx.App`` class represents the application and is used to:
7380
7381 * bootstrap the wxPython system and initialize the underlying
7382 gui toolkit
7383 * set and get application-wide properties
7384 * implement the windowing system main message or event loop,
7385 and to dispatch events to window instances
7386 * etc.
7387
7388 Every application must have a ``wx.App`` instance, and all
7389 creation of UI objects should be delayed until after the
03e37cd5
RD
7390 ``wx.App`` object has been created in order to ensure that the gui
7391 platform and wxWidgets have been fully initialized.
66c033b4
RD
7392
7393 Normally you would derive from this class and implement an
7394 ``OnInit`` method that creates a frame and then calls
7395 ``self.SetTopWindow(frame)``.
7396
03e37cd5 7397 :see: `wx.PySimpleApp` for a simpler app class that can be used
1c0f361b 7398 directly.
6c3b4aae 7399 """
66c033b4 7400
d14a1e28
RD
7401 outputWindowClass = PyOnDemandOutputWindow
7402
03e37cd5
RD
7403 def __init__(self, redirect=_defRedirect, filename=None,
7404 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7405 """
7406 Construct a ``wx.App`` object.
7407
03e37cd5
RD
7408 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7409 redirected? Defaults to True on Windows and Mac, False
7410 otherwise. If `filename` is None then output will be
7411 redirected to a window that pops up as needed. (You can
7412 control what kind of window is created for the output by
7413 resetting the class variable ``outputWindowClass`` to a
7414 class of your choosing.)
66c033b4 7415
03e37cd5
RD
7416 :param filename: The name of a file to redirect output to, if
7417 redirect is True.
66c033b4
RD
7418
7419 :param useBestVisual: Should the app try to use the best
03e37cd5
RD
7420 available visual provided by the system (only relevant on
7421 systems that have more than one visual.) This parameter
7422 must be used instead of calling `SetUseBestVisual` later
7423 on because it must be set before the underlying GUI
7424 toolkit is initialized.
7425
7426 :param clearSigInt: Should SIGINT be cleared? This allows the
7427 app to terminate upon a Ctrl-C in the console like other
7428 GUI apps will.
66c033b4
RD
7429
7430 :note: You should override OnInit to do applicaition
7431 initialization to ensure that the system, toolkit and
7432 wxWidgets are fully initialized.
7433 """
fc46b7f3 7434
d14a1e28
RD
7435 wx.PyApp.__init__(self)
7436
fc46b7f3 7437 # make sure we can create a GUI
33d6fd3b 7438 if not self.IsDisplayAvailable():
fc46b7f3
RD
7439
7440 if wx.Platform == "__WXMAC__":
7441 msg = """This program needs access to the screen.
7442Please run with 'pythonw', not 'python', and only when you are logged
7443in on the main display of your Mac."""
7444
7445 elif wx.Platform == "__WXGTK__":
7446 msg ="Unable to access the X Display, is $DISPLAY set properly?"
d14a1e28 7447
fc46b7f3
RD
7448 else:
7449 msg = "Unable to create GUI"
7450 # TODO: more description is needed for wxMSW...
7451
7452 raise SystemExit(msg)
7453
d14a1e28
RD
7454 # This has to be done before OnInit
7455 self.SetUseBestVisual(useBestVisual)
7456
7457 # Set the default handler for SIGINT. This fixes a problem
7458 # where if Ctrl-C is pressed in the console that started this
7459 # app then it will not appear to do anything, (not even send
7460 # KeyboardInterrupt???) but will later segfault on exit. By
7461 # setting the default handler then the app will exit, as
7462 # expected (depending on platform.)
03e37cd5
RD
7463 if clearSigInt:
7464 try:
7465 import signal
7466 signal.signal(signal.SIGINT, signal.SIG_DFL)
7467 except:
7468 pass
d14a1e28
RD
7469
7470 # Save and redirect the stdio to a window?
7471 self.stdioWin = None
7472 self.saveStdio = (_sys.stdout, _sys.stderr)
7473 if redirect:
7474 self.RedirectStdio(filename)
7475
8fb0e70a
RD
7476 # Use Python's install prefix as the default
7477 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7478
d14a1e28
RD
7479 # This finishes the initialization of wxWindows and then calls
7480 # the OnInit that should be present in the derived class
7481 self._BootstrapApp()
7482
7483
01f6b6d3
RD
7484 def OnPreInit(self):
7485 """
7486 Things that must be done after _BootstrapApp has done its
7487 thing, but would be nice if they were already done by the time
7488 that OnInit is called.
7489 """
7490 wx.StockGDI._initStockObjects()
7491
7492
02b455f2
RD
7493 def __del__(self, destroy=wx.PyApp.__del__):
7494 self.RestoreStdio() # Just in case the MainLoop was overridden
7495 destroy(self)
d14a1e28 7496
70b7a5fe 7497 def Destroy(self):
b39fe951 7498 self.this.own(False)
70b7a5fe 7499 wx.PyApp.Destroy(self)
d14a1e28
RD
7500
7501 def SetTopWindow(self, frame):
1e0c8722 7502 """Set the \"main\" top level window"""
d14a1e28
RD
7503 if self.stdioWin:
7504 self.stdioWin.SetParent(frame)
7505 wx.PyApp.SetTopWindow(self, frame)
7506
7507
7508 def MainLoop(self):
1e0c8722 7509 """Execute the main GUI event loop"""
d14a1e28
RD
7510 wx.PyApp.MainLoop(self)
7511 self.RestoreStdio()
7512
7513
7409c0c6 7514 def RedirectStdio(self, filename=None):
1e0c8722 7515 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
d14a1e28
RD
7516 if filename:
7517 _sys.stdout = _sys.stderr = open(filename, 'a')
7518 else:
7519 self.stdioWin = self.outputWindowClass()
7520 _sys.stdout = _sys.stderr = self.stdioWin
7521
7522
7523 def RestoreStdio(self):
02b455f2
RD
7524 try:
7525 _sys.stdout, _sys.stderr = self.saveStdio
7526 except:
7527 pass
d14a1e28
RD
7528
7529
412d302d
RD
7530 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7531 """
7532 Set the title, position and/or size of the output window if
f5b96ee1
RD
7533 the stdio has been redirected. This should be called before
7534 any output would cause the output window to be created.
412d302d
RD
7535 """
7536 if self.stdioWin:
7537 if title is not None:
7538 self.stdioWin.title = title
7539 if pos is not None:
7540 self.stdioWin.pos = pos
7541 if size is not None:
7542 self.stdioWin.size = size
7543
7544
7545
d14a1e28 7546
66c033b4 7547# change from wx.PyApp_XX to wx.App_XX
54f9ee45
RD
7548App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7549App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7550App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7551App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7552App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7553App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7554App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7555App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7556App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7557App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7558App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
d14a1e28
RD
7559
7560#----------------------------------------------------------------------------
7561
7562class PySimpleApp(wx.App):
6c3b4aae
RD
7563 """
7564 A simple application class. You can just create one of these and
7565 then then make your top level windows later, and not have to worry
66c033b4
RD
7566 about OnInit. For example::
7567
7568 app = wx.PySimpleApp()
7569 frame = wx.Frame(None, title='Hello World')
7570 frame.Show()
7571 app.MainLoop()
7572
7573 :see: `wx.App`
7574 """
6c3b4aae 7575
03e37cd5
RD
7576 def __init__(self, redirect=False, filename=None,
7577 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7578 """
7579 :see: `wx.App.__init__`
7580 """
03e37cd5 7581 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
6c3b4aae 7582
d14a1e28 7583 def OnInit(self):
d14a1e28
RD
7584 return True
7585
7586
66c033b4 7587
6c3b4aae 7588# Is anybody using this one?
d14a1e28
RD
7589class PyWidgetTester(wx.App):
7590 def __init__(self, size = (250, 100)):
7591 self.size = size
7592 wx.App.__init__(self, 0)
7593
7594 def OnInit(self):
196addbf 7595 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
d14a1e28
RD
7596 self.SetTopWindow(self.frame)
7597 return True
7598
66c033b4
RD
7599 def SetWidget(self, widgetClass, *args, **kwargs):
7600 w = widgetClass(self.frame, *args, **kwargs)
d14a1e28
RD
7601 self.frame.Show(True)
7602
7603#----------------------------------------------------------------------------
7604# DO NOT hold any other references to this object. This is how we
66c033b4 7605# know when to cleanup system resources that wxWidgets is holding. When
d14a1e28 7606# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
66c033b4 7607# goes to zero and it calls the wx.App_CleanUp function.
d14a1e28
RD
7608
7609class __wxPyCleanup:
7610 def __init__(self):
54f9ee45 7611 self.cleanup = _core_.App_CleanUp
d14a1e28
RD
7612 def __del__(self):
7613 self.cleanup()
7614
7615_sys.__wxPythonCleanup = __wxPyCleanup()
7616
7617## # another possible solution, but it gets called too early...
66c033b4
RD
7618## import atexit
7619## atexit.register(_core_.wxApp_CleanUp)
d14a1e28
RD
7620
7621
7622#----------------------------------------------------------------------------
7623
7624#---------------------------------------------------------------------------
2ef75293
RD
7625
7626class EventLoop(object):
093d3ff1 7627 """Proxy of C++ EventLoop class"""
0085ce49
RD
7628 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7629 __repr__ = _swig_repr
7630 def __init__(self, *args, **kwargs):
2ef75293 7631 """__init__(self) -> EventLoop"""
0085ce49
RD
7632 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7633 __swig_destroy__ = _core_.delete_EventLoop
7634 __del__ = lambda self : None;
2ef75293
RD
7635 def Run(*args, **kwargs):
7636 """Run(self) -> int"""
7637 return _core_.EventLoop_Run(*args, **kwargs)
7638
7639 def Exit(*args, **kwargs):
7640 """Exit(self, int rc=0)"""
7641 return _core_.EventLoop_Exit(*args, **kwargs)
7642
7643 def Pending(*args, **kwargs):
7644 """Pending(self) -> bool"""
7645 return _core_.EventLoop_Pending(*args, **kwargs)
7646
7647 def Dispatch(*args, **kwargs):
7648 """Dispatch(self) -> bool"""
7649 return _core_.EventLoop_Dispatch(*args, **kwargs)
7650
7651 def IsRunning(*args, **kwargs):
7652 """IsRunning(self) -> bool"""
7653 return _core_.EventLoop_IsRunning(*args, **kwargs)
7654
7655 def GetActive(*args, **kwargs):
7656 """GetActive() -> EventLoop"""
7657 return _core_.EventLoop_GetActive(*args, **kwargs)
7658
7659 GetActive = staticmethod(GetActive)
7660 def SetActive(*args, **kwargs):
7661 """SetActive(EventLoop loop)"""
7662 return _core_.EventLoop_SetActive(*args, **kwargs)
7663
7664 SetActive = staticmethod(SetActive)
2131d850 7665_core_.EventLoop_swigregister(EventLoop)
2ef75293 7666
0085ce49
RD
7667def EventLoop_GetActive(*args):
7668 """EventLoop_GetActive() -> EventLoop"""
7669 return _core_.EventLoop_GetActive(*args)
2ef75293
RD
7670
7671def EventLoop_SetActive(*args, **kwargs):
0085ce49
RD
7672 """EventLoop_SetActive(EventLoop loop)"""
7673 return _core_.EventLoop_SetActive(*args, **kwargs)
2ef75293 7674
091f5bed
RD
7675class EventLoopActivator(object):
7676 """Proxy of C++ EventLoopActivator class"""
0085ce49
RD
7677 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7678 __repr__ = _swig_repr
7679 def __init__(self, *args, **kwargs):
091f5bed 7680 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
0085ce49
RD
7681 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7682 __swig_destroy__ = _core_.delete_EventLoopActivator
7683 __del__ = lambda self : None;
2131d850 7684_core_.EventLoopActivator_swigregister(EventLoopActivator)
091f5bed 7685
2ef75293 7686#---------------------------------------------------------------------------
d14a1e28 7687
eec1c382
RD
7688ACCEL_ALT = _core_.ACCEL_ALT
7689ACCEL_CTRL = _core_.ACCEL_CTRL
7690ACCEL_SHIFT = _core_.ACCEL_SHIFT
7691ACCEL_NORMAL = _core_.ACCEL_NORMAL
7692ACCEL_CMD = _core_.ACCEL_CMD
1e0c8722 7693class AcceleratorEntry(object):
66c033b4
RD
7694 """
7695 A class used to define items in an `wx.AcceleratorTable`. wxPython
7696 programs can choose to use wx.AcceleratorEntry objects, but using a
7697 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
41e2b43e 7698 as well. See `__init__` for of the tuple values.
66c033b4
RD
7699
7700 :see: `wx.AcceleratorTable`
7701 """
0085ce49
RD
7702 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7703 __repr__ = _swig_repr
7704 def __init__(self, *args, **kwargs):
66c033b4
RD
7705 """
7706 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7707
7708 Construct a wx.AcceleratorEntry.
66c033b4 7709 """
0085ce49
RD
7710 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7711 __swig_destroy__ = _core_.delete_AcceleratorEntry
7712 __del__ = lambda self : None;
1e0c8722 7713 def Set(*args, **kwargs):
66c033b4
RD
7714 """
7715 Set(self, int flags, int keyCode, int cmd)
1e0c8722 7716
66c033b4
RD
7717 (Re)set the attributes of a wx.AcceleratorEntry.
7718 :see `__init__`
7719 """
7720 return _core_.AcceleratorEntry_Set(*args, **kwargs)
1e0c8722 7721
97ab0f6a
RD
7722 def Create(*args, **kwargs):
7723 """
7724 Create(String str) -> AcceleratorEntry
7725
7726 Create accelerator corresponding to the specified string, or None if
7727 it coulnd't be parsed.
7728 """
7729 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7730
7731 Create = staticmethod(Create)
1e0c8722 7732 def GetFlags(*args, **kwargs):
66c033b4
RD
7733 """
7734 GetFlags(self) -> int
7735
7736 Get the AcceleratorEntry's flags.
7737 """
54f9ee45 7738 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
1e0c8722
RD
7739
7740 def GetKeyCode(*args, **kwargs):
66c033b4
RD
7741 """
7742 GetKeyCode(self) -> int
7743
7744 Get the AcceleratorEntry's keycode.
7745 """
54f9ee45 7746 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
1e0c8722
RD
7747
7748 def GetCommand(*args, **kwargs):
66c033b4
RD
7749 """
7750 GetCommand(self) -> int
7751
7752 Get the AcceleratorEntry's command ID.
7753 """
54f9ee45 7754 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
1e0c8722 7755
97ab0f6a
RD
7756 def IsOk(*args, **kwargs):
7757 """IsOk(self) -> bool"""
7758 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
7759
7760 def ToString(*args, **kwargs):
7761 """
7762 ToString(self) -> String
7763
7764 Returns a string representation for the this accelerator. The string
7765 is formatted using the <flags>-<keycode> format where <flags> maybe a
7766 hyphen-separed list of "shift|alt|ctrl"
7767
7768 """
7769 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
7770
7771 def FromString(*args, **kwargs):
7772 """
7773 FromString(self, String str) -> bool
7774
7775 Returns true if the given string correctly initialized this object.
7776 """
7777 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
7778
2bf58437
RD
7779 Command = property(GetCommand,doc="See `GetCommand`")
7780 Flags = property(GetFlags,doc="See `GetFlags`")
7781 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
2131d850 7782_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
1e0c8722 7783
97ab0f6a
RD
7784def AcceleratorEntry_Create(*args, **kwargs):
7785 """
7786 AcceleratorEntry_Create(String str) -> AcceleratorEntry
7787
7788 Create accelerator corresponding to the specified string, or None if
7789 it coulnd't be parsed.
7790 """
7791 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7792
1e0c8722 7793class AcceleratorTable(Object):
66c033b4
RD
7794 """
7795 An accelerator table allows the application to specify a table of
7796 keyboard shortcuts for menus or other commands. On Windows, menu or
7797 button commands are supported; on GTK, only menu commands are
7798 supported.
66c033b4 7799 """
0085ce49
RD
7800 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7801 __repr__ = _swig_repr
7802 def __init__(self, *args, **kwargs):
0df68c9f
RD
7803 """
7804 __init__(entries) -> AcceleratorTable
1e0c8722 7805
66c033b4
RD
7806 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7807 items or or of 3-tuples (flags, keyCode, cmdID)
7808
7809 :see: `wx.AcceleratorEntry`
0df68c9f 7810 """
0085ce49
RD
7811 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7812 __swig_destroy__ = _core_.delete_AcceleratorTable
7813 __del__ = lambda self : None;
b39fe951
RD
7814 def IsOk(*args, **kwargs):
7815 """IsOk(self) -> bool"""
7816 return _core_.AcceleratorTable_IsOk(*args, **kwargs)
1e0c8722 7817
b39fe951 7818 Ok = IsOk
2131d850 7819_core_.AcceleratorTable_swigregister(AcceleratorTable)
1e0c8722
RD
7820
7821
7822def GetAccelFromString(*args, **kwargs):
0085ce49
RD
7823 """GetAccelFromString(String label) -> AcceleratorEntry"""
7824 return _core_.GetAccelFromString(*args, **kwargs)
1e0c8722
RD
7825#---------------------------------------------------------------------------
7826
74a57fcd
RD
7827class VisualAttributes(object):
7828 """struct containing all the visual attributes of a control"""
0085ce49
RD
7829 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7830 __repr__ = _swig_repr
7831 def __init__(self, *args, **kwargs):
74a57fcd 7832 """
a95a7133 7833 __init__(self) -> VisualAttributes
74a57fcd
RD
7834
7835 struct containing all the visual attributes of a control
7836 """
0085ce49
RD
7837 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7838 __swig_destroy__ = _core_.delete_VisualAttributes
7839 __del__ = lambda self : None;
54f9ee45
RD
7840 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7841 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7842 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 7843_core_.VisualAttributes_swigregister(VisualAttributes)
74a57fcd
RD
7844NullAcceleratorTable = cvar.NullAcceleratorTable
7845PanelNameStr = cvar.PanelNameStr
7846
54f9ee45
RD
7847WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7848WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7849WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7850WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7851WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
d14a1e28 7852class Window(EvtHandler):
15afbcd0
RD
7853 """
7854 wx.Window is the base class for all windows and represents any visible
7855 object on the screen. All controls, top level windows and so on are
7856 wx.Windows. Sizers and device contexts are not however, as they don't
7857 appear on screen themselves.
7858
7859 """
0085ce49
RD
7860 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7861 __repr__ = _swig_repr
7862 def __init__(self, *args, **kwargs):
0df68c9f 7863 """
a95a7133 7864 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 7865 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
15afbcd0
RD
7866
7867 Construct and show a generic Window.
0df68c9f 7868 """
0085ce49 7869 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d14a1e28 7870 self._setOORInfo(self)
d14a1e28 7871
e811c8ce 7872 def Create(*args, **kwargs):
0df68c9f 7873 """
a95a7133 7874 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 7875 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
15afbcd0
RD
7876
7877 Create the GUI part of the Window for 2-phase creation mode.
0df68c9f 7878 """
54f9ee45 7879 return _core_.Window_Create(*args, **kwargs)
d14a1e28 7880
e811c8ce 7881 def Close(*args, **kwargs):
15afbcd0 7882 """
a95a7133 7883 Close(self, bool force=False) -> bool
15afbcd0
RD
7884
7885 This function simply generates a EVT_CLOSE event whose handler usually
7886 tries to close the window. It doesn't close the window itself,
7887 however. If force is False (the default) then the window's close
7888 handler will be allowed to veto the destruction of the window.
15afbcd0 7889 """
54f9ee45 7890 return _core_.Window_Close(*args, **kwargs)
d14a1e28 7891
e811c8ce 7892 def Destroy(*args, **kwargs):
0df68c9f 7893 """
a95a7133 7894 Destroy(self) -> bool
d14a1e28 7895
15afbcd0
RD
7896 Destroys the window safely. Frames and dialogs are not destroyed
7897 immediately when this function is called -- they are added to a list
7898 of windows to be deleted on idle time, when all the window's events
7899 have been processed. This prevents problems with events being sent to
7900 non-existent windows.
7901
7902 Returns True if the window has either been successfully deleted, or it
7903 has been added to the list of windows pending real deletion.
0df68c9f 7904 """
b39fe951
RD
7905 args[0].this.own(False)
7906 return _core_.Window_Destroy(*args, **kwargs)
d14a1e28 7907
e811c8ce 7908 def DestroyChildren(*args, **kwargs):
15afbcd0 7909 """
a95a7133 7910 DestroyChildren(self) -> bool
15afbcd0 7911
41e2b43e
RD
7912 Destroys all children of a window. Called automatically by the
7913 destructor.
15afbcd0 7914 """
54f9ee45 7915 return _core_.Window_DestroyChildren(*args, **kwargs)
d14a1e28 7916
e811c8ce 7917 def IsBeingDeleted(*args, **kwargs):
15afbcd0 7918 """
a95a7133 7919 IsBeingDeleted(self) -> bool
15afbcd0
RD
7920
7921 Is the window in the process of being deleted?
7922 """
54f9ee45 7923 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d14a1e28 7924
e811c8ce 7925 def SetLabel(*args, **kwargs):
15afbcd0 7926 """
a95a7133 7927 SetLabel(self, String label)
15afbcd0
RD
7928
7929 Set the text which the window shows in its label if applicable.
7930 """
54f9ee45 7931 return _core_.Window_SetLabel(*args, **kwargs)
d14a1e28 7932
e811c8ce 7933 def GetLabel(*args, **kwargs):
15afbcd0 7934 """
a95a7133 7935 GetLabel(self) -> String
15afbcd0 7936
41e2b43e
RD
7937 Generic way of getting a label from any window, for identification
7938 purposes. The interpretation of this function differs from class to
7939 class. For frames and dialogs, the value returned is the title. For
7940 buttons or static text controls, it is the button text. This function
7941 can be useful for meta-programs such as testing tools or special-needs
7942 access programs)which need to identify windows by name.
15afbcd0 7943 """
54f9ee45 7944 return _core_.Window_GetLabel(*args, **kwargs)
d14a1e28 7945
e811c8ce 7946 def SetName(*args, **kwargs):
15afbcd0 7947 """
a95a7133 7948 SetName(self, String name)
15afbcd0 7949
41e2b43e
RD
7950 Sets the window's name. The window name is used for ressource setting
7951 in X, it is not the same as the window title/label
15afbcd0 7952 """
54f9ee45 7953 return _core_.Window_SetName(*args, **kwargs)
d14a1e28 7954
e811c8ce 7955 def GetName(*args, **kwargs):
15afbcd0 7956 """
a95a7133 7957 GetName(self) -> String
15afbcd0 7958
41e2b43e
RD
7959 Returns the windows name. This name is not guaranteed to be unique;
7960 it is up to the programmer to supply an appropriate name in the window
7961 constructor or via wx.Window.SetName.
15afbcd0 7962 """
54f9ee45 7963 return _core_.Window_GetName(*args, **kwargs)
d14a1e28 7964
4276dc52
RD
7965 def SetWindowVariant(*args, **kwargs):
7966 """
a95a7133 7967 SetWindowVariant(self, int variant)
4276dc52 7968
41e2b43e
RD
7969 Sets the variant of the window/font size to use for this window, if
7970 the platform supports variants, for example, wxMac.
4276dc52 7971 """
54f9ee45 7972 return _core_.Window_SetWindowVariant(*args, **kwargs)
4276dc52
RD
7973
7974 def GetWindowVariant(*args, **kwargs):
a95a7133 7975 """GetWindowVariant(self) -> int"""
54f9ee45 7976 return _core_.Window_GetWindowVariant(*args, **kwargs)
4276dc52 7977
e811c8ce 7978 def SetId(*args, **kwargs):
15afbcd0 7979 """
a95a7133 7980 SetId(self, int winid)
15afbcd0
RD
7981
7982 Sets the identifier of the window. Each window has an integer
7983 identifier. If the application has not provided one, an identifier
7984 will be generated. Normally, the identifier should be provided on
7985 creation and should not be modified subsequently.
7986 """
54f9ee45 7987 return _core_.Window_SetId(*args, **kwargs)
d14a1e28 7988
e811c8ce 7989 def GetId(*args, **kwargs):
15afbcd0 7990 """
a95a7133 7991 GetId(self) -> int
15afbcd0
RD
7992
7993 Returns the identifier of the window. Each window has an integer
7994 identifier. If the application has not provided one (or the default Id
7995 -1 is used) then an unique identifier with a negative value will be
7996 generated.
7997 """
54f9ee45 7998 return _core_.Window_GetId(*args, **kwargs)
d14a1e28 7999
e811c8ce 8000 def NewControlId(*args, **kwargs):
15afbcd0 8001 """
66c033b4 8002 NewControlId() -> int
15afbcd0
RD
8003
8004 Generate a control id for the controls which were not given one.
8005 """
54f9ee45 8006 return _core_.Window_NewControlId(*args, **kwargs)
d14a1e28 8007
e811c8ce
RD
8008 NewControlId = staticmethod(NewControlId)
8009 def NextControlId(*args, **kwargs):
15afbcd0 8010 """
66c033b4 8011 NextControlId(int winid) -> int
15afbcd0
RD
8012
8013 Get the id of the control following the one with the given
41e2b43e 8014 autogenerated) id
15afbcd0 8015 """
54f9ee45 8016 return _core_.Window_NextControlId(*args, **kwargs)
d14a1e28 8017
e811c8ce
RD
8018 NextControlId = staticmethod(NextControlId)
8019 def PrevControlId(*args, **kwargs):
15afbcd0 8020 """
66c033b4 8021 PrevControlId(int winid) -> int
15afbcd0
RD
8022
8023 Get the id of the control preceding the one with the given
41e2b43e 8024 autogenerated) id
15afbcd0 8025 """
54f9ee45 8026 return _core_.Window_PrevControlId(*args, **kwargs)
d14a1e28 8027
e811c8ce 8028 PrevControlId = staticmethod(PrevControlId)
97ab0f6a
RD
8029 def GetLayoutDirection(*args, **kwargs):
8030 """
994453b8 8031 GetLayoutDirection(self) -> int
97ab0f6a
RD
8032
8033 Get the layout direction (LTR or RTL) for this window. Returns
8034 ``wx.Layout_Default`` if layout direction is not supported.
8035 """
8036 return _core_.Window_GetLayoutDirection(*args, **kwargs)
8037
8038 def SetLayoutDirection(*args, **kwargs):
8039 """
994453b8 8040 SetLayoutDirection(self, int dir)
97ab0f6a
RD
8041
8042 Set the layout direction (LTR or RTL) for this window.
8043 """
8044 return _core_.Window_SetLayoutDirection(*args, **kwargs)
8045
8046 def AdjustForLayoutDirection(*args, **kwargs):
8047 """
8048 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
8049
8050 Mirror coordinates for RTL layout if this window uses it and if the
8051 mirroring is not done automatically like Win32.
8052 """
8053 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
8054
e811c8ce 8055 def SetSize(*args, **kwargs):
15afbcd0 8056 """
a95a7133 8057 SetSize(self, Size size)
15afbcd0
RD
8058
8059 Sets the size of the window in pixels.
8060 """
54f9ee45 8061 return _core_.Window_SetSize(*args, **kwargs)
d14a1e28 8062
e811c8ce 8063 def SetDimensions(*args, **kwargs):
15afbcd0 8064 """
a95a7133 8065 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
8066
8067 Sets the position and size of the window in pixels. The sizeFlags
8068 parameter indicates the interpretation of the other params if they are
e505d15e
RD
8069 equal to -1.
8070
8071 ======================== ======================================
8072 wx.SIZE_AUTO A -1 indicates that a class-specific
8073 default should be used.
8074 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8075 -1 values are supplied.
8076 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8077 interpreted as real dimensions, not
8078 default values.
8079 ======================== ======================================
8080
15afbcd0 8081 """
54f9ee45 8082 return _core_.Window_SetDimensions(*args, **kwargs)
d14a1e28 8083
e811c8ce 8084 def SetRect(*args, **kwargs):
15afbcd0 8085 """
a95a7133 8086 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
8087
8088 Sets the position and size of the window in pixels using a wx.Rect.
8089 """
54f9ee45 8090 return _core_.Window_SetRect(*args, **kwargs)
d14a1e28 8091
e811c8ce 8092 def SetSizeWH(*args, **kwargs):
15afbcd0 8093 """
a95a7133 8094 SetSizeWH(self, int width, int height)
15afbcd0
RD
8095
8096 Sets the size of the window in pixels.
8097 """
54f9ee45 8098 return _core_.Window_SetSizeWH(*args, **kwargs)
d14a1e28 8099
e811c8ce 8100 def Move(*args, **kwargs):
15afbcd0 8101 """
a95a7133 8102 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
8103
8104 Moves the window to the given position.
8105 """
54f9ee45 8106 return _core_.Window_Move(*args, **kwargs)
d14a1e28 8107
e811c8ce
RD
8108 SetPosition = Move
8109 def MoveXY(*args, **kwargs):
15afbcd0 8110 """
a95a7133 8111 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
8112
8113 Moves the window to the given position.
8114 """
54f9ee45 8115 return _core_.Window_MoveXY(*args, **kwargs)
e811c8ce 8116
f8167d6e
RD
8117 def SetBestFittingSize(*args, **kwargs):
8118 """
8119 SetBestFittingSize(self, Size size=DefaultSize)
8120
8121 A 'Smart' SetSize that will fill in default size components with the
8122 window's *best size* values. Also set's the minsize for use with sizers.
8123 """
8124 return _core_.Window_SetBestFittingSize(*args, **kwargs)
8125
e811c8ce 8126 def Raise(*args, **kwargs):
15afbcd0 8127 """
a95a7133 8128 Raise(self)
15afbcd0 8129
943e8dfd
RD
8130 Raises the window to the top of the window hierarchy. In current
8131 version of wxWidgets this works both for manage and child windows.
15afbcd0 8132 """
54f9ee45 8133 return _core_.Window_Raise(*args, **kwargs)
e811c8ce
RD
8134
8135 def Lower(*args, **kwargs):
15afbcd0 8136 """
a95a7133 8137 Lower(self)
15afbcd0 8138
943e8dfd
RD
8139 Lowers the window to the bottom of the window hierarchy. In current
8140 version of wxWidgets this works both for manage and child windows.
15afbcd0 8141 """
54f9ee45 8142 return _core_.Window_Lower(*args, **kwargs)
e811c8ce
RD
8143
8144 def SetClientSize(*args, **kwargs):
15afbcd0 8145 """
a95a7133 8146 SetClientSize(self, Size size)
15afbcd0
RD
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 """
54f9ee45 8154 return _core_.Window_SetClientSize(*args, **kwargs)
e811c8ce
RD
8155
8156 def SetClientSizeWH(*args, **kwargs):
15afbcd0 8157 """
a95a7133 8158 SetClientSizeWH(self, int width, int height)
15afbcd0
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 """
54f9ee45 8166 return _core_.Window_SetClientSizeWH(*args, **kwargs)
e811c8ce
RD
8167
8168 def SetClientRect(*args, **kwargs):
15afbcd0 8169 """
a95a7133 8170 SetClientRect(self, Rect rect)
15afbcd0
RD
8171
8172 This sets the size of the window client area in pixels. Using this
8173 function to size a window tends to be more device-independent than
8174 wx.Window.SetSize, since the application need not worry about what
8175 dimensions the border or title bar have when trying to fit the window
8176 around panel items, for example.
8177 """
54f9ee45 8178 return _core_.Window_SetClientRect(*args, **kwargs)
e811c8ce
RD
8179
8180 def GetPosition(*args, **kwargs):
0df68c9f 8181 """
a95a7133 8182 GetPosition(self) -> Point
e811c8ce 8183
75219dcb
RD
8184 Get the window's position. Notice that the position is in client
8185 coordinates for child windows and screen coordinates for the top level
8186 ones, use `GetScreenPosition` if you need screen coordinates for all
8187 kinds of windows.
0df68c9f 8188 """
54f9ee45 8189 return _core_.Window_GetPosition(*args, **kwargs)
e811c8ce
RD
8190
8191 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
8192 """
8193 GetPositionTuple() -> (x,y)
e811c8ce 8194
75219dcb
RD
8195 Get the window's position. Notice that the position is in client
8196 coordinates for child windows and screen coordinates for the top level
8197 ones, use `GetScreenPosition` if you need screen coordinates for all
8198 kinds of windows.
0df68c9f 8199 """
54f9ee45 8200 return _core_.Window_GetPositionTuple(*args, **kwargs)
e811c8ce 8201
75219dcb
RD
8202 def GetScreenPosition(*args, **kwargs):
8203 """
8204 GetScreenPosition(self) -> Point
8205
8206 Get the position of the window in screen coordinantes.
8207 """
8208 return _core_.Window_GetScreenPosition(*args, **kwargs)
8209
8210 def GetScreenPositionTuple(*args, **kwargs):
8211 """
8212 GetScreenPositionTuple() -> (x,y)
8213
8214 Get the position of the window in screen coordinantes.
8215 """
8216 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8217
8218 def GetScreenRect(*args, **kwargs):
8219 """
8220 GetScreenRect(self) -> Rect
8221
8222 Returns the size and position of the window in screen coordinantes as
8223 a `wx.Rect` object.
8224 """
8225 return _core_.Window_GetScreenRect(*args, **kwargs)
8226
e811c8ce 8227 def GetSize(*args, **kwargs):
0df68c9f 8228 """
a95a7133 8229 GetSize(self) -> Size
e811c8ce 8230
0df68c9f
RD
8231 Get the window size.
8232 """
54f9ee45 8233 return _core_.Window_GetSize(*args, **kwargs)
e811c8ce
RD
8234
8235 def GetSizeTuple(*args, **kwargs):
0df68c9f
RD
8236 """
8237 GetSizeTuple() -> (width, height)
e811c8ce 8238
0df68c9f
RD
8239 Get the window size.
8240 """
54f9ee45 8241 return _core_.Window_GetSizeTuple(*args, **kwargs)
e811c8ce
RD
8242
8243 def GetRect(*args, **kwargs):
15afbcd0 8244 """
a95a7133 8245 GetRect(self) -> Rect
15afbcd0 8246
75219dcb 8247 Returns the size and position of the window as a `wx.Rect` object.
15afbcd0 8248 """
54f9ee45 8249 return _core_.Window_GetRect(*args, **kwargs)
e811c8ce
RD
8250
8251 def GetClientSize(*args, **kwargs):
0df68c9f 8252 """
a95a7133 8253 GetClientSize(self) -> Size
e811c8ce 8254
15afbcd0
RD
8255 This gets the size of the window's 'client area' in pixels. The client
8256 area is the area which may be drawn on by the programmer, excluding
8257 title bar, border, scrollbars, etc.
0df68c9f 8258 """
54f9ee45 8259 return _core_.Window_GetClientSize(*args, **kwargs)
e811c8ce
RD
8260
8261 def GetClientSizeTuple(*args, **kwargs):
0df68c9f
RD
8262 """
8263 GetClientSizeTuple() -> (width, height)
e811c8ce 8264
15afbcd0
RD
8265 This gets the size of the window's 'client area' in pixels. The client
8266 area is the area which may be drawn on by the programmer, excluding
8267 title bar, border, scrollbars, etc.
0df68c9f 8268 """
54f9ee45 8269 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
e811c8ce
RD
8270
8271 def GetClientAreaOrigin(*args, **kwargs):
15afbcd0 8272 """
a95a7133 8273 GetClientAreaOrigin(self) -> Point
15afbcd0
RD
8274
8275 Get the origin of the client area of the window relative to the
8276 window's top left corner (the client area may be shifted because of
8277 the borders, scrollbars, other decorations...)
8278 """
54f9ee45 8279 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
e811c8ce
RD
8280
8281 def GetClientRect(*args, **kwargs):
15afbcd0 8282 """
a95a7133 8283 GetClientRect(self) -> Rect
15afbcd0 8284
61863841 8285 Get the client area position and size as a `wx.Rect` object.
15afbcd0 8286 """
54f9ee45 8287 return _core_.Window_GetClientRect(*args, **kwargs)
e811c8ce
RD
8288
8289 def GetBestSize(*args, **kwargs):
0df68c9f 8290 """
a95a7133 8291 GetBestSize(self) -> Size
e811c8ce 8292
248ed943 8293 This function returns the best acceptable minimal size for the
41e2b43e
RD
8294 window, if applicable. For example, for a static text control, it will
8295 be the minimal size such that the control label is not truncated. For
8296 windows containing subwindows (suzh aswx.Panel), the size returned by
8297 this function will be the same as the size the window would have had
8298 after calling Fit.
0df68c9f 8299 """
54f9ee45 8300 return _core_.Window_GetBestSize(*args, **kwargs)
e811c8ce
RD
8301
8302 def GetBestSizeTuple(*args, **kwargs):
0df68c9f
RD
8303 """
8304 GetBestSizeTuple() -> (width, height)
e811c8ce 8305
248ed943 8306 This function returns the best acceptable minimal size for the
41e2b43e
RD
8307 window, if applicable. For example, for a static text control, it will
8308 be the minimal size such that the control label is not truncated. For
8309 windows containing subwindows (suzh aswx.Panel), the size returned by
8310 this function will be the same as the size the window would have had
8311 after calling Fit.
0df68c9f 8312 """
54f9ee45 8313 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
e811c8ce 8314
dfbb5885
RD
8315 def InvalidateBestSize(*args, **kwargs):
8316 """
8317 InvalidateBestSize(self)
8318
8319 Reset the cached best size value so it will be recalculated the next
8320 time it is needed.
8321 """
8322 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8323
e2813725
RD
8324 def CacheBestSize(*args, **kwargs):
8325 """
8326 CacheBestSize(self, Size size)
8327
8328 Cache the best size so it doesn't need to be calculated again, (at least until
8329 some properties of the window change.)
8330 """
8331 return _core_.Window_CacheBestSize(*args, **kwargs)
8332
dfbb5885
RD
8333 def GetBestFittingSize(*args, **kwargs):
8334 """
8335 GetBestFittingSize(self) -> Size
8336
8337 This function will merge the window's best size into the window's
8338 minimum size, giving priority to the min size components, and returns
8339 the results.
8340
8341 """
8342 return _core_.Window_GetBestFittingSize(*args, **kwargs)
8343
e811c8ce 8344 def GetAdjustedBestSize(*args, **kwargs):
15afbcd0 8345 """
a95a7133 8346 GetAdjustedBestSize(self) -> Size
15afbcd0
RD
8347
8348 This method is similar to GetBestSize, except in one
8349 thing. GetBestSize should return the minimum untruncated size of the
8350 window, while this method will return the largest of BestSize and any
8351 user specified minimum size. ie. it is the minimum size the window
8352 should currently be drawn at, not the minimal size it can possibly
8353 tolerate.
8354 """
54f9ee45 8355 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
e811c8ce
RD
8356
8357 def Center(*args, **kwargs):
15afbcd0 8358 """
a95a7133 8359 Center(self, int direction=BOTH)
15afbcd0
RD
8360
8361 Centers the window. The parameter specifies the direction for
8362 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8363 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8364 on the entire screen and not on its parent window. If it is a
8365 top-level window and has no parent then it will always be centered
8366 relative to the screen.
8367 """
54f9ee45 8368 return _core_.Window_Center(*args, **kwargs)
e811c8ce
RD
8369
8370 Centre = Center
e811c8ce 8371 def CenterOnParent(*args, **kwargs):
15afbcd0 8372 """
a95a7133 8373 CenterOnParent(self, int dir=BOTH)
15afbcd0
RD
8374
8375 Center with respect to the the parent window
8376 """
54f9ee45 8377 return _core_.Window_CenterOnParent(*args, **kwargs)
e811c8ce
RD
8378
8379 CentreOnParent = CenterOnParent
8380 def Fit(*args, **kwargs):
15afbcd0 8381 """
a95a7133 8382 Fit(self)
15afbcd0
RD
8383
8384 Sizes the window so that it fits around its subwindows. This function
8385 won't do anything if there are no subwindows and will only really work
8386 correctly if sizers are used for the subwindows layout. Also, if the
8387 window has exactly one subwindow it is better (faster and the result
8388 is more precise as Fit adds some margin to account for fuzziness of
8389 its calculations) to call window.SetClientSize(child.GetSize())
8390 instead of calling Fit.
8391 """
54f9ee45 8392 return _core_.Window_Fit(*args, **kwargs)
e811c8ce
RD
8393
8394 def FitInside(*args, **kwargs):
15afbcd0 8395 """
a95a7133 8396 FitInside(self)
15afbcd0
RD
8397
8398 Similar to Fit, but sizes the interior (virtual) size of a
8399 window. Mainly useful with scrolled windows to reset scrollbars after
8400 sizing changes that do not trigger a size event, and/or scrolled
8401 windows without an interior sizer. This function similarly won't do
8402 anything if there are no subwindows.
8403 """
54f9ee45 8404 return _core_.Window_FitInside(*args, **kwargs)
e811c8ce 8405
f16ab95d 8406 def SetSizeHints(*args, **kwargs):
0df68c9f 8407 """
a95a7133 8408 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
0df68c9f 8409 int incH=-1)
15afbcd0
RD
8410
8411 Allows specification of minimum and maximum window sizes, and window
8412 size increments. If a pair of values is not set (or set to -1), the
8413 default values will be used. If this function is called, the user
908b74cd
RD
8414 will not be able to size the window outside the given bounds (if it is
8415 a top-level window.) Sizers will also inspect the minimum window size
8416 and will use that value if set when calculating layout.
8417
8418 The resizing increments are only significant under Motif or Xt.
0df68c9f 8419 """
f16ab95d 8420 return _core_.Window_SetSizeHints(*args, **kwargs)
e811c8ce 8421
f16ab95d
RD
8422 def SetSizeHintsSz(*args, **kwargs):
8423 """
8424 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8425
8426 Allows specification of minimum and maximum window sizes, and window
8427 size increments. If a pair of values is not set (or set to -1), the
8428 default values will be used. If this function is called, the user
8429 will not be able to size the window outside the given bounds (if it is
8430 a top-level window.) Sizers will also inspect the minimum window size
8431 and will use that value if set when calculating layout.
8432
8433 The resizing increments are only significant under Motif or Xt.
8434 """
8435 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8436
8437 def SetVirtualSizeHints(*args, **kwargs):
15afbcd0 8438 """
908b74cd 8439 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
15afbcd0
RD
8440
8441 Allows specification of minimum and maximum virtual window sizes. If a
8442 pair of values is not set (or set to -1), the default values will be
8443 used. If this function is called, the user will not be able to size
8444 the virtual area of the window outside the given bounds.
8445 """
f16ab95d
RD
8446 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8447
8448 def SetVirtualSizeHintsSz(*args, **kwargs):
8449 """
8450 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8451
8452 Allows specification of minimum and maximum virtual window sizes. If a
8453 pair of values is not set (or set to -1), the default values will be
8454 used. If this function is called, the user will not be able to size
8455 the virtual area of the window outside the given bounds.
8456 """
8457 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
e811c8ce 8458
908b74cd
RD
8459 def GetMaxSize(*args, **kwargs):
8460 """GetMaxSize(self) -> Size"""
8461 return _core_.Window_GetMaxSize(*args, **kwargs)
8462
8463 def GetMinSize(*args, **kwargs):
8464 """GetMinSize(self) -> Size"""
8465 return _core_.Window_GetMinSize(*args, **kwargs)
8466
8467 def SetMinSize(*args, **kwargs):
8468 """
8469 SetMinSize(self, Size minSize)
8470
8471 A more convenient method than `SetSizeHints` for setting just the
8472 min size.
8473 """
8474 return _core_.Window_SetMinSize(*args, **kwargs)
8475
8476 def SetMaxSize(*args, **kwargs):
8477 """
8478 SetMaxSize(self, Size maxSize)
8479
8480 A more convenient method than `SetSizeHints` for setting just the
8481 max size.
8482 """
8483 return _core_.Window_SetMaxSize(*args, **kwargs)
8484
e811c8ce 8485 def GetMinWidth(*args, **kwargs):
a95a7133 8486 """GetMinWidth(self) -> int"""
54f9ee45 8487 return _core_.Window_GetMinWidth(*args, **kwargs)
e811c8ce
RD
8488
8489 def GetMinHeight(*args, **kwargs):
a95a7133 8490 """GetMinHeight(self) -> int"""
54f9ee45 8491 return _core_.Window_GetMinHeight(*args, **kwargs)
e811c8ce
RD
8492
8493 def GetMaxWidth(*args, **kwargs):
a95a7133 8494 """GetMaxWidth(self) -> int"""
54f9ee45 8495 return _core_.Window_GetMaxWidth(*args, **kwargs)
e811c8ce
RD
8496
8497 def GetMaxHeight(*args, **kwargs):
a95a7133 8498 """GetMaxHeight(self) -> int"""
54f9ee45 8499 return _core_.Window_GetMaxHeight(*args, **kwargs)
e811c8ce 8500
e811c8ce 8501 def SetVirtualSize(*args, **kwargs):
0df68c9f 8502 """
a95a7133 8503 SetVirtualSize(self, Size size)
e811c8ce 8504
15afbcd0
RD
8505 Set the the virtual size of a window in pixels. For most windows this
8506 is just the client area of the window, but for some like scrolled
8507 windows it is more or less independent of the screen window size.
0df68c9f 8508 """
54f9ee45 8509 return _core_.Window_SetVirtualSize(*args, **kwargs)
e811c8ce
RD
8510
8511 def SetVirtualSizeWH(*args, **kwargs):
0df68c9f 8512 """
a95a7133 8513 SetVirtualSizeWH(self, int w, int h)
e811c8ce 8514
15afbcd0
RD
8515 Set the the virtual size of a window in pixels. For most windows this
8516 is just the client area of the window, but for some like scrolled
8517 windows it is more or less independent of the screen window size.
0df68c9f 8518 """
54f9ee45 8519 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
e811c8ce
RD
8520
8521 def GetVirtualSize(*args, **kwargs):
0df68c9f 8522 """
a95a7133 8523 GetVirtualSize(self) -> Size
e811c8ce 8524
15afbcd0
RD
8525 Get the the virtual size of the window in pixels. For most windows
8526 this is just the client area of the window, but for some like scrolled
8527 windows it is more or less independent of the screen window size.
0df68c9f 8528 """
54f9ee45 8529 return _core_.Window_GetVirtualSize(*args, **kwargs)
e811c8ce
RD
8530
8531 def GetVirtualSizeTuple(*args, **kwargs):
0df68c9f
RD
8532 """
8533 GetVirtualSizeTuple() -> (width, height)
e811c8ce 8534
15afbcd0
RD
8535 Get the the virtual size of the window in pixels. For most windows
8536 this is just the client area of the window, but for some like scrolled
8537 windows it is more or less independent of the screen window size.
0df68c9f 8538 """
54f9ee45 8539 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
e811c8ce
RD
8540
8541 def GetBestVirtualSize(*args, **kwargs):
15afbcd0 8542 """
a95a7133 8543 GetBestVirtualSize(self) -> Size
15afbcd0
RD
8544
8545 Return the largest of ClientSize and BestSize (as determined by a
8546 sizer, interior children, or other means)
8547 """
54f9ee45 8548 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
e811c8ce
RD
8549
8550 def Show(*args, **kwargs):
15afbcd0 8551 """
a95a7133 8552 Show(self, bool show=True) -> bool
15afbcd0
RD
8553
8554 Shows or hides the window. You may need to call Raise for a top level
8555 window if you want to bring it to top, although this is not needed if
8556 Show is called immediately after the frame creation. Returns True if
8557 the window has been shown or hidden or False if nothing was done
8558 because it already was in the requested state.
8559 """
54f9ee45 8560 return _core_.Window_Show(*args, **kwargs)
e811c8ce
RD
8561
8562 def Hide(*args, **kwargs):
15afbcd0 8563 """
a95a7133 8564 Hide(self) -> bool
15afbcd0
RD
8565
8566 Equivalent to calling Show(False).
8567 """
54f9ee45 8568 return _core_.Window_Hide(*args, **kwargs)
e811c8ce
RD
8569
8570 def Enable(*args, **kwargs):
15afbcd0 8571 """
a95a7133 8572 Enable(self, bool enable=True) -> bool
15afbcd0
RD
8573
8574 Enable or disable the window for user input. Note that when a parent
8575 window is disabled, all of its children are disabled as well and they
8576 are reenabled again when the parent is. Returns true if the window
8577 has been enabled or disabled, false if nothing was done, i.e. if the
8578 window had already been in the specified state.
8579 """
54f9ee45 8580 return _core_.Window_Enable(*args, **kwargs)
e811c8ce
RD
8581
8582 def Disable(*args, **kwargs):
15afbcd0 8583 """
a95a7133 8584 Disable(self) -> bool
15afbcd0
RD
8585
8586 Disables the window, same as Enable(false).
8587 """
54f9ee45 8588 return _core_.Window_Disable(*args, **kwargs)
e811c8ce
RD
8589
8590 def IsShown(*args, **kwargs):
15afbcd0 8591 """
a95a7133 8592 IsShown(self) -> bool
15afbcd0
RD
8593
8594 Returns true if the window is shown, false if it has been hidden.
8595 """
54f9ee45 8596 return _core_.Window_IsShown(*args, **kwargs)
e811c8ce
RD
8597
8598 def IsEnabled(*args, **kwargs):
15afbcd0 8599 """
a95a7133 8600 IsEnabled(self) -> bool
15afbcd0
RD
8601
8602 Returns true if the window is enabled for input, false otherwise.
8603 """
54f9ee45 8604 return _core_.Window_IsEnabled(*args, **kwargs)
e811c8ce 8605
33d6fd3b
RD
8606 def IsShownOnScreen(*args, **kwargs):
8607 """
8608 IsShownOnScreen(self) -> bool
8609
8610 Returns ``True`` if the window is physically visible on the screen,
8611 i.e. it is shown and all its parents up to the toplevel window are
8612 shown as well.
8613 """
8614 return _core_.Window_IsShownOnScreen(*args, **kwargs)
8615
e811c8ce 8616 def SetWindowStyleFlag(*args, **kwargs):
15afbcd0 8617 """
a95a7133 8618 SetWindowStyleFlag(self, long style)
15afbcd0 8619
41e2b43e
RD
8620 Sets the style of the window. Please note that some styles cannot be
8621 changed after the window creation and that Refresh() might need to be
8622 called after changing the others for the change to take place
8623 immediately.
15afbcd0 8624 """
54f9ee45 8625 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
e811c8ce
RD
8626
8627 def GetWindowStyleFlag(*args, **kwargs):
15afbcd0 8628 """
a95a7133 8629 GetWindowStyleFlag(self) -> long
e811c8ce 8630
15afbcd0
RD
8631 Gets the window style that was passed to the constructor or Create
8632 method.
8633 """
54f9ee45 8634 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
e811c8ce 8635
15afbcd0 8636 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
e811c8ce 8637 def HasFlag(*args, **kwargs):
15afbcd0 8638 """
a95a7133 8639 HasFlag(self, int flag) -> bool
15afbcd0
RD
8640
8641 Test if the given style is set for this window.
8642 """
54f9ee45 8643 return _core_.Window_HasFlag(*args, **kwargs)
e811c8ce
RD
8644
8645 def IsRetained(*args, **kwargs):
15afbcd0 8646 """
a95a7133 8647 IsRetained(self) -> bool
15afbcd0
RD
8648
8649 Returns true if the window is retained, false otherwise. Retained
8650 windows are only available on X platforms.
8651 """
54f9ee45 8652 return _core_.Window_IsRetained(*args, **kwargs)
e811c8ce
RD
8653
8654 def SetExtraStyle(*args, **kwargs):
15afbcd0 8655 """
a95a7133 8656 SetExtraStyle(self, long exStyle)
15afbcd0
RD
8657
8658 Sets the extra style bits for the window. Extra styles are the less
8659 often used style bits which can't be set with the constructor or with
8660 SetWindowStyleFlag()
8661 """
54f9ee45 8662 return _core_.Window_SetExtraStyle(*args, **kwargs)
e811c8ce
RD
8663
8664 def GetExtraStyle(*args, **kwargs):
15afbcd0 8665 """
a95a7133 8666 GetExtraStyle(self) -> long
15afbcd0
RD
8667
8668 Returns the extra style bits for the window.
8669 """
54f9ee45 8670 return _core_.Window_GetExtraStyle(*args, **kwargs)
e811c8ce
RD
8671
8672 def MakeModal(*args, **kwargs):
15afbcd0 8673 """
a95a7133 8674 MakeModal(self, bool modal=True)
15afbcd0
RD
8675
8676 Disables all other windows in the application so that the user can
8677 only interact with this window. Passing False will reverse this
8678 effect.
8679 """
54f9ee45 8680 return _core_.Window_MakeModal(*args, **kwargs)
e811c8ce
RD
8681
8682 def SetThemeEnabled(*args, **kwargs):
15afbcd0 8683 """
a95a7133 8684 SetThemeEnabled(self, bool enableTheme)
15afbcd0
RD
8685
8686 This function tells a window if it should use the system's "theme"
8687 code to draw the windows' background instead if its own background
8688 drawing code. This will only have an effect on platforms that support
8689 the notion of themes in user defined windows. One such platform is
8690 GTK+ where windows can have (very colourful) backgrounds defined by a
8691 user's selected theme.
8692
8693 Dialogs, notebook pages and the status bar have this flag set to true
8694 by default so that the default look and feel is simulated best.
8695 """
54f9ee45 8696 return _core_.Window_SetThemeEnabled(*args, **kwargs)
e811c8ce
RD
8697
8698 def GetThemeEnabled(*args, **kwargs):
15afbcd0 8699 """
a95a7133 8700 GetThemeEnabled(self) -> bool
e811c8ce 8701
15afbcd0
RD
8702 Return the themeEnabled flag.
8703 """
54f9ee45 8704 return _core_.Window_GetThemeEnabled(*args, **kwargs)
e811c8ce
RD
8705
8706 def SetFocus(*args, **kwargs):
15afbcd0 8707 """
a95a7133 8708 SetFocus(self)
15afbcd0
RD
8709
8710 Set's the focus to this window, allowing it to receive keyboard input.
8711 """
54f9ee45 8712 return _core_.Window_SetFocus(*args, **kwargs)
e811c8ce
RD
8713
8714 def SetFocusFromKbd(*args, **kwargs):
15afbcd0 8715 """
a95a7133 8716 SetFocusFromKbd(self)
15afbcd0
RD
8717
8718 Set focus to this window as the result of a keyboard action. Normally
8719 only called internally.
8720 """
54f9ee45 8721 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
e811c8ce
RD
8722
8723 def FindFocus(*args, **kwargs):
15afbcd0 8724 """
66c033b4 8725 FindFocus() -> Window
15afbcd0
RD
8726
8727 Returns the window or control that currently has the keyboard focus,
8728 or None.
8729 """
54f9ee45 8730 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
8731
8732 FindFocus = staticmethod(FindFocus)
8733 def AcceptsFocus(*args, **kwargs):
15afbcd0 8734 """
a95a7133 8735 AcceptsFocus(self) -> bool
15afbcd0
RD
8736
8737 Can this window have focus?
8738 """
54f9ee45 8739 return _core_.Window_AcceptsFocus(*args, **kwargs)
e811c8ce
RD
8740
8741 def AcceptsFocusFromKeyboard(*args, **kwargs):
15afbcd0 8742 """
a95a7133 8743 AcceptsFocusFromKeyboard(self) -> bool
15afbcd0
RD
8744
8745 Can this window be given focus by keyboard navigation? if not, the
8746 only way to give it focus (provided it accepts it at all) is to click
8747 it.
8748 """
54f9ee45 8749 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
e811c8ce 8750
908b74cd
RD
8751 def Navigate(*args, **kwargs):
8752 """
8753 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8754
fd2dc343
RD
8755 Does keyboard navigation from this window to another, by sending a
8756 `wx.NavigationKeyEvent`.
908b74cd
RD
8757 """
8758 return _core_.Window_Navigate(*args, **kwargs)
8759
7f98d120
RD
8760 def MoveAfterInTabOrder(*args, **kwargs):
8761 """
8762 MoveAfterInTabOrder(self, Window win)
8763
8764 Moves this window in the tab navigation order after the specified
8765 sibling window. This means that when the user presses the TAB key on
8766 that other window, the focus switches to this window.
8767
8768 The default tab order is the same as creation order. This function
8769 and `MoveBeforeInTabOrder` allow to change it after creating all the
8770 windows.
8771
8772 """
8773 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8774
8775 def MoveBeforeInTabOrder(*args, **kwargs):
8776 """
8777 MoveBeforeInTabOrder(self, Window win)
8778
8779 Same as `MoveAfterInTabOrder` except that it inserts this window just
8780 before win instead of putting it right after it.
8781 """
8782 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8783
e811c8ce 8784 def GetChildren(*args, **kwargs):
15afbcd0 8785 """
a95a7133 8786 GetChildren(self) -> PyObject
15afbcd0
RD
8787
8788 Returns a list of the window's children. NOTE: Currently this is a
8789 copy of the child window list maintained by the window, so the return
8790 value of this function is only valid as long as the window's children
8791 do not change.
8792 """
54f9ee45 8793 return _core_.Window_GetChildren(*args, **kwargs)
e811c8ce
RD
8794
8795 def GetParent(*args, **kwargs):
15afbcd0 8796 """
a95a7133 8797 GetParent(self) -> Window
15afbcd0
RD
8798
8799 Returns the parent window of this window, or None if there isn't one.
8800 """
54f9ee45 8801 return _core_.Window_GetParent(*args, **kwargs)
e811c8ce
RD
8802
8803 def GetGrandParent(*args, **kwargs):
15afbcd0 8804 """
a95a7133 8805 GetGrandParent(self) -> Window
15afbcd0 8806
41e2b43e
RD
8807 Returns the parent of the parent of this window, or None if there
8808 isn't one.
15afbcd0 8809 """
54f9ee45 8810 return _core_.Window_GetGrandParent(*args, **kwargs)
e811c8ce
RD
8811
8812 def IsTopLevel(*args, **kwargs):
15afbcd0 8813 """
a95a7133 8814 IsTopLevel(self) -> bool
15afbcd0
RD
8815
8816 Returns true if the given window is a top-level one. Currently all
8817 frames and dialogs are always considered to be top-level windows (even
8818 if they have a parent window).
8819 """
54f9ee45 8820 return _core_.Window_IsTopLevel(*args, **kwargs)
e811c8ce
RD
8821
8822 def Reparent(*args, **kwargs):
15afbcd0 8823 """
a95a7133 8824 Reparent(self, Window newParent) -> bool
15afbcd0
RD
8825
8826 Reparents the window, i.e the window will be removed from its current
8827 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8828 re-inserted into another. Available on Windows and GTK. Returns True
8829 if the parent was changed, False otherwise (error or newParent ==
8830 oldParent)
8831 """
54f9ee45 8832 return _core_.Window_Reparent(*args, **kwargs)
e811c8ce
RD
8833
8834 def AddChild(*args, **kwargs):
15afbcd0 8835 """
a95a7133 8836 AddChild(self, Window child)
15afbcd0
RD
8837
8838 Adds a child window. This is called automatically by window creation
8839 functions so should not be required by the application programmer.
8840 """
54f9ee45 8841 return _core_.Window_AddChild(*args, **kwargs)
e811c8ce
RD
8842
8843 def RemoveChild(*args, **kwargs):
15afbcd0 8844 """
a95a7133 8845 RemoveChild(self, Window child)
15afbcd0
RD
8846
8847 Removes a child window. This is called automatically by window
8848 deletion functions so should not be required by the application
8849 programmer.
8850 """
54f9ee45 8851 return _core_.Window_RemoveChild(*args, **kwargs)
e811c8ce 8852
704eda0c
RD
8853 def SetDoubleBuffered(*args, **kwargs):
8854 """
8855 SetDoubleBuffered(self, bool on)
8856
8857 Currently wxGTK2 only.
8858 """
8859 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8860
e811c8ce 8861 def FindWindowById(*args, **kwargs):
15afbcd0 8862 """
a95a7133 8863 FindWindowById(self, long winid) -> Window
15afbcd0
RD
8864
8865 Find a chld of this window by window ID
8866 """
54f9ee45 8867 return _core_.Window_FindWindowById(*args, **kwargs)
e811c8ce
RD
8868
8869 def FindWindowByName(*args, **kwargs):
15afbcd0 8870 """
a95a7133 8871 FindWindowByName(self, String name) -> Window
15afbcd0
RD
8872
8873 Find a child of this window by name
8874 """
54f9ee45 8875 return _core_.Window_FindWindowByName(*args, **kwargs)
e811c8ce
RD
8876
8877 def GetEventHandler(*args, **kwargs):
15afbcd0 8878 """
a95a7133 8879 GetEventHandler(self) -> EvtHandler
15afbcd0
RD
8880
8881 Returns the event handler for this window. By default, the window is
8882 its own event handler.
8883 """
54f9ee45 8884 return _core_.Window_GetEventHandler(*args, **kwargs)
e811c8ce
RD
8885
8886 def SetEventHandler(*args, **kwargs):
15afbcd0 8887 """
a95a7133 8888 SetEventHandler(self, EvtHandler handler)
15afbcd0
RD
8889
8890 Sets the event handler for this window. An event handler is an object
d49bdf34
RD
8891 that is capable of processing the events sent to a window. (In other
8892 words, is able to dispatch the events to handler function.) By
8893 default, the window is its own event handler, but an application may
8894 wish to substitute another, for example to allow central
8895 implementation of event-handling for a variety of different window
8896 classes.
15afbcd0 8897
41e2b43e 8898 It is usually better to use `wx.Window.PushEventHandler` since this sets
15afbcd0 8899 up a chain of event handlers, where an event not handled by one event
d49bdf34 8900 handler is handed off to the next one in the chain.
15afbcd0 8901 """
54f9ee45 8902 return _core_.Window_SetEventHandler(*args, **kwargs)
e811c8ce
RD
8903
8904 def PushEventHandler(*args, **kwargs):
15afbcd0 8905 """
a95a7133 8906 PushEventHandler(self, EvtHandler handler)
15afbcd0
RD
8907
8908 Pushes this event handler onto the event handler stack for the window.
8909 An event handler is an object that is capable of processing the events
d49bdf34
RD
8910 sent to a window. (In other words, is able to dispatch the events to
8911 handler function.) By default, the window is its own event handler,
8912 but an application may wish to substitute another, for example to
8913 allow central implementation of event-handling for a variety of
8914 different window classes.
15afbcd0
RD
8915
8916 wx.Window.PushEventHandler allows an application to set up a chain of
8917 event handlers, where an event not handled by one event handler is
d49bdf34
RD
8918 handed to the next one in the chain. Use `wx.Window.PopEventHandler`
8919 to remove the event handler. Ownership of the handler is *not* given
8920 to the window, so you should be sure to pop the handler before the
8921 window is destroyed and either let PopEventHandler destroy it, or call
8922 its Destroy method yourself.
15afbcd0 8923 """
54f9ee45 8924 return _core_.Window_PushEventHandler(*args, **kwargs)
e811c8ce
RD
8925
8926 def PopEventHandler(*args, **kwargs):
15afbcd0 8927 """
a95a7133 8928 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
15afbcd0
RD
8929
8930 Removes and returns the top-most event handler on the event handler
8931 stack. If deleteHandler is True then the wx.EvtHandler object will be
d49bdf34 8932 destroyed after it is popped, and ``None`` will be returned instead.
15afbcd0 8933 """
54f9ee45 8934 return _core_.Window_PopEventHandler(*args, **kwargs)
e811c8ce
RD
8935
8936 def RemoveEventHandler(*args, **kwargs):
15afbcd0 8937 """
a95a7133 8938 RemoveEventHandler(self, EvtHandler handler) -> bool
15afbcd0 8939
41e2b43e 8940 Find the given handler in the event handler chain and remove (but not
d49bdf34 8941 delete) it from the event handler chain, returns True if it was found
41e2b43e
RD
8942 and False otherwise (this also results in an assert failure so this
8943 function should only be called when the handler is supposed to be
8944 there.)
15afbcd0 8945 """
54f9ee45 8946 return _core_.Window_RemoveEventHandler(*args, **kwargs)
e811c8ce
RD
8947
8948 def SetValidator(*args, **kwargs):
15afbcd0 8949 """
a95a7133 8950 SetValidator(self, Validator validator)
15afbcd0
RD
8951
8952 Deletes the current validator (if any) and sets the window validator,
8953 having called wx.Validator.Clone to create a new validator of this
8954 type.
8955 """
54f9ee45 8956 return _core_.Window_SetValidator(*args, **kwargs)
e811c8ce
RD
8957
8958 def GetValidator(*args, **kwargs):
15afbcd0 8959 """
a95a7133 8960 GetValidator(self) -> Validator
15afbcd0
RD
8961
8962 Returns a pointer to the current validator for the window, or None if
8963 there is none.
8964 """
54f9ee45 8965 return _core_.Window_GetValidator(*args, **kwargs)
e811c8ce 8966
74a57fcd
RD
8967 def Validate(*args, **kwargs):
8968 """
a95a7133 8969 Validate(self) -> bool
74a57fcd
RD
8970
8971 Validates the current values of the child controls using their
41e2b43e
RD
8972 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8973 style flag set, the method will also call Validate() of all child
8974 windows. Returns false if any of the validations failed.
74a57fcd 8975 """
54f9ee45 8976 return _core_.Window_Validate(*args, **kwargs)
74a57fcd
RD
8977
8978 def TransferDataToWindow(*args, **kwargs):
8979 """
a95a7133 8980 TransferDataToWindow(self) -> bool
74a57fcd 8981
41e2b43e
RD
8982 Transfers values to child controls from data areas specified by their
8983 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8984 style flag set, the method will also call TransferDataToWindow() of
8985 all child windows.
74a57fcd 8986 """
54f9ee45 8987 return _core_.Window_TransferDataToWindow(*args, **kwargs)
74a57fcd
RD
8988
8989 def TransferDataFromWindow(*args, **kwargs):
8990 """
a95a7133 8991 TransferDataFromWindow(self) -> bool
74a57fcd 8992
41e2b43e
RD
8993 Transfers values from child controls to data areas specified by their
8994 validators. Returns false if a transfer failed. If the window has
8995 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8996 also call TransferDataFromWindow() of all child windows.
74a57fcd 8997 """
54f9ee45 8998 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
74a57fcd
RD
8999
9000 def InitDialog(*args, **kwargs):
9001 """
a95a7133 9002 InitDialog(self)
74a57fcd 9003
41e2b43e
RD
9004 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9005 to the dialog via validators.
74a57fcd 9006 """
54f9ee45 9007 return _core_.Window_InitDialog(*args, **kwargs)
74a57fcd 9008
e811c8ce 9009 def SetAcceleratorTable(*args, **kwargs):
15afbcd0 9010 """
a95a7133 9011 SetAcceleratorTable(self, AcceleratorTable accel)
15afbcd0
RD
9012
9013 Sets the accelerator table for this window.
9014 """
54f9ee45 9015 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
9016
9017 def GetAcceleratorTable(*args, **kwargs):
15afbcd0 9018 """
a95a7133 9019 GetAcceleratorTable(self) -> AcceleratorTable
15afbcd0
RD
9020
9021 Gets the accelerator table for this window.
9022 """
54f9ee45 9023 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
9024
9025 def RegisterHotKey(*args, **kwargs):
15afbcd0 9026 """
a95a7133 9027 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
15afbcd0
RD
9028
9029 Registers a system wide hotkey. Every time the user presses the hotkey
9030 registered here, this window will receive a hotkey event. It will
9031 receive the event even if the application is in the background and
9032 does not have the input focus because the user is working with some
9033 other application. To bind an event handler function to this hotkey
9034 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9035 hotkey was registered successfully.
9036 """
54f9ee45 9037 return _core_.Window_RegisterHotKey(*args, **kwargs)
e811c8ce
RD
9038
9039 def UnregisterHotKey(*args, **kwargs):
15afbcd0 9040 """
a95a7133 9041 UnregisterHotKey(self, int hotkeyId) -> bool
15afbcd0
RD
9042
9043 Unregisters a system wide hotkey.
9044 """
54f9ee45 9045 return _core_.Window_UnregisterHotKey(*args, **kwargs)
e811c8ce
RD
9046
9047 def ConvertDialogPointToPixels(*args, **kwargs):
15afbcd0 9048 """
a95a7133 9049 ConvertDialogPointToPixels(self, Point pt) -> Point
15afbcd0
RD
9050
9051 Converts a point or size from dialog units to pixels. Dialog units
9052 are used for maintaining a dialog's proportions even if the font
9053 changes. For the x dimension, the dialog units are multiplied by the
9054 average character width and then divided by 4. For the y dimension,
9055 the dialog units are multiplied by the average character height and
9056 then divided by 8.
9057 """
54f9ee45 9058 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
e811c8ce
RD
9059
9060 def ConvertDialogSizeToPixels(*args, **kwargs):
15afbcd0 9061 """
a95a7133 9062 ConvertDialogSizeToPixels(self, Size sz) -> Size
15afbcd0
RD
9063
9064 Converts a point or size from dialog units to pixels. Dialog units
9065 are used for maintaining a dialog's proportions even if the font
9066 changes. For the x dimension, the dialog units are multiplied by the
9067 average character width and then divided by 4. For the y dimension,
9068 the dialog units are multiplied by the average character height and
9069 then divided by 8.
9070 """
54f9ee45 9071 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
e811c8ce
RD
9072
9073 def DLG_PNT(*args, **kwargs):
15afbcd0 9074 """
a95a7133 9075 DLG_PNT(self, Point pt) -> Point
15afbcd0
RD
9076
9077 Converts a point or size from dialog units to pixels. Dialog units
9078 are used for maintaining a dialog's proportions even if the font
9079 changes. For the x dimension, the dialog units are multiplied by the
9080 average character width and then divided by 4. For the y dimension,
9081 the dialog units are multiplied by the average character height and
9082 then divided by 8.
9083 """
54f9ee45 9084 return _core_.Window_DLG_PNT(*args, **kwargs)
e811c8ce
RD
9085
9086 def DLG_SZE(*args, **kwargs):
15afbcd0 9087 """
a95a7133 9088 DLG_SZE(self, Size sz) -> Size
15afbcd0
RD
9089
9090 Converts a point or size from dialog units to pixels. Dialog units
9091 are used for maintaining a dialog's proportions even if the font
9092 changes. For the x dimension, the dialog units are multiplied by the
9093 average character width and then divided by 4. For the y dimension,
9094 the dialog units are multiplied by the average character height and
9095 then divided by 8.
9096 """
54f9ee45 9097 return _core_.Window_DLG_SZE(*args, **kwargs)
e811c8ce
RD
9098
9099 def ConvertPixelPointToDialog(*args, **kwargs):
a95a7133 9100 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
54f9ee45 9101 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
e811c8ce
RD
9102
9103 def ConvertPixelSizeToDialog(*args, **kwargs):
a95a7133 9104 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
54f9ee45 9105 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
e811c8ce
RD
9106
9107 def WarpPointer(*args, **kwargs):
15afbcd0 9108 """
a95a7133 9109 WarpPointer(self, int x, int y)
15afbcd0
RD
9110
9111 Moves the pointer to the given position on the window.
9112
9113 NOTE: This function is not supported under Mac because Apple Human
9114 Interface Guidelines forbid moving the mouse cursor programmatically.
9115 """
54f9ee45 9116 return _core_.Window_WarpPointer(*args, **kwargs)
e811c8ce
RD
9117
9118 def CaptureMouse(*args, **kwargs):
15afbcd0 9119 """
a95a7133 9120 CaptureMouse(self)
15afbcd0
RD
9121
9122 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9123 release the capture.
9124
9125 Note that wxWindows maintains the stack of windows having captured the
9126 mouse and when the mouse is released the capture returns to the window
9127 which had had captured it previously and it is only really released if
9128 there were no previous window. In particular, this means that you must
34e0a3bb
RD
9129 release the mouse as many times as you capture it, unless the window
9130 receives the `wx.MouseCaptureLostEvent` event.
9131
9132 Any application which captures the mouse in the beginning of some
9133 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9134 operation when it receives the event. The event handler must not
9135 recapture mouse.
15afbcd0 9136 """
54f9ee45 9137 return _core_.Window_CaptureMouse(*args, **kwargs)
e811c8ce
RD
9138
9139 def ReleaseMouse(*args, **kwargs):
15afbcd0 9140 """
a95a7133 9141 ReleaseMouse(self)
15afbcd0
RD
9142
9143 Releases mouse input captured with wx.Window.CaptureMouse.
9144 """
54f9ee45 9145 return _core_.Window_ReleaseMouse(*args, **kwargs)
e811c8ce
RD
9146
9147 def GetCapture(*args, **kwargs):
15afbcd0 9148 """
66c033b4 9149 GetCapture() -> Window
15afbcd0
RD
9150
9151 Returns the window which currently captures the mouse or None
9152 """
54f9ee45 9153 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce
RD
9154
9155 GetCapture = staticmethod(GetCapture)
9156 def HasCapture(*args, **kwargs):
15afbcd0 9157 """
a95a7133 9158 HasCapture(self) -> bool
15afbcd0
RD
9159
9160 Returns true if this window has the current mouse capture.
9161 """
54f9ee45 9162 return _core_.Window_HasCapture(*args, **kwargs)
e811c8ce
RD
9163
9164 def Refresh(*args, **kwargs):
15afbcd0 9165 """
a95a7133 9166 Refresh(self, bool eraseBackground=True, Rect rect=None)
15afbcd0
RD
9167
9168 Mark the specified rectangle (or the whole window) as "dirty" so it
9169 will be repainted. Causes an EVT_PAINT event to be generated and sent
9170 to the window.
9171 """
54f9ee45 9172 return _core_.Window_Refresh(*args, **kwargs)
e811c8ce
RD
9173
9174 def RefreshRect(*args, **kwargs):
15afbcd0 9175 """
fef4c27a 9176 RefreshRect(self, Rect rect, bool eraseBackground=True)
15afbcd0
RD
9177
9178 Redraws the contents of the given rectangle: the area inside it will
9179 be repainted. This is the same as Refresh but has a nicer syntax.
9180 """
54f9ee45 9181 return _core_.Window_RefreshRect(*args, **kwargs)
e811c8ce
RD
9182
9183 def Update(*args, **kwargs):
15afbcd0 9184 """
a95a7133 9185 Update(self)
15afbcd0
RD
9186
9187 Calling this method immediately repaints the invalidated area of the
9188 window instead of waiting for the EVT_PAINT event to happen, (normally
9189 this would usually only happen when the flow of control returns to the
9190 event loop.) Notice that this function doesn't refresh the window and
9b940138 9191 does nothing if the window has been already repainted. Use `Refresh`
15afbcd0
RD
9192 first if you want to immediately redraw the window (or some portion of
9193 it) unconditionally.
9194 """
54f9ee45 9195 return _core_.Window_Update(*args, **kwargs)
e811c8ce
RD
9196
9197 def ClearBackground(*args, **kwargs):
15afbcd0 9198 """
a95a7133 9199 ClearBackground(self)
15afbcd0
RD
9200
9201 Clears the window by filling it with the current background
9202 colour. Does not cause an erase background event to be generated.
9203 """
54f9ee45 9204 return _core_.Window_ClearBackground(*args, **kwargs)
e811c8ce
RD
9205
9206 def Freeze(*args, **kwargs):
15afbcd0 9207 """
a95a7133 9208 Freeze(self)
15afbcd0 9209
41e2b43e
RD
9210 Freezes the window or, in other words, prevents any updates from
9211 taking place on screen, the window is not redrawn at all. Thaw must be
9212 called to reenable window redrawing. Calls to Freeze/Thaw may be
9213 nested, with the actual Thaw being delayed until all the nesting has
9214 been undone.
15afbcd0
RD
9215
9216 This method is useful for visual appearance optimization (for example,
9217 it is a good idea to use it before inserting large amount of text into
9218 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9219 for all controls so it is mostly just a hint to wxWindows and not a
9220 mandatory directive.
9221 """
54f9ee45 9222 return _core_.Window_Freeze(*args, **kwargs)
e811c8ce 9223
33d6fd3b
RD
9224 def IsFrozen(*args, **kwargs):
9225 """
9226 IsFrozen(self) -> bool
9227
9228 Returns ``True`` if the window has been frozen and not thawed yet.
9229
9230 :see: `Freeze` and `Thaw`
9231 """
9232 return _core_.Window_IsFrozen(*args, **kwargs)
9233
e811c8ce 9234 def Thaw(*args, **kwargs):
15afbcd0 9235 """
a95a7133 9236 Thaw(self)
15afbcd0 9237
4276dc52 9238 Reenables window updating after a previous call to Freeze. Calls to
41e2b43e
RD
9239 Freeze/Thaw may be nested, so Thaw must be called the same number of
9240 times that Freeze was before the window will be updated.
15afbcd0 9241 """
54f9ee45 9242 return _core_.Window_Thaw(*args, **kwargs)
e811c8ce
RD
9243
9244 def PrepareDC(*args, **kwargs):
15afbcd0 9245 """
a95a7133 9246 PrepareDC(self, DC dc)
15afbcd0
RD
9247
9248 Call this function to prepare the device context for drawing a
9249 scrolled image. It sets the device origin according to the current
9250 scroll position.
9251 """
54f9ee45 9252 return _core_.Window_PrepareDC(*args, **kwargs)
e811c8ce 9253
b39fe951
RD
9254 def IsDoubleBuffered(*args, **kwargs):
9255 """
9256 IsDoubleBuffered(self) -> bool
9257
9258 Returns ``True`` if the window contents is double-buffered by the
9259 system, i.e. if any drawing done on the window is really done on a
9260 temporary backing surface and transferred to the screen all at once
9261 later.
9262 """
9263 return _core_.Window_IsDoubleBuffered(*args, **kwargs)
9264
e811c8ce 9265 def GetUpdateRegion(*args, **kwargs):
15afbcd0 9266 """
a95a7133 9267 GetUpdateRegion(self) -> Region
15afbcd0
RD
9268
9269 Returns the region specifying which parts of the window have been
9270 damaged. Should only be called within an EVT_PAINT handler.
9271 """
54f9ee45 9272 return _core_.Window_GetUpdateRegion(*args, **kwargs)
e811c8ce
RD
9273
9274 def GetUpdateClientRect(*args, **kwargs):
15afbcd0 9275 """
a95a7133 9276 GetUpdateClientRect(self) -> Rect
15afbcd0
RD
9277
9278 Get the update rectangle region bounding box in client coords.
9279 """
54f9ee45 9280 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
e811c8ce
RD
9281
9282 def IsExposed(*args, **kwargs):
15afbcd0 9283 """
a95a7133 9284 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
15afbcd0
RD
9285
9286 Returns true if the given point or rectangle area has been exposed
9287 since the last repaint. Call this in an paint event handler to
9288 optimize redrawing by only redrawing those areas, which have been
9289 exposed.
9290 """
54f9ee45 9291 return _core_.Window_IsExposed(*args, **kwargs)
e811c8ce
RD
9292
9293 def IsExposedPoint(*args, **kwargs):
15afbcd0 9294 """
a95a7133 9295 IsExposedPoint(self, Point pt) -> bool
15afbcd0
RD
9296
9297 Returns true if the given point or rectangle area has been exposed
9298 since the last repaint. Call this in an paint event handler to
9299 optimize redrawing by only redrawing those areas, which have been
9300 exposed.
9301 """
54f9ee45 9302 return _core_.Window_IsExposedPoint(*args, **kwargs)
e811c8ce 9303
4276dc52 9304 def IsExposedRect(*args, **kwargs):
15afbcd0 9305 """
a95a7133 9306 IsExposedRect(self, Rect rect) -> bool
15afbcd0
RD
9307
9308 Returns true if the given point or rectangle area has been exposed
9309 since the last repaint. Call this in an paint event handler to
9310 optimize redrawing by only redrawing those areas, which have been
9311 exposed.
9312 """
54f9ee45 9313 return _core_.Window_IsExposedRect(*args, **kwargs)
e811c8ce 9314
74a57fcd
RD
9315 def GetDefaultAttributes(*args, **kwargs):
9316 """
a95a7133 9317 GetDefaultAttributes(self) -> VisualAttributes
74a57fcd 9318
41e2b43e
RD
9319 Get the default attributes for an instance of this class. This is
9320 useful if you want to use the same font or colour in your own control
9321 as in a standard control -- which is a much better idea than hard
9322 coding specific colours or fonts which might look completely out of
db3e571a 9323 place on the user's system, especially if it uses themes.
74a57fcd 9324 """
54f9ee45 9325 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
74a57fcd
RD
9326
9327 def GetClassDefaultAttributes(*args, **kwargs):
9328 """
66c033b4 9329 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
74a57fcd 9330
41e2b43e
RD
9331 Get the default attributes for this class. This is useful if you want
9332 to use the same font or colour in your own control as in a standard
9333 control -- which is a much better idea than hard coding specific
db3e571a
RD
9334 colours or fonts which might look completely out of place on the
9335 user's system, especially if it uses themes.
74a57fcd
RD
9336
9337 The variant parameter is only relevant under Mac currently and is
41e2b43e 9338 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
9339 the returned font. See `wx.Window.SetWindowVariant` for more about
9340 this.
74a57fcd 9341 """
54f9ee45 9342 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
9343
9344 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
e811c8ce 9345 def SetBackgroundColour(*args, **kwargs):
15afbcd0 9346 """
a95a7133 9347 SetBackgroundColour(self, Colour colour) -> bool
15afbcd0
RD
9348
9349 Sets the background colour of the window. Returns True if the colour
9350 was changed. The background colour is usually painted by the default
9351 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9352 automatically under GTK. Using `wx.NullColour` will reset the window
9353 to the default background colour.
15afbcd0 9354
db3e571a 9355 Note that setting the background colour may not cause an immediate
f8167d6e 9356 refresh, so you may wish to call `ClearBackground` or `Refresh` after
15afbcd0
RD
9357 calling this function.
9358
f8167d6e
RD
9359 Using this function will disable attempts to use themes for this
9360 window, if the system supports them. Use with care since usually the
9361 themes represent the appearance chosen by the user to be used for all
9362 applications on the system.
15afbcd0 9363 """
54f9ee45 9364 return _core_.Window_SetBackgroundColour(*args, **kwargs)
e811c8ce 9365
412d302d
RD
9366 def SetOwnBackgroundColour(*args, **kwargs):
9367 """SetOwnBackgroundColour(self, Colour colour)"""
9368 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
b2df227b 9369
e811c8ce 9370 def SetForegroundColour(*args, **kwargs):
15afbcd0 9371 """
a95a7133 9372 SetForegroundColour(self, Colour colour) -> bool
15afbcd0
RD
9373
9374 Sets the foreground colour of the window. Returns True is the colour
9375 was changed. The interpretation of foreground colour is dependent on
9376 the window class; it may be the text colour or other colour, or it may
9377 not be used at all.
9378 """
54f9ee45 9379 return _core_.Window_SetForegroundColour(*args, **kwargs)
e811c8ce 9380
fa47d7a7
VS
9381 def SetOwnForegroundColour(*args, **kwargs):
9382 """SetOwnForegroundColour(self, Colour colour)"""
9383 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
b2df227b 9384
e811c8ce 9385 def GetBackgroundColour(*args, **kwargs):
15afbcd0 9386 """
a95a7133 9387 GetBackgroundColour(self) -> Colour
15afbcd0
RD
9388
9389 Returns the background colour of the window.
9390 """
54f9ee45 9391 return _core_.Window_GetBackgroundColour(*args, **kwargs)
e811c8ce
RD
9392
9393 def GetForegroundColour(*args, **kwargs):
15afbcd0 9394 """
a95a7133 9395 GetForegroundColour(self) -> Colour
15afbcd0
RD
9396
9397 Returns the foreground colour of the window. The interpretation of
9398 foreground colour is dependent on the window class; it may be the text
9399 colour or other colour, or it may not be used at all.
9400 """
54f9ee45 9401 return _core_.Window_GetForegroundColour(*args, **kwargs)
e811c8ce 9402
562ecc31
RD
9403 def InheritsBackgroundColour(*args, **kwargs):
9404 """InheritsBackgroundColour(self) -> bool"""
9405 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9406
9407 def UseBgCol(*args, **kwargs):
9408 """UseBgCol(self) -> bool"""
9409 return _core_.Window_UseBgCol(*args, **kwargs)
9410
7bc1e663
RD
9411 def SetBackgroundStyle(*args, **kwargs):
9412 """
9413 SetBackgroundStyle(self, int style) -> bool
9414
9415 Returns the background style of the window. The background style
9416 indicates how the background of the window is drawn.
9417
9418 ====================== ========================================
9419 wx.BG_STYLE_SYSTEM The background colour or pattern should
9420 be determined by the system
9421 wx.BG_STYLE_COLOUR The background should be a solid colour
9422 wx.BG_STYLE_CUSTOM The background will be implemented by the
9423 application.
9424 ====================== ========================================
9425
9426 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9427 a custom background, such as a tiled bitmap. Currently the style has
9428 no effect on other platforms.
9429
9430 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9431 """
9432 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9433
9434 def GetBackgroundStyle(*args, **kwargs):
9435 """
9436 GetBackgroundStyle(self) -> int
9437
9438 Returns the background style of the window.
9439
9440 :see: `SetBackgroundStyle`
9441 """
9442 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9443
51b83b37
RD
9444 def HasTransparentBackground(*args, **kwargs):
9445 """
9446 HasTransparentBackground(self) -> bool
9447
9448 Returns True if this window's background is transparent (as, for
9449 example, for `wx.StaticText`) and should show the parent window's
9450 background.
9451
9452 This method is mostly used internally by the library itself and you
9453 normally shouldn't have to call it. You may, however, have to override
9454 it in your custom control classes to ensure that background is painted
9455 correctly.
9456 """
9457 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9458
e811c8ce 9459 def SetCursor(*args, **kwargs):
15afbcd0 9460 """
a95a7133 9461 SetCursor(self, Cursor cursor) -> bool
15afbcd0
RD
9462
9463 Sets the window's cursor. Notice that the window cursor also sets it
9464 for the children of the window implicitly.
9465
9466 The cursor may be wx.NullCursor in which case the window cursor will
9467 be reset back to default.
9468 """
54f9ee45 9469 return _core_.Window_SetCursor(*args, **kwargs)
e811c8ce
RD
9470
9471 def GetCursor(*args, **kwargs):
15afbcd0 9472 """
a95a7133 9473 GetCursor(self) -> Cursor
15afbcd0
RD
9474
9475 Return the cursor associated with this window.
9476 """
54f9ee45 9477 return _core_.Window_GetCursor(*args, **kwargs)
e811c8ce
RD
9478
9479 def SetFont(*args, **kwargs):
15afbcd0 9480 """
a95a7133 9481 SetFont(self, Font font) -> bool
15afbcd0
RD
9482
9483 Sets the font for this window.
9484 """
54f9ee45 9485 return _core_.Window_SetFont(*args, **kwargs)
e811c8ce 9486
fa47d7a7
VS
9487 def SetOwnFont(*args, **kwargs):
9488 """SetOwnFont(self, Font font)"""
9489 return _core_.Window_SetOwnFont(*args, **kwargs)
b2df227b 9490
e811c8ce 9491 def GetFont(*args, **kwargs):
15afbcd0 9492 """
a95a7133 9493 GetFont(self) -> Font
15afbcd0 9494
4276dc52 9495 Returns the default font used for this window.
15afbcd0 9496 """
54f9ee45 9497 return _core_.Window_GetFont(*args, **kwargs)
e811c8ce
RD
9498
9499 def SetCaret(*args, **kwargs):
15afbcd0 9500 """
a95a7133 9501 SetCaret(self, Caret caret)
15afbcd0
RD
9502
9503 Sets the caret associated with the window.
9504 """
54f9ee45 9505 return _core_.Window_SetCaret(*args, **kwargs)
e811c8ce
RD
9506
9507 def GetCaret(*args, **kwargs):
15afbcd0 9508 """
a95a7133 9509 GetCaret(self) -> Caret
15afbcd0
RD
9510
9511 Returns the caret associated with the window.
9512 """
54f9ee45 9513 return _core_.Window_GetCaret(*args, **kwargs)
e811c8ce
RD
9514
9515 def GetCharHeight(*args, **kwargs):
15afbcd0 9516 """
a95a7133 9517 GetCharHeight(self) -> int
15afbcd0
RD
9518
9519 Get the (average) character size for the current font.
9520 """
54f9ee45 9521 return _core_.Window_GetCharHeight(*args, **kwargs)
e811c8ce
RD
9522
9523 def GetCharWidth(*args, **kwargs):
15afbcd0 9524 """
a95a7133 9525 GetCharWidth(self) -> int
15afbcd0
RD
9526
9527 Get the (average) character size for the current font.
9528 """
54f9ee45 9529 return _core_.Window_GetCharWidth(*args, **kwargs)
e811c8ce
RD
9530
9531 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9532 """
9533 GetTextExtent(String string) -> (width, height)
9534
9535 Get the width and height of the text using the current font.
9536 """
54f9ee45 9537 return _core_.Window_GetTextExtent(*args, **kwargs)
e811c8ce
RD
9538
9539 def GetFullTextExtent(*args, **kwargs):
0df68c9f 9540 """
196addbf 9541 GetFullTextExtent(String string, Font font=None) ->
0df68c9f 9542 (width, height, descent, externalLeading)
e811c8ce 9543
15afbcd0
RD
9544 Get the width, height, decent and leading of the text using the
9545 current or specified font.
0df68c9f 9546 """
54f9ee45 9547 return _core_.Window_GetFullTextExtent(*args, **kwargs)
e811c8ce
RD
9548
9549 def ClientToScreenXY(*args, **kwargs):
15afbcd0
RD
9550 """
9551 ClientToScreenXY(int x, int y) -> (x,y)
9552
9553 Converts to screen coordinates from coordinates relative to this window.
9554 """
54f9ee45 9555 return _core_.Window_ClientToScreenXY(*args, **kwargs)
e811c8ce
RD
9556
9557 def ScreenToClientXY(*args, **kwargs):
15afbcd0
RD
9558 """
9559 ScreenToClientXY(int x, int y) -> (x,y)
9560
9561 Converts from screen to client window coordinates.
9562 """
54f9ee45 9563 return _core_.Window_ScreenToClientXY(*args, **kwargs)
e811c8ce
RD
9564
9565 def ClientToScreen(*args, **kwargs):
15afbcd0 9566 """
a95a7133 9567 ClientToScreen(self, Point pt) -> Point
15afbcd0
RD
9568
9569 Converts to screen coordinates from coordinates relative to this window.
9570 """
54f9ee45 9571 return _core_.Window_ClientToScreen(*args, **kwargs)
e811c8ce
RD
9572
9573 def ScreenToClient(*args, **kwargs):
15afbcd0 9574 """
a95a7133 9575 ScreenToClient(self, Point pt) -> Point
15afbcd0
RD
9576
9577 Converts from screen to client window coordinates.
9578 """
54f9ee45 9579 return _core_.Window_ScreenToClient(*args, **kwargs)
e811c8ce
RD
9580
9581 def HitTestXY(*args, **kwargs):
15afbcd0 9582 """
a95a7133 9583 HitTestXY(self, int x, int y) -> int
15afbcd0
RD
9584
9585 Test where the given (in client coords) point lies
9586 """
54f9ee45 9587 return _core_.Window_HitTestXY(*args, **kwargs)
e811c8ce
RD
9588
9589 def HitTest(*args, **kwargs):
15afbcd0 9590 """
a95a7133 9591 HitTest(self, Point pt) -> int
15afbcd0
RD
9592
9593 Test where the given (in client coords) point lies
9594 """
54f9ee45 9595 return _core_.Window_HitTest(*args, **kwargs)
e811c8ce 9596
15afbcd0
RD
9597 def GetBorder(*args):
9598 """
a95a7133
RD
9599 GetBorder(self, long flags) -> int
9600 GetBorder(self) -> int
e811c8ce 9601
15afbcd0
RD
9602 Get border for the flags of this window
9603 """
54f9ee45 9604 return _core_.Window_GetBorder(*args)
e811c8ce
RD
9605
9606 def UpdateWindowUI(*args, **kwargs):
15afbcd0 9607 """
a95a7133 9608 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
15afbcd0
RD
9609
9610 This function sends EVT_UPDATE_UI events to the window. The particular
9611 implementation depends on the window; for example a wx.ToolBar will
9612 send an update UI event for each toolbar button, and a wx.Frame will
9613 send an update UI event for each menubar menu item. You can call this
9614 function from your application to ensure that your UI is up-to-date at
9615 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9616 concerned). This may be necessary if you have called
5ba5649b 9617 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
15afbcd0
RD
9618 limit the overhead that wxWindows incurs by sending update UI events
9619 in idle time.
15afbcd0 9620 """
54f9ee45 9621 return _core_.Window_UpdateWindowUI(*args, **kwargs)
e811c8ce
RD
9622
9623 def PopupMenuXY(*args, **kwargs):
15afbcd0 9624 """
b0503257 9625 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
15afbcd0 9626
b0503257
RD
9627 Pops up the given menu at the specified coordinates, relative to this window,
9628 and returns control when the user has dismissed the menu. If a menu item is
9629 selected, the corresponding menu event is generated and will be processed as
9630 usual. If the default position is given then the current position of the
9631 mouse cursor will be used.
15afbcd0 9632 """
54f9ee45 9633 return _core_.Window_PopupMenuXY(*args, **kwargs)
e811c8ce 9634
15afbcd0
RD
9635 def PopupMenu(*args, **kwargs):
9636 """
b0503257 9637 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
15afbcd0 9638
b0503257
RD
9639 Pops up the given menu at the specified coordinates, relative to this window,
9640 and returns control when the user has dismissed the menu. If a menu item is
9641 selected, the corresponding menu event is generated and will be processed as
9642 usual. If the default position is given then the current position of the
9643 mouse cursor will be used.
15afbcd0 9644 """
54f9ee45 9645 return _core_.Window_PopupMenu(*args, **kwargs)
15afbcd0 9646
10044bf1
RD
9647 def HasMultiplePages(*args, **kwargs):
9648 """HasMultiplePages(self) -> bool"""
9649 return _core_.Window_HasMultiplePages(*args, **kwargs)
9650
15afbcd0
RD
9651 def GetHandle(*args, **kwargs):
9652 """
a95a7133 9653 GetHandle(self) -> long
15afbcd0
RD
9654
9655 Returns the platform-specific handle (as a long integer) of the
9656 physical window. Currently on wxMac it returns the handle of the
9657 toplevel parent of the window.
9658 """
54f9ee45 9659 return _core_.Window_GetHandle(*args, **kwargs)
15afbcd0 9660
7e63a440
RD
9661 def AssociateHandle(*args, **kwargs):
9662 """
9663 AssociateHandle(self, long handle)
9664
9665 Associate the window with a new native handle
9666 """
9667 return _core_.Window_AssociateHandle(*args, **kwargs)
9668
9669 def DissociateHandle(*args, **kwargs):
9670 """
9671 DissociateHandle(self)
9672
9673 Dissociate the current native handle from the window
9674 """
9675 return _core_.Window_DissociateHandle(*args, **kwargs)
9676
15afbcd0
RD
9677 def HasScrollbar(*args, **kwargs):
9678 """
a95a7133 9679 HasScrollbar(self, int orient) -> bool
15afbcd0
RD
9680
9681 Does the window have the scrollbar for this orientation?
9682 """
54f9ee45 9683 return _core_.Window_HasScrollbar(*args, **kwargs)
15afbcd0
RD
9684
9685 def SetScrollbar(*args, **kwargs):
9686 """
41e2b43e 9687 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
15afbcd0
RD
9688 bool refresh=True)
9689
9690 Sets the scrollbar properties of a built-in scrollbar.
15afbcd0 9691 """
54f9ee45 9692 return _core_.Window_SetScrollbar(*args, **kwargs)
e811c8ce
RD
9693
9694 def SetScrollPos(*args, **kwargs):
15afbcd0 9695 """
a95a7133 9696 SetScrollPos(self, int orientation, int pos, bool refresh=True)
15afbcd0
RD
9697
9698 Sets the position of one of the built-in scrollbars.
9699 """
54f9ee45 9700 return _core_.Window_SetScrollPos(*args, **kwargs)
e811c8ce
RD
9701
9702 def GetScrollPos(*args, **kwargs):
15afbcd0 9703 """
a95a7133 9704 GetScrollPos(self, int orientation) -> int
15afbcd0
RD
9705
9706 Returns the built-in scrollbar position.
9707 """
54f9ee45 9708 return _core_.Window_GetScrollPos(*args, **kwargs)
e811c8ce
RD
9709
9710 def GetScrollThumb(*args, **kwargs):
15afbcd0 9711 """
a95a7133 9712 GetScrollThumb(self, int orientation) -> int
15afbcd0
RD
9713
9714 Returns the built-in scrollbar thumb size.
9715 """
54f9ee45 9716 return _core_.Window_GetScrollThumb(*args, **kwargs)
e811c8ce
RD
9717
9718 def GetScrollRange(*args, **kwargs):
15afbcd0 9719 """
a95a7133 9720 GetScrollRange(self, int orientation) -> int
15afbcd0
RD
9721
9722 Returns the built-in scrollbar range.
9723 """
54f9ee45 9724 return _core_.Window_GetScrollRange(*args, **kwargs)
e811c8ce
RD
9725
9726 def ScrollWindow(*args, **kwargs):
15afbcd0 9727 """
a95a7133 9728 ScrollWindow(self, int dx, int dy, Rect rect=None)
15afbcd0
RD
9729
9730 Physically scrolls the pixels in the window and move child windows
9731 accordingly. Use this function to optimise your scrolling
9732 implementations, to minimise the area that must be redrawn. Note that
9733 it is rarely required to call this function from a user program.
15afbcd0 9734 """
54f9ee45 9735 return _core_.Window_ScrollWindow(*args, **kwargs)
e811c8ce
RD
9736
9737 def ScrollLines(*args, **kwargs):
15afbcd0 9738 """
a95a7133 9739 ScrollLines(self, int lines) -> bool
15afbcd0
RD
9740
9741 If the platform and window class supports it, scrolls the window by
9742 the given number of lines down, if lines is positive, or up if lines
9743 is negative. Returns True if the window was scrolled, False if it was
9744 already on top/bottom and nothing was done.
9745 """
54f9ee45 9746 return _core_.Window_ScrollLines(*args, **kwargs)
e811c8ce
RD
9747
9748 def ScrollPages(*args, **kwargs):
15afbcd0 9749 """
a95a7133 9750 ScrollPages(self, int pages) -> bool
15afbcd0 9751
41e2b43e 9752 If the platform and window class supports it, scrolls the window by
15afbcd0
RD
9753 the given number of pages down, if pages is positive, or up if pages
9754 is negative. Returns True if the window was scrolled, False if it was
9755 already on top/bottom and nothing was done.
9756 """
54f9ee45 9757 return _core_.Window_ScrollPages(*args, **kwargs)
e811c8ce
RD
9758
9759 def LineUp(*args, **kwargs):
15afbcd0 9760 """
a95a7133 9761 LineUp(self) -> bool
15afbcd0
RD
9762
9763 This is just a wrapper for ScrollLines(-1).
9764 """
54f9ee45 9765 return _core_.Window_LineUp(*args, **kwargs)
e811c8ce
RD
9766
9767 def LineDown(*args, **kwargs):
15afbcd0 9768 """
a95a7133 9769 LineDown(self) -> bool
15afbcd0
RD
9770
9771 This is just a wrapper for ScrollLines(1).
9772 """
54f9ee45 9773 return _core_.Window_LineDown(*args, **kwargs)
e811c8ce
RD
9774
9775 def PageUp(*args, **kwargs):
15afbcd0 9776 """
a95a7133 9777 PageUp(self) -> bool
15afbcd0
RD
9778
9779 This is just a wrapper for ScrollPages(-1).
9780 """
54f9ee45 9781 return _core_.Window_PageUp(*args, **kwargs)
e811c8ce
RD
9782
9783 def PageDown(*args, **kwargs):
15afbcd0 9784 """
a95a7133 9785 PageDown(self) -> bool
15afbcd0
RD
9786
9787 This is just a wrapper for ScrollPages(1).
9788 """
54f9ee45 9789 return _core_.Window_PageDown(*args, **kwargs)
e811c8ce
RD
9790
9791 def SetHelpText(*args, **kwargs):
15afbcd0 9792 """
a95a7133 9793 SetHelpText(self, String text)
15afbcd0
RD
9794
9795 Sets the help text to be used as context-sensitive help for this
9796 window. Note that the text is actually stored by the current
f52cbe90 9797 `wx.HelpProvider` implementation, and not in the window object itself.
15afbcd0 9798 """
54f9ee45 9799 return _core_.Window_SetHelpText(*args, **kwargs)
e811c8ce
RD
9800
9801 def SetHelpTextForId(*args, **kwargs):
15afbcd0 9802 """
a95a7133 9803 SetHelpTextForId(self, String text)
15afbcd0
RD
9804
9805 Associate this help text with all windows with the same id as this
9806 one.
9807 """
54f9ee45 9808 return _core_.Window_SetHelpTextForId(*args, **kwargs)
e811c8ce 9809
b850e7f3
RD
9810 def GetHelpTextAtPoint(*args, **kwargs):
9811 """
9812 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9813
9814 Get the help string associated with the given position in this window.
9815
9816 Notice that pt may be invalid if event origin is keyboard or unknown
9817 and this method should return the global window help text then
9818
9819 """
9820 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9821
e811c8ce 9822 def GetHelpText(*args, **kwargs):
15afbcd0 9823 """
a95a7133 9824 GetHelpText(self) -> String
15afbcd0
RD
9825
9826 Gets the help text to be used as context-sensitive help for this
9827 window. Note that the text is actually stored by the current
f52cbe90 9828 `wx.HelpProvider` implementation, and not in the window object itself.
15afbcd0 9829 """
54f9ee45 9830 return _core_.Window_GetHelpText(*args, **kwargs)
e811c8ce
RD
9831
9832 def SetToolTipString(*args, **kwargs):
15afbcd0 9833 """
a95a7133 9834 SetToolTipString(self, String tip)
15afbcd0
RD
9835
9836 Attach a tooltip to the window.
9837 """
54f9ee45 9838 return _core_.Window_SetToolTipString(*args, **kwargs)
e811c8ce
RD
9839
9840 def SetToolTip(*args, **kwargs):
15afbcd0 9841 """
a95a7133 9842 SetToolTip(self, ToolTip tip)
15afbcd0
RD
9843
9844 Attach a tooltip to the window.
9845 """
54f9ee45 9846 return _core_.Window_SetToolTip(*args, **kwargs)
e811c8ce
RD
9847
9848 def GetToolTip(*args, **kwargs):
15afbcd0 9849 """
a95a7133 9850 GetToolTip(self) -> ToolTip
15afbcd0
RD
9851
9852 get the associated tooltip or None if none
9853 """
54f9ee45 9854 return _core_.Window_GetToolTip(*args, **kwargs)
e811c8ce
RD
9855
9856 def SetDropTarget(*args, **kwargs):
15afbcd0 9857 """
a95a7133 9858 SetDropTarget(self, DropTarget dropTarget)
15afbcd0
RD
9859
9860 Associates a drop target with this window. If the window already has
9861 a drop target, it is deleted.
9862 """
54f9ee45 9863 return _core_.Window_SetDropTarget(*args, **kwargs)
e811c8ce
RD
9864
9865 def GetDropTarget(*args, **kwargs):
15afbcd0 9866 """
a95a7133 9867 GetDropTarget(self) -> DropTarget
15afbcd0
RD
9868
9869 Returns the associated drop target, which may be None.
9870 """
54f9ee45 9871 return _core_.Window_GetDropTarget(*args, **kwargs)
e811c8ce 9872
5ba5649b
RD
9873 def DragAcceptFiles(*args, **kwargs):
9874 """
9875 DragAcceptFiles(self, bool accept)
9876
9877 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9878 Only functional on Windows.
9879 """
9880 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9881
e811c8ce 9882 def SetConstraints(*args, **kwargs):
15afbcd0 9883 """
a95a7133 9884 SetConstraints(self, LayoutConstraints constraints)
15afbcd0
RD
9885
9886 Sets the window to have the given layout constraints. If an existing
9887 layout constraints object is already owned by the window, it will be
9888 deleted. Pass None to disassociate and delete the window's current
9889 constraints.
9890
9891 You must call SetAutoLayout to tell a window to use the constraints
9892 automatically in its default EVT_SIZE handler; otherwise, you must
9893 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9894 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9895 effect.
9896 """
54f9ee45 9897 return _core_.Window_SetConstraints(*args, **kwargs)
e811c8ce
RD
9898
9899 def GetConstraints(*args, **kwargs):
15afbcd0 9900 """
a95a7133 9901 GetConstraints(self) -> LayoutConstraints
15afbcd0
RD
9902
9903 Returns a pointer to the window's layout constraints, or None if there
9904 are none.
9905 """
54f9ee45 9906 return _core_.Window_GetConstraints(*args, **kwargs)
e811c8ce
RD
9907
9908 def SetAutoLayout(*args, **kwargs):
15afbcd0 9909 """
a95a7133 9910 SetAutoLayout(self, bool autoLayout)
15afbcd0
RD
9911
9912 Determines whether the Layout function will be called automatically
b1fcee84
RD
9913 when the window is resized. lease note that this only happens for the
9914 windows usually used to contain children, namely `wx.Panel` and
9915 `wx.TopLevelWindow` (and the classes deriving from them).
9916
9917 This method is called implicitly by `SetSizer` but if you use
9918 `SetConstraints` you should call it manually or otherwise the window
9919 layout won't be correctly updated when its size changes.
15afbcd0 9920 """
54f9ee45 9921 return _core_.Window_SetAutoLayout(*args, **kwargs)
e811c8ce
RD
9922
9923 def GetAutoLayout(*args, **kwargs):
15afbcd0 9924 """
a95a7133 9925 GetAutoLayout(self) -> bool
15afbcd0
RD
9926
9927 Returns the current autoLayout setting
9928 """
54f9ee45 9929 return _core_.Window_GetAutoLayout(*args, **kwargs)
e811c8ce
RD
9930
9931 def Layout(*args, **kwargs):
15afbcd0 9932 """
a95a7133 9933 Layout(self) -> bool
15afbcd0
RD
9934
9935 Invokes the constraint-based layout algorithm or the sizer-based
9936 algorithm for this window. See SetAutoLayout: when auto layout is on,
9937 this function gets called automatically by the default EVT_SIZE
9938 handler when the window is resized.
9939 """
54f9ee45 9940 return _core_.Window_Layout(*args, **kwargs)
e811c8ce
RD
9941
9942 def SetSizer(*args, **kwargs):
15afbcd0 9943 """
a95a7133 9944 SetSizer(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
9945
9946 Sets the window to have the given layout sizer. The window will then
9947 own the object, and will take care of its deletion. If an existing
9948 layout sizer object is already owned by the window, it will be deleted
9949 if the deleteOld parameter is true. Note that this function will also
9950 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 9951 non-None, and False otherwise.
15afbcd0 9952 """
54f9ee45 9953 return _core_.Window_SetSizer(*args, **kwargs)
e811c8ce
RD
9954
9955 def SetSizerAndFit(*args, **kwargs):
15afbcd0 9956 """
a95a7133 9957 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
9958
9959 The same as SetSizer, except it also sets the size hints for the
9960 window based on the sizer's minimum size.
9961 """
54f9ee45 9962 return _core_.Window_SetSizerAndFit(*args, **kwargs)
e811c8ce
RD
9963
9964 def GetSizer(*args, **kwargs):
15afbcd0 9965 """
a95a7133 9966 GetSizer(self) -> Sizer
15afbcd0
RD
9967
9968 Return the sizer associated with the window by a previous call to
9969 SetSizer or None if there isn't one.
9970 """
54f9ee45 9971 return _core_.Window_GetSizer(*args, **kwargs)
e811c8ce
RD
9972
9973 def SetContainingSizer(*args, **kwargs):
15afbcd0 9974 """
a95a7133 9975 SetContainingSizer(self, Sizer sizer)
15afbcd0
RD
9976
9977 This normally does not need to be called by application code. It is
9978 called internally when a window is added to a sizer, and is used so
9979 the window can remove itself from the sizer when it is destroyed.
9980 """
54f9ee45 9981 return _core_.Window_SetContainingSizer(*args, **kwargs)
e811c8ce
RD
9982
9983 def GetContainingSizer(*args, **kwargs):
15afbcd0 9984 """
a95a7133 9985 GetContainingSizer(self) -> Sizer
15afbcd0
RD
9986
9987 Return the sizer that this window is a member of, if any, otherwise None.
9988 """
54f9ee45 9989 return _core_.Window_GetContainingSizer(*args, **kwargs)
e811c8ce 9990
a95a7133
RD
9991 def InheritAttributes(*args, **kwargs):
9992 """
9993 InheritAttributes(self)
9994
41e2b43e
RD
9995 This function is (or should be, in case of custom controls) called
9996 during window creation to intelligently set up the window visual
9997 attributes, that is the font and the foreground and background
9998 colours.
9999
10000 By 'intelligently' the following is meant: by default, all windows use
10001 their own default attributes. However if some of the parent's
10002 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 10003 SetOwnFont) and if the corresponding attribute hadn't been
41e2b43e
RD
10004 explicitly set for this window itself, then this window takes the same
10005 value as used by the parent. In addition, if the window overrides
10006 ShouldInheritColours to return false, the colours will not be changed
10007 no matter what and only the font might.
10008
34621cc5 10009 This rather complicated logic is necessary in order to accommodate the
ec9b55ca 10010 different usage scenarios. The most common one is when all default
41e2b43e
RD
10011 attributes are used and in this case, nothing should be inherited as
10012 in modern GUIs different controls use different fonts (and colours)
10013 than their siblings so they can't inherit the same value from the
10014 parent. However it was also deemed desirable to allow to simply change
10015 the attributes of all children at once by just changing the font or
10016 colour of their common parent, hence in this case we do inherit the
10017 parents attributes.
10018
a95a7133 10019 """
54f9ee45 10020 return _core_.Window_InheritAttributes(*args, **kwargs)
a95a7133
RD
10021
10022 def ShouldInheritColours(*args, **kwargs):
10023 """
10024 ShouldInheritColours(self) -> bool
10025
10026 Return true from here to allow the colours of this window to be
41e2b43e
RD
10027 changed by InheritAttributes, returning false forbids inheriting them
10028 from the parent window.
a95a7133 10029
41e2b43e
RD
10030 The base class version returns false, but this method is overridden in
10031 wxControl where it returns true.
a95a7133 10032 """
54f9ee45 10033 return _core_.Window_ShouldInheritColours(*args, **kwargs)
a95a7133 10034
fc46b7f3
RD
10035 def CanSetTransparent(*args, **kwargs):
10036 """
10037 CanSetTransparent(self) -> bool
10038
10039 Returns ``True`` if the platform supports setting the transparency for
10040 this window. Note that this method will err on the side of caution,
10041 so it is possible that this will return ``False`` when it is in fact
10042 possible to set the transparency.
10043
10044 NOTE: On X-windows systems the X server must have the composite
10045 extension loaded, and there must be a composite manager program (such
10046 as xcompmgr) running.
10047 """
10048 return _core_.Window_CanSetTransparent(*args, **kwargs)
10049
10050 def SetTransparent(*args, **kwargs):
10051 """
10052 SetTransparent(self, byte alpha) -> bool
10053
10054 Attempt to set the transparency of this window to the ``alpha`` value,
10055 returns True on success. The ``alpha`` value is an integer in the
10056 range of 0 to 255, where 0 is fully transparent and 255 is fully
10057 opaque.
10058 """
10059 return _core_.Window_SetTransparent(*args, **kwargs)
10060
e811c8ce 10061 def PostCreate(self, pre):
15afbcd0
RD
10062 """
10063 Phase 3 of the 2-phase create <wink!>
10064 Call this method after precreating the window with the 2-phase create method.
10065 """
e811c8ce
RD
10066 self.this = pre.this
10067 self.thisown = pre.thisown
10068 pre.thisown = 0
10069 if hasattr(self, '_setOORInfo'):
10070 self._setOORInfo(self)
10071 if hasattr(self, '_setCallbackInfo'):
10072 self._setCallbackInfo(self, self.__class__)
10073
7e08d4ef 10074 def SendSizeEvent(self):
453fb36b 10075 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
7e08d4ef 10076
2bf58437
RD
10077 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
10078 AdjustedBestSize = property(GetAdjustedBestSize,doc="See `GetAdjustedBestSize`")
10079 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
10080 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10081 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
10082 BestFittingSize = property(GetBestFittingSize,SetBestFittingSize,doc="See `GetBestFittingSize` and `SetBestFittingSize`")
10083 BestSize = property(GetBestSize,doc="See `GetBestSize`")
10084 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
10085 Border = property(GetBorder,doc="See `GetBorder`")
10086 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
10087 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
10088 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
10089 Children = property(GetChildren,doc="See `GetChildren`")
10090 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
10091 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
10092 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
10093 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
10094 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
10095 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
10096 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
10097 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
10098 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10099 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
10100 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10101 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
2bf58437
RD
10102 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
10103 Handle = property(GetHandle,doc="See `GetHandle`")
10104 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
2bf58437
RD
10105 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10106 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
994453b8 10107 LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`")
2bf58437
RD
10108 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
10109 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
10110 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
10111 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
10112 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
10113 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
10114 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
10115 Parent = property(GetParent,doc="See `GetParent`")
10116 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
10117 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
10118 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
10119 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
2bf58437
RD
10120 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
10121 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
2bf58437
RD
10122 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
10123 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
10124 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
10125 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
10126 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
10127 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
10128 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
10129 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10130 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
97ab0f6a
RD
10131 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
10132 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
10133 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
2131d850 10134_core_.Window_swigregister(Window)
e811c8ce
RD
10135
10136def PreWindow(*args, **kwargs):
15afbcd0
RD
10137 """
10138 PreWindow() -> Window
10139
10140 Precreate a Window for 2-phase creation.
10141 """
54f9ee45 10142 val = _core_.new_PreWindow(*args, **kwargs)
e811c8ce
RD
10143 return val
10144
0085ce49
RD
10145def Window_NewControlId(*args):
10146 """
15afbcd0
RD
10147 Window_NewControlId() -> int
10148
10149 Generate a control id for the controls which were not given one.
10150 """
0085ce49 10151 return _core_.Window_NewControlId(*args)
e811c8ce
RD
10152
10153def Window_NextControlId(*args, **kwargs):
0085ce49 10154 """
15afbcd0
RD
10155 Window_NextControlId(int winid) -> int
10156
10157 Get the id of the control following the one with the given
41e2b43e 10158 autogenerated) id
15afbcd0 10159 """
0085ce49 10160 return _core_.Window_NextControlId(*args, **kwargs)
e811c8ce
RD
10161
10162def Window_PrevControlId(*args, **kwargs):
0085ce49 10163 """
15afbcd0
RD
10164 Window_PrevControlId(int winid) -> int
10165
10166 Get the id of the control preceding the one with the given
41e2b43e 10167 autogenerated) id
15afbcd0 10168 """
0085ce49 10169 return _core_.Window_PrevControlId(*args, **kwargs)
e811c8ce 10170
0085ce49
RD
10171def Window_FindFocus(*args):
10172 """
15afbcd0
RD
10173 Window_FindFocus() -> Window
10174
10175 Returns the window or control that currently has the keyboard focus,
10176 or None.
10177 """
0085ce49 10178 return _core_.Window_FindFocus(*args)
e811c8ce 10179
0085ce49
RD
10180def Window_GetCapture(*args):
10181 """
15afbcd0
RD
10182 Window_GetCapture() -> Window
10183
10184 Returns the window which currently captures the mouse or None
10185 """
0085ce49 10186 return _core_.Window_GetCapture(*args)
e811c8ce 10187
74a57fcd 10188def Window_GetClassDefaultAttributes(*args, **kwargs):
0085ce49 10189 """
74a57fcd
RD
10190 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10191
41e2b43e
RD
10192 Get the default attributes for this class. This is useful if you want
10193 to use the same font or colour in your own control as in a standard
10194 control -- which is a much better idea than hard coding specific
db3e571a
RD
10195 colours or fonts which might look completely out of place on the
10196 user's system, especially if it uses themes.
74a57fcd
RD
10197
10198 The variant parameter is only relevant under Mac currently and is
41e2b43e 10199 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
10200 the returned font. See `wx.Window.SetWindowVariant` for more about
10201 this.
74a57fcd 10202 """
0085ce49 10203 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 10204
e811c8ce 10205def DLG_PNT(win, point_or_x, y=None):
15afbcd0
RD
10206 """
10207 Convenience function for converting a Point or (x,y) in
10208 dialog units to pixel units.
10209 """
e811c8ce
RD
10210 if y is None:
10211 return win.ConvertDialogPointToPixels(point_or_x)
10212 else:
fd3f2efe 10213 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
e811c8ce
RD
10214
10215def DLG_SZE(win, size_width, height=None):
15afbcd0
RD
10216 """
10217 Convenience function for converting a Size or (w,h) in
10218 dialog units to pixel units.
10219 """
e811c8ce
RD
10220 if height is None:
10221 return win.ConvertDialogSizeToPixels(size_width)
10222 else:
fd3f2efe 10223 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
e811c8ce
RD
10224
10225
10226def FindWindowById(*args, **kwargs):
0085ce49 10227 """
15afbcd0
RD
10228 FindWindowById(long id, Window parent=None) -> Window
10229
10230 Find the first window in the application with the given id. If parent
10231 is None, the search will start from all top-level frames and dialog
10232 boxes; if non-None, the search will be limited to the given window
10233 hierarchy. The search is recursive in both cases.
10234 """
0085ce49 10235 return _core_.FindWindowById(*args, **kwargs)
e811c8ce
RD
10236
10237def FindWindowByName(*args, **kwargs):
0085ce49 10238 """
15afbcd0
RD
10239 FindWindowByName(String name, Window parent=None) -> Window
10240
10241 Find a window by its name (as given in a window constructor or Create
10242 function call). If parent is None, the search will start from all
10243 top-level frames and dialog boxes; if non-None, the search will be
10244 limited to the given window hierarchy. The search is recursive in both
10245 cases.
10246
10247 If no window with such name is found, wx.FindWindowByLabel is called.
10248 """
0085ce49 10249 return _core_.FindWindowByName(*args, **kwargs)
e811c8ce
RD
10250
10251def FindWindowByLabel(*args, **kwargs):
0085ce49 10252 """
15afbcd0
RD
10253 FindWindowByLabel(String label, Window parent=None) -> Window
10254
10255 Find a window by its label. Depending on the type of window, the label
10256 may be a window title or panel item label. If parent is None, the
10257 search will start from all top-level frames and dialog boxes; if
10258 non-None, the search will be limited to the given window
10259 hierarchy. The search is recursive in both cases.
10260 """
0085ce49 10261 return _core_.FindWindowByLabel(*args, **kwargs)
e811c8ce
RD
10262
10263def Window_FromHWND(*args, **kwargs):
0085ce49
RD
10264 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10265 return _core_.Window_FromHWND(*args, **kwargs)
b6b0383e 10266
0085ce49
RD
10267def GetTopLevelWindows(*args):
10268 """
b6b0383e
RD
10269 GetTopLevelWindows() -> PyObject
10270
10271 Returns a list of the the application's top-level windows, (frames,
10272 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10273 by wxWidgets, and so it is only valid as long as no top-level windows
10274 are closed or new top-level windows are created.
10275
10276 """
0085ce49 10277 return _core_.GetTopLevelWindows(*args)
e811c8ce
RD
10278#---------------------------------------------------------------------------
10279
10280class Validator(EvtHandler):
093d3ff1 10281 """Proxy of C++ Validator class"""
0085ce49
RD
10282 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10283 __repr__ = _swig_repr
10284 def __init__(self, *args, **kwargs):
a95a7133 10285 """__init__(self) -> Validator"""
0085ce49 10286 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d14a1e28 10287 self._setOORInfo(self)
e811c8ce
RD
10288
10289 def Clone(*args, **kwargs):
a95a7133 10290 """Clone(self) -> Validator"""
54f9ee45 10291 return _core_.Validator_Clone(*args, **kwargs)
e811c8ce
RD
10292
10293 def Validate(*args, **kwargs):
a95a7133 10294 """Validate(self, Window parent) -> bool"""
54f9ee45 10295 return _core_.Validator_Validate(*args, **kwargs)
e811c8ce
RD
10296
10297 def TransferToWindow(*args, **kwargs):
a95a7133 10298 """TransferToWindow(self) -> bool"""
54f9ee45 10299 return _core_.Validator_TransferToWindow(*args, **kwargs)
e811c8ce
RD
10300
10301 def TransferFromWindow(*args, **kwargs):
a95a7133 10302 """TransferFromWindow(self) -> bool"""
54f9ee45 10303 return _core_.Validator_TransferFromWindow(*args, **kwargs)
e811c8ce
RD
10304
10305 def GetWindow(*args, **kwargs):
a95a7133 10306 """GetWindow(self) -> Window"""
54f9ee45 10307 return _core_.Validator_GetWindow(*args, **kwargs)
e811c8ce
RD
10308
10309 def SetWindow(*args, **kwargs):
a95a7133 10310 """SetWindow(self, Window window)"""
54f9ee45 10311 return _core_.Validator_SetWindow(*args, **kwargs)
e811c8ce
RD
10312
10313 def IsSilent(*args, **kwargs):
66c033b4 10314 """IsSilent() -> bool"""
54f9ee45 10315 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
10316
10317 IsSilent = staticmethod(IsSilent)
10318 def SetBellOnError(*args, **kwargs):
66c033b4 10319 """SetBellOnError(int doIt=True)"""
54f9ee45 10320 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
10321
10322 SetBellOnError = staticmethod(SetBellOnError)
dba7934c 10323 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 10324_core_.Validator_swigregister(Validator)
e811c8ce 10325
0085ce49
RD
10326def Validator_IsSilent(*args):
10327 """Validator_IsSilent() -> bool"""
10328 return _core_.Validator_IsSilent(*args)
e811c8ce
RD
10329
10330def Validator_SetBellOnError(*args, **kwargs):
0085ce49
RD
10331 """Validator_SetBellOnError(int doIt=True)"""
10332 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
10333
10334class PyValidator(Validator):
093d3ff1 10335 """Proxy of C++ PyValidator class"""
0085ce49
RD
10336 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10337 __repr__ = _swig_repr
10338 def __init__(self, *args, **kwargs):
a95a7133 10339 """__init__(self) -> PyValidator"""
0085ce49 10340 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
e811c8ce
RD
10341
10342 self._setCallbackInfo(self, PyValidator, 1)
10343 self._setOORInfo(self)
10344
10345 def _setCallbackInfo(*args, **kwargs):
a95a7133 10346 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
54f9ee45 10347 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
e811c8ce 10348
2131d850 10349_core_.PyValidator_swigregister(PyValidator)
e811c8ce
RD
10350
10351#---------------------------------------------------------------------------
10352
10353class Menu(EvtHandler):
093d3ff1 10354 """Proxy of C++ Menu class"""
0085ce49
RD
10355 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10356 __repr__ = _swig_repr
10357 def __init__(self, *args, **kwargs):
a95a7133 10358 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
0085ce49 10359 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
e811c8ce
RD
10360 self._setOORInfo(self)
10361
10362 def Append(*args, **kwargs):
97ab0f6a
RD
10363 """
10364 Append(self, int id, String text=EmptyString, String help=EmptyString,
10365 int kind=ITEM_NORMAL) -> MenuItem
10366 """
54f9ee45 10367 return _core_.Menu_Append(*args, **kwargs)
e811c8ce
RD
10368
10369 def AppendSeparator(*args, **kwargs):
a95a7133 10370 """AppendSeparator(self) -> MenuItem"""
54f9ee45 10371 return _core_.Menu_AppendSeparator(*args, **kwargs)
e811c8ce
RD
10372
10373 def AppendCheckItem(*args, **kwargs):
a95a7133 10374 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10375 return _core_.Menu_AppendCheckItem(*args, **kwargs)
e811c8ce
RD
10376
10377 def AppendRadioItem(*args, **kwargs):
a95a7133 10378 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10379 return _core_.Menu_AppendRadioItem(*args, **kwargs)
e811c8ce
RD
10380
10381 def AppendMenu(*args, **kwargs):
a95a7133 10382 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10383 return _core_.Menu_AppendMenu(*args, **kwargs)
e811c8ce 10384
50efceee
RD
10385 def AppendSubMenu(*args, **kwargs):
10386 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10387 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10388
e811c8ce 10389 def AppendItem(*args, **kwargs):
a95a7133 10390 """AppendItem(self, MenuItem item) -> MenuItem"""
54f9ee45 10391 return _core_.Menu_AppendItem(*args, **kwargs)
e811c8ce 10392
e811c8ce 10393 def InsertItem(*args, **kwargs):
a95a7133 10394 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
54f9ee45 10395 return _core_.Menu_InsertItem(*args, **kwargs)
e811c8ce 10396
0085ce49
RD
10397 def PrependItem(*args, **kwargs):
10398 """PrependItem(self, MenuItem item) -> MenuItem"""
10399 return _core_.Menu_PrependItem(*args, **kwargs)
10400
10401 def Break(*args, **kwargs):
10402 """Break(self)"""
10403 return _core_.Menu_Break(*args, **kwargs)
10404
e811c8ce 10405 def Insert(*args, **kwargs):
0df68c9f 10406 """
97ab0f6a 10407 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
a41e16b6 10408 int kind=ITEM_NORMAL) -> MenuItem
0df68c9f 10409 """
54f9ee45 10410 return _core_.Menu_Insert(*args, **kwargs)
e811c8ce
RD
10411
10412 def InsertSeparator(*args, **kwargs):
a95a7133 10413 """InsertSeparator(self, size_t pos) -> MenuItem"""
54f9ee45 10414 return _core_.Menu_InsertSeparator(*args, **kwargs)
e811c8ce
RD
10415
10416 def InsertCheckItem(*args, **kwargs):
a95a7133 10417 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10418 return _core_.Menu_InsertCheckItem(*args, **kwargs)
e811c8ce
RD
10419
10420 def InsertRadioItem(*args, **kwargs):
a95a7133 10421 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10422 return _core_.Menu_InsertRadioItem(*args, **kwargs)
e811c8ce
RD
10423
10424 def InsertMenu(*args, **kwargs):
a95a7133 10425 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10426 return _core_.Menu_InsertMenu(*args, **kwargs)
e811c8ce 10427
e811c8ce 10428 def Prepend(*args, **kwargs):
97ab0f6a
RD
10429 """
10430 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10431 int kind=ITEM_NORMAL) -> MenuItem
10432 """
54f9ee45 10433 return _core_.Menu_Prepend(*args, **kwargs)
e811c8ce
RD
10434
10435 def PrependSeparator(*args, **kwargs):
a95a7133 10436 """PrependSeparator(self) -> MenuItem"""
54f9ee45 10437 return _core_.Menu_PrependSeparator(*args, **kwargs)
e811c8ce
RD
10438
10439 def PrependCheckItem(*args, **kwargs):
a95a7133 10440 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10441 return _core_.Menu_PrependCheckItem(*args, **kwargs)
e811c8ce
RD
10442
10443 def PrependRadioItem(*args, **kwargs):
a95a7133 10444 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10445 return _core_.Menu_PrependRadioItem(*args, **kwargs)
e811c8ce
RD
10446
10447 def PrependMenu(*args, **kwargs):
a95a7133 10448 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10449 return _core_.Menu_PrependMenu(*args, **kwargs)
e811c8ce
RD
10450
10451 def Remove(*args, **kwargs):
a95a7133 10452 """Remove(self, int id) -> MenuItem"""
54f9ee45 10453 return _core_.Menu_Remove(*args, **kwargs)
e811c8ce
RD
10454
10455 def RemoveItem(*args, **kwargs):
a95a7133 10456 """RemoveItem(self, MenuItem item) -> MenuItem"""
54f9ee45 10457 return _core_.Menu_RemoveItem(*args, **kwargs)
e811c8ce
RD
10458
10459 def Delete(*args, **kwargs):
a95a7133 10460 """Delete(self, int id) -> bool"""
54f9ee45 10461 return _core_.Menu_Delete(*args, **kwargs)
e811c8ce
RD
10462
10463 def DeleteItem(*args, **kwargs):
a95a7133 10464 """DeleteItem(self, MenuItem item) -> bool"""
54f9ee45 10465 return _core_.Menu_DeleteItem(*args, **kwargs)
e811c8ce
RD
10466
10467 def Destroy(*args, **kwargs):
0df68c9f 10468 """
a95a7133 10469 Destroy(self)
e811c8ce 10470
0df68c9f
RD
10471 Deletes the C++ object this Python object is a proxy for.
10472 """
b39fe951
RD
10473 args[0].this.own(False)
10474 return _core_.Menu_Destroy(*args, **kwargs)
e811c8ce
RD
10475
10476 def DestroyId(*args, **kwargs):
b39fe951
RD
10477 """DestroyId(self, int id) -> bool"""
10478 return _core_.Menu_DestroyId(*args, **kwargs)
e811c8ce
RD
10479
10480 def DestroyItem(*args, **kwargs):
b39fe951
RD
10481 """DestroyItem(self, MenuItem item) -> bool"""
10482 return _core_.Menu_DestroyItem(*args, **kwargs)
e811c8ce
RD
10483
10484 def GetMenuItemCount(*args, **kwargs):
a95a7133 10485 """GetMenuItemCount(self) -> size_t"""
54f9ee45 10486 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
e811c8ce
RD
10487
10488 def GetMenuItems(*args, **kwargs):
a95a7133 10489 """GetMenuItems(self) -> PyObject"""
54f9ee45 10490 return _core_.Menu_GetMenuItems(*args, **kwargs)
e811c8ce
RD
10491
10492 def FindItem(*args, **kwargs):
a95a7133 10493 """FindItem(self, String item) -> int"""
54f9ee45 10494 return _core_.Menu_FindItem(*args, **kwargs)
e811c8ce
RD
10495
10496 def FindItemById(*args, **kwargs):
a95a7133 10497 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 10498 return _core_.Menu_FindItemById(*args, **kwargs)
e811c8ce
RD
10499
10500 def FindItemByPosition(*args, **kwargs):
a95a7133 10501 """FindItemByPosition(self, size_t position) -> MenuItem"""
54f9ee45 10502 return _core_.Menu_FindItemByPosition(*args, **kwargs)
e811c8ce
RD
10503
10504 def Enable(*args, **kwargs):
a95a7133 10505 """Enable(self, int id, bool enable)"""
54f9ee45 10506 return _core_.Menu_Enable(*args, **kwargs)
e811c8ce
RD
10507
10508 def IsEnabled(*args, **kwargs):
a95a7133 10509 """IsEnabled(self, int id) -> bool"""
54f9ee45 10510 return _core_.Menu_IsEnabled(*args, **kwargs)
e811c8ce
RD
10511
10512 def Check(*args, **kwargs):
a95a7133 10513 """Check(self, int id, bool check)"""
54f9ee45 10514 return _core_.Menu_Check(*args, **kwargs)
e811c8ce
RD
10515
10516 def IsChecked(*args, **kwargs):
a95a7133 10517 """IsChecked(self, int id) -> bool"""
54f9ee45 10518 return _core_.Menu_IsChecked(*args, **kwargs)
e811c8ce
RD
10519
10520 def SetLabel(*args, **kwargs):
a95a7133 10521 """SetLabel(self, int id, String label)"""
54f9ee45 10522 return _core_.Menu_SetLabel(*args, **kwargs)
e811c8ce
RD
10523
10524 def GetLabel(*args, **kwargs):
a95a7133 10525 """GetLabel(self, int id) -> String"""
54f9ee45 10526 return _core_.Menu_GetLabel(*args, **kwargs)
e811c8ce
RD
10527
10528 def SetHelpString(*args, **kwargs):
a95a7133 10529 """SetHelpString(self, int id, String helpString)"""
54f9ee45 10530 return _core_.Menu_SetHelpString(*args, **kwargs)
e811c8ce
RD
10531
10532 def GetHelpString(*args, **kwargs):
a95a7133 10533 """GetHelpString(self, int id) -> String"""
54f9ee45 10534 return _core_.Menu_GetHelpString(*args, **kwargs)
e811c8ce
RD
10535
10536 def SetTitle(*args, **kwargs):
a95a7133 10537 """SetTitle(self, String title)"""
54f9ee45 10538 return _core_.Menu_SetTitle(*args, **kwargs)
e811c8ce
RD
10539
10540 def GetTitle(*args, **kwargs):
a95a7133 10541 """GetTitle(self) -> String"""
54f9ee45 10542 return _core_.Menu_GetTitle(*args, **kwargs)
e811c8ce
RD
10543
10544 def SetEventHandler(*args, **kwargs):
a95a7133 10545 """SetEventHandler(self, EvtHandler handler)"""
54f9ee45 10546 return _core_.Menu_SetEventHandler(*args, **kwargs)
e811c8ce
RD
10547
10548 def GetEventHandler(*args, **kwargs):
a95a7133 10549 """GetEventHandler(self) -> EvtHandler"""
54f9ee45 10550 return _core_.Menu_GetEventHandler(*args, **kwargs)
e811c8ce
RD
10551
10552 def SetInvokingWindow(*args, **kwargs):
a95a7133 10553 """SetInvokingWindow(self, Window win)"""
54f9ee45 10554 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
e811c8ce
RD
10555
10556 def GetInvokingWindow(*args, **kwargs):
a95a7133 10557 """GetInvokingWindow(self) -> Window"""
54f9ee45 10558 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
e811c8ce
RD
10559
10560 def GetStyle(*args, **kwargs):
a95a7133 10561 """GetStyle(self) -> long"""
54f9ee45 10562 return _core_.Menu_GetStyle(*args, **kwargs)
e811c8ce
RD
10563
10564 def UpdateUI(*args, **kwargs):
a95a7133 10565 """UpdateUI(self, EvtHandler source=None)"""
54f9ee45 10566 return _core_.Menu_UpdateUI(*args, **kwargs)
e811c8ce
RD
10567
10568 def GetMenuBar(*args, **kwargs):
a95a7133 10569 """GetMenuBar(self) -> MenuBar"""
54f9ee45 10570 return _core_.Menu_GetMenuBar(*args, **kwargs)
e811c8ce
RD
10571
10572 def Attach(*args, **kwargs):
a95a7133 10573 """Attach(self, wxMenuBarBase menubar)"""
54f9ee45 10574 return _core_.Menu_Attach(*args, **kwargs)
e811c8ce
RD
10575
10576 def Detach(*args, **kwargs):
a95a7133 10577 """Detach(self)"""
54f9ee45 10578 return _core_.Menu_Detach(*args, **kwargs)
e811c8ce
RD
10579
10580 def IsAttached(*args, **kwargs):
a95a7133 10581 """IsAttached(self) -> bool"""
54f9ee45 10582 return _core_.Menu_IsAttached(*args, **kwargs)
e811c8ce
RD
10583
10584 def SetParent(*args, **kwargs):
a95a7133 10585 """SetParent(self, Menu parent)"""
54f9ee45 10586 return _core_.Menu_SetParent(*args, **kwargs)
e811c8ce
RD
10587
10588 def GetParent(*args, **kwargs):
a95a7133 10589 """GetParent(self) -> Menu"""
54f9ee45 10590 return _core_.Menu_GetParent(*args, **kwargs)
e811c8ce 10591
57332a5a
RD
10592 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10593 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
10594 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
10595 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
10596 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
10597 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
10598 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
10599 Style = property(GetStyle,doc="See `GetStyle`")
10600 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
2131d850 10601_core_.Menu_swigregister(Menu)
d14a1e28
RD
10602DefaultValidator = cvar.DefaultValidator
10603
10604#---------------------------------------------------------------------------
10605
10606class MenuBar(Window):
093d3ff1 10607 """Proxy of C++ MenuBar class"""
0085ce49
RD
10608 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10609 __repr__ = _swig_repr
10610 def __init__(self, *args, **kwargs):
a95a7133 10611 """__init__(self, long style=0) -> MenuBar"""
0085ce49 10612 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d14a1e28 10613 self._setOORInfo(self)
e811c8ce
RD
10614
10615 def Append(*args, **kwargs):
a95a7133 10616 """Append(self, Menu menu, String title) -> bool"""
54f9ee45 10617 return _core_.MenuBar_Append(*args, **kwargs)
e811c8ce
RD
10618
10619 def Insert(*args, **kwargs):
a95a7133 10620 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
54f9ee45 10621 return _core_.MenuBar_Insert(*args, **kwargs)
e811c8ce
RD
10622
10623 def GetMenuCount(*args, **kwargs):
a95a7133 10624 """GetMenuCount(self) -> size_t"""
54f9ee45 10625 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
e811c8ce
RD
10626
10627 def GetMenu(*args, **kwargs):
a95a7133 10628 """GetMenu(self, size_t pos) -> Menu"""
54f9ee45 10629 return _core_.MenuBar_GetMenu(*args, **kwargs)
e811c8ce
RD
10630
10631 def Replace(*args, **kwargs):
a95a7133 10632 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
54f9ee45 10633 return _core_.MenuBar_Replace(*args, **kwargs)
e811c8ce
RD
10634
10635 def Remove(*args, **kwargs):
a95a7133 10636 """Remove(self, size_t pos) -> Menu"""
54f9ee45 10637 return _core_.MenuBar_Remove(*args, **kwargs)
e811c8ce
RD
10638
10639 def EnableTop(*args, **kwargs):
a95a7133 10640 """EnableTop(self, size_t pos, bool enable)"""
54f9ee45 10641 return _core_.MenuBar_EnableTop(*args, **kwargs)
e811c8ce
RD
10642
10643 def IsEnabledTop(*args, **kwargs):
a95a7133 10644 """IsEnabledTop(self, size_t pos) -> bool"""
54f9ee45 10645 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
e811c8ce
RD
10646
10647 def SetLabelTop(*args, **kwargs):
a95a7133 10648 """SetLabelTop(self, size_t pos, String label)"""
54f9ee45 10649 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
e811c8ce
RD
10650
10651 def GetLabelTop(*args, **kwargs):
a95a7133 10652 """GetLabelTop(self, size_t pos) -> String"""
54f9ee45 10653 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
e811c8ce
RD
10654
10655 def FindMenuItem(*args, **kwargs):
a95a7133 10656 """FindMenuItem(self, String menu, String item) -> int"""
54f9ee45 10657 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
e811c8ce
RD
10658
10659 def FindItemById(*args, **kwargs):
a95a7133 10660 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 10661 return _core_.MenuBar_FindItemById(*args, **kwargs)
e811c8ce
RD
10662
10663 def FindMenu(*args, **kwargs):
a95a7133 10664 """FindMenu(self, String title) -> int"""
54f9ee45 10665 return _core_.MenuBar_FindMenu(*args, **kwargs)
e811c8ce
RD
10666
10667 def Enable(*args, **kwargs):
a95a7133 10668 """Enable(self, int id, bool enable)"""
54f9ee45 10669 return _core_.MenuBar_Enable(*args, **kwargs)
e811c8ce
RD
10670
10671 def Check(*args, **kwargs):
a95a7133 10672 """Check(self, int id, bool check)"""
54f9ee45 10673 return _core_.MenuBar_Check(*args, **kwargs)
e811c8ce
RD
10674
10675 def IsChecked(*args, **kwargs):
a95a7133 10676 """IsChecked(self, int id) -> bool"""
54f9ee45 10677 return _core_.MenuBar_IsChecked(*args, **kwargs)
e811c8ce
RD
10678
10679 def IsEnabled(*args, **kwargs):
a95a7133 10680 """IsEnabled(self, int id) -> bool"""
54f9ee45 10681 return _core_.MenuBar_IsEnabled(*args, **kwargs)
e811c8ce
RD
10682
10683 def SetLabel(*args, **kwargs):
a95a7133 10684 """SetLabel(self, int id, String label)"""
54f9ee45 10685 return _core_.MenuBar_SetLabel(*args, **kwargs)
e811c8ce
RD
10686
10687 def GetLabel(*args, **kwargs):
a95a7133 10688 """GetLabel(self, int id) -> String"""
54f9ee45 10689 return _core_.MenuBar_GetLabel(*args, **kwargs)
e811c8ce
RD
10690
10691 def SetHelpString(*args, **kwargs):
a95a7133 10692 """SetHelpString(self, int id, String helpString)"""
54f9ee45 10693 return _core_.MenuBar_SetHelpString(*args, **kwargs)
e811c8ce
RD
10694
10695 def GetHelpString(*args, **kwargs):
a95a7133 10696 """GetHelpString(self, int id) -> String"""
54f9ee45 10697 return _core_.MenuBar_GetHelpString(*args, **kwargs)
e811c8ce
RD
10698
10699 def GetFrame(*args, **kwargs):
a95a7133 10700 """GetFrame(self) -> wxFrame"""
54f9ee45 10701 return _core_.MenuBar_GetFrame(*args, **kwargs)
e811c8ce
RD
10702
10703 def IsAttached(*args, **kwargs):
a95a7133 10704 """IsAttached(self) -> bool"""
54f9ee45 10705 return _core_.MenuBar_IsAttached(*args, **kwargs)
e811c8ce
RD
10706
10707 def Attach(*args, **kwargs):
a95a7133 10708 """Attach(self, wxFrame frame)"""
54f9ee45 10709 return _core_.MenuBar_Attach(*args, **kwargs)
e811c8ce
RD
10710
10711 def Detach(*args, **kwargs):
a95a7133 10712 """Detach(self)"""
54f9ee45 10713 return _core_.MenuBar_Detach(*args, **kwargs)
e811c8ce 10714
587d0f36
RD
10715 def UpdateMenus(*args, **kwargs):
10716 """UpdateMenus(self)"""
10717 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
10718
4f433fef
RD
10719 def SetAutoWindowMenu(*args, **kwargs):
10720 """SetAutoWindowMenu(bool enable)"""
10721 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10722
10723 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10724 def GetAutoWindowMenu(*args, **kwargs):
10725 """GetAutoWindowMenu() -> bool"""
10726 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10727
10728 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
97ab0f6a
RD
10729 def GetMenus(self):
10730 """Return a list of (menu, label) items for the menus in the MenuBar. """
10731 return [(self.GetMenu(i), self.GetLabelTop(i))
10732 for i in range(self.GetMenuCount())]
10733
10734 def SetMenus(self, items):
10735 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
10736 for i in range(self.GetMenuCount()-1, -1, -1):
10737 self.Remove(i)
10738 for m, l in items:
10739 self.Append(m, l)
10740
57332a5a
RD
10741 Frame = property(GetFrame,doc="See `GetFrame`")
10742 Menu = property(GetMenu,doc="See `GetMenu`")
10743 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
10744 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
2131d850 10745_core_.MenuBar_swigregister(MenuBar)
d14a1e28 10746
4f433fef 10747def MenuBar_SetAutoWindowMenu(*args, **kwargs):
0085ce49
RD
10748 """MenuBar_SetAutoWindowMenu(bool enable)"""
10749 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 10750
0085ce49
RD
10751def MenuBar_GetAutoWindowMenu(*args):
10752 """MenuBar_GetAutoWindowMenu() -> bool"""
10753 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 10754
d14a1e28
RD
10755#---------------------------------------------------------------------------
10756
10757class MenuItem(Object):
093d3ff1 10758 """Proxy of C++ MenuItem class"""
0085ce49
RD
10759 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10760 __repr__ = _swig_repr
10761 def __init__(self, *args, **kwargs):
0df68c9f 10762 """
a95a7133 10763 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
196addbf
RD
10764 String help=EmptyString, int kind=ITEM_NORMAL,
10765 Menu subMenu=None) -> MenuItem
0df68c9f 10766 """
0085ce49
RD
10767 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10768 __swig_destroy__ = _core_.delete_MenuItem
10769 __del__ = lambda self : None;
e811c8ce 10770 def GetMenu(*args, **kwargs):
a95a7133 10771 """GetMenu(self) -> Menu"""
54f9ee45 10772 return _core_.MenuItem_GetMenu(*args, **kwargs)
e811c8ce
RD
10773
10774 def SetMenu(*args, **kwargs):
a95a7133 10775 """SetMenu(self, Menu menu)"""
54f9ee45 10776 return _core_.MenuItem_SetMenu(*args, **kwargs)
e811c8ce
RD
10777
10778 def SetId(*args, **kwargs):
a95a7133 10779 """SetId(self, int id)"""
54f9ee45 10780 return _core_.MenuItem_SetId(*args, **kwargs)
e811c8ce
RD
10781
10782 def GetId(*args, **kwargs):
a95a7133 10783 """GetId(self) -> int"""
54f9ee45 10784 return _core_.MenuItem_GetId(*args, **kwargs)
e811c8ce
RD
10785
10786 def IsSeparator(*args, **kwargs):
a95a7133 10787 """IsSeparator(self) -> bool"""
54f9ee45 10788 return _core_.MenuItem_IsSeparator(*args, **kwargs)
e811c8ce
RD
10789
10790 def SetText(*args, **kwargs):
a95a7133 10791 """SetText(self, String str)"""
54f9ee45 10792 return _core_.MenuItem_SetText(*args, **kwargs)
e811c8ce
RD
10793
10794 def GetLabel(*args, **kwargs):
a95a7133 10795 """GetLabel(self) -> String"""
54f9ee45 10796 return _core_.MenuItem_GetLabel(*args, **kwargs)
e811c8ce
RD
10797
10798 def GetText(*args, **kwargs):
a95a7133 10799 """GetText(self) -> String"""
54f9ee45 10800 return _core_.MenuItem_GetText(*args, **kwargs)
e811c8ce
RD
10801
10802 def GetLabelFromText(*args, **kwargs):
66c033b4 10803 """GetLabelFromText(String text) -> String"""
54f9ee45 10804 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
e811c8ce
RD
10805
10806 GetLabelFromText = staticmethod(GetLabelFromText)
10807 def GetKind(*args, **kwargs):
a95a7133 10808 """GetKind(self) -> int"""
54f9ee45 10809 return _core_.MenuItem_GetKind(*args, **kwargs)
e811c8ce 10810
a95a7133
RD
10811 def SetKind(*args, **kwargs):
10812 """SetKind(self, int kind)"""
54f9ee45 10813 return _core_.MenuItem_SetKind(*args, **kwargs)
a95a7133 10814
e811c8ce 10815 def SetCheckable(*args, **kwargs):
a95a7133 10816 """SetCheckable(self, bool checkable)"""
54f9ee45 10817 return _core_.MenuItem_SetCheckable(*args, **kwargs)
e811c8ce
RD
10818
10819 def IsCheckable(*args, **kwargs):
a95a7133 10820 """IsCheckable(self) -> bool"""
54f9ee45 10821 return _core_.MenuItem_IsCheckable(*args, **kwargs)
e811c8ce
RD
10822
10823 def IsSubMenu(*args, **kwargs):
a95a7133 10824 """IsSubMenu(self) -> bool"""
54f9ee45 10825 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
e811c8ce
RD
10826
10827 def SetSubMenu(*args, **kwargs):
a95a7133 10828 """SetSubMenu(self, Menu menu)"""
54f9ee45 10829 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
e811c8ce
RD
10830
10831 def GetSubMenu(*args, **kwargs):
a95a7133 10832 """GetSubMenu(self) -> Menu"""
54f9ee45 10833 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
e811c8ce
RD
10834
10835 def Enable(*args, **kwargs):
a95a7133 10836 """Enable(self, bool enable=True)"""
54f9ee45 10837 return _core_.MenuItem_Enable(*args, **kwargs)
e811c8ce
RD
10838
10839 def IsEnabled(*args, **kwargs):
a95a7133 10840 """IsEnabled(self) -> bool"""
54f9ee45 10841 return _core_.MenuItem_IsEnabled(*args, **kwargs)
e811c8ce
RD
10842
10843 def Check(*args, **kwargs):
a95a7133 10844 """Check(self, bool check=True)"""
54f9ee45 10845 return _core_.MenuItem_Check(*args, **kwargs)
e811c8ce
RD
10846
10847 def IsChecked(*args, **kwargs):
a95a7133 10848 """IsChecked(self) -> bool"""
54f9ee45 10849 return _core_.MenuItem_IsChecked(*args, **kwargs)
e811c8ce
RD
10850
10851 def Toggle(*args, **kwargs):
a95a7133 10852 """Toggle(self)"""
54f9ee45 10853 return _core_.MenuItem_Toggle(*args, **kwargs)
e811c8ce
RD
10854
10855 def SetHelp(*args, **kwargs):
a95a7133 10856 """SetHelp(self, String str)"""
54f9ee45 10857 return _core_.MenuItem_SetHelp(*args, **kwargs)
e811c8ce
RD
10858
10859 def GetHelp(*args, **kwargs):
a95a7133 10860 """GetHelp(self) -> String"""
54f9ee45 10861 return _core_.MenuItem_GetHelp(*args, **kwargs)
e811c8ce
RD
10862
10863 def GetAccel(*args, **kwargs):
a95a7133 10864 """GetAccel(self) -> AcceleratorEntry"""
54f9ee45 10865 return _core_.MenuItem_GetAccel(*args, **kwargs)
e811c8ce
RD
10866
10867 def SetAccel(*args, **kwargs):
a95a7133 10868 """SetAccel(self, AcceleratorEntry accel)"""
54f9ee45 10869 return _core_.MenuItem_SetAccel(*args, **kwargs)
e811c8ce 10870
091f5bed
RD
10871 def SetBitmap(*args, **kwargs):
10872 """SetBitmap(self, Bitmap bitmap)"""
10873 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10874
10875 def GetBitmap(*args, **kwargs):
10876 """GetBitmap(self) -> Bitmap"""
10877 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10878
c1280d1e
RD
10879 def SetFont(*args, **kwargs):
10880 """SetFont(self, Font font)"""
10881 return _core_.MenuItem_SetFont(*args, **kwargs)
10882
10883 def GetFont(*args, **kwargs):
10884 """GetFont(self) -> Font"""
10885 return _core_.MenuItem_GetFont(*args, **kwargs)
10886
10887 def SetTextColour(*args, **kwargs):
10888 """SetTextColour(self, Colour colText)"""
10889 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10890
10891 def GetTextColour(*args, **kwargs):
10892 """GetTextColour(self) -> Colour"""
10893 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10894
10895 def SetBackgroundColour(*args, **kwargs):
10896 """SetBackgroundColour(self, Colour colBack)"""
10897 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10898
10899 def GetBackgroundColour(*args, **kwargs):
10900 """GetBackgroundColour(self) -> Colour"""
10901 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10902
10903 def SetBitmaps(*args, **kwargs):
10904 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10905 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10906
10907 def SetDisabledBitmap(*args, **kwargs):
10908 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10909 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10910
10911 def GetDisabledBitmap(*args, **kwargs):
10912 """GetDisabledBitmap(self) -> Bitmap"""
10913 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10914
10915 def SetMarginWidth(*args, **kwargs):
10916 """SetMarginWidth(self, int nWidth)"""
10917 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10918
10919 def GetMarginWidth(*args, **kwargs):
10920 """GetMarginWidth(self) -> int"""
10921 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10922
e811c8ce 10923 def GetDefaultMarginWidth(*args, **kwargs):
66c033b4 10924 """GetDefaultMarginWidth() -> int"""
54f9ee45 10925 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
e811c8ce
RD
10926
10927 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10928 def IsOwnerDrawn(*args, **kwargs):
10929 """IsOwnerDrawn(self) -> bool"""
10930 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10931
10932 def SetOwnerDrawn(*args, **kwargs):
10933 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10934 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10935
10936 def ResetOwnerDrawn(*args, **kwargs):
10937 """ResetOwnerDrawn(self)"""
10938 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10939
57332a5a
RD
10940 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
10941 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10942 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
10943 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
10944 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10945 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
10946 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10947 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
10948 Label = property(GetLabel,doc="See `GetLabel`")
10949 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
10950 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
10951 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
10952 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
10953 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
2131d850 10954_core_.MenuItem_swigregister(MenuItem)
d14a1e28 10955
e811c8ce 10956def MenuItem_GetLabelFromText(*args, **kwargs):
0085ce49
RD
10957 """MenuItem_GetLabelFromText(String text) -> String"""
10958 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d14a1e28 10959
0085ce49
RD
10960def MenuItem_GetDefaultMarginWidth(*args):
10961 """MenuItem_GetDefaultMarginWidth() -> int"""
10962 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d14a1e28
RD
10963
10964#---------------------------------------------------------------------------
10965
10966class Control(Window):
15afbcd0
RD
10967 """
10968 This is the base class for a control or 'widget'.
10969
41e2b43e
RD
10970 A control is generally a small window which processes user input
10971 and/or displays one or more item of data.
15afbcd0 10972 """
0085ce49
RD
10973 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10974 __repr__ = _swig_repr
10975 def __init__(self, *args, **kwargs):
0df68c9f 10976 """
248ed943
RD
10977 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10978 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 10979 String name=ControlNameStr) -> Control
15afbcd0 10980
41e2b43e
RD
10981 Create a Control. Normally you should only call this from a subclass'
10982 __init__ as a plain old wx.Control is not very useful.
0df68c9f 10983 """
0085ce49 10984 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d14a1e28 10985 self._setOORInfo(self)
e811c8ce
RD
10986
10987 def Create(*args, **kwargs):
0df68c9f 10988 """
248ed943
RD
10989 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10990 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 10991 String name=ControlNameStr) -> bool
15afbcd0
RD
10992
10993 Do the 2nd phase and create the GUI control.
0df68c9f 10994 """
54f9ee45 10995 return _core_.Control_Create(*args, **kwargs)
e811c8ce 10996
10044bf1
RD
10997 def GetAlignment(*args, **kwargs):
10998 """
10999 GetAlignment(self) -> int
11000
11001 Get the control alignment (left/right/centre, top/bottom/centre)
11002 """
11003 return _core_.Control_GetAlignment(*args, **kwargs)
11004
34e0a3bb 11005 def GetLabelText(*args, **kwargs):
10044bf1 11006 """
10044bf1
RD
11007 GetLabelText(self) -> String
11008
11009 Get just the text of the label, without mnemonic characters ('&')
11010 """
34e0a3bb 11011 return _core_.Control_GetLabelText(*args, **kwargs)
10044bf1 11012
e811c8ce 11013 def Command(*args, **kwargs):
15afbcd0 11014 """
a95a7133 11015 Command(self, CommandEvent event)
15afbcd0 11016
41e2b43e
RD
11017 Simulates the effect of the user issuing a command to the item.
11018
11019 :see: `wx.CommandEvent`
11020
15afbcd0 11021 """
54f9ee45 11022 return _core_.Control_Command(*args, **kwargs)
e811c8ce 11023
74a57fcd 11024 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
11025 """
11026 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11027
11028 Get the default attributes for this class. This is useful if you want
11029 to use the same font or colour in your own control as in a standard
11030 control -- which is a much better idea than hard coding specific
11031 colours or fonts which might look completely out of place on the
11032 user's system, especially if it uses themes.
11033
11034 The variant parameter is only relevant under Mac currently and is
11035 ignore under other platforms. Under Mac, it will change the size of
11036 the returned font. See `wx.Window.SetWindowVariant` for more about
11037 this.
11038 """
54f9ee45 11039 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
11040
11041 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2bf58437 11042 Alignment = property(GetAlignment,doc="See `GetAlignment`")
2bf58437 11043 LabelText = property(GetLabelText,doc="See `GetLabelText`")
2131d850 11044_core_.Control_swigregister(Control)
b2dc1044 11045ControlNameStr = cvar.ControlNameStr
d14a1e28
RD
11046
11047def PreControl(*args, **kwargs):
15afbcd0
RD
11048 """
11049 PreControl() -> Control
11050
11051 Precreate a Control control for 2-phase creation
11052 """
54f9ee45 11053 val = _core_.new_PreControl(*args, **kwargs)
d14a1e28
RD
11054 return val
11055
74a57fcd 11056def Control_GetClassDefaultAttributes(*args, **kwargs):
0085ce49 11057 """
110da5b0
RD
11058 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
11059
11060 Get the default attributes for this class. This is useful if you want
11061 to use the same font or colour in your own control as in a standard
11062 control -- which is a much better idea than hard coding specific
11063 colours or fonts which might look completely out of place on the
11064 user's system, especially if it uses themes.
11065
11066 The variant parameter is only relevant under Mac currently and is
11067 ignore under other platforms. Under Mac, it will change the size of
11068 the returned font. See `wx.Window.SetWindowVariant` for more about
11069 this.
11070 """
0085ce49 11071 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 11072
d14a1e28
RD
11073#---------------------------------------------------------------------------
11074
11075class ItemContainer(object):
15afbcd0 11076 """
53aa7709
RD
11077 The wx.ItemContainer class defines an interface which is implemented
11078 by all controls which have string subitems, each of which may be
11079 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11080 as `wx.ComboBox` which implements an extended interface deriving from
41e2b43e 11081 this one.
15afbcd0 11082
41e2b43e
RD
11083 It defines the methods for accessing the control's items and although
11084 each of the derived classes implements them differently, they still
11085 all conform to the same interface.
15afbcd0 11086
41e2b43e
RD
11087 The items in a wx.ItemContainer have (non empty) string labels and,
11088 optionally, client data associated with them.
15afbcd0
RD
11089
11090 """
0085ce49
RD
11091 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11092 def __init__(self): raise AttributeError, "No constructor defined"
11093 __repr__ = _swig_repr
e811c8ce 11094 def Append(*args, **kwargs):
15afbcd0 11095 """
a95a7133 11096 Append(self, String item, PyObject clientData=None) -> int
15afbcd0 11097
41e2b43e
RD
11098 Adds the item to the control, associating the given data with the item
11099 if not None. The return value is the index of the newly added item
11100 which may be different from the last one if the control is sorted (e.g.
11101 has wx.LB_SORT or wx.CB_SORT style).
15afbcd0 11102 """
54f9ee45 11103 return _core_.ItemContainer_Append(*args, **kwargs)
e811c8ce
RD
11104
11105 def AppendItems(*args, **kwargs):
15afbcd0 11106 """
f5b96ee1 11107 AppendItems(self, List strings)
15afbcd0 11108
41e2b43e
RD
11109 Apend several items at once to the control. Notice that calling this
11110 method may be much faster than appending the items one by one if you
11111 need to add a lot of items.
15afbcd0 11112 """
54f9ee45 11113 return _core_.ItemContainer_AppendItems(*args, **kwargs)
e811c8ce
RD
11114
11115 def Insert(*args, **kwargs):
15afbcd0 11116 """
50f151d7 11117 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
15afbcd0 11118
41e2b43e 11119 Insert an item into the control before the item at the ``pos`` index,
15afbcd0
RD
11120 optionally associating some data object with the item.
11121 """
54f9ee45 11122 return _core_.ItemContainer_Insert(*args, **kwargs)
e811c8ce
RD
11123
11124 def Clear(*args, **kwargs):
15afbcd0 11125 """
a95a7133 11126 Clear(self)
15afbcd0
RD
11127
11128 Removes all items from the control.
11129 """
54f9ee45 11130 return _core_.ItemContainer_Clear(*args, **kwargs)
e811c8ce
RD
11131
11132 def Delete(*args, **kwargs):
15afbcd0 11133 """
50f151d7 11134 Delete(self, unsigned int n)
15afbcd0 11135
41e2b43e
RD
11136 Deletes the item at the zero-based index 'n' from the control. Note
11137 that it is an error (signalled by a `wx.PyAssertionError` exception if
11138 enabled) to remove an item with the index negative or greater or equal
11139 than the number of items in the control.
15afbcd0 11140 """
54f9ee45 11141 return _core_.ItemContainer_Delete(*args, **kwargs)
e811c8ce 11142
53aa7709
RD
11143 def GetClientData(*args, **kwargs):
11144 """
50f151d7 11145 GetClientData(self, unsigned int n) -> PyObject
53aa7709
RD
11146
11147 Returns the client data associated with the given item, (if any.)
11148 """
11149 return _core_.ItemContainer_GetClientData(*args, **kwargs)
11150
11151 def SetClientData(*args, **kwargs):
11152 """
50f151d7 11153 SetClientData(self, unsigned int n, PyObject clientData)
53aa7709
RD
11154
11155 Associate the given client data with the item at position n.
11156 """
11157 return _core_.ItemContainer_SetClientData(*args, **kwargs)
11158
e811c8ce 11159 def GetCount(*args, **kwargs):
15afbcd0 11160 """
50f151d7 11161 GetCount(self) -> unsigned int
15afbcd0
RD
11162
11163 Returns the number of items in the control.
11164 """
54f9ee45 11165 return _core_.ItemContainer_GetCount(*args, **kwargs)
e811c8ce
RD
11166
11167 def IsEmpty(*args, **kwargs):
15afbcd0 11168 """
a95a7133 11169 IsEmpty(self) -> bool
15afbcd0
RD
11170
11171 Returns True if the control is empty or False if it has some items.
11172 """
54f9ee45 11173 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
e811c8ce
RD
11174
11175 def GetString(*args, **kwargs):
15afbcd0 11176 """
50f151d7 11177 GetString(self, unsigned int n) -> String
15afbcd0
RD
11178
11179 Returns the label of the item with the given index.
11180 """
54f9ee45 11181 return _core_.ItemContainer_GetString(*args, **kwargs)
e811c8ce
RD
11182
11183 def GetStrings(*args, **kwargs):
a95a7133 11184 """GetStrings(self) -> wxArrayString"""
54f9ee45 11185 return _core_.ItemContainer_GetStrings(*args, **kwargs)
e811c8ce
RD
11186
11187 def SetString(*args, **kwargs):
15afbcd0 11188 """
50f151d7 11189 SetString(self, unsigned int n, String s)
15afbcd0
RD
11190
11191 Sets the label for the given item.
11192 """
54f9ee45 11193 return _core_.ItemContainer_SetString(*args, **kwargs)
e811c8ce
RD
11194
11195 def FindString(*args, **kwargs):
15afbcd0 11196 """
a95a7133 11197 FindString(self, String s) -> int
15afbcd0
RD
11198
11199 Finds an item whose label matches the given string. Returns the
41e2b43e
RD
11200 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11201 found.
15afbcd0 11202 """
54f9ee45 11203 return _core_.ItemContainer_FindString(*args, **kwargs)
e811c8ce 11204
53aa7709 11205 def SetSelection(*args, **kwargs):
15afbcd0 11206 """
53aa7709 11207 SetSelection(self, int n)
15afbcd0
RD
11208
11209 Sets the item at index 'n' to be the selected item.
11210 """
53aa7709 11211 return _core_.ItemContainer_SetSelection(*args, **kwargs)
e811c8ce
RD
11212
11213 def GetSelection(*args, **kwargs):
15afbcd0 11214 """
a95a7133 11215 GetSelection(self) -> int
15afbcd0 11216
41e2b43e
RD
11217 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11218 is selected.
15afbcd0 11219 """
54f9ee45 11220 return _core_.ItemContainer_GetSelection(*args, **kwargs)
e811c8ce 11221
53aa7709
RD
11222 def SetStringSelection(*args, **kwargs):
11223 """SetStringSelection(self, String s) -> bool"""
11224 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11225
e811c8ce 11226 def GetStringSelection(*args, **kwargs):
15afbcd0 11227 """
a95a7133 11228 GetStringSelection(self) -> String
15afbcd0 11229
41e2b43e
RD
11230 Returns the label of the selected item or an empty string if no item
11231 is selected.
15afbcd0 11232 """
54f9ee45 11233 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
e811c8ce 11234
53aa7709 11235 def Select(*args, **kwargs):
15afbcd0 11236 """
53aa7709 11237 Select(self, int n)
15afbcd0 11238
53aa7709
RD
11239 This is the same as `SetSelection` and exists only because it is
11240 slightly more natural for controls which support multiple selection.
15afbcd0 11241 """
53aa7709 11242 return _core_.ItemContainer_Select(*args, **kwargs)
e811c8ce 11243
97ab0f6a
RD
11244 def GetItems(self):
11245 """Return a list of the strings in the control"""
11246 return [self.GetString(i) for i in xrange(self.GetCount())]
11247
11248 def SetItems(self, items):
11249 """Clear and set the strings in the control from a list"""
11250 self.Clear()
11251 for i in items:
11252 self.Append(i)
11253
11254 Count = property(GetCount,doc="See `GetCount`")
11255 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11256 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11257 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11258 Strings = property(GetStrings,doc="See `GetStrings`")
2131d850 11259_core_.ItemContainer_swigregister(ItemContainer)
d14a1e28
RD
11260
11261#---------------------------------------------------------------------------
11262
11263class ControlWithItems(Control,ItemContainer):
15afbcd0 11264 """
41e2b43e
RD
11265 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11266 wx.Control class, and is used for the base class of various controls
11267 that have items.
15afbcd0 11268 """
0085ce49
RD
11269 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11270 def __init__(self): raise AttributeError, "No constructor defined"
11271 __repr__ = _swig_repr
2131d850 11272_core_.ControlWithItems_swigregister(ControlWithItems)
d14a1e28
RD
11273
11274#---------------------------------------------------------------------------
11275
11276class SizerItem(Object):
248ed943
RD
11277 """
11278 The wx.SizerItem class is used to track the position, size and other
01f6b6d3
RD
11279 attributes of each item managed by a `wx.Sizer`. It is not usually
11280 necessary to use this class because the sizer elements can also be
11281 identified by their positions or window or sizer references but
11282 sometimes it may be more convenient to use wx.SizerItem directly.
11283 Also, custom classes derived from `wx.PySizer` will probably need to
11284 use the collection of wx.SizerItems held by wx.Sizer when calculating
11285 layout.
248ed943
RD
11286
11287 :see: `wx.Sizer`, `wx.GBSizerItem`
11288 """
0085ce49
RD
11289 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11290 __repr__ = _swig_repr
11291 def __init__(self, *args, **kwargs):
248ed943
RD
11292 """
11293 __init__(self) -> SizerItem
11294
11295 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11296 size will need to be set before this item can be used in a Sizer.
11297
11298 You will probably never need to create a wx.SizerItem directly as they
11299 are created automatically when the sizer's Add, Insert or Prepend
11300 methods are called.
11301
11302 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11303 """
0085ce49
RD
11304 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11305 __swig_destroy__ = _core_.delete_SizerItem
11306 __del__ = lambda self : None;
e811c8ce 11307 def DeleteWindows(*args, **kwargs):
248ed943
RD
11308 """
11309 DeleteWindows(self)
11310
11311 Destroy the window or the windows in a subsizer, depending on the type
11312 of item.
11313 """
54f9ee45 11314 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
e811c8ce
RD
11315
11316 def DetachSizer(*args, **kwargs):
248ed943
RD
11317 """
11318 DetachSizer(self)
11319
11320 Enable deleting the SizerItem without destroying the contained sizer.
11321 """
54f9ee45 11322 return _core_.SizerItem_DetachSizer(*args, **kwargs)
e811c8ce
RD
11323
11324 def GetSize(*args, **kwargs):
248ed943
RD
11325 """
11326 GetSize(self) -> Size
11327
11328 Get the current size of the item, as set in the last Layout.
11329 """
54f9ee45 11330 return _core_.SizerItem_GetSize(*args, **kwargs)
e811c8ce
RD
11331
11332 def CalcMin(*args, **kwargs):
248ed943
RD
11333 """
11334 CalcMin(self) -> Size
11335
11336 Calculates the minimum desired size for the item, including any space
11337 needed by borders.
11338 """
54f9ee45 11339 return _core_.SizerItem_CalcMin(*args, **kwargs)
e811c8ce
RD
11340
11341 def SetDimension(*args, **kwargs):
248ed943
RD
11342 """
11343 SetDimension(self, Point pos, Size size)
11344
11345 Set the position and size of the space allocated for this item by the
11346 sizer, and adjust the position and size of the item (window or
11347 subsizer) to be within that space taking alignment and borders into
11348 account.
11349 """
54f9ee45 11350 return _core_.SizerItem_SetDimension(*args, **kwargs)
e811c8ce
RD
11351
11352 def GetMinSize(*args, **kwargs):
248ed943
RD
11353 """
11354 GetMinSize(self) -> Size
11355
11356 Get the minimum size needed for the item.
11357 """
54f9ee45 11358 return _core_.SizerItem_GetMinSize(*args, **kwargs)
e811c8ce 11359
dfbb5885
RD
11360 def GetMinSizeWithBorder(*args, **kwargs):
11361 """
11362 GetMinSizeWithBorder(self) -> Size
11363
11364 Get the minimum size needed for the item with space for the borders
11365 added, if needed.
11366 """
11367 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
11368
e811c8ce 11369 def SetInitSize(*args, **kwargs):
a95a7133 11370 """SetInitSize(self, int x, int y)"""
54f9ee45 11371 return _core_.SizerItem_SetInitSize(*args, **kwargs)
e811c8ce
RD
11372
11373 def SetRatioWH(*args, **kwargs):
248ed943
RD
11374 """
11375 SetRatioWH(self, int width, int height)
11376
11377 Set the ratio item attribute.
11378 """
54f9ee45 11379 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
e811c8ce
RD
11380
11381 def SetRatioSize(*args, **kwargs):
248ed943
RD
11382 """
11383 SetRatioSize(self, Size size)
11384
11385 Set the ratio item attribute.
11386 """
54f9ee45 11387 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
e811c8ce
RD
11388
11389 def SetRatio(*args, **kwargs):
248ed943
RD
11390 """
11391 SetRatio(self, float ratio)
11392
11393 Set the ratio item attribute.
11394 """
54f9ee45 11395 return _core_.SizerItem_SetRatio(*args, **kwargs)
e811c8ce
RD
11396
11397 def GetRatio(*args, **kwargs):
248ed943
RD
11398 """
11399 GetRatio(self) -> float
11400
11401 Set the ratio item attribute.
11402 """
54f9ee45 11403 return _core_.SizerItem_GetRatio(*args, **kwargs)
e811c8ce 11404
d3b6e4ff
RD
11405 def GetRect(*args, **kwargs):
11406 """
11407 GetRect(self) -> Rect
11408
11409 Returns the rectangle that the sizer item should occupy
11410 """
11411 return _core_.SizerItem_GetRect(*args, **kwargs)
11412
e811c8ce 11413 def IsWindow(*args, **kwargs):
248ed943
RD
11414 """
11415 IsWindow(self) -> bool
11416
11417 Is this sizer item a window?
11418 """
54f9ee45 11419 return _core_.SizerItem_IsWindow(*args, **kwargs)
e811c8ce
RD
11420
11421 def IsSizer(*args, **kwargs):
248ed943
RD
11422 """
11423 IsSizer(self) -> bool
11424
11425 Is this sizer item a subsizer?
11426 """
54f9ee45 11427 return _core_.SizerItem_IsSizer(*args, **kwargs)
e811c8ce
RD
11428
11429 def IsSpacer(*args, **kwargs):
248ed943
RD
11430 """
11431 IsSpacer(self) -> bool
11432
11433 Is this sizer item a spacer?
11434 """
54f9ee45 11435 return _core_.SizerItem_IsSpacer(*args, **kwargs)
e811c8ce
RD
11436
11437 def SetProportion(*args, **kwargs):
248ed943
RD
11438 """
11439 SetProportion(self, int proportion)
11440
11441 Set the proportion value for this item.
11442 """
54f9ee45 11443 return _core_.SizerItem_SetProportion(*args, **kwargs)
e811c8ce
RD
11444
11445 def GetProportion(*args, **kwargs):
248ed943
RD
11446 """
11447 GetProportion(self) -> int
11448
11449 Get the proportion value for this item.
11450 """
54f9ee45 11451 return _core_.SizerItem_GetProportion(*args, **kwargs)
e811c8ce 11452
248ed943
RD
11453 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11454 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
e811c8ce 11455 def SetFlag(*args, **kwargs):
248ed943
RD
11456 """
11457 SetFlag(self, int flag)
11458
11459 Set the flag value for this item.
11460 """
54f9ee45 11461 return _core_.SizerItem_SetFlag(*args, **kwargs)
e811c8ce
RD
11462
11463 def GetFlag(*args, **kwargs):
248ed943
RD
11464 """
11465 GetFlag(self) -> int
11466
11467 Get the flag value for this item.
11468 """
54f9ee45 11469 return _core_.SizerItem_GetFlag(*args, **kwargs)
e811c8ce
RD
11470
11471 def SetBorder(*args, **kwargs):
248ed943
RD
11472 """
11473 SetBorder(self, int border)
11474
11475 Set the border value for this item.
11476 """
54f9ee45 11477 return _core_.SizerItem_SetBorder(*args, **kwargs)
e811c8ce
RD
11478
11479 def GetBorder(*args, **kwargs):
248ed943
RD
11480 """
11481 GetBorder(self) -> int
11482
11483 Get the border value for this item.
11484 """
54f9ee45 11485 return _core_.SizerItem_GetBorder(*args, **kwargs)
e811c8ce
RD
11486
11487 def GetWindow(*args, **kwargs):
248ed943
RD
11488 """
11489 GetWindow(self) -> Window
11490
11491 Get the window (if any) that is managed by this sizer item.
11492 """
54f9ee45 11493 return _core_.SizerItem_GetWindow(*args, **kwargs)
e811c8ce
RD
11494
11495 def SetWindow(*args, **kwargs):
248ed943
RD
11496 """
11497 SetWindow(self, Window window)
11498
11499 Set the window to be managed by this sizer item.
11500 """
54f9ee45 11501 return _core_.SizerItem_SetWindow(*args, **kwargs)
e811c8ce
RD
11502
11503 def GetSizer(*args, **kwargs):
248ed943
RD
11504 """
11505 GetSizer(self) -> Sizer
11506
11507 Get the subsizer (if any) that is managed by this sizer item.
11508 """
54f9ee45 11509 return _core_.SizerItem_GetSizer(*args, **kwargs)
e811c8ce
RD
11510
11511 def SetSizer(*args, **kwargs):
248ed943
RD
11512 """
11513 SetSizer(self, Sizer sizer)
11514
11515 Set the subsizer to be managed by this sizer item.
11516 """
54f9ee45 11517 return _core_.SizerItem_SetSizer(*args, **kwargs)
e811c8ce
RD
11518
11519 def GetSpacer(*args, **kwargs):
248ed943
RD
11520 """
11521 GetSpacer(self) -> Size
11522
11523 Get the size of the spacer managed by this sizer item.
11524 """
54f9ee45 11525 return _core_.SizerItem_GetSpacer(*args, **kwargs)
e811c8ce
RD
11526
11527 def SetSpacer(*args, **kwargs):
248ed943
RD
11528 """
11529 SetSpacer(self, Size size)
11530
11531 Set the size of the spacer to be managed by this sizer item.
11532 """
54f9ee45 11533 return _core_.SizerItem_SetSpacer(*args, **kwargs)
e811c8ce
RD
11534
11535 def Show(*args, **kwargs):
248ed943
RD
11536 """
11537 Show(self, bool show)
11538
11539 Set the show item attribute, which sizers use to determine if the item
11540 is to be made part of the layout or not. If the item is tracking a
11541 window then it is shown or hidden as needed.
11542 """
54f9ee45 11543 return _core_.SizerItem_Show(*args, **kwargs)
e811c8ce
RD
11544
11545 def IsShown(*args, **kwargs):
248ed943
RD
11546 """
11547 IsShown(self) -> bool
11548
11549 Is the item to be shown in the layout?
11550 """
54f9ee45 11551 return _core_.SizerItem_IsShown(*args, **kwargs)
e811c8ce
RD
11552
11553 def GetPosition(*args, **kwargs):
248ed943
RD
11554 """
11555 GetPosition(self) -> Point
11556
11557 Returns the current position of the item, as set in the last Layout.
11558 """
54f9ee45 11559 return _core_.SizerItem_GetPosition(*args, **kwargs)
e811c8ce
RD
11560
11561 def GetUserData(*args, **kwargs):
248ed943
RD
11562 """
11563 GetUserData(self) -> PyObject
11564
11565 Returns the userData associated with this sizer item, or None if there
11566 isn't any.
11567 """
54f9ee45 11568 return _core_.SizerItem_GetUserData(*args, **kwargs)
e811c8ce 11569
091f5bed
RD
11570 def SetUserData(*args, **kwargs):
11571 """
11572 SetUserData(self, PyObject userData)
11573
11574 Associate a Python object with this sizer item.
11575 """
11576 return _core_.SizerItem_SetUserData(*args, **kwargs)
11577
33d6fd3b
RD
11578 Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`")
11579 Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`")
11580 MinSize = property(GetMinSize,doc="See `GetMinSize`")
11581 MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`")
11582 Position = property(GetPosition,doc="See `GetPosition`")
11583 Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`")
11584 Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`")
11585 Rect = property(GetRect,doc="See `GetRect`")
11586 Size = property(GetSize,doc="See `GetSize`")
11587 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
11588 Spacer = property(GetSpacer,SetSpacer,doc="See `GetSpacer` and `SetSpacer`")
11589 UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`")
11590 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 11591_core_.SizerItem_swigregister(SizerItem)
d14a1e28 11592
248ed943 11593def SizerItemWindow(*args, **kwargs):
0df68c9f 11594 """
248ed943
RD
11595 SizerItemWindow(Window window, int proportion, int flag, int border,
11596 PyObject userData=None) -> SizerItem
11597
11598 Constructs a `wx.SizerItem` for tracking a window.
0df68c9f 11599 """
248ed943 11600 val = _core_.new_SizerItemWindow(*args, **kwargs)
d14a1e28
RD
11601 return val
11602
248ed943 11603def SizerItemSpacer(*args, **kwargs):
0df68c9f 11604 """
248ed943
RD
11605 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11606 PyObject userData=None) -> SizerItem
11607
11608 Constructs a `wx.SizerItem` for tracking a spacer.
0df68c9f 11609 """
248ed943 11610 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d14a1e28
RD
11611 return val
11612
11613def SizerItemSizer(*args, **kwargs):
0df68c9f
RD
11614 """
11615 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
11616 PyObject userData=None) -> SizerItem
11617
11618 Constructs a `wx.SizerItem` for tracking a subsizer
0df68c9f 11619 """
54f9ee45 11620 val = _core_.new_SizerItemSizer(*args, **kwargs)
d14a1e28
RD
11621 return val
11622
11623class Sizer(Object):
248ed943
RD
11624 """
11625 wx.Sizer is the abstract base class used for laying out subwindows in
11626 a window. You cannot use wx.Sizer directly; instead, you will have to
11627 use one of the sizer classes derived from it such as `wx.BoxSizer`,
1d5ee749
RD
11628 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11629 `wx.GridBagSizer`.
248ed943
RD
11630
11631 The concept implemented by sizers in wxWidgets is closely related to
11632 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11633 toolkit or the Qt toolkit. It is based upon the idea of the individual
11634 subwindows reporting their minimal required size and their ability to
11635 get stretched if the size of the parent window has changed. This will
11636 most often mean that the programmer does not set the original size of
11637 a dialog in the beginning, rather the dialog will assigned a sizer and
11638 this sizer will be queried about the recommended size. The sizer in
11639 turn will query its children, which can be normal windows or contorls,
11640 empty space or other sizers, so that a hierarchy of sizers can be
11641 constructed. Note that wxSizer does not derive from wxWindow and thus
11642 do not interfere with tab ordering and requires very little resources
11643 compared to a real window on screen.
11644
11645 What makes sizers so well fitted for use in wxWidgets is the fact that
11646 every control reports its own minimal size and the algorithm can
11647 handle differences in font sizes or different window (dialog item)
11648 sizes on different platforms without problems. If for example the
11649 standard font as well as the overall design of Mac widgets requires
11650 more space than on Windows, then the initial size of a dialog using a
11651 sizer will automatically be bigger on Mac than on Windows.
11652 """
0085ce49
RD
11653 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11654 def __init__(self): raise AttributeError, "No constructor defined"
11655 __repr__ = _swig_repr
11656 __swig_destroy__ = _core_.delete_Sizer
11657 __del__ = lambda self : None;
e811c8ce 11658 def _setOORInfo(*args, **kwargs):
a95a7133 11659 """_setOORInfo(self, PyObject _self)"""
54f9ee45 11660 return _core_.Sizer__setOORInfo(*args, **kwargs)
e811c8ce
RD
11661
11662 def Add(*args, **kwargs):
0df68c9f 11663 """
248ed943 11664 Add(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11665 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11666
11667 Appends a child item to the sizer.
0df68c9f 11668 """
54f9ee45 11669 return _core_.Sizer_Add(*args, **kwargs)
e811c8ce
RD
11670
11671 def Insert(*args, **kwargs):
0df68c9f 11672 """
248ed943 11673 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11674 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11675
11676 Inserts a new item into the list of items managed by this sizer before
11677 the item at index *before*. See `Add` for a description of the parameters.
0df68c9f 11678 """
54f9ee45 11679 return _core_.Sizer_Insert(*args, **kwargs)
e811c8ce
RD
11680
11681 def Prepend(*args, **kwargs):
0df68c9f 11682 """
248ed943 11683 Prepend(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11684 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11685
11686 Adds a new item to the begining of the list of sizer items managed by
11687 this sizer. See `Add` for a description of the parameters.
0df68c9f 11688 """
54f9ee45 11689 return _core_.Sizer_Prepend(*args, **kwargs)
e811c8ce
RD
11690
11691 def Remove(*args, **kwargs):
248ed943
RD
11692 """
11693 Remove(self, item) -> bool
11694
11695 Removes an item from the sizer and destroys it. This method does not
11696 cause any layout or resizing to take place, call `Layout` to update
11697 the layout on screen after removing a child from the sizer. The
11698 *item* parameter can be either a window, a sizer, or the zero-based
11699 index of an item to remove. Returns True if the child item was found
11700 and removed.
11701 """
54f9ee45 11702 return _core_.Sizer_Remove(*args, **kwargs)
e811c8ce 11703
1c0f361b 11704 def Detach(*args, **kwargs):
248ed943
RD
11705 """
11706 Detach(self, item) -> bool
11707
11708 Detaches an item from the sizer without destroying it. This method
11709 does not cause any layout or resizing to take place, call `Layout` to
11710 do so. The *item* parameter can be either a window, a sizer, or the
11711 zero-based index of the item to be detached. Returns True if the child item
11712 was found and detached.
11713 """
1c0f361b
RD
11714 return _core_.Sizer_Detach(*args, **kwargs)
11715
d3b6e4ff
RD
11716 def GetItem(*args, **kwargs):
11717 """
11718 GetItem(self, item) -> wx.SizerItem
11719
11720 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11721 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11722 the item to be found.
d3b6e4ff
RD
11723 """
11724 return _core_.Sizer_GetItem(*args, **kwargs)
11725
e811c8ce 11726 def _SetItemMinSize(*args, **kwargs):
a95a7133 11727 """_SetItemMinSize(self, PyObject item, Size size)"""
54f9ee45 11728 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
e811c8ce 11729
97ab0f6a
RD
11730 def _ReplaceWin(*args, **kwargs):
11731 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
11732 return _core_.Sizer__ReplaceWin(*args, **kwargs)
11733
11734 def _ReplaceSizer(*args, **kwargs):
11735 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
11736 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
11737
11738 def _ReplaceItem(*args, **kwargs):
11739 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
11740 return _core_.Sizer__ReplaceItem(*args, **kwargs)
11741
11742 def Replace(self, olditem, item, recursive=False):
11743 """
11744 Detaches the given ``olditem`` from the sizer and replaces it with
11745 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
11746 detached child is destroyed only if it is not a window, (because
11747 windows are owned by their parent, not the sizer.) The
11748 ``recursive`` parameter can be used to search for the given
11749 element recursivly in subsizers.
11750
11751 This method does not cause any layout or resizing to take place,
11752 call `Layout` to do so.
11753
11754 Returns ``True`` if the child item was found and removed.
11755 """
11756 if isinstance(olditem, wx.Window):
11757 return self._ReplaceWin(olditem, item, recursive)
11758 elif isinstnace(olditem, wx.Sizer):
11759 return self._ReplaceSizer(olditem, item, recursive)
11760 elif isinstnace(olditem, int):
11761 return self._ReplaceItem(olditem, item)
11762 else:
11763 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
11764
11765 def SetContainingWindow(*args, **kwargs):
11766 """
11767 SetContainingWindow(self, Window window)
11768
11769 Set (or unset) the window this sizer is used in.
11770 """
11771 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
11772
11773 def GetContainingWindow(*args, **kwargs):
11774 """
11775 GetContainingWindow(self) -> Window
11776
11777 Get the window this sizer is used in.
11778 """
11779 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
11780
248ed943
RD
11781 def SetItemMinSize(self, item, *args):
11782 """
11783 SetItemMinSize(self, item, Size size)
11784
11785 Sets the minimum size that will be allocated for an item in the sizer.
11786 The *item* parameter can be either a window, a sizer, or the
11787 zero-based index of the item. If a window or sizer is given then it
11788 will be searched for recursivly in subsizers if neccessary.
11789 """
11790 if len(args) == 2:
11791 # for backward compatibility accept separate width,height args too
11792 return self._SetItemMinSize(item, args)
11793 else:
11794 return self._SetItemMinSize(item, args[0])
11795
e811c8ce 11796 def AddItem(*args, **kwargs):
248ed943
RD
11797 """
11798 AddItem(self, SizerItem item)
11799
11800 Adds a `wx.SizerItem` to the sizer.
11801 """
54f9ee45 11802 return _core_.Sizer_AddItem(*args, **kwargs)
e811c8ce
RD
11803
11804 def InsertItem(*args, **kwargs):
248ed943
RD
11805 """
11806 InsertItem(self, int index, SizerItem item)
11807
11808 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11809 """
54f9ee45 11810 return _core_.Sizer_InsertItem(*args, **kwargs)
e811c8ce
RD
11811
11812 def PrependItem(*args, **kwargs):
248ed943
RD
11813 """
11814 PrependItem(self, SizerItem item)
11815
11816 Prepends a `wx.SizerItem` to the sizer.
11817 """
54f9ee45 11818 return _core_.Sizer_PrependItem(*args, **kwargs)
e811c8ce 11819
248ed943 11820 def AddMany(self, items):
66c033b4
RD
11821 """
11822 AddMany is a convenience method for adding several items
11823 to a sizer at one time. Simply pass it a list of tuples,
11824 where each tuple consists of the parameters that you
11825 would normally pass to the `Add` method.
11826 """
248ed943
RD
11827 for item in items:
11828 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11829 item = (item, )
11830 self.Add(*item)
d14a1e28 11831
ae5bc7f3
RD
11832 def AddSpacer(self, *args, **kw):
11833 """AddSpacer(int size) --> SizerItem
11834
11835 Add a spacer that is (size,size) pixels.
11836 """
11837 if args and type(args[0]) == int:
11838 return self.Add( (args[0],args[0] ), 0)
11839 else: # otherwise stay compatible with old AddSpacer
11840 return self.Add(*args, **kw)
11841 def PrependSpacer(self, *args, **kw):
11842 """PrependSpacer(int size) --> SizerItem
11843
11844 Prepend a spacer that is (size, size) pixels."""
11845 if args and type(args[0]) == int:
11846 return self.Prepend( (args[0],args[0] ), 0)
11847 else: # otherwise stay compatible with old PrependSpacer
11848 return self.Prepend(*args, **kw)
11849 def InsertSpacer(self, index, *args, **kw):
11850 """InsertSpacer(int index, int size) --> SizerItem
11851
11852 Insert a spacer at position index that is (size, size) pixels."""
11853 if args and type(args[0]) == int:
11854 return self.Insert( index, (args[0],args[0] ), 0)
11855 else: # otherwise stay compatible with old InsertSpacer
11856 return self.Insert(index, *args, **kw)
11857
11858
11859 def AddStretchSpacer(self, prop=1):
11860 """AddStretchSpacer(int prop=1) --> SizerItem
11861
11862 Add a stretchable spacer."""
11863 return self.Add((0,0), prop)
11864 def PrependStretchSpacer(self, prop=1):
11865 """PrependStretchSpacer(int prop=1) --> SizerItem
11866
11867 Prepend a stretchable spacer."""
11868 return self.Prepend((0,0), prop)
11869 def InsertStretchSpacer(self, index, prop=1):
11870 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
11871
11872 Insert a stretchable spacer."""
11873 return self.Insert(index, (0,0), prop)
11874
11875
74e96f3d 11876 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
11877 def AddWindow(self, *args, **kw):
11878 """Compatibility alias for `Add`."""
11879 return self.Add(*args, **kw)
11880 def AddSizer(self, *args, **kw):
11881 """Compatibility alias for `Add`."""
11882 return self.Add(*args, **kw)
b9d6a5f3
RD
11883
11884 def PrependWindow(self, *args, **kw):
11885 """Compatibility alias for `Prepend`."""
11886 return self.Prepend(*args, **kw)
11887 def PrependSizer(self, *args, **kw):
11888 """Compatibility alias for `Prepend`."""
11889 return self.Prepend(*args, **kw)
b9d6a5f3
RD
11890
11891 def InsertWindow(self, *args, **kw):
11892 """Compatibility alias for `Insert`."""
11893 return self.Insert(*args, **kw)
11894 def InsertSizer(self, *args, **kw):
11895 """Compatibility alias for `Insert`."""
b9d6a5f3
RD
11896 return self.Insert(*args, **kw)
11897
11898 def RemoveWindow(self, *args, **kw):
11899 """Compatibility alias for `Remove`."""
11900 return self.Remove(*args, **kw)
11901 def RemoveSizer(self, *args, **kw):
11902 """Compatibility alias for `Remove`."""
11903 return self.Remove(*args, **kw)
11904 def RemovePos(self, *args, **kw):
11905 """Compatibility alias for `Remove`."""
11906 return self.Remove(*args, **kw)
d14a1e28
RD
11907
11908
e811c8ce 11909 def SetDimension(*args, **kwargs):
248ed943
RD
11910 """
11911 SetDimension(self, int x, int y, int width, int height)
11912
11913 Call this to force the sizer to take the given dimension and thus
11914 force the items owned by the sizer to resize themselves according to
11915 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11916 methods.
11917 """
54f9ee45 11918 return _core_.Sizer_SetDimension(*args, **kwargs)
e811c8ce
RD
11919
11920 def SetMinSize(*args, **kwargs):
248ed943
RD
11921 """
11922 SetMinSize(self, Size size)
11923
11924 Call this to give the sizer a minimal size. Normally, the sizer will
11925 calculate its minimal size based purely on how much space its children
11926 need. After calling this method `GetMinSize` will return either the
11927 minimal size as requested by its children or the minimal size set
11928 here, depending on which is bigger.
11929 """
54f9ee45 11930 return _core_.Sizer_SetMinSize(*args, **kwargs)
e811c8ce
RD
11931
11932 def GetSize(*args, **kwargs):
248ed943
RD
11933 """
11934 GetSize(self) -> Size
11935
11936 Returns the current size of the space managed by the sizer.
11937 """
54f9ee45 11938 return _core_.Sizer_GetSize(*args, **kwargs)
e811c8ce
RD
11939
11940 def GetPosition(*args, **kwargs):
248ed943
RD
11941 """
11942 GetPosition(self) -> Point
11943
11944 Returns the current position of the sizer's managed space.
11945 """
54f9ee45 11946 return _core_.Sizer_GetPosition(*args, **kwargs)
e811c8ce
RD
11947
11948 def GetMinSize(*args, **kwargs):
248ed943
RD
11949 """
11950 GetMinSize(self) -> Size
11951
11952 Returns the minimal size of the sizer. This is either the combined
11953 minimal size of all the children and their borders or the minimal size
11954 set by SetMinSize, depending on which is bigger.
11955 """
54f9ee45 11956 return _core_.Sizer_GetMinSize(*args, **kwargs)
e811c8ce 11957
d14a1e28 11958 def GetSizeTuple(self):
1c0f361b 11959 return self.GetSize().Get()
d14a1e28 11960 def GetPositionTuple(self):
1c0f361b 11961 return self.GetPosition().Get()
d14a1e28 11962 def GetMinSizeTuple(self):
1c0f361b 11963 return self.GetMinSize().Get()
d14a1e28 11964
e811c8ce 11965 def RecalcSizes(*args, **kwargs):
248ed943
RD
11966 """
11967 RecalcSizes(self)
11968
11969 Using the sizes calculated by `CalcMin` reposition and resize all the
11970 items managed by this sizer. You should not need to call this directly as
11971 it is called by `Layout`.
11972 """
54f9ee45 11973 return _core_.Sizer_RecalcSizes(*args, **kwargs)
e811c8ce
RD
11974
11975 def CalcMin(*args, **kwargs):
248ed943
RD
11976 """
11977 CalcMin(self) -> Size
11978
11979 This method is where the sizer will do the actual calculation of its
11980 children's minimal sizes. You should not need to call this directly as
11981 it is called by `Layout`.
11982 """
54f9ee45 11983 return _core_.Sizer_CalcMin(*args, **kwargs)
e811c8ce
RD
11984
11985 def Layout(*args, **kwargs):
248ed943
RD
11986 """
11987 Layout(self)
11988
11989 This method will force the recalculation and layout of the items
11990 controlled by the sizer using the current space allocated to the
11991 sizer. Normally this is called automatically from the owning window's
11992 EVT_SIZE handler, but it is also useful to call it from user code when
11993 one of the items in a sizer change size, or items are added or
11994 removed.
11995 """
54f9ee45 11996 return _core_.Sizer_Layout(*args, **kwargs)
e811c8ce
RD
11997
11998 def Fit(*args, **kwargs):
248ed943
RD
11999 """
12000 Fit(self, Window window) -> Size
12001
12002 Tell the sizer to resize the *window* to match the sizer's minimal
12003 size. This is commonly done in the constructor of the window itself in
12004 order to set its initial size to match the needs of the children as
12005 determined by the sizer. Returns the new size.
12006
12007 For a top level window this is the total window size, not the client size.
12008 """
54f9ee45 12009 return _core_.Sizer_Fit(*args, **kwargs)
e811c8ce
RD
12010
12011 def FitInside(*args, **kwargs):
248ed943
RD
12012 """
12013 FitInside(self, Window window)
12014
12015 Tell the sizer to resize the *virtual size* of the *window* to match the
12016 sizer's minimal size. This will not alter the on screen size of the
12017 window, but may cause the addition/removal/alteration of scrollbars
12018 required to view the virtual area in windows which manage it.
12019
12020 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12021
12022 """
54f9ee45 12023 return _core_.Sizer_FitInside(*args, **kwargs)
e811c8ce
RD
12024
12025 def SetSizeHints(*args, **kwargs):
248ed943
RD
12026 """
12027 SetSizeHints(self, Window window)
12028
12029 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12030 match the sizer's minimal size. This is commonly done in the
12031 constructor of the window itself if the window is resizable (as are
12032 many dialogs under Unix and frames on probably all platforms) in order
12033 to prevent the window from being sized smaller than the minimal size
12034 required by the sizer.
12035 """
54f9ee45 12036 return _core_.Sizer_SetSizeHints(*args, **kwargs)
e811c8ce
RD
12037
12038 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
12039 """
12040 SetVirtualSizeHints(self, Window window)
12041
12042 Tell the sizer to set the minimal size of the window virtual area to
12043 match the sizer's minimal size. For windows with managed scrollbars
12044 this will set them appropriately.
12045
12046 :see: `wx.ScrolledWindow.SetScrollbars`
12047
12048 """
54f9ee45 12049 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
e811c8ce
RD
12050
12051 def Clear(*args, **kwargs):
248ed943
RD
12052 """
12053 Clear(self, bool deleteWindows=False)
12054
12055 Clear all items from the sizer, optionally destroying the window items
12056 as well.
12057 """
54f9ee45 12058 return _core_.Sizer_Clear(*args, **kwargs)
e811c8ce
RD
12059
12060 def DeleteWindows(*args, **kwargs):
248ed943
RD
12061 """
12062 DeleteWindows(self)
12063
12064 Destroy all windows managed by the sizer.
12065 """
54f9ee45 12066 return _core_.Sizer_DeleteWindows(*args, **kwargs)
e811c8ce
RD
12067
12068 def GetChildren(*args, **kwargs):
248ed943 12069 """
51b83b37 12070 GetChildren(self) -> list
248ed943
RD
12071
12072 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12073 """
54f9ee45 12074 return _core_.Sizer_GetChildren(*args, **kwargs)
e811c8ce
RD
12075
12076 def Show(*args, **kwargs):
248ed943 12077 """
ae8162c8 12078 Show(self, item, bool show=True, bool recursive=false) -> bool
e811c8ce 12079
248ed943
RD
12080 Shows or hides an item managed by the sizer. To make a sizer item
12081 disappear or reappear, use Show followed by `Layout`. The *item*
12082 parameter can be either a window, a sizer, or the zero-based index of
7e63a440
RD
12083 the item. Use the recursive parameter to show or hide an item in a
12084 subsizer. Returns True if the item was found.
248ed943
RD
12085 """
12086 return _core_.Sizer_Show(*args, **kwargs)
e811c8ce
RD
12087
12088 def IsShown(*args, **kwargs):
248ed943
RD
12089 """
12090 IsShown(self, item)
12091
b1fcee84 12092 Determines if the item is currently shown. To make a sizer
248ed943
RD
12093 item disappear or reappear, use Show followed by `Layout`. The *item*
12094 parameter can be either a window, a sizer, or the zero-based index of
12095 the item.
12096 """
54f9ee45 12097 return _core_.Sizer_IsShown(*args, **kwargs)
e811c8ce 12098
7e63a440 12099 def Hide(self, item, recursive=False):
248ed943 12100 """
27fb7603 12101 A convenience method for `Show` (item, False, recursive).
248ed943 12102 """
06759a38 12103 return self.Show(item, False, recursive)
248ed943 12104
e811c8ce 12105 def ShowItems(*args, **kwargs):
248ed943
RD
12106 """
12107 ShowItems(self, bool show)
12108
84f85550 12109 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 12110 """
54f9ee45 12111 return _core_.Sizer_ShowItems(*args, **kwargs)
e811c8ce 12112
33d6fd3b
RD
12113 Children = property(GetChildren,doc="See `GetChildren`")
12114 ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`")
12115 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
12116 Position = property(GetPosition,doc="See `GetPosition`")
12117 Size = property(GetSize,doc="See `GetSize`")
2131d850 12118_core_.Sizer_swigregister(Sizer)
d14a1e28
RD
12119
12120class PySizer(Sizer):
248ed943
RD
12121 """
12122 wx.PySizer is a special version of `wx.Sizer` that has been
12123 instrumented to allow the C++ virtual methods to be overloaded in
12124 Python derived classes. You would derive from this class if you are
12125 wanting to implement a custom sizer in Python code. Simply implement
12126 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12127 For example::
12128
12129 class MySizer(wx.PySizer):
12130 def __init__(self):
12131 wx.PySizer.__init__(self)
12132
12133 def CalcMin(self):
12134 for item in self.GetChildren():
12135 # calculate the total minimum width and height needed
12136 # by all items in the sizer according to this sizer's
12137 # layout algorithm.
12138 ...
12139 return wx.Size(width, height)
12140
12141 def RecalcSizes(self):
12142 # find the space allotted to this sizer
12143 pos = self.GetPosition()
12144 size = self.GetSize()
12145 for item in self.GetChildren():
12146 # Recalculate (if necessary) the position and size of
12147 # each item and then call item.SetDimension to do the
12148 # actual positioning and sizing of the items within the
12149 # space alloted to this sizer.
12150 ...
12151 item.SetDimension(itemPos, itemSize)
12152
12153
12154 When `Layout` is called it first calls `CalcMin` followed by
12155 `RecalcSizes` so you can optimize a bit by saving the results of
e505d15e 12156 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
12157
12158 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12159
12160
12161 """
0085ce49
RD
12162 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12163 __repr__ = _swig_repr
12164 def __init__(self, *args, **kwargs):
248ed943
RD
12165 """
12166 __init__(self) -> PySizer
12167
12168 Creates a wx.PySizer. Must be called from the __init__ in the derived
12169 class.
12170 """
0085ce49 12171 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
d14a1e28 12172 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
e811c8ce
RD
12173
12174 def _setCallbackInfo(*args, **kwargs):
a95a7133 12175 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 12176 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
e811c8ce 12177
2131d850 12178_core_.PySizer_swigregister(PySizer)
d14a1e28
RD
12179
12180#---------------------------------------------------------------------------
12181
12182class BoxSizer(Sizer):
248ed943
RD
12183 """
12184 The basic idea behind a box sizer is that windows will most often be
12185 laid out in rather simple basic geometry, typically in a row or a
12186 column or nested hierarchies of either. A wx.BoxSizer will lay out
12187 its items in a simple row or column, depending on the orientation
12188 parameter passed to the constructor.
12189 """
0085ce49
RD
12190 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12191 __repr__ = _swig_repr
12192 def __init__(self, *args, **kwargs):
248ed943
RD
12193 """
12194 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12195
12196 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12197 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12198 sizer.
12199 """
0085ce49 12200 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d14a1e28 12201 self._setOORInfo(self)
e811c8ce
RD
12202
12203 def GetOrientation(*args, **kwargs):
248ed943
RD
12204 """
12205 GetOrientation(self) -> int
12206
12207 Returns the current orientation of the sizer.
12208 """
54f9ee45 12209 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
e811c8ce
RD
12210
12211 def SetOrientation(*args, **kwargs):
248ed943
RD
12212 """
12213 SetOrientation(self, int orient)
e811c8ce 12214
248ed943
RD
12215 Resets the orientation of the sizer.
12216 """
12217 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
e811c8ce 12218
2bf58437 12219 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
2131d850 12220_core_.BoxSizer_swigregister(BoxSizer)
d14a1e28
RD
12221
12222#---------------------------------------------------------------------------
12223
12224class StaticBoxSizer(BoxSizer):
248ed943
RD
12225 """
12226 wx.StaticBoxSizer derives from and functions identically to the
12227 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12228 manages. Note that this static box must be created separately and
12229 passed to the sizer constructor.
12230 """
0085ce49
RD
12231 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12232 __repr__ = _swig_repr
12233 def __init__(self, *args, **kwargs):
248ed943
RD
12234 """
12235 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12236
12237 Constructor. It takes an associated static box and the orientation
12238 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12239 ``wx.HORIZONTAL``.
12240 """
0085ce49 12241 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d14a1e28 12242 self._setOORInfo(self)
e811c8ce
RD
12243
12244 def GetStaticBox(*args, **kwargs):
248ed943
RD
12245 """
12246 GetStaticBox(self) -> StaticBox
e811c8ce 12247
248ed943
RD
12248 Returns the static box associated with this sizer.
12249 """
12250 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
e811c8ce 12251
33d6fd3b 12252 StaticBox = property(GetStaticBox,doc="See `GetStaticBox`")
2131d850 12253_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d14a1e28
RD
12254
12255#---------------------------------------------------------------------------
12256
12257class GridSizer(Sizer):
248ed943
RD
12258 """
12259 A grid sizer is a sizer which lays out its children in a
12260 two-dimensional table with all cells having the same size. In other
12261 words, the width of each cell within the grid is the width of the
12262 widest item added to the sizer and the height of each grid cell is the
12263 height of the tallest item. An optional vertical and/or horizontal
12264 gap between items can also be specified (in pixels.)
12265
12266 Items are placed in the cells of the grid in the order they are added,
12267 in row-major order. In other words, the first row is filled first,
12268 then the second, and so on until all items have been added. (If
12269 neccessary, additional rows will be added as items are added.) If you
12270 need to have greater control over the cells that items are placed in
12271 then use the `wx.GridBagSizer`.
12272
12273 """
0085ce49
RD
12274 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12275 __repr__ = _swig_repr
12276 def __init__(self, *args, **kwargs):
248ed943
RD
12277 """
12278 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12279
12280 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12281 of columns and rows in the sizer - if either of the parameters is
12282 zero, it will be calculated to from the total number of children in
12283 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12284 define extra space between all children.
12285 """
0085ce49 12286 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d14a1e28 12287 self._setOORInfo(self)
e811c8ce 12288
e811c8ce 12289 def SetCols(*args, **kwargs):
248ed943
RD
12290 """
12291 SetCols(self, int cols)
12292
12293 Sets the number of columns in the sizer.
12294 """
54f9ee45 12295 return _core_.GridSizer_SetCols(*args, **kwargs)
e811c8ce
RD
12296
12297 def SetRows(*args, **kwargs):
248ed943
RD
12298 """
12299 SetRows(self, int rows)
12300
12301 Sets the number of rows in the sizer.
12302 """
54f9ee45 12303 return _core_.GridSizer_SetRows(*args, **kwargs)
e811c8ce
RD
12304
12305 def SetVGap(*args, **kwargs):
248ed943
RD
12306 """
12307 SetVGap(self, int gap)
12308
12309 Sets the vertical gap (in pixels) between the cells in the sizer.
12310 """
54f9ee45 12311 return _core_.GridSizer_SetVGap(*args, **kwargs)
e811c8ce
RD
12312
12313 def SetHGap(*args, **kwargs):
248ed943
RD
12314 """
12315 SetHGap(self, int gap)
12316
12317 Sets the horizontal gap (in pixels) between cells in the sizer
12318 """
54f9ee45 12319 return _core_.GridSizer_SetHGap(*args, **kwargs)
e811c8ce
RD
12320
12321 def GetCols(*args, **kwargs):
248ed943
RD
12322 """
12323 GetCols(self) -> int
12324
12325 Returns the number of columns in the sizer.
12326 """
54f9ee45 12327 return _core_.GridSizer_GetCols(*args, **kwargs)
e811c8ce
RD
12328
12329 def GetRows(*args, **kwargs):
248ed943
RD
12330 """
12331 GetRows(self) -> int
12332
12333 Returns the number of rows in the sizer.
12334 """
54f9ee45 12335 return _core_.GridSizer_GetRows(*args, **kwargs)
e811c8ce
RD
12336
12337 def GetVGap(*args, **kwargs):
248ed943
RD
12338 """
12339 GetVGap(self) -> int
12340
12341 Returns the vertical gap (in pixels) between the cells in the sizer.
12342 """
54f9ee45 12343 return _core_.GridSizer_GetVGap(*args, **kwargs)
e811c8ce
RD
12344
12345 def GetHGap(*args, **kwargs):
248ed943
RD
12346 """
12347 GetHGap(self) -> int
12348
12349 Returns the horizontal gap (in pixels) between cells in the sizer.
12350 """
54f9ee45 12351 return _core_.GridSizer_GetHGap(*args, **kwargs)
e811c8ce 12352
0085ce49
RD
12353 def CalcRowsCols(self):
12354 """
12355 CalcRowsCols() -> (rows, cols)
12356
12357 Calculates how many rows and columns will be in the sizer based
12358 on the current number of items and also the rows, cols specified
12359 in the constructor.
12360 """
12361 nitems = len(self.GetChildren())
12362 rows = self.GetRows()
12363 cols = self.GetCols()
12364 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
12365 if cols != 0:
12366 rows = (nitems + cols - 1) / cols
12367 elif rows != 0:
12368 cols = (nitems + rows - 1) / rows
12369 return (rows, cols)
d14a1e28 12370
97ab0f6a
RD
12371 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
12372 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
12373 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
12374 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
2131d850 12375_core_.GridSizer_swigregister(GridSizer)
d14a1e28
RD
12376
12377#---------------------------------------------------------------------------
12378
54f9ee45
RD
12379FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12380FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12381FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
d14a1e28 12382class FlexGridSizer(GridSizer):
248ed943
RD
12383 """
12384 A flex grid sizer is a sizer which lays out its children in a
12385 two-dimensional table with all table cells in one row having the same
12386 height and all cells in one column having the same width, but all
12387 rows or all columns are not necessarily the same height or width as in
12388 the `wx.GridSizer`.
12389
12390 wx.FlexGridSizer can also size items equally in one direction but
12391 unequally ("flexibly") in the other. If the sizer is only flexible
12392 in one direction (this can be changed using `SetFlexibleDirection`), it
12393 needs to be decided how the sizer should grow in the other ("non
12394 flexible") direction in order to fill the available space. The
12395 `SetNonFlexibleGrowMode` method serves this purpose.
12396
12397
12398 """
0085ce49
RD
12399 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12400 __repr__ = _swig_repr
12401 def __init__(self, *args, **kwargs):
248ed943
RD
12402 """
12403 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12404
12405 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12406 number of columns and rows in the sizer - if either of the parameters
12407 is zero, it will be calculated to from the total number of children in
12408 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12409 define extra space between all children.
12410 """
0085ce49 12411 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d14a1e28 12412 self._setOORInfo(self)
e811c8ce 12413
248ed943
RD
12414 def AddGrowableRow(*args, **kwargs):
12415 """
12416 AddGrowableRow(self, size_t idx, int proportion=0)
e811c8ce 12417
248ed943
RD
12418 Specifies that row *idx* (starting from zero) should be grown if there
12419 is extra space available to the sizer.
e811c8ce 12420
248ed943
RD
12421 The *proportion* parameter has the same meaning as the stretch factor
12422 for the box sizers except that if all proportions are 0, then all
12423 columns are resized equally (instead of not being resized at all).
12424 """
54f9ee45 12425 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
e811c8ce
RD
12426
12427 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
12428 """
12429 RemoveGrowableRow(self, size_t idx)
12430
12431 Specifies that row *idx* is no longer growable.
12432 """
54f9ee45 12433 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
e811c8ce
RD
12434
12435 def AddGrowableCol(*args, **kwargs):
248ed943
RD
12436 """
12437 AddGrowableCol(self, size_t idx, int proportion=0)
12438
12439 Specifies that column *idx* (starting from zero) should be grown if
12440 there is extra space available to the sizer.
12441
12442 The *proportion* parameter has the same meaning as the stretch factor
12443 for the box sizers except that if all proportions are 0, then all
12444 columns are resized equally (instead of not being resized at all).
12445 """
54f9ee45 12446 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
e811c8ce
RD
12447
12448 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
12449 """
12450 RemoveGrowableCol(self, size_t idx)
12451
12452 Specifies that column *idx* is no longer growable.
12453 """
54f9ee45 12454 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
e811c8ce
RD
12455
12456 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
12457 """
12458 SetFlexibleDirection(self, int direction)
12459
12460 Specifies whether the sizer should flexibly resize its columns, rows,
12461 or both. Argument *direction* can be one of the following values. Any
12462 other value is ignored.
12463
12464 ============== =======================================
12465 wx.VERTICAL Rows are flexibly sized.
12466 wx.HORIZONTAL Columns are flexibly sized.
12467 wx.BOTH Both rows and columns are flexibly sized
12468 (this is the default value).
12469 ============== =======================================
12470
12471 Note that this method does not trigger relayout.
12472
12473 """
54f9ee45 12474 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
12475
12476 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
12477 """
12478 GetFlexibleDirection(self) -> int
12479
12480 Returns a value that specifies whether the sizer
12481 flexibly resizes its columns, rows, or both (default).
12482
12483 :see: `SetFlexibleDirection`
12484 """
54f9ee45 12485 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
12486
12487 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
12488 """
12489 SetNonFlexibleGrowMode(self, int mode)
12490
12491 Specifies how the sizer should grow in the non-flexible direction if
12492 there is one (so `SetFlexibleDirection` must have been called
12493 previously). Argument *mode* can be one of the following values:
12494
12495 ========================== =================================================
12496 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12497 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12498 `AddGrowableCol` and `AddGrowableRow`. In this
12499 case equal sizing applies to minimum sizes of
12500 columns or rows (this is the default value).
12501 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12502 the non flexible direction, whether they are
12503 growable or not in the flexbile direction.
12504 ========================== =================================================
12505
12506 Note that this method does not trigger relayout.
248ed943 12507 """
54f9ee45 12508 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
12509
12510 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
12511 """
12512 GetNonFlexibleGrowMode(self) -> int
12513
12514 Returns the value that specifies how the sizer grows in the
12515 non-flexible direction if there is one.
12516
12517 :see: `SetNonFlexibleGrowMode`
12518 """
54f9ee45 12519 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
12520
12521 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
12522 """
12523 GetRowHeights(self) -> list
12524
12525 Returns a list of integers representing the heights of each of the
12526 rows in the sizer.
12527 """
54f9ee45 12528 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
e811c8ce
RD
12529
12530 def GetColWidths(*args, **kwargs):
fd2dc343
RD
12531 """
12532 GetColWidths(self) -> list
12533
12534 Returns a list of integers representing the widths of each of the
12535 columns in the sizer.
12536 """
54f9ee45 12537 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
e811c8ce 12538
97ab0f6a
RD
12539 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
12540 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
12541 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
12542 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
2131d850 12543_core_.FlexGridSizer_swigregister(FlexGridSizer)
d14a1e28 12544
e505d15e
RD
12545class StdDialogButtonSizer(BoxSizer):
12546 """
12547 A special sizer that knows how to order and position standard buttons
12548 in order to conform to the current platform's standards. You simply
12549 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 12550 buttons using the standard ID's. Then call `Realize` and the sizer
e505d15e
RD
12551 will take care of the rest.
12552
12553 """
0085ce49
RD
12554 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12555 __repr__ = _swig_repr
12556 def __init__(self, *args, **kwargs):
e505d15e 12557 """__init__(self) -> StdDialogButtonSizer"""
0085ce49 12558 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
e505d15e
RD
12559 def AddButton(*args, **kwargs):
12560 """
12561 AddButton(self, wxButton button)
12562
12563 Use this to add the buttons to this sizer. Do not use the `Add`
12564 method in the base class.
12565 """
12566 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
12567
53aa7709 12568 def Realize(*args, **kwargs):
e505d15e 12569 """
53aa7709 12570 Realize(self)
e505d15e
RD
12571
12572 This funciton needs to be called after all the buttons have been added
12573 to the sizer. It will reorder them and position them in a platform
12574 specifc manner.
12575 """
53aa7709 12576 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
12577
12578 def SetAffirmativeButton(*args, **kwargs):
12579 """SetAffirmativeButton(self, wxButton button)"""
12580 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
12581
12582 def SetNegativeButton(*args, **kwargs):
12583 """SetNegativeButton(self, wxButton button)"""
12584 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
12585
12586 def SetCancelButton(*args, **kwargs):
12587 """SetCancelButton(self, wxButton button)"""
12588 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
e505d15e
RD
12589
12590 def GetAffirmativeButton(*args, **kwargs):
12591 """GetAffirmativeButton(self) -> wxButton"""
12592 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
12593
12594 def GetApplyButton(*args, **kwargs):
12595 """GetApplyButton(self) -> wxButton"""
12596 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
12597
12598 def GetNegativeButton(*args, **kwargs):
12599 """GetNegativeButton(self) -> wxButton"""
12600 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
12601
12602 def GetCancelButton(*args, **kwargs):
12603 """GetCancelButton(self) -> wxButton"""
12604 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
12605
12606 def GetHelpButton(*args, **kwargs):
12607 """GetHelpButton(self) -> wxButton"""
12608 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
12609
33d6fd3b
RD
12610 AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`")
12611 ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`")
12612 CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`")
12613 HelpButton = property(GetHelpButton,doc="See `GetHelpButton`")
12614 NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`")
2131d850 12615_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
e505d15e 12616
d14a1e28
RD
12617#---------------------------------------------------------------------------
12618
12619class GBPosition(object):
248ed943
RD
12620 """
12621 This class represents the position of an item in a virtual grid of
12622 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12623 typemaps that will automatically convert from a 2-element sequence of
12624 integers to a wx.GBPosition, so you can use the more pythonic
12625 representation of the position nearly transparently in Python code.
12626 """
0085ce49
RD
12627 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12628 __repr__ = _swig_repr
12629 def __init__(self, *args, **kwargs):
248ed943
RD
12630 """
12631 __init__(self, int row=0, int col=0) -> GBPosition
12632
12633 This class represents the position of an item in a virtual grid of
12634 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12635 typemaps that will automatically convert from a 2-element sequence of
12636 integers to a wx.GBPosition, so you can use the more pythonic
12637 representation of the position nearly transparently in Python code.
12638 """
0085ce49
RD
12639 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
12640 __swig_destroy__ = _core_.delete_GBPosition
12641 __del__ = lambda self : None;
e811c8ce 12642 def GetRow(*args, **kwargs):
a95a7133 12643 """GetRow(self) -> int"""
54f9ee45 12644 return _core_.GBPosition_GetRow(*args, **kwargs)
e811c8ce
RD
12645
12646 def GetCol(*args, **kwargs):
a95a7133 12647 """GetCol(self) -> int"""
54f9ee45 12648 return _core_.GBPosition_GetCol(*args, **kwargs)
e811c8ce
RD
12649
12650 def SetRow(*args, **kwargs):
a95a7133 12651 """SetRow(self, int row)"""
54f9ee45 12652 return _core_.GBPosition_SetRow(*args, **kwargs)
e811c8ce
RD
12653
12654 def SetCol(*args, **kwargs):
a95a7133 12655 """SetCol(self, int col)"""
54f9ee45 12656 return _core_.GBPosition_SetCol(*args, **kwargs)
e811c8ce
RD
12657
12658 def __eq__(*args, **kwargs):
e9d6f3a4
RD
12659 """
12660 __eq__(self, PyObject other) -> bool
12661
12662 Compare GBPosition for equality.
12663 """
54f9ee45 12664 return _core_.GBPosition___eq__(*args, **kwargs)
e811c8ce
RD
12665
12666 def __ne__(*args, **kwargs):
e9d6f3a4
RD
12667 """
12668 __ne__(self, PyObject other) -> bool
12669
12670 Compare GBPosition for inequality.
12671 """
54f9ee45 12672 return _core_.GBPosition___ne__(*args, **kwargs)
e811c8ce
RD
12673
12674 def Set(*args, **kwargs):
a95a7133 12675 """Set(self, int row=0, int col=0)"""
54f9ee45 12676 return _core_.GBPosition_Set(*args, **kwargs)
e811c8ce
RD
12677
12678 def Get(*args, **kwargs):
a95a7133 12679 """Get(self) -> PyObject"""
54f9ee45 12680 return _core_.GBPosition_Get(*args, **kwargs)
e811c8ce 12681
41e2b43e 12682 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
12683 def __str__(self): return str(self.Get())
12684 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12685 def __len__(self): return len(self.Get())
12686 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
12687 def __setitem__(self, index, val):
12688 if index == 0: self.SetRow(val)
12689 elif index == 1: self.SetCol(val)
12690 else: raise IndexError
e811c8ce 12691 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
12692 __safe_for_unpickling__ = True
12693 def __reduce__(self): return (wx.GBPosition, self.Get())
d14a1e28
RD
12694
12695 row = property(GetRow, SetRow)
12696 col = property(GetCol, SetCol)
12697
2131d850 12698_core_.GBPosition_swigregister(GBPosition)
d14a1e28
RD
12699
12700class GBSpan(object):
248ed943
RD
12701 """
12702 This class is used to hold the row and column spanning attributes of
12703 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12704 automatically convert from a 2-element sequence of integers to a
12705 wx.GBSpan, so you can use the more pythonic representation of the span
12706 nearly transparently in Python code.
12707
12708 """
0085ce49
RD
12709 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12710 __repr__ = _swig_repr
12711 def __init__(self, *args, **kwargs):
248ed943
RD
12712 """
12713 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12714
12715 Construct a new wxGBSpan, optionally setting the rowspan and
12716 colspan. The default is (1,1). (Meaning that the item occupies one
12717 cell in each direction.
12718 """
0085ce49
RD
12719 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12720 __swig_destroy__ = _core_.delete_GBSpan
12721 __del__ = lambda self : None;
e811c8ce 12722 def GetRowspan(*args, **kwargs):
a95a7133 12723 """GetRowspan(self) -> int"""
54f9ee45 12724 return _core_.GBSpan_GetRowspan(*args, **kwargs)
e811c8ce
RD
12725
12726 def GetColspan(*args, **kwargs):
a95a7133 12727 """GetColspan(self) -> int"""
54f9ee45 12728 return _core_.GBSpan_GetColspan(*args, **kwargs)
e811c8ce
RD
12729
12730 def SetRowspan(*args, **kwargs):
a95a7133 12731 """SetRowspan(self, int rowspan)"""
54f9ee45 12732 return _core_.GBSpan_SetRowspan(*args, **kwargs)
e811c8ce
RD
12733
12734 def SetColspan(*args, **kwargs):
a95a7133 12735 """SetColspan(self, int colspan)"""
54f9ee45 12736 return _core_.GBSpan_SetColspan(*args, **kwargs)
e811c8ce
RD
12737
12738 def __eq__(*args, **kwargs):
e9d6f3a4
RD
12739 """
12740 __eq__(self, PyObject other) -> bool
12741
12742 Compare wxGBSpan for equality.
12743 """
54f9ee45 12744 return _core_.GBSpan___eq__(*args, **kwargs)
e811c8ce
RD
12745
12746 def __ne__(*args, **kwargs):
e9d6f3a4
RD
12747 """
12748 __ne__(self, PyObject other) -> bool
12749
12750 Compare GBSpan for inequality.
12751 """
54f9ee45 12752 return _core_.GBSpan___ne__(*args, **kwargs)
e811c8ce
RD
12753
12754 def Set(*args, **kwargs):
a95a7133 12755 """Set(self, int rowspan=1, int colspan=1)"""
54f9ee45 12756 return _core_.GBSpan_Set(*args, **kwargs)
e811c8ce
RD
12757
12758 def Get(*args, **kwargs):
a95a7133 12759 """Get(self) -> PyObject"""
54f9ee45 12760 return _core_.GBSpan_Get(*args, **kwargs)
e811c8ce 12761
41e2b43e 12762 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
12763 def __str__(self): return str(self.Get())
12764 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12765 def __len__(self): return len(self.Get())
12766 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
12767 def __setitem__(self, index, val):
12768 if index == 0: self.SetRowspan(val)
12769 elif index == 1: self.SetColspan(val)
12770 else: raise IndexError
e811c8ce 12771 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
12772 __safe_for_unpickling__ = True
12773 def __reduce__(self): return (wx.GBSpan, self.Get())
d14a1e28
RD
12774
12775 rowspan = property(GetRowspan, SetRowspan)
12776 colspan = property(GetColspan, SetColspan)
12777
2131d850 12778_core_.GBSpan_swigregister(GBSpan)
d14a1e28
RD
12779
12780class GBSizerItem(SizerItem):
248ed943
RD
12781 """
12782 The wx.GBSizerItem class is used to track the additional data about
12783 items in a `wx.GridBagSizer` such as the item's position in the grid
12784 and how many rows or columns it spans.
12785
12786 """
0085ce49
RD
12787 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12788 __repr__ = _swig_repr
12789 def __init__(self, *args, **kwargs):
248ed943
RD
12790 """
12791 __init__(self) -> GBSizerItem
12792
12793 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12794 size will need to be set, as well as a position and span before this
12795 item can be used in a Sizer.
12796
12797 You will probably never need to create a wx.GBSizerItem directly as they
12798 are created automatically when the sizer's Add method is called.
12799 """
0085ce49
RD
12800 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12801 __swig_destroy__ = _core_.delete_GBSizerItem
12802 __del__ = lambda self : None;
e811c8ce 12803 def GetPos(*args, **kwargs):
248ed943
RD
12804 """
12805 GetPos(self) -> GBPosition
12806
12807 Get the grid position of the item
12808 """
54f9ee45 12809 return _core_.GBSizerItem_GetPos(*args, **kwargs)
e811c8ce
RD
12810
12811 def GetPosTuple(self): return self.GetPos().Get()
12812 def GetSpan(*args, **kwargs):
248ed943
RD
12813 """
12814 GetSpan(self) -> GBSpan
12815
12816 Get the row and column spanning of the item
12817 """
54f9ee45 12818 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
e811c8ce
RD
12819
12820 def GetSpanTuple(self): return self.GetSpan().Get()
12821 def SetPos(*args, **kwargs):
248ed943
RD
12822 """
12823 SetPos(self, GBPosition pos) -> bool
12824
12825 If the item is already a member of a sizer then first ensure that
12826 there is no other item that would intersect with this one at the new
12827 position, then set the new position. Returns True if the change is
12828 successful and after the next Layout() the item will be moved.
12829 """
54f9ee45 12830 return _core_.GBSizerItem_SetPos(*args, **kwargs)
e811c8ce
RD
12831
12832 def SetSpan(*args, **kwargs):
248ed943
RD
12833 """
12834 SetSpan(self, GBSpan span) -> bool
12835
12836 If the item is already a member of a sizer then first ensure that
12837 there is no other item that would intersect with this one with its new
12838 spanning size, then set the new spanning. Returns True if the change
12839 is successful and after the next Layout() the item will be resized.
12840
12841 """
54f9ee45 12842 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
e811c8ce 12843
248ed943 12844 def Intersects(*args, **kwargs):
0df68c9f 12845 """
a95a7133 12846 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
12847
12848 Returns True if this item and the other item instersect.
0df68c9f 12849 """
248ed943
RD
12850 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12851
12852 def IntersectsPos(*args, **kwargs):
12853 """
12854 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12855
12856 Returns True if the given pos/span would intersect with this item.
12857 """
12858 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
e811c8ce
RD
12859
12860 def GetEndPos(*args, **kwargs):
248ed943
RD
12861 """
12862 GetEndPos(self) -> GBPosition
12863
12864 Get the row and column of the endpoint of this item.
12865 """
54f9ee45 12866 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
e811c8ce
RD
12867
12868 def GetGBSizer(*args, **kwargs):
248ed943
RD
12869 """
12870 GetGBSizer(self) -> GridBagSizer
12871
12872 Get the sizer this item is a member of.
12873 """
54f9ee45 12874 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
e811c8ce
RD
12875
12876 def SetGBSizer(*args, **kwargs):
248ed943
RD
12877 """
12878 SetGBSizer(self, GridBagSizer sizer)
12879
12880 Set the sizer this item is a member of.
12881 """
54f9ee45 12882 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
e811c8ce 12883
97ab0f6a
RD
12884 EndPos = property(GetEndPos,doc="See `GetEndPos`")
12885 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
12886 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
12887 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
2131d850 12888_core_.GBSizerItem_swigregister(GBSizerItem)
d14a1e28
RD
12889DefaultSpan = cvar.DefaultSpan
12890
12891def GBSizerItemWindow(*args, **kwargs):
0df68c9f
RD
12892 """
12893 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12894 int border, PyObject userData=None) -> GBSizerItem
12895
12896 Construct a `wx.GBSizerItem` for a window.
0df68c9f 12897 """
54f9ee45 12898 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d14a1e28
RD
12899 return val
12900
12901def GBSizerItemSizer(*args, **kwargs):
0df68c9f
RD
12902 """
12903 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12904 int border, PyObject userData=None) -> GBSizerItem
12905
12906 Construct a `wx.GBSizerItem` for a sizer
0df68c9f 12907 """
54f9ee45 12908 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d14a1e28
RD
12909 return val
12910
12911def GBSizerItemSpacer(*args, **kwargs):
0df68c9f
RD
12912 """
12913 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
12914 int flag, int border, PyObject userData=None) -> GBSizerItem
12915
12916 Construct a `wx.GBSizerItem` for a spacer.
0df68c9f 12917 """
54f9ee45 12918 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d14a1e28
RD
12919 return val
12920
12921class GridBagSizer(FlexGridSizer):
248ed943
RD
12922 """
12923 A `wx.Sizer` that can lay out items in a virtual grid like a
12924 `wx.FlexGridSizer` but in this case explicit positioning of the items
12925 is allowed using `wx.GBPosition`, and items can optionally span more
12926 than one row and/or column using `wx.GBSpan`. The total size of the
12927 virtual grid is determined by the largest row and column that items are
12928 positioned at, adjusted for spanning.
12929
12930 """
0085ce49
RD
12931 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12932 __repr__ = _swig_repr
12933 def __init__(self, *args, **kwargs):
248ed943
RD
12934 """
12935 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12936
12937 Constructor, with optional parameters to specify the gap between the
12938 rows and columns.
12939 """
0085ce49 12940 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
1823fbb4
RD
12941 self._setOORInfo(self)
12942
e811c8ce 12943 def Add(*args, **kwargs):
0df68c9f 12944 """
248ed943 12945 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
d3b6e4ff 12946 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
12947
12948 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12949 more than one row or column as specified with *span*. The remaining
12950 args behave similarly to `wx.Sizer.Add`.
12951
12952 Returns True if the item was successfully placed at the given cell
12953 position, False if something was already there.
12954
0df68c9f 12955 """
54f9ee45 12956 return _core_.GridBagSizer_Add(*args, **kwargs)
e811c8ce
RD
12957
12958 def AddItem(*args, **kwargs):
248ed943 12959 """
d3b6e4ff 12960 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
12961
12962 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12963 the item was successfully placed at its given cell position, False if
12964 something was already there.
12965 """
54f9ee45 12966 return _core_.GridBagSizer_AddItem(*args, **kwargs)
e811c8ce 12967
84f85550
RD
12968 def GetCellSize(*args, **kwargs):
12969 """
12970 GetCellSize(self, int row, int col) -> Size
12971
12972 Get the size of the specified cell, including hgap and
12973 vgap. Only valid after a Layout.
12974 """
12975 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12976
e811c8ce 12977 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
12978 """
12979 GetEmptyCellSize(self) -> Size
12980
12981 Get the size used for cells in the grid with no item.
12982 """
54f9ee45 12983 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
12984
12985 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
12986 """
12987 SetEmptyCellSize(self, Size sz)
12988
12989 Set the size used for cells in the grid with no item.
12990 """
54f9ee45 12991 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
12992
12993 def GetItemPosition(*args):
0df68c9f 12994 """
248ed943
RD
12995 GetItemPosition(self, item) -> GBPosition
12996
12997 Get 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.
0df68c9f 13000 """
54f9ee45 13001 return _core_.GridBagSizer_GetItemPosition(*args)
e811c8ce
RD
13002
13003 def SetItemPosition(*args):
0df68c9f 13004 """
248ed943
RD
13005 SetItemPosition(self, item, GBPosition pos) -> bool
13006
13007 Set the grid position of the specified *item* where *item* is either a
13008 window or subsizer that is a member of this sizer, or a zero-based
13009 index of an item. Returns True on success. If the move is not
13010 allowed (because an item is already there) then False is returned.
13011
0df68c9f 13012 """
54f9ee45 13013 return _core_.GridBagSizer_SetItemPosition(*args)
e811c8ce
RD
13014
13015 def GetItemSpan(*args):
0df68c9f 13016 """
248ed943
RD
13017 GetItemSpan(self, item) -> GBSpan
13018
13019 Get 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.
0df68c9f 13022 """
54f9ee45 13023 return _core_.GridBagSizer_GetItemSpan(*args)
e811c8ce
RD
13024
13025 def SetItemSpan(*args):
0df68c9f 13026 """
248ed943
RD
13027 SetItemSpan(self, item, GBSpan span) -> bool
13028
13029 Set the row/col spanning of the specified *item* where *item* is
13030 either a window or subsizer that is a member of this sizer, or a
13031 zero-based index of an item. Returns True on success. If the move is
13032 not allowed (because an item is already there) then False is returned.
0df68c9f 13033 """
54f9ee45 13034 return _core_.GridBagSizer_SetItemSpan(*args)
e811c8ce
RD
13035
13036 def FindItem(*args):
0df68c9f 13037 """
248ed943
RD
13038 FindItem(self, item) -> GBSizerItem
13039
13040 Find the sizer item for the given window or subsizer, returns None if
13041 not found. (non-recursive)
0df68c9f 13042 """
54f9ee45 13043 return _core_.GridBagSizer_FindItem(*args)
e811c8ce
RD
13044
13045 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
13046 """
13047 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
13048
13049 Return the sizer item for the given grid cell, or None if there is no
13050 item at that position. (non-recursive)
13051 """
54f9ee45 13052 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
e811c8ce
RD
13053
13054 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
13055 """
13056 FindItemAtPoint(self, Point pt) -> GBSizerItem
13057
13058 Return the sizer item located at the point given in *pt*, or None if
13059 there is no item at that point. The (x,y) coordinates in pt correspond
13060 to the client coordinates of the window using the sizer for
13061 layout. (non-recursive)
13062 """
54f9ee45 13063 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
e811c8ce 13064
248ed943
RD
13065 def CheckForIntersection(*args, **kwargs):
13066 """
13067 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
e811c8ce 13068
248ed943
RD
13069 Look at all items and see if any intersect (or would overlap) the
13070 given *item*. Returns True if so, False if there would be no overlap.
13071 If an *excludeItem* is given then it will not be checked for
13072 intersection, for example it may be the item we are checking the
13073 position of.
e811c8ce 13074
248ed943
RD
13075 """
13076 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
e811c8ce 13077
248ed943 13078 def CheckForIntersectionPos(*args, **kwargs):
0df68c9f 13079 """
248ed943
RD
13080 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
13081
13082 Look at all items and see if any intersect (or would overlap) the
13083 given position and span. Returns True if so, False if there would be
13084 no overlap. If an *excludeItem* is given then it will not be checked
13085 for intersection, for example it may be the item we are checking the
13086 position of.
0df68c9f 13087 """
248ed943 13088 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
e811c8ce 13089
2131d850 13090_core_.GridBagSizer_swigregister(GridBagSizer)
d14a1e28
RD
13091
13092#---------------------------------------------------------------------------
13093
54f9ee45
RD
13094Left = _core_.Left
13095Top = _core_.Top
13096Right = _core_.Right
13097Bottom = _core_.Bottom
13098Width = _core_.Width
13099Height = _core_.Height
13100Centre = _core_.Centre
13101Center = _core_.Center
13102CentreX = _core_.CentreX
13103CentreY = _core_.CentreY
13104Unconstrained = _core_.Unconstrained
13105AsIs = _core_.AsIs
13106PercentOf = _core_.PercentOf
13107Above = _core_.Above
13108Below = _core_.Below
13109LeftOf = _core_.LeftOf
13110RightOf = _core_.RightOf
13111SameAs = _core_.SameAs
13112Absolute = _core_.Absolute
d14a1e28 13113class IndividualLayoutConstraint(Object):
15afbcd0 13114 """
41e2b43e
RD
13115 Objects of this class are stored in the `wx.LayoutConstraints` class as
13116 one of eight possible constraints that a window can be involved in.
13117 You will never need to create an instance of
13118 wx.IndividualLayoutConstraint, rather you should create a
13119 `wx.LayoutConstraints` instance and use the individual contstraints
15afbcd0 13120 that it contains.
15afbcd0 13121 """
0085ce49
RD
13122 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13123 def __init__(self): raise AttributeError, "No constructor defined"
13124 __repr__ = _swig_repr
e811c8ce 13125 def Set(*args, **kwargs):
41e2b43e
RD
13126 """
13127 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
13128
13129 Sets the properties of the constraint. Normally called by one of the
13130 convenience functions such as Above, RightOf, SameAs.
13131 """
54f9ee45 13132 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
e811c8ce
RD
13133
13134 def LeftOf(*args, **kwargs):
15afbcd0 13135 """
a95a7133 13136 LeftOf(self, Window sibling, int marg=0)
15afbcd0 13137
41e2b43e
RD
13138 Constrains this edge to be to the left of the given window, with an
13139 optional margin. Implicitly, this is relative to the left edge of the
13140 other window.
15afbcd0 13141 """
54f9ee45 13142 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
e811c8ce
RD
13143
13144 def RightOf(*args, **kwargs):
15afbcd0 13145 """
a95a7133 13146 RightOf(self, Window sibling, int marg=0)
15afbcd0 13147
41e2b43e
RD
13148 Constrains this edge to be to the right of the given window, with an
13149 optional margin. Implicitly, this is relative to the right edge of the
13150 other window.
15afbcd0 13151 """
54f9ee45 13152 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
e811c8ce
RD
13153
13154 def Above(*args, **kwargs):
15afbcd0 13155 """
a95a7133 13156 Above(self, Window sibling, int marg=0)
15afbcd0 13157
41e2b43e
RD
13158 Constrains this edge to be above the given window, with an optional
13159 margin. Implicitly, this is relative to the top edge of the other
13160 window.
15afbcd0 13161 """
54f9ee45 13162 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
e811c8ce
RD
13163
13164 def Below(*args, **kwargs):
15afbcd0 13165 """
a95a7133 13166 Below(self, Window sibling, int marg=0)
15afbcd0 13167
41e2b43e
RD
13168 Constrains this edge to be below the given window, with an optional
13169 margin. Implicitly, this is relative to the bottom edge of the other
13170 window.
15afbcd0 13171 """
54f9ee45 13172 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
e811c8ce
RD
13173
13174 def SameAs(*args, **kwargs):
15afbcd0 13175 """
a95a7133 13176 SameAs(self, Window otherW, int edge, int marg=0)
15afbcd0 13177
41e2b43e
RD
13178 Constrains this edge or dimension to be to the same as the edge of the
13179 given window, with an optional margin.
15afbcd0 13180 """
54f9ee45 13181 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
e811c8ce
RD
13182
13183 def PercentOf(*args, **kwargs):
15afbcd0 13184 """
a95a7133 13185 PercentOf(self, Window otherW, int wh, int per)
15afbcd0 13186
41e2b43e
RD
13187 Constrains this edge or dimension to be to a percentage of the given
13188 window, with an optional margin.
15afbcd0 13189 """
54f9ee45 13190 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
e811c8ce
RD
13191
13192 def Absolute(*args, **kwargs):
15afbcd0 13193 """
a95a7133 13194 Absolute(self, int val)
15afbcd0 13195
41e2b43e 13196 Constrains this edge or dimension to be the given absolute value.
15afbcd0 13197 """
54f9ee45 13198 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
e811c8ce
RD
13199
13200 def Unconstrained(*args, **kwargs):
15afbcd0 13201 """
a95a7133 13202 Unconstrained(self)
15afbcd0 13203
41e2b43e
RD
13204 Sets this edge or dimension to be unconstrained, that is, dependent on
13205 other edges and dimensions from which this value can be deduced.
15afbcd0 13206 """
54f9ee45 13207 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
e811c8ce
RD
13208
13209 def AsIs(*args, **kwargs):
15afbcd0 13210 """
a95a7133 13211 AsIs(self)
15afbcd0 13212
41e2b43e
RD
13213 Sets this edge or constraint to be whatever the window's value is at
13214 the moment. If either of the width and height constraints are *as is*,
13215 the window will not be resized, but moved instead. This is important
13216 when considering panel items which are intended to have a default
13217 size, such as a button, which may take its size from the size of the
13218 button label.
15afbcd0 13219 """
54f9ee45 13220 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
e811c8ce
RD
13221
13222 def GetOtherWindow(*args, **kwargs):
a95a7133 13223 """GetOtherWindow(self) -> Window"""
54f9ee45 13224 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
e811c8ce
RD
13225
13226 def GetMyEdge(*args, **kwargs):
a95a7133 13227 """GetMyEdge(self) -> int"""
54f9ee45 13228 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
e811c8ce
RD
13229
13230 def SetEdge(*args, **kwargs):
a95a7133 13231 """SetEdge(self, int which)"""
54f9ee45 13232 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
e811c8ce
RD
13233
13234 def SetValue(*args, **kwargs):
a95a7133 13235 """SetValue(self, int v)"""
54f9ee45 13236 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
e811c8ce
RD
13237
13238 def GetMargin(*args, **kwargs):
a95a7133 13239 """GetMargin(self) -> int"""
54f9ee45 13240 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
e811c8ce
RD
13241
13242 def SetMargin(*args, **kwargs):
a95a7133 13243 """SetMargin(self, int m)"""
54f9ee45 13244 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
e811c8ce
RD
13245
13246 def GetValue(*args, **kwargs):
a95a7133 13247 """GetValue(self) -> int"""
54f9ee45 13248 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
e811c8ce
RD
13249
13250 def GetPercent(*args, **kwargs):
a95a7133 13251 """GetPercent(self) -> int"""
54f9ee45 13252 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
e811c8ce
RD
13253
13254 def GetOtherEdge(*args, **kwargs):
a95a7133 13255 """GetOtherEdge(self) -> int"""
54f9ee45 13256 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
e811c8ce
RD
13257
13258 def GetDone(*args, **kwargs):
a95a7133 13259 """GetDone(self) -> bool"""
54f9ee45 13260 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
e811c8ce
RD
13261
13262 def SetDone(*args, **kwargs):
a95a7133 13263 """SetDone(self, bool d)"""
54f9ee45 13264 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
e811c8ce
RD
13265
13266 def GetRelationship(*args, **kwargs):
a95a7133 13267 """GetRelationship(self) -> int"""
54f9ee45 13268 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
e811c8ce
RD
13269
13270 def SetRelationship(*args, **kwargs):
a95a7133 13271 """SetRelationship(self, int r)"""
54f9ee45 13272 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
e811c8ce
RD
13273
13274 def ResetIfWin(*args, **kwargs):
15afbcd0 13275 """
a95a7133 13276 ResetIfWin(self, Window otherW) -> bool
15afbcd0
RD
13277
13278 Reset constraint if it mentions otherWin
13279 """
54f9ee45 13280 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
e811c8ce
RD
13281
13282 def SatisfyConstraint(*args, **kwargs):
15afbcd0 13283 """
a95a7133 13284 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
15afbcd0
RD
13285
13286 Try to satisfy constraint
13287 """
54f9ee45 13288 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
e811c8ce
RD
13289
13290 def GetEdge(*args, **kwargs):
15afbcd0 13291 """
a95a7133 13292 GetEdge(self, int which, Window thisWin, Window other) -> int
15afbcd0
RD
13293
13294 Get the value of this edge or dimension, or if this
13295 is not determinable, -1.
13296 """
54f9ee45 13297 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
e811c8ce 13298
97ab0f6a
RD
13299 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
13300 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
13301 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
13302 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
13303 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
13304 Percent = property(GetPercent,doc="See `GetPercent`")
13305 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
13306 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
2131d850 13307_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d14a1e28
RD
13308
13309class LayoutConstraints(Object):
15afbcd0 13310 """
41e2b43e
RD
13311 **Note:** constraints are now deprecated and you should use sizers
13312 instead.
15afbcd0 13313
41e2b43e
RD
13314 Objects of this class can be associated with a window to define its
13315 layout constraints, with respect to siblings or its parent.
15afbcd0
RD
13316
13317 The class consists of the following eight constraints of class
13318 wx.IndividualLayoutConstraint, some or all of which should be accessed
13319 directly to set the appropriate constraints.
13320
13321 * left: represents the left hand edge of the window
13322 * right: represents the right hand edge of the window
13323 * top: represents the top edge of the window
13324 * bottom: represents the bottom edge of the window
13325 * width: represents the width of the window
13326 * height: represents the height of the window
13327 * centreX: represents the horizontal centre point of the window
13328 * centreY: represents the vertical centre point of the window
13329
41e2b43e
RD
13330 Most constraints are initially set to have the relationship
13331 wxUnconstrained, which means that their values should be calculated by
13332 looking at known constraints. The exceptions are width and height,
13333 which are set to wxAsIs to ensure that if the user does not specify a
13334 constraint, the existing width and height will be used, to be
13335 compatible with panel items which often have take a default size. If
13336 the constraint is ``wx.AsIs``, the dimension will not be changed.
13337
13338 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
15afbcd0
RD
13339
13340 """
0085ce49
RD
13341 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13342 __repr__ = _swig_repr
54f9ee45
RD
13343 left = property(_core_.LayoutConstraints_left_get)
13344 top = property(_core_.LayoutConstraints_top_get)
13345 right = property(_core_.LayoutConstraints_right_get)
13346 bottom = property(_core_.LayoutConstraints_bottom_get)
13347 width = property(_core_.LayoutConstraints_width_get)
13348 height = property(_core_.LayoutConstraints_height_get)
13349 centreX = property(_core_.LayoutConstraints_centreX_get)
13350 centreY = property(_core_.LayoutConstraints_centreY_get)
0085ce49 13351 def __init__(self, *args, **kwargs):
a95a7133 13352 """__init__(self) -> LayoutConstraints"""
0085ce49
RD
13353 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
13354 __swig_destroy__ = _core_.delete_LayoutConstraints
13355 __del__ = lambda self : None;
e811c8ce 13356 def SatisfyConstraints(*args, **kwargs):
6c3b4aae 13357 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
54f9ee45 13358 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
e811c8ce
RD
13359
13360 def AreSatisfied(*args, **kwargs):
a95a7133 13361 """AreSatisfied(self) -> bool"""
54f9ee45 13362 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
e811c8ce 13363
2131d850 13364_core_.LayoutConstraints_swigregister(LayoutConstraints)
d14a1e28
RD
13365
13366#----------------------------------------------------------------------------
13367
322913ce 13368# Use Python's bool constants if available, make some if not
d14a1e28
RD
13369try:
13370 True
13371except NameError:
322913ce
RD
13372 __builtins__.True = 1==1
13373 __builtins__.False = 1==0
4f89f6a3
RD
13374 def bool(value): return not not value
13375 __builtins__.bool = bool
d14a1e28 13376
d14a1e28
RD
13377
13378
13379# workarounds for bad wxRTTI names
13380__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13381__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13382__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13383
13384
13385#----------------------------------------------------------------------------
13386# Load version numbers from __version__... Ensure that major and minor
7bc1e663 13387# versions are the same for both wxPython and wxWidgets.
d14a1e28
RD
13388
13389from __version__ import *
13390__version__ = VERSION_STRING
13391
7bc1e663
RD
13392assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13393assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
54f9ee45 13394if RELEASE_VERSION != _core_.RELEASE_VERSION:
d14a1e28 13395 import warnings
7bc1e663 13396 warnings.warn("wxPython/wxWidgets release number mismatch")
d14a1e28
RD
13397
13398#----------------------------------------------------------------------------
13399
70b7a5fe
RD
13400# Set wxPython's default string<-->unicode conversion encoding from
13401# the locale, but only if Python's default hasn't been changed. (We
13402# assume that if the user has customized it already then that is the
13403# encoding we need to use as well.)
13404#
13405# The encoding selected here is used when string or unicode objects
13406# need to be converted in order to pass them to wxWidgets. Please be
13407# aware that the default encoding within the same locale may be
13408# slightly different on different platforms. For example, please see
e505d15e
RD
13409# http://www.alanwood.net/demos/charsetdiffs.html for differences
13410# between the common latin/roman encodings.
396fb509
RD
13411
13412default = _sys.getdefaultencoding()
13413if default == 'ascii':
13414 import locale
13415 import codecs
13416 try:
13417 default = locale.getdefaultlocale()[1]
13418 codecs.lookup(default)
70b7a5fe 13419 except (ValueError, LookupError, TypeError):
396fb509
RD
13420 default = _sys.getdefaultencoding()
13421 del locale
13422 del codecs
5cbf236d
RD
13423if default:
13424 wx.SetDefaultPyEncoding(default)
13425del default
5cbf236d
RD
13426
13427#----------------------------------------------------------------------------
13428
d14a1e28
RD
13429class PyDeadObjectError(AttributeError):
13430 pass
13431
d14a1e28
RD
13432class _wxPyDeadObject(object):
13433 """
13434 Instances of wx objects that are OOR capable will have their __class__
13435 changed to this class when the C++ object is deleted. This should help
13436 prevent crashes due to referencing a bogus C++ pointer.
13437 """
13438 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13439 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13440
3a04f143 13441 def __repr__(self):
d14a1e28
RD
13442 if not hasattr(self, "_name"):
13443 self._name = "[unknown]"
13444 return self.reprStr % self._name
13445
3a04f143 13446 def __getattr__(self, *args):
d14a1e28
RD
13447 if not hasattr(self, "_name"):
13448 self._name = "[unknown]"
3a04f143
RD
13449 raise PyDeadObjectError(self.attrStr % self._name)
13450
13451 def __nonzero__(self):
13452 return 0
13453
13454
13455
13456class PyUnbornObjectError(AttributeError):
13457 pass
13458
13459class _wxPyUnbornObject(object):
13460 """
54f9ee45 13461 Some stock objects are created when the wx._core module is
3a04f143
RD
13462 imported, but their C++ instance is not created until the wx.App
13463 object is created and initialized. These object instances will
13464 temporarily have their __class__ changed to this class so an
13465 exception will be raised if they are used before the C++ instance
13466 is ready.
13467 """
13468
13469 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13470 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13471
13472 def __repr__(self):
13473 #if not hasattr(self, "_name"):
13474 # self._name = "[unknown]"
13475 return self.reprStr #% self._name
13476
13477 def __getattr__(self, *args):
13478 #if not hasattr(self, "_name"):
13479 # self._name = "[unknown]"
13480 raise PyUnbornObjectError(self.attrStr) # % self._name )
d14a1e28
RD
13481
13482 def __nonzero__(self):
13483 return 0
13484
13485
13486#----------------------------------------------------------------------------
d14a1e28
RD
13487
13488def CallAfter(callable, *args, **kw):
13489 """
13490 Call the specified function after the current and pending event
13491 handlers have been completed. This is also good for making GUI
61863841
RD
13492 method calls from non-GUI threads. Any extra positional or
13493 keyword args are passed on to the callable when it is called.
13494
846c181b 13495 :see: `wx.CallLater`
d14a1e28
RD
13496 """
13497 app = wx.GetApp()
dfbb5885 13498 assert app is not None, 'No wx.App created yet'
d14a1e28 13499
148275d3
RD
13500 if not hasattr(app, "_CallAfterId"):
13501 app._CallAfterId = wx.NewEventType()
13502 app.Connect(-1, -1, app._CallAfterId,
13503 lambda event: event.callable(*event.args, **event.kw) )
d14a1e28 13504 evt = wx.PyEvent()
148275d3 13505 evt.SetEventType(app._CallAfterId)
d14a1e28
RD
13506 evt.callable = callable
13507 evt.args = args
13508 evt.kw = kw
13509 wx.PostEvent(app, evt)
13510
d14a1e28
RD
13511#----------------------------------------------------------------------------
13512
13513
846c181b 13514class CallLater:
d14a1e28 13515 """
8ac8dba0 13516 A convenience class for `wx.Timer`, that calls the given callable
d14a1e28
RD
13517 object once after the given amount of milliseconds, passing any
13518 positional or keyword args. The return value of the callable is
61863841 13519 availbale after it has been run with the `GetResult` method.
d14a1e28
RD
13520
13521 If you don't need to get the return value or restart the timer
13522 then there is no need to hold a reference to this object. It will
13523 hold a reference to itself while the timer is running (the timer
13524 has a reference to self.Notify) but the cycle will be broken when
846c181b 13525 the timer completes, automatically cleaning up the wx.CallLater
d14a1e28 13526 object.
61863841
RD
13527
13528 :see: `wx.CallAfter`
d14a1e28
RD
13529 """
13530 def __init__(self, millis, callable, *args, **kwargs):
13531 self.millis = millis
13532 self.callable = callable
13533 self.SetArgs(*args, **kwargs)
13534 self.runCount = 0
4276dc52 13535 self.running = False
d14a1e28
RD
13536 self.hasRun = False
13537 self.result = None
13538 self.timer = None
13539 self.Start()
13540
13541 def __del__(self):
13542 self.Stop()
13543
13544
13545 def Start(self, millis=None, *args, **kwargs):
13546 """
13547 (Re)start the timer
13548 """
13549 self.hasRun = False
13550 if millis is not None:
13551 self.millis = millis
13552 if args or kwargs:
13553 self.SetArgs(*args, **kwargs)
13554 self.Stop()
13555 self.timer = wx.PyTimer(self.Notify)
13556 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
4276dc52 13557 self.running = True
d14a1e28
RD
13558 Restart = Start
13559
13560
13561 def Stop(self):
13562 """
13563 Stop and destroy the timer.
13564 """
13565 if self.timer is not None:
13566 self.timer.Stop()
13567 self.timer = None
13568
13569
13570 def GetInterval(self):
13571 if self.timer is not None:
13572 return self.timer.GetInterval()
13573 else:
13574 return 0
13575
13576
13577 def IsRunning(self):
13578 return self.timer is not None and self.timer.IsRunning()
13579
13580
13581 def SetArgs(self, *args, **kwargs):
13582 """
13583 (Re)set the args passed to the callable object. This is
13584 useful in conjunction with Restart if you want to schedule a
13585 new call to the same callable object but with different
13586 parameters.
13587 """
13588 self.args = args
13589 self.kwargs = kwargs
13590
13591
13592 def HasRun(self):
13593 return self.hasRun
13594
13595 def GetResult(self):
13596 return self.result
13597
13598 def Notify(self):
13599 """
13600 The timer has expired so call the callable.
13601 """
13602 if self.callable and getattr(self.callable, 'im_self', True):
13603 self.runCount += 1
4276dc52 13604 self.running = False
d14a1e28
RD
13605 self.result = self.callable(*self.args, **self.kwargs)
13606 self.hasRun = True
4276dc52
RD
13607 if not self.running:
13608 # if it wasn't restarted, then cleanup
13609 wx.CallAfter(self.Stop)
d14a1e28 13610
97ab0f6a
RD
13611 Interval = property(GetInterval)
13612 Result = property(GetResult)
d14a1e28 13613
a95a7133 13614
846c181b 13615class FutureCall(CallLater):
b39fe951 13616 """A compatibility alias for `CallLater`."""
846c181b 13617
a95a7133
RD
13618#----------------------------------------------------------------------------
13619# Control which items in this module should be documented by epydoc.
13620# We allow only classes and functions, which will help reduce the size
13621# of the docs by filtering out the zillions of constants, EVT objects,
13622# and etc that don't make much sense by themselves, but are instead
13623# documented (or will be) as part of the classes/functions/methods
13624# where they should be used.
13625
66c033b4
RD
13626class __DocFilter:
13627 """
13628 A filter for epydoc that only allows non-Ptr classes and
34e0a3bb 13629 functions, in order to reduce the clutter in the API docs.
66c033b4
RD
13630 """
13631 def __init__(self, globals):
13632 self._globals = globals
13633
13634 def __call__(self, name):
13635 import types
13636 obj = self._globals.get(name, None)
34e0a3bb
RD
13637
13638 # only document classes and function
66c033b4
RD
13639 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13640 return False
34e0a3bb
RD
13641
13642 # skip other things that are private or will be documented as part of somethign else
0085ce49 13643 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
66c033b4 13644 return False
34e0a3bb
RD
13645
13646 # skip functions that are duplicates of static functions in a class
13647 if name.find('_') != -1:
13648 cls = self._globals.get(name.split('_')[0], None)
13649 methname = name.split('_')[1]
13650 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
13651 return False
13652
66c033b4 13653 return True
a95a7133 13654
d14a1e28
RD
13655#----------------------------------------------------------------------------
13656#----------------------------------------------------------------------------
13657
13658# Import other modules in this package that should show up in the
13659# "core" wx namespace
54f9ee45
RD
13660from _gdi import *
13661from _windows import *
13662from _controls import *
13663from _misc import *
d14a1e28
RD
13664
13665#----------------------------------------------------------------------------
13666#----------------------------------------------------------------------------
13667
13668
32fe5131 13669