]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/mac/_core.py
reSWIGged
[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
RD
1984
1985 def SetName(*args, **kwargs):
5b5c9bc7
RD
1986 """SetName(self, String name)"""
1987 return _core_.ImageHandler_SetName(*args, **kwargs)
d55e5bfc
RD
1988
1989 def SetExtension(*args, **kwargs):
5b5c9bc7
RD
1990 """SetExtension(self, String extension)"""
1991 return _core_.ImageHandler_SetExtension(*args, **kwargs)
d55e5bfc
RD
1992
1993 def SetType(*args, **kwargs):
1994 """SetType(self, long type)"""
5b5c9bc7 1995 return _core_.ImageHandler_SetType(*args, **kwargs)
d55e5bfc
RD
1996
1997 def SetMimeType(*args, **kwargs):
5b5c9bc7
RD
1998 """SetMimeType(self, String mimetype)"""
1999 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
d55e5bfc 2000
2131d850 2001_core_.ImageHandler_swigregister(ImageHandler)
d55e5bfc 2002
943e8dfd
RD
2003class PyImageHandler(ImageHandler):
2004 """
2005 This is the base class for implementing image file loading/saving, and
2006 image creation from data, all written in Python. To create a custom
2007 image handler derive a new class from wx.PyImageHandler and provide
2008 the following methods::
2009
2010 def DoCanRead(self, stream) --> bool
2011 '''Check if this handler can read the image on the stream'''
2012
2013 def LoadFile(self, image, stream, verbose, index) --> bool
2014 '''Load image data from the stream and load it into image.'''
2015
2016 def SaveFile(self, image, stream, verbose) --> bool
2017 '''Save the iamge data in image to the stream using
2018 this handler's image file format.'''
2019
2020 def GetImageCount(self, stream) --> int
2021 '''If this image format can hold more than one image,
2022 how many does the image on the stream have?'''
2023
2024 To activate your handler create an instance of it and pass it to
2025 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2026 `SetExtension` from your constructor.
2027
2028 """
1bd55598
RD
2029 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2030 __repr__ = _swig_repr
2031 def __init__(self, *args, **kwargs):
943e8dfd
RD
2032 """
2033 __init__(self) -> PyImageHandler
2034
2035 This is the base class for implementing image file loading/saving, and
2036 image creation from data, all written in Python. To create a custom
2037 image handler derive a new class from wx.PyImageHandler and provide
2038 the following methods::
2039
2040 def DoCanRead(self, stream) --> bool
2041 '''Check if this handler can read the image on the stream'''
2042
2043 def LoadFile(self, image, stream, verbose, index) --> bool
2044 '''Load image data from the stream and load it into image.'''
2045
2046 def SaveFile(self, image, stream, verbose) --> bool
2047 '''Save the iamge data in image to the stream using
2048 this handler's image file format.'''
2049
2050 def GetImageCount(self, stream) --> int
2051 '''If this image format can hold more than one image,
2052 how many does the image on the stream have?'''
2053
2054 To activate your handler create an instance of it and pass it to
2055 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2056 `SetExtension` from your constructor.
2057
2058 """
1bd55598 2059 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
RD
2060 self._SetSelf(self)
2061
2062 def _SetSelf(*args, **kwargs):
2063 """_SetSelf(self, PyObject self)"""
2064 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2065
2131d850 2066_core_.PyImageHandler_swigregister(PyImageHandler)
943e8dfd 2067
5b5c9bc7
RD
2068class ImageHistogram(object):
2069 """Proxy of C++ ImageHistogram class"""
1bd55598
RD
2070 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2071 __repr__ = _swig_repr
2072 def __init__(self, *args, **kwargs):
5b5c9bc7 2073 """__init__(self) -> ImageHistogram"""
1bd55598 2074 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
d55e5bfc
RD
2075 def MakeKey(*args, **kwargs):
2076 """
7a27cf7c 2077 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2078
2079 Get the key in the histogram for the given RGB values
2080 """
5b5c9bc7 2081 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc
RD
2082
2083 MakeKey = staticmethod(MakeKey)
2084 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2085 """
2086 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2087
2088 Find first colour that is not used in the image and has higher RGB
2089 values than startR, startG, startB. Returns a tuple consisting of a
2090 success flag and rgb values.
2091 """
5b5c9bc7 2092 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2093
f1cbd8fa
RD
2094 def GetCount(*args, **kwargs):
2095 """
2096 GetCount(self, unsigned long key) -> unsigned long
2097
2098 Returns the pixel count for the given key. Use `MakeKey` to create a
2099 key value from a RGB tripple.
2100 """
5b5c9bc7 2101 return _core_.ImageHistogram_GetCount(*args, **kwargs)
f1cbd8fa
RD
2102
2103 def GetCountRGB(*args, **kwargs):
2104 """
7a27cf7c 2105 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2106
2107 Returns the pixel count for the given RGB values.
2108 """
5b5c9bc7 2109 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
f1cbd8fa
RD
2110
2111 def GetCountColour(*args, **kwargs):
2112 """
5b5c9bc7 2113 GetCountColour(self, Colour colour) -> unsigned long
f1cbd8fa
RD
2114
2115 Returns the pixel count for the given `wx.Colour` value.
2116 """
5b5c9bc7 2117 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
f1cbd8fa 2118
2131d850 2119_core_.ImageHistogram_swigregister(ImageHistogram)
d55e5bfc 2120
5b5c9bc7 2121def ImageHistogram_MakeKey(*args, **kwargs):
1bd55598 2122 """
7a27cf7c 2123 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2124
2125 Get the key in the histogram for the given RGB values
2126 """
1bd55598 2127 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2128
943e8dfd
RD
2129class Image_RGBValue(object):
2130 """
2131 An object that contains values for red, green and blue which represent
2132 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2133 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2134 color space.
2135 """
1bd55598
RD
2136 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2137 __repr__ = _swig_repr
2138 def __init__(self, *args, **kwargs):
943e8dfd
RD
2139 """
2140 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2141
2142 Constructor.
2143 """
1bd55598 2144 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
2145 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2146 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2147 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2148_core_.Image_RGBValue_swigregister(Image_RGBValue)
943e8dfd
RD
2149
2150class Image_HSVValue(object):
2151 """
2152 An object that contains values for hue, saturation and value which
2153 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2154 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2155 color space.
2156 """
1bd55598
RD
2157 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2158 __repr__ = _swig_repr
2159 def __init__(self, *args, **kwargs):
943e8dfd
RD
2160 """
2161 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2162
2163 Constructor.
2164 """
1bd55598 2165 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
2166 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2167 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2168 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2169_core_.Image_HSVValue_swigregister(Image_HSVValue)
943e8dfd 2170
5b5c9bc7 2171class Image(Object):
7a27cf7c
RD
2172 """
2173 A platform-independent image class. An image can be created from
2174 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2175 variety of formats. Functions are available to set and get image
2176 bits, so it can be used for basic image manipulation.
2177
2178 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2179 platform-specific `wx.Bitmap` object must be created from it using the
2180 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2181 device context, using `wx.DC.DrawBitmap`.
2182
2183 One colour value of the image may be used as a mask colour which will
2184 lead to the automatic creation of a `wx.Mask` object associated to the
2185 bitmap object.
2186
2187 wx.Image supports alpha channel data, that is in addition to a byte
2188 for the red, green and blue colour components for each pixel it also
2189 stores a byte representing the pixel opacity. An alpha value of 0
2190 corresponds to a transparent pixel (null opacity) while a value of 255
2191 means that the pixel is 100% opaque.
2192
2193 Unlike RGB data, not all images have an alpha channel and before using
2194 `GetAlpha` you should check if this image contains an alpha channel
2195 with `HasAlpha`. Note that currently only images loaded from PNG files
2196 with transparency information will have an alpha channel.
2197 """
1bd55598
RD
2198 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2199 __repr__ = _swig_repr
2200 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2201 """
2202 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2203
2204 Loads an image from a file.
2205 """
1bd55598
RD
2206 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2207 __swig_destroy__ = _core_.delete_Image
2208 __del__ = lambda self : None;
d55e5bfc 2209 def Create(*args, **kwargs):
7a27cf7c
RD
2210 """
2211 Create(self, int width, int height, bool clear=True)
2212
2213 Creates a fresh image. If clear is ``True``, the new image will be
2214 initialized to black. Otherwise, the image data will be uninitialized.
2215 """
5b5c9bc7 2216 return _core_.Image_Create(*args, **kwargs)
d55e5bfc
RD
2217
2218 def Destroy(*args, **kwargs):
2219 """
2220 Destroy(self)
2221
7a27cf7c 2222 Destroys the image data.
d55e5bfc 2223 """
7e08d4ef
RD
2224 val = _core_.Image_Destroy(*args, **kwargs)
2225 args[0].thisown = 0
2226 return val
d55e5bfc
RD
2227
2228 def Scale(*args, **kwargs):
7a27cf7c
RD
2229 """
2230 Scale(self, int width, int height) -> Image
2231
2232 Returns a scaled version of the image. This is also useful for scaling
2233 bitmaps in general as the only other way to scale bitmaps is to blit a
2234 `wx.MemoryDC` into another `wx.MemoryDC`.
2235 """
5b5c9bc7 2236 return _core_.Image_Scale(*args, **kwargs)
d55e5bfc
RD
2237
2238 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2239 """
2240 ShrinkBy(self, int xFactor, int yFactor) -> Image
2241
2242 Return a version of the image scaled smaller by the given factors.
2243 """
5b5c9bc7 2244 return _core_.Image_ShrinkBy(*args, **kwargs)
d55e5bfc
RD
2245
2246 def Rescale(*args, **kwargs):
7a27cf7c
RD
2247 """
2248 Rescale(self, int width, int height) -> Image
2249
2250 Changes the size of the image in-place by scaling it: after a call to
2251 this function, the image will have the given width and height.
2252
2253 Returns the (modified) image itself.
2254 """
5b5c9bc7 2255 return _core_.Image_Rescale(*args, **kwargs)
d55e5bfc 2256
aff4cc5c 2257 def Resize(*args, **kwargs):
7a27cf7c
RD
2258 """
2259 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2260
2261 Changes the size of the image in-place without scaling it, by adding
2262 either a border with the given colour or cropping as necessary. The
2263 image is pasted into a new image with the given size and background
2264 colour at the position pos relative to the upper left of the new
2265 image. If red = green = blue = -1 then use either the current mask
2266 colour if set or find, use, and set a suitable mask colour for any
2267 newly exposed areas.
2268
2269 Returns the (modified) image itself.
2270 """
5b5c9bc7 2271 return _core_.Image_Resize(*args, **kwargs)
aff4cc5c 2272
d55e5bfc 2273 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2274 """
2275 SetRGB(self, int x, int y, byte r, byte g, byte b)
2276
2277 Sets the pixel at the given coordinate. This routine performs
2278 bounds-checks for the coordinate so it can be considered a safe way to
2279 manipulate the data, but in some cases this might be too slow so that
2280 the data will have to be set directly. In that case you will have to
2281 get access to the image data using the `GetData` method.
2282 """
5b5c9bc7 2283 return _core_.Image_SetRGB(*args, **kwargs)
d55e5bfc 2284
aff4cc5c 2285 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2286 """
2287 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2288
2289 Sets the colour of the pixels within the given rectangle. This routine
2290 performs bounds-checks for the rectangle so it can be considered a
2291 safe way to manipulate the data.
2292 """
5b5c9bc7 2293 return _core_.Image_SetRGBRect(*args, **kwargs)
aff4cc5c 2294
d55e5bfc 2295 def GetRed(*args, **kwargs):
7a27cf7c
RD
2296 """
2297 GetRed(self, int x, int y) -> byte
2298
2299 Returns the red intensity at the given coordinate.
2300 """
5b5c9bc7 2301 return _core_.Image_GetRed(*args, **kwargs)
d55e5bfc
RD
2302
2303 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2304 """
2305 GetGreen(self, int x, int y) -> byte
2306
2307 Returns the green intensity at the given coordinate.
2308 """
5b5c9bc7 2309 return _core_.Image_GetGreen(*args, **kwargs)
d55e5bfc
RD
2310
2311 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2312 """
2313 GetBlue(self, int x, int y) -> byte
2314
2315 Returns the blue intensity at the given coordinate.
2316 """
5b5c9bc7 2317 return _core_.Image_GetBlue(*args, **kwargs)
d55e5bfc
RD
2318
2319 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2320 """
2321 SetAlpha(self, int x, int y, byte alpha)
2322
2323 Sets the alpha value for the given pixel. This function should only be
2324 called if the image has alpha channel data, use `HasAlpha` to check
2325 for this.
2326 """
5b5c9bc7 2327 return _core_.Image_SetAlpha(*args, **kwargs)
d55e5bfc
RD
2328
2329 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2330 """
2331 GetAlpha(self, int x, int y) -> byte
2332
2333 Returns the alpha value for the given pixel. This function may only be
2334 called for the images with alpha channel, use `HasAlpha` to check for
2335 this.
2336
2337 The returned value is the *opacity* of the image, i.e. the value of 0
2338 corresponds to the fully transparent pixels while the value of 255 to
2339 the fully opaque pixels.
2340 """
5b5c9bc7 2341 return _core_.Image_GetAlpha(*args, **kwargs)
d55e5bfc
RD
2342
2343 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2344 """
2345 HasAlpha(self) -> bool
2346
2347 Returns true if this image has alpha channel, false otherwise.
2348 """
5b5c9bc7 2349 return _core_.Image_HasAlpha(*args, **kwargs)
d55e5bfc 2350
68350608
RD
2351 def InitAlpha(*args, **kwargs):
2352 """
2353 InitAlpha(self)
2354
2355 Initializes the image alpha channel data. It is an error to call it if
2356 the image already has alpha data. If it doesn't, alpha data will be by
2357 default initialized to all pixels being fully opaque. But if the image
2358 has a a mask colour, all mask pixels will be completely transparent.
2359 """
5b5c9bc7
RD
2360 return _core_.Image_InitAlpha(*args, **kwargs)
2361
2362 def IsTransparent(*args, **kwargs):
2363 """
7a27cf7c 2364 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
5b5c9bc7 2365
7a27cf7c
RD
2366 Returns ``True`` if this pixel is masked or has an alpha value less
2367 than the spcified threshold.
5b5c9bc7
RD
2368 """
2369 return _core_.Image_IsTransparent(*args, **kwargs)
68350608 2370
d55e5bfc 2371 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2372 """
2373 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2374
2375 Find first colour that is not used in the image and has higher RGB
2376 values than startR, startG, startB. Returns a tuple consisting of a
2377 success flag and rgb values.
2378 """
5b5c9bc7 2379 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2380
4cf4100f
RD
2381 def ConvertAlphaToMask(*args, **kwargs):
2382 """
5b5c9bc7 2383 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2384
7a27cf7c
RD
2385 If the image has alpha channel, this method converts it to mask. All
2386 pixels with alpha value less than ``threshold`` are replaced with the
2387 mask colour and the alpha channel is removed. The mask colour is
2388 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2389
2390 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2391 nothing.
2392 """
5b5c9bc7 2393 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
4cf4100f 2394
8fb0e70a
RD
2395 def ConvertColourToAlpha(*args, **kwargs):
2396 """
7a27cf7c 2397 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2398
2399 This method converts an image where the original alpha information is
2400 only available as a shades of a colour (actually shades of grey)
2401 typically when you draw anti-aliased text into a bitmap. The DC
2402 drawing routines draw grey values on the black background although
2403 they actually mean to draw white with differnt alpha values. This
2404 method reverses it, assuming a black (!) background and white text.
2405 The method will then fill up the whole image with the colour given.
2406 """
5b5c9bc7 2407 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
8fb0e70a 2408
d55e5bfc 2409 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2410 """
2411 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2412
2413 Sets the image's mask so that the pixels that have RGB value of
2414 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2415 by first finding an unused colour in the image, setting this colour as
2416 the mask colour and then using this colour to draw all pixels in the
2417 image who corresponding pixel in mask has given RGB value.
2418
2419 Returns ``False`` if ``mask`` does not have same dimensions as the
2420 image or if there is no unused colour left. Returns ``True`` if the
2421 mask was successfully applied.
2422
2423 Note that this method involves computing the histogram, which is
2424 computationally intensive operation.
2425 """
5b5c9bc7 2426 return _core_.Image_SetMaskFromImage(*args, **kwargs)
d55e5bfc
RD
2427
2428 def CanRead(*args, **kwargs):
7a27cf7c
RD
2429 """
2430 CanRead(String filename) -> bool
2431
2432 Returns True if the image handlers can read this file.
2433 """
5b5c9bc7 2434 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
RD
2435
2436 CanRead = staticmethod(CanRead)
2437 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2438 """
2439 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2440
2441 If the image file contains more than one image and the image handler
2442 is capable of retrieving these individually, this function will return
2443 the number of available images.
2444 """
5b5c9bc7 2445 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
RD
2446
2447 GetImageCount = staticmethod(GetImageCount)
2448 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2449 """
2450 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2451
2452 Loads an image from a file. If no handler type is provided, the
2453 library will try to autodetect the format.
2454 """
5b5c9bc7 2455 return _core_.Image_LoadFile(*args, **kwargs)
d55e5bfc
RD
2456
2457 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2458 """
2459 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2460
2461 Loads an image from a file, specifying the image type with a MIME type
2462 string.
2463 """
5b5c9bc7 2464 return _core_.Image_LoadMimeFile(*args, **kwargs)
d55e5bfc
RD
2465
2466 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2467 """
2468 SaveFile(self, String name, int type) -> bool
2469
2470 Saves an image in the named file.
2471 """
5b5c9bc7 2472 return _core_.Image_SaveFile(*args, **kwargs)
d55e5bfc
RD
2473
2474 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2475 """
2476 SaveMimeFile(self, String name, String mimetype) -> bool
2477
2478 Saves an image in the named file.
2479 """
5b5c9bc7 2480 return _core_.Image_SaveMimeFile(*args, **kwargs)
d55e5bfc
RD
2481
2482 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2483 """
2484 CanReadStream(InputStream stream) -> bool
2485
2486 Returns True if the image handlers can read an image file from the
2487 data currently on the input stream, or a readable Python file-like
2488 object.
2489 """
5b5c9bc7 2490 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
RD
2491
2492 CanReadStream = staticmethod(CanReadStream)
2493 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2494 """
2495 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2496
2497 Loads an image from an input stream or a readable Python file-like
2498 object. If no handler type is provided, the library will try to
2499 autodetect the format.
2500 """
5b5c9bc7 2501 return _core_.Image_LoadStream(*args, **kwargs)
d55e5bfc
RD
2502
2503 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2504 """
2505 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2506
2507 Loads an image from an input stream or a readable Python file-like
2508 object, using a MIME type string to specify the image file format.
2509 """
5b5c9bc7 2510 return _core_.Image_LoadMimeStream(*args, **kwargs)
d55e5bfc
RD
2511
2512 def Ok(*args, **kwargs):
7a27cf7c
RD
2513 """
2514 Ok(self) -> bool
2515
2516 Returns true if image data is present.
2517 """
5b5c9bc7 2518 return _core_.Image_Ok(*args, **kwargs)
d55e5bfc
RD
2519
2520 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2521 """
2522 GetWidth(self) -> int
2523
2524 Gets the width of the image in pixels.
2525 """
5b5c9bc7 2526 return _core_.Image_GetWidth(*args, **kwargs)
d55e5bfc
RD
2527
2528 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2529 """
2530 GetHeight(self) -> int
2531
2532 Gets the height of the image in pixels.
2533 """
5b5c9bc7 2534 return _core_.Image_GetHeight(*args, **kwargs)
d55e5bfc
RD
2535
2536 def GetSize(*args, **kwargs):
7a27cf7c
RD
2537 """
2538 GetSize(self) -> Size
2539
2540 Returns the size of the image in pixels.
2541 """
5b5c9bc7 2542 return _core_.Image_GetSize(*args, **kwargs)
d55e5bfc
RD
2543
2544 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2545 """
2546 GetSubImage(self, Rect rect) -> Image
2547
2548 Returns a sub image of the current one as long as the rect belongs
2549 entirely to the image.
2550 """
5b5c9bc7 2551 return _core_.Image_GetSubImage(*args, **kwargs)
d55e5bfc 2552
aff4cc5c 2553 def Size(*args, **kwargs):
7a27cf7c
RD
2554 """
2555 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2556
2557 Returns a resized version of this image without scaling it by adding
2558 either a border with the given colour or cropping as necessary. The
2559 image is pasted into a new image with the given size and background
2560 colour at the position ``pos`` relative to the upper left of the new
2561 image. If red = green = blue = -1 then use either the current mask
2562 colour if set or find, use, and set a suitable mask colour for any
2563 newly exposed areas.
2564 """
5b5c9bc7 2565 return _core_.Image_Size(*args, **kwargs)
aff4cc5c 2566
d55e5bfc 2567 def Copy(*args, **kwargs):
7a27cf7c
RD
2568 """
2569 Copy(self) -> Image
2570
2571 Returns an identical copy of the image.
2572 """
5b5c9bc7 2573 return _core_.Image_Copy(*args, **kwargs)
d55e5bfc
RD
2574
2575 def Paste(*args, **kwargs):
7a27cf7c
RD
2576 """
2577 Paste(self, Image image, int x, int y)
2578
2579 Pastes ``image`` into this instance and takes care of the mask colour
2580 and any out of bounds problems.
2581 """
5b5c9bc7 2582 return _core_.Image_Paste(*args, **kwargs)
d55e5bfc
RD
2583
2584 def GetData(*args, **kwargs):
bb2ef2cc
RD
2585 """
2586 GetData(self) -> PyObject
2587
2588 Returns a string containing a copy of the RGB bytes of the image.
2589 """
5b5c9bc7 2590 return _core_.Image_GetData(*args, **kwargs)
d55e5bfc
RD
2591
2592 def SetData(*args, **kwargs):
bb2ef2cc
RD
2593 """
2594 SetData(self, buffer data)
2595
2596 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2597 either a string or a buffer object holding the data and the length of
2598 the data must be width*height*3.
2599 """
5b5c9bc7 2600 return _core_.Image_SetData(*args, **kwargs)
d55e5bfc
RD
2601
2602 def GetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2603 """
2604 GetDataBuffer(self) -> PyObject
2605
2606 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2607 image data buffer inside the wx.Image. You need to ensure that you do
2608 not use this buffer object after the image has been destroyed.
bb2ef2cc 2609 """
5b5c9bc7 2610 return _core_.Image_GetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2611
2612 def SetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2613 """
2614 SetDataBuffer(self, buffer data)
2615
2616 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2617 object. This can save making an extra copy of the data but you must
2618 ensure that the buffer object lives longer than the wx.Image does.
bb2ef2cc 2619 """
5b5c9bc7 2620 return _core_.Image_SetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2621
2622 def GetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2623 """
2624 GetAlphaData(self) -> PyObject
2625
2626 Returns a string containing a copy of the alpha bytes of the image.
2627 """
5b5c9bc7 2628 return _core_.Image_GetAlphaData(*args, **kwargs)
d55e5bfc
RD
2629
2630 def SetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2631 """
2632 SetAlphaData(self, buffer alpha)
2633
2634 Resets the Image's alpha data from a buffer of bytes. Accepts either
2635 a string or a buffer object holding the data and the length of the
2636 data must be width*height.
2637 """
5b5c9bc7 2638 return _core_.Image_SetAlphaData(*args, **kwargs)
d55e5bfc
RD
2639
2640 def GetAlphaBuffer(*args, **kwargs):
2641 """GetAlphaBuffer(self) -> PyObject"""
5b5c9bc7 2642 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2643
2644 def SetAlphaBuffer(*args, **kwargs):
bb2ef2cc 2645 """SetAlphaBuffer(self, buffer alpha)"""
5b5c9bc7 2646 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2647
2648 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2649 """
2650 SetMaskColour(self, byte r, byte g, byte b)
2651
2652 Sets the mask colour for this image (and tells the image to use the
2653 mask).
2654 """
5b5c9bc7 2655 return _core_.Image_SetMaskColour(*args, **kwargs)
d55e5bfc 2656
aff4cc5c
RD
2657 def GetOrFindMaskColour(*args, **kwargs):
2658 """
2659 GetOrFindMaskColour() -> (r,g,b)
2660
2661 Get the current mask colour or find a suitable colour.
2662 """
5b5c9bc7 2663 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
aff4cc5c 2664
d55e5bfc 2665 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2666 """
2667 GetMaskRed(self) -> byte
2668
2669 Gets the red component of the mask colour.
2670 """
5b5c9bc7 2671 return _core_.Image_GetMaskRed(*args, **kwargs)
d55e5bfc
RD
2672
2673 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2674 """
2675 GetMaskGreen(self) -> byte
2676
2677 Gets the green component of the mask colour.
2678 """
5b5c9bc7 2679 return _core_.Image_GetMaskGreen(*args, **kwargs)
d55e5bfc
RD
2680
2681 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2682 """
2683 GetMaskBlue(self) -> byte
2684
2685 Gets the blue component of the mask colour.
2686 """
5b5c9bc7 2687 return _core_.Image_GetMaskBlue(*args, **kwargs)
d55e5bfc
RD
2688
2689 def SetMask(*args, **kwargs):
7a27cf7c
RD
2690 """
2691 SetMask(self, bool mask=True)
2692
2693 Specifies whether there is a mask or not. The area of the mask is
2694 determined by the current mask colour.
2695 """
5b5c9bc7 2696 return _core_.Image_SetMask(*args, **kwargs)
d55e5bfc
RD
2697
2698 def HasMask(*args, **kwargs):
7a27cf7c
RD
2699 """
2700 HasMask(self) -> bool
2701
2702 Returns ``True`` if there is a mask active, ``False`` otherwise.
2703 """
5b5c9bc7 2704 return _core_.Image_HasMask(*args, **kwargs)
d55e5bfc
RD
2705
2706 def Rotate(*args, **kwargs):
2707 """
5b5c9bc7
RD
2708 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2709 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2710
2711 Rotates the image about the given point, by ``angle`` radians. Passing
2712 ``True`` to ``interpolating`` results in better image quality, but is
2713 slower. If the image has a mask, then the mask colour is used for the
2714 uncovered pixels in the rotated image background. Otherwise, black
2715 will be used as the fill colour.
2716
2717 Returns the rotated image, leaving this image intact.
d55e5bfc 2718 """
5b5c9bc7 2719 return _core_.Image_Rotate(*args, **kwargs)
d55e5bfc
RD
2720
2721 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2722 """
2723 Rotate90(self, bool clockwise=True) -> Image
2724
2725 Returns a copy of the image rotated 90 degrees in the direction
2726 indicated by ``clockwise``.
2727 """
5b5c9bc7 2728 return _core_.Image_Rotate90(*args, **kwargs)
d55e5bfc
RD
2729
2730 def Mirror(*args, **kwargs):
7a27cf7c
RD
2731 """
2732 Mirror(self, bool horizontally=True) -> Image
2733
2734 Returns a mirrored copy of the image. The parameter ``horizontally``
2735 indicates the orientation.
2736 """
5b5c9bc7 2737 return _core_.Image_Mirror(*args, **kwargs)
d55e5bfc
RD
2738
2739 def Replace(*args, **kwargs):
2740 """
7a27cf7c
RD
2741 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2742
2743 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2744 ``(r2,g2,b2)``.
d55e5bfc 2745 """
5b5c9bc7 2746 return _core_.Image_Replace(*args, **kwargs)
d55e5bfc 2747
32fe5131
RD
2748 def ConvertToGreyscale(*args, **kwargs):
2749 """
2750 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2751
2752 Convert to greyscale image. Uses the luminance component (Y) of the
2753 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2754 defaults to ITU-T BT.601
2755 """
2756 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2757
d55e5bfc 2758 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2759 """
2760 ConvertToMono(self, byte r, byte g, byte b) -> Image
2761
2762 Returns monochromatic version of the image. The returned image has
2763 white colour where the original has ``(r,g,b)`` colour and black
2764 colour everywhere else.
2765 """
5b5c9bc7 2766 return _core_.Image_ConvertToMono(*args, **kwargs)
d55e5bfc
RD
2767
2768 def SetOption(*args, **kwargs):
7a27cf7c
RD
2769 """
2770 SetOption(self, String name, String value)
2771
2772 Sets an image handler defined option. For example, when saving as a
2773 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2774 number between 0 and 100 (0 is terrible, 100 is very good).
2775 """
5b5c9bc7 2776 return _core_.Image_SetOption(*args, **kwargs)
d55e5bfc
RD
2777
2778 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2779 """
2780 SetOptionInt(self, String name, int value)
2781
2782 Sets an image option as an integer.
2783 """
5b5c9bc7 2784 return _core_.Image_SetOptionInt(*args, **kwargs)
d55e5bfc
RD
2785
2786 def GetOption(*args, **kwargs):
7a27cf7c
RD
2787 """
2788 GetOption(self, String name) -> String
2789
2790 Gets the value of an image handler option.
2791 """
5b5c9bc7 2792 return _core_.Image_GetOption(*args, **kwargs)
d55e5bfc
RD
2793
2794 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2795 """
2796 GetOptionInt(self, String name) -> int
2797
2798 Gets the value of an image handler option as an integer. If the given
2799 option is not present, the function returns 0.
2800 """
5b5c9bc7 2801 return _core_.Image_GetOptionInt(*args, **kwargs)
d55e5bfc
RD
2802
2803 def HasOption(*args, **kwargs):
7a27cf7c
RD
2804 """
2805 HasOption(self, String name) -> bool
2806
2807 Returns true if the given option is present.
2808 """
5b5c9bc7 2809 return _core_.Image_HasOption(*args, **kwargs)
d55e5bfc
RD
2810
2811 def CountColours(*args, **kwargs):
2812 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
5b5c9bc7 2813 return _core_.Image_CountColours(*args, **kwargs)
d55e5bfc
RD
2814
2815 def ComputeHistogram(*args, **kwargs):
5b5c9bc7
RD
2816 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2817 return _core_.Image_ComputeHistogram(*args, **kwargs)
d55e5bfc
RD
2818
2819 def AddHandler(*args, **kwargs):
5b5c9bc7
RD
2820 """AddHandler(ImageHandler handler)"""
2821 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
2822
2823 AddHandler = staticmethod(AddHandler)
2824 def InsertHandler(*args, **kwargs):
5b5c9bc7
RD
2825 """InsertHandler(ImageHandler handler)"""
2826 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
2827
2828 InsertHandler = staticmethod(InsertHandler)
2829 def RemoveHandler(*args, **kwargs):
5b5c9bc7
RD
2830 """RemoveHandler(String name) -> bool"""
2831 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc
RD
2832
2833 RemoveHandler = staticmethod(RemoveHandler)
1bd55598
RD
2834 def GetHandlers(*args, **kwargs):
2835 """GetHandlers() -> PyObject"""
2836 return _core_.Image_GetHandlers(*args, **kwargs)
2837
2838 GetHandlers = staticmethod(GetHandlers)
d55e5bfc 2839 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2840 """
2841 GetImageExtWildcard() -> String
2842
2843 Iterates all registered wxImageHandler objects, and returns a string
2844 containing file extension masks suitable for passing to file open/save
2845 dialog boxes.
2846 """
5b5c9bc7 2847 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc
RD
2848
2849 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2850 def ConvertToBitmap(*args, **kwargs):
5b5c9bc7
RD
2851 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2852 return _core_.Image_ConvertToBitmap(*args, **kwargs)
d55e5bfc
RD
2853
2854 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 2855 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
5b5c9bc7 2856 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
d55e5bfc 2857
943e8dfd
RD
2858 def RotateHue(*args, **kwargs):
2859 """
2860 RotateHue(self, double angle)
2861
2862 Rotates the hue of each pixel of the image. Hue is a double in the
2863 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2864 """
2865 return _core_.Image_RotateHue(*args, **kwargs)
2866
2867 def RGBtoHSV(*args, **kwargs):
2868 """
2869 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2870
2871 Converts a color in RGB color space to HSV color space.
2872 """
2873 return _core_.Image_RGBtoHSV(*args, **kwargs)
2874
2875 RGBtoHSV = staticmethod(RGBtoHSV)
2876 def HSVtoRGB(*args, **kwargs):
2877 """
2878 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2879
2880 Converts a color in HSV color space to RGB color space.
2881 """
2882 return _core_.Image_HSVtoRGB(*args, **kwargs)
2883
2884 HSVtoRGB = staticmethod(HSVtoRGB)
d55e5bfc 2885 def __nonzero__(self): return self.Ok()
2131d850 2886_core_.Image_swigregister(Image)
d55e5bfc
RD
2887
2888def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
2889 """
2890 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2891
2892 Loads an image from a file, using a MIME type string (such as
2893 'image/jpeg') to specify image type.
2894 """
5b5c9bc7 2895 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
2896 return val
2897
2898def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
2899 """
2900 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2901
2902 Loads an image from an input stream, or any readable Python file-like
2903 object.
2904 """
5b5c9bc7 2905 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
2906 return val
2907
2908def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
2909 """
2910 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2911
2912 Loads an image from an input stream, or any readable Python file-like
2913 object, specifying the image format with a MIME type string.
2914 """
5b5c9bc7 2915 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
2916 return val
2917
d6c14a4c 2918def EmptyImage(*args, **kwargs):
bb2ef2cc 2919 """
5b5c9bc7 2920 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
bb2ef2cc
RD
2921
2922 Construct an empty image of a given size, optionally setting all
2923 pixels to black.
2924 """
5b5c9bc7 2925 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
2926 return val
2927
2928def ImageFromBitmap(*args, **kwargs):
bb2ef2cc 2929 """
5b5c9bc7 2930 ImageFromBitmap(Bitmap bitmap) -> Image
bb2ef2cc
RD
2931
2932 Construct an Image from a `wx.Bitmap`.
2933 """
5b5c9bc7 2934 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
2935 return val
2936
2937def ImageFromData(*args, **kwargs):
bb2ef2cc 2938 """
5b5c9bc7 2939 ImageFromData(int width, int height, buffer data) -> Image
bb2ef2cc
RD
2940
2941 Construct an Image from a buffer of RGB bytes. Accepts either a
2942 string or a buffer object holding the data and the length of the data
2943 must be width*height*3.
2944 """
5b5c9bc7 2945 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
2946 return val
2947
03e46024 2948def ImageFromDataWithAlpha(*args, **kwargs):
bb2ef2cc 2949 """
5b5c9bc7 2950 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
bb2ef2cc
RD
2951
2952 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2953 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
2954 length of the data must be width*height*3 bytes, and the length of the
2955 alpha data must be width*height bytes.
bb2ef2cc 2956 """
5b5c9bc7 2957 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
03e46024
RD
2958 return val
2959
5b5c9bc7 2960def Image_CanRead(*args, **kwargs):
1bd55598 2961 """
7a27cf7c
RD
2962 Image_CanRead(String filename) -> bool
2963
2964 Returns True if the image handlers can read this file.
2965 """
1bd55598 2966 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc 2967
5b5c9bc7 2968def Image_GetImageCount(*args, **kwargs):
1bd55598 2969 """
7a27cf7c
RD
2970 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2971
2972 If the image file contains more than one image and the image handler
2973 is capable of retrieving these individually, this function will return
2974 the number of available images.
2975 """
1bd55598 2976 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc 2977
5b5c9bc7 2978def Image_CanReadStream(*args, **kwargs):
1bd55598 2979 """
7a27cf7c
RD
2980 Image_CanReadStream(InputStream stream) -> bool
2981
2982 Returns True if the image handlers can read an image file from the
2983 data currently on the input stream, or a readable Python file-like
2984 object.
2985 """
1bd55598 2986 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc 2987
5b5c9bc7 2988def Image_AddHandler(*args, **kwargs):
1bd55598
RD
2989 """Image_AddHandler(ImageHandler handler)"""
2990 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc 2991
5b5c9bc7 2992def Image_InsertHandler(*args, **kwargs):
1bd55598
RD
2993 """Image_InsertHandler(ImageHandler handler)"""
2994 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc 2995
5b5c9bc7 2996def Image_RemoveHandler(*args, **kwargs):
1bd55598
RD
2997 """Image_RemoveHandler(String name) -> bool"""
2998 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 2999
1bd55598
RD
3000def Image_GetHandlers(*args):
3001 """Image_GetHandlers() -> PyObject"""
3002 return _core_.Image_GetHandlers(*args)
3003
3004def Image_GetImageExtWildcard(*args):
3005 """
7a27cf7c
RD
3006 Image_GetImageExtWildcard() -> String
3007
3008 Iterates all registered wxImageHandler objects, and returns a string
3009 containing file extension masks suitable for passing to file open/save
3010 dialog boxes.
3011 """
1bd55598 3012 return _core_.Image_GetImageExtWildcard(*args)
d55e5bfc 3013
943e8dfd 3014def Image_RGBtoHSV(*args, **kwargs):
1bd55598 3015 """
943e8dfd
RD
3016 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3017
3018 Converts a color in RGB color space to HSV color space.
3019 """
1bd55598 3020 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3021
3022def Image_HSVtoRGB(*args, **kwargs):
1bd55598 3023 """
943e8dfd
RD
3024 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3025
3026 Converts a color in HSV color space to RGB color space.
3027 """
1bd55598 3028 return _core_.Image_HSVtoRGB(*args, **kwargs)
943e8dfd 3029
68e533f8
RD
3030def InitAllImageHandlers():
3031 """
3032 The former functionality of InitAllImageHanders is now done internal to
3033 the _core_ extension module and so this function has become a simple NOP.
3034 """
3035 pass
d55e5bfc 3036
5b5c9bc7
RD
3037IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3038IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3039PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3040PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3041PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3042BMP_24BPP = _core_.BMP_24BPP
3043BMP_8BPP = _core_.BMP_8BPP
3044BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3045BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3046BMP_8BPP_RED = _core_.BMP_8BPP_RED
3047BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3048BMP_4BPP = _core_.BMP_4BPP
3049BMP_1BPP = _core_.BMP_1BPP
3050BMP_1BPP_BW = _core_.BMP_1BPP_BW
3051class BMPHandler(ImageHandler):
27fb7603 3052 """A `wx.ImageHandler` for \*.bmp bitmap files."""
1bd55598
RD
3053 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3054 __repr__ = _swig_repr
3055 def __init__(self, *args, **kwargs):
27fb7603
RD
3056 """
3057 __init__(self) -> BMPHandler
3058
3059 A `wx.ImageHandler` for \*.bmp bitmap files.
3060 """
1bd55598 3061 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3062_core_.BMPHandler_swigregister(BMPHandler)
5b5c9bc7 3063NullImage = cvar.NullImage
68350608 3064IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3065IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3066IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3067IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3068IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3069IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3070IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3071IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3072IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3073IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3074IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3075IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3076IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
7fbf8399
RD
3077IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3078IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc 3079
5b5c9bc7 3080class ICOHandler(BMPHandler):
27fb7603 3081 """A `wx.ImageHandler` for \*.ico icon files."""
1bd55598
RD
3082 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3083 __repr__ = _swig_repr
3084 def __init__(self, *args, **kwargs):
27fb7603
RD
3085 """
3086 __init__(self) -> ICOHandler
3087
3088 A `wx.ImageHandler` for \*.ico icon files.
3089 """
1bd55598 3090 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3091_core_.ICOHandler_swigregister(ICOHandler)
d55e5bfc 3092
5b5c9bc7 3093class CURHandler(ICOHandler):
27fb7603 3094 """A `wx.ImageHandler` for \*.cur cursor files."""
1bd55598
RD
3095 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3096 __repr__ = _swig_repr
3097 def __init__(self, *args, **kwargs):
27fb7603
RD
3098 """
3099 __init__(self) -> CURHandler
3100
3101 A `wx.ImageHandler` for \*.cur cursor files.
3102 """
1bd55598 3103 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3104_core_.CURHandler_swigregister(CURHandler)
d55e5bfc 3105
5b5c9bc7 3106class ANIHandler(CURHandler):
27fb7603 3107 """A `wx.ImageHandler` for \*.ani animated cursor files."""
1bd55598
RD
3108 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3109 __repr__ = _swig_repr
3110 def __init__(self, *args, **kwargs):
27fb7603
RD
3111 """
3112 __init__(self) -> ANIHandler
3113
3114 A `wx.ImageHandler` for \*.ani animated cursor files.
3115 """
1bd55598 3116 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3117_core_.ANIHandler_swigregister(ANIHandler)
d55e5bfc 3118
5b5c9bc7 3119class PNGHandler(ImageHandler):
27fb7603 3120 """A `wx.ImageHandler` for PNG image files."""
1bd55598
RD
3121 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3122 __repr__ = _swig_repr
3123 def __init__(self, *args, **kwargs):
27fb7603
RD
3124 """
3125 __init__(self) -> PNGHandler
3126
3127 A `wx.ImageHandler` for PNG image files.
3128 """
1bd55598 3129 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3130_core_.PNGHandler_swigregister(PNGHandler)
d55e5bfc 3131
5b5c9bc7 3132class GIFHandler(ImageHandler):
27fb7603 3133 """A `wx.ImageHandler` for GIF image files."""
1bd55598
RD
3134 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3135 __repr__ = _swig_repr
3136 def __init__(self, *args, **kwargs):
27fb7603
RD
3137 """
3138 __init__(self) -> GIFHandler
3139
3140 A `wx.ImageHandler` for GIF image files.
3141 """
1bd55598 3142 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3143_core_.GIFHandler_swigregister(GIFHandler)
d55e5bfc 3144
5b5c9bc7 3145class PCXHandler(ImageHandler):
27fb7603 3146 """A `wx.ImageHandler` for PCX imager files."""
1bd55598
RD
3147 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3148 __repr__ = _swig_repr
3149 def __init__(self, *args, **kwargs):
27fb7603
RD
3150 """
3151 __init__(self) -> PCXHandler
3152
3153 A `wx.ImageHandler` for PCX imager files.
3154 """
1bd55598 3155 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3156_core_.PCXHandler_swigregister(PCXHandler)
d55e5bfc 3157
5b5c9bc7 3158class JPEGHandler(ImageHandler):
27fb7603 3159 """A `wx.ImageHandler` for JPEG/JPG image files."""
1bd55598
RD
3160 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3161 __repr__ = _swig_repr
3162 def __init__(self, *args, **kwargs):
27fb7603
RD
3163 """
3164 __init__(self) -> JPEGHandler
3165
3166 A `wx.ImageHandler` for JPEG/JPG image files.
3167 """
1bd55598 3168 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3169_core_.JPEGHandler_swigregister(JPEGHandler)
d55e5bfc 3170
5b5c9bc7 3171class PNMHandler(ImageHandler):
27fb7603 3172 """A `wx.ImageHandler` for PNM image files."""
1bd55598
RD
3173 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3174 __repr__ = _swig_repr
3175 def __init__(self, *args, **kwargs):
27fb7603
RD
3176 """
3177 __init__(self) -> PNMHandler
3178
3179 A `wx.ImageHandler` for PNM image files.
3180 """
1bd55598 3181 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3182_core_.PNMHandler_swigregister(PNMHandler)
d55e5bfc 3183
5b5c9bc7 3184class XPMHandler(ImageHandler):
27fb7603 3185 """A `wx.ImageHandler` for XPM image."""
1bd55598
RD
3186 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3187 __repr__ = _swig_repr
3188 def __init__(self, *args, **kwargs):
27fb7603
RD
3189 """
3190 __init__(self) -> XPMHandler
3191
3192 A `wx.ImageHandler` for XPM image.
3193 """
1bd55598 3194 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3195_core_.XPMHandler_swigregister(XPMHandler)
d55e5bfc 3196
5b5c9bc7 3197class TIFFHandler(ImageHandler):
27fb7603 3198 """A `wx.ImageHandler` for TIFF image files."""
1bd55598
RD
3199 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3200 __repr__ = _swig_repr
3201 def __init__(self, *args, **kwargs):
27fb7603
RD
3202 """
3203 __init__(self) -> TIFFHandler
3204
3205 A `wx.ImageHandler` for TIFF image files.
3206 """
1bd55598 3207 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3208_core_.TIFFHandler_swigregister(TIFFHandler)
d55e5bfc 3209
5b5c9bc7
RD
3210QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3211QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3212class Quantize(object):
c0de73ae 3213 """Performs quantization, or colour reduction, on a wxImage."""
1bd55598
RD
3214 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3215 def __init__(self): raise AttributeError, "No constructor defined"
3216 __repr__ = _swig_repr
c0de73ae
RD
3217 def Quantize(*args, **kwargs):
3218 """
5b5c9bc7 3219 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3220
3221 Reduce the colours in the source image and put the result into the
3222 destination image, setting the palette in the destination if
3223 needed. Both images may be the same, to overwrite the source image.
3224 """
5b5c9bc7 3225 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae
RD
3226
3227 Quantize = staticmethod(Quantize)
2131d850 3228_core_.Quantize_swigregister(Quantize)
c0de73ae 3229
5b5c9bc7 3230def Quantize_Quantize(*args, **kwargs):
1bd55598 3231 """
5b5c9bc7 3232 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3233
3234 Reduce the colours in the source image and put the result into the
3235 destination image, setting the palette in the destination if
3236 needed. Both images may be the same, to overwrite the source image.
3237 """
1bd55598 3238 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3239
d55e5bfc
RD
3240#---------------------------------------------------------------------------
3241
5b5c9bc7
RD
3242class EvtHandler(Object):
3243 """Proxy of C++ EvtHandler class"""
1bd55598
RD
3244 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3245 __repr__ = _swig_repr
3246 def __init__(self, *args, **kwargs):
5b5c9bc7 3247 """__init__(self) -> EvtHandler"""
1bd55598 3248 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d55e5bfc 3249 def GetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3250 """GetNextHandler(self) -> EvtHandler"""
3251 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
d55e5bfc
RD
3252
3253 def GetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3254 """GetPreviousHandler(self) -> EvtHandler"""
3255 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3256
3257 def SetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3258 """SetNextHandler(self, EvtHandler handler)"""
3259 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
d55e5bfc
RD
3260
3261 def SetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3262 """SetPreviousHandler(self, EvtHandler handler)"""
3263 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3264
3265 def GetEvtHandlerEnabled(*args, **kwargs):
3266 """GetEvtHandlerEnabled(self) -> bool"""
5b5c9bc7 3267 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3268
3269 def SetEvtHandlerEnabled(*args, **kwargs):
3270 """SetEvtHandlerEnabled(self, bool enabled)"""
5b5c9bc7 3271 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3272
3273 def ProcessEvent(*args, **kwargs):
5b5c9bc7
RD
3274 """ProcessEvent(self, Event event) -> bool"""
3275 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
d55e5bfc
RD
3276
3277 def AddPendingEvent(*args, **kwargs):
5b5c9bc7
RD
3278 """AddPendingEvent(self, Event event)"""
3279 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
d55e5bfc
RD
3280
3281 def ProcessPendingEvents(*args, **kwargs):
3282 """ProcessPendingEvents(self)"""
5b5c9bc7 3283 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
3284
3285 def Connect(*args, **kwargs):
3286 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
5b5c9bc7 3287 return _core_.EvtHandler_Connect(*args, **kwargs)
d55e5bfc
RD
3288
3289 def Disconnect(*args, **kwargs):
2131d850 3290 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
5b5c9bc7 3291 return _core_.EvtHandler_Disconnect(*args, **kwargs)
d55e5bfc
RD
3292
3293 def _setOORInfo(*args, **kwargs):
36ed4f51 3294 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3295 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3296 args[0].thisown = 0
3297 return val
d55e5bfc
RD
3298
3299 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3300 """
3301 Bind an event to an event handler.
3302
a5ee0656
RD
3303 :param event: One of the EVT_* objects that specifies the
3304 type of event to bind,
d55e5bfc 3305
a5ee0656
RD
3306 :param handler: A callable object to be invoked when the
3307 event is delivered to self. Pass None to
3308 disconnect an event handler.
d55e5bfc 3309
a5ee0656
RD
3310 :param source: Sometimes the event originates from a
3311 different window than self, but you still
3312 want to catch it in self. (For example, a
3313 button event delivered to a frame.) By
3314 passing the source of the event, the event
3315 handling system is able to differentiate
3316 between the same event type from different
3317 controls.
d55e5bfc 3318
a5ee0656
RD
3319 :param id: Used to spcify the event source by ID instead
3320 of instance.
3321
3322 :param id2: Used when it is desirable to bind a handler
3323 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3324 """
3325 if source is not None:
3326 id = source.GetId()
3327 event.Bind(self, id, id2, handler)
3328
d6c14a4c
RD
3329 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3330 """
3331 Disconencts the event handler binding for event from self.
3332 Returns True if successful.
3333 """
3334 if source is not None:
3335 id = source.GetId()
3336 return event.Unbind(self, id, id2)
d55e5bfc 3337
2131d850 3338_core_.EvtHandler_swigregister(EvtHandler)
d55e5bfc
RD
3339
3340#---------------------------------------------------------------------------
3341
3342class PyEventBinder(object):
3343 """
3344 Instances of this class are used to bind specific events to event
3345 handlers.
3346 """
3347 def __init__(self, evtType, expectedIDs=0):
3348 if expectedIDs not in [0, 1, 2]:
3349 raise ValueError, "Invalid number of expectedIDs"
3350 self.expectedIDs = expectedIDs
3351
3352 if type(evtType) == list or type(evtType) == tuple:
3353 self.evtType = evtType
3354 else:
3355 self.evtType = [evtType]
3356
3357
3358 def Bind(self, target, id1, id2, function):
3359 """Bind this set of event types to target."""
3360 for et in self.evtType:
3361 target.Connect(id1, id2, et, function)
3362
d6c14a4c
RD
3363
3364 def Unbind(self, target, id1, id2):
3365 """Remove an event binding."""
3366 success = 0
3367 for et in self.evtType:
3368 success += target.Disconnect(id1, id2, et)
3369 return success != 0
3370
d55e5bfc
RD
3371
3372 def __call__(self, *args):
3373 """
3374 For backwards compatibility with the old EVT_* functions.
3375 Should be called with either (window, func), (window, ID,
3376 func) or (window, ID1, ID2, func) parameters depending on the
3377 type of the event.
3378 """
3379 assert len(args) == 2 + self.expectedIDs
3380 id1 = wx.ID_ANY
3381 id2 = wx.ID_ANY
3382 target = args[0]
3383 if self.expectedIDs == 0:
3384 func = args[1]
3385 elif self.expectedIDs == 1:
3386 id1 = args[1]
3387 func = args[2]
3388 elif self.expectedIDs == 2:
3389 id1 = args[1]
3390 id2 = args[2]
3391 func = args[3]
3392 else:
3393 raise ValueError, "Unexpected number of IDs"
3394
3395 self.Bind(target, id1, id2, func)
3396
3397
3398# These two are square pegs that don't fit the PyEventBinder hole...
3399def EVT_COMMAND(win, id, cmd, func):
3400 win.Connect(id, -1, cmd, func)
3401def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3402 win.Connect(id1, id2, cmd, func)
3403
3404
3405#---------------------------------------------------------------------------
3406
3407#---------------------------------------------------------------------------
3408
5b5c9bc7
RD
3409EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3410EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3411
1bd55598 3412def NewEventType(*args):
2131d850 3413 """NewEventType() -> EventType"""
1bd55598 3414 return _core_.NewEventType(*args)
5b5c9bc7
RD
3415wxEVT_NULL = _core_.wxEVT_NULL
3416wxEVT_FIRST = _core_.wxEVT_FIRST
3417wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3418wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3419wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3420wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3421wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3422wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3423wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3424wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3425wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3426wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3427wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3428wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3429wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3430wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3431wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3432wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3433wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3434wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3435wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3436wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3437wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3438wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3439wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3440wxEVT_MOTION = _core_.wxEVT_MOTION
3441wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3442wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3443wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3444wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3445wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3446wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3447wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3448wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3449wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3450wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3451wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3452wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3453wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3454wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3455wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3456wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3457wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3458wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3459wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3460wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3461wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3462wxEVT_CHAR = _core_.wxEVT_CHAR
3463wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3464wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3465wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3466wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3467wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3468wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3469wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3470wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3471wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3472wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3473wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3474wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3475wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3476wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3477wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3478wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
5b5c9bc7
RD
3479wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3480wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3481wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3482wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3483wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3484wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3485wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3486wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3487wxEVT_SIZE = _core_.wxEVT_SIZE
3488wxEVT_MOVE = _core_.wxEVT_MOVE
3489wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3490wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3491wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3492wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
5b5c9bc7
RD
3493wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3494wxEVT_CREATE = _core_.wxEVT_CREATE
3495wxEVT_DESTROY = _core_.wxEVT_DESTROY
3496wxEVT_SHOW = _core_.wxEVT_SHOW
3497wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3498wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3499wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3500wxEVT_PAINT = _core_.wxEVT_PAINT
3501wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3502wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3503wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3504wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3505wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3506wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3507wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3508wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3509wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3510wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3511wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3512wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3513wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3514wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3515wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3516wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3517wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3518wxEVT_IDLE = _core_.wxEVT_IDLE
3519wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3520wxEVT_SIZING = _core_.wxEVT_SIZING
3521wxEVT_MOVING = _core_.wxEVT_MOVING
3522wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
3523wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3524wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3525wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
5b5c9bc7
RD
3526wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3527wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3528wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3529wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3530wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3531wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3532wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d55e5bfc
RD
3533#
3534# Create some event binders
3535EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3536EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3537EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3538EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3539EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3540EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3541EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3542EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3543EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3544EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3545EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3546EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3547EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 3548EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d55e5bfc
RD
3549EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3550EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3551EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3552EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3553EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3554EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3555EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3556EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3557EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3558EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 3559EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3560EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3561EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3562EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3563EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3564EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3565EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3566EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3567EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3568EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3569EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3570EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3571EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3572EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3573EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3574EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3575EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3576
3577EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3578EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3579EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3580EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3581EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3582EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3583EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3584EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3585EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3586EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3587EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3588EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3589EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3590
3591EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3592 wxEVT_LEFT_UP,
3593 wxEVT_MIDDLE_DOWN,
3594 wxEVT_MIDDLE_UP,
3595 wxEVT_RIGHT_DOWN,
3596 wxEVT_RIGHT_UP,
3597 wxEVT_MOTION,
3598 wxEVT_LEFT_DCLICK,
3599 wxEVT_MIDDLE_DCLICK,
3600 wxEVT_RIGHT_DCLICK,
3601 wxEVT_ENTER_WINDOW,
3602 wxEVT_LEAVE_WINDOW,
3603 wxEVT_MOUSEWHEEL
3604 ])
3605
3606
3607# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 3608EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d55e5bfc
RD
3609 wxEVT_SCROLLWIN_BOTTOM,
3610 wxEVT_SCROLLWIN_LINEUP,
3611 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 3612 wxEVT_SCROLLWIN_PAGEUP,
d55e5bfc
RD
3613 wxEVT_SCROLLWIN_PAGEDOWN,
3614 wxEVT_SCROLLWIN_THUMBTRACK,
3615 wxEVT_SCROLLWIN_THUMBRELEASE,
3616 ])
3617
3618EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3619EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3620EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3621EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3622EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3623EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3624EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3625EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3626
27fb7603 3627# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
3628EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3629 wxEVT_SCROLL_BOTTOM,
3630 wxEVT_SCROLL_LINEUP,
3631 wxEVT_SCROLL_LINEDOWN,
3632 wxEVT_SCROLL_PAGEUP,
3633 wxEVT_SCROLL_PAGEDOWN,
3634 wxEVT_SCROLL_THUMBTRACK,
3635 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3636 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3637 ])
3638
3639EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3640EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3641EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3642EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3643EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3644EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3645EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3646EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3647EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3648EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 3649
27fb7603 3650# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
3651EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3652 wxEVT_SCROLL_BOTTOM,
3653 wxEVT_SCROLL_LINEUP,
3654 wxEVT_SCROLL_LINEDOWN,
3655 wxEVT_SCROLL_PAGEUP,
3656 wxEVT_SCROLL_PAGEDOWN,
3657 wxEVT_SCROLL_THUMBTRACK,
d55e5bfc 3658 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3659 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3660 ], 1)
3661
3662EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3663EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3664EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3665EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3666EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3667EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3668EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3669EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3670EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3671EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
3672
3673EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3674EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3675EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3676EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3677EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3678EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3679EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3680EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3681EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3682EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3683
3684EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3685EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3686EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3687EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3688EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3689EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3690EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3691EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3692EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3693
3694
3695EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3696EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3697EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3698EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3699EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3700EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3701EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3702
3703EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3704
3705EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3706EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3707
3708EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3709
2131d850
RD
3710EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3711EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3712EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d55e5bfc
RD
3713
3714
3715#---------------------------------------------------------------------------
3716
5b5c9bc7 3717class Event(Object):
27fb7603
RD
3718 """
3719 An event is a structure holding information about an event passed to a
3720 callback or member function. wx.Event is an abstract base class for
3721 other event classes
3722 """
1bd55598
RD
3723 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3724 def __init__(self): raise AttributeError, "No constructor defined"
3725 __repr__ = _swig_repr
3726 __swig_destroy__ = _core_.delete_Event
3727 __del__ = lambda self : None;
d55e5bfc 3728 def SetEventType(*args, **kwargs):
27fb7603 3729 """
2131d850 3730 SetEventType(self, EventType typ)
27fb7603
RD
3731
3732 Sets the specific type of the event.
3733 """
5b5c9bc7 3734 return _core_.Event_SetEventType(*args, **kwargs)
d55e5bfc
RD
3735
3736 def GetEventType(*args, **kwargs):
27fb7603 3737 """
2131d850 3738 GetEventType(self) -> EventType
27fb7603
RD
3739
3740 Returns the identifier of the given event type, such as
3741 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3742 """
5b5c9bc7 3743 return _core_.Event_GetEventType(*args, **kwargs)
d55e5bfc
RD
3744
3745 def GetEventObject(*args, **kwargs):
27fb7603
RD
3746 """
3747 GetEventObject(self) -> Object
3748
3749 Returns the object (usually a window) associated with the event, if
3750 any.
3751 """
5b5c9bc7 3752 return _core_.Event_GetEventObject(*args, **kwargs)
d55e5bfc
RD
3753
3754 def SetEventObject(*args, **kwargs):
27fb7603
RD
3755 """
3756 SetEventObject(self, Object obj)
3757
3758 Sets the originating object, or in other words, obj is normally the
3759 object that is sending the event.
3760 """
5b5c9bc7 3761 return _core_.Event_SetEventObject(*args, **kwargs)
d55e5bfc
RD
3762
3763 def GetTimestamp(*args, **kwargs):
3764 """GetTimestamp(self) -> long"""
5b5c9bc7 3765 return _core_.Event_GetTimestamp(*args, **kwargs)
d55e5bfc
RD
3766
3767 def SetTimestamp(*args, **kwargs):
3768 """SetTimestamp(self, long ts=0)"""
5b5c9bc7 3769 return _core_.Event_SetTimestamp(*args, **kwargs)
d55e5bfc
RD
3770
3771 def GetId(*args, **kwargs):
27fb7603
RD
3772 """
3773 GetId(self) -> int
3774
3775 Returns the identifier associated with this event, such as a button
3776 command id.
3777 """
5b5c9bc7 3778 return _core_.Event_GetId(*args, **kwargs)
d55e5bfc
RD
3779
3780 def SetId(*args, **kwargs):
27fb7603
RD
3781 """
3782 SetId(self, int Id)
3783
3784 Set's the ID for the event. This is usually the ID of the window that
3785 is sending the event, but it can also be a command id from a menu
3786 item, etc.
3787 """
5b5c9bc7 3788 return _core_.Event_SetId(*args, **kwargs)
d55e5bfc
RD
3789
3790 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
3791 """
3792 IsCommandEvent(self) -> bool
3793
3794 Returns true if the event is or is derived from `wx.CommandEvent` else
3795 it returns false. Note: Exists only for optimization purposes.
3796 """
5b5c9bc7 3797 return _core_.Event_IsCommandEvent(*args, **kwargs)
d55e5bfc
RD
3798
3799 def Skip(*args, **kwargs):
51b83b37
RD
3800 """
3801 Skip(self, bool skip=True)
3802
3803 Called by an event handler, it controls whether additional event
3804 handlers bound to this event will be called after the current event
3805 handler returns. Skip(false) (the default setting) will prevent
3806 additional event handlers from being called and control will be
3807 returned to the sender of the event immediately after the current
3808 handler has finished. Skip(True) will cause the event processing
3809 system to continue searching for a handler function for this event.
3810
3811 """
5b5c9bc7 3812 return _core_.Event_Skip(*args, **kwargs)
d55e5bfc
RD
3813
3814 def GetSkipped(*args, **kwargs):
27fb7603
RD
3815 """
3816 GetSkipped(self) -> bool
3817
3818 Returns true if the event handler should be skipped, false otherwise.
3819 :see: `Skip`
3820 """
5b5c9bc7 3821 return _core_.Event_GetSkipped(*args, **kwargs)
d55e5bfc
RD
3822
3823 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
3824 """
3825 ShouldPropagate(self) -> bool
3826
3827 Test if this event should be propagated to the parent window or not,
3828 i.e. if the propagation level is currently greater than 0.
3829 """
5b5c9bc7 3830 return _core_.Event_ShouldPropagate(*args, **kwargs)
d55e5bfc
RD
3831
3832 def StopPropagation(*args, **kwargs):
27fb7603
RD
3833 """
3834 StopPropagation(self) -> int
3835
3836 Stop the event from propagating to its parent window. Returns the old
3837 propagation level value which may be later passed to
3838 `ResumePropagation` to allow propagating the event again.
3839 """
5b5c9bc7 3840 return _core_.Event_StopPropagation(*args, **kwargs)
d55e5bfc
RD
3841
3842 def ResumePropagation(*args, **kwargs):
27fb7603
RD
3843 """
3844 ResumePropagation(self, int propagationLevel)
3845
3846 Resume the event propagation by restoring the propagation level. (For
3847 example, you can use the value returned by an earlier call to
3848 `StopPropagation`.)
3849
3850 """
5b5c9bc7 3851 return _core_.Event_ResumePropagation(*args, **kwargs)
d55e5bfc
RD
3852
3853 def Clone(*args, **kwargs):
5b5c9bc7
RD
3854 """Clone(self) -> Event"""
3855 return _core_.Event_Clone(*args, **kwargs)
d55e5bfc 3856
2131d850 3857_core_.Event_swigregister(Event)
d55e5bfc
RD
3858
3859#---------------------------------------------------------------------------
3860
5b5c9bc7 3861class PropagationDisabler(object):
27fb7603
RD
3862 """
3863 Helper class to temporarily change an event not to propagate. Simply
3864 create an instance of this class and then whe it is destroyed the
3865 propogation of the event will be restored.
3866 """
1bd55598
RD
3867 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3868 __repr__ = _swig_repr
3869 def __init__(self, *args, **kwargs):
27fb7603
RD
3870 """
3871 __init__(self, Event event) -> PropagationDisabler
3872
3873 Helper class to temporarily change an event not to propagate. Simply
3874 create an instance of this class and then whe it is destroyed the
3875 propogation of the event will be restored.
3876 """
1bd55598
RD
3877 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3878 __swig_destroy__ = _core_.delete_PropagationDisabler
3879 __del__ = lambda self : None;
2131d850 3880_core_.PropagationDisabler_swigregister(PropagationDisabler)
d55e5bfc 3881
5b5c9bc7 3882class PropagateOnce(object):
27fb7603
RD
3883 """
3884 A helper class that will temporarily lower propagation level of an
3885 event. Simply create an instance of this class and then whe it is
3886 destroyed the propogation of the event will be restored.
3887 """
1bd55598
RD
3888 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3889 __repr__ = _swig_repr
3890 def __init__(self, *args, **kwargs):
27fb7603
RD
3891 """
3892 __init__(self, Event event) -> PropagateOnce
3893
3894 A helper class that will temporarily lower propagation level of an
3895 event. Simply create an instance of this class and then whe it is
3896 destroyed the propogation of the event will be restored.
3897 """
1bd55598
RD
3898 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3899 __swig_destroy__ = _core_.delete_PropagateOnce
3900 __del__ = lambda self : None;
2131d850 3901_core_.PropagateOnce_swigregister(PropagateOnce)
d55e5bfc
RD
3902
3903#---------------------------------------------------------------------------
3904
5b5c9bc7 3905class CommandEvent(Event):
27fb7603
RD
3906 """
3907 This event class contains information about command events, which
3908 originate from a variety of simple controls, as well as menus and
3909 toolbars.
3910 """
1bd55598
RD
3911 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3912 __repr__ = _swig_repr
3913 def __init__(self, *args, **kwargs):
27fb7603 3914 """
2131d850 3915 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
3916
3917 This event class contains information about command events, which
3918 originate from a variety of simple controls, as well as menus and
3919 toolbars.
3920 """
1bd55598 3921 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
d55e5bfc 3922 def GetSelection(*args, **kwargs):
27fb7603
RD
3923 """
3924 GetSelection(self) -> int
3925
3926 Returns item index for a listbox or choice selection event (not valid
3927 for a deselection).
3928 """
5b5c9bc7 3929 return _core_.CommandEvent_GetSelection(*args, **kwargs)
d55e5bfc
RD
3930
3931 def SetString(*args, **kwargs):
5b5c9bc7
RD
3932 """SetString(self, String s)"""
3933 return _core_.CommandEvent_SetString(*args, **kwargs)
d55e5bfc
RD
3934
3935 def GetString(*args, **kwargs):
27fb7603
RD
3936 """
3937 GetString(self) -> String
3938
3939 Returns item string for a listbox or choice selection event (not valid
3940 for a deselection).
3941 """
5b5c9bc7 3942 return _core_.CommandEvent_GetString(*args, **kwargs)
d55e5bfc
RD
3943
3944 def IsChecked(*args, **kwargs):
27fb7603
RD
3945 """
3946 IsChecked(self) -> bool
3947
3948 This method can be used with checkbox and menu events: for the
3949 checkboxes, the method returns true for a selection event and false
3950 for a deselection one. For the menu events, this method indicates if
3951 the menu item just has become checked or unchecked (and thus only
3952 makes sense for checkable menu items).
3953 """
5b5c9bc7 3954 return _core_.CommandEvent_IsChecked(*args, **kwargs)
d55e5bfc
RD
3955
3956 Checked = IsChecked
3957 def IsSelection(*args, **kwargs):
27fb7603
RD
3958 """
3959 IsSelection(self) -> bool
3960
3961 For a listbox or similar event, returns true if it is a selection,
3962 false if it is a deselection.
3963 """
5b5c9bc7 3964 return _core_.CommandEvent_IsSelection(*args, **kwargs)
d55e5bfc
RD
3965
3966 def SetExtraLong(*args, **kwargs):
3967 """SetExtraLong(self, long extraLong)"""
5b5c9bc7 3968 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
d55e5bfc
RD
3969
3970 def GetExtraLong(*args, **kwargs):
27fb7603
RD
3971 """
3972 GetExtraLong(self) -> long
3973
5ba5649b
RD
3974 Returns extra information dependant on the event objects type. If the
3975 event comes from a listbox selection, it is a boolean determining
3976 whether the event was a selection (true) or a deselection (false). A
3977 listbox deselection only occurs for multiple-selection boxes, and in
3978 this case the index and string values are indeterminate and the
3979 listbox must be examined by the application.
27fb7603 3980 """
5b5c9bc7 3981 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
d55e5bfc
RD
3982
3983 def SetInt(*args, **kwargs):
3984 """SetInt(self, int i)"""
5b5c9bc7 3985 return _core_.CommandEvent_SetInt(*args, **kwargs)
d55e5bfc
RD
3986
3987 def GetInt(*args, **kwargs):
27fb7603 3988 """
2131d850 3989 GetInt(self) -> int
27fb7603 3990
5ba5649b
RD
3991 Returns the integer identifier corresponding to a listbox, choice or
3992 radiobox selection (only if the event was a selection, not a
3993 deselection), or a boolean value representing the value of a checkbox.
27fb7603 3994 """
5b5c9bc7 3995 return _core_.CommandEvent_GetInt(*args, **kwargs)
d55e5bfc 3996
1bd55598
RD
3997 def GetClientData(*args, **kwargs):
3998 """
3999 GetClientData(self) -> PyObject
4000
4001 Returns the client data object for a listbox or choice selection event, (if any.)
4002 """
4003 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4004
4005 def SetClientData(*args, **kwargs):
4006 """
4007 SetClientData(self, PyObject clientData)
4008
4009 Associate the given client data with the item at position n.
4010 """
4011 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4012
4013 GetClientObject = GetClientData
4014 SetClientObject = SetClientData
4015
d55e5bfc 4016 def Clone(*args, **kwargs):
5b5c9bc7
RD
4017 """Clone(self) -> Event"""
4018 return _core_.CommandEvent_Clone(*args, **kwargs)
d55e5bfc 4019
2131d850 4020_core_.CommandEvent_swigregister(CommandEvent)
d55e5bfc
RD
4021
4022#---------------------------------------------------------------------------
4023
5b5c9bc7 4024class NotifyEvent(CommandEvent):
27fb7603
RD
4025 """
4026 An instance of this class (or one of its derived classes) is sent from
4027 a control when the control's state is being changed and the control
4028 allows that change to be prevented from happening. The event handler
4029 can call `Veto` or `Allow` to tell the control what to do.
4030 """
1bd55598
RD
4031 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4032 __repr__ = _swig_repr
4033 def __init__(self, *args, **kwargs):
27fb7603 4034 """
2131d850 4035 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4036
4037 An instance of this class (or one of its derived classes) is sent from
4038 a control when the control's state is being changed and the control
4039 allows that change to be prevented from happening. The event handler
4040 can call `Veto` or `Allow` to tell the control what to do.
4041 """
1bd55598 4042 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
d55e5bfc 4043 def Veto(*args, **kwargs):
27fb7603
RD
4044 """
4045 Veto(self)
4046
4047 Prevents the change announced by this event from happening.
4048
4049 It is in general a good idea to notify the user about the reasons for
4050 vetoing the change because otherwise the applications behaviour (which
4051 just refuses to do what the user wants) might be quite surprising.
4052 """
5b5c9bc7 4053 return _core_.NotifyEvent_Veto(*args, **kwargs)
d55e5bfc
RD
4054
4055 def Allow(*args, **kwargs):
27fb7603
RD
4056 """
4057 Allow(self)
4058
4059 This is the opposite of `Veto`: it explicitly allows the event to be
4060 processed. For most events it is not necessary to call this method as
4061 the events are allowed anyhow but some are forbidden by default (this
4062 will be mentioned in the corresponding event description).
4063 """
5b5c9bc7 4064 return _core_.NotifyEvent_Allow(*args, **kwargs)
d55e5bfc
RD
4065
4066 def IsAllowed(*args, **kwargs):
27fb7603
RD
4067 """
4068 IsAllowed(self) -> bool
4069
4070 Returns true if the change is allowed (`Veto` hasn't been called) or
4071 false otherwise (if it was).
4072 """
5b5c9bc7 4073 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
d55e5bfc 4074
2131d850 4075_core_.NotifyEvent_swigregister(NotifyEvent)
d55e5bfc
RD
4076
4077#---------------------------------------------------------------------------
4078
5b5c9bc7 4079class ScrollEvent(CommandEvent):
27fb7603
RD
4080 """
4081 A scroll event holds information about events sent from stand-alone
4082 scrollbars and sliders. Note that scrolled windows do not send
4083 instnaces of this event class, but send the `wx.ScrollWinEvent`
4084 instead.
4085 """
1bd55598
RD
4086 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4087 __repr__ = _swig_repr
4088 def __init__(self, *args, **kwargs):
d55e5bfc 4089 """
2131d850 4090 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
5b5c9bc7 4091 int orient=0) -> ScrollEvent
d55e5bfc 4092 """
1bd55598 4093 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
d55e5bfc 4094 def GetOrientation(*args, **kwargs):
27fb7603
RD
4095 """
4096 GetOrientation(self) -> int
4097
4098 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4099 the scrollbar.
4100 """
5b5c9bc7 4101 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4102
4103 def GetPosition(*args, **kwargs):
27fb7603
RD
4104 """
4105 GetPosition(self) -> int
4106
4107 Returns the position of the scrollbar.
4108 """
5b5c9bc7 4109 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4110
4111 def SetOrientation(*args, **kwargs):
4112 """SetOrientation(self, int orient)"""
5b5c9bc7 4113 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4114
4115 def SetPosition(*args, **kwargs):
4116 """SetPosition(self, int pos)"""
5b5c9bc7 4117 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
d55e5bfc 4118
2131d850 4119_core_.ScrollEvent_swigregister(ScrollEvent)
d55e5bfc
RD
4120
4121#---------------------------------------------------------------------------
4122
5b5c9bc7 4123class ScrollWinEvent(Event):
27fb7603
RD
4124 """
4125 A wx.ScrollWinEvent holds information about scrolling and is sent from
4126 scrolling windows.
4127 """
1bd55598
RD
4128 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4129 __repr__ = _swig_repr
4130 def __init__(self, *args, **kwargs):
27fb7603 4131 """
2131d850 4132 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4133
4134 A wx.ScrollWinEvent holds information about scrolling and is sent from
4135 scrolling windows.
4136 """
1bd55598 4137 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
d55e5bfc 4138 def GetOrientation(*args, **kwargs):
27fb7603
RD
4139 """
4140 GetOrientation(self) -> int
4141
4142 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4143 the scrollbar.
4144 """
5b5c9bc7 4145 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4146
4147 def GetPosition(*args, **kwargs):
27fb7603
RD
4148 """
4149 GetPosition(self) -> int
4150
4151 Returns the position of the scrollbar for the thumb track and release
4152 events. Note that this field can't be used for the other events, you
4153 need to query the window itself for the current position in that case.
4154 """
5b5c9bc7 4155 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4156
4157 def SetOrientation(*args, **kwargs):
4158 """SetOrientation(self, int orient)"""
5b5c9bc7 4159 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4160
4161 def SetPosition(*args, **kwargs):
4162 """SetPosition(self, int pos)"""
5b5c9bc7 4163 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
d55e5bfc 4164
2131d850 4165_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d55e5bfc
RD
4166
4167#---------------------------------------------------------------------------
4168
5b5c9bc7
RD
4169MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4170MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4171MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4172MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4173MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4174class MouseEvent(Event):
27fb7603
RD
4175 """
4176 This event class contains information about the events generated by
4177 the mouse: they include mouse buttons press and release events and
4178 mouse move events.
4179
4180 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4181 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4182 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4183 a middle button so a portable application should avoid relying on the
4184 events from it.
4185
4186 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4187 the former returns true when the event corresponds to the left mouse
4188 button click while the latter returns true if the left mouse button is
4189 currently being pressed. For example, when the user is dragging the
4190 mouse you can use `LeftIsDown` to test whether the left mouse button
4191 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4192 `LeftIsDown` will also return true in wxWidgets whatever the
4193 underlying GUI behaviour is (which is platform-dependent). The same
4194 applies, of course, to other mouse buttons as well.
4195 """
1bd55598
RD
4196 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4197 __repr__ = _swig_repr
4198 def __init__(self, *args, **kwargs):
27fb7603 4199 """
2131d850 4200 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4201
4202 Constructs a wx.MouseEvent. Valid event types are:
4203
4204 * wxEVT_ENTER_WINDOW
4205 * wxEVT_LEAVE_WINDOW
4206 * wxEVT_LEFT_DOWN
4207 * wxEVT_LEFT_UP
4208 * wxEVT_LEFT_DCLICK
4209 * wxEVT_MIDDLE_DOWN
4210 * wxEVT_MIDDLE_UP
4211 * wxEVT_MIDDLE_DCLICK
4212 * wxEVT_RIGHT_DOWN
4213 * wxEVT_RIGHT_UP
4214 * wxEVT_RIGHT_DCLICK
4215 * wxEVT_MOTION
4216 * wxEVT_MOUSEWHEEL
4217 """
1bd55598 4218 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
d55e5bfc 4219 def IsButton(*args, **kwargs):
27fb7603
RD
4220 """
4221 IsButton(self) -> bool
4222
4223 Returns true if the event was a mouse button event (not necessarily a
4224 button down event - that may be tested using `ButtonDown`).
4225 """
5b5c9bc7 4226 return _core_.MouseEvent_IsButton(*args, **kwargs)
d55e5bfc
RD
4227
4228 def ButtonDown(*args, **kwargs):
27fb7603
RD
4229 """
4230 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4231
5ba5649b
RD
4232 If the argument is omitted, this returns true if the event was any
4233 mouse button down event. Otherwise the argument specifies which
4234 button-down event shold be checked for (see `Button` for the possible
4235 values).
27fb7603 4236 """
5b5c9bc7 4237 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
d55e5bfc
RD
4238
4239 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4240 """
4241 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4242
4243 If the argument is omitted, this returns true if the event was any
4244 mouse double click event. Otherwise the argument specifies which
4245 double click event to check for (see `Button` for the possible
4246 values).
4247 """
5b5c9bc7 4248 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
d55e5bfc
RD
4249
4250 def ButtonUp(*args, **kwargs):
27fb7603
RD
4251 """
4252 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4253
4254 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4255 mouse button up event. Otherwise the argument specifies which button
4256 up event to check for (see `Button` for the possible values).
27fb7603 4257 """
5b5c9bc7 4258 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
d55e5bfc
RD
4259
4260 def Button(*args, **kwargs):
27fb7603
RD
4261 """
4262 Button(self, int button) -> bool
4263
4264 Returns true if the identified mouse button is changing state. Valid
4265 values of button are:
4266
4267 ==================== =====================================
4268 wx.MOUSE_BTN_LEFT check if left button was pressed
4269 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4270 wx.MOUSE_BTN_RIGHT check if right button was pressed
4271 wx.MOUSE_BTN_ANY check if any button was pressed
4272 ==================== =====================================
4273
4274 """
5b5c9bc7 4275 return _core_.MouseEvent_Button(*args, **kwargs)
d55e5bfc
RD
4276
4277 def ButtonIsDown(*args, **kwargs):
4278 """ButtonIsDown(self, int but) -> bool"""
5b5c9bc7 4279 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
d55e5bfc
RD
4280
4281 def GetButton(*args, **kwargs):
27fb7603
RD
4282 """
4283 GetButton(self) -> int
4284
4285 Returns the mouse button which generated this event or
4286 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4287 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4288 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4289 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4290 right buttons respectively.
4291 """
5b5c9bc7 4292 return _core_.MouseEvent_GetButton(*args, **kwargs)
d55e5bfc
RD
4293
4294 def ControlDown(*args, **kwargs):
27fb7603
RD
4295 """
4296 ControlDown(self) -> bool
4297
4298 Returns true if the control key was down at the time of the event.
4299 """
5b5c9bc7 4300 return _core_.MouseEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4301
4302 def MetaDown(*args, **kwargs):
27fb7603
RD
4303 """
4304 MetaDown(self) -> bool
4305
4306 Returns true if the Meta key was down at the time of the event.
4307 """
5b5c9bc7 4308 return _core_.MouseEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4309
4310 def AltDown(*args, **kwargs):
27fb7603
RD
4311 """
4312 AltDown(self) -> bool
4313
4314 Returns true if the Alt key was down at the time of the event.
4315 """
5b5c9bc7 4316 return _core_.MouseEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4317
4318 def ShiftDown(*args, **kwargs):
27fb7603
RD
4319 """
4320 ShiftDown(self) -> bool
4321
4322 Returns true if the Shift key was down at the time of the event.
4323 """
5b5c9bc7 4324 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4325
412d302d
RD
4326 def CmdDown(*args, **kwargs):
4327 """
4328 CmdDown(self) -> bool
4329
4330 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4331 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4332 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4333 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4334 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4335 purpose. So for non-Mac platforms this is the same as `ControlDown`
4336 and Macs this is the same as `MetaDown`.
4337 """
5b5c9bc7 4338 return _core_.MouseEvent_CmdDown(*args, **kwargs)
412d302d 4339
d55e5bfc 4340 def LeftDown(*args, **kwargs):
27fb7603
RD
4341 """
4342 LeftDown(self) -> bool
4343
4344 Returns true if the left mouse button state changed to down.
4345 """
5b5c9bc7 4346 return _core_.MouseEvent_LeftDown(*args, **kwargs)
d55e5bfc
RD
4347
4348 def MiddleDown(*args, **kwargs):
27fb7603
RD
4349 """
4350 MiddleDown(self) -> bool
4351
4352 Returns true if the middle mouse button state changed to down.
4353 """
5b5c9bc7 4354 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
d55e5bfc
RD
4355
4356 def RightDown(*args, **kwargs):
27fb7603
RD
4357 """
4358 RightDown(self) -> bool
4359
4360 Returns true if the right mouse button state changed to down.
4361 """
5b5c9bc7 4362 return _core_.MouseEvent_RightDown(*args, **kwargs)
d55e5bfc
RD
4363
4364 def LeftUp(*args, **kwargs):
27fb7603
RD
4365 """
4366 LeftUp(self) -> bool
4367
4368 Returns true if the left mouse button state changed to up.
4369 """
5b5c9bc7 4370 return _core_.MouseEvent_LeftUp(*args, **kwargs)
d55e5bfc
RD
4371
4372 def MiddleUp(*args, **kwargs):
27fb7603
RD
4373 """
4374 MiddleUp(self) -> bool
4375
4376 Returns true if the middle mouse button state changed to up.
4377 """
5b5c9bc7 4378 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
d55e5bfc
RD
4379
4380 def RightUp(*args, **kwargs):
27fb7603
RD
4381 """
4382 RightUp(self) -> bool
4383
4384 Returns true if the right mouse button state changed to up.
4385 """
5b5c9bc7 4386 return _core_.MouseEvent_RightUp(*args, **kwargs)
d55e5bfc
RD
4387
4388 def LeftDClick(*args, **kwargs):
27fb7603
RD
4389 """
4390 LeftDClick(self) -> bool
4391
4392 Returns true if the event was a left button double click.
4393 """
5b5c9bc7 4394 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
d55e5bfc
RD
4395
4396 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4397 """
4398 MiddleDClick(self) -> bool
4399
4400 Returns true if the event was a middle button double click.
4401 """
5b5c9bc7 4402 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
d55e5bfc
RD
4403
4404 def RightDClick(*args, **kwargs):
27fb7603
RD
4405 """
4406 RightDClick(self) -> bool
4407
4408 Returns true if the event was a right button double click.
4409 """
5b5c9bc7 4410 return _core_.MouseEvent_RightDClick(*args, **kwargs)
d55e5bfc
RD
4411
4412 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4413 """
4414 LeftIsDown(self) -> bool
4415
4416 Returns true if the left mouse button is currently down, independent
4417 of the current event type.
4418
4419 Please notice that it is not the same as LeftDown which returns true
4420 if the left mouse button was just pressed. Rather, it describes the
4421 state of the mouse button before the event happened.
4422
4423 This event is usually used in the mouse event handlers which process
4424 "move mouse" messages to determine whether the user is (still)
4425 dragging the mouse.
4426 """
5b5c9bc7 4427 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
d55e5bfc
RD
4428
4429 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4430 """
4431 MiddleIsDown(self) -> bool
4432
4433 Returns true if the middle mouse button is currently down, independent
4434 of the current event type.
4435 """
5b5c9bc7 4436 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
d55e5bfc
RD
4437
4438 def RightIsDown(*args, **kwargs):
27fb7603
RD
4439 """
4440 RightIsDown(self) -> bool
4441
4442 Returns true if the right mouse button is currently down, independent
4443 of the current event type.
4444 """
5b5c9bc7 4445 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
d55e5bfc
RD
4446
4447 def Dragging(*args, **kwargs):
27fb7603
RD
4448 """
4449 Dragging(self) -> bool
4450
4451 Returns true if this was a dragging event (motion while a button is
4452 depressed).
4453 """
5b5c9bc7 4454 return _core_.MouseEvent_Dragging(*args, **kwargs)
d55e5bfc
RD
4455
4456 def Moving(*args, **kwargs):
27fb7603
RD
4457 """
4458 Moving(self) -> bool
4459
4460 Returns true if this was a motion event and no mouse buttons were
4461 pressed. If any mouse button is held pressed, then this method returns
4462 false and Dragging returns true.
4463 """
5b5c9bc7 4464 return _core_.MouseEvent_Moving(*args, **kwargs)
d55e5bfc
RD
4465
4466 def Entering(*args, **kwargs):
27fb7603
RD
4467 """
4468 Entering(self) -> bool
4469
4470 Returns true if the mouse was entering the window.
4471 """
5b5c9bc7 4472 return _core_.MouseEvent_Entering(*args, **kwargs)
d55e5bfc
RD
4473
4474 def Leaving(*args, **kwargs):
27fb7603
RD
4475 """
4476 Leaving(self) -> bool
4477
4478 Returns true if the mouse was leaving the window.
4479 """
5b5c9bc7 4480 return _core_.MouseEvent_Leaving(*args, **kwargs)
d55e5bfc
RD
4481
4482 def GetPosition(*args, **kwargs):
4483 """
5b5c9bc7 4484 GetPosition(self) -> Point
d55e5bfc 4485
27fb7603
RD
4486 Returns the pixel position of the mouse in window coordinates when the
4487 event happened.
d55e5bfc 4488 """
5b5c9bc7 4489 return _core_.MouseEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4490
4491 def GetPositionTuple(*args, **kwargs):
4492 """
4493 GetPositionTuple() -> (x,y)
4494
27fb7603
RD
4495 Returns the pixel position of the mouse in window coordinates when the
4496 event happened.
d55e5bfc 4497 """
5b5c9bc7 4498 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4499
4500 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4501 """
4502 GetLogicalPosition(self, DC dc) -> Point
4503
4504 Returns the logical mouse position in pixels (i.e. translated
4505 according to the translation set for the DC, which usually indicates
4506 that the window has been scrolled).
4507 """
5b5c9bc7 4508 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
d55e5bfc
RD
4509
4510 def GetX(*args, **kwargs):
27fb7603
RD
4511 """
4512 GetX(self) -> int
4513
4514 Returns X coordinate of the physical mouse event position.
4515 """
5b5c9bc7 4516 return _core_.MouseEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4517
4518 def GetY(*args, **kwargs):
27fb7603
RD
4519 """
4520 GetY(self) -> int
4521
4522 Returns Y coordinate of the physical mouse event position.
4523 """
5b5c9bc7 4524 return _core_.MouseEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4525
4526 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4527 """
4528 GetWheelRotation(self) -> int
4529
4530 Get wheel rotation, positive or negative indicates direction of
4531 rotation. Current devices all send an event when rotation is equal to
4532 +/-WheelDelta, but this allows for finer resolution devices to be
4533 created in the future. Because of this you shouldn't assume that one
4534 event is equal to 1 line or whatever, but you should be able to either
4535 do partial line scrolling or wait until +/-WheelDelta rotation values
4536 have been accumulated before scrolling.
4537 """
5b5c9bc7 4538 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
d55e5bfc
RD
4539
4540 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4541 """
4542 GetWheelDelta(self) -> int
4543
4544 Get wheel delta, normally 120. This is the threshold for action to be
4545 taken, and one such action (for example, scrolling one increment)
4546 should occur for each delta.
4547 """
5b5c9bc7 4548 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
d55e5bfc
RD
4549
4550 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4551 """
4552 GetLinesPerAction(self) -> int
4553
4554 Returns the configured number of lines (or whatever) to be scrolled
4555 per wheel action. Defaults to three.
4556 """
5b5c9bc7 4557 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
d55e5bfc
RD
4558
4559 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4560 """
4561 IsPageScroll(self) -> bool
4562
4563 Returns true if the system has been setup to do page scrolling with
4564 the mouse wheel instead of line scrolling.
4565 """
5b5c9bc7
RD
4566 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4567
4568 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4569 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4570 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4571 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4572 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4573 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4574 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4575 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4576 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4577 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4578 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4579 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
2131d850 4580_core_.MouseEvent_swigregister(MouseEvent)
d55e5bfc
RD
4581
4582#---------------------------------------------------------------------------
4583
5b5c9bc7 4584class SetCursorEvent(Event):
5ba5649b
RD
4585 """
4586 A SetCursorEvent is generated when the mouse cursor is about to be set
4587 as a result of mouse motion. This event gives the application the
4588 chance to perform specific mouse cursor processing based on the
4589 current position of the mouse within the window. Use the `SetCursor`
4590 method to specify the cursor you want to be displayed.
4591 """
1bd55598
RD
4592 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4593 __repr__ = _swig_repr
4594 def __init__(self, *args, **kwargs):
5ba5649b
RD
4595 """
4596 __init__(self, int x=0, int y=0) -> SetCursorEvent
4597
4598 Construct a new `wx.SetCursorEvent`.
4599 """
1bd55598 4600 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
d55e5bfc 4601 def GetX(*args, **kwargs):
5ba5649b
RD
4602 """
4603 GetX(self) -> int
4604
4605 Returns the X coordinate of the mouse in client coordinates.
4606 """
5b5c9bc7 4607 return _core_.SetCursorEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4608
4609 def GetY(*args, **kwargs):
5ba5649b
RD
4610 """
4611 GetY(self) -> int
4612
4613 Returns the Y coordinate of the mouse in client coordinates.
4614 """
5b5c9bc7 4615 return _core_.SetCursorEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4616
4617 def SetCursor(*args, **kwargs):
5ba5649b
RD
4618 """
4619 SetCursor(self, Cursor cursor)
4620
4621 Sets the cursor associated with this event.
4622 """
5b5c9bc7 4623 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
d55e5bfc
RD
4624
4625 def GetCursor(*args, **kwargs):
5ba5649b
RD
4626 """
4627 GetCursor(self) -> Cursor
4628
4629 Returns a reference to the cursor specified by this event.
4630 """
5b5c9bc7 4631 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
d55e5bfc
RD
4632
4633 def HasCursor(*args, **kwargs):
5ba5649b
RD
4634 """
4635 HasCursor(self) -> bool
4636
4637 Returns true if the cursor specified by this event is a valid cursor.
4638 """
5b5c9bc7 4639 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
d55e5bfc 4640
2131d850 4641_core_.SetCursorEvent_swigregister(SetCursorEvent)
d55e5bfc
RD
4642
4643#---------------------------------------------------------------------------
4644
5b5c9bc7 4645class KeyEvent(Event):
5ba5649b
RD
4646 """
4647 This event class contains information about keypress and character
4648 events. These events are only sent to the widget that currently has
4649 the keyboard focus.
4650
4651 Notice that there are three different kinds of keyboard events in
4652 wxWidgets: key down and up events and char events. The difference
4653 between the first two is clear - the first corresponds to a key press
4654 and the second to a key release - otherwise they are identical. Just
4655 note that if the key is maintained in a pressed state you will
4656 typically get a lot of (automatically generated) down events but only
4657 one up so it is wrong to assume that there is one up event
4658 corresponding to each down one.
4659
4660 Both key events provide untranslated key codes while the char event
4661 carries the translated one. The untranslated code for alphanumeric
4662 keys is always an upper case value. For the other keys it is one of
4663 WXK_XXX values from the keycodes table. The translated key is, in
4664 general, the character the user expects to appear as the result of the
4665 key combination when typing the text into a text entry zone, for
4666 example.
4667
4668 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4669 and the standard US keyboard): when the 'A' key is pressed, the key
4670 down event key code is equal to ASCII A == 65. But the char event key
4671 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4672 'A' keys simultaneously , the key code in key down event will still be
4673 just 'A' while the char event key code parameter will now be 'A' as
4674 well.
4675
4676 Although in this simple case it is clear that the correct key code
4677 could be found in the key down event handler by checking the value
4678 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4679 as for non alphanumeric keys or non-US keyboard layouts the
4680 translation is keyboard-layout dependent and can only be done properly
4681 by the system itself.
4682
4683 Another kind of translation is done when the control key is pressed:
4684 for example, for CTRL-A key press the key down event still carries the
4685 same key code 'A' as usual but the char event will have key code of 1,
4686 the ASCII value of this key combination.
4687
4688 You may discover how the other keys on your system behave
4689 interactively by running the KeyEvents sample in the wxPython demo and
4690 pressing some keys while the blue box at the top has the keyboard
4691 focus.
4692
4693 **Note**: If a key down event is caught and the event handler does not
4694 call event.Skip() then the coresponding char event will not
4695 happen. This is by design and enables the programs that handle both
4696 types of events to be a bit simpler.
4697
4698 **Note for Windows programmers**: The key and char events in wxWidgets
4699 are similar to but slightly different from Windows WM_KEYDOWN and
4700 WM_CHAR events. In particular, Alt-x combination will generate a char
4701 event in wxWidgets (unless it is used as an accelerator).
4702
4703 **Tip**: be sure to call event.Skip() for events that you don't
4704 process in key event function, otherwise menu shortcuts may cease to
4705 work under Windows.
4706
4707 """
1bd55598
RD
4708 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4709 __repr__ = _swig_repr
4710 def __init__(self, *args, **kwargs):
5ba5649b 4711 """
2131d850 4712 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
4713
4714 Construct a new `wx.KeyEvent`. Valid event types are:
4715 *
4716 """
1bd55598 4717 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
4718 def GetModifiers(*args, **kwargs):
4719 """
4720 GetModifiers(self) -> int
4721
4722 Returns a bitmask of the current modifier settings. Can be used to
4723 check if the key event has exactly the given modifiers without having
4724 to explicitly check that the other modifiers are not down. For
4725 example::
4726
4727 if event.GetModifers() == wx.MOD_CONTROL:
4728 DoSomething()
4729
4730 """
4731 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4732
d55e5bfc 4733 def ControlDown(*args, **kwargs):
5ba5649b
RD
4734 """
4735 ControlDown(self) -> bool
4736
4737 Returns ``True`` if the Control key was down at the time of the event.
4738 """
5b5c9bc7 4739 return _core_.KeyEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4740
4741 def MetaDown(*args, **kwargs):
5ba5649b
RD
4742 """
4743 MetaDown(self) -> bool
4744
4745 Returns ``True`` if the Meta key was down at the time of the event.
4746 """
5b5c9bc7 4747 return _core_.KeyEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4748
4749 def AltDown(*args, **kwargs):
5ba5649b
RD
4750 """
4751 AltDown(self) -> bool
4752
4753 Returns ``True`` if the Alt key was down at the time of the event.
4754 """
5b5c9bc7 4755 return _core_.KeyEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4756
4757 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4758 """
4759 ShiftDown(self) -> bool
4760
4761 Returns ``True`` if the Shift key was down at the time of the event.
4762 """
5b5c9bc7 4763 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4764
412d302d
RD
4765 def CmdDown(*args, **kwargs):
4766 """
4767 CmdDown(self) -> bool
4768
4769 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4770 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4771 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
4772 because Cmd key is used for the same thing under Mac as Ctrl
4773 elsewhere. The Ctrl still exists, it's just not used for this
4774 purpose. So for non-Mac platforms this is the same as `ControlDown`
4775 and Macs this is the same as `MetaDown`.
4776 """
5b5c9bc7 4777 return _core_.KeyEvent_CmdDown(*args, **kwargs)
412d302d 4778
d55e5bfc 4779 def HasModifiers(*args, **kwargs):
5ba5649b
RD
4780 """
4781 HasModifiers(self) -> bool
4782
4783 Returns true if either CTRL or ALT keys was down at the time of the
4784 key event. Note that this function does not take into account neither
4785 SHIFT nor META key states (the reason for ignoring the latter is that
4786 it is common for NUMLOCK key to be configured as META under X but the
4787 key presses even while NUMLOCK is on should be still processed
4788 normally).
4789 """
5b5c9bc7 4790 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
d55e5bfc
RD
4791
4792 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
4793 """
4794 GetKeyCode(self) -> int
4795
4796 Returns the virtual key code. ASCII events return normal ASCII values,
4797 while non-ASCII events return values such as WXK_LEFT for the left
4798 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4799 codes.
4800
4801 Note that in Unicode build, the returned value is meaningful only if
4802 the user entered a character that can be represented in current
4803 locale's default charset. You can obtain the corresponding Unicode
4804 character using `GetUnicodeKey`.
4805 """
5b5c9bc7 4806 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
4807
4808 KeyCode = GetKeyCode
bb4524c4 4809 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
4810 """
4811 GetUnicodeKey(self) -> int
4812
4813 Returns the Unicode character corresponding to this key event. This
4814 function is only meaningfule in a Unicode build of wxPython.
4815 """
5b5c9bc7 4816 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 4817
bb4524c4 4818 GetUniChar = GetUnicodeKey
b850e7f3
RD
4819 def SetUnicodeKey(*args, **kwargs):
4820 """
4821 SetUnicodeKey(self, int uniChar)
4822
4823 Set the Unicode value of the key event, but only if this is a Unicode
4824 build of wxPython.
4825 """
4826 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
4827
d55e5bfc 4828 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
4829 """
4830 GetRawKeyCode(self) -> unsigned int
4831
4832 Returns the raw key code for this event. This is a platform-dependent
4833 scan code which should only be used in advanced
4834 applications. Currently the raw key codes are not supported by all
4835 ports.
4836 """
5b5c9bc7 4837 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
d55e5bfc
RD
4838
4839 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
4840 """
4841 GetRawKeyFlags(self) -> unsigned int
4842
4843 Returns the low level key flags for this event. The flags are
4844 platform-dependent and should only be used in advanced applications.
4845 Currently the raw key flags are not supported by all ports.
4846 """
5b5c9bc7 4847 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
d55e5bfc
RD
4848
4849 def GetPosition(*args, **kwargs):
4850 """
5b5c9bc7 4851 GetPosition(self) -> Point
d55e5bfc 4852
5ba5649b 4853 Find the position of the event, if applicable.
d55e5bfc 4854 """
5b5c9bc7 4855 return _core_.KeyEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4856
4857 def GetPositionTuple(*args, **kwargs):
4858 """
4859 GetPositionTuple() -> (x,y)
4860
5ba5649b 4861 Find the position of the event, if applicable.
d55e5bfc 4862 """
5b5c9bc7 4863 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4864
4865 def GetX(*args, **kwargs):
5ba5649b
RD
4866 """
4867 GetX(self) -> int
4868
4869 Returns the X position (in client coordinates) of the event, if
4870 applicable.
4871 """
5b5c9bc7 4872 return _core_.KeyEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4873
4874 def GetY(*args, **kwargs):
5ba5649b
RD
4875 """
4876 GetY(self) -> int
4877
4878 Returns the Y position (in client coordinates) of the event, if
4879 applicable.
4880 """
5b5c9bc7
RD
4881 return _core_.KeyEvent_GetY(*args, **kwargs)
4882
4883 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4884 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4885 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4886 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4887 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4888 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4889 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4890 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4891 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4892 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
2131d850 4893_core_.KeyEvent_swigregister(KeyEvent)
d55e5bfc
RD
4894
4895#---------------------------------------------------------------------------
4896
5b5c9bc7 4897class SizeEvent(Event):
5ba5649b
RD
4898 """
4899 A size event holds information about size change events. The EVT_SIZE
4900 handler function will be called when the window it is bound to has
4901 been resized.
4902
4903 Note that the size passed is of the whole window: call
4904 `wx.Window.GetClientSize` for the area which may be used by the
4905 application.
4906
4907 When a window is resized, usually only a small part of the window is
4908 damaged and and that area is all that is in the update region for the
4909 next paint event. However, if your drawing depends on the size of the
4910 window, you may need to clear the DC explicitly and repaint the whole
4911 window. In which case, you may need to call `wx.Window.Refresh` to
4912 invalidate the entire window.
4913
4914 """
1bd55598
RD
4915 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4916 __repr__ = _swig_repr
4917 def __init__(self, *args, **kwargs):
5ba5649b
RD
4918 """
4919 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4920
4921 Construct a new ``wx.SizeEvent``.
4922 """
1bd55598 4923 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
d55e5bfc 4924 def GetSize(*args, **kwargs):
5ba5649b
RD
4925 """
4926 GetSize(self) -> Size
4927
4928 Returns the entire size of the window generating the size change
4929 event.
4930 """
5b5c9bc7 4931 return _core_.SizeEvent_GetSize(*args, **kwargs)
d55e5bfc
RD
4932
4933 def GetRect(*args, **kwargs):
5b5c9bc7
RD
4934 """GetRect(self) -> Rect"""
4935 return _core_.SizeEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
4936
4937 def SetRect(*args, **kwargs):
5b5c9bc7
RD
4938 """SetRect(self, Rect rect)"""
4939 return _core_.SizeEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
4940
4941 def SetSize(*args, **kwargs):
5b5c9bc7
RD
4942 """SetSize(self, Size size)"""
4943 return _core_.SizeEvent_SetSize(*args, **kwargs)
d55e5bfc 4944
5b5c9bc7
RD
4945 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4946 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
2131d850 4947_core_.SizeEvent_swigregister(SizeEvent)
d55e5bfc
RD
4948
4949#---------------------------------------------------------------------------
4950
5b5c9bc7 4951class MoveEvent(Event):
5ba5649b
RD
4952 """
4953 This event object is sent for EVT_MOVE event bindings when a window is
4954 moved to a new position.
4955 """
1bd55598
RD
4956 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4957 __repr__ = _swig_repr
4958 def __init__(self, *args, **kwargs):
5ba5649b
RD
4959 """
4960 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
4961
4962 Constructor.
4963 """
1bd55598 4964 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
d55e5bfc 4965 def GetPosition(*args, **kwargs):
5ba5649b
RD
4966 """
4967 GetPosition(self) -> Point
4968
4969 Returns the position of the window generating the move change event.
4970 """
5b5c9bc7 4971 return _core_.MoveEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4972
4973 def GetRect(*args, **kwargs):
5b5c9bc7
RD
4974 """GetRect(self) -> Rect"""
4975 return _core_.MoveEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
4976
4977 def SetRect(*args, **kwargs):
5b5c9bc7
RD
4978 """SetRect(self, Rect rect)"""
4979 return _core_.MoveEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
4980
4981 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
4982 """SetPosition(self, Point pos)"""
4983 return _core_.MoveEvent_SetPosition(*args, **kwargs)
d55e5bfc 4984
fef4c27a
RD
4985 m_pos = property(GetPosition, SetPosition)
4986 m_rect = property(GetRect, SetRect)
4987
2131d850 4988_core_.MoveEvent_swigregister(MoveEvent)
d55e5bfc
RD
4989
4990#---------------------------------------------------------------------------
4991
5b5c9bc7 4992class PaintEvent(Event):
5ba5649b
RD
4993 """
4994 A paint event is sent when a window's contents needs to be repainted.
4995 Note that in an EVT_PAINT handler the application must *always* create
4996 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
4997 Windows assumes that the window has not been painted yet and will send
4998 the event again, causing endless refreshes.
4999
5000 You can optimize painting by retrieving the rectangles that have been
5001 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5002 and only repainting these rectangles. The rectangles are in terms of
5003 the client area, and are unscrolled, so you will need to do some
5004 calculations using the current view position to obtain logical,
5005 scrolled units.
5006
5007 """
1bd55598
RD
5008 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5009 __repr__ = _swig_repr
5010 def __init__(self, *args, **kwargs):
5b5c9bc7 5011 """__init__(self, int Id=0) -> PaintEvent"""
1bd55598 5012 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5013_core_.PaintEvent_swigregister(PaintEvent)
d55e5bfc 5014
5b5c9bc7
RD
5015class NcPaintEvent(Event):
5016 """Proxy of C++ NcPaintEvent class"""
1bd55598
RD
5017 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5018 __repr__ = _swig_repr
5019 def __init__(self, *args, **kwargs):
5b5c9bc7 5020 """__init__(self, int winid=0) -> NcPaintEvent"""
1bd55598 5021 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5022_core_.NcPaintEvent_swigregister(NcPaintEvent)
d55e5bfc
RD
5023
5024#---------------------------------------------------------------------------
5025
5b5c9bc7 5026class EraseEvent(Event):
5ba5649b
RD
5027 """
5028 An erase event is sent whenever the background of a window needs to be
5029 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5030 binder. On some platforms, such as GTK+, this event is simulated
5031 (simply generated just before the paint event) and may cause flicker.
5032
5033 To paint a custom background use the `GetDC` method and use the returned
5034 device context if it is not ``None``, otherwise create a temporary
5035 `wx.ClientDC` and draw on that.
5036
5037 """
1bd55598
RD
5038 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5039 __repr__ = _swig_repr
5040 def __init__(self, *args, **kwargs):
5ba5649b
RD
5041 """
5042 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5043
5044 Constructor
5045 """
1bd55598 5046 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
d55e5bfc 5047 def GetDC(*args, **kwargs):
5ba5649b
RD
5048 """
5049 GetDC(self) -> DC
5050
5051 Returns the device context the event handler should draw upon. If
5052 ``None`` is returned then create a temporary `wx.ClientDC` and use
5053 that instead.
5054 """
5b5c9bc7 5055 return _core_.EraseEvent_GetDC(*args, **kwargs)
d55e5bfc 5056
2131d850 5057_core_.EraseEvent_swigregister(EraseEvent)
d55e5bfc
RD
5058
5059#---------------------------------------------------------------------------
5060
5b5c9bc7 5061class FocusEvent(Event):
5ba5649b
RD
5062 """
5063 A focus event is sent when a window's focus changes. The window losing
5064 focus receives an EVT_KILL_FOCUS event while the window gaining it
5065 gets an EVT_SET_FOCUS event.
5066
5067 Notice that the set focus event happens both when the user gives focus
5068 to the window (whether using the mouse or keyboard) and when it is
5069 done from the program itself using `wx.Window.SetFocus`.
5070
5071 """
1bd55598
RD
5072 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5073 __repr__ = _swig_repr
5074 def __init__(self, *args, **kwargs):
5ba5649b 5075 """
2131d850 5076 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5077
5078 Constructor
5079 """
1bd55598 5080 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
d55e5bfc 5081 def GetWindow(*args, **kwargs):
5ba5649b
RD
5082 """
5083 GetWindow(self) -> Window
5084
5085 Returns the other window associated with this event, that is the
5086 window which had the focus before for the EVT_SET_FOCUS event and the
5087 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5088
5089 Warning: the window returned may be None!
5090 """
5b5c9bc7 5091 return _core_.FocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
5092
5093 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
5094 """SetWindow(self, Window win)"""
5095 return _core_.FocusEvent_SetWindow(*args, **kwargs)
d55e5bfc 5096
2131d850 5097_core_.FocusEvent_swigregister(FocusEvent)
d55e5bfc
RD
5098
5099#---------------------------------------------------------------------------
5100
5b5c9bc7 5101class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5102 """
5103 wx.ChildFocusEvent notifies the parent that a child has received the
5104 focus. Unlike `wx.FocusEvent` it is propagated up the window
5105 heirarchy.
5106 """
1bd55598
RD
5107 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5108 __repr__ = _swig_repr
5109 def __init__(self, *args, **kwargs):
5ba5649b
RD
5110 """
5111 __init__(self, Window win=None) -> ChildFocusEvent
5112
5113 Constructor
5114 """
1bd55598 5115 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
d55e5bfc 5116 def GetWindow(*args, **kwargs):
5ba5649b
RD
5117 """
5118 GetWindow(self) -> Window
5119
5120 The window which has just received the focus.
5121 """
5b5c9bc7 5122 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
d55e5bfc 5123
2131d850 5124_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d55e5bfc
RD
5125
5126#---------------------------------------------------------------------------
5127
5b5c9bc7 5128class ActivateEvent(Event):
5ba5649b
RD
5129 """
5130 An activate event is sent when a top-level window or the entire
5131 application is being activated or deactivated.
5132
5133 A top-level window (a dialog or frame) receives an activate event when
5134 is being activated or deactivated. This is indicated visually by the
5135 title bar changing colour, and a subwindow gaining the keyboard focus.
5136 An application is activated or deactivated when one of its frames
5137 becomes activated, or a frame becomes inactivate resulting in all
5138 application frames being inactive.
5139
5140 Please note that usually you should call event.Skip() in your handlers
5141 for these events so the default handlers will still be called, as not
5142 doing so can result in strange effects.
5143
5144 """
1bd55598
RD
5145 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5146 __repr__ = _swig_repr
5147 def __init__(self, *args, **kwargs):
5ba5649b 5148 """
2131d850 5149 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5150
5151 Constructor
5152 """
1bd55598 5153 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
d55e5bfc 5154 def GetActive(*args, **kwargs):
5ba5649b
RD
5155 """
5156 GetActive(self) -> bool
5157
5158 Returns true if the application or window is being activated, false
5159 otherwise.
5160 """
5b5c9bc7 5161 return _core_.ActivateEvent_GetActive(*args, **kwargs)
d55e5bfc 5162
2131d850 5163_core_.ActivateEvent_swigregister(ActivateEvent)
d55e5bfc
RD
5164
5165#---------------------------------------------------------------------------
5166
5b5c9bc7 5167class InitDialogEvent(Event):
5ba5649b
RD
5168 """
5169 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5170 any window when `wx.Window.InitDialog` is called. Handlers for this
5171 event can transfer data to the window, or anything else that should be
5172 done before the user begins editing the form. The default handler
5173 calls `wx.Window.TransferDataToWindow`.
5174 """
1bd55598
RD
5175 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5176 __repr__ = _swig_repr
5177 def __init__(self, *args, **kwargs):
5ba5649b
RD
5178 """
5179 __init__(self, int Id=0) -> InitDialogEvent
5180
5181 Constructor
5182 """
1bd55598 5183 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5184_core_.InitDialogEvent_swigregister(InitDialogEvent)
d55e5bfc
RD
5185
5186#---------------------------------------------------------------------------
5187
5b5c9bc7 5188class MenuEvent(Event):
5ba5649b
RD
5189 """
5190 This class is used for a variety of menu-related events. Note that
5191 these do not include menu command events, which are handled by sending
5192 `wx.CommandEvent` objects.
5193
5194 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5195 text in the first field of the status bar.
5196 """
1bd55598
RD
5197 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5198 __repr__ = _swig_repr
5199 def __init__(self, *args, **kwargs):
5ba5649b 5200 """
2131d850 5201 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5202
5203 Constructor
5204 """
1bd55598 5205 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
d55e5bfc 5206 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5207 """
5208 GetMenuId(self) -> int
5209
5210 Returns the menu identifier associated with the event. This method
5211 should be only used with the HIGHLIGHT events.
5212 """
5b5c9bc7 5213 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
d55e5bfc
RD
5214
5215 def IsPopup(*args, **kwargs):
5ba5649b
RD
5216 """
5217 IsPopup(self) -> bool
5218
5219 Returns ``True`` if the menu which is being opened or closed is a
5220 popup menu, ``False`` if it is a normal one. This method should only
5221 be used with the OPEN and CLOSE events.
5222 """
5b5c9bc7 5223 return _core_.MenuEvent_IsPopup(*args, **kwargs)
d55e5bfc
RD
5224
5225 def GetMenu(*args, **kwargs):
5ba5649b
RD
5226 """
5227 GetMenu(self) -> Menu
5228
5229 Returns the menu which is being opened or closed. This method should
5230 only be used with the OPEN and CLOSE events.
5231 """
5b5c9bc7 5232 return _core_.MenuEvent_GetMenu(*args, **kwargs)
d55e5bfc 5233
2131d850 5234_core_.MenuEvent_swigregister(MenuEvent)
d55e5bfc
RD
5235
5236#---------------------------------------------------------------------------
5237
5b5c9bc7 5238class CloseEvent(Event):
5ba5649b
RD
5239 """
5240 This event class contains information about window and session close
5241 events.
5242
5243 The handler function for EVT_CLOSE is called when the user has tried
5244 to close a a frame or dialog box using the window manager controls or
5245 the system menu. It can also be invoked by the application itself
5246 programmatically, for example by calling the `wx.Window.Close`
5247 function.
5248
5249 You should check whether the application is forcing the deletion of
5250 the window using `CanVeto`. If it returns ``False``, you must destroy
5251 the window using `wx.Window.Destroy`. If the return value is ``True``,
5252 it is up to you whether you respond by destroying the window or not.
5253 For example you may wish to display a message dialog prompting to save
5254 files or to cancel the close.
5255
5256 If you don't destroy the window, you should call `Veto` to let the
5257 calling code know that you did not destroy the window. This allows the
5258 `wx.Window.Close` function to return ``True`` or ``False`` depending
5259 on whether the close instruction was honored or not.
5260 """
1bd55598
RD
5261 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5262 __repr__ = _swig_repr
5263 def __init__(self, *args, **kwargs):
5ba5649b 5264 """
2131d850 5265 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5266
5267 Constructor.
5268 """
1bd55598 5269 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
d55e5bfc 5270 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5271 """
5272 SetLoggingOff(self, bool logOff)
5273
5274 Sets the 'logging off' flag.
5275 """
5b5c9bc7 5276 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5277
5278 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5279 """
5280 GetLoggingOff(self) -> bool
5281
034e3677
RD
5282 Returns ``True`` if the user is logging off or ``False`` if the
5283 system is shutting down. This method can only be called for end
5284 session and query end session events, it doesn't make sense for close
5285 window event.
5ba5649b 5286 """
5b5c9bc7 5287 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5288
5289 def Veto(*args, **kwargs):
5ba5649b
RD
5290 """
5291 Veto(self, bool veto=True)
5292
5293 Call this from your event handler to veto a system shutdown or to
5294 signal to the calling application that a window close did not happen.
5295
5296 You can only veto a shutdown or close if `CanVeto` returns true.
5297 """
5b5c9bc7 5298 return _core_.CloseEvent_Veto(*args, **kwargs)
d55e5bfc 5299
5ba5649b
RD
5300 def GetVeto(*args, **kwargs):
5301 """GetVeto(self) -> bool"""
5302 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5303
d55e5bfc 5304 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5305 """
5306 SetCanVeto(self, bool canVeto)
5307
5308 Sets the 'can veto' flag.
5309 """
5b5c9bc7 5310 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
d55e5bfc
RD
5311
5312 def CanVeto(*args, **kwargs):
5ba5649b
RD
5313 """
5314 CanVeto(self) -> bool
d55e5bfc 5315
5ba5649b
RD
5316 Returns true if you can veto a system shutdown or a window close
5317 event. Vetoing a window close event is not possible if the calling
5318 code wishes to force the application to exit, and so this function
5319 must be called to check this.
5320 """
5321 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc 5322
2131d850 5323_core_.CloseEvent_swigregister(CloseEvent)
d55e5bfc
RD
5324
5325#---------------------------------------------------------------------------
5326
5b5c9bc7 5327class ShowEvent(Event):
5ba5649b 5328 """An EVT_SHOW event is sent when a window is shown or hidden."""
1bd55598
RD
5329 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5330 __repr__ = _swig_repr
5331 def __init__(self, *args, **kwargs):
5ba5649b
RD
5332 """
5333 __init__(self, int winid=0, bool show=False) -> ShowEvent
5334
5335 An EVT_SHOW event is sent when a window is shown or hidden.
5336 """
1bd55598 5337 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
d55e5bfc
RD
5338 def SetShow(*args, **kwargs):
5339 """SetShow(self, bool show)"""
5b5c9bc7 5340 return _core_.ShowEvent_SetShow(*args, **kwargs)
d55e5bfc
RD
5341
5342 def GetShow(*args, **kwargs):
5343 """GetShow(self) -> bool"""
5b5c9bc7 5344 return _core_.ShowEvent_GetShow(*args, **kwargs)
d55e5bfc 5345
2131d850 5346_core_.ShowEvent_swigregister(ShowEvent)
d55e5bfc
RD
5347
5348#---------------------------------------------------------------------------
5349
5b5c9bc7 5350class IconizeEvent(Event):
5ba5649b
RD
5351 """
5352 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5353 restored.
5354 """
1bd55598
RD
5355 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5356 __repr__ = _swig_repr
5357 def __init__(self, *args, **kwargs):
5ba5649b
RD
5358 """
5359 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5360
5361 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5362 restored.
5363 """
1bd55598 5364 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
d55e5bfc 5365 def Iconized(*args, **kwargs):
5ba5649b
RD
5366 """
5367 Iconized(self) -> bool
5368
5369 Returns ``True`` if the frame has been iconized, ``False`` if it has
5370 been restored.
5371 """
5b5c9bc7 5372 return _core_.IconizeEvent_Iconized(*args, **kwargs)
d55e5bfc 5373
2131d850 5374_core_.IconizeEvent_swigregister(IconizeEvent)
d55e5bfc
RD
5375
5376#---------------------------------------------------------------------------
5377
5b5c9bc7 5378class MaximizeEvent(Event):
5ba5649b 5379 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
1bd55598
RD
5380 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5381 __repr__ = _swig_repr
5382 def __init__(self, *args, **kwargs):
5ba5649b
RD
5383 """
5384 __init__(self, int id=0) -> MaximizeEvent
5385
5386 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5387 """
1bd55598 5388 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5389_core_.MaximizeEvent_swigregister(MaximizeEvent)
d55e5bfc
RD
5390
5391#---------------------------------------------------------------------------
5392
5b5c9bc7 5393class DropFilesEvent(Event):
5ba5649b
RD
5394 """
5395 This class is used for drop files events, that is, when files have
5396 been dropped onto the window. This functionality is only available
5397 under Windows. The window must have previously been enabled for
5398 dropping by calling `wx.Window.DragAcceptFiles`.
5399
5400 Important note: this is a separate implementation to the more general
5401 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5402 implementation uses the older, Windows message-based approach of
5403 dropping files.
5404
5405 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5406 events.
5407
5408 """
1bd55598
RD
5409 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5410 def __init__(self): raise AttributeError, "No constructor defined"
5411 __repr__ = _swig_repr
d55e5bfc 5412 def GetPosition(*args, **kwargs):
5ba5649b
RD
5413 """
5414 GetPosition(self) -> Point
5415
5416 Returns the position at which the files were dropped.
5417 """
5b5c9bc7 5418 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5419
5420 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5421 """
5422 GetNumberOfFiles(self) -> int
5423
5424 Returns the number of files dropped.
5425 """
5b5c9bc7 5426 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
d55e5bfc
RD
5427
5428 def GetFiles(*args, **kwargs):
5ba5649b
RD
5429 """
5430 GetFiles(self) -> PyObject
5431
5432 Returns a list of the filenames that were dropped.
5433 """
5b5c9bc7 5434 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
d55e5bfc 5435
2131d850 5436_core_.DropFilesEvent_swigregister(DropFilesEvent)
d55e5bfc
RD
5437
5438#---------------------------------------------------------------------------
5439
5b5c9bc7
RD
5440UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5441UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5442class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5443 """
5444 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5445 wxWidgets to give an application the chance to update various user
5446 interface elements.
5447
5448 Without update UI events, an application has to work hard to
5449 check/uncheck, enable/disable, and set the text for elements such as
5450 menu items and toolbar buttons. The code for doing this has to be
5451 mixed up with the code that is invoked when an action is invoked for a
5452 menu item or button.
5453
5454 With update UI events, you define an event handler to look at the
5455 state of the application and change UI elements accordingly. wxWidgets
5456 will call your handler functions in idle time, so you don't have to
5457 worry where to call this code. In addition to being a clearer and more
5458 declarative method, it also means you don't have to worry whether
5459 you're updating a toolbar or menubar identifier. The same handler can
5460 update a menu item and toolbar button, if the ID values are the same.
5461
5462 Instead of directly manipulating the menu or button, you call
5463 functions in the event object, such as `Check`. wxWidgets will
5464 determine whether such a call has been made, and which UI element to
5465 update.
5466
5467 These events will work for popup menus as well as menubars. Just
5468 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5469 any UI events for the window that owns the menu.
5470
5471 If you find that the overhead of UI update processing is affecting
5472 your application, you can do one or both of the following:
5473
5474 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5475 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5476 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5477 receive update events. No other windows will receive update
5478 events.
5479
5480 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5481 value to set the delay between updates. You may need to call
5482 `wx.Window.UpdateWindowUI` at critical points, for example when
5483 a dialog is about to be shown, in case the user sees a slight
5484 delay before windows are updated.
5485
5486 Note that although events are sent in idle time, defining a EVT_IDLE
5487 handler for a window does not affect this because the events are sent
5488 from an internal idle handler.
5489
5490 wxWidgets tries to optimize update events on some platforms. On
5491 Windows and GTK+, events for menubar items are only sent when the menu
5492 is about to be shown, and not in idle time.
5493
5494 """
1bd55598
RD
5495 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5496 __repr__ = _swig_repr
5497 def __init__(self, *args, **kwargs):
5ba5649b
RD
5498 """
5499 __init__(self, int commandId=0) -> UpdateUIEvent
5500
5501 Constructor
5502 """
1bd55598 5503 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
d55e5bfc 5504 def GetChecked(*args, **kwargs):
5ba5649b
RD
5505 """
5506 GetChecked(self) -> bool
5507
5508 Returns ``True`` if the UI element should be checked.
5509 """
5b5c9bc7 5510 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
d55e5bfc
RD
5511
5512 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5513 """
5514 GetEnabled(self) -> bool
5515
5516 Returns ``True`` if the UI element should be enabled.
5517 """
5b5c9bc7 5518 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
d55e5bfc 5519
b1fcee84
RD
5520 def GetShown(*args, **kwargs):
5521 """
5522 GetShown(self) -> bool
5523
5524 Returns ``True`` if the UI element should be shown.
5525 """
5526 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5527
d55e5bfc 5528 def GetText(*args, **kwargs):
5ba5649b
RD
5529 """
5530 GetText(self) -> String
5531
5532 Returns the text that should be set for the UI element.
5533 """
5b5c9bc7 5534 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
d55e5bfc
RD
5535
5536 def GetSetText(*args, **kwargs):
5ba5649b
RD
5537 """
5538 GetSetText(self) -> bool
5539
5540 Returns ``True`` if the application has called `SetText`. For
5541 wxWidgets internal use only.
5542 """
5b5c9bc7 5543 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
d55e5bfc
RD
5544
5545 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5546 """
5547 GetSetChecked(self) -> bool
5548
5549 Returns ``True`` if the application has called `Check`. For wxWidgets
5550 internal use only.
5551 """
5b5c9bc7 5552 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
d55e5bfc
RD
5553
5554 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5555 """
5556 GetSetEnabled(self) -> bool
5557
5558 Returns ``True`` if the application has called `Enable`. For wxWidgets
5559 internal use only.
5560 """
5b5c9bc7 5561 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
d55e5bfc 5562
b1fcee84
RD
5563 def GetSetShown(*args, **kwargs):
5564 """
5565 GetSetShown(self) -> bool
5566
5567 Returns ``True`` if the application has called `Show`. For wxWidgets
5568 internal use only.
5569 """
5570 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5571
d55e5bfc 5572 def Check(*args, **kwargs):
5ba5649b
RD
5573 """
5574 Check(self, bool check)
5575
5576 Check or uncheck the UI element.
5577 """
5b5c9bc7 5578 return _core_.UpdateUIEvent_Check(*args, **kwargs)
d55e5bfc
RD
5579
5580 def Enable(*args, **kwargs):
5ba5649b
RD
5581 """
5582 Enable(self, bool enable)
5583
5584 Enable or disable the UI element.
5585 """
5b5c9bc7 5586 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
d55e5bfc 5587
b1fcee84
RD
5588 def Show(*args, **kwargs):
5589 """
5590 Show(self, bool show)
5591
5592 Show or hide the UI element.
5593 """
5594 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5595
d55e5bfc 5596 def SetText(*args, **kwargs):
5ba5649b
RD
5597 """
5598 SetText(self, String text)
5599
5600 Sets the text for this UI element.
5601 """
5b5c9bc7 5602 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
d55e5bfc
RD
5603
5604 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5605 """
5606 SetUpdateInterval(long updateInterval)
5607
5608 Sets the interval between updates in milliseconds. Set to -1 to
5609 disable updates, or to 0 to update as frequently as possible. The
5610 default is 0.
5611
5612 Use this to reduce the overhead of UI update events if your
5613 application has a lot of windows. If you set the value to -1 or
5614 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5615 at appropriate points in your application, such as when a dialog is
5616 about to be shown.
5617 """
5b5c9bc7 5618 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5619
5620 SetUpdateInterval = staticmethod(SetUpdateInterval)
5621 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5622 """
5623 GetUpdateInterval() -> long
5624
5625 Returns the current interval between updates in milliseconds. -1
5626 disables updates, 0 updates as frequently as possible.
5627 """
5b5c9bc7 5628 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5629
5630 GetUpdateInterval = staticmethod(GetUpdateInterval)
5631 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5632 """
5633 CanUpdate(Window win) -> bool
5634
5635 Returns ``True`` if it is appropriate to update (send UI update events
5636 to) this window.
5637
5638 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5639 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5640 events were last sent in idle time, and the update interval, to
5641 determine whether events should be sent to this window now. By default
5642 this will always return true because the update mode is initially
5643 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5644 events will be sent as often as possible. You can reduce the frequency
5645 that events are sent by changing the mode and/or setting an update
5646 interval.
5647
5648 """
5b5c9bc7 5649 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc
RD
5650
5651 CanUpdate = staticmethod(CanUpdate)
5652 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5653 """
5654 ResetUpdateTime()
5655
5656 Used internally to reset the last-updated time to the current time. It
5657 is assumed that update events are normally sent in idle time, so this
5658 is called at the end of idle processing.
5659 """
5b5c9bc7 5660 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc
RD
5661
5662 ResetUpdateTime = staticmethod(ResetUpdateTime)
5663 def SetMode(*args, **kwargs):
5ba5649b
RD
5664 """
5665 SetMode(int mode)
5666
5667 Specify how wxWidgets will send update events: to all windows, or only
5668 to those which specify that they will process the events.
5669
5670 The mode may be one of the following values:
5671
5672 ============================= ==========================================
5673 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5674 is the default setting.
5675 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5676 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5677 style set.
5678 ============================= ==========================================
5679
5680 """
5b5c9bc7 5681 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
5682
5683 SetMode = staticmethod(SetMode)
5684 def GetMode(*args, **kwargs):
5ba5649b
RD
5685 """
5686 GetMode() -> int
5687
5688 Returns a value specifying how wxWidgets will send update events: to
5689 all windows, or only to those which specify that they will process the
5690 events.
5691 """
5b5c9bc7 5692 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
5693
5694 GetMode = staticmethod(GetMode)
2131d850 5695_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d55e5bfc 5696
5b5c9bc7 5697def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
1bd55598 5698 """
5ba5649b
RD
5699 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5700
5701 Sets the interval between updates in milliseconds. Set to -1 to
5702 disable updates, or to 0 to update as frequently as possible. The
5703 default is 0.
5704
5705 Use this to reduce the overhead of UI update events if your
5706 application has a lot of windows. If you set the value to -1 or
5707 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5708 at appropriate points in your application, such as when a dialog is
5709 about to be shown.
5710 """
1bd55598 5711 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 5712
1bd55598
RD
5713def UpdateUIEvent_GetUpdateInterval(*args):
5714 """
5ba5649b
RD
5715 UpdateUIEvent_GetUpdateInterval() -> long
5716
5717 Returns the current interval between updates in milliseconds. -1
5718 disables updates, 0 updates as frequently as possible.
5719 """
1bd55598 5720 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d55e5bfc 5721
5b5c9bc7 5722def UpdateUIEvent_CanUpdate(*args, **kwargs):
1bd55598 5723 """
5ba5649b
RD
5724 UpdateUIEvent_CanUpdate(Window win) -> bool
5725
5726 Returns ``True`` if it is appropriate to update (send UI update events
5727 to) this window.
5728
5729 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5730 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5731 events were last sent in idle time, and the update interval, to
5732 determine whether events should be sent to this window now. By default
5733 this will always return true because the update mode is initially
5734 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5735 events will be sent as often as possible. You can reduce the frequency
5736 that events are sent by changing the mode and/or setting an update
5737 interval.
5738
5739 """
1bd55598 5740 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 5741
1bd55598
RD
5742def UpdateUIEvent_ResetUpdateTime(*args):
5743 """
5ba5649b
RD
5744 UpdateUIEvent_ResetUpdateTime()
5745
5746 Used internally to reset the last-updated time to the current time. It
5747 is assumed that update events are normally sent in idle time, so this
5748 is called at the end of idle processing.
5749 """
1bd55598 5750 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d55e5bfc 5751
5b5c9bc7 5752def UpdateUIEvent_SetMode(*args, **kwargs):
1bd55598 5753 """
5ba5649b
RD
5754 UpdateUIEvent_SetMode(int mode)
5755
5756 Specify how wxWidgets will send update events: to all windows, or only
5757 to those which specify that they will process the events.
5758
5759 The mode may be one of the following values:
5760
5761 ============================= ==========================================
5762 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5763 is the default setting.
5764 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5765 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5766 style set.
5767 ============================= ==========================================
5768
5769 """
1bd55598 5770 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 5771
1bd55598
RD
5772def UpdateUIEvent_GetMode(*args):
5773 """
5ba5649b
RD
5774 UpdateUIEvent_GetMode() -> int
5775
5776 Returns a value specifying how wxWidgets will send update events: to
5777 all windows, or only to those which specify that they will process the
5778 events.
5779 """
1bd55598 5780 return _core_.UpdateUIEvent_GetMode(*args)
d55e5bfc
RD
5781
5782#---------------------------------------------------------------------------
5783
5b5c9bc7 5784class SysColourChangedEvent(Event):
5ba5649b
RD
5785 """
5786 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5787 when the user changes the colour settings using the control
5788 panel. This is only applicable under Windows.
5789
5790 The default event handler for this event propagates the event to child
5791 windows, since Windows only sends the events to top-level windows. If
5792 intercepting this event for a top-level window, remember to call
5793 `Skip` so the the base class handler will still be executed, or to
5794 pass the event on to the window's children explicitly.
5795
5796 """
1bd55598
RD
5797 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5798 __repr__ = _swig_repr
5799 def __init__(self, *args, **kwargs):
5ba5649b
RD
5800 """
5801 __init__(self) -> SysColourChangedEvent
5802
5803 Constructor
5804 """
1bd55598 5805 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 5806_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d55e5bfc
RD
5807
5808#---------------------------------------------------------------------------
5809
5b5c9bc7 5810class MouseCaptureChangedEvent(Event):
5ba5649b
RD
5811 """
5812 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5813 a window that loses its mouse capture. This is called even if
5814 `wx.Window.ReleaseMouse` was called by the application code. Handling
5815 this event allows an application to cater for unexpected capture
5816 releases which might otherwise confuse mouse handling code.
5817
5818 This event is implemented under Windows only.
5819 """
1bd55598
RD
5820 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5821 __repr__ = _swig_repr
5822 def __init__(self, *args, **kwargs):
5ba5649b
RD
5823 """
5824 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5825
5826 Constructor
5827 """
1bd55598 5828 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
d55e5bfc 5829 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
5830 """
5831 GetCapturedWindow(self) -> Window
5832
5833 Returns the window that gained the capture, or ``None`` if it was a
5834 non-wxWidgets window.
5835 """
5b5c9bc7 5836 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
d55e5bfc 5837
2131d850 5838_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d55e5bfc
RD
5839
5840#---------------------------------------------------------------------------
5841
5b5c9bc7 5842class DisplayChangedEvent(Event):
5ba5649b
RD
5843 """
5844 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5845 resolution has changed.
5846
5847 This event is implemented under Windows only.
5848 """
1bd55598
RD
5849 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5850 __repr__ = _swig_repr
5851 def __init__(self, *args, **kwargs):
5b5c9bc7 5852 """__init__(self) -> DisplayChangedEvent"""
1bd55598 5853 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 5854_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d55e5bfc
RD
5855
5856#---------------------------------------------------------------------------
5857
5b5c9bc7 5858class PaletteChangedEvent(Event):
5ba5649b
RD
5859 """
5860 An EVT_PALETTE_CHANGED event is sent when the system palette has
5861 changed, thereby giving each window a chance to redo their own to
5862 match.
5863
5864 This event is implemented under Windows only.
5865 """
1bd55598
RD
5866 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5867 __repr__ = _swig_repr
5868 def __init__(self, *args, **kwargs):
5ba5649b
RD
5869 """
5870 __init__(self, int id=0) -> PaletteChangedEvent
5871
5872 An EVT_PALETTE_CHANGED event is sent when the system palette has
5873 changed, thereby giving each window a chance to redo their own to
5874 match.
5875
5876 This event is implemented under Windows only.
5877 """
1bd55598 5878 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
d55e5bfc 5879 def SetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
5880 """SetChangedWindow(self, Window win)"""
5881 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
d55e5bfc
RD
5882
5883 def GetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
5884 """GetChangedWindow(self) -> Window"""
5885 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
d55e5bfc 5886
2131d850 5887_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d55e5bfc
RD
5888
5889#---------------------------------------------------------------------------
5890
5b5c9bc7 5891class QueryNewPaletteEvent(Event):
5ba5649b
RD
5892 """
5893 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5894 focus and should re-do its palette.
5895
5896 This event is implemented under Windows only.
5897 """
1bd55598
RD
5898 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5899 __repr__ = _swig_repr
5900 def __init__(self, *args, **kwargs):
5ba5649b
RD
5901 """
5902 __init__(self, int winid=0) -> QueryNewPaletteEvent
5903
5904 Constructor.
5905 """
1bd55598 5906 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
d55e5bfc 5907 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
5908 """
5909 SetPaletteRealized(self, bool realized)
5910
5911 App should set this if it changes the palette.
5912 """
5b5c9bc7 5913 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
5914
5915 def GetPaletteRealized(*args, **kwargs):
5916 """GetPaletteRealized(self) -> bool"""
5b5c9bc7 5917 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
d55e5bfc 5918
2131d850 5919_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d55e5bfc
RD
5920
5921#---------------------------------------------------------------------------
5922
5b5c9bc7 5923class NavigationKeyEvent(Event):
5ba5649b
RD
5924 """
5925 EVT_NAVIGATION_KEY events are used to control moving the focus between
5926 widgets, otherwise known as tab-traversal. You woudl normally not
5927 catch navigation events in applications as there are already
5928 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5929 it useful to send navigation events in certain situations to change
5930 the focus in certain ways, although it's probably easier to just call
5931 `wx.Window.Navigate`.
5932 """
1bd55598
RD
5933 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5934 __repr__ = _swig_repr
5935 def __init__(self, *args, **kwargs):
5b5c9bc7 5936 """__init__(self) -> NavigationKeyEvent"""
1bd55598 5937 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
d55e5bfc 5938 def GetDirection(*args, **kwargs):
5ba5649b
RD
5939 """
5940 GetDirection(self) -> bool
5941
5942 Returns ``True`` if the direction is forward, ``False`` otherwise.
5943 """
5b5c9bc7 5944 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
d55e5bfc
RD
5945
5946 def SetDirection(*args, **kwargs):
5ba5649b
RD
5947 """
5948 SetDirection(self, bool forward)
5949
5950 Specify the direction that the navigation should take. Usually the
5951 difference between using Tab and Shift-Tab.
5952 """
5b5c9bc7 5953 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
d55e5bfc
RD
5954
5955 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
5956 """
5957 IsWindowChange(self) -> bool
5958
5959 Returns ``True`` if window change is allowed.
5960 """
5b5c9bc7 5961 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
d55e5bfc
RD
5962
5963 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
5964 """
5965 SetWindowChange(self, bool ischange)
5966
5967 Specify if the navigation should be able to change parent windows.
5968 For example, changing notebook pages, etc. This is usually implemented
5969 by using Control-Tab.
5970 """
5b5c9bc7 5971 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
d55e5bfc 5972
68350608 5973 def IsFromTab(*args, **kwargs):
5ba5649b
RD
5974 """
5975 IsFromTab(self) -> bool
5976
5977 Returns ``True`` if the navigation event is originated from the Tab
5978 key.
5979 """
5b5c9bc7 5980 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
68350608
RD
5981
5982 def SetFromTab(*args, **kwargs):
5ba5649b
RD
5983 """
5984 SetFromTab(self, bool bIs)
5985
5986 Set to true under MSW if the event was generated using the tab key.
5987 This is required for proper navogation over radio buttons.
5988 """
5b5c9bc7 5989 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
68350608 5990
908b74cd 5991 def SetFlags(*args, **kwargs):
5ba5649b
RD
5992 """
5993 SetFlags(self, long flags)
5994
5995 Set the navigation flags to a combination of the following:
5996
5997 * wx.NavigationKeyEvent.IsBackward
5998 * wx.NavigationKeyEvent.IsForward
5999 * wx.NavigationKeyEvent.WinChange
6000 * wx.NavigationKeyEvent.FromTab
6001
6002 """
5b5c9bc7 6003 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
908b74cd 6004
d55e5bfc 6005 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6006 """
6007 GetCurrentFocus(self) -> Window
6008
6009 Returns the child window which currenty has the focus. May be
6010 ``None``.
6011 """
5b5c9bc7 6012 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
d55e5bfc
RD
6013
6014 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6015 """
6016 SetCurrentFocus(self, Window win)
6017
6018 Set the window that has the focus.
6019 """
5b5c9bc7 6020 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
d55e5bfc 6021
5b5c9bc7
RD
6022 IsBackward = _core_.NavigationKeyEvent_IsBackward
6023 IsForward = _core_.NavigationKeyEvent_IsForward
6024 WinChange = _core_.NavigationKeyEvent_WinChange
6025 FromTab = _core_.NavigationKeyEvent_FromTab
2131d850 6026_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d55e5bfc
RD
6027
6028#---------------------------------------------------------------------------
6029
5b5c9bc7 6030class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6031 """
6032 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6033 underlying GUI object) exists.
6034 """
1bd55598
RD
6035 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6036 __repr__ = _swig_repr
6037 def __init__(self, *args, **kwargs):
5ba5649b
RD
6038 """
6039 __init__(self, Window win=None) -> WindowCreateEvent
6040
6041 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6042 underlying GUI object) exists.
6043 """
1bd55598 6044 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
d55e5bfc 6045 def GetWindow(*args, **kwargs):
5ba5649b
RD
6046 """
6047 GetWindow(self) -> Window
6048
6049 Returns the window that this event refers to.
6050 """
5b5c9bc7 6051 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
d55e5bfc 6052
2131d850 6053_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d55e5bfc 6054
5b5c9bc7 6055class WindowDestroyEvent(CommandEvent):
5ba5649b 6056 """
943e8dfd
RD
6057 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6058 when the GUI window is destroyed.
6059
6060 When a class derived from `wx.Window` is destroyed its destructor will
6061 have already run by the time this event is sent. Therefore this event
6062 will not usually be received at all by the window itself. Since it is
6063 received after the destructor has run, an object should not try to
6064 handle its own wx.WindowDestroyEvent, but it can be used to get
6065 notification of the destruction of another window.
5ba5649b 6066 """
1bd55598
RD
6067 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6068 __repr__ = _swig_repr
6069 def __init__(self, *args, **kwargs):
5ba5649b
RD
6070 """
6071 __init__(self, Window win=None) -> WindowDestroyEvent
6072
943e8dfd
RD
6073 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6074 when the GUI window is destroyed.
6075
6076 When a class derived from `wx.Window` is destroyed its destructor will
6077 have already run by the time this event is sent. Therefore this event
6078 will not usually be received at all by the window itself. Since it is
6079 received after the destructor has run, an object should not try to
6080 handle its own wx.WindowDestroyEvent, but it can be used to get
6081 notification of the destruction of another window.
5ba5649b 6082 """
1bd55598 6083 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
d55e5bfc 6084 def GetWindow(*args, **kwargs):
5ba5649b
RD
6085 """
6086 GetWindow(self) -> Window
6087
6088 Returns the window that this event refers to.
6089 """
5b5c9bc7 6090 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
d55e5bfc 6091
2131d850 6092_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d55e5bfc
RD
6093
6094#---------------------------------------------------------------------------
6095
5b5c9bc7 6096class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6097 """
6098 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6099 give the application a chance to show a context (popup) menu.
6100 """
1bd55598
RD
6101 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6102 __repr__ = _swig_repr
6103 def __init__(self, *args, **kwargs):
5ba5649b 6104 """
2131d850 6105 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6106
6107 Constructor.
6108 """
1bd55598 6109 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
d55e5bfc 6110 def GetPosition(*args, **kwargs):
5ba5649b
RD
6111 """
6112 GetPosition(self) -> Point
6113
6114 Returns the position (in screen coordinants) at which the menu should
6115 be shown.
6116 """
5b5c9bc7 6117 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
6118
6119 def SetPosition(*args, **kwargs):
5ba5649b
RD
6120 """
6121 SetPosition(self, Point pos)
6122
6123 Sets the position at which the menu should be shown.
6124 """
5b5c9bc7 6125 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
d55e5bfc 6126
2131d850 6127_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d55e5bfc
RD
6128
6129#---------------------------------------------------------------------------
6130
5b5c9bc7
RD
6131IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6132IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6133class IdleEvent(Event):
5ba5649b
RD
6134 """
6135 This class is used for EVT_IDLE events, which are generated and sent
6136 when the application *becomes* idle. In other words, the when the
6137 event queue becomes empty then idle events are sent to all windows (by
6138 default) and as long as none of them call `RequestMore` then there are
6139 no more idle events until after the system event queue has some normal
6140 events and then becomes empty again.
6141
6142 By default, idle events are sent to all windows. If this is causing a
6143 significant overhead in your application, you can call
6144 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6145 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6146 which should receive idle events. Then idle events will only be sent
6147 to those windows and not to any others.
6148 """
1bd55598
RD
6149 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6150 __repr__ = _swig_repr
6151 def __init__(self, *args, **kwargs):
5ba5649b
RD
6152 """
6153 __init__(self) -> IdleEvent
6154
6155 Constructor
6156 """
1bd55598 6157 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
d55e5bfc 6158 def RequestMore(*args, **kwargs):
5ba5649b
RD
6159 """
6160 RequestMore(self, bool needMore=True)
6161
6162 Tells wxWidgets that more processing is required. This function can be
6163 called by an EVT_IDLE handler for a window to indicate that the
6164 application should forward the EVT_IDLE event once more to the
6165 application windows. If no window calls this function during its
6166 EVT_IDLE handler, then the application will remain in a passive event
6167 loop until a new event is posted to the application by the windowing
6168 system.
6169 """
5b5c9bc7 6170 return _core_.IdleEvent_RequestMore(*args, **kwargs)
d55e5bfc
RD
6171
6172 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6173 """
6174 MoreRequested(self) -> bool
6175
6176 Returns ``True`` if the OnIdle function processing this event
6177 requested more processing time.
6178 """
5b5c9bc7 6179 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
d55e5bfc
RD
6180
6181 def SetMode(*args, **kwargs):
5ba5649b
RD
6182 """
6183 SetMode(int mode)
6184
6185 Static method for specifying how wxWidgets will send idle events: to
6186 all windows, or only to those which specify that they will process the
6187 events.
6188
6189 The mode can be one of the following values:
6190
6191 ========================= ========================================
6192 wx.IDLE_PROCESS_ALL Send idle events to all windows
6193 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6194 the wx.WS_EX_PROCESS_IDLE extra style
6195 flag set.
6196 ========================= ========================================
6197
6198 """
5b5c9bc7 6199 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
6200
6201 SetMode = staticmethod(SetMode)
6202 def GetMode(*args, **kwargs):
5ba5649b
RD
6203 """
6204 GetMode() -> int
6205
6206 Static method returning a value specifying how wxWidgets will send
6207 idle events: to all windows, or only to those which specify that they
6208 will process the events.
6209 """
5b5c9bc7 6210 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6211
6212 GetMode = staticmethod(GetMode)
6213 def CanSend(*args, **kwargs):
5ba5649b
RD
6214 """
6215 CanSend(Window win) -> bool
6216
6217 Returns ``True`` if it is appropriate to send idle events to this
6218 window.
6219
6220 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6221 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6222 events should be sent to this window now. By default this will always
6223 return ``True`` because the update mode is initially
6224 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6225 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6226 """
5b5c9bc7 6227 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6228
6229 CanSend = staticmethod(CanSend)
2131d850 6230_core_.IdleEvent_swigregister(IdleEvent)
d55e5bfc 6231
5b5c9bc7 6232def IdleEvent_SetMode(*args, **kwargs):
1bd55598 6233 """
5ba5649b
RD
6234 IdleEvent_SetMode(int mode)
6235
6236 Static method for specifying how wxWidgets will send idle events: to
6237 all windows, or only to those which specify that they will process the
6238 events.
6239
6240 The mode can be one of the following values:
6241
6242 ========================= ========================================
6243 wx.IDLE_PROCESS_ALL Send idle events to all windows
6244 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6245 the wx.WS_EX_PROCESS_IDLE extra style
6246 flag set.
6247 ========================= ========================================
6248
6249 """
1bd55598 6250 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6251
1bd55598
RD
6252def IdleEvent_GetMode(*args):
6253 """
5ba5649b
RD
6254 IdleEvent_GetMode() -> int
6255
6256 Static method returning a value specifying how wxWidgets will send
6257 idle events: to all windows, or only to those which specify that they
6258 will process the events.
6259 """
1bd55598 6260 return _core_.IdleEvent_GetMode(*args)
d55e5bfc 6261
5b5c9bc7 6262def IdleEvent_CanSend(*args, **kwargs):
1bd55598 6263 """
5ba5649b
RD
6264 IdleEvent_CanSend(Window win) -> bool
6265
6266 Returns ``True`` if it is appropriate to send idle events to this
6267 window.
6268
6269 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6270 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6271 events should be sent to this window now. By default this will always
6272 return ``True`` because the update mode is initially
6273 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6274 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6275 """
1bd55598 6276 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6277
6278#---------------------------------------------------------------------------
6279
2131d850
RD
6280class ClipboardTextEvent(CommandEvent):
6281 """
6282 A Clipboard Text event is sent when a window intercepts a text
6283 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6284 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6285 popup menu command, etc. NOTE : under windows these events are *NOT*
6286 generated automatically for a Rich Edit text control.
6287 """
6288 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6289 __repr__ = _swig_repr
6290 def __init__(self, *args, **kwargs):
6291 """
6292 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6293
6294 A Clipboard Text event is sent when a window intercepts a text
6295 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6296 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6297 popup menu command, etc. NOTE : under windows these events are *NOT*
6298 generated automatically for a Rich Edit text control.
6299 """
6300 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6301_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6302
6303#---------------------------------------------------------------------------
6304
5b5c9bc7 6305class PyEvent(Event):
5ba5649b
RD
6306 """
6307 wx.PyEvent can be used as a base class for implementing custom event
6308 types in Python. You should derived from this class instead of
6309 `wx.Event` because this class is Python-aware and is able to transport
6310 its Python bits safely through the wxWidgets event system and have
6311 them still be there when the event handler is invoked.
6312
6313 :see: `wx.PyCommandEvent`
6314
6315 """
1bd55598
RD
6316 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6317 __repr__ = _swig_repr
6318 def __init__(self, *args, **kwargs):
2131d850 6319 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
1bd55598 6320 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6321 self._SetSelf(self)
d55e5bfc 6322
1bd55598
RD
6323 __swig_destroy__ = _core_.delete_PyEvent
6324 __del__ = lambda self : None;
5ba5649b
RD
6325 def _SetSelf(*args, **kwargs):
6326 """_SetSelf(self, PyObject self)"""
6327 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6328
5ba5649b
RD
6329 def _GetSelf(*args, **kwargs):
6330 """_GetSelf(self) -> PyObject"""
6331 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc 6332
2131d850 6333_core_.PyEvent_swigregister(PyEvent)
d55e5bfc 6334
5b5c9bc7 6335class PyCommandEvent(CommandEvent):
5ba5649b
RD
6336 """
6337 wx.PyCommandEvent can be used as a base class for implementing custom
6338 event types in Python, where the event shoudl travel up to parent
6339 windows looking for a handler. You should derived from this class
6340 instead of `wx.CommandEvent` because this class is Python-aware and is
6341 able to transport its Python bits safely through the wxWidgets event
6342 system and have them still be there when the event handler is invoked.
6343
6344 :see: `wx.PyEvent`
6345
6346 """
1bd55598
RD
6347 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6348 __repr__ = _swig_repr
6349 def __init__(self, *args, **kwargs):
2131d850 6350 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
1bd55598 6351 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6352 self._SetSelf(self)
d55e5bfc 6353
1bd55598
RD
6354 __swig_destroy__ = _core_.delete_PyCommandEvent
6355 __del__ = lambda self : None;
5ba5649b
RD
6356 def _SetSelf(*args, **kwargs):
6357 """_SetSelf(self, PyObject self)"""
6358 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6359
5ba5649b
RD
6360 def _GetSelf(*args, **kwargs):
6361 """_GetSelf(self) -> PyObject"""
6362 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc 6363
2131d850 6364_core_.PyCommandEvent_swigregister(PyCommandEvent)
d55e5bfc 6365
5b5c9bc7 6366class DateEvent(CommandEvent):
5ba5649b
RD
6367 """
6368 This event class holds information about a date change event and is
6369 used together with `wx.DatePickerCtrl`. It also serves as a base class
6370 for `wx.calendar.CalendarEvent`. Bind these event types with
6371 EVT_DATE_CHANGED.
6372 """
1bd55598
RD
6373 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6374 __repr__ = _swig_repr
6375 def __init__(self, *args, **kwargs):
2131d850 6376 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
1bd55598 6377 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6378 def GetDate(*args, **kwargs):
5ba5649b
RD
6379 """
6380 GetDate(self) -> DateTime
6381
6382 Returns the date.
6383 """
5b5c9bc7 6384 return _core_.DateEvent_GetDate(*args, **kwargs)
53aa7709
RD
6385
6386 def SetDate(*args, **kwargs):
5ba5649b
RD
6387 """
6388 SetDate(self, DateTime date)
6389
6390 Sets the date carried by the event, normally only used by the library
6391 internally.
6392 """
5b5c9bc7 6393 return _core_.DateEvent_SetDate(*args, **kwargs)
53aa7709 6394
2131d850 6395_core_.DateEvent_swigregister(DateEvent)
53aa7709 6396
5b5c9bc7 6397wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
53aa7709
RD
6398EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6399
d55e5bfc
RD
6400#---------------------------------------------------------------------------
6401
5b5c9bc7
RD
6402PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6403PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6404PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6405PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6406PRINT_WINDOWS = _core_.PRINT_WINDOWS
6407PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6408class PyApp(EvtHandler):
d6c14a4c
RD
6409 """
6410 The ``wx.PyApp`` class is an *implementation detail*, please use the
6411 `wx.App` class (or some other derived class) instead.
6412 """
1bd55598
RD
6413 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6414 __repr__ = _swig_repr
6415 def __init__(self, *args, **kwargs):
d55e5bfc 6416 """
5b5c9bc7 6417 __init__(self) -> PyApp
d55e5bfc
RD
6418
6419 Create a new application object, starting the bootstrap process.
6420 """
1bd55598 6421 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
7993762b
RD
6422 self._setCallbackInfo(self, PyApp, False)
6423 self._setOORInfo(self, False)
d55e5bfc 6424
1bd55598
RD
6425 __swig_destroy__ = _core_.delete_PyApp
6426 __del__ = lambda self : None;
d55e5bfc 6427 def _setCallbackInfo(*args, **kwargs):
7993762b 6428 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
5b5c9bc7 6429 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
6430
6431 def GetAppName(*args, **kwargs):
6432 """
5b5c9bc7 6433 GetAppName(self) -> String
d55e5bfc
RD
6434
6435 Get the application name.
6436 """
5b5c9bc7 6437 return _core_.PyApp_GetAppName(*args, **kwargs)
d55e5bfc
RD
6438
6439 def SetAppName(*args, **kwargs):
6440 """
5b5c9bc7 6441 SetAppName(self, String name)
d55e5bfc 6442
d6c14a4c
RD
6443 Set the application name. This value may be used automatically by
6444 `wx.Config` and such.
d55e5bfc 6445 """
5b5c9bc7 6446 return _core_.PyApp_SetAppName(*args, **kwargs)
d55e5bfc
RD
6447
6448 def GetClassName(*args, **kwargs):
6449 """
5b5c9bc7 6450 GetClassName(self) -> String
d55e5bfc
RD
6451
6452 Get the application's class name.
6453 """
5b5c9bc7 6454 return _core_.PyApp_GetClassName(*args, **kwargs)
d55e5bfc
RD
6455
6456 def SetClassName(*args, **kwargs):
6457 """
5b5c9bc7 6458 SetClassName(self, String name)
d55e5bfc 6459
d6c14a4c
RD
6460 Set the application's class name. This value may be used for
6461 X-resources if applicable for the platform
d55e5bfc 6462 """
5b5c9bc7 6463 return _core_.PyApp_SetClassName(*args, **kwargs)
d55e5bfc
RD
6464
6465 def GetVendorName(*args, **kwargs):
6466 """
5b5c9bc7 6467 GetVendorName(self) -> String
d55e5bfc
RD
6468
6469 Get the application's vendor name.
6470 """
5b5c9bc7 6471 return _core_.PyApp_GetVendorName(*args, **kwargs)
d55e5bfc
RD
6472
6473 def SetVendorName(*args, **kwargs):
6474 """
5b5c9bc7 6475 SetVendorName(self, String name)
d55e5bfc 6476
d6c14a4c
RD
6477 Set the application's vendor name. This value may be used
6478 automatically by `wx.Config` and such.
d55e5bfc 6479 """
5b5c9bc7 6480 return _core_.PyApp_SetVendorName(*args, **kwargs)
d55e5bfc
RD
6481
6482 def GetTraits(*args, **kwargs):
6483 """
6484 GetTraits(self) -> wxAppTraits
6485
d6c14a4c
RD
6486 Return (and create if necessary) the app traits object to which we
6487 delegate for everything which either should be configurable by the
6488 user (then he can change the default behaviour simply by overriding
6489 CreateTraits() and returning his own traits object) or which is
6490 GUI/console dependent as then wx.AppTraits allows us to abstract the
6491 differences behind the common facade.
6492
6493 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc 6494 """
5b5c9bc7 6495 return _core_.PyApp_GetTraits(*args, **kwargs)
d55e5bfc
RD
6496
6497 def ProcessPendingEvents(*args, **kwargs):
6498 """
6499 ProcessPendingEvents(self)
6500
d6c14a4c
RD
6501 Process all events in the Pending Events list -- it is necessary to
6502 call this function to process posted events. This normally happens
6503 during each event loop iteration.
d55e5bfc 6504 """
5b5c9bc7 6505 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
6506
6507 def Yield(*args, **kwargs):
6508 """
6509 Yield(self, bool onlyIfNeeded=False) -> bool
6510
d6c14a4c
RD
6511 Process all currently pending events right now, instead of waiting
6512 until return to the event loop. It is an error to call ``Yield``
6513 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 6514
d6c14a4c 6515 :warning: This function is dangerous as it can lead to unexpected
15817c7e
RD
6516 reentrancies (i.e. when called from an event handler it may
6517 result in calling the same event handler again), use with
6518 extreme care or, better, don't use at all!
d55e5bfc 6519
d6c14a4c 6520 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
15817c7e 6521
d55e5bfc 6522 """
5b5c9bc7 6523 return _core_.PyApp_Yield(*args, **kwargs)
d55e5bfc
RD
6524
6525 def WakeUpIdle(*args, **kwargs):
6526 """
6527 WakeUpIdle(self)
6528
d6c14a4c
RD
6529 Make sure that idle events are sent again.
6530 :see: `wx.WakeUpIdle`
d55e5bfc 6531 """
5b5c9bc7 6532 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
d55e5bfc 6533
84f85550
RD
6534 def IsMainLoopRunning(*args, **kwargs):
6535 """
6536 IsMainLoopRunning() -> bool
6537
6538 Returns True if we're running the main loop, i.e. if the events can
6539 currently be dispatched.
6540 """
5b5c9bc7 6541 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550
RD
6542
6543 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
6544 def MainLoop(*args, **kwargs):
6545 """
6546 MainLoop(self) -> int
6547
d6c14a4c
RD
6548 Execute the main GUI loop, the function doesn't normally return until
6549 all top level windows have been closed and destroyed.
d55e5bfc 6550 """
5b5c9bc7 6551 return _core_.PyApp_MainLoop(*args, **kwargs)
d55e5bfc
RD
6552
6553 def Exit(*args, **kwargs):
6554 """
6555 Exit(self)
6556
6557 Exit the main loop thus terminating the application.
d6c14a4c 6558 :see: `wx.Exit`
d55e5bfc 6559 """
5b5c9bc7 6560 return _core_.PyApp_Exit(*args, **kwargs)
d55e5bfc
RD
6561
6562 def ExitMainLoop(*args, **kwargs):
6563 """
6564 ExitMainLoop(self)
6565
d6c14a4c
RD
6566 Exit the main GUI loop during the next iteration of the main
6567 loop, (i.e. it does not stop the program immediately!)
d55e5bfc 6568 """
5b5c9bc7 6569 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
d55e5bfc
RD
6570
6571 def Pending(*args, **kwargs):
6572 """
6573 Pending(self) -> bool
6574
6575 Returns True if there are unprocessed events in the event queue.
6576 """
5b5c9bc7 6577 return _core_.PyApp_Pending(*args, **kwargs)
d55e5bfc
RD
6578
6579 def Dispatch(*args, **kwargs):
6580 """
6581 Dispatch(self) -> bool
6582
6583 Process the first event in the event queue (blocks until an event
6584 appears if there are none currently)
6585 """
5b5c9bc7 6586 return _core_.PyApp_Dispatch(*args, **kwargs)
d55e5bfc
RD
6587
6588 def ProcessIdle(*args, **kwargs):
6589 """
6590 ProcessIdle(self) -> bool
6591
d6c14a4c
RD
6592 Called from the MainLoop when the application becomes idle (there are
6593 no pending events) and sends a `wx.IdleEvent` to all interested
6594 parties. Returns True if more idle events are needed, False if not.
d55e5bfc 6595 """
5b5c9bc7 6596 return _core_.PyApp_ProcessIdle(*args, **kwargs)
d55e5bfc
RD
6597
6598 def SendIdleEvents(*args, **kwargs):
6599 """
5b5c9bc7 6600 SendIdleEvents(self, Window win, IdleEvent event) -> bool
d55e5bfc 6601
d6c14a4c
RD
6602 Send idle event to window and all subwindows. Returns True if more
6603 idle time is requested.
d55e5bfc 6604 """
5b5c9bc7 6605 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
d55e5bfc
RD
6606
6607 def IsActive(*args, **kwargs):
6608 """
6609 IsActive(self) -> bool
6610
6611 Return True if our app has focus.
6612 """
5b5c9bc7 6613 return _core_.PyApp_IsActive(*args, **kwargs)
d55e5bfc
RD
6614
6615 def SetTopWindow(*args, **kwargs):
6616 """
5b5c9bc7 6617 SetTopWindow(self, Window win)
d55e5bfc 6618
d6c14a4c 6619 Set the *main* top level window
d55e5bfc 6620 """
5b5c9bc7 6621 return _core_.PyApp_SetTopWindow(*args, **kwargs)
d55e5bfc
RD
6622
6623 def GetTopWindow(*args, **kwargs):
6624 """
5b5c9bc7 6625 GetTopWindow(self) -> Window
d55e5bfc 6626
d6c14a4c
RD
6627 Return the *main* top level window (if it hadn't been set previously
6628 with SetTopWindow(), will return just some top level window and, if
6629 there not any, will return None)
d55e5bfc 6630 """
5b5c9bc7 6631 return _core_.PyApp_GetTopWindow(*args, **kwargs)
d55e5bfc
RD
6632
6633 def SetExitOnFrameDelete(*args, **kwargs):
6634 """
6635 SetExitOnFrameDelete(self, bool flag)
6636
d6c14a4c
RD
6637 Control the exit behaviour: by default, the program will exit the main
6638 loop (and so, usually, terminate) when the last top-level program
6639 window is deleted. Beware that if you disable this behaviour (with
6640 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6641 explicitly from somewhere.
d55e5bfc 6642 """
5b5c9bc7 6643 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6644
6645 def GetExitOnFrameDelete(*args, **kwargs):
6646 """
6647 GetExitOnFrameDelete(self) -> bool
6648
6649 Get the current exit behaviour setting.
6650 """
5b5c9bc7 6651 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6652
6653 def SetUseBestVisual(*args, **kwargs):
6654 """
6655 SetUseBestVisual(self, bool flag)
6656
d6c14a4c
RD
6657 Set whether the app should try to use the best available visual on
6658 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc 6659 """
5b5c9bc7 6660 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
6661
6662 def GetUseBestVisual(*args, **kwargs):
6663 """
6664 GetUseBestVisual(self) -> bool
6665
6666 Get current UseBestVisual setting.
6667 """
5b5c9bc7 6668 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
6669
6670 def SetPrintMode(*args, **kwargs):
6671 """SetPrintMode(self, int mode)"""
5b5c9bc7 6672 return _core_.PyApp_SetPrintMode(*args, **kwargs)
d55e5bfc
RD
6673
6674 def GetPrintMode(*args, **kwargs):
6675 """GetPrintMode(self) -> int"""
5b5c9bc7 6676 return _core_.PyApp_GetPrintMode(*args, **kwargs)
d55e5bfc
RD
6677
6678 def SetAssertMode(*args, **kwargs):
6679 """
6680 SetAssertMode(self, int mode)
6681
15817c7e 6682 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc 6683 """
5b5c9bc7 6684 return _core_.PyApp_SetAssertMode(*args, **kwargs)
d55e5bfc
RD
6685
6686 def GetAssertMode(*args, **kwargs):
6687 """
6688 GetAssertMode(self) -> int
6689
6690 Get the current OnAssert behaviour setting.
6691 """
5b5c9bc7 6692 return _core_.PyApp_GetAssertMode(*args, **kwargs)
d55e5bfc
RD
6693
6694 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 6695 """GetMacSupportPCMenuShortcuts() -> bool"""
5b5c9bc7 6696 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
6697
6698 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6699 def GetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 6700 """GetMacAboutMenuItemId() -> long"""
5b5c9bc7 6701 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
6702
6703 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6704 def GetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 6705 """GetMacPreferencesMenuItemId() -> long"""
5b5c9bc7 6706 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
6707
6708 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6709 def GetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 6710 """GetMacExitMenuItemId() -> long"""
5b5c9bc7 6711 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
6712
6713 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6714 def GetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
6715 """GetMacHelpMenuTitleName() -> String"""
6716 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
6717
6718 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6719 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 6720 """SetMacSupportPCMenuShortcuts(bool val)"""
5b5c9bc7 6721 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
6722
6723 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6724 def SetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 6725 """SetMacAboutMenuItemId(long val)"""
5b5c9bc7 6726 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
6727
6728 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6729 def SetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 6730 """SetMacPreferencesMenuItemId(long val)"""
5b5c9bc7 6731 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
6732
6733 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6734 def SetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 6735 """SetMacExitMenuItemId(long val)"""
5b5c9bc7 6736 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
6737
6738 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6739 def SetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
6740 """SetMacHelpMenuTitleName(String val)"""
6741 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
6742
6743 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6744 def _BootstrapApp(*args, **kwargs):
6745 """
6746 _BootstrapApp(self)
6747
6748 For internal use only
6749 """
5b5c9bc7 6750 return _core_.PyApp__BootstrapApp(*args, **kwargs)
d55e5bfc
RD
6751
6752 def GetComCtl32Version(*args, **kwargs):
6753 """
d6c14a4c 6754 GetComCtl32Version() -> int
d55e5bfc 6755
d6c14a4c
RD
6756 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6757 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 6758 """
5b5c9bc7 6759 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
6760
6761 GetComCtl32Version = staticmethod(GetComCtl32Version)
2131d850 6762_core_.PyApp_swigregister(PyApp)
d55e5bfc 6763
1bd55598
RD
6764def PyApp_IsMainLoopRunning(*args):
6765 """
5b5c9bc7 6766 PyApp_IsMainLoopRunning() -> bool
84f85550
RD
6767
6768 Returns True if we're running the main loop, i.e. if the events can
6769 currently be dispatched.
6770 """
1bd55598 6771 return _core_.PyApp_IsMainLoopRunning(*args)
84f85550 6772
1bd55598
RD
6773def PyApp_GetMacSupportPCMenuShortcuts(*args):
6774 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6775 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d55e5bfc 6776
1bd55598
RD
6777def PyApp_GetMacAboutMenuItemId(*args):
6778 """PyApp_GetMacAboutMenuItemId() -> long"""
6779 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d55e5bfc 6780
1bd55598
RD
6781def PyApp_GetMacPreferencesMenuItemId(*args):
6782 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6783 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d55e5bfc 6784
1bd55598
RD
6785def PyApp_GetMacExitMenuItemId(*args):
6786 """PyApp_GetMacExitMenuItemId() -> long"""
6787 return _core_.PyApp_GetMacExitMenuItemId(*args)
d55e5bfc 6788
1bd55598
RD
6789def PyApp_GetMacHelpMenuTitleName(*args):
6790 """PyApp_GetMacHelpMenuTitleName() -> String"""
6791 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d55e5bfc 6792
5b5c9bc7 6793def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
1bd55598
RD
6794 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6795 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 6796
5b5c9bc7 6797def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
1bd55598
RD
6798 """PyApp_SetMacAboutMenuItemId(long val)"""
6799 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 6800
5b5c9bc7 6801def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
1bd55598
RD
6802 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6803 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 6804
5b5c9bc7 6805def PyApp_SetMacExitMenuItemId(*args, **kwargs):
1bd55598
RD
6806 """PyApp_SetMacExitMenuItemId(long val)"""
6807 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 6808
5b5c9bc7 6809def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
1bd55598
RD
6810 """PyApp_SetMacHelpMenuTitleName(String val)"""
6811 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 6812
1bd55598
RD
6813def PyApp_GetComCtl32Version(*args):
6814 """
5b5c9bc7 6815 PyApp_GetComCtl32Version() -> int
d55e5bfc 6816
d6c14a4c
RD
6817 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6818 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 6819 """
1bd55598 6820 return _core_.PyApp_GetComCtl32Version(*args)
d55e5bfc
RD
6821
6822#---------------------------------------------------------------------------
6823
6824
1bd55598
RD
6825def Exit(*args):
6826 """
5b5c9bc7 6827 Exit()
d55e5bfc
RD
6828
6829 Force an exit of the application. Convenience for wx.GetApp().Exit()
6830 """
1bd55598 6831 return _core_.Exit(*args)
d55e5bfc 6832
1bd55598
RD
6833def Yield(*args):
6834 """
5b5c9bc7 6835 Yield() -> bool
d55e5bfc
RD
6836
6837 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6838 """
1bd55598 6839 return _core_.Yield(*args)
d55e5bfc 6840
1bd55598
RD
6841def YieldIfNeeded(*args):
6842 """
5b5c9bc7 6843 YieldIfNeeded() -> bool
d55e5bfc
RD
6844
6845 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6846 """
1bd55598 6847 return _core_.YieldIfNeeded(*args)
d55e5bfc 6848
5b5c9bc7 6849def SafeYield(*args, **kwargs):
1bd55598 6850 """
5b5c9bc7 6851 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
d55e5bfc 6852
d6c14a4c
RD
6853 This function is similar to `wx.Yield`, except that it disables the
6854 user input to all program windows before calling `wx.Yield` and
6855 re-enables it again afterwards. If ``win`` is not None, this window
6856 will remain enabled, allowing the implementation of some limited user
6857 interaction.
d55e5bfc 6858
d6c14a4c 6859 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 6860 """
1bd55598 6861 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 6862
1bd55598
RD
6863def WakeUpIdle(*args):
6864 """
5b5c9bc7 6865 WakeUpIdle()
d55e5bfc 6866
d6c14a4c
RD
6867 Cause the message queue to become empty again, so idle events will be
6868 sent.
d55e5bfc 6869 """
1bd55598 6870 return _core_.WakeUpIdle(*args)
d55e5bfc 6871
5b5c9bc7 6872def PostEvent(*args, **kwargs):
1bd55598 6873 """
5b5c9bc7 6874 PostEvent(EvtHandler dest, Event event)
d55e5bfc 6875
d6c14a4c
RD
6876 Send an event to a window or other wx.EvtHandler to be processed
6877 later.
d55e5bfc 6878 """
1bd55598 6879 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 6880
1bd55598
RD
6881def App_CleanUp(*args):
6882 """
5b5c9bc7 6883 App_CleanUp()
d55e5bfc 6884
15817c7e 6885 For internal use only, it is used to cleanup after wxWidgets when
d6c14a4c 6886 Python shuts down.
d55e5bfc 6887 """
1bd55598 6888 return _core_.App_CleanUp(*args)
d55e5bfc 6889
1bd55598
RD
6890def GetApp(*args):
6891 """
5b5c9bc7 6892 GetApp() -> PyApp
d55e5bfc
RD
6893
6894 Return a reference to the current wx.App object.
6895 """
1bd55598 6896 return _core_.GetApp(*args)
5cbf236d 6897
5b5c9bc7 6898def SetDefaultPyEncoding(*args, **kwargs):
1bd55598 6899 """
5cbf236d
RD
6900 SetDefaultPyEncoding(string encoding)
6901
6902 Sets the encoding that wxPython will use when it needs to convert a
6903 Python string or unicode object to or from a wxString.
62d32a5f
RD
6904
6905 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6906 but please be aware that the default encoding within the same locale
6907 may be slightly different on different platforms. For example, please
6908 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6909 between the common latin/roman encodings.
5cbf236d 6910 """
1bd55598 6911 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 6912
1bd55598
RD
6913def GetDefaultPyEncoding(*args):
6914 """
5cbf236d
RD
6915 GetDefaultPyEncoding() -> string
6916
6917 Gets the current encoding that wxPython will use when it needs to
6918 convert a Python string or unicode object to or from a wxString.
6919 """
1bd55598 6920 return _core_.GetDefaultPyEncoding(*args)
d55e5bfc
RD
6921#----------------------------------------------------------------------
6922
6923class PyOnDemandOutputWindow:
6924 """
6925 A class that can be used for redirecting Python's stdout and
6926 stderr streams. It will do nothing until something is wrriten to
6927 the stream at which point it will create a Frame with a text area
6928 and write the text there.
6929 """
6930 def __init__(self, title = "wxPython: stdout/stderr"):
6931 self.frame = None
6932 self.title = title
412d302d
RD
6933 self.pos = wx.DefaultPosition
6934 self.size = (450, 300)
d55e5bfc
RD
6935 self.parent = None
6936
6937 def SetParent(self, parent):
6938 """Set the window to be used as the popup Frame's parent."""
6939 self.parent = parent
6940
6941
6942 def CreateOutputWindow(self, st):
412d302d
RD
6943 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
6944 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 6945 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 6946 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 6947 self.text.AppendText(st)
d55e5bfc 6948 self.frame.Show(True)
2131d850 6949 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
d55e5bfc
RD
6950
6951
6952 def OnCloseWindow(self, event):
6953 if self.frame is not None:
6954 self.frame.Destroy()
6955 self.frame = None
6956 self.text = None
6957
6958
6959 # These methods provide the file-like output behaviour.
6960 def write(self, text):
6961 """
6962 Create the output window if needed and write the string to it.
6963 If not called in the context of the gui thread then uses
6964 CallAfter to do the work there.
6965 """
6966 if self.frame is None:
6967 if not wx.Thread_IsMain():
6968 wx.CallAfter(self.CreateOutputWindow, text)
6969 else:
6970 self.CreateOutputWindow(text)
6971 else:
6972 if not wx.Thread_IsMain():
6973 wx.CallAfter(self.text.AppendText, text)
6974 else:
6975 self.text.AppendText(text)
6976
6977
6978 def close(self):
6979 if self.frame is not None:
6980 wx.CallAfter(self.frame.Close)
6981
6982
bb4524c4
RD
6983 def flush(self):
6984 pass
6985
6986
d55e5bfc
RD
6987
6988#----------------------------------------------------------------------
6989
6990_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
6991
6992class App(wx.PyApp):
6993 """
d6c14a4c
RD
6994 The ``wx.App`` class represents the application and is used to:
6995
6996 * bootstrap the wxPython system and initialize the underlying
6997 gui toolkit
6998 * set and get application-wide properties
6999 * implement the windowing system main message or event loop,
7000 and to dispatch events to window instances
7001 * etc.
7002
7003 Every application must have a ``wx.App`` instance, and all
7004 creation of UI objects should be delayed until after the
7005 ``wx.App`` object has been created in order to ensure that the gui
7006 platform and wxWidgets have been fully initialized.
7007
7008 Normally you would derive from this class and implement an
7009 ``OnInit`` method that creates a frame and then calls
7010 ``self.SetTopWindow(frame)``.
7011
7012 :see: `wx.PySimpleApp` for a simpler app class that can be used
15817c7e 7013 directly.
d55e5bfc 7014 """
d6c14a4c 7015
d55e5bfc
RD
7016 outputWindowClass = PyOnDemandOutputWindow
7017
d6c14a4c
RD
7018 def __init__(self, redirect=_defRedirect, filename=None,
7019 useBestVisual=False, clearSigInt=True):
7020 """
7021 Construct a ``wx.App`` object.
7022
7023 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7024 redirected? Defaults to True on Windows and Mac, False
7025 otherwise. If `filename` is None then output will be
7026 redirected to a window that pops up as needed. (You can
7027 control what kind of window is created for the output by
7028 resetting the class variable ``outputWindowClass`` to a
7029 class of your choosing.)
7030
7031 :param filename: The name of a file to redirect output to, if
7032 redirect is True.
7033
7034 :param useBestVisual: Should the app try to use the best
7035 available visual provided by the system (only relevant on
7036 systems that have more than one visual.) This parameter
7037 must be used instead of calling `SetUseBestVisual` later
7038 on because it must be set before the underlying GUI
7039 toolkit is initialized.
7040
7041 :param clearSigInt: Should SIGINT be cleared? This allows the
7042 app to terminate upon a Ctrl-C in the console like other
7043 GUI apps will.
7044
7045 :note: You should override OnInit to do applicaition
7046 initialization to ensure that the system, toolkit and
7047 wxWidgets are fully initialized.
7048 """
d55e5bfc
RD
7049 wx.PyApp.__init__(self)
7050
7051 if wx.Platform == "__WXMAC__":
7052 try:
7053 import MacOS
7054 if not MacOS.WMAvailable():
7055 print """\
7056This program needs access to the screen. Please run with 'pythonw',
7057not 'python', and only when you are logged in on the main display of
7058your Mac."""
7059 _sys.exit(1)
0346c964
RD
7060 except SystemExit:
7061 raise
d55e5bfc
RD
7062 except:
7063 pass
7064
7065 # This has to be done before OnInit
7066 self.SetUseBestVisual(useBestVisual)
7067
7068 # Set the default handler for SIGINT. This fixes a problem
7069 # where if Ctrl-C is pressed in the console that started this
7070 # app then it will not appear to do anything, (not even send
7071 # KeyboardInterrupt???) but will later segfault on exit. By
7072 # setting the default handler then the app will exit, as
7073 # expected (depending on platform.)
d6c14a4c
RD
7074 if clearSigInt:
7075 try:
7076 import signal
7077 signal.signal(signal.SIGINT, signal.SIG_DFL)
7078 except:
7079 pass
d55e5bfc
RD
7080
7081 # Save and redirect the stdio to a window?
7082 self.stdioWin = None
7083 self.saveStdio = (_sys.stdout, _sys.stderr)
7084 if redirect:
7085 self.RedirectStdio(filename)
7086
8fb0e70a
RD
7087 # Use Python's install prefix as the default
7088 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7089
d55e5bfc
RD
7090 # This finishes the initialization of wxWindows and then calls
7091 # the OnInit that should be present in the derived class
7092 self._BootstrapApp()
7093
7094
2131d850
RD
7095 def OnPreInit(self):
7096 """
7097 Things that must be done after _BootstrapApp has done its
7098 thing, but would be nice if they were already done by the time
7099 that OnInit is called.
7100 """
7101 wx.StockGDI._initStockObjects()
7102
7103
66af7a75
RD
7104 def __del__(self, destroy=wx.PyApp.__del__):
7105 self.RestoreStdio() # Just in case the MainLoop was overridden
7106 destroy(self)
d55e5bfc 7107
7993762b
RD
7108 def Destroy(self):
7109 wx.PyApp.Destroy(self)
7110 self.thisown = 0
d55e5bfc
RD
7111
7112 def SetTopWindow(self, frame):
7113 """Set the \"main\" top level window"""
7114 if self.stdioWin:
7115 self.stdioWin.SetParent(frame)
7116 wx.PyApp.SetTopWindow(self, frame)
7117
7118
7119 def MainLoop(self):
7120 """Execute the main GUI event loop"""
7121 wx.PyApp.MainLoop(self)
7122 self.RestoreStdio()
7123
7124
7125 def RedirectStdio(self, filename=None):
7126 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7127 if filename:
7128 _sys.stdout = _sys.stderr = open(filename, 'a')
7129 else:
7130 self.stdioWin = self.outputWindowClass()
7131 _sys.stdout = _sys.stderr = self.stdioWin
7132
7133
7134 def RestoreStdio(self):
66af7a75
RD
7135 try:
7136 _sys.stdout, _sys.stderr = self.saveStdio
7137 except:
7138 pass
d55e5bfc
RD
7139
7140
412d302d
RD
7141 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7142 """
7143 Set the title, position and/or size of the output window if
f5b96ee1
RD
7144 the stdio has been redirected. This should be called before
7145 any output would cause the output window to be created.
412d302d
RD
7146 """
7147 if self.stdioWin:
7148 if title is not None:
7149 self.stdioWin.title = title
7150 if pos is not None:
7151 self.stdioWin.pos = pos
7152 if size is not None:
7153 self.stdioWin.size = size
7154
7155
7156
d55e5bfc 7157
d6c14a4c 7158# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7159App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7160App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7161App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7162App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7163App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7164App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7165App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7166App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7167App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7168App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7169App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7170
7171#----------------------------------------------------------------------------
7172
7173class PySimpleApp(wx.App):
7174 """
7175 A simple application class. You can just create one of these and
7176 then then make your top level windows later, and not have to worry
d6c14a4c 7177 about OnInit. For example::
d55e5bfc 7178
d6c14a4c
RD
7179 app = wx.PySimpleApp()
7180 frame = wx.Frame(None, title='Hello World')
7181 frame.Show()
7182 app.MainLoop()
7183
7184 :see: `wx.App`
7185 """
7186
7187 def __init__(self, redirect=False, filename=None,
7188 useBestVisual=False, clearSigInt=True):
7189 """
7190 :see: `wx.App.__init__`
7191 """
7192 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7193
7194 def OnInit(self):
d55e5bfc
RD
7195 return True
7196
7197
d6c14a4c 7198
d55e5bfc
RD
7199# Is anybody using this one?
7200class PyWidgetTester(wx.App):
7201 def __init__(self, size = (250, 100)):
7202 self.size = size
7203 wx.App.__init__(self, 0)
7204
7205 def OnInit(self):
7206 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7207 self.SetTopWindow(self.frame)
7208 return True
7209
d6c14a4c
RD
7210 def SetWidget(self, widgetClass, *args, **kwargs):
7211 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7212 self.frame.Show(True)
7213
7214#----------------------------------------------------------------------------
7215# DO NOT hold any other references to this object. This is how we
d6c14a4c 7216# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7217# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
d6c14a4c 7218# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7219
7220class __wxPyCleanup:
7221 def __init__(self):
7222 self.cleanup = _core_.App_CleanUp
7223 def __del__(self):
7224 self.cleanup()
7225
7226_sys.__wxPythonCleanup = __wxPyCleanup()
7227
7228## # another possible solution, but it gets called too early...
d6c14a4c
RD
7229## import atexit
7230## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7231
7232
7233#----------------------------------------------------------------------------
7234
7235#---------------------------------------------------------------------------
7236
5b5c9bc7
RD
7237class EventLoop(object):
7238 """Proxy of C++ EventLoop class"""
1bd55598
RD
7239 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7240 __repr__ = _swig_repr
7241 def __init__(self, *args, **kwargs):
5b5c9bc7 7242 """__init__(self) -> EventLoop"""
1bd55598
RD
7243 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7244 __swig_destroy__ = _core_.delete_EventLoop
7245 __del__ = lambda self : None;
b411df4a
RD
7246 def Run(*args, **kwargs):
7247 """Run(self) -> int"""
5b5c9bc7 7248 return _core_.EventLoop_Run(*args, **kwargs)
b411df4a
RD
7249
7250 def Exit(*args, **kwargs):
7251 """Exit(self, int rc=0)"""
5b5c9bc7 7252 return _core_.EventLoop_Exit(*args, **kwargs)
b411df4a
RD
7253
7254 def Pending(*args, **kwargs):
7255 """Pending(self) -> bool"""
5b5c9bc7 7256 return _core_.EventLoop_Pending(*args, **kwargs)
b411df4a
RD
7257
7258 def Dispatch(*args, **kwargs):
7259 """Dispatch(self) -> bool"""
5b5c9bc7 7260 return _core_.EventLoop_Dispatch(*args, **kwargs)
b411df4a
RD
7261
7262 def IsRunning(*args, **kwargs):
7263 """IsRunning(self) -> bool"""
5b5c9bc7 7264 return _core_.EventLoop_IsRunning(*args, **kwargs)
b411df4a
RD
7265
7266 def GetActive(*args, **kwargs):
5b5c9bc7
RD
7267 """GetActive() -> EventLoop"""
7268 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a
RD
7269
7270 GetActive = staticmethod(GetActive)
7271 def SetActive(*args, **kwargs):
5b5c9bc7
RD
7272 """SetActive(EventLoop loop)"""
7273 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a
RD
7274
7275 SetActive = staticmethod(SetActive)
2131d850 7276_core_.EventLoop_swigregister(EventLoop)
b411df4a 7277
1bd55598
RD
7278def EventLoop_GetActive(*args):
7279 """EventLoop_GetActive() -> EventLoop"""
7280 return _core_.EventLoop_GetActive(*args)
b411df4a 7281
5b5c9bc7 7282def EventLoop_SetActive(*args, **kwargs):
1bd55598
RD
7283 """EventLoop_SetActive(EventLoop loop)"""
7284 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a 7285
32fe5131
RD
7286class EventLoopActivator(object):
7287 """Proxy of C++ EventLoopActivator class"""
1bd55598
RD
7288 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7289 __repr__ = _swig_repr
7290 def __init__(self, *args, **kwargs):
32fe5131 7291 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
1bd55598
RD
7292 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7293 __swig_destroy__ = _core_.delete_EventLoopActivator
7294 __del__ = lambda self : None;
2131d850 7295_core_.EventLoopActivator_swigregister(EventLoopActivator)
32fe5131 7296
b411df4a
RD
7297#---------------------------------------------------------------------------
7298
5b5c9bc7 7299class AcceleratorEntry(object):
d6c14a4c
RD
7300 """
7301 A class used to define items in an `wx.AcceleratorTable`. wxPython
7302 programs can choose to use wx.AcceleratorEntry objects, but using a
7303 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
15817c7e 7304 as well. See `__init__` for of the tuple values.
d6c14a4c
RD
7305
7306 :see: `wx.AcceleratorTable`
7307 """
1bd55598
RD
7308 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7309 __repr__ = _swig_repr
7310 def __init__(self, *args, **kwargs):
d6c14a4c 7311 """
5b5c9bc7 7312 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
d6c14a4c
RD
7313
7314 Construct a wx.AcceleratorEntry.
d6c14a4c 7315 """
1bd55598
RD
7316 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7317 __swig_destroy__ = _core_.delete_AcceleratorEntry
7318 __del__ = lambda self : None;
d55e5bfc 7319 def Set(*args, **kwargs):
d6c14a4c
RD
7320 """
7321 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 7322
d6c14a4c
RD
7323 (Re)set the attributes of a wx.AcceleratorEntry.
7324 :see `__init__`
7325 """
5b5c9bc7 7326 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
7327
7328 def GetFlags(*args, **kwargs):
d6c14a4c
RD
7329 """
7330 GetFlags(self) -> int
7331
7332 Get the AcceleratorEntry's flags.
7333 """
5b5c9bc7 7334 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
d55e5bfc
RD
7335
7336 def GetKeyCode(*args, **kwargs):
d6c14a4c
RD
7337 """
7338 GetKeyCode(self) -> int
7339
7340 Get the AcceleratorEntry's keycode.
7341 """
5b5c9bc7 7342 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
7343
7344 def GetCommand(*args, **kwargs):
d6c14a4c
RD
7345 """
7346 GetCommand(self) -> int
7347
7348 Get the AcceleratorEntry's command ID.
7349 """
5b5c9bc7 7350 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
d55e5bfc 7351
2131d850 7352_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
d55e5bfc 7353
5b5c9bc7 7354class AcceleratorTable(Object):
d6c14a4c
RD
7355 """
7356 An accelerator table allows the application to specify a table of
7357 keyboard shortcuts for menus or other commands. On Windows, menu or
7358 button commands are supported; on GTK, only menu commands are
7359 supported.
d6c14a4c 7360 """
1bd55598
RD
7361 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7362 __repr__ = _swig_repr
7363 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7364 """
7365 __init__(entries) -> AcceleratorTable
7366
d6c14a4c
RD
7367 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7368 items or or of 3-tuples (flags, keyCode, cmdID)
7369
7370 :see: `wx.AcceleratorEntry`
d55e5bfc 7371 """
1bd55598
RD
7372 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7373 __swig_destroy__ = _core_.delete_AcceleratorTable
7374 __del__ = lambda self : None;
d55e5bfc
RD
7375 def Ok(*args, **kwargs):
7376 """Ok(self) -> bool"""
5b5c9bc7 7377 return _core_.AcceleratorTable_Ok(*args, **kwargs)
d55e5bfc 7378
2131d850 7379_core_.AcceleratorTable_swigregister(AcceleratorTable)
d55e5bfc
RD
7380
7381
5b5c9bc7 7382def GetAccelFromString(*args, **kwargs):
1bd55598
RD
7383 """GetAccelFromString(String label) -> AcceleratorEntry"""
7384 return _core_.GetAccelFromString(*args, **kwargs)
d55e5bfc
RD
7385#---------------------------------------------------------------------------
7386
5b5c9bc7 7387class VisualAttributes(object):
d55e5bfc 7388 """struct containing all the visual attributes of a control"""
1bd55598
RD
7389 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7390 __repr__ = _swig_repr
7391 def __init__(self, *args, **kwargs):
d55e5bfc 7392 """
5b5c9bc7 7393 __init__(self) -> VisualAttributes
d55e5bfc
RD
7394
7395 struct containing all the visual attributes of a control
7396 """
1bd55598
RD
7397 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7398 __swig_destroy__ = _core_.delete_VisualAttributes
7399 __del__ = lambda self : None;
5b5c9bc7
RD
7400 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7401 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7402 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 7403_core_.VisualAttributes_swigregister(VisualAttributes)
5b5c9bc7 7404NullAcceleratorTable = cvar.NullAcceleratorTable
d55e5bfc
RD
7405PanelNameStr = cvar.PanelNameStr
7406
5b5c9bc7
RD
7407WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7408WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7409WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7410WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7411WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7412class Window(EvtHandler):
d55e5bfc
RD
7413 """
7414 wx.Window is the base class for all windows and represents any visible
7415 object on the screen. All controls, top level windows and so on are
7416 wx.Windows. Sizers and device contexts are not however, as they don't
7417 appear on screen themselves.
7418
7419 """
1bd55598
RD
7420 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7421 __repr__ = _swig_repr
7422 def __init__(self, *args, **kwargs):
d55e5bfc 7423 """
5b5c9bc7
RD
7424 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7425 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
d55e5bfc
RD
7426
7427 Construct and show a generic Window.
7428 """
1bd55598 7429 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d55e5bfc
RD
7430 self._setOORInfo(self)
7431
7432 def Create(*args, **kwargs):
7433 """
5b5c9bc7
RD
7434 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7435 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
d55e5bfc
RD
7436
7437 Create the GUI part of the Window for 2-phase creation mode.
7438 """
5b5c9bc7 7439 return _core_.Window_Create(*args, **kwargs)
d55e5bfc
RD
7440
7441 def Close(*args, **kwargs):
7442 """
7443 Close(self, bool force=False) -> bool
7444
7445 This function simply generates a EVT_CLOSE event whose handler usually
7446 tries to close the window. It doesn't close the window itself,
7447 however. If force is False (the default) then the window's close
7448 handler will be allowed to veto the destruction of the window.
d55e5bfc 7449 """
5b5c9bc7 7450 return _core_.Window_Close(*args, **kwargs)
d55e5bfc
RD
7451
7452 def Destroy(*args, **kwargs):
7453 """
7454 Destroy(self) -> bool
7455
7456 Destroys the window safely. Frames and dialogs are not destroyed
7457 immediately when this function is called -- they are added to a list
7458 of windows to be deleted on idle time, when all the window's events
7459 have been processed. This prevents problems with events being sent to
7460 non-existent windows.
7461
7462 Returns True if the window has either been successfully deleted, or it
7463 has been added to the list of windows pending real deletion.
7464 """
7e08d4ef
RD
7465 val = _core_.Window_Destroy(*args, **kwargs)
7466 args[0].thisown = 0
7467 return val
d55e5bfc
RD
7468
7469 def DestroyChildren(*args, **kwargs):
7470 """
7471 DestroyChildren(self) -> bool
7472
15817c7e
RD
7473 Destroys all children of a window. Called automatically by the
7474 destructor.
d55e5bfc 7475 """
5b5c9bc7 7476 return _core_.Window_DestroyChildren(*args, **kwargs)
d55e5bfc
RD
7477
7478 def IsBeingDeleted(*args, **kwargs):
7479 """
7480 IsBeingDeleted(self) -> bool
7481
7482 Is the window in the process of being deleted?
7483 """
5b5c9bc7 7484 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d55e5bfc 7485
d55e5bfc
RD
7486 def SetLabel(*args, **kwargs):
7487 """
5b5c9bc7 7488 SetLabel(self, String label)
d55e5bfc
RD
7489
7490 Set the text which the window shows in its label if applicable.
7491 """
5b5c9bc7 7492 return _core_.Window_SetLabel(*args, **kwargs)
d55e5bfc
RD
7493
7494 def GetLabel(*args, **kwargs):
7495 """
5b5c9bc7 7496 GetLabel(self) -> String
d55e5bfc 7497
15817c7e
RD
7498 Generic way of getting a label from any window, for identification
7499 purposes. The interpretation of this function differs from class to
7500 class. For frames and dialogs, the value returned is the title. For
7501 buttons or static text controls, it is the button text. This function
7502 can be useful for meta-programs such as testing tools or special-needs
7503 access programs)which need to identify windows by name.
d55e5bfc 7504 """
5b5c9bc7 7505 return _core_.Window_GetLabel(*args, **kwargs)
d55e5bfc
RD
7506
7507 def SetName(*args, **kwargs):
7508 """
5b5c9bc7 7509 SetName(self, String name)
d55e5bfc 7510
15817c7e
RD
7511 Sets the window's name. The window name is used for ressource setting
7512 in X, it is not the same as the window title/label
d55e5bfc 7513 """
5b5c9bc7 7514 return _core_.Window_SetName(*args, **kwargs)
d55e5bfc
RD
7515
7516 def GetName(*args, **kwargs):
7517 """
5b5c9bc7 7518 GetName(self) -> String
d55e5bfc 7519
15817c7e
RD
7520 Returns the windows name. This name is not guaranteed to be unique;
7521 it is up to the programmer to supply an appropriate name in the window
7522 constructor or via wx.Window.SetName.
d55e5bfc 7523 """
5b5c9bc7 7524 return _core_.Window_GetName(*args, **kwargs)
d55e5bfc
RD
7525
7526 def SetWindowVariant(*args, **kwargs):
7527 """
7528 SetWindowVariant(self, int variant)
7529
15817c7e
RD
7530 Sets the variant of the window/font size to use for this window, if
7531 the platform supports variants, for example, wxMac.
d55e5bfc 7532 """
5b5c9bc7 7533 return _core_.Window_SetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7534
7535 def GetWindowVariant(*args, **kwargs):
7536 """GetWindowVariant(self) -> int"""
5b5c9bc7 7537 return _core_.Window_GetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7538
7539 def SetId(*args, **kwargs):
7540 """
7541 SetId(self, int winid)
7542
7543 Sets the identifier of the window. Each window has an integer
7544 identifier. If the application has not provided one, an identifier
7545 will be generated. Normally, the identifier should be provided on
7546 creation and should not be modified subsequently.
7547 """
5b5c9bc7 7548 return _core_.Window_SetId(*args, **kwargs)
d55e5bfc
RD
7549
7550 def GetId(*args, **kwargs):
7551 """
7552 GetId(self) -> int
7553
7554 Returns the identifier of the window. Each window has an integer
7555 identifier. If the application has not provided one (or the default Id
7556 -1 is used) then an unique identifier with a negative value will be
7557 generated.
7558 """
5b5c9bc7 7559 return _core_.Window_GetId(*args, **kwargs)
d55e5bfc
RD
7560
7561 def NewControlId(*args, **kwargs):
7562 """
d6c14a4c 7563 NewControlId() -> int
d55e5bfc
RD
7564
7565 Generate a control id for the controls which were not given one.
7566 """
5b5c9bc7 7567 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc
RD
7568
7569 NewControlId = staticmethod(NewControlId)
7570 def NextControlId(*args, **kwargs):
7571 """
d6c14a4c 7572 NextControlId(int winid) -> int
d55e5bfc
RD
7573
7574 Get the id of the control following the one with the given
15817c7e 7575 autogenerated) id
d55e5bfc 7576 """
5b5c9bc7 7577 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
7578
7579 NextControlId = staticmethod(NextControlId)
7580 def PrevControlId(*args, **kwargs):
7581 """
d6c14a4c 7582 PrevControlId(int winid) -> int
d55e5bfc
RD
7583
7584 Get the id of the control preceding the one with the given
15817c7e 7585 autogenerated) id
d55e5bfc 7586 """
5b5c9bc7 7587 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc
RD
7588
7589 PrevControlId = staticmethod(PrevControlId)
7590 def SetSize(*args, **kwargs):
7591 """
5b5c9bc7 7592 SetSize(self, Size size)
d55e5bfc
RD
7593
7594 Sets the size of the window in pixels.
7595 """
5b5c9bc7 7596 return _core_.Window_SetSize(*args, **kwargs)
d55e5bfc
RD
7597
7598 def SetDimensions(*args, **kwargs):
7599 """
5b5c9bc7 7600 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
7601
7602 Sets the position and size of the window in pixels. The sizeFlags
7603 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
7604 equal to -1.
7605
7606 ======================== ======================================
7607 wx.SIZE_AUTO A -1 indicates that a class-specific
7608 default should be used.
7609 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7610 -1 values are supplied.
7611 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7612 interpreted as real dimensions, not
7613 default values.
7614 ======================== ======================================
7615
d55e5bfc 7616 """
5b5c9bc7 7617 return _core_.Window_SetDimensions(*args, **kwargs)
d55e5bfc
RD
7618
7619 def SetRect(*args, **kwargs):
7620 """
5b5c9bc7 7621 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
7622
7623 Sets the position and size of the window in pixels using a wx.Rect.
7624 """
5b5c9bc7 7625 return _core_.Window_SetRect(*args, **kwargs)
d55e5bfc
RD
7626
7627 def SetSizeWH(*args, **kwargs):
7628 """
7629 SetSizeWH(self, int width, int height)
7630
7631 Sets the size of the window in pixels.
7632 """
5b5c9bc7 7633 return _core_.Window_SetSizeWH(*args, **kwargs)
d55e5bfc
RD
7634
7635 def Move(*args, **kwargs):
7636 """
5b5c9bc7 7637 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
7638
7639 Moves the window to the given position.
7640 """
5b5c9bc7 7641 return _core_.Window_Move(*args, **kwargs)
d55e5bfc
RD
7642
7643 SetPosition = Move
7644 def MoveXY(*args, **kwargs):
7645 """
5b5c9bc7 7646 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
7647
7648 Moves the window to the given position.
7649 """
5b5c9bc7 7650 return _core_.Window_MoveXY(*args, **kwargs)
d55e5bfc 7651
f8167d6e
RD
7652 def SetBestFittingSize(*args, **kwargs):
7653 """
5b5c9bc7 7654 SetBestFittingSize(self, Size size=DefaultSize)
f8167d6e
RD
7655
7656 A 'Smart' SetSize that will fill in default size components with the
7657 window's *best size* values. Also set's the minsize for use with sizers.
7658 """
5b5c9bc7 7659 return _core_.Window_SetBestFittingSize(*args, **kwargs)
f8167d6e 7660
d55e5bfc
RD
7661 def Raise(*args, **kwargs):
7662 """
7663 Raise(self)
7664
943e8dfd
RD
7665 Raises the window to the top of the window hierarchy. In current
7666 version of wxWidgets this works both for manage and child windows.
d55e5bfc 7667 """
5b5c9bc7 7668 return _core_.Window_Raise(*args, **kwargs)
d55e5bfc
RD
7669
7670 def Lower(*args, **kwargs):
7671 """
7672 Lower(self)
7673
943e8dfd
RD
7674 Lowers the window to the bottom of the window hierarchy. In current
7675 version of wxWidgets this works both for manage and child windows.
d55e5bfc 7676 """
5b5c9bc7 7677 return _core_.Window_Lower(*args, **kwargs)
d55e5bfc
RD
7678
7679 def SetClientSize(*args, **kwargs):
7680 """
5b5c9bc7 7681 SetClientSize(self, Size size)
d55e5bfc
RD
7682
7683 This sets the size of the window client area in pixels. Using this
7684 function to size a window tends to be more device-independent than
7685 wx.Window.SetSize, since the application need not worry about what
7686 dimensions the border or title bar have when trying to fit the window
7687 around panel items, for example.
7688 """
5b5c9bc7 7689 return _core_.Window_SetClientSize(*args, **kwargs)
d55e5bfc
RD
7690
7691 def SetClientSizeWH(*args, **kwargs):
7692 """
7693 SetClientSizeWH(self, int width, int height)
7694
7695 This sets the size of the window client area in pixels. Using this
7696 function to size a window tends to be more device-independent than
7697 wx.Window.SetSize, since the application need not worry about what
7698 dimensions the border or title bar have when trying to fit the window
7699 around panel items, for example.
7700 """
5b5c9bc7 7701 return _core_.Window_SetClientSizeWH(*args, **kwargs)
d55e5bfc
RD
7702
7703 def SetClientRect(*args, **kwargs):
7704 """
5b5c9bc7 7705 SetClientRect(self, Rect rect)
d55e5bfc
RD
7706
7707 This sets the size of the window client area in pixels. Using this
7708 function to size a window tends to be more device-independent than
7709 wx.Window.SetSize, since the application need not worry about what
7710 dimensions the border or title bar have when trying to fit the window
7711 around panel items, for example.
7712 """
5b5c9bc7 7713 return _core_.Window_SetClientRect(*args, **kwargs)
d55e5bfc
RD
7714
7715 def GetPosition(*args, **kwargs):
7716 """
5b5c9bc7 7717 GetPosition(self) -> Point
d55e5bfc 7718
1c71765a
RD
7719 Get the window's position. Notice that the position is in client
7720 coordinates for child windows and screen coordinates for the top level
7721 ones, use `GetScreenPosition` if you need screen coordinates for all
7722 kinds of windows.
d55e5bfc 7723 """
5b5c9bc7 7724 return _core_.Window_GetPosition(*args, **kwargs)
d55e5bfc
RD
7725
7726 def GetPositionTuple(*args, **kwargs):
7727 """
7728 GetPositionTuple() -> (x,y)
7729
1c71765a
RD
7730 Get the window's position. Notice that the position is in client
7731 coordinates for child windows and screen coordinates for the top level
7732 ones, use `GetScreenPosition` if you need screen coordinates for all
7733 kinds of windows.
d55e5bfc 7734 """
5b5c9bc7 7735 return _core_.Window_GetPositionTuple(*args, **kwargs)
d55e5bfc 7736
1c71765a
RD
7737 def GetScreenPosition(*args, **kwargs):
7738 """
7739 GetScreenPosition(self) -> Point
7740
7741 Get the position of the window in screen coordinantes.
7742 """
7743 return _core_.Window_GetScreenPosition(*args, **kwargs)
7744
7745 def GetScreenPositionTuple(*args, **kwargs):
7746 """
7747 GetScreenPositionTuple() -> (x,y)
7748
7749 Get the position of the window in screen coordinantes.
7750 """
7751 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7752
7753 def GetScreenRect(*args, **kwargs):
7754 """
7755 GetScreenRect(self) -> Rect
7756
7757 Returns the size and position of the window in screen coordinantes as
7758 a `wx.Rect` object.
7759 """
7760 return _core_.Window_GetScreenRect(*args, **kwargs)
7761
d55e5bfc
RD
7762 def GetSize(*args, **kwargs):
7763 """
5b5c9bc7 7764 GetSize(self) -> Size
d55e5bfc
RD
7765
7766 Get the window size.
7767 """
5b5c9bc7 7768 return _core_.Window_GetSize(*args, **kwargs)
d55e5bfc
RD
7769
7770 def GetSizeTuple(*args, **kwargs):
7771 """
7772 GetSizeTuple() -> (width, height)
7773
7774 Get the window size.
7775 """
5b5c9bc7 7776 return _core_.Window_GetSizeTuple(*args, **kwargs)
d55e5bfc
RD
7777
7778 def GetRect(*args, **kwargs):
7779 """
5b5c9bc7 7780 GetRect(self) -> Rect
d55e5bfc 7781
1c71765a 7782 Returns the size and position of the window as a `wx.Rect` object.
d55e5bfc 7783 """
5b5c9bc7 7784 return _core_.Window_GetRect(*args, **kwargs)
d55e5bfc
RD
7785
7786 def GetClientSize(*args, **kwargs):
7787 """
5b5c9bc7 7788 GetClientSize(self) -> Size
d55e5bfc
RD
7789
7790 This gets the size of the window's 'client area' in pixels. The client
7791 area is the area which may be drawn on by the programmer, excluding
7792 title bar, border, scrollbars, etc.
7793 """
5b5c9bc7 7794 return _core_.Window_GetClientSize(*args, **kwargs)
d55e5bfc
RD
7795
7796 def GetClientSizeTuple(*args, **kwargs):
7797 """
7798 GetClientSizeTuple() -> (width, height)
7799
7800 This gets the size of the window's 'client area' in pixels. The client
7801 area is the area which may be drawn on by the programmer, excluding
7802 title bar, border, scrollbars, etc.
7803 """
5b5c9bc7 7804 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
d55e5bfc
RD
7805
7806 def GetClientAreaOrigin(*args, **kwargs):
7807 """
5b5c9bc7 7808 GetClientAreaOrigin(self) -> Point
d55e5bfc
RD
7809
7810 Get the origin of the client area of the window relative to the
7811 window's top left corner (the client area may be shifted because of
7812 the borders, scrollbars, other decorations...)
7813 """
5b5c9bc7 7814 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
d55e5bfc
RD
7815
7816 def GetClientRect(*args, **kwargs):
7817 """
5b5c9bc7 7818 GetClientRect(self) -> Rect
d55e5bfc 7819
0439c23b 7820 Get the client area position and size as a `wx.Rect` object.
d55e5bfc 7821 """
5b5c9bc7 7822 return _core_.Window_GetClientRect(*args, **kwargs)
d55e5bfc
RD
7823
7824 def GetBestSize(*args, **kwargs):
7825 """
5b5c9bc7 7826 GetBestSize(self) -> Size
d55e5bfc 7827
bfddbb17 7828 This function returns the best acceptable minimal size for the
15817c7e
RD
7829 window, if applicable. For example, for a static text control, it will
7830 be the minimal size such that the control label is not truncated. For
7831 windows containing subwindows (suzh aswx.Panel), the size returned by
7832 this function will be the same as the size the window would have had
7833 after calling Fit.
d55e5bfc 7834 """
5b5c9bc7 7835 return _core_.Window_GetBestSize(*args, **kwargs)
d55e5bfc
RD
7836
7837 def GetBestSizeTuple(*args, **kwargs):
7838 """
7839 GetBestSizeTuple() -> (width, height)
7840
bfddbb17 7841 This function returns the best acceptable minimal size for the
15817c7e
RD
7842 window, if applicable. For example, for a static text control, it will
7843 be the minimal size such that the control label is not truncated. For
7844 windows containing subwindows (suzh aswx.Panel), the size returned by
7845 this function will be the same as the size the window would have had
7846 after calling Fit.
d55e5bfc 7847 """
5b5c9bc7 7848 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
d55e5bfc 7849
a001823c
RD
7850 def InvalidateBestSize(*args, **kwargs):
7851 """
7852 InvalidateBestSize(self)
7853
7854 Reset the cached best size value so it will be recalculated the next
7855 time it is needed.
7856 """
5b5c9bc7 7857 return _core_.Window_InvalidateBestSize(*args, **kwargs)
a001823c 7858
e2813725
RD
7859 def CacheBestSize(*args, **kwargs):
7860 """
7861 CacheBestSize(self, Size size)
7862
7863 Cache the best size so it doesn't need to be calculated again, (at least until
7864 some properties of the window change.)
7865 """
7866 return _core_.Window_CacheBestSize(*args, **kwargs)
7867
a001823c
RD
7868 def GetBestFittingSize(*args, **kwargs):
7869 """
5b5c9bc7 7870 GetBestFittingSize(self) -> Size
a001823c
RD
7871
7872 This function will merge the window's best size into the window's
7873 minimum size, giving priority to the min size components, and returns
7874 the results.
7875
7876 """
5b5c9bc7 7877 return _core_.Window_GetBestFittingSize(*args, **kwargs)
a001823c 7878
d55e5bfc
RD
7879 def GetAdjustedBestSize(*args, **kwargs):
7880 """
5b5c9bc7 7881 GetAdjustedBestSize(self) -> Size
d55e5bfc
RD
7882
7883 This method is similar to GetBestSize, except in one
7884 thing. GetBestSize should return the minimum untruncated size of the
7885 window, while this method will return the largest of BestSize and any
7886 user specified minimum size. ie. it is the minimum size the window
7887 should currently be drawn at, not the minimal size it can possibly
7888 tolerate.
7889 """
5b5c9bc7 7890 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
d55e5bfc
RD
7891
7892 def Center(*args, **kwargs):
7893 """
5b5c9bc7 7894 Center(self, int direction=BOTH)
d55e5bfc
RD
7895
7896 Centers the window. The parameter specifies the direction for
7897 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7898 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7899 on the entire screen and not on its parent window. If it is a
7900 top-level window and has no parent then it will always be centered
7901 relative to the screen.
7902 """
5b5c9bc7 7903 return _core_.Window_Center(*args, **kwargs)
d55e5bfc
RD
7904
7905 Centre = Center
d55e5bfc
RD
7906 def CenterOnParent(*args, **kwargs):
7907 """
5b5c9bc7 7908 CenterOnParent(self, int dir=BOTH)
d55e5bfc
RD
7909
7910 Center with respect to the the parent window
7911 """
5b5c9bc7 7912 return _core_.Window_CenterOnParent(*args, **kwargs)
d55e5bfc
RD
7913
7914 CentreOnParent = CenterOnParent
7915 def Fit(*args, **kwargs):
7916 """
7917 Fit(self)
7918
7919 Sizes the window so that it fits around its subwindows. This function
7920 won't do anything if there are no subwindows and will only really work
7921 correctly if sizers are used for the subwindows layout. Also, if the
7922 window has exactly one subwindow it is better (faster and the result
7923 is more precise as Fit adds some margin to account for fuzziness of
7924 its calculations) to call window.SetClientSize(child.GetSize())
7925 instead of calling Fit.
7926 """
5b5c9bc7 7927 return _core_.Window_Fit(*args, **kwargs)
d55e5bfc
RD
7928
7929 def FitInside(*args, **kwargs):
7930 """
7931 FitInside(self)
7932
7933 Similar to Fit, but sizes the interior (virtual) size of a
7934 window. Mainly useful with scrolled windows to reset scrollbars after
7935 sizing changes that do not trigger a size event, and/or scrolled
7936 windows without an interior sizer. This function similarly won't do
7937 anything if there are no subwindows.
7938 """
5b5c9bc7 7939 return _core_.Window_FitInside(*args, **kwargs)
d55e5bfc 7940
03837c5c 7941 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
7942 """
7943 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
7944 int incH=-1)
d55e5bfc
RD
7945
7946 Allows specification of minimum and maximum window sizes, and window
7947 size increments. If a pair of values is not set (or set to -1), the
7948 default values will be used. If this function is called, the user
908b74cd
RD
7949 will not be able to size the window outside the given bounds (if it is
7950 a top-level window.) Sizers will also inspect the minimum window size
7951 and will use that value if set when calculating layout.
7952
7953 The resizing increments are only significant under Motif or Xt.
d55e5bfc 7954 """
5b5c9bc7 7955 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 7956
03837c5c
RD
7957 def SetSizeHintsSz(*args, **kwargs):
7958 """
5b5c9bc7 7959 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
03837c5c
RD
7960
7961 Allows specification of minimum and maximum window sizes, and window
7962 size increments. If a pair of values is not set (or set to -1), the
7963 default values will be used. If this function is called, the user
7964 will not be able to size the window outside the given bounds (if it is
7965 a top-level window.) Sizers will also inspect the minimum window size
7966 and will use that value if set when calculating layout.
7967
7968 The resizing increments are only significant under Motif or Xt.
7969 """
5b5c9bc7 7970 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
03837c5c
RD
7971
7972 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 7973 """
908b74cd 7974 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
7975
7976 Allows specification of minimum and maximum virtual window sizes. If a
7977 pair of values is not set (or set to -1), the default values will be
7978 used. If this function is called, the user will not be able to size
7979 the virtual area of the window outside the given bounds.
7980 """
5b5c9bc7 7981 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
03837c5c
RD
7982
7983 def SetVirtualSizeHintsSz(*args, **kwargs):
7984 """
5b5c9bc7 7985 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
03837c5c
RD
7986
7987 Allows specification of minimum and maximum virtual window sizes. If a
7988 pair of values is not set (or set to -1), the default values will be
7989 used. If this function is called, the user will not be able to size
7990 the virtual area of the window outside the given bounds.
7991 """
5b5c9bc7 7992 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 7993
908b74cd 7994 def GetMaxSize(*args, **kwargs):
5b5c9bc7
RD
7995 """GetMaxSize(self) -> Size"""
7996 return _core_.Window_GetMaxSize(*args, **kwargs)
908b74cd
RD
7997
7998 def GetMinSize(*args, **kwargs):
5b5c9bc7
RD
7999 """GetMinSize(self) -> Size"""
8000 return _core_.Window_GetMinSize(*args, **kwargs)
908b74cd
RD
8001
8002 def SetMinSize(*args, **kwargs):
8003 """
5b5c9bc7 8004 SetMinSize(self, Size minSize)
908b74cd
RD
8005
8006 A more convenient method than `SetSizeHints` for setting just the
8007 min size.
8008 """
5b5c9bc7 8009 return _core_.Window_SetMinSize(*args, **kwargs)
908b74cd
RD
8010
8011 def SetMaxSize(*args, **kwargs):
8012 """
5b5c9bc7 8013 SetMaxSize(self, Size maxSize)
908b74cd
RD
8014
8015 A more convenient method than `SetSizeHints` for setting just the
8016 max size.
8017 """
5b5c9bc7 8018 return _core_.Window_SetMaxSize(*args, **kwargs)
908b74cd 8019
d55e5bfc
RD
8020 def GetMinWidth(*args, **kwargs):
8021 """GetMinWidth(self) -> int"""
5b5c9bc7 8022 return _core_.Window_GetMinWidth(*args, **kwargs)
d55e5bfc
RD
8023
8024 def GetMinHeight(*args, **kwargs):
8025 """GetMinHeight(self) -> int"""
5b5c9bc7 8026 return _core_.Window_GetMinHeight(*args, **kwargs)
d55e5bfc
RD
8027
8028 def GetMaxWidth(*args, **kwargs):
8029 """GetMaxWidth(self) -> int"""
5b5c9bc7 8030 return _core_.Window_GetMaxWidth(*args, **kwargs)
d55e5bfc
RD
8031
8032 def GetMaxHeight(*args, **kwargs):
8033 """GetMaxHeight(self) -> int"""
5b5c9bc7 8034 return _core_.Window_GetMaxHeight(*args, **kwargs)
d55e5bfc 8035
d55e5bfc
RD
8036 def SetVirtualSize(*args, **kwargs):
8037 """
5b5c9bc7 8038 SetVirtualSize(self, Size size)
d55e5bfc
RD
8039
8040 Set the the virtual size of a window in pixels. For most windows this
8041 is just the client area of the window, but for some like scrolled
8042 windows it is more or less independent of the screen window size.
8043 """
5b5c9bc7 8044 return _core_.Window_SetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8045
8046 def SetVirtualSizeWH(*args, **kwargs):
8047 """
8048 SetVirtualSizeWH(self, int w, int h)
8049
8050 Set the the virtual size of a window in pixels. For most windows this
8051 is just the client area of the window, but for some like scrolled
8052 windows it is more or less independent of the screen window size.
8053 """
5b5c9bc7 8054 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
d55e5bfc
RD
8055
8056 def GetVirtualSize(*args, **kwargs):
8057 """
5b5c9bc7 8058 GetVirtualSize(self) -> Size
d55e5bfc
RD
8059
8060 Get the the virtual size of the window in pixels. For most windows
8061 this is just the client area of the window, but for some like scrolled
8062 windows it is more or less independent of the screen window size.
8063 """
5b5c9bc7 8064 return _core_.Window_GetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8065
8066 def GetVirtualSizeTuple(*args, **kwargs):
8067 """
8068 GetVirtualSizeTuple() -> (width, height)
8069
8070 Get the the virtual size of the window in pixels. For most windows
8071 this is just the client area of the window, but for some like scrolled
8072 windows it is more or less independent of the screen window size.
8073 """
5b5c9bc7 8074 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
d55e5bfc
RD
8075
8076 def GetBestVirtualSize(*args, **kwargs):
8077 """
5b5c9bc7 8078 GetBestVirtualSize(self) -> Size
d55e5bfc
RD
8079
8080 Return the largest of ClientSize and BestSize (as determined by a
8081 sizer, interior children, or other means)
8082 """
5b5c9bc7 8083 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
d55e5bfc
RD
8084
8085 def Show(*args, **kwargs):
8086 """
8087 Show(self, bool show=True) -> bool
8088
8089 Shows or hides the window. You may need to call Raise for a top level
8090 window if you want to bring it to top, although this is not needed if
8091 Show is called immediately after the frame creation. Returns True if
8092 the window has been shown or hidden or False if nothing was done
8093 because it already was in the requested state.
8094 """
5b5c9bc7 8095 return _core_.Window_Show(*args, **kwargs)
d55e5bfc
RD
8096
8097 def Hide(*args, **kwargs):
8098 """
8099 Hide(self) -> bool
8100
8101 Equivalent to calling Show(False).
8102 """
5b5c9bc7 8103 return _core_.Window_Hide(*args, **kwargs)
d55e5bfc
RD
8104
8105 def Enable(*args, **kwargs):
8106 """
8107 Enable(self, bool enable=True) -> bool
8108
8109 Enable or disable the window for user input. Note that when a parent
8110 window is disabled, all of its children are disabled as well and they
8111 are reenabled again when the parent is. Returns true if the window
8112 has been enabled or disabled, false if nothing was done, i.e. if the
8113 window had already been in the specified state.
8114 """
5b5c9bc7 8115 return _core_.Window_Enable(*args, **kwargs)
d55e5bfc
RD
8116
8117 def Disable(*args, **kwargs):
8118 """
8119 Disable(self) -> bool
8120
8121 Disables the window, same as Enable(false).
8122 """
5b5c9bc7 8123 return _core_.Window_Disable(*args, **kwargs)
d55e5bfc
RD
8124
8125 def IsShown(*args, **kwargs):
8126 """
8127 IsShown(self) -> bool
8128
8129 Returns true if the window is shown, false if it has been hidden.
8130 """
5b5c9bc7 8131 return _core_.Window_IsShown(*args, **kwargs)
d55e5bfc
RD
8132
8133 def IsEnabled(*args, **kwargs):
8134 """
8135 IsEnabled(self) -> bool
8136
8137 Returns true if the window is enabled for input, false otherwise.
8138 """
5b5c9bc7 8139 return _core_.Window_IsEnabled(*args, **kwargs)
d55e5bfc
RD
8140
8141 def SetWindowStyleFlag(*args, **kwargs):
8142 """
8143 SetWindowStyleFlag(self, long style)
8144
15817c7e
RD
8145 Sets the style of the window. Please note that some styles cannot be
8146 changed after the window creation and that Refresh() might need to be
8147 called after changing the others for the change to take place
8148 immediately.
d55e5bfc 8149 """
5b5c9bc7 8150 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8151
8152 def GetWindowStyleFlag(*args, **kwargs):
8153 """
8154 GetWindowStyleFlag(self) -> long
8155
8156 Gets the window style that was passed to the constructor or Create
8157 method.
8158 """
5b5c9bc7 8159 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8160
8161 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8162 def HasFlag(*args, **kwargs):
8163 """
8164 HasFlag(self, int flag) -> bool
8165
8166 Test if the given style is set for this window.
8167 """
5b5c9bc7 8168 return _core_.Window_HasFlag(*args, **kwargs)
d55e5bfc
RD
8169
8170 def IsRetained(*args, **kwargs):
8171 """
8172 IsRetained(self) -> bool
8173
8174 Returns true if the window is retained, false otherwise. Retained
8175 windows are only available on X platforms.
8176 """
5b5c9bc7 8177 return _core_.Window_IsRetained(*args, **kwargs)
d55e5bfc
RD
8178
8179 def SetExtraStyle(*args, **kwargs):
8180 """
8181 SetExtraStyle(self, long exStyle)
8182
8183 Sets the extra style bits for the window. Extra styles are the less
8184 often used style bits which can't be set with the constructor or with
8185 SetWindowStyleFlag()
8186 """
5b5c9bc7 8187 return _core_.Window_SetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8188
8189 def GetExtraStyle(*args, **kwargs):
8190 """
8191 GetExtraStyle(self) -> long
8192
8193 Returns the extra style bits for the window.
8194 """
5b5c9bc7 8195 return _core_.Window_GetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8196
8197 def MakeModal(*args, **kwargs):
8198 """
8199 MakeModal(self, bool modal=True)
8200
8201 Disables all other windows in the application so that the user can
8202 only interact with this window. Passing False will reverse this
8203 effect.
8204 """
5b5c9bc7 8205 return _core_.Window_MakeModal(*args, **kwargs)
d55e5bfc
RD
8206
8207 def SetThemeEnabled(*args, **kwargs):
8208 """
8209 SetThemeEnabled(self, bool enableTheme)
8210
8211 This function tells a window if it should use the system's "theme"
8212 code to draw the windows' background instead if its own background
8213 drawing code. This will only have an effect on platforms that support
8214 the notion of themes in user defined windows. One such platform is
8215 GTK+ where windows can have (very colourful) backgrounds defined by a
8216 user's selected theme.
8217
8218 Dialogs, notebook pages and the status bar have this flag set to true
8219 by default so that the default look and feel is simulated best.
8220 """
5b5c9bc7 8221 return _core_.Window_SetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8222
8223 def GetThemeEnabled(*args, **kwargs):
8224 """
8225 GetThemeEnabled(self) -> bool
8226
8227 Return the themeEnabled flag.
8228 """
5b5c9bc7 8229 return _core_.Window_GetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8230
8231 def SetFocus(*args, **kwargs):
8232 """
8233 SetFocus(self)
8234
8235 Set's the focus to this window, allowing it to receive keyboard input.
8236 """
5b5c9bc7 8237 return _core_.Window_SetFocus(*args, **kwargs)
d55e5bfc
RD
8238
8239 def SetFocusFromKbd(*args, **kwargs):
8240 """
8241 SetFocusFromKbd(self)
8242
8243 Set focus to this window as the result of a keyboard action. Normally
8244 only called internally.
8245 """
5b5c9bc7 8246 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
d55e5bfc
RD
8247
8248 def FindFocus(*args, **kwargs):
8249 """
5b5c9bc7 8250 FindFocus() -> Window
d55e5bfc
RD
8251
8252 Returns the window or control that currently has the keyboard focus,
8253 or None.
8254 """
5b5c9bc7 8255 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc
RD
8256
8257 FindFocus = staticmethod(FindFocus)
8258 def AcceptsFocus(*args, **kwargs):
8259 """
8260 AcceptsFocus(self) -> bool
8261
8262 Can this window have focus?
8263 """
5b5c9bc7 8264 return _core_.Window_AcceptsFocus(*args, **kwargs)
d55e5bfc
RD
8265
8266 def AcceptsFocusFromKeyboard(*args, **kwargs):
8267 """
8268 AcceptsFocusFromKeyboard(self) -> bool
8269
8270 Can this window be given focus by keyboard navigation? if not, the
8271 only way to give it focus (provided it accepts it at all) is to click
8272 it.
8273 """
5b5c9bc7 8274 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
d55e5bfc
RD
8275
8276 def GetDefaultItem(*args, **kwargs):
8277 """
5b5c9bc7 8278 GetDefaultItem(self) -> Window
d55e5bfc
RD
8279
8280 Get the default child of this parent, i.e. the one which is activated
8281 by pressing <Enter> such as the OK button on a wx.Dialog.
8282 """
5b5c9bc7 8283 return _core_.Window_GetDefaultItem(*args, **kwargs)
d55e5bfc
RD
8284
8285 def SetDefaultItem(*args, **kwargs):
8286 """
5b5c9bc7 8287 SetDefaultItem(self, Window child) -> Window
d55e5bfc
RD
8288
8289 Set this child as default, return the old default.
8290 """
5b5c9bc7 8291 return _core_.Window_SetDefaultItem(*args, **kwargs)
d55e5bfc
RD
8292
8293 def SetTmpDefaultItem(*args, **kwargs):
8294 """
5b5c9bc7 8295 SetTmpDefaultItem(self, Window win)
d55e5bfc
RD
8296
8297 Set this child as temporary default
8298 """
5b5c9bc7 8299 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
d55e5bfc 8300
908b74cd
RD
8301 def Navigate(*args, **kwargs):
8302 """
8303 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8304
fd2dc343
RD
8305 Does keyboard navigation from this window to another, by sending a
8306 `wx.NavigationKeyEvent`.
908b74cd 8307 """
5b5c9bc7 8308 return _core_.Window_Navigate(*args, **kwargs)
908b74cd 8309
bf26d883
RD
8310 def MoveAfterInTabOrder(*args, **kwargs):
8311 """
5b5c9bc7 8312 MoveAfterInTabOrder(self, Window win)
bf26d883
RD
8313
8314 Moves this window in the tab navigation order after the specified
8315 sibling window. This means that when the user presses the TAB key on
8316 that other window, the focus switches to this window.
8317
8318 The default tab order is the same as creation order. This function
8319 and `MoveBeforeInTabOrder` allow to change it after creating all the
8320 windows.
8321
8322 """
5b5c9bc7 8323 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
bf26d883
RD
8324
8325 def MoveBeforeInTabOrder(*args, **kwargs):
8326 """
5b5c9bc7 8327 MoveBeforeInTabOrder(self, Window win)
bf26d883
RD
8328
8329 Same as `MoveAfterInTabOrder` except that it inserts this window just
8330 before win instead of putting it right after it.
8331 """
5b5c9bc7 8332 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
bf26d883 8333
d55e5bfc
RD
8334 def GetChildren(*args, **kwargs):
8335 """
8336 GetChildren(self) -> PyObject
8337
8338 Returns a list of the window's children. NOTE: Currently this is a
8339 copy of the child window list maintained by the window, so the return
8340 value of this function is only valid as long as the window's children
8341 do not change.
8342 """
5b5c9bc7 8343 return _core_.Window_GetChildren(*args, **kwargs)
d55e5bfc
RD
8344
8345 def GetParent(*args, **kwargs):
8346 """
5b5c9bc7 8347 GetParent(self) -> Window
d55e5bfc
RD
8348
8349 Returns the parent window of this window, or None if there isn't one.
8350 """
5b5c9bc7 8351 return _core_.Window_GetParent(*args, **kwargs)
d55e5bfc
RD
8352
8353 def GetGrandParent(*args, **kwargs):
8354 """
5b5c9bc7 8355 GetGrandParent(self) -> Window
d55e5bfc 8356
15817c7e
RD
8357 Returns the parent of the parent of this window, or None if there
8358 isn't one.
d55e5bfc 8359 """
5b5c9bc7 8360 return _core_.Window_GetGrandParent(*args, **kwargs)
d55e5bfc
RD
8361
8362 def IsTopLevel(*args, **kwargs):
8363 """
8364 IsTopLevel(self) -> bool
8365
8366 Returns true if the given window is a top-level one. Currently all
8367 frames and dialogs are always considered to be top-level windows (even
8368 if they have a parent window).
8369 """
5b5c9bc7 8370 return _core_.Window_IsTopLevel(*args, **kwargs)
d55e5bfc
RD
8371
8372 def Reparent(*args, **kwargs):
8373 """
5b5c9bc7 8374 Reparent(self, Window newParent) -> bool
d55e5bfc
RD
8375
8376 Reparents the window, i.e the window will be removed from its current
8377 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8378 re-inserted into another. Available on Windows and GTK. Returns True
8379 if the parent was changed, False otherwise (error or newParent ==
8380 oldParent)
8381 """
5b5c9bc7 8382 return _core_.Window_Reparent(*args, **kwargs)
d55e5bfc
RD
8383
8384 def AddChild(*args, **kwargs):
8385 """
5b5c9bc7 8386 AddChild(self, Window child)
d55e5bfc
RD
8387
8388 Adds a child window. This is called automatically by window creation
8389 functions so should not be required by the application programmer.
8390 """
5b5c9bc7 8391 return _core_.Window_AddChild(*args, **kwargs)
d55e5bfc
RD
8392
8393 def RemoveChild(*args, **kwargs):
8394 """
5b5c9bc7 8395 RemoveChild(self, Window child)
d55e5bfc
RD
8396
8397 Removes a child window. This is called automatically by window
8398 deletion functions so should not be required by the application
8399 programmer.
8400 """
5b5c9bc7 8401 return _core_.Window_RemoveChild(*args, **kwargs)
d55e5bfc 8402
704eda0c
RD
8403 def SetDoubleBuffered(*args, **kwargs):
8404 """
8405 SetDoubleBuffered(self, bool on)
8406
8407 Currently wxGTK2 only.
8408 """
8409 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8410
d55e5bfc
RD
8411 def FindWindowById(*args, **kwargs):
8412 """
5b5c9bc7 8413 FindWindowById(self, long winid) -> Window
d55e5bfc
RD
8414
8415 Find a chld of this window by window ID
8416 """
5b5c9bc7 8417 return _core_.Window_FindWindowById(*args, **kwargs)
d55e5bfc
RD
8418
8419 def FindWindowByName(*args, **kwargs):
8420 """
5b5c9bc7 8421 FindWindowByName(self, String name) -> Window
d55e5bfc
RD
8422
8423 Find a child of this window by name
8424 """
5b5c9bc7 8425 return _core_.Window_FindWindowByName(*args, **kwargs)
d55e5bfc
RD
8426
8427 def GetEventHandler(*args, **kwargs):
8428 """
5b5c9bc7 8429 GetEventHandler(self) -> EvtHandler
d55e5bfc
RD
8430
8431 Returns the event handler for this window. By default, the window is
8432 its own event handler.
8433 """
5b5c9bc7 8434 return _core_.Window_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
8435
8436 def SetEventHandler(*args, **kwargs):
8437 """
5b5c9bc7 8438 SetEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8439
8440 Sets the event handler for this window. An event handler is an object
8441 that is capable of processing the events sent to a window. By default,
8442 the window is its own event handler, but an application may wish to
8443 substitute another, for example to allow central implementation of
8444 event-handling for a variety of different window classes.
8445
15817c7e 8446 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
8447 up a chain of event handlers, where an event not handled by one event
8448 handler is handed to the next one in the chain.
8449 """
5b5c9bc7 8450 return _core_.Window_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
8451
8452 def PushEventHandler(*args, **kwargs):
8453 """
5b5c9bc7 8454 PushEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8455
8456 Pushes this event handler onto the event handler stack for the window.
8457 An event handler is an object that is capable of processing the events
8458 sent to a window. By default, the window is its own event handler, but
8459 an application may wish to substitute another, for example to allow
8460 central implementation of event-handling for a variety of different
8461 window classes.
8462
8463 wx.Window.PushEventHandler allows an application to set up a chain of
8464 event handlers, where an event not handled by one event handler is
15817c7e 8465 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
8466 remove the event handler.
8467 """
5b5c9bc7 8468 return _core_.Window_PushEventHandler(*args, **kwargs)
d55e5bfc
RD
8469
8470 def PopEventHandler(*args, **kwargs):
8471 """
5b5c9bc7 8472 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
d55e5bfc
RD
8473
8474 Removes and returns the top-most event handler on the event handler
8475 stack. If deleteHandler is True then the wx.EvtHandler object will be
8476 destroyed after it is popped.
8477 """
5b5c9bc7 8478 return _core_.Window_PopEventHandler(*args, **kwargs)
d55e5bfc
RD
8479
8480 def RemoveEventHandler(*args, **kwargs):
8481 """
5b5c9bc7 8482 RemoveEventHandler(self, EvtHandler handler) -> bool
d55e5bfc 8483
15817c7e
RD
8484 Find the given handler in the event handler chain and remove (but not
8485 delete) it from the event handler chain, return True if it was found
8486 and False otherwise (this also results in an assert failure so this
8487 function should only be called when the handler is supposed to be
8488 there.)
d55e5bfc 8489 """
5b5c9bc7 8490 return _core_.Window_RemoveEventHandler(*args, **kwargs)
d55e5bfc
RD
8491
8492 def SetValidator(*args, **kwargs):
8493 """
5b5c9bc7 8494 SetValidator(self, Validator validator)
d55e5bfc
RD
8495
8496 Deletes the current validator (if any) and sets the window validator,
8497 having called wx.Validator.Clone to create a new validator of this
8498 type.
8499 """
5b5c9bc7 8500 return _core_.Window_SetValidator(*args, **kwargs)
d55e5bfc
RD
8501
8502 def GetValidator(*args, **kwargs):
8503 """
5b5c9bc7 8504 GetValidator(self) -> Validator
d55e5bfc
RD
8505
8506 Returns a pointer to the current validator for the window, or None if
8507 there is none.
8508 """
5b5c9bc7 8509 return _core_.Window_GetValidator(*args, **kwargs)
d55e5bfc
RD
8510
8511 def Validate(*args, **kwargs):
8512 """
8513 Validate(self) -> bool
8514
8515 Validates the current values of the child controls using their
15817c7e
RD
8516 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8517 style flag set, the method will also call Validate() of all child
8518 windows. Returns false if any of the validations failed.
d55e5bfc 8519 """
5b5c9bc7 8520 return _core_.Window_Validate(*args, **kwargs)
d55e5bfc
RD
8521
8522 def TransferDataToWindow(*args, **kwargs):
8523 """
8524 TransferDataToWindow(self) -> bool
8525
15817c7e
RD
8526 Transfers values to child controls from data areas specified by their
8527 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8528 style flag set, the method will also call TransferDataToWindow() of
8529 all child windows.
d55e5bfc 8530 """
5b5c9bc7 8531 return _core_.Window_TransferDataToWindow(*args, **kwargs)
d55e5bfc
RD
8532
8533 def TransferDataFromWindow(*args, **kwargs):
8534 """
8535 TransferDataFromWindow(self) -> bool
8536
15817c7e
RD
8537 Transfers values from child controls to data areas specified by their
8538 validators. Returns false if a transfer failed. If the window has
8539 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8540 also call TransferDataFromWindow() of all child windows.
d55e5bfc 8541 """
5b5c9bc7 8542 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
d55e5bfc
RD
8543
8544 def InitDialog(*args, **kwargs):
8545 """
8546 InitDialog(self)
8547
15817c7e
RD
8548 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8549 to the dialog via validators.
d55e5bfc 8550 """
5b5c9bc7 8551 return _core_.Window_InitDialog(*args, **kwargs)
d55e5bfc
RD
8552
8553 def SetAcceleratorTable(*args, **kwargs):
8554 """
5b5c9bc7 8555 SetAcceleratorTable(self, AcceleratorTable accel)
d55e5bfc
RD
8556
8557 Sets the accelerator table for this window.
8558 """
5b5c9bc7 8559 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
8560
8561 def GetAcceleratorTable(*args, **kwargs):
8562 """
5b5c9bc7 8563 GetAcceleratorTable(self) -> AcceleratorTable
d55e5bfc
RD
8564
8565 Gets the accelerator table for this window.
8566 """
5b5c9bc7 8567 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
8568
8569 def RegisterHotKey(*args, **kwargs):
8570 """
8571 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8572
8573 Registers a system wide hotkey. Every time the user presses the hotkey
8574 registered here, this window will receive a hotkey event. It will
8575 receive the event even if the application is in the background and
8576 does not have the input focus because the user is working with some
8577 other application. To bind an event handler function to this hotkey
8578 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8579 hotkey was registered successfully.
8580 """
5b5c9bc7 8581 return _core_.Window_RegisterHotKey(*args, **kwargs)
d55e5bfc
RD
8582
8583 def UnregisterHotKey(*args, **kwargs):
8584 """
8585 UnregisterHotKey(self, int hotkeyId) -> bool
8586
8587 Unregisters a system wide hotkey.
8588 """
5b5c9bc7 8589 return _core_.Window_UnregisterHotKey(*args, **kwargs)
d55e5bfc
RD
8590
8591 def ConvertDialogPointToPixels(*args, **kwargs):
8592 """
5b5c9bc7 8593 ConvertDialogPointToPixels(self, Point pt) -> Point
d55e5bfc
RD
8594
8595 Converts a point or size from dialog units to pixels. Dialog units
8596 are used for maintaining a dialog's proportions even if the font
8597 changes. For the x dimension, the dialog units are multiplied by the
8598 average character width and then divided by 4. For the y dimension,
8599 the dialog units are multiplied by the average character height and
8600 then divided by 8.
8601 """
5b5c9bc7 8602 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
d55e5bfc
RD
8603
8604 def ConvertDialogSizeToPixels(*args, **kwargs):
8605 """
5b5c9bc7 8606 ConvertDialogSizeToPixels(self, Size sz) -> Size
d55e5bfc
RD
8607
8608 Converts a point or size from dialog units to pixels. Dialog units
8609 are used for maintaining a dialog's proportions even if the font
8610 changes. For the x dimension, the dialog units are multiplied by the
8611 average character width and then divided by 4. For the y dimension,
8612 the dialog units are multiplied by the average character height and
8613 then divided by 8.
8614 """
5b5c9bc7 8615 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
d55e5bfc
RD
8616
8617 def DLG_PNT(*args, **kwargs):
8618 """
5b5c9bc7 8619 DLG_PNT(self, Point pt) -> Point
d55e5bfc
RD
8620
8621 Converts a point or size from dialog units to pixels. Dialog units
8622 are used for maintaining a dialog's proportions even if the font
8623 changes. For the x dimension, the dialog units are multiplied by the
8624 average character width and then divided by 4. For the y dimension,
8625 the dialog units are multiplied by the average character height and
8626 then divided by 8.
8627 """
5b5c9bc7 8628 return _core_.Window_DLG_PNT(*args, **kwargs)
d55e5bfc
RD
8629
8630 def DLG_SZE(*args, **kwargs):
8631 """
5b5c9bc7 8632 DLG_SZE(self, Size sz) -> Size
d55e5bfc
RD
8633
8634 Converts a point or size from dialog units to pixels. Dialog units
8635 are used for maintaining a dialog's proportions even if the font
8636 changes. For the x dimension, the dialog units are multiplied by the
8637 average character width and then divided by 4. For the y dimension,
8638 the dialog units are multiplied by the average character height and
8639 then divided by 8.
8640 """
5b5c9bc7 8641 return _core_.Window_DLG_SZE(*args, **kwargs)
d55e5bfc
RD
8642
8643 def ConvertPixelPointToDialog(*args, **kwargs):
5b5c9bc7
RD
8644 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8645 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
d55e5bfc
RD
8646
8647 def ConvertPixelSizeToDialog(*args, **kwargs):
5b5c9bc7
RD
8648 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8649 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
d55e5bfc
RD
8650
8651 def WarpPointer(*args, **kwargs):
8652 """
8653 WarpPointer(self, int x, int y)
8654
8655 Moves the pointer to the given position on the window.
8656
8657 NOTE: This function is not supported under Mac because Apple Human
8658 Interface Guidelines forbid moving the mouse cursor programmatically.
8659 """
5b5c9bc7 8660 return _core_.Window_WarpPointer(*args, **kwargs)
d55e5bfc
RD
8661
8662 def CaptureMouse(*args, **kwargs):
8663 """
8664 CaptureMouse(self)
8665
8666 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8667 release the capture.
8668
8669 Note that wxWindows maintains the stack of windows having captured the
8670 mouse and when the mouse is released the capture returns to the window
8671 which had had captured it previously and it is only really released if
8672 there were no previous window. In particular, this means that you must
8673 release the mouse as many times as you capture it.
8674 """
5b5c9bc7 8675 return _core_.Window_CaptureMouse(*args, **kwargs)
d55e5bfc
RD
8676
8677 def ReleaseMouse(*args, **kwargs):
8678 """
8679 ReleaseMouse(self)
8680
8681 Releases mouse input captured with wx.Window.CaptureMouse.
8682 """
5b5c9bc7 8683 return _core_.Window_ReleaseMouse(*args, **kwargs)
d55e5bfc
RD
8684
8685 def GetCapture(*args, **kwargs):
8686 """
5b5c9bc7 8687 GetCapture() -> Window
d55e5bfc
RD
8688
8689 Returns the window which currently captures the mouse or None
8690 """
5b5c9bc7 8691 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc
RD
8692
8693 GetCapture = staticmethod(GetCapture)
8694 def HasCapture(*args, **kwargs):
8695 """
8696 HasCapture(self) -> bool
8697
8698 Returns true if this window has the current mouse capture.
8699 """
5b5c9bc7 8700 return _core_.Window_HasCapture(*args, **kwargs)
d55e5bfc
RD
8701
8702 def Refresh(*args, **kwargs):
8703 """
5b5c9bc7 8704 Refresh(self, bool eraseBackground=True, Rect rect=None)
d55e5bfc
RD
8705
8706 Mark the specified rectangle (or the whole window) as "dirty" so it
8707 will be repainted. Causes an EVT_PAINT event to be generated and sent
8708 to the window.
8709 """
5b5c9bc7 8710 return _core_.Window_Refresh(*args, **kwargs)
d55e5bfc
RD
8711
8712 def RefreshRect(*args, **kwargs):
8713 """
5b5c9bc7 8714 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
8715
8716 Redraws the contents of the given rectangle: the area inside it will
8717 be repainted. This is the same as Refresh but has a nicer syntax.
8718 """
5b5c9bc7 8719 return _core_.Window_RefreshRect(*args, **kwargs)
d55e5bfc
RD
8720
8721 def Update(*args, **kwargs):
8722 """
8723 Update(self)
8724
8725 Calling this method immediately repaints the invalidated area of the
8726 window instead of waiting for the EVT_PAINT event to happen, (normally
8727 this would usually only happen when the flow of control returns to the
8728 event loop.) Notice that this function doesn't refresh the window and
8729 does nothing if the window has been already repainted. Use Refresh
8730 first if you want to immediately redraw the window (or some portion of
8731 it) unconditionally.
8732 """
5b5c9bc7 8733 return _core_.Window_Update(*args, **kwargs)
d55e5bfc
RD
8734
8735 def ClearBackground(*args, **kwargs):
8736 """
8737 ClearBackground(self)
8738
8739 Clears the window by filling it with the current background
8740 colour. Does not cause an erase background event to be generated.
8741 """
5b5c9bc7 8742 return _core_.Window_ClearBackground(*args, **kwargs)
d55e5bfc
RD
8743
8744 def Freeze(*args, **kwargs):
8745 """
8746 Freeze(self)
8747
15817c7e
RD
8748 Freezes the window or, in other words, prevents any updates from
8749 taking place on screen, the window is not redrawn at all. Thaw must be
8750 called to reenable window redrawing. Calls to Freeze/Thaw may be
8751 nested, with the actual Thaw being delayed until all the nesting has
8752 been undone.
d55e5bfc
RD
8753
8754 This method is useful for visual appearance optimization (for example,
8755 it is a good idea to use it before inserting large amount of text into
8756 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8757 for all controls so it is mostly just a hint to wxWindows and not a
8758 mandatory directive.
8759 """
5b5c9bc7 8760 return _core_.Window_Freeze(*args, **kwargs)
d55e5bfc
RD
8761
8762 def Thaw(*args, **kwargs):
8763 """
8764 Thaw(self)
8765
8766 Reenables window updating after a previous call to Freeze. Calls to
15817c7e
RD
8767 Freeze/Thaw may be nested, so Thaw must be called the same number of
8768 times that Freeze was before the window will be updated.
d55e5bfc 8769 """
5b5c9bc7 8770 return _core_.Window_Thaw(*args, **kwargs)
d55e5bfc
RD
8771
8772 def PrepareDC(*args, **kwargs):
8773 """
5b5c9bc7 8774 PrepareDC(self, DC dc)
d55e5bfc
RD
8775
8776 Call this function to prepare the device context for drawing a
8777 scrolled image. It sets the device origin according to the current
8778 scroll position.
8779 """
5b5c9bc7 8780 return _core_.Window_PrepareDC(*args, **kwargs)
d55e5bfc
RD
8781
8782 def GetUpdateRegion(*args, **kwargs):
8783 """
5b5c9bc7 8784 GetUpdateRegion(self) -> Region
d55e5bfc
RD
8785
8786 Returns the region specifying which parts of the window have been
8787 damaged. Should only be called within an EVT_PAINT handler.
8788 """
5b5c9bc7 8789 return _core_.Window_GetUpdateRegion(*args, **kwargs)
d55e5bfc
RD
8790
8791 def GetUpdateClientRect(*args, **kwargs):
8792 """
5b5c9bc7 8793 GetUpdateClientRect(self) -> Rect
d55e5bfc
RD
8794
8795 Get the update rectangle region bounding box in client coords.
8796 """
5b5c9bc7 8797 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
d55e5bfc
RD
8798
8799 def IsExposed(*args, **kwargs):
8800 """
8801 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8802
8803 Returns true if the given point or rectangle area has been exposed
8804 since the last repaint. Call this in an paint event handler to
8805 optimize redrawing by only redrawing those areas, which have been
8806 exposed.
8807 """
5b5c9bc7 8808 return _core_.Window_IsExposed(*args, **kwargs)
d55e5bfc
RD
8809
8810 def IsExposedPoint(*args, **kwargs):
8811 """
5b5c9bc7 8812 IsExposedPoint(self, Point pt) -> bool
d55e5bfc
RD
8813
8814 Returns true if the given point or rectangle area has been exposed
8815 since the last repaint. Call this in an paint event handler to
8816 optimize redrawing by only redrawing those areas, which have been
8817 exposed.
8818 """
5b5c9bc7 8819 return _core_.Window_IsExposedPoint(*args, **kwargs)
d55e5bfc
RD
8820
8821 def IsExposedRect(*args, **kwargs):
8822 """
5b5c9bc7 8823 IsExposedRect(self, Rect rect) -> bool
d55e5bfc
RD
8824
8825 Returns true if the given point or rectangle area has been exposed
8826 since the last repaint. Call this in an paint event handler to
8827 optimize redrawing by only redrawing those areas, which have been
8828 exposed.
8829 """
5b5c9bc7 8830 return _core_.Window_IsExposedRect(*args, **kwargs)
d55e5bfc
RD
8831
8832 def GetDefaultAttributes(*args, **kwargs):
8833 """
5b5c9bc7 8834 GetDefaultAttributes(self) -> VisualAttributes
d55e5bfc 8835
15817c7e
RD
8836 Get the default attributes for an instance of this class. This is
8837 useful if you want to use the same font or colour in your own control
8838 as in a standard control -- which is a much better idea than hard
8839 coding specific colours or fonts which might look completely out of
a5ee0656 8840 place on the user's system, especially if it uses themes.
d55e5bfc 8841 """
5b5c9bc7 8842 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
8843
8844 def GetClassDefaultAttributes(*args, **kwargs):
8845 """
5b5c9bc7 8846 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 8847
15817c7e
RD
8848 Get the default attributes for this class. This is useful if you want
8849 to use the same font or colour in your own control as in a standard
8850 control -- which is a much better idea than hard coding specific
a5ee0656
RD
8851 colours or fonts which might look completely out of place on the
8852 user's system, especially if it uses themes.
d55e5bfc
RD
8853
8854 The variant parameter is only relevant under Mac currently and is
15817c7e 8855 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
8856 the returned font. See `wx.Window.SetWindowVariant` for more about
8857 this.
d55e5bfc 8858 """
5b5c9bc7 8859 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
8860
8861 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8862 def SetBackgroundColour(*args, **kwargs):
8863 """
5b5c9bc7 8864 SetBackgroundColour(self, Colour colour) -> bool
d55e5bfc
RD
8865
8866 Sets the background colour of the window. Returns True if the colour
8867 was changed. The background colour is usually painted by the default
8868 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
8869 automatically under GTK. Using `wx.NullColour` will reset the window
8870 to the default background colour.
d55e5bfc 8871
a5ee0656 8872 Note that setting the background colour may not cause an immediate
f8167d6e 8873 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
8874 calling this function.
8875
f8167d6e
RD
8876 Using this function will disable attempts to use themes for this
8877 window, if the system supports them. Use with care since usually the
8878 themes represent the appearance chosen by the user to be used for all
8879 applications on the system.
d55e5bfc 8880 """
5b5c9bc7 8881 return _core_.Window_SetBackgroundColour(*args, **kwargs)
d55e5bfc 8882
412d302d 8883 def SetOwnBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
8884 """SetOwnBackgroundColour(self, Colour colour)"""
8885 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
8886
8887 def SetForegroundColour(*args, **kwargs):
8888 """
5b5c9bc7 8889 SetForegroundColour(self, Colour colour) -> bool
d55e5bfc
RD
8890
8891 Sets the foreground colour of the window. Returns True is the colour
8892 was changed. The interpretation of foreground colour is dependent on
8893 the window class; it may be the text colour or other colour, or it may
8894 not be used at all.
8895 """
5b5c9bc7 8896 return _core_.Window_SetForegroundColour(*args, **kwargs)
d55e5bfc 8897
fa47d7a7 8898 def SetOwnForegroundColour(*args, **kwargs):
5b5c9bc7
RD
8899 """SetOwnForegroundColour(self, Colour colour)"""
8900 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
8901
8902 def GetBackgroundColour(*args, **kwargs):
8903 """
5b5c9bc7 8904 GetBackgroundColour(self) -> Colour
d55e5bfc
RD
8905
8906 Returns the background colour of the window.
8907 """
5b5c9bc7 8908 return _core_.Window_GetBackgroundColour(*args, **kwargs)
d55e5bfc
RD
8909
8910 def GetForegroundColour(*args, **kwargs):
8911 """
5b5c9bc7 8912 GetForegroundColour(self) -> Colour
d55e5bfc
RD
8913
8914 Returns the foreground colour of the window. The interpretation of
8915 foreground colour is dependent on the window class; it may be the text
8916 colour or other colour, or it may not be used at all.
8917 """
5b5c9bc7 8918 return _core_.Window_GetForegroundColour(*args, **kwargs)
d55e5bfc 8919
dcb8fc74
RD
8920 def InheritsBackgroundColour(*args, **kwargs):
8921 """InheritsBackgroundColour(self) -> bool"""
5b5c9bc7 8922 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
dcb8fc74
RD
8923
8924 def UseBgCol(*args, **kwargs):
8925 """UseBgCol(self) -> bool"""
5b5c9bc7 8926 return _core_.Window_UseBgCol(*args, **kwargs)
dcb8fc74 8927
0f63ec68
RD
8928 def SetBackgroundStyle(*args, **kwargs):
8929 """
8930 SetBackgroundStyle(self, int style) -> bool
8931
8932 Returns the background style of the window. The background style
8933 indicates how the background of the window is drawn.
8934
8935 ====================== ========================================
8936 wx.BG_STYLE_SYSTEM The background colour or pattern should
8937 be determined by the system
8938 wx.BG_STYLE_COLOUR The background should be a solid colour
8939 wx.BG_STYLE_CUSTOM The background will be implemented by the
8940 application.
8941 ====================== ========================================
8942
8943 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8944 a custom background, such as a tiled bitmap. Currently the style has
8945 no effect on other platforms.
8946
8947 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8948 """
5b5c9bc7 8949 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
0f63ec68
RD
8950
8951 def GetBackgroundStyle(*args, **kwargs):
8952 """
8953 GetBackgroundStyle(self) -> int
8954
8955 Returns the background style of the window.
8956
8957 :see: `SetBackgroundStyle`
8958 """
5b5c9bc7 8959 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
0f63ec68 8960
51b83b37
RD
8961 def HasTransparentBackground(*args, **kwargs):
8962 """
8963 HasTransparentBackground(self) -> bool
8964
8965 Returns True if this window's background is transparent (as, for
8966 example, for `wx.StaticText`) and should show the parent window's
8967 background.
8968
8969 This method is mostly used internally by the library itself and you
8970 normally shouldn't have to call it. You may, however, have to override
8971 it in your custom control classes to ensure that background is painted
8972 correctly.
8973 """
5b5c9bc7 8974 return _core_.Window_HasTransparentBackground(*args, **kwargs)
51b83b37 8975
d55e5bfc
RD
8976 def SetCursor(*args, **kwargs):
8977 """
5b5c9bc7 8978 SetCursor(self, Cursor cursor) -> bool
d55e5bfc
RD
8979
8980 Sets the window's cursor. Notice that the window cursor also sets it
8981 for the children of the window implicitly.
8982
8983 The cursor may be wx.NullCursor in which case the window cursor will
8984 be reset back to default.
8985 """
5b5c9bc7 8986 return _core_.Window_SetCursor(*args, **kwargs)
d55e5bfc
RD
8987
8988 def GetCursor(*args, **kwargs):
8989 """
5b5c9bc7 8990 GetCursor(self) -> Cursor
d55e5bfc
RD
8991
8992 Return the cursor associated with this window.
8993 """
5b5c9bc7 8994 return _core_.Window_GetCursor(*args, **kwargs)
d55e5bfc
RD
8995
8996 def SetFont(*args, **kwargs):
8997 """
5b5c9bc7 8998 SetFont(self, Font font) -> bool
d55e5bfc
RD
8999
9000 Sets the font for this window.
9001 """
5b5c9bc7 9002 return _core_.Window_SetFont(*args, **kwargs)
d55e5bfc 9003
fa47d7a7 9004 def SetOwnFont(*args, **kwargs):
5b5c9bc7
RD
9005 """SetOwnFont(self, Font font)"""
9006 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9007
9008 def GetFont(*args, **kwargs):
9009 """
5b5c9bc7 9010 GetFont(self) -> Font
d55e5bfc
RD
9011
9012 Returns the default font used for this window.
9013 """
5b5c9bc7 9014 return _core_.Window_GetFont(*args, **kwargs)
d55e5bfc
RD
9015
9016 def SetCaret(*args, **kwargs):
9017 """
5b5c9bc7 9018 SetCaret(self, Caret caret)
d55e5bfc
RD
9019
9020 Sets the caret associated with the window.
9021 """
5b5c9bc7 9022 return _core_.Window_SetCaret(*args, **kwargs)
d55e5bfc
RD
9023
9024 def GetCaret(*args, **kwargs):
9025 """
5b5c9bc7 9026 GetCaret(self) -> Caret
d55e5bfc
RD
9027
9028 Returns the caret associated with the window.
9029 """
5b5c9bc7 9030 return _core_.Window_GetCaret(*args, **kwargs)
d55e5bfc
RD
9031
9032 def GetCharHeight(*args, **kwargs):
9033 """
9034 GetCharHeight(self) -> int
9035
9036 Get the (average) character size for the current font.
9037 """
5b5c9bc7 9038 return _core_.Window_GetCharHeight(*args, **kwargs)
d55e5bfc
RD
9039
9040 def GetCharWidth(*args, **kwargs):
9041 """
9042 GetCharWidth(self) -> int
9043
9044 Get the (average) character size for the current font.
9045 """
5b5c9bc7 9046 return _core_.Window_GetCharWidth(*args, **kwargs)
d55e5bfc
RD
9047
9048 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9049 """
9050 GetTextExtent(String string) -> (width, height)
9051
9052 Get the width and height of the text using the current font.
9053 """
5b5c9bc7 9054 return _core_.Window_GetTextExtent(*args, **kwargs)
d55e5bfc
RD
9055
9056 def GetFullTextExtent(*args, **kwargs):
9057 """
9058 GetFullTextExtent(String string, Font font=None) ->
9059 (width, height, descent, externalLeading)
9060
9061 Get the width, height, decent and leading of the text using the
9062 current or specified font.
9063 """
5b5c9bc7 9064 return _core_.Window_GetFullTextExtent(*args, **kwargs)
d55e5bfc
RD
9065
9066 def ClientToScreenXY(*args, **kwargs):
9067 """
9068 ClientToScreenXY(int x, int y) -> (x,y)
9069
9070 Converts to screen coordinates from coordinates relative to this window.
9071 """
5b5c9bc7 9072 return _core_.Window_ClientToScreenXY(*args, **kwargs)
d55e5bfc
RD
9073
9074 def ScreenToClientXY(*args, **kwargs):
9075 """
9076 ScreenToClientXY(int x, int y) -> (x,y)
9077
9078 Converts from screen to client window coordinates.
9079 """
5b5c9bc7 9080 return _core_.Window_ScreenToClientXY(*args, **kwargs)
d55e5bfc
RD
9081
9082 def ClientToScreen(*args, **kwargs):
9083 """
5b5c9bc7 9084 ClientToScreen(self, Point pt) -> Point
d55e5bfc
RD
9085
9086 Converts to screen coordinates from coordinates relative to this window.
9087 """
5b5c9bc7 9088 return _core_.Window_ClientToScreen(*args, **kwargs)
d55e5bfc
RD
9089
9090 def ScreenToClient(*args, **kwargs):
9091 """
5b5c9bc7 9092 ScreenToClient(self, Point pt) -> Point
d55e5bfc
RD
9093
9094 Converts from screen to client window coordinates.
9095 """
5b5c9bc7 9096 return _core_.Window_ScreenToClient(*args, **kwargs)
d55e5bfc
RD
9097
9098 def HitTestXY(*args, **kwargs):
9099 """
9100 HitTestXY(self, int x, int y) -> int
9101
9102 Test where the given (in client coords) point lies
9103 """
5b5c9bc7 9104 return _core_.Window_HitTestXY(*args, **kwargs)
d55e5bfc
RD
9105
9106 def HitTest(*args, **kwargs):
9107 """
5b5c9bc7 9108 HitTest(self, Point pt) -> int
d55e5bfc
RD
9109
9110 Test where the given (in client coords) point lies
9111 """
5b5c9bc7 9112 return _core_.Window_HitTest(*args, **kwargs)
d55e5bfc
RD
9113
9114 def GetBorder(*args):
9115 """
9116 GetBorder(self, long flags) -> int
9117 GetBorder(self) -> int
9118
9119 Get border for the flags of this window
9120 """
5b5c9bc7 9121 return _core_.Window_GetBorder(*args)
d55e5bfc
RD
9122
9123 def UpdateWindowUI(*args, **kwargs):
9124 """
5b5c9bc7 9125 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
d55e5bfc
RD
9126
9127 This function sends EVT_UPDATE_UI events to the window. The particular
9128 implementation depends on the window; for example a wx.ToolBar will
9129 send an update UI event for each toolbar button, and a wx.Frame will
9130 send an update UI event for each menubar menu item. You can call this
9131 function from your application to ensure that your UI is up-to-date at
9132 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9133 concerned). This may be necessary if you have called
5ba5649b 9134 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9135 limit the overhead that wxWindows incurs by sending update UI events
9136 in idle time.
d55e5bfc 9137 """
5b5c9bc7 9138 return _core_.Window_UpdateWindowUI(*args, **kwargs)
d55e5bfc
RD
9139
9140 def PopupMenuXY(*args, **kwargs):
9141 """
5b5c9bc7 9142 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9143
b0503257
RD
9144 Pops up the given menu at the specified coordinates, relative to this window,
9145 and returns control when the user has dismissed the menu. If a menu item is
9146 selected, the corresponding menu event is generated and will be processed as
9147 usual. If the default position is given then the current position of the
9148 mouse cursor will be used.
d55e5bfc 9149 """
5b5c9bc7 9150 return _core_.Window_PopupMenuXY(*args, **kwargs)
d55e5bfc
RD
9151
9152 def PopupMenu(*args, **kwargs):
9153 """
5b5c9bc7 9154 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9155
b0503257
RD
9156 Pops up the given menu at the specified coordinates, relative to this window,
9157 and returns control when the user has dismissed the menu. If a menu item is
9158 selected, the corresponding menu event is generated and will be processed as
9159 usual. If the default position is given then the current position of the
9160 mouse cursor will be used.
d55e5bfc 9161 """
5b5c9bc7 9162 return _core_.Window_PopupMenu(*args, **kwargs)
d55e5bfc
RD
9163
9164 def GetHandle(*args, **kwargs):
9165 """
9166 GetHandle(self) -> long
9167
9168 Returns the platform-specific handle (as a long integer) of the
9169 physical window. Currently on wxMac it returns the handle of the
9170 toplevel parent of the window.
9171 """
5b5c9bc7 9172 return _core_.Window_GetHandle(*args, **kwargs)
d55e5bfc 9173
629e65c2
RD
9174 def AssociateHandle(*args, **kwargs):
9175 """
9176 AssociateHandle(self, long handle)
9177
9178 Associate the window with a new native handle
9179 """
5b5c9bc7 9180 return _core_.Window_AssociateHandle(*args, **kwargs)
629e65c2
RD
9181
9182 def DissociateHandle(*args, **kwargs):
9183 """
9184 DissociateHandle(self)
9185
9186 Dissociate the current native handle from the window
9187 """
5b5c9bc7 9188 return _core_.Window_DissociateHandle(*args, **kwargs)
629e65c2 9189
d55e5bfc
RD
9190 def HasScrollbar(*args, **kwargs):
9191 """
9192 HasScrollbar(self, int orient) -> bool
9193
9194 Does the window have the scrollbar for this orientation?
9195 """
5b5c9bc7 9196 return _core_.Window_HasScrollbar(*args, **kwargs)
d55e5bfc
RD
9197
9198 def SetScrollbar(*args, **kwargs):
9199 """
15817c7e 9200 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
9201 bool refresh=True)
9202
9203 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc 9204 """
5b5c9bc7 9205 return _core_.Window_SetScrollbar(*args, **kwargs)
d55e5bfc
RD
9206
9207 def SetScrollPos(*args, **kwargs):
9208 """
9209 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9210
9211 Sets the position of one of the built-in scrollbars.
9212 """
5b5c9bc7 9213 return _core_.Window_SetScrollPos(*args, **kwargs)
d55e5bfc
RD
9214
9215 def GetScrollPos(*args, **kwargs):
9216 """
9217 GetScrollPos(self, int orientation) -> int
9218
9219 Returns the built-in scrollbar position.
9220 """
5b5c9bc7 9221 return _core_.Window_GetScrollPos(*args, **kwargs)
d55e5bfc
RD
9222
9223 def GetScrollThumb(*args, **kwargs):
9224 """
9225 GetScrollThumb(self, int orientation) -> int
9226
9227 Returns the built-in scrollbar thumb size.
9228 """
5b5c9bc7 9229 return _core_.Window_GetScrollThumb(*args, **kwargs)
d55e5bfc
RD
9230
9231 def GetScrollRange(*args, **kwargs):
9232 """
9233 GetScrollRange(self, int orientation) -> int
9234
9235 Returns the built-in scrollbar range.
9236 """
5b5c9bc7 9237 return _core_.Window_GetScrollRange(*args, **kwargs)
d55e5bfc
RD
9238
9239 def ScrollWindow(*args, **kwargs):
9240 """
5b5c9bc7 9241 ScrollWindow(self, int dx, int dy, Rect rect=None)
d55e5bfc
RD
9242
9243 Physically scrolls the pixels in the window and move child windows
9244 accordingly. Use this function to optimise your scrolling
9245 implementations, to minimise the area that must be redrawn. Note that
9246 it is rarely required to call this function from a user program.
d55e5bfc 9247 """
5b5c9bc7 9248 return _core_.Window_ScrollWindow(*args, **kwargs)
d55e5bfc
RD
9249
9250 def ScrollLines(*args, **kwargs):
9251 """
9252 ScrollLines(self, int lines) -> bool
9253
9254 If the platform and window class supports it, scrolls the window by
9255 the given number of lines down, if lines is positive, or up if lines
9256 is negative. Returns True if the window was scrolled, False if it was
9257 already on top/bottom and nothing was done.
9258 """
5b5c9bc7 9259 return _core_.Window_ScrollLines(*args, **kwargs)
d55e5bfc
RD
9260
9261 def ScrollPages(*args, **kwargs):
9262 """
9263 ScrollPages(self, int pages) -> bool
9264
15817c7e 9265 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
9266 the given number of pages down, if pages is positive, or up if pages
9267 is negative. Returns True if the window was scrolled, False if it was
9268 already on top/bottom and nothing was done.
9269 """
5b5c9bc7 9270 return _core_.Window_ScrollPages(*args, **kwargs)
d55e5bfc
RD
9271
9272 def LineUp(*args, **kwargs):
9273 """
9274 LineUp(self) -> bool
9275
9276 This is just a wrapper for ScrollLines(-1).
9277 """
5b5c9bc7 9278 return _core_.Window_LineUp(*args, **kwargs)
d55e5bfc
RD
9279
9280 def LineDown(*args, **kwargs):
9281 """
9282 LineDown(self) -> bool
9283
9284 This is just a wrapper for ScrollLines(1).
9285 """
5b5c9bc7 9286 return _core_.Window_LineDown(*args, **kwargs)
d55e5bfc
RD
9287
9288 def PageUp(*args, **kwargs):
9289 """
9290 PageUp(self) -> bool
9291
9292 This is just a wrapper for ScrollPages(-1).
9293 """
5b5c9bc7 9294 return _core_.Window_PageUp(*args, **kwargs)
d55e5bfc
RD
9295
9296 def PageDown(*args, **kwargs):
9297 """
9298 PageDown(self) -> bool
9299
9300 This is just a wrapper for ScrollPages(1).
9301 """
5b5c9bc7 9302 return _core_.Window_PageDown(*args, **kwargs)
d55e5bfc
RD
9303
9304 def SetHelpText(*args, **kwargs):
9305 """
5b5c9bc7 9306 SetHelpText(self, String text)
d55e5bfc
RD
9307
9308 Sets the help text to be used as context-sensitive help for this
9309 window. Note that the text is actually stored by the current
f52cbe90 9310 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 9311 """
5b5c9bc7 9312 return _core_.Window_SetHelpText(*args, **kwargs)
d55e5bfc
RD
9313
9314 def SetHelpTextForId(*args, **kwargs):
9315 """
5b5c9bc7 9316 SetHelpTextForId(self, String text)
d55e5bfc
RD
9317
9318 Associate this help text with all windows with the same id as this
9319 one.
9320 """
5b5c9bc7 9321 return _core_.Window_SetHelpTextForId(*args, **kwargs)
d55e5bfc 9322
b850e7f3
RD
9323 def GetHelpTextAtPoint(*args, **kwargs):
9324 """
9325 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9326
9327 Get the help string associated with the given position in this window.
9328
9329 Notice that pt may be invalid if event origin is keyboard or unknown
9330 and this method should return the global window help text then
9331
9332 """
9333 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9334
d55e5bfc
RD
9335 def GetHelpText(*args, **kwargs):
9336 """
5b5c9bc7 9337 GetHelpText(self) -> String
d55e5bfc
RD
9338
9339 Gets the help text to be used as context-sensitive help for this
9340 window. Note that the text is actually stored by the current
f52cbe90 9341 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 9342 """
5b5c9bc7 9343 return _core_.Window_GetHelpText(*args, **kwargs)
d55e5bfc
RD
9344
9345 def SetToolTipString(*args, **kwargs):
9346 """
5b5c9bc7 9347 SetToolTipString(self, String tip)
d55e5bfc
RD
9348
9349 Attach a tooltip to the window.
9350 """
5b5c9bc7 9351 return _core_.Window_SetToolTipString(*args, **kwargs)
d55e5bfc
RD
9352
9353 def SetToolTip(*args, **kwargs):
9354 """
5b5c9bc7 9355 SetToolTip(self, ToolTip tip)
d55e5bfc
RD
9356
9357 Attach a tooltip to the window.
9358 """
5b5c9bc7 9359 return _core_.Window_SetToolTip(*args, **kwargs)
d55e5bfc
RD
9360
9361 def GetToolTip(*args, **kwargs):
9362 """
5b5c9bc7 9363 GetToolTip(self) -> ToolTip
d55e5bfc
RD
9364
9365 get the associated tooltip or None if none
9366 """
5b5c9bc7 9367 return _core_.Window_GetToolTip(*args, **kwargs)
d55e5bfc
RD
9368
9369 def SetDropTarget(*args, **kwargs):
9370 """
5b5c9bc7 9371 SetDropTarget(self, DropTarget dropTarget)
d55e5bfc
RD
9372
9373 Associates a drop target with this window. If the window already has
9374 a drop target, it is deleted.
9375 """
5b5c9bc7 9376 return _core_.Window_SetDropTarget(*args, **kwargs)
d55e5bfc
RD
9377
9378 def GetDropTarget(*args, **kwargs):
9379 """
5b5c9bc7 9380 GetDropTarget(self) -> DropTarget
d55e5bfc
RD
9381
9382 Returns the associated drop target, which may be None.
9383 """
5b5c9bc7 9384 return _core_.Window_GetDropTarget(*args, **kwargs)
d55e5bfc 9385
5ba5649b
RD
9386 def DragAcceptFiles(*args, **kwargs):
9387 """
9388 DragAcceptFiles(self, bool accept)
9389
9390 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9391 Only functional on Windows.
9392 """
9393 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9394
d55e5bfc
RD
9395 def SetConstraints(*args, **kwargs):
9396 """
5b5c9bc7 9397 SetConstraints(self, LayoutConstraints constraints)
d55e5bfc
RD
9398
9399 Sets the window to have the given layout constraints. If an existing
9400 layout constraints object is already owned by the window, it will be
9401 deleted. Pass None to disassociate and delete the window's current
9402 constraints.
9403
9404 You must call SetAutoLayout to tell a window to use the constraints
9405 automatically in its default EVT_SIZE handler; otherwise, you must
9406 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9407 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9408 effect.
9409 """
5b5c9bc7 9410 return _core_.Window_SetConstraints(*args, **kwargs)
d55e5bfc
RD
9411
9412 def GetConstraints(*args, **kwargs):
9413 """
5b5c9bc7 9414 GetConstraints(self) -> LayoutConstraints
d55e5bfc
RD
9415
9416 Returns a pointer to the window's layout constraints, or None if there
9417 are none.
9418 """
5b5c9bc7 9419 return _core_.Window_GetConstraints(*args, **kwargs)
d55e5bfc
RD
9420
9421 def SetAutoLayout(*args, **kwargs):
9422 """
9423 SetAutoLayout(self, bool autoLayout)
9424
9425 Determines whether the Layout function will be called automatically
b1fcee84
RD
9426 when the window is resized. lease note that this only happens for the
9427 windows usually used to contain children, namely `wx.Panel` and
9428 `wx.TopLevelWindow` (and the classes deriving from them).
9429
9430 This method is called implicitly by `SetSizer` but if you use
9431 `SetConstraints` you should call it manually or otherwise the window
9432 layout won't be correctly updated when its size changes.
d55e5bfc 9433 """
5b5c9bc7 9434 return _core_.Window_SetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9435
9436 def GetAutoLayout(*args, **kwargs):
9437 """
9438 GetAutoLayout(self) -> bool
9439
9440 Returns the current autoLayout setting
9441 """
5b5c9bc7 9442 return _core_.Window_GetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9443
9444 def Layout(*args, **kwargs):
9445 """
9446 Layout(self) -> bool
9447
9448 Invokes the constraint-based layout algorithm or the sizer-based
9449 algorithm for this window. See SetAutoLayout: when auto layout is on,
9450 this function gets called automatically by the default EVT_SIZE
9451 handler when the window is resized.
9452 """
5b5c9bc7 9453 return _core_.Window_Layout(*args, **kwargs)
d55e5bfc
RD
9454
9455 def SetSizer(*args, **kwargs):
9456 """
5b5c9bc7 9457 SetSizer(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9458
9459 Sets the window to have the given layout sizer. The window will then
9460 own the object, and will take care of its deletion. If an existing
9461 layout sizer object is already owned by the window, it will be deleted
9462 if the deleteOld parameter is true. Note that this function will also
9463 call SetAutoLayout implicitly with a True parameter if the sizer is
b411df4a 9464 non-None, and False otherwise.
d55e5bfc 9465 """
5b5c9bc7 9466 return _core_.Window_SetSizer(*args, **kwargs)
d55e5bfc
RD
9467
9468 def SetSizerAndFit(*args, **kwargs):
9469 """
5b5c9bc7 9470 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9471
9472 The same as SetSizer, except it also sets the size hints for the
9473 window based on the sizer's minimum size.
9474 """
5b5c9bc7 9475 return _core_.Window_SetSizerAndFit(*args, **kwargs)
d55e5bfc
RD
9476
9477 def GetSizer(*args, **kwargs):
9478 """
5b5c9bc7 9479 GetSizer(self) -> Sizer
d55e5bfc
RD
9480
9481 Return the sizer associated with the window by a previous call to
9482 SetSizer or None if there isn't one.
9483 """
5b5c9bc7 9484 return _core_.Window_GetSizer(*args, **kwargs)
d55e5bfc
RD
9485
9486 def SetContainingSizer(*args, **kwargs):
9487 """
5b5c9bc7 9488 SetContainingSizer(self, Sizer sizer)
d55e5bfc
RD
9489
9490 This normally does not need to be called by application code. It is
9491 called internally when a window is added to a sizer, and is used so
9492 the window can remove itself from the sizer when it is destroyed.
9493 """
5b5c9bc7 9494 return _core_.Window_SetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9495
9496 def GetContainingSizer(*args, **kwargs):
9497 """
5b5c9bc7 9498 GetContainingSizer(self) -> Sizer
d55e5bfc
RD
9499
9500 Return the sizer that this window is a member of, if any, otherwise None.
9501 """
5b5c9bc7 9502 return _core_.Window_GetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9503
9504 def InheritAttributes(*args, **kwargs):
9505 """
9506 InheritAttributes(self)
9507
15817c7e
RD
9508 This function is (or should be, in case of custom controls) called
9509 during window creation to intelligently set up the window visual
9510 attributes, that is the font and the foreground and background
9511 colours.
9512
9513 By 'intelligently' the following is meant: by default, all windows use
9514 their own default attributes. However if some of the parent's
9515 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 9516 SetOwnFont) and if the corresponding attribute hadn't been
15817c7e
RD
9517 explicitly set for this window itself, then this window takes the same
9518 value as used by the parent. In addition, if the window overrides
9519 ShouldInheritColours to return false, the colours will not be changed
9520 no matter what and only the font might.
9521
a7bb0a9d
RD
9522 This rather complicated logic is necessary in order to accommodate the
9523 different usage scenarios. The most common one is when all default
15817c7e
RD
9524 attributes are used and in this case, nothing should be inherited as
9525 in modern GUIs different controls use different fonts (and colours)
9526 than their siblings so they can't inherit the same value from the
9527 parent. However it was also deemed desirable to allow to simply change
9528 the attributes of all children at once by just changing the font or
9529 colour of their common parent, hence in this case we do inherit the
9530 parents attributes.
9531
d55e5bfc 9532 """
5b5c9bc7 9533 return _core_.Window_InheritAttributes(*args, **kwargs)
d55e5bfc
RD
9534
9535 def ShouldInheritColours(*args, **kwargs):
9536 """
9537 ShouldInheritColours(self) -> bool
9538
9539 Return true from here to allow the colours of this window to be
15817c7e
RD
9540 changed by InheritAttributes, returning false forbids inheriting them
9541 from the parent window.
d55e5bfc 9542
15817c7e
RD
9543 The base class version returns false, but this method is overridden in
9544 wxControl where it returns true.
d55e5bfc 9545 """
5b5c9bc7 9546 return _core_.Window_ShouldInheritColours(*args, **kwargs)
d55e5bfc
RD
9547
9548 def PostCreate(self, pre):
9549 """
9550 Phase 3 of the 2-phase create <wink!>
9551 Call this method after precreating the window with the 2-phase create method.
9552 """
9553 self.this = pre.this
9554 self.thisown = pre.thisown
9555 pre.thisown = 0
9556 if hasattr(self, '_setOORInfo'):
9557 self._setOORInfo(self)
9558 if hasattr(self, '_setCallbackInfo'):
9559 self._setCallbackInfo(self, self.__class__)
9560
7e08d4ef
RD
9561 def SendSizeEvent(self):
9562 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9563
2131d850 9564_core_.Window_swigregister(Window)
d55e5bfc
RD
9565
9566def PreWindow(*args, **kwargs):
9567 """
5b5c9bc7 9568 PreWindow() -> Window
d55e5bfc
RD
9569
9570 Precreate a Window for 2-phase creation.
9571 """
5b5c9bc7 9572 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
9573 return val
9574
1bd55598
RD
9575def Window_NewControlId(*args):
9576 """
5b5c9bc7 9577 Window_NewControlId() -> int
d55e5bfc
RD
9578
9579 Generate a control id for the controls which were not given one.
9580 """
1bd55598 9581 return _core_.Window_NewControlId(*args)
d55e5bfc 9582
5b5c9bc7 9583def Window_NextControlId(*args, **kwargs):
1bd55598 9584 """
5b5c9bc7 9585 Window_NextControlId(int winid) -> int
d55e5bfc
RD
9586
9587 Get the id of the control following the one with the given
15817c7e 9588 autogenerated) id
d55e5bfc 9589 """
1bd55598 9590 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc 9591
5b5c9bc7 9592def Window_PrevControlId(*args, **kwargs):
1bd55598 9593 """
5b5c9bc7 9594 Window_PrevControlId(int winid) -> int
d55e5bfc
RD
9595
9596 Get the id of the control preceding the one with the given
15817c7e 9597 autogenerated) id
d55e5bfc 9598 """
1bd55598 9599 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 9600
1bd55598
RD
9601def Window_FindFocus(*args):
9602 """
5b5c9bc7 9603 Window_FindFocus() -> Window
d55e5bfc
RD
9604
9605 Returns the window or control that currently has the keyboard focus,
9606 or None.
9607 """
1bd55598 9608 return _core_.Window_FindFocus(*args)
d55e5bfc 9609
1bd55598
RD
9610def Window_GetCapture(*args):
9611 """
5b5c9bc7 9612 Window_GetCapture() -> Window
d55e5bfc
RD
9613
9614 Returns the window which currently captures the mouse or None
9615 """
1bd55598 9616 return _core_.Window_GetCapture(*args)
d55e5bfc 9617
5b5c9bc7 9618def Window_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 9619 """
5b5c9bc7 9620 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9621
15817c7e
RD
9622 Get the default attributes for this class. This is useful if you want
9623 to use the same font or colour in your own control as in a standard
9624 control -- which is a much better idea than hard coding specific
a5ee0656
RD
9625 colours or fonts which might look completely out of place on the
9626 user's system, especially if it uses themes.
d55e5bfc
RD
9627
9628 The variant parameter is only relevant under Mac currently and is
15817c7e 9629 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
9630 the returned font. See `wx.Window.SetWindowVariant` for more about
9631 this.
d55e5bfc 9632 """
1bd55598 9633 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9634
9635def DLG_PNT(win, point_or_x, y=None):
9636 """
9637 Convenience function for converting a Point or (x,y) in
9638 dialog units to pixel units.
9639 """
9640 if y is None:
9641 return win.ConvertDialogPointToPixels(point_or_x)
9642 else:
9643 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9644
9645def DLG_SZE(win, size_width, height=None):
9646 """
9647 Convenience function for converting a Size or (w,h) in
9648 dialog units to pixel units.
9649 """
9650 if height is None:
9651 return win.ConvertDialogSizeToPixels(size_width)
9652 else:
9653 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9654
9655
5b5c9bc7 9656def FindWindowById(*args, **kwargs):
1bd55598 9657 """
5b5c9bc7 9658 FindWindowById(long id, Window parent=None) -> Window
d55e5bfc
RD
9659
9660 Find the first window in the application with the given id. If parent
9661 is None, the search will start from all top-level frames and dialog
9662 boxes; if non-None, the search will be limited to the given window
9663 hierarchy. The search is recursive in both cases.
9664 """
1bd55598 9665 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc 9666
5b5c9bc7 9667def FindWindowByName(*args, **kwargs):
1bd55598 9668 """
5b5c9bc7 9669 FindWindowByName(String name, Window parent=None) -> Window
d55e5bfc
RD
9670
9671 Find a window by its name (as given in a window constructor or Create
9672 function call). If parent is None, the search will start from all
9673 top-level frames and dialog boxes; if non-None, the search will be
9674 limited to the given window hierarchy. The search is recursive in both
9675 cases.
9676
9677 If no window with such name is found, wx.FindWindowByLabel is called.
9678 """
1bd55598 9679 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc 9680
5b5c9bc7 9681def FindWindowByLabel(*args, **kwargs):
1bd55598 9682 """
5b5c9bc7 9683 FindWindowByLabel(String label, Window parent=None) -> Window
d55e5bfc
RD
9684
9685 Find a window by its label. Depending on the type of window, the label
9686 may be a window title or panel item label. If parent is None, the
9687 search will start from all top-level frames and dialog boxes; if
9688 non-None, the search will be limited to the given window
9689 hierarchy. The search is recursive in both cases.
9690 """
1bd55598 9691 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc 9692
5b5c9bc7 9693def Window_FromHWND(*args, **kwargs):
1bd55598
RD
9694 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9695 return _core_.Window_FromHWND(*args, **kwargs)
3215336e 9696
1bd55598
RD
9697def GetTopLevelWindows(*args):
9698 """
3215336e
RD
9699 GetTopLevelWindows() -> PyObject
9700
9701 Returns a list of the the application's top-level windows, (frames,
9702 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9703 by wxWidgets, and so it is only valid as long as no top-level windows
9704 are closed or new top-level windows are created.
9705
9706 """
1bd55598 9707 return _core_.GetTopLevelWindows(*args)
d55e5bfc
RD
9708#---------------------------------------------------------------------------
9709
5b5c9bc7
RD
9710class Validator(EvtHandler):
9711 """Proxy of C++ Validator class"""
1bd55598
RD
9712 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9713 __repr__ = _swig_repr
9714 def __init__(self, *args, **kwargs):
5b5c9bc7 9715 """__init__(self) -> Validator"""
1bd55598 9716 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d55e5bfc
RD
9717 self._setOORInfo(self)
9718
9719 def Clone(*args, **kwargs):
5b5c9bc7
RD
9720 """Clone(self) -> Validator"""
9721 return _core_.Validator_Clone(*args, **kwargs)
d55e5bfc
RD
9722
9723 def Validate(*args, **kwargs):
5b5c9bc7
RD
9724 """Validate(self, Window parent) -> bool"""
9725 return _core_.Validator_Validate(*args, **kwargs)
d55e5bfc
RD
9726
9727 def TransferToWindow(*args, **kwargs):
9728 """TransferToWindow(self) -> bool"""
5b5c9bc7 9729 return _core_.Validator_TransferToWindow(*args, **kwargs)
d55e5bfc
RD
9730
9731 def TransferFromWindow(*args, **kwargs):
9732 """TransferFromWindow(self) -> bool"""
5b5c9bc7 9733 return _core_.Validator_TransferFromWindow(*args, **kwargs)
d55e5bfc
RD
9734
9735 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
9736 """GetWindow(self) -> Window"""
9737 return _core_.Validator_GetWindow(*args, **kwargs)
d55e5bfc
RD
9738
9739 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
9740 """SetWindow(self, Window window)"""
9741 return _core_.Validator_SetWindow(*args, **kwargs)
d55e5bfc
RD
9742
9743 def IsSilent(*args, **kwargs):
d6c14a4c 9744 """IsSilent() -> bool"""
5b5c9bc7 9745 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc
RD
9746
9747 IsSilent = staticmethod(IsSilent)
9748 def SetBellOnError(*args, **kwargs):
d6c14a4c 9749 """SetBellOnError(int doIt=True)"""
5b5c9bc7 9750 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
9751
9752 SetBellOnError = staticmethod(SetBellOnError)
2131d850 9753_core_.Validator_swigregister(Validator)
d55e5bfc 9754
1bd55598
RD
9755def Validator_IsSilent(*args):
9756 """Validator_IsSilent() -> bool"""
9757 return _core_.Validator_IsSilent(*args)
d55e5bfc 9758
5b5c9bc7 9759def Validator_SetBellOnError(*args, **kwargs):
1bd55598
RD
9760 """Validator_SetBellOnError(int doIt=True)"""
9761 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc 9762
5b5c9bc7
RD
9763class PyValidator(Validator):
9764 """Proxy of C++ PyValidator class"""
1bd55598
RD
9765 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9766 __repr__ = _swig_repr
9767 def __init__(self, *args, **kwargs):
5b5c9bc7 9768 """__init__(self) -> PyValidator"""
1bd55598 9769 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
d55e5bfc
RD
9770
9771 self._setCallbackInfo(self, PyValidator, 1)
9772 self._setOORInfo(self)
9773
9774 def _setCallbackInfo(*args, **kwargs):
9775 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
5b5c9bc7 9776 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
d55e5bfc 9777
2131d850 9778_core_.PyValidator_swigregister(PyValidator)
d55e5bfc
RD
9779
9780#---------------------------------------------------------------------------
9781
5b5c9bc7
RD
9782class Menu(EvtHandler):
9783 """Proxy of C++ Menu class"""
1bd55598
RD
9784 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9785 __repr__ = _swig_repr
9786 def __init__(self, *args, **kwargs):
5b5c9bc7 9787 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
1bd55598 9788 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
d55e5bfc
RD
9789 self._setOORInfo(self)
9790
9791 def Append(*args, **kwargs):
5b5c9bc7
RD
9792 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9793 return _core_.Menu_Append(*args, **kwargs)
d55e5bfc
RD
9794
9795 def AppendSeparator(*args, **kwargs):
5b5c9bc7
RD
9796 """AppendSeparator(self) -> MenuItem"""
9797 return _core_.Menu_AppendSeparator(*args, **kwargs)
d55e5bfc
RD
9798
9799 def AppendCheckItem(*args, **kwargs):
5b5c9bc7
RD
9800 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9801 return _core_.Menu_AppendCheckItem(*args, **kwargs)
d55e5bfc
RD
9802
9803 def AppendRadioItem(*args, **kwargs):
5b5c9bc7
RD
9804 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9805 return _core_.Menu_AppendRadioItem(*args, **kwargs)
d55e5bfc
RD
9806
9807 def AppendMenu(*args, **kwargs):
5b5c9bc7
RD
9808 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9809 return _core_.Menu_AppendMenu(*args, **kwargs)
d55e5bfc 9810
da91cb0f
RD
9811 def AppendSubMenu(*args, **kwargs):
9812 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9813 return _core_.Menu_AppendSubMenu(*args, **kwargs)
9814
d55e5bfc 9815 def AppendItem(*args, **kwargs):
5b5c9bc7
RD
9816 """AppendItem(self, MenuItem item) -> MenuItem"""
9817 return _core_.Menu_AppendItem(*args, **kwargs)
d55e5bfc 9818
d55e5bfc 9819 def InsertItem(*args, **kwargs):
5b5c9bc7
RD
9820 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9821 return _core_.Menu_InsertItem(*args, **kwargs)
d55e5bfc 9822
1bd55598
RD
9823 def PrependItem(*args, **kwargs):
9824 """PrependItem(self, MenuItem item) -> MenuItem"""
9825 return _core_.Menu_PrependItem(*args, **kwargs)
9826
9827 def Break(*args, **kwargs):
9828 """Break(self)"""
9829 return _core_.Menu_Break(*args, **kwargs)
9830
d55e5bfc
RD
9831 def Insert(*args, **kwargs):
9832 """
5b5c9bc7
RD
9833 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9834 int kind=ITEM_NORMAL) -> MenuItem
d55e5bfc 9835 """
5b5c9bc7 9836 return _core_.Menu_Insert(*args, **kwargs)
d55e5bfc
RD
9837
9838 def InsertSeparator(*args, **kwargs):
5b5c9bc7
RD
9839 """InsertSeparator(self, size_t pos) -> MenuItem"""
9840 return _core_.Menu_InsertSeparator(*args, **kwargs)
d55e5bfc
RD
9841
9842 def InsertCheckItem(*args, **kwargs):
5b5c9bc7
RD
9843 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9844 return _core_.Menu_InsertCheckItem(*args, **kwargs)
d55e5bfc
RD
9845
9846 def InsertRadioItem(*args, **kwargs):
5b5c9bc7
RD
9847 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9848 return _core_.Menu_InsertRadioItem(*args, **kwargs)
d55e5bfc
RD
9849
9850 def InsertMenu(*args, **kwargs):
5b5c9bc7
RD
9851 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9852 return _core_.Menu_InsertMenu(*args, **kwargs)
d55e5bfc 9853
d55e5bfc 9854 def Prepend(*args, **kwargs):
5b5c9bc7
RD
9855 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9856 return _core_.Menu_Prepend(*args, **kwargs)
d55e5bfc
RD
9857
9858 def PrependSeparator(*args, **kwargs):
5b5c9bc7
RD
9859 """PrependSeparator(self) -> MenuItem"""
9860 return _core_.Menu_PrependSeparator(*args, **kwargs)
d55e5bfc
RD
9861
9862 def PrependCheckItem(*args, **kwargs):
5b5c9bc7
RD
9863 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9864 return _core_.Menu_PrependCheckItem(*args, **kwargs)
d55e5bfc
RD
9865
9866 def PrependRadioItem(*args, **kwargs):
5b5c9bc7
RD
9867 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9868 return _core_.Menu_PrependRadioItem(*args, **kwargs)
d55e5bfc
RD
9869
9870 def PrependMenu(*args, **kwargs):
5b5c9bc7
RD
9871 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9872 return _core_.Menu_PrependMenu(*args, **kwargs)
d55e5bfc
RD
9873
9874 def Remove(*args, **kwargs):
5b5c9bc7
RD
9875 """Remove(self, int id) -> MenuItem"""
9876 return _core_.Menu_Remove(*args, **kwargs)
d55e5bfc
RD
9877
9878 def RemoveItem(*args, **kwargs):
5b5c9bc7
RD
9879 """RemoveItem(self, MenuItem item) -> MenuItem"""
9880 return _core_.Menu_RemoveItem(*args, **kwargs)
d55e5bfc
RD
9881
9882 def Delete(*args, **kwargs):
9883 """Delete(self, int id) -> bool"""
5b5c9bc7 9884 return _core_.Menu_Delete(*args, **kwargs)
d55e5bfc
RD
9885
9886 def DeleteItem(*args, **kwargs):
5b5c9bc7
RD
9887 """DeleteItem(self, MenuItem item) -> bool"""
9888 return _core_.Menu_DeleteItem(*args, **kwargs)
d55e5bfc
RD
9889
9890 def Destroy(*args, **kwargs):
9891 """
9892 Destroy(self)
9893
9894 Deletes the C++ object this Python object is a proxy for.
9895 """
7e08d4ef
RD
9896 val = _core_.Menu_Destroy(*args, **kwargs)
9897 args[0].thisown = 0
9898 return val
d55e5bfc
RD
9899
9900 def DestroyId(*args, **kwargs):
9901 """
9902 DestroyId(self, int id) -> bool
9903
9904 Deletes the C++ object this Python object is a proxy for.
9905 """
7e08d4ef
RD
9906 val = _core_.Menu_DestroyId(*args, **kwargs)
9907 args[0].thisown = 0
9908 return val
d55e5bfc
RD
9909
9910 def DestroyItem(*args, **kwargs):
9911 """
5b5c9bc7 9912 DestroyItem(self, MenuItem item) -> bool
d55e5bfc
RD
9913
9914 Deletes the C++ object this Python object is a proxy for.
9915 """
7e08d4ef
RD
9916 val = _core_.Menu_DestroyItem(*args, **kwargs)
9917 args[0].thisown = 0
9918 return val
d55e5bfc
RD
9919
9920 def GetMenuItemCount(*args, **kwargs):
9921 """GetMenuItemCount(self) -> size_t"""
5b5c9bc7 9922 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
d55e5bfc
RD
9923
9924 def GetMenuItems(*args, **kwargs):
9925 """GetMenuItems(self) -> PyObject"""
5b5c9bc7 9926 return _core_.Menu_GetMenuItems(*args, **kwargs)
d55e5bfc
RD
9927
9928 def FindItem(*args, **kwargs):
5b5c9bc7
RD
9929 """FindItem(self, String item) -> int"""
9930 return _core_.Menu_FindItem(*args, **kwargs)
d55e5bfc
RD
9931
9932 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
9933 """FindItemById(self, int id) -> MenuItem"""
9934 return _core_.Menu_FindItemById(*args, **kwargs)
d55e5bfc
RD
9935
9936 def FindItemByPosition(*args, **kwargs):
5b5c9bc7
RD
9937 """FindItemByPosition(self, size_t position) -> MenuItem"""
9938 return _core_.Menu_FindItemByPosition(*args, **kwargs)
d55e5bfc
RD
9939
9940 def Enable(*args, **kwargs):
9941 """Enable(self, int id, bool enable)"""
5b5c9bc7 9942 return _core_.Menu_Enable(*args, **kwargs)
d55e5bfc
RD
9943
9944 def IsEnabled(*args, **kwargs):
9945 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 9946 return _core_.Menu_IsEnabled(*args, **kwargs)
d55e5bfc
RD
9947
9948 def Check(*args, **kwargs):
9949 """Check(self, int id, bool check)"""
5b5c9bc7 9950 return _core_.Menu_Check(*args, **kwargs)
d55e5bfc
RD
9951
9952 def IsChecked(*args, **kwargs):
9953 """IsChecked(self, int id) -> bool"""
5b5c9bc7 9954 return _core_.Menu_IsChecked(*args, **kwargs)
d55e5bfc
RD
9955
9956 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
9957 """SetLabel(self, int id, String label)"""
9958 return _core_.Menu_SetLabel(*args, **kwargs)
d55e5bfc
RD
9959
9960 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
9961 """GetLabel(self, int id) -> String"""
9962 return _core_.Menu_GetLabel(*args, **kwargs)
d55e5bfc
RD
9963
9964 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
9965 """SetHelpString(self, int id, String helpString)"""
9966 return _core_.Menu_SetHelpString(*args, **kwargs)
d55e5bfc
RD
9967
9968 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
9969 """GetHelpString(self, int id) -> String"""
9970 return _core_.Menu_GetHelpString(*args, **kwargs)
d55e5bfc
RD
9971
9972 def SetTitle(*args, **kwargs):
5b5c9bc7
RD
9973 """SetTitle(self, String title)"""
9974 return _core_.Menu_SetTitle(*args, **kwargs)
d55e5bfc
RD
9975
9976 def GetTitle(*args, **kwargs):
5b5c9bc7
RD
9977 """GetTitle(self) -> String"""
9978 return _core_.Menu_GetTitle(*args, **kwargs)
d55e5bfc
RD
9979
9980 def SetEventHandler(*args, **kwargs):
5b5c9bc7
RD
9981 """SetEventHandler(self, EvtHandler handler)"""
9982 return _core_.Menu_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
9983
9984 def GetEventHandler(*args, **kwargs):
5b5c9bc7
RD
9985 """GetEventHandler(self) -> EvtHandler"""
9986 return _core_.Menu_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
9987
9988 def SetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
9989 """SetInvokingWindow(self, Window win)"""
9990 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
9991
9992 def GetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
9993 """GetInvokingWindow(self) -> Window"""
9994 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
9995
9996 def GetStyle(*args, **kwargs):
9997 """GetStyle(self) -> long"""
5b5c9bc7 9998 return _core_.Menu_GetStyle(*args, **kwargs)
d55e5bfc
RD
9999
10000 def UpdateUI(*args, **kwargs):
5b5c9bc7
RD
10001 """UpdateUI(self, EvtHandler source=None)"""
10002 return _core_.Menu_UpdateUI(*args, **kwargs)
d55e5bfc
RD
10003
10004 def GetMenuBar(*args, **kwargs):
5b5c9bc7
RD
10005 """GetMenuBar(self) -> MenuBar"""
10006 return _core_.Menu_GetMenuBar(*args, **kwargs)
d55e5bfc
RD
10007
10008 def Attach(*args, **kwargs):
10009 """Attach(self, wxMenuBarBase menubar)"""
5b5c9bc7 10010 return _core_.Menu_Attach(*args, **kwargs)
d55e5bfc
RD
10011
10012 def Detach(*args, **kwargs):
10013 """Detach(self)"""
5b5c9bc7 10014 return _core_.Menu_Detach(*args, **kwargs)
d55e5bfc
RD
10015
10016 def IsAttached(*args, **kwargs):
10017 """IsAttached(self) -> bool"""
5b5c9bc7 10018 return _core_.Menu_IsAttached(*args, **kwargs)
d55e5bfc
RD
10019
10020 def SetParent(*args, **kwargs):
5b5c9bc7
RD
10021 """SetParent(self, Menu parent)"""
10022 return _core_.Menu_SetParent(*args, **kwargs)
d55e5bfc
RD
10023
10024 def GetParent(*args, **kwargs):
5b5c9bc7
RD
10025 """GetParent(self) -> Menu"""
10026 return _core_.Menu_GetParent(*args, **kwargs)
d55e5bfc 10027
2131d850 10028_core_.Menu_swigregister(Menu)
5b5c9bc7 10029DefaultValidator = cvar.DefaultValidator
d55e5bfc
RD
10030
10031#---------------------------------------------------------------------------
10032
5b5c9bc7
RD
10033class MenuBar(Window):
10034 """Proxy of C++ MenuBar class"""
1bd55598
RD
10035 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10036 __repr__ = _swig_repr
10037 def __init__(self, *args, **kwargs):
5b5c9bc7 10038 """__init__(self, long style=0) -> MenuBar"""
1bd55598 10039 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d55e5bfc
RD
10040 self._setOORInfo(self)
10041
10042 def Append(*args, **kwargs):
5b5c9bc7
RD
10043 """Append(self, Menu menu, String title) -> bool"""
10044 return _core_.MenuBar_Append(*args, **kwargs)
d55e5bfc
RD
10045
10046 def Insert(*args, **kwargs):
5b5c9bc7
RD
10047 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10048 return _core_.MenuBar_Insert(*args, **kwargs)
d55e5bfc
RD
10049
10050 def GetMenuCount(*args, **kwargs):
10051 """GetMenuCount(self) -> size_t"""
5b5c9bc7 10052 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
d55e5bfc
RD
10053
10054 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10055 """GetMenu(self, size_t pos) -> Menu"""
10056 return _core_.MenuBar_GetMenu(*args, **kwargs)
d55e5bfc
RD
10057
10058 def Replace(*args, **kwargs):
5b5c9bc7
RD
10059 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10060 return _core_.MenuBar_Replace(*args, **kwargs)
d55e5bfc
RD
10061
10062 def Remove(*args, **kwargs):
5b5c9bc7
RD
10063 """Remove(self, size_t pos) -> Menu"""
10064 return _core_.MenuBar_Remove(*args, **kwargs)
d55e5bfc
RD
10065
10066 def EnableTop(*args, **kwargs):
10067 """EnableTop(self, size_t pos, bool enable)"""
5b5c9bc7 10068 return _core_.MenuBar_EnableTop(*args, **kwargs)
d55e5bfc
RD
10069
10070 def IsEnabledTop(*args, **kwargs):
10071 """IsEnabledTop(self, size_t pos) -> bool"""
5b5c9bc7 10072 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
d55e5bfc
RD
10073
10074 def SetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10075 """SetLabelTop(self, size_t pos, String label)"""
10076 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
d55e5bfc
RD
10077
10078 def GetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10079 """GetLabelTop(self, size_t pos) -> String"""
10080 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
d55e5bfc
RD
10081
10082 def FindMenuItem(*args, **kwargs):
5b5c9bc7
RD
10083 """FindMenuItem(self, String menu, String item) -> int"""
10084 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
d55e5bfc
RD
10085
10086 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10087 """FindItemById(self, int id) -> MenuItem"""
10088 return _core_.MenuBar_FindItemById(*args, **kwargs)
d55e5bfc
RD
10089
10090 def FindMenu(*args, **kwargs):
5b5c9bc7
RD
10091 """FindMenu(self, String title) -> int"""
10092 return _core_.MenuBar_FindMenu(*args, **kwargs)
d55e5bfc
RD
10093
10094 def Enable(*args, **kwargs):
10095 """Enable(self, int id, bool enable)"""
5b5c9bc7 10096 return _core_.MenuBar_Enable(*args, **kwargs)
d55e5bfc
RD
10097
10098 def Check(*args, **kwargs):
10099 """Check(self, int id, bool check)"""
5b5c9bc7 10100 return _core_.MenuBar_Check(*args, **kwargs)
d55e5bfc
RD
10101
10102 def IsChecked(*args, **kwargs):
10103 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10104 return _core_.MenuBar_IsChecked(*args, **kwargs)
d55e5bfc
RD
10105
10106 def IsEnabled(*args, **kwargs):
10107 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10108 return _core_.MenuBar_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10109
10110 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10111 """SetLabel(self, int id, String label)"""
10112 return _core_.MenuBar_SetLabel(*args, **kwargs)
d55e5bfc
RD
10113
10114 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10115 """GetLabel(self, int id) -> String"""
10116 return _core_.MenuBar_GetLabel(*args, **kwargs)
d55e5bfc
RD
10117
10118 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10119 """SetHelpString(self, int id, String helpString)"""
10120 return _core_.MenuBar_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10121
10122 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10123 """GetHelpString(self, int id) -> String"""
10124 return _core_.MenuBar_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10125
10126 def GetFrame(*args, **kwargs):
10127 """GetFrame(self) -> wxFrame"""
5b5c9bc7 10128 return _core_.MenuBar_GetFrame(*args, **kwargs)
d55e5bfc
RD
10129
10130 def IsAttached(*args, **kwargs):
10131 """IsAttached(self) -> bool"""
5b5c9bc7 10132 return _core_.MenuBar_IsAttached(*args, **kwargs)
d55e5bfc
RD
10133
10134 def Attach(*args, **kwargs):
10135 """Attach(self, wxFrame frame)"""
5b5c9bc7 10136 return _core_.MenuBar_Attach(*args, **kwargs)
d55e5bfc
RD
10137
10138 def Detach(*args, **kwargs):
10139 """Detach(self)"""
5b5c9bc7 10140 return _core_.MenuBar_Detach(*args, **kwargs)
d55e5bfc 10141
4f433fef
RD
10142 def SetAutoWindowMenu(*args, **kwargs):
10143 """SetAutoWindowMenu(bool enable)"""
10144 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10145
10146 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10147 def GetAutoWindowMenu(*args, **kwargs):
10148 """GetAutoWindowMenu() -> bool"""
10149 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10150
10151 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
2131d850 10152_core_.MenuBar_swigregister(MenuBar)
d55e5bfc 10153
4f433fef 10154def MenuBar_SetAutoWindowMenu(*args, **kwargs):
1bd55598
RD
10155 """MenuBar_SetAutoWindowMenu(bool enable)"""
10156 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 10157
1bd55598
RD
10158def MenuBar_GetAutoWindowMenu(*args):
10159 """MenuBar_GetAutoWindowMenu() -> bool"""
10160 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 10161
d55e5bfc
RD
10162#---------------------------------------------------------------------------
10163
5b5c9bc7
RD
10164class MenuItem(Object):
10165 """Proxy of C++ MenuItem class"""
1bd55598
RD
10166 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10167 __repr__ = _swig_repr
10168 def __init__(self, *args, **kwargs):
d55e5bfc 10169 """
5b5c9bc7
RD
10170 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10171 String help=EmptyString, int kind=ITEM_NORMAL,
10172 Menu subMenu=None) -> MenuItem
d55e5bfc 10173 """
1bd55598
RD
10174 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10175 __swig_destroy__ = _core_.delete_MenuItem
10176 __del__ = lambda self : None;
d55e5bfc 10177 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10178 """GetMenu(self) -> Menu"""
10179 return _core_.MenuItem_GetMenu(*args, **kwargs)
d55e5bfc
RD
10180
10181 def SetMenu(*args, **kwargs):
5b5c9bc7
RD
10182 """SetMenu(self, Menu menu)"""
10183 return _core_.MenuItem_SetMenu(*args, **kwargs)
d55e5bfc
RD
10184
10185 def SetId(*args, **kwargs):
10186 """SetId(self, int id)"""
5b5c9bc7 10187 return _core_.MenuItem_SetId(*args, **kwargs)
d55e5bfc
RD
10188
10189 def GetId(*args, **kwargs):
10190 """GetId(self) -> int"""
5b5c9bc7 10191 return _core_.MenuItem_GetId(*args, **kwargs)
d55e5bfc
RD
10192
10193 def IsSeparator(*args, **kwargs):
10194 """IsSeparator(self) -> bool"""
5b5c9bc7 10195 return _core_.MenuItem_IsSeparator(*args, **kwargs)
d55e5bfc
RD
10196
10197 def SetText(*args, **kwargs):
5b5c9bc7
RD
10198 """SetText(self, String str)"""
10199 return _core_.MenuItem_SetText(*args, **kwargs)
d55e5bfc
RD
10200
10201 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10202 """GetLabel(self) -> String"""
10203 return _core_.MenuItem_GetLabel(*args, **kwargs)
d55e5bfc
RD
10204
10205 def GetText(*args, **kwargs):
5b5c9bc7
RD
10206 """GetText(self) -> String"""
10207 return _core_.MenuItem_GetText(*args, **kwargs)
d55e5bfc
RD
10208
10209 def GetLabelFromText(*args, **kwargs):
5b5c9bc7
RD
10210 """GetLabelFromText(String text) -> String"""
10211 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc
RD
10212
10213 GetLabelFromText = staticmethod(GetLabelFromText)
10214 def GetKind(*args, **kwargs):
10215 """GetKind(self) -> int"""
5b5c9bc7 10216 return _core_.MenuItem_GetKind(*args, **kwargs)
d55e5bfc
RD
10217
10218 def SetKind(*args, **kwargs):
10219 """SetKind(self, int kind)"""
5b5c9bc7 10220 return _core_.MenuItem_SetKind(*args, **kwargs)
d55e5bfc
RD
10221
10222 def SetCheckable(*args, **kwargs):
10223 """SetCheckable(self, bool checkable)"""
5b5c9bc7 10224 return _core_.MenuItem_SetCheckable(*args, **kwargs)
d55e5bfc
RD
10225
10226 def IsCheckable(*args, **kwargs):
10227 """IsCheckable(self) -> bool"""
5b5c9bc7 10228 return _core_.MenuItem_IsCheckable(*args, **kwargs)
d55e5bfc
RD
10229
10230 def IsSubMenu(*args, **kwargs):
10231 """IsSubMenu(self) -> bool"""
5b5c9bc7 10232 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
d55e5bfc
RD
10233
10234 def SetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10235 """SetSubMenu(self, Menu menu)"""
10236 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
d55e5bfc
RD
10237
10238 def GetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10239 """GetSubMenu(self) -> Menu"""
10240 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
d55e5bfc
RD
10241
10242 def Enable(*args, **kwargs):
10243 """Enable(self, bool enable=True)"""
5b5c9bc7 10244 return _core_.MenuItem_Enable(*args, **kwargs)
d55e5bfc
RD
10245
10246 def IsEnabled(*args, **kwargs):
10247 """IsEnabled(self) -> bool"""
5b5c9bc7 10248 return _core_.MenuItem_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10249
10250 def Check(*args, **kwargs):
10251 """Check(self, bool check=True)"""
5b5c9bc7 10252 return _core_.MenuItem_Check(*args, **kwargs)
d55e5bfc
RD
10253
10254 def IsChecked(*args, **kwargs):
10255 """IsChecked(self) -> bool"""
5b5c9bc7 10256 return _core_.MenuItem_IsChecked(*args, **kwargs)
d55e5bfc
RD
10257
10258 def Toggle(*args, **kwargs):
10259 """Toggle(self)"""
5b5c9bc7 10260 return _core_.MenuItem_Toggle(*args, **kwargs)
d55e5bfc
RD
10261
10262 def SetHelp(*args, **kwargs):
5b5c9bc7
RD
10263 """SetHelp(self, String str)"""
10264 return _core_.MenuItem_SetHelp(*args, **kwargs)
d55e5bfc
RD
10265
10266 def GetHelp(*args, **kwargs):
5b5c9bc7
RD
10267 """GetHelp(self) -> String"""
10268 return _core_.MenuItem_GetHelp(*args, **kwargs)
d55e5bfc
RD
10269
10270 def GetAccel(*args, **kwargs):
5b5c9bc7
RD
10271 """GetAccel(self) -> AcceleratorEntry"""
10272 return _core_.MenuItem_GetAccel(*args, **kwargs)
d55e5bfc
RD
10273
10274 def SetAccel(*args, **kwargs):
5b5c9bc7
RD
10275 """SetAccel(self, AcceleratorEntry accel)"""
10276 return _core_.MenuItem_SetAccel(*args, **kwargs)
d55e5bfc 10277
32fe5131
RD
10278 def SetBitmap(*args, **kwargs):
10279 """SetBitmap(self, Bitmap bitmap)"""
10280 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10281
10282 def GetBitmap(*args, **kwargs):
10283 """GetBitmap(self) -> Bitmap"""
10284 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10285
c1280d1e 10286 def SetFont(*args, **kwargs):
5b5c9bc7
RD
10287 """SetFont(self, Font font)"""
10288 return _core_.MenuItem_SetFont(*args, **kwargs)
c1280d1e
RD
10289
10290 def GetFont(*args, **kwargs):
5b5c9bc7
RD
10291 """GetFont(self) -> Font"""
10292 return _core_.MenuItem_GetFont(*args, **kwargs)
c1280d1e
RD
10293
10294 def SetTextColour(*args, **kwargs):
5b5c9bc7
RD
10295 """SetTextColour(self, Colour colText)"""
10296 return _core_.MenuItem_SetTextColour(*args, **kwargs)
c1280d1e
RD
10297
10298 def GetTextColour(*args, **kwargs):
5b5c9bc7
RD
10299 """GetTextColour(self) -> Colour"""
10300 return _core_.MenuItem_GetTextColour(*args, **kwargs)
c1280d1e
RD
10301
10302 def SetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10303 """SetBackgroundColour(self, Colour colBack)"""
10304 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10305
10306 def GetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10307 """GetBackgroundColour(self) -> Colour"""
10308 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10309
10310 def SetBitmaps(*args, **kwargs):
5b5c9bc7
RD
10311 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10312 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
c1280d1e
RD
10313
10314 def SetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10315 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10316 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10317
10318 def GetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10319 """GetDisabledBitmap(self) -> Bitmap"""
10320 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10321
10322 def SetMarginWidth(*args, **kwargs):
10323 """SetMarginWidth(self, int nWidth)"""
5b5c9bc7 10324 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
c1280d1e
RD
10325
10326 def GetMarginWidth(*args, **kwargs):
10327 """GetMarginWidth(self) -> int"""
5b5c9bc7 10328 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
c1280d1e 10329
d55e5bfc 10330 def GetDefaultMarginWidth(*args, **kwargs):
d6c14a4c 10331 """GetDefaultMarginWidth() -> int"""
5b5c9bc7 10332 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
10333
10334 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10335 def IsOwnerDrawn(*args, **kwargs):
10336 """IsOwnerDrawn(self) -> bool"""
5b5c9bc7 10337 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10338
10339 def SetOwnerDrawn(*args, **kwargs):
10340 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
5b5c9bc7 10341 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10342
10343 def ResetOwnerDrawn(*args, **kwargs):
10344 """ResetOwnerDrawn(self)"""
5b5c9bc7 10345 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
c1280d1e 10346
2131d850 10347_core_.MenuItem_swigregister(MenuItem)
d55e5bfc 10348
5b5c9bc7 10349def MenuItem_GetLabelFromText(*args, **kwargs):
1bd55598
RD
10350 """MenuItem_GetLabelFromText(String text) -> String"""
10351 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 10352
1bd55598
RD
10353def MenuItem_GetDefaultMarginWidth(*args):
10354 """MenuItem_GetDefaultMarginWidth() -> int"""
10355 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d55e5bfc
RD
10356
10357#---------------------------------------------------------------------------
10358
5b5c9bc7 10359class Control(Window):
d55e5bfc
RD
10360 """
10361 This is the base class for a control or 'widget'.
10362
15817c7e
RD
10363 A control is generally a small window which processes user input
10364 and/or displays one or more item of data.
d55e5bfc 10365 """
1bd55598
RD
10366 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10367 __repr__ = _swig_repr
10368 def __init__(self, *args, **kwargs):
d55e5bfc 10369 """
5b5c9bc7
RD
10370 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10371 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10372 String name=ControlNameStr) -> Control
d55e5bfc 10373
15817c7e
RD
10374 Create a Control. Normally you should only call this from a subclass'
10375 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 10376 """
1bd55598 10377 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d55e5bfc
RD
10378 self._setOORInfo(self)
10379
10380 def Create(*args, **kwargs):
10381 """
5b5c9bc7
RD
10382 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10383 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10384 String name=ControlNameStr) -> bool
d55e5bfc
RD
10385
10386 Do the 2nd phase and create the GUI control.
10387 """
5b5c9bc7 10388 return _core_.Control_Create(*args, **kwargs)
d55e5bfc
RD
10389
10390 def Command(*args, **kwargs):
10391 """
5b5c9bc7 10392 Command(self, CommandEvent event)
d55e5bfc 10393
15817c7e
RD
10394 Simulates the effect of the user issuing a command to the item.
10395
10396 :see: `wx.CommandEvent`
10397
d55e5bfc 10398 """
5b5c9bc7 10399 return _core_.Control_Command(*args, **kwargs)
d55e5bfc
RD
10400
10401 def GetLabel(*args, **kwargs):
10402 """
5b5c9bc7 10403 GetLabel(self) -> String
d55e5bfc
RD
10404
10405 Return a control's text.
10406 """
5b5c9bc7 10407 return _core_.Control_GetLabel(*args, **kwargs)
d55e5bfc 10408
d55e5bfc 10409 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0 10410 """
5b5c9bc7 10411 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
10412
10413 Get the default attributes for this class. This is useful if you want
10414 to use the same font or colour in your own control as in a standard
10415 control -- which is a much better idea than hard coding specific
10416 colours or fonts which might look completely out of place on the
10417 user's system, especially if it uses themes.
10418
10419 The variant parameter is only relevant under Mac currently and is
10420 ignore under other platforms. Under Mac, it will change the size of
10421 the returned font. See `wx.Window.SetWindowVariant` for more about
10422 this.
10423 """
5b5c9bc7 10424 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10425
10426 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2131d850 10427_core_.Control_swigregister(Control)
d55e5bfc
RD
10428ControlNameStr = cvar.ControlNameStr
10429
10430def PreControl(*args, **kwargs):
10431 """
5b5c9bc7 10432 PreControl() -> Control
d55e5bfc
RD
10433
10434 Precreate a Control control for 2-phase creation
10435 """
5b5c9bc7 10436 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
10437 return val
10438
5b5c9bc7 10439def Control_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 10440 """
5b5c9bc7 10441 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
10442
10443 Get the default attributes for this class. This is useful if you want
10444 to use the same font or colour in your own control as in a standard
10445 control -- which is a much better idea than hard coding specific
10446 colours or fonts which might look completely out of place on the
10447 user's system, especially if it uses themes.
10448
10449 The variant parameter is only relevant under Mac currently and is
10450 ignore under other platforms. Under Mac, it will change the size of
10451 the returned font. See `wx.Window.SetWindowVariant` for more about
10452 this.
10453 """
1bd55598 10454 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10455
10456#---------------------------------------------------------------------------
10457
5b5c9bc7 10458class ItemContainer(object):
d55e5bfc 10459 """
53aa7709
RD
10460 The wx.ItemContainer class defines an interface which is implemented
10461 by all controls which have string subitems, each of which may be
10462 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10463 as `wx.ComboBox` which implements an extended interface deriving from
15817c7e 10464 this one.
d55e5bfc 10465
15817c7e
RD
10466 It defines the methods for accessing the control's items and although
10467 each of the derived classes implements them differently, they still
10468 all conform to the same interface.
d55e5bfc 10469
15817c7e
RD
10470 The items in a wx.ItemContainer have (non empty) string labels and,
10471 optionally, client data associated with them.
d55e5bfc
RD
10472
10473 """
1bd55598
RD
10474 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10475 def __init__(self): raise AttributeError, "No constructor defined"
10476 __repr__ = _swig_repr
d55e5bfc
RD
10477 def Append(*args, **kwargs):
10478 """
5b5c9bc7 10479 Append(self, String item, PyObject clientData=None) -> int
d55e5bfc 10480
15817c7e
RD
10481 Adds the item to the control, associating the given data with the item
10482 if not None. The return value is the index of the newly added item
10483 which may be different from the last one if the control is sorted (e.g.
10484 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc 10485 """
5b5c9bc7 10486 return _core_.ItemContainer_Append(*args, **kwargs)
d55e5bfc
RD
10487
10488 def AppendItems(*args, **kwargs):
10489 """
f5b96ee1 10490 AppendItems(self, List strings)
d55e5bfc 10491
15817c7e
RD
10492 Apend several items at once to the control. Notice that calling this
10493 method may be much faster than appending the items one by one if you
10494 need to add a lot of items.
d55e5bfc 10495 """
5b5c9bc7 10496 return _core_.ItemContainer_AppendItems(*args, **kwargs)
d55e5bfc
RD
10497
10498 def Insert(*args, **kwargs):
10499 """
50f151d7 10500 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
d55e5bfc 10501
15817c7e 10502 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
10503 optionally associating some data object with the item.
10504 """
5b5c9bc7 10505 return _core_.ItemContainer_Insert(*args, **kwargs)
d55e5bfc
RD
10506
10507 def Clear(*args, **kwargs):
10508 """
10509 Clear(self)
10510
10511 Removes all items from the control.
10512 """
5b5c9bc7 10513 return _core_.ItemContainer_Clear(*args, **kwargs)
d55e5bfc
RD
10514
10515 def Delete(*args, **kwargs):
10516 """
50f151d7 10517 Delete(self, unsigned int n)
d55e5bfc 10518
15817c7e
RD
10519 Deletes the item at the zero-based index 'n' from the control. Note
10520 that it is an error (signalled by a `wx.PyAssertionError` exception if
10521 enabled) to remove an item with the index negative or greater or equal
10522 than the number of items in the control.
d55e5bfc 10523 """
5b5c9bc7 10524 return _core_.ItemContainer_Delete(*args, **kwargs)
d55e5bfc 10525
53aa7709
RD
10526 def GetClientData(*args, **kwargs):
10527 """
50f151d7 10528 GetClientData(self, unsigned int n) -> PyObject
53aa7709
RD
10529
10530 Returns the client data associated with the given item, (if any.)
10531 """
5b5c9bc7 10532 return _core_.ItemContainer_GetClientData(*args, **kwargs)
53aa7709
RD
10533
10534 def SetClientData(*args, **kwargs):
10535 """
50f151d7 10536 SetClientData(self, unsigned int n, PyObject clientData)
53aa7709
RD
10537
10538 Associate the given client data with the item at position n.
10539 """
5b5c9bc7 10540 return _core_.ItemContainer_SetClientData(*args, **kwargs)
53aa7709 10541
d55e5bfc
RD
10542 def GetCount(*args, **kwargs):
10543 """
50f151d7 10544 GetCount(self) -> unsigned int
d55e5bfc
RD
10545
10546 Returns the number of items in the control.
10547 """
5b5c9bc7 10548 return _core_.ItemContainer_GetCount(*args, **kwargs)
d55e5bfc
RD
10549
10550 def IsEmpty(*args, **kwargs):
10551 """
10552 IsEmpty(self) -> bool
10553
10554 Returns True if the control is empty or False if it has some items.
10555 """
5b5c9bc7 10556 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
d55e5bfc
RD
10557
10558 def GetString(*args, **kwargs):
10559 """
50f151d7 10560 GetString(self, unsigned int n) -> String
d55e5bfc
RD
10561
10562 Returns the label of the item with the given index.
10563 """
5b5c9bc7 10564 return _core_.ItemContainer_GetString(*args, **kwargs)
d55e5bfc
RD
10565
10566 def GetStrings(*args, **kwargs):
10567 """GetStrings(self) -> wxArrayString"""
5b5c9bc7 10568 return _core_.ItemContainer_GetStrings(*args, **kwargs)
d55e5bfc
RD
10569
10570 def SetString(*args, **kwargs):
10571 """
50f151d7 10572 SetString(self, unsigned int n, String s)
d55e5bfc
RD
10573
10574 Sets the label for the given item.
10575 """
5b5c9bc7 10576 return _core_.ItemContainer_SetString(*args, **kwargs)
d55e5bfc
RD
10577
10578 def FindString(*args, **kwargs):
10579 """
5b5c9bc7 10580 FindString(self, String s) -> int
d55e5bfc
RD
10581
10582 Finds an item whose label matches the given string. Returns the
15817c7e
RD
10583 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10584 found.
d55e5bfc 10585 """
5b5c9bc7 10586 return _core_.ItemContainer_FindString(*args, **kwargs)
d55e5bfc 10587
53aa7709 10588 def SetSelection(*args, **kwargs):
d55e5bfc 10589 """
53aa7709 10590 SetSelection(self, int n)
d55e5bfc
RD
10591
10592 Sets the item at index 'n' to be the selected item.
10593 """
5b5c9bc7 10594 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 10595
d55e5bfc
RD
10596 def GetSelection(*args, **kwargs):
10597 """
10598 GetSelection(self) -> int
10599
15817c7e
RD
10600 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10601 is selected.
d55e5bfc 10602 """
5b5c9bc7 10603 return _core_.ItemContainer_GetSelection(*args, **kwargs)
d55e5bfc 10604
53aa7709 10605 def SetStringSelection(*args, **kwargs):
5b5c9bc7
RD
10606 """SetStringSelection(self, String s) -> bool"""
10607 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
53aa7709 10608
d55e5bfc
RD
10609 def GetStringSelection(*args, **kwargs):
10610 """
5b5c9bc7 10611 GetStringSelection(self) -> String
d55e5bfc 10612
15817c7e
RD
10613 Returns the label of the selected item or an empty string if no item
10614 is selected.
d55e5bfc 10615 """
5b5c9bc7 10616 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
d55e5bfc 10617
53aa7709 10618 def Select(*args, **kwargs):
d55e5bfc 10619 """
53aa7709 10620 Select(self, int n)
d55e5bfc 10621
53aa7709
RD
10622 This is the same as `SetSelection` and exists only because it is
10623 slightly more natural for controls which support multiple selection.
d55e5bfc 10624 """
5b5c9bc7 10625 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc 10626
2131d850 10627_core_.ItemContainer_swigregister(ItemContainer)
d55e5bfc
RD
10628
10629#---------------------------------------------------------------------------
10630
5b5c9bc7 10631class ControlWithItems(Control,ItemContainer):
d55e5bfc 10632 """
15817c7e
RD
10633 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10634 wx.Control class, and is used for the base class of various controls
10635 that have items.
d55e5bfc 10636 """
1bd55598
RD
10637 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10638 def __init__(self): raise AttributeError, "No constructor defined"
10639 __repr__ = _swig_repr
2131d850 10640_core_.ControlWithItems_swigregister(ControlWithItems)
d55e5bfc
RD
10641
10642#---------------------------------------------------------------------------
10643
5b5c9bc7 10644class SizerItem(Object):
bfddbb17
RD
10645 """
10646 The wx.SizerItem class is used to track the position, size and other
2131d850
RD
10647 attributes of each item managed by a `wx.Sizer`. It is not usually
10648 necessary to use this class because the sizer elements can also be
10649 identified by their positions or window or sizer references but
10650 sometimes it may be more convenient to use wx.SizerItem directly.
10651 Also, custom classes derived from `wx.PySizer` will probably need to
10652 use the collection of wx.SizerItems held by wx.Sizer when calculating
10653 layout.
bfddbb17
RD
10654
10655 :see: `wx.Sizer`, `wx.GBSizerItem`
10656 """
1bd55598
RD
10657 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10658 __repr__ = _swig_repr
10659 def __init__(self, *args, **kwargs):
bfddbb17 10660 """
5b5c9bc7 10661 __init__(self) -> SizerItem
bfddbb17
RD
10662
10663 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10664 size will need to be set before this item can be used in a Sizer.
10665
10666 You will probably never need to create a wx.SizerItem directly as they
10667 are created automatically when the sizer's Add, Insert or Prepend
10668 methods are called.
10669
10670 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10671 """
1bd55598
RD
10672 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10673 __swig_destroy__ = _core_.delete_SizerItem
10674 __del__ = lambda self : None;
d55e5bfc 10675 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
10676 """
10677 DeleteWindows(self)
10678
10679 Destroy the window or the windows in a subsizer, depending on the type
10680 of item.
10681 """
5b5c9bc7 10682 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
10683
10684 def DetachSizer(*args, **kwargs):
bfddbb17
RD
10685 """
10686 DetachSizer(self)
10687
10688 Enable deleting the SizerItem without destroying the contained sizer.
10689 """
5b5c9bc7 10690 return _core_.SizerItem_DetachSizer(*args, **kwargs)
d55e5bfc
RD
10691
10692 def GetSize(*args, **kwargs):
bfddbb17 10693 """
5b5c9bc7 10694 GetSize(self) -> Size
bfddbb17
RD
10695
10696 Get the current size of the item, as set in the last Layout.
10697 """
5b5c9bc7 10698 return _core_.SizerItem_GetSize(*args, **kwargs)
d55e5bfc
RD
10699
10700 def CalcMin(*args, **kwargs):
bfddbb17 10701 """
5b5c9bc7 10702 CalcMin(self) -> Size
bfddbb17
RD
10703
10704 Calculates the minimum desired size for the item, including any space
10705 needed by borders.
10706 """
5b5c9bc7 10707 return _core_.SizerItem_CalcMin(*args, **kwargs)
d55e5bfc
RD
10708
10709 def SetDimension(*args, **kwargs):
bfddbb17 10710 """
5b5c9bc7 10711 SetDimension(self, Point pos, Size size)
bfddbb17
RD
10712
10713 Set the position and size of the space allocated for this item by the
10714 sizer, and adjust the position and size of the item (window or
10715 subsizer) to be within that space taking alignment and borders into
10716 account.
10717 """
5b5c9bc7 10718 return _core_.SizerItem_SetDimension(*args, **kwargs)
d55e5bfc
RD
10719
10720 def GetMinSize(*args, **kwargs):
bfddbb17 10721 """
5b5c9bc7 10722 GetMinSize(self) -> Size
bfddbb17
RD
10723
10724 Get the minimum size needed for the item.
10725 """
5b5c9bc7 10726 return _core_.SizerItem_GetMinSize(*args, **kwargs)
d55e5bfc 10727
a001823c
RD
10728 def GetMinSizeWithBorder(*args, **kwargs):
10729 """
5b5c9bc7 10730 GetMinSizeWithBorder(self) -> Size
a001823c
RD
10731
10732 Get the minimum size needed for the item with space for the borders
10733 added, if needed.
10734 """
5b5c9bc7 10735 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
a001823c 10736
d55e5bfc
RD
10737 def SetInitSize(*args, **kwargs):
10738 """SetInitSize(self, int x, int y)"""
5b5c9bc7 10739 return _core_.SizerItem_SetInitSize(*args, **kwargs)
d55e5bfc
RD
10740
10741 def SetRatioWH(*args, **kwargs):
bfddbb17
RD
10742 """
10743 SetRatioWH(self, int width, int height)
10744
10745 Set the ratio item attribute.
10746 """
5b5c9bc7 10747 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
d55e5bfc
RD
10748
10749 def SetRatioSize(*args, **kwargs):
bfddbb17 10750 """
5b5c9bc7 10751 SetRatioSize(self, Size size)
bfddbb17
RD
10752
10753 Set the ratio item attribute.
10754 """
5b5c9bc7 10755 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
d55e5bfc
RD
10756
10757 def SetRatio(*args, **kwargs):
bfddbb17
RD
10758 """
10759 SetRatio(self, float ratio)
10760
10761 Set the ratio item attribute.
10762 """
5b5c9bc7 10763 return _core_.SizerItem_SetRatio(*args, **kwargs)
d55e5bfc
RD
10764
10765 def GetRatio(*args, **kwargs):
bfddbb17
RD
10766 """
10767 GetRatio(self) -> float
10768
10769 Set the ratio item attribute.
10770 """
5b5c9bc7 10771 return _core_.SizerItem_GetRatio(*args, **kwargs)
d55e5bfc 10772
070c48b4
RD
10773 def GetRect(*args, **kwargs):
10774 """
5b5c9bc7 10775 GetRect(self) -> Rect
070c48b4
RD
10776
10777 Returns the rectangle that the sizer item should occupy
10778 """
5b5c9bc7 10779 return _core_.SizerItem_GetRect(*args, **kwargs)
070c48b4 10780
d55e5bfc 10781 def IsWindow(*args, **kwargs):
bfddbb17
RD
10782 """
10783 IsWindow(self) -> bool
10784
10785 Is this sizer item a window?
10786 """
5b5c9bc7 10787 return _core_.SizerItem_IsWindow(*args, **kwargs)
d55e5bfc
RD
10788
10789 def IsSizer(*args, **kwargs):
bfddbb17
RD
10790 """
10791 IsSizer(self) -> bool
10792
10793 Is this sizer item a subsizer?
10794 """
5b5c9bc7 10795 return _core_.SizerItem_IsSizer(*args, **kwargs)
d55e5bfc
RD
10796
10797 def IsSpacer(*args, **kwargs):
bfddbb17
RD
10798 """
10799 IsSpacer(self) -> bool
10800
10801 Is this sizer item a spacer?
10802 """
5b5c9bc7 10803 return _core_.SizerItem_IsSpacer(*args, **kwargs)
d55e5bfc
RD
10804
10805 def SetProportion(*args, **kwargs):
bfddbb17
RD
10806 """
10807 SetProportion(self, int proportion)
10808
10809 Set the proportion value for this item.
10810 """
5b5c9bc7 10811 return _core_.SizerItem_SetProportion(*args, **kwargs)
d55e5bfc
RD
10812
10813 def GetProportion(*args, **kwargs):
bfddbb17
RD
10814 """
10815 GetProportion(self) -> int
10816
10817 Get the proportion value for this item.
10818 """
5b5c9bc7 10819 return _core_.SizerItem_GetProportion(*args, **kwargs)
d55e5bfc 10820
bfddbb17
RD
10821 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10822 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 10823 def SetFlag(*args, **kwargs):
bfddbb17
RD
10824 """
10825 SetFlag(self, int flag)
10826
10827 Set the flag value for this item.
10828 """
5b5c9bc7 10829 return _core_.SizerItem_SetFlag(*args, **kwargs)
d55e5bfc
RD
10830
10831 def GetFlag(*args, **kwargs):
bfddbb17
RD
10832 """
10833 GetFlag(self) -> int
10834
10835 Get the flag value for this item.
10836 """
5b5c9bc7 10837 return _core_.SizerItem_GetFlag(*args, **kwargs)
d55e5bfc
RD
10838
10839 def SetBorder(*args, **kwargs):
bfddbb17
RD
10840 """
10841 SetBorder(self, int border)
10842
10843 Set the border value for this item.
10844 """
5b5c9bc7 10845 return _core_.SizerItem_SetBorder(*args, **kwargs)
d55e5bfc
RD
10846
10847 def GetBorder(*args, **kwargs):
bfddbb17
RD
10848 """
10849 GetBorder(self) -> int
10850
10851 Get the border value for this item.
10852 """
5b5c9bc7 10853 return _core_.SizerItem_GetBorder(*args, **kwargs)
d55e5bfc
RD
10854
10855 def GetWindow(*args, **kwargs):
bfddbb17 10856 """
5b5c9bc7 10857 GetWindow(self) -> Window
bfddbb17
RD
10858
10859 Get the window (if any) that is managed by this sizer item.
10860 """
5b5c9bc7 10861 return _core_.SizerItem_GetWindow(*args, **kwargs)
d55e5bfc
RD
10862
10863 def SetWindow(*args, **kwargs):
bfddbb17 10864 """
5b5c9bc7 10865 SetWindow(self, Window window)
bfddbb17
RD
10866
10867 Set the window to be managed by this sizer item.
10868 """
5b5c9bc7 10869 return _core_.SizerItem_SetWindow(*args, **kwargs)
d55e5bfc
RD
10870
10871 def GetSizer(*args, **kwargs):
bfddbb17 10872 """
5b5c9bc7 10873 GetSizer(self) -> Sizer
bfddbb17
RD
10874
10875 Get the subsizer (if any) that is managed by this sizer item.
10876 """
5b5c9bc7 10877 return _core_.SizerItem_GetSizer(*args, **kwargs)
d55e5bfc
RD
10878
10879 def SetSizer(*args, **kwargs):
bfddbb17 10880 """
5b5c9bc7 10881 SetSizer(self, Sizer sizer)
bfddbb17
RD
10882
10883 Set the subsizer to be managed by this sizer item.
10884 """
5b5c9bc7 10885 return _core_.SizerItem_SetSizer(*args, **kwargs)
d55e5bfc
RD
10886
10887 def GetSpacer(*args, **kwargs):
bfddbb17 10888 """
5b5c9bc7 10889 GetSpacer(self) -> Size
bfddbb17
RD
10890
10891 Get the size of the spacer managed by this sizer item.
10892 """
5b5c9bc7 10893 return _core_.SizerItem_GetSpacer(*args, **kwargs)
d55e5bfc
RD
10894
10895 def SetSpacer(*args, **kwargs):
bfddbb17 10896 """
5b5c9bc7 10897 SetSpacer(self, Size size)
bfddbb17
RD
10898
10899 Set the size of the spacer to be managed by this sizer item.
10900 """
5b5c9bc7 10901 return _core_.SizerItem_SetSpacer(*args, **kwargs)
d55e5bfc
RD
10902
10903 def Show(*args, **kwargs):
bfddbb17
RD
10904 """
10905 Show(self, bool show)
10906
10907 Set the show item attribute, which sizers use to determine if the item
10908 is to be made part of the layout or not. If the item is tracking a
10909 window then it is shown or hidden as needed.
10910 """
5b5c9bc7 10911 return _core_.SizerItem_Show(*args, **kwargs)
d55e5bfc
RD
10912
10913 def IsShown(*args, **kwargs):
bfddbb17
RD
10914 """
10915 IsShown(self) -> bool
10916
10917 Is the item to be shown in the layout?
10918 """
5b5c9bc7 10919 return _core_.SizerItem_IsShown(*args, **kwargs)
d55e5bfc
RD
10920
10921 def GetPosition(*args, **kwargs):
bfddbb17 10922 """
5b5c9bc7 10923 GetPosition(self) -> Point
bfddbb17
RD
10924
10925 Returns the current position of the item, as set in the last Layout.
10926 """
5b5c9bc7 10927 return _core_.SizerItem_GetPosition(*args, **kwargs)
d55e5bfc
RD
10928
10929 def GetUserData(*args, **kwargs):
bfddbb17
RD
10930 """
10931 GetUserData(self) -> PyObject
10932
10933 Returns the userData associated with this sizer item, or None if there
10934 isn't any.
10935 """
5b5c9bc7 10936 return _core_.SizerItem_GetUserData(*args, **kwargs)
d55e5bfc 10937
32fe5131
RD
10938 def SetUserData(*args, **kwargs):
10939 """
10940 SetUserData(self, PyObject userData)
10941
10942 Associate a Python object with this sizer item.
10943 """
10944 return _core_.SizerItem_SetUserData(*args, **kwargs)
10945
2131d850 10946_core_.SizerItem_swigregister(SizerItem)
d55e5bfc 10947
bfddbb17 10948def SizerItemWindow(*args, **kwargs):
d55e5bfc 10949 """
5b5c9bc7
RD
10950 SizerItemWindow(Window window, int proportion, int flag, int border,
10951 PyObject userData=None) -> SizerItem
bfddbb17
RD
10952
10953 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 10954 """
5b5c9bc7 10955 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
10956 return val
10957
bfddbb17 10958def SizerItemSpacer(*args, **kwargs):
d55e5bfc 10959 """
bfddbb17 10960 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
5b5c9bc7 10961 PyObject userData=None) -> SizerItem
bfddbb17
RD
10962
10963 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 10964 """
5b5c9bc7 10965 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
10966 return val
10967
10968def SizerItemSizer(*args, **kwargs):
10969 """
5b5c9bc7
RD
10970 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
10971 PyObject userData=None) -> SizerItem
bfddbb17
RD
10972
10973 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc 10974 """
5b5c9bc7 10975 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
10976 return val
10977
5b5c9bc7 10978class Sizer(Object):
bfddbb17
RD
10979 """
10980 wx.Sizer is the abstract base class used for laying out subwindows in
10981 a window. You cannot use wx.Sizer directly; instead, you will have to
10982 use one of the sizer classes derived from it such as `wx.BoxSizer`,
10983 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
10984 and `wx.GridBagSizer`.
10985
10986 The concept implemented by sizers in wxWidgets is closely related to
10987 layout tools in other GUI toolkits, such as Java's AWT, the GTK
10988 toolkit or the Qt toolkit. It is based upon the idea of the individual
10989 subwindows reporting their minimal required size and their ability to
10990 get stretched if the size of the parent window has changed. This will
10991 most often mean that the programmer does not set the original size of
10992 a dialog in the beginning, rather the dialog will assigned a sizer and
10993 this sizer will be queried about the recommended size. The sizer in
10994 turn will query its children, which can be normal windows or contorls,
10995 empty space or other sizers, so that a hierarchy of sizers can be
10996 constructed. Note that wxSizer does not derive from wxWindow and thus
10997 do not interfere with tab ordering and requires very little resources
10998 compared to a real window on screen.
10999
11000 What makes sizers so well fitted for use in wxWidgets is the fact that
11001 every control reports its own minimal size and the algorithm can
11002 handle differences in font sizes or different window (dialog item)
11003 sizes on different platforms without problems. If for example the
11004 standard font as well as the overall design of Mac widgets requires
11005 more space than on Windows, then the initial size of a dialog using a
11006 sizer will automatically be bigger on Mac than on Windows.
11007 """
1bd55598
RD
11008 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11009 def __init__(self): raise AttributeError, "No constructor defined"
11010 __repr__ = _swig_repr
11011 __swig_destroy__ = _core_.delete_Sizer
11012 __del__ = lambda self : None;
d55e5bfc
RD
11013 def _setOORInfo(*args, **kwargs):
11014 """_setOORInfo(self, PyObject _self)"""
5b5c9bc7 11015 return _core_.Sizer__setOORInfo(*args, **kwargs)
d55e5bfc
RD
11016
11017 def Add(*args, **kwargs):
11018 """
bfddbb17 11019 Add(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11020 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11021
11022 Appends a child item to the sizer.
d55e5bfc 11023 """
5b5c9bc7 11024 return _core_.Sizer_Add(*args, **kwargs)
d55e5bfc
RD
11025
11026 def Insert(*args, **kwargs):
11027 """
bfddbb17 11028 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
070c48b4 11029 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11030
11031 Inserts a new item into the list of items managed by this sizer before
11032 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc 11033 """
5b5c9bc7 11034 return _core_.Sizer_Insert(*args, **kwargs)
d55e5bfc
RD
11035
11036 def Prepend(*args, **kwargs):
11037 """
bfddbb17 11038 Prepend(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11039 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11040
11041 Adds a new item to the begining of the list of sizer items managed by
11042 this sizer. See `Add` for a description of the parameters.
d55e5bfc 11043 """
5b5c9bc7 11044 return _core_.Sizer_Prepend(*args, **kwargs)
d55e5bfc
RD
11045
11046 def Remove(*args, **kwargs):
bfddbb17
RD
11047 """
11048 Remove(self, item) -> bool
11049
11050 Removes an item from the sizer and destroys it. This method does not
11051 cause any layout or resizing to take place, call `Layout` to update
11052 the layout on screen after removing a child from the sizer. The
11053 *item* parameter can be either a window, a sizer, or the zero-based
11054 index of an item to remove. Returns True if the child item was found
11055 and removed.
11056 """
5b5c9bc7 11057 return _core_.Sizer_Remove(*args, **kwargs)
d55e5bfc 11058
1a6bba1e 11059 def Detach(*args, **kwargs):
bfddbb17
RD
11060 """
11061 Detach(self, item) -> bool
11062
11063 Detaches an item from the sizer without destroying it. This method
11064 does not cause any layout or resizing to take place, call `Layout` to
11065 do so. The *item* parameter can be either a window, a sizer, or the
11066 zero-based index of the item to be detached. Returns True if the child item
11067 was found and detached.
11068 """
5b5c9bc7 11069 return _core_.Sizer_Detach(*args, **kwargs)
1a6bba1e 11070
070c48b4
RD
11071 def GetItem(*args, **kwargs):
11072 """
11073 GetItem(self, item) -> wx.SizerItem
11074
11075 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11076 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11077 the item to be found.
070c48b4 11078 """
5b5c9bc7 11079 return _core_.Sizer_GetItem(*args, **kwargs)
070c48b4 11080
d55e5bfc 11081 def _SetItemMinSize(*args, **kwargs):
5b5c9bc7
RD
11082 """_SetItemMinSize(self, PyObject item, Size size)"""
11083 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
d55e5bfc 11084
bfddbb17
RD
11085 def SetItemMinSize(self, item, *args):
11086 """
11087 SetItemMinSize(self, item, Size size)
11088
11089 Sets the minimum size that will be allocated for an item in the sizer.
11090 The *item* parameter can be either a window, a sizer, or the
11091 zero-based index of the item. If a window or sizer is given then it
11092 will be searched for recursivly in subsizers if neccessary.
11093 """
11094 if len(args) == 2:
11095 # for backward compatibility accept separate width,height args too
11096 return self._SetItemMinSize(item, args)
11097 else:
11098 return self._SetItemMinSize(item, args[0])
11099
d55e5bfc 11100 def AddItem(*args, **kwargs):
bfddbb17
RD
11101 """
11102 AddItem(self, SizerItem item)
11103
11104 Adds a `wx.SizerItem` to the sizer.
11105 """
5b5c9bc7 11106 return _core_.Sizer_AddItem(*args, **kwargs)
d55e5bfc
RD
11107
11108 def InsertItem(*args, **kwargs):
bfddbb17
RD
11109 """
11110 InsertItem(self, int index, SizerItem item)
11111
11112 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11113 """
5b5c9bc7 11114 return _core_.Sizer_InsertItem(*args, **kwargs)
d55e5bfc
RD
11115
11116 def PrependItem(*args, **kwargs):
bfddbb17
RD
11117 """
11118 PrependItem(self, SizerItem item)
11119
11120 Prepends a `wx.SizerItem` to the sizer.
11121 """
5b5c9bc7 11122 return _core_.Sizer_PrependItem(*args, **kwargs)
d55e5bfc 11123
bfddbb17 11124 def AddMany(self, items):
d6c14a4c
RD
11125 """
11126 AddMany is a convenience method for adding several items
11127 to a sizer at one time. Simply pass it a list of tuples,
11128 where each tuple consists of the parameters that you
11129 would normally pass to the `Add` method.
11130 """
bfddbb17
RD
11131 for item in items:
11132 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11133 item = (item, )
11134 self.Add(*item)
d55e5bfc
RD
11135
11136 # for backwards compatibility only, please do not use in new code
7fbf8399
RD
11137 def AddWindow(self, *args, **kw):
11138 """Compatibility alias for `Add`."""
11139 return self.Add(*args, **kw)
11140 def AddSizer(self, *args, **kw):
11141 """Compatibility alias for `Add`."""
11142 return self.Add(*args, **kw)
11143 def AddSpacer(self, *args, **kw):
11144 """Compatibility alias for `Add`."""
11145 return self.Add(*args, **kw)
11146
11147 def PrependWindow(self, *args, **kw):
11148 """Compatibility alias for `Prepend`."""
11149 return self.Prepend(*args, **kw)
11150 def PrependSizer(self, *args, **kw):
11151 """Compatibility alias for `Prepend`."""
11152 return self.Prepend(*args, **kw)
11153 def PrependSpacer(self, *args, **kw):
11154 """Compatibility alias for `Prepend`."""
11155 return self.Prepend(*args, **kw)
11156
11157 def InsertWindow(self, *args, **kw):
11158 """Compatibility alias for `Insert`."""
11159 return self.Insert(*args, **kw)
11160 def InsertSizer(self, *args, **kw):
11161 """Compatibility alias for `Insert`."""
11162 return self.Insert(*args, **kw)
11163 def InsertSpacer(self, *args, **kw):
11164 """Compatibility alias for `Insert`."""
11165 return self.Insert(*args, **kw)
11166
11167 def RemoveWindow(self, *args, **kw):
11168 """Compatibility alias for `Remove`."""
11169 return self.Remove(*args, **kw)
11170 def RemoveSizer(self, *args, **kw):
11171 """Compatibility alias for `Remove`."""
11172 return self.Remove(*args, **kw)
11173 def RemovePos(self, *args, **kw):
11174 """Compatibility alias for `Remove`."""
11175 return self.Remove(*args, **kw)
d55e5bfc
RD
11176
11177
d55e5bfc 11178 def SetDimension(*args, **kwargs):
bfddbb17
RD
11179 """
11180 SetDimension(self, int x, int y, int width, int height)
11181
11182 Call this to force the sizer to take the given dimension and thus
11183 force the items owned by the sizer to resize themselves according to
11184 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11185 methods.
11186 """
5b5c9bc7 11187 return _core_.Sizer_SetDimension(*args, **kwargs)
d55e5bfc
RD
11188
11189 def SetMinSize(*args, **kwargs):
bfddbb17 11190 """
5b5c9bc7 11191 SetMinSize(self, Size size)
bfddbb17
RD
11192
11193 Call this to give the sizer a minimal size. Normally, the sizer will
11194 calculate its minimal size based purely on how much space its children
11195 need. After calling this method `GetMinSize` will return either the
11196 minimal size as requested by its children or the minimal size set
11197 here, depending on which is bigger.
11198 """
5b5c9bc7 11199 return _core_.Sizer_SetMinSize(*args, **kwargs)
d55e5bfc
RD
11200
11201 def GetSize(*args, **kwargs):
bfddbb17 11202 """
5b5c9bc7 11203 GetSize(self) -> Size
bfddbb17
RD
11204
11205 Returns the current size of the space managed by the sizer.
11206 """
5b5c9bc7 11207 return _core_.Sizer_GetSize(*args, **kwargs)
d55e5bfc
RD
11208
11209 def GetPosition(*args, **kwargs):
bfddbb17 11210 """
5b5c9bc7 11211 GetPosition(self) -> Point
bfddbb17
RD
11212
11213 Returns the current position of the sizer's managed space.
11214 """
5b5c9bc7 11215 return _core_.Sizer_GetPosition(*args, **kwargs)
d55e5bfc
RD
11216
11217 def GetMinSize(*args, **kwargs):
bfddbb17 11218 """
5b5c9bc7 11219 GetMinSize(self) -> Size
bfddbb17
RD
11220
11221 Returns the minimal size of the sizer. This is either the combined
11222 minimal size of all the children and their borders or the minimal size
11223 set by SetMinSize, depending on which is bigger.
11224 """
5b5c9bc7 11225 return _core_.Sizer_GetMinSize(*args, **kwargs)
d55e5bfc
RD
11226
11227 def GetSizeTuple(self):
1a6bba1e 11228 return self.GetSize().Get()
d55e5bfc 11229 def GetPositionTuple(self):
1a6bba1e 11230 return self.GetPosition().Get()
d55e5bfc 11231 def GetMinSizeTuple(self):
1a6bba1e 11232 return self.GetMinSize().Get()
d55e5bfc
RD
11233
11234 def RecalcSizes(*args, **kwargs):
bfddbb17
RD
11235 """
11236 RecalcSizes(self)
11237
11238 Using the sizes calculated by `CalcMin` reposition and resize all the
11239 items managed by this sizer. You should not need to call this directly as
11240 it is called by `Layout`.
11241 """
5b5c9bc7 11242 return _core_.Sizer_RecalcSizes(*args, **kwargs)
d55e5bfc
RD
11243
11244 def CalcMin(*args, **kwargs):
bfddbb17 11245 """
5b5c9bc7 11246 CalcMin(self) -> Size
bfddbb17
RD
11247
11248 This method is where the sizer will do the actual calculation of its
11249 children's minimal sizes. You should not need to call this directly as
11250 it is called by `Layout`.
11251 """
5b5c9bc7 11252 return _core_.Sizer_CalcMin(*args, **kwargs)
d55e5bfc
RD
11253
11254 def Layout(*args, **kwargs):
bfddbb17
RD
11255 """
11256 Layout(self)
11257
11258 This method will force the recalculation and layout of the items
11259 controlled by the sizer using the current space allocated to the
11260 sizer. Normally this is called automatically from the owning window's
11261 EVT_SIZE handler, but it is also useful to call it from user code when
11262 one of the items in a sizer change size, or items are added or
11263 removed.
11264 """
5b5c9bc7 11265 return _core_.Sizer_Layout(*args, **kwargs)
d55e5bfc
RD
11266
11267 def Fit(*args, **kwargs):
bfddbb17 11268 """
5b5c9bc7 11269 Fit(self, Window window) -> Size
bfddbb17
RD
11270
11271 Tell the sizer to resize the *window* to match the sizer's minimal
11272 size. This is commonly done in the constructor of the window itself in
11273 order to set its initial size to match the needs of the children as
11274 determined by the sizer. Returns the new size.
11275
11276 For a top level window this is the total window size, not the client size.
11277 """
5b5c9bc7 11278 return _core_.Sizer_Fit(*args, **kwargs)
d55e5bfc
RD
11279
11280 def FitInside(*args, **kwargs):
bfddbb17 11281 """
5b5c9bc7 11282 FitInside(self, Window window)
bfddbb17
RD
11283
11284 Tell the sizer to resize the *virtual size* of the *window* to match the
11285 sizer's minimal size. This will not alter the on screen size of the
11286 window, but may cause the addition/removal/alteration of scrollbars
11287 required to view the virtual area in windows which manage it.
11288
11289 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11290
11291 """
5b5c9bc7 11292 return _core_.Sizer_FitInside(*args, **kwargs)
d55e5bfc
RD
11293
11294 def SetSizeHints(*args, **kwargs):
bfddbb17 11295 """
5b5c9bc7 11296 SetSizeHints(self, Window window)
bfddbb17
RD
11297
11298 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11299 match the sizer's minimal size. This is commonly done in the
11300 constructor of the window itself if the window is resizable (as are
11301 many dialogs under Unix and frames on probably all platforms) in order
11302 to prevent the window from being sized smaller than the minimal size
11303 required by the sizer.
11304 """
5b5c9bc7 11305 return _core_.Sizer_SetSizeHints(*args, **kwargs)
d55e5bfc
RD
11306
11307 def SetVirtualSizeHints(*args, **kwargs):
bfddbb17 11308 """
5b5c9bc7 11309 SetVirtualSizeHints(self, Window window)
bfddbb17
RD
11310
11311 Tell the sizer to set the minimal size of the window virtual area to
11312 match the sizer's minimal size. For windows with managed scrollbars
11313 this will set them appropriately.
11314
11315 :see: `wx.ScrolledWindow.SetScrollbars`
11316
11317 """
5b5c9bc7 11318 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
d55e5bfc
RD
11319
11320 def Clear(*args, **kwargs):
bfddbb17
RD
11321 """
11322 Clear(self, bool deleteWindows=False)
11323
11324 Clear all items from the sizer, optionally destroying the window items
11325 as well.
11326 """
5b5c9bc7 11327 return _core_.Sizer_Clear(*args, **kwargs)
d55e5bfc
RD
11328
11329 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
11330 """
11331 DeleteWindows(self)
11332
11333 Destroy all windows managed by the sizer.
11334 """
5b5c9bc7 11335 return _core_.Sizer_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
11336
11337 def GetChildren(*args, **kwargs):
bfddbb17 11338 """
51b83b37 11339 GetChildren(self) -> list
bfddbb17
RD
11340
11341 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11342 """
5b5c9bc7 11343 return _core_.Sizer_GetChildren(*args, **kwargs)
d55e5bfc
RD
11344
11345 def Show(*args, **kwargs):
bfddbb17 11346 """
b411df4a 11347 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 11348
bfddbb17
RD
11349 Shows or hides an item managed by the sizer. To make a sizer item
11350 disappear or reappear, use Show followed by `Layout`. The *item*
11351 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
11352 the item. Use the recursive parameter to show or hide an item in a
11353 subsizer. Returns True if the item was found.
bfddbb17 11354 """
5b5c9bc7 11355 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
11356
11357 def IsShown(*args, **kwargs):
bfddbb17
RD
11358 """
11359 IsShown(self, item)
11360
b1fcee84 11361 Determines if the item is currently shown. To make a sizer
bfddbb17
RD
11362 item disappear or reappear, use Show followed by `Layout`. The *item*
11363 parameter can be either a window, a sizer, or the zero-based index of
11364 the item.
11365 """
5b5c9bc7 11366 return _core_.Sizer_IsShown(*args, **kwargs)
d55e5bfc 11367
629e65c2 11368 def Hide(self, item, recursive=False):
bfddbb17 11369 """
27fb7603 11370 A convenience method for `Show` (item, False, recursive).
bfddbb17 11371 """
06759a38 11372 return self.Show(item, False, recursive)
bfddbb17 11373
d55e5bfc 11374 def ShowItems(*args, **kwargs):
bfddbb17
RD
11375 """
11376 ShowItems(self, bool show)
11377
84f85550 11378 Recursively call `wx.SizerItem.Show` on all sizer items.
bfddbb17 11379 """
5b5c9bc7 11380 return _core_.Sizer_ShowItems(*args, **kwargs)
d55e5bfc 11381
2131d850 11382_core_.Sizer_swigregister(Sizer)
d55e5bfc 11383
5b5c9bc7 11384class PySizer(Sizer):
bfddbb17
RD
11385 """
11386 wx.PySizer is a special version of `wx.Sizer` that has been
11387 instrumented to allow the C++ virtual methods to be overloaded in
11388 Python derived classes. You would derive from this class if you are
11389 wanting to implement a custom sizer in Python code. Simply implement
11390 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11391 For example::
11392
11393 class MySizer(wx.PySizer):
11394 def __init__(self):
11395 wx.PySizer.__init__(self)
11396
11397 def CalcMin(self):
11398 for item in self.GetChildren():
11399 # calculate the total minimum width and height needed
11400 # by all items in the sizer according to this sizer's
11401 # layout algorithm.
11402 ...
11403 return wx.Size(width, height)
11404
11405 def RecalcSizes(self):
11406 # find the space allotted to this sizer
11407 pos = self.GetPosition()
11408 size = self.GetSize()
11409 for item in self.GetChildren():
11410 # Recalculate (if necessary) the position and size of
11411 # each item and then call item.SetDimension to do the
11412 # actual positioning and sizing of the items within the
11413 # space alloted to this sizer.
11414 ...
11415 item.SetDimension(itemPos, itemSize)
11416
11417
11418 When `Layout` is called it first calls `CalcMin` followed by
11419 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 11420 `CalcMin` and reusing them in `RecalcSizes`.
bfddbb17
RD
11421
11422 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11423
11424
11425 """
1bd55598
RD
11426 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11427 __repr__ = _swig_repr
11428 def __init__(self, *args, **kwargs):
bfddbb17 11429 """
5b5c9bc7 11430 __init__(self) -> PySizer
bfddbb17
RD
11431
11432 Creates a wx.PySizer. Must be called from the __init__ in the derived
11433 class.
11434 """
1bd55598 11435 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
d55e5bfc
RD
11436 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11437
11438 def _setCallbackInfo(*args, **kwargs):
11439 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 11440 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
d55e5bfc 11441
2131d850 11442_core_.PySizer_swigregister(PySizer)
d55e5bfc
RD
11443
11444#---------------------------------------------------------------------------
11445
5b5c9bc7 11446class BoxSizer(Sizer):
bfddbb17
RD
11447 """
11448 The basic idea behind a box sizer is that windows will most often be
11449 laid out in rather simple basic geometry, typically in a row or a
11450 column or nested hierarchies of either. A wx.BoxSizer will lay out
11451 its items in a simple row or column, depending on the orientation
11452 parameter passed to the constructor.
11453 """
1bd55598
RD
11454 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11455 __repr__ = _swig_repr
11456 def __init__(self, *args, **kwargs):
bfddbb17 11457 """
5b5c9bc7 11458 __init__(self, int orient=HORIZONTAL) -> BoxSizer
bfddbb17
RD
11459
11460 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11461 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11462 sizer.
11463 """
1bd55598 11464 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d55e5bfc
RD
11465 self._setOORInfo(self)
11466
11467 def GetOrientation(*args, **kwargs):
bfddbb17
RD
11468 """
11469 GetOrientation(self) -> int
11470
11471 Returns the current orientation of the sizer.
11472 """
5b5c9bc7 11473 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
d55e5bfc
RD
11474
11475 def SetOrientation(*args, **kwargs):
bfddbb17
RD
11476 """
11477 SetOrientation(self, int orient)
d55e5bfc 11478
bfddbb17
RD
11479 Resets the orientation of the sizer.
11480 """
5b5c9bc7 11481 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc 11482
2131d850 11483_core_.BoxSizer_swigregister(BoxSizer)
d55e5bfc
RD
11484
11485#---------------------------------------------------------------------------
11486
5b5c9bc7 11487class StaticBoxSizer(BoxSizer):
bfddbb17
RD
11488 """
11489 wx.StaticBoxSizer derives from and functions identically to the
11490 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11491 manages. Note that this static box must be created separately and
11492 passed to the sizer constructor.
11493 """
1bd55598
RD
11494 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11495 __repr__ = _swig_repr
11496 def __init__(self, *args, **kwargs):
bfddbb17 11497 """
5b5c9bc7 11498 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
bfddbb17
RD
11499
11500 Constructor. It takes an associated static box and the orientation
11501 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11502 ``wx.HORIZONTAL``.
11503 """
1bd55598 11504 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d55e5bfc
RD
11505 self._setOORInfo(self)
11506
11507 def GetStaticBox(*args, **kwargs):
bfddbb17 11508 """
5b5c9bc7 11509 GetStaticBox(self) -> StaticBox
d55e5bfc 11510
bfddbb17
RD
11511 Returns the static box associated with this sizer.
11512 """
5b5c9bc7 11513 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc 11514
2131d850 11515_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d55e5bfc
RD
11516
11517#---------------------------------------------------------------------------
11518
5b5c9bc7 11519class GridSizer(Sizer):
bfddbb17
RD
11520 """
11521 A grid sizer is a sizer which lays out its children in a
11522 two-dimensional table with all cells having the same size. In other
11523 words, the width of each cell within the grid is the width of the
11524 widest item added to the sizer and the height of each grid cell is the
11525 height of the tallest item. An optional vertical and/or horizontal
11526 gap between items can also be specified (in pixels.)
11527
11528 Items are placed in the cells of the grid in the order they are added,
11529 in row-major order. In other words, the first row is filled first,
11530 then the second, and so on until all items have been added. (If
11531 neccessary, additional rows will be added as items are added.) If you
11532 need to have greater control over the cells that items are placed in
11533 then use the `wx.GridBagSizer`.
11534
11535 """
1bd55598
RD
11536 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11537 __repr__ = _swig_repr
11538 def __init__(self, *args, **kwargs):
bfddbb17 11539 """
5b5c9bc7 11540 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
bfddbb17
RD
11541
11542 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11543 of columns and rows in the sizer - if either of the parameters is
11544 zero, it will be calculated to from the total number of children in
11545 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11546 define extra space between all children.
11547 """
1bd55598 11548 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d55e5bfc
RD
11549 self._setOORInfo(self)
11550
d55e5bfc 11551 def SetCols(*args, **kwargs):
bfddbb17
RD
11552 """
11553 SetCols(self, int cols)
11554
11555 Sets the number of columns in the sizer.
11556 """
5b5c9bc7 11557 return _core_.GridSizer_SetCols(*args, **kwargs)
d55e5bfc
RD
11558
11559 def SetRows(*args, **kwargs):
bfddbb17
RD
11560 """
11561 SetRows(self, int rows)
11562
11563 Sets the number of rows in the sizer.
11564 """
5b5c9bc7 11565 return _core_.GridSizer_SetRows(*args, **kwargs)
d55e5bfc
RD
11566
11567 def SetVGap(*args, **kwargs):
bfddbb17
RD
11568 """
11569 SetVGap(self, int gap)
11570
11571 Sets the vertical gap (in pixels) between the cells in the sizer.
11572 """
5b5c9bc7 11573 return _core_.GridSizer_SetVGap(*args, **kwargs)
d55e5bfc
RD
11574
11575 def SetHGap(*args, **kwargs):
bfddbb17
RD
11576 """
11577 SetHGap(self, int gap)
11578
11579 Sets the horizontal gap (in pixels) between cells in the sizer
11580 """
5b5c9bc7 11581 return _core_.GridSizer_SetHGap(*args, **kwargs)
d55e5bfc
RD
11582
11583 def GetCols(*args, **kwargs):
bfddbb17
RD
11584 """
11585 GetCols(self) -> int
11586
11587 Returns the number of columns in the sizer.
11588 """
5b5c9bc7 11589 return _core_.GridSizer_GetCols(*args, **kwargs)
d55e5bfc
RD
11590
11591 def GetRows(*args, **kwargs):
bfddbb17
RD
11592 """
11593 GetRows(self) -> int
11594
11595 Returns the number of rows in the sizer.
11596 """
5b5c9bc7 11597 return _core_.GridSizer_GetRows(*args, **kwargs)
d55e5bfc
RD
11598
11599 def GetVGap(*args, **kwargs):
bfddbb17
RD
11600 """
11601 GetVGap(self) -> int
11602
11603 Returns the vertical gap (in pixels) between the cells in the sizer.
11604 """
5b5c9bc7 11605 return _core_.GridSizer_GetVGap(*args, **kwargs)
d55e5bfc
RD
11606
11607 def GetHGap(*args, **kwargs):
bfddbb17
RD
11608 """
11609 GetHGap(self) -> int
11610
11611 Returns the horizontal gap (in pixels) between cells in the sizer.
11612 """
5b5c9bc7 11613 return _core_.GridSizer_GetHGap(*args, **kwargs)
d55e5bfc 11614
1bd55598
RD
11615 def CalcRowsCols(self):
11616 """
11617 CalcRowsCols() -> (rows, cols)
11618
11619 Calculates how many rows and columns will be in the sizer based
11620 on the current number of items and also the rows, cols specified
11621 in the constructor.
11622 """
11623 nitems = len(self.GetChildren())
11624 rows = self.GetRows()
11625 cols = self.GetCols()
11626 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11627 if cols != 0:
11628 rows = (nitems + cols - 1) / cols
11629 elif rows != 0:
11630 cols = (nitems + rows - 1) / rows
11631 return (rows, cols)
d55e5bfc 11632
2131d850 11633_core_.GridSizer_swigregister(GridSizer)
d55e5bfc
RD
11634
11635#---------------------------------------------------------------------------
11636
5b5c9bc7
RD
11637FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11638FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11639FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11640class FlexGridSizer(GridSizer):
bfddbb17
RD
11641 """
11642 A flex grid sizer is a sizer which lays out its children in a
11643 two-dimensional table with all table cells in one row having the same
11644 height and all cells in one column having the same width, but all
11645 rows or all columns are not necessarily the same height or width as in
11646 the `wx.GridSizer`.
11647
11648 wx.FlexGridSizer can also size items equally in one direction but
11649 unequally ("flexibly") in the other. If the sizer is only flexible
11650 in one direction (this can be changed using `SetFlexibleDirection`), it
11651 needs to be decided how the sizer should grow in the other ("non
11652 flexible") direction in order to fill the available space. The
11653 `SetNonFlexibleGrowMode` method serves this purpose.
11654
11655
11656 """
1bd55598
RD
11657 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11658 __repr__ = _swig_repr
11659 def __init__(self, *args, **kwargs):
bfddbb17 11660 """
5b5c9bc7 11661 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
bfddbb17
RD
11662
11663 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11664 number of columns and rows in the sizer - if either of the parameters
11665 is zero, it will be calculated to from the total number of children in
11666 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11667 define extra space between all children.
11668 """
1bd55598 11669 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d55e5bfc
RD
11670 self._setOORInfo(self)
11671
bfddbb17
RD
11672 def AddGrowableRow(*args, **kwargs):
11673 """
11674 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 11675
bfddbb17
RD
11676 Specifies that row *idx* (starting from zero) should be grown if there
11677 is extra space available to the sizer.
d55e5bfc 11678
bfddbb17
RD
11679 The *proportion* parameter has the same meaning as the stretch factor
11680 for the box sizers except that if all proportions are 0, then all
11681 columns are resized equally (instead of not being resized at all).
11682 """
5b5c9bc7 11683 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
d55e5bfc
RD
11684
11685 def RemoveGrowableRow(*args, **kwargs):
bfddbb17
RD
11686 """
11687 RemoveGrowableRow(self, size_t idx)
11688
11689 Specifies that row *idx* is no longer growable.
11690 """
5b5c9bc7 11691 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
d55e5bfc
RD
11692
11693 def AddGrowableCol(*args, **kwargs):
bfddbb17
RD
11694 """
11695 AddGrowableCol(self, size_t idx, int proportion=0)
11696
11697 Specifies that column *idx* (starting from zero) should be grown if
11698 there is extra space available to the sizer.
11699
11700 The *proportion* parameter has the same meaning as the stretch factor
11701 for the box sizers except that if all proportions are 0, then all
11702 columns are resized equally (instead of not being resized at all).
11703 """
5b5c9bc7 11704 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
d55e5bfc
RD
11705
11706 def RemoveGrowableCol(*args, **kwargs):
bfddbb17
RD
11707 """
11708 RemoveGrowableCol(self, size_t idx)
11709
11710 Specifies that column *idx* is no longer growable.
11711 """
5b5c9bc7 11712 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
d55e5bfc
RD
11713
11714 def SetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
11715 """
11716 SetFlexibleDirection(self, int direction)
11717
11718 Specifies whether the sizer should flexibly resize its columns, rows,
11719 or both. Argument *direction* can be one of the following values. Any
11720 other value is ignored.
11721
11722 ============== =======================================
11723 wx.VERTICAL Rows are flexibly sized.
11724 wx.HORIZONTAL Columns are flexibly sized.
11725 wx.BOTH Both rows and columns are flexibly sized
11726 (this is the default value).
11727 ============== =======================================
11728
11729 Note that this method does not trigger relayout.
11730
11731 """
5b5c9bc7 11732 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
11733
11734 def GetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
11735 """
11736 GetFlexibleDirection(self) -> int
11737
11738 Returns a value that specifies whether the sizer
11739 flexibly resizes its columns, rows, or both (default).
11740
11741 :see: `SetFlexibleDirection`
11742 """
5b5c9bc7 11743 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
11744
11745 def SetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
11746 """
11747 SetNonFlexibleGrowMode(self, int mode)
11748
11749 Specifies how the sizer should grow in the non-flexible direction if
11750 there is one (so `SetFlexibleDirection` must have been called
11751 previously). Argument *mode* can be one of the following values:
11752
11753 ========================== =================================================
11754 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11755 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11756 `AddGrowableCol` and `AddGrowableRow`. In this
11757 case equal sizing applies to minimum sizes of
11758 columns or rows (this is the default value).
11759 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11760 the non flexible direction, whether they are
11761 growable or not in the flexbile direction.
11762 ========================== =================================================
11763
11764 Note that this method does not trigger relayout.
11765
11766
11767 """
5b5c9bc7 11768 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
11769
11770 def GetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
11771 """
11772 GetNonFlexibleGrowMode(self) -> int
11773
11774 Returns the value that specifies how the sizer grows in the
11775 non-flexible direction if there is one.
11776
11777 :see: `SetNonFlexibleGrowMode`
11778 """
5b5c9bc7 11779 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
11780
11781 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
11782 """
11783 GetRowHeights(self) -> list
11784
11785 Returns a list of integers representing the heights of each of the
11786 rows in the sizer.
11787 """
5b5c9bc7 11788 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
d55e5bfc
RD
11789
11790 def GetColWidths(*args, **kwargs):
fd2dc343
RD
11791 """
11792 GetColWidths(self) -> list
11793
11794 Returns a list of integers representing the widths of each of the
11795 columns in the sizer.
11796 """
5b5c9bc7 11797 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
d55e5bfc 11798
2131d850 11799_core_.FlexGridSizer_swigregister(FlexGridSizer)
d55e5bfc 11800
5b5c9bc7 11801class StdDialogButtonSizer(BoxSizer):
62d32a5f
RD
11802 """
11803 A special sizer that knows how to order and position standard buttons
11804 in order to conform to the current platform's standards. You simply
11805 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 11806 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
11807 will take care of the rest.
11808
11809 """
1bd55598
RD
11810 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11811 __repr__ = _swig_repr
11812 def __init__(self, *args, **kwargs):
5b5c9bc7 11813 """__init__(self) -> StdDialogButtonSizer"""
1bd55598 11814 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
62d32a5f
RD
11815 def AddButton(*args, **kwargs):
11816 """
11817 AddButton(self, wxButton button)
11818
11819 Use this to add the buttons to this sizer. Do not use the `Add`
11820 method in the base class.
11821 """
5b5c9bc7 11822 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
62d32a5f 11823
53aa7709 11824 def Realize(*args, **kwargs):
62d32a5f 11825 """
53aa7709 11826 Realize(self)
62d32a5f
RD
11827
11828 This funciton needs to be called after all the buttons have been added
11829 to the sizer. It will reorder them and position them in a platform
11830 specifc manner.
11831 """
5b5c9bc7 11832 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
11833
11834 def SetAffirmativeButton(*args, **kwargs):
11835 """SetAffirmativeButton(self, wxButton button)"""
5b5c9bc7 11836 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
51b83b37
RD
11837
11838 def SetNegativeButton(*args, **kwargs):
11839 """SetNegativeButton(self, wxButton button)"""
5b5c9bc7 11840 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
51b83b37
RD
11841
11842 def SetCancelButton(*args, **kwargs):
11843 """SetCancelButton(self, wxButton button)"""
5b5c9bc7 11844 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
11845
11846 def GetAffirmativeButton(*args, **kwargs):
11847 """GetAffirmativeButton(self) -> wxButton"""
5b5c9bc7 11848 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
62d32a5f
RD
11849
11850 def GetApplyButton(*args, **kwargs):
11851 """GetApplyButton(self) -> wxButton"""
5b5c9bc7 11852 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
62d32a5f
RD
11853
11854 def GetNegativeButton(*args, **kwargs):
11855 """GetNegativeButton(self) -> wxButton"""
5b5c9bc7 11856 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
62d32a5f
RD
11857
11858 def GetCancelButton(*args, **kwargs):
11859 """GetCancelButton(self) -> wxButton"""
5b5c9bc7 11860 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
62d32a5f
RD
11861
11862 def GetHelpButton(*args, **kwargs):
11863 """GetHelpButton(self) -> wxButton"""
5b5c9bc7 11864 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
62d32a5f 11865
2131d850 11866_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
62d32a5f 11867
d55e5bfc
RD
11868#---------------------------------------------------------------------------
11869
5b5c9bc7 11870class GBPosition(object):
bfddbb17
RD
11871 """
11872 This class represents the position of an item in a virtual grid of
11873 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11874 typemaps that will automatically convert from a 2-element sequence of
11875 integers to a wx.GBPosition, so you can use the more pythonic
11876 representation of the position nearly transparently in Python code.
11877 """
1bd55598
RD
11878 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11879 __repr__ = _swig_repr
11880 def __init__(self, *args, **kwargs):
bfddbb17 11881 """
5b5c9bc7 11882 __init__(self, int row=0, int col=0) -> GBPosition
bfddbb17
RD
11883
11884 This class represents the position of an item in a virtual grid of
11885 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11886 typemaps that will automatically convert from a 2-element sequence of
11887 integers to a wx.GBPosition, so you can use the more pythonic
11888 representation of the position nearly transparently in Python code.
11889 """
1bd55598
RD
11890 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11891 __swig_destroy__ = _core_.delete_GBPosition
11892 __del__ = lambda self : None;
d55e5bfc
RD
11893 def GetRow(*args, **kwargs):
11894 """GetRow(self) -> int"""
5b5c9bc7 11895 return _core_.GBPosition_GetRow(*args, **kwargs)
d55e5bfc
RD
11896
11897 def GetCol(*args, **kwargs):
11898 """GetCol(self) -> int"""
5b5c9bc7 11899 return _core_.GBPosition_GetCol(*args, **kwargs)
d55e5bfc
RD
11900
11901 def SetRow(*args, **kwargs):
11902 """SetRow(self, int row)"""
5b5c9bc7 11903 return _core_.GBPosition_SetRow(*args, **kwargs)
d55e5bfc
RD
11904
11905 def SetCol(*args, **kwargs):
11906 """SetCol(self, int col)"""
5b5c9bc7 11907 return _core_.GBPosition_SetCol(*args, **kwargs)
d55e5bfc
RD
11908
11909 def __eq__(*args, **kwargs):
e9d6f3a4
RD
11910 """
11911 __eq__(self, PyObject other) -> bool
11912
11913 Compare GBPosition for equality.
11914 """
5b5c9bc7 11915 return _core_.GBPosition___eq__(*args, **kwargs)
d55e5bfc
RD
11916
11917 def __ne__(*args, **kwargs):
e9d6f3a4
RD
11918 """
11919 __ne__(self, PyObject other) -> bool
11920
11921 Compare GBPosition for inequality.
11922 """
5b5c9bc7 11923 return _core_.GBPosition___ne__(*args, **kwargs)
d55e5bfc
RD
11924
11925 def Set(*args, **kwargs):
11926 """Set(self, int row=0, int col=0)"""
5b5c9bc7 11927 return _core_.GBPosition_Set(*args, **kwargs)
d55e5bfc
RD
11928
11929 def Get(*args, **kwargs):
11930 """Get(self) -> PyObject"""
5b5c9bc7 11931 return _core_.GBPosition_Get(*args, **kwargs)
d55e5bfc 11932
15817c7e 11933 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
11934 def __str__(self): return str(self.Get())
11935 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11936 def __len__(self): return len(self.Get())
11937 def __getitem__(self, index): return self.Get()[index]
11938 def __setitem__(self, index, val):
11939 if index == 0: self.SetRow(val)
11940 elif index == 1: self.SetCol(val)
11941 else: raise IndexError
11942 def __nonzero__(self): return self.Get() != (0,0)
11943 __safe_for_unpickling__ = True
11944 def __reduce__(self): return (wx.GBPosition, self.Get())
11945
11946 row = property(GetRow, SetRow)
11947 col = property(GetCol, SetCol)
11948
2131d850 11949_core_.GBPosition_swigregister(GBPosition)
d55e5bfc 11950
5b5c9bc7 11951class GBSpan(object):
bfddbb17
RD
11952 """
11953 This class is used to hold the row and column spanning attributes of
11954 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11955 automatically convert from a 2-element sequence of integers to a
11956 wx.GBSpan, so you can use the more pythonic representation of the span
11957 nearly transparently in Python code.
11958
11959 """
1bd55598
RD
11960 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11961 __repr__ = _swig_repr
11962 def __init__(self, *args, **kwargs):
bfddbb17 11963 """
5b5c9bc7 11964 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
bfddbb17
RD
11965
11966 Construct a new wxGBSpan, optionally setting the rowspan and
11967 colspan. The default is (1,1). (Meaning that the item occupies one
11968 cell in each direction.
11969 """
1bd55598
RD
11970 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
11971 __swig_destroy__ = _core_.delete_GBSpan
11972 __del__ = lambda self : None;
d55e5bfc
RD
11973 def GetRowspan(*args, **kwargs):
11974 """GetRowspan(self) -> int"""
5b5c9bc7 11975 return _core_.GBSpan_GetRowspan(*args, **kwargs)
d55e5bfc
RD
11976
11977 def GetColspan(*args, **kwargs):
11978 """GetColspan(self) -> int"""
5b5c9bc7 11979 return _core_.GBSpan_GetColspan(*args, **kwargs)
d55e5bfc
RD
11980
11981 def SetRowspan(*args, **kwargs):
11982 """SetRowspan(self, int rowspan)"""
5b5c9bc7 11983 return _core_.GBSpan_SetRowspan(*args, **kwargs)
d55e5bfc
RD
11984
11985 def SetColspan(*args, **kwargs):
11986 """SetColspan(self, int colspan)"""
5b5c9bc7 11987 return _core_.GBSpan_SetColspan(*args, **kwargs)
d55e5bfc
RD
11988
11989 def __eq__(*args, **kwargs):
e9d6f3a4
RD
11990 """
11991 __eq__(self, PyObject other) -> bool
11992
11993 Compare wxGBSpan for equality.
11994 """
5b5c9bc7 11995 return _core_.GBSpan___eq__(*args, **kwargs)
d55e5bfc
RD
11996
11997 def __ne__(*args, **kwargs):
e9d6f3a4
RD
11998 """
11999 __ne__(self, PyObject other) -> bool
12000
12001 Compare GBSpan for inequality.
12002 """
5b5c9bc7 12003 return _core_.GBSpan___ne__(*args, **kwargs)
d55e5bfc
RD
12004
12005 def Set(*args, **kwargs):
12006 """Set(self, int rowspan=1, int colspan=1)"""
5b5c9bc7 12007 return _core_.GBSpan_Set(*args, **kwargs)
d55e5bfc
RD
12008
12009 def Get(*args, **kwargs):
12010 """Get(self) -> PyObject"""
5b5c9bc7 12011 return _core_.GBSpan_Get(*args, **kwargs)
d55e5bfc 12012
15817c7e 12013 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12014 def __str__(self): return str(self.Get())
12015 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12016 def __len__(self): return len(self.Get())
12017 def __getitem__(self, index): return self.Get()[index]
12018 def __setitem__(self, index, val):
12019 if index == 0: self.SetRowspan(val)
12020 elif index == 1: self.SetColspan(val)
12021 else: raise IndexError
12022 def __nonzero__(self): return self.Get() != (0,0)
12023 __safe_for_unpickling__ = True
12024 def __reduce__(self): return (wx.GBSpan, self.Get())
12025
12026 rowspan = property(GetRowspan, SetRowspan)
12027 colspan = property(GetColspan, SetColspan)
12028
2131d850 12029_core_.GBSpan_swigregister(GBSpan)
d55e5bfc 12030
5b5c9bc7 12031class GBSizerItem(SizerItem):
bfddbb17
RD
12032 """
12033 The wx.GBSizerItem class is used to track the additional data about
12034 items in a `wx.GridBagSizer` such as the item's position in the grid
12035 and how many rows or columns it spans.
12036
12037 """
1bd55598
RD
12038 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12039 __repr__ = _swig_repr
12040 def __init__(self, *args, **kwargs):
bfddbb17 12041 """
5b5c9bc7 12042 __init__(self) -> GBSizerItem
bfddbb17
RD
12043
12044 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12045 size will need to be set, as well as a position and span before this
12046 item can be used in a Sizer.
12047
12048 You will probably never need to create a wx.GBSizerItem directly as they
12049 are created automatically when the sizer's Add method is called.
12050 """
1bd55598
RD
12051 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12052 __swig_destroy__ = _core_.delete_GBSizerItem
12053 __del__ = lambda self : None;
d55e5bfc 12054 def GetPos(*args, **kwargs):
bfddbb17 12055 """
5b5c9bc7 12056 GetPos(self) -> GBPosition
bfddbb17
RD
12057
12058 Get the grid position of the item
12059 """
5b5c9bc7 12060 return _core_.GBSizerItem_GetPos(*args, **kwargs)
d55e5bfc
RD
12061
12062 def GetPosTuple(self): return self.GetPos().Get()
12063 def GetSpan(*args, **kwargs):
bfddbb17 12064 """
5b5c9bc7 12065 GetSpan(self) -> GBSpan
bfddbb17
RD
12066
12067 Get the row and column spanning of the item
12068 """
5b5c9bc7 12069 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
d55e5bfc
RD
12070
12071 def GetSpanTuple(self): return self.GetSpan().Get()
12072 def SetPos(*args, **kwargs):
bfddbb17 12073 """
5b5c9bc7 12074 SetPos(self, GBPosition pos) -> bool
bfddbb17
RD
12075
12076 If the item is already a member of a sizer then first ensure that
12077 there is no other item that would intersect with this one at the new
12078 position, then set the new position. Returns True if the change is
12079 successful and after the next Layout() the item will be moved.
12080 """
5b5c9bc7 12081 return _core_.GBSizerItem_SetPos(*args, **kwargs)
d55e5bfc
RD
12082
12083 def SetSpan(*args, **kwargs):
bfddbb17 12084 """
5b5c9bc7 12085 SetSpan(self, GBSpan span) -> bool
bfddbb17
RD
12086
12087 If the item is already a member of a sizer then first ensure that
12088 there is no other item that would intersect with this one with its new
12089 spanning size, then set the new spanning. Returns True if the change
12090 is successful and after the next Layout() the item will be resized.
12091
12092 """
5b5c9bc7 12093 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
d55e5bfc 12094
bfddbb17 12095 def Intersects(*args, **kwargs):
d55e5bfc 12096 """
5b5c9bc7 12097 Intersects(self, GBSizerItem other) -> bool
bfddbb17
RD
12098
12099 Returns True if this item and the other item instersect.
d55e5bfc 12100 """
5b5c9bc7 12101 return _core_.GBSizerItem_Intersects(*args, **kwargs)
bfddbb17
RD
12102
12103 def IntersectsPos(*args, **kwargs):
12104 """
5b5c9bc7 12105 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
bfddbb17
RD
12106
12107 Returns True if the given pos/span would intersect with this item.
12108 """
5b5c9bc7 12109 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
12110
12111 def GetEndPos(*args, **kwargs):
bfddbb17 12112 """
5b5c9bc7 12113 GetEndPos(self) -> GBPosition
bfddbb17
RD
12114
12115 Get the row and column of the endpoint of this item.
12116 """
5b5c9bc7 12117 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
d55e5bfc
RD
12118
12119 def GetGBSizer(*args, **kwargs):
bfddbb17 12120 """
5b5c9bc7 12121 GetGBSizer(self) -> GridBagSizer
bfddbb17
RD
12122
12123 Get the sizer this item is a member of.
12124 """
5b5c9bc7 12125 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
d55e5bfc
RD
12126
12127 def SetGBSizer(*args, **kwargs):
bfddbb17 12128 """
5b5c9bc7 12129 SetGBSizer(self, GridBagSizer sizer)
bfddbb17
RD
12130
12131 Set the sizer this item is a member of.
12132 """
5b5c9bc7 12133 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
d55e5bfc 12134
2131d850 12135_core_.GBSizerItem_swigregister(GBSizerItem)
5b5c9bc7 12136DefaultSpan = cvar.DefaultSpan
d55e5bfc
RD
12137
12138def GBSizerItemWindow(*args, **kwargs):
12139 """
5b5c9bc7
RD
12140 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12141 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12142
12143 Construct a `wx.GBSizerItem` for a window.
d55e5bfc 12144 """
5b5c9bc7 12145 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12146 return val
12147
12148def GBSizerItemSizer(*args, **kwargs):
12149 """
5b5c9bc7
RD
12150 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12151 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12152
12153 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc 12154 """
5b5c9bc7 12155 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12156 return val
12157
12158def GBSizerItemSpacer(*args, **kwargs):
12159 """
5b5c9bc7
RD
12160 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12161 int flag, int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12162
12163 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc 12164 """
5b5c9bc7 12165 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12166 return val
12167
5b5c9bc7 12168class GridBagSizer(FlexGridSizer):
bfddbb17
RD
12169 """
12170 A `wx.Sizer` that can lay out items in a virtual grid like a
12171 `wx.FlexGridSizer` but in this case explicit positioning of the items
12172 is allowed using `wx.GBPosition`, and items can optionally span more
12173 than one row and/or column using `wx.GBSpan`. The total size of the
12174 virtual grid is determined by the largest row and column that items are
12175 positioned at, adjusted for spanning.
12176
12177 """
1bd55598
RD
12178 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12179 __repr__ = _swig_repr
12180 def __init__(self, *args, **kwargs):
bfddbb17 12181 """
5b5c9bc7 12182 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
bfddbb17
RD
12183
12184 Constructor, with optional parameters to specify the gap between the
12185 rows and columns.
12186 """
1bd55598 12187 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
03e46024
RD
12188 self._setOORInfo(self)
12189
d55e5bfc
RD
12190 def Add(*args, **kwargs):
12191 """
bfddbb17 12192 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
070c48b4 12193 int border=0, userData=None) -> wx.GBSizerItem
bfddbb17
RD
12194
12195 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12196 more than one row or column as specified with *span*. The remaining
12197 args behave similarly to `wx.Sizer.Add`.
12198
12199 Returns True if the item was successfully placed at the given cell
12200 position, False if something was already there.
12201
d55e5bfc 12202 """
5b5c9bc7 12203 return _core_.GridBagSizer_Add(*args, **kwargs)
d55e5bfc
RD
12204
12205 def AddItem(*args, **kwargs):
bfddbb17 12206 """
070c48b4 12207 Add(self, GBSizerItem item) -> wx.GBSizerItem
bfddbb17
RD
12208
12209 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12210 the item was successfully placed at its given cell position, False if
12211 something was already there.
12212 """
5b5c9bc7 12213 return _core_.GridBagSizer_AddItem(*args, **kwargs)
d55e5bfc 12214
84f85550
RD
12215 def GetCellSize(*args, **kwargs):
12216 """
5b5c9bc7 12217 GetCellSize(self, int row, int col) -> Size
84f85550
RD
12218
12219 Get the size of the specified cell, including hgap and
12220 vgap. Only valid after a Layout.
12221 """
5b5c9bc7 12222 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
84f85550 12223
d55e5bfc 12224 def GetEmptyCellSize(*args, **kwargs):
bfddbb17 12225 """
5b5c9bc7 12226 GetEmptyCellSize(self) -> Size
bfddbb17
RD
12227
12228 Get the size used for cells in the grid with no item.
12229 """
5b5c9bc7 12230 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12231
12232 def SetEmptyCellSize(*args, **kwargs):
bfddbb17 12233 """
5b5c9bc7 12234 SetEmptyCellSize(self, Size sz)
bfddbb17
RD
12235
12236 Set the size used for cells in the grid with no item.
12237 """
5b5c9bc7 12238 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12239
12240 def GetItemPosition(*args):
12241 """
bfddbb17
RD
12242 GetItemPosition(self, item) -> GBPosition
12243
12244 Get the grid position of the specified *item* where *item* is either a
12245 window or subsizer that is a member of this sizer, or a zero-based
12246 index of an item.
d55e5bfc 12247 """
5b5c9bc7 12248 return _core_.GridBagSizer_GetItemPosition(*args)
d55e5bfc
RD
12249
12250 def SetItemPosition(*args):
12251 """
bfddbb17
RD
12252 SetItemPosition(self, item, GBPosition pos) -> bool
12253
12254 Set the grid position of the specified *item* where *item* is either a
12255 window or subsizer that is a member of this sizer, or a zero-based
12256 index of an item. Returns True on success. If the move is not
12257 allowed (because an item is already there) then False is returned.
12258
d55e5bfc 12259 """
5b5c9bc7 12260 return _core_.GridBagSizer_SetItemPosition(*args)
d55e5bfc
RD
12261
12262 def GetItemSpan(*args):
12263 """
bfddbb17
RD
12264 GetItemSpan(self, item) -> GBSpan
12265
12266 Get the row/col spanning of the specified *item* where *item* is
12267 either a window or subsizer that is a member of this sizer, or a
12268 zero-based index of an item.
d55e5bfc 12269 """
5b5c9bc7 12270 return _core_.GridBagSizer_GetItemSpan(*args)
d55e5bfc
RD
12271
12272 def SetItemSpan(*args):
12273 """
bfddbb17
RD
12274 SetItemSpan(self, item, GBSpan span) -> bool
12275
12276 Set the row/col spanning of the specified *item* where *item* is
12277 either a window or subsizer that is a member of this sizer, or a
12278 zero-based index of an item. Returns True on success. If the move is
12279 not allowed (because an item is already there) then False is returned.
d55e5bfc 12280 """
5b5c9bc7 12281 return _core_.GridBagSizer_SetItemSpan(*args)
d55e5bfc
RD
12282
12283 def FindItem(*args):
12284 """
bfddbb17
RD
12285 FindItem(self, item) -> GBSizerItem
12286
12287 Find the sizer item for the given window or subsizer, returns None if
12288 not found. (non-recursive)
d55e5bfc 12289 """
5b5c9bc7 12290 return _core_.GridBagSizer_FindItem(*args)
d55e5bfc
RD
12291
12292 def FindItemAtPosition(*args, **kwargs):
bfddbb17 12293 """
5b5c9bc7 12294 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
bfddbb17
RD
12295
12296 Return the sizer item for the given grid cell, or None if there is no
12297 item at that position. (non-recursive)
12298 """
5b5c9bc7 12299 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
d55e5bfc
RD
12300
12301 def FindItemAtPoint(*args, **kwargs):
bfddbb17 12302 """
5b5c9bc7 12303 FindItemAtPoint(self, Point pt) -> GBSizerItem
bfddbb17
RD
12304
12305 Return the sizer item located at the point given in *pt*, or None if
12306 there is no item at that point. The (x,y) coordinates in pt correspond
12307 to the client coordinates of the window using the sizer for
12308 layout. (non-recursive)
12309 """
5b5c9bc7 12310 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
d55e5bfc 12311
bfddbb17
RD
12312 def CheckForIntersection(*args, **kwargs):
12313 """
5b5c9bc7 12314 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 12315
bfddbb17
RD
12316 Look at all items and see if any intersect (or would overlap) the
12317 given *item*. Returns True if so, False if there would be no overlap.
12318 If an *excludeItem* is given then it will not be checked for
12319 intersection, for example it may be the item we are checking the
12320 position of.
d55e5bfc 12321
bfddbb17 12322 """
5b5c9bc7 12323 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 12324
bfddbb17 12325 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 12326 """
5b5c9bc7 12327 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
bfddbb17
RD
12328
12329 Look at all items and see if any intersect (or would overlap) the
12330 given position and span. Returns True if so, False if there would be
12331 no overlap. If an *excludeItem* is given then it will not be checked
12332 for intersection, for example it may be the item we are checking the
12333 position of.
d55e5bfc 12334 """
5b5c9bc7 12335 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc 12336
2131d850 12337_core_.GridBagSizer_swigregister(GridBagSizer)
d55e5bfc
RD
12338
12339#---------------------------------------------------------------------------
12340
5b5c9bc7
RD
12341Left = _core_.Left
12342Top = _core_.Top
12343Right = _core_.Right
12344Bottom = _core_.Bottom
12345Width = _core_.Width
12346Height = _core_.Height
12347Centre = _core_.Centre
12348Center = _core_.Center
12349CentreX = _core_.CentreX
12350CentreY = _core_.CentreY
12351Unconstrained = _core_.Unconstrained
12352AsIs = _core_.AsIs
12353PercentOf = _core_.PercentOf
12354Above = _core_.Above
12355Below = _core_.Below
12356LeftOf = _core_.LeftOf
12357RightOf = _core_.RightOf
12358SameAs = _core_.SameAs
12359Absolute = _core_.Absolute
12360class IndividualLayoutConstraint(Object):
d55e5bfc 12361 """
15817c7e
RD
12362 Objects of this class are stored in the `wx.LayoutConstraints` class as
12363 one of eight possible constraints that a window can be involved in.
12364 You will never need to create an instance of
12365 wx.IndividualLayoutConstraint, rather you should create a
12366 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 12367 that it contains.
d55e5bfc 12368 """
1bd55598
RD
12369 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12370 def __init__(self): raise AttributeError, "No constructor defined"
12371 __repr__ = _swig_repr
d55e5bfc 12372 def Set(*args, **kwargs):
15817c7e 12373 """
5b5c9bc7 12374 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
15817c7e
RD
12375
12376 Sets the properties of the constraint. Normally called by one of the
12377 convenience functions such as Above, RightOf, SameAs.
12378 """
5b5c9bc7 12379 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
d55e5bfc
RD
12380
12381 def LeftOf(*args, **kwargs):
12382 """
5b5c9bc7 12383 LeftOf(self, Window sibling, int marg=0)
d55e5bfc 12384
15817c7e
RD
12385 Constrains this edge to be to the left of the given window, with an
12386 optional margin. Implicitly, this is relative to the left edge of the
12387 other window.
d55e5bfc 12388 """
5b5c9bc7 12389 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
d55e5bfc
RD
12390
12391 def RightOf(*args, **kwargs):
12392 """
5b5c9bc7 12393 RightOf(self, Window sibling, int marg=0)
d55e5bfc 12394
15817c7e
RD
12395 Constrains this edge to be to the right of the given window, with an
12396 optional margin. Implicitly, this is relative to the right edge of the
12397 other window.
d55e5bfc 12398 """
5b5c9bc7 12399 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
d55e5bfc
RD
12400
12401 def Above(*args, **kwargs):
12402 """
5b5c9bc7 12403 Above(self, Window sibling, int marg=0)
d55e5bfc 12404
15817c7e
RD
12405 Constrains this edge to be above the given window, with an optional
12406 margin. Implicitly, this is relative to the top edge of the other
12407 window.
d55e5bfc 12408 """
5b5c9bc7 12409 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
d55e5bfc
RD
12410
12411 def Below(*args, **kwargs):
12412 """
5b5c9bc7 12413 Below(self, Window sibling, int marg=0)
d55e5bfc 12414
15817c7e
RD
12415 Constrains this edge to be below the given window, with an optional
12416 margin. Implicitly, this is relative to the bottom edge of the other
12417 window.
d55e5bfc 12418 """
5b5c9bc7 12419 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
d55e5bfc
RD
12420
12421 def SameAs(*args, **kwargs):
12422 """
5b5c9bc7 12423 SameAs(self, Window otherW, int edge, int marg=0)
d55e5bfc 12424
15817c7e
RD
12425 Constrains this edge or dimension to be to the same as the edge of the
12426 given window, with an optional margin.
d55e5bfc 12427 """
5b5c9bc7 12428 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
d55e5bfc
RD
12429
12430 def PercentOf(*args, **kwargs):
12431 """
5b5c9bc7 12432 PercentOf(self, Window otherW, int wh, int per)
d55e5bfc 12433
15817c7e
RD
12434 Constrains this edge or dimension to be to a percentage of the given
12435 window, with an optional margin.
d55e5bfc 12436 """
5b5c9bc7 12437 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
d55e5bfc
RD
12438
12439 def Absolute(*args, **kwargs):
12440 """
12441 Absolute(self, int val)
12442
15817c7e 12443 Constrains this edge or dimension to be the given absolute value.
d55e5bfc 12444 """
5b5c9bc7 12445 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
d55e5bfc
RD
12446
12447 def Unconstrained(*args, **kwargs):
12448 """
12449 Unconstrained(self)
12450
15817c7e
RD
12451 Sets this edge or dimension to be unconstrained, that is, dependent on
12452 other edges and dimensions from which this value can be deduced.
d55e5bfc 12453 """
5b5c9bc7 12454 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
d55e5bfc
RD
12455
12456 def AsIs(*args, **kwargs):
12457 """
12458 AsIs(self)
12459
15817c7e
RD
12460 Sets this edge or constraint to be whatever the window's value is at
12461 the moment. If either of the width and height constraints are *as is*,
12462 the window will not be resized, but moved instead. This is important
12463 when considering panel items which are intended to have a default
12464 size, such as a button, which may take its size from the size of the
12465 button label.
d55e5bfc 12466 """
5b5c9bc7 12467 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
d55e5bfc
RD
12468
12469 def GetOtherWindow(*args, **kwargs):
5b5c9bc7
RD
12470 """GetOtherWindow(self) -> Window"""
12471 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
d55e5bfc
RD
12472
12473 def GetMyEdge(*args, **kwargs):
12474 """GetMyEdge(self) -> int"""
5b5c9bc7 12475 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
d55e5bfc
RD
12476
12477 def SetEdge(*args, **kwargs):
12478 """SetEdge(self, int which)"""
5b5c9bc7 12479 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
d55e5bfc
RD
12480
12481 def SetValue(*args, **kwargs):
12482 """SetValue(self, int v)"""
5b5c9bc7 12483 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
d55e5bfc
RD
12484
12485 def GetMargin(*args, **kwargs):
12486 """GetMargin(self) -> int"""
5b5c9bc7 12487 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
d55e5bfc
RD
12488
12489 def SetMargin(*args, **kwargs):
12490 """SetMargin(self, int m)"""
5b5c9bc7 12491 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
d55e5bfc
RD
12492
12493 def GetValue(*args, **kwargs):
12494 """GetValue(self) -> int"""
5b5c9bc7 12495 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
d55e5bfc
RD
12496
12497 def GetPercent(*args, **kwargs):
12498 """GetPercent(self) -> int"""
5b5c9bc7 12499 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
d55e5bfc
RD
12500
12501 def GetOtherEdge(*args, **kwargs):
12502 """GetOtherEdge(self) -> int"""
5b5c9bc7 12503 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
d55e5bfc
RD
12504
12505 def GetDone(*args, **kwargs):
12506 """GetDone(self) -> bool"""
5b5c9bc7 12507 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
d55e5bfc
RD
12508
12509 def SetDone(*args, **kwargs):
12510 """SetDone(self, bool d)"""
5b5c9bc7 12511 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
d55e5bfc
RD
12512
12513 def GetRelationship(*args, **kwargs):
12514 """GetRelationship(self) -> int"""
5b5c9bc7 12515 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
d55e5bfc
RD
12516
12517 def SetRelationship(*args, **kwargs):
12518 """SetRelationship(self, int r)"""
5b5c9bc7 12519 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
d55e5bfc
RD
12520
12521 def ResetIfWin(*args, **kwargs):
12522 """
5b5c9bc7 12523 ResetIfWin(self, Window otherW) -> bool
d55e5bfc
RD
12524
12525 Reset constraint if it mentions otherWin
12526 """
5b5c9bc7 12527 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
d55e5bfc
RD
12528
12529 def SatisfyConstraint(*args, **kwargs):
12530 """
5b5c9bc7 12531 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
d55e5bfc
RD
12532
12533 Try to satisfy constraint
12534 """
5b5c9bc7 12535 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
d55e5bfc
RD
12536
12537 def GetEdge(*args, **kwargs):
12538 """
5b5c9bc7 12539 GetEdge(self, int which, Window thisWin, Window other) -> int
d55e5bfc
RD
12540
12541 Get the value of this edge or dimension, or if this
12542 is not determinable, -1.
12543 """
5b5c9bc7 12544 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
d55e5bfc 12545
2131d850 12546_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d55e5bfc 12547
5b5c9bc7 12548class LayoutConstraints(Object):
d55e5bfc 12549 """
15817c7e
RD
12550 **Note:** constraints are now deprecated and you should use sizers
12551 instead.
d55e5bfc 12552
15817c7e
RD
12553 Objects of this class can be associated with a window to define its
12554 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
12555
12556 The class consists of the following eight constraints of class
12557 wx.IndividualLayoutConstraint, some or all of which should be accessed
12558 directly to set the appropriate constraints.
12559
12560 * left: represents the left hand edge of the window
12561 * right: represents the right hand edge of the window
12562 * top: represents the top edge of the window
12563 * bottom: represents the bottom edge of the window
12564 * width: represents the width of the window
12565 * height: represents the height of the window
12566 * centreX: represents the horizontal centre point of the window
12567 * centreY: represents the vertical centre point of the window
12568
15817c7e
RD
12569 Most constraints are initially set to have the relationship
12570 wxUnconstrained, which means that their values should be calculated by
12571 looking at known constraints. The exceptions are width and height,
12572 which are set to wxAsIs to ensure that if the user does not specify a
12573 constraint, the existing width and height will be used, to be
12574 compatible with panel items which often have take a default size. If
12575 the constraint is ``wx.AsIs``, the dimension will not be changed.
12576
12577 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
12578
12579 """
1bd55598
RD
12580 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12581 __repr__ = _swig_repr
5b5c9bc7
RD
12582 left = property(_core_.LayoutConstraints_left_get)
12583 top = property(_core_.LayoutConstraints_top_get)
12584 right = property(_core_.LayoutConstraints_right_get)
12585 bottom = property(_core_.LayoutConstraints_bottom_get)
12586 width = property(_core_.LayoutConstraints_width_get)
12587 height = property(_core_.LayoutConstraints_height_get)
12588 centreX = property(_core_.LayoutConstraints_centreX_get)
12589 centreY = property(_core_.LayoutConstraints_centreY_get)
1bd55598 12590 def __init__(self, *args, **kwargs):
5b5c9bc7 12591 """__init__(self) -> LayoutConstraints"""
1bd55598
RD
12592 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12593 __swig_destroy__ = _core_.delete_LayoutConstraints
12594 __del__ = lambda self : None;
d55e5bfc
RD
12595 def SatisfyConstraints(*args, **kwargs):
12596 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
5b5c9bc7 12597 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
d55e5bfc
RD
12598
12599 def AreSatisfied(*args, **kwargs):
12600 """AreSatisfied(self) -> bool"""
5b5c9bc7 12601 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
d55e5bfc 12602
2131d850 12603_core_.LayoutConstraints_swigregister(LayoutConstraints)
d55e5bfc
RD
12604
12605#----------------------------------------------------------------------------
12606
12607# Use Python's bool constants if available, make some if not
12608try:
12609 True
12610except NameError:
12611 __builtins__.True = 1==1
12612 __builtins__.False = 1==0
12613 def bool(value): return not not value
12614 __builtins__.bool = bool
12615
12616
12617
12618# workarounds for bad wxRTTI names
12619__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12620__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12621__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12622
12623
12624#----------------------------------------------------------------------------
12625# Load version numbers from __version__... Ensure that major and minor
0f63ec68 12626# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
12627
12628from __version__ import *
12629__version__ = VERSION_STRING
12630
0f63ec68
RD
12631assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12632assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
12633if RELEASE_VERSION != _core_.RELEASE_VERSION:
12634 import warnings
0f63ec68 12635 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
12636
12637#----------------------------------------------------------------------------
12638
7993762b
RD
12639# Set wxPython's default string<-->unicode conversion encoding from
12640# the locale, but only if Python's default hasn't been changed. (We
12641# assume that if the user has customized it already then that is the
12642# encoding we need to use as well.)
12643#
12644# The encoding selected here is used when string or unicode objects
12645# need to be converted in order to pass them to wxWidgets. Please be
12646# aware that the default encoding within the same locale may be
12647# slightly different on different platforms. For example, please see
62d32a5f
RD
12648# http://www.alanwood.net/demos/charsetdiffs.html for differences
12649# between the common latin/roman encodings.
3837a853
RD
12650
12651default = _sys.getdefaultencoding()
12652if default == 'ascii':
12653 import locale
12654 import codecs
12655 try:
12656 default = locale.getdefaultlocale()[1]
12657 codecs.lookup(default)
7993762b 12658 except (ValueError, LookupError, TypeError):
3837a853
RD
12659 default = _sys.getdefaultencoding()
12660 del locale
12661 del codecs
5cbf236d
RD
12662if default:
12663 wx.SetDefaultPyEncoding(default)
12664del default
5cbf236d
RD
12665
12666#----------------------------------------------------------------------------
12667
d55e5bfc
RD
12668class PyDeadObjectError(AttributeError):
12669 pass
12670
12671class _wxPyDeadObject(object):
12672 """
12673 Instances of wx objects that are OOR capable will have their __class__
12674 changed to this class when the C++ object is deleted. This should help
12675 prevent crashes due to referencing a bogus C++ pointer.
12676 """
12677 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12678 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12679
12680 def __repr__(self):
12681 if not hasattr(self, "_name"):
12682 self._name = "[unknown]"
12683 return self.reprStr % self._name
12684
12685 def __getattr__(self, *args):
12686 if not hasattr(self, "_name"):
12687 self._name = "[unknown]"
12688 raise PyDeadObjectError(self.attrStr % self._name)
12689
12690 def __nonzero__(self):
12691 return 0
12692
12693
12694
12695class PyUnbornObjectError(AttributeError):
12696 pass
12697
12698class _wxPyUnbornObject(object):
12699 """
12700 Some stock objects are created when the wx._core module is
12701 imported, but their C++ instance is not created until the wx.App
12702 object is created and initialized. These object instances will
12703 temporarily have their __class__ changed to this class so an
12704 exception will be raised if they are used before the C++ instance
12705 is ready.
12706 """
12707
12708 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12709 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12710
12711 def __repr__(self):
12712 #if not hasattr(self, "_name"):
12713 # self._name = "[unknown]"
12714 return self.reprStr #% self._name
12715
12716 def __getattr__(self, *args):
12717 #if not hasattr(self, "_name"):
12718 # self._name = "[unknown]"
12719 raise PyUnbornObjectError(self.attrStr) # % self._name )
12720
12721 def __nonzero__(self):
12722 return 0
12723
12724
12725#----------------------------------------------------------------------------
d55e5bfc
RD
12726
12727def CallAfter(callable, *args, **kw):
12728 """
12729 Call the specified function after the current and pending event
12730 handlers have been completed. This is also good for making GUI
0439c23b
RD
12731 method calls from non-GUI threads. Any extra positional or
12732 keyword args are passed on to the callable when it is called.
12733
12734 :see: `wx.FutureCall`
d55e5bfc
RD
12735 """
12736 app = wx.GetApp()
a001823c 12737 assert app is not None, 'No wx.App created yet'
d55e5bfc 12738
891bb194
RD
12739 if not hasattr(app, "_CallAfterId"):
12740 app._CallAfterId = wx.NewEventType()
12741 app.Connect(-1, -1, app._CallAfterId,
12742 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 12743 evt = wx.PyEvent()
891bb194 12744 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
12745 evt.callable = callable
12746 evt.args = args
12747 evt.kw = kw
12748 wx.PostEvent(app, evt)
12749
d55e5bfc
RD
12750#----------------------------------------------------------------------------
12751
12752
12753class FutureCall:
12754 """
6e0de3df 12755 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
12756 object once after the given amount of milliseconds, passing any
12757 positional or keyword args. The return value of the callable is
0439c23b 12758 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
12759
12760 If you don't need to get the return value or restart the timer
12761 then there is no need to hold a reference to this object. It will
12762 hold a reference to itself while the timer is running (the timer
12763 has a reference to self.Notify) but the cycle will be broken when
12764 the timer completes, automatically cleaning up the wx.FutureCall
12765 object.
0439c23b
RD
12766
12767 :see: `wx.CallAfter`
d55e5bfc
RD
12768 """
12769 def __init__(self, millis, callable, *args, **kwargs):
12770 self.millis = millis
12771 self.callable = callable
12772 self.SetArgs(*args, **kwargs)
12773 self.runCount = 0
12774 self.running = False
12775 self.hasRun = False
12776 self.result = None
12777 self.timer = None
12778 self.Start()
12779
12780 def __del__(self):
12781 self.Stop()
12782
12783
12784 def Start(self, millis=None, *args, **kwargs):
12785 """
12786 (Re)start the timer
12787 """
12788 self.hasRun = False
12789 if millis is not None:
12790 self.millis = millis
12791 if args or kwargs:
12792 self.SetArgs(*args, **kwargs)
12793 self.Stop()
12794 self.timer = wx.PyTimer(self.Notify)
12795 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
12796 self.running = True
12797 Restart = Start
12798
12799
12800 def Stop(self):
12801 """
12802 Stop and destroy the timer.
12803 """
12804 if self.timer is not None:
12805 self.timer.Stop()
12806 self.timer = None
12807
12808
12809 def GetInterval(self):
12810 if self.timer is not None:
12811 return self.timer.GetInterval()
12812 else:
12813 return 0
12814
12815
12816 def IsRunning(self):
12817 return self.timer is not None and self.timer.IsRunning()
12818
12819
12820 def SetArgs(self, *args, **kwargs):
12821 """
12822 (Re)set the args passed to the callable object. This is
12823 useful in conjunction with Restart if you want to schedule a
12824 new call to the same callable object but with different
12825 parameters.
12826 """
12827 self.args = args
12828 self.kwargs = kwargs
12829
12830
12831 def HasRun(self):
12832 return self.hasRun
12833
12834 def GetResult(self):
12835 return self.result
12836
12837 def Notify(self):
12838 """
12839 The timer has expired so call the callable.
12840 """
12841 if self.callable and getattr(self.callable, 'im_self', True):
12842 self.runCount += 1
12843 self.running = False
12844 self.result = self.callable(*self.args, **self.kwargs)
12845 self.hasRun = True
12846 if not self.running:
12847 # if it wasn't restarted, then cleanup
12848 wx.CallAfter(self.Stop)
12849
12850
12851
12852#----------------------------------------------------------------------------
12853# Control which items in this module should be documented by epydoc.
12854# We allow only classes and functions, which will help reduce the size
12855# of the docs by filtering out the zillions of constants, EVT objects,
12856# and etc that don't make much sense by themselves, but are instead
12857# documented (or will be) as part of the classes/functions/methods
12858# where they should be used.
12859
d6c14a4c
RD
12860class __DocFilter:
12861 """
12862 A filter for epydoc that only allows non-Ptr classes and
12863 fucntions, in order to reduce the clutter in the API docs.
12864 """
12865 def __init__(self, globals):
12866 self._globals = globals
12867
12868 def __call__(self, name):
12869 import types
12870 obj = self._globals.get(name, None)
12871 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12872 return False
1bd55598 12873 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
d6c14a4c
RD
12874 return False
12875 return True
d55e5bfc
RD
12876
12877#----------------------------------------------------------------------------
12878#----------------------------------------------------------------------------
12879
12880# Import other modules in this package that should show up in the
12881# "core" wx namespace
12882from _gdi import *
12883from _windows import *
12884from _controls import *
12885from _misc import *
12886
d55e5bfc
RD
12887#----------------------------------------------------------------------------
12888#----------------------------------------------------------------------------
12889
12890
32fe5131 12891