]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/mac/_core.py
Changes needed for building with Python 2.5
[wxWidgets.git] / wxPython / src / mac / _core.py
CommitLineData
1bd55598 1# This file was created automatically by SWIG 1.3.29.
d55e5bfc
RD
2# Don't modify this file, modify the SWIG interface instead.
3
5b5c9bc7 4import _core_
1bd55598
RD
5import new
6new_instancemethod = new.instancemethod
36ed4f51 7def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
1bd55598 8 if (name == "thisown"): return self.this.own(value)
36ed4f51 9 if (name == "this"):
1bd55598
RD
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
36ed4f51
RD
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
1bd55598 15 if (not static) or hasattr(self,name):
36ed4f51
RD
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
1bd55598 24 if (name == "thisown"): return self.this.own()
36ed4f51
RD
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
1bd55598
RD
29def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
36ed4f51
RD
34import types
35try:
36 _object = types.ObjectType
37 _newclass = 1
38except AttributeError:
39 class _object : pass
40 _newclass = 0
41del types
42
43
44def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
1bd55598
RD
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
36ed4f51
RD
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
d55e5bfc
RD
54#// Give a reference to the dictionary of this module to the C++ extension
55#// code.
56_core_._wxPySetDictionary(vars())
57
58#// A little trick to make 'wx' be a reference to this module so wx.Names can
59#// be used here.
60import sys as _sys
61wx = _sys.modules[__name__]
62
d6c14a4c
RD
63
64#----------------------------------------------------------------------------
65
66def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81#----------------------------------------------------------------------------
82
5b5c9bc7
RD
83NOT_FOUND = _core_.NOT_FOUND
84VSCROLL = _core_.VSCROLL
85HSCROLL = _core_.HSCROLL
86CAPTION = _core_.CAPTION
87DOUBLE_BORDER = _core_.DOUBLE_BORDER
88SUNKEN_BORDER = _core_.SUNKEN_BORDER
89RAISED_BORDER = _core_.RAISED_BORDER
90BORDER = _core_.BORDER
91SIMPLE_BORDER = _core_.SIMPLE_BORDER
92STATIC_BORDER = _core_.STATIC_BORDER
93TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94NO_BORDER = _core_.NO_BORDER
95DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 96DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
5b5c9bc7
RD
97TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98WANTS_CHARS = _core_.WANTS_CHARS
99POPUP_WINDOW = _core_.POPUP_WINDOW
100CENTER_FRAME = _core_.CENTER_FRAME
101CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
103CLIP_CHILDREN = _core_.CLIP_CHILDREN
104CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
092f0ed7 105WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
5b5c9bc7
RD
106ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
107RETAINED = _core_.RETAINED
108BACKINGSTORE = _core_.BACKINGSTORE
109COLOURED = _core_.COLOURED
110FIXED_LENGTH = _core_.FIXED_LENGTH
111LB_NEEDED_SB = _core_.LB_NEEDED_SB
112LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
113LB_SORT = _core_.LB_SORT
114LB_SINGLE = _core_.LB_SINGLE
115LB_MULTIPLE = _core_.LB_MULTIPLE
116LB_EXTENDED = _core_.LB_EXTENDED
117LB_OWNERDRAW = _core_.LB_OWNERDRAW
118LB_HSCROLL = _core_.LB_HSCROLL
119PROCESS_ENTER = _core_.PROCESS_ENTER
120PASSWORD = _core_.PASSWORD
121CB_SIMPLE = _core_.CB_SIMPLE
122CB_DROPDOWN = _core_.CB_DROPDOWN
123CB_SORT = _core_.CB_SORT
124CB_READONLY = _core_.CB_READONLY
125RA_HORIZONTAL = _core_.RA_HORIZONTAL
126RA_VERTICAL = _core_.RA_VERTICAL
127RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
128RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
129RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
130RB_GROUP = _core_.RB_GROUP
131RB_SINGLE = _core_.RB_SINGLE
132SB_HORIZONTAL = _core_.SB_HORIZONTAL
133SB_VERTICAL = _core_.SB_VERTICAL
134RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
135ST_SIZEGRIP = _core_.ST_SIZEGRIP
136ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
e9d6f3a4
RD
137ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
138ST_DOTS_END = _core_.ST_DOTS_END
5b5c9bc7
RD
139FLOOD_SURFACE = _core_.FLOOD_SURFACE
140FLOOD_BORDER = _core_.FLOOD_BORDER
141ODDEVEN_RULE = _core_.ODDEVEN_RULE
142WINDING_RULE = _core_.WINDING_RULE
143TOOL_TOP = _core_.TOOL_TOP
144TOOL_BOTTOM = _core_.TOOL_BOTTOM
145TOOL_LEFT = _core_.TOOL_LEFT
146TOOL_RIGHT = _core_.TOOL_RIGHT
147OK = _core_.OK
148YES_NO = _core_.YES_NO
149CANCEL = _core_.CANCEL
150YES = _core_.YES
151NO = _core_.NO
152NO_DEFAULT = _core_.NO_DEFAULT
153YES_DEFAULT = _core_.YES_DEFAULT
154ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
155ICON_HAND = _core_.ICON_HAND
156ICON_QUESTION = _core_.ICON_QUESTION
157ICON_INFORMATION = _core_.ICON_INFORMATION
158ICON_STOP = _core_.ICON_STOP
159ICON_ASTERISK = _core_.ICON_ASTERISK
160ICON_MASK = _core_.ICON_MASK
161ICON_WARNING = _core_.ICON_WARNING
162ICON_ERROR = _core_.ICON_ERROR
163FORWARD = _core_.FORWARD
164BACKWARD = _core_.BACKWARD
165RESET = _core_.RESET
166HELP = _core_.HELP
167MORE = _core_.MORE
168SETUP = _core_.SETUP
169SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
170SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
171SIZE_AUTO = _core_.SIZE_AUTO
172SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
173SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
943e8dfd 174SIZE_FORCE = _core_.SIZE_FORCE
5b5c9bc7
RD
175PORTRAIT = _core_.PORTRAIT
176LANDSCAPE = _core_.LANDSCAPE
177PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
178PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
179PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
180PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
181ID_ANY = _core_.ID_ANY
182ID_SEPARATOR = _core_.ID_SEPARATOR
943e8dfd 183ID_NONE = _core_.ID_NONE
5b5c9bc7
RD
184ID_LOWEST = _core_.ID_LOWEST
185ID_OPEN = _core_.ID_OPEN
186ID_CLOSE = _core_.ID_CLOSE
187ID_NEW = _core_.ID_NEW
188ID_SAVE = _core_.ID_SAVE
189ID_SAVEAS = _core_.ID_SAVEAS
190ID_REVERT = _core_.ID_REVERT
191ID_EXIT = _core_.ID_EXIT
192ID_UNDO = _core_.ID_UNDO
193ID_REDO = _core_.ID_REDO
194ID_HELP = _core_.ID_HELP
195ID_PRINT = _core_.ID_PRINT
196ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
197ID_PREVIEW = _core_.ID_PREVIEW
198ID_ABOUT = _core_.ID_ABOUT
199ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
200ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
201ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
202ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
203ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
204ID_PREFERENCES = _core_.ID_PREFERENCES
205ID_CUT = _core_.ID_CUT
206ID_COPY = _core_.ID_COPY
207ID_PASTE = _core_.ID_PASTE
208ID_CLEAR = _core_.ID_CLEAR
209ID_FIND = _core_.ID_FIND
210ID_DUPLICATE = _core_.ID_DUPLICATE
211ID_SELECTALL = _core_.ID_SELECTALL
212ID_DELETE = _core_.ID_DELETE
213ID_REPLACE = _core_.ID_REPLACE
214ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
215ID_PROPERTIES = _core_.ID_PROPERTIES
216ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
217ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
218ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
219ID_VIEW_LIST = _core_.ID_VIEW_LIST
220ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
221ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
222ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
223ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
224ID_FILE1 = _core_.ID_FILE1
225ID_FILE2 = _core_.ID_FILE2
226ID_FILE3 = _core_.ID_FILE3
227ID_FILE4 = _core_.ID_FILE4
228ID_FILE5 = _core_.ID_FILE5
229ID_FILE6 = _core_.ID_FILE6
230ID_FILE7 = _core_.ID_FILE7
231ID_FILE8 = _core_.ID_FILE8
232ID_FILE9 = _core_.ID_FILE9
233ID_OK = _core_.ID_OK
234ID_CANCEL = _core_.ID_CANCEL
235ID_APPLY = _core_.ID_APPLY
236ID_YES = _core_.ID_YES
237ID_NO = _core_.ID_NO
238ID_STATIC = _core_.ID_STATIC
239ID_FORWARD = _core_.ID_FORWARD
240ID_BACKWARD = _core_.ID_BACKWARD
241ID_DEFAULT = _core_.ID_DEFAULT
242ID_MORE = _core_.ID_MORE
243ID_SETUP = _core_.ID_SETUP
244ID_RESET = _core_.ID_RESET
245ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
246ID_YESTOALL = _core_.ID_YESTOALL
247ID_NOTOALL = _core_.ID_NOTOALL
248ID_ABORT = _core_.ID_ABORT
249ID_RETRY = _core_.ID_RETRY
250ID_IGNORE = _core_.ID_IGNORE
251ID_ADD = _core_.ID_ADD
252ID_REMOVE = _core_.ID_REMOVE
253ID_UP = _core_.ID_UP
254ID_DOWN = _core_.ID_DOWN
255ID_HOME = _core_.ID_HOME
256ID_REFRESH = _core_.ID_REFRESH
257ID_STOP = _core_.ID_STOP
258ID_INDEX = _core_.ID_INDEX
259ID_BOLD = _core_.ID_BOLD
260ID_ITALIC = _core_.ID_ITALIC
261ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
262ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
263ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
264ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
265ID_UNDERLINE = _core_.ID_UNDERLINE
266ID_INDENT = _core_.ID_INDENT
267ID_UNINDENT = _core_.ID_UNINDENT
268ID_ZOOM_100 = _core_.ID_ZOOM_100
269ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
270ID_ZOOM_IN = _core_.ID_ZOOM_IN
271ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
272ID_UNDELETE = _core_.ID_UNDELETE
273ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
274ID_HIGHEST = _core_.ID_HIGHEST
5b5c9bc7
RD
275ACCEL_ALT = _core_.ACCEL_ALT
276ACCEL_CTRL = _core_.ACCEL_CTRL
277ACCEL_SHIFT = _core_.ACCEL_SHIFT
278ACCEL_NORMAL = _core_.ACCEL_NORMAL
279PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
280PD_APP_MODAL = _core_.PD_APP_MODAL
281PD_CAN_ABORT = _core_.PD_CAN_ABORT
282PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
283PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
284PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
285PD_SMOOTH = _core_.PD_SMOOTH
286PD_CAN_SKIP = _core_.PD_CAN_SKIP
5b5c9bc7
RD
287MENU_TEAROFF = _core_.MENU_TEAROFF
288MB_DOCKABLE = _core_.MB_DOCKABLE
289NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
290FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
291LI_HORIZONTAL = _core_.LI_HORIZONTAL
292LI_VERTICAL = _core_.LI_VERTICAL
293WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
294WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
295WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
296WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
297WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
298WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
299MM_TEXT = _core_.MM_TEXT
300MM_LOMETRIC = _core_.MM_LOMETRIC
301MM_HIMETRIC = _core_.MM_HIMETRIC
302MM_LOENGLISH = _core_.MM_LOENGLISH
303MM_HIENGLISH = _core_.MM_HIENGLISH
304MM_TWIPS = _core_.MM_TWIPS
305MM_ISOTROPIC = _core_.MM_ISOTROPIC
306MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
307MM_POINTS = _core_.MM_POINTS
308MM_METRIC = _core_.MM_METRIC
309CENTRE = _core_.CENTRE
310CENTER = _core_.CENTER
311HORIZONTAL = _core_.HORIZONTAL
312VERTICAL = _core_.VERTICAL
313BOTH = _core_.BOTH
314LEFT = _core_.LEFT
315RIGHT = _core_.RIGHT
316UP = _core_.UP
317DOWN = _core_.DOWN
318TOP = _core_.TOP
319BOTTOM = _core_.BOTTOM
320NORTH = _core_.NORTH
321SOUTH = _core_.SOUTH
322WEST = _core_.WEST
323EAST = _core_.EAST
324ALL = _core_.ALL
325ALIGN_NOT = _core_.ALIGN_NOT
326ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
327ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
328ALIGN_LEFT = _core_.ALIGN_LEFT
329ALIGN_TOP = _core_.ALIGN_TOP
330ALIGN_RIGHT = _core_.ALIGN_RIGHT
331ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
332ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
333ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
334ALIGN_CENTER = _core_.ALIGN_CENTER
335ALIGN_CENTRE = _core_.ALIGN_CENTRE
336ALIGN_MASK = _core_.ALIGN_MASK
337STRETCH_NOT = _core_.STRETCH_NOT
338SHRINK = _core_.SHRINK
339GROW = _core_.GROW
340EXPAND = _core_.EXPAND
341SHAPED = _core_.SHAPED
342FIXED_MINSIZE = _core_.FIXED_MINSIZE
343TILE = _core_.TILE
344ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
345BORDER_DEFAULT = _core_.BORDER_DEFAULT
346BORDER_NONE = _core_.BORDER_NONE
347BORDER_STATIC = _core_.BORDER_STATIC
348BORDER_SIMPLE = _core_.BORDER_SIMPLE
349BORDER_RAISED = _core_.BORDER_RAISED
350BORDER_SUNKEN = _core_.BORDER_SUNKEN
351BORDER_DOUBLE = _core_.BORDER_DOUBLE
352BORDER_MASK = _core_.BORDER_MASK
353BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
354BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
355BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
356DEFAULT = _core_.DEFAULT
357DECORATIVE = _core_.DECORATIVE
358ROMAN = _core_.ROMAN
359SCRIPT = _core_.SCRIPT
360SWISS = _core_.SWISS
361MODERN = _core_.MODERN
362TELETYPE = _core_.TELETYPE
363VARIABLE = _core_.VARIABLE
364FIXED = _core_.FIXED
365NORMAL = _core_.NORMAL
366LIGHT = _core_.LIGHT
367BOLD = _core_.BOLD
368ITALIC = _core_.ITALIC
369SLANT = _core_.SLANT
370SOLID = _core_.SOLID
371DOT = _core_.DOT
372LONG_DASH = _core_.LONG_DASH
373SHORT_DASH = _core_.SHORT_DASH
374DOT_DASH = _core_.DOT_DASH
375USER_DASH = _core_.USER_DASH
376TRANSPARENT = _core_.TRANSPARENT
377STIPPLE = _core_.STIPPLE
d04418a7
RD
378STIPPLE_MASK = _core_.STIPPLE_MASK
379STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
5b5c9bc7
RD
380BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
381CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
382FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
383CROSS_HATCH = _core_.CROSS_HATCH
384HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
385VERTICAL_HATCH = _core_.VERTICAL_HATCH
386JOIN_BEVEL = _core_.JOIN_BEVEL
387JOIN_MITER = _core_.JOIN_MITER
388JOIN_ROUND = _core_.JOIN_ROUND
389CAP_ROUND = _core_.CAP_ROUND
390CAP_PROJECTING = _core_.CAP_PROJECTING
391CAP_BUTT = _core_.CAP_BUTT
392CLEAR = _core_.CLEAR
393XOR = _core_.XOR
394INVERT = _core_.INVERT
395OR_REVERSE = _core_.OR_REVERSE
396AND_REVERSE = _core_.AND_REVERSE
397COPY = _core_.COPY
398AND = _core_.AND
399AND_INVERT = _core_.AND_INVERT
400NO_OP = _core_.NO_OP
401NOR = _core_.NOR
402EQUIV = _core_.EQUIV
403SRC_INVERT = _core_.SRC_INVERT
404OR_INVERT = _core_.OR_INVERT
405NAND = _core_.NAND
406OR = _core_.OR
407SET = _core_.SET
408WXK_BACK = _core_.WXK_BACK
409WXK_TAB = _core_.WXK_TAB
410WXK_RETURN = _core_.WXK_RETURN
411WXK_ESCAPE = _core_.WXK_ESCAPE
412WXK_SPACE = _core_.WXK_SPACE
413WXK_DELETE = _core_.WXK_DELETE
414WXK_START = _core_.WXK_START
415WXK_LBUTTON = _core_.WXK_LBUTTON
416WXK_RBUTTON = _core_.WXK_RBUTTON
417WXK_CANCEL = _core_.WXK_CANCEL
418WXK_MBUTTON = _core_.WXK_MBUTTON
419WXK_CLEAR = _core_.WXK_CLEAR
420WXK_SHIFT = _core_.WXK_SHIFT
421WXK_ALT = _core_.WXK_ALT
422WXK_CONTROL = _core_.WXK_CONTROL
423WXK_MENU = _core_.WXK_MENU
424WXK_PAUSE = _core_.WXK_PAUSE
425WXK_CAPITAL = _core_.WXK_CAPITAL
426WXK_PRIOR = _core_.WXK_PRIOR
427WXK_NEXT = _core_.WXK_NEXT
428WXK_END = _core_.WXK_END
429WXK_HOME = _core_.WXK_HOME
430WXK_LEFT = _core_.WXK_LEFT
431WXK_UP = _core_.WXK_UP
432WXK_RIGHT = _core_.WXK_RIGHT
433WXK_DOWN = _core_.WXK_DOWN
434WXK_SELECT = _core_.WXK_SELECT
435WXK_PRINT = _core_.WXK_PRINT
436WXK_EXECUTE = _core_.WXK_EXECUTE
437WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
438WXK_INSERT = _core_.WXK_INSERT
439WXK_HELP = _core_.WXK_HELP
440WXK_NUMPAD0 = _core_.WXK_NUMPAD0
441WXK_NUMPAD1 = _core_.WXK_NUMPAD1
442WXK_NUMPAD2 = _core_.WXK_NUMPAD2
443WXK_NUMPAD3 = _core_.WXK_NUMPAD3
444WXK_NUMPAD4 = _core_.WXK_NUMPAD4
445WXK_NUMPAD5 = _core_.WXK_NUMPAD5
446WXK_NUMPAD6 = _core_.WXK_NUMPAD6
447WXK_NUMPAD7 = _core_.WXK_NUMPAD7
448WXK_NUMPAD8 = _core_.WXK_NUMPAD8
449WXK_NUMPAD9 = _core_.WXK_NUMPAD9
450WXK_MULTIPLY = _core_.WXK_MULTIPLY
451WXK_ADD = _core_.WXK_ADD
452WXK_SEPARATOR = _core_.WXK_SEPARATOR
453WXK_SUBTRACT = _core_.WXK_SUBTRACT
454WXK_DECIMAL = _core_.WXK_DECIMAL
455WXK_DIVIDE = _core_.WXK_DIVIDE
456WXK_F1 = _core_.WXK_F1
457WXK_F2 = _core_.WXK_F2
458WXK_F3 = _core_.WXK_F3
459WXK_F4 = _core_.WXK_F4
460WXK_F5 = _core_.WXK_F5
461WXK_F6 = _core_.WXK_F6
462WXK_F7 = _core_.WXK_F7
463WXK_F8 = _core_.WXK_F8
464WXK_F9 = _core_.WXK_F9
465WXK_F10 = _core_.WXK_F10
466WXK_F11 = _core_.WXK_F11
467WXK_F12 = _core_.WXK_F12
468WXK_F13 = _core_.WXK_F13
469WXK_F14 = _core_.WXK_F14
470WXK_F15 = _core_.WXK_F15
471WXK_F16 = _core_.WXK_F16
472WXK_F17 = _core_.WXK_F17
473WXK_F18 = _core_.WXK_F18
474WXK_F19 = _core_.WXK_F19
475WXK_F20 = _core_.WXK_F20
476WXK_F21 = _core_.WXK_F21
477WXK_F22 = _core_.WXK_F22
478WXK_F23 = _core_.WXK_F23
479WXK_F24 = _core_.WXK_F24
480WXK_NUMLOCK = _core_.WXK_NUMLOCK
481WXK_SCROLL = _core_.WXK_SCROLL
482WXK_PAGEUP = _core_.WXK_PAGEUP
483WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
484WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
485WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
486WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
487WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
488WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
489WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
490WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
491WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
492WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
493WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
494WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
495WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
496WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
497WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
498WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
499WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
500WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
501WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
502WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
503WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
504WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
505WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
506WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
507WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
508WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
509WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
510WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
511WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
512WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
513WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
514WXK_COMMAND = _core_.WXK_COMMAND
515WXK_SPECIAL1 = _core_.WXK_SPECIAL1
516WXK_SPECIAL2 = _core_.WXK_SPECIAL2
517WXK_SPECIAL3 = _core_.WXK_SPECIAL3
518WXK_SPECIAL4 = _core_.WXK_SPECIAL4
519WXK_SPECIAL5 = _core_.WXK_SPECIAL5
520WXK_SPECIAL6 = _core_.WXK_SPECIAL6
521WXK_SPECIAL7 = _core_.WXK_SPECIAL7
522WXK_SPECIAL8 = _core_.WXK_SPECIAL8
523WXK_SPECIAL9 = _core_.WXK_SPECIAL9
524WXK_SPECIAL10 = _core_.WXK_SPECIAL10
525WXK_SPECIAL11 = _core_.WXK_SPECIAL11
526WXK_SPECIAL12 = _core_.WXK_SPECIAL12
527WXK_SPECIAL13 = _core_.WXK_SPECIAL13
528WXK_SPECIAL14 = _core_.WXK_SPECIAL14
529WXK_SPECIAL15 = _core_.WXK_SPECIAL15
530WXK_SPECIAL16 = _core_.WXK_SPECIAL16
531WXK_SPECIAL17 = _core_.WXK_SPECIAL17
532WXK_SPECIAL18 = _core_.WXK_SPECIAL18
533WXK_SPECIAL19 = _core_.WXK_SPECIAL19
534WXK_SPECIAL20 = _core_.WXK_SPECIAL20
535PAPER_NONE = _core_.PAPER_NONE
536PAPER_LETTER = _core_.PAPER_LETTER
537PAPER_LEGAL = _core_.PAPER_LEGAL
538PAPER_A4 = _core_.PAPER_A4
539PAPER_CSHEET = _core_.PAPER_CSHEET
540PAPER_DSHEET = _core_.PAPER_DSHEET
541PAPER_ESHEET = _core_.PAPER_ESHEET
542PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
543PAPER_TABLOID = _core_.PAPER_TABLOID
544PAPER_LEDGER = _core_.PAPER_LEDGER
545PAPER_STATEMENT = _core_.PAPER_STATEMENT
546PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
547PAPER_A3 = _core_.PAPER_A3
548PAPER_A4SMALL = _core_.PAPER_A4SMALL
549PAPER_A5 = _core_.PAPER_A5
550PAPER_B4 = _core_.PAPER_B4
551PAPER_B5 = _core_.PAPER_B5
552PAPER_FOLIO = _core_.PAPER_FOLIO
553PAPER_QUARTO = _core_.PAPER_QUARTO
554PAPER_10X14 = _core_.PAPER_10X14
555PAPER_11X17 = _core_.PAPER_11X17
556PAPER_NOTE = _core_.PAPER_NOTE
557PAPER_ENV_9 = _core_.PAPER_ENV_9
558PAPER_ENV_10 = _core_.PAPER_ENV_10
559PAPER_ENV_11 = _core_.PAPER_ENV_11
560PAPER_ENV_12 = _core_.PAPER_ENV_12
561PAPER_ENV_14 = _core_.PAPER_ENV_14
562PAPER_ENV_DL = _core_.PAPER_ENV_DL
563PAPER_ENV_C5 = _core_.PAPER_ENV_C5
564PAPER_ENV_C3 = _core_.PAPER_ENV_C3
565PAPER_ENV_C4 = _core_.PAPER_ENV_C4
566PAPER_ENV_C6 = _core_.PAPER_ENV_C6
567PAPER_ENV_C65 = _core_.PAPER_ENV_C65
568PAPER_ENV_B4 = _core_.PAPER_ENV_B4
569PAPER_ENV_B5 = _core_.PAPER_ENV_B5
570PAPER_ENV_B6 = _core_.PAPER_ENV_B6
571PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
572PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
573PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
574PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
575PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
576PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
577PAPER_ISO_B4 = _core_.PAPER_ISO_B4
578PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
579PAPER_9X11 = _core_.PAPER_9X11
580PAPER_10X11 = _core_.PAPER_10X11
581PAPER_15X11 = _core_.PAPER_15X11
582PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
583PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
584PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
585PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
586PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
587PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
588PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
589PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
590PAPER_A_PLUS = _core_.PAPER_A_PLUS
591PAPER_B_PLUS = _core_.PAPER_B_PLUS
592PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
593PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
594PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
595PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
596PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
597PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
598PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
599PAPER_A2 = _core_.PAPER_A2
600PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
601PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
034e3677
RD
602PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
603PAPER_A6 = _core_.PAPER_A6
604PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
605PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
606PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
607PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
608PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
609PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
610PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
611PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
612PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
613PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
614PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
615PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
616PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
617PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
618PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
619PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
620PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
621PAPER_B6_JIS = _core_.PAPER_B6_JIS
622PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
623PAPER_12X11 = _core_.PAPER_12X11
624PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
625PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
626PAPER_P16K = _core_.PAPER_P16K
627PAPER_P32K = _core_.PAPER_P32K
628PAPER_P32KBIG = _core_.PAPER_P32KBIG
629PAPER_PENV_1 = _core_.PAPER_PENV_1
630PAPER_PENV_2 = _core_.PAPER_PENV_2
631PAPER_PENV_3 = _core_.PAPER_PENV_3
632PAPER_PENV_4 = _core_.PAPER_PENV_4
633PAPER_PENV_5 = _core_.PAPER_PENV_5
634PAPER_PENV_6 = _core_.PAPER_PENV_6
635PAPER_PENV_7 = _core_.PAPER_PENV_7
636PAPER_PENV_8 = _core_.PAPER_PENV_8
637PAPER_PENV_9 = _core_.PAPER_PENV_9
638PAPER_PENV_10 = _core_.PAPER_PENV_10
639PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
640PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
641PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
642PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
643PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
644PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
645PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
646PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
647PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
648PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
649PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
650PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
651PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
5b5c9bc7
RD
652DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
653DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
654DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
655ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
656ITEM_NORMAL = _core_.ITEM_NORMAL
657ITEM_CHECK = _core_.ITEM_CHECK
658ITEM_RADIO = _core_.ITEM_RADIO
659ITEM_MAX = _core_.ITEM_MAX
660HT_NOWHERE = _core_.HT_NOWHERE
661HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
662HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
663HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
664HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
665HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
666HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
667HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
668HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
669HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
670HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
671HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
672HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
673HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
674HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
675HT_MAX = _core_.HT_MAX
676MOD_NONE = _core_.MOD_NONE
677MOD_ALT = _core_.MOD_ALT
678MOD_CONTROL = _core_.MOD_CONTROL
943e8dfd 679MOD_ALTGR = _core_.MOD_ALTGR
5b5c9bc7 680MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 681MOD_META = _core_.MOD_META
5b5c9bc7 682MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
683MOD_CMD = _core_.MOD_CMD
684MOD_ALL = _core_.MOD_ALL
5b5c9bc7
RD
685UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
686UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
687UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d55e5bfc
RD
688#---------------------------------------------------------------------------
689
5b5c9bc7 690class Object(object):
d55e5bfc
RD
691 """
692 The base class for most wx objects, although in wxPython not
693 much functionality is needed nor exposed.
694 """
1bd55598
RD
695 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
696 def __init__(self): raise AttributeError, "No constructor defined"
697 __repr__ = _swig_repr
d55e5bfc
RD
698 def GetClassName(*args, **kwargs):
699 """
5b5c9bc7 700 GetClassName(self) -> String
d55e5bfc
RD
701
702 Returns the class name of the C++ class using wxRTTI.
703 """
5b5c9bc7 704 return _core_.Object_GetClassName(*args, **kwargs)
d55e5bfc
RD
705
706 def Destroy(*args, **kwargs):
707 """
708 Destroy(self)
709
710 Deletes the C++ object this Python object is a proxy for.
711 """
7e08d4ef
RD
712 val = _core_.Object_Destroy(*args, **kwargs)
713 args[0].thisown = 0
714 return val
d55e5bfc 715
2131d850 716_core_.Object_swigregister(Object)
5b5c9bc7 717_wxPySetDictionary = _core_._wxPySetDictionary
5b5c9bc7 718cvar = _core_.cvar
d55e5bfc
RD
719EmptyString = cvar.EmptyString
720
721#---------------------------------------------------------------------------
722
5b5c9bc7
RD
723BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
724BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
725BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
726BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
727BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
728BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
729BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
730BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
731BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
732BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
733BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
734BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
735BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
736BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
737BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
738BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
739BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
740BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
741BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
742BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
743CURSOR_NONE = _core_.CURSOR_NONE
744CURSOR_ARROW = _core_.CURSOR_ARROW
745CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
746CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
747CURSOR_CHAR = _core_.CURSOR_CHAR
748CURSOR_CROSS = _core_.CURSOR_CROSS
749CURSOR_HAND = _core_.CURSOR_HAND
750CURSOR_IBEAM = _core_.CURSOR_IBEAM
751CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
752CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
753CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
754CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
755CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
756CURSOR_PENCIL = _core_.CURSOR_PENCIL
757CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
758CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
759CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
760CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
761CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
762CURSOR_SIZENS = _core_.CURSOR_SIZENS
763CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
764CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
765CURSOR_SIZING = _core_.CURSOR_SIZING
766CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
767CURSOR_WAIT = _core_.CURSOR_WAIT
768CURSOR_WATCH = _core_.CURSOR_WATCH
769CURSOR_BLANK = _core_.CURSOR_BLANK
770CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
771CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
772CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
773CURSOR_MAX = _core_.CURSOR_MAX
d55e5bfc
RD
774#---------------------------------------------------------------------------
775
5b5c9bc7 776class Size(object):
d55e5bfc 777 """
15817c7e 778 wx.Size is a useful data structure used to represent the size of
1bd55598
RD
779 something. It simply contains integer width and height
780 properties. In most places in wxPython where a wx.Size is
36ed4f51 781 expected a (width, height) tuple can be used instead.
d55e5bfc 782 """
1bd55598
RD
783 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
784 __repr__ = _swig_repr
5b5c9bc7
RD
785 width = property(_core_.Size_width_get, _core_.Size_width_set)
786 height = property(_core_.Size_height_get, _core_.Size_height_set)
d55e5bfc 787 x = width; y = height
1bd55598 788 def __init__(self, *args, **kwargs):
d55e5bfc 789 """
5b5c9bc7 790 __init__(self, int w=0, int h=0) -> Size
d55e5bfc
RD
791
792 Creates a size object.
793 """
1bd55598
RD
794 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
795 __swig_destroy__ = _core_.delete_Size
796 __del__ = lambda self : None;
d55e5bfc
RD
797 def __eq__(*args, **kwargs):
798 """
e9d6f3a4 799 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
800
801 Test for equality of wx.Size objects.
802 """
5b5c9bc7 803 return _core_.Size___eq__(*args, **kwargs)
d55e5bfc
RD
804
805 def __ne__(*args, **kwargs):
806 """
e9d6f3a4 807 __ne__(self, PyObject other) -> bool
d55e5bfc 808
e9d6f3a4 809 Test for inequality of wx.Size objects.
d55e5bfc 810 """
5b5c9bc7 811 return _core_.Size___ne__(*args, **kwargs)
d55e5bfc
RD
812
813 def __add__(*args, **kwargs):
814 """
5b5c9bc7 815 __add__(self, Size sz) -> Size
d55e5bfc
RD
816
817 Add sz's proprties to this and return the result.
818 """
5b5c9bc7 819 return _core_.Size___add__(*args, **kwargs)
d55e5bfc
RD
820
821 def __sub__(*args, **kwargs):
822 """
5b5c9bc7 823 __sub__(self, Size sz) -> Size
d55e5bfc
RD
824
825 Subtract sz's properties from this and return the result.
826 """
5b5c9bc7 827 return _core_.Size___sub__(*args, **kwargs)
d55e5bfc
RD
828
829 def IncTo(*args, **kwargs):
830 """
5b5c9bc7 831 IncTo(self, Size sz)
d55e5bfc
RD
832
833 Increments this object so that both of its dimensions are not less
834 than the corresponding dimensions of the size.
835 """
5b5c9bc7 836 return _core_.Size_IncTo(*args, **kwargs)
d55e5bfc
RD
837
838 def DecTo(*args, **kwargs):
839 """
5b5c9bc7 840 DecTo(self, Size sz)
d55e5bfc
RD
841
842 Decrements this object so that both of its dimensions are not greater
843 than the corresponding dimensions of the size.
844 """
5b5c9bc7 845 return _core_.Size_DecTo(*args, **kwargs)
d55e5bfc
RD
846
847 def Set(*args, **kwargs):
848 """
849 Set(self, int w, int h)
850
851 Set both width and height.
852 """
5b5c9bc7 853 return _core_.Size_Set(*args, **kwargs)
d55e5bfc
RD
854
855 def SetWidth(*args, **kwargs):
856 """SetWidth(self, int w)"""
5b5c9bc7 857 return _core_.Size_SetWidth(*args, **kwargs)
d55e5bfc
RD
858
859 def SetHeight(*args, **kwargs):
860 """SetHeight(self, int h)"""
5b5c9bc7 861 return _core_.Size_SetHeight(*args, **kwargs)
d55e5bfc
RD
862
863 def GetWidth(*args, **kwargs):
864 """GetWidth(self) -> int"""
5b5c9bc7 865 return _core_.Size_GetWidth(*args, **kwargs)
d55e5bfc
RD
866
867 def GetHeight(*args, **kwargs):
868 """GetHeight(self) -> int"""
5b5c9bc7 869 return _core_.Size_GetHeight(*args, **kwargs)
d55e5bfc
RD
870
871 def IsFullySpecified(*args, **kwargs):
872 """
873 IsFullySpecified(self) -> bool
874
875 Returns True if both components of the size are non-default values.
876 """
5b5c9bc7 877 return _core_.Size_IsFullySpecified(*args, **kwargs)
d55e5bfc
RD
878
879 def SetDefaults(*args, **kwargs):
880 """
5b5c9bc7 881 SetDefaults(self, Size size)
d55e5bfc 882
15817c7e
RD
883 Combine this size with the other one replacing the default components
884 of this object (i.e. equal to -1) with those of the other.
d55e5bfc 885 """
5b5c9bc7 886 return _core_.Size_SetDefaults(*args, **kwargs)
d55e5bfc
RD
887
888 def Get(*args, **kwargs):
889 """
890 Get() -> (width,height)
891
892 Returns the width and height properties as a tuple.
893 """
5b5c9bc7 894 return _core_.Size_Get(*args, **kwargs)
d55e5bfc 895
15817c7e 896 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
897 def __str__(self): return str(self.Get())
898 def __repr__(self): return 'wx.Size'+str(self.Get())
899 def __len__(self): return len(self.Get())
900 def __getitem__(self, index): return self.Get()[index]
901 def __setitem__(self, index, val):
902 if index == 0: self.width = val
903 elif index == 1: self.height = val
904 else: raise IndexError
905 def __nonzero__(self): return self.Get() != (0,0)
906 __safe_for_unpickling__ = True
907 def __reduce__(self): return (wx.Size, self.Get())
908
2131d850 909_core_.Size_swigregister(Size)
d55e5bfc
RD
910
911#---------------------------------------------------------------------------
912
5b5c9bc7 913class RealPoint(object):
d55e5bfc 914 """
15817c7e
RD
915 A data structure for representing a point or position with floating
916 point x and y properties. In wxPython most places that expect a
917 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc 918 """
1bd55598
RD
919 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
920 __repr__ = _swig_repr
5b5c9bc7
RD
921 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
922 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
1bd55598 923 def __init__(self, *args, **kwargs):
d55e5bfc 924 """
5b5c9bc7 925 __init__(self, double x=0.0, double y=0.0) -> RealPoint
d55e5bfc
RD
926
927 Create a wx.RealPoint object
928 """
1bd55598
RD
929 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
930 __swig_destroy__ = _core_.delete_RealPoint
931 __del__ = lambda self : None;
d55e5bfc
RD
932 def __eq__(*args, **kwargs):
933 """
e9d6f3a4 934 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
935
936 Test for equality of wx.RealPoint objects.
937 """
5b5c9bc7 938 return _core_.RealPoint___eq__(*args, **kwargs)
d55e5bfc
RD
939
940 def __ne__(*args, **kwargs):
941 """
e9d6f3a4 942 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
943
944 Test for inequality of wx.RealPoint objects.
945 """
5b5c9bc7 946 return _core_.RealPoint___ne__(*args, **kwargs)
d55e5bfc
RD
947
948 def __add__(*args, **kwargs):
949 """
5b5c9bc7 950 __add__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
951
952 Add pt's proprties to this and return the result.
953 """
5b5c9bc7 954 return _core_.RealPoint___add__(*args, **kwargs)
d55e5bfc
RD
955
956 def __sub__(*args, **kwargs):
957 """
5b5c9bc7 958 __sub__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
959
960 Subtract pt's proprties from this and return the result
961 """
5b5c9bc7 962 return _core_.RealPoint___sub__(*args, **kwargs)
d55e5bfc
RD
963
964 def Set(*args, **kwargs):
965 """
966 Set(self, double x, double y)
967
968 Set both the x and y properties
969 """
5b5c9bc7 970 return _core_.RealPoint_Set(*args, **kwargs)
d55e5bfc
RD
971
972 def Get(*args, **kwargs):
973 """
974 Get() -> (x,y)
975
976 Return the x and y properties as a tuple.
977 """
5b5c9bc7 978 return _core_.RealPoint_Get(*args, **kwargs)
d55e5bfc 979
15817c7e 980 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
981 def __str__(self): return str(self.Get())
982 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
983 def __len__(self): return len(self.Get())
984 def __getitem__(self, index): return self.Get()[index]
985 def __setitem__(self, index, val):
986 if index == 0: self.x = val
987 elif index == 1: self.y = val
988 else: raise IndexError
989 def __nonzero__(self): return self.Get() != (0.0, 0.0)
990 __safe_for_unpickling__ = True
991 def __reduce__(self): return (wx.RealPoint, self.Get())
992
2131d850 993_core_.RealPoint_swigregister(RealPoint)
d55e5bfc
RD
994
995#---------------------------------------------------------------------------
996
5b5c9bc7 997class Point(object):
d55e5bfc 998 """
15817c7e
RD
999 A data structure for representing a point or position with integer x
1000 and y properties. Most places in wxPython that expect a wx.Point can
1001 also accept a (x,y) tuple.
d55e5bfc 1002 """
1bd55598
RD
1003 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1004 __repr__ = _swig_repr
5b5c9bc7
RD
1005 x = property(_core_.Point_x_get, _core_.Point_x_set)
1006 y = property(_core_.Point_y_get, _core_.Point_y_set)
1bd55598 1007 def __init__(self, *args, **kwargs):
d55e5bfc 1008 """
5b5c9bc7 1009 __init__(self, int x=0, int y=0) -> Point
d55e5bfc
RD
1010
1011 Create a wx.Point object
1012 """
1bd55598
RD
1013 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1014 __swig_destroy__ = _core_.delete_Point
1015 __del__ = lambda self : None;
d55e5bfc
RD
1016 def __eq__(*args, **kwargs):
1017 """
e9d6f3a4 1018 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
1019
1020 Test for equality of wx.Point objects.
1021 """
5b5c9bc7 1022 return _core_.Point___eq__(*args, **kwargs)
d55e5bfc
RD
1023
1024 def __ne__(*args, **kwargs):
1025 """
e9d6f3a4 1026 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
1027
1028 Test for inequality of wx.Point objects.
1029 """
5b5c9bc7 1030 return _core_.Point___ne__(*args, **kwargs)
d55e5bfc
RD
1031
1032 def __add__(*args, **kwargs):
1033 """
5b5c9bc7 1034 __add__(self, Point pt) -> Point
d55e5bfc
RD
1035
1036 Add pt's proprties to this and return the result.
1037 """
5b5c9bc7 1038 return _core_.Point___add__(*args, **kwargs)
d55e5bfc
RD
1039
1040 def __sub__(*args, **kwargs):
1041 """
5b5c9bc7 1042 __sub__(self, Point pt) -> Point
d55e5bfc
RD
1043
1044 Subtract pt's proprties from this and return the result
1045 """
5b5c9bc7 1046 return _core_.Point___sub__(*args, **kwargs)
d55e5bfc
RD
1047
1048 def __iadd__(*args, **kwargs):
1049 """
5b5c9bc7 1050 __iadd__(self, Point pt) -> Point
d55e5bfc
RD
1051
1052 Add pt to this object.
1053 """
5b5c9bc7 1054 return _core_.Point___iadd__(*args, **kwargs)
d55e5bfc
RD
1055
1056 def __isub__(*args, **kwargs):
1057 """
5b5c9bc7 1058 __isub__(self, Point pt) -> Point
d55e5bfc
RD
1059
1060 Subtract pt from this object.
1061 """
5b5c9bc7 1062 return _core_.Point___isub__(*args, **kwargs)
d55e5bfc
RD
1063
1064 def Set(*args, **kwargs):
1065 """
1066 Set(self, long x, long y)
1067
1068 Set both the x and y properties
1069 """
5b5c9bc7 1070 return _core_.Point_Set(*args, **kwargs)
d55e5bfc
RD
1071
1072 def Get(*args, **kwargs):
1073 """
1074 Get() -> (x,y)
1075
1076 Return the x and y properties as a tuple.
1077 """
5b5c9bc7 1078 return _core_.Point_Get(*args, **kwargs)
d55e5bfc 1079
15817c7e 1080 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1081 def __str__(self): return str(self.Get())
1082 def __repr__(self): return 'wx.Point'+str(self.Get())
1083 def __len__(self): return len(self.Get())
1084 def __getitem__(self, index): return self.Get()[index]
1085 def __setitem__(self, index, val):
1086 if index == 0: self.x = val
1087 elif index == 1: self.y = val
1088 else: raise IndexError
1089 def __nonzero__(self): return self.Get() != (0,0)
1090 __safe_for_unpickling__ = True
1091 def __reduce__(self): return (wx.Point, self.Get())
1092
2131d850 1093_core_.Point_swigregister(Point)
d55e5bfc
RD
1094
1095#---------------------------------------------------------------------------
1096
5b5c9bc7 1097class Rect(object):
d55e5bfc 1098 """
15817c7e
RD
1099 A class for representing and manipulating rectangles. It has x, y,
1100 width and height properties. In wxPython most palces that expect a
1101 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc 1102 """
1bd55598
RD
1103 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1104 __repr__ = _swig_repr
1105 def __init__(self, *args, **kwargs):
d55e5bfc 1106 """
5b5c9bc7 1107 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
d55e5bfc
RD
1108
1109 Create a new Rect object.
1110 """
1bd55598
RD
1111 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1112 __swig_destroy__ = _core_.delete_Rect
1113 __del__ = lambda self : None;
d55e5bfc
RD
1114 def GetX(*args, **kwargs):
1115 """GetX(self) -> int"""
5b5c9bc7 1116 return _core_.Rect_GetX(*args, **kwargs)
d55e5bfc
RD
1117
1118 def SetX(*args, **kwargs):
1119 """SetX(self, int x)"""
5b5c9bc7 1120 return _core_.Rect_SetX(*args, **kwargs)
d55e5bfc
RD
1121
1122 def GetY(*args, **kwargs):
1123 """GetY(self) -> int"""
5b5c9bc7 1124 return _core_.Rect_GetY(*args, **kwargs)
d55e5bfc
RD
1125
1126 def SetY(*args, **kwargs):
1127 """SetY(self, int y)"""
5b5c9bc7 1128 return _core_.Rect_SetY(*args, **kwargs)
d55e5bfc
RD
1129
1130 def GetWidth(*args, **kwargs):
1131 """GetWidth(self) -> int"""
5b5c9bc7 1132 return _core_.Rect_GetWidth(*args, **kwargs)
d55e5bfc
RD
1133
1134 def SetWidth(*args, **kwargs):
1135 """SetWidth(self, int w)"""
5b5c9bc7 1136 return _core_.Rect_SetWidth(*args, **kwargs)
d55e5bfc
RD
1137
1138 def GetHeight(*args, **kwargs):
1139 """GetHeight(self) -> int"""
5b5c9bc7 1140 return _core_.Rect_GetHeight(*args, **kwargs)
d55e5bfc
RD
1141
1142 def SetHeight(*args, **kwargs):
1143 """SetHeight(self, int h)"""
5b5c9bc7 1144 return _core_.Rect_SetHeight(*args, **kwargs)
d55e5bfc
RD
1145
1146 def GetPosition(*args, **kwargs):
5b5c9bc7
RD
1147 """GetPosition(self) -> Point"""
1148 return _core_.Rect_GetPosition(*args, **kwargs)
d55e5bfc
RD
1149
1150 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
1151 """SetPosition(self, Point p)"""
1152 return _core_.Rect_SetPosition(*args, **kwargs)
d55e5bfc
RD
1153
1154 def GetSize(*args, **kwargs):
5b5c9bc7
RD
1155 """GetSize(self) -> Size"""
1156 return _core_.Rect_GetSize(*args, **kwargs)
d55e5bfc
RD
1157
1158 def SetSize(*args, **kwargs):
5b5c9bc7
RD
1159 """SetSize(self, Size s)"""
1160 return _core_.Rect_SetSize(*args, **kwargs)
d55e5bfc 1161
aff4cc5c
RD
1162 def IsEmpty(*args, **kwargs):
1163 """IsEmpty(self) -> bool"""
5b5c9bc7 1164 return _core_.Rect_IsEmpty(*args, **kwargs)
aff4cc5c 1165
d55e5bfc 1166 def GetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1167 """GetTopLeft(self) -> Point"""
1168 return _core_.Rect_GetTopLeft(*args, **kwargs)
d55e5bfc
RD
1169
1170 def SetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1171 """SetTopLeft(self, Point p)"""
1172 return _core_.Rect_SetTopLeft(*args, **kwargs)
d55e5bfc
RD
1173
1174 def GetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1175 """GetBottomRight(self) -> Point"""
1176 return _core_.Rect_GetBottomRight(*args, **kwargs)
d55e5bfc
RD
1177
1178 def SetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1179 """SetBottomRight(self, Point p)"""
1180 return _core_.Rect_SetBottomRight(*args, **kwargs)
d55e5bfc
RD
1181
1182 def GetLeft(*args, **kwargs):
1183 """GetLeft(self) -> int"""
5b5c9bc7 1184 return _core_.Rect_GetLeft(*args, **kwargs)
d55e5bfc
RD
1185
1186 def GetTop(*args, **kwargs):
1187 """GetTop(self) -> int"""
5b5c9bc7 1188 return _core_.Rect_GetTop(*args, **kwargs)
d55e5bfc
RD
1189
1190 def GetBottom(*args, **kwargs):
1191 """GetBottom(self) -> int"""
5b5c9bc7 1192 return _core_.Rect_GetBottom(*args, **kwargs)
d55e5bfc
RD
1193
1194 def GetRight(*args, **kwargs):
1195 """GetRight(self) -> int"""
5b5c9bc7 1196 return _core_.Rect_GetRight(*args, **kwargs)
d55e5bfc
RD
1197
1198 def SetLeft(*args, **kwargs):
1199 """SetLeft(self, int left)"""
5b5c9bc7 1200 return _core_.Rect_SetLeft(*args, **kwargs)
d55e5bfc
RD
1201
1202 def SetRight(*args, **kwargs):
1203 """SetRight(self, int right)"""
5b5c9bc7 1204 return _core_.Rect_SetRight(*args, **kwargs)
d55e5bfc
RD
1205
1206 def SetTop(*args, **kwargs):
1207 """SetTop(self, int top)"""
5b5c9bc7 1208 return _core_.Rect_SetTop(*args, **kwargs)
d55e5bfc
RD
1209
1210 def SetBottom(*args, **kwargs):
1211 """SetBottom(self, int bottom)"""
5b5c9bc7 1212 return _core_.Rect_SetBottom(*args, **kwargs)
d55e5bfc
RD
1213
1214 position = property(GetPosition, SetPosition)
1215 size = property(GetSize, SetSize)
1216 left = property(GetLeft, SetLeft)
1217 right = property(GetRight, SetRight)
1218 top = property(GetTop, SetTop)
1219 bottom = property(GetBottom, SetBottom)
1220
1221 def Inflate(*args, **kwargs):
1222 """
5b5c9bc7 1223 Inflate(self, int dx, int dy) -> Rect
d55e5bfc 1224
091fdbfa
RD
1225 Increases the size of the rectangle.
1226
1227 The left border is moved farther left and the right border is moved
1228 farther right by ``dx``. The upper border is moved farther up and the
1229 bottom border is moved farther down by ``dy``. (Note the the width and
1230 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1231 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1232 opposite happens: the rectangle size decreases in the respective
1233 direction.
1234
1235 The change is made to the rectangle inplace, if instead you need a
1236 copy that is inflated, preserving the original then make the copy
1237 first::
1238
1239 copy = wx.Rect(*original)
1240 copy.Inflate(10,15)
1241
1242
d55e5bfc 1243 """
5b5c9bc7 1244 return _core_.Rect_Inflate(*args, **kwargs)
d55e5bfc
RD
1245
1246 def Deflate(*args, **kwargs):
1247 """
5b5c9bc7 1248 Deflate(self, int dx, int dy) -> Rect
d55e5bfc 1249
091fdbfa
RD
1250 Decrease the rectangle size. This method is the opposite of `Inflate`
1251 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1252 `Inflate` for a full description.
d55e5bfc 1253 """
5b5c9bc7 1254 return _core_.Rect_Deflate(*args, **kwargs)
d55e5bfc
RD
1255
1256 def OffsetXY(*args, **kwargs):
1257 """
1258 OffsetXY(self, int dx, int dy)
1259
15817c7e
RD
1260 Moves the rectangle by the specified offset. If dx is positive, the
1261 rectangle is moved to the right, if dy is positive, it is moved to the
1262 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc 1263 """
5b5c9bc7 1264 return _core_.Rect_OffsetXY(*args, **kwargs)
d55e5bfc
RD
1265
1266 def Offset(*args, **kwargs):
1267 """
5b5c9bc7 1268 Offset(self, Point pt)
d55e5bfc 1269
b1fcee84 1270 Same as `OffsetXY` but uses dx,dy from Point
d55e5bfc 1271 """
5b5c9bc7 1272 return _core_.Rect_Offset(*args, **kwargs)
d55e5bfc
RD
1273
1274 def Intersect(*args, **kwargs):
1275 """
5b5c9bc7 1276 Intersect(self, Rect rect) -> Rect
d55e5bfc 1277
5cbf236d 1278 Returns the intersectsion of this rectangle and rect.
d55e5bfc 1279 """
5b5c9bc7 1280 return _core_.Rect_Intersect(*args, **kwargs)
d55e5bfc 1281
5cbf236d
RD
1282 def Union(*args, **kwargs):
1283 """
5b5c9bc7 1284 Union(self, Rect rect) -> Rect
5cbf236d
RD
1285
1286 Returns the union of this rectangle and rect.
1287 """
5b5c9bc7 1288 return _core_.Rect_Union(*args, **kwargs)
5cbf236d 1289
d55e5bfc
RD
1290 def __add__(*args, **kwargs):
1291 """
5b5c9bc7 1292 __add__(self, Rect rect) -> Rect
d55e5bfc
RD
1293
1294 Add the properties of rect to this rectangle and return the result.
1295 """
5b5c9bc7 1296 return _core_.Rect___add__(*args, **kwargs)
d55e5bfc
RD
1297
1298 def __iadd__(*args, **kwargs):
1299 """
5b5c9bc7 1300 __iadd__(self, Rect rect) -> Rect
d55e5bfc
RD
1301
1302 Add the properties of rect to this rectangle, updating this rectangle.
1303 """
5b5c9bc7 1304 return _core_.Rect___iadd__(*args, **kwargs)
d55e5bfc
RD
1305
1306 def __eq__(*args, **kwargs):
1307 """
e9d6f3a4 1308 __eq__(self, PyObject other) -> bool
d55e5bfc 1309
e9d6f3a4 1310 Test for equality of wx.Rect objects.
d55e5bfc 1311 """
5b5c9bc7 1312 return _core_.Rect___eq__(*args, **kwargs)
d55e5bfc
RD
1313
1314 def __ne__(*args, **kwargs):
1315 """
e9d6f3a4 1316 __ne__(self, PyObject other) -> bool
d55e5bfc 1317
e9d6f3a4 1318 Test for inequality of wx.Rect objects.
d55e5bfc 1319 """
5b5c9bc7 1320 return _core_.Rect___ne__(*args, **kwargs)
d55e5bfc
RD
1321
1322 def InsideXY(*args, **kwargs):
1323 """
1324 InsideXY(self, int x, int y) -> bool
1325
1326 Return True if the point is (not strcitly) inside the rect.
1327 """
5b5c9bc7 1328 return _core_.Rect_InsideXY(*args, **kwargs)
d55e5bfc
RD
1329
1330 def Inside(*args, **kwargs):
1331 """
5b5c9bc7 1332 Inside(self, Point pt) -> bool
d55e5bfc
RD
1333
1334 Return True if the point is (not strcitly) inside the rect.
1335 """
5b5c9bc7 1336 return _core_.Rect_Inside(*args, **kwargs)
d55e5bfc
RD
1337
1338 def Intersects(*args, **kwargs):
1339 """
5b5c9bc7 1340 Intersects(self, Rect rect) -> bool
d55e5bfc
RD
1341
1342 Returns True if the rectangles have a non empty intersection.
1343 """
5b5c9bc7 1344 return _core_.Rect_Intersects(*args, **kwargs)
d55e5bfc 1345
b1fcee84
RD
1346 def CenterIn(*args, **kwargs):
1347 """
1348 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1349
1350 Center this rectangle within the one passed to the method, which is
1351 usually, but not necessarily, the larger one.
1352 """
1353 return _core_.Rect_CenterIn(*args, **kwargs)
1354
1355 CentreIn = CenterIn
5b5c9bc7
RD
1356 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1357 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1358 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1359 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
d55e5bfc
RD
1360 def Set(*args, **kwargs):
1361 """
1362 Set(self, int x=0, int y=0, int width=0, int height=0)
1363
1364 Set all rectangle properties.
1365 """
5b5c9bc7 1366 return _core_.Rect_Set(*args, **kwargs)
d55e5bfc
RD
1367
1368 def Get(*args, **kwargs):
1369 """
1370 Get() -> (x,y,width,height)
1371
1372 Return the rectangle properties as a tuple.
1373 """
5b5c9bc7 1374 return _core_.Rect_Get(*args, **kwargs)
d55e5bfc 1375
15817c7e 1376 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1377 def __str__(self): return str(self.Get())
1378 def __repr__(self): return 'wx.Rect'+str(self.Get())
1379 def __len__(self): return len(self.Get())
1380 def __getitem__(self, index): return self.Get()[index]
1381 def __setitem__(self, index, val):
1382 if index == 0: self.x = val
1383 elif index == 1: self.y = val
1384 elif index == 2: self.width = val
1385 elif index == 3: self.height = val
1386 else: raise IndexError
1387 def __nonzero__(self): return self.Get() != (0,0,0,0)
1388 __safe_for_unpickling__ = True
1389 def __reduce__(self): return (wx.Rect, self.Get())
1390
2131d850 1391_core_.Rect_swigregister(Rect)
d55e5bfc
RD
1392
1393def RectPP(*args, **kwargs):
1394 """
5b5c9bc7 1395 RectPP(Point topLeft, Point bottomRight) -> Rect
d55e5bfc
RD
1396
1397 Create a new Rect object from Points representing two corners.
1398 """
5b5c9bc7 1399 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1400 return val
1401
1402def RectPS(*args, **kwargs):
1403 """
5b5c9bc7 1404 RectPS(Point pos, Size size) -> Rect
d55e5bfc
RD
1405
1406 Create a new Rect from a position and size.
1407 """
5b5c9bc7 1408 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1409 return val
1410
070c48b4
RD
1411def RectS(*args, **kwargs):
1412 """
5b5c9bc7 1413 RectS(Size size) -> Rect
070c48b4
RD
1414
1415 Create a new Rect from a size only.
1416 """
5b5c9bc7 1417 val = _core_.new_RectS(*args, **kwargs)
070c48b4
RD
1418 return val
1419
d55e5bfc 1420
5b5c9bc7 1421def IntersectRect(*args, **kwargs):
1bd55598 1422 """
d55e5bfc
RD
1423 IntersectRect(Rect r1, Rect r2) -> Rect
1424
1425 Calculate and return the intersection of r1 and r2.
1426 """
1bd55598 1427 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1428#---------------------------------------------------------------------------
1429
5b5c9bc7 1430class Point2D(object):
15817c7e
RD
1431 """
1432 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1433 with floating point values.
1434 """
1bd55598
RD
1435 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1436 __repr__ = _swig_repr
1437 def __init__(self, *args, **kwargs):
d55e5bfc 1438 """
5b5c9bc7 1439 __init__(self, double x=0.0, double y=0.0) -> Point2D
d55e5bfc
RD
1440
1441 Create a w.Point2D object.
1442 """
1bd55598 1443 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
d55e5bfc 1444 def GetFloor(*args, **kwargs):
fd2dc343
RD
1445 """
1446 GetFloor() -> (x,y)
1447
1448 Convert to integer
1449 """
5b5c9bc7 1450 return _core_.Point2D_GetFloor(*args, **kwargs)
d55e5bfc
RD
1451
1452 def GetRounded(*args, **kwargs):
fd2dc343
RD
1453 """
1454 GetRounded() -> (x,y)
1455
1456 Convert to integer
1457 """
5b5c9bc7 1458 return _core_.Point2D_GetRounded(*args, **kwargs)
d55e5bfc
RD
1459
1460 def GetVectorLength(*args, **kwargs):
1461 """GetVectorLength(self) -> double"""
5b5c9bc7 1462 return _core_.Point2D_GetVectorLength(*args, **kwargs)
d55e5bfc
RD
1463
1464 def GetVectorAngle(*args, **kwargs):
1465 """GetVectorAngle(self) -> double"""
5b5c9bc7 1466 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1467
1468 def SetVectorLength(*args, **kwargs):
1469 """SetVectorLength(self, double length)"""
5b5c9bc7 1470 return _core_.Point2D_SetVectorLength(*args, **kwargs)
d55e5bfc
RD
1471
1472 def SetVectorAngle(*args, **kwargs):
1473 """SetVectorAngle(self, double degrees)"""
5b5c9bc7 1474 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1475
1476 def SetPolarCoordinates(self, angle, length):
1477 self.SetVectorLength(length)
1478 self.SetVectorAngle(angle)
1479 def Normalize(self):
1480 self.SetVectorLength(1.0)
1481
1482 def GetDistance(*args, **kwargs):
5b5c9bc7
RD
1483 """GetDistance(self, Point2D pt) -> double"""
1484 return _core_.Point2D_GetDistance(*args, **kwargs)
d55e5bfc
RD
1485
1486 def GetDistanceSquare(*args, **kwargs):
5b5c9bc7
RD
1487 """GetDistanceSquare(self, Point2D pt) -> double"""
1488 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
d55e5bfc
RD
1489
1490 def GetDotProduct(*args, **kwargs):
5b5c9bc7
RD
1491 """GetDotProduct(self, Point2D vec) -> double"""
1492 return _core_.Point2D_GetDotProduct(*args, **kwargs)
d55e5bfc
RD
1493
1494 def GetCrossProduct(*args, **kwargs):
5b5c9bc7
RD
1495 """GetCrossProduct(self, Point2D vec) -> double"""
1496 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
d55e5bfc
RD
1497
1498 def __neg__(*args, **kwargs):
1499 """
5b5c9bc7 1500 __neg__(self) -> Point2D
d55e5bfc
RD
1501
1502 the reflection of this point
1503 """
5b5c9bc7 1504 return _core_.Point2D___neg__(*args, **kwargs)
d55e5bfc
RD
1505
1506 def __iadd__(*args, **kwargs):
5b5c9bc7
RD
1507 """__iadd__(self, Point2D pt) -> Point2D"""
1508 return _core_.Point2D___iadd__(*args, **kwargs)
d55e5bfc
RD
1509
1510 def __isub__(*args, **kwargs):
5b5c9bc7
RD
1511 """__isub__(self, Point2D pt) -> Point2D"""
1512 return _core_.Point2D___isub__(*args, **kwargs)
d55e5bfc
RD
1513
1514 def __imul__(*args, **kwargs):
5b5c9bc7
RD
1515 """__imul__(self, Point2D pt) -> Point2D"""
1516 return _core_.Point2D___imul__(*args, **kwargs)
d55e5bfc
RD
1517
1518 def __idiv__(*args, **kwargs):
5b5c9bc7
RD
1519 """__idiv__(self, Point2D pt) -> Point2D"""
1520 return _core_.Point2D___idiv__(*args, **kwargs)
d55e5bfc
RD
1521
1522 def __eq__(*args, **kwargs):
1523 """
e9d6f3a4 1524 __eq__(self, PyObject other) -> bool
d55e5bfc 1525
e9d6f3a4 1526 Test for equality of wx.Point2D objects.
d55e5bfc 1527 """
5b5c9bc7 1528 return _core_.Point2D___eq__(*args, **kwargs)
d55e5bfc
RD
1529
1530 def __ne__(*args, **kwargs):
1531 """
e9d6f3a4 1532 __ne__(self, PyObject other) -> bool
d55e5bfc 1533
e9d6f3a4 1534 Test for inequality of wx.Point2D objects.
d55e5bfc 1535 """
5b5c9bc7 1536 return _core_.Point2D___ne__(*args, **kwargs)
d55e5bfc 1537
5b5c9bc7
RD
1538 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1539 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
d55e5bfc
RD
1540 def Set(*args, **kwargs):
1541 """Set(self, double x=0, double y=0)"""
5b5c9bc7 1542 return _core_.Point2D_Set(*args, **kwargs)
d55e5bfc
RD
1543
1544 def Get(*args, **kwargs):
1545 """
1546 Get() -> (x,y)
1547
1548 Return x and y properties as a tuple.
1549 """
5b5c9bc7 1550 return _core_.Point2D_Get(*args, **kwargs)
d55e5bfc 1551
15817c7e 1552 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1553 def __str__(self): return str(self.Get())
1554 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1555 def __len__(self): return len(self.Get())
1556 def __getitem__(self, index): return self.Get()[index]
1557 def __setitem__(self, index, val):
1558 if index == 0: self.x = val
1559 elif index == 1: self.y = val
1560 else: raise IndexError
1561 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1562 __safe_for_unpickling__ = True
1563 def __reduce__(self): return (wx.Point2D, self.Get())
1564
2131d850 1565_core_.Point2D_swigregister(Point2D)
d55e5bfc
RD
1566
1567def Point2DCopy(*args, **kwargs):
1568 """
5b5c9bc7 1569 Point2DCopy(Point2D pt) -> Point2D
d55e5bfc
RD
1570
1571 Create a w.Point2D object.
1572 """
5b5c9bc7 1573 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1574 return val
1575
1576def Point2DFromPoint(*args, **kwargs):
1577 """
5b5c9bc7 1578 Point2DFromPoint(Point pt) -> Point2D
d55e5bfc
RD
1579
1580 Create a w.Point2D object.
1581 """
5b5c9bc7 1582 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d55e5bfc
RD
1583 return val
1584
1585#---------------------------------------------------------------------------
1586
5b5c9bc7
RD
1587FromStart = _core_.FromStart
1588FromCurrent = _core_.FromCurrent
1589FromEnd = _core_.FromEnd
d55e5bfc 1590class InputStream(object):
36ed4f51 1591 """Proxy of C++ InputStream class"""
1bd55598
RD
1592 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1593 __repr__ = _swig_repr
1594 def __init__(self, *args, **kwargs):
d55e5bfc 1595 """__init__(self, PyObject p) -> InputStream"""
1bd55598
RD
1596 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1597 __swig_destroy__ = _core_.delete_InputStream
1598 __del__ = lambda self : None;
d55e5bfc
RD
1599 def close(*args, **kwargs):
1600 """close(self)"""
5b5c9bc7 1601 return _core_.InputStream_close(*args, **kwargs)
d55e5bfc
RD
1602
1603 def flush(*args, **kwargs):
1604 """flush(self)"""
5b5c9bc7 1605 return _core_.InputStream_flush(*args, **kwargs)
d55e5bfc
RD
1606
1607 def eof(*args, **kwargs):
1608 """eof(self) -> bool"""
5b5c9bc7 1609 return _core_.InputStream_eof(*args, **kwargs)
d55e5bfc
RD
1610
1611 def read(*args, **kwargs):
1612 """read(self, int size=-1) -> PyObject"""
5b5c9bc7 1613 return _core_.InputStream_read(*args, **kwargs)
d55e5bfc
RD
1614
1615 def readline(*args, **kwargs):
1616 """readline(self, int size=-1) -> PyObject"""
5b5c9bc7 1617 return _core_.InputStream_readline(*args, **kwargs)
d55e5bfc
RD
1618
1619 def readlines(*args, **kwargs):
1620 """readlines(self, int sizehint=-1) -> PyObject"""
5b5c9bc7 1621 return _core_.InputStream_readlines(*args, **kwargs)
d55e5bfc
RD
1622
1623 def seek(*args, **kwargs):
1624 """seek(self, int offset, int whence=0)"""
5b5c9bc7 1625 return _core_.InputStream_seek(*args, **kwargs)
d55e5bfc
RD
1626
1627 def tell(*args, **kwargs):
1628 """tell(self) -> int"""
5b5c9bc7 1629 return _core_.InputStream_tell(*args, **kwargs)
d55e5bfc
RD
1630
1631 def Peek(*args, **kwargs):
1632 """Peek(self) -> char"""
5b5c9bc7 1633 return _core_.InputStream_Peek(*args, **kwargs)
d55e5bfc
RD
1634
1635 def GetC(*args, **kwargs):
1636 """GetC(self) -> char"""
5b5c9bc7 1637 return _core_.InputStream_GetC(*args, **kwargs)
d55e5bfc
RD
1638
1639 def LastRead(*args, **kwargs):
1640 """LastRead(self) -> size_t"""
5b5c9bc7 1641 return _core_.InputStream_LastRead(*args, **kwargs)
d55e5bfc
RD
1642
1643 def CanRead(*args, **kwargs):
1644 """CanRead(self) -> bool"""
5b5c9bc7 1645 return _core_.InputStream_CanRead(*args, **kwargs)
d55e5bfc
RD
1646
1647 def Eof(*args, **kwargs):
1648 """Eof(self) -> bool"""
5b5c9bc7 1649 return _core_.InputStream_Eof(*args, **kwargs)
d55e5bfc
RD
1650
1651 def Ungetch(*args, **kwargs):
1652 """Ungetch(self, char c) -> bool"""
5b5c9bc7 1653 return _core_.InputStream_Ungetch(*args, **kwargs)
d55e5bfc
RD
1654
1655 def SeekI(*args, **kwargs):
5b5c9bc7
RD
1656 """SeekI(self, long pos, int mode=FromStart) -> long"""
1657 return _core_.InputStream_SeekI(*args, **kwargs)
d55e5bfc
RD
1658
1659 def TellI(*args, **kwargs):
1660 """TellI(self) -> long"""
5b5c9bc7 1661 return _core_.InputStream_TellI(*args, **kwargs)
d55e5bfc 1662
2131d850 1663_core_.InputStream_swigregister(InputStream)
5b5c9bc7
RD
1664DefaultPosition = cvar.DefaultPosition
1665DefaultSize = cvar.DefaultSize
d55e5bfc 1666
5b5c9bc7
RD
1667class OutputStream(object):
1668 """Proxy of C++ OutputStream class"""
1bd55598
RD
1669 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1670 def __init__(self): raise AttributeError, "No constructor defined"
1671 __repr__ = _swig_repr
d55e5bfc
RD
1672 def write(*args, **kwargs):
1673 """write(self, PyObject obj)"""
5b5c9bc7 1674 return _core_.OutputStream_write(*args, **kwargs)
d55e5bfc 1675
1bd55598
RD
1676 def LastWrite(*args, **kwargs):
1677 """LastWrite(self) -> size_t"""
1678 return _core_.OutputStream_LastWrite(*args, **kwargs)
d55e5bfc 1679
2131d850 1680_core_.OutputStream_swigregister(OutputStream)
d55e5bfc
RD
1681
1682#---------------------------------------------------------------------------
1683
5b5c9bc7
RD
1684class FSFile(Object):
1685 """Proxy of C++ FSFile class"""
1bd55598
RD
1686 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1687 __repr__ = _swig_repr
1688 def __init__(self, *args, **kwargs):
d55e5bfc 1689 """
5b5c9bc7
RD
1690 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1691 DateTime modif) -> FSFile
d55e5bfc 1692 """
1bd55598 1693 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1bd55598
RD
1694 __swig_destroy__ = _core_.delete_FSFile
1695 __del__ = lambda self : None;
d55e5bfc 1696 def GetStream(*args, **kwargs):
5b5c9bc7
RD
1697 """GetStream(self) -> InputStream"""
1698 return _core_.FSFile_GetStream(*args, **kwargs)
d55e5bfc
RD
1699
1700 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
1701 """GetMimeType(self) -> String"""
1702 return _core_.FSFile_GetMimeType(*args, **kwargs)
d55e5bfc
RD
1703
1704 def GetLocation(*args, **kwargs):
5b5c9bc7
RD
1705 """GetLocation(self) -> String"""
1706 return _core_.FSFile_GetLocation(*args, **kwargs)
d55e5bfc
RD
1707
1708 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1709 """GetAnchor(self) -> String"""
1710 return _core_.FSFile_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1711
1712 def GetModificationTime(*args, **kwargs):
5b5c9bc7
RD
1713 """GetModificationTime(self) -> DateTime"""
1714 return _core_.FSFile_GetModificationTime(*args, **kwargs)
d55e5bfc 1715
2131d850 1716_core_.FSFile_swigregister(FSFile)
d55e5bfc
RD
1717
1718class CPPFileSystemHandler(object):
36ed4f51 1719 """Proxy of C++ CPPFileSystemHandler class"""
1bd55598
RD
1720 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1721 def __init__(self): raise AttributeError, "No constructor defined"
1722 __repr__ = _swig_repr
50f151d7
RD
1723 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1724 __del__ = lambda self : None;
2131d850 1725_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d55e5bfc
RD
1726
1727class FileSystemHandler(CPPFileSystemHandler):
36ed4f51 1728 """Proxy of C++ FileSystemHandler class"""
1bd55598
RD
1729 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1730 __repr__ = _swig_repr
1731 def __init__(self, *args, **kwargs):
d55e5bfc 1732 """__init__(self) -> FileSystemHandler"""
1bd55598 1733 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
d55e5bfc
RD
1734 self._setCallbackInfo(self, FileSystemHandler)
1735
1736 def _setCallbackInfo(*args, **kwargs):
1737 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 1738 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
1739
1740 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1741 """CanOpen(self, String location) -> bool"""
1742 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1743
1744 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1745 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1746 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1747
1748 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1749 """FindFirst(self, String spec, int flags=0) -> String"""
1750 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1751
1752 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1753 """FindNext(self) -> String"""
1754 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
1755
1756 def GetProtocol(*args, **kwargs):
5b5c9bc7
RD
1757 """GetProtocol(self, String location) -> String"""
1758 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
d55e5bfc
RD
1759
1760 def GetLeftLocation(*args, **kwargs):
5b5c9bc7
RD
1761 """GetLeftLocation(self, String location) -> String"""
1762 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
d55e5bfc
RD
1763
1764 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1765 """GetAnchor(self, String location) -> String"""
1766 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1767
1768 def GetRightLocation(*args, **kwargs):
5b5c9bc7
RD
1769 """GetRightLocation(self, String location) -> String"""
1770 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
d55e5bfc
RD
1771
1772 def GetMimeTypeFromExt(*args, **kwargs):
5b5c9bc7
RD
1773 """GetMimeTypeFromExt(self, String location) -> String"""
1774 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
d55e5bfc 1775
2131d850 1776_core_.FileSystemHandler_swigregister(FileSystemHandler)
d55e5bfc 1777
5b5c9bc7
RD
1778class FileSystem(Object):
1779 """Proxy of C++ FileSystem class"""
1bd55598
RD
1780 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1781 __repr__ = _swig_repr
1782 def __init__(self, *args, **kwargs):
5b5c9bc7 1783 """__init__(self) -> FileSystem"""
1bd55598
RD
1784 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1785 __swig_destroy__ = _core_.delete_FileSystem
1786 __del__ = lambda self : None;
d55e5bfc 1787 def ChangePathTo(*args, **kwargs):
5b5c9bc7
RD
1788 """ChangePathTo(self, String location, bool is_dir=False)"""
1789 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
d55e5bfc
RD
1790
1791 def GetPath(*args, **kwargs):
5b5c9bc7
RD
1792 """GetPath(self) -> String"""
1793 return _core_.FileSystem_GetPath(*args, **kwargs)
d55e5bfc
RD
1794
1795 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1796 """OpenFile(self, String location) -> FSFile"""
1797 return _core_.FileSystem_OpenFile(*args, **kwargs)
d55e5bfc
RD
1798
1799 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1800 """FindFirst(self, String spec, int flags=0) -> String"""
1801 return _core_.FileSystem_FindFirst(*args, **kwargs)
d55e5bfc
RD
1802
1803 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1804 """FindNext(self) -> String"""
1805 return _core_.FileSystem_FindNext(*args, **kwargs)
d55e5bfc
RD
1806
1807 def AddHandler(*args, **kwargs):
d6c14a4c 1808 """AddHandler(CPPFileSystemHandler handler)"""
5b5c9bc7 1809 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc
RD
1810
1811 AddHandler = staticmethod(AddHandler)
1812 def CleanUpHandlers(*args, **kwargs):
d6c14a4c 1813 """CleanUpHandlers()"""
5b5c9bc7 1814 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc
RD
1815
1816 CleanUpHandlers = staticmethod(CleanUpHandlers)
1817 def FileNameToURL(*args, **kwargs):
5b5c9bc7
RD
1818 """FileNameToURL(String filename) -> String"""
1819 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc
RD
1820
1821 FileNameToURL = staticmethod(FileNameToURL)
b411df4a 1822 def URLToFileName(*args, **kwargs):
5b5c9bc7
RD
1823 """URLToFileName(String url) -> String"""
1824 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a
RD
1825
1826 URLToFileName = staticmethod(URLToFileName)
2131d850 1827_core_.FileSystem_swigregister(FileSystem)
d55e5bfc 1828
5b5c9bc7 1829def FileSystem_AddHandler(*args, **kwargs):
1bd55598
RD
1830 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1831 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 1832
1bd55598
RD
1833def FileSystem_CleanUpHandlers(*args):
1834 """FileSystem_CleanUpHandlers()"""
1835 return _core_.FileSystem_CleanUpHandlers(*args)
d55e5bfc 1836
5b5c9bc7 1837def FileSystem_FileNameToURL(*args, **kwargs):
1bd55598
RD
1838 """FileSystem_FileNameToURL(String filename) -> String"""
1839 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 1840
5b5c9bc7 1841def FileSystem_URLToFileName(*args, **kwargs):
1bd55598
RD
1842 """FileSystem_URLToFileName(String url) -> String"""
1843 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a 1844
5b5c9bc7
RD
1845class InternetFSHandler(CPPFileSystemHandler):
1846 """Proxy of C++ InternetFSHandler class"""
1bd55598
RD
1847 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1848 __repr__ = _swig_repr
1849 def __init__(self, *args, **kwargs):
5b5c9bc7 1850 """__init__(self) -> InternetFSHandler"""
1bd55598 1851 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
d55e5bfc 1852 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1853 """CanOpen(self, String location) -> bool"""
1854 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1855
1856 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1857 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1858 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
d55e5bfc 1859
2131d850 1860_core_.InternetFSHandler_swigregister(InternetFSHandler)
d55e5bfc 1861
5b5c9bc7
RD
1862class ZipFSHandler(CPPFileSystemHandler):
1863 """Proxy of C++ ZipFSHandler class"""
1bd55598
RD
1864 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1865 __repr__ = _swig_repr
1866 def __init__(self, *args, **kwargs):
5b5c9bc7 1867 """__init__(self) -> ZipFSHandler"""
1bd55598 1868 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
d55e5bfc 1869 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1870 """CanOpen(self, String location) -> bool"""
1871 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1872
1873 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1874 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1875 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1876
1877 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1878 """FindFirst(self, String spec, int flags=0) -> String"""
1879 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1880
1881 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1882 """FindNext(self) -> String"""
1883 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
d55e5bfc 1884
2131d850 1885_core_.ZipFSHandler_swigregister(ZipFSHandler)
d55e5bfc
RD
1886
1887
1888def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1bd55598
RD
1889 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1890 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d55e5bfc
RD
1891
1892def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1bd55598
RD
1893 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1894 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d55e5bfc
RD
1895
1896def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1bd55598
RD
1897 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1898 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
b411df4a
RD
1899def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1900 """
1901 Add 'file' to the memory filesystem. The dataItem parameter can
1902 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1903 arbitrary data. If a bitmap or image is used then the imgType
1904 parameter should specify what kind of image file it should be
1905 written as, wx.BITMAP_TYPE_PNG, etc.
1906 """
1907 if isinstance(dataItem, wx.Image):
1908 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1909 elif isinstance(dataItem, wx.Bitmap):
1910 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1911 elif type(dataItem) == str:
1912 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1913 else:
1914 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc 1915
5b5c9bc7
RD
1916class MemoryFSHandler(CPPFileSystemHandler):
1917 """Proxy of C++ MemoryFSHandler class"""
1bd55598
RD
1918 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1919 __repr__ = _swig_repr
1920 def __init__(self, *args, **kwargs):
5b5c9bc7 1921 """__init__(self) -> MemoryFSHandler"""
1bd55598 1922 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
d55e5bfc 1923 def RemoveFile(*args, **kwargs):
5b5c9bc7
RD
1924 """RemoveFile(String filename)"""
1925 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc
RD
1926
1927 RemoveFile = staticmethod(RemoveFile)
1928 AddFile = staticmethod(MemoryFSHandler_AddFile)
1929 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1930 """CanOpen(self, String location) -> bool"""
1931 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1932
1933 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1934 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1935 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1936
1937 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1938 """FindFirst(self, String spec, int flags=0) -> String"""
1939 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1940
1941 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1942 """FindNext(self) -> String"""
1943 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
d55e5bfc 1944
2131d850 1945_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d55e5bfc 1946
5b5c9bc7 1947def MemoryFSHandler_RemoveFile(*args, **kwargs):
1bd55598
RD
1948 """MemoryFSHandler_RemoveFile(String filename)"""
1949 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 1950
5b5c9bc7
RD
1951IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1952IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1953IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d55e5bfc
RD
1954#---------------------------------------------------------------------------
1955
5b5c9bc7 1956class ImageHandler(Object):
27fb7603
RD
1957 """
1958 This is the base class for implementing image file loading/saving, and
1959 image creation from data. It is used within `wx.Image` and is not
1960 normally seen by the application.
1961 """
1bd55598
RD
1962 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1963 def __init__(self): raise AttributeError, "No constructor defined"
1964 __repr__ = _swig_repr
d55e5bfc 1965 def GetName(*args, **kwargs):
5b5c9bc7
RD
1966 """GetName(self) -> String"""
1967 return _core_.ImageHandler_GetName(*args, **kwargs)
d55e5bfc
RD
1968
1969 def GetExtension(*args, **kwargs):
5b5c9bc7
RD
1970 """GetExtension(self) -> String"""
1971 return _core_.ImageHandler_GetExtension(*args, **kwargs)
d55e5bfc
RD
1972
1973 def GetType(*args, **kwargs):
1974 """GetType(self) -> long"""
5b5c9bc7 1975 return _core_.ImageHandler_GetType(*args, **kwargs)
d55e5bfc
RD
1976
1977 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
1978 """GetMimeType(self) -> String"""
1979 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
d55e5bfc
RD
1980
1981 def CanRead(*args, **kwargs):
5b5c9bc7
RD
1982 """CanRead(self, String name) -> bool"""
1983 return _core_.ImageHandler_CanRead(*args, **kwargs)
d55e5bfc 1984
b02396e8
RD
1985 def CanReadStream(*args, **kwargs):
1986 """CanReadStream(self, InputStream stream) -> bool"""
1987 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
1988
d55e5bfc 1989 def SetName(*args, **kwargs):
5b5c9bc7
RD
1990 """SetName(self, String name)"""
1991 return _core_.ImageHandler_SetName(*args, **kwargs)
d55e5bfc
RD
1992
1993 def SetExtension(*args, **kwargs):
5b5c9bc7
RD
1994 """SetExtension(self, String extension)"""
1995 return _core_.ImageHandler_SetExtension(*args, **kwargs)
d55e5bfc
RD
1996
1997 def SetType(*args, **kwargs):
1998 """SetType(self, long type)"""
5b5c9bc7 1999 return _core_.ImageHandler_SetType(*args, **kwargs)
d55e5bfc
RD
2000
2001 def SetMimeType(*args, **kwargs):
5b5c9bc7
RD
2002 """SetMimeType(self, String mimetype)"""
2003 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
d55e5bfc 2004
2131d850 2005_core_.ImageHandler_swigregister(ImageHandler)
d55e5bfc 2006
943e8dfd
RD
2007class PyImageHandler(ImageHandler):
2008 """
2009 This is the base class for implementing image file loading/saving, and
2010 image creation from data, all written in Python. To create a custom
2011 image handler derive a new class from wx.PyImageHandler and provide
2012 the following methods::
2013
2014 def DoCanRead(self, stream) --> bool
2015 '''Check if this handler can read the image on the stream'''
2016
2017 def LoadFile(self, image, stream, verbose, index) --> bool
2018 '''Load image data from the stream and load it into image.'''
2019
2020 def SaveFile(self, image, stream, verbose) --> bool
2021 '''Save the iamge data in image to the stream using
2022 this handler's image file format.'''
2023
2024 def GetImageCount(self, stream) --> int
2025 '''If this image format can hold more than one image,
2026 how many does the image on the stream have?'''
2027
2028 To activate your handler create an instance of it and pass it to
2029 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2030 `SetExtension` from your constructor.
2031
2032 """
1bd55598
RD
2033 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2034 __repr__ = _swig_repr
2035 def __init__(self, *args, **kwargs):
943e8dfd
RD
2036 """
2037 __init__(self) -> PyImageHandler
2038
2039 This is the base class for implementing image file loading/saving, and
2040 image creation from data, all written in Python. To create a custom
2041 image handler derive a new class from wx.PyImageHandler and provide
2042 the following methods::
2043
2044 def DoCanRead(self, stream) --> bool
2045 '''Check if this handler can read the image on the stream'''
2046
2047 def LoadFile(self, image, stream, verbose, index) --> bool
2048 '''Load image data from the stream and load it into image.'''
2049
2050 def SaveFile(self, image, stream, verbose) --> bool
2051 '''Save the iamge data in image to the stream using
2052 this handler's image file format.'''
2053
2054 def GetImageCount(self, stream) --> int
2055 '''If this image format can hold more than one image,
2056 how many does the image on the stream have?'''
2057
2058 To activate your handler create an instance of it and pass it to
2059 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2060 `SetExtension` from your constructor.
2061
2062 """
1bd55598 2063 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
RD
2064 self._SetSelf(self)
2065
2066 def _SetSelf(*args, **kwargs):
2067 """_SetSelf(self, PyObject self)"""
2068 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2069
2131d850 2070_core_.PyImageHandler_swigregister(PyImageHandler)
943e8dfd 2071
5b5c9bc7
RD
2072class ImageHistogram(object):
2073 """Proxy of C++ ImageHistogram class"""
1bd55598
RD
2074 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2075 __repr__ = _swig_repr
2076 def __init__(self, *args, **kwargs):
5b5c9bc7 2077 """__init__(self) -> ImageHistogram"""
1bd55598 2078 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
d55e5bfc
RD
2079 def MakeKey(*args, **kwargs):
2080 """
7a27cf7c 2081 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2082
2083 Get the key in the histogram for the given RGB values
2084 """
5b5c9bc7 2085 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc
RD
2086
2087 MakeKey = staticmethod(MakeKey)
2088 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2089 """
2090 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2091
2092 Find first colour that is not used in the image and has higher RGB
2093 values than startR, startG, startB. Returns a tuple consisting of a
2094 success flag and rgb values.
2095 """
5b5c9bc7 2096 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2097
f1cbd8fa
RD
2098 def GetCount(*args, **kwargs):
2099 """
2100 GetCount(self, unsigned long key) -> unsigned long
2101
2102 Returns the pixel count for the given key. Use `MakeKey` to create a
2103 key value from a RGB tripple.
2104 """
5b5c9bc7 2105 return _core_.ImageHistogram_GetCount(*args, **kwargs)
f1cbd8fa
RD
2106
2107 def GetCountRGB(*args, **kwargs):
2108 """
7a27cf7c 2109 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2110
2111 Returns the pixel count for the given RGB values.
2112 """
5b5c9bc7 2113 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
f1cbd8fa
RD
2114
2115 def GetCountColour(*args, **kwargs):
2116 """
5b5c9bc7 2117 GetCountColour(self, Colour colour) -> unsigned long
f1cbd8fa
RD
2118
2119 Returns the pixel count for the given `wx.Colour` value.
2120 """
5b5c9bc7 2121 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
f1cbd8fa 2122
2131d850 2123_core_.ImageHistogram_swigregister(ImageHistogram)
d55e5bfc 2124
5b5c9bc7 2125def ImageHistogram_MakeKey(*args, **kwargs):
1bd55598 2126 """
7a27cf7c 2127 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2128
2129 Get the key in the histogram for the given RGB values
2130 """
1bd55598 2131 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2132
943e8dfd
RD
2133class Image_RGBValue(object):
2134 """
2135 An object that contains values for red, green and blue which represent
2136 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2137 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2138 color space.
2139 """
1bd55598
RD
2140 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2141 __repr__ = _swig_repr
2142 def __init__(self, *args, **kwargs):
943e8dfd
RD
2143 """
2144 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2145
2146 Constructor.
2147 """
1bd55598 2148 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
2149 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2150 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2151 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2152_core_.Image_RGBValue_swigregister(Image_RGBValue)
943e8dfd
RD
2153
2154class Image_HSVValue(object):
2155 """
2156 An object that contains values for hue, saturation and value which
2157 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2158 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2159 color space.
2160 """
1bd55598
RD
2161 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2162 __repr__ = _swig_repr
2163 def __init__(self, *args, **kwargs):
943e8dfd
RD
2164 """
2165 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2166
2167 Constructor.
2168 """
1bd55598 2169 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
2170 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2171 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2172 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2173_core_.Image_HSVValue_swigregister(Image_HSVValue)
943e8dfd 2174
5b5c9bc7 2175class Image(Object):
7a27cf7c
RD
2176 """
2177 A platform-independent image class. An image can be created from
2178 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2179 variety of formats. Functions are available to set and get image
2180 bits, so it can be used for basic image manipulation.
2181
2182 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2183 platform-specific `wx.Bitmap` object must be created from it using the
2184 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2185 device context, using `wx.DC.DrawBitmap`.
2186
2187 One colour value of the image may be used as a mask colour which will
2188 lead to the automatic creation of a `wx.Mask` object associated to the
2189 bitmap object.
2190
2191 wx.Image supports alpha channel data, that is in addition to a byte
2192 for the red, green and blue colour components for each pixel it also
2193 stores a byte representing the pixel opacity. An alpha value of 0
2194 corresponds to a transparent pixel (null opacity) while a value of 255
2195 means that the pixel is 100% opaque.
2196
2197 Unlike RGB data, not all images have an alpha channel and before using
2198 `GetAlpha` you should check if this image contains an alpha channel
2199 with `HasAlpha`. Note that currently only images loaded from PNG files
2200 with transparency information will have an alpha channel.
2201 """
1bd55598
RD
2202 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2203 __repr__ = _swig_repr
2204 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2205 """
2206 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2207
2208 Loads an image from a file.
2209 """
1bd55598
RD
2210 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2211 __swig_destroy__ = _core_.delete_Image
2212 __del__ = lambda self : None;
d55e5bfc 2213 def Create(*args, **kwargs):
7a27cf7c
RD
2214 """
2215 Create(self, int width, int height, bool clear=True)
2216
2217 Creates a fresh image. If clear is ``True``, the new image will be
2218 initialized to black. Otherwise, the image data will be uninitialized.
2219 """
5b5c9bc7 2220 return _core_.Image_Create(*args, **kwargs)
d55e5bfc
RD
2221
2222 def Destroy(*args, **kwargs):
2223 """
2224 Destroy(self)
2225
7a27cf7c 2226 Destroys the image data.
d55e5bfc 2227 """
7e08d4ef
RD
2228 val = _core_.Image_Destroy(*args, **kwargs)
2229 args[0].thisown = 0
2230 return val
d55e5bfc
RD
2231
2232 def Scale(*args, **kwargs):
7a27cf7c
RD
2233 """
2234 Scale(self, int width, int height) -> Image
2235
2236 Returns a scaled version of the image. This is also useful for scaling
2237 bitmaps in general as the only other way to scale bitmaps is to blit a
2238 `wx.MemoryDC` into another `wx.MemoryDC`.
2239 """
5b5c9bc7 2240 return _core_.Image_Scale(*args, **kwargs)
d55e5bfc
RD
2241
2242 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2243 """
2244 ShrinkBy(self, int xFactor, int yFactor) -> Image
2245
2246 Return a version of the image scaled smaller by the given factors.
2247 """
5b5c9bc7 2248 return _core_.Image_ShrinkBy(*args, **kwargs)
d55e5bfc
RD
2249
2250 def Rescale(*args, **kwargs):
7a27cf7c
RD
2251 """
2252 Rescale(self, int width, int height) -> Image
2253
2254 Changes the size of the image in-place by scaling it: after a call to
2255 this function, the image will have the given width and height.
2256
2257 Returns the (modified) image itself.
2258 """
5b5c9bc7 2259 return _core_.Image_Rescale(*args, **kwargs)
d55e5bfc 2260
aff4cc5c 2261 def Resize(*args, **kwargs):
7a27cf7c
RD
2262 """
2263 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2264
2265 Changes the size of the image in-place without scaling it, by adding
2266 either a border with the given colour or cropping as necessary. The
2267 image is pasted into a new image with the given size and background
2268 colour at the position pos relative to the upper left of the new
2269 image. If red = green = blue = -1 then use either the current mask
2270 colour if set or find, use, and set a suitable mask colour for any
2271 newly exposed areas.
2272
2273 Returns the (modified) image itself.
2274 """
5b5c9bc7 2275 return _core_.Image_Resize(*args, **kwargs)
aff4cc5c 2276
d55e5bfc 2277 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2278 """
2279 SetRGB(self, int x, int y, byte r, byte g, byte b)
2280
2281 Sets the pixel at the given coordinate. This routine performs
2282 bounds-checks for the coordinate so it can be considered a safe way to
2283 manipulate the data, but in some cases this might be too slow so that
2284 the data will have to be set directly. In that case you will have to
2285 get access to the image data using the `GetData` method.
2286 """
5b5c9bc7 2287 return _core_.Image_SetRGB(*args, **kwargs)
d55e5bfc 2288
aff4cc5c 2289 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2290 """
2291 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2292
2293 Sets the colour of the pixels within the given rectangle. This routine
2294 performs bounds-checks for the rectangle so it can be considered a
2295 safe way to manipulate the data.
2296 """
5b5c9bc7 2297 return _core_.Image_SetRGBRect(*args, **kwargs)
aff4cc5c 2298
d55e5bfc 2299 def GetRed(*args, **kwargs):
7a27cf7c
RD
2300 """
2301 GetRed(self, int x, int y) -> byte
2302
2303 Returns the red intensity at the given coordinate.
2304 """
5b5c9bc7 2305 return _core_.Image_GetRed(*args, **kwargs)
d55e5bfc
RD
2306
2307 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2308 """
2309 GetGreen(self, int x, int y) -> byte
2310
2311 Returns the green intensity at the given coordinate.
2312 """
5b5c9bc7 2313 return _core_.Image_GetGreen(*args, **kwargs)
d55e5bfc
RD
2314
2315 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2316 """
2317 GetBlue(self, int x, int y) -> byte
2318
2319 Returns the blue intensity at the given coordinate.
2320 """
5b5c9bc7 2321 return _core_.Image_GetBlue(*args, **kwargs)
d55e5bfc
RD
2322
2323 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2324 """
2325 SetAlpha(self, int x, int y, byte alpha)
2326
2327 Sets the alpha value for the given pixel. This function should only be
2328 called if the image has alpha channel data, use `HasAlpha` to check
2329 for this.
2330 """
5b5c9bc7 2331 return _core_.Image_SetAlpha(*args, **kwargs)
d55e5bfc
RD
2332
2333 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2334 """
2335 GetAlpha(self, int x, int y) -> byte
2336
2337 Returns the alpha value for the given pixel. This function may only be
2338 called for the images with alpha channel, use `HasAlpha` to check for
2339 this.
2340
2341 The returned value is the *opacity* of the image, i.e. the value of 0
2342 corresponds to the fully transparent pixels while the value of 255 to
2343 the fully opaque pixels.
2344 """
5b5c9bc7 2345 return _core_.Image_GetAlpha(*args, **kwargs)
d55e5bfc
RD
2346
2347 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2348 """
2349 HasAlpha(self) -> bool
2350
2351 Returns true if this image has alpha channel, false otherwise.
2352 """
5b5c9bc7 2353 return _core_.Image_HasAlpha(*args, **kwargs)
d55e5bfc 2354
68350608
RD
2355 def InitAlpha(*args, **kwargs):
2356 """
2357 InitAlpha(self)
2358
2359 Initializes the image alpha channel data. It is an error to call it if
2360 the image already has alpha data. If it doesn't, alpha data will be by
2361 default initialized to all pixels being fully opaque. But if the image
2362 has a a mask colour, all mask pixels will be completely transparent.
2363 """
5b5c9bc7
RD
2364 return _core_.Image_InitAlpha(*args, **kwargs)
2365
2366 def IsTransparent(*args, **kwargs):
2367 """
7a27cf7c 2368 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
5b5c9bc7 2369
7a27cf7c
RD
2370 Returns ``True`` if this pixel is masked or has an alpha value less
2371 than the spcified threshold.
5b5c9bc7
RD
2372 """
2373 return _core_.Image_IsTransparent(*args, **kwargs)
68350608 2374
d55e5bfc 2375 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2376 """
2377 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2378
2379 Find first colour that is not used in the image and has higher RGB
2380 values than startR, startG, startB. Returns a tuple consisting of a
2381 success flag and rgb values.
2382 """
5b5c9bc7 2383 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2384
4cf4100f
RD
2385 def ConvertAlphaToMask(*args, **kwargs):
2386 """
5b5c9bc7 2387 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2388
7a27cf7c
RD
2389 If the image has alpha channel, this method converts it to mask. All
2390 pixels with alpha value less than ``threshold`` are replaced with the
2391 mask colour and the alpha channel is removed. The mask colour is
2392 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2393
2394 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2395 nothing.
2396 """
5b5c9bc7 2397 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
4cf4100f 2398
8fb0e70a
RD
2399 def ConvertColourToAlpha(*args, **kwargs):
2400 """
7a27cf7c 2401 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2402
2403 This method converts an image where the original alpha information is
2404 only available as a shades of a colour (actually shades of grey)
2405 typically when you draw anti-aliased text into a bitmap. The DC
2406 drawing routines draw grey values on the black background although
2407 they actually mean to draw white with differnt alpha values. This
2408 method reverses it, assuming a black (!) background and white text.
2409 The method will then fill up the whole image with the colour given.
2410 """
5b5c9bc7 2411 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
8fb0e70a 2412
d55e5bfc 2413 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2414 """
2415 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2416
2417 Sets the image's mask so that the pixels that have RGB value of
2418 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2419 by first finding an unused colour in the image, setting this colour as
2420 the mask colour and then using this colour to draw all pixels in the
2421 image who corresponding pixel in mask has given RGB value.
2422
2423 Returns ``False`` if ``mask`` does not have same dimensions as the
2424 image or if there is no unused colour left. Returns ``True`` if the
2425 mask was successfully applied.
2426
2427 Note that this method involves computing the histogram, which is
2428 computationally intensive operation.
2429 """
5b5c9bc7 2430 return _core_.Image_SetMaskFromImage(*args, **kwargs)
d55e5bfc
RD
2431
2432 def CanRead(*args, **kwargs):
7a27cf7c
RD
2433 """
2434 CanRead(String filename) -> bool
2435
2436 Returns True if the image handlers can read this file.
2437 """
5b5c9bc7 2438 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
RD
2439
2440 CanRead = staticmethod(CanRead)
2441 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2442 """
2443 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2444
2445 If the image file contains more than one image and the image handler
2446 is capable of retrieving these individually, this function will return
2447 the number of available images.
2448 """
5b5c9bc7 2449 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
RD
2450
2451 GetImageCount = staticmethod(GetImageCount)
2452 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2453 """
2454 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2455
2456 Loads an image from a file. If no handler type is provided, the
2457 library will try to autodetect the format.
2458 """
5b5c9bc7 2459 return _core_.Image_LoadFile(*args, **kwargs)
d55e5bfc
RD
2460
2461 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2462 """
2463 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2464
2465 Loads an image from a file, specifying the image type with a MIME type
2466 string.
2467 """
5b5c9bc7 2468 return _core_.Image_LoadMimeFile(*args, **kwargs)
d55e5bfc
RD
2469
2470 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2471 """
2472 SaveFile(self, String name, int type) -> bool
2473
2474 Saves an image in the named file.
2475 """
5b5c9bc7 2476 return _core_.Image_SaveFile(*args, **kwargs)
d55e5bfc
RD
2477
2478 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2479 """
2480 SaveMimeFile(self, String name, String mimetype) -> bool
2481
2482 Saves an image in the named file.
2483 """
5b5c9bc7 2484 return _core_.Image_SaveMimeFile(*args, **kwargs)
d55e5bfc
RD
2485
2486 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2487 """
2488 CanReadStream(InputStream stream) -> bool
2489
2490 Returns True if the image handlers can read an image file from the
2491 data currently on the input stream, or a readable Python file-like
2492 object.
2493 """
5b5c9bc7 2494 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
RD
2495
2496 CanReadStream = staticmethod(CanReadStream)
2497 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2498 """
2499 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2500
2501 Loads an image from an input stream or a readable Python file-like
2502 object. If no handler type is provided, the library will try to
2503 autodetect the format.
2504 """
5b5c9bc7 2505 return _core_.Image_LoadStream(*args, **kwargs)
d55e5bfc
RD
2506
2507 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2508 """
2509 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2510
2511 Loads an image from an input stream or a readable Python file-like
2512 object, using a MIME type string to specify the image file format.
2513 """
5b5c9bc7 2514 return _core_.Image_LoadMimeStream(*args, **kwargs)
d55e5bfc
RD
2515
2516 def Ok(*args, **kwargs):
7a27cf7c
RD
2517 """
2518 Ok(self) -> bool
2519
2520 Returns true if image data is present.
2521 """
5b5c9bc7 2522 return _core_.Image_Ok(*args, **kwargs)
d55e5bfc
RD
2523
2524 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2525 """
2526 GetWidth(self) -> int
2527
2528 Gets the width of the image in pixels.
2529 """
5b5c9bc7 2530 return _core_.Image_GetWidth(*args, **kwargs)
d55e5bfc
RD
2531
2532 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2533 """
2534 GetHeight(self) -> int
2535
2536 Gets the height of the image in pixels.
2537 """
5b5c9bc7 2538 return _core_.Image_GetHeight(*args, **kwargs)
d55e5bfc
RD
2539
2540 def GetSize(*args, **kwargs):
7a27cf7c
RD
2541 """
2542 GetSize(self) -> Size
2543
2544 Returns the size of the image in pixels.
2545 """
5b5c9bc7 2546 return _core_.Image_GetSize(*args, **kwargs)
d55e5bfc
RD
2547
2548 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2549 """
2550 GetSubImage(self, Rect rect) -> Image
2551
2552 Returns a sub image of the current one as long as the rect belongs
2553 entirely to the image.
2554 """
5b5c9bc7 2555 return _core_.Image_GetSubImage(*args, **kwargs)
d55e5bfc 2556
aff4cc5c 2557 def Size(*args, **kwargs):
7a27cf7c
RD
2558 """
2559 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2560
2561 Returns a resized version of this image without scaling it by adding
2562 either a border with the given colour or cropping as necessary. The
2563 image is pasted into a new image with the given size and background
2564 colour at the position ``pos`` relative to the upper left of the new
2565 image. If red = green = blue = -1 then use either the current mask
2566 colour if set or find, use, and set a suitable mask colour for any
2567 newly exposed areas.
2568 """
5b5c9bc7 2569 return _core_.Image_Size(*args, **kwargs)
aff4cc5c 2570
d55e5bfc 2571 def Copy(*args, **kwargs):
7a27cf7c
RD
2572 """
2573 Copy(self) -> Image
2574
2575 Returns an identical copy of the image.
2576 """
5b5c9bc7 2577 return _core_.Image_Copy(*args, **kwargs)
d55e5bfc
RD
2578
2579 def Paste(*args, **kwargs):
7a27cf7c
RD
2580 """
2581 Paste(self, Image image, int x, int y)
2582
2583 Pastes ``image`` into this instance and takes care of the mask colour
2584 and any out of bounds problems.
2585 """
5b5c9bc7 2586 return _core_.Image_Paste(*args, **kwargs)
d55e5bfc
RD
2587
2588 def GetData(*args, **kwargs):
bb2ef2cc
RD
2589 """
2590 GetData(self) -> PyObject
2591
2592 Returns a string containing a copy of the RGB bytes of the image.
2593 """
5b5c9bc7 2594 return _core_.Image_GetData(*args, **kwargs)
d55e5bfc
RD
2595
2596 def SetData(*args, **kwargs):
bb2ef2cc
RD
2597 """
2598 SetData(self, buffer data)
2599
2600 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2601 either a string or a buffer object holding the data and the length of
2602 the data must be width*height*3.
2603 """
5b5c9bc7 2604 return _core_.Image_SetData(*args, **kwargs)
d55e5bfc
RD
2605
2606 def GetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2607 """
2608 GetDataBuffer(self) -> PyObject
2609
2610 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2611 image data buffer inside the wx.Image. You need to ensure that you do
2612 not use this buffer object after the image has been destroyed.
bb2ef2cc 2613 """
5b5c9bc7 2614 return _core_.Image_GetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2615
2616 def SetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2617 """
2618 SetDataBuffer(self, buffer data)
2619
2620 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2621 object. This can save making an extra copy of the data but you must
2622 ensure that the buffer object lives longer than the wx.Image does.
bb2ef2cc 2623 """
5b5c9bc7 2624 return _core_.Image_SetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2625
2626 def GetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2627 """
2628 GetAlphaData(self) -> PyObject
2629
2630 Returns a string containing a copy of the alpha bytes of the image.
2631 """
5b5c9bc7 2632 return _core_.Image_GetAlphaData(*args, **kwargs)
d55e5bfc
RD
2633
2634 def SetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2635 """
2636 SetAlphaData(self, buffer alpha)
2637
2638 Resets the Image's alpha data from a buffer of bytes. Accepts either
2639 a string or a buffer object holding the data and the length of the
2640 data must be width*height.
2641 """
5b5c9bc7 2642 return _core_.Image_SetAlphaData(*args, **kwargs)
d55e5bfc
RD
2643
2644 def GetAlphaBuffer(*args, **kwargs):
2645 """GetAlphaBuffer(self) -> PyObject"""
5b5c9bc7 2646 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2647
2648 def SetAlphaBuffer(*args, **kwargs):
bb2ef2cc 2649 """SetAlphaBuffer(self, buffer alpha)"""
5b5c9bc7 2650 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2651
2652 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2653 """
2654 SetMaskColour(self, byte r, byte g, byte b)
2655
2656 Sets the mask colour for this image (and tells the image to use the
2657 mask).
2658 """
5b5c9bc7 2659 return _core_.Image_SetMaskColour(*args, **kwargs)
d55e5bfc 2660
aff4cc5c
RD
2661 def GetOrFindMaskColour(*args, **kwargs):
2662 """
2663 GetOrFindMaskColour() -> (r,g,b)
2664
2665 Get the current mask colour or find a suitable colour.
2666 """
5b5c9bc7 2667 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
aff4cc5c 2668
d55e5bfc 2669 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2670 """
2671 GetMaskRed(self) -> byte
2672
2673 Gets the red component of the mask colour.
2674 """
5b5c9bc7 2675 return _core_.Image_GetMaskRed(*args, **kwargs)
d55e5bfc
RD
2676
2677 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2678 """
2679 GetMaskGreen(self) -> byte
2680
2681 Gets the green component of the mask colour.
2682 """
5b5c9bc7 2683 return _core_.Image_GetMaskGreen(*args, **kwargs)
d55e5bfc
RD
2684
2685 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2686 """
2687 GetMaskBlue(self) -> byte
2688
2689 Gets the blue component of the mask colour.
2690 """
5b5c9bc7 2691 return _core_.Image_GetMaskBlue(*args, **kwargs)
d55e5bfc
RD
2692
2693 def SetMask(*args, **kwargs):
7a27cf7c
RD
2694 """
2695 SetMask(self, bool mask=True)
2696
2697 Specifies whether there is a mask or not. The area of the mask is
2698 determined by the current mask colour.
2699 """
5b5c9bc7 2700 return _core_.Image_SetMask(*args, **kwargs)
d55e5bfc
RD
2701
2702 def HasMask(*args, **kwargs):
7a27cf7c
RD
2703 """
2704 HasMask(self) -> bool
2705
2706 Returns ``True`` if there is a mask active, ``False`` otherwise.
2707 """
5b5c9bc7 2708 return _core_.Image_HasMask(*args, **kwargs)
d55e5bfc
RD
2709
2710 def Rotate(*args, **kwargs):
2711 """
5b5c9bc7
RD
2712 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2713 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2714
2715 Rotates the image about the given point, by ``angle`` radians. Passing
2716 ``True`` to ``interpolating`` results in better image quality, but is
2717 slower. If the image has a mask, then the mask colour is used for the
2718 uncovered pixels in the rotated image background. Otherwise, black
2719 will be used as the fill colour.
2720
2721 Returns the rotated image, leaving this image intact.
d55e5bfc 2722 """
5b5c9bc7 2723 return _core_.Image_Rotate(*args, **kwargs)
d55e5bfc
RD
2724
2725 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2726 """
2727 Rotate90(self, bool clockwise=True) -> Image
2728
2729 Returns a copy of the image rotated 90 degrees in the direction
2730 indicated by ``clockwise``.
2731 """
5b5c9bc7 2732 return _core_.Image_Rotate90(*args, **kwargs)
d55e5bfc
RD
2733
2734 def Mirror(*args, **kwargs):
7a27cf7c
RD
2735 """
2736 Mirror(self, bool horizontally=True) -> Image
2737
2738 Returns a mirrored copy of the image. The parameter ``horizontally``
2739 indicates the orientation.
2740 """
5b5c9bc7 2741 return _core_.Image_Mirror(*args, **kwargs)
d55e5bfc
RD
2742
2743 def Replace(*args, **kwargs):
2744 """
7a27cf7c
RD
2745 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2746
2747 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2748 ``(r2,g2,b2)``.
d55e5bfc 2749 """
5b5c9bc7 2750 return _core_.Image_Replace(*args, **kwargs)
d55e5bfc 2751
32fe5131
RD
2752 def ConvertToGreyscale(*args, **kwargs):
2753 """
2754 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2755
2756 Convert to greyscale image. Uses the luminance component (Y) of the
2757 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2758 defaults to ITU-T BT.601
2759 """
2760 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2761
d55e5bfc 2762 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2763 """
2764 ConvertToMono(self, byte r, byte g, byte b) -> Image
2765
2766 Returns monochromatic version of the image. The returned image has
2767 white colour where the original has ``(r,g,b)`` colour and black
2768 colour everywhere else.
2769 """
5b5c9bc7 2770 return _core_.Image_ConvertToMono(*args, **kwargs)
d55e5bfc
RD
2771
2772 def SetOption(*args, **kwargs):
7a27cf7c
RD
2773 """
2774 SetOption(self, String name, String value)
2775
2776 Sets an image handler defined option. For example, when saving as a
2777 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2778 number between 0 and 100 (0 is terrible, 100 is very good).
2779 """
5b5c9bc7 2780 return _core_.Image_SetOption(*args, **kwargs)
d55e5bfc
RD
2781
2782 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2783 """
2784 SetOptionInt(self, String name, int value)
2785
2786 Sets an image option as an integer.
2787 """
5b5c9bc7 2788 return _core_.Image_SetOptionInt(*args, **kwargs)
d55e5bfc
RD
2789
2790 def GetOption(*args, **kwargs):
7a27cf7c
RD
2791 """
2792 GetOption(self, String name) -> String
2793
2794 Gets the value of an image handler option.
2795 """
5b5c9bc7 2796 return _core_.Image_GetOption(*args, **kwargs)
d55e5bfc
RD
2797
2798 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2799 """
2800 GetOptionInt(self, String name) -> int
2801
2802 Gets the value of an image handler option as an integer. If the given
2803 option is not present, the function returns 0.
2804 """
5b5c9bc7 2805 return _core_.Image_GetOptionInt(*args, **kwargs)
d55e5bfc
RD
2806
2807 def HasOption(*args, **kwargs):
7a27cf7c
RD
2808 """
2809 HasOption(self, String name) -> bool
2810
2811 Returns true if the given option is present.
2812 """
5b5c9bc7 2813 return _core_.Image_HasOption(*args, **kwargs)
d55e5bfc
RD
2814
2815 def CountColours(*args, **kwargs):
2816 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
5b5c9bc7 2817 return _core_.Image_CountColours(*args, **kwargs)
d55e5bfc
RD
2818
2819 def ComputeHistogram(*args, **kwargs):
5b5c9bc7
RD
2820 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2821 return _core_.Image_ComputeHistogram(*args, **kwargs)
d55e5bfc
RD
2822
2823 def AddHandler(*args, **kwargs):
5b5c9bc7
RD
2824 """AddHandler(ImageHandler handler)"""
2825 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
2826
2827 AddHandler = staticmethod(AddHandler)
2828 def InsertHandler(*args, **kwargs):
5b5c9bc7
RD
2829 """InsertHandler(ImageHandler handler)"""
2830 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
2831
2832 InsertHandler = staticmethod(InsertHandler)
2833 def RemoveHandler(*args, **kwargs):
5b5c9bc7
RD
2834 """RemoveHandler(String name) -> bool"""
2835 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc
RD
2836
2837 RemoveHandler = staticmethod(RemoveHandler)
1bd55598
RD
2838 def GetHandlers(*args, **kwargs):
2839 """GetHandlers() -> PyObject"""
2840 return _core_.Image_GetHandlers(*args, **kwargs)
2841
2842 GetHandlers = staticmethod(GetHandlers)
d55e5bfc 2843 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2844 """
2845 GetImageExtWildcard() -> String
2846
2847 Iterates all registered wxImageHandler objects, and returns a string
2848 containing file extension masks suitable for passing to file open/save
2849 dialog boxes.
2850 """
5b5c9bc7 2851 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc
RD
2852
2853 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2854 def ConvertToBitmap(*args, **kwargs):
5b5c9bc7
RD
2855 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2856 return _core_.Image_ConvertToBitmap(*args, **kwargs)
d55e5bfc
RD
2857
2858 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 2859 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
5b5c9bc7 2860 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
d55e5bfc 2861
943e8dfd
RD
2862 def RotateHue(*args, **kwargs):
2863 """
2864 RotateHue(self, double angle)
2865
2866 Rotates the hue of each pixel of the image. Hue is a double in the
2867 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2868 """
2869 return _core_.Image_RotateHue(*args, **kwargs)
2870
2871 def RGBtoHSV(*args, **kwargs):
2872 """
2873 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2874
2875 Converts a color in RGB color space to HSV color space.
2876 """
2877 return _core_.Image_RGBtoHSV(*args, **kwargs)
2878
2879 RGBtoHSV = staticmethod(RGBtoHSV)
2880 def HSVtoRGB(*args, **kwargs):
2881 """
2882 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2883
2884 Converts a color in HSV color space to RGB color space.
2885 """
2886 return _core_.Image_HSVtoRGB(*args, **kwargs)
2887
2888 HSVtoRGB = staticmethod(HSVtoRGB)
d55e5bfc 2889 def __nonzero__(self): return self.Ok()
2131d850 2890_core_.Image_swigregister(Image)
d55e5bfc
RD
2891
2892def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
2893 """
2894 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2895
2896 Loads an image from a file, using a MIME type string (such as
2897 'image/jpeg') to specify image type.
2898 """
5b5c9bc7 2899 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
2900 return val
2901
2902def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
2903 """
2904 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2905
2906 Loads an image from an input stream, or any readable Python file-like
2907 object.
2908 """
5b5c9bc7 2909 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
2910 return val
2911
2912def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
2913 """
2914 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2915
2916 Loads an image from an input stream, or any readable Python file-like
2917 object, specifying the image format with a MIME type string.
2918 """
5b5c9bc7 2919 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
2920 return val
2921
d6c14a4c 2922def EmptyImage(*args, **kwargs):
bb2ef2cc 2923 """
5b5c9bc7 2924 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
bb2ef2cc
RD
2925
2926 Construct an empty image of a given size, optionally setting all
2927 pixels to black.
2928 """
5b5c9bc7 2929 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
2930 return val
2931
2932def ImageFromBitmap(*args, **kwargs):
bb2ef2cc 2933 """
5b5c9bc7 2934 ImageFromBitmap(Bitmap bitmap) -> Image
bb2ef2cc
RD
2935
2936 Construct an Image from a `wx.Bitmap`.
2937 """
5b5c9bc7 2938 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
2939 return val
2940
2941def ImageFromData(*args, **kwargs):
bb2ef2cc 2942 """
5b5c9bc7 2943 ImageFromData(int width, int height, buffer data) -> Image
bb2ef2cc
RD
2944
2945 Construct an Image from a buffer of RGB bytes. Accepts either a
2946 string or a buffer object holding the data and the length of the data
2947 must be width*height*3.
2948 """
5b5c9bc7 2949 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
2950 return val
2951
03e46024 2952def ImageFromDataWithAlpha(*args, **kwargs):
bb2ef2cc 2953 """
5b5c9bc7 2954 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
bb2ef2cc
RD
2955
2956 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2957 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
2958 length of the data must be width*height*3 bytes, and the length of the
2959 alpha data must be width*height bytes.
bb2ef2cc 2960 """
5b5c9bc7 2961 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
03e46024
RD
2962 return val
2963
5b5c9bc7 2964def Image_CanRead(*args, **kwargs):
1bd55598 2965 """
7a27cf7c
RD
2966 Image_CanRead(String filename) -> bool
2967
2968 Returns True if the image handlers can read this file.
2969 """
1bd55598 2970 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc 2971
5b5c9bc7 2972def Image_GetImageCount(*args, **kwargs):
1bd55598 2973 """
7a27cf7c
RD
2974 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2975
2976 If the image file contains more than one image and the image handler
2977 is capable of retrieving these individually, this function will return
2978 the number of available images.
2979 """
1bd55598 2980 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc 2981
5b5c9bc7 2982def Image_CanReadStream(*args, **kwargs):
1bd55598 2983 """
7a27cf7c
RD
2984 Image_CanReadStream(InputStream stream) -> bool
2985
2986 Returns True if the image handlers can read an image file from the
2987 data currently on the input stream, or a readable Python file-like
2988 object.
2989 """
1bd55598 2990 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc 2991
5b5c9bc7 2992def Image_AddHandler(*args, **kwargs):
1bd55598
RD
2993 """Image_AddHandler(ImageHandler handler)"""
2994 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc 2995
5b5c9bc7 2996def Image_InsertHandler(*args, **kwargs):
1bd55598
RD
2997 """Image_InsertHandler(ImageHandler handler)"""
2998 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc 2999
5b5c9bc7 3000def Image_RemoveHandler(*args, **kwargs):
1bd55598
RD
3001 """Image_RemoveHandler(String name) -> bool"""
3002 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 3003
1bd55598
RD
3004def Image_GetHandlers(*args):
3005 """Image_GetHandlers() -> PyObject"""
3006 return _core_.Image_GetHandlers(*args)
3007
3008def Image_GetImageExtWildcard(*args):
3009 """
7a27cf7c
RD
3010 Image_GetImageExtWildcard() -> String
3011
3012 Iterates all registered wxImageHandler objects, and returns a string
3013 containing file extension masks suitable for passing to file open/save
3014 dialog boxes.
3015 """
1bd55598 3016 return _core_.Image_GetImageExtWildcard(*args)
d55e5bfc 3017
943e8dfd 3018def Image_RGBtoHSV(*args, **kwargs):
1bd55598 3019 """
943e8dfd
RD
3020 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3021
3022 Converts a color in RGB color space to HSV color space.
3023 """
1bd55598 3024 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3025
3026def Image_HSVtoRGB(*args, **kwargs):
1bd55598 3027 """
943e8dfd
RD
3028 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3029
3030 Converts a color in HSV color space to RGB color space.
3031 """
1bd55598 3032 return _core_.Image_HSVtoRGB(*args, **kwargs)
943e8dfd 3033
68e533f8
RD
3034def InitAllImageHandlers():
3035 """
3036 The former functionality of InitAllImageHanders is now done internal to
3037 the _core_ extension module and so this function has become a simple NOP.
3038 """
3039 pass
d55e5bfc 3040
5b5c9bc7
RD
3041IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3042IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3043PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3044PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3045PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3046BMP_24BPP = _core_.BMP_24BPP
3047BMP_8BPP = _core_.BMP_8BPP
3048BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3049BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3050BMP_8BPP_RED = _core_.BMP_8BPP_RED
3051BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3052BMP_4BPP = _core_.BMP_4BPP
3053BMP_1BPP = _core_.BMP_1BPP
3054BMP_1BPP_BW = _core_.BMP_1BPP_BW
3055class BMPHandler(ImageHandler):
27fb7603 3056 """A `wx.ImageHandler` for \*.bmp bitmap files."""
1bd55598
RD
3057 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3058 __repr__ = _swig_repr
3059 def __init__(self, *args, **kwargs):
27fb7603
RD
3060 """
3061 __init__(self) -> BMPHandler
3062
3063 A `wx.ImageHandler` for \*.bmp bitmap files.
3064 """
1bd55598 3065 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3066_core_.BMPHandler_swigregister(BMPHandler)
5b5c9bc7 3067NullImage = cvar.NullImage
68350608 3068IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3069IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3070IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3071IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3072IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3073IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3074IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3075IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3076IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3077IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3078IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3079IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3080IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
7fbf8399
RD
3081IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3082IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc 3083
5b5c9bc7 3084class ICOHandler(BMPHandler):
27fb7603 3085 """A `wx.ImageHandler` for \*.ico icon files."""
1bd55598
RD
3086 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3087 __repr__ = _swig_repr
3088 def __init__(self, *args, **kwargs):
27fb7603
RD
3089 """
3090 __init__(self) -> ICOHandler
3091
3092 A `wx.ImageHandler` for \*.ico icon files.
3093 """
1bd55598 3094 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3095_core_.ICOHandler_swigregister(ICOHandler)
d55e5bfc 3096
5b5c9bc7 3097class CURHandler(ICOHandler):
27fb7603 3098 """A `wx.ImageHandler` for \*.cur cursor files."""
1bd55598
RD
3099 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3100 __repr__ = _swig_repr
3101 def __init__(self, *args, **kwargs):
27fb7603
RD
3102 """
3103 __init__(self) -> CURHandler
3104
3105 A `wx.ImageHandler` for \*.cur cursor files.
3106 """
1bd55598 3107 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3108_core_.CURHandler_swigregister(CURHandler)
d55e5bfc 3109
5b5c9bc7 3110class ANIHandler(CURHandler):
27fb7603 3111 """A `wx.ImageHandler` for \*.ani animated cursor files."""
1bd55598
RD
3112 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3113 __repr__ = _swig_repr
3114 def __init__(self, *args, **kwargs):
27fb7603
RD
3115 """
3116 __init__(self) -> ANIHandler
3117
3118 A `wx.ImageHandler` for \*.ani animated cursor files.
3119 """
1bd55598 3120 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3121_core_.ANIHandler_swigregister(ANIHandler)
d55e5bfc 3122
5b5c9bc7 3123class PNGHandler(ImageHandler):
27fb7603 3124 """A `wx.ImageHandler` for PNG image files."""
1bd55598
RD
3125 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3126 __repr__ = _swig_repr
3127 def __init__(self, *args, **kwargs):
27fb7603
RD
3128 """
3129 __init__(self) -> PNGHandler
3130
3131 A `wx.ImageHandler` for PNG image files.
3132 """
1bd55598 3133 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3134_core_.PNGHandler_swigregister(PNGHandler)
d55e5bfc 3135
5b5c9bc7 3136class GIFHandler(ImageHandler):
27fb7603 3137 """A `wx.ImageHandler` for GIF image files."""
1bd55598
RD
3138 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3139 __repr__ = _swig_repr
3140 def __init__(self, *args, **kwargs):
27fb7603
RD
3141 """
3142 __init__(self) -> GIFHandler
3143
3144 A `wx.ImageHandler` for GIF image files.
3145 """
1bd55598 3146 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3147_core_.GIFHandler_swigregister(GIFHandler)
d55e5bfc 3148
5b5c9bc7 3149class PCXHandler(ImageHandler):
27fb7603 3150 """A `wx.ImageHandler` for PCX imager files."""
1bd55598
RD
3151 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3152 __repr__ = _swig_repr
3153 def __init__(self, *args, **kwargs):
27fb7603
RD
3154 """
3155 __init__(self) -> PCXHandler
3156
3157 A `wx.ImageHandler` for PCX imager files.
3158 """
1bd55598 3159 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3160_core_.PCXHandler_swigregister(PCXHandler)
d55e5bfc 3161
5b5c9bc7 3162class JPEGHandler(ImageHandler):
27fb7603 3163 """A `wx.ImageHandler` for JPEG/JPG image files."""
1bd55598
RD
3164 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3165 __repr__ = _swig_repr
3166 def __init__(self, *args, **kwargs):
27fb7603
RD
3167 """
3168 __init__(self) -> JPEGHandler
3169
3170 A `wx.ImageHandler` for JPEG/JPG image files.
3171 """
1bd55598 3172 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3173_core_.JPEGHandler_swigregister(JPEGHandler)
d55e5bfc 3174
5b5c9bc7 3175class PNMHandler(ImageHandler):
27fb7603 3176 """A `wx.ImageHandler` for PNM image files."""
1bd55598
RD
3177 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3178 __repr__ = _swig_repr
3179 def __init__(self, *args, **kwargs):
27fb7603
RD
3180 """
3181 __init__(self) -> PNMHandler
3182
3183 A `wx.ImageHandler` for PNM image files.
3184 """
1bd55598 3185 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3186_core_.PNMHandler_swigregister(PNMHandler)
d55e5bfc 3187
5b5c9bc7 3188class XPMHandler(ImageHandler):
27fb7603 3189 """A `wx.ImageHandler` for XPM image."""
1bd55598
RD
3190 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3191 __repr__ = _swig_repr
3192 def __init__(self, *args, **kwargs):
27fb7603
RD
3193 """
3194 __init__(self) -> XPMHandler
3195
3196 A `wx.ImageHandler` for XPM image.
3197 """
1bd55598 3198 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3199_core_.XPMHandler_swigregister(XPMHandler)
d55e5bfc 3200
5b5c9bc7 3201class TIFFHandler(ImageHandler):
27fb7603 3202 """A `wx.ImageHandler` for TIFF image files."""
1bd55598
RD
3203 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3204 __repr__ = _swig_repr
3205 def __init__(self, *args, **kwargs):
27fb7603
RD
3206 """
3207 __init__(self) -> TIFFHandler
3208
3209 A `wx.ImageHandler` for TIFF image files.
3210 """
1bd55598 3211 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3212_core_.TIFFHandler_swigregister(TIFFHandler)
d55e5bfc 3213
5b5c9bc7
RD
3214QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3215QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3216class Quantize(object):
c0de73ae 3217 """Performs quantization, or colour reduction, on a wxImage."""
1bd55598
RD
3218 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3219 def __init__(self): raise AttributeError, "No constructor defined"
3220 __repr__ = _swig_repr
c0de73ae
RD
3221 def Quantize(*args, **kwargs):
3222 """
5b5c9bc7 3223 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3224
3225 Reduce the colours in the source image and put the result into the
3226 destination image, setting the palette in the destination if
3227 needed. Both images may be the same, to overwrite the source image.
3228 """
5b5c9bc7 3229 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae
RD
3230
3231 Quantize = staticmethod(Quantize)
2131d850 3232_core_.Quantize_swigregister(Quantize)
c0de73ae 3233
5b5c9bc7 3234def Quantize_Quantize(*args, **kwargs):
1bd55598 3235 """
5b5c9bc7 3236 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3237
3238 Reduce the colours in the source image and put the result into the
3239 destination image, setting the palette in the destination if
3240 needed. Both images may be the same, to overwrite the source image.
3241 """
1bd55598 3242 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3243
d55e5bfc
RD
3244#---------------------------------------------------------------------------
3245
5b5c9bc7
RD
3246class EvtHandler(Object):
3247 """Proxy of C++ EvtHandler class"""
1bd55598
RD
3248 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3249 __repr__ = _swig_repr
3250 def __init__(self, *args, **kwargs):
5b5c9bc7 3251 """__init__(self) -> EvtHandler"""
1bd55598 3252 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d55e5bfc 3253 def GetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3254 """GetNextHandler(self) -> EvtHandler"""
3255 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
d55e5bfc
RD
3256
3257 def GetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3258 """GetPreviousHandler(self) -> EvtHandler"""
3259 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3260
3261 def SetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3262 """SetNextHandler(self, EvtHandler handler)"""
3263 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
d55e5bfc
RD
3264
3265 def SetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3266 """SetPreviousHandler(self, EvtHandler handler)"""
3267 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3268
3269 def GetEvtHandlerEnabled(*args, **kwargs):
3270 """GetEvtHandlerEnabled(self) -> bool"""
5b5c9bc7 3271 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3272
3273 def SetEvtHandlerEnabled(*args, **kwargs):
3274 """SetEvtHandlerEnabled(self, bool enabled)"""
5b5c9bc7 3275 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3276
3277 def ProcessEvent(*args, **kwargs):
5b5c9bc7
RD
3278 """ProcessEvent(self, Event event) -> bool"""
3279 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
d55e5bfc
RD
3280
3281 def AddPendingEvent(*args, **kwargs):
5b5c9bc7
RD
3282 """AddPendingEvent(self, Event event)"""
3283 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
d55e5bfc
RD
3284
3285 def ProcessPendingEvents(*args, **kwargs):
3286 """ProcessPendingEvents(self)"""
5b5c9bc7 3287 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
3288
3289 def Connect(*args, **kwargs):
3290 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
5b5c9bc7 3291 return _core_.EvtHandler_Connect(*args, **kwargs)
d55e5bfc
RD
3292
3293 def Disconnect(*args, **kwargs):
2131d850 3294 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
5b5c9bc7 3295 return _core_.EvtHandler_Disconnect(*args, **kwargs)
d55e5bfc
RD
3296
3297 def _setOORInfo(*args, **kwargs):
36ed4f51 3298 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3299 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3300 args[0].thisown = 0
3301 return val
d55e5bfc
RD
3302
3303 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3304 """
3305 Bind an event to an event handler.
3306
a5ee0656
RD
3307 :param event: One of the EVT_* objects that specifies the
3308 type of event to bind,
d55e5bfc 3309
a5ee0656
RD
3310 :param handler: A callable object to be invoked when the
3311 event is delivered to self. Pass None to
3312 disconnect an event handler.
d55e5bfc 3313
a5ee0656
RD
3314 :param source: Sometimes the event originates from a
3315 different window than self, but you still
3316 want to catch it in self. (For example, a
3317 button event delivered to a frame.) By
3318 passing the source of the event, the event
3319 handling system is able to differentiate
3320 between the same event type from different
3321 controls.
d55e5bfc 3322
a5ee0656
RD
3323 :param id: Used to spcify the event source by ID instead
3324 of instance.
3325
3326 :param id2: Used when it is desirable to bind a handler
3327 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3328 """
3329 if source is not None:
3330 id = source.GetId()
3331 event.Bind(self, id, id2, handler)
3332
d6c14a4c
RD
3333 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3334 """
3335 Disconencts the event handler binding for event from self.
3336 Returns True if successful.
3337 """
3338 if source is not None:
3339 id = source.GetId()
3340 return event.Unbind(self, id, id2)
d55e5bfc 3341
2131d850 3342_core_.EvtHandler_swigregister(EvtHandler)
d55e5bfc
RD
3343
3344#---------------------------------------------------------------------------
3345
3346class PyEventBinder(object):
3347 """
3348 Instances of this class are used to bind specific events to event
3349 handlers.
3350 """
3351 def __init__(self, evtType, expectedIDs=0):
3352 if expectedIDs not in [0, 1, 2]:
3353 raise ValueError, "Invalid number of expectedIDs"
3354 self.expectedIDs = expectedIDs
3355
3356 if type(evtType) == list or type(evtType) == tuple:
3357 self.evtType = evtType
3358 else:
3359 self.evtType = [evtType]
3360
3361
3362 def Bind(self, target, id1, id2, function):
3363 """Bind this set of event types to target."""
3364 for et in self.evtType:
3365 target.Connect(id1, id2, et, function)
3366
d6c14a4c
RD
3367
3368 def Unbind(self, target, id1, id2):
3369 """Remove an event binding."""
3370 success = 0
3371 for et in self.evtType:
3372 success += target.Disconnect(id1, id2, et)
3373 return success != 0
3374
d55e5bfc
RD
3375
3376 def __call__(self, *args):
3377 """
3378 For backwards compatibility with the old EVT_* functions.
3379 Should be called with either (window, func), (window, ID,
3380 func) or (window, ID1, ID2, func) parameters depending on the
3381 type of the event.
3382 """
3383 assert len(args) == 2 + self.expectedIDs
3384 id1 = wx.ID_ANY
3385 id2 = wx.ID_ANY
3386 target = args[0]
3387 if self.expectedIDs == 0:
3388 func = args[1]
3389 elif self.expectedIDs == 1:
3390 id1 = args[1]
3391 func = args[2]
3392 elif self.expectedIDs == 2:
3393 id1 = args[1]
3394 id2 = args[2]
3395 func = args[3]
3396 else:
3397 raise ValueError, "Unexpected number of IDs"
3398
3399 self.Bind(target, id1, id2, func)
3400
3401
3402# These two are square pegs that don't fit the PyEventBinder hole...
3403def EVT_COMMAND(win, id, cmd, func):
3404 win.Connect(id, -1, cmd, func)
3405def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3406 win.Connect(id1, id2, cmd, func)
3407
3408
3409#---------------------------------------------------------------------------
3410
3411#---------------------------------------------------------------------------
3412
5b5c9bc7
RD
3413EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3414EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3415
1bd55598 3416def NewEventType(*args):
2131d850 3417 """NewEventType() -> EventType"""
1bd55598 3418 return _core_.NewEventType(*args)
5b5c9bc7
RD
3419wxEVT_NULL = _core_.wxEVT_NULL
3420wxEVT_FIRST = _core_.wxEVT_FIRST
3421wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3422wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3423wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3424wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3425wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3426wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3427wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3428wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3429wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3430wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3431wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3432wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3433wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3434wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3435wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3436wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3437wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3438wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3439wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3440wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3441wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3442wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3443wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3444wxEVT_MOTION = _core_.wxEVT_MOTION
3445wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3446wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3447wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3448wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3449wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3450wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3451wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3452wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3453wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3454wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3455wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3456wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3457wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3458wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3459wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3460wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3461wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3462wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3463wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3464wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3465wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3466wxEVT_CHAR = _core_.wxEVT_CHAR
3467wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3468wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3469wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3470wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3471wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3472wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3473wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3474wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3475wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3476wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3477wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3478wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3479wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3480wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3481wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3482wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
5b5c9bc7
RD
3483wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3484wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3485wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3486wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3487wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3488wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3489wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3490wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3491wxEVT_SIZE = _core_.wxEVT_SIZE
3492wxEVT_MOVE = _core_.wxEVT_MOVE
3493wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3494wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3495wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3496wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
5b5c9bc7
RD
3497wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3498wxEVT_CREATE = _core_.wxEVT_CREATE
3499wxEVT_DESTROY = _core_.wxEVT_DESTROY
3500wxEVT_SHOW = _core_.wxEVT_SHOW
3501wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3502wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3503wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3504wxEVT_PAINT = _core_.wxEVT_PAINT
3505wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3506wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3507wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3508wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3509wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3510wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3511wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3512wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3513wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3514wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3515wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3516wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3517wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3518wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3519wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3520wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3521wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3522wxEVT_IDLE = _core_.wxEVT_IDLE
3523wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3524wxEVT_SIZING = _core_.wxEVT_SIZING
3525wxEVT_MOVING = _core_.wxEVT_MOVING
3526wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
3527wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3528wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3529wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
5b5c9bc7
RD
3530wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3531wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3532wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3533wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3534wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3535wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3536wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d55e5bfc
RD
3537#
3538# Create some event binders
3539EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3540EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3541EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3542EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3543EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3544EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3545EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3546EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3547EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3548EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3549EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3550EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3551EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 3552EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d55e5bfc
RD
3553EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3554EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3555EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3556EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3557EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3558EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3559EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3560EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3561EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3562EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 3563EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3564EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3565EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3566EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3567EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3568EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3569EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3570EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3571EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3572EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3573EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3574EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3575EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3576EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3577EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3578EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3579EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3580
3581EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3582EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3583EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3584EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3585EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3586EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3587EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3588EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3589EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3590EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3591EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3592EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3593EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3594
3595EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3596 wxEVT_LEFT_UP,
3597 wxEVT_MIDDLE_DOWN,
3598 wxEVT_MIDDLE_UP,
3599 wxEVT_RIGHT_DOWN,
3600 wxEVT_RIGHT_UP,
3601 wxEVT_MOTION,
3602 wxEVT_LEFT_DCLICK,
3603 wxEVT_MIDDLE_DCLICK,
3604 wxEVT_RIGHT_DCLICK,
3605 wxEVT_ENTER_WINDOW,
3606 wxEVT_LEAVE_WINDOW,
3607 wxEVT_MOUSEWHEEL
3608 ])
3609
3610
3611# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 3612EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d55e5bfc
RD
3613 wxEVT_SCROLLWIN_BOTTOM,
3614 wxEVT_SCROLLWIN_LINEUP,
3615 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 3616 wxEVT_SCROLLWIN_PAGEUP,
d55e5bfc
RD
3617 wxEVT_SCROLLWIN_PAGEDOWN,
3618 wxEVT_SCROLLWIN_THUMBTRACK,
3619 wxEVT_SCROLLWIN_THUMBRELEASE,
3620 ])
3621
3622EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3623EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3624EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3625EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3626EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3627EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3628EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3629EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3630
27fb7603 3631# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
3632EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3633 wxEVT_SCROLL_BOTTOM,
3634 wxEVT_SCROLL_LINEUP,
3635 wxEVT_SCROLL_LINEDOWN,
3636 wxEVT_SCROLL_PAGEUP,
3637 wxEVT_SCROLL_PAGEDOWN,
3638 wxEVT_SCROLL_THUMBTRACK,
3639 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3640 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3641 ])
3642
3643EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3644EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3645EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3646EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3647EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3648EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3649EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3650EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3651EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3652EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 3653
27fb7603 3654# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
3655EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3656 wxEVT_SCROLL_BOTTOM,
3657 wxEVT_SCROLL_LINEUP,
3658 wxEVT_SCROLL_LINEDOWN,
3659 wxEVT_SCROLL_PAGEUP,
3660 wxEVT_SCROLL_PAGEDOWN,
3661 wxEVT_SCROLL_THUMBTRACK,
d55e5bfc 3662 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3663 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3664 ], 1)
3665
3666EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3667EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3668EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3669EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3670EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3671EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3672EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3673EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3674EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3675EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
3676
3677EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3678EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3679EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3680EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3681EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3682EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3683EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3684EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3685EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3686EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3687
3688EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3689EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3690EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3691EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3692EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3693EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3694EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3695EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3696EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3697
3698
3699EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3700EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3701EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3702EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3703EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3704EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3705EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3706
3707EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3708
3709EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3710EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3711
3712EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3713
2131d850
RD
3714EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3715EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3716EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d55e5bfc
RD
3717
3718
3719#---------------------------------------------------------------------------
3720
5b5c9bc7 3721class Event(Object):
27fb7603
RD
3722 """
3723 An event is a structure holding information about an event passed to a
3724 callback or member function. wx.Event is an abstract base class for
3725 other event classes
3726 """
1bd55598
RD
3727 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3728 def __init__(self): raise AttributeError, "No constructor defined"
3729 __repr__ = _swig_repr
3730 __swig_destroy__ = _core_.delete_Event
3731 __del__ = lambda self : None;
d55e5bfc 3732 def SetEventType(*args, **kwargs):
27fb7603 3733 """
2131d850 3734 SetEventType(self, EventType typ)
27fb7603
RD
3735
3736 Sets the specific type of the event.
3737 """
5b5c9bc7 3738 return _core_.Event_SetEventType(*args, **kwargs)
d55e5bfc
RD
3739
3740 def GetEventType(*args, **kwargs):
27fb7603 3741 """
2131d850 3742 GetEventType(self) -> EventType
27fb7603
RD
3743
3744 Returns the identifier of the given event type, such as
3745 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3746 """
5b5c9bc7 3747 return _core_.Event_GetEventType(*args, **kwargs)
d55e5bfc
RD
3748
3749 def GetEventObject(*args, **kwargs):
27fb7603
RD
3750 """
3751 GetEventObject(self) -> Object
3752
3753 Returns the object (usually a window) associated with the event, if
3754 any.
3755 """
5b5c9bc7 3756 return _core_.Event_GetEventObject(*args, **kwargs)
d55e5bfc
RD
3757
3758 def SetEventObject(*args, **kwargs):
27fb7603
RD
3759 """
3760 SetEventObject(self, Object obj)
3761
3762 Sets the originating object, or in other words, obj is normally the
3763 object that is sending the event.
3764 """
5b5c9bc7 3765 return _core_.Event_SetEventObject(*args, **kwargs)
d55e5bfc
RD
3766
3767 def GetTimestamp(*args, **kwargs):
3768 """GetTimestamp(self) -> long"""
5b5c9bc7 3769 return _core_.Event_GetTimestamp(*args, **kwargs)
d55e5bfc
RD
3770
3771 def SetTimestamp(*args, **kwargs):
3772 """SetTimestamp(self, long ts=0)"""
5b5c9bc7 3773 return _core_.Event_SetTimestamp(*args, **kwargs)
d55e5bfc
RD
3774
3775 def GetId(*args, **kwargs):
27fb7603
RD
3776 """
3777 GetId(self) -> int
3778
3779 Returns the identifier associated with this event, such as a button
3780 command id.
3781 """
5b5c9bc7 3782 return _core_.Event_GetId(*args, **kwargs)
d55e5bfc
RD
3783
3784 def SetId(*args, **kwargs):
27fb7603
RD
3785 """
3786 SetId(self, int Id)
3787
3788 Set's the ID for the event. This is usually the ID of the window that
3789 is sending the event, but it can also be a command id from a menu
3790 item, etc.
3791 """
5b5c9bc7 3792 return _core_.Event_SetId(*args, **kwargs)
d55e5bfc
RD
3793
3794 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
3795 """
3796 IsCommandEvent(self) -> bool
3797
3798 Returns true if the event is or is derived from `wx.CommandEvent` else
3799 it returns false. Note: Exists only for optimization purposes.
3800 """
5b5c9bc7 3801 return _core_.Event_IsCommandEvent(*args, **kwargs)
d55e5bfc
RD
3802
3803 def Skip(*args, **kwargs):
51b83b37
RD
3804 """
3805 Skip(self, bool skip=True)
3806
3807 Called by an event handler, it controls whether additional event
3808 handlers bound to this event will be called after the current event
3809 handler returns. Skip(false) (the default setting) will prevent
3810 additional event handlers from being called and control will be
3811 returned to the sender of the event immediately after the current
3812 handler has finished. Skip(True) will cause the event processing
3813 system to continue searching for a handler function for this event.
3814
3815 """
5b5c9bc7 3816 return _core_.Event_Skip(*args, **kwargs)
d55e5bfc
RD
3817
3818 def GetSkipped(*args, **kwargs):
27fb7603
RD
3819 """
3820 GetSkipped(self) -> bool
3821
3822 Returns true if the event handler should be skipped, false otherwise.
3823 :see: `Skip`
3824 """
5b5c9bc7 3825 return _core_.Event_GetSkipped(*args, **kwargs)
d55e5bfc
RD
3826
3827 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
3828 """
3829 ShouldPropagate(self) -> bool
3830
3831 Test if this event should be propagated to the parent window or not,
3832 i.e. if the propagation level is currently greater than 0.
3833 """
5b5c9bc7 3834 return _core_.Event_ShouldPropagate(*args, **kwargs)
d55e5bfc
RD
3835
3836 def StopPropagation(*args, **kwargs):
27fb7603
RD
3837 """
3838 StopPropagation(self) -> int
3839
3840 Stop the event from propagating to its parent window. Returns the old
3841 propagation level value which may be later passed to
3842 `ResumePropagation` to allow propagating the event again.
3843 """
5b5c9bc7 3844 return _core_.Event_StopPropagation(*args, **kwargs)
d55e5bfc
RD
3845
3846 def ResumePropagation(*args, **kwargs):
27fb7603
RD
3847 """
3848 ResumePropagation(self, int propagationLevel)
3849
3850 Resume the event propagation by restoring the propagation level. (For
3851 example, you can use the value returned by an earlier call to
3852 `StopPropagation`.)
3853
3854 """
5b5c9bc7 3855 return _core_.Event_ResumePropagation(*args, **kwargs)
d55e5bfc
RD
3856
3857 def Clone(*args, **kwargs):
5b5c9bc7
RD
3858 """Clone(self) -> Event"""
3859 return _core_.Event_Clone(*args, **kwargs)
d55e5bfc 3860
2131d850 3861_core_.Event_swigregister(Event)
d55e5bfc
RD
3862
3863#---------------------------------------------------------------------------
3864
5b5c9bc7 3865class PropagationDisabler(object):
27fb7603
RD
3866 """
3867 Helper class to temporarily change an event not to propagate. Simply
3868 create an instance of this class and then whe it is destroyed the
3869 propogation of the event will be restored.
3870 """
1bd55598
RD
3871 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3872 __repr__ = _swig_repr
3873 def __init__(self, *args, **kwargs):
27fb7603
RD
3874 """
3875 __init__(self, Event event) -> PropagationDisabler
3876
3877 Helper class to temporarily change an event not to propagate. Simply
3878 create an instance of this class and then whe it is destroyed the
3879 propogation of the event will be restored.
3880 """
1bd55598
RD
3881 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3882 __swig_destroy__ = _core_.delete_PropagationDisabler
3883 __del__ = lambda self : None;
2131d850 3884_core_.PropagationDisabler_swigregister(PropagationDisabler)
d55e5bfc 3885
5b5c9bc7 3886class PropagateOnce(object):
27fb7603
RD
3887 """
3888 A helper class that will temporarily lower propagation level of an
3889 event. Simply create an instance of this class and then whe it is
3890 destroyed the propogation of the event will be restored.
3891 """
1bd55598
RD
3892 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3893 __repr__ = _swig_repr
3894 def __init__(self, *args, **kwargs):
27fb7603
RD
3895 """
3896 __init__(self, Event event) -> PropagateOnce
3897
3898 A helper class that will temporarily lower propagation level of an
3899 event. Simply create an instance of this class and then whe it is
3900 destroyed the propogation of the event will be restored.
3901 """
1bd55598
RD
3902 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3903 __swig_destroy__ = _core_.delete_PropagateOnce
3904 __del__ = lambda self : None;
2131d850 3905_core_.PropagateOnce_swigregister(PropagateOnce)
d55e5bfc
RD
3906
3907#---------------------------------------------------------------------------
3908
5b5c9bc7 3909class CommandEvent(Event):
27fb7603
RD
3910 """
3911 This event class contains information about command events, which
3912 originate from a variety of simple controls, as well as menus and
3913 toolbars.
3914 """
1bd55598
RD
3915 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3916 __repr__ = _swig_repr
3917 def __init__(self, *args, **kwargs):
27fb7603 3918 """
2131d850 3919 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
3920
3921 This event class contains information about command events, which
3922 originate from a variety of simple controls, as well as menus and
3923 toolbars.
3924 """
1bd55598 3925 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
d55e5bfc 3926 def GetSelection(*args, **kwargs):
27fb7603
RD
3927 """
3928 GetSelection(self) -> int
3929
3930 Returns item index for a listbox or choice selection event (not valid
3931 for a deselection).
3932 """
5b5c9bc7 3933 return _core_.CommandEvent_GetSelection(*args, **kwargs)
d55e5bfc
RD
3934
3935 def SetString(*args, **kwargs):
5b5c9bc7
RD
3936 """SetString(self, String s)"""
3937 return _core_.CommandEvent_SetString(*args, **kwargs)
d55e5bfc
RD
3938
3939 def GetString(*args, **kwargs):
27fb7603
RD
3940 """
3941 GetString(self) -> String
3942
3943 Returns item string for a listbox or choice selection event (not valid
3944 for a deselection).
3945 """
5b5c9bc7 3946 return _core_.CommandEvent_GetString(*args, **kwargs)
d55e5bfc
RD
3947
3948 def IsChecked(*args, **kwargs):
27fb7603
RD
3949 """
3950 IsChecked(self) -> bool
3951
3952 This method can be used with checkbox and menu events: for the
3953 checkboxes, the method returns true for a selection event and false
3954 for a deselection one. For the menu events, this method indicates if
3955 the menu item just has become checked or unchecked (and thus only
3956 makes sense for checkable menu items).
3957 """
5b5c9bc7 3958 return _core_.CommandEvent_IsChecked(*args, **kwargs)
d55e5bfc
RD
3959
3960 Checked = IsChecked
3961 def IsSelection(*args, **kwargs):
27fb7603
RD
3962 """
3963 IsSelection(self) -> bool
3964
3965 For a listbox or similar event, returns true if it is a selection,
3966 false if it is a deselection.
3967 """
5b5c9bc7 3968 return _core_.CommandEvent_IsSelection(*args, **kwargs)
d55e5bfc
RD
3969
3970 def SetExtraLong(*args, **kwargs):
3971 """SetExtraLong(self, long extraLong)"""
5b5c9bc7 3972 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
d55e5bfc
RD
3973
3974 def GetExtraLong(*args, **kwargs):
27fb7603
RD
3975 """
3976 GetExtraLong(self) -> long
3977
5ba5649b
RD
3978 Returns extra information dependant on the event objects type. If the
3979 event comes from a listbox selection, it is a boolean determining
3980 whether the event was a selection (true) or a deselection (false). A
3981 listbox deselection only occurs for multiple-selection boxes, and in
3982 this case the index and string values are indeterminate and the
3983 listbox must be examined by the application.
27fb7603 3984 """
5b5c9bc7 3985 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
d55e5bfc
RD
3986
3987 def SetInt(*args, **kwargs):
3988 """SetInt(self, int i)"""
5b5c9bc7 3989 return _core_.CommandEvent_SetInt(*args, **kwargs)
d55e5bfc
RD
3990
3991 def GetInt(*args, **kwargs):
27fb7603 3992 """
2131d850 3993 GetInt(self) -> int
27fb7603 3994
5ba5649b
RD
3995 Returns the integer identifier corresponding to a listbox, choice or
3996 radiobox selection (only if the event was a selection, not a
3997 deselection), or a boolean value representing the value of a checkbox.
27fb7603 3998 """
5b5c9bc7 3999 return _core_.CommandEvent_GetInt(*args, **kwargs)
d55e5bfc 4000
1bd55598
RD
4001 def GetClientData(*args, **kwargs):
4002 """
4003 GetClientData(self) -> PyObject
4004
4005 Returns the client data object for a listbox or choice selection event, (if any.)
4006 """
4007 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4008
4009 def SetClientData(*args, **kwargs):
4010 """
4011 SetClientData(self, PyObject clientData)
4012
4013 Associate the given client data with the item at position n.
4014 """
4015 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4016
4017 GetClientObject = GetClientData
4018 SetClientObject = SetClientData
4019
d55e5bfc 4020 def Clone(*args, **kwargs):
5b5c9bc7
RD
4021 """Clone(self) -> Event"""
4022 return _core_.CommandEvent_Clone(*args, **kwargs)
d55e5bfc 4023
2131d850 4024_core_.CommandEvent_swigregister(CommandEvent)
d55e5bfc
RD
4025
4026#---------------------------------------------------------------------------
4027
5b5c9bc7 4028class NotifyEvent(CommandEvent):
27fb7603
RD
4029 """
4030 An instance of this class (or one of its derived classes) is sent from
4031 a control when the control's state is being changed and the control
4032 allows that change to be prevented from happening. The event handler
4033 can call `Veto` or `Allow` to tell the control what to do.
4034 """
1bd55598
RD
4035 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4036 __repr__ = _swig_repr
4037 def __init__(self, *args, **kwargs):
27fb7603 4038 """
2131d850 4039 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4040
4041 An instance of this class (or one of its derived classes) is sent from
4042 a control when the control's state is being changed and the control
4043 allows that change to be prevented from happening. The event handler
4044 can call `Veto` or `Allow` to tell the control what to do.
4045 """
1bd55598 4046 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
d55e5bfc 4047 def Veto(*args, **kwargs):
27fb7603
RD
4048 """
4049 Veto(self)
4050
4051 Prevents the change announced by this event from happening.
4052
4053 It is in general a good idea to notify the user about the reasons for
4054 vetoing the change because otherwise the applications behaviour (which
4055 just refuses to do what the user wants) might be quite surprising.
4056 """
5b5c9bc7 4057 return _core_.NotifyEvent_Veto(*args, **kwargs)
d55e5bfc
RD
4058
4059 def Allow(*args, **kwargs):
27fb7603
RD
4060 """
4061 Allow(self)
4062
4063 This is the opposite of `Veto`: it explicitly allows the event to be
4064 processed. For most events it is not necessary to call this method as
4065 the events are allowed anyhow but some are forbidden by default (this
4066 will be mentioned in the corresponding event description).
4067 """
5b5c9bc7 4068 return _core_.NotifyEvent_Allow(*args, **kwargs)
d55e5bfc
RD
4069
4070 def IsAllowed(*args, **kwargs):
27fb7603
RD
4071 """
4072 IsAllowed(self) -> bool
4073
4074 Returns true if the change is allowed (`Veto` hasn't been called) or
4075 false otherwise (if it was).
4076 """
5b5c9bc7 4077 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
d55e5bfc 4078
2131d850 4079_core_.NotifyEvent_swigregister(NotifyEvent)
d55e5bfc
RD
4080
4081#---------------------------------------------------------------------------
4082
5b5c9bc7 4083class ScrollEvent(CommandEvent):
27fb7603
RD
4084 """
4085 A scroll event holds information about events sent from stand-alone
4086 scrollbars and sliders. Note that scrolled windows do not send
4087 instnaces of this event class, but send the `wx.ScrollWinEvent`
4088 instead.
4089 """
1bd55598
RD
4090 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4091 __repr__ = _swig_repr
4092 def __init__(self, *args, **kwargs):
d55e5bfc 4093 """
2131d850 4094 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
5b5c9bc7 4095 int orient=0) -> ScrollEvent
d55e5bfc 4096 """
1bd55598 4097 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
d55e5bfc 4098 def GetOrientation(*args, **kwargs):
27fb7603
RD
4099 """
4100 GetOrientation(self) -> int
4101
4102 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4103 the scrollbar.
4104 """
5b5c9bc7 4105 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4106
4107 def GetPosition(*args, **kwargs):
27fb7603
RD
4108 """
4109 GetPosition(self) -> int
4110
4111 Returns the position of the scrollbar.
4112 """
5b5c9bc7 4113 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4114
4115 def SetOrientation(*args, **kwargs):
4116 """SetOrientation(self, int orient)"""
5b5c9bc7 4117 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4118
4119 def SetPosition(*args, **kwargs):
4120 """SetPosition(self, int pos)"""
5b5c9bc7 4121 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
d55e5bfc 4122
2131d850 4123_core_.ScrollEvent_swigregister(ScrollEvent)
d55e5bfc
RD
4124
4125#---------------------------------------------------------------------------
4126
5b5c9bc7 4127class ScrollWinEvent(Event):
27fb7603
RD
4128 """
4129 A wx.ScrollWinEvent holds information about scrolling and is sent from
4130 scrolling windows.
4131 """
1bd55598
RD
4132 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4133 __repr__ = _swig_repr
4134 def __init__(self, *args, **kwargs):
27fb7603 4135 """
2131d850 4136 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4137
4138 A wx.ScrollWinEvent holds information about scrolling and is sent from
4139 scrolling windows.
4140 """
1bd55598 4141 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
d55e5bfc 4142 def GetOrientation(*args, **kwargs):
27fb7603
RD
4143 """
4144 GetOrientation(self) -> int
4145
4146 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4147 the scrollbar.
4148 """
5b5c9bc7 4149 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4150
4151 def GetPosition(*args, **kwargs):
27fb7603
RD
4152 """
4153 GetPosition(self) -> int
4154
4155 Returns the position of the scrollbar for the thumb track and release
4156 events. Note that this field can't be used for the other events, you
4157 need to query the window itself for the current position in that case.
4158 """
5b5c9bc7 4159 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4160
4161 def SetOrientation(*args, **kwargs):
4162 """SetOrientation(self, int orient)"""
5b5c9bc7 4163 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4164
4165 def SetPosition(*args, **kwargs):
4166 """SetPosition(self, int pos)"""
5b5c9bc7 4167 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
d55e5bfc 4168
2131d850 4169_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d55e5bfc
RD
4170
4171#---------------------------------------------------------------------------
4172
5b5c9bc7
RD
4173MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4174MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4175MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4176MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4177MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4178class MouseEvent(Event):
27fb7603
RD
4179 """
4180 This event class contains information about the events generated by
4181 the mouse: they include mouse buttons press and release events and
4182 mouse move events.
4183
4184 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4185 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4186 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4187 a middle button so a portable application should avoid relying on the
4188 events from it.
4189
4190 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4191 the former returns true when the event corresponds to the left mouse
4192 button click while the latter returns true if the left mouse button is
4193 currently being pressed. For example, when the user is dragging the
4194 mouse you can use `LeftIsDown` to test whether the left mouse button
4195 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4196 `LeftIsDown` will also return true in wxWidgets whatever the
4197 underlying GUI behaviour is (which is platform-dependent). The same
4198 applies, of course, to other mouse buttons as well.
4199 """
1bd55598
RD
4200 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4201 __repr__ = _swig_repr
4202 def __init__(self, *args, **kwargs):
27fb7603 4203 """
2131d850 4204 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4205
4206 Constructs a wx.MouseEvent. Valid event types are:
4207
4208 * wxEVT_ENTER_WINDOW
4209 * wxEVT_LEAVE_WINDOW
4210 * wxEVT_LEFT_DOWN
4211 * wxEVT_LEFT_UP
4212 * wxEVT_LEFT_DCLICK
4213 * wxEVT_MIDDLE_DOWN
4214 * wxEVT_MIDDLE_UP
4215 * wxEVT_MIDDLE_DCLICK
4216 * wxEVT_RIGHT_DOWN
4217 * wxEVT_RIGHT_UP
4218 * wxEVT_RIGHT_DCLICK
4219 * wxEVT_MOTION
4220 * wxEVT_MOUSEWHEEL
4221 """
1bd55598 4222 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
d55e5bfc 4223 def IsButton(*args, **kwargs):
27fb7603
RD
4224 """
4225 IsButton(self) -> bool
4226
4227 Returns true if the event was a mouse button event (not necessarily a
4228 button down event - that may be tested using `ButtonDown`).
4229 """
5b5c9bc7 4230 return _core_.MouseEvent_IsButton(*args, **kwargs)
d55e5bfc
RD
4231
4232 def ButtonDown(*args, **kwargs):
27fb7603
RD
4233 """
4234 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4235
5ba5649b
RD
4236 If the argument is omitted, this returns true if the event was any
4237 mouse button down event. Otherwise the argument specifies which
4238 button-down event shold be checked for (see `Button` for the possible
4239 values).
27fb7603 4240 """
5b5c9bc7 4241 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
d55e5bfc
RD
4242
4243 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4244 """
4245 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4246
4247 If the argument is omitted, this returns true if the event was any
4248 mouse double click event. Otherwise the argument specifies which
4249 double click event to check for (see `Button` for the possible
4250 values).
4251 """
5b5c9bc7 4252 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
d55e5bfc
RD
4253
4254 def ButtonUp(*args, **kwargs):
27fb7603
RD
4255 """
4256 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4257
4258 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4259 mouse button up event. Otherwise the argument specifies which button
4260 up event to check for (see `Button` for the possible values).
27fb7603 4261 """
5b5c9bc7 4262 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
d55e5bfc
RD
4263
4264 def Button(*args, **kwargs):
27fb7603
RD
4265 """
4266 Button(self, int button) -> bool
4267
4268 Returns true if the identified mouse button is changing state. Valid
4269 values of button are:
4270
4271 ==================== =====================================
4272 wx.MOUSE_BTN_LEFT check if left button was pressed
4273 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4274 wx.MOUSE_BTN_RIGHT check if right button was pressed
4275 wx.MOUSE_BTN_ANY check if any button was pressed
4276 ==================== =====================================
4277
4278 """
5b5c9bc7 4279 return _core_.MouseEvent_Button(*args, **kwargs)
d55e5bfc
RD
4280
4281 def ButtonIsDown(*args, **kwargs):
4282 """ButtonIsDown(self, int but) -> bool"""
5b5c9bc7 4283 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
d55e5bfc
RD
4284
4285 def GetButton(*args, **kwargs):
27fb7603
RD
4286 """
4287 GetButton(self) -> int
4288
4289 Returns the mouse button which generated this event or
4290 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4291 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4292 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4293 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4294 right buttons respectively.
4295 """
5b5c9bc7 4296 return _core_.MouseEvent_GetButton(*args, **kwargs)
d55e5bfc
RD
4297
4298 def ControlDown(*args, **kwargs):
27fb7603
RD
4299 """
4300 ControlDown(self) -> bool
4301
4302 Returns true if the control key was down at the time of the event.
4303 """
5b5c9bc7 4304 return _core_.MouseEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4305
4306 def MetaDown(*args, **kwargs):
27fb7603
RD
4307 """
4308 MetaDown(self) -> bool
4309
4310 Returns true if the Meta key was down at the time of the event.
4311 """
5b5c9bc7 4312 return _core_.MouseEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4313
4314 def AltDown(*args, **kwargs):
27fb7603
RD
4315 """
4316 AltDown(self) -> bool
4317
4318 Returns true if the Alt key was down at the time of the event.
4319 """
5b5c9bc7 4320 return _core_.MouseEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4321
4322 def ShiftDown(*args, **kwargs):
27fb7603
RD
4323 """
4324 ShiftDown(self) -> bool
4325
4326 Returns true if the Shift key was down at the time of the event.
4327 """
5b5c9bc7 4328 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4329
412d302d
RD
4330 def CmdDown(*args, **kwargs):
4331 """
4332 CmdDown(self) -> bool
4333
4334 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4335 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4336 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4337 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4338 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4339 purpose. So for non-Mac platforms this is the same as `ControlDown`
4340 and Macs this is the same as `MetaDown`.
4341 """
5b5c9bc7 4342 return _core_.MouseEvent_CmdDown(*args, **kwargs)
412d302d 4343
d55e5bfc 4344 def LeftDown(*args, **kwargs):
27fb7603
RD
4345 """
4346 LeftDown(self) -> bool
4347
4348 Returns true if the left mouse button state changed to down.
4349 """
5b5c9bc7 4350 return _core_.MouseEvent_LeftDown(*args, **kwargs)
d55e5bfc
RD
4351
4352 def MiddleDown(*args, **kwargs):
27fb7603
RD
4353 """
4354 MiddleDown(self) -> bool
4355
4356 Returns true if the middle mouse button state changed to down.
4357 """
5b5c9bc7 4358 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
d55e5bfc
RD
4359
4360 def RightDown(*args, **kwargs):
27fb7603
RD
4361 """
4362 RightDown(self) -> bool
4363
4364 Returns true if the right mouse button state changed to down.
4365 """
5b5c9bc7 4366 return _core_.MouseEvent_RightDown(*args, **kwargs)
d55e5bfc
RD
4367
4368 def LeftUp(*args, **kwargs):
27fb7603
RD
4369 """
4370 LeftUp(self) -> bool
4371
4372 Returns true if the left mouse button state changed to up.
4373 """
5b5c9bc7 4374 return _core_.MouseEvent_LeftUp(*args, **kwargs)
d55e5bfc
RD
4375
4376 def MiddleUp(*args, **kwargs):
27fb7603
RD
4377 """
4378 MiddleUp(self) -> bool
4379
4380 Returns true if the middle mouse button state changed to up.
4381 """
5b5c9bc7 4382 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
d55e5bfc
RD
4383
4384 def RightUp(*args, **kwargs):
27fb7603
RD
4385 """
4386 RightUp(self) -> bool
4387
4388 Returns true if the right mouse button state changed to up.
4389 """
5b5c9bc7 4390 return _core_.MouseEvent_RightUp(*args, **kwargs)
d55e5bfc
RD
4391
4392 def LeftDClick(*args, **kwargs):
27fb7603
RD
4393 """
4394 LeftDClick(self) -> bool
4395
4396 Returns true if the event was a left button double click.
4397 """
5b5c9bc7 4398 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
d55e5bfc
RD
4399
4400 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4401 """
4402 MiddleDClick(self) -> bool
4403
4404 Returns true if the event was a middle button double click.
4405 """
5b5c9bc7 4406 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
d55e5bfc
RD
4407
4408 def RightDClick(*args, **kwargs):
27fb7603
RD
4409 """
4410 RightDClick(self) -> bool
4411
4412 Returns true if the event was a right button double click.
4413 """
5b5c9bc7 4414 return _core_.MouseEvent_RightDClick(*args, **kwargs)
d55e5bfc
RD
4415
4416 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4417 """
4418 LeftIsDown(self) -> bool
4419
4420 Returns true if the left mouse button is currently down, independent
4421 of the current event type.
4422
4423 Please notice that it is not the same as LeftDown which returns true
4424 if the left mouse button was just pressed. Rather, it describes the
4425 state of the mouse button before the event happened.
4426
4427 This event is usually used in the mouse event handlers which process
4428 "move mouse" messages to determine whether the user is (still)
4429 dragging the mouse.
4430 """
5b5c9bc7 4431 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
d55e5bfc
RD
4432
4433 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4434 """
4435 MiddleIsDown(self) -> bool
4436
4437 Returns true if the middle mouse button is currently down, independent
4438 of the current event type.
4439 """
5b5c9bc7 4440 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
d55e5bfc
RD
4441
4442 def RightIsDown(*args, **kwargs):
27fb7603
RD
4443 """
4444 RightIsDown(self) -> bool
4445
4446 Returns true if the right mouse button is currently down, independent
4447 of the current event type.
4448 """
5b5c9bc7 4449 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
d55e5bfc
RD
4450
4451 def Dragging(*args, **kwargs):
27fb7603
RD
4452 """
4453 Dragging(self) -> bool
4454
4455 Returns true if this was a dragging event (motion while a button is
4456 depressed).
4457 """
5b5c9bc7 4458 return _core_.MouseEvent_Dragging(*args, **kwargs)
d55e5bfc
RD
4459
4460 def Moving(*args, **kwargs):
27fb7603
RD
4461 """
4462 Moving(self) -> bool
4463
4464 Returns true if this was a motion event and no mouse buttons were
4465 pressed. If any mouse button is held pressed, then this method returns
4466 false and Dragging returns true.
4467 """
5b5c9bc7 4468 return _core_.MouseEvent_Moving(*args, **kwargs)
d55e5bfc
RD
4469
4470 def Entering(*args, **kwargs):
27fb7603
RD
4471 """
4472 Entering(self) -> bool
4473
4474 Returns true if the mouse was entering the window.
4475 """
5b5c9bc7 4476 return _core_.MouseEvent_Entering(*args, **kwargs)
d55e5bfc
RD
4477
4478 def Leaving(*args, **kwargs):
27fb7603
RD
4479 """
4480 Leaving(self) -> bool
4481
4482 Returns true if the mouse was leaving the window.
4483 """
5b5c9bc7 4484 return _core_.MouseEvent_Leaving(*args, **kwargs)
d55e5bfc
RD
4485
4486 def GetPosition(*args, **kwargs):
4487 """
5b5c9bc7 4488 GetPosition(self) -> Point
d55e5bfc 4489
27fb7603
RD
4490 Returns the pixel position of the mouse in window coordinates when the
4491 event happened.
d55e5bfc 4492 """
5b5c9bc7 4493 return _core_.MouseEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4494
4495 def GetPositionTuple(*args, **kwargs):
4496 """
4497 GetPositionTuple() -> (x,y)
4498
27fb7603
RD
4499 Returns the pixel position of the mouse in window coordinates when the
4500 event happened.
d55e5bfc 4501 """
5b5c9bc7 4502 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4503
4504 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4505 """
4506 GetLogicalPosition(self, DC dc) -> Point
4507
4508 Returns the logical mouse position in pixels (i.e. translated
4509 according to the translation set for the DC, which usually indicates
4510 that the window has been scrolled).
4511 """
5b5c9bc7 4512 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
d55e5bfc
RD
4513
4514 def GetX(*args, **kwargs):
27fb7603
RD
4515 """
4516 GetX(self) -> int
4517
4518 Returns X coordinate of the physical mouse event position.
4519 """
5b5c9bc7 4520 return _core_.MouseEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4521
4522 def GetY(*args, **kwargs):
27fb7603
RD
4523 """
4524 GetY(self) -> int
4525
4526 Returns Y coordinate of the physical mouse event position.
4527 """
5b5c9bc7 4528 return _core_.MouseEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4529
4530 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4531 """
4532 GetWheelRotation(self) -> int
4533
4534 Get wheel rotation, positive or negative indicates direction of
4535 rotation. Current devices all send an event when rotation is equal to
4536 +/-WheelDelta, but this allows for finer resolution devices to be
4537 created in the future. Because of this you shouldn't assume that one
4538 event is equal to 1 line or whatever, but you should be able to either
4539 do partial line scrolling or wait until +/-WheelDelta rotation values
4540 have been accumulated before scrolling.
4541 """
5b5c9bc7 4542 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
d55e5bfc
RD
4543
4544 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4545 """
4546 GetWheelDelta(self) -> int
4547
4548 Get wheel delta, normally 120. This is the threshold for action to be
4549 taken, and one such action (for example, scrolling one increment)
4550 should occur for each delta.
4551 """
5b5c9bc7 4552 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
d55e5bfc
RD
4553
4554 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4555 """
4556 GetLinesPerAction(self) -> int
4557
4558 Returns the configured number of lines (or whatever) to be scrolled
4559 per wheel action. Defaults to three.
4560 """
5b5c9bc7 4561 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
d55e5bfc
RD
4562
4563 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4564 """
4565 IsPageScroll(self) -> bool
4566
4567 Returns true if the system has been setup to do page scrolling with
4568 the mouse wheel instead of line scrolling.
4569 """
5b5c9bc7
RD
4570 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4571
4572 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4573 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4574 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4575 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4576 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4577 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4578 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4579 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4580 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4581 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4582 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4583 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
2131d850 4584_core_.MouseEvent_swigregister(MouseEvent)
d55e5bfc
RD
4585
4586#---------------------------------------------------------------------------
4587
5b5c9bc7 4588class SetCursorEvent(Event):
5ba5649b
RD
4589 """
4590 A SetCursorEvent is generated when the mouse cursor is about to be set
4591 as a result of mouse motion. This event gives the application the
4592 chance to perform specific mouse cursor processing based on the
4593 current position of the mouse within the window. Use the `SetCursor`
4594 method to specify the cursor you want to be displayed.
4595 """
1bd55598
RD
4596 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4597 __repr__ = _swig_repr
4598 def __init__(self, *args, **kwargs):
5ba5649b
RD
4599 """
4600 __init__(self, int x=0, int y=0) -> SetCursorEvent
4601
4602 Construct a new `wx.SetCursorEvent`.
4603 """
1bd55598 4604 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
d55e5bfc 4605 def GetX(*args, **kwargs):
5ba5649b
RD
4606 """
4607 GetX(self) -> int
4608
4609 Returns the X coordinate of the mouse in client coordinates.
4610 """
5b5c9bc7 4611 return _core_.SetCursorEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4612
4613 def GetY(*args, **kwargs):
5ba5649b
RD
4614 """
4615 GetY(self) -> int
4616
4617 Returns the Y coordinate of the mouse in client coordinates.
4618 """
5b5c9bc7 4619 return _core_.SetCursorEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4620
4621 def SetCursor(*args, **kwargs):
5ba5649b
RD
4622 """
4623 SetCursor(self, Cursor cursor)
4624
4625 Sets the cursor associated with this event.
4626 """
5b5c9bc7 4627 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
d55e5bfc
RD
4628
4629 def GetCursor(*args, **kwargs):
5ba5649b
RD
4630 """
4631 GetCursor(self) -> Cursor
4632
4633 Returns a reference to the cursor specified by this event.
4634 """
5b5c9bc7 4635 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
d55e5bfc
RD
4636
4637 def HasCursor(*args, **kwargs):
5ba5649b
RD
4638 """
4639 HasCursor(self) -> bool
4640
4641 Returns true if the cursor specified by this event is a valid cursor.
4642 """
5b5c9bc7 4643 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
d55e5bfc 4644
2131d850 4645_core_.SetCursorEvent_swigregister(SetCursorEvent)
d55e5bfc
RD
4646
4647#---------------------------------------------------------------------------
4648
5b5c9bc7 4649class KeyEvent(Event):
5ba5649b
RD
4650 """
4651 This event class contains information about keypress and character
4652 events. These events are only sent to the widget that currently has
4653 the keyboard focus.
4654
4655 Notice that there are three different kinds of keyboard events in
4656 wxWidgets: key down and up events and char events. The difference
4657 between the first two is clear - the first corresponds to a key press
4658 and the second to a key release - otherwise they are identical. Just
4659 note that if the key is maintained in a pressed state you will
4660 typically get a lot of (automatically generated) down events but only
4661 one up so it is wrong to assume that there is one up event
4662 corresponding to each down one.
4663
4664 Both key events provide untranslated key codes while the char event
4665 carries the translated one. The untranslated code for alphanumeric
4666 keys is always an upper case value. For the other keys it is one of
4667 WXK_XXX values from the keycodes table. The translated key is, in
4668 general, the character the user expects to appear as the result of the
4669 key combination when typing the text into a text entry zone, for
4670 example.
4671
4672 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4673 and the standard US keyboard): when the 'A' key is pressed, the key
4674 down event key code is equal to ASCII A == 65. But the char event key
4675 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4676 'A' keys simultaneously , the key code in key down event will still be
4677 just 'A' while the char event key code parameter will now be 'A' as
4678 well.
4679
4680 Although in this simple case it is clear that the correct key code
4681 could be found in the key down event handler by checking the value
4682 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4683 as for non alphanumeric keys or non-US keyboard layouts the
4684 translation is keyboard-layout dependent and can only be done properly
4685 by the system itself.
4686
4687 Another kind of translation is done when the control key is pressed:
4688 for example, for CTRL-A key press the key down event still carries the
4689 same key code 'A' as usual but the char event will have key code of 1,
4690 the ASCII value of this key combination.
4691
4692 You may discover how the other keys on your system behave
4693 interactively by running the KeyEvents sample in the wxPython demo and
4694 pressing some keys while the blue box at the top has the keyboard
4695 focus.
4696
4697 **Note**: If a key down event is caught and the event handler does not
4698 call event.Skip() then the coresponding char event will not
4699 happen. This is by design and enables the programs that handle both
4700 types of events to be a bit simpler.
4701
4702 **Note for Windows programmers**: The key and char events in wxWidgets
4703 are similar to but slightly different from Windows WM_KEYDOWN and
4704 WM_CHAR events. In particular, Alt-x combination will generate a char
4705 event in wxWidgets (unless it is used as an accelerator).
4706
4707 **Tip**: be sure to call event.Skip() for events that you don't
4708 process in key event function, otherwise menu shortcuts may cease to
4709 work under Windows.
4710
4711 """
1bd55598
RD
4712 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4713 __repr__ = _swig_repr
4714 def __init__(self, *args, **kwargs):
5ba5649b 4715 """
2131d850 4716 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
4717
4718 Construct a new `wx.KeyEvent`. Valid event types are:
4719 *
4720 """
1bd55598 4721 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
4722 def GetModifiers(*args, **kwargs):
4723 """
4724 GetModifiers(self) -> int
4725
4726 Returns a bitmask of the current modifier settings. Can be used to
4727 check if the key event has exactly the given modifiers without having
4728 to explicitly check that the other modifiers are not down. For
4729 example::
4730
4731 if event.GetModifers() == wx.MOD_CONTROL:
4732 DoSomething()
4733
4734 """
4735 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4736
d55e5bfc 4737 def ControlDown(*args, **kwargs):
5ba5649b
RD
4738 """
4739 ControlDown(self) -> bool
4740
4741 Returns ``True`` if the Control key was down at the time of the event.
4742 """
5b5c9bc7 4743 return _core_.KeyEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4744
4745 def MetaDown(*args, **kwargs):
5ba5649b
RD
4746 """
4747 MetaDown(self) -> bool
4748
4749 Returns ``True`` if the Meta key was down at the time of the event.
4750 """
5b5c9bc7 4751 return _core_.KeyEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4752
4753 def AltDown(*args, **kwargs):
5ba5649b
RD
4754 """
4755 AltDown(self) -> bool
4756
4757 Returns ``True`` if the Alt key was down at the time of the event.
4758 """
5b5c9bc7 4759 return _core_.KeyEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4760
4761 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4762 """
4763 ShiftDown(self) -> bool
4764
4765 Returns ``True`` if the Shift key was down at the time of the event.
4766 """
5b5c9bc7 4767 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4768
412d302d
RD
4769 def CmdDown(*args, **kwargs):
4770 """
4771 CmdDown(self) -> bool
4772
4773 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4774 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4775 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
4776 because Cmd key is used for the same thing under Mac as Ctrl
4777 elsewhere. The Ctrl still exists, it's just not used for this
4778 purpose. So for non-Mac platforms this is the same as `ControlDown`
4779 and Macs this is the same as `MetaDown`.
4780 """
5b5c9bc7 4781 return _core_.KeyEvent_CmdDown(*args, **kwargs)
412d302d 4782
d55e5bfc 4783 def HasModifiers(*args, **kwargs):
5ba5649b
RD
4784 """
4785 HasModifiers(self) -> bool
4786
4787 Returns true if either CTRL or ALT keys was down at the time of the
4788 key event. Note that this function does not take into account neither
4789 SHIFT nor META key states (the reason for ignoring the latter is that
4790 it is common for NUMLOCK key to be configured as META under X but the
4791 key presses even while NUMLOCK is on should be still processed
4792 normally).
4793 """
5b5c9bc7 4794 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
d55e5bfc
RD
4795
4796 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
4797 """
4798 GetKeyCode(self) -> int
4799
4800 Returns the virtual key code. ASCII events return normal ASCII values,
4801 while non-ASCII events return values such as WXK_LEFT for the left
4802 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4803 codes.
4804
4805 Note that in Unicode build, the returned value is meaningful only if
4806 the user entered a character that can be represented in current
4807 locale's default charset. You can obtain the corresponding Unicode
4808 character using `GetUnicodeKey`.
4809 """
5b5c9bc7 4810 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
4811
4812 KeyCode = GetKeyCode
bb4524c4 4813 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
4814 """
4815 GetUnicodeKey(self) -> int
4816
4817 Returns the Unicode character corresponding to this key event. This
4818 function is only meaningfule in a Unicode build of wxPython.
4819 """
5b5c9bc7 4820 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 4821
bb4524c4 4822 GetUniChar = GetUnicodeKey
b850e7f3
RD
4823 def SetUnicodeKey(*args, **kwargs):
4824 """
4825 SetUnicodeKey(self, int uniChar)
4826
4827 Set the Unicode value of the key event, but only if this is a Unicode
4828 build of wxPython.
4829 """
4830 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
4831
d55e5bfc 4832 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
4833 """
4834 GetRawKeyCode(self) -> unsigned int
4835
4836 Returns the raw key code for this event. This is a platform-dependent
4837 scan code which should only be used in advanced
4838 applications. Currently the raw key codes are not supported by all
4839 ports.
4840 """
5b5c9bc7 4841 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
d55e5bfc
RD
4842
4843 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
4844 """
4845 GetRawKeyFlags(self) -> unsigned int
4846
4847 Returns the low level key flags for this event. The flags are
4848 platform-dependent and should only be used in advanced applications.
4849 Currently the raw key flags are not supported by all ports.
4850 """
5b5c9bc7 4851 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
d55e5bfc
RD
4852
4853 def GetPosition(*args, **kwargs):
4854 """
5b5c9bc7 4855 GetPosition(self) -> Point
d55e5bfc 4856
5ba5649b 4857 Find the position of the event, if applicable.
d55e5bfc 4858 """
5b5c9bc7 4859 return _core_.KeyEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4860
4861 def GetPositionTuple(*args, **kwargs):
4862 """
4863 GetPositionTuple() -> (x,y)
4864
5ba5649b 4865 Find the position of the event, if applicable.
d55e5bfc 4866 """
5b5c9bc7 4867 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4868
4869 def GetX(*args, **kwargs):
5ba5649b
RD
4870 """
4871 GetX(self) -> int
4872
4873 Returns the X position (in client coordinates) of the event, if
4874 applicable.
4875 """
5b5c9bc7 4876 return _core_.KeyEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4877
4878 def GetY(*args, **kwargs):
5ba5649b
RD
4879 """
4880 GetY(self) -> int
4881
4882 Returns the Y position (in client coordinates) of the event, if
4883 applicable.
4884 """
5b5c9bc7
RD
4885 return _core_.KeyEvent_GetY(*args, **kwargs)
4886
4887 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4888 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4889 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4890 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4891 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4892 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4893 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4894 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4895 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4896 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
2131d850 4897_core_.KeyEvent_swigregister(KeyEvent)
d55e5bfc
RD
4898
4899#---------------------------------------------------------------------------
4900
5b5c9bc7 4901class SizeEvent(Event):
5ba5649b
RD
4902 """
4903 A size event holds information about size change events. The EVT_SIZE
4904 handler function will be called when the window it is bound to has
4905 been resized.
4906
4907 Note that the size passed is of the whole window: call
4908 `wx.Window.GetClientSize` for the area which may be used by the
4909 application.
4910
4911 When a window is resized, usually only a small part of the window is
4912 damaged and and that area is all that is in the update region for the
4913 next paint event. However, if your drawing depends on the size of the
4914 window, you may need to clear the DC explicitly and repaint the whole
4915 window. In which case, you may need to call `wx.Window.Refresh` to
4916 invalidate the entire window.
4917
4918 """
1bd55598
RD
4919 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4920 __repr__ = _swig_repr
4921 def __init__(self, *args, **kwargs):
5ba5649b
RD
4922 """
4923 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4924
4925 Construct a new ``wx.SizeEvent``.
4926 """
1bd55598 4927 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
d55e5bfc 4928 def GetSize(*args, **kwargs):
5ba5649b
RD
4929 """
4930 GetSize(self) -> Size
4931
4932 Returns the entire size of the window generating the size change
4933 event.
4934 """
5b5c9bc7 4935 return _core_.SizeEvent_GetSize(*args, **kwargs)
d55e5bfc
RD
4936
4937 def GetRect(*args, **kwargs):
5b5c9bc7
RD
4938 """GetRect(self) -> Rect"""
4939 return _core_.SizeEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
4940
4941 def SetRect(*args, **kwargs):
5b5c9bc7
RD
4942 """SetRect(self, Rect rect)"""
4943 return _core_.SizeEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
4944
4945 def SetSize(*args, **kwargs):
5b5c9bc7
RD
4946 """SetSize(self, Size size)"""
4947 return _core_.SizeEvent_SetSize(*args, **kwargs)
d55e5bfc 4948
5b5c9bc7
RD
4949 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4950 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
2131d850 4951_core_.SizeEvent_swigregister(SizeEvent)
d55e5bfc
RD
4952
4953#---------------------------------------------------------------------------
4954
5b5c9bc7 4955class MoveEvent(Event):
5ba5649b
RD
4956 """
4957 This event object is sent for EVT_MOVE event bindings when a window is
4958 moved to a new position.
4959 """
1bd55598
RD
4960 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4961 __repr__ = _swig_repr
4962 def __init__(self, *args, **kwargs):
5ba5649b
RD
4963 """
4964 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
4965
4966 Constructor.
4967 """
1bd55598 4968 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
d55e5bfc 4969 def GetPosition(*args, **kwargs):
5ba5649b
RD
4970 """
4971 GetPosition(self) -> Point
4972
4973 Returns the position of the window generating the move change event.
4974 """
5b5c9bc7 4975 return _core_.MoveEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4976
4977 def GetRect(*args, **kwargs):
5b5c9bc7
RD
4978 """GetRect(self) -> Rect"""
4979 return _core_.MoveEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
4980
4981 def SetRect(*args, **kwargs):
5b5c9bc7
RD
4982 """SetRect(self, Rect rect)"""
4983 return _core_.MoveEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
4984
4985 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
4986 """SetPosition(self, Point pos)"""
4987 return _core_.MoveEvent_SetPosition(*args, **kwargs)
d55e5bfc 4988
fef4c27a
RD
4989 m_pos = property(GetPosition, SetPosition)
4990 m_rect = property(GetRect, SetRect)
4991
2131d850 4992_core_.MoveEvent_swigregister(MoveEvent)
d55e5bfc
RD
4993
4994#---------------------------------------------------------------------------
4995
5b5c9bc7 4996class PaintEvent(Event):
5ba5649b
RD
4997 """
4998 A paint event is sent when a window's contents needs to be repainted.
4999 Note that in an EVT_PAINT handler the application must *always* create
5000 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5001 Windows assumes that the window has not been painted yet and will send
5002 the event again, causing endless refreshes.
5003
5004 You can optimize painting by retrieving the rectangles that have been
5005 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5006 and only repainting these rectangles. The rectangles are in terms of
5007 the client area, and are unscrolled, so you will need to do some
5008 calculations using the current view position to obtain logical,
5009 scrolled units.
5010
5011 """
1bd55598
RD
5012 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5013 __repr__ = _swig_repr
5014 def __init__(self, *args, **kwargs):
5b5c9bc7 5015 """__init__(self, int Id=0) -> PaintEvent"""
1bd55598 5016 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5017_core_.PaintEvent_swigregister(PaintEvent)
d55e5bfc 5018
5b5c9bc7
RD
5019class NcPaintEvent(Event):
5020 """Proxy of C++ NcPaintEvent class"""
1bd55598
RD
5021 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5022 __repr__ = _swig_repr
5023 def __init__(self, *args, **kwargs):
5b5c9bc7 5024 """__init__(self, int winid=0) -> NcPaintEvent"""
1bd55598 5025 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5026_core_.NcPaintEvent_swigregister(NcPaintEvent)
d55e5bfc
RD
5027
5028#---------------------------------------------------------------------------
5029
5b5c9bc7 5030class EraseEvent(Event):
5ba5649b
RD
5031 """
5032 An erase event is sent whenever the background of a window needs to be
5033 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5034 binder. On some platforms, such as GTK+, this event is simulated
5035 (simply generated just before the paint event) and may cause flicker.
5036
5037 To paint a custom background use the `GetDC` method and use the returned
5038 device context if it is not ``None``, otherwise create a temporary
5039 `wx.ClientDC` and draw on that.
5040
5041 """
1bd55598
RD
5042 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5043 __repr__ = _swig_repr
5044 def __init__(self, *args, **kwargs):
5ba5649b
RD
5045 """
5046 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5047
5048 Constructor
5049 """
1bd55598 5050 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
d55e5bfc 5051 def GetDC(*args, **kwargs):
5ba5649b
RD
5052 """
5053 GetDC(self) -> DC
5054
5055 Returns the device context the event handler should draw upon. If
5056 ``None`` is returned then create a temporary `wx.ClientDC` and use
5057 that instead.
5058 """
5b5c9bc7 5059 return _core_.EraseEvent_GetDC(*args, **kwargs)
d55e5bfc 5060
2131d850 5061_core_.EraseEvent_swigregister(EraseEvent)
d55e5bfc
RD
5062
5063#---------------------------------------------------------------------------
5064
5b5c9bc7 5065class FocusEvent(Event):
5ba5649b
RD
5066 """
5067 A focus event is sent when a window's focus changes. The window losing
5068 focus receives an EVT_KILL_FOCUS event while the window gaining it
5069 gets an EVT_SET_FOCUS event.
5070
5071 Notice that the set focus event happens both when the user gives focus
5072 to the window (whether using the mouse or keyboard) and when it is
5073 done from the program itself using `wx.Window.SetFocus`.
5074
5075 """
1bd55598
RD
5076 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5077 __repr__ = _swig_repr
5078 def __init__(self, *args, **kwargs):
5ba5649b 5079 """
2131d850 5080 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5081
5082 Constructor
5083 """
1bd55598 5084 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
d55e5bfc 5085 def GetWindow(*args, **kwargs):
5ba5649b
RD
5086 """
5087 GetWindow(self) -> Window
5088
5089 Returns the other window associated with this event, that is the
5090 window which had the focus before for the EVT_SET_FOCUS event and the
5091 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5092
5093 Warning: the window returned may be None!
5094 """
5b5c9bc7 5095 return _core_.FocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
5096
5097 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
5098 """SetWindow(self, Window win)"""
5099 return _core_.FocusEvent_SetWindow(*args, **kwargs)
d55e5bfc 5100
2131d850 5101_core_.FocusEvent_swigregister(FocusEvent)
d55e5bfc
RD
5102
5103#---------------------------------------------------------------------------
5104
5b5c9bc7 5105class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5106 """
5107 wx.ChildFocusEvent notifies the parent that a child has received the
5108 focus. Unlike `wx.FocusEvent` it is propagated up the window
5109 heirarchy.
5110 """
1bd55598
RD
5111 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5112 __repr__ = _swig_repr
5113 def __init__(self, *args, **kwargs):
5ba5649b
RD
5114 """
5115 __init__(self, Window win=None) -> ChildFocusEvent
5116
5117 Constructor
5118 """
1bd55598 5119 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
d55e5bfc 5120 def GetWindow(*args, **kwargs):
5ba5649b
RD
5121 """
5122 GetWindow(self) -> Window
5123
5124 The window which has just received the focus.
5125 """
5b5c9bc7 5126 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
d55e5bfc 5127
2131d850 5128_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d55e5bfc
RD
5129
5130#---------------------------------------------------------------------------
5131
5b5c9bc7 5132class ActivateEvent(Event):
5ba5649b
RD
5133 """
5134 An activate event is sent when a top-level window or the entire
5135 application is being activated or deactivated.
5136
5137 A top-level window (a dialog or frame) receives an activate event when
5138 is being activated or deactivated. This is indicated visually by the
5139 title bar changing colour, and a subwindow gaining the keyboard focus.
5140 An application is activated or deactivated when one of its frames
5141 becomes activated, or a frame becomes inactivate resulting in all
5142 application frames being inactive.
5143
5144 Please note that usually you should call event.Skip() in your handlers
5145 for these events so the default handlers will still be called, as not
5146 doing so can result in strange effects.
5147
5148 """
1bd55598
RD
5149 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5150 __repr__ = _swig_repr
5151 def __init__(self, *args, **kwargs):
5ba5649b 5152 """
2131d850 5153 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5154
5155 Constructor
5156 """
1bd55598 5157 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
d55e5bfc 5158 def GetActive(*args, **kwargs):
5ba5649b
RD
5159 """
5160 GetActive(self) -> bool
5161
5162 Returns true if the application or window is being activated, false
5163 otherwise.
5164 """
5b5c9bc7 5165 return _core_.ActivateEvent_GetActive(*args, **kwargs)
d55e5bfc 5166
2131d850 5167_core_.ActivateEvent_swigregister(ActivateEvent)
d55e5bfc
RD
5168
5169#---------------------------------------------------------------------------
5170
5b5c9bc7 5171class InitDialogEvent(Event):
5ba5649b
RD
5172 """
5173 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5174 any window when `wx.Window.InitDialog` is called. Handlers for this
5175 event can transfer data to the window, or anything else that should be
5176 done before the user begins editing the form. The default handler
5177 calls `wx.Window.TransferDataToWindow`.
5178 """
1bd55598
RD
5179 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5180 __repr__ = _swig_repr
5181 def __init__(self, *args, **kwargs):
5ba5649b
RD
5182 """
5183 __init__(self, int Id=0) -> InitDialogEvent
5184
5185 Constructor
5186 """
1bd55598 5187 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5188_core_.InitDialogEvent_swigregister(InitDialogEvent)
d55e5bfc
RD
5189
5190#---------------------------------------------------------------------------
5191
5b5c9bc7 5192class MenuEvent(Event):
5ba5649b
RD
5193 """
5194 This class is used for a variety of menu-related events. Note that
5195 these do not include menu command events, which are handled by sending
5196 `wx.CommandEvent` objects.
5197
5198 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5199 text in the first field of the status bar.
5200 """
1bd55598
RD
5201 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5202 __repr__ = _swig_repr
5203 def __init__(self, *args, **kwargs):
5ba5649b 5204 """
2131d850 5205 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5206
5207 Constructor
5208 """
1bd55598 5209 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
d55e5bfc 5210 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5211 """
5212 GetMenuId(self) -> int
5213
5214 Returns the menu identifier associated with the event. This method
5215 should be only used with the HIGHLIGHT events.
5216 """
5b5c9bc7 5217 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
d55e5bfc
RD
5218
5219 def IsPopup(*args, **kwargs):
5ba5649b
RD
5220 """
5221 IsPopup(self) -> bool
5222
5223 Returns ``True`` if the menu which is being opened or closed is a
5224 popup menu, ``False`` if it is a normal one. This method should only
5225 be used with the OPEN and CLOSE events.
5226 """
5b5c9bc7 5227 return _core_.MenuEvent_IsPopup(*args, **kwargs)
d55e5bfc
RD
5228
5229 def GetMenu(*args, **kwargs):
5ba5649b
RD
5230 """
5231 GetMenu(self) -> Menu
5232
5233 Returns the menu which is being opened or closed. This method should
5234 only be used with the OPEN and CLOSE events.
5235 """
5b5c9bc7 5236 return _core_.MenuEvent_GetMenu(*args, **kwargs)
d55e5bfc 5237
2131d850 5238_core_.MenuEvent_swigregister(MenuEvent)
d55e5bfc
RD
5239
5240#---------------------------------------------------------------------------
5241
5b5c9bc7 5242class CloseEvent(Event):
5ba5649b
RD
5243 """
5244 This event class contains information about window and session close
5245 events.
5246
5247 The handler function for EVT_CLOSE is called when the user has tried
5248 to close a a frame or dialog box using the window manager controls or
5249 the system menu. It can also be invoked by the application itself
5250 programmatically, for example by calling the `wx.Window.Close`
5251 function.
5252
5253 You should check whether the application is forcing the deletion of
5254 the window using `CanVeto`. If it returns ``False``, you must destroy
5255 the window using `wx.Window.Destroy`. If the return value is ``True``,
5256 it is up to you whether you respond by destroying the window or not.
5257 For example you may wish to display a message dialog prompting to save
5258 files or to cancel the close.
5259
5260 If you don't destroy the window, you should call `Veto` to let the
5261 calling code know that you did not destroy the window. This allows the
5262 `wx.Window.Close` function to return ``True`` or ``False`` depending
5263 on whether the close instruction was honored or not.
5264 """
1bd55598
RD
5265 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5266 __repr__ = _swig_repr
5267 def __init__(self, *args, **kwargs):
5ba5649b 5268 """
2131d850 5269 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5270
5271 Constructor.
5272 """
1bd55598 5273 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
d55e5bfc 5274 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5275 """
5276 SetLoggingOff(self, bool logOff)
5277
5278 Sets the 'logging off' flag.
5279 """
5b5c9bc7 5280 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5281
5282 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5283 """
5284 GetLoggingOff(self) -> bool
5285
034e3677
RD
5286 Returns ``True`` if the user is logging off or ``False`` if the
5287 system is shutting down. This method can only be called for end
5288 session and query end session events, it doesn't make sense for close
5289 window event.
5ba5649b 5290 """
5b5c9bc7 5291 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5292
5293 def Veto(*args, **kwargs):
5ba5649b
RD
5294 """
5295 Veto(self, bool veto=True)
5296
5297 Call this from your event handler to veto a system shutdown or to
5298 signal to the calling application that a window close did not happen.
5299
5300 You can only veto a shutdown or close if `CanVeto` returns true.
5301 """
5b5c9bc7 5302 return _core_.CloseEvent_Veto(*args, **kwargs)
d55e5bfc 5303
5ba5649b
RD
5304 def GetVeto(*args, **kwargs):
5305 """GetVeto(self) -> bool"""
5306 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5307
d55e5bfc 5308 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5309 """
5310 SetCanVeto(self, bool canVeto)
5311
5312 Sets the 'can veto' flag.
5313 """
5b5c9bc7 5314 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
d55e5bfc
RD
5315
5316 def CanVeto(*args, **kwargs):
5ba5649b
RD
5317 """
5318 CanVeto(self) -> bool
d55e5bfc 5319
5ba5649b
RD
5320 Returns true if you can veto a system shutdown or a window close
5321 event. Vetoing a window close event is not possible if the calling
5322 code wishes to force the application to exit, and so this function
5323 must be called to check this.
5324 """
5325 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc 5326
2131d850 5327_core_.CloseEvent_swigregister(CloseEvent)
d55e5bfc
RD
5328
5329#---------------------------------------------------------------------------
5330
5b5c9bc7 5331class ShowEvent(Event):
5ba5649b 5332 """An EVT_SHOW event is sent when a window is shown or hidden."""
1bd55598
RD
5333 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5334 __repr__ = _swig_repr
5335 def __init__(self, *args, **kwargs):
5ba5649b
RD
5336 """
5337 __init__(self, int winid=0, bool show=False) -> ShowEvent
5338
5339 An EVT_SHOW event is sent when a window is shown or hidden.
5340 """
1bd55598 5341 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
d55e5bfc
RD
5342 def SetShow(*args, **kwargs):
5343 """SetShow(self, bool show)"""
5b5c9bc7 5344 return _core_.ShowEvent_SetShow(*args, **kwargs)
d55e5bfc
RD
5345
5346 def GetShow(*args, **kwargs):
5347 """GetShow(self) -> bool"""
5b5c9bc7 5348 return _core_.ShowEvent_GetShow(*args, **kwargs)
d55e5bfc 5349
2131d850 5350_core_.ShowEvent_swigregister(ShowEvent)
d55e5bfc
RD
5351
5352#---------------------------------------------------------------------------
5353
5b5c9bc7 5354class IconizeEvent(Event):
5ba5649b
RD
5355 """
5356 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5357 restored.
5358 """
1bd55598
RD
5359 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5360 __repr__ = _swig_repr
5361 def __init__(self, *args, **kwargs):
5ba5649b
RD
5362 """
5363 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5364
5365 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5366 restored.
5367 """
1bd55598 5368 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
d55e5bfc 5369 def Iconized(*args, **kwargs):
5ba5649b
RD
5370 """
5371 Iconized(self) -> bool
5372
5373 Returns ``True`` if the frame has been iconized, ``False`` if it has
5374 been restored.
5375 """
5b5c9bc7 5376 return _core_.IconizeEvent_Iconized(*args, **kwargs)
d55e5bfc 5377
2131d850 5378_core_.IconizeEvent_swigregister(IconizeEvent)
d55e5bfc
RD
5379
5380#---------------------------------------------------------------------------
5381
5b5c9bc7 5382class MaximizeEvent(Event):
5ba5649b 5383 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
1bd55598
RD
5384 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5385 __repr__ = _swig_repr
5386 def __init__(self, *args, **kwargs):
5ba5649b
RD
5387 """
5388 __init__(self, int id=0) -> MaximizeEvent
5389
5390 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5391 """
1bd55598 5392 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5393_core_.MaximizeEvent_swigregister(MaximizeEvent)
d55e5bfc
RD
5394
5395#---------------------------------------------------------------------------
5396
5b5c9bc7 5397class DropFilesEvent(Event):
5ba5649b
RD
5398 """
5399 This class is used for drop files events, that is, when files have
5400 been dropped onto the window. This functionality is only available
5401 under Windows. The window must have previously been enabled for
5402 dropping by calling `wx.Window.DragAcceptFiles`.
5403
5404 Important note: this is a separate implementation to the more general
5405 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5406 implementation uses the older, Windows message-based approach of
5407 dropping files.
5408
5409 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5410 events.
5411
5412 """
1bd55598
RD
5413 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5414 def __init__(self): raise AttributeError, "No constructor defined"
5415 __repr__ = _swig_repr
d55e5bfc 5416 def GetPosition(*args, **kwargs):
5ba5649b
RD
5417 """
5418 GetPosition(self) -> Point
5419
5420 Returns the position at which the files were dropped.
5421 """
5b5c9bc7 5422 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5423
5424 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5425 """
5426 GetNumberOfFiles(self) -> int
5427
5428 Returns the number of files dropped.
5429 """
5b5c9bc7 5430 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
d55e5bfc
RD
5431
5432 def GetFiles(*args, **kwargs):
5ba5649b
RD
5433 """
5434 GetFiles(self) -> PyObject
5435
5436 Returns a list of the filenames that were dropped.
5437 """
5b5c9bc7 5438 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
d55e5bfc 5439
2131d850 5440_core_.DropFilesEvent_swigregister(DropFilesEvent)
d55e5bfc
RD
5441
5442#---------------------------------------------------------------------------
5443
5b5c9bc7
RD
5444UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5445UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5446class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5447 """
5448 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5449 wxWidgets to give an application the chance to update various user
5450 interface elements.
5451
5452 Without update UI events, an application has to work hard to
5453 check/uncheck, enable/disable, and set the text for elements such as
5454 menu items and toolbar buttons. The code for doing this has to be
5455 mixed up with the code that is invoked when an action is invoked for a
5456 menu item or button.
5457
5458 With update UI events, you define an event handler to look at the
5459 state of the application and change UI elements accordingly. wxWidgets
5460 will call your handler functions in idle time, so you don't have to
5461 worry where to call this code. In addition to being a clearer and more
5462 declarative method, it also means you don't have to worry whether
5463 you're updating a toolbar or menubar identifier. The same handler can
5464 update a menu item and toolbar button, if the ID values are the same.
5465
5466 Instead of directly manipulating the menu or button, you call
5467 functions in the event object, such as `Check`. wxWidgets will
5468 determine whether such a call has been made, and which UI element to
5469 update.
5470
5471 These events will work for popup menus as well as menubars. Just
5472 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5473 any UI events for the window that owns the menu.
5474
5475 If you find that the overhead of UI update processing is affecting
5476 your application, you can do one or both of the following:
5477
5478 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5479 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5480 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5481 receive update events. No other windows will receive update
5482 events.
5483
5484 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5485 value to set the delay between updates. You may need to call
5486 `wx.Window.UpdateWindowUI` at critical points, for example when
5487 a dialog is about to be shown, in case the user sees a slight
5488 delay before windows are updated.
5489
5490 Note that although events are sent in idle time, defining a EVT_IDLE
5491 handler for a window does not affect this because the events are sent
5492 from an internal idle handler.
5493
5494 wxWidgets tries to optimize update events on some platforms. On
5495 Windows and GTK+, events for menubar items are only sent when the menu
5496 is about to be shown, and not in idle time.
5497
5498 """
1bd55598
RD
5499 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5500 __repr__ = _swig_repr
5501 def __init__(self, *args, **kwargs):
5ba5649b
RD
5502 """
5503 __init__(self, int commandId=0) -> UpdateUIEvent
5504
5505 Constructor
5506 """
1bd55598 5507 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
d55e5bfc 5508 def GetChecked(*args, **kwargs):
5ba5649b
RD
5509 """
5510 GetChecked(self) -> bool
5511
5512 Returns ``True`` if the UI element should be checked.
5513 """
5b5c9bc7 5514 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
d55e5bfc
RD
5515
5516 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5517 """
5518 GetEnabled(self) -> bool
5519
5520 Returns ``True`` if the UI element should be enabled.
5521 """
5b5c9bc7 5522 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
d55e5bfc 5523
b1fcee84
RD
5524 def GetShown(*args, **kwargs):
5525 """
5526 GetShown(self) -> bool
5527
5528 Returns ``True`` if the UI element should be shown.
5529 """
5530 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5531
d55e5bfc 5532 def GetText(*args, **kwargs):
5ba5649b
RD
5533 """
5534 GetText(self) -> String
5535
5536 Returns the text that should be set for the UI element.
5537 """
5b5c9bc7 5538 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
d55e5bfc
RD
5539
5540 def GetSetText(*args, **kwargs):
5ba5649b
RD
5541 """
5542 GetSetText(self) -> bool
5543
5544 Returns ``True`` if the application has called `SetText`. For
5545 wxWidgets internal use only.
5546 """
5b5c9bc7 5547 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
d55e5bfc
RD
5548
5549 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5550 """
5551 GetSetChecked(self) -> bool
5552
5553 Returns ``True`` if the application has called `Check`. For wxWidgets
5554 internal use only.
5555 """
5b5c9bc7 5556 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
d55e5bfc
RD
5557
5558 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5559 """
5560 GetSetEnabled(self) -> bool
5561
5562 Returns ``True`` if the application has called `Enable`. For wxWidgets
5563 internal use only.
5564 """
5b5c9bc7 5565 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
d55e5bfc 5566
b1fcee84
RD
5567 def GetSetShown(*args, **kwargs):
5568 """
5569 GetSetShown(self) -> bool
5570
5571 Returns ``True`` if the application has called `Show`. For wxWidgets
5572 internal use only.
5573 """
5574 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5575
d55e5bfc 5576 def Check(*args, **kwargs):
5ba5649b
RD
5577 """
5578 Check(self, bool check)
5579
5580 Check or uncheck the UI element.
5581 """
5b5c9bc7 5582 return _core_.UpdateUIEvent_Check(*args, **kwargs)
d55e5bfc
RD
5583
5584 def Enable(*args, **kwargs):
5ba5649b
RD
5585 """
5586 Enable(self, bool enable)
5587
5588 Enable or disable the UI element.
5589 """
5b5c9bc7 5590 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
d55e5bfc 5591
b1fcee84
RD
5592 def Show(*args, **kwargs):
5593 """
5594 Show(self, bool show)
5595
5596 Show or hide the UI element.
5597 """
5598 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5599
d55e5bfc 5600 def SetText(*args, **kwargs):
5ba5649b
RD
5601 """
5602 SetText(self, String text)
5603
5604 Sets the text for this UI element.
5605 """
5b5c9bc7 5606 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
d55e5bfc
RD
5607
5608 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5609 """
5610 SetUpdateInterval(long updateInterval)
5611
5612 Sets the interval between updates in milliseconds. Set to -1 to
5613 disable updates, or to 0 to update as frequently as possible. The
5614 default is 0.
5615
5616 Use this to reduce the overhead of UI update events if your
5617 application has a lot of windows. If you set the value to -1 or
5618 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5619 at appropriate points in your application, such as when a dialog is
5620 about to be shown.
5621 """
5b5c9bc7 5622 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5623
5624 SetUpdateInterval = staticmethod(SetUpdateInterval)
5625 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5626 """
5627 GetUpdateInterval() -> long
5628
5629 Returns the current interval between updates in milliseconds. -1
5630 disables updates, 0 updates as frequently as possible.
5631 """
5b5c9bc7 5632 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5633
5634 GetUpdateInterval = staticmethod(GetUpdateInterval)
5635 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5636 """
5637 CanUpdate(Window win) -> bool
5638
5639 Returns ``True`` if it is appropriate to update (send UI update events
5640 to) this window.
5641
5642 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5643 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5644 events were last sent in idle time, and the update interval, to
5645 determine whether events should be sent to this window now. By default
5646 this will always return true because the update mode is initially
5647 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5648 events will be sent as often as possible. You can reduce the frequency
5649 that events are sent by changing the mode and/or setting an update
5650 interval.
5651
5652 """
5b5c9bc7 5653 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc
RD
5654
5655 CanUpdate = staticmethod(CanUpdate)
5656 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5657 """
5658 ResetUpdateTime()
5659
5660 Used internally to reset the last-updated time to the current time. It
5661 is assumed that update events are normally sent in idle time, so this
5662 is called at the end of idle processing.
5663 """
5b5c9bc7 5664 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc
RD
5665
5666 ResetUpdateTime = staticmethod(ResetUpdateTime)
5667 def SetMode(*args, **kwargs):
5ba5649b
RD
5668 """
5669 SetMode(int mode)
5670
5671 Specify how wxWidgets will send update events: to all windows, or only
5672 to those which specify that they will process the events.
5673
5674 The mode may be one of the following values:
5675
5676 ============================= ==========================================
5677 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5678 is the default setting.
5679 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5680 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5681 style set.
5682 ============================= ==========================================
5683
5684 """
5b5c9bc7 5685 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
5686
5687 SetMode = staticmethod(SetMode)
5688 def GetMode(*args, **kwargs):
5ba5649b
RD
5689 """
5690 GetMode() -> int
5691
5692 Returns a value specifying how wxWidgets will send update events: to
5693 all windows, or only to those which specify that they will process the
5694 events.
5695 """
5b5c9bc7 5696 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
5697
5698 GetMode = staticmethod(GetMode)
2131d850 5699_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d55e5bfc 5700
5b5c9bc7 5701def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
1bd55598 5702 """
5ba5649b
RD
5703 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5704
5705 Sets the interval between updates in milliseconds. Set to -1 to
5706 disable updates, or to 0 to update as frequently as possible. The
5707 default is 0.
5708
5709 Use this to reduce the overhead of UI update events if your
5710 application has a lot of windows. If you set the value to -1 or
5711 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5712 at appropriate points in your application, such as when a dialog is
5713 about to be shown.
5714 """
1bd55598 5715 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 5716
1bd55598
RD
5717def UpdateUIEvent_GetUpdateInterval(*args):
5718 """
5ba5649b
RD
5719 UpdateUIEvent_GetUpdateInterval() -> long
5720
5721 Returns the current interval between updates in milliseconds. -1
5722 disables updates, 0 updates as frequently as possible.
5723 """
1bd55598 5724 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d55e5bfc 5725
5b5c9bc7 5726def UpdateUIEvent_CanUpdate(*args, **kwargs):
1bd55598 5727 """
5ba5649b
RD
5728 UpdateUIEvent_CanUpdate(Window win) -> bool
5729
5730 Returns ``True`` if it is appropriate to update (send UI update events
5731 to) this window.
5732
5733 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5734 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5735 events were last sent in idle time, and the update interval, to
5736 determine whether events should be sent to this window now. By default
5737 this will always return true because the update mode is initially
5738 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5739 events will be sent as often as possible. You can reduce the frequency
5740 that events are sent by changing the mode and/or setting an update
5741 interval.
5742
5743 """
1bd55598 5744 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 5745
1bd55598
RD
5746def UpdateUIEvent_ResetUpdateTime(*args):
5747 """
5ba5649b
RD
5748 UpdateUIEvent_ResetUpdateTime()
5749
5750 Used internally to reset the last-updated time to the current time. It
5751 is assumed that update events are normally sent in idle time, so this
5752 is called at the end of idle processing.
5753 """
1bd55598 5754 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d55e5bfc 5755
5b5c9bc7 5756def UpdateUIEvent_SetMode(*args, **kwargs):
1bd55598 5757 """
5ba5649b
RD
5758 UpdateUIEvent_SetMode(int mode)
5759
5760 Specify how wxWidgets will send update events: to all windows, or only
5761 to those which specify that they will process the events.
5762
5763 The mode may be one of the following values:
5764
5765 ============================= ==========================================
5766 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5767 is the default setting.
5768 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5769 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5770 style set.
5771 ============================= ==========================================
5772
5773 """
1bd55598 5774 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 5775
1bd55598
RD
5776def UpdateUIEvent_GetMode(*args):
5777 """
5ba5649b
RD
5778 UpdateUIEvent_GetMode() -> int
5779
5780 Returns a value specifying how wxWidgets will send update events: to
5781 all windows, or only to those which specify that they will process the
5782 events.
5783 """
1bd55598 5784 return _core_.UpdateUIEvent_GetMode(*args)
d55e5bfc
RD
5785
5786#---------------------------------------------------------------------------
5787
5b5c9bc7 5788class SysColourChangedEvent(Event):
5ba5649b
RD
5789 """
5790 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5791 when the user changes the colour settings using the control
5792 panel. This is only applicable under Windows.
5793
5794 The default event handler for this event propagates the event to child
5795 windows, since Windows only sends the events to top-level windows. If
5796 intercepting this event for a top-level window, remember to call
5797 `Skip` so the the base class handler will still be executed, or to
5798 pass the event on to the window's children explicitly.
5799
5800 """
1bd55598
RD
5801 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5802 __repr__ = _swig_repr
5803 def __init__(self, *args, **kwargs):
5ba5649b
RD
5804 """
5805 __init__(self) -> SysColourChangedEvent
5806
5807 Constructor
5808 """
1bd55598 5809 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 5810_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d55e5bfc
RD
5811
5812#---------------------------------------------------------------------------
5813
5b5c9bc7 5814class MouseCaptureChangedEvent(Event):
5ba5649b
RD
5815 """
5816 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5817 a window that loses its mouse capture. This is called even if
5818 `wx.Window.ReleaseMouse` was called by the application code. Handling
5819 this event allows an application to cater for unexpected capture
5820 releases which might otherwise confuse mouse handling code.
5821
5822 This event is implemented under Windows only.
5823 """
1bd55598
RD
5824 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5825 __repr__ = _swig_repr
5826 def __init__(self, *args, **kwargs):
5ba5649b
RD
5827 """
5828 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5829
5830 Constructor
5831 """
1bd55598 5832 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
d55e5bfc 5833 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
5834 """
5835 GetCapturedWindow(self) -> Window
5836
5837 Returns the window that gained the capture, or ``None`` if it was a
5838 non-wxWidgets window.
5839 """
5b5c9bc7 5840 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
d55e5bfc 5841
2131d850 5842_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d55e5bfc
RD
5843
5844#---------------------------------------------------------------------------
5845
5b5c9bc7 5846class DisplayChangedEvent(Event):
5ba5649b
RD
5847 """
5848 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5849 resolution has changed.
5850
5851 This event is implemented under Windows only.
5852 """
1bd55598
RD
5853 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5854 __repr__ = _swig_repr
5855 def __init__(self, *args, **kwargs):
5b5c9bc7 5856 """__init__(self) -> DisplayChangedEvent"""
1bd55598 5857 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 5858_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d55e5bfc
RD
5859
5860#---------------------------------------------------------------------------
5861
5b5c9bc7 5862class PaletteChangedEvent(Event):
5ba5649b
RD
5863 """
5864 An EVT_PALETTE_CHANGED event is sent when the system palette has
5865 changed, thereby giving each window a chance to redo their own to
5866 match.
5867
5868 This event is implemented under Windows only.
5869 """
1bd55598
RD
5870 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5871 __repr__ = _swig_repr
5872 def __init__(self, *args, **kwargs):
5ba5649b
RD
5873 """
5874 __init__(self, int id=0) -> PaletteChangedEvent
5875
5876 An EVT_PALETTE_CHANGED event is sent when the system palette has
5877 changed, thereby giving each window a chance to redo their own to
5878 match.
5879
5880 This event is implemented under Windows only.
5881 """
1bd55598 5882 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
d55e5bfc 5883 def SetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
5884 """SetChangedWindow(self, Window win)"""
5885 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
d55e5bfc
RD
5886
5887 def GetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
5888 """GetChangedWindow(self) -> Window"""
5889 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
d55e5bfc 5890
2131d850 5891_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d55e5bfc
RD
5892
5893#---------------------------------------------------------------------------
5894
5b5c9bc7 5895class QueryNewPaletteEvent(Event):
5ba5649b
RD
5896 """
5897 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5898 focus and should re-do its palette.
5899
5900 This event is implemented under Windows only.
5901 """
1bd55598
RD
5902 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5903 __repr__ = _swig_repr
5904 def __init__(self, *args, **kwargs):
5ba5649b
RD
5905 """
5906 __init__(self, int winid=0) -> QueryNewPaletteEvent
5907
5908 Constructor.
5909 """
1bd55598 5910 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
d55e5bfc 5911 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
5912 """
5913 SetPaletteRealized(self, bool realized)
5914
5915 App should set this if it changes the palette.
5916 """
5b5c9bc7 5917 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
5918
5919 def GetPaletteRealized(*args, **kwargs):
5920 """GetPaletteRealized(self) -> bool"""
5b5c9bc7 5921 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
d55e5bfc 5922
2131d850 5923_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d55e5bfc
RD
5924
5925#---------------------------------------------------------------------------
5926
5b5c9bc7 5927class NavigationKeyEvent(Event):
5ba5649b
RD
5928 """
5929 EVT_NAVIGATION_KEY events are used to control moving the focus between
5930 widgets, otherwise known as tab-traversal. You woudl normally not
5931 catch navigation events in applications as there are already
5932 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5933 it useful to send navigation events in certain situations to change
5934 the focus in certain ways, although it's probably easier to just call
5935 `wx.Window.Navigate`.
5936 """
1bd55598
RD
5937 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5938 __repr__ = _swig_repr
5939 def __init__(self, *args, **kwargs):
5b5c9bc7 5940 """__init__(self) -> NavigationKeyEvent"""
1bd55598 5941 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
d55e5bfc 5942 def GetDirection(*args, **kwargs):
5ba5649b
RD
5943 """
5944 GetDirection(self) -> bool
5945
5946 Returns ``True`` if the direction is forward, ``False`` otherwise.
5947 """
5b5c9bc7 5948 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
d55e5bfc
RD
5949
5950 def SetDirection(*args, **kwargs):
5ba5649b
RD
5951 """
5952 SetDirection(self, bool forward)
5953
5954 Specify the direction that the navigation should take. Usually the
5955 difference between using Tab and Shift-Tab.
5956 """
5b5c9bc7 5957 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
d55e5bfc
RD
5958
5959 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
5960 """
5961 IsWindowChange(self) -> bool
5962
5963 Returns ``True`` if window change is allowed.
5964 """
5b5c9bc7 5965 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
d55e5bfc
RD
5966
5967 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
5968 """
5969 SetWindowChange(self, bool ischange)
5970
5971 Specify if the navigation should be able to change parent windows.
5972 For example, changing notebook pages, etc. This is usually implemented
5973 by using Control-Tab.
5974 """
5b5c9bc7 5975 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
d55e5bfc 5976
68350608 5977 def IsFromTab(*args, **kwargs):
5ba5649b
RD
5978 """
5979 IsFromTab(self) -> bool
5980
5981 Returns ``True`` if the navigation event is originated from the Tab
5982 key.
5983 """
5b5c9bc7 5984 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
68350608
RD
5985
5986 def SetFromTab(*args, **kwargs):
5ba5649b
RD
5987 """
5988 SetFromTab(self, bool bIs)
5989
5990 Set to true under MSW if the event was generated using the tab key.
5991 This is required for proper navogation over radio buttons.
5992 """
5b5c9bc7 5993 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
68350608 5994
908b74cd 5995 def SetFlags(*args, **kwargs):
5ba5649b
RD
5996 """
5997 SetFlags(self, long flags)
5998
5999 Set the navigation flags to a combination of the following:
6000
6001 * wx.NavigationKeyEvent.IsBackward
6002 * wx.NavigationKeyEvent.IsForward
6003 * wx.NavigationKeyEvent.WinChange
6004 * wx.NavigationKeyEvent.FromTab
6005
6006 """
5b5c9bc7 6007 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
908b74cd 6008
d55e5bfc 6009 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6010 """
6011 GetCurrentFocus(self) -> Window
6012
6013 Returns the child window which currenty has the focus. May be
6014 ``None``.
6015 """
5b5c9bc7 6016 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
d55e5bfc
RD
6017
6018 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6019 """
6020 SetCurrentFocus(self, Window win)
6021
6022 Set the window that has the focus.
6023 """
5b5c9bc7 6024 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
d55e5bfc 6025
5b5c9bc7
RD
6026 IsBackward = _core_.NavigationKeyEvent_IsBackward
6027 IsForward = _core_.NavigationKeyEvent_IsForward
6028 WinChange = _core_.NavigationKeyEvent_WinChange
6029 FromTab = _core_.NavigationKeyEvent_FromTab
2131d850 6030_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d55e5bfc
RD
6031
6032#---------------------------------------------------------------------------
6033
5b5c9bc7 6034class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6035 """
6036 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6037 underlying GUI object) exists.
6038 """
1bd55598
RD
6039 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6040 __repr__ = _swig_repr
6041 def __init__(self, *args, **kwargs):
5ba5649b
RD
6042 """
6043 __init__(self, Window win=None) -> WindowCreateEvent
6044
6045 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6046 underlying GUI object) exists.
6047 """
1bd55598 6048 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
d55e5bfc 6049 def GetWindow(*args, **kwargs):
5ba5649b
RD
6050 """
6051 GetWindow(self) -> Window
6052
6053 Returns the window that this event refers to.
6054 """
5b5c9bc7 6055 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
d55e5bfc 6056
2131d850 6057_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d55e5bfc 6058
5b5c9bc7 6059class WindowDestroyEvent(CommandEvent):
5ba5649b 6060 """
943e8dfd
RD
6061 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6062 when the GUI window is destroyed.
6063
6064 When a class derived from `wx.Window` is destroyed its destructor will
6065 have already run by the time this event is sent. Therefore this event
6066 will not usually be received at all by the window itself. Since it is
6067 received after the destructor has run, an object should not try to
6068 handle its own wx.WindowDestroyEvent, but it can be used to get
6069 notification of the destruction of another window.
5ba5649b 6070 """
1bd55598
RD
6071 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6072 __repr__ = _swig_repr
6073 def __init__(self, *args, **kwargs):
5ba5649b
RD
6074 """
6075 __init__(self, Window win=None) -> WindowDestroyEvent
6076
943e8dfd
RD
6077 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6078 when the GUI window is destroyed.
6079
6080 When a class derived from `wx.Window` is destroyed its destructor will
6081 have already run by the time this event is sent. Therefore this event
6082 will not usually be received at all by the window itself. Since it is
6083 received after the destructor has run, an object should not try to
6084 handle its own wx.WindowDestroyEvent, but it can be used to get
6085 notification of the destruction of another window.
5ba5649b 6086 """
1bd55598 6087 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
d55e5bfc 6088 def GetWindow(*args, **kwargs):
5ba5649b
RD
6089 """
6090 GetWindow(self) -> Window
6091
6092 Returns the window that this event refers to.
6093 """
5b5c9bc7 6094 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
d55e5bfc 6095
2131d850 6096_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d55e5bfc
RD
6097
6098#---------------------------------------------------------------------------
6099
5b5c9bc7 6100class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6101 """
6102 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6103 give the application a chance to show a context (popup) menu.
6104 """
1bd55598
RD
6105 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6106 __repr__ = _swig_repr
6107 def __init__(self, *args, **kwargs):
5ba5649b 6108 """
2131d850 6109 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6110
6111 Constructor.
6112 """
1bd55598 6113 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
d55e5bfc 6114 def GetPosition(*args, **kwargs):
5ba5649b
RD
6115 """
6116 GetPosition(self) -> Point
6117
6118 Returns the position (in screen coordinants) at which the menu should
6119 be shown.
6120 """
5b5c9bc7 6121 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
6122
6123 def SetPosition(*args, **kwargs):
5ba5649b
RD
6124 """
6125 SetPosition(self, Point pos)
6126
6127 Sets the position at which the menu should be shown.
6128 """
5b5c9bc7 6129 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
d55e5bfc 6130
2131d850 6131_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d55e5bfc
RD
6132
6133#---------------------------------------------------------------------------
6134
5b5c9bc7
RD
6135IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6136IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6137class IdleEvent(Event):
5ba5649b
RD
6138 """
6139 This class is used for EVT_IDLE events, which are generated and sent
6140 when the application *becomes* idle. In other words, the when the
6141 event queue becomes empty then idle events are sent to all windows (by
6142 default) and as long as none of them call `RequestMore` then there are
6143 no more idle events until after the system event queue has some normal
6144 events and then becomes empty again.
6145
6146 By default, idle events are sent to all windows. If this is causing a
6147 significant overhead in your application, you can call
6148 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6149 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6150 which should receive idle events. Then idle events will only be sent
6151 to those windows and not to any others.
6152 """
1bd55598
RD
6153 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6154 __repr__ = _swig_repr
6155 def __init__(self, *args, **kwargs):
5ba5649b
RD
6156 """
6157 __init__(self) -> IdleEvent
6158
6159 Constructor
6160 """
1bd55598 6161 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
d55e5bfc 6162 def RequestMore(*args, **kwargs):
5ba5649b
RD
6163 """
6164 RequestMore(self, bool needMore=True)
6165
6166 Tells wxWidgets that more processing is required. This function can be
6167 called by an EVT_IDLE handler for a window to indicate that the
6168 application should forward the EVT_IDLE event once more to the
6169 application windows. If no window calls this function during its
6170 EVT_IDLE handler, then the application will remain in a passive event
6171 loop until a new event is posted to the application by the windowing
6172 system.
6173 """
5b5c9bc7 6174 return _core_.IdleEvent_RequestMore(*args, **kwargs)
d55e5bfc
RD
6175
6176 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6177 """
6178 MoreRequested(self) -> bool
6179
6180 Returns ``True`` if the OnIdle function processing this event
6181 requested more processing time.
6182 """
5b5c9bc7 6183 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
d55e5bfc
RD
6184
6185 def SetMode(*args, **kwargs):
5ba5649b
RD
6186 """
6187 SetMode(int mode)
6188
6189 Static method for specifying how wxWidgets will send idle events: to
6190 all windows, or only to those which specify that they will process the
6191 events.
6192
6193 The mode can be one of the following values:
6194
6195 ========================= ========================================
6196 wx.IDLE_PROCESS_ALL Send idle events to all windows
6197 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6198 the wx.WS_EX_PROCESS_IDLE extra style
6199 flag set.
6200 ========================= ========================================
6201
6202 """
5b5c9bc7 6203 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
6204
6205 SetMode = staticmethod(SetMode)
6206 def GetMode(*args, **kwargs):
5ba5649b
RD
6207 """
6208 GetMode() -> int
6209
6210 Static method returning a value specifying how wxWidgets will send
6211 idle events: to all windows, or only to those which specify that they
6212 will process the events.
6213 """
5b5c9bc7 6214 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6215
6216 GetMode = staticmethod(GetMode)
6217 def CanSend(*args, **kwargs):
5ba5649b
RD
6218 """
6219 CanSend(Window win) -> bool
6220
6221 Returns ``True`` if it is appropriate to send idle events to this
6222 window.
6223
6224 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6225 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6226 events should be sent to this window now. By default this will always
6227 return ``True`` because the update mode is initially
6228 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6229 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6230 """
5b5c9bc7 6231 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6232
6233 CanSend = staticmethod(CanSend)
2131d850 6234_core_.IdleEvent_swigregister(IdleEvent)
d55e5bfc 6235
5b5c9bc7 6236def IdleEvent_SetMode(*args, **kwargs):
1bd55598 6237 """
5ba5649b
RD
6238 IdleEvent_SetMode(int mode)
6239
6240 Static method for specifying how wxWidgets will send idle events: to
6241 all windows, or only to those which specify that they will process the
6242 events.
6243
6244 The mode can be one of the following values:
6245
6246 ========================= ========================================
6247 wx.IDLE_PROCESS_ALL Send idle events to all windows
6248 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6249 the wx.WS_EX_PROCESS_IDLE extra style
6250 flag set.
6251 ========================= ========================================
6252
6253 """
1bd55598 6254 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6255
1bd55598
RD
6256def IdleEvent_GetMode(*args):
6257 """
5ba5649b
RD
6258 IdleEvent_GetMode() -> int
6259
6260 Static method returning a value specifying how wxWidgets will send
6261 idle events: to all windows, or only to those which specify that they
6262 will process the events.
6263 """
1bd55598 6264 return _core_.IdleEvent_GetMode(*args)
d55e5bfc 6265
5b5c9bc7 6266def IdleEvent_CanSend(*args, **kwargs):
1bd55598 6267 """
5ba5649b
RD
6268 IdleEvent_CanSend(Window win) -> bool
6269
6270 Returns ``True`` if it is appropriate to send idle events to this
6271 window.
6272
6273 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6274 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6275 events should be sent to this window now. By default this will always
6276 return ``True`` because the update mode is initially
6277 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6278 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6279 """
1bd55598 6280 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6281
6282#---------------------------------------------------------------------------
6283
2131d850
RD
6284class ClipboardTextEvent(CommandEvent):
6285 """
6286 A Clipboard Text event is sent when a window intercepts a text
6287 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6288 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6289 popup menu command, etc. NOTE : under windows these events are *NOT*
6290 generated automatically for a Rich Edit text control.
6291 """
6292 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6293 __repr__ = _swig_repr
6294 def __init__(self, *args, **kwargs):
6295 """
6296 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6297
6298 A Clipboard Text event is sent when a window intercepts a text
6299 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6300 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6301 popup menu command, etc. NOTE : under windows these events are *NOT*
6302 generated automatically for a Rich Edit text control.
6303 """
6304 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6305_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6306
6307#---------------------------------------------------------------------------
6308
5b5c9bc7 6309class PyEvent(Event):
5ba5649b
RD
6310 """
6311 wx.PyEvent can be used as a base class for implementing custom event
6312 types in Python. You should derived from this class instead of
6313 `wx.Event` because this class is Python-aware and is able to transport
6314 its Python bits safely through the wxWidgets event system and have
6315 them still be there when the event handler is invoked.
6316
6317 :see: `wx.PyCommandEvent`
6318
6319 """
1bd55598
RD
6320 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6321 __repr__ = _swig_repr
6322 def __init__(self, *args, **kwargs):
2131d850 6323 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
1bd55598 6324 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6325 self._SetSelf(self)
d55e5bfc 6326
1bd55598
RD
6327 __swig_destroy__ = _core_.delete_PyEvent
6328 __del__ = lambda self : None;
5ba5649b
RD
6329 def _SetSelf(*args, **kwargs):
6330 """_SetSelf(self, PyObject self)"""
6331 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6332
5ba5649b
RD
6333 def _GetSelf(*args, **kwargs):
6334 """_GetSelf(self) -> PyObject"""
6335 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc 6336
2131d850 6337_core_.PyEvent_swigregister(PyEvent)
d55e5bfc 6338
5b5c9bc7 6339class PyCommandEvent(CommandEvent):
5ba5649b
RD
6340 """
6341 wx.PyCommandEvent can be used as a base class for implementing custom
6342 event types in Python, where the event shoudl travel up to parent
6343 windows looking for a handler. You should derived from this class
6344 instead of `wx.CommandEvent` because this class is Python-aware and is
6345 able to transport its Python bits safely through the wxWidgets event
6346 system and have them still be there when the event handler is invoked.
6347
6348 :see: `wx.PyEvent`
6349
6350 """
1bd55598
RD
6351 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6352 __repr__ = _swig_repr
6353 def __init__(self, *args, **kwargs):
2131d850 6354 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
1bd55598 6355 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6356 self._SetSelf(self)
d55e5bfc 6357
1bd55598
RD
6358 __swig_destroy__ = _core_.delete_PyCommandEvent
6359 __del__ = lambda self : None;
5ba5649b
RD
6360 def _SetSelf(*args, **kwargs):
6361 """_SetSelf(self, PyObject self)"""
6362 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6363
5ba5649b
RD
6364 def _GetSelf(*args, **kwargs):
6365 """_GetSelf(self) -> PyObject"""
6366 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc 6367
2131d850 6368_core_.PyCommandEvent_swigregister(PyCommandEvent)
d55e5bfc 6369
5b5c9bc7 6370class DateEvent(CommandEvent):
5ba5649b
RD
6371 """
6372 This event class holds information about a date change event and is
6373 used together with `wx.DatePickerCtrl`. It also serves as a base class
6374 for `wx.calendar.CalendarEvent`. Bind these event types with
6375 EVT_DATE_CHANGED.
6376 """
1bd55598
RD
6377 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6378 __repr__ = _swig_repr
6379 def __init__(self, *args, **kwargs):
2131d850 6380 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
1bd55598 6381 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6382 def GetDate(*args, **kwargs):
5ba5649b
RD
6383 """
6384 GetDate(self) -> DateTime
6385
6386 Returns the date.
6387 """
5b5c9bc7 6388 return _core_.DateEvent_GetDate(*args, **kwargs)
53aa7709
RD
6389
6390 def SetDate(*args, **kwargs):
5ba5649b
RD
6391 """
6392 SetDate(self, DateTime date)
6393
6394 Sets the date carried by the event, normally only used by the library
6395 internally.
6396 """
5b5c9bc7 6397 return _core_.DateEvent_SetDate(*args, **kwargs)
53aa7709 6398
2131d850 6399_core_.DateEvent_swigregister(DateEvent)
53aa7709 6400
5b5c9bc7 6401wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
53aa7709
RD
6402EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6403
d55e5bfc
RD
6404#---------------------------------------------------------------------------
6405
5b5c9bc7
RD
6406PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6407PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6408PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6409PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6410PRINT_WINDOWS = _core_.PRINT_WINDOWS
6411PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6412class PyApp(EvtHandler):
d6c14a4c
RD
6413 """
6414 The ``wx.PyApp`` class is an *implementation detail*, please use the
6415 `wx.App` class (or some other derived class) instead.
6416 """
1bd55598
RD
6417 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6418 __repr__ = _swig_repr
6419 def __init__(self, *args, **kwargs):
d55e5bfc 6420 """
5b5c9bc7 6421 __init__(self) -> PyApp
d55e5bfc
RD
6422
6423 Create a new application object, starting the bootstrap process.
6424 """
1bd55598 6425 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
7993762b
RD
6426 self._setCallbackInfo(self, PyApp, False)
6427 self._setOORInfo(self, False)
d55e5bfc 6428
1bd55598
RD
6429 __swig_destroy__ = _core_.delete_PyApp
6430 __del__ = lambda self : None;
d55e5bfc 6431 def _setCallbackInfo(*args, **kwargs):
7993762b 6432 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
5b5c9bc7 6433 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
6434
6435 def GetAppName(*args, **kwargs):
6436 """
5b5c9bc7 6437 GetAppName(self) -> String
d55e5bfc
RD
6438
6439 Get the application name.
6440 """
5b5c9bc7 6441 return _core_.PyApp_GetAppName(*args, **kwargs)
d55e5bfc
RD
6442
6443 def SetAppName(*args, **kwargs):
6444 """
5b5c9bc7 6445 SetAppName(self, String name)
d55e5bfc 6446
d6c14a4c
RD
6447 Set the application name. This value may be used automatically by
6448 `wx.Config` and such.
d55e5bfc 6449 """
5b5c9bc7 6450 return _core_.PyApp_SetAppName(*args, **kwargs)
d55e5bfc
RD
6451
6452 def GetClassName(*args, **kwargs):
6453 """
5b5c9bc7 6454 GetClassName(self) -> String
d55e5bfc
RD
6455
6456 Get the application's class name.
6457 """
5b5c9bc7 6458 return _core_.PyApp_GetClassName(*args, **kwargs)
d55e5bfc
RD
6459
6460 def SetClassName(*args, **kwargs):
6461 """
5b5c9bc7 6462 SetClassName(self, String name)
d55e5bfc 6463
d6c14a4c
RD
6464 Set the application's class name. This value may be used for
6465 X-resources if applicable for the platform
d55e5bfc 6466 """
5b5c9bc7 6467 return _core_.PyApp_SetClassName(*args, **kwargs)
d55e5bfc
RD
6468
6469 def GetVendorName(*args, **kwargs):
6470 """
5b5c9bc7 6471 GetVendorName(self) -> String
d55e5bfc
RD
6472
6473 Get the application's vendor name.
6474 """
5b5c9bc7 6475 return _core_.PyApp_GetVendorName(*args, **kwargs)
d55e5bfc
RD
6476
6477 def SetVendorName(*args, **kwargs):
6478 """
5b5c9bc7 6479 SetVendorName(self, String name)
d55e5bfc 6480
d6c14a4c
RD
6481 Set the application's vendor name. This value may be used
6482 automatically by `wx.Config` and such.
d55e5bfc 6483 """
5b5c9bc7 6484 return _core_.PyApp_SetVendorName(*args, **kwargs)
d55e5bfc
RD
6485
6486 def GetTraits(*args, **kwargs):
6487 """
6488 GetTraits(self) -> wxAppTraits
6489
d6c14a4c
RD
6490 Return (and create if necessary) the app traits object to which we
6491 delegate for everything which either should be configurable by the
6492 user (then he can change the default behaviour simply by overriding
6493 CreateTraits() and returning his own traits object) or which is
6494 GUI/console dependent as then wx.AppTraits allows us to abstract the
6495 differences behind the common facade.
6496
6497 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc 6498 """
5b5c9bc7 6499 return _core_.PyApp_GetTraits(*args, **kwargs)
d55e5bfc
RD
6500
6501 def ProcessPendingEvents(*args, **kwargs):
6502 """
6503 ProcessPendingEvents(self)
6504
d6c14a4c
RD
6505 Process all events in the Pending Events list -- it is necessary to
6506 call this function to process posted events. This normally happens
6507 during each event loop iteration.
d55e5bfc 6508 """
5b5c9bc7 6509 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
6510
6511 def Yield(*args, **kwargs):
6512 """
6513 Yield(self, bool onlyIfNeeded=False) -> bool
6514
d6c14a4c
RD
6515 Process all currently pending events right now, instead of waiting
6516 until return to the event loop. It is an error to call ``Yield``
6517 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 6518
d6c14a4c 6519 :warning: This function is dangerous as it can lead to unexpected
15817c7e
RD
6520 reentrancies (i.e. when called from an event handler it may
6521 result in calling the same event handler again), use with
6522 extreme care or, better, don't use at all!
d55e5bfc 6523
d6c14a4c 6524 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
15817c7e 6525
d55e5bfc 6526 """
5b5c9bc7 6527 return _core_.PyApp_Yield(*args, **kwargs)
d55e5bfc
RD
6528
6529 def WakeUpIdle(*args, **kwargs):
6530 """
6531 WakeUpIdle(self)
6532
d6c14a4c
RD
6533 Make sure that idle events are sent again.
6534 :see: `wx.WakeUpIdle`
d55e5bfc 6535 """
5b5c9bc7 6536 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
d55e5bfc 6537
84f85550
RD
6538 def IsMainLoopRunning(*args, **kwargs):
6539 """
6540 IsMainLoopRunning() -> bool
6541
6542 Returns True if we're running the main loop, i.e. if the events can
6543 currently be dispatched.
6544 """
5b5c9bc7 6545 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550
RD
6546
6547 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
6548 def MainLoop(*args, **kwargs):
6549 """
6550 MainLoop(self) -> int
6551
d6c14a4c
RD
6552 Execute the main GUI loop, the function doesn't normally return until
6553 all top level windows have been closed and destroyed.
d55e5bfc 6554 """
5b5c9bc7 6555 return _core_.PyApp_MainLoop(*args, **kwargs)
d55e5bfc
RD
6556
6557 def Exit(*args, **kwargs):
6558 """
6559 Exit(self)
6560
6561 Exit the main loop thus terminating the application.
d6c14a4c 6562 :see: `wx.Exit`
d55e5bfc 6563 """
5b5c9bc7 6564 return _core_.PyApp_Exit(*args, **kwargs)
d55e5bfc
RD
6565
6566 def ExitMainLoop(*args, **kwargs):
6567 """
6568 ExitMainLoop(self)
6569
d6c14a4c
RD
6570 Exit the main GUI loop during the next iteration of the main
6571 loop, (i.e. it does not stop the program immediately!)
d55e5bfc 6572 """
5b5c9bc7 6573 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
d55e5bfc
RD
6574
6575 def Pending(*args, **kwargs):
6576 """
6577 Pending(self) -> bool
6578
6579 Returns True if there are unprocessed events in the event queue.
6580 """
5b5c9bc7 6581 return _core_.PyApp_Pending(*args, **kwargs)
d55e5bfc
RD
6582
6583 def Dispatch(*args, **kwargs):
6584 """
6585 Dispatch(self) -> bool
6586
6587 Process the first event in the event queue (blocks until an event
6588 appears if there are none currently)
6589 """
5b5c9bc7 6590 return _core_.PyApp_Dispatch(*args, **kwargs)
d55e5bfc
RD
6591
6592 def ProcessIdle(*args, **kwargs):
6593 """
6594 ProcessIdle(self) -> bool
6595
d6c14a4c
RD
6596 Called from the MainLoop when the application becomes idle (there are
6597 no pending events) and sends a `wx.IdleEvent` to all interested
6598 parties. Returns True if more idle events are needed, False if not.
d55e5bfc 6599 """
5b5c9bc7 6600 return _core_.PyApp_ProcessIdle(*args, **kwargs)
d55e5bfc
RD
6601
6602 def SendIdleEvents(*args, **kwargs):
6603 """
5b5c9bc7 6604 SendIdleEvents(self, Window win, IdleEvent event) -> bool
d55e5bfc 6605
d6c14a4c
RD
6606 Send idle event to window and all subwindows. Returns True if more
6607 idle time is requested.
d55e5bfc 6608 """
5b5c9bc7 6609 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
d55e5bfc
RD
6610
6611 def IsActive(*args, **kwargs):
6612 """
6613 IsActive(self) -> bool
6614
6615 Return True if our app has focus.
6616 """
5b5c9bc7 6617 return _core_.PyApp_IsActive(*args, **kwargs)
d55e5bfc
RD
6618
6619 def SetTopWindow(*args, **kwargs):
6620 """
5b5c9bc7 6621 SetTopWindow(self, Window win)
d55e5bfc 6622
d6c14a4c 6623 Set the *main* top level window
d55e5bfc 6624 """
5b5c9bc7 6625 return _core_.PyApp_SetTopWindow(*args, **kwargs)
d55e5bfc
RD
6626
6627 def GetTopWindow(*args, **kwargs):
6628 """
5b5c9bc7 6629 GetTopWindow(self) -> Window
d55e5bfc 6630
d6c14a4c
RD
6631 Return the *main* top level window (if it hadn't been set previously
6632 with SetTopWindow(), will return just some top level window and, if
6633 there not any, will return None)
d55e5bfc 6634 """
5b5c9bc7 6635 return _core_.PyApp_GetTopWindow(*args, **kwargs)
d55e5bfc
RD
6636
6637 def SetExitOnFrameDelete(*args, **kwargs):
6638 """
6639 SetExitOnFrameDelete(self, bool flag)
6640
d6c14a4c
RD
6641 Control the exit behaviour: by default, the program will exit the main
6642 loop (and so, usually, terminate) when the last top-level program
6643 window is deleted. Beware that if you disable this behaviour (with
6644 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6645 explicitly from somewhere.
d55e5bfc 6646 """
5b5c9bc7 6647 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6648
6649 def GetExitOnFrameDelete(*args, **kwargs):
6650 """
6651 GetExitOnFrameDelete(self) -> bool
6652
6653 Get the current exit behaviour setting.
6654 """
5b5c9bc7 6655 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6656
6657 def SetUseBestVisual(*args, **kwargs):
6658 """
6659 SetUseBestVisual(self, bool flag)
6660
d6c14a4c
RD
6661 Set whether the app should try to use the best available visual on
6662 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc 6663 """
5b5c9bc7 6664 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
6665
6666 def GetUseBestVisual(*args, **kwargs):
6667 """
6668 GetUseBestVisual(self) -> bool
6669
6670 Get current UseBestVisual setting.
6671 """
5b5c9bc7 6672 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
6673
6674 def SetPrintMode(*args, **kwargs):
6675 """SetPrintMode(self, int mode)"""
5b5c9bc7 6676 return _core_.PyApp_SetPrintMode(*args, **kwargs)
d55e5bfc
RD
6677
6678 def GetPrintMode(*args, **kwargs):
6679 """GetPrintMode(self) -> int"""
5b5c9bc7 6680 return _core_.PyApp_GetPrintMode(*args, **kwargs)
d55e5bfc
RD
6681
6682 def SetAssertMode(*args, **kwargs):
6683 """
6684 SetAssertMode(self, int mode)
6685
15817c7e 6686 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc 6687 """
5b5c9bc7 6688 return _core_.PyApp_SetAssertMode(*args, **kwargs)
d55e5bfc
RD
6689
6690 def GetAssertMode(*args, **kwargs):
6691 """
6692 GetAssertMode(self) -> int
6693
6694 Get the current OnAssert behaviour setting.
6695 """
5b5c9bc7 6696 return _core_.PyApp_GetAssertMode(*args, **kwargs)
d55e5bfc
RD
6697
6698 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 6699 """GetMacSupportPCMenuShortcuts() -> bool"""
5b5c9bc7 6700 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
6701
6702 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6703 def GetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 6704 """GetMacAboutMenuItemId() -> long"""
5b5c9bc7 6705 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
6706
6707 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6708 def GetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 6709 """GetMacPreferencesMenuItemId() -> long"""
5b5c9bc7 6710 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
6711
6712 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6713 def GetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 6714 """GetMacExitMenuItemId() -> long"""
5b5c9bc7 6715 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
6716
6717 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6718 def GetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
6719 """GetMacHelpMenuTitleName() -> String"""
6720 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
6721
6722 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6723 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 6724 """SetMacSupportPCMenuShortcuts(bool val)"""
5b5c9bc7 6725 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
6726
6727 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6728 def SetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 6729 """SetMacAboutMenuItemId(long val)"""
5b5c9bc7 6730 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
6731
6732 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6733 def SetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 6734 """SetMacPreferencesMenuItemId(long val)"""
5b5c9bc7 6735 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
6736
6737 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6738 def SetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 6739 """SetMacExitMenuItemId(long val)"""
5b5c9bc7 6740 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
6741
6742 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6743 def SetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
6744 """SetMacHelpMenuTitleName(String val)"""
6745 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
6746
6747 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6748 def _BootstrapApp(*args, **kwargs):
6749 """
6750 _BootstrapApp(self)
6751
6752 For internal use only
6753 """
5b5c9bc7 6754 return _core_.PyApp__BootstrapApp(*args, **kwargs)
d55e5bfc
RD
6755
6756 def GetComCtl32Version(*args, **kwargs):
6757 """
d6c14a4c 6758 GetComCtl32Version() -> int
d55e5bfc 6759
d6c14a4c
RD
6760 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6761 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 6762 """
5b5c9bc7 6763 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
6764
6765 GetComCtl32Version = staticmethod(GetComCtl32Version)
2131d850 6766_core_.PyApp_swigregister(PyApp)
d55e5bfc 6767
1bd55598
RD
6768def PyApp_IsMainLoopRunning(*args):
6769 """
5b5c9bc7 6770 PyApp_IsMainLoopRunning() -> bool
84f85550
RD
6771
6772 Returns True if we're running the main loop, i.e. if the events can
6773 currently be dispatched.
6774 """
1bd55598 6775 return _core_.PyApp_IsMainLoopRunning(*args)
84f85550 6776
1bd55598
RD
6777def PyApp_GetMacSupportPCMenuShortcuts(*args):
6778 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6779 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d55e5bfc 6780
1bd55598
RD
6781def PyApp_GetMacAboutMenuItemId(*args):
6782 """PyApp_GetMacAboutMenuItemId() -> long"""
6783 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d55e5bfc 6784
1bd55598
RD
6785def PyApp_GetMacPreferencesMenuItemId(*args):
6786 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6787 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d55e5bfc 6788
1bd55598
RD
6789def PyApp_GetMacExitMenuItemId(*args):
6790 """PyApp_GetMacExitMenuItemId() -> long"""
6791 return _core_.PyApp_GetMacExitMenuItemId(*args)
d55e5bfc 6792
1bd55598
RD
6793def PyApp_GetMacHelpMenuTitleName(*args):
6794 """PyApp_GetMacHelpMenuTitleName() -> String"""
6795 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d55e5bfc 6796
5b5c9bc7 6797def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
1bd55598
RD
6798 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6799 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 6800
5b5c9bc7 6801def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
1bd55598
RD
6802 """PyApp_SetMacAboutMenuItemId(long val)"""
6803 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 6804
5b5c9bc7 6805def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
1bd55598
RD
6806 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6807 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 6808
5b5c9bc7 6809def PyApp_SetMacExitMenuItemId(*args, **kwargs):
1bd55598
RD
6810 """PyApp_SetMacExitMenuItemId(long val)"""
6811 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 6812
5b5c9bc7 6813def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
1bd55598
RD
6814 """PyApp_SetMacHelpMenuTitleName(String val)"""
6815 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 6816
1bd55598
RD
6817def PyApp_GetComCtl32Version(*args):
6818 """
5b5c9bc7 6819 PyApp_GetComCtl32Version() -> int
d55e5bfc 6820
d6c14a4c
RD
6821 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6822 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 6823 """
1bd55598 6824 return _core_.PyApp_GetComCtl32Version(*args)
d55e5bfc
RD
6825
6826#---------------------------------------------------------------------------
6827
6828
1bd55598
RD
6829def Exit(*args):
6830 """
5b5c9bc7 6831 Exit()
d55e5bfc
RD
6832
6833 Force an exit of the application. Convenience for wx.GetApp().Exit()
6834 """
1bd55598 6835 return _core_.Exit(*args)
d55e5bfc 6836
1bd55598
RD
6837def Yield(*args):
6838 """
5b5c9bc7 6839 Yield() -> bool
d55e5bfc
RD
6840
6841 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6842 """
1bd55598 6843 return _core_.Yield(*args)
d55e5bfc 6844
1bd55598
RD
6845def YieldIfNeeded(*args):
6846 """
5b5c9bc7 6847 YieldIfNeeded() -> bool
d55e5bfc
RD
6848
6849 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6850 """
1bd55598 6851 return _core_.YieldIfNeeded(*args)
d55e5bfc 6852
5b5c9bc7 6853def SafeYield(*args, **kwargs):
1bd55598 6854 """
5b5c9bc7 6855 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
d55e5bfc 6856
d6c14a4c
RD
6857 This function is similar to `wx.Yield`, except that it disables the
6858 user input to all program windows before calling `wx.Yield` and
6859 re-enables it again afterwards. If ``win`` is not None, this window
6860 will remain enabled, allowing the implementation of some limited user
6861 interaction.
d55e5bfc 6862
d6c14a4c 6863 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 6864 """
1bd55598 6865 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 6866
1bd55598
RD
6867def WakeUpIdle(*args):
6868 """
5b5c9bc7 6869 WakeUpIdle()
d55e5bfc 6870
d6c14a4c
RD
6871 Cause the message queue to become empty again, so idle events will be
6872 sent.
d55e5bfc 6873 """
1bd55598 6874 return _core_.WakeUpIdle(*args)
d55e5bfc 6875
5b5c9bc7 6876def PostEvent(*args, **kwargs):
1bd55598 6877 """
5b5c9bc7 6878 PostEvent(EvtHandler dest, Event event)
d55e5bfc 6879
d6c14a4c
RD
6880 Send an event to a window or other wx.EvtHandler to be processed
6881 later.
d55e5bfc 6882 """
1bd55598 6883 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 6884
1bd55598
RD
6885def App_CleanUp(*args):
6886 """
5b5c9bc7 6887 App_CleanUp()
d55e5bfc 6888
15817c7e 6889 For internal use only, it is used to cleanup after wxWidgets when
d6c14a4c 6890 Python shuts down.
d55e5bfc 6891 """
1bd55598 6892 return _core_.App_CleanUp(*args)
d55e5bfc 6893
1bd55598
RD
6894def GetApp(*args):
6895 """
5b5c9bc7 6896 GetApp() -> PyApp
d55e5bfc
RD
6897
6898 Return a reference to the current wx.App object.
6899 """
1bd55598 6900 return _core_.GetApp(*args)
5cbf236d 6901
5b5c9bc7 6902def SetDefaultPyEncoding(*args, **kwargs):
1bd55598 6903 """
5cbf236d
RD
6904 SetDefaultPyEncoding(string encoding)
6905
6906 Sets the encoding that wxPython will use when it needs to convert a
6907 Python string or unicode object to or from a wxString.
62d32a5f
RD
6908
6909 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6910 but please be aware that the default encoding within the same locale
6911 may be slightly different on different platforms. For example, please
6912 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6913 between the common latin/roman encodings.
5cbf236d 6914 """
1bd55598 6915 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 6916
1bd55598
RD
6917def GetDefaultPyEncoding(*args):
6918 """
5cbf236d
RD
6919 GetDefaultPyEncoding() -> string
6920
6921 Gets the current encoding that wxPython will use when it needs to
6922 convert a Python string or unicode object to or from a wxString.
6923 """
1bd55598 6924 return _core_.GetDefaultPyEncoding(*args)
d55e5bfc
RD
6925#----------------------------------------------------------------------
6926
6927class PyOnDemandOutputWindow:
6928 """
6929 A class that can be used for redirecting Python's stdout and
6930 stderr streams. It will do nothing until something is wrriten to
6931 the stream at which point it will create a Frame with a text area
6932 and write the text there.
6933 """
6934 def __init__(self, title = "wxPython: stdout/stderr"):
6935 self.frame = None
6936 self.title = title
412d302d
RD
6937 self.pos = wx.DefaultPosition
6938 self.size = (450, 300)
d55e5bfc
RD
6939 self.parent = None
6940
6941 def SetParent(self, parent):
6942 """Set the window to be used as the popup Frame's parent."""
6943 self.parent = parent
6944
6945
6946 def CreateOutputWindow(self, st):
412d302d
RD
6947 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
6948 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 6949 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 6950 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 6951 self.text.AppendText(st)
d55e5bfc 6952 self.frame.Show(True)
2131d850 6953 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
d55e5bfc
RD
6954
6955
6956 def OnCloseWindow(self, event):
6957 if self.frame is not None:
6958 self.frame.Destroy()
6959 self.frame = None
6960 self.text = None
6961
6962
6963 # These methods provide the file-like output behaviour.
6964 def write(self, text):
6965 """
6966 Create the output window if needed and write the string to it.
6967 If not called in the context of the gui thread then uses
6968 CallAfter to do the work there.
6969 """
6970 if self.frame is None:
6971 if not wx.Thread_IsMain():
6972 wx.CallAfter(self.CreateOutputWindow, text)
6973 else:
6974 self.CreateOutputWindow(text)
6975 else:
6976 if not wx.Thread_IsMain():
6977 wx.CallAfter(self.text.AppendText, text)
6978 else:
6979 self.text.AppendText(text)
6980
6981
6982 def close(self):
6983 if self.frame is not None:
6984 wx.CallAfter(self.frame.Close)
6985
6986
bb4524c4
RD
6987 def flush(self):
6988 pass
6989
6990
d55e5bfc
RD
6991
6992#----------------------------------------------------------------------
6993
6994_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
6995
6996class App(wx.PyApp):
6997 """
d6c14a4c
RD
6998 The ``wx.App`` class represents the application and is used to:
6999
7000 * bootstrap the wxPython system and initialize the underlying
7001 gui toolkit
7002 * set and get application-wide properties
7003 * implement the windowing system main message or event loop,
7004 and to dispatch events to window instances
7005 * etc.
7006
7007 Every application must have a ``wx.App`` instance, and all
7008 creation of UI objects should be delayed until after the
7009 ``wx.App`` object has been created in order to ensure that the gui
7010 platform and wxWidgets have been fully initialized.
7011
7012 Normally you would derive from this class and implement an
7013 ``OnInit`` method that creates a frame and then calls
7014 ``self.SetTopWindow(frame)``.
7015
7016 :see: `wx.PySimpleApp` for a simpler app class that can be used
15817c7e 7017 directly.
d55e5bfc 7018 """
d6c14a4c 7019
d55e5bfc
RD
7020 outputWindowClass = PyOnDemandOutputWindow
7021
d6c14a4c
RD
7022 def __init__(self, redirect=_defRedirect, filename=None,
7023 useBestVisual=False, clearSigInt=True):
7024 """
7025 Construct a ``wx.App`` object.
7026
7027 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7028 redirected? Defaults to True on Windows and Mac, False
7029 otherwise. If `filename` is None then output will be
7030 redirected to a window that pops up as needed. (You can
7031 control what kind of window is created for the output by
7032 resetting the class variable ``outputWindowClass`` to a
7033 class of your choosing.)
7034
7035 :param filename: The name of a file to redirect output to, if
7036 redirect is True.
7037
7038 :param useBestVisual: Should the app try to use the best
7039 available visual provided by the system (only relevant on
7040 systems that have more than one visual.) This parameter
7041 must be used instead of calling `SetUseBestVisual` later
7042 on because it must be set before the underlying GUI
7043 toolkit is initialized.
7044
7045 :param clearSigInt: Should SIGINT be cleared? This allows the
7046 app to terminate upon a Ctrl-C in the console like other
7047 GUI apps will.
7048
7049 :note: You should override OnInit to do applicaition
7050 initialization to ensure that the system, toolkit and
7051 wxWidgets are fully initialized.
7052 """
d55e5bfc
RD
7053 wx.PyApp.__init__(self)
7054
7055 if wx.Platform == "__WXMAC__":
7056 try:
7057 import MacOS
7058 if not MacOS.WMAvailable():
7059 print """\
7060This program needs access to the screen. Please run with 'pythonw',
7061not 'python', and only when you are logged in on the main display of
7062your Mac."""
7063 _sys.exit(1)
0346c964
RD
7064 except SystemExit:
7065 raise
d55e5bfc
RD
7066 except:
7067 pass
7068
7069 # This has to be done before OnInit
7070 self.SetUseBestVisual(useBestVisual)
7071
7072 # Set the default handler for SIGINT. This fixes a problem
7073 # where if Ctrl-C is pressed in the console that started this
7074 # app then it will not appear to do anything, (not even send
7075 # KeyboardInterrupt???) but will later segfault on exit. By
7076 # setting the default handler then the app will exit, as
7077 # expected (depending on platform.)
d6c14a4c
RD
7078 if clearSigInt:
7079 try:
7080 import signal
7081 signal.signal(signal.SIGINT, signal.SIG_DFL)
7082 except:
7083 pass
d55e5bfc
RD
7084
7085 # Save and redirect the stdio to a window?
7086 self.stdioWin = None
7087 self.saveStdio = (_sys.stdout, _sys.stderr)
7088 if redirect:
7089 self.RedirectStdio(filename)
7090
8fb0e70a
RD
7091 # Use Python's install prefix as the default
7092 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7093
d55e5bfc
RD
7094 # This finishes the initialization of wxWindows and then calls
7095 # the OnInit that should be present in the derived class
7096 self._BootstrapApp()
7097
7098
2131d850
RD
7099 def OnPreInit(self):
7100 """
7101 Things that must be done after _BootstrapApp has done its
7102 thing, but would be nice if they were already done by the time
7103 that OnInit is called.
7104 """
7105 wx.StockGDI._initStockObjects()
7106
7107
66af7a75
RD
7108 def __del__(self, destroy=wx.PyApp.__del__):
7109 self.RestoreStdio() # Just in case the MainLoop was overridden
7110 destroy(self)
d55e5bfc 7111
7993762b
RD
7112 def Destroy(self):
7113 wx.PyApp.Destroy(self)
7114 self.thisown = 0
d55e5bfc
RD
7115
7116 def SetTopWindow(self, frame):
7117 """Set the \"main\" top level window"""
7118 if self.stdioWin:
7119 self.stdioWin.SetParent(frame)
7120 wx.PyApp.SetTopWindow(self, frame)
7121
7122
7123 def MainLoop(self):
7124 """Execute the main GUI event loop"""
7125 wx.PyApp.MainLoop(self)
7126 self.RestoreStdio()
7127
7128
7129 def RedirectStdio(self, filename=None):
7130 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7131 if filename:
7132 _sys.stdout = _sys.stderr = open(filename, 'a')
7133 else:
7134 self.stdioWin = self.outputWindowClass()
7135 _sys.stdout = _sys.stderr = self.stdioWin
7136
7137
7138 def RestoreStdio(self):
66af7a75
RD
7139 try:
7140 _sys.stdout, _sys.stderr = self.saveStdio
7141 except:
7142 pass
d55e5bfc
RD
7143
7144
412d302d
RD
7145 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7146 """
7147 Set the title, position and/or size of the output window if
f5b96ee1
RD
7148 the stdio has been redirected. This should be called before
7149 any output would cause the output window to be created.
412d302d
RD
7150 """
7151 if self.stdioWin:
7152 if title is not None:
7153 self.stdioWin.title = title
7154 if pos is not None:
7155 self.stdioWin.pos = pos
7156 if size is not None:
7157 self.stdioWin.size = size
7158
7159
7160
d55e5bfc 7161
d6c14a4c 7162# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7163App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7164App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7165App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7166App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7167App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7168App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7169App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7170App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7171App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7172App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7173App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7174
7175#----------------------------------------------------------------------------
7176
7177class PySimpleApp(wx.App):
7178 """
7179 A simple application class. You can just create one of these and
7180 then then make your top level windows later, and not have to worry
d6c14a4c 7181 about OnInit. For example::
d55e5bfc 7182
d6c14a4c
RD
7183 app = wx.PySimpleApp()
7184 frame = wx.Frame(None, title='Hello World')
7185 frame.Show()
7186 app.MainLoop()
7187
7188 :see: `wx.App`
7189 """
7190
7191 def __init__(self, redirect=False, filename=None,
7192 useBestVisual=False, clearSigInt=True):
7193 """
7194 :see: `wx.App.__init__`
7195 """
7196 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7197
7198 def OnInit(self):
d55e5bfc
RD
7199 return True
7200
7201
d6c14a4c 7202
d55e5bfc
RD
7203# Is anybody using this one?
7204class PyWidgetTester(wx.App):
7205 def __init__(self, size = (250, 100)):
7206 self.size = size
7207 wx.App.__init__(self, 0)
7208
7209 def OnInit(self):
7210 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7211 self.SetTopWindow(self.frame)
7212 return True
7213
d6c14a4c
RD
7214 def SetWidget(self, widgetClass, *args, **kwargs):
7215 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7216 self.frame.Show(True)
7217
7218#----------------------------------------------------------------------------
7219# DO NOT hold any other references to this object. This is how we
d6c14a4c 7220# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7221# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
d6c14a4c 7222# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7223
7224class __wxPyCleanup:
7225 def __init__(self):
7226 self.cleanup = _core_.App_CleanUp
7227 def __del__(self):
7228 self.cleanup()
7229
7230_sys.__wxPythonCleanup = __wxPyCleanup()
7231
7232## # another possible solution, but it gets called too early...
d6c14a4c
RD
7233## import atexit
7234## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7235
7236
7237#----------------------------------------------------------------------------
7238
7239#---------------------------------------------------------------------------
7240
5b5c9bc7
RD
7241class EventLoop(object):
7242 """Proxy of C++ EventLoop class"""
1bd55598
RD
7243 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7244 __repr__ = _swig_repr
7245 def __init__(self, *args, **kwargs):
5b5c9bc7 7246 """__init__(self) -> EventLoop"""
1bd55598
RD
7247 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7248 __swig_destroy__ = _core_.delete_EventLoop
7249 __del__ = lambda self : None;
b411df4a
RD
7250 def Run(*args, **kwargs):
7251 """Run(self) -> int"""
5b5c9bc7 7252 return _core_.EventLoop_Run(*args, **kwargs)
b411df4a
RD
7253
7254 def Exit(*args, **kwargs):
7255 """Exit(self, int rc=0)"""
5b5c9bc7 7256 return _core_.EventLoop_Exit(*args, **kwargs)
b411df4a
RD
7257
7258 def Pending(*args, **kwargs):
7259 """Pending(self) -> bool"""
5b5c9bc7 7260 return _core_.EventLoop_Pending(*args, **kwargs)
b411df4a
RD
7261
7262 def Dispatch(*args, **kwargs):
7263 """Dispatch(self) -> bool"""
5b5c9bc7 7264 return _core_.EventLoop_Dispatch(*args, **kwargs)
b411df4a
RD
7265
7266 def IsRunning(*args, **kwargs):
7267 """IsRunning(self) -> bool"""
5b5c9bc7 7268 return _core_.EventLoop_IsRunning(*args, **kwargs)
b411df4a
RD
7269
7270 def GetActive(*args, **kwargs):
5b5c9bc7
RD
7271 """GetActive() -> EventLoop"""
7272 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a
RD
7273
7274 GetActive = staticmethod(GetActive)
7275 def SetActive(*args, **kwargs):
5b5c9bc7
RD
7276 """SetActive(EventLoop loop)"""
7277 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a
RD
7278
7279 SetActive = staticmethod(SetActive)
2131d850 7280_core_.EventLoop_swigregister(EventLoop)
b411df4a 7281
1bd55598
RD
7282def EventLoop_GetActive(*args):
7283 """EventLoop_GetActive() -> EventLoop"""
7284 return _core_.EventLoop_GetActive(*args)
b411df4a 7285
5b5c9bc7 7286def EventLoop_SetActive(*args, **kwargs):
1bd55598
RD
7287 """EventLoop_SetActive(EventLoop loop)"""
7288 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a 7289
32fe5131
RD
7290class EventLoopActivator(object):
7291 """Proxy of C++ EventLoopActivator class"""
1bd55598
RD
7292 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7293 __repr__ = _swig_repr
7294 def __init__(self, *args, **kwargs):
32fe5131 7295 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
1bd55598
RD
7296 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7297 __swig_destroy__ = _core_.delete_EventLoopActivator
7298 __del__ = lambda self : None;
2131d850 7299_core_.EventLoopActivator_swigregister(EventLoopActivator)
32fe5131 7300
b411df4a
RD
7301#---------------------------------------------------------------------------
7302
5b5c9bc7 7303class AcceleratorEntry(object):
d6c14a4c
RD
7304 """
7305 A class used to define items in an `wx.AcceleratorTable`. wxPython
7306 programs can choose to use wx.AcceleratorEntry objects, but using a
7307 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
15817c7e 7308 as well. See `__init__` for of the tuple values.
d6c14a4c
RD
7309
7310 :see: `wx.AcceleratorTable`
7311 """
1bd55598
RD
7312 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7313 __repr__ = _swig_repr
7314 def __init__(self, *args, **kwargs):
d6c14a4c 7315 """
5b5c9bc7 7316 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
d6c14a4c
RD
7317
7318 Construct a wx.AcceleratorEntry.
d6c14a4c 7319 """
1bd55598
RD
7320 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7321 __swig_destroy__ = _core_.delete_AcceleratorEntry
7322 __del__ = lambda self : None;
d55e5bfc 7323 def Set(*args, **kwargs):
d6c14a4c
RD
7324 """
7325 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 7326
d6c14a4c
RD
7327 (Re)set the attributes of a wx.AcceleratorEntry.
7328 :see `__init__`
7329 """
5b5c9bc7 7330 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
7331
7332 def GetFlags(*args, **kwargs):
d6c14a4c
RD
7333 """
7334 GetFlags(self) -> int
7335
7336 Get the AcceleratorEntry's flags.
7337 """
5b5c9bc7 7338 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
d55e5bfc
RD
7339
7340 def GetKeyCode(*args, **kwargs):
d6c14a4c
RD
7341 """
7342 GetKeyCode(self) -> int
7343
7344 Get the AcceleratorEntry's keycode.
7345 """
5b5c9bc7 7346 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
7347
7348 def GetCommand(*args, **kwargs):
d6c14a4c
RD
7349 """
7350 GetCommand(self) -> int
7351
7352 Get the AcceleratorEntry's command ID.
7353 """
5b5c9bc7 7354 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
d55e5bfc 7355
2131d850 7356_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
d55e5bfc 7357
5b5c9bc7 7358class AcceleratorTable(Object):
d6c14a4c
RD
7359 """
7360 An accelerator table allows the application to specify a table of
7361 keyboard shortcuts for menus or other commands. On Windows, menu or
7362 button commands are supported; on GTK, only menu commands are
7363 supported.
d6c14a4c 7364 """
1bd55598
RD
7365 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7366 __repr__ = _swig_repr
7367 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7368 """
7369 __init__(entries) -> AcceleratorTable
7370
d6c14a4c
RD
7371 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7372 items or or of 3-tuples (flags, keyCode, cmdID)
7373
7374 :see: `wx.AcceleratorEntry`
d55e5bfc 7375 """
1bd55598
RD
7376 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7377 __swig_destroy__ = _core_.delete_AcceleratorTable
7378 __del__ = lambda self : None;
d55e5bfc
RD
7379 def Ok(*args, **kwargs):
7380 """Ok(self) -> bool"""
5b5c9bc7 7381 return _core_.AcceleratorTable_Ok(*args, **kwargs)
d55e5bfc 7382
2131d850 7383_core_.AcceleratorTable_swigregister(AcceleratorTable)
d55e5bfc
RD
7384
7385
5b5c9bc7 7386def GetAccelFromString(*args, **kwargs):
1bd55598
RD
7387 """GetAccelFromString(String label) -> AcceleratorEntry"""
7388 return _core_.GetAccelFromString(*args, **kwargs)
d55e5bfc
RD
7389#---------------------------------------------------------------------------
7390
5b5c9bc7 7391class VisualAttributes(object):
d55e5bfc 7392 """struct containing all the visual attributes of a control"""
1bd55598
RD
7393 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7394 __repr__ = _swig_repr
7395 def __init__(self, *args, **kwargs):
d55e5bfc 7396 """
5b5c9bc7 7397 __init__(self) -> VisualAttributes
d55e5bfc
RD
7398
7399 struct containing all the visual attributes of a control
7400 """
1bd55598
RD
7401 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7402 __swig_destroy__ = _core_.delete_VisualAttributes
7403 __del__ = lambda self : None;
5b5c9bc7
RD
7404 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7405 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7406 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 7407_core_.VisualAttributes_swigregister(VisualAttributes)
5b5c9bc7 7408NullAcceleratorTable = cvar.NullAcceleratorTable
d55e5bfc
RD
7409PanelNameStr = cvar.PanelNameStr
7410
5b5c9bc7
RD
7411WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7412WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7413WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7414WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7415WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7416class Window(EvtHandler):
d55e5bfc
RD
7417 """
7418 wx.Window is the base class for all windows and represents any visible
7419 object on the screen. All controls, top level windows and so on are
7420 wx.Windows. Sizers and device contexts are not however, as they don't
7421 appear on screen themselves.
7422
7423 """
1bd55598
RD
7424 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7425 __repr__ = _swig_repr
7426 def __init__(self, *args, **kwargs):
d55e5bfc 7427 """
5b5c9bc7
RD
7428 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7429 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
d55e5bfc
RD
7430
7431 Construct and show a generic Window.
7432 """
1bd55598 7433 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d55e5bfc
RD
7434 self._setOORInfo(self)
7435
7436 def Create(*args, **kwargs):
7437 """
5b5c9bc7
RD
7438 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7439 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
d55e5bfc
RD
7440
7441 Create the GUI part of the Window for 2-phase creation mode.
7442 """
5b5c9bc7 7443 return _core_.Window_Create(*args, **kwargs)
d55e5bfc
RD
7444
7445 def Close(*args, **kwargs):
7446 """
7447 Close(self, bool force=False) -> bool
7448
7449 This function simply generates a EVT_CLOSE event whose handler usually
7450 tries to close the window. It doesn't close the window itself,
7451 however. If force is False (the default) then the window's close
7452 handler will be allowed to veto the destruction of the window.
d55e5bfc 7453 """
5b5c9bc7 7454 return _core_.Window_Close(*args, **kwargs)
d55e5bfc
RD
7455
7456 def Destroy(*args, **kwargs):
7457 """
7458 Destroy(self) -> bool
7459
7460 Destroys the window safely. Frames and dialogs are not destroyed
7461 immediately when this function is called -- they are added to a list
7462 of windows to be deleted on idle time, when all the window's events
7463 have been processed. This prevents problems with events being sent to
7464 non-existent windows.
7465
7466 Returns True if the window has either been successfully deleted, or it
7467 has been added to the list of windows pending real deletion.
7468 """
7e08d4ef
RD
7469 val = _core_.Window_Destroy(*args, **kwargs)
7470 args[0].thisown = 0
7471 return val
d55e5bfc
RD
7472
7473 def DestroyChildren(*args, **kwargs):
7474 """
7475 DestroyChildren(self) -> bool
7476
15817c7e
RD
7477 Destroys all children of a window. Called automatically by the
7478 destructor.
d55e5bfc 7479 """
5b5c9bc7 7480 return _core_.Window_DestroyChildren(*args, **kwargs)
d55e5bfc
RD
7481
7482 def IsBeingDeleted(*args, **kwargs):
7483 """
7484 IsBeingDeleted(self) -> bool
7485
7486 Is the window in the process of being deleted?
7487 """
5b5c9bc7 7488 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d55e5bfc 7489
d55e5bfc
RD
7490 def SetLabel(*args, **kwargs):
7491 """
5b5c9bc7 7492 SetLabel(self, String label)
d55e5bfc
RD
7493
7494 Set the text which the window shows in its label if applicable.
7495 """
5b5c9bc7 7496 return _core_.Window_SetLabel(*args, **kwargs)
d55e5bfc
RD
7497
7498 def GetLabel(*args, **kwargs):
7499 """
5b5c9bc7 7500 GetLabel(self) -> String
d55e5bfc 7501
15817c7e
RD
7502 Generic way of getting a label from any window, for identification
7503 purposes. The interpretation of this function differs from class to
7504 class. For frames and dialogs, the value returned is the title. For
7505 buttons or static text controls, it is the button text. This function
7506 can be useful for meta-programs such as testing tools or special-needs
7507 access programs)which need to identify windows by name.
d55e5bfc 7508 """
5b5c9bc7 7509 return _core_.Window_GetLabel(*args, **kwargs)
d55e5bfc
RD
7510
7511 def SetName(*args, **kwargs):
7512 """
5b5c9bc7 7513 SetName(self, String name)
d55e5bfc 7514
15817c7e
RD
7515 Sets the window's name. The window name is used for ressource setting
7516 in X, it is not the same as the window title/label
d55e5bfc 7517 """
5b5c9bc7 7518 return _core_.Window_SetName(*args, **kwargs)
d55e5bfc
RD
7519
7520 def GetName(*args, **kwargs):
7521 """
5b5c9bc7 7522 GetName(self) -> String
d55e5bfc 7523
15817c7e
RD
7524 Returns the windows name. This name is not guaranteed to be unique;
7525 it is up to the programmer to supply an appropriate name in the window
7526 constructor or via wx.Window.SetName.
d55e5bfc 7527 """
5b5c9bc7 7528 return _core_.Window_GetName(*args, **kwargs)
d55e5bfc
RD
7529
7530 def SetWindowVariant(*args, **kwargs):
7531 """
7532 SetWindowVariant(self, int variant)
7533
15817c7e
RD
7534 Sets the variant of the window/font size to use for this window, if
7535 the platform supports variants, for example, wxMac.
d55e5bfc 7536 """
5b5c9bc7 7537 return _core_.Window_SetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7538
7539 def GetWindowVariant(*args, **kwargs):
7540 """GetWindowVariant(self) -> int"""
5b5c9bc7 7541 return _core_.Window_GetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7542
7543 def SetId(*args, **kwargs):
7544 """
7545 SetId(self, int winid)
7546
7547 Sets the identifier of the window. Each window has an integer
7548 identifier. If the application has not provided one, an identifier
7549 will be generated. Normally, the identifier should be provided on
7550 creation and should not be modified subsequently.
7551 """
5b5c9bc7 7552 return _core_.Window_SetId(*args, **kwargs)
d55e5bfc
RD
7553
7554 def GetId(*args, **kwargs):
7555 """
7556 GetId(self) -> int
7557
7558 Returns the identifier of the window. Each window has an integer
7559 identifier. If the application has not provided one (or the default Id
7560 -1 is used) then an unique identifier with a negative value will be
7561 generated.
7562 """
5b5c9bc7 7563 return _core_.Window_GetId(*args, **kwargs)
d55e5bfc
RD
7564
7565 def NewControlId(*args, **kwargs):
7566 """
d6c14a4c 7567 NewControlId() -> int
d55e5bfc
RD
7568
7569 Generate a control id for the controls which were not given one.
7570 """
5b5c9bc7 7571 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc
RD
7572
7573 NewControlId = staticmethod(NewControlId)
7574 def NextControlId(*args, **kwargs):
7575 """
d6c14a4c 7576 NextControlId(int winid) -> int
d55e5bfc
RD
7577
7578 Get the id of the control following the one with the given
15817c7e 7579 autogenerated) id
d55e5bfc 7580 """
5b5c9bc7 7581 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
7582
7583 NextControlId = staticmethod(NextControlId)
7584 def PrevControlId(*args, **kwargs):
7585 """
d6c14a4c 7586 PrevControlId(int winid) -> int
d55e5bfc
RD
7587
7588 Get the id of the control preceding the one with the given
15817c7e 7589 autogenerated) id
d55e5bfc 7590 """
5b5c9bc7 7591 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc
RD
7592
7593 PrevControlId = staticmethod(PrevControlId)
7594 def SetSize(*args, **kwargs):
7595 """
5b5c9bc7 7596 SetSize(self, Size size)
d55e5bfc
RD
7597
7598 Sets the size of the window in pixels.
7599 """
5b5c9bc7 7600 return _core_.Window_SetSize(*args, **kwargs)
d55e5bfc
RD
7601
7602 def SetDimensions(*args, **kwargs):
7603 """
5b5c9bc7 7604 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
7605
7606 Sets the position and size of the window in pixels. The sizeFlags
7607 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
7608 equal to -1.
7609
7610 ======================== ======================================
7611 wx.SIZE_AUTO A -1 indicates that a class-specific
7612 default should be used.
7613 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7614 -1 values are supplied.
7615 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7616 interpreted as real dimensions, not
7617 default values.
7618 ======================== ======================================
7619
d55e5bfc 7620 """
5b5c9bc7 7621 return _core_.Window_SetDimensions(*args, **kwargs)
d55e5bfc
RD
7622
7623 def SetRect(*args, **kwargs):
7624 """
5b5c9bc7 7625 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
7626
7627 Sets the position and size of the window in pixels using a wx.Rect.
7628 """
5b5c9bc7 7629 return _core_.Window_SetRect(*args, **kwargs)
d55e5bfc
RD
7630
7631 def SetSizeWH(*args, **kwargs):
7632 """
7633 SetSizeWH(self, int width, int height)
7634
7635 Sets the size of the window in pixels.
7636 """
5b5c9bc7 7637 return _core_.Window_SetSizeWH(*args, **kwargs)
d55e5bfc
RD
7638
7639 def Move(*args, **kwargs):
7640 """
5b5c9bc7 7641 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
7642
7643 Moves the window to the given position.
7644 """
5b5c9bc7 7645 return _core_.Window_Move(*args, **kwargs)
d55e5bfc
RD
7646
7647 SetPosition = Move
7648 def MoveXY(*args, **kwargs):
7649 """
5b5c9bc7 7650 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
7651
7652 Moves the window to the given position.
7653 """
5b5c9bc7 7654 return _core_.Window_MoveXY(*args, **kwargs)
d55e5bfc 7655
f8167d6e
RD
7656 def SetBestFittingSize(*args, **kwargs):
7657 """
5b5c9bc7 7658 SetBestFittingSize(self, Size size=DefaultSize)
f8167d6e
RD
7659
7660 A 'Smart' SetSize that will fill in default size components with the
7661 window's *best size* values. Also set's the minsize for use with sizers.
7662 """
5b5c9bc7 7663 return _core_.Window_SetBestFittingSize(*args, **kwargs)
f8167d6e 7664
d55e5bfc
RD
7665 def Raise(*args, **kwargs):
7666 """
7667 Raise(self)
7668
943e8dfd
RD
7669 Raises the window to the top of the window hierarchy. In current
7670 version of wxWidgets this works both for manage and child windows.
d55e5bfc 7671 """
5b5c9bc7 7672 return _core_.Window_Raise(*args, **kwargs)
d55e5bfc
RD
7673
7674 def Lower(*args, **kwargs):
7675 """
7676 Lower(self)
7677
943e8dfd
RD
7678 Lowers the window to the bottom of the window hierarchy. In current
7679 version of wxWidgets this works both for manage and child windows.
d55e5bfc 7680 """
5b5c9bc7 7681 return _core_.Window_Lower(*args, **kwargs)
d55e5bfc
RD
7682
7683 def SetClientSize(*args, **kwargs):
7684 """
5b5c9bc7 7685 SetClientSize(self, Size size)
d55e5bfc
RD
7686
7687 This sets the size of the window client area in pixels. Using this
7688 function to size a window tends to be more device-independent than
7689 wx.Window.SetSize, since the application need not worry about what
7690 dimensions the border or title bar have when trying to fit the window
7691 around panel items, for example.
7692 """
5b5c9bc7 7693 return _core_.Window_SetClientSize(*args, **kwargs)
d55e5bfc
RD
7694
7695 def SetClientSizeWH(*args, **kwargs):
7696 """
7697 SetClientSizeWH(self, int width, int height)
7698
7699 This sets the size of the window client area in pixels. Using this
7700 function to size a window tends to be more device-independent than
7701 wx.Window.SetSize, since the application need not worry about what
7702 dimensions the border or title bar have when trying to fit the window
7703 around panel items, for example.
7704 """
5b5c9bc7 7705 return _core_.Window_SetClientSizeWH(*args, **kwargs)
d55e5bfc
RD
7706
7707 def SetClientRect(*args, **kwargs):
7708 """
5b5c9bc7 7709 SetClientRect(self, Rect rect)
d55e5bfc
RD
7710
7711 This sets the size of the window client area in pixels. Using this
7712 function to size a window tends to be more device-independent than
7713 wx.Window.SetSize, since the application need not worry about what
7714 dimensions the border or title bar have when trying to fit the window
7715 around panel items, for example.
7716 """
5b5c9bc7 7717 return _core_.Window_SetClientRect(*args, **kwargs)
d55e5bfc
RD
7718
7719 def GetPosition(*args, **kwargs):
7720 """
5b5c9bc7 7721 GetPosition(self) -> Point
d55e5bfc 7722
1c71765a
RD
7723 Get the window's position. Notice that the position is in client
7724 coordinates for child windows and screen coordinates for the top level
7725 ones, use `GetScreenPosition` if you need screen coordinates for all
7726 kinds of windows.
d55e5bfc 7727 """
5b5c9bc7 7728 return _core_.Window_GetPosition(*args, **kwargs)
d55e5bfc
RD
7729
7730 def GetPositionTuple(*args, **kwargs):
7731 """
7732 GetPositionTuple() -> (x,y)
7733
1c71765a
RD
7734 Get the window's position. Notice that the position is in client
7735 coordinates for child windows and screen coordinates for the top level
7736 ones, use `GetScreenPosition` if you need screen coordinates for all
7737 kinds of windows.
d55e5bfc 7738 """
5b5c9bc7 7739 return _core_.Window_GetPositionTuple(*args, **kwargs)
d55e5bfc 7740
1c71765a
RD
7741 def GetScreenPosition(*args, **kwargs):
7742 """
7743 GetScreenPosition(self) -> Point
7744
7745 Get the position of the window in screen coordinantes.
7746 """
7747 return _core_.Window_GetScreenPosition(*args, **kwargs)
7748
7749 def GetScreenPositionTuple(*args, **kwargs):
7750 """
7751 GetScreenPositionTuple() -> (x,y)
7752
7753 Get the position of the window in screen coordinantes.
7754 """
7755 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7756
7757 def GetScreenRect(*args, **kwargs):
7758 """
7759 GetScreenRect(self) -> Rect
7760
7761 Returns the size and position of the window in screen coordinantes as
7762 a `wx.Rect` object.
7763 """
7764 return _core_.Window_GetScreenRect(*args, **kwargs)
7765
d55e5bfc
RD
7766 def GetSize(*args, **kwargs):
7767 """
5b5c9bc7 7768 GetSize(self) -> Size
d55e5bfc
RD
7769
7770 Get the window size.
7771 """
5b5c9bc7 7772 return _core_.Window_GetSize(*args, **kwargs)
d55e5bfc
RD
7773
7774 def GetSizeTuple(*args, **kwargs):
7775 """
7776 GetSizeTuple() -> (width, height)
7777
7778 Get the window size.
7779 """
5b5c9bc7 7780 return _core_.Window_GetSizeTuple(*args, **kwargs)
d55e5bfc
RD
7781
7782 def GetRect(*args, **kwargs):
7783 """
5b5c9bc7 7784 GetRect(self) -> Rect
d55e5bfc 7785
1c71765a 7786 Returns the size and position of the window as a `wx.Rect` object.
d55e5bfc 7787 """
5b5c9bc7 7788 return _core_.Window_GetRect(*args, **kwargs)
d55e5bfc
RD
7789
7790 def GetClientSize(*args, **kwargs):
7791 """
5b5c9bc7 7792 GetClientSize(self) -> Size
d55e5bfc
RD
7793
7794 This gets the size of the window's 'client area' in pixels. The client
7795 area is the area which may be drawn on by the programmer, excluding
7796 title bar, border, scrollbars, etc.
7797 """
5b5c9bc7 7798 return _core_.Window_GetClientSize(*args, **kwargs)
d55e5bfc
RD
7799
7800 def GetClientSizeTuple(*args, **kwargs):
7801 """
7802 GetClientSizeTuple() -> (width, height)
7803
7804 This gets the size of the window's 'client area' in pixels. The client
7805 area is the area which may be drawn on by the programmer, excluding
7806 title bar, border, scrollbars, etc.
7807 """
5b5c9bc7 7808 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
d55e5bfc
RD
7809
7810 def GetClientAreaOrigin(*args, **kwargs):
7811 """
5b5c9bc7 7812 GetClientAreaOrigin(self) -> Point
d55e5bfc
RD
7813
7814 Get the origin of the client area of the window relative to the
7815 window's top left corner (the client area may be shifted because of
7816 the borders, scrollbars, other decorations...)
7817 """
5b5c9bc7 7818 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
d55e5bfc
RD
7819
7820 def GetClientRect(*args, **kwargs):
7821 """
5b5c9bc7 7822 GetClientRect(self) -> Rect
d55e5bfc 7823
0439c23b 7824 Get the client area position and size as a `wx.Rect` object.
d55e5bfc 7825 """
5b5c9bc7 7826 return _core_.Window_GetClientRect(*args, **kwargs)
d55e5bfc
RD
7827
7828 def GetBestSize(*args, **kwargs):
7829 """
5b5c9bc7 7830 GetBestSize(self) -> Size
d55e5bfc 7831
bfddbb17 7832 This function returns the best acceptable minimal size for the
15817c7e
RD
7833 window, if applicable. For example, for a static text control, it will
7834 be the minimal size such that the control label is not truncated. For
7835 windows containing subwindows (suzh aswx.Panel), the size returned by
7836 this function will be the same as the size the window would have had
7837 after calling Fit.
d55e5bfc 7838 """
5b5c9bc7 7839 return _core_.Window_GetBestSize(*args, **kwargs)
d55e5bfc
RD
7840
7841 def GetBestSizeTuple(*args, **kwargs):
7842 """
7843 GetBestSizeTuple() -> (width, height)
7844
bfddbb17 7845 This function returns the best acceptable minimal size for the
15817c7e
RD
7846 window, if applicable. For example, for a static text control, it will
7847 be the minimal size such that the control label is not truncated. For
7848 windows containing subwindows (suzh aswx.Panel), the size returned by
7849 this function will be the same as the size the window would have had
7850 after calling Fit.
d55e5bfc 7851 """
5b5c9bc7 7852 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
d55e5bfc 7853
a001823c
RD
7854 def InvalidateBestSize(*args, **kwargs):
7855 """
7856 InvalidateBestSize(self)
7857
7858 Reset the cached best size value so it will be recalculated the next
7859 time it is needed.
7860 """
5b5c9bc7 7861 return _core_.Window_InvalidateBestSize(*args, **kwargs)
a001823c 7862
e2813725
RD
7863 def CacheBestSize(*args, **kwargs):
7864 """
7865 CacheBestSize(self, Size size)
7866
7867 Cache the best size so it doesn't need to be calculated again, (at least until
7868 some properties of the window change.)
7869 """
7870 return _core_.Window_CacheBestSize(*args, **kwargs)
7871
a001823c
RD
7872 def GetBestFittingSize(*args, **kwargs):
7873 """
5b5c9bc7 7874 GetBestFittingSize(self) -> Size
a001823c
RD
7875
7876 This function will merge the window's best size into the window's
7877 minimum size, giving priority to the min size components, and returns
7878 the results.
7879
7880 """
5b5c9bc7 7881 return _core_.Window_GetBestFittingSize(*args, **kwargs)
a001823c 7882
d55e5bfc
RD
7883 def GetAdjustedBestSize(*args, **kwargs):
7884 """
5b5c9bc7 7885 GetAdjustedBestSize(self) -> Size
d55e5bfc
RD
7886
7887 This method is similar to GetBestSize, except in one
7888 thing. GetBestSize should return the minimum untruncated size of the
7889 window, while this method will return the largest of BestSize and any
7890 user specified minimum size. ie. it is the minimum size the window
7891 should currently be drawn at, not the minimal size it can possibly
7892 tolerate.
7893 """
5b5c9bc7 7894 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
d55e5bfc
RD
7895
7896 def Center(*args, **kwargs):
7897 """
5b5c9bc7 7898 Center(self, int direction=BOTH)
d55e5bfc
RD
7899
7900 Centers the window. The parameter specifies the direction for
7901 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7902 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7903 on the entire screen and not on its parent window. If it is a
7904 top-level window and has no parent then it will always be centered
7905 relative to the screen.
7906 """
5b5c9bc7 7907 return _core_.Window_Center(*args, **kwargs)
d55e5bfc
RD
7908
7909 Centre = Center
d55e5bfc
RD
7910 def CenterOnParent(*args, **kwargs):
7911 """
5b5c9bc7 7912 CenterOnParent(self, int dir=BOTH)
d55e5bfc
RD
7913
7914 Center with respect to the the parent window
7915 """
5b5c9bc7 7916 return _core_.Window_CenterOnParent(*args, **kwargs)
d55e5bfc
RD
7917
7918 CentreOnParent = CenterOnParent
7919 def Fit(*args, **kwargs):
7920 """
7921 Fit(self)
7922
7923 Sizes the window so that it fits around its subwindows. This function
7924 won't do anything if there are no subwindows and will only really work
7925 correctly if sizers are used for the subwindows layout. Also, if the
7926 window has exactly one subwindow it is better (faster and the result
7927 is more precise as Fit adds some margin to account for fuzziness of
7928 its calculations) to call window.SetClientSize(child.GetSize())
7929 instead of calling Fit.
7930 """
5b5c9bc7 7931 return _core_.Window_Fit(*args, **kwargs)
d55e5bfc
RD
7932
7933 def FitInside(*args, **kwargs):
7934 """
7935 FitInside(self)
7936
7937 Similar to Fit, but sizes the interior (virtual) size of a
7938 window. Mainly useful with scrolled windows to reset scrollbars after
7939 sizing changes that do not trigger a size event, and/or scrolled
7940 windows without an interior sizer. This function similarly won't do
7941 anything if there are no subwindows.
7942 """
5b5c9bc7 7943 return _core_.Window_FitInside(*args, **kwargs)
d55e5bfc 7944
03837c5c 7945 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
7946 """
7947 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
7948 int incH=-1)
d55e5bfc
RD
7949
7950 Allows specification of minimum and maximum window sizes, and window
7951 size increments. If a pair of values is not set (or set to -1), the
7952 default values will be used. If this function is called, the user
908b74cd
RD
7953 will not be able to size the window outside the given bounds (if it is
7954 a top-level window.) Sizers will also inspect the minimum window size
7955 and will use that value if set when calculating layout.
7956
7957 The resizing increments are only significant under Motif or Xt.
d55e5bfc 7958 """
5b5c9bc7 7959 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 7960
03837c5c
RD
7961 def SetSizeHintsSz(*args, **kwargs):
7962 """
5b5c9bc7 7963 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
03837c5c
RD
7964
7965 Allows specification of minimum and maximum window sizes, and window
7966 size increments. If a pair of values is not set (or set to -1), the
7967 default values will be used. If this function is called, the user
7968 will not be able to size the window outside the given bounds (if it is
7969 a top-level window.) Sizers will also inspect the minimum window size
7970 and will use that value if set when calculating layout.
7971
7972 The resizing increments are only significant under Motif or Xt.
7973 """
5b5c9bc7 7974 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
03837c5c
RD
7975
7976 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 7977 """
908b74cd 7978 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
7979
7980 Allows specification of minimum and maximum virtual window sizes. If a
7981 pair of values is not set (or set to -1), the default values will be
7982 used. If this function is called, the user will not be able to size
7983 the virtual area of the window outside the given bounds.
7984 """
5b5c9bc7 7985 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
03837c5c
RD
7986
7987 def SetVirtualSizeHintsSz(*args, **kwargs):
7988 """
5b5c9bc7 7989 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
03837c5c
RD
7990
7991 Allows specification of minimum and maximum virtual window sizes. If a
7992 pair of values is not set (or set to -1), the default values will be
7993 used. If this function is called, the user will not be able to size
7994 the virtual area of the window outside the given bounds.
7995 """
5b5c9bc7 7996 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 7997
908b74cd 7998 def GetMaxSize(*args, **kwargs):
5b5c9bc7
RD
7999 """GetMaxSize(self) -> Size"""
8000 return _core_.Window_GetMaxSize(*args, **kwargs)
908b74cd
RD
8001
8002 def GetMinSize(*args, **kwargs):
5b5c9bc7
RD
8003 """GetMinSize(self) -> Size"""
8004 return _core_.Window_GetMinSize(*args, **kwargs)
908b74cd
RD
8005
8006 def SetMinSize(*args, **kwargs):
8007 """
5b5c9bc7 8008 SetMinSize(self, Size minSize)
908b74cd
RD
8009
8010 A more convenient method than `SetSizeHints` for setting just the
8011 min size.
8012 """
5b5c9bc7 8013 return _core_.Window_SetMinSize(*args, **kwargs)
908b74cd
RD
8014
8015 def SetMaxSize(*args, **kwargs):
8016 """
5b5c9bc7 8017 SetMaxSize(self, Size maxSize)
908b74cd
RD
8018
8019 A more convenient method than `SetSizeHints` for setting just the
8020 max size.
8021 """
5b5c9bc7 8022 return _core_.Window_SetMaxSize(*args, **kwargs)
908b74cd 8023
d55e5bfc
RD
8024 def GetMinWidth(*args, **kwargs):
8025 """GetMinWidth(self) -> int"""
5b5c9bc7 8026 return _core_.Window_GetMinWidth(*args, **kwargs)
d55e5bfc
RD
8027
8028 def GetMinHeight(*args, **kwargs):
8029 """GetMinHeight(self) -> int"""
5b5c9bc7 8030 return _core_.Window_GetMinHeight(*args, **kwargs)
d55e5bfc
RD
8031
8032 def GetMaxWidth(*args, **kwargs):
8033 """GetMaxWidth(self) -> int"""
5b5c9bc7 8034 return _core_.Window_GetMaxWidth(*args, **kwargs)
d55e5bfc
RD
8035
8036 def GetMaxHeight(*args, **kwargs):
8037 """GetMaxHeight(self) -> int"""
5b5c9bc7 8038 return _core_.Window_GetMaxHeight(*args, **kwargs)
d55e5bfc 8039
d55e5bfc
RD
8040 def SetVirtualSize(*args, **kwargs):
8041 """
5b5c9bc7 8042 SetVirtualSize(self, Size size)
d55e5bfc
RD
8043
8044 Set the the virtual size of a window in pixels. For most windows this
8045 is just the client area of the window, but for some like scrolled
8046 windows it is more or less independent of the screen window size.
8047 """
5b5c9bc7 8048 return _core_.Window_SetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8049
8050 def SetVirtualSizeWH(*args, **kwargs):
8051 """
8052 SetVirtualSizeWH(self, int w, int h)
8053
8054 Set the the virtual size of a window in pixels. For most windows this
8055 is just the client area of the window, but for some like scrolled
8056 windows it is more or less independent of the screen window size.
8057 """
5b5c9bc7 8058 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
d55e5bfc
RD
8059
8060 def GetVirtualSize(*args, **kwargs):
8061 """
5b5c9bc7 8062 GetVirtualSize(self) -> Size
d55e5bfc
RD
8063
8064 Get the the virtual size of the window in pixels. For most windows
8065 this is just the client area of the window, but for some like scrolled
8066 windows it is more or less independent of the screen window size.
8067 """
5b5c9bc7 8068 return _core_.Window_GetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8069
8070 def GetVirtualSizeTuple(*args, **kwargs):
8071 """
8072 GetVirtualSizeTuple() -> (width, height)
8073
8074 Get the the virtual size of the window in pixels. For most windows
8075 this is just the client area of the window, but for some like scrolled
8076 windows it is more or less independent of the screen window size.
8077 """
5b5c9bc7 8078 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
d55e5bfc
RD
8079
8080 def GetBestVirtualSize(*args, **kwargs):
8081 """
5b5c9bc7 8082 GetBestVirtualSize(self) -> Size
d55e5bfc
RD
8083
8084 Return the largest of ClientSize and BestSize (as determined by a
8085 sizer, interior children, or other means)
8086 """
5b5c9bc7 8087 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
d55e5bfc
RD
8088
8089 def Show(*args, **kwargs):
8090 """
8091 Show(self, bool show=True) -> bool
8092
8093 Shows or hides the window. You may need to call Raise for a top level
8094 window if you want to bring it to top, although this is not needed if
8095 Show is called immediately after the frame creation. Returns True if
8096 the window has been shown or hidden or False if nothing was done
8097 because it already was in the requested state.
8098 """
5b5c9bc7 8099 return _core_.Window_Show(*args, **kwargs)
d55e5bfc
RD
8100
8101 def Hide(*args, **kwargs):
8102 """
8103 Hide(self) -> bool
8104
8105 Equivalent to calling Show(False).
8106 """
5b5c9bc7 8107 return _core_.Window_Hide(*args, **kwargs)
d55e5bfc
RD
8108
8109 def Enable(*args, **kwargs):
8110 """
8111 Enable(self, bool enable=True) -> bool
8112
8113 Enable or disable the window for user input. Note that when a parent
8114 window is disabled, all of its children are disabled as well and they
8115 are reenabled again when the parent is. Returns true if the window
8116 has been enabled or disabled, false if nothing was done, i.e. if the
8117 window had already been in the specified state.
8118 """
5b5c9bc7 8119 return _core_.Window_Enable(*args, **kwargs)
d55e5bfc
RD
8120
8121 def Disable(*args, **kwargs):
8122 """
8123 Disable(self) -> bool
8124
8125 Disables the window, same as Enable(false).
8126 """
5b5c9bc7 8127 return _core_.Window_Disable(*args, **kwargs)
d55e5bfc
RD
8128
8129 def IsShown(*args, **kwargs):
8130 """
8131 IsShown(self) -> bool
8132
8133 Returns true if the window is shown, false if it has been hidden.
8134 """
5b5c9bc7 8135 return _core_.Window_IsShown(*args, **kwargs)
d55e5bfc
RD
8136
8137 def IsEnabled(*args, **kwargs):
8138 """
8139 IsEnabled(self) -> bool
8140
8141 Returns true if the window is enabled for input, false otherwise.
8142 """
5b5c9bc7 8143 return _core_.Window_IsEnabled(*args, **kwargs)
d55e5bfc
RD
8144
8145 def SetWindowStyleFlag(*args, **kwargs):
8146 """
8147 SetWindowStyleFlag(self, long style)
8148
15817c7e
RD
8149 Sets the style of the window. Please note that some styles cannot be
8150 changed after the window creation and that Refresh() might need to be
8151 called after changing the others for the change to take place
8152 immediately.
d55e5bfc 8153 """
5b5c9bc7 8154 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8155
8156 def GetWindowStyleFlag(*args, **kwargs):
8157 """
8158 GetWindowStyleFlag(self) -> long
8159
8160 Gets the window style that was passed to the constructor or Create
8161 method.
8162 """
5b5c9bc7 8163 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8164
8165 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8166 def HasFlag(*args, **kwargs):
8167 """
8168 HasFlag(self, int flag) -> bool
8169
8170 Test if the given style is set for this window.
8171 """
5b5c9bc7 8172 return _core_.Window_HasFlag(*args, **kwargs)
d55e5bfc
RD
8173
8174 def IsRetained(*args, **kwargs):
8175 """
8176 IsRetained(self) -> bool
8177
8178 Returns true if the window is retained, false otherwise. Retained
8179 windows are only available on X platforms.
8180 """
5b5c9bc7 8181 return _core_.Window_IsRetained(*args, **kwargs)
d55e5bfc
RD
8182
8183 def SetExtraStyle(*args, **kwargs):
8184 """
8185 SetExtraStyle(self, long exStyle)
8186
8187 Sets the extra style bits for the window. Extra styles are the less
8188 often used style bits which can't be set with the constructor or with
8189 SetWindowStyleFlag()
8190 """
5b5c9bc7 8191 return _core_.Window_SetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8192
8193 def GetExtraStyle(*args, **kwargs):
8194 """
8195 GetExtraStyle(self) -> long
8196
8197 Returns the extra style bits for the window.
8198 """
5b5c9bc7 8199 return _core_.Window_GetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8200
8201 def MakeModal(*args, **kwargs):
8202 """
8203 MakeModal(self, bool modal=True)
8204
8205 Disables all other windows in the application so that the user can
8206 only interact with this window. Passing False will reverse this
8207 effect.
8208 """
5b5c9bc7 8209 return _core_.Window_MakeModal(*args, **kwargs)
d55e5bfc
RD
8210
8211 def SetThemeEnabled(*args, **kwargs):
8212 """
8213 SetThemeEnabled(self, bool enableTheme)
8214
8215 This function tells a window if it should use the system's "theme"
8216 code to draw the windows' background instead if its own background
8217 drawing code. This will only have an effect on platforms that support
8218 the notion of themes in user defined windows. One such platform is
8219 GTK+ where windows can have (very colourful) backgrounds defined by a
8220 user's selected theme.
8221
8222 Dialogs, notebook pages and the status bar have this flag set to true
8223 by default so that the default look and feel is simulated best.
8224 """
5b5c9bc7 8225 return _core_.Window_SetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8226
8227 def GetThemeEnabled(*args, **kwargs):
8228 """
8229 GetThemeEnabled(self) -> bool
8230
8231 Return the themeEnabled flag.
8232 """
5b5c9bc7 8233 return _core_.Window_GetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8234
8235 def SetFocus(*args, **kwargs):
8236 """
8237 SetFocus(self)
8238
8239 Set's the focus to this window, allowing it to receive keyboard input.
8240 """
5b5c9bc7 8241 return _core_.Window_SetFocus(*args, **kwargs)
d55e5bfc
RD
8242
8243 def SetFocusFromKbd(*args, **kwargs):
8244 """
8245 SetFocusFromKbd(self)
8246
8247 Set focus to this window as the result of a keyboard action. Normally
8248 only called internally.
8249 """
5b5c9bc7 8250 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
d55e5bfc
RD
8251
8252 def FindFocus(*args, **kwargs):
8253 """
5b5c9bc7 8254 FindFocus() -> Window
d55e5bfc
RD
8255
8256 Returns the window or control that currently has the keyboard focus,
8257 or None.
8258 """
5b5c9bc7 8259 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc
RD
8260
8261 FindFocus = staticmethod(FindFocus)
8262 def AcceptsFocus(*args, **kwargs):
8263 """
8264 AcceptsFocus(self) -> bool
8265
8266 Can this window have focus?
8267 """
5b5c9bc7 8268 return _core_.Window_AcceptsFocus(*args, **kwargs)
d55e5bfc
RD
8269
8270 def AcceptsFocusFromKeyboard(*args, **kwargs):
8271 """
8272 AcceptsFocusFromKeyboard(self) -> bool
8273
8274 Can this window be given focus by keyboard navigation? if not, the
8275 only way to give it focus (provided it accepts it at all) is to click
8276 it.
8277 """
5b5c9bc7 8278 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
d55e5bfc
RD
8279
8280 def GetDefaultItem(*args, **kwargs):
8281 """
5b5c9bc7 8282 GetDefaultItem(self) -> Window
d55e5bfc
RD
8283
8284 Get the default child of this parent, i.e. the one which is activated
8285 by pressing <Enter> such as the OK button on a wx.Dialog.
8286 """
5b5c9bc7 8287 return _core_.Window_GetDefaultItem(*args, **kwargs)
d55e5bfc
RD
8288
8289 def SetDefaultItem(*args, **kwargs):
8290 """
5b5c9bc7 8291 SetDefaultItem(self, Window child) -> Window
d55e5bfc
RD
8292
8293 Set this child as default, return the old default.
8294 """
5b5c9bc7 8295 return _core_.Window_SetDefaultItem(*args, **kwargs)
d55e5bfc
RD
8296
8297 def SetTmpDefaultItem(*args, **kwargs):
8298 """
5b5c9bc7 8299 SetTmpDefaultItem(self, Window win)
d55e5bfc
RD
8300
8301 Set this child as temporary default
8302 """
5b5c9bc7 8303 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
d55e5bfc 8304
908b74cd
RD
8305 def Navigate(*args, **kwargs):
8306 """
8307 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8308
fd2dc343
RD
8309 Does keyboard navigation from this window to another, by sending a
8310 `wx.NavigationKeyEvent`.
908b74cd 8311 """
5b5c9bc7 8312 return _core_.Window_Navigate(*args, **kwargs)
908b74cd 8313
bf26d883
RD
8314 def MoveAfterInTabOrder(*args, **kwargs):
8315 """
5b5c9bc7 8316 MoveAfterInTabOrder(self, Window win)
bf26d883
RD
8317
8318 Moves this window in the tab navigation order after the specified
8319 sibling window. This means that when the user presses the TAB key on
8320 that other window, the focus switches to this window.
8321
8322 The default tab order is the same as creation order. This function
8323 and `MoveBeforeInTabOrder` allow to change it after creating all the
8324 windows.
8325
8326 """
5b5c9bc7 8327 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
bf26d883
RD
8328
8329 def MoveBeforeInTabOrder(*args, **kwargs):
8330 """
5b5c9bc7 8331 MoveBeforeInTabOrder(self, Window win)
bf26d883
RD
8332
8333 Same as `MoveAfterInTabOrder` except that it inserts this window just
8334 before win instead of putting it right after it.
8335 """
5b5c9bc7 8336 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
bf26d883 8337
d55e5bfc
RD
8338 def GetChildren(*args, **kwargs):
8339 """
8340 GetChildren(self) -> PyObject
8341
8342 Returns a list of the window's children. NOTE: Currently this is a
8343 copy of the child window list maintained by the window, so the return
8344 value of this function is only valid as long as the window's children
8345 do not change.
8346 """
5b5c9bc7 8347 return _core_.Window_GetChildren(*args, **kwargs)
d55e5bfc
RD
8348
8349 def GetParent(*args, **kwargs):
8350 """
5b5c9bc7 8351 GetParent(self) -> Window
d55e5bfc
RD
8352
8353 Returns the parent window of this window, or None if there isn't one.
8354 """
5b5c9bc7 8355 return _core_.Window_GetParent(*args, **kwargs)
d55e5bfc
RD
8356
8357 def GetGrandParent(*args, **kwargs):
8358 """
5b5c9bc7 8359 GetGrandParent(self) -> Window
d55e5bfc 8360
15817c7e
RD
8361 Returns the parent of the parent of this window, or None if there
8362 isn't one.
d55e5bfc 8363 """
5b5c9bc7 8364 return _core_.Window_GetGrandParent(*args, **kwargs)
d55e5bfc
RD
8365
8366 def IsTopLevel(*args, **kwargs):
8367 """
8368 IsTopLevel(self) -> bool
8369
8370 Returns true if the given window is a top-level one. Currently all
8371 frames and dialogs are always considered to be top-level windows (even
8372 if they have a parent window).
8373 """
5b5c9bc7 8374 return _core_.Window_IsTopLevel(*args, **kwargs)
d55e5bfc
RD
8375
8376 def Reparent(*args, **kwargs):
8377 """
5b5c9bc7 8378 Reparent(self, Window newParent) -> bool
d55e5bfc
RD
8379
8380 Reparents the window, i.e the window will be removed from its current
8381 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8382 re-inserted into another. Available on Windows and GTK. Returns True
8383 if the parent was changed, False otherwise (error or newParent ==
8384 oldParent)
8385 """
5b5c9bc7 8386 return _core_.Window_Reparent(*args, **kwargs)
d55e5bfc
RD
8387
8388 def AddChild(*args, **kwargs):
8389 """
5b5c9bc7 8390 AddChild(self, Window child)
d55e5bfc
RD
8391
8392 Adds a child window. This is called automatically by window creation
8393 functions so should not be required by the application programmer.
8394 """
5b5c9bc7 8395 return _core_.Window_AddChild(*args, **kwargs)
d55e5bfc
RD
8396
8397 def RemoveChild(*args, **kwargs):
8398 """
5b5c9bc7 8399 RemoveChild(self, Window child)
d55e5bfc
RD
8400
8401 Removes a child window. This is called automatically by window
8402 deletion functions so should not be required by the application
8403 programmer.
8404 """
5b5c9bc7 8405 return _core_.Window_RemoveChild(*args, **kwargs)
d55e5bfc 8406
704eda0c
RD
8407 def SetDoubleBuffered(*args, **kwargs):
8408 """
8409 SetDoubleBuffered(self, bool on)
8410
8411 Currently wxGTK2 only.
8412 """
8413 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8414
d55e5bfc
RD
8415 def FindWindowById(*args, **kwargs):
8416 """
5b5c9bc7 8417 FindWindowById(self, long winid) -> Window
d55e5bfc
RD
8418
8419 Find a chld of this window by window ID
8420 """
5b5c9bc7 8421 return _core_.Window_FindWindowById(*args, **kwargs)
d55e5bfc
RD
8422
8423 def FindWindowByName(*args, **kwargs):
8424 """
5b5c9bc7 8425 FindWindowByName(self, String name) -> Window
d55e5bfc
RD
8426
8427 Find a child of this window by name
8428 """
5b5c9bc7 8429 return _core_.Window_FindWindowByName(*args, **kwargs)
d55e5bfc
RD
8430
8431 def GetEventHandler(*args, **kwargs):
8432 """
5b5c9bc7 8433 GetEventHandler(self) -> EvtHandler
d55e5bfc
RD
8434
8435 Returns the event handler for this window. By default, the window is
8436 its own event handler.
8437 """
5b5c9bc7 8438 return _core_.Window_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
8439
8440 def SetEventHandler(*args, **kwargs):
8441 """
5b5c9bc7 8442 SetEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8443
8444 Sets the event handler for this window. An event handler is an object
8445 that is capable of processing the events sent to a window. By default,
8446 the window is its own event handler, but an application may wish to
8447 substitute another, for example to allow central implementation of
8448 event-handling for a variety of different window classes.
8449
15817c7e 8450 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
8451 up a chain of event handlers, where an event not handled by one event
8452 handler is handed to the next one in the chain.
8453 """
5b5c9bc7 8454 return _core_.Window_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
8455
8456 def PushEventHandler(*args, **kwargs):
8457 """
5b5c9bc7 8458 PushEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8459
8460 Pushes this event handler onto the event handler stack for the window.
8461 An event handler is an object that is capable of processing the events
8462 sent to a window. By default, the window is its own event handler, but
8463 an application may wish to substitute another, for example to allow
8464 central implementation of event-handling for a variety of different
8465 window classes.
8466
8467 wx.Window.PushEventHandler allows an application to set up a chain of
8468 event handlers, where an event not handled by one event handler is
15817c7e 8469 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
8470 remove the event handler.
8471 """
5b5c9bc7 8472 return _core_.Window_PushEventHandler(*args, **kwargs)
d55e5bfc
RD
8473
8474 def PopEventHandler(*args, **kwargs):
8475 """
5b5c9bc7 8476 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
d55e5bfc
RD
8477
8478 Removes and returns the top-most event handler on the event handler
8479 stack. If deleteHandler is True then the wx.EvtHandler object will be
8480 destroyed after it is popped.
8481 """
5b5c9bc7 8482 return _core_.Window_PopEventHandler(*args, **kwargs)
d55e5bfc
RD
8483
8484 def RemoveEventHandler(*args, **kwargs):
8485 """
5b5c9bc7 8486 RemoveEventHandler(self, EvtHandler handler) -> bool
d55e5bfc 8487
15817c7e
RD
8488 Find the given handler in the event handler chain and remove (but not
8489 delete) it from the event handler chain, return True if it was found
8490 and False otherwise (this also results in an assert failure so this
8491 function should only be called when the handler is supposed to be
8492 there.)
d55e5bfc 8493 """
5b5c9bc7 8494 return _core_.Window_RemoveEventHandler(*args, **kwargs)
d55e5bfc
RD
8495
8496 def SetValidator(*args, **kwargs):
8497 """
5b5c9bc7 8498 SetValidator(self, Validator validator)
d55e5bfc
RD
8499
8500 Deletes the current validator (if any) and sets the window validator,
8501 having called wx.Validator.Clone to create a new validator of this
8502 type.
8503 """
5b5c9bc7 8504 return _core_.Window_SetValidator(*args, **kwargs)
d55e5bfc
RD
8505
8506 def GetValidator(*args, **kwargs):
8507 """
5b5c9bc7 8508 GetValidator(self) -> Validator
d55e5bfc
RD
8509
8510 Returns a pointer to the current validator for the window, or None if
8511 there is none.
8512 """
5b5c9bc7 8513 return _core_.Window_GetValidator(*args, **kwargs)
d55e5bfc
RD
8514
8515 def Validate(*args, **kwargs):
8516 """
8517 Validate(self) -> bool
8518
8519 Validates the current values of the child controls using their
15817c7e
RD
8520 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8521 style flag set, the method will also call Validate() of all child
8522 windows. Returns false if any of the validations failed.
d55e5bfc 8523 """
5b5c9bc7 8524 return _core_.Window_Validate(*args, **kwargs)
d55e5bfc
RD
8525
8526 def TransferDataToWindow(*args, **kwargs):
8527 """
8528 TransferDataToWindow(self) -> bool
8529
15817c7e
RD
8530 Transfers values to child controls from data areas specified by their
8531 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8532 style flag set, the method will also call TransferDataToWindow() of
8533 all child windows.
d55e5bfc 8534 """
5b5c9bc7 8535 return _core_.Window_TransferDataToWindow(*args, **kwargs)
d55e5bfc
RD
8536
8537 def TransferDataFromWindow(*args, **kwargs):
8538 """
8539 TransferDataFromWindow(self) -> bool
8540
15817c7e
RD
8541 Transfers values from child controls to data areas specified by their
8542 validators. Returns false if a transfer failed. If the window has
8543 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8544 also call TransferDataFromWindow() of all child windows.
d55e5bfc 8545 """
5b5c9bc7 8546 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
d55e5bfc
RD
8547
8548 def InitDialog(*args, **kwargs):
8549 """
8550 InitDialog(self)
8551
15817c7e
RD
8552 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8553 to the dialog via validators.
d55e5bfc 8554 """
5b5c9bc7 8555 return _core_.Window_InitDialog(*args, **kwargs)
d55e5bfc
RD
8556
8557 def SetAcceleratorTable(*args, **kwargs):
8558 """
5b5c9bc7 8559 SetAcceleratorTable(self, AcceleratorTable accel)
d55e5bfc
RD
8560
8561 Sets the accelerator table for this window.
8562 """
5b5c9bc7 8563 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
8564
8565 def GetAcceleratorTable(*args, **kwargs):
8566 """
5b5c9bc7 8567 GetAcceleratorTable(self) -> AcceleratorTable
d55e5bfc
RD
8568
8569 Gets the accelerator table for this window.
8570 """
5b5c9bc7 8571 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
8572
8573 def RegisterHotKey(*args, **kwargs):
8574 """
8575 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8576
8577 Registers a system wide hotkey. Every time the user presses the hotkey
8578 registered here, this window will receive a hotkey event. It will
8579 receive the event even if the application is in the background and
8580 does not have the input focus because the user is working with some
8581 other application. To bind an event handler function to this hotkey
8582 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8583 hotkey was registered successfully.
8584 """
5b5c9bc7 8585 return _core_.Window_RegisterHotKey(*args, **kwargs)
d55e5bfc
RD
8586
8587 def UnregisterHotKey(*args, **kwargs):
8588 """
8589 UnregisterHotKey(self, int hotkeyId) -> bool
8590
8591 Unregisters a system wide hotkey.
8592 """
5b5c9bc7 8593 return _core_.Window_UnregisterHotKey(*args, **kwargs)
d55e5bfc
RD
8594
8595 def ConvertDialogPointToPixels(*args, **kwargs):
8596 """
5b5c9bc7 8597 ConvertDialogPointToPixels(self, Point pt) -> Point
d55e5bfc
RD
8598
8599 Converts a point or size from dialog units to pixels. Dialog units
8600 are used for maintaining a dialog's proportions even if the font
8601 changes. For the x dimension, the dialog units are multiplied by the
8602 average character width and then divided by 4. For the y dimension,
8603 the dialog units are multiplied by the average character height and
8604 then divided by 8.
8605 """
5b5c9bc7 8606 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
d55e5bfc
RD
8607
8608 def ConvertDialogSizeToPixels(*args, **kwargs):
8609 """
5b5c9bc7 8610 ConvertDialogSizeToPixels(self, Size sz) -> Size
d55e5bfc
RD
8611
8612 Converts a point or size from dialog units to pixels. Dialog units
8613 are used for maintaining a dialog's proportions even if the font
8614 changes. For the x dimension, the dialog units are multiplied by the
8615 average character width and then divided by 4. For the y dimension,
8616 the dialog units are multiplied by the average character height and
8617 then divided by 8.
8618 """
5b5c9bc7 8619 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
d55e5bfc
RD
8620
8621 def DLG_PNT(*args, **kwargs):
8622 """
5b5c9bc7 8623 DLG_PNT(self, Point pt) -> Point
d55e5bfc
RD
8624
8625 Converts a point or size from dialog units to pixels. Dialog units
8626 are used for maintaining a dialog's proportions even if the font
8627 changes. For the x dimension, the dialog units are multiplied by the
8628 average character width and then divided by 4. For the y dimension,
8629 the dialog units are multiplied by the average character height and
8630 then divided by 8.
8631 """
5b5c9bc7 8632 return _core_.Window_DLG_PNT(*args, **kwargs)
d55e5bfc
RD
8633
8634 def DLG_SZE(*args, **kwargs):
8635 """
5b5c9bc7 8636 DLG_SZE(self, Size sz) -> Size
d55e5bfc
RD
8637
8638 Converts a point or size from dialog units to pixels. Dialog units
8639 are used for maintaining a dialog's proportions even if the font
8640 changes. For the x dimension, the dialog units are multiplied by the
8641 average character width and then divided by 4. For the y dimension,
8642 the dialog units are multiplied by the average character height and
8643 then divided by 8.
8644 """
5b5c9bc7 8645 return _core_.Window_DLG_SZE(*args, **kwargs)
d55e5bfc
RD
8646
8647 def ConvertPixelPointToDialog(*args, **kwargs):
5b5c9bc7
RD
8648 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8649 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
d55e5bfc
RD
8650
8651 def ConvertPixelSizeToDialog(*args, **kwargs):
5b5c9bc7
RD
8652 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8653 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
d55e5bfc
RD
8654
8655 def WarpPointer(*args, **kwargs):
8656 """
8657 WarpPointer(self, int x, int y)
8658
8659 Moves the pointer to the given position on the window.
8660
8661 NOTE: This function is not supported under Mac because Apple Human
8662 Interface Guidelines forbid moving the mouse cursor programmatically.
8663 """
5b5c9bc7 8664 return _core_.Window_WarpPointer(*args, **kwargs)
d55e5bfc
RD
8665
8666 def CaptureMouse(*args, **kwargs):
8667 """
8668 CaptureMouse(self)
8669
8670 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8671 release the capture.
8672
8673 Note that wxWindows maintains the stack of windows having captured the
8674 mouse and when the mouse is released the capture returns to the window
8675 which had had captured it previously and it is only really released if
8676 there were no previous window. In particular, this means that you must
8677 release the mouse as many times as you capture it.
8678 """
5b5c9bc7 8679 return _core_.Window_CaptureMouse(*args, **kwargs)
d55e5bfc
RD
8680
8681 def ReleaseMouse(*args, **kwargs):
8682 """
8683 ReleaseMouse(self)
8684
8685 Releases mouse input captured with wx.Window.CaptureMouse.
8686 """
5b5c9bc7 8687 return _core_.Window_ReleaseMouse(*args, **kwargs)
d55e5bfc
RD
8688
8689 def GetCapture(*args, **kwargs):
8690 """
5b5c9bc7 8691 GetCapture() -> Window
d55e5bfc
RD
8692
8693 Returns the window which currently captures the mouse or None
8694 """
5b5c9bc7 8695 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc
RD
8696
8697 GetCapture = staticmethod(GetCapture)
8698 def HasCapture(*args, **kwargs):
8699 """
8700 HasCapture(self) -> bool
8701
8702 Returns true if this window has the current mouse capture.
8703 """
5b5c9bc7 8704 return _core_.Window_HasCapture(*args, **kwargs)
d55e5bfc
RD
8705
8706 def Refresh(*args, **kwargs):
8707 """
5b5c9bc7 8708 Refresh(self, bool eraseBackground=True, Rect rect=None)
d55e5bfc
RD
8709
8710 Mark the specified rectangle (or the whole window) as "dirty" so it
8711 will be repainted. Causes an EVT_PAINT event to be generated and sent
8712 to the window.
8713 """
5b5c9bc7 8714 return _core_.Window_Refresh(*args, **kwargs)
d55e5bfc
RD
8715
8716 def RefreshRect(*args, **kwargs):
8717 """
5b5c9bc7 8718 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
8719
8720 Redraws the contents of the given rectangle: the area inside it will
8721 be repainted. This is the same as Refresh but has a nicer syntax.
8722 """
5b5c9bc7 8723 return _core_.Window_RefreshRect(*args, **kwargs)
d55e5bfc
RD
8724
8725 def Update(*args, **kwargs):
8726 """
8727 Update(self)
8728
8729 Calling this method immediately repaints the invalidated area of the
8730 window instead of waiting for the EVT_PAINT event to happen, (normally
8731 this would usually only happen when the flow of control returns to the
8732 event loop.) Notice that this function doesn't refresh the window and
8733 does nothing if the window has been already repainted. Use Refresh
8734 first if you want to immediately redraw the window (or some portion of
8735 it) unconditionally.
8736 """
5b5c9bc7 8737 return _core_.Window_Update(*args, **kwargs)
d55e5bfc
RD
8738
8739 def ClearBackground(*args, **kwargs):
8740 """
8741 ClearBackground(self)
8742
8743 Clears the window by filling it with the current background
8744 colour. Does not cause an erase background event to be generated.
8745 """
5b5c9bc7 8746 return _core_.Window_ClearBackground(*args, **kwargs)
d55e5bfc
RD
8747
8748 def Freeze(*args, **kwargs):
8749 """
8750 Freeze(self)
8751
15817c7e
RD
8752 Freezes the window or, in other words, prevents any updates from
8753 taking place on screen, the window is not redrawn at all. Thaw must be
8754 called to reenable window redrawing. Calls to Freeze/Thaw may be
8755 nested, with the actual Thaw being delayed until all the nesting has
8756 been undone.
d55e5bfc
RD
8757
8758 This method is useful for visual appearance optimization (for example,
8759 it is a good idea to use it before inserting large amount of text into
8760 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8761 for all controls so it is mostly just a hint to wxWindows and not a
8762 mandatory directive.
8763 """
5b5c9bc7 8764 return _core_.Window_Freeze(*args, **kwargs)
d55e5bfc
RD
8765
8766 def Thaw(*args, **kwargs):
8767 """
8768 Thaw(self)
8769
8770 Reenables window updating after a previous call to Freeze. Calls to
15817c7e
RD
8771 Freeze/Thaw may be nested, so Thaw must be called the same number of
8772 times that Freeze was before the window will be updated.
d55e5bfc 8773 """
5b5c9bc7 8774 return _core_.Window_Thaw(*args, **kwargs)
d55e5bfc
RD
8775
8776 def PrepareDC(*args, **kwargs):
8777 """
5b5c9bc7 8778 PrepareDC(self, DC dc)
d55e5bfc
RD
8779
8780 Call this function to prepare the device context for drawing a
8781 scrolled image. It sets the device origin according to the current
8782 scroll position.
8783 """
5b5c9bc7 8784 return _core_.Window_PrepareDC(*args, **kwargs)
d55e5bfc
RD
8785
8786 def GetUpdateRegion(*args, **kwargs):
8787 """
5b5c9bc7 8788 GetUpdateRegion(self) -> Region
d55e5bfc
RD
8789
8790 Returns the region specifying which parts of the window have been
8791 damaged. Should only be called within an EVT_PAINT handler.
8792 """
5b5c9bc7 8793 return _core_.Window_GetUpdateRegion(*args, **kwargs)
d55e5bfc
RD
8794
8795 def GetUpdateClientRect(*args, **kwargs):
8796 """
5b5c9bc7 8797 GetUpdateClientRect(self) -> Rect
d55e5bfc
RD
8798
8799 Get the update rectangle region bounding box in client coords.
8800 """
5b5c9bc7 8801 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
d55e5bfc
RD
8802
8803 def IsExposed(*args, **kwargs):
8804 """
8805 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8806
8807 Returns true if the given point or rectangle area has been exposed
8808 since the last repaint. Call this in an paint event handler to
8809 optimize redrawing by only redrawing those areas, which have been
8810 exposed.
8811 """
5b5c9bc7 8812 return _core_.Window_IsExposed(*args, **kwargs)
d55e5bfc
RD
8813
8814 def IsExposedPoint(*args, **kwargs):
8815 """
5b5c9bc7 8816 IsExposedPoint(self, Point pt) -> bool
d55e5bfc
RD
8817
8818 Returns true if the given point or rectangle area has been exposed
8819 since the last repaint. Call this in an paint event handler to
8820 optimize redrawing by only redrawing those areas, which have been
8821 exposed.
8822 """
5b5c9bc7 8823 return _core_.Window_IsExposedPoint(*args, **kwargs)
d55e5bfc
RD
8824
8825 def IsExposedRect(*args, **kwargs):
8826 """
5b5c9bc7 8827 IsExposedRect(self, Rect rect) -> bool
d55e5bfc
RD
8828
8829 Returns true if the given point or rectangle area has been exposed
8830 since the last repaint. Call this in an paint event handler to
8831 optimize redrawing by only redrawing those areas, which have been
8832 exposed.
8833 """
5b5c9bc7 8834 return _core_.Window_IsExposedRect(*args, **kwargs)
d55e5bfc
RD
8835
8836 def GetDefaultAttributes(*args, **kwargs):
8837 """
5b5c9bc7 8838 GetDefaultAttributes(self) -> VisualAttributes
d55e5bfc 8839
15817c7e
RD
8840 Get the default attributes for an instance of this class. This is
8841 useful if you want to use the same font or colour in your own control
8842 as in a standard control -- which is a much better idea than hard
8843 coding specific colours or fonts which might look completely out of
a5ee0656 8844 place on the user's system, especially if it uses themes.
d55e5bfc 8845 """
5b5c9bc7 8846 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
8847
8848 def GetClassDefaultAttributes(*args, **kwargs):
8849 """
5b5c9bc7 8850 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 8851
15817c7e
RD
8852 Get the default attributes for this class. This is useful if you want
8853 to use the same font or colour in your own control as in a standard
8854 control -- which is a much better idea than hard coding specific
a5ee0656
RD
8855 colours or fonts which might look completely out of place on the
8856 user's system, especially if it uses themes.
d55e5bfc
RD
8857
8858 The variant parameter is only relevant under Mac currently and is
15817c7e 8859 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
8860 the returned font. See `wx.Window.SetWindowVariant` for more about
8861 this.
d55e5bfc 8862 """
5b5c9bc7 8863 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
8864
8865 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8866 def SetBackgroundColour(*args, **kwargs):
8867 """
5b5c9bc7 8868 SetBackgroundColour(self, Colour colour) -> bool
d55e5bfc
RD
8869
8870 Sets the background colour of the window. Returns True if the colour
8871 was changed. The background colour is usually painted by the default
8872 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
8873 automatically under GTK. Using `wx.NullColour` will reset the window
8874 to the default background colour.
d55e5bfc 8875
a5ee0656 8876 Note that setting the background colour may not cause an immediate
f8167d6e 8877 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
8878 calling this function.
8879
f8167d6e
RD
8880 Using this function will disable attempts to use themes for this
8881 window, if the system supports them. Use with care since usually the
8882 themes represent the appearance chosen by the user to be used for all
8883 applications on the system.
d55e5bfc 8884 """
5b5c9bc7 8885 return _core_.Window_SetBackgroundColour(*args, **kwargs)
d55e5bfc 8886
412d302d 8887 def SetOwnBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
8888 """SetOwnBackgroundColour(self, Colour colour)"""
8889 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
8890
8891 def SetForegroundColour(*args, **kwargs):
8892 """
5b5c9bc7 8893 SetForegroundColour(self, Colour colour) -> bool
d55e5bfc
RD
8894
8895 Sets the foreground colour of the window. Returns True is the colour
8896 was changed. The interpretation of foreground colour is dependent on
8897 the window class; it may be the text colour or other colour, or it may
8898 not be used at all.
8899 """
5b5c9bc7 8900 return _core_.Window_SetForegroundColour(*args, **kwargs)
d55e5bfc 8901
fa47d7a7 8902 def SetOwnForegroundColour(*args, **kwargs):
5b5c9bc7
RD
8903 """SetOwnForegroundColour(self, Colour colour)"""
8904 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
8905
8906 def GetBackgroundColour(*args, **kwargs):
8907 """
5b5c9bc7 8908 GetBackgroundColour(self) -> Colour
d55e5bfc
RD
8909
8910 Returns the background colour of the window.
8911 """
5b5c9bc7 8912 return _core_.Window_GetBackgroundColour(*args, **kwargs)
d55e5bfc
RD
8913
8914 def GetForegroundColour(*args, **kwargs):
8915 """
5b5c9bc7 8916 GetForegroundColour(self) -> Colour
d55e5bfc
RD
8917
8918 Returns the foreground colour of the window. The interpretation of
8919 foreground colour is dependent on the window class; it may be the text
8920 colour or other colour, or it may not be used at all.
8921 """
5b5c9bc7 8922 return _core_.Window_GetForegroundColour(*args, **kwargs)
d55e5bfc 8923
dcb8fc74
RD
8924 def InheritsBackgroundColour(*args, **kwargs):
8925 """InheritsBackgroundColour(self) -> bool"""
5b5c9bc7 8926 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
dcb8fc74
RD
8927
8928 def UseBgCol(*args, **kwargs):
8929 """UseBgCol(self) -> bool"""
5b5c9bc7 8930 return _core_.Window_UseBgCol(*args, **kwargs)
dcb8fc74 8931
0f63ec68
RD
8932 def SetBackgroundStyle(*args, **kwargs):
8933 """
8934 SetBackgroundStyle(self, int style) -> bool
8935
8936 Returns the background style of the window. The background style
8937 indicates how the background of the window is drawn.
8938
8939 ====================== ========================================
8940 wx.BG_STYLE_SYSTEM The background colour or pattern should
8941 be determined by the system
8942 wx.BG_STYLE_COLOUR The background should be a solid colour
8943 wx.BG_STYLE_CUSTOM The background will be implemented by the
8944 application.
8945 ====================== ========================================
8946
8947 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8948 a custom background, such as a tiled bitmap. Currently the style has
8949 no effect on other platforms.
8950
8951 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8952 """
5b5c9bc7 8953 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
0f63ec68
RD
8954
8955 def GetBackgroundStyle(*args, **kwargs):
8956 """
8957 GetBackgroundStyle(self) -> int
8958
8959 Returns the background style of the window.
8960
8961 :see: `SetBackgroundStyle`
8962 """
5b5c9bc7 8963 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
0f63ec68 8964
51b83b37
RD
8965 def HasTransparentBackground(*args, **kwargs):
8966 """
8967 HasTransparentBackground(self) -> bool
8968
8969 Returns True if this window's background is transparent (as, for
8970 example, for `wx.StaticText`) and should show the parent window's
8971 background.
8972
8973 This method is mostly used internally by the library itself and you
8974 normally shouldn't have to call it. You may, however, have to override
8975 it in your custom control classes to ensure that background is painted
8976 correctly.
8977 """
5b5c9bc7 8978 return _core_.Window_HasTransparentBackground(*args, **kwargs)
51b83b37 8979
d55e5bfc
RD
8980 def SetCursor(*args, **kwargs):
8981 """
5b5c9bc7 8982 SetCursor(self, Cursor cursor) -> bool
d55e5bfc
RD
8983
8984 Sets the window's cursor. Notice that the window cursor also sets it
8985 for the children of the window implicitly.
8986
8987 The cursor may be wx.NullCursor in which case the window cursor will
8988 be reset back to default.
8989 """
5b5c9bc7 8990 return _core_.Window_SetCursor(*args, **kwargs)
d55e5bfc
RD
8991
8992 def GetCursor(*args, **kwargs):
8993 """
5b5c9bc7 8994 GetCursor(self) -> Cursor
d55e5bfc
RD
8995
8996 Return the cursor associated with this window.
8997 """
5b5c9bc7 8998 return _core_.Window_GetCursor(*args, **kwargs)
d55e5bfc
RD
8999
9000 def SetFont(*args, **kwargs):
9001 """
5b5c9bc7 9002 SetFont(self, Font font) -> bool
d55e5bfc
RD
9003
9004 Sets the font for this window.
9005 """
5b5c9bc7 9006 return _core_.Window_SetFont(*args, **kwargs)
d55e5bfc 9007
fa47d7a7 9008 def SetOwnFont(*args, **kwargs):
5b5c9bc7
RD
9009 """SetOwnFont(self, Font font)"""
9010 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9011
9012 def GetFont(*args, **kwargs):
9013 """
5b5c9bc7 9014 GetFont(self) -> Font
d55e5bfc
RD
9015
9016 Returns the default font used for this window.
9017 """
5b5c9bc7 9018 return _core_.Window_GetFont(*args, **kwargs)
d55e5bfc
RD
9019
9020 def SetCaret(*args, **kwargs):
9021 """
5b5c9bc7 9022 SetCaret(self, Caret caret)
d55e5bfc
RD
9023
9024 Sets the caret associated with the window.
9025 """
5b5c9bc7 9026 return _core_.Window_SetCaret(*args, **kwargs)
d55e5bfc
RD
9027
9028 def GetCaret(*args, **kwargs):
9029 """
5b5c9bc7 9030 GetCaret(self) -> Caret
d55e5bfc
RD
9031
9032 Returns the caret associated with the window.
9033 """
5b5c9bc7 9034 return _core_.Window_GetCaret(*args, **kwargs)
d55e5bfc
RD
9035
9036 def GetCharHeight(*args, **kwargs):
9037 """
9038 GetCharHeight(self) -> int
9039
9040 Get the (average) character size for the current font.
9041 """
5b5c9bc7 9042 return _core_.Window_GetCharHeight(*args, **kwargs)
d55e5bfc
RD
9043
9044 def GetCharWidth(*args, **kwargs):
9045 """
9046 GetCharWidth(self) -> int
9047
9048 Get the (average) character size for the current font.
9049 """
5b5c9bc7 9050 return _core_.Window_GetCharWidth(*args, **kwargs)
d55e5bfc
RD
9051
9052 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9053 """
9054 GetTextExtent(String string) -> (width, height)
9055
9056 Get the width and height of the text using the current font.
9057 """
5b5c9bc7 9058 return _core_.Window_GetTextExtent(*args, **kwargs)
d55e5bfc
RD
9059
9060 def GetFullTextExtent(*args, **kwargs):
9061 """
9062 GetFullTextExtent(String string, Font font=None) ->
9063 (width, height, descent, externalLeading)
9064
9065 Get the width, height, decent and leading of the text using the
9066 current or specified font.
9067 """
5b5c9bc7 9068 return _core_.Window_GetFullTextExtent(*args, **kwargs)
d55e5bfc
RD
9069
9070 def ClientToScreenXY(*args, **kwargs):
9071 """
9072 ClientToScreenXY(int x, int y) -> (x,y)
9073
9074 Converts to screen coordinates from coordinates relative to this window.
9075 """
5b5c9bc7 9076 return _core_.Window_ClientToScreenXY(*args, **kwargs)
d55e5bfc
RD
9077
9078 def ScreenToClientXY(*args, **kwargs):
9079 """
9080 ScreenToClientXY(int x, int y) -> (x,y)
9081
9082 Converts from screen to client window coordinates.
9083 """
5b5c9bc7 9084 return _core_.Window_ScreenToClientXY(*args, **kwargs)
d55e5bfc
RD
9085
9086 def ClientToScreen(*args, **kwargs):
9087 """
5b5c9bc7 9088 ClientToScreen(self, Point pt) -> Point
d55e5bfc
RD
9089
9090 Converts to screen coordinates from coordinates relative to this window.
9091 """
5b5c9bc7 9092 return _core_.Window_ClientToScreen(*args, **kwargs)
d55e5bfc
RD
9093
9094 def ScreenToClient(*args, **kwargs):
9095 """
5b5c9bc7 9096 ScreenToClient(self, Point pt) -> Point
d55e5bfc
RD
9097
9098 Converts from screen to client window coordinates.
9099 """
5b5c9bc7 9100 return _core_.Window_ScreenToClient(*args, **kwargs)
d55e5bfc
RD
9101
9102 def HitTestXY(*args, **kwargs):
9103 """
9104 HitTestXY(self, int x, int y) -> int
9105
9106 Test where the given (in client coords) point lies
9107 """
5b5c9bc7 9108 return _core_.Window_HitTestXY(*args, **kwargs)
d55e5bfc
RD
9109
9110 def HitTest(*args, **kwargs):
9111 """
5b5c9bc7 9112 HitTest(self, Point pt) -> int
d55e5bfc
RD
9113
9114 Test where the given (in client coords) point lies
9115 """
5b5c9bc7 9116 return _core_.Window_HitTest(*args, **kwargs)
d55e5bfc
RD
9117
9118 def GetBorder(*args):
9119 """
9120 GetBorder(self, long flags) -> int
9121 GetBorder(self) -> int
9122
9123 Get border for the flags of this window
9124 """
5b5c9bc7 9125 return _core_.Window_GetBorder(*args)
d55e5bfc
RD
9126
9127 def UpdateWindowUI(*args, **kwargs):
9128 """
5b5c9bc7 9129 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
d55e5bfc
RD
9130
9131 This function sends EVT_UPDATE_UI events to the window. The particular
9132 implementation depends on the window; for example a wx.ToolBar will
9133 send an update UI event for each toolbar button, and a wx.Frame will
9134 send an update UI event for each menubar menu item. You can call this
9135 function from your application to ensure that your UI is up-to-date at
9136 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9137 concerned). This may be necessary if you have called
5ba5649b 9138 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9139 limit the overhead that wxWindows incurs by sending update UI events
9140 in idle time.
d55e5bfc 9141 """
5b5c9bc7 9142 return _core_.Window_UpdateWindowUI(*args, **kwargs)
d55e5bfc
RD
9143
9144 def PopupMenuXY(*args, **kwargs):
9145 """
5b5c9bc7 9146 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9147
b0503257
RD
9148 Pops up the given menu at the specified coordinates, relative to this window,
9149 and returns control when the user has dismissed the menu. If a menu item is
9150 selected, the corresponding menu event is generated and will be processed as
9151 usual. If the default position is given then the current position of the
9152 mouse cursor will be used.
d55e5bfc 9153 """
5b5c9bc7 9154 return _core_.Window_PopupMenuXY(*args, **kwargs)
d55e5bfc
RD
9155
9156 def PopupMenu(*args, **kwargs):
9157 """
5b5c9bc7 9158 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9159
b0503257
RD
9160 Pops up the given menu at the specified coordinates, relative to this window,
9161 and returns control when the user has dismissed the menu. If a menu item is
9162 selected, the corresponding menu event is generated and will be processed as
9163 usual. If the default position is given then the current position of the
9164 mouse cursor will be used.
d55e5bfc 9165 """
5b5c9bc7 9166 return _core_.Window_PopupMenu(*args, **kwargs)
d55e5bfc
RD
9167
9168 def GetHandle(*args, **kwargs):
9169 """
9170 GetHandle(self) -> long
9171
9172 Returns the platform-specific handle (as a long integer) of the
9173 physical window. Currently on wxMac it returns the handle of the
9174 toplevel parent of the window.
9175 """
5b5c9bc7 9176 return _core_.Window_GetHandle(*args, **kwargs)
d55e5bfc 9177
629e65c2
RD
9178 def AssociateHandle(*args, **kwargs):
9179 """
9180 AssociateHandle(self, long handle)
9181
9182 Associate the window with a new native handle
9183 """
5b5c9bc7 9184 return _core_.Window_AssociateHandle(*args, **kwargs)
629e65c2
RD
9185
9186 def DissociateHandle(*args, **kwargs):
9187 """
9188 DissociateHandle(self)
9189
9190 Dissociate the current native handle from the window
9191 """
5b5c9bc7 9192 return _core_.Window_DissociateHandle(*args, **kwargs)
629e65c2 9193
d55e5bfc
RD
9194 def HasScrollbar(*args, **kwargs):
9195 """
9196 HasScrollbar(self, int orient) -> bool
9197
9198 Does the window have the scrollbar for this orientation?
9199 """
5b5c9bc7 9200 return _core_.Window_HasScrollbar(*args, **kwargs)
d55e5bfc
RD
9201
9202 def SetScrollbar(*args, **kwargs):
9203 """
15817c7e 9204 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
9205 bool refresh=True)
9206
9207 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc 9208 """
5b5c9bc7 9209 return _core_.Window_SetScrollbar(*args, **kwargs)
d55e5bfc
RD
9210
9211 def SetScrollPos(*args, **kwargs):
9212 """
9213 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9214
9215 Sets the position of one of the built-in scrollbars.
9216 """
5b5c9bc7 9217 return _core_.Window_SetScrollPos(*args, **kwargs)
d55e5bfc
RD
9218
9219 def GetScrollPos(*args, **kwargs):
9220 """
9221 GetScrollPos(self, int orientation) -> int
9222
9223 Returns the built-in scrollbar position.
9224 """
5b5c9bc7 9225 return _core_.Window_GetScrollPos(*args, **kwargs)
d55e5bfc
RD
9226
9227 def GetScrollThumb(*args, **kwargs):
9228 """
9229 GetScrollThumb(self, int orientation) -> int
9230
9231 Returns the built-in scrollbar thumb size.
9232 """
5b5c9bc7 9233 return _core_.Window_GetScrollThumb(*args, **kwargs)
d55e5bfc
RD
9234
9235 def GetScrollRange(*args, **kwargs):
9236 """
9237 GetScrollRange(self, int orientation) -> int
9238
9239 Returns the built-in scrollbar range.
9240 """
5b5c9bc7 9241 return _core_.Window_GetScrollRange(*args, **kwargs)
d55e5bfc
RD
9242
9243 def ScrollWindow(*args, **kwargs):
9244 """
5b5c9bc7 9245 ScrollWindow(self, int dx, int dy, Rect rect=None)
d55e5bfc
RD
9246
9247 Physically scrolls the pixels in the window and move child windows
9248 accordingly. Use this function to optimise your scrolling
9249 implementations, to minimise the area that must be redrawn. Note that
9250 it is rarely required to call this function from a user program.
d55e5bfc 9251 """
5b5c9bc7 9252 return _core_.Window_ScrollWindow(*args, **kwargs)
d55e5bfc
RD
9253
9254 def ScrollLines(*args, **kwargs):
9255 """
9256 ScrollLines(self, int lines) -> bool
9257
9258 If the platform and window class supports it, scrolls the window by
9259 the given number of lines down, if lines is positive, or up if lines
9260 is negative. Returns True if the window was scrolled, False if it was
9261 already on top/bottom and nothing was done.
9262 """
5b5c9bc7 9263 return _core_.Window_ScrollLines(*args, **kwargs)
d55e5bfc
RD
9264
9265 def ScrollPages(*args, **kwargs):
9266 """
9267 ScrollPages(self, int pages) -> bool
9268
15817c7e 9269 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
9270 the given number of pages down, if pages is positive, or up if pages
9271 is negative. Returns True if the window was scrolled, False if it was
9272 already on top/bottom and nothing was done.
9273 """
5b5c9bc7 9274 return _core_.Window_ScrollPages(*args, **kwargs)
d55e5bfc
RD
9275
9276 def LineUp(*args, **kwargs):
9277 """
9278 LineUp(self) -> bool
9279
9280 This is just a wrapper for ScrollLines(-1).
9281 """
5b5c9bc7 9282 return _core_.Window_LineUp(*args, **kwargs)
d55e5bfc
RD
9283
9284 def LineDown(*args, **kwargs):
9285 """
9286 LineDown(self) -> bool
9287
9288 This is just a wrapper for ScrollLines(1).
9289 """
5b5c9bc7 9290 return _core_.Window_LineDown(*args, **kwargs)
d55e5bfc
RD
9291
9292 def PageUp(*args, **kwargs):
9293 """
9294 PageUp(self) -> bool
9295
9296 This is just a wrapper for ScrollPages(-1).
9297 """
5b5c9bc7 9298 return _core_.Window_PageUp(*args, **kwargs)
d55e5bfc
RD
9299
9300 def PageDown(*args, **kwargs):
9301 """
9302 PageDown(self) -> bool
9303
9304 This is just a wrapper for ScrollPages(1).
9305 """
5b5c9bc7 9306 return _core_.Window_PageDown(*args, **kwargs)
d55e5bfc
RD
9307
9308 def SetHelpText(*args, **kwargs):
9309 """
5b5c9bc7 9310 SetHelpText(self, String text)
d55e5bfc
RD
9311
9312 Sets the help text to be used as context-sensitive help for this
9313 window. Note that the text is actually stored by the current
f52cbe90 9314 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 9315 """
5b5c9bc7 9316 return _core_.Window_SetHelpText(*args, **kwargs)
d55e5bfc
RD
9317
9318 def SetHelpTextForId(*args, **kwargs):
9319 """
5b5c9bc7 9320 SetHelpTextForId(self, String text)
d55e5bfc
RD
9321
9322 Associate this help text with all windows with the same id as this
9323 one.
9324 """
5b5c9bc7 9325 return _core_.Window_SetHelpTextForId(*args, **kwargs)
d55e5bfc 9326
b850e7f3
RD
9327 def GetHelpTextAtPoint(*args, **kwargs):
9328 """
9329 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9330
9331 Get the help string associated with the given position in this window.
9332
9333 Notice that pt may be invalid if event origin is keyboard or unknown
9334 and this method should return the global window help text then
9335
9336 """
9337 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9338
d55e5bfc
RD
9339 def GetHelpText(*args, **kwargs):
9340 """
5b5c9bc7 9341 GetHelpText(self) -> String
d55e5bfc
RD
9342
9343 Gets the help text to be used as context-sensitive help for this
9344 window. Note that the text is actually stored by the current
f52cbe90 9345 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 9346 """
5b5c9bc7 9347 return _core_.Window_GetHelpText(*args, **kwargs)
d55e5bfc
RD
9348
9349 def SetToolTipString(*args, **kwargs):
9350 """
5b5c9bc7 9351 SetToolTipString(self, String tip)
d55e5bfc
RD
9352
9353 Attach a tooltip to the window.
9354 """
5b5c9bc7 9355 return _core_.Window_SetToolTipString(*args, **kwargs)
d55e5bfc
RD
9356
9357 def SetToolTip(*args, **kwargs):
9358 """
5b5c9bc7 9359 SetToolTip(self, ToolTip tip)
d55e5bfc
RD
9360
9361 Attach a tooltip to the window.
9362 """
5b5c9bc7 9363 return _core_.Window_SetToolTip(*args, **kwargs)
d55e5bfc
RD
9364
9365 def GetToolTip(*args, **kwargs):
9366 """
5b5c9bc7 9367 GetToolTip(self) -> ToolTip
d55e5bfc
RD
9368
9369 get the associated tooltip or None if none
9370 """
5b5c9bc7 9371 return _core_.Window_GetToolTip(*args, **kwargs)
d55e5bfc
RD
9372
9373 def SetDropTarget(*args, **kwargs):
9374 """
5b5c9bc7 9375 SetDropTarget(self, DropTarget dropTarget)
d55e5bfc
RD
9376
9377 Associates a drop target with this window. If the window already has
9378 a drop target, it is deleted.
9379 """
5b5c9bc7 9380 return _core_.Window_SetDropTarget(*args, **kwargs)
d55e5bfc
RD
9381
9382 def GetDropTarget(*args, **kwargs):
9383 """
5b5c9bc7 9384 GetDropTarget(self) -> DropTarget
d55e5bfc
RD
9385
9386 Returns the associated drop target, which may be None.
9387 """
5b5c9bc7 9388 return _core_.Window_GetDropTarget(*args, **kwargs)
d55e5bfc 9389
5ba5649b
RD
9390 def DragAcceptFiles(*args, **kwargs):
9391 """
9392 DragAcceptFiles(self, bool accept)
9393
9394 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9395 Only functional on Windows.
9396 """
9397 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9398
d55e5bfc
RD
9399 def SetConstraints(*args, **kwargs):
9400 """
5b5c9bc7 9401 SetConstraints(self, LayoutConstraints constraints)
d55e5bfc
RD
9402
9403 Sets the window to have the given layout constraints. If an existing
9404 layout constraints object is already owned by the window, it will be
9405 deleted. Pass None to disassociate and delete the window's current
9406 constraints.
9407
9408 You must call SetAutoLayout to tell a window to use the constraints
9409 automatically in its default EVT_SIZE handler; otherwise, you must
9410 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9411 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9412 effect.
9413 """
5b5c9bc7 9414 return _core_.Window_SetConstraints(*args, **kwargs)
d55e5bfc
RD
9415
9416 def GetConstraints(*args, **kwargs):
9417 """
5b5c9bc7 9418 GetConstraints(self) -> LayoutConstraints
d55e5bfc
RD
9419
9420 Returns a pointer to the window's layout constraints, or None if there
9421 are none.
9422 """
5b5c9bc7 9423 return _core_.Window_GetConstraints(*args, **kwargs)
d55e5bfc
RD
9424
9425 def SetAutoLayout(*args, **kwargs):
9426 """
9427 SetAutoLayout(self, bool autoLayout)
9428
9429 Determines whether the Layout function will be called automatically
b1fcee84
RD
9430 when the window is resized. lease note that this only happens for the
9431 windows usually used to contain children, namely `wx.Panel` and
9432 `wx.TopLevelWindow` (and the classes deriving from them).
9433
9434 This method is called implicitly by `SetSizer` but if you use
9435 `SetConstraints` you should call it manually or otherwise the window
9436 layout won't be correctly updated when its size changes.
d55e5bfc 9437 """
5b5c9bc7 9438 return _core_.Window_SetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9439
9440 def GetAutoLayout(*args, **kwargs):
9441 """
9442 GetAutoLayout(self) -> bool
9443
9444 Returns the current autoLayout setting
9445 """
5b5c9bc7 9446 return _core_.Window_GetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9447
9448 def Layout(*args, **kwargs):
9449 """
9450 Layout(self) -> bool
9451
9452 Invokes the constraint-based layout algorithm or the sizer-based
9453 algorithm for this window. See SetAutoLayout: when auto layout is on,
9454 this function gets called automatically by the default EVT_SIZE
9455 handler when the window is resized.
9456 """
5b5c9bc7 9457 return _core_.Window_Layout(*args, **kwargs)
d55e5bfc
RD
9458
9459 def SetSizer(*args, **kwargs):
9460 """
5b5c9bc7 9461 SetSizer(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9462
9463 Sets the window to have the given layout sizer. The window will then
9464 own the object, and will take care of its deletion. If an existing
9465 layout sizer object is already owned by the window, it will be deleted
9466 if the deleteOld parameter is true. Note that this function will also
9467 call SetAutoLayout implicitly with a True parameter if the sizer is
b411df4a 9468 non-None, and False otherwise.
d55e5bfc 9469 """
5b5c9bc7 9470 return _core_.Window_SetSizer(*args, **kwargs)
d55e5bfc
RD
9471
9472 def SetSizerAndFit(*args, **kwargs):
9473 """
5b5c9bc7 9474 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9475
9476 The same as SetSizer, except it also sets the size hints for the
9477 window based on the sizer's minimum size.
9478 """
5b5c9bc7 9479 return _core_.Window_SetSizerAndFit(*args, **kwargs)
d55e5bfc
RD
9480
9481 def GetSizer(*args, **kwargs):
9482 """
5b5c9bc7 9483 GetSizer(self) -> Sizer
d55e5bfc
RD
9484
9485 Return the sizer associated with the window by a previous call to
9486 SetSizer or None if there isn't one.
9487 """
5b5c9bc7 9488 return _core_.Window_GetSizer(*args, **kwargs)
d55e5bfc
RD
9489
9490 def SetContainingSizer(*args, **kwargs):
9491 """
5b5c9bc7 9492 SetContainingSizer(self, Sizer sizer)
d55e5bfc
RD
9493
9494 This normally does not need to be called by application code. It is
9495 called internally when a window is added to a sizer, and is used so
9496 the window can remove itself from the sizer when it is destroyed.
9497 """
5b5c9bc7 9498 return _core_.Window_SetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9499
9500 def GetContainingSizer(*args, **kwargs):
9501 """
5b5c9bc7 9502 GetContainingSizer(self) -> Sizer
d55e5bfc
RD
9503
9504 Return the sizer that this window is a member of, if any, otherwise None.
9505 """
5b5c9bc7 9506 return _core_.Window_GetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9507
9508 def InheritAttributes(*args, **kwargs):
9509 """
9510 InheritAttributes(self)
9511
15817c7e
RD
9512 This function is (or should be, in case of custom controls) called
9513 during window creation to intelligently set up the window visual
9514 attributes, that is the font and the foreground and background
9515 colours.
9516
9517 By 'intelligently' the following is meant: by default, all windows use
9518 their own default attributes. However if some of the parent's
9519 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 9520 SetOwnFont) and if the corresponding attribute hadn't been
15817c7e
RD
9521 explicitly set for this window itself, then this window takes the same
9522 value as used by the parent. In addition, if the window overrides
9523 ShouldInheritColours to return false, the colours will not be changed
9524 no matter what and only the font might.
9525
a7bb0a9d
RD
9526 This rather complicated logic is necessary in order to accommodate the
9527 different usage scenarios. The most common one is when all default
15817c7e
RD
9528 attributes are used and in this case, nothing should be inherited as
9529 in modern GUIs different controls use different fonts (and colours)
9530 than their siblings so they can't inherit the same value from the
9531 parent. However it was also deemed desirable to allow to simply change
9532 the attributes of all children at once by just changing the font or
9533 colour of their common parent, hence in this case we do inherit the
9534 parents attributes.
9535
d55e5bfc 9536 """
5b5c9bc7 9537 return _core_.Window_InheritAttributes(*args, **kwargs)
d55e5bfc
RD
9538
9539 def ShouldInheritColours(*args, **kwargs):
9540 """
9541 ShouldInheritColours(self) -> bool
9542
9543 Return true from here to allow the colours of this window to be
15817c7e
RD
9544 changed by InheritAttributes, returning false forbids inheriting them
9545 from the parent window.
d55e5bfc 9546
15817c7e
RD
9547 The base class version returns false, but this method is overridden in
9548 wxControl where it returns true.
d55e5bfc 9549 """
5b5c9bc7 9550 return _core_.Window_ShouldInheritColours(*args, **kwargs)
d55e5bfc
RD
9551
9552 def PostCreate(self, pre):
9553 """
9554 Phase 3 of the 2-phase create <wink!>
9555 Call this method after precreating the window with the 2-phase create method.
9556 """
9557 self.this = pre.this
9558 self.thisown = pre.thisown
9559 pre.thisown = 0
9560 if hasattr(self, '_setOORInfo'):
9561 self._setOORInfo(self)
9562 if hasattr(self, '_setCallbackInfo'):
9563 self._setCallbackInfo(self, self.__class__)
9564
7e08d4ef
RD
9565 def SendSizeEvent(self):
9566 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9567
2131d850 9568_core_.Window_swigregister(Window)
d55e5bfc
RD
9569
9570def PreWindow(*args, **kwargs):
9571 """
5b5c9bc7 9572 PreWindow() -> Window
d55e5bfc
RD
9573
9574 Precreate a Window for 2-phase creation.
9575 """
5b5c9bc7 9576 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
9577 return val
9578
1bd55598
RD
9579def Window_NewControlId(*args):
9580 """
5b5c9bc7 9581 Window_NewControlId() -> int
d55e5bfc
RD
9582
9583 Generate a control id for the controls which were not given one.
9584 """
1bd55598 9585 return _core_.Window_NewControlId(*args)
d55e5bfc 9586
5b5c9bc7 9587def Window_NextControlId(*args, **kwargs):
1bd55598 9588 """
5b5c9bc7 9589 Window_NextControlId(int winid) -> int
d55e5bfc
RD
9590
9591 Get the id of the control following the one with the given
15817c7e 9592 autogenerated) id
d55e5bfc 9593 """
1bd55598 9594 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc 9595
5b5c9bc7 9596def Window_PrevControlId(*args, **kwargs):
1bd55598 9597 """
5b5c9bc7 9598 Window_PrevControlId(int winid) -> int
d55e5bfc
RD
9599
9600 Get the id of the control preceding the one with the given
15817c7e 9601 autogenerated) id
d55e5bfc 9602 """
1bd55598 9603 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 9604
1bd55598
RD
9605def Window_FindFocus(*args):
9606 """
5b5c9bc7 9607 Window_FindFocus() -> Window
d55e5bfc
RD
9608
9609 Returns the window or control that currently has the keyboard focus,
9610 or None.
9611 """
1bd55598 9612 return _core_.Window_FindFocus(*args)
d55e5bfc 9613
1bd55598
RD
9614def Window_GetCapture(*args):
9615 """
5b5c9bc7 9616 Window_GetCapture() -> Window
d55e5bfc
RD
9617
9618 Returns the window which currently captures the mouse or None
9619 """
1bd55598 9620 return _core_.Window_GetCapture(*args)
d55e5bfc 9621
5b5c9bc7 9622def Window_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 9623 """
5b5c9bc7 9624 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9625
15817c7e
RD
9626 Get the default attributes for this class. This is useful if you want
9627 to use the same font or colour in your own control as in a standard
9628 control -- which is a much better idea than hard coding specific
a5ee0656
RD
9629 colours or fonts which might look completely out of place on the
9630 user's system, especially if it uses themes.
d55e5bfc
RD
9631
9632 The variant parameter is only relevant under Mac currently and is
15817c7e 9633 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
9634 the returned font. See `wx.Window.SetWindowVariant` for more about
9635 this.
d55e5bfc 9636 """
1bd55598 9637 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9638
9639def DLG_PNT(win, point_or_x, y=None):
9640 """
9641 Convenience function for converting a Point or (x,y) in
9642 dialog units to pixel units.
9643 """
9644 if y is None:
9645 return win.ConvertDialogPointToPixels(point_or_x)
9646 else:
9647 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9648
9649def DLG_SZE(win, size_width, height=None):
9650 """
9651 Convenience function for converting a Size or (w,h) in
9652 dialog units to pixel units.
9653 """
9654 if height is None:
9655 return win.ConvertDialogSizeToPixels(size_width)
9656 else:
9657 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9658
9659
5b5c9bc7 9660def FindWindowById(*args, **kwargs):
1bd55598 9661 """
5b5c9bc7 9662 FindWindowById(long id, Window parent=None) -> Window
d55e5bfc
RD
9663
9664 Find the first window in the application with the given id. If parent
9665 is None, the search will start from all top-level frames and dialog
9666 boxes; if non-None, the search will be limited to the given window
9667 hierarchy. The search is recursive in both cases.
9668 """
1bd55598 9669 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc 9670
5b5c9bc7 9671def FindWindowByName(*args, **kwargs):
1bd55598 9672 """
5b5c9bc7 9673 FindWindowByName(String name, Window parent=None) -> Window
d55e5bfc
RD
9674
9675 Find a window by its name (as given in a window constructor or Create
9676 function call). If parent is None, the search will start from all
9677 top-level frames and dialog boxes; if non-None, the search will be
9678 limited to the given window hierarchy. The search is recursive in both
9679 cases.
9680
9681 If no window with such name is found, wx.FindWindowByLabel is called.
9682 """
1bd55598 9683 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc 9684
5b5c9bc7 9685def FindWindowByLabel(*args, **kwargs):
1bd55598 9686 """
5b5c9bc7 9687 FindWindowByLabel(String label, Window parent=None) -> Window
d55e5bfc
RD
9688
9689 Find a window by its label. Depending on the type of window, the label
9690 may be a window title or panel item label. If parent is None, the
9691 search will start from all top-level frames and dialog boxes; if
9692 non-None, the search will be limited to the given window
9693 hierarchy. The search is recursive in both cases.
9694 """
1bd55598 9695 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc 9696
5b5c9bc7 9697def Window_FromHWND(*args, **kwargs):
1bd55598
RD
9698 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9699 return _core_.Window_FromHWND(*args, **kwargs)
3215336e 9700
1bd55598
RD
9701def GetTopLevelWindows(*args):
9702 """
3215336e
RD
9703 GetTopLevelWindows() -> PyObject
9704
9705 Returns a list of the the application's top-level windows, (frames,
9706 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9707 by wxWidgets, and so it is only valid as long as no top-level windows
9708 are closed or new top-level windows are created.
9709
9710 """
1bd55598 9711 return _core_.GetTopLevelWindows(*args)
d55e5bfc
RD
9712#---------------------------------------------------------------------------
9713
5b5c9bc7
RD
9714class Validator(EvtHandler):
9715 """Proxy of C++ Validator class"""
1bd55598
RD
9716 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9717 __repr__ = _swig_repr
9718 def __init__(self, *args, **kwargs):
5b5c9bc7 9719 """__init__(self) -> Validator"""
1bd55598 9720 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d55e5bfc
RD
9721 self._setOORInfo(self)
9722
9723 def Clone(*args, **kwargs):
5b5c9bc7
RD
9724 """Clone(self) -> Validator"""
9725 return _core_.Validator_Clone(*args, **kwargs)
d55e5bfc
RD
9726
9727 def Validate(*args, **kwargs):
5b5c9bc7
RD
9728 """Validate(self, Window parent) -> bool"""
9729 return _core_.Validator_Validate(*args, **kwargs)
d55e5bfc
RD
9730
9731 def TransferToWindow(*args, **kwargs):
9732 """TransferToWindow(self) -> bool"""
5b5c9bc7 9733 return _core_.Validator_TransferToWindow(*args, **kwargs)
d55e5bfc
RD
9734
9735 def TransferFromWindow(*args, **kwargs):
9736 """TransferFromWindow(self) -> bool"""
5b5c9bc7 9737 return _core_.Validator_TransferFromWindow(*args, **kwargs)
d55e5bfc
RD
9738
9739 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
9740 """GetWindow(self) -> Window"""
9741 return _core_.Validator_GetWindow(*args, **kwargs)
d55e5bfc
RD
9742
9743 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
9744 """SetWindow(self, Window window)"""
9745 return _core_.Validator_SetWindow(*args, **kwargs)
d55e5bfc
RD
9746
9747 def IsSilent(*args, **kwargs):
d6c14a4c 9748 """IsSilent() -> bool"""
5b5c9bc7 9749 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc
RD
9750
9751 IsSilent = staticmethod(IsSilent)
9752 def SetBellOnError(*args, **kwargs):
d6c14a4c 9753 """SetBellOnError(int doIt=True)"""
5b5c9bc7 9754 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
9755
9756 SetBellOnError = staticmethod(SetBellOnError)
2131d850 9757_core_.Validator_swigregister(Validator)
d55e5bfc 9758
1bd55598
RD
9759def Validator_IsSilent(*args):
9760 """Validator_IsSilent() -> bool"""
9761 return _core_.Validator_IsSilent(*args)
d55e5bfc 9762
5b5c9bc7 9763def Validator_SetBellOnError(*args, **kwargs):
1bd55598
RD
9764 """Validator_SetBellOnError(int doIt=True)"""
9765 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc 9766
5b5c9bc7
RD
9767class PyValidator(Validator):
9768 """Proxy of C++ PyValidator class"""
1bd55598
RD
9769 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9770 __repr__ = _swig_repr
9771 def __init__(self, *args, **kwargs):
5b5c9bc7 9772 """__init__(self) -> PyValidator"""
1bd55598 9773 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
d55e5bfc
RD
9774
9775 self._setCallbackInfo(self, PyValidator, 1)
9776 self._setOORInfo(self)
9777
9778 def _setCallbackInfo(*args, **kwargs):
9779 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
5b5c9bc7 9780 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
d55e5bfc 9781
2131d850 9782_core_.PyValidator_swigregister(PyValidator)
d55e5bfc
RD
9783
9784#---------------------------------------------------------------------------
9785
5b5c9bc7
RD
9786class Menu(EvtHandler):
9787 """Proxy of C++ Menu class"""
1bd55598
RD
9788 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9789 __repr__ = _swig_repr
9790 def __init__(self, *args, **kwargs):
5b5c9bc7 9791 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
1bd55598 9792 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
d55e5bfc
RD
9793 self._setOORInfo(self)
9794
9795 def Append(*args, **kwargs):
5b5c9bc7
RD
9796 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9797 return _core_.Menu_Append(*args, **kwargs)
d55e5bfc
RD
9798
9799 def AppendSeparator(*args, **kwargs):
5b5c9bc7
RD
9800 """AppendSeparator(self) -> MenuItem"""
9801 return _core_.Menu_AppendSeparator(*args, **kwargs)
d55e5bfc
RD
9802
9803 def AppendCheckItem(*args, **kwargs):
5b5c9bc7
RD
9804 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9805 return _core_.Menu_AppendCheckItem(*args, **kwargs)
d55e5bfc
RD
9806
9807 def AppendRadioItem(*args, **kwargs):
5b5c9bc7
RD
9808 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9809 return _core_.Menu_AppendRadioItem(*args, **kwargs)
d55e5bfc
RD
9810
9811 def AppendMenu(*args, **kwargs):
5b5c9bc7
RD
9812 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9813 return _core_.Menu_AppendMenu(*args, **kwargs)
d55e5bfc 9814
da91cb0f
RD
9815 def AppendSubMenu(*args, **kwargs):
9816 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9817 return _core_.Menu_AppendSubMenu(*args, **kwargs)
9818
d55e5bfc 9819 def AppendItem(*args, **kwargs):
5b5c9bc7
RD
9820 """AppendItem(self, MenuItem item) -> MenuItem"""
9821 return _core_.Menu_AppendItem(*args, **kwargs)
d55e5bfc 9822
d55e5bfc 9823 def InsertItem(*args, **kwargs):
5b5c9bc7
RD
9824 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9825 return _core_.Menu_InsertItem(*args, **kwargs)
d55e5bfc 9826
1bd55598
RD
9827 def PrependItem(*args, **kwargs):
9828 """PrependItem(self, MenuItem item) -> MenuItem"""
9829 return _core_.Menu_PrependItem(*args, **kwargs)
9830
9831 def Break(*args, **kwargs):
9832 """Break(self)"""
9833 return _core_.Menu_Break(*args, **kwargs)
9834
d55e5bfc
RD
9835 def Insert(*args, **kwargs):
9836 """
5b5c9bc7
RD
9837 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9838 int kind=ITEM_NORMAL) -> MenuItem
d55e5bfc 9839 """
5b5c9bc7 9840 return _core_.Menu_Insert(*args, **kwargs)
d55e5bfc
RD
9841
9842 def InsertSeparator(*args, **kwargs):
5b5c9bc7
RD
9843 """InsertSeparator(self, size_t pos) -> MenuItem"""
9844 return _core_.Menu_InsertSeparator(*args, **kwargs)
d55e5bfc
RD
9845
9846 def InsertCheckItem(*args, **kwargs):
5b5c9bc7
RD
9847 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9848 return _core_.Menu_InsertCheckItem(*args, **kwargs)
d55e5bfc
RD
9849
9850 def InsertRadioItem(*args, **kwargs):
5b5c9bc7
RD
9851 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9852 return _core_.Menu_InsertRadioItem(*args, **kwargs)
d55e5bfc
RD
9853
9854 def InsertMenu(*args, **kwargs):
5b5c9bc7
RD
9855 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9856 return _core_.Menu_InsertMenu(*args, **kwargs)
d55e5bfc 9857
d55e5bfc 9858 def Prepend(*args, **kwargs):
5b5c9bc7
RD
9859 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9860 return _core_.Menu_Prepend(*args, **kwargs)
d55e5bfc
RD
9861
9862 def PrependSeparator(*args, **kwargs):
5b5c9bc7
RD
9863 """PrependSeparator(self) -> MenuItem"""
9864 return _core_.Menu_PrependSeparator(*args, **kwargs)
d55e5bfc
RD
9865
9866 def PrependCheckItem(*args, **kwargs):
5b5c9bc7
RD
9867 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9868 return _core_.Menu_PrependCheckItem(*args, **kwargs)
d55e5bfc
RD
9869
9870 def PrependRadioItem(*args, **kwargs):
5b5c9bc7
RD
9871 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9872 return _core_.Menu_PrependRadioItem(*args, **kwargs)
d55e5bfc
RD
9873
9874 def PrependMenu(*args, **kwargs):
5b5c9bc7
RD
9875 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9876 return _core_.Menu_PrependMenu(*args, **kwargs)
d55e5bfc
RD
9877
9878 def Remove(*args, **kwargs):
5b5c9bc7
RD
9879 """Remove(self, int id) -> MenuItem"""
9880 return _core_.Menu_Remove(*args, **kwargs)
d55e5bfc
RD
9881
9882 def RemoveItem(*args, **kwargs):
5b5c9bc7
RD
9883 """RemoveItem(self, MenuItem item) -> MenuItem"""
9884 return _core_.Menu_RemoveItem(*args, **kwargs)
d55e5bfc
RD
9885
9886 def Delete(*args, **kwargs):
9887 """Delete(self, int id) -> bool"""
5b5c9bc7 9888 return _core_.Menu_Delete(*args, **kwargs)
d55e5bfc
RD
9889
9890 def DeleteItem(*args, **kwargs):
5b5c9bc7
RD
9891 """DeleteItem(self, MenuItem item) -> bool"""
9892 return _core_.Menu_DeleteItem(*args, **kwargs)
d55e5bfc
RD
9893
9894 def Destroy(*args, **kwargs):
9895 """
9896 Destroy(self)
9897
9898 Deletes the C++ object this Python object is a proxy for.
9899 """
7e08d4ef
RD
9900 val = _core_.Menu_Destroy(*args, **kwargs)
9901 args[0].thisown = 0
9902 return val
d55e5bfc
RD
9903
9904 def DestroyId(*args, **kwargs):
9905 """
9906 DestroyId(self, int id) -> bool
9907
9908 Deletes the C++ object this Python object is a proxy for.
9909 """
7e08d4ef
RD
9910 val = _core_.Menu_DestroyId(*args, **kwargs)
9911 args[0].thisown = 0
9912 return val
d55e5bfc
RD
9913
9914 def DestroyItem(*args, **kwargs):
9915 """
5b5c9bc7 9916 DestroyItem(self, MenuItem item) -> bool
d55e5bfc
RD
9917
9918 Deletes the C++ object this Python object is a proxy for.
9919 """
7e08d4ef
RD
9920 val = _core_.Menu_DestroyItem(*args, **kwargs)
9921 args[0].thisown = 0
9922 return val
d55e5bfc
RD
9923
9924 def GetMenuItemCount(*args, **kwargs):
9925 """GetMenuItemCount(self) -> size_t"""
5b5c9bc7 9926 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
d55e5bfc
RD
9927
9928 def GetMenuItems(*args, **kwargs):
9929 """GetMenuItems(self) -> PyObject"""
5b5c9bc7 9930 return _core_.Menu_GetMenuItems(*args, **kwargs)
d55e5bfc
RD
9931
9932 def FindItem(*args, **kwargs):
5b5c9bc7
RD
9933 """FindItem(self, String item) -> int"""
9934 return _core_.Menu_FindItem(*args, **kwargs)
d55e5bfc
RD
9935
9936 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
9937 """FindItemById(self, int id) -> MenuItem"""
9938 return _core_.Menu_FindItemById(*args, **kwargs)
d55e5bfc
RD
9939
9940 def FindItemByPosition(*args, **kwargs):
5b5c9bc7
RD
9941 """FindItemByPosition(self, size_t position) -> MenuItem"""
9942 return _core_.Menu_FindItemByPosition(*args, **kwargs)
d55e5bfc
RD
9943
9944 def Enable(*args, **kwargs):
9945 """Enable(self, int id, bool enable)"""
5b5c9bc7 9946 return _core_.Menu_Enable(*args, **kwargs)
d55e5bfc
RD
9947
9948 def IsEnabled(*args, **kwargs):
9949 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 9950 return _core_.Menu_IsEnabled(*args, **kwargs)
d55e5bfc
RD
9951
9952 def Check(*args, **kwargs):
9953 """Check(self, int id, bool check)"""
5b5c9bc7 9954 return _core_.Menu_Check(*args, **kwargs)
d55e5bfc
RD
9955
9956 def IsChecked(*args, **kwargs):
9957 """IsChecked(self, int id) -> bool"""
5b5c9bc7 9958 return _core_.Menu_IsChecked(*args, **kwargs)
d55e5bfc
RD
9959
9960 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
9961 """SetLabel(self, int id, String label)"""
9962 return _core_.Menu_SetLabel(*args, **kwargs)
d55e5bfc
RD
9963
9964 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
9965 """GetLabel(self, int id) -> String"""
9966 return _core_.Menu_GetLabel(*args, **kwargs)
d55e5bfc
RD
9967
9968 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
9969 """SetHelpString(self, int id, String helpString)"""
9970 return _core_.Menu_SetHelpString(*args, **kwargs)
d55e5bfc
RD
9971
9972 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
9973 """GetHelpString(self, int id) -> String"""
9974 return _core_.Menu_GetHelpString(*args, **kwargs)
d55e5bfc
RD
9975
9976 def SetTitle(*args, **kwargs):
5b5c9bc7
RD
9977 """SetTitle(self, String title)"""
9978 return _core_.Menu_SetTitle(*args, **kwargs)
d55e5bfc
RD
9979
9980 def GetTitle(*args, **kwargs):
5b5c9bc7
RD
9981 """GetTitle(self) -> String"""
9982 return _core_.Menu_GetTitle(*args, **kwargs)
d55e5bfc
RD
9983
9984 def SetEventHandler(*args, **kwargs):
5b5c9bc7
RD
9985 """SetEventHandler(self, EvtHandler handler)"""
9986 return _core_.Menu_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
9987
9988 def GetEventHandler(*args, **kwargs):
5b5c9bc7
RD
9989 """GetEventHandler(self) -> EvtHandler"""
9990 return _core_.Menu_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
9991
9992 def SetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
9993 """SetInvokingWindow(self, Window win)"""
9994 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
9995
9996 def GetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
9997 """GetInvokingWindow(self) -> Window"""
9998 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
9999
10000 def GetStyle(*args, **kwargs):
10001 """GetStyle(self) -> long"""
5b5c9bc7 10002 return _core_.Menu_GetStyle(*args, **kwargs)
d55e5bfc
RD
10003
10004 def UpdateUI(*args, **kwargs):
5b5c9bc7
RD
10005 """UpdateUI(self, EvtHandler source=None)"""
10006 return _core_.Menu_UpdateUI(*args, **kwargs)
d55e5bfc
RD
10007
10008 def GetMenuBar(*args, **kwargs):
5b5c9bc7
RD
10009 """GetMenuBar(self) -> MenuBar"""
10010 return _core_.Menu_GetMenuBar(*args, **kwargs)
d55e5bfc
RD
10011
10012 def Attach(*args, **kwargs):
10013 """Attach(self, wxMenuBarBase menubar)"""
5b5c9bc7 10014 return _core_.Menu_Attach(*args, **kwargs)
d55e5bfc
RD
10015
10016 def Detach(*args, **kwargs):
10017 """Detach(self)"""
5b5c9bc7 10018 return _core_.Menu_Detach(*args, **kwargs)
d55e5bfc
RD
10019
10020 def IsAttached(*args, **kwargs):
10021 """IsAttached(self) -> bool"""
5b5c9bc7 10022 return _core_.Menu_IsAttached(*args, **kwargs)
d55e5bfc
RD
10023
10024 def SetParent(*args, **kwargs):
5b5c9bc7
RD
10025 """SetParent(self, Menu parent)"""
10026 return _core_.Menu_SetParent(*args, **kwargs)
d55e5bfc
RD
10027
10028 def GetParent(*args, **kwargs):
5b5c9bc7
RD
10029 """GetParent(self) -> Menu"""
10030 return _core_.Menu_GetParent(*args, **kwargs)
d55e5bfc 10031
2131d850 10032_core_.Menu_swigregister(Menu)
5b5c9bc7 10033DefaultValidator = cvar.DefaultValidator
d55e5bfc
RD
10034
10035#---------------------------------------------------------------------------
10036
5b5c9bc7
RD
10037class MenuBar(Window):
10038 """Proxy of C++ MenuBar class"""
1bd55598
RD
10039 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10040 __repr__ = _swig_repr
10041 def __init__(self, *args, **kwargs):
5b5c9bc7 10042 """__init__(self, long style=0) -> MenuBar"""
1bd55598 10043 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d55e5bfc
RD
10044 self._setOORInfo(self)
10045
10046 def Append(*args, **kwargs):
5b5c9bc7
RD
10047 """Append(self, Menu menu, String title) -> bool"""
10048 return _core_.MenuBar_Append(*args, **kwargs)
d55e5bfc
RD
10049
10050 def Insert(*args, **kwargs):
5b5c9bc7
RD
10051 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10052 return _core_.MenuBar_Insert(*args, **kwargs)
d55e5bfc
RD
10053
10054 def GetMenuCount(*args, **kwargs):
10055 """GetMenuCount(self) -> size_t"""
5b5c9bc7 10056 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
d55e5bfc
RD
10057
10058 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10059 """GetMenu(self, size_t pos) -> Menu"""
10060 return _core_.MenuBar_GetMenu(*args, **kwargs)
d55e5bfc
RD
10061
10062 def Replace(*args, **kwargs):
5b5c9bc7
RD
10063 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10064 return _core_.MenuBar_Replace(*args, **kwargs)
d55e5bfc
RD
10065
10066 def Remove(*args, **kwargs):
5b5c9bc7
RD
10067 """Remove(self, size_t pos) -> Menu"""
10068 return _core_.MenuBar_Remove(*args, **kwargs)
d55e5bfc
RD
10069
10070 def EnableTop(*args, **kwargs):
10071 """EnableTop(self, size_t pos, bool enable)"""
5b5c9bc7 10072 return _core_.MenuBar_EnableTop(*args, **kwargs)
d55e5bfc
RD
10073
10074 def IsEnabledTop(*args, **kwargs):
10075 """IsEnabledTop(self, size_t pos) -> bool"""
5b5c9bc7 10076 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
d55e5bfc
RD
10077
10078 def SetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10079 """SetLabelTop(self, size_t pos, String label)"""
10080 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
d55e5bfc
RD
10081
10082 def GetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10083 """GetLabelTop(self, size_t pos) -> String"""
10084 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
d55e5bfc
RD
10085
10086 def FindMenuItem(*args, **kwargs):
5b5c9bc7
RD
10087 """FindMenuItem(self, String menu, String item) -> int"""
10088 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
d55e5bfc
RD
10089
10090 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10091 """FindItemById(self, int id) -> MenuItem"""
10092 return _core_.MenuBar_FindItemById(*args, **kwargs)
d55e5bfc
RD
10093
10094 def FindMenu(*args, **kwargs):
5b5c9bc7
RD
10095 """FindMenu(self, String title) -> int"""
10096 return _core_.MenuBar_FindMenu(*args, **kwargs)
d55e5bfc
RD
10097
10098 def Enable(*args, **kwargs):
10099 """Enable(self, int id, bool enable)"""
5b5c9bc7 10100 return _core_.MenuBar_Enable(*args, **kwargs)
d55e5bfc
RD
10101
10102 def Check(*args, **kwargs):
10103 """Check(self, int id, bool check)"""
5b5c9bc7 10104 return _core_.MenuBar_Check(*args, **kwargs)
d55e5bfc
RD
10105
10106 def IsChecked(*args, **kwargs):
10107 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10108 return _core_.MenuBar_IsChecked(*args, **kwargs)
d55e5bfc
RD
10109
10110 def IsEnabled(*args, **kwargs):
10111 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10112 return _core_.MenuBar_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10113
10114 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10115 """SetLabel(self, int id, String label)"""
10116 return _core_.MenuBar_SetLabel(*args, **kwargs)
d55e5bfc
RD
10117
10118 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10119 """GetLabel(self, int id) -> String"""
10120 return _core_.MenuBar_GetLabel(*args, **kwargs)
d55e5bfc
RD
10121
10122 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10123 """SetHelpString(self, int id, String helpString)"""
10124 return _core_.MenuBar_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10125
10126 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10127 """GetHelpString(self, int id) -> String"""
10128 return _core_.MenuBar_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10129
10130 def GetFrame(*args, **kwargs):
10131 """GetFrame(self) -> wxFrame"""
5b5c9bc7 10132 return _core_.MenuBar_GetFrame(*args, **kwargs)
d55e5bfc
RD
10133
10134 def IsAttached(*args, **kwargs):
10135 """IsAttached(self) -> bool"""
5b5c9bc7 10136 return _core_.MenuBar_IsAttached(*args, **kwargs)
d55e5bfc
RD
10137
10138 def Attach(*args, **kwargs):
10139 """Attach(self, wxFrame frame)"""
5b5c9bc7 10140 return _core_.MenuBar_Attach(*args, **kwargs)
d55e5bfc
RD
10141
10142 def Detach(*args, **kwargs):
10143 """Detach(self)"""
5b5c9bc7 10144 return _core_.MenuBar_Detach(*args, **kwargs)
d55e5bfc 10145
4f433fef
RD
10146 def SetAutoWindowMenu(*args, **kwargs):
10147 """SetAutoWindowMenu(bool enable)"""
10148 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10149
10150 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10151 def GetAutoWindowMenu(*args, **kwargs):
10152 """GetAutoWindowMenu() -> bool"""
10153 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10154
10155 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
2131d850 10156_core_.MenuBar_swigregister(MenuBar)
d55e5bfc 10157
4f433fef 10158def MenuBar_SetAutoWindowMenu(*args, **kwargs):
1bd55598
RD
10159 """MenuBar_SetAutoWindowMenu(bool enable)"""
10160 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 10161
1bd55598
RD
10162def MenuBar_GetAutoWindowMenu(*args):
10163 """MenuBar_GetAutoWindowMenu() -> bool"""
10164 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 10165
d55e5bfc
RD
10166#---------------------------------------------------------------------------
10167
5b5c9bc7
RD
10168class MenuItem(Object):
10169 """Proxy of C++ MenuItem class"""
1bd55598
RD
10170 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10171 __repr__ = _swig_repr
10172 def __init__(self, *args, **kwargs):
d55e5bfc 10173 """
5b5c9bc7
RD
10174 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10175 String help=EmptyString, int kind=ITEM_NORMAL,
10176 Menu subMenu=None) -> MenuItem
d55e5bfc 10177 """
1bd55598
RD
10178 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10179 __swig_destroy__ = _core_.delete_MenuItem
10180 __del__ = lambda self : None;
d55e5bfc 10181 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10182 """GetMenu(self) -> Menu"""
10183 return _core_.MenuItem_GetMenu(*args, **kwargs)
d55e5bfc
RD
10184
10185 def SetMenu(*args, **kwargs):
5b5c9bc7
RD
10186 """SetMenu(self, Menu menu)"""
10187 return _core_.MenuItem_SetMenu(*args, **kwargs)
d55e5bfc
RD
10188
10189 def SetId(*args, **kwargs):
10190 """SetId(self, int id)"""
5b5c9bc7 10191 return _core_.MenuItem_SetId(*args, **kwargs)
d55e5bfc
RD
10192
10193 def GetId(*args, **kwargs):
10194 """GetId(self) -> int"""
5b5c9bc7 10195 return _core_.MenuItem_GetId(*args, **kwargs)
d55e5bfc
RD
10196
10197 def IsSeparator(*args, **kwargs):
10198 """IsSeparator(self) -> bool"""
5b5c9bc7 10199 return _core_.MenuItem_IsSeparator(*args, **kwargs)
d55e5bfc
RD
10200
10201 def SetText(*args, **kwargs):
5b5c9bc7
RD
10202 """SetText(self, String str)"""
10203 return _core_.MenuItem_SetText(*args, **kwargs)
d55e5bfc
RD
10204
10205 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10206 """GetLabel(self) -> String"""
10207 return _core_.MenuItem_GetLabel(*args, **kwargs)
d55e5bfc
RD
10208
10209 def GetText(*args, **kwargs):
5b5c9bc7
RD
10210 """GetText(self) -> String"""
10211 return _core_.MenuItem_GetText(*args, **kwargs)
d55e5bfc
RD
10212
10213 def GetLabelFromText(*args, **kwargs):
5b5c9bc7
RD
10214 """GetLabelFromText(String text) -> String"""
10215 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc
RD
10216
10217 GetLabelFromText = staticmethod(GetLabelFromText)
10218 def GetKind(*args, **kwargs):
10219 """GetKind(self) -> int"""
5b5c9bc7 10220 return _core_.MenuItem_GetKind(*args, **kwargs)
d55e5bfc
RD
10221
10222 def SetKind(*args, **kwargs):
10223 """SetKind(self, int kind)"""
5b5c9bc7 10224 return _core_.MenuItem_SetKind(*args, **kwargs)
d55e5bfc
RD
10225
10226 def SetCheckable(*args, **kwargs):
10227 """SetCheckable(self, bool checkable)"""
5b5c9bc7 10228 return _core_.MenuItem_SetCheckable(*args, **kwargs)
d55e5bfc
RD
10229
10230 def IsCheckable(*args, **kwargs):
10231 """IsCheckable(self) -> bool"""
5b5c9bc7 10232 return _core_.MenuItem_IsCheckable(*args, **kwargs)
d55e5bfc
RD
10233
10234 def IsSubMenu(*args, **kwargs):
10235 """IsSubMenu(self) -> bool"""
5b5c9bc7 10236 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
d55e5bfc
RD
10237
10238 def SetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10239 """SetSubMenu(self, Menu menu)"""
10240 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
d55e5bfc
RD
10241
10242 def GetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10243 """GetSubMenu(self) -> Menu"""
10244 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
d55e5bfc
RD
10245
10246 def Enable(*args, **kwargs):
10247 """Enable(self, bool enable=True)"""
5b5c9bc7 10248 return _core_.MenuItem_Enable(*args, **kwargs)
d55e5bfc
RD
10249
10250 def IsEnabled(*args, **kwargs):
10251 """IsEnabled(self) -> bool"""
5b5c9bc7 10252 return _core_.MenuItem_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10253
10254 def Check(*args, **kwargs):
10255 """Check(self, bool check=True)"""
5b5c9bc7 10256 return _core_.MenuItem_Check(*args, **kwargs)
d55e5bfc
RD
10257
10258 def IsChecked(*args, **kwargs):
10259 """IsChecked(self) -> bool"""
5b5c9bc7 10260 return _core_.MenuItem_IsChecked(*args, **kwargs)
d55e5bfc
RD
10261
10262 def Toggle(*args, **kwargs):
10263 """Toggle(self)"""
5b5c9bc7 10264 return _core_.MenuItem_Toggle(*args, **kwargs)
d55e5bfc
RD
10265
10266 def SetHelp(*args, **kwargs):
5b5c9bc7
RD
10267 """SetHelp(self, String str)"""
10268 return _core_.MenuItem_SetHelp(*args, **kwargs)
d55e5bfc
RD
10269
10270 def GetHelp(*args, **kwargs):
5b5c9bc7
RD
10271 """GetHelp(self) -> String"""
10272 return _core_.MenuItem_GetHelp(*args, **kwargs)
d55e5bfc
RD
10273
10274 def GetAccel(*args, **kwargs):
5b5c9bc7
RD
10275 """GetAccel(self) -> AcceleratorEntry"""
10276 return _core_.MenuItem_GetAccel(*args, **kwargs)
d55e5bfc
RD
10277
10278 def SetAccel(*args, **kwargs):
5b5c9bc7
RD
10279 """SetAccel(self, AcceleratorEntry accel)"""
10280 return _core_.MenuItem_SetAccel(*args, **kwargs)
d55e5bfc 10281
32fe5131
RD
10282 def SetBitmap(*args, **kwargs):
10283 """SetBitmap(self, Bitmap bitmap)"""
10284 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10285
10286 def GetBitmap(*args, **kwargs):
10287 """GetBitmap(self) -> Bitmap"""
10288 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10289
c1280d1e 10290 def SetFont(*args, **kwargs):
5b5c9bc7
RD
10291 """SetFont(self, Font font)"""
10292 return _core_.MenuItem_SetFont(*args, **kwargs)
c1280d1e
RD
10293
10294 def GetFont(*args, **kwargs):
5b5c9bc7
RD
10295 """GetFont(self) -> Font"""
10296 return _core_.MenuItem_GetFont(*args, **kwargs)
c1280d1e
RD
10297
10298 def SetTextColour(*args, **kwargs):
5b5c9bc7
RD
10299 """SetTextColour(self, Colour colText)"""
10300 return _core_.MenuItem_SetTextColour(*args, **kwargs)
c1280d1e
RD
10301
10302 def GetTextColour(*args, **kwargs):
5b5c9bc7
RD
10303 """GetTextColour(self) -> Colour"""
10304 return _core_.MenuItem_GetTextColour(*args, **kwargs)
c1280d1e
RD
10305
10306 def SetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10307 """SetBackgroundColour(self, Colour colBack)"""
10308 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10309
10310 def GetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10311 """GetBackgroundColour(self) -> Colour"""
10312 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10313
10314 def SetBitmaps(*args, **kwargs):
5b5c9bc7
RD
10315 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10316 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
c1280d1e
RD
10317
10318 def SetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10319 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10320 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10321
10322 def GetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10323 """GetDisabledBitmap(self) -> Bitmap"""
10324 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10325
10326 def SetMarginWidth(*args, **kwargs):
10327 """SetMarginWidth(self, int nWidth)"""
5b5c9bc7 10328 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
c1280d1e
RD
10329
10330 def GetMarginWidth(*args, **kwargs):
10331 """GetMarginWidth(self) -> int"""
5b5c9bc7 10332 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
c1280d1e 10333
d55e5bfc 10334 def GetDefaultMarginWidth(*args, **kwargs):
d6c14a4c 10335 """GetDefaultMarginWidth() -> int"""
5b5c9bc7 10336 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
10337
10338 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10339 def IsOwnerDrawn(*args, **kwargs):
10340 """IsOwnerDrawn(self) -> bool"""
5b5c9bc7 10341 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10342
10343 def SetOwnerDrawn(*args, **kwargs):
10344 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
5b5c9bc7 10345 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10346
10347 def ResetOwnerDrawn(*args, **kwargs):
10348 """ResetOwnerDrawn(self)"""
5b5c9bc7 10349 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
c1280d1e 10350
2131d850 10351_core_.MenuItem_swigregister(MenuItem)
d55e5bfc 10352
5b5c9bc7 10353def MenuItem_GetLabelFromText(*args, **kwargs):
1bd55598
RD
10354 """MenuItem_GetLabelFromText(String text) -> String"""
10355 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 10356
1bd55598
RD
10357def MenuItem_GetDefaultMarginWidth(*args):
10358 """MenuItem_GetDefaultMarginWidth() -> int"""
10359 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d55e5bfc
RD
10360
10361#---------------------------------------------------------------------------
10362
5b5c9bc7 10363class Control(Window):
d55e5bfc
RD
10364 """
10365 This is the base class for a control or 'widget'.
10366
15817c7e
RD
10367 A control is generally a small window which processes user input
10368 and/or displays one or more item of data.
d55e5bfc 10369 """
1bd55598
RD
10370 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10371 __repr__ = _swig_repr
10372 def __init__(self, *args, **kwargs):
d55e5bfc 10373 """
5b5c9bc7
RD
10374 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10375 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10376 String name=ControlNameStr) -> Control
d55e5bfc 10377
15817c7e
RD
10378 Create a Control. Normally you should only call this from a subclass'
10379 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 10380 """
1bd55598 10381 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d55e5bfc
RD
10382 self._setOORInfo(self)
10383
10384 def Create(*args, **kwargs):
10385 """
5b5c9bc7
RD
10386 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10387 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10388 String name=ControlNameStr) -> bool
d55e5bfc
RD
10389
10390 Do the 2nd phase and create the GUI control.
10391 """
5b5c9bc7 10392 return _core_.Control_Create(*args, **kwargs)
d55e5bfc
RD
10393
10394 def Command(*args, **kwargs):
10395 """
5b5c9bc7 10396 Command(self, CommandEvent event)
d55e5bfc 10397
15817c7e
RD
10398 Simulates the effect of the user issuing a command to the item.
10399
10400 :see: `wx.CommandEvent`
10401
d55e5bfc 10402 """
5b5c9bc7 10403 return _core_.Control_Command(*args, **kwargs)
d55e5bfc
RD
10404
10405 def GetLabel(*args, **kwargs):
10406 """
5b5c9bc7 10407 GetLabel(self) -> String
d55e5bfc
RD
10408
10409 Return a control's text.
10410 """
5b5c9bc7 10411 return _core_.Control_GetLabel(*args, **kwargs)
d55e5bfc 10412
d55e5bfc 10413 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0 10414 """
5b5c9bc7 10415 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
10416
10417 Get the default attributes for this class. This is useful if you want
10418 to use the same font or colour in your own control as in a standard
10419 control -- which is a much better idea than hard coding specific
10420 colours or fonts which might look completely out of place on the
10421 user's system, especially if it uses themes.
10422
10423 The variant parameter is only relevant under Mac currently and is
10424 ignore under other platforms. Under Mac, it will change the size of
10425 the returned font. See `wx.Window.SetWindowVariant` for more about
10426 this.
10427 """
5b5c9bc7 10428 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10429
10430 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2131d850 10431_core_.Control_swigregister(Control)
d55e5bfc
RD
10432ControlNameStr = cvar.ControlNameStr
10433
10434def PreControl(*args, **kwargs):
10435 """
5b5c9bc7 10436 PreControl() -> Control
d55e5bfc
RD
10437
10438 Precreate a Control control for 2-phase creation
10439 """
5b5c9bc7 10440 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
10441 return val
10442
5b5c9bc7 10443def Control_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 10444 """
5b5c9bc7 10445 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
10446
10447 Get the default attributes for this class. This is useful if you want
10448 to use the same font or colour in your own control as in a standard
10449 control -- which is a much better idea than hard coding specific
10450 colours or fonts which might look completely out of place on the
10451 user's system, especially if it uses themes.
10452
10453 The variant parameter is only relevant under Mac currently and is
10454 ignore under other platforms. Under Mac, it will change the size of
10455 the returned font. See `wx.Window.SetWindowVariant` for more about
10456 this.
10457 """
1bd55598 10458 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10459
10460#---------------------------------------------------------------------------
10461
5b5c9bc7 10462class ItemContainer(object):
d55e5bfc 10463 """
53aa7709
RD
10464 The wx.ItemContainer class defines an interface which is implemented
10465 by all controls which have string subitems, each of which may be
10466 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10467 as `wx.ComboBox` which implements an extended interface deriving from
15817c7e 10468 this one.
d55e5bfc 10469
15817c7e
RD
10470 It defines the methods for accessing the control's items and although
10471 each of the derived classes implements them differently, they still
10472 all conform to the same interface.
d55e5bfc 10473
15817c7e
RD
10474 The items in a wx.ItemContainer have (non empty) string labels and,
10475 optionally, client data associated with them.
d55e5bfc
RD
10476
10477 """
1bd55598
RD
10478 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10479 def __init__(self): raise AttributeError, "No constructor defined"
10480 __repr__ = _swig_repr
d55e5bfc
RD
10481 def Append(*args, **kwargs):
10482 """
5b5c9bc7 10483 Append(self, String item, PyObject clientData=None) -> int
d55e5bfc 10484
15817c7e
RD
10485 Adds the item to the control, associating the given data with the item
10486 if not None. The return value is the index of the newly added item
10487 which may be different from the last one if the control is sorted (e.g.
10488 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc 10489 """
5b5c9bc7 10490 return _core_.ItemContainer_Append(*args, **kwargs)
d55e5bfc
RD
10491
10492 def AppendItems(*args, **kwargs):
10493 """
f5b96ee1 10494 AppendItems(self, List strings)
d55e5bfc 10495
15817c7e
RD
10496 Apend several items at once to the control. Notice that calling this
10497 method may be much faster than appending the items one by one if you
10498 need to add a lot of items.
d55e5bfc 10499 """
5b5c9bc7 10500 return _core_.ItemContainer_AppendItems(*args, **kwargs)
d55e5bfc
RD
10501
10502 def Insert(*args, **kwargs):
10503 """
50f151d7 10504 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
d55e5bfc 10505
15817c7e 10506 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
10507 optionally associating some data object with the item.
10508 """
5b5c9bc7 10509 return _core_.ItemContainer_Insert(*args, **kwargs)
d55e5bfc
RD
10510
10511 def Clear(*args, **kwargs):
10512 """
10513 Clear(self)
10514
10515 Removes all items from the control.
10516 """
5b5c9bc7 10517 return _core_.ItemContainer_Clear(*args, **kwargs)
d55e5bfc
RD
10518
10519 def Delete(*args, **kwargs):
10520 """
50f151d7 10521 Delete(self, unsigned int n)
d55e5bfc 10522
15817c7e
RD
10523 Deletes the item at the zero-based index 'n' from the control. Note
10524 that it is an error (signalled by a `wx.PyAssertionError` exception if
10525 enabled) to remove an item with the index negative or greater or equal
10526 than the number of items in the control.
d55e5bfc 10527 """
5b5c9bc7 10528 return _core_.ItemContainer_Delete(*args, **kwargs)
d55e5bfc 10529
53aa7709
RD
10530 def GetClientData(*args, **kwargs):
10531 """
50f151d7 10532 GetClientData(self, unsigned int n) -> PyObject
53aa7709
RD
10533
10534 Returns the client data associated with the given item, (if any.)
10535 """
5b5c9bc7 10536 return _core_.ItemContainer_GetClientData(*args, **kwargs)
53aa7709
RD
10537
10538 def SetClientData(*args, **kwargs):
10539 """
50f151d7 10540 SetClientData(self, unsigned int n, PyObject clientData)
53aa7709
RD
10541
10542 Associate the given client data with the item at position n.
10543 """
5b5c9bc7 10544 return _core_.ItemContainer_SetClientData(*args, **kwargs)
53aa7709 10545
d55e5bfc
RD
10546 def GetCount(*args, **kwargs):
10547 """
50f151d7 10548 GetCount(self) -> unsigned int
d55e5bfc
RD
10549
10550 Returns the number of items in the control.
10551 """
5b5c9bc7 10552 return _core_.ItemContainer_GetCount(*args, **kwargs)
d55e5bfc
RD
10553
10554 def IsEmpty(*args, **kwargs):
10555 """
10556 IsEmpty(self) -> bool
10557
10558 Returns True if the control is empty or False if it has some items.
10559 """
5b5c9bc7 10560 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
d55e5bfc
RD
10561
10562 def GetString(*args, **kwargs):
10563 """
50f151d7 10564 GetString(self, unsigned int n) -> String
d55e5bfc
RD
10565
10566 Returns the label of the item with the given index.
10567 """
5b5c9bc7 10568 return _core_.ItemContainer_GetString(*args, **kwargs)
d55e5bfc
RD
10569
10570 def GetStrings(*args, **kwargs):
10571 """GetStrings(self) -> wxArrayString"""
5b5c9bc7 10572 return _core_.ItemContainer_GetStrings(*args, **kwargs)
d55e5bfc
RD
10573
10574 def SetString(*args, **kwargs):
10575 """
50f151d7 10576 SetString(self, unsigned int n, String s)
d55e5bfc
RD
10577
10578 Sets the label for the given item.
10579 """
5b5c9bc7 10580 return _core_.ItemContainer_SetString(*args, **kwargs)
d55e5bfc
RD
10581
10582 def FindString(*args, **kwargs):
10583 """
5b5c9bc7 10584 FindString(self, String s) -> int
d55e5bfc
RD
10585
10586 Finds an item whose label matches the given string. Returns the
15817c7e
RD
10587 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10588 found.
d55e5bfc 10589 """
5b5c9bc7 10590 return _core_.ItemContainer_FindString(*args, **kwargs)
d55e5bfc 10591
53aa7709 10592 def SetSelection(*args, **kwargs):
d55e5bfc 10593 """
53aa7709 10594 SetSelection(self, int n)
d55e5bfc
RD
10595
10596 Sets the item at index 'n' to be the selected item.
10597 """
5b5c9bc7 10598 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 10599
d55e5bfc
RD
10600 def GetSelection(*args, **kwargs):
10601 """
10602 GetSelection(self) -> int
10603
15817c7e
RD
10604 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10605 is selected.
d55e5bfc 10606 """
5b5c9bc7 10607 return _core_.ItemContainer_GetSelection(*args, **kwargs)
d55e5bfc 10608
53aa7709 10609 def SetStringSelection(*args, **kwargs):
5b5c9bc7
RD
10610 """SetStringSelection(self, String s) -> bool"""
10611 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
53aa7709 10612
d55e5bfc
RD
10613 def GetStringSelection(*args, **kwargs):
10614 """
5b5c9bc7 10615 GetStringSelection(self) -> String
d55e5bfc 10616
15817c7e
RD
10617 Returns the label of the selected item or an empty string if no item
10618 is selected.
d55e5bfc 10619 """
5b5c9bc7 10620 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
d55e5bfc 10621
53aa7709 10622 def Select(*args, **kwargs):
d55e5bfc 10623 """
53aa7709 10624 Select(self, int n)
d55e5bfc 10625
53aa7709
RD
10626 This is the same as `SetSelection` and exists only because it is
10627 slightly more natural for controls which support multiple selection.
d55e5bfc 10628 """
5b5c9bc7 10629 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc 10630
2131d850 10631_core_.ItemContainer_swigregister(ItemContainer)
d55e5bfc
RD
10632
10633#---------------------------------------------------------------------------
10634
5b5c9bc7 10635class ControlWithItems(Control,ItemContainer):
d55e5bfc 10636 """
15817c7e
RD
10637 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10638 wx.Control class, and is used for the base class of various controls
10639 that have items.
d55e5bfc 10640 """
1bd55598
RD
10641 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10642 def __init__(self): raise AttributeError, "No constructor defined"
10643 __repr__ = _swig_repr
2131d850 10644_core_.ControlWithItems_swigregister(ControlWithItems)
d55e5bfc
RD
10645
10646#---------------------------------------------------------------------------
10647
5b5c9bc7 10648class SizerItem(Object):
bfddbb17
RD
10649 """
10650 The wx.SizerItem class is used to track the position, size and other
2131d850
RD
10651 attributes of each item managed by a `wx.Sizer`. It is not usually
10652 necessary to use this class because the sizer elements can also be
10653 identified by their positions or window or sizer references but
10654 sometimes it may be more convenient to use wx.SizerItem directly.
10655 Also, custom classes derived from `wx.PySizer` will probably need to
10656 use the collection of wx.SizerItems held by wx.Sizer when calculating
10657 layout.
bfddbb17
RD
10658
10659 :see: `wx.Sizer`, `wx.GBSizerItem`
10660 """
1bd55598
RD
10661 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10662 __repr__ = _swig_repr
10663 def __init__(self, *args, **kwargs):
bfddbb17 10664 """
5b5c9bc7 10665 __init__(self) -> SizerItem
bfddbb17
RD
10666
10667 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10668 size will need to be set before this item can be used in a Sizer.
10669
10670 You will probably never need to create a wx.SizerItem directly as they
10671 are created automatically when the sizer's Add, Insert or Prepend
10672 methods are called.
10673
10674 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10675 """
1bd55598
RD
10676 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10677 __swig_destroy__ = _core_.delete_SizerItem
10678 __del__ = lambda self : None;
d55e5bfc 10679 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
10680 """
10681 DeleteWindows(self)
10682
10683 Destroy the window or the windows in a subsizer, depending on the type
10684 of item.
10685 """
5b5c9bc7 10686 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
10687
10688 def DetachSizer(*args, **kwargs):
bfddbb17
RD
10689 """
10690 DetachSizer(self)
10691
10692 Enable deleting the SizerItem without destroying the contained sizer.
10693 """
5b5c9bc7 10694 return _core_.SizerItem_DetachSizer(*args, **kwargs)
d55e5bfc
RD
10695
10696 def GetSize(*args, **kwargs):
bfddbb17 10697 """
5b5c9bc7 10698 GetSize(self) -> Size
bfddbb17
RD
10699
10700 Get the current size of the item, as set in the last Layout.
10701 """
5b5c9bc7 10702 return _core_.SizerItem_GetSize(*args, **kwargs)
d55e5bfc
RD
10703
10704 def CalcMin(*args, **kwargs):
bfddbb17 10705 """
5b5c9bc7 10706 CalcMin(self) -> Size
bfddbb17
RD
10707
10708 Calculates the minimum desired size for the item, including any space
10709 needed by borders.
10710 """
5b5c9bc7 10711 return _core_.SizerItem_CalcMin(*args, **kwargs)
d55e5bfc
RD
10712
10713 def SetDimension(*args, **kwargs):
bfddbb17 10714 """
5b5c9bc7 10715 SetDimension(self, Point pos, Size size)
bfddbb17
RD
10716
10717 Set the position and size of the space allocated for this item by the
10718 sizer, and adjust the position and size of the item (window or
10719 subsizer) to be within that space taking alignment and borders into
10720 account.
10721 """
5b5c9bc7 10722 return _core_.SizerItem_SetDimension(*args, **kwargs)
d55e5bfc
RD
10723
10724 def GetMinSize(*args, **kwargs):
bfddbb17 10725 """
5b5c9bc7 10726 GetMinSize(self) -> Size
bfddbb17
RD
10727
10728 Get the minimum size needed for the item.
10729 """
5b5c9bc7 10730 return _core_.SizerItem_GetMinSize(*args, **kwargs)
d55e5bfc 10731
a001823c
RD
10732 def GetMinSizeWithBorder(*args, **kwargs):
10733 """
5b5c9bc7 10734 GetMinSizeWithBorder(self) -> Size
a001823c
RD
10735
10736 Get the minimum size needed for the item with space for the borders
10737 added, if needed.
10738 """
5b5c9bc7 10739 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
a001823c 10740
d55e5bfc
RD
10741 def SetInitSize(*args, **kwargs):
10742 """SetInitSize(self, int x, int y)"""
5b5c9bc7 10743 return _core_.SizerItem_SetInitSize(*args, **kwargs)
d55e5bfc
RD
10744
10745 def SetRatioWH(*args, **kwargs):
bfddbb17
RD
10746 """
10747 SetRatioWH(self, int width, int height)
10748
10749 Set the ratio item attribute.
10750 """
5b5c9bc7 10751 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
d55e5bfc
RD
10752
10753 def SetRatioSize(*args, **kwargs):
bfddbb17 10754 """
5b5c9bc7 10755 SetRatioSize(self, Size size)
bfddbb17
RD
10756
10757 Set the ratio item attribute.
10758 """
5b5c9bc7 10759 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
d55e5bfc
RD
10760
10761 def SetRatio(*args, **kwargs):
bfddbb17
RD
10762 """
10763 SetRatio(self, float ratio)
10764
10765 Set the ratio item attribute.
10766 """
5b5c9bc7 10767 return _core_.SizerItem_SetRatio(*args, **kwargs)
d55e5bfc
RD
10768
10769 def GetRatio(*args, **kwargs):
bfddbb17
RD
10770 """
10771 GetRatio(self) -> float
10772
10773 Set the ratio item attribute.
10774 """
5b5c9bc7 10775 return _core_.SizerItem_GetRatio(*args, **kwargs)
d55e5bfc 10776
070c48b4
RD
10777 def GetRect(*args, **kwargs):
10778 """
5b5c9bc7 10779 GetRect(self) -> Rect
070c48b4
RD
10780
10781 Returns the rectangle that the sizer item should occupy
10782 """
5b5c9bc7 10783 return _core_.SizerItem_GetRect(*args, **kwargs)
070c48b4 10784
d55e5bfc 10785 def IsWindow(*args, **kwargs):
bfddbb17
RD
10786 """
10787 IsWindow(self) -> bool
10788
10789 Is this sizer item a window?
10790 """
5b5c9bc7 10791 return _core_.SizerItem_IsWindow(*args, **kwargs)
d55e5bfc
RD
10792
10793 def IsSizer(*args, **kwargs):
bfddbb17
RD
10794 """
10795 IsSizer(self) -> bool
10796
10797 Is this sizer item a subsizer?
10798 """
5b5c9bc7 10799 return _core_.SizerItem_IsSizer(*args, **kwargs)
d55e5bfc
RD
10800
10801 def IsSpacer(*args, **kwargs):
bfddbb17
RD
10802 """
10803 IsSpacer(self) -> bool
10804
10805 Is this sizer item a spacer?
10806 """
5b5c9bc7 10807 return _core_.SizerItem_IsSpacer(*args, **kwargs)
d55e5bfc
RD
10808
10809 def SetProportion(*args, **kwargs):
bfddbb17
RD
10810 """
10811 SetProportion(self, int proportion)
10812
10813 Set the proportion value for this item.
10814 """
5b5c9bc7 10815 return _core_.SizerItem_SetProportion(*args, **kwargs)
d55e5bfc
RD
10816
10817 def GetProportion(*args, **kwargs):
bfddbb17
RD
10818 """
10819 GetProportion(self) -> int
10820
10821 Get the proportion value for this item.
10822 """
5b5c9bc7 10823 return _core_.SizerItem_GetProportion(*args, **kwargs)
d55e5bfc 10824
bfddbb17
RD
10825 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10826 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 10827 def SetFlag(*args, **kwargs):
bfddbb17
RD
10828 """
10829 SetFlag(self, int flag)
10830
10831 Set the flag value for this item.
10832 """
5b5c9bc7 10833 return _core_.SizerItem_SetFlag(*args, **kwargs)
d55e5bfc
RD
10834
10835 def GetFlag(*args, **kwargs):
bfddbb17
RD
10836 """
10837 GetFlag(self) -> int
10838
10839 Get the flag value for this item.
10840 """
5b5c9bc7 10841 return _core_.SizerItem_GetFlag(*args, **kwargs)
d55e5bfc
RD
10842
10843 def SetBorder(*args, **kwargs):
bfddbb17
RD
10844 """
10845 SetBorder(self, int border)
10846
10847 Set the border value for this item.
10848 """
5b5c9bc7 10849 return _core_.SizerItem_SetBorder(*args, **kwargs)
d55e5bfc
RD
10850
10851 def GetBorder(*args, **kwargs):
bfddbb17
RD
10852 """
10853 GetBorder(self) -> int
10854
10855 Get the border value for this item.
10856 """
5b5c9bc7 10857 return _core_.SizerItem_GetBorder(*args, **kwargs)
d55e5bfc
RD
10858
10859 def GetWindow(*args, **kwargs):
bfddbb17 10860 """
5b5c9bc7 10861 GetWindow(self) -> Window
bfddbb17
RD
10862
10863 Get the window (if any) that is managed by this sizer item.
10864 """
5b5c9bc7 10865 return _core_.SizerItem_GetWindow(*args, **kwargs)
d55e5bfc
RD
10866
10867 def SetWindow(*args, **kwargs):
bfddbb17 10868 """
5b5c9bc7 10869 SetWindow(self, Window window)
bfddbb17
RD
10870
10871 Set the window to be managed by this sizer item.
10872 """
5b5c9bc7 10873 return _core_.SizerItem_SetWindow(*args, **kwargs)
d55e5bfc
RD
10874
10875 def GetSizer(*args, **kwargs):
bfddbb17 10876 """
5b5c9bc7 10877 GetSizer(self) -> Sizer
bfddbb17
RD
10878
10879 Get the subsizer (if any) that is managed by this sizer item.
10880 """
5b5c9bc7 10881 return _core_.SizerItem_GetSizer(*args, **kwargs)
d55e5bfc
RD
10882
10883 def SetSizer(*args, **kwargs):
bfddbb17 10884 """
5b5c9bc7 10885 SetSizer(self, Sizer sizer)
bfddbb17
RD
10886
10887 Set the subsizer to be managed by this sizer item.
10888 """
5b5c9bc7 10889 return _core_.SizerItem_SetSizer(*args, **kwargs)
d55e5bfc
RD
10890
10891 def GetSpacer(*args, **kwargs):
bfddbb17 10892 """
5b5c9bc7 10893 GetSpacer(self) -> Size
bfddbb17
RD
10894
10895 Get the size of the spacer managed by this sizer item.
10896 """
5b5c9bc7 10897 return _core_.SizerItem_GetSpacer(*args, **kwargs)
d55e5bfc
RD
10898
10899 def SetSpacer(*args, **kwargs):
bfddbb17 10900 """
5b5c9bc7 10901 SetSpacer(self, Size size)
bfddbb17
RD
10902
10903 Set the size of the spacer to be managed by this sizer item.
10904 """
5b5c9bc7 10905 return _core_.SizerItem_SetSpacer(*args, **kwargs)
d55e5bfc
RD
10906
10907 def Show(*args, **kwargs):
bfddbb17
RD
10908 """
10909 Show(self, bool show)
10910
10911 Set the show item attribute, which sizers use to determine if the item
10912 is to be made part of the layout or not. If the item is tracking a
10913 window then it is shown or hidden as needed.
10914 """
5b5c9bc7 10915 return _core_.SizerItem_Show(*args, **kwargs)
d55e5bfc
RD
10916
10917 def IsShown(*args, **kwargs):
bfddbb17
RD
10918 """
10919 IsShown(self) -> bool
10920
10921 Is the item to be shown in the layout?
10922 """
5b5c9bc7 10923 return _core_.SizerItem_IsShown(*args, **kwargs)
d55e5bfc
RD
10924
10925 def GetPosition(*args, **kwargs):
bfddbb17 10926 """
5b5c9bc7 10927 GetPosition(self) -> Point
bfddbb17
RD
10928
10929 Returns the current position of the item, as set in the last Layout.
10930 """
5b5c9bc7 10931 return _core_.SizerItem_GetPosition(*args, **kwargs)
d55e5bfc
RD
10932
10933 def GetUserData(*args, **kwargs):
bfddbb17
RD
10934 """
10935 GetUserData(self) -> PyObject
10936
10937 Returns the userData associated with this sizer item, or None if there
10938 isn't any.
10939 """
5b5c9bc7 10940 return _core_.SizerItem_GetUserData(*args, **kwargs)
d55e5bfc 10941
32fe5131
RD
10942 def SetUserData(*args, **kwargs):
10943 """
10944 SetUserData(self, PyObject userData)
10945
10946 Associate a Python object with this sizer item.
10947 """
10948 return _core_.SizerItem_SetUserData(*args, **kwargs)
10949
2131d850 10950_core_.SizerItem_swigregister(SizerItem)
d55e5bfc 10951
bfddbb17 10952def SizerItemWindow(*args, **kwargs):
d55e5bfc 10953 """
5b5c9bc7
RD
10954 SizerItemWindow(Window window, int proportion, int flag, int border,
10955 PyObject userData=None) -> SizerItem
bfddbb17
RD
10956
10957 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 10958 """
5b5c9bc7 10959 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
10960 return val
10961
bfddbb17 10962def SizerItemSpacer(*args, **kwargs):
d55e5bfc 10963 """
bfddbb17 10964 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
5b5c9bc7 10965 PyObject userData=None) -> SizerItem
bfddbb17
RD
10966
10967 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 10968 """
5b5c9bc7 10969 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
10970 return val
10971
10972def SizerItemSizer(*args, **kwargs):
10973 """
5b5c9bc7
RD
10974 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
10975 PyObject userData=None) -> SizerItem
bfddbb17
RD
10976
10977 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc 10978 """
5b5c9bc7 10979 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
10980 return val
10981
5b5c9bc7 10982class Sizer(Object):
bfddbb17
RD
10983 """
10984 wx.Sizer is the abstract base class used for laying out subwindows in
10985 a window. You cannot use wx.Sizer directly; instead, you will have to
10986 use one of the sizer classes derived from it such as `wx.BoxSizer`,
10987 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
10988 and `wx.GridBagSizer`.
10989
10990 The concept implemented by sizers in wxWidgets is closely related to
10991 layout tools in other GUI toolkits, such as Java's AWT, the GTK
10992 toolkit or the Qt toolkit. It is based upon the idea of the individual
10993 subwindows reporting their minimal required size and their ability to
10994 get stretched if the size of the parent window has changed. This will
10995 most often mean that the programmer does not set the original size of
10996 a dialog in the beginning, rather the dialog will assigned a sizer and
10997 this sizer will be queried about the recommended size. The sizer in
10998 turn will query its children, which can be normal windows or contorls,
10999 empty space or other sizers, so that a hierarchy of sizers can be
11000 constructed. Note that wxSizer does not derive from wxWindow and thus
11001 do not interfere with tab ordering and requires very little resources
11002 compared to a real window on screen.
11003
11004 What makes sizers so well fitted for use in wxWidgets is the fact that
11005 every control reports its own minimal size and the algorithm can
11006 handle differences in font sizes or different window (dialog item)
11007 sizes on different platforms without problems. If for example the
11008 standard font as well as the overall design of Mac widgets requires
11009 more space than on Windows, then the initial size of a dialog using a
11010 sizer will automatically be bigger on Mac than on Windows.
11011 """
1bd55598
RD
11012 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11013 def __init__(self): raise AttributeError, "No constructor defined"
11014 __repr__ = _swig_repr
11015 __swig_destroy__ = _core_.delete_Sizer
11016 __del__ = lambda self : None;
d55e5bfc
RD
11017 def _setOORInfo(*args, **kwargs):
11018 """_setOORInfo(self, PyObject _self)"""
5b5c9bc7 11019 return _core_.Sizer__setOORInfo(*args, **kwargs)
d55e5bfc
RD
11020
11021 def Add(*args, **kwargs):
11022 """
bfddbb17 11023 Add(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11024 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11025
11026 Appends a child item to the sizer.
d55e5bfc 11027 """
5b5c9bc7 11028 return _core_.Sizer_Add(*args, **kwargs)
d55e5bfc
RD
11029
11030 def Insert(*args, **kwargs):
11031 """
bfddbb17 11032 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
070c48b4 11033 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11034
11035 Inserts a new item into the list of items managed by this sizer before
11036 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc 11037 """
5b5c9bc7 11038 return _core_.Sizer_Insert(*args, **kwargs)
d55e5bfc
RD
11039
11040 def Prepend(*args, **kwargs):
11041 """
bfddbb17 11042 Prepend(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11043 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11044
11045 Adds a new item to the begining of the list of sizer items managed by
11046 this sizer. See `Add` for a description of the parameters.
d55e5bfc 11047 """
5b5c9bc7 11048 return _core_.Sizer_Prepend(*args, **kwargs)
d55e5bfc
RD
11049
11050 def Remove(*args, **kwargs):
bfddbb17
RD
11051 """
11052 Remove(self, item) -> bool
11053
11054 Removes an item from the sizer and destroys it. This method does not
11055 cause any layout or resizing to take place, call `Layout` to update
11056 the layout on screen after removing a child from the sizer. The
11057 *item* parameter can be either a window, a sizer, or the zero-based
11058 index of an item to remove. Returns True if the child item was found
11059 and removed.
11060 """
5b5c9bc7 11061 return _core_.Sizer_Remove(*args, **kwargs)
d55e5bfc 11062
1a6bba1e 11063 def Detach(*args, **kwargs):
bfddbb17
RD
11064 """
11065 Detach(self, item) -> bool
11066
11067 Detaches an item from the sizer without destroying it. This method
11068 does not cause any layout or resizing to take place, call `Layout` to
11069 do so. The *item* parameter can be either a window, a sizer, or the
11070 zero-based index of the item to be detached. Returns True if the child item
11071 was found and detached.
11072 """
5b5c9bc7 11073 return _core_.Sizer_Detach(*args, **kwargs)
1a6bba1e 11074
070c48b4
RD
11075 def GetItem(*args, **kwargs):
11076 """
11077 GetItem(self, item) -> wx.SizerItem
11078
11079 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11080 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11081 the item to be found.
070c48b4 11082 """
5b5c9bc7 11083 return _core_.Sizer_GetItem(*args, **kwargs)
070c48b4 11084
d55e5bfc 11085 def _SetItemMinSize(*args, **kwargs):
5b5c9bc7
RD
11086 """_SetItemMinSize(self, PyObject item, Size size)"""
11087 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
d55e5bfc 11088
bfddbb17
RD
11089 def SetItemMinSize(self, item, *args):
11090 """
11091 SetItemMinSize(self, item, Size size)
11092
11093 Sets the minimum size that will be allocated for an item in the sizer.
11094 The *item* parameter can be either a window, a sizer, or the
11095 zero-based index of the item. If a window or sizer is given then it
11096 will be searched for recursivly in subsizers if neccessary.
11097 """
11098 if len(args) == 2:
11099 # for backward compatibility accept separate width,height args too
11100 return self._SetItemMinSize(item, args)
11101 else:
11102 return self._SetItemMinSize(item, args[0])
11103
d55e5bfc 11104 def AddItem(*args, **kwargs):
bfddbb17
RD
11105 """
11106 AddItem(self, SizerItem item)
11107
11108 Adds a `wx.SizerItem` to the sizer.
11109 """
5b5c9bc7 11110 return _core_.Sizer_AddItem(*args, **kwargs)
d55e5bfc
RD
11111
11112 def InsertItem(*args, **kwargs):
bfddbb17
RD
11113 """
11114 InsertItem(self, int index, SizerItem item)
11115
11116 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11117 """
5b5c9bc7 11118 return _core_.Sizer_InsertItem(*args, **kwargs)
d55e5bfc
RD
11119
11120 def PrependItem(*args, **kwargs):
bfddbb17
RD
11121 """
11122 PrependItem(self, SizerItem item)
11123
11124 Prepends a `wx.SizerItem` to the sizer.
11125 """
5b5c9bc7 11126 return _core_.Sizer_PrependItem(*args, **kwargs)
d55e5bfc 11127
bfddbb17 11128 def AddMany(self, items):
d6c14a4c
RD
11129 """
11130 AddMany is a convenience method for adding several items
11131 to a sizer at one time. Simply pass it a list of tuples,
11132 where each tuple consists of the parameters that you
11133 would normally pass to the `Add` method.
11134 """
bfddbb17
RD
11135 for item in items:
11136 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11137 item = (item, )
11138 self.Add(*item)
d55e5bfc
RD
11139
11140 # for backwards compatibility only, please do not use in new code
7fbf8399
RD
11141 def AddWindow(self, *args, **kw):
11142 """Compatibility alias for `Add`."""
11143 return self.Add(*args, **kw)
11144 def AddSizer(self, *args, **kw):
11145 """Compatibility alias for `Add`."""
11146 return self.Add(*args, **kw)
11147 def AddSpacer(self, *args, **kw):
11148 """Compatibility alias for `Add`."""
11149 return self.Add(*args, **kw)
11150
11151 def PrependWindow(self, *args, **kw):
11152 """Compatibility alias for `Prepend`."""
11153 return self.Prepend(*args, **kw)
11154 def PrependSizer(self, *args, **kw):
11155 """Compatibility alias for `Prepend`."""
11156 return self.Prepend(*args, **kw)
11157 def PrependSpacer(self, *args, **kw):
11158 """Compatibility alias for `Prepend`."""
11159 return self.Prepend(*args, **kw)
11160
11161 def InsertWindow(self, *args, **kw):
11162 """Compatibility alias for `Insert`."""
11163 return self.Insert(*args, **kw)
11164 def InsertSizer(self, *args, **kw):
11165 """Compatibility alias for `Insert`."""
11166 return self.Insert(*args, **kw)
11167 def InsertSpacer(self, *args, **kw):
11168 """Compatibility alias for `Insert`."""
11169 return self.Insert(*args, **kw)
11170
11171 def RemoveWindow(self, *args, **kw):
11172 """Compatibility alias for `Remove`."""
11173 return self.Remove(*args, **kw)
11174 def RemoveSizer(self, *args, **kw):
11175 """Compatibility alias for `Remove`."""
11176 return self.Remove(*args, **kw)
11177 def RemovePos(self, *args, **kw):
11178 """Compatibility alias for `Remove`."""
11179 return self.Remove(*args, **kw)
d55e5bfc
RD
11180
11181
d55e5bfc 11182 def SetDimension(*args, **kwargs):
bfddbb17
RD
11183 """
11184 SetDimension(self, int x, int y, int width, int height)
11185
11186 Call this to force the sizer to take the given dimension and thus
11187 force the items owned by the sizer to resize themselves according to
11188 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11189 methods.
11190 """
5b5c9bc7 11191 return _core_.Sizer_SetDimension(*args, **kwargs)
d55e5bfc
RD
11192
11193 def SetMinSize(*args, **kwargs):
bfddbb17 11194 """
5b5c9bc7 11195 SetMinSize(self, Size size)
bfddbb17
RD
11196
11197 Call this to give the sizer a minimal size. Normally, the sizer will
11198 calculate its minimal size based purely on how much space its children
11199 need. After calling this method `GetMinSize` will return either the
11200 minimal size as requested by its children or the minimal size set
11201 here, depending on which is bigger.
11202 """
5b5c9bc7 11203 return _core_.Sizer_SetMinSize(*args, **kwargs)
d55e5bfc
RD
11204
11205 def GetSize(*args, **kwargs):
bfddbb17 11206 """
5b5c9bc7 11207 GetSize(self) -> Size
bfddbb17
RD
11208
11209 Returns the current size of the space managed by the sizer.
11210 """
5b5c9bc7 11211 return _core_.Sizer_GetSize(*args, **kwargs)
d55e5bfc
RD
11212
11213 def GetPosition(*args, **kwargs):
bfddbb17 11214 """
5b5c9bc7 11215 GetPosition(self) -> Point
bfddbb17
RD
11216
11217 Returns the current position of the sizer's managed space.
11218 """
5b5c9bc7 11219 return _core_.Sizer_GetPosition(*args, **kwargs)
d55e5bfc
RD
11220
11221 def GetMinSize(*args, **kwargs):
bfddbb17 11222 """
5b5c9bc7 11223 GetMinSize(self) -> Size
bfddbb17
RD
11224
11225 Returns the minimal size of the sizer. This is either the combined
11226 minimal size of all the children and their borders or the minimal size
11227 set by SetMinSize, depending on which is bigger.
11228 """
5b5c9bc7 11229 return _core_.Sizer_GetMinSize(*args, **kwargs)
d55e5bfc
RD
11230
11231 def GetSizeTuple(self):
1a6bba1e 11232 return self.GetSize().Get()
d55e5bfc 11233 def GetPositionTuple(self):
1a6bba1e 11234 return self.GetPosition().Get()
d55e5bfc 11235 def GetMinSizeTuple(self):
1a6bba1e 11236 return self.GetMinSize().Get()
d55e5bfc
RD
11237
11238 def RecalcSizes(*args, **kwargs):
bfddbb17
RD
11239 """
11240 RecalcSizes(self)
11241
11242 Using the sizes calculated by `CalcMin` reposition and resize all the
11243 items managed by this sizer. You should not need to call this directly as
11244 it is called by `Layout`.
11245 """
5b5c9bc7 11246 return _core_.Sizer_RecalcSizes(*args, **kwargs)
d55e5bfc
RD
11247
11248 def CalcMin(*args, **kwargs):
bfddbb17 11249 """
5b5c9bc7 11250 CalcMin(self) -> Size
bfddbb17
RD
11251
11252 This method is where the sizer will do the actual calculation of its
11253 children's minimal sizes. You should not need to call this directly as
11254 it is called by `Layout`.
11255 """
5b5c9bc7 11256 return _core_.Sizer_CalcMin(*args, **kwargs)
d55e5bfc
RD
11257
11258 def Layout(*args, **kwargs):
bfddbb17
RD
11259 """
11260 Layout(self)
11261
11262 This method will force the recalculation and layout of the items
11263 controlled by the sizer using the current space allocated to the
11264 sizer. Normally this is called automatically from the owning window's
11265 EVT_SIZE handler, but it is also useful to call it from user code when
11266 one of the items in a sizer change size, or items are added or
11267 removed.
11268 """
5b5c9bc7 11269 return _core_.Sizer_Layout(*args, **kwargs)
d55e5bfc
RD
11270
11271 def Fit(*args, **kwargs):
bfddbb17 11272 """
5b5c9bc7 11273 Fit(self, Window window) -> Size
bfddbb17
RD
11274
11275 Tell the sizer to resize the *window* to match the sizer's minimal
11276 size. This is commonly done in the constructor of the window itself in
11277 order to set its initial size to match the needs of the children as
11278 determined by the sizer. Returns the new size.
11279
11280 For a top level window this is the total window size, not the client size.
11281 """
5b5c9bc7 11282 return _core_.Sizer_Fit(*args, **kwargs)
d55e5bfc
RD
11283
11284 def FitInside(*args, **kwargs):
bfddbb17 11285 """
5b5c9bc7 11286 FitInside(self, Window window)
bfddbb17
RD
11287
11288 Tell the sizer to resize the *virtual size* of the *window* to match the
11289 sizer's minimal size. This will not alter the on screen size of the
11290 window, but may cause the addition/removal/alteration of scrollbars
11291 required to view the virtual area in windows which manage it.
11292
11293 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11294
11295 """
5b5c9bc7 11296 return _core_.Sizer_FitInside(*args, **kwargs)
d55e5bfc
RD
11297
11298 def SetSizeHints(*args, **kwargs):
bfddbb17 11299 """
5b5c9bc7 11300 SetSizeHints(self, Window window)
bfddbb17
RD
11301
11302 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11303 match the sizer's minimal size. This is commonly done in the
11304 constructor of the window itself if the window is resizable (as are
11305 many dialogs under Unix and frames on probably all platforms) in order
11306 to prevent the window from being sized smaller than the minimal size
11307 required by the sizer.
11308 """
5b5c9bc7 11309 return _core_.Sizer_SetSizeHints(*args, **kwargs)
d55e5bfc
RD
11310
11311 def SetVirtualSizeHints(*args, **kwargs):
bfddbb17 11312 """
5b5c9bc7 11313 SetVirtualSizeHints(self, Window window)
bfddbb17
RD
11314
11315 Tell the sizer to set the minimal size of the window virtual area to
11316 match the sizer's minimal size. For windows with managed scrollbars
11317 this will set them appropriately.
11318
11319 :see: `wx.ScrolledWindow.SetScrollbars`
11320
11321 """
5b5c9bc7 11322 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
d55e5bfc
RD
11323
11324 def Clear(*args, **kwargs):
bfddbb17
RD
11325 """
11326 Clear(self, bool deleteWindows=False)
11327
11328 Clear all items from the sizer, optionally destroying the window items
11329 as well.
11330 """
5b5c9bc7 11331 return _core_.Sizer_Clear(*args, **kwargs)
d55e5bfc
RD
11332
11333 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
11334 """
11335 DeleteWindows(self)
11336
11337 Destroy all windows managed by the sizer.
11338 """
5b5c9bc7 11339 return _core_.Sizer_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
11340
11341 def GetChildren(*args, **kwargs):
bfddbb17 11342 """
51b83b37 11343 GetChildren(self) -> list
bfddbb17
RD
11344
11345 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11346 """
5b5c9bc7 11347 return _core_.Sizer_GetChildren(*args, **kwargs)
d55e5bfc
RD
11348
11349 def Show(*args, **kwargs):
bfddbb17 11350 """
b411df4a 11351 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 11352
bfddbb17
RD
11353 Shows or hides an item managed by the sizer. To make a sizer item
11354 disappear or reappear, use Show followed by `Layout`. The *item*
11355 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
11356 the item. Use the recursive parameter to show or hide an item in a
11357 subsizer. Returns True if the item was found.
bfddbb17 11358 """
5b5c9bc7 11359 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
11360
11361 def IsShown(*args, **kwargs):
bfddbb17
RD
11362 """
11363 IsShown(self, item)
11364
b1fcee84 11365 Determines if the item is currently shown. To make a sizer
bfddbb17
RD
11366 item disappear or reappear, use Show followed by `Layout`. The *item*
11367 parameter can be either a window, a sizer, or the zero-based index of
11368 the item.
11369 """
5b5c9bc7 11370 return _core_.Sizer_IsShown(*args, **kwargs)
d55e5bfc 11371
629e65c2 11372 def Hide(self, item, recursive=False):
bfddbb17 11373 """
27fb7603 11374 A convenience method for `Show` (item, False, recursive).
bfddbb17 11375 """
06759a38 11376 return self.Show(item, False, recursive)
bfddbb17 11377
d55e5bfc 11378 def ShowItems(*args, **kwargs):
bfddbb17
RD
11379 """
11380 ShowItems(self, bool show)
11381
84f85550 11382 Recursively call `wx.SizerItem.Show` on all sizer items.
bfddbb17 11383 """
5b5c9bc7 11384 return _core_.Sizer_ShowItems(*args, **kwargs)
d55e5bfc 11385
2131d850 11386_core_.Sizer_swigregister(Sizer)
d55e5bfc 11387
5b5c9bc7 11388class PySizer(Sizer):
bfddbb17
RD
11389 """
11390 wx.PySizer is a special version of `wx.Sizer` that has been
11391 instrumented to allow the C++ virtual methods to be overloaded in
11392 Python derived classes. You would derive from this class if you are
11393 wanting to implement a custom sizer in Python code. Simply implement
11394 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11395 For example::
11396
11397 class MySizer(wx.PySizer):
11398 def __init__(self):
11399 wx.PySizer.__init__(self)
11400
11401 def CalcMin(self):
11402 for item in self.GetChildren():
11403 # calculate the total minimum width and height needed
11404 # by all items in the sizer according to this sizer's
11405 # layout algorithm.
11406 ...
11407 return wx.Size(width, height)
11408
11409 def RecalcSizes(self):
11410 # find the space allotted to this sizer
11411 pos = self.GetPosition()
11412 size = self.GetSize()
11413 for item in self.GetChildren():
11414 # Recalculate (if necessary) the position and size of
11415 # each item and then call item.SetDimension to do the
11416 # actual positioning and sizing of the items within the
11417 # space alloted to this sizer.
11418 ...
11419 item.SetDimension(itemPos, itemSize)
11420
11421
11422 When `Layout` is called it first calls `CalcMin` followed by
11423 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 11424 `CalcMin` and reusing them in `RecalcSizes`.
bfddbb17
RD
11425
11426 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11427
11428
11429 """
1bd55598
RD
11430 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11431 __repr__ = _swig_repr
11432 def __init__(self, *args, **kwargs):
bfddbb17 11433 """
5b5c9bc7 11434 __init__(self) -> PySizer
bfddbb17
RD
11435
11436 Creates a wx.PySizer. Must be called from the __init__ in the derived
11437 class.
11438 """
1bd55598 11439 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
d55e5bfc
RD
11440 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11441
11442 def _setCallbackInfo(*args, **kwargs):
11443 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 11444 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
d55e5bfc 11445
2131d850 11446_core_.PySizer_swigregister(PySizer)
d55e5bfc
RD
11447
11448#---------------------------------------------------------------------------
11449
5b5c9bc7 11450class BoxSizer(Sizer):
bfddbb17
RD
11451 """
11452 The basic idea behind a box sizer is that windows will most often be
11453 laid out in rather simple basic geometry, typically in a row or a
11454 column or nested hierarchies of either. A wx.BoxSizer will lay out
11455 its items in a simple row or column, depending on the orientation
11456 parameter passed to the constructor.
11457 """
1bd55598
RD
11458 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11459 __repr__ = _swig_repr
11460 def __init__(self, *args, **kwargs):
bfddbb17 11461 """
5b5c9bc7 11462 __init__(self, int orient=HORIZONTAL) -> BoxSizer
bfddbb17
RD
11463
11464 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11465 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11466 sizer.
11467 """
1bd55598 11468 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d55e5bfc
RD
11469 self._setOORInfo(self)
11470
11471 def GetOrientation(*args, **kwargs):
bfddbb17
RD
11472 """
11473 GetOrientation(self) -> int
11474
11475 Returns the current orientation of the sizer.
11476 """
5b5c9bc7 11477 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
d55e5bfc
RD
11478
11479 def SetOrientation(*args, **kwargs):
bfddbb17
RD
11480 """
11481 SetOrientation(self, int orient)
d55e5bfc 11482
bfddbb17
RD
11483 Resets the orientation of the sizer.
11484 """
5b5c9bc7 11485 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc 11486
2131d850 11487_core_.BoxSizer_swigregister(BoxSizer)
d55e5bfc
RD
11488
11489#---------------------------------------------------------------------------
11490
5b5c9bc7 11491class StaticBoxSizer(BoxSizer):
bfddbb17
RD
11492 """
11493 wx.StaticBoxSizer derives from and functions identically to the
11494 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11495 manages. Note that this static box must be created separately and
11496 passed to the sizer constructor.
11497 """
1bd55598
RD
11498 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11499 __repr__ = _swig_repr
11500 def __init__(self, *args, **kwargs):
bfddbb17 11501 """
5b5c9bc7 11502 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
bfddbb17
RD
11503
11504 Constructor. It takes an associated static box and the orientation
11505 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11506 ``wx.HORIZONTAL``.
11507 """
1bd55598 11508 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d55e5bfc
RD
11509 self._setOORInfo(self)
11510
11511 def GetStaticBox(*args, **kwargs):
bfddbb17 11512 """
5b5c9bc7 11513 GetStaticBox(self) -> StaticBox
d55e5bfc 11514
bfddbb17
RD
11515 Returns the static box associated with this sizer.
11516 """
5b5c9bc7 11517 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc 11518
2131d850 11519_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d55e5bfc
RD
11520
11521#---------------------------------------------------------------------------
11522
5b5c9bc7 11523class GridSizer(Sizer):
bfddbb17
RD
11524 """
11525 A grid sizer is a sizer which lays out its children in a
11526 two-dimensional table with all cells having the same size. In other
11527 words, the width of each cell within the grid is the width of the
11528 widest item added to the sizer and the height of each grid cell is the
11529 height of the tallest item. An optional vertical and/or horizontal
11530 gap between items can also be specified (in pixels.)
11531
11532 Items are placed in the cells of the grid in the order they are added,
11533 in row-major order. In other words, the first row is filled first,
11534 then the second, and so on until all items have been added. (If
11535 neccessary, additional rows will be added as items are added.) If you
11536 need to have greater control over the cells that items are placed in
11537 then use the `wx.GridBagSizer`.
11538
11539 """
1bd55598
RD
11540 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11541 __repr__ = _swig_repr
11542 def __init__(self, *args, **kwargs):
bfddbb17 11543 """
5b5c9bc7 11544 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
bfddbb17
RD
11545
11546 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11547 of columns and rows in the sizer - if either of the parameters is
11548 zero, it will be calculated to from the total number of children in
11549 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11550 define extra space between all children.
11551 """
1bd55598 11552 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d55e5bfc
RD
11553 self._setOORInfo(self)
11554
d55e5bfc 11555 def SetCols(*args, **kwargs):
bfddbb17
RD
11556 """
11557 SetCols(self, int cols)
11558
11559 Sets the number of columns in the sizer.
11560 """
5b5c9bc7 11561 return _core_.GridSizer_SetCols(*args, **kwargs)
d55e5bfc
RD
11562
11563 def SetRows(*args, **kwargs):
bfddbb17
RD
11564 """
11565 SetRows(self, int rows)
11566
11567 Sets the number of rows in the sizer.
11568 """
5b5c9bc7 11569 return _core_.GridSizer_SetRows(*args, **kwargs)
d55e5bfc
RD
11570
11571 def SetVGap(*args, **kwargs):
bfddbb17
RD
11572 """
11573 SetVGap(self, int gap)
11574
11575 Sets the vertical gap (in pixels) between the cells in the sizer.
11576 """
5b5c9bc7 11577 return _core_.GridSizer_SetVGap(*args, **kwargs)
d55e5bfc
RD
11578
11579 def SetHGap(*args, **kwargs):
bfddbb17
RD
11580 """
11581 SetHGap(self, int gap)
11582
11583 Sets the horizontal gap (in pixels) between cells in the sizer
11584 """
5b5c9bc7 11585 return _core_.GridSizer_SetHGap(*args, **kwargs)
d55e5bfc
RD
11586
11587 def GetCols(*args, **kwargs):
bfddbb17
RD
11588 """
11589 GetCols(self) -> int
11590
11591 Returns the number of columns in the sizer.
11592 """
5b5c9bc7 11593 return _core_.GridSizer_GetCols(*args, **kwargs)
d55e5bfc
RD
11594
11595 def GetRows(*args, **kwargs):
bfddbb17
RD
11596 """
11597 GetRows(self) -> int
11598
11599 Returns the number of rows in the sizer.
11600 """
5b5c9bc7 11601 return _core_.GridSizer_GetRows(*args, **kwargs)
d55e5bfc
RD
11602
11603 def GetVGap(*args, **kwargs):
bfddbb17
RD
11604 """
11605 GetVGap(self) -> int
11606
11607 Returns the vertical gap (in pixels) between the cells in the sizer.
11608 """
5b5c9bc7 11609 return _core_.GridSizer_GetVGap(*args, **kwargs)
d55e5bfc
RD
11610
11611 def GetHGap(*args, **kwargs):
bfddbb17
RD
11612 """
11613 GetHGap(self) -> int
11614
11615 Returns the horizontal gap (in pixels) between cells in the sizer.
11616 """
5b5c9bc7 11617 return _core_.GridSizer_GetHGap(*args, **kwargs)
d55e5bfc 11618
1bd55598
RD
11619 def CalcRowsCols(self):
11620 """
11621 CalcRowsCols() -> (rows, cols)
11622
11623 Calculates how many rows and columns will be in the sizer based
11624 on the current number of items and also the rows, cols specified
11625 in the constructor.
11626 """
11627 nitems = len(self.GetChildren())
11628 rows = self.GetRows()
11629 cols = self.GetCols()
11630 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11631 if cols != 0:
11632 rows = (nitems + cols - 1) / cols
11633 elif rows != 0:
11634 cols = (nitems + rows - 1) / rows
11635 return (rows, cols)
d55e5bfc 11636
2131d850 11637_core_.GridSizer_swigregister(GridSizer)
d55e5bfc
RD
11638
11639#---------------------------------------------------------------------------
11640
5b5c9bc7
RD
11641FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11642FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11643FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11644class FlexGridSizer(GridSizer):
bfddbb17
RD
11645 """
11646 A flex grid sizer is a sizer which lays out its children in a
11647 two-dimensional table with all table cells in one row having the same
11648 height and all cells in one column having the same width, but all
11649 rows or all columns are not necessarily the same height or width as in
11650 the `wx.GridSizer`.
11651
11652 wx.FlexGridSizer can also size items equally in one direction but
11653 unequally ("flexibly") in the other. If the sizer is only flexible
11654 in one direction (this can be changed using `SetFlexibleDirection`), it
11655 needs to be decided how the sizer should grow in the other ("non
11656 flexible") direction in order to fill the available space. The
11657 `SetNonFlexibleGrowMode` method serves this purpose.
11658
11659
11660 """
1bd55598
RD
11661 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11662 __repr__ = _swig_repr
11663 def __init__(self, *args, **kwargs):
bfddbb17 11664 """
5b5c9bc7 11665 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
bfddbb17
RD
11666
11667 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11668 number of columns and rows in the sizer - if either of the parameters
11669 is zero, it will be calculated to from the total number of children in
11670 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11671 define extra space between all children.
11672 """
1bd55598 11673 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d55e5bfc
RD
11674 self._setOORInfo(self)
11675
bfddbb17
RD
11676 def AddGrowableRow(*args, **kwargs):
11677 """
11678 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 11679
bfddbb17
RD
11680 Specifies that row *idx* (starting from zero) should be grown if there
11681 is extra space available to the sizer.
d55e5bfc 11682
bfddbb17
RD
11683 The *proportion* parameter has the same meaning as the stretch factor
11684 for the box sizers except that if all proportions are 0, then all
11685 columns are resized equally (instead of not being resized at all).
11686 """
5b5c9bc7 11687 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
d55e5bfc
RD
11688
11689 def RemoveGrowableRow(*args, **kwargs):
bfddbb17
RD
11690 """
11691 RemoveGrowableRow(self, size_t idx)
11692
11693 Specifies that row *idx* is no longer growable.
11694 """
5b5c9bc7 11695 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
d55e5bfc
RD
11696
11697 def AddGrowableCol(*args, **kwargs):
bfddbb17
RD
11698 """
11699 AddGrowableCol(self, size_t idx, int proportion=0)
11700
11701 Specifies that column *idx* (starting from zero) should be grown if
11702 there is extra space available to the sizer.
11703
11704 The *proportion* parameter has the same meaning as the stretch factor
11705 for the box sizers except that if all proportions are 0, then all
11706 columns are resized equally (instead of not being resized at all).
11707 """
5b5c9bc7 11708 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
d55e5bfc
RD
11709
11710 def RemoveGrowableCol(*args, **kwargs):
bfddbb17
RD
11711 """
11712 RemoveGrowableCol(self, size_t idx)
11713
11714 Specifies that column *idx* is no longer growable.
11715 """
5b5c9bc7 11716 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
d55e5bfc
RD
11717
11718 def SetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
11719 """
11720 SetFlexibleDirection(self, int direction)
11721
11722 Specifies whether the sizer should flexibly resize its columns, rows,
11723 or both. Argument *direction* can be one of the following values. Any
11724 other value is ignored.
11725
11726 ============== =======================================
11727 wx.VERTICAL Rows are flexibly sized.
11728 wx.HORIZONTAL Columns are flexibly sized.
11729 wx.BOTH Both rows and columns are flexibly sized
11730 (this is the default value).
11731 ============== =======================================
11732
11733 Note that this method does not trigger relayout.
11734
11735 """
5b5c9bc7 11736 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
11737
11738 def GetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
11739 """
11740 GetFlexibleDirection(self) -> int
11741
11742 Returns a value that specifies whether the sizer
11743 flexibly resizes its columns, rows, or both (default).
11744
11745 :see: `SetFlexibleDirection`
11746 """
5b5c9bc7 11747 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
11748
11749 def SetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
11750 """
11751 SetNonFlexibleGrowMode(self, int mode)
11752
11753 Specifies how the sizer should grow in the non-flexible direction if
11754 there is one (so `SetFlexibleDirection` must have been called
11755 previously). Argument *mode* can be one of the following values:
11756
11757 ========================== =================================================
11758 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11759 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11760 `AddGrowableCol` and `AddGrowableRow`. In this
11761 case equal sizing applies to minimum sizes of
11762 columns or rows (this is the default value).
11763 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11764 the non flexible direction, whether they are
11765 growable or not in the flexbile direction.
11766 ========================== =================================================
11767
11768 Note that this method does not trigger relayout.
11769
11770
11771 """
5b5c9bc7 11772 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
11773
11774 def GetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
11775 """
11776 GetNonFlexibleGrowMode(self) -> int
11777
11778 Returns the value that specifies how the sizer grows in the
11779 non-flexible direction if there is one.
11780
11781 :see: `SetNonFlexibleGrowMode`
11782 """
5b5c9bc7 11783 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
11784
11785 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
11786 """
11787 GetRowHeights(self) -> list
11788
11789 Returns a list of integers representing the heights of each of the
11790 rows in the sizer.
11791 """
5b5c9bc7 11792 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
d55e5bfc
RD
11793
11794 def GetColWidths(*args, **kwargs):
fd2dc343
RD
11795 """
11796 GetColWidths(self) -> list
11797
11798 Returns a list of integers representing the widths of each of the
11799 columns in the sizer.
11800 """
5b5c9bc7 11801 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
d55e5bfc 11802
2131d850 11803_core_.FlexGridSizer_swigregister(FlexGridSizer)
d55e5bfc 11804
5b5c9bc7 11805class StdDialogButtonSizer(BoxSizer):
62d32a5f
RD
11806 """
11807 A special sizer that knows how to order and position standard buttons
11808 in order to conform to the current platform's standards. You simply
11809 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 11810 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
11811 will take care of the rest.
11812
11813 """
1bd55598
RD
11814 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11815 __repr__ = _swig_repr
11816 def __init__(self, *args, **kwargs):
5b5c9bc7 11817 """__init__(self) -> StdDialogButtonSizer"""
1bd55598 11818 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
62d32a5f
RD
11819 def AddButton(*args, **kwargs):
11820 """
11821 AddButton(self, wxButton button)
11822
11823 Use this to add the buttons to this sizer. Do not use the `Add`
11824 method in the base class.
11825 """
5b5c9bc7 11826 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
62d32a5f 11827
53aa7709 11828 def Realize(*args, **kwargs):
62d32a5f 11829 """
53aa7709 11830 Realize(self)
62d32a5f
RD
11831
11832 This funciton needs to be called after all the buttons have been added
11833 to the sizer. It will reorder them and position them in a platform
11834 specifc manner.
11835 """
5b5c9bc7 11836 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
11837
11838 def SetAffirmativeButton(*args, **kwargs):
11839 """SetAffirmativeButton(self, wxButton button)"""
5b5c9bc7 11840 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
51b83b37
RD
11841
11842 def SetNegativeButton(*args, **kwargs):
11843 """SetNegativeButton(self, wxButton button)"""
5b5c9bc7 11844 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
51b83b37
RD
11845
11846 def SetCancelButton(*args, **kwargs):
11847 """SetCancelButton(self, wxButton button)"""
5b5c9bc7 11848 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
11849
11850 def GetAffirmativeButton(*args, **kwargs):
11851 """GetAffirmativeButton(self) -> wxButton"""
5b5c9bc7 11852 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
62d32a5f
RD
11853
11854 def GetApplyButton(*args, **kwargs):
11855 """GetApplyButton(self) -> wxButton"""
5b5c9bc7 11856 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
62d32a5f
RD
11857
11858 def GetNegativeButton(*args, **kwargs):
11859 """GetNegativeButton(self) -> wxButton"""
5b5c9bc7 11860 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
62d32a5f
RD
11861
11862 def GetCancelButton(*args, **kwargs):
11863 """GetCancelButton(self) -> wxButton"""
5b5c9bc7 11864 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
62d32a5f
RD
11865
11866 def GetHelpButton(*args, **kwargs):
11867 """GetHelpButton(self) -> wxButton"""
5b5c9bc7 11868 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
62d32a5f 11869
2131d850 11870_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
62d32a5f 11871
d55e5bfc
RD
11872#---------------------------------------------------------------------------
11873
5b5c9bc7 11874class GBPosition(object):
bfddbb17
RD
11875 """
11876 This class represents the position of an item in a virtual grid of
11877 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11878 typemaps that will automatically convert from a 2-element sequence of
11879 integers to a wx.GBPosition, so you can use the more pythonic
11880 representation of the position nearly transparently in Python code.
11881 """
1bd55598
RD
11882 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11883 __repr__ = _swig_repr
11884 def __init__(self, *args, **kwargs):
bfddbb17 11885 """
5b5c9bc7 11886 __init__(self, int row=0, int col=0) -> GBPosition
bfddbb17
RD
11887
11888 This class represents the position of an item in a virtual grid of
11889 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11890 typemaps that will automatically convert from a 2-element sequence of
11891 integers to a wx.GBPosition, so you can use the more pythonic
11892 representation of the position nearly transparently in Python code.
11893 """
1bd55598
RD
11894 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11895 __swig_destroy__ = _core_.delete_GBPosition
11896 __del__ = lambda self : None;
d55e5bfc
RD
11897 def GetRow(*args, **kwargs):
11898 """GetRow(self) -> int"""
5b5c9bc7 11899 return _core_.GBPosition_GetRow(*args, **kwargs)
d55e5bfc
RD
11900
11901 def GetCol(*args, **kwargs):
11902 """GetCol(self) -> int"""
5b5c9bc7 11903 return _core_.GBPosition_GetCol(*args, **kwargs)
d55e5bfc
RD
11904
11905 def SetRow(*args, **kwargs):
11906 """SetRow(self, int row)"""
5b5c9bc7 11907 return _core_.GBPosition_SetRow(*args, **kwargs)
d55e5bfc
RD
11908
11909 def SetCol(*args, **kwargs):
11910 """SetCol(self, int col)"""
5b5c9bc7 11911 return _core_.GBPosition_SetCol(*args, **kwargs)
d55e5bfc
RD
11912
11913 def __eq__(*args, **kwargs):
e9d6f3a4
RD
11914 """
11915 __eq__(self, PyObject other) -> bool
11916
11917 Compare GBPosition for equality.
11918 """
5b5c9bc7 11919 return _core_.GBPosition___eq__(*args, **kwargs)
d55e5bfc
RD
11920
11921 def __ne__(*args, **kwargs):
e9d6f3a4
RD
11922 """
11923 __ne__(self, PyObject other) -> bool
11924
11925 Compare GBPosition for inequality.
11926 """
5b5c9bc7 11927 return _core_.GBPosition___ne__(*args, **kwargs)
d55e5bfc
RD
11928
11929 def Set(*args, **kwargs):
11930 """Set(self, int row=0, int col=0)"""
5b5c9bc7 11931 return _core_.GBPosition_Set(*args, **kwargs)
d55e5bfc
RD
11932
11933 def Get(*args, **kwargs):
11934 """Get(self) -> PyObject"""
5b5c9bc7 11935 return _core_.GBPosition_Get(*args, **kwargs)
d55e5bfc 11936
15817c7e 11937 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
11938 def __str__(self): return str(self.Get())
11939 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11940 def __len__(self): return len(self.Get())
11941 def __getitem__(self, index): return self.Get()[index]
11942 def __setitem__(self, index, val):
11943 if index == 0: self.SetRow(val)
11944 elif index == 1: self.SetCol(val)
11945 else: raise IndexError
11946 def __nonzero__(self): return self.Get() != (0,0)
11947 __safe_for_unpickling__ = True
11948 def __reduce__(self): return (wx.GBPosition, self.Get())
11949
11950 row = property(GetRow, SetRow)
11951 col = property(GetCol, SetCol)
11952
2131d850 11953_core_.GBPosition_swigregister(GBPosition)
d55e5bfc 11954
5b5c9bc7 11955class GBSpan(object):
bfddbb17
RD
11956 """
11957 This class is used to hold the row and column spanning attributes of
11958 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11959 automatically convert from a 2-element sequence of integers to a
11960 wx.GBSpan, so you can use the more pythonic representation of the span
11961 nearly transparently in Python code.
11962
11963 """
1bd55598
RD
11964 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11965 __repr__ = _swig_repr
11966 def __init__(self, *args, **kwargs):
bfddbb17 11967 """
5b5c9bc7 11968 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
bfddbb17
RD
11969
11970 Construct a new wxGBSpan, optionally setting the rowspan and
11971 colspan. The default is (1,1). (Meaning that the item occupies one
11972 cell in each direction.
11973 """
1bd55598
RD
11974 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
11975 __swig_destroy__ = _core_.delete_GBSpan
11976 __del__ = lambda self : None;
d55e5bfc
RD
11977 def GetRowspan(*args, **kwargs):
11978 """GetRowspan(self) -> int"""
5b5c9bc7 11979 return _core_.GBSpan_GetRowspan(*args, **kwargs)
d55e5bfc
RD
11980
11981 def GetColspan(*args, **kwargs):
11982 """GetColspan(self) -> int"""
5b5c9bc7 11983 return _core_.GBSpan_GetColspan(*args, **kwargs)
d55e5bfc
RD
11984
11985 def SetRowspan(*args, **kwargs):
11986 """SetRowspan(self, int rowspan)"""
5b5c9bc7 11987 return _core_.GBSpan_SetRowspan(*args, **kwargs)
d55e5bfc
RD
11988
11989 def SetColspan(*args, **kwargs):
11990 """SetColspan(self, int colspan)"""
5b5c9bc7 11991 return _core_.GBSpan_SetColspan(*args, **kwargs)
d55e5bfc
RD
11992
11993 def __eq__(*args, **kwargs):
e9d6f3a4
RD
11994 """
11995 __eq__(self, PyObject other) -> bool
11996
11997 Compare wxGBSpan for equality.
11998 """
5b5c9bc7 11999 return _core_.GBSpan___eq__(*args, **kwargs)
d55e5bfc
RD
12000
12001 def __ne__(*args, **kwargs):
e9d6f3a4
RD
12002 """
12003 __ne__(self, PyObject other) -> bool
12004
12005 Compare GBSpan for inequality.
12006 """
5b5c9bc7 12007 return _core_.GBSpan___ne__(*args, **kwargs)
d55e5bfc
RD
12008
12009 def Set(*args, **kwargs):
12010 """Set(self, int rowspan=1, int colspan=1)"""
5b5c9bc7 12011 return _core_.GBSpan_Set(*args, **kwargs)
d55e5bfc
RD
12012
12013 def Get(*args, **kwargs):
12014 """Get(self) -> PyObject"""
5b5c9bc7 12015 return _core_.GBSpan_Get(*args, **kwargs)
d55e5bfc 12016
15817c7e 12017 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12018 def __str__(self): return str(self.Get())
12019 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12020 def __len__(self): return len(self.Get())
12021 def __getitem__(self, index): return self.Get()[index]
12022 def __setitem__(self, index, val):
12023 if index == 0: self.SetRowspan(val)
12024 elif index == 1: self.SetColspan(val)
12025 else: raise IndexError
12026 def __nonzero__(self): return self.Get() != (0,0)
12027 __safe_for_unpickling__ = True
12028 def __reduce__(self): return (wx.GBSpan, self.Get())
12029
12030 rowspan = property(GetRowspan, SetRowspan)
12031 colspan = property(GetColspan, SetColspan)
12032
2131d850 12033_core_.GBSpan_swigregister(GBSpan)
d55e5bfc 12034
5b5c9bc7 12035class GBSizerItem(SizerItem):
bfddbb17
RD
12036 """
12037 The wx.GBSizerItem class is used to track the additional data about
12038 items in a `wx.GridBagSizer` such as the item's position in the grid
12039 and how many rows or columns it spans.
12040
12041 """
1bd55598
RD
12042 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12043 __repr__ = _swig_repr
12044 def __init__(self, *args, **kwargs):
bfddbb17 12045 """
5b5c9bc7 12046 __init__(self) -> GBSizerItem
bfddbb17
RD
12047
12048 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12049 size will need to be set, as well as a position and span before this
12050 item can be used in a Sizer.
12051
12052 You will probably never need to create a wx.GBSizerItem directly as they
12053 are created automatically when the sizer's Add method is called.
12054 """
1bd55598
RD
12055 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12056 __swig_destroy__ = _core_.delete_GBSizerItem
12057 __del__ = lambda self : None;
d55e5bfc 12058 def GetPos(*args, **kwargs):
bfddbb17 12059 """
5b5c9bc7 12060 GetPos(self) -> GBPosition
bfddbb17
RD
12061
12062 Get the grid position of the item
12063 """
5b5c9bc7 12064 return _core_.GBSizerItem_GetPos(*args, **kwargs)
d55e5bfc
RD
12065
12066 def GetPosTuple(self): return self.GetPos().Get()
12067 def GetSpan(*args, **kwargs):
bfddbb17 12068 """
5b5c9bc7 12069 GetSpan(self) -> GBSpan
bfddbb17
RD
12070
12071 Get the row and column spanning of the item
12072 """
5b5c9bc7 12073 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
d55e5bfc
RD
12074
12075 def GetSpanTuple(self): return self.GetSpan().Get()
12076 def SetPos(*args, **kwargs):
bfddbb17 12077 """
5b5c9bc7 12078 SetPos(self, GBPosition pos) -> bool
bfddbb17
RD
12079
12080 If the item is already a member of a sizer then first ensure that
12081 there is no other item that would intersect with this one at the new
12082 position, then set the new position. Returns True if the change is
12083 successful and after the next Layout() the item will be moved.
12084 """
5b5c9bc7 12085 return _core_.GBSizerItem_SetPos(*args, **kwargs)
d55e5bfc
RD
12086
12087 def SetSpan(*args, **kwargs):
bfddbb17 12088 """
5b5c9bc7 12089 SetSpan(self, GBSpan span) -> bool
bfddbb17
RD
12090
12091 If the item is already a member of a sizer then first ensure that
12092 there is no other item that would intersect with this one with its new
12093 spanning size, then set the new spanning. Returns True if the change
12094 is successful and after the next Layout() the item will be resized.
12095
12096 """
5b5c9bc7 12097 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
d55e5bfc 12098
bfddbb17 12099 def Intersects(*args, **kwargs):
d55e5bfc 12100 """
5b5c9bc7 12101 Intersects(self, GBSizerItem other) -> bool
bfddbb17
RD
12102
12103 Returns True if this item and the other item instersect.
d55e5bfc 12104 """
5b5c9bc7 12105 return _core_.GBSizerItem_Intersects(*args, **kwargs)
bfddbb17
RD
12106
12107 def IntersectsPos(*args, **kwargs):
12108 """
5b5c9bc7 12109 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
bfddbb17
RD
12110
12111 Returns True if the given pos/span would intersect with this item.
12112 """
5b5c9bc7 12113 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
12114
12115 def GetEndPos(*args, **kwargs):
bfddbb17 12116 """
5b5c9bc7 12117 GetEndPos(self) -> GBPosition
bfddbb17
RD
12118
12119 Get the row and column of the endpoint of this item.
12120 """
5b5c9bc7 12121 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
d55e5bfc
RD
12122
12123 def GetGBSizer(*args, **kwargs):
bfddbb17 12124 """
5b5c9bc7 12125 GetGBSizer(self) -> GridBagSizer
bfddbb17
RD
12126
12127 Get the sizer this item is a member of.
12128 """
5b5c9bc7 12129 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
d55e5bfc
RD
12130
12131 def SetGBSizer(*args, **kwargs):
bfddbb17 12132 """
5b5c9bc7 12133 SetGBSizer(self, GridBagSizer sizer)
bfddbb17
RD
12134
12135 Set the sizer this item is a member of.
12136 """
5b5c9bc7 12137 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
d55e5bfc 12138
2131d850 12139_core_.GBSizerItem_swigregister(GBSizerItem)
5b5c9bc7 12140DefaultSpan = cvar.DefaultSpan
d55e5bfc
RD
12141
12142def GBSizerItemWindow(*args, **kwargs):
12143 """
5b5c9bc7
RD
12144 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12145 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12146
12147 Construct a `wx.GBSizerItem` for a window.
d55e5bfc 12148 """
5b5c9bc7 12149 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12150 return val
12151
12152def GBSizerItemSizer(*args, **kwargs):
12153 """
5b5c9bc7
RD
12154 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12155 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12156
12157 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc 12158 """
5b5c9bc7 12159 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12160 return val
12161
12162def GBSizerItemSpacer(*args, **kwargs):
12163 """
5b5c9bc7
RD
12164 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12165 int flag, int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12166
12167 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc 12168 """
5b5c9bc7 12169 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12170 return val
12171
5b5c9bc7 12172class GridBagSizer(FlexGridSizer):
bfddbb17
RD
12173 """
12174 A `wx.Sizer` that can lay out items in a virtual grid like a
12175 `wx.FlexGridSizer` but in this case explicit positioning of the items
12176 is allowed using `wx.GBPosition`, and items can optionally span more
12177 than one row and/or column using `wx.GBSpan`. The total size of the
12178 virtual grid is determined by the largest row and column that items are
12179 positioned at, adjusted for spanning.
12180
12181 """
1bd55598
RD
12182 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12183 __repr__ = _swig_repr
12184 def __init__(self, *args, **kwargs):
bfddbb17 12185 """
5b5c9bc7 12186 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
bfddbb17
RD
12187
12188 Constructor, with optional parameters to specify the gap between the
12189 rows and columns.
12190 """
1bd55598 12191 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
03e46024
RD
12192 self._setOORInfo(self)
12193
d55e5bfc
RD
12194 def Add(*args, **kwargs):
12195 """
bfddbb17 12196 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
070c48b4 12197 int border=0, userData=None) -> wx.GBSizerItem
bfddbb17
RD
12198
12199 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12200 more than one row or column as specified with *span*. The remaining
12201 args behave similarly to `wx.Sizer.Add`.
12202
12203 Returns True if the item was successfully placed at the given cell
12204 position, False if something was already there.
12205
d55e5bfc 12206 """
5b5c9bc7 12207 return _core_.GridBagSizer_Add(*args, **kwargs)
d55e5bfc
RD
12208
12209 def AddItem(*args, **kwargs):
bfddbb17 12210 """
070c48b4 12211 Add(self, GBSizerItem item) -> wx.GBSizerItem
bfddbb17
RD
12212
12213 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12214 the item was successfully placed at its given cell position, False if
12215 something was already there.
12216 """
5b5c9bc7 12217 return _core_.GridBagSizer_AddItem(*args, **kwargs)
d55e5bfc 12218
84f85550
RD
12219 def GetCellSize(*args, **kwargs):
12220 """
5b5c9bc7 12221 GetCellSize(self, int row, int col) -> Size
84f85550
RD
12222
12223 Get the size of the specified cell, including hgap and
12224 vgap. Only valid after a Layout.
12225 """
5b5c9bc7 12226 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
84f85550 12227
d55e5bfc 12228 def GetEmptyCellSize(*args, **kwargs):
bfddbb17 12229 """
5b5c9bc7 12230 GetEmptyCellSize(self) -> Size
bfddbb17
RD
12231
12232 Get the size used for cells in the grid with no item.
12233 """
5b5c9bc7 12234 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12235
12236 def SetEmptyCellSize(*args, **kwargs):
bfddbb17 12237 """
5b5c9bc7 12238 SetEmptyCellSize(self, Size sz)
bfddbb17
RD
12239
12240 Set the size used for cells in the grid with no item.
12241 """
5b5c9bc7 12242 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12243
12244 def GetItemPosition(*args):
12245 """
bfddbb17
RD
12246 GetItemPosition(self, item) -> GBPosition
12247
12248 Get the grid position of the specified *item* where *item* is either a
12249 window or subsizer that is a member of this sizer, or a zero-based
12250 index of an item.
d55e5bfc 12251 """
5b5c9bc7 12252 return _core_.GridBagSizer_GetItemPosition(*args)
d55e5bfc
RD
12253
12254 def SetItemPosition(*args):
12255 """
bfddbb17
RD
12256 SetItemPosition(self, item, GBPosition pos) -> bool
12257
12258 Set the grid position of the specified *item* where *item* is either a
12259 window or subsizer that is a member of this sizer, or a zero-based
12260 index of an item. Returns True on success. If the move is not
12261 allowed (because an item is already there) then False is returned.
12262
d55e5bfc 12263 """
5b5c9bc7 12264 return _core_.GridBagSizer_SetItemPosition(*args)
d55e5bfc
RD
12265
12266 def GetItemSpan(*args):
12267 """
bfddbb17
RD
12268 GetItemSpan(self, item) -> GBSpan
12269
12270 Get the row/col spanning of the specified *item* where *item* is
12271 either a window or subsizer that is a member of this sizer, or a
12272 zero-based index of an item.
d55e5bfc 12273 """
5b5c9bc7 12274 return _core_.GridBagSizer_GetItemSpan(*args)
d55e5bfc
RD
12275
12276 def SetItemSpan(*args):
12277 """
bfddbb17
RD
12278 SetItemSpan(self, item, GBSpan span) -> bool
12279
12280 Set the row/col spanning of the specified *item* where *item* is
12281 either a window or subsizer that is a member of this sizer, or a
12282 zero-based index of an item. Returns True on success. If the move is
12283 not allowed (because an item is already there) then False is returned.
d55e5bfc 12284 """
5b5c9bc7 12285 return _core_.GridBagSizer_SetItemSpan(*args)
d55e5bfc
RD
12286
12287 def FindItem(*args):
12288 """
bfddbb17
RD
12289 FindItem(self, item) -> GBSizerItem
12290
12291 Find the sizer item for the given window or subsizer, returns None if
12292 not found. (non-recursive)
d55e5bfc 12293 """
5b5c9bc7 12294 return _core_.GridBagSizer_FindItem(*args)
d55e5bfc
RD
12295
12296 def FindItemAtPosition(*args, **kwargs):
bfddbb17 12297 """
5b5c9bc7 12298 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
bfddbb17
RD
12299
12300 Return the sizer item for the given grid cell, or None if there is no
12301 item at that position. (non-recursive)
12302 """
5b5c9bc7 12303 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
d55e5bfc
RD
12304
12305 def FindItemAtPoint(*args, **kwargs):
bfddbb17 12306 """
5b5c9bc7 12307 FindItemAtPoint(self, Point pt) -> GBSizerItem
bfddbb17
RD
12308
12309 Return the sizer item located at the point given in *pt*, or None if
12310 there is no item at that point. The (x,y) coordinates in pt correspond
12311 to the client coordinates of the window using the sizer for
12312 layout. (non-recursive)
12313 """
5b5c9bc7 12314 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
d55e5bfc 12315
bfddbb17
RD
12316 def CheckForIntersection(*args, **kwargs):
12317 """
5b5c9bc7 12318 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 12319
bfddbb17
RD
12320 Look at all items and see if any intersect (or would overlap) the
12321 given *item*. Returns True if so, False if there would be no overlap.
12322 If an *excludeItem* is given then it will not be checked for
12323 intersection, for example it may be the item we are checking the
12324 position of.
d55e5bfc 12325
bfddbb17 12326 """
5b5c9bc7 12327 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 12328
bfddbb17 12329 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 12330 """
5b5c9bc7 12331 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
bfddbb17
RD
12332
12333 Look at all items and see if any intersect (or would overlap) the
12334 given position and span. Returns True if so, False if there would be
12335 no overlap. If an *excludeItem* is given then it will not be checked
12336 for intersection, for example it may be the item we are checking the
12337 position of.
d55e5bfc 12338 """
5b5c9bc7 12339 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc 12340
2131d850 12341_core_.GridBagSizer_swigregister(GridBagSizer)
d55e5bfc
RD
12342
12343#---------------------------------------------------------------------------
12344
5b5c9bc7
RD
12345Left = _core_.Left
12346Top = _core_.Top
12347Right = _core_.Right
12348Bottom = _core_.Bottom
12349Width = _core_.Width
12350Height = _core_.Height
12351Centre = _core_.Centre
12352Center = _core_.Center
12353CentreX = _core_.CentreX
12354CentreY = _core_.CentreY
12355Unconstrained = _core_.Unconstrained
12356AsIs = _core_.AsIs
12357PercentOf = _core_.PercentOf
12358Above = _core_.Above
12359Below = _core_.Below
12360LeftOf = _core_.LeftOf
12361RightOf = _core_.RightOf
12362SameAs = _core_.SameAs
12363Absolute = _core_.Absolute
12364class IndividualLayoutConstraint(Object):
d55e5bfc 12365 """
15817c7e
RD
12366 Objects of this class are stored in the `wx.LayoutConstraints` class as
12367 one of eight possible constraints that a window can be involved in.
12368 You will never need to create an instance of
12369 wx.IndividualLayoutConstraint, rather you should create a
12370 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 12371 that it contains.
d55e5bfc 12372 """
1bd55598
RD
12373 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12374 def __init__(self): raise AttributeError, "No constructor defined"
12375 __repr__ = _swig_repr
d55e5bfc 12376 def Set(*args, **kwargs):
15817c7e 12377 """
5b5c9bc7 12378 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
15817c7e
RD
12379
12380 Sets the properties of the constraint. Normally called by one of the
12381 convenience functions such as Above, RightOf, SameAs.
12382 """
5b5c9bc7 12383 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
d55e5bfc
RD
12384
12385 def LeftOf(*args, **kwargs):
12386 """
5b5c9bc7 12387 LeftOf(self, Window sibling, int marg=0)
d55e5bfc 12388
15817c7e
RD
12389 Constrains this edge to be to the left of the given window, with an
12390 optional margin. Implicitly, this is relative to the left edge of the
12391 other window.
d55e5bfc 12392 """
5b5c9bc7 12393 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
d55e5bfc
RD
12394
12395 def RightOf(*args, **kwargs):
12396 """
5b5c9bc7 12397 RightOf(self, Window sibling, int marg=0)
d55e5bfc 12398
15817c7e
RD
12399 Constrains this edge to be to the right of the given window, with an
12400 optional margin. Implicitly, this is relative to the right edge of the
12401 other window.
d55e5bfc 12402 """
5b5c9bc7 12403 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
d55e5bfc
RD
12404
12405 def Above(*args, **kwargs):
12406 """
5b5c9bc7 12407 Above(self, Window sibling, int marg=0)
d55e5bfc 12408
15817c7e
RD
12409 Constrains this edge to be above the given window, with an optional
12410 margin. Implicitly, this is relative to the top edge of the other
12411 window.
d55e5bfc 12412 """
5b5c9bc7 12413 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
d55e5bfc
RD
12414
12415 def Below(*args, **kwargs):
12416 """
5b5c9bc7 12417 Below(self, Window sibling, int marg=0)
d55e5bfc 12418
15817c7e
RD
12419 Constrains this edge to be below the given window, with an optional
12420 margin. Implicitly, this is relative to the bottom edge of the other
12421 window.
d55e5bfc 12422 """
5b5c9bc7 12423 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
d55e5bfc
RD
12424
12425 def SameAs(*args, **kwargs):
12426 """
5b5c9bc7 12427 SameAs(self, Window otherW, int edge, int marg=0)
d55e5bfc 12428
15817c7e
RD
12429 Constrains this edge or dimension to be to the same as the edge of the
12430 given window, with an optional margin.
d55e5bfc 12431 """
5b5c9bc7 12432 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
d55e5bfc
RD
12433
12434 def PercentOf(*args, **kwargs):
12435 """
5b5c9bc7 12436 PercentOf(self, Window otherW, int wh, int per)
d55e5bfc 12437
15817c7e
RD
12438 Constrains this edge or dimension to be to a percentage of the given
12439 window, with an optional margin.
d55e5bfc 12440 """
5b5c9bc7 12441 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
d55e5bfc
RD
12442
12443 def Absolute(*args, **kwargs):
12444 """
12445 Absolute(self, int val)
12446
15817c7e 12447 Constrains this edge or dimension to be the given absolute value.
d55e5bfc 12448 """
5b5c9bc7 12449 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
d55e5bfc
RD
12450
12451 def Unconstrained(*args, **kwargs):
12452 """
12453 Unconstrained(self)
12454
15817c7e
RD
12455 Sets this edge or dimension to be unconstrained, that is, dependent on
12456 other edges and dimensions from which this value can be deduced.
d55e5bfc 12457 """
5b5c9bc7 12458 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
d55e5bfc
RD
12459
12460 def AsIs(*args, **kwargs):
12461 """
12462 AsIs(self)
12463
15817c7e
RD
12464 Sets this edge or constraint to be whatever the window's value is at
12465 the moment. If either of the width and height constraints are *as is*,
12466 the window will not be resized, but moved instead. This is important
12467 when considering panel items which are intended to have a default
12468 size, such as a button, which may take its size from the size of the
12469 button label.
d55e5bfc 12470 """
5b5c9bc7 12471 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
d55e5bfc
RD
12472
12473 def GetOtherWindow(*args, **kwargs):
5b5c9bc7
RD
12474 """GetOtherWindow(self) -> Window"""
12475 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
d55e5bfc
RD
12476
12477 def GetMyEdge(*args, **kwargs):
12478 """GetMyEdge(self) -> int"""
5b5c9bc7 12479 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
d55e5bfc
RD
12480
12481 def SetEdge(*args, **kwargs):
12482 """SetEdge(self, int which)"""
5b5c9bc7 12483 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
d55e5bfc
RD
12484
12485 def SetValue(*args, **kwargs):
12486 """SetValue(self, int v)"""
5b5c9bc7 12487 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
d55e5bfc
RD
12488
12489 def GetMargin(*args, **kwargs):
12490 """GetMargin(self) -> int"""
5b5c9bc7 12491 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
d55e5bfc
RD
12492
12493 def SetMargin(*args, **kwargs):
12494 """SetMargin(self, int m)"""
5b5c9bc7 12495 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
d55e5bfc
RD
12496
12497 def GetValue(*args, **kwargs):
12498 """GetValue(self) -> int"""
5b5c9bc7 12499 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
d55e5bfc
RD
12500
12501 def GetPercent(*args, **kwargs):
12502 """GetPercent(self) -> int"""
5b5c9bc7 12503 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
d55e5bfc
RD
12504
12505 def GetOtherEdge(*args, **kwargs):
12506 """GetOtherEdge(self) -> int"""
5b5c9bc7 12507 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
d55e5bfc
RD
12508
12509 def GetDone(*args, **kwargs):
12510 """GetDone(self) -> bool"""
5b5c9bc7 12511 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
d55e5bfc
RD
12512
12513 def SetDone(*args, **kwargs):
12514 """SetDone(self, bool d)"""
5b5c9bc7 12515 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
d55e5bfc
RD
12516
12517 def GetRelationship(*args, **kwargs):
12518 """GetRelationship(self) -> int"""
5b5c9bc7 12519 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
d55e5bfc
RD
12520
12521 def SetRelationship(*args, **kwargs):
12522 """SetRelationship(self, int r)"""
5b5c9bc7 12523 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
d55e5bfc
RD
12524
12525 def ResetIfWin(*args, **kwargs):
12526 """
5b5c9bc7 12527 ResetIfWin(self, Window otherW) -> bool
d55e5bfc
RD
12528
12529 Reset constraint if it mentions otherWin
12530 """
5b5c9bc7 12531 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
d55e5bfc
RD
12532
12533 def SatisfyConstraint(*args, **kwargs):
12534 """
5b5c9bc7 12535 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
d55e5bfc
RD
12536
12537 Try to satisfy constraint
12538 """
5b5c9bc7 12539 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
d55e5bfc
RD
12540
12541 def GetEdge(*args, **kwargs):
12542 """
5b5c9bc7 12543 GetEdge(self, int which, Window thisWin, Window other) -> int
d55e5bfc
RD
12544
12545 Get the value of this edge or dimension, or if this
12546 is not determinable, -1.
12547 """
5b5c9bc7 12548 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
d55e5bfc 12549
2131d850 12550_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d55e5bfc 12551
5b5c9bc7 12552class LayoutConstraints(Object):
d55e5bfc 12553 """
15817c7e
RD
12554 **Note:** constraints are now deprecated and you should use sizers
12555 instead.
d55e5bfc 12556
15817c7e
RD
12557 Objects of this class can be associated with a window to define its
12558 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
12559
12560 The class consists of the following eight constraints of class
12561 wx.IndividualLayoutConstraint, some or all of which should be accessed
12562 directly to set the appropriate constraints.
12563
12564 * left: represents the left hand edge of the window
12565 * right: represents the right hand edge of the window
12566 * top: represents the top edge of the window
12567 * bottom: represents the bottom edge of the window
12568 * width: represents the width of the window
12569 * height: represents the height of the window
12570 * centreX: represents the horizontal centre point of the window
12571 * centreY: represents the vertical centre point of the window
12572
15817c7e
RD
12573 Most constraints are initially set to have the relationship
12574 wxUnconstrained, which means that their values should be calculated by
12575 looking at known constraints. The exceptions are width and height,
12576 which are set to wxAsIs to ensure that if the user does not specify a
12577 constraint, the existing width and height will be used, to be
12578 compatible with panel items which often have take a default size. If
12579 the constraint is ``wx.AsIs``, the dimension will not be changed.
12580
12581 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
12582
12583 """
1bd55598
RD
12584 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12585 __repr__ = _swig_repr
5b5c9bc7
RD
12586 left = property(_core_.LayoutConstraints_left_get)
12587 top = property(_core_.LayoutConstraints_top_get)
12588 right = property(_core_.LayoutConstraints_right_get)
12589 bottom = property(_core_.LayoutConstraints_bottom_get)
12590 width = property(_core_.LayoutConstraints_width_get)
12591 height = property(_core_.LayoutConstraints_height_get)
12592 centreX = property(_core_.LayoutConstraints_centreX_get)
12593 centreY = property(_core_.LayoutConstraints_centreY_get)
1bd55598 12594 def __init__(self, *args, **kwargs):
5b5c9bc7 12595 """__init__(self) -> LayoutConstraints"""
1bd55598
RD
12596 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12597 __swig_destroy__ = _core_.delete_LayoutConstraints
12598 __del__ = lambda self : None;
d55e5bfc
RD
12599 def SatisfyConstraints(*args, **kwargs):
12600 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
5b5c9bc7 12601 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
d55e5bfc
RD
12602
12603 def AreSatisfied(*args, **kwargs):
12604 """AreSatisfied(self) -> bool"""
5b5c9bc7 12605 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
d55e5bfc 12606
2131d850 12607_core_.LayoutConstraints_swigregister(LayoutConstraints)
d55e5bfc
RD
12608
12609#----------------------------------------------------------------------------
12610
12611# Use Python's bool constants if available, make some if not
12612try:
12613 True
12614except NameError:
12615 __builtins__.True = 1==1
12616 __builtins__.False = 1==0
12617 def bool(value): return not not value
12618 __builtins__.bool = bool
12619
12620
12621
12622# workarounds for bad wxRTTI names
12623__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12624__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12625__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12626
12627
12628#----------------------------------------------------------------------------
12629# Load version numbers from __version__... Ensure that major and minor
0f63ec68 12630# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
12631
12632from __version__ import *
12633__version__ = VERSION_STRING
12634
0f63ec68
RD
12635assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12636assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
12637if RELEASE_VERSION != _core_.RELEASE_VERSION:
12638 import warnings
0f63ec68 12639 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
12640
12641#----------------------------------------------------------------------------
12642
7993762b
RD
12643# Set wxPython's default string<-->unicode conversion encoding from
12644# the locale, but only if Python's default hasn't been changed. (We
12645# assume that if the user has customized it already then that is the
12646# encoding we need to use as well.)
12647#
12648# The encoding selected here is used when string or unicode objects
12649# need to be converted in order to pass them to wxWidgets. Please be
12650# aware that the default encoding within the same locale may be
12651# slightly different on different platforms. For example, please see
62d32a5f
RD
12652# http://www.alanwood.net/demos/charsetdiffs.html for differences
12653# between the common latin/roman encodings.
3837a853
RD
12654
12655default = _sys.getdefaultencoding()
12656if default == 'ascii':
12657 import locale
12658 import codecs
12659 try:
12660 default = locale.getdefaultlocale()[1]
12661 codecs.lookup(default)
7993762b 12662 except (ValueError, LookupError, TypeError):
3837a853
RD
12663 default = _sys.getdefaultencoding()
12664 del locale
12665 del codecs
5cbf236d
RD
12666if default:
12667 wx.SetDefaultPyEncoding(default)
12668del default
5cbf236d
RD
12669
12670#----------------------------------------------------------------------------
12671
d55e5bfc
RD
12672class PyDeadObjectError(AttributeError):
12673 pass
12674
12675class _wxPyDeadObject(object):
12676 """
12677 Instances of wx objects that are OOR capable will have their __class__
12678 changed to this class when the C++ object is deleted. This should help
12679 prevent crashes due to referencing a bogus C++ pointer.
12680 """
12681 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12682 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12683
12684 def __repr__(self):
12685 if not hasattr(self, "_name"):
12686 self._name = "[unknown]"
12687 return self.reprStr % self._name
12688
12689 def __getattr__(self, *args):
12690 if not hasattr(self, "_name"):
12691 self._name = "[unknown]"
12692 raise PyDeadObjectError(self.attrStr % self._name)
12693
12694 def __nonzero__(self):
12695 return 0
12696
12697
12698
12699class PyUnbornObjectError(AttributeError):
12700 pass
12701
12702class _wxPyUnbornObject(object):
12703 """
12704 Some stock objects are created when the wx._core module is
12705 imported, but their C++ instance is not created until the wx.App
12706 object is created and initialized. These object instances will
12707 temporarily have their __class__ changed to this class so an
12708 exception will be raised if they are used before the C++ instance
12709 is ready.
12710 """
12711
12712 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12713 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12714
12715 def __repr__(self):
12716 #if not hasattr(self, "_name"):
12717 # self._name = "[unknown]"
12718 return self.reprStr #% self._name
12719
12720 def __getattr__(self, *args):
12721 #if not hasattr(self, "_name"):
12722 # self._name = "[unknown]"
12723 raise PyUnbornObjectError(self.attrStr) # % self._name )
12724
12725 def __nonzero__(self):
12726 return 0
12727
12728
12729#----------------------------------------------------------------------------
d55e5bfc
RD
12730
12731def CallAfter(callable, *args, **kw):
12732 """
12733 Call the specified function after the current and pending event
12734 handlers have been completed. This is also good for making GUI
0439c23b
RD
12735 method calls from non-GUI threads. Any extra positional or
12736 keyword args are passed on to the callable when it is called.
12737
12738 :see: `wx.FutureCall`
d55e5bfc
RD
12739 """
12740 app = wx.GetApp()
a001823c 12741 assert app is not None, 'No wx.App created yet'
d55e5bfc 12742
891bb194
RD
12743 if not hasattr(app, "_CallAfterId"):
12744 app._CallAfterId = wx.NewEventType()
12745 app.Connect(-1, -1, app._CallAfterId,
12746 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 12747 evt = wx.PyEvent()
891bb194 12748 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
12749 evt.callable = callable
12750 evt.args = args
12751 evt.kw = kw
12752 wx.PostEvent(app, evt)
12753
d55e5bfc
RD
12754#----------------------------------------------------------------------------
12755
12756
12757class FutureCall:
12758 """
6e0de3df 12759 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
12760 object once after the given amount of milliseconds, passing any
12761 positional or keyword args. The return value of the callable is
0439c23b 12762 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
12763
12764 If you don't need to get the return value or restart the timer
12765 then there is no need to hold a reference to this object. It will
12766 hold a reference to itself while the timer is running (the timer
12767 has a reference to self.Notify) but the cycle will be broken when
12768 the timer completes, automatically cleaning up the wx.FutureCall
12769 object.
0439c23b
RD
12770
12771 :see: `wx.CallAfter`
d55e5bfc
RD
12772 """
12773 def __init__(self, millis, callable, *args, **kwargs):
12774 self.millis = millis
12775 self.callable = callable
12776 self.SetArgs(*args, **kwargs)
12777 self.runCount = 0
12778 self.running = False
12779 self.hasRun = False
12780 self.result = None
12781 self.timer = None
12782 self.Start()
12783
12784 def __del__(self):
12785 self.Stop()
12786
12787
12788 def Start(self, millis=None, *args, **kwargs):
12789 """
12790 (Re)start the timer
12791 """
12792 self.hasRun = False
12793 if millis is not None:
12794 self.millis = millis
12795 if args or kwargs:
12796 self.SetArgs(*args, **kwargs)
12797 self.Stop()
12798 self.timer = wx.PyTimer(self.Notify)
12799 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
12800 self.running = True
12801 Restart = Start
12802
12803
12804 def Stop(self):
12805 """
12806 Stop and destroy the timer.
12807 """
12808 if self.timer is not None:
12809 self.timer.Stop()
12810 self.timer = None
12811
12812
12813 def GetInterval(self):
12814 if self.timer is not None:
12815 return self.timer.GetInterval()
12816 else:
12817 return 0
12818
12819
12820 def IsRunning(self):
12821 return self.timer is not None and self.timer.IsRunning()
12822
12823
12824 def SetArgs(self, *args, **kwargs):
12825 """
12826 (Re)set the args passed to the callable object. This is
12827 useful in conjunction with Restart if you want to schedule a
12828 new call to the same callable object but with different
12829 parameters.
12830 """
12831 self.args = args
12832 self.kwargs = kwargs
12833
12834
12835 def HasRun(self):
12836 return self.hasRun
12837
12838 def GetResult(self):
12839 return self.result
12840
12841 def Notify(self):
12842 """
12843 The timer has expired so call the callable.
12844 """
12845 if self.callable and getattr(self.callable, 'im_self', True):
12846 self.runCount += 1
12847 self.running = False
12848 self.result = self.callable(*self.args, **self.kwargs)
12849 self.hasRun = True
12850 if not self.running:
12851 # if it wasn't restarted, then cleanup
12852 wx.CallAfter(self.Stop)
12853
12854
12855
12856#----------------------------------------------------------------------------
12857# Control which items in this module should be documented by epydoc.
12858# We allow only classes and functions, which will help reduce the size
12859# of the docs by filtering out the zillions of constants, EVT objects,
12860# and etc that don't make much sense by themselves, but are instead
12861# documented (or will be) as part of the classes/functions/methods
12862# where they should be used.
12863
d6c14a4c
RD
12864class __DocFilter:
12865 """
12866 A filter for epydoc that only allows non-Ptr classes and
12867 fucntions, in order to reduce the clutter in the API docs.
12868 """
12869 def __init__(self, globals):
12870 self._globals = globals
12871
12872 def __call__(self, name):
12873 import types
12874 obj = self._globals.get(name, None)
12875 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12876 return False
1bd55598 12877 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
d6c14a4c
RD
12878 return False
12879 return True
d55e5bfc
RD
12880
12881#----------------------------------------------------------------------------
12882#----------------------------------------------------------------------------
12883
12884# Import other modules in this package that should show up in the
12885# "core" wx namespace
12886from _gdi import *
12887from _windows import *
12888from _controls import *
12889from _misc import *
12890
d55e5bfc
RD
12891#----------------------------------------------------------------------------
12892#----------------------------------------------------------------------------
12893
12894
32fe5131 12895