]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/mac/_core.py
Add dtor for wxCalendarDateAttr
[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
1eeb270e
RD
203ID_HELP_INDEX = _core_.ID_HELP_INDEX
204ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
5b5c9bc7
RD
205ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
206ID_PREFERENCES = _core_.ID_PREFERENCES
207ID_CUT = _core_.ID_CUT
208ID_COPY = _core_.ID_COPY
209ID_PASTE = _core_.ID_PASTE
210ID_CLEAR = _core_.ID_CLEAR
211ID_FIND = _core_.ID_FIND
212ID_DUPLICATE = _core_.ID_DUPLICATE
213ID_SELECTALL = _core_.ID_SELECTALL
214ID_DELETE = _core_.ID_DELETE
215ID_REPLACE = _core_.ID_REPLACE
216ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
217ID_PROPERTIES = _core_.ID_PROPERTIES
218ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
219ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
220ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
221ID_VIEW_LIST = _core_.ID_VIEW_LIST
222ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
223ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
224ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
225ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
226ID_FILE1 = _core_.ID_FILE1
227ID_FILE2 = _core_.ID_FILE2
228ID_FILE3 = _core_.ID_FILE3
229ID_FILE4 = _core_.ID_FILE4
230ID_FILE5 = _core_.ID_FILE5
231ID_FILE6 = _core_.ID_FILE6
232ID_FILE7 = _core_.ID_FILE7
233ID_FILE8 = _core_.ID_FILE8
234ID_FILE9 = _core_.ID_FILE9
235ID_OK = _core_.ID_OK
236ID_CANCEL = _core_.ID_CANCEL
237ID_APPLY = _core_.ID_APPLY
238ID_YES = _core_.ID_YES
239ID_NO = _core_.ID_NO
240ID_STATIC = _core_.ID_STATIC
241ID_FORWARD = _core_.ID_FORWARD
242ID_BACKWARD = _core_.ID_BACKWARD
243ID_DEFAULT = _core_.ID_DEFAULT
244ID_MORE = _core_.ID_MORE
245ID_SETUP = _core_.ID_SETUP
246ID_RESET = _core_.ID_RESET
247ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
248ID_YESTOALL = _core_.ID_YESTOALL
249ID_NOTOALL = _core_.ID_NOTOALL
250ID_ABORT = _core_.ID_ABORT
251ID_RETRY = _core_.ID_RETRY
252ID_IGNORE = _core_.ID_IGNORE
253ID_ADD = _core_.ID_ADD
254ID_REMOVE = _core_.ID_REMOVE
255ID_UP = _core_.ID_UP
256ID_DOWN = _core_.ID_DOWN
257ID_HOME = _core_.ID_HOME
258ID_REFRESH = _core_.ID_REFRESH
259ID_STOP = _core_.ID_STOP
260ID_INDEX = _core_.ID_INDEX
261ID_BOLD = _core_.ID_BOLD
262ID_ITALIC = _core_.ID_ITALIC
263ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
264ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
265ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
266ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
267ID_UNDERLINE = _core_.ID_UNDERLINE
268ID_INDENT = _core_.ID_INDENT
269ID_UNINDENT = _core_.ID_UNINDENT
270ID_ZOOM_100 = _core_.ID_ZOOM_100
271ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
272ID_ZOOM_IN = _core_.ID_ZOOM_IN
273ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
274ID_UNDELETE = _core_.ID_UNDELETE
275ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
276ID_HIGHEST = _core_.ID_HIGHEST
5b5c9bc7
RD
277ACCEL_ALT = _core_.ACCEL_ALT
278ACCEL_CTRL = _core_.ACCEL_CTRL
279ACCEL_SHIFT = _core_.ACCEL_SHIFT
280ACCEL_NORMAL = _core_.ACCEL_NORMAL
281PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
282PD_APP_MODAL = _core_.PD_APP_MODAL
283PD_CAN_ABORT = _core_.PD_CAN_ABORT
284PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
285PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
286PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
287PD_SMOOTH = _core_.PD_SMOOTH
288PD_CAN_SKIP = _core_.PD_CAN_SKIP
5b5c9bc7
RD
289MENU_TEAROFF = _core_.MENU_TEAROFF
290MB_DOCKABLE = _core_.MB_DOCKABLE
291NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
292FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
293LI_HORIZONTAL = _core_.LI_HORIZONTAL
294LI_VERTICAL = _core_.LI_VERTICAL
295WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
296WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
297WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
298WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
299WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
300WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
301MM_TEXT = _core_.MM_TEXT
302MM_LOMETRIC = _core_.MM_LOMETRIC
303MM_HIMETRIC = _core_.MM_HIMETRIC
304MM_LOENGLISH = _core_.MM_LOENGLISH
305MM_HIENGLISH = _core_.MM_HIENGLISH
306MM_TWIPS = _core_.MM_TWIPS
307MM_ISOTROPIC = _core_.MM_ISOTROPIC
308MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
309MM_POINTS = _core_.MM_POINTS
310MM_METRIC = _core_.MM_METRIC
311CENTRE = _core_.CENTRE
312CENTER = _core_.CENTER
313HORIZONTAL = _core_.HORIZONTAL
314VERTICAL = _core_.VERTICAL
315BOTH = _core_.BOTH
316LEFT = _core_.LEFT
317RIGHT = _core_.RIGHT
318UP = _core_.UP
319DOWN = _core_.DOWN
320TOP = _core_.TOP
321BOTTOM = _core_.BOTTOM
322NORTH = _core_.NORTH
323SOUTH = _core_.SOUTH
324WEST = _core_.WEST
325EAST = _core_.EAST
326ALL = _core_.ALL
327ALIGN_NOT = _core_.ALIGN_NOT
328ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
329ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
330ALIGN_LEFT = _core_.ALIGN_LEFT
331ALIGN_TOP = _core_.ALIGN_TOP
332ALIGN_RIGHT = _core_.ALIGN_RIGHT
333ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
334ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
335ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
336ALIGN_CENTER = _core_.ALIGN_CENTER
337ALIGN_CENTRE = _core_.ALIGN_CENTRE
338ALIGN_MASK = _core_.ALIGN_MASK
339STRETCH_NOT = _core_.STRETCH_NOT
340SHRINK = _core_.SHRINK
341GROW = _core_.GROW
342EXPAND = _core_.EXPAND
343SHAPED = _core_.SHAPED
344FIXED_MINSIZE = _core_.FIXED_MINSIZE
345TILE = _core_.TILE
346ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
347BORDER_DEFAULT = _core_.BORDER_DEFAULT
348BORDER_NONE = _core_.BORDER_NONE
349BORDER_STATIC = _core_.BORDER_STATIC
350BORDER_SIMPLE = _core_.BORDER_SIMPLE
351BORDER_RAISED = _core_.BORDER_RAISED
352BORDER_SUNKEN = _core_.BORDER_SUNKEN
353BORDER_DOUBLE = _core_.BORDER_DOUBLE
354BORDER_MASK = _core_.BORDER_MASK
355BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
356BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
357BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
358DEFAULT = _core_.DEFAULT
359DECORATIVE = _core_.DECORATIVE
360ROMAN = _core_.ROMAN
361SCRIPT = _core_.SCRIPT
362SWISS = _core_.SWISS
363MODERN = _core_.MODERN
364TELETYPE = _core_.TELETYPE
365VARIABLE = _core_.VARIABLE
366FIXED = _core_.FIXED
367NORMAL = _core_.NORMAL
368LIGHT = _core_.LIGHT
369BOLD = _core_.BOLD
370ITALIC = _core_.ITALIC
371SLANT = _core_.SLANT
372SOLID = _core_.SOLID
373DOT = _core_.DOT
374LONG_DASH = _core_.LONG_DASH
375SHORT_DASH = _core_.SHORT_DASH
376DOT_DASH = _core_.DOT_DASH
377USER_DASH = _core_.USER_DASH
378TRANSPARENT = _core_.TRANSPARENT
379STIPPLE = _core_.STIPPLE
d04418a7
RD
380STIPPLE_MASK = _core_.STIPPLE_MASK
381STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
5b5c9bc7
RD
382BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
383CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
384FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
385CROSS_HATCH = _core_.CROSS_HATCH
386HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
387VERTICAL_HATCH = _core_.VERTICAL_HATCH
388JOIN_BEVEL = _core_.JOIN_BEVEL
389JOIN_MITER = _core_.JOIN_MITER
390JOIN_ROUND = _core_.JOIN_ROUND
391CAP_ROUND = _core_.CAP_ROUND
392CAP_PROJECTING = _core_.CAP_PROJECTING
393CAP_BUTT = _core_.CAP_BUTT
394CLEAR = _core_.CLEAR
395XOR = _core_.XOR
396INVERT = _core_.INVERT
397OR_REVERSE = _core_.OR_REVERSE
398AND_REVERSE = _core_.AND_REVERSE
399COPY = _core_.COPY
400AND = _core_.AND
401AND_INVERT = _core_.AND_INVERT
402NO_OP = _core_.NO_OP
403NOR = _core_.NOR
404EQUIV = _core_.EQUIV
405SRC_INVERT = _core_.SRC_INVERT
406OR_INVERT = _core_.OR_INVERT
407NAND = _core_.NAND
408OR = _core_.OR
409SET = _core_.SET
410WXK_BACK = _core_.WXK_BACK
411WXK_TAB = _core_.WXK_TAB
412WXK_RETURN = _core_.WXK_RETURN
413WXK_ESCAPE = _core_.WXK_ESCAPE
414WXK_SPACE = _core_.WXK_SPACE
415WXK_DELETE = _core_.WXK_DELETE
416WXK_START = _core_.WXK_START
417WXK_LBUTTON = _core_.WXK_LBUTTON
418WXK_RBUTTON = _core_.WXK_RBUTTON
419WXK_CANCEL = _core_.WXK_CANCEL
420WXK_MBUTTON = _core_.WXK_MBUTTON
421WXK_CLEAR = _core_.WXK_CLEAR
422WXK_SHIFT = _core_.WXK_SHIFT
423WXK_ALT = _core_.WXK_ALT
424WXK_CONTROL = _core_.WXK_CONTROL
425WXK_MENU = _core_.WXK_MENU
426WXK_PAUSE = _core_.WXK_PAUSE
427WXK_CAPITAL = _core_.WXK_CAPITAL
428WXK_PRIOR = _core_.WXK_PRIOR
429WXK_NEXT = _core_.WXK_NEXT
430WXK_END = _core_.WXK_END
431WXK_HOME = _core_.WXK_HOME
432WXK_LEFT = _core_.WXK_LEFT
433WXK_UP = _core_.WXK_UP
434WXK_RIGHT = _core_.WXK_RIGHT
435WXK_DOWN = _core_.WXK_DOWN
436WXK_SELECT = _core_.WXK_SELECT
437WXK_PRINT = _core_.WXK_PRINT
438WXK_EXECUTE = _core_.WXK_EXECUTE
439WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
440WXK_INSERT = _core_.WXK_INSERT
441WXK_HELP = _core_.WXK_HELP
442WXK_NUMPAD0 = _core_.WXK_NUMPAD0
443WXK_NUMPAD1 = _core_.WXK_NUMPAD1
444WXK_NUMPAD2 = _core_.WXK_NUMPAD2
445WXK_NUMPAD3 = _core_.WXK_NUMPAD3
446WXK_NUMPAD4 = _core_.WXK_NUMPAD4
447WXK_NUMPAD5 = _core_.WXK_NUMPAD5
448WXK_NUMPAD6 = _core_.WXK_NUMPAD6
449WXK_NUMPAD7 = _core_.WXK_NUMPAD7
450WXK_NUMPAD8 = _core_.WXK_NUMPAD8
451WXK_NUMPAD9 = _core_.WXK_NUMPAD9
452WXK_MULTIPLY = _core_.WXK_MULTIPLY
453WXK_ADD = _core_.WXK_ADD
454WXK_SEPARATOR = _core_.WXK_SEPARATOR
455WXK_SUBTRACT = _core_.WXK_SUBTRACT
456WXK_DECIMAL = _core_.WXK_DECIMAL
457WXK_DIVIDE = _core_.WXK_DIVIDE
458WXK_F1 = _core_.WXK_F1
459WXK_F2 = _core_.WXK_F2
460WXK_F3 = _core_.WXK_F3
461WXK_F4 = _core_.WXK_F4
462WXK_F5 = _core_.WXK_F5
463WXK_F6 = _core_.WXK_F6
464WXK_F7 = _core_.WXK_F7
465WXK_F8 = _core_.WXK_F8
466WXK_F9 = _core_.WXK_F9
467WXK_F10 = _core_.WXK_F10
468WXK_F11 = _core_.WXK_F11
469WXK_F12 = _core_.WXK_F12
470WXK_F13 = _core_.WXK_F13
471WXK_F14 = _core_.WXK_F14
472WXK_F15 = _core_.WXK_F15
473WXK_F16 = _core_.WXK_F16
474WXK_F17 = _core_.WXK_F17
475WXK_F18 = _core_.WXK_F18
476WXK_F19 = _core_.WXK_F19
477WXK_F20 = _core_.WXK_F20
478WXK_F21 = _core_.WXK_F21
479WXK_F22 = _core_.WXK_F22
480WXK_F23 = _core_.WXK_F23
481WXK_F24 = _core_.WXK_F24
482WXK_NUMLOCK = _core_.WXK_NUMLOCK
483WXK_SCROLL = _core_.WXK_SCROLL
484WXK_PAGEUP = _core_.WXK_PAGEUP
485WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
486WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
487WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
488WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
489WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
490WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
491WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
492WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
493WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
494WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
495WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
496WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
497WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
498WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
499WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
500WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
501WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
502WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
503WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
504WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
505WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
506WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
507WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
508WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
509WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
510WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
511WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
512WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
513WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
514WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
515WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
516WXK_COMMAND = _core_.WXK_COMMAND
517WXK_SPECIAL1 = _core_.WXK_SPECIAL1
518WXK_SPECIAL2 = _core_.WXK_SPECIAL2
519WXK_SPECIAL3 = _core_.WXK_SPECIAL3
520WXK_SPECIAL4 = _core_.WXK_SPECIAL4
521WXK_SPECIAL5 = _core_.WXK_SPECIAL5
522WXK_SPECIAL6 = _core_.WXK_SPECIAL6
523WXK_SPECIAL7 = _core_.WXK_SPECIAL7
524WXK_SPECIAL8 = _core_.WXK_SPECIAL8
525WXK_SPECIAL9 = _core_.WXK_SPECIAL9
526WXK_SPECIAL10 = _core_.WXK_SPECIAL10
527WXK_SPECIAL11 = _core_.WXK_SPECIAL11
528WXK_SPECIAL12 = _core_.WXK_SPECIAL12
529WXK_SPECIAL13 = _core_.WXK_SPECIAL13
530WXK_SPECIAL14 = _core_.WXK_SPECIAL14
531WXK_SPECIAL15 = _core_.WXK_SPECIAL15
532WXK_SPECIAL16 = _core_.WXK_SPECIAL16
533WXK_SPECIAL17 = _core_.WXK_SPECIAL17
534WXK_SPECIAL18 = _core_.WXK_SPECIAL18
535WXK_SPECIAL19 = _core_.WXK_SPECIAL19
536WXK_SPECIAL20 = _core_.WXK_SPECIAL20
537PAPER_NONE = _core_.PAPER_NONE
538PAPER_LETTER = _core_.PAPER_LETTER
539PAPER_LEGAL = _core_.PAPER_LEGAL
540PAPER_A4 = _core_.PAPER_A4
541PAPER_CSHEET = _core_.PAPER_CSHEET
542PAPER_DSHEET = _core_.PAPER_DSHEET
543PAPER_ESHEET = _core_.PAPER_ESHEET
544PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
545PAPER_TABLOID = _core_.PAPER_TABLOID
546PAPER_LEDGER = _core_.PAPER_LEDGER
547PAPER_STATEMENT = _core_.PAPER_STATEMENT
548PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
549PAPER_A3 = _core_.PAPER_A3
550PAPER_A4SMALL = _core_.PAPER_A4SMALL
551PAPER_A5 = _core_.PAPER_A5
552PAPER_B4 = _core_.PAPER_B4
553PAPER_B5 = _core_.PAPER_B5
554PAPER_FOLIO = _core_.PAPER_FOLIO
555PAPER_QUARTO = _core_.PAPER_QUARTO
556PAPER_10X14 = _core_.PAPER_10X14
557PAPER_11X17 = _core_.PAPER_11X17
558PAPER_NOTE = _core_.PAPER_NOTE
559PAPER_ENV_9 = _core_.PAPER_ENV_9
560PAPER_ENV_10 = _core_.PAPER_ENV_10
561PAPER_ENV_11 = _core_.PAPER_ENV_11
562PAPER_ENV_12 = _core_.PAPER_ENV_12
563PAPER_ENV_14 = _core_.PAPER_ENV_14
564PAPER_ENV_DL = _core_.PAPER_ENV_DL
565PAPER_ENV_C5 = _core_.PAPER_ENV_C5
566PAPER_ENV_C3 = _core_.PAPER_ENV_C3
567PAPER_ENV_C4 = _core_.PAPER_ENV_C4
568PAPER_ENV_C6 = _core_.PAPER_ENV_C6
569PAPER_ENV_C65 = _core_.PAPER_ENV_C65
570PAPER_ENV_B4 = _core_.PAPER_ENV_B4
571PAPER_ENV_B5 = _core_.PAPER_ENV_B5
572PAPER_ENV_B6 = _core_.PAPER_ENV_B6
573PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
574PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
575PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
576PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
577PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
578PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
579PAPER_ISO_B4 = _core_.PAPER_ISO_B4
580PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
581PAPER_9X11 = _core_.PAPER_9X11
582PAPER_10X11 = _core_.PAPER_10X11
583PAPER_15X11 = _core_.PAPER_15X11
584PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
585PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
586PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
587PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
588PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
589PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
590PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
591PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
592PAPER_A_PLUS = _core_.PAPER_A_PLUS
593PAPER_B_PLUS = _core_.PAPER_B_PLUS
594PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
595PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
596PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
597PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
598PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
599PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
600PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
601PAPER_A2 = _core_.PAPER_A2
602PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
603PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
034e3677
RD
604PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
605PAPER_A6 = _core_.PAPER_A6
606PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
607PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
608PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
609PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
610PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
611PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
612PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
613PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
614PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
615PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
616PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
617PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
618PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
619PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
620PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
621PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
622PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
623PAPER_B6_JIS = _core_.PAPER_B6_JIS
624PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
625PAPER_12X11 = _core_.PAPER_12X11
626PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
627PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
628PAPER_P16K = _core_.PAPER_P16K
629PAPER_P32K = _core_.PAPER_P32K
630PAPER_P32KBIG = _core_.PAPER_P32KBIG
631PAPER_PENV_1 = _core_.PAPER_PENV_1
632PAPER_PENV_2 = _core_.PAPER_PENV_2
633PAPER_PENV_3 = _core_.PAPER_PENV_3
634PAPER_PENV_4 = _core_.PAPER_PENV_4
635PAPER_PENV_5 = _core_.PAPER_PENV_5
636PAPER_PENV_6 = _core_.PAPER_PENV_6
637PAPER_PENV_7 = _core_.PAPER_PENV_7
638PAPER_PENV_8 = _core_.PAPER_PENV_8
639PAPER_PENV_9 = _core_.PAPER_PENV_9
640PAPER_PENV_10 = _core_.PAPER_PENV_10
641PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
642PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
643PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
644PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
645PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
646PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
647PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
648PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
649PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
650PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
651PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
652PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
653PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
5b5c9bc7
RD
654DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
655DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
656DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
657ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
658ITEM_NORMAL = _core_.ITEM_NORMAL
659ITEM_CHECK = _core_.ITEM_CHECK
660ITEM_RADIO = _core_.ITEM_RADIO
661ITEM_MAX = _core_.ITEM_MAX
662HT_NOWHERE = _core_.HT_NOWHERE
663HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
664HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
665HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
666HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
667HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
668HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
669HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
670HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
671HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
672HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
673HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
674HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
675HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
676HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
677HT_MAX = _core_.HT_MAX
678MOD_NONE = _core_.MOD_NONE
679MOD_ALT = _core_.MOD_ALT
680MOD_CONTROL = _core_.MOD_CONTROL
943e8dfd 681MOD_ALTGR = _core_.MOD_ALTGR
5b5c9bc7 682MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 683MOD_META = _core_.MOD_META
5b5c9bc7 684MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
685MOD_CMD = _core_.MOD_CMD
686MOD_ALL = _core_.MOD_ALL
5b5c9bc7
RD
687UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
688UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
689UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d55e5bfc
RD
690#---------------------------------------------------------------------------
691
5b5c9bc7 692class Object(object):
d55e5bfc
RD
693 """
694 The base class for most wx objects, although in wxPython not
695 much functionality is needed nor exposed.
696 """
1bd55598
RD
697 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
698 def __init__(self): raise AttributeError, "No constructor defined"
699 __repr__ = _swig_repr
d55e5bfc
RD
700 def GetClassName(*args, **kwargs):
701 """
5b5c9bc7 702 GetClassName(self) -> String
d55e5bfc
RD
703
704 Returns the class name of the C++ class using wxRTTI.
705 """
5b5c9bc7 706 return _core_.Object_GetClassName(*args, **kwargs)
d55e5bfc
RD
707
708 def Destroy(*args, **kwargs):
709 """
710 Destroy(self)
711
712 Deletes the C++ object this Python object is a proxy for.
713 """
7e08d4ef
RD
714 val = _core_.Object_Destroy(*args, **kwargs)
715 args[0].thisown = 0
716 return val
d55e5bfc 717
2131d850 718_core_.Object_swigregister(Object)
5b5c9bc7 719_wxPySetDictionary = _core_._wxPySetDictionary
5b5c9bc7 720cvar = _core_.cvar
d55e5bfc
RD
721EmptyString = cvar.EmptyString
722
723#---------------------------------------------------------------------------
724
5b5c9bc7
RD
725BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
726BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
727BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
728BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
729BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
730BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
731BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
732BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
733BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
734BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
735BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
736BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
737BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
738BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
739BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
740BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
741BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
742BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
743BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
744BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
745CURSOR_NONE = _core_.CURSOR_NONE
746CURSOR_ARROW = _core_.CURSOR_ARROW
747CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
748CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
749CURSOR_CHAR = _core_.CURSOR_CHAR
750CURSOR_CROSS = _core_.CURSOR_CROSS
751CURSOR_HAND = _core_.CURSOR_HAND
752CURSOR_IBEAM = _core_.CURSOR_IBEAM
753CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
754CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
755CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
756CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
757CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
758CURSOR_PENCIL = _core_.CURSOR_PENCIL
759CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
760CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
761CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
762CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
763CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
764CURSOR_SIZENS = _core_.CURSOR_SIZENS
765CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
766CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
767CURSOR_SIZING = _core_.CURSOR_SIZING
768CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
769CURSOR_WAIT = _core_.CURSOR_WAIT
770CURSOR_WATCH = _core_.CURSOR_WATCH
771CURSOR_BLANK = _core_.CURSOR_BLANK
772CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
773CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
774CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
775CURSOR_MAX = _core_.CURSOR_MAX
d55e5bfc
RD
776#---------------------------------------------------------------------------
777
5b5c9bc7 778class Size(object):
d55e5bfc 779 """
15817c7e 780 wx.Size is a useful data structure used to represent the size of
1bd55598
RD
781 something. It simply contains integer width and height
782 properties. In most places in wxPython where a wx.Size is
36ed4f51 783 expected a (width, height) tuple can be used instead.
d55e5bfc 784 """
1bd55598
RD
785 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
786 __repr__ = _swig_repr
5b5c9bc7
RD
787 width = property(_core_.Size_width_get, _core_.Size_width_set)
788 height = property(_core_.Size_height_get, _core_.Size_height_set)
d55e5bfc 789 x = width; y = height
1bd55598 790 def __init__(self, *args, **kwargs):
d55e5bfc 791 """
5b5c9bc7 792 __init__(self, int w=0, int h=0) -> Size
d55e5bfc
RD
793
794 Creates a size object.
795 """
1bd55598
RD
796 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
797 __swig_destroy__ = _core_.delete_Size
798 __del__ = lambda self : None;
d55e5bfc
RD
799 def __eq__(*args, **kwargs):
800 """
e9d6f3a4 801 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
802
803 Test for equality of wx.Size objects.
804 """
5b5c9bc7 805 return _core_.Size___eq__(*args, **kwargs)
d55e5bfc
RD
806
807 def __ne__(*args, **kwargs):
808 """
e9d6f3a4 809 __ne__(self, PyObject other) -> bool
d55e5bfc 810
e9d6f3a4 811 Test for inequality of wx.Size objects.
d55e5bfc 812 """
5b5c9bc7 813 return _core_.Size___ne__(*args, **kwargs)
d55e5bfc
RD
814
815 def __add__(*args, **kwargs):
816 """
5b5c9bc7 817 __add__(self, Size sz) -> Size
d55e5bfc
RD
818
819 Add sz's proprties to this and return the result.
820 """
5b5c9bc7 821 return _core_.Size___add__(*args, **kwargs)
d55e5bfc
RD
822
823 def __sub__(*args, **kwargs):
824 """
5b5c9bc7 825 __sub__(self, Size sz) -> Size
d55e5bfc
RD
826
827 Subtract sz's properties from this and return the result.
828 """
5b5c9bc7 829 return _core_.Size___sub__(*args, **kwargs)
d55e5bfc
RD
830
831 def IncTo(*args, **kwargs):
832 """
5b5c9bc7 833 IncTo(self, Size sz)
d55e5bfc
RD
834
835 Increments this object so that both of its dimensions are not less
836 than the corresponding dimensions of the size.
837 """
5b5c9bc7 838 return _core_.Size_IncTo(*args, **kwargs)
d55e5bfc
RD
839
840 def DecTo(*args, **kwargs):
841 """
5b5c9bc7 842 DecTo(self, Size sz)
d55e5bfc
RD
843
844 Decrements this object so that both of its dimensions are not greater
845 than the corresponding dimensions of the size.
846 """
5b5c9bc7 847 return _core_.Size_DecTo(*args, **kwargs)
d55e5bfc 848
1eeb270e
RD
849 def Scale(*args, **kwargs):
850 """
851 Scale(self, float xscale, float yscale)
852
853 Scales the dimensions of this object by the given factors.
854 """
855 return _core_.Size_Scale(*args, **kwargs)
856
d55e5bfc
RD
857 def Set(*args, **kwargs):
858 """
859 Set(self, int w, int h)
860
861 Set both width and height.
862 """
5b5c9bc7 863 return _core_.Size_Set(*args, **kwargs)
d55e5bfc
RD
864
865 def SetWidth(*args, **kwargs):
866 """SetWidth(self, int w)"""
5b5c9bc7 867 return _core_.Size_SetWidth(*args, **kwargs)
d55e5bfc
RD
868
869 def SetHeight(*args, **kwargs):
870 """SetHeight(self, int h)"""
5b5c9bc7 871 return _core_.Size_SetHeight(*args, **kwargs)
d55e5bfc
RD
872
873 def GetWidth(*args, **kwargs):
874 """GetWidth(self) -> int"""
5b5c9bc7 875 return _core_.Size_GetWidth(*args, **kwargs)
d55e5bfc
RD
876
877 def GetHeight(*args, **kwargs):
878 """GetHeight(self) -> int"""
5b5c9bc7 879 return _core_.Size_GetHeight(*args, **kwargs)
d55e5bfc
RD
880
881 def IsFullySpecified(*args, **kwargs):
882 """
883 IsFullySpecified(self) -> bool
884
885 Returns True if both components of the size are non-default values.
886 """
5b5c9bc7 887 return _core_.Size_IsFullySpecified(*args, **kwargs)
d55e5bfc
RD
888
889 def SetDefaults(*args, **kwargs):
890 """
5b5c9bc7 891 SetDefaults(self, Size size)
d55e5bfc 892
15817c7e
RD
893 Combine this size with the other one replacing the default components
894 of this object (i.e. equal to -1) with those of the other.
d55e5bfc 895 """
5b5c9bc7 896 return _core_.Size_SetDefaults(*args, **kwargs)
d55e5bfc
RD
897
898 def Get(*args, **kwargs):
899 """
900 Get() -> (width,height)
901
902 Returns the width and height properties as a tuple.
903 """
5b5c9bc7 904 return _core_.Size_Get(*args, **kwargs)
d55e5bfc 905
15817c7e 906 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
907 def __str__(self): return str(self.Get())
908 def __repr__(self): return 'wx.Size'+str(self.Get())
909 def __len__(self): return len(self.Get())
910 def __getitem__(self, index): return self.Get()[index]
911 def __setitem__(self, index, val):
912 if index == 0: self.width = val
913 elif index == 1: self.height = val
914 else: raise IndexError
915 def __nonzero__(self): return self.Get() != (0,0)
916 __safe_for_unpickling__ = True
917 def __reduce__(self): return (wx.Size, self.Get())
918
2131d850 919_core_.Size_swigregister(Size)
d55e5bfc
RD
920
921#---------------------------------------------------------------------------
922
5b5c9bc7 923class RealPoint(object):
d55e5bfc 924 """
15817c7e
RD
925 A data structure for representing a point or position with floating
926 point x and y properties. In wxPython most places that expect a
927 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc 928 """
1bd55598
RD
929 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
930 __repr__ = _swig_repr
5b5c9bc7
RD
931 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
932 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
1bd55598 933 def __init__(self, *args, **kwargs):
d55e5bfc 934 """
5b5c9bc7 935 __init__(self, double x=0.0, double y=0.0) -> RealPoint
d55e5bfc
RD
936
937 Create a wx.RealPoint object
938 """
1bd55598
RD
939 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
940 __swig_destroy__ = _core_.delete_RealPoint
941 __del__ = lambda self : None;
d55e5bfc
RD
942 def __eq__(*args, **kwargs):
943 """
e9d6f3a4 944 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
945
946 Test for equality of wx.RealPoint objects.
947 """
5b5c9bc7 948 return _core_.RealPoint___eq__(*args, **kwargs)
d55e5bfc
RD
949
950 def __ne__(*args, **kwargs):
951 """
e9d6f3a4 952 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
953
954 Test for inequality of wx.RealPoint objects.
955 """
5b5c9bc7 956 return _core_.RealPoint___ne__(*args, **kwargs)
d55e5bfc
RD
957
958 def __add__(*args, **kwargs):
959 """
5b5c9bc7 960 __add__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
961
962 Add pt's proprties to this and return the result.
963 """
5b5c9bc7 964 return _core_.RealPoint___add__(*args, **kwargs)
d55e5bfc
RD
965
966 def __sub__(*args, **kwargs):
967 """
5b5c9bc7 968 __sub__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
969
970 Subtract pt's proprties from this and return the result
971 """
5b5c9bc7 972 return _core_.RealPoint___sub__(*args, **kwargs)
d55e5bfc
RD
973
974 def Set(*args, **kwargs):
975 """
976 Set(self, double x, double y)
977
978 Set both the x and y properties
979 """
5b5c9bc7 980 return _core_.RealPoint_Set(*args, **kwargs)
d55e5bfc
RD
981
982 def Get(*args, **kwargs):
983 """
984 Get() -> (x,y)
985
986 Return the x and y properties as a tuple.
987 """
5b5c9bc7 988 return _core_.RealPoint_Get(*args, **kwargs)
d55e5bfc 989
15817c7e 990 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
991 def __str__(self): return str(self.Get())
992 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
993 def __len__(self): return len(self.Get())
994 def __getitem__(self, index): return self.Get()[index]
995 def __setitem__(self, index, val):
996 if index == 0: self.x = val
997 elif index == 1: self.y = val
998 else: raise IndexError
999 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1000 __safe_for_unpickling__ = True
1001 def __reduce__(self): return (wx.RealPoint, self.Get())
1002
2131d850 1003_core_.RealPoint_swigregister(RealPoint)
d55e5bfc
RD
1004
1005#---------------------------------------------------------------------------
1006
5b5c9bc7 1007class Point(object):
d55e5bfc 1008 """
15817c7e
RD
1009 A data structure for representing a point or position with integer x
1010 and y properties. Most places in wxPython that expect a wx.Point can
1011 also accept a (x,y) tuple.
d55e5bfc 1012 """
1bd55598
RD
1013 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1014 __repr__ = _swig_repr
5b5c9bc7
RD
1015 x = property(_core_.Point_x_get, _core_.Point_x_set)
1016 y = property(_core_.Point_y_get, _core_.Point_y_set)
1bd55598 1017 def __init__(self, *args, **kwargs):
d55e5bfc 1018 """
5b5c9bc7 1019 __init__(self, int x=0, int y=0) -> Point
d55e5bfc
RD
1020
1021 Create a wx.Point object
1022 """
1bd55598
RD
1023 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1024 __swig_destroy__ = _core_.delete_Point
1025 __del__ = lambda self : None;
d55e5bfc
RD
1026 def __eq__(*args, **kwargs):
1027 """
e9d6f3a4 1028 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
1029
1030 Test for equality of wx.Point objects.
1031 """
5b5c9bc7 1032 return _core_.Point___eq__(*args, **kwargs)
d55e5bfc
RD
1033
1034 def __ne__(*args, **kwargs):
1035 """
e9d6f3a4 1036 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
1037
1038 Test for inequality of wx.Point objects.
1039 """
5b5c9bc7 1040 return _core_.Point___ne__(*args, **kwargs)
d55e5bfc
RD
1041
1042 def __add__(*args, **kwargs):
1043 """
5b5c9bc7 1044 __add__(self, Point pt) -> Point
d55e5bfc
RD
1045
1046 Add pt's proprties to this and return the result.
1047 """
5b5c9bc7 1048 return _core_.Point___add__(*args, **kwargs)
d55e5bfc
RD
1049
1050 def __sub__(*args, **kwargs):
1051 """
5b5c9bc7 1052 __sub__(self, Point pt) -> Point
d55e5bfc
RD
1053
1054 Subtract pt's proprties from this and return the result
1055 """
5b5c9bc7 1056 return _core_.Point___sub__(*args, **kwargs)
d55e5bfc
RD
1057
1058 def __iadd__(*args, **kwargs):
1059 """
5b5c9bc7 1060 __iadd__(self, Point pt) -> Point
d55e5bfc
RD
1061
1062 Add pt to this object.
1063 """
5b5c9bc7 1064 return _core_.Point___iadd__(*args, **kwargs)
d55e5bfc
RD
1065
1066 def __isub__(*args, **kwargs):
1067 """
5b5c9bc7 1068 __isub__(self, Point pt) -> Point
d55e5bfc
RD
1069
1070 Subtract pt from this object.
1071 """
5b5c9bc7 1072 return _core_.Point___isub__(*args, **kwargs)
d55e5bfc
RD
1073
1074 def Set(*args, **kwargs):
1075 """
1076 Set(self, long x, long y)
1077
1078 Set both the x and y properties
1079 """
5b5c9bc7 1080 return _core_.Point_Set(*args, **kwargs)
d55e5bfc
RD
1081
1082 def Get(*args, **kwargs):
1083 """
1084 Get() -> (x,y)
1085
1086 Return the x and y properties as a tuple.
1087 """
5b5c9bc7 1088 return _core_.Point_Get(*args, **kwargs)
d55e5bfc 1089
15817c7e 1090 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1091 def __str__(self): return str(self.Get())
1092 def __repr__(self): return 'wx.Point'+str(self.Get())
1093 def __len__(self): return len(self.Get())
1094 def __getitem__(self, index): return self.Get()[index]
1095 def __setitem__(self, index, val):
1096 if index == 0: self.x = val
1097 elif index == 1: self.y = val
1098 else: raise IndexError
1099 def __nonzero__(self): return self.Get() != (0,0)
1100 __safe_for_unpickling__ = True
1101 def __reduce__(self): return (wx.Point, self.Get())
1102
2131d850 1103_core_.Point_swigregister(Point)
d55e5bfc
RD
1104
1105#---------------------------------------------------------------------------
1106
5b5c9bc7 1107class Rect(object):
d55e5bfc 1108 """
15817c7e
RD
1109 A class for representing and manipulating rectangles. It has x, y,
1110 width and height properties. In wxPython most palces that expect a
1111 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc 1112 """
1bd55598
RD
1113 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1114 __repr__ = _swig_repr
1115 def __init__(self, *args, **kwargs):
d55e5bfc 1116 """
5b5c9bc7 1117 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
d55e5bfc
RD
1118
1119 Create a new Rect object.
1120 """
1bd55598
RD
1121 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1122 __swig_destroy__ = _core_.delete_Rect
1123 __del__ = lambda self : None;
d55e5bfc
RD
1124 def GetX(*args, **kwargs):
1125 """GetX(self) -> int"""
5b5c9bc7 1126 return _core_.Rect_GetX(*args, **kwargs)
d55e5bfc
RD
1127
1128 def SetX(*args, **kwargs):
1129 """SetX(self, int x)"""
5b5c9bc7 1130 return _core_.Rect_SetX(*args, **kwargs)
d55e5bfc
RD
1131
1132 def GetY(*args, **kwargs):
1133 """GetY(self) -> int"""
5b5c9bc7 1134 return _core_.Rect_GetY(*args, **kwargs)
d55e5bfc
RD
1135
1136 def SetY(*args, **kwargs):
1137 """SetY(self, int y)"""
5b5c9bc7 1138 return _core_.Rect_SetY(*args, **kwargs)
d55e5bfc
RD
1139
1140 def GetWidth(*args, **kwargs):
1141 """GetWidth(self) -> int"""
5b5c9bc7 1142 return _core_.Rect_GetWidth(*args, **kwargs)
d55e5bfc
RD
1143
1144 def SetWidth(*args, **kwargs):
1145 """SetWidth(self, int w)"""
5b5c9bc7 1146 return _core_.Rect_SetWidth(*args, **kwargs)
d55e5bfc
RD
1147
1148 def GetHeight(*args, **kwargs):
1149 """GetHeight(self) -> int"""
5b5c9bc7 1150 return _core_.Rect_GetHeight(*args, **kwargs)
d55e5bfc
RD
1151
1152 def SetHeight(*args, **kwargs):
1153 """SetHeight(self, int h)"""
5b5c9bc7 1154 return _core_.Rect_SetHeight(*args, **kwargs)
d55e5bfc
RD
1155
1156 def GetPosition(*args, **kwargs):
5b5c9bc7
RD
1157 """GetPosition(self) -> Point"""
1158 return _core_.Rect_GetPosition(*args, **kwargs)
d55e5bfc
RD
1159
1160 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
1161 """SetPosition(self, Point p)"""
1162 return _core_.Rect_SetPosition(*args, **kwargs)
d55e5bfc
RD
1163
1164 def GetSize(*args, **kwargs):
5b5c9bc7
RD
1165 """GetSize(self) -> Size"""
1166 return _core_.Rect_GetSize(*args, **kwargs)
d55e5bfc
RD
1167
1168 def SetSize(*args, **kwargs):
5b5c9bc7
RD
1169 """SetSize(self, Size s)"""
1170 return _core_.Rect_SetSize(*args, **kwargs)
d55e5bfc 1171
aff4cc5c
RD
1172 def IsEmpty(*args, **kwargs):
1173 """IsEmpty(self) -> bool"""
5b5c9bc7 1174 return _core_.Rect_IsEmpty(*args, **kwargs)
aff4cc5c 1175
d55e5bfc 1176 def GetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1177 """GetTopLeft(self) -> Point"""
1178 return _core_.Rect_GetTopLeft(*args, **kwargs)
d55e5bfc
RD
1179
1180 def SetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1181 """SetTopLeft(self, Point p)"""
1182 return _core_.Rect_SetTopLeft(*args, **kwargs)
d55e5bfc
RD
1183
1184 def GetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1185 """GetBottomRight(self) -> Point"""
1186 return _core_.Rect_GetBottomRight(*args, **kwargs)
d55e5bfc
RD
1187
1188 def SetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1189 """SetBottomRight(self, Point p)"""
1190 return _core_.Rect_SetBottomRight(*args, **kwargs)
d55e5bfc
RD
1191
1192 def GetLeft(*args, **kwargs):
1193 """GetLeft(self) -> int"""
5b5c9bc7 1194 return _core_.Rect_GetLeft(*args, **kwargs)
d55e5bfc
RD
1195
1196 def GetTop(*args, **kwargs):
1197 """GetTop(self) -> int"""
5b5c9bc7 1198 return _core_.Rect_GetTop(*args, **kwargs)
d55e5bfc
RD
1199
1200 def GetBottom(*args, **kwargs):
1201 """GetBottom(self) -> int"""
5b5c9bc7 1202 return _core_.Rect_GetBottom(*args, **kwargs)
d55e5bfc
RD
1203
1204 def GetRight(*args, **kwargs):
1205 """GetRight(self) -> int"""
5b5c9bc7 1206 return _core_.Rect_GetRight(*args, **kwargs)
d55e5bfc
RD
1207
1208 def SetLeft(*args, **kwargs):
1209 """SetLeft(self, int left)"""
5b5c9bc7 1210 return _core_.Rect_SetLeft(*args, **kwargs)
d55e5bfc
RD
1211
1212 def SetRight(*args, **kwargs):
1213 """SetRight(self, int right)"""
5b5c9bc7 1214 return _core_.Rect_SetRight(*args, **kwargs)
d55e5bfc
RD
1215
1216 def SetTop(*args, **kwargs):
1217 """SetTop(self, int top)"""
5b5c9bc7 1218 return _core_.Rect_SetTop(*args, **kwargs)
d55e5bfc
RD
1219
1220 def SetBottom(*args, **kwargs):
1221 """SetBottom(self, int bottom)"""
5b5c9bc7 1222 return _core_.Rect_SetBottom(*args, **kwargs)
d55e5bfc
RD
1223
1224 position = property(GetPosition, SetPosition)
1225 size = property(GetSize, SetSize)
1226 left = property(GetLeft, SetLeft)
1227 right = property(GetRight, SetRight)
1228 top = property(GetTop, SetTop)
1229 bottom = property(GetBottom, SetBottom)
1230
1231 def Inflate(*args, **kwargs):
1232 """
5b5c9bc7 1233 Inflate(self, int dx, int dy) -> Rect
d55e5bfc 1234
091fdbfa
RD
1235 Increases the size of the rectangle.
1236
1237 The left border is moved farther left and the right border is moved
1238 farther right by ``dx``. The upper border is moved farther up and the
1239 bottom border is moved farther down by ``dy``. (Note the the width and
1240 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1241 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1242 opposite happens: the rectangle size decreases in the respective
1243 direction.
1244
1245 The change is made to the rectangle inplace, if instead you need a
1246 copy that is inflated, preserving the original then make the copy
1247 first::
1248
1249 copy = wx.Rect(*original)
1250 copy.Inflate(10,15)
1251
1252
d55e5bfc 1253 """
5b5c9bc7 1254 return _core_.Rect_Inflate(*args, **kwargs)
d55e5bfc
RD
1255
1256 def Deflate(*args, **kwargs):
1257 """
5b5c9bc7 1258 Deflate(self, int dx, int dy) -> Rect
d55e5bfc 1259
091fdbfa
RD
1260 Decrease the rectangle size. This method is the opposite of `Inflate`
1261 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1262 `Inflate` for a full description.
d55e5bfc 1263 """
5b5c9bc7 1264 return _core_.Rect_Deflate(*args, **kwargs)
d55e5bfc
RD
1265
1266 def OffsetXY(*args, **kwargs):
1267 """
1268 OffsetXY(self, int dx, int dy)
1269
15817c7e
RD
1270 Moves the rectangle by the specified offset. If dx is positive, the
1271 rectangle is moved to the right, if dy is positive, it is moved to the
1272 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc 1273 """
5b5c9bc7 1274 return _core_.Rect_OffsetXY(*args, **kwargs)
d55e5bfc
RD
1275
1276 def Offset(*args, **kwargs):
1277 """
5b5c9bc7 1278 Offset(self, Point pt)
d55e5bfc 1279
b1fcee84 1280 Same as `OffsetXY` but uses dx,dy from Point
d55e5bfc 1281 """
5b5c9bc7 1282 return _core_.Rect_Offset(*args, **kwargs)
d55e5bfc
RD
1283
1284 def Intersect(*args, **kwargs):
1285 """
5b5c9bc7 1286 Intersect(self, Rect rect) -> Rect
d55e5bfc 1287
5cbf236d 1288 Returns the intersectsion of this rectangle and rect.
d55e5bfc 1289 """
5b5c9bc7 1290 return _core_.Rect_Intersect(*args, **kwargs)
d55e5bfc 1291
5cbf236d
RD
1292 def Union(*args, **kwargs):
1293 """
5b5c9bc7 1294 Union(self, Rect rect) -> Rect
5cbf236d
RD
1295
1296 Returns the union of this rectangle and rect.
1297 """
5b5c9bc7 1298 return _core_.Rect_Union(*args, **kwargs)
5cbf236d 1299
d55e5bfc
RD
1300 def __add__(*args, **kwargs):
1301 """
5b5c9bc7 1302 __add__(self, Rect rect) -> Rect
d55e5bfc
RD
1303
1304 Add the properties of rect to this rectangle and return the result.
1305 """
5b5c9bc7 1306 return _core_.Rect___add__(*args, **kwargs)
d55e5bfc
RD
1307
1308 def __iadd__(*args, **kwargs):
1309 """
5b5c9bc7 1310 __iadd__(self, Rect rect) -> Rect
d55e5bfc
RD
1311
1312 Add the properties of rect to this rectangle, updating this rectangle.
1313 """
5b5c9bc7 1314 return _core_.Rect___iadd__(*args, **kwargs)
d55e5bfc
RD
1315
1316 def __eq__(*args, **kwargs):
1317 """
e9d6f3a4 1318 __eq__(self, PyObject other) -> bool
d55e5bfc 1319
e9d6f3a4 1320 Test for equality of wx.Rect objects.
d55e5bfc 1321 """
5b5c9bc7 1322 return _core_.Rect___eq__(*args, **kwargs)
d55e5bfc
RD
1323
1324 def __ne__(*args, **kwargs):
1325 """
e9d6f3a4 1326 __ne__(self, PyObject other) -> bool
d55e5bfc 1327
e9d6f3a4 1328 Test for inequality of wx.Rect objects.
d55e5bfc 1329 """
5b5c9bc7 1330 return _core_.Rect___ne__(*args, **kwargs)
d55e5bfc
RD
1331
1332 def InsideXY(*args, **kwargs):
1333 """
1334 InsideXY(self, int x, int y) -> bool
1335
1336 Return True if the point is (not strcitly) inside the rect.
1337 """
5b5c9bc7 1338 return _core_.Rect_InsideXY(*args, **kwargs)
d55e5bfc
RD
1339
1340 def Inside(*args, **kwargs):
1341 """
5b5c9bc7 1342 Inside(self, Point pt) -> bool
d55e5bfc
RD
1343
1344 Return True if the point is (not strcitly) inside the rect.
1345 """
5b5c9bc7 1346 return _core_.Rect_Inside(*args, **kwargs)
d55e5bfc
RD
1347
1348 def Intersects(*args, **kwargs):
1349 """
5b5c9bc7 1350 Intersects(self, Rect rect) -> bool
d55e5bfc
RD
1351
1352 Returns True if the rectangles have a non empty intersection.
1353 """
5b5c9bc7 1354 return _core_.Rect_Intersects(*args, **kwargs)
d55e5bfc 1355
b1fcee84
RD
1356 def CenterIn(*args, **kwargs):
1357 """
1358 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1359
1360 Center this rectangle within the one passed to the method, which is
1361 usually, but not necessarily, the larger one.
1362 """
1363 return _core_.Rect_CenterIn(*args, **kwargs)
1364
1365 CentreIn = CenterIn
5b5c9bc7
RD
1366 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1367 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1368 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1369 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
d55e5bfc
RD
1370 def Set(*args, **kwargs):
1371 """
1372 Set(self, int x=0, int y=0, int width=0, int height=0)
1373
1374 Set all rectangle properties.
1375 """
5b5c9bc7 1376 return _core_.Rect_Set(*args, **kwargs)
d55e5bfc
RD
1377
1378 def Get(*args, **kwargs):
1379 """
1380 Get() -> (x,y,width,height)
1381
1382 Return the rectangle properties as a tuple.
1383 """
5b5c9bc7 1384 return _core_.Rect_Get(*args, **kwargs)
d55e5bfc 1385
15817c7e 1386 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1387 def __str__(self): return str(self.Get())
1388 def __repr__(self): return 'wx.Rect'+str(self.Get())
1389 def __len__(self): return len(self.Get())
1390 def __getitem__(self, index): return self.Get()[index]
1391 def __setitem__(self, index, val):
1392 if index == 0: self.x = val
1393 elif index == 1: self.y = val
1394 elif index == 2: self.width = val
1395 elif index == 3: self.height = val
1396 else: raise IndexError
1397 def __nonzero__(self): return self.Get() != (0,0,0,0)
1398 __safe_for_unpickling__ = True
1399 def __reduce__(self): return (wx.Rect, self.Get())
1400
2131d850 1401_core_.Rect_swigregister(Rect)
d55e5bfc
RD
1402
1403def RectPP(*args, **kwargs):
1404 """
5b5c9bc7 1405 RectPP(Point topLeft, Point bottomRight) -> Rect
d55e5bfc
RD
1406
1407 Create a new Rect object from Points representing two corners.
1408 """
5b5c9bc7 1409 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1410 return val
1411
1412def RectPS(*args, **kwargs):
1413 """
5b5c9bc7 1414 RectPS(Point pos, Size size) -> Rect
d55e5bfc
RD
1415
1416 Create a new Rect from a position and size.
1417 """
5b5c9bc7 1418 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1419 return val
1420
070c48b4
RD
1421def RectS(*args, **kwargs):
1422 """
5b5c9bc7 1423 RectS(Size size) -> Rect
070c48b4
RD
1424
1425 Create a new Rect from a size only.
1426 """
5b5c9bc7 1427 val = _core_.new_RectS(*args, **kwargs)
070c48b4
RD
1428 return val
1429
d55e5bfc 1430
5b5c9bc7 1431def IntersectRect(*args, **kwargs):
1bd55598 1432 """
d55e5bfc
RD
1433 IntersectRect(Rect r1, Rect r2) -> Rect
1434
1435 Calculate and return the intersection of r1 and r2.
1436 """
1bd55598 1437 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1438#---------------------------------------------------------------------------
1439
5b5c9bc7 1440class Point2D(object):
15817c7e
RD
1441 """
1442 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1443 with floating point values.
1444 """
1bd55598
RD
1445 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1446 __repr__ = _swig_repr
1447 def __init__(self, *args, **kwargs):
d55e5bfc 1448 """
5b5c9bc7 1449 __init__(self, double x=0.0, double y=0.0) -> Point2D
d55e5bfc
RD
1450
1451 Create a w.Point2D object.
1452 """
1bd55598 1453 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
d55e5bfc 1454 def GetFloor(*args, **kwargs):
fd2dc343
RD
1455 """
1456 GetFloor() -> (x,y)
1457
1458 Convert to integer
1459 """
5b5c9bc7 1460 return _core_.Point2D_GetFloor(*args, **kwargs)
d55e5bfc
RD
1461
1462 def GetRounded(*args, **kwargs):
fd2dc343
RD
1463 """
1464 GetRounded() -> (x,y)
1465
1466 Convert to integer
1467 """
5b5c9bc7 1468 return _core_.Point2D_GetRounded(*args, **kwargs)
d55e5bfc
RD
1469
1470 def GetVectorLength(*args, **kwargs):
1471 """GetVectorLength(self) -> double"""
5b5c9bc7 1472 return _core_.Point2D_GetVectorLength(*args, **kwargs)
d55e5bfc
RD
1473
1474 def GetVectorAngle(*args, **kwargs):
1475 """GetVectorAngle(self) -> double"""
5b5c9bc7 1476 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1477
1478 def SetVectorLength(*args, **kwargs):
1479 """SetVectorLength(self, double length)"""
5b5c9bc7 1480 return _core_.Point2D_SetVectorLength(*args, **kwargs)
d55e5bfc
RD
1481
1482 def SetVectorAngle(*args, **kwargs):
1483 """SetVectorAngle(self, double degrees)"""
5b5c9bc7 1484 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1485
1486 def SetPolarCoordinates(self, angle, length):
1487 self.SetVectorLength(length)
1488 self.SetVectorAngle(angle)
1489 def Normalize(self):
1490 self.SetVectorLength(1.0)
1491
1492 def GetDistance(*args, **kwargs):
5b5c9bc7
RD
1493 """GetDistance(self, Point2D pt) -> double"""
1494 return _core_.Point2D_GetDistance(*args, **kwargs)
d55e5bfc
RD
1495
1496 def GetDistanceSquare(*args, **kwargs):
5b5c9bc7
RD
1497 """GetDistanceSquare(self, Point2D pt) -> double"""
1498 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
d55e5bfc
RD
1499
1500 def GetDotProduct(*args, **kwargs):
5b5c9bc7
RD
1501 """GetDotProduct(self, Point2D vec) -> double"""
1502 return _core_.Point2D_GetDotProduct(*args, **kwargs)
d55e5bfc
RD
1503
1504 def GetCrossProduct(*args, **kwargs):
5b5c9bc7
RD
1505 """GetCrossProduct(self, Point2D vec) -> double"""
1506 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
d55e5bfc
RD
1507
1508 def __neg__(*args, **kwargs):
1509 """
5b5c9bc7 1510 __neg__(self) -> Point2D
d55e5bfc
RD
1511
1512 the reflection of this point
1513 """
5b5c9bc7 1514 return _core_.Point2D___neg__(*args, **kwargs)
d55e5bfc
RD
1515
1516 def __iadd__(*args, **kwargs):
5b5c9bc7
RD
1517 """__iadd__(self, Point2D pt) -> Point2D"""
1518 return _core_.Point2D___iadd__(*args, **kwargs)
d55e5bfc
RD
1519
1520 def __isub__(*args, **kwargs):
5b5c9bc7
RD
1521 """__isub__(self, Point2D pt) -> Point2D"""
1522 return _core_.Point2D___isub__(*args, **kwargs)
d55e5bfc
RD
1523
1524 def __imul__(*args, **kwargs):
5b5c9bc7
RD
1525 """__imul__(self, Point2D pt) -> Point2D"""
1526 return _core_.Point2D___imul__(*args, **kwargs)
d55e5bfc
RD
1527
1528 def __idiv__(*args, **kwargs):
5b5c9bc7
RD
1529 """__idiv__(self, Point2D pt) -> Point2D"""
1530 return _core_.Point2D___idiv__(*args, **kwargs)
d55e5bfc
RD
1531
1532 def __eq__(*args, **kwargs):
1533 """
e9d6f3a4 1534 __eq__(self, PyObject other) -> bool
d55e5bfc 1535
e9d6f3a4 1536 Test for equality of wx.Point2D objects.
d55e5bfc 1537 """
5b5c9bc7 1538 return _core_.Point2D___eq__(*args, **kwargs)
d55e5bfc
RD
1539
1540 def __ne__(*args, **kwargs):
1541 """
e9d6f3a4 1542 __ne__(self, PyObject other) -> bool
d55e5bfc 1543
e9d6f3a4 1544 Test for inequality of wx.Point2D objects.
d55e5bfc 1545 """
5b5c9bc7 1546 return _core_.Point2D___ne__(*args, **kwargs)
d55e5bfc 1547
5b5c9bc7
RD
1548 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1549 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
d55e5bfc
RD
1550 def Set(*args, **kwargs):
1551 """Set(self, double x=0, double y=0)"""
5b5c9bc7 1552 return _core_.Point2D_Set(*args, **kwargs)
d55e5bfc
RD
1553
1554 def Get(*args, **kwargs):
1555 """
1556 Get() -> (x,y)
1557
1558 Return x and y properties as a tuple.
1559 """
5b5c9bc7 1560 return _core_.Point2D_Get(*args, **kwargs)
d55e5bfc 1561
15817c7e 1562 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1563 def __str__(self): return str(self.Get())
1564 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1565 def __len__(self): return len(self.Get())
1566 def __getitem__(self, index): return self.Get()[index]
1567 def __setitem__(self, index, val):
1568 if index == 0: self.x = val
1569 elif index == 1: self.y = val
1570 else: raise IndexError
1571 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1572 __safe_for_unpickling__ = True
1573 def __reduce__(self): return (wx.Point2D, self.Get())
1574
2131d850 1575_core_.Point2D_swigregister(Point2D)
d55e5bfc
RD
1576
1577def Point2DCopy(*args, **kwargs):
1578 """
5b5c9bc7 1579 Point2DCopy(Point2D pt) -> Point2D
d55e5bfc
RD
1580
1581 Create a w.Point2D object.
1582 """
5b5c9bc7 1583 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1584 return val
1585
1586def Point2DFromPoint(*args, **kwargs):
1587 """
5b5c9bc7 1588 Point2DFromPoint(Point pt) -> Point2D
d55e5bfc
RD
1589
1590 Create a w.Point2D object.
1591 """
5b5c9bc7 1592 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d55e5bfc
RD
1593 return val
1594
1595#---------------------------------------------------------------------------
1596
5b5c9bc7
RD
1597FromStart = _core_.FromStart
1598FromCurrent = _core_.FromCurrent
1599FromEnd = _core_.FromEnd
d55e5bfc 1600class InputStream(object):
36ed4f51 1601 """Proxy of C++ InputStream class"""
1bd55598
RD
1602 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1603 __repr__ = _swig_repr
1604 def __init__(self, *args, **kwargs):
d55e5bfc 1605 """__init__(self, PyObject p) -> InputStream"""
1bd55598
RD
1606 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1607 __swig_destroy__ = _core_.delete_InputStream
1608 __del__ = lambda self : None;
d55e5bfc
RD
1609 def close(*args, **kwargs):
1610 """close(self)"""
5b5c9bc7 1611 return _core_.InputStream_close(*args, **kwargs)
d55e5bfc
RD
1612
1613 def flush(*args, **kwargs):
1614 """flush(self)"""
5b5c9bc7 1615 return _core_.InputStream_flush(*args, **kwargs)
d55e5bfc
RD
1616
1617 def eof(*args, **kwargs):
1618 """eof(self) -> bool"""
5b5c9bc7 1619 return _core_.InputStream_eof(*args, **kwargs)
d55e5bfc
RD
1620
1621 def read(*args, **kwargs):
1622 """read(self, int size=-1) -> PyObject"""
5b5c9bc7 1623 return _core_.InputStream_read(*args, **kwargs)
d55e5bfc
RD
1624
1625 def readline(*args, **kwargs):
1626 """readline(self, int size=-1) -> PyObject"""
5b5c9bc7 1627 return _core_.InputStream_readline(*args, **kwargs)
d55e5bfc
RD
1628
1629 def readlines(*args, **kwargs):
1630 """readlines(self, int sizehint=-1) -> PyObject"""
5b5c9bc7 1631 return _core_.InputStream_readlines(*args, **kwargs)
d55e5bfc
RD
1632
1633 def seek(*args, **kwargs):
1634 """seek(self, int offset, int whence=0)"""
5b5c9bc7 1635 return _core_.InputStream_seek(*args, **kwargs)
d55e5bfc
RD
1636
1637 def tell(*args, **kwargs):
1638 """tell(self) -> int"""
5b5c9bc7 1639 return _core_.InputStream_tell(*args, **kwargs)
d55e5bfc
RD
1640
1641 def Peek(*args, **kwargs):
1642 """Peek(self) -> char"""
5b5c9bc7 1643 return _core_.InputStream_Peek(*args, **kwargs)
d55e5bfc
RD
1644
1645 def GetC(*args, **kwargs):
1646 """GetC(self) -> char"""
5b5c9bc7 1647 return _core_.InputStream_GetC(*args, **kwargs)
d55e5bfc
RD
1648
1649 def LastRead(*args, **kwargs):
1650 """LastRead(self) -> size_t"""
5b5c9bc7 1651 return _core_.InputStream_LastRead(*args, **kwargs)
d55e5bfc
RD
1652
1653 def CanRead(*args, **kwargs):
1654 """CanRead(self) -> bool"""
5b5c9bc7 1655 return _core_.InputStream_CanRead(*args, **kwargs)
d55e5bfc
RD
1656
1657 def Eof(*args, **kwargs):
1658 """Eof(self) -> bool"""
5b5c9bc7 1659 return _core_.InputStream_Eof(*args, **kwargs)
d55e5bfc
RD
1660
1661 def Ungetch(*args, **kwargs):
1662 """Ungetch(self, char c) -> bool"""
5b5c9bc7 1663 return _core_.InputStream_Ungetch(*args, **kwargs)
d55e5bfc
RD
1664
1665 def SeekI(*args, **kwargs):
5b5c9bc7
RD
1666 """SeekI(self, long pos, int mode=FromStart) -> long"""
1667 return _core_.InputStream_SeekI(*args, **kwargs)
d55e5bfc
RD
1668
1669 def TellI(*args, **kwargs):
1670 """TellI(self) -> long"""
5b5c9bc7 1671 return _core_.InputStream_TellI(*args, **kwargs)
d55e5bfc 1672
2131d850 1673_core_.InputStream_swigregister(InputStream)
5b5c9bc7
RD
1674DefaultPosition = cvar.DefaultPosition
1675DefaultSize = cvar.DefaultSize
d55e5bfc 1676
5b5c9bc7
RD
1677class OutputStream(object):
1678 """Proxy of C++ OutputStream class"""
1bd55598
RD
1679 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1680 def __init__(self): raise AttributeError, "No constructor defined"
1681 __repr__ = _swig_repr
d55e5bfc
RD
1682 def write(*args, **kwargs):
1683 """write(self, PyObject obj)"""
5b5c9bc7 1684 return _core_.OutputStream_write(*args, **kwargs)
d55e5bfc 1685
1bd55598
RD
1686 def LastWrite(*args, **kwargs):
1687 """LastWrite(self) -> size_t"""
1688 return _core_.OutputStream_LastWrite(*args, **kwargs)
d55e5bfc 1689
2131d850 1690_core_.OutputStream_swigregister(OutputStream)
d55e5bfc
RD
1691
1692#---------------------------------------------------------------------------
1693
5b5c9bc7
RD
1694class FSFile(Object):
1695 """Proxy of C++ FSFile class"""
1bd55598
RD
1696 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1697 __repr__ = _swig_repr
1698 def __init__(self, *args, **kwargs):
d55e5bfc 1699 """
5b5c9bc7
RD
1700 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1701 DateTime modif) -> FSFile
d55e5bfc 1702 """
1bd55598 1703 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1bd55598
RD
1704 __swig_destroy__ = _core_.delete_FSFile
1705 __del__ = lambda self : None;
d55e5bfc 1706 def GetStream(*args, **kwargs):
5b5c9bc7
RD
1707 """GetStream(self) -> InputStream"""
1708 return _core_.FSFile_GetStream(*args, **kwargs)
d55e5bfc
RD
1709
1710 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
1711 """GetMimeType(self) -> String"""
1712 return _core_.FSFile_GetMimeType(*args, **kwargs)
d55e5bfc
RD
1713
1714 def GetLocation(*args, **kwargs):
5b5c9bc7
RD
1715 """GetLocation(self) -> String"""
1716 return _core_.FSFile_GetLocation(*args, **kwargs)
d55e5bfc
RD
1717
1718 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1719 """GetAnchor(self) -> String"""
1720 return _core_.FSFile_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1721
1722 def GetModificationTime(*args, **kwargs):
5b5c9bc7
RD
1723 """GetModificationTime(self) -> DateTime"""
1724 return _core_.FSFile_GetModificationTime(*args, **kwargs)
d55e5bfc 1725
2131d850 1726_core_.FSFile_swigregister(FSFile)
d55e5bfc
RD
1727
1728class CPPFileSystemHandler(object):
36ed4f51 1729 """Proxy of C++ CPPFileSystemHandler class"""
1bd55598
RD
1730 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1731 def __init__(self): raise AttributeError, "No constructor defined"
1732 __repr__ = _swig_repr
50f151d7
RD
1733 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1734 __del__ = lambda self : None;
2131d850 1735_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d55e5bfc
RD
1736
1737class FileSystemHandler(CPPFileSystemHandler):
36ed4f51 1738 """Proxy of C++ FileSystemHandler class"""
1bd55598
RD
1739 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1740 __repr__ = _swig_repr
1741 def __init__(self, *args, **kwargs):
d55e5bfc 1742 """__init__(self) -> FileSystemHandler"""
1bd55598 1743 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
d55e5bfc
RD
1744 self._setCallbackInfo(self, FileSystemHandler)
1745
1746 def _setCallbackInfo(*args, **kwargs):
1747 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 1748 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
1749
1750 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1751 """CanOpen(self, String location) -> bool"""
1752 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1753
1754 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1755 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1756 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1757
1758 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1759 """FindFirst(self, String spec, int flags=0) -> String"""
1760 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1761
1762 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1763 """FindNext(self) -> String"""
1764 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
1765
1766 def GetProtocol(*args, **kwargs):
5b5c9bc7
RD
1767 """GetProtocol(self, String location) -> String"""
1768 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
d55e5bfc
RD
1769
1770 def GetLeftLocation(*args, **kwargs):
5b5c9bc7
RD
1771 """GetLeftLocation(self, String location) -> String"""
1772 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
d55e5bfc
RD
1773
1774 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1775 """GetAnchor(self, String location) -> String"""
1776 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1777
1778 def GetRightLocation(*args, **kwargs):
5b5c9bc7
RD
1779 """GetRightLocation(self, String location) -> String"""
1780 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
d55e5bfc
RD
1781
1782 def GetMimeTypeFromExt(*args, **kwargs):
5b5c9bc7
RD
1783 """GetMimeTypeFromExt(self, String location) -> String"""
1784 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
d55e5bfc 1785
2131d850 1786_core_.FileSystemHandler_swigregister(FileSystemHandler)
d55e5bfc 1787
5b5c9bc7
RD
1788class FileSystem(Object):
1789 """Proxy of C++ FileSystem class"""
1bd55598
RD
1790 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1791 __repr__ = _swig_repr
1792 def __init__(self, *args, **kwargs):
5b5c9bc7 1793 """__init__(self) -> FileSystem"""
1bd55598
RD
1794 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1795 __swig_destroy__ = _core_.delete_FileSystem
1796 __del__ = lambda self : None;
d55e5bfc 1797 def ChangePathTo(*args, **kwargs):
5b5c9bc7
RD
1798 """ChangePathTo(self, String location, bool is_dir=False)"""
1799 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
d55e5bfc
RD
1800
1801 def GetPath(*args, **kwargs):
5b5c9bc7
RD
1802 """GetPath(self) -> String"""
1803 return _core_.FileSystem_GetPath(*args, **kwargs)
d55e5bfc
RD
1804
1805 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1806 """OpenFile(self, String location) -> FSFile"""
1807 return _core_.FileSystem_OpenFile(*args, **kwargs)
d55e5bfc
RD
1808
1809 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1810 """FindFirst(self, String spec, int flags=0) -> String"""
1811 return _core_.FileSystem_FindFirst(*args, **kwargs)
d55e5bfc
RD
1812
1813 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1814 """FindNext(self) -> String"""
1815 return _core_.FileSystem_FindNext(*args, **kwargs)
d55e5bfc
RD
1816
1817 def AddHandler(*args, **kwargs):
d6c14a4c 1818 """AddHandler(CPPFileSystemHandler handler)"""
5b5c9bc7 1819 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc
RD
1820
1821 AddHandler = staticmethod(AddHandler)
1822 def CleanUpHandlers(*args, **kwargs):
d6c14a4c 1823 """CleanUpHandlers()"""
5b5c9bc7 1824 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc
RD
1825
1826 CleanUpHandlers = staticmethod(CleanUpHandlers)
1827 def FileNameToURL(*args, **kwargs):
5b5c9bc7
RD
1828 """FileNameToURL(String filename) -> String"""
1829 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc
RD
1830
1831 FileNameToURL = staticmethod(FileNameToURL)
b411df4a 1832 def URLToFileName(*args, **kwargs):
5b5c9bc7
RD
1833 """URLToFileName(String url) -> String"""
1834 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a
RD
1835
1836 URLToFileName = staticmethod(URLToFileName)
2131d850 1837_core_.FileSystem_swigregister(FileSystem)
d55e5bfc 1838
5b5c9bc7 1839def FileSystem_AddHandler(*args, **kwargs):
1bd55598
RD
1840 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1841 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 1842
1bd55598
RD
1843def FileSystem_CleanUpHandlers(*args):
1844 """FileSystem_CleanUpHandlers()"""
1845 return _core_.FileSystem_CleanUpHandlers(*args)
d55e5bfc 1846
5b5c9bc7 1847def FileSystem_FileNameToURL(*args, **kwargs):
1bd55598
RD
1848 """FileSystem_FileNameToURL(String filename) -> String"""
1849 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 1850
5b5c9bc7 1851def FileSystem_URLToFileName(*args, **kwargs):
1bd55598
RD
1852 """FileSystem_URLToFileName(String url) -> String"""
1853 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a 1854
5b5c9bc7
RD
1855class InternetFSHandler(CPPFileSystemHandler):
1856 """Proxy of C++ InternetFSHandler class"""
1bd55598
RD
1857 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1858 __repr__ = _swig_repr
1859 def __init__(self, *args, **kwargs):
5b5c9bc7 1860 """__init__(self) -> InternetFSHandler"""
1bd55598 1861 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
d55e5bfc 1862 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1863 """CanOpen(self, String location) -> bool"""
1864 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1865
1866 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1867 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1868 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
d55e5bfc 1869
2131d850 1870_core_.InternetFSHandler_swigregister(InternetFSHandler)
d55e5bfc 1871
5b5c9bc7
RD
1872class ZipFSHandler(CPPFileSystemHandler):
1873 """Proxy of C++ ZipFSHandler class"""
1bd55598
RD
1874 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1875 __repr__ = _swig_repr
1876 def __init__(self, *args, **kwargs):
5b5c9bc7 1877 """__init__(self) -> ZipFSHandler"""
1bd55598 1878 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
d55e5bfc 1879 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1880 """CanOpen(self, String location) -> bool"""
1881 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1882
1883 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1884 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1885 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1886
1887 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1888 """FindFirst(self, String spec, int flags=0) -> String"""
1889 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1890
1891 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1892 """FindNext(self) -> String"""
1893 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
d55e5bfc 1894
2131d850 1895_core_.ZipFSHandler_swigregister(ZipFSHandler)
d55e5bfc
RD
1896
1897
1898def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1bd55598
RD
1899 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1900 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d55e5bfc
RD
1901
1902def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1bd55598
RD
1903 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1904 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d55e5bfc
RD
1905
1906def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1bd55598
RD
1907 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1908 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
b411df4a
RD
1909def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1910 """
1911 Add 'file' to the memory filesystem. The dataItem parameter can
1912 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1913 arbitrary data. If a bitmap or image is used then the imgType
1914 parameter should specify what kind of image file it should be
1915 written as, wx.BITMAP_TYPE_PNG, etc.
1916 """
1917 if isinstance(dataItem, wx.Image):
1918 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1919 elif isinstance(dataItem, wx.Bitmap):
1920 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1921 elif type(dataItem) == str:
1922 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1923 else:
1924 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc 1925
5b5c9bc7
RD
1926class MemoryFSHandler(CPPFileSystemHandler):
1927 """Proxy of C++ MemoryFSHandler class"""
1bd55598
RD
1928 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1929 __repr__ = _swig_repr
1930 def __init__(self, *args, **kwargs):
5b5c9bc7 1931 """__init__(self) -> MemoryFSHandler"""
1bd55598 1932 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
d55e5bfc 1933 def RemoveFile(*args, **kwargs):
5b5c9bc7
RD
1934 """RemoveFile(String filename)"""
1935 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc
RD
1936
1937 RemoveFile = staticmethod(RemoveFile)
1938 AddFile = staticmethod(MemoryFSHandler_AddFile)
1939 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1940 """CanOpen(self, String location) -> bool"""
1941 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1942
1943 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1944 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1945 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1946
1947 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1948 """FindFirst(self, String spec, int flags=0) -> String"""
1949 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1950
1951 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1952 """FindNext(self) -> String"""
1953 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
d55e5bfc 1954
2131d850 1955_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d55e5bfc 1956
5b5c9bc7 1957def MemoryFSHandler_RemoveFile(*args, **kwargs):
1bd55598
RD
1958 """MemoryFSHandler_RemoveFile(String filename)"""
1959 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 1960
5b5c9bc7
RD
1961IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1962IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1963IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d55e5bfc
RD
1964#---------------------------------------------------------------------------
1965
5b5c9bc7 1966class ImageHandler(Object):
27fb7603
RD
1967 """
1968 This is the base class for implementing image file loading/saving, and
1969 image creation from data. It is used within `wx.Image` and is not
1970 normally seen by the application.
1971 """
1bd55598
RD
1972 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1973 def __init__(self): raise AttributeError, "No constructor defined"
1974 __repr__ = _swig_repr
d55e5bfc 1975 def GetName(*args, **kwargs):
5b5c9bc7
RD
1976 """GetName(self) -> String"""
1977 return _core_.ImageHandler_GetName(*args, **kwargs)
d55e5bfc
RD
1978
1979 def GetExtension(*args, **kwargs):
5b5c9bc7
RD
1980 """GetExtension(self) -> String"""
1981 return _core_.ImageHandler_GetExtension(*args, **kwargs)
d55e5bfc
RD
1982
1983 def GetType(*args, **kwargs):
1984 """GetType(self) -> long"""
5b5c9bc7 1985 return _core_.ImageHandler_GetType(*args, **kwargs)
d55e5bfc
RD
1986
1987 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
1988 """GetMimeType(self) -> String"""
1989 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
d55e5bfc
RD
1990
1991 def CanRead(*args, **kwargs):
5b5c9bc7
RD
1992 """CanRead(self, String name) -> bool"""
1993 return _core_.ImageHandler_CanRead(*args, **kwargs)
d55e5bfc 1994
b02396e8
RD
1995 def CanReadStream(*args, **kwargs):
1996 """CanReadStream(self, InputStream stream) -> bool"""
1997 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
1998
d55e5bfc 1999 def SetName(*args, **kwargs):
5b5c9bc7
RD
2000 """SetName(self, String name)"""
2001 return _core_.ImageHandler_SetName(*args, **kwargs)
d55e5bfc
RD
2002
2003 def SetExtension(*args, **kwargs):
5b5c9bc7
RD
2004 """SetExtension(self, String extension)"""
2005 return _core_.ImageHandler_SetExtension(*args, **kwargs)
d55e5bfc
RD
2006
2007 def SetType(*args, **kwargs):
2008 """SetType(self, long type)"""
5b5c9bc7 2009 return _core_.ImageHandler_SetType(*args, **kwargs)
d55e5bfc
RD
2010
2011 def SetMimeType(*args, **kwargs):
5b5c9bc7
RD
2012 """SetMimeType(self, String mimetype)"""
2013 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
d55e5bfc 2014
2131d850 2015_core_.ImageHandler_swigregister(ImageHandler)
d55e5bfc 2016
943e8dfd
RD
2017class PyImageHandler(ImageHandler):
2018 """
2019 This is the base class for implementing image file loading/saving, and
2020 image creation from data, all written in Python. To create a custom
2021 image handler derive a new class from wx.PyImageHandler and provide
2022 the following methods::
2023
2024 def DoCanRead(self, stream) --> bool
2025 '''Check if this handler can read the image on the stream'''
2026
2027 def LoadFile(self, image, stream, verbose, index) --> bool
2028 '''Load image data from the stream and load it into image.'''
2029
2030 def SaveFile(self, image, stream, verbose) --> bool
2031 '''Save the iamge data in image to the stream using
2032 this handler's image file format.'''
2033
2034 def GetImageCount(self, stream) --> int
2035 '''If this image format can hold more than one image,
2036 how many does the image on the stream have?'''
2037
2038 To activate your handler create an instance of it and pass it to
2039 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2040 `SetExtension` from your constructor.
2041
2042 """
1bd55598
RD
2043 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2044 __repr__ = _swig_repr
2045 def __init__(self, *args, **kwargs):
943e8dfd
RD
2046 """
2047 __init__(self) -> PyImageHandler
2048
2049 This is the base class for implementing image file loading/saving, and
2050 image creation from data, all written in Python. To create a custom
2051 image handler derive a new class from wx.PyImageHandler and provide
2052 the following methods::
2053
2054 def DoCanRead(self, stream) --> bool
2055 '''Check if this handler can read the image on the stream'''
2056
2057 def LoadFile(self, image, stream, verbose, index) --> bool
2058 '''Load image data from the stream and load it into image.'''
2059
2060 def SaveFile(self, image, stream, verbose) --> bool
2061 '''Save the iamge data in image to the stream using
2062 this handler's image file format.'''
2063
2064 def GetImageCount(self, stream) --> int
2065 '''If this image format can hold more than one image,
2066 how many does the image on the stream have?'''
2067
2068 To activate your handler create an instance of it and pass it to
2069 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2070 `SetExtension` from your constructor.
2071
2072 """
1bd55598 2073 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
RD
2074 self._SetSelf(self)
2075
2076 def _SetSelf(*args, **kwargs):
2077 """_SetSelf(self, PyObject self)"""
2078 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2079
2131d850 2080_core_.PyImageHandler_swigregister(PyImageHandler)
943e8dfd 2081
5b5c9bc7
RD
2082class ImageHistogram(object):
2083 """Proxy of C++ ImageHistogram class"""
1bd55598
RD
2084 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2085 __repr__ = _swig_repr
2086 def __init__(self, *args, **kwargs):
5b5c9bc7 2087 """__init__(self) -> ImageHistogram"""
1bd55598 2088 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
d55e5bfc
RD
2089 def MakeKey(*args, **kwargs):
2090 """
7a27cf7c 2091 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2092
2093 Get the key in the histogram for the given RGB values
2094 """
5b5c9bc7 2095 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc
RD
2096
2097 MakeKey = staticmethod(MakeKey)
2098 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2099 """
2100 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2101
2102 Find first colour that is not used in the image and has higher RGB
2103 values than startR, startG, startB. Returns a tuple consisting of a
2104 success flag and rgb values.
2105 """
5b5c9bc7 2106 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2107
f1cbd8fa
RD
2108 def GetCount(*args, **kwargs):
2109 """
2110 GetCount(self, unsigned long key) -> unsigned long
2111
2112 Returns the pixel count for the given key. Use `MakeKey` to create a
2113 key value from a RGB tripple.
2114 """
5b5c9bc7 2115 return _core_.ImageHistogram_GetCount(*args, **kwargs)
f1cbd8fa
RD
2116
2117 def GetCountRGB(*args, **kwargs):
2118 """
7a27cf7c 2119 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2120
2121 Returns the pixel count for the given RGB values.
2122 """
5b5c9bc7 2123 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
f1cbd8fa
RD
2124
2125 def GetCountColour(*args, **kwargs):
2126 """
5b5c9bc7 2127 GetCountColour(self, Colour colour) -> unsigned long
f1cbd8fa
RD
2128
2129 Returns the pixel count for the given `wx.Colour` value.
2130 """
5b5c9bc7 2131 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
f1cbd8fa 2132
2131d850 2133_core_.ImageHistogram_swigregister(ImageHistogram)
d55e5bfc 2134
5b5c9bc7 2135def ImageHistogram_MakeKey(*args, **kwargs):
1bd55598 2136 """
7a27cf7c 2137 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2138
2139 Get the key in the histogram for the given RGB values
2140 """
1bd55598 2141 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2142
943e8dfd
RD
2143class Image_RGBValue(object):
2144 """
2145 An object that contains values for red, green and blue which represent
2146 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2147 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2148 color space.
2149 """
1bd55598
RD
2150 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2151 __repr__ = _swig_repr
2152 def __init__(self, *args, **kwargs):
943e8dfd
RD
2153 """
2154 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2155
2156 Constructor.
2157 """
1bd55598 2158 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
2159 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2160 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2161 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2162_core_.Image_RGBValue_swigregister(Image_RGBValue)
943e8dfd
RD
2163
2164class Image_HSVValue(object):
2165 """
2166 An object that contains values for hue, saturation and value which
2167 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2168 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2169 color space.
2170 """
1bd55598
RD
2171 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2172 __repr__ = _swig_repr
2173 def __init__(self, *args, **kwargs):
943e8dfd
RD
2174 """
2175 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2176
2177 Constructor.
2178 """
1bd55598 2179 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
2180 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2181 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2182 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2183_core_.Image_HSVValue_swigregister(Image_HSVValue)
943e8dfd 2184
5b5c9bc7 2185class Image(Object):
7a27cf7c
RD
2186 """
2187 A platform-independent image class. An image can be created from
2188 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2189 variety of formats. Functions are available to set and get image
2190 bits, so it can be used for basic image manipulation.
2191
2192 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2193 platform-specific `wx.Bitmap` object must be created from it using the
2194 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2195 device context, using `wx.DC.DrawBitmap`.
2196
2197 One colour value of the image may be used as a mask colour which will
2198 lead to the automatic creation of a `wx.Mask` object associated to the
2199 bitmap object.
2200
2201 wx.Image supports alpha channel data, that is in addition to a byte
2202 for the red, green and blue colour components for each pixel it also
2203 stores a byte representing the pixel opacity. An alpha value of 0
2204 corresponds to a transparent pixel (null opacity) while a value of 255
2205 means that the pixel is 100% opaque.
2206
2207 Unlike RGB data, not all images have an alpha channel and before using
2208 `GetAlpha` you should check if this image contains an alpha channel
2209 with `HasAlpha`. Note that currently only images loaded from PNG files
2210 with transparency information will have an alpha channel.
2211 """
1bd55598
RD
2212 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2213 __repr__ = _swig_repr
2214 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2215 """
2216 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2217
2218 Loads an image from a file.
2219 """
1bd55598
RD
2220 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2221 __swig_destroy__ = _core_.delete_Image
2222 __del__ = lambda self : None;
d55e5bfc 2223 def Create(*args, **kwargs):
7a27cf7c
RD
2224 """
2225 Create(self, int width, int height, bool clear=True)
2226
2227 Creates a fresh image. If clear is ``True``, the new image will be
2228 initialized to black. Otherwise, the image data will be uninitialized.
2229 """
5b5c9bc7 2230 return _core_.Image_Create(*args, **kwargs)
d55e5bfc
RD
2231
2232 def Destroy(*args, **kwargs):
2233 """
2234 Destroy(self)
2235
7a27cf7c 2236 Destroys the image data.
d55e5bfc 2237 """
7e08d4ef
RD
2238 val = _core_.Image_Destroy(*args, **kwargs)
2239 args[0].thisown = 0
2240 return val
d55e5bfc
RD
2241
2242 def Scale(*args, **kwargs):
7a27cf7c
RD
2243 """
2244 Scale(self, int width, int height) -> Image
2245
2246 Returns a scaled version of the image. This is also useful for scaling
2247 bitmaps in general as the only other way to scale bitmaps is to blit a
2248 `wx.MemoryDC` into another `wx.MemoryDC`.
2249 """
5b5c9bc7 2250 return _core_.Image_Scale(*args, **kwargs)
d55e5bfc
RD
2251
2252 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2253 """
2254 ShrinkBy(self, int xFactor, int yFactor) -> Image
2255
2256 Return a version of the image scaled smaller by the given factors.
2257 """
5b5c9bc7 2258 return _core_.Image_ShrinkBy(*args, **kwargs)
d55e5bfc
RD
2259
2260 def Rescale(*args, **kwargs):
7a27cf7c
RD
2261 """
2262 Rescale(self, int width, int height) -> Image
2263
2264 Changes the size of the image in-place by scaling it: after a call to
2265 this function, the image will have the given width and height.
2266
2267 Returns the (modified) image itself.
2268 """
5b5c9bc7 2269 return _core_.Image_Rescale(*args, **kwargs)
d55e5bfc 2270
aff4cc5c 2271 def Resize(*args, **kwargs):
7a27cf7c
RD
2272 """
2273 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2274
2275 Changes the size of the image in-place without scaling it, by adding
2276 either a border with the given colour or cropping as necessary. The
2277 image is pasted into a new image with the given size and background
2278 colour at the position pos relative to the upper left of the new
2279 image. If red = green = blue = -1 then use either the current mask
2280 colour if set or find, use, and set a suitable mask colour for any
2281 newly exposed areas.
2282
2283 Returns the (modified) image itself.
2284 """
5b5c9bc7 2285 return _core_.Image_Resize(*args, **kwargs)
aff4cc5c 2286
d55e5bfc 2287 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2288 """
2289 SetRGB(self, int x, int y, byte r, byte g, byte b)
2290
2291 Sets the pixel at the given coordinate. This routine performs
2292 bounds-checks for the coordinate so it can be considered a safe way to
2293 manipulate the data, but in some cases this might be too slow so that
2294 the data will have to be set directly. In that case you will have to
2295 get access to the image data using the `GetData` method.
2296 """
5b5c9bc7 2297 return _core_.Image_SetRGB(*args, **kwargs)
d55e5bfc 2298
aff4cc5c 2299 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2300 """
2301 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2302
2303 Sets the colour of the pixels within the given rectangle. This routine
2304 performs bounds-checks for the rectangle so it can be considered a
2305 safe way to manipulate the data.
2306 """
5b5c9bc7 2307 return _core_.Image_SetRGBRect(*args, **kwargs)
aff4cc5c 2308
d55e5bfc 2309 def GetRed(*args, **kwargs):
7a27cf7c
RD
2310 """
2311 GetRed(self, int x, int y) -> byte
2312
2313 Returns the red intensity at the given coordinate.
2314 """
5b5c9bc7 2315 return _core_.Image_GetRed(*args, **kwargs)
d55e5bfc
RD
2316
2317 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2318 """
2319 GetGreen(self, int x, int y) -> byte
2320
2321 Returns the green intensity at the given coordinate.
2322 """
5b5c9bc7 2323 return _core_.Image_GetGreen(*args, **kwargs)
d55e5bfc
RD
2324
2325 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2326 """
2327 GetBlue(self, int x, int y) -> byte
2328
2329 Returns the blue intensity at the given coordinate.
2330 """
5b5c9bc7 2331 return _core_.Image_GetBlue(*args, **kwargs)
d55e5bfc
RD
2332
2333 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2334 """
2335 SetAlpha(self, int x, int y, byte alpha)
2336
2337 Sets the alpha value for the given pixel. This function should only be
2338 called if the image has alpha channel data, use `HasAlpha` to check
2339 for this.
2340 """
5b5c9bc7 2341 return _core_.Image_SetAlpha(*args, **kwargs)
d55e5bfc
RD
2342
2343 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2344 """
2345 GetAlpha(self, int x, int y) -> byte
2346
2347 Returns the alpha value for the given pixel. This function may only be
2348 called for the images with alpha channel, use `HasAlpha` to check for
2349 this.
2350
2351 The returned value is the *opacity* of the image, i.e. the value of 0
2352 corresponds to the fully transparent pixels while the value of 255 to
2353 the fully opaque pixels.
2354 """
5b5c9bc7 2355 return _core_.Image_GetAlpha(*args, **kwargs)
d55e5bfc
RD
2356
2357 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2358 """
2359 HasAlpha(self) -> bool
2360
2361 Returns true if this image has alpha channel, false otherwise.
2362 """
5b5c9bc7 2363 return _core_.Image_HasAlpha(*args, **kwargs)
d55e5bfc 2364
68350608
RD
2365 def InitAlpha(*args, **kwargs):
2366 """
2367 InitAlpha(self)
2368
2369 Initializes the image alpha channel data. It is an error to call it if
2370 the image already has alpha data. If it doesn't, alpha data will be by
2371 default initialized to all pixels being fully opaque. But if the image
2372 has a a mask colour, all mask pixels will be completely transparent.
2373 """
5b5c9bc7
RD
2374 return _core_.Image_InitAlpha(*args, **kwargs)
2375
2376 def IsTransparent(*args, **kwargs):
2377 """
7a27cf7c 2378 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
5b5c9bc7 2379
7a27cf7c
RD
2380 Returns ``True`` if this pixel is masked or has an alpha value less
2381 than the spcified threshold.
5b5c9bc7
RD
2382 """
2383 return _core_.Image_IsTransparent(*args, **kwargs)
68350608 2384
d55e5bfc 2385 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2386 """
2387 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2388
2389 Find first colour that is not used in the image and has higher RGB
2390 values than startR, startG, startB. Returns a tuple consisting of a
2391 success flag and rgb values.
2392 """
5b5c9bc7 2393 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2394
4cf4100f
RD
2395 def ConvertAlphaToMask(*args, **kwargs):
2396 """
5b5c9bc7 2397 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2398
7a27cf7c
RD
2399 If the image has alpha channel, this method converts it to mask. All
2400 pixels with alpha value less than ``threshold`` are replaced with the
2401 mask colour and the alpha channel is removed. The mask colour is
2402 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2403
2404 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2405 nothing.
2406 """
5b5c9bc7 2407 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
4cf4100f 2408
8fb0e70a
RD
2409 def ConvertColourToAlpha(*args, **kwargs):
2410 """
7a27cf7c 2411 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2412
2413 This method converts an image where the original alpha information is
2414 only available as a shades of a colour (actually shades of grey)
2415 typically when you draw anti-aliased text into a bitmap. The DC
2416 drawing routines draw grey values on the black background although
2417 they actually mean to draw white with differnt alpha values. This
2418 method reverses it, assuming a black (!) background and white text.
2419 The method will then fill up the whole image with the colour given.
2420 """
5b5c9bc7 2421 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
8fb0e70a 2422
d55e5bfc 2423 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2424 """
2425 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2426
2427 Sets the image's mask so that the pixels that have RGB value of
2428 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2429 by first finding an unused colour in the image, setting this colour as
2430 the mask colour and then using this colour to draw all pixels in the
2431 image who corresponding pixel in mask has given RGB value.
2432
2433 Returns ``False`` if ``mask`` does not have same dimensions as the
2434 image or if there is no unused colour left. Returns ``True`` if the
2435 mask was successfully applied.
2436
2437 Note that this method involves computing the histogram, which is
2438 computationally intensive operation.
2439 """
5b5c9bc7 2440 return _core_.Image_SetMaskFromImage(*args, **kwargs)
d55e5bfc
RD
2441
2442 def CanRead(*args, **kwargs):
7a27cf7c
RD
2443 """
2444 CanRead(String filename) -> bool
2445
2446 Returns True if the image handlers can read this file.
2447 """
5b5c9bc7 2448 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
RD
2449
2450 CanRead = staticmethod(CanRead)
2451 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2452 """
2453 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2454
2455 If the image file contains more than one image and the image handler
2456 is capable of retrieving these individually, this function will return
2457 the number of available images.
2458 """
5b5c9bc7 2459 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
RD
2460
2461 GetImageCount = staticmethod(GetImageCount)
2462 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2463 """
2464 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2465
2466 Loads an image from a file. If no handler type is provided, the
2467 library will try to autodetect the format.
2468 """
5b5c9bc7 2469 return _core_.Image_LoadFile(*args, **kwargs)
d55e5bfc
RD
2470
2471 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2472 """
2473 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2474
2475 Loads an image from a file, specifying the image type with a MIME type
2476 string.
2477 """
5b5c9bc7 2478 return _core_.Image_LoadMimeFile(*args, **kwargs)
d55e5bfc
RD
2479
2480 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2481 """
2482 SaveFile(self, String name, int type) -> bool
2483
2484 Saves an image in the named file.
2485 """
5b5c9bc7 2486 return _core_.Image_SaveFile(*args, **kwargs)
d55e5bfc
RD
2487
2488 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2489 """
2490 SaveMimeFile(self, String name, String mimetype) -> bool
2491
2492 Saves an image in the named file.
2493 """
5b5c9bc7 2494 return _core_.Image_SaveMimeFile(*args, **kwargs)
d55e5bfc
RD
2495
2496 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2497 """
2498 CanReadStream(InputStream stream) -> bool
2499
2500 Returns True if the image handlers can read an image file from the
2501 data currently on the input stream, or a readable Python file-like
2502 object.
2503 """
5b5c9bc7 2504 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
RD
2505
2506 CanReadStream = staticmethod(CanReadStream)
2507 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2508 """
2509 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2510
2511 Loads an image from an input stream or a readable Python file-like
2512 object. If no handler type is provided, the library will try to
2513 autodetect the format.
2514 """
5b5c9bc7 2515 return _core_.Image_LoadStream(*args, **kwargs)
d55e5bfc
RD
2516
2517 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2518 """
2519 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2520
2521 Loads an image from an input stream or a readable Python file-like
2522 object, using a MIME type string to specify the image file format.
2523 """
5b5c9bc7 2524 return _core_.Image_LoadMimeStream(*args, **kwargs)
d55e5bfc
RD
2525
2526 def Ok(*args, **kwargs):
7a27cf7c
RD
2527 """
2528 Ok(self) -> bool
2529
2530 Returns true if image data is present.
2531 """
5b5c9bc7 2532 return _core_.Image_Ok(*args, **kwargs)
d55e5bfc
RD
2533
2534 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2535 """
2536 GetWidth(self) -> int
2537
2538 Gets the width of the image in pixels.
2539 """
5b5c9bc7 2540 return _core_.Image_GetWidth(*args, **kwargs)
d55e5bfc
RD
2541
2542 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2543 """
2544 GetHeight(self) -> int
2545
2546 Gets the height of the image in pixels.
2547 """
5b5c9bc7 2548 return _core_.Image_GetHeight(*args, **kwargs)
d55e5bfc
RD
2549
2550 def GetSize(*args, **kwargs):
7a27cf7c
RD
2551 """
2552 GetSize(self) -> Size
2553
2554 Returns the size of the image in pixels.
2555 """
5b5c9bc7 2556 return _core_.Image_GetSize(*args, **kwargs)
d55e5bfc
RD
2557
2558 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2559 """
2560 GetSubImage(self, Rect rect) -> Image
2561
2562 Returns a sub image of the current one as long as the rect belongs
2563 entirely to the image.
2564 """
5b5c9bc7 2565 return _core_.Image_GetSubImage(*args, **kwargs)
d55e5bfc 2566
aff4cc5c 2567 def Size(*args, **kwargs):
7a27cf7c
RD
2568 """
2569 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2570
2571 Returns a resized version of this image without scaling it by adding
2572 either a border with the given colour or cropping as necessary. The
2573 image is pasted into a new image with the given size and background
2574 colour at the position ``pos`` relative to the upper left of the new
2575 image. If red = green = blue = -1 then use either the current mask
2576 colour if set or find, use, and set a suitable mask colour for any
2577 newly exposed areas.
2578 """
5b5c9bc7 2579 return _core_.Image_Size(*args, **kwargs)
aff4cc5c 2580
d55e5bfc 2581 def Copy(*args, **kwargs):
7a27cf7c
RD
2582 """
2583 Copy(self) -> Image
2584
2585 Returns an identical copy of the image.
2586 """
5b5c9bc7 2587 return _core_.Image_Copy(*args, **kwargs)
d55e5bfc
RD
2588
2589 def Paste(*args, **kwargs):
7a27cf7c
RD
2590 """
2591 Paste(self, Image image, int x, int y)
2592
2593 Pastes ``image`` into this instance and takes care of the mask colour
2594 and any out of bounds problems.
2595 """
5b5c9bc7 2596 return _core_.Image_Paste(*args, **kwargs)
d55e5bfc
RD
2597
2598 def GetData(*args, **kwargs):
bb2ef2cc
RD
2599 """
2600 GetData(self) -> PyObject
2601
2602 Returns a string containing a copy of the RGB bytes of the image.
2603 """
5b5c9bc7 2604 return _core_.Image_GetData(*args, **kwargs)
d55e5bfc
RD
2605
2606 def SetData(*args, **kwargs):
bb2ef2cc
RD
2607 """
2608 SetData(self, buffer data)
2609
2610 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2611 either a string or a buffer object holding the data and the length of
2612 the data must be width*height*3.
2613 """
5b5c9bc7 2614 return _core_.Image_SetData(*args, **kwargs)
d55e5bfc
RD
2615
2616 def GetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2617 """
2618 GetDataBuffer(self) -> PyObject
2619
2620 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2621 image data buffer inside the wx.Image. You need to ensure that you do
2622 not use this buffer object after the image has been destroyed.
bb2ef2cc 2623 """
5b5c9bc7 2624 return _core_.Image_GetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2625
2626 def SetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2627 """
2628 SetDataBuffer(self, buffer data)
2629
2630 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2631 object. This can save making an extra copy of the data but you must
2632 ensure that the buffer object lives longer than the wx.Image does.
bb2ef2cc 2633 """
5b5c9bc7 2634 return _core_.Image_SetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2635
2636 def GetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2637 """
2638 GetAlphaData(self) -> PyObject
2639
2640 Returns a string containing a copy of the alpha bytes of the image.
2641 """
5b5c9bc7 2642 return _core_.Image_GetAlphaData(*args, **kwargs)
d55e5bfc
RD
2643
2644 def SetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2645 """
2646 SetAlphaData(self, buffer alpha)
2647
2648 Resets the Image's alpha data from a buffer of bytes. Accepts either
2649 a string or a buffer object holding the data and the length of the
2650 data must be width*height.
2651 """
5b5c9bc7 2652 return _core_.Image_SetAlphaData(*args, **kwargs)
d55e5bfc
RD
2653
2654 def GetAlphaBuffer(*args, **kwargs):
2655 """GetAlphaBuffer(self) -> PyObject"""
5b5c9bc7 2656 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2657
2658 def SetAlphaBuffer(*args, **kwargs):
bb2ef2cc 2659 """SetAlphaBuffer(self, buffer alpha)"""
5b5c9bc7 2660 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2661
2662 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2663 """
2664 SetMaskColour(self, byte r, byte g, byte b)
2665
2666 Sets the mask colour for this image (and tells the image to use the
2667 mask).
2668 """
5b5c9bc7 2669 return _core_.Image_SetMaskColour(*args, **kwargs)
d55e5bfc 2670
aff4cc5c
RD
2671 def GetOrFindMaskColour(*args, **kwargs):
2672 """
2673 GetOrFindMaskColour() -> (r,g,b)
2674
2675 Get the current mask colour or find a suitable colour.
2676 """
5b5c9bc7 2677 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
aff4cc5c 2678
d55e5bfc 2679 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2680 """
2681 GetMaskRed(self) -> byte
2682
2683 Gets the red component of the mask colour.
2684 """
5b5c9bc7 2685 return _core_.Image_GetMaskRed(*args, **kwargs)
d55e5bfc
RD
2686
2687 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2688 """
2689 GetMaskGreen(self) -> byte
2690
2691 Gets the green component of the mask colour.
2692 """
5b5c9bc7 2693 return _core_.Image_GetMaskGreen(*args, **kwargs)
d55e5bfc
RD
2694
2695 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2696 """
2697 GetMaskBlue(self) -> byte
2698
2699 Gets the blue component of the mask colour.
2700 """
5b5c9bc7 2701 return _core_.Image_GetMaskBlue(*args, **kwargs)
d55e5bfc
RD
2702
2703 def SetMask(*args, **kwargs):
7a27cf7c
RD
2704 """
2705 SetMask(self, bool mask=True)
2706
2707 Specifies whether there is a mask or not. The area of the mask is
2708 determined by the current mask colour.
2709 """
5b5c9bc7 2710 return _core_.Image_SetMask(*args, **kwargs)
d55e5bfc
RD
2711
2712 def HasMask(*args, **kwargs):
7a27cf7c
RD
2713 """
2714 HasMask(self) -> bool
2715
2716 Returns ``True`` if there is a mask active, ``False`` otherwise.
2717 """
5b5c9bc7 2718 return _core_.Image_HasMask(*args, **kwargs)
d55e5bfc
RD
2719
2720 def Rotate(*args, **kwargs):
2721 """
5b5c9bc7
RD
2722 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2723 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2724
2725 Rotates the image about the given point, by ``angle`` radians. Passing
2726 ``True`` to ``interpolating`` results in better image quality, but is
2727 slower. If the image has a mask, then the mask colour is used for the
2728 uncovered pixels in the rotated image background. Otherwise, black
2729 will be used as the fill colour.
2730
2731 Returns the rotated image, leaving this image intact.
d55e5bfc 2732 """
5b5c9bc7 2733 return _core_.Image_Rotate(*args, **kwargs)
d55e5bfc
RD
2734
2735 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2736 """
2737 Rotate90(self, bool clockwise=True) -> Image
2738
2739 Returns a copy of the image rotated 90 degrees in the direction
2740 indicated by ``clockwise``.
2741 """
5b5c9bc7 2742 return _core_.Image_Rotate90(*args, **kwargs)
d55e5bfc
RD
2743
2744 def Mirror(*args, **kwargs):
7a27cf7c
RD
2745 """
2746 Mirror(self, bool horizontally=True) -> Image
2747
2748 Returns a mirrored copy of the image. The parameter ``horizontally``
2749 indicates the orientation.
2750 """
5b5c9bc7 2751 return _core_.Image_Mirror(*args, **kwargs)
d55e5bfc
RD
2752
2753 def Replace(*args, **kwargs):
2754 """
7a27cf7c
RD
2755 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2756
2757 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2758 ``(r2,g2,b2)``.
d55e5bfc 2759 """
5b5c9bc7 2760 return _core_.Image_Replace(*args, **kwargs)
d55e5bfc 2761
32fe5131
RD
2762 def ConvertToGreyscale(*args, **kwargs):
2763 """
2764 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2765
2766 Convert to greyscale image. Uses the luminance component (Y) of the
2767 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2768 defaults to ITU-T BT.601
2769 """
2770 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2771
d55e5bfc 2772 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2773 """
2774 ConvertToMono(self, byte r, byte g, byte b) -> Image
2775
2776 Returns monochromatic version of the image. The returned image has
2777 white colour where the original has ``(r,g,b)`` colour and black
2778 colour everywhere else.
2779 """
5b5c9bc7 2780 return _core_.Image_ConvertToMono(*args, **kwargs)
d55e5bfc
RD
2781
2782 def SetOption(*args, **kwargs):
7a27cf7c
RD
2783 """
2784 SetOption(self, String name, String value)
2785
2786 Sets an image handler defined option. For example, when saving as a
2787 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2788 number between 0 and 100 (0 is terrible, 100 is very good).
2789 """
5b5c9bc7 2790 return _core_.Image_SetOption(*args, **kwargs)
d55e5bfc
RD
2791
2792 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2793 """
2794 SetOptionInt(self, String name, int value)
2795
2796 Sets an image option as an integer.
2797 """
5b5c9bc7 2798 return _core_.Image_SetOptionInt(*args, **kwargs)
d55e5bfc
RD
2799
2800 def GetOption(*args, **kwargs):
7a27cf7c
RD
2801 """
2802 GetOption(self, String name) -> String
2803
2804 Gets the value of an image handler option.
2805 """
5b5c9bc7 2806 return _core_.Image_GetOption(*args, **kwargs)
d55e5bfc
RD
2807
2808 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2809 """
2810 GetOptionInt(self, String name) -> int
2811
2812 Gets the value of an image handler option as an integer. If the given
2813 option is not present, the function returns 0.
2814 """
5b5c9bc7 2815 return _core_.Image_GetOptionInt(*args, **kwargs)
d55e5bfc
RD
2816
2817 def HasOption(*args, **kwargs):
7a27cf7c
RD
2818 """
2819 HasOption(self, String name) -> bool
2820
2821 Returns true if the given option is present.
2822 """
5b5c9bc7 2823 return _core_.Image_HasOption(*args, **kwargs)
d55e5bfc
RD
2824
2825 def CountColours(*args, **kwargs):
2826 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
5b5c9bc7 2827 return _core_.Image_CountColours(*args, **kwargs)
d55e5bfc
RD
2828
2829 def ComputeHistogram(*args, **kwargs):
5b5c9bc7
RD
2830 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2831 return _core_.Image_ComputeHistogram(*args, **kwargs)
d55e5bfc
RD
2832
2833 def AddHandler(*args, **kwargs):
5b5c9bc7
RD
2834 """AddHandler(ImageHandler handler)"""
2835 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
2836
2837 AddHandler = staticmethod(AddHandler)
2838 def InsertHandler(*args, **kwargs):
5b5c9bc7
RD
2839 """InsertHandler(ImageHandler handler)"""
2840 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
2841
2842 InsertHandler = staticmethod(InsertHandler)
2843 def RemoveHandler(*args, **kwargs):
5b5c9bc7
RD
2844 """RemoveHandler(String name) -> bool"""
2845 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc
RD
2846
2847 RemoveHandler = staticmethod(RemoveHandler)
1bd55598
RD
2848 def GetHandlers(*args, **kwargs):
2849 """GetHandlers() -> PyObject"""
2850 return _core_.Image_GetHandlers(*args, **kwargs)
2851
2852 GetHandlers = staticmethod(GetHandlers)
d55e5bfc 2853 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2854 """
2855 GetImageExtWildcard() -> String
2856
2857 Iterates all registered wxImageHandler objects, and returns a string
2858 containing file extension masks suitable for passing to file open/save
2859 dialog boxes.
2860 """
5b5c9bc7 2861 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc
RD
2862
2863 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2864 def ConvertToBitmap(*args, **kwargs):
5b5c9bc7
RD
2865 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2866 return _core_.Image_ConvertToBitmap(*args, **kwargs)
d55e5bfc
RD
2867
2868 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 2869 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
5b5c9bc7 2870 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
d55e5bfc 2871
943e8dfd
RD
2872 def RotateHue(*args, **kwargs):
2873 """
2874 RotateHue(self, double angle)
2875
2876 Rotates the hue of each pixel of the image. Hue is a double in the
2877 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2878 """
2879 return _core_.Image_RotateHue(*args, **kwargs)
2880
2881 def RGBtoHSV(*args, **kwargs):
2882 """
2883 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2884
2885 Converts a color in RGB color space to HSV color space.
2886 """
2887 return _core_.Image_RGBtoHSV(*args, **kwargs)
2888
2889 RGBtoHSV = staticmethod(RGBtoHSV)
2890 def HSVtoRGB(*args, **kwargs):
2891 """
2892 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2893
2894 Converts a color in HSV color space to RGB color space.
2895 """
2896 return _core_.Image_HSVtoRGB(*args, **kwargs)
2897
2898 HSVtoRGB = staticmethod(HSVtoRGB)
d55e5bfc 2899 def __nonzero__(self): return self.Ok()
2131d850 2900_core_.Image_swigregister(Image)
d55e5bfc
RD
2901
2902def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
2903 """
2904 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2905
2906 Loads an image from a file, using a MIME type string (such as
2907 'image/jpeg') to specify image type.
2908 """
5b5c9bc7 2909 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
2910 return val
2911
2912def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
2913 """
2914 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2915
2916 Loads an image from an input stream, or any readable Python file-like
2917 object.
2918 """
5b5c9bc7 2919 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
2920 return val
2921
2922def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
2923 """
2924 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2925
2926 Loads an image from an input stream, or any readable Python file-like
2927 object, specifying the image format with a MIME type string.
2928 """
5b5c9bc7 2929 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
2930 return val
2931
d6c14a4c 2932def EmptyImage(*args, **kwargs):
bb2ef2cc 2933 """
5b5c9bc7 2934 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
bb2ef2cc
RD
2935
2936 Construct an empty image of a given size, optionally setting all
2937 pixels to black.
2938 """
5b5c9bc7 2939 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
2940 return val
2941
2942def ImageFromBitmap(*args, **kwargs):
bb2ef2cc 2943 """
5b5c9bc7 2944 ImageFromBitmap(Bitmap bitmap) -> Image
bb2ef2cc
RD
2945
2946 Construct an Image from a `wx.Bitmap`.
2947 """
5b5c9bc7 2948 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
2949 return val
2950
2951def ImageFromData(*args, **kwargs):
bb2ef2cc 2952 """
5b5c9bc7 2953 ImageFromData(int width, int height, buffer data) -> Image
bb2ef2cc
RD
2954
2955 Construct an Image from a buffer of RGB bytes. Accepts either a
2956 string or a buffer object holding the data and the length of the data
2957 must be width*height*3.
2958 """
5b5c9bc7 2959 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
2960 return val
2961
03e46024 2962def ImageFromDataWithAlpha(*args, **kwargs):
bb2ef2cc 2963 """
5b5c9bc7 2964 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
bb2ef2cc
RD
2965
2966 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2967 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
2968 length of the data must be width*height*3 bytes, and the length of the
2969 alpha data must be width*height bytes.
bb2ef2cc 2970 """
5b5c9bc7 2971 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
03e46024
RD
2972 return val
2973
5b5c9bc7 2974def Image_CanRead(*args, **kwargs):
1bd55598 2975 """
7a27cf7c
RD
2976 Image_CanRead(String filename) -> bool
2977
2978 Returns True if the image handlers can read this file.
2979 """
1bd55598 2980 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc 2981
5b5c9bc7 2982def Image_GetImageCount(*args, **kwargs):
1bd55598 2983 """
7a27cf7c
RD
2984 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2985
2986 If the image file contains more than one image and the image handler
2987 is capable of retrieving these individually, this function will return
2988 the number of available images.
2989 """
1bd55598 2990 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc 2991
5b5c9bc7 2992def Image_CanReadStream(*args, **kwargs):
1bd55598 2993 """
7a27cf7c
RD
2994 Image_CanReadStream(InputStream stream) -> bool
2995
2996 Returns True if the image handlers can read an image file from the
2997 data currently on the input stream, or a readable Python file-like
2998 object.
2999 """
1bd55598 3000 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc 3001
5b5c9bc7 3002def Image_AddHandler(*args, **kwargs):
1bd55598
RD
3003 """Image_AddHandler(ImageHandler handler)"""
3004 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc 3005
5b5c9bc7 3006def Image_InsertHandler(*args, **kwargs):
1bd55598
RD
3007 """Image_InsertHandler(ImageHandler handler)"""
3008 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc 3009
5b5c9bc7 3010def Image_RemoveHandler(*args, **kwargs):
1bd55598
RD
3011 """Image_RemoveHandler(String name) -> bool"""
3012 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 3013
1bd55598
RD
3014def Image_GetHandlers(*args):
3015 """Image_GetHandlers() -> PyObject"""
3016 return _core_.Image_GetHandlers(*args)
3017
3018def Image_GetImageExtWildcard(*args):
3019 """
7a27cf7c
RD
3020 Image_GetImageExtWildcard() -> String
3021
3022 Iterates all registered wxImageHandler objects, and returns a string
3023 containing file extension masks suitable for passing to file open/save
3024 dialog boxes.
3025 """
1bd55598 3026 return _core_.Image_GetImageExtWildcard(*args)
d55e5bfc 3027
943e8dfd 3028def Image_RGBtoHSV(*args, **kwargs):
1bd55598 3029 """
943e8dfd
RD
3030 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3031
3032 Converts a color in RGB color space to HSV color space.
3033 """
1bd55598 3034 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3035
3036def Image_HSVtoRGB(*args, **kwargs):
1bd55598 3037 """
943e8dfd
RD
3038 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3039
3040 Converts a color in HSV color space to RGB color space.
3041 """
1bd55598 3042 return _core_.Image_HSVtoRGB(*args, **kwargs)
943e8dfd 3043
68e533f8
RD
3044def InitAllImageHandlers():
3045 """
3046 The former functionality of InitAllImageHanders is now done internal to
3047 the _core_ extension module and so this function has become a simple NOP.
3048 """
3049 pass
d55e5bfc 3050
5b5c9bc7
RD
3051IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3052IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3053PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3054PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3055PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3056BMP_24BPP = _core_.BMP_24BPP
3057BMP_8BPP = _core_.BMP_8BPP
3058BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3059BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3060BMP_8BPP_RED = _core_.BMP_8BPP_RED
3061BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3062BMP_4BPP = _core_.BMP_4BPP
3063BMP_1BPP = _core_.BMP_1BPP
3064BMP_1BPP_BW = _core_.BMP_1BPP_BW
3065class BMPHandler(ImageHandler):
27fb7603 3066 """A `wx.ImageHandler` for \*.bmp bitmap files."""
1bd55598
RD
3067 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3068 __repr__ = _swig_repr
3069 def __init__(self, *args, **kwargs):
27fb7603
RD
3070 """
3071 __init__(self) -> BMPHandler
3072
3073 A `wx.ImageHandler` for \*.bmp bitmap files.
3074 """
1bd55598 3075 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3076_core_.BMPHandler_swigregister(BMPHandler)
5b5c9bc7 3077NullImage = cvar.NullImage
68350608 3078IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3079IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3080IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3081IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3082IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3083IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3084IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3085IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3086IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3087IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3088IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3089IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3090IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
7fbf8399
RD
3091IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3092IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc 3093
5b5c9bc7 3094class ICOHandler(BMPHandler):
27fb7603 3095 """A `wx.ImageHandler` for \*.ico icon files."""
1bd55598
RD
3096 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3097 __repr__ = _swig_repr
3098 def __init__(self, *args, **kwargs):
27fb7603
RD
3099 """
3100 __init__(self) -> ICOHandler
3101
3102 A `wx.ImageHandler` for \*.ico icon files.
3103 """
1bd55598 3104 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3105_core_.ICOHandler_swigregister(ICOHandler)
d55e5bfc 3106
5b5c9bc7 3107class CURHandler(ICOHandler):
27fb7603 3108 """A `wx.ImageHandler` for \*.cur cursor files."""
1bd55598
RD
3109 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3110 __repr__ = _swig_repr
3111 def __init__(self, *args, **kwargs):
27fb7603
RD
3112 """
3113 __init__(self) -> CURHandler
3114
3115 A `wx.ImageHandler` for \*.cur cursor files.
3116 """
1bd55598 3117 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3118_core_.CURHandler_swigregister(CURHandler)
d55e5bfc 3119
5b5c9bc7 3120class ANIHandler(CURHandler):
27fb7603 3121 """A `wx.ImageHandler` for \*.ani animated cursor files."""
1bd55598
RD
3122 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3123 __repr__ = _swig_repr
3124 def __init__(self, *args, **kwargs):
27fb7603
RD
3125 """
3126 __init__(self) -> ANIHandler
3127
3128 A `wx.ImageHandler` for \*.ani animated cursor files.
3129 """
1bd55598 3130 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3131_core_.ANIHandler_swigregister(ANIHandler)
d55e5bfc 3132
5b5c9bc7 3133class PNGHandler(ImageHandler):
27fb7603 3134 """A `wx.ImageHandler` for PNG image files."""
1bd55598
RD
3135 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3136 __repr__ = _swig_repr
3137 def __init__(self, *args, **kwargs):
27fb7603
RD
3138 """
3139 __init__(self) -> PNGHandler
3140
3141 A `wx.ImageHandler` for PNG image files.
3142 """
1bd55598 3143 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3144_core_.PNGHandler_swigregister(PNGHandler)
d55e5bfc 3145
5b5c9bc7 3146class GIFHandler(ImageHandler):
27fb7603 3147 """A `wx.ImageHandler` for GIF image files."""
1bd55598
RD
3148 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3149 __repr__ = _swig_repr
3150 def __init__(self, *args, **kwargs):
27fb7603
RD
3151 """
3152 __init__(self) -> GIFHandler
3153
3154 A `wx.ImageHandler` for GIF image files.
3155 """
1bd55598 3156 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3157_core_.GIFHandler_swigregister(GIFHandler)
d55e5bfc 3158
5b5c9bc7 3159class PCXHandler(ImageHandler):
27fb7603 3160 """A `wx.ImageHandler` for PCX imager files."""
1bd55598
RD
3161 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3162 __repr__ = _swig_repr
3163 def __init__(self, *args, **kwargs):
27fb7603
RD
3164 """
3165 __init__(self) -> PCXHandler
3166
3167 A `wx.ImageHandler` for PCX imager files.
3168 """
1bd55598 3169 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3170_core_.PCXHandler_swigregister(PCXHandler)
d55e5bfc 3171
5b5c9bc7 3172class JPEGHandler(ImageHandler):
27fb7603 3173 """A `wx.ImageHandler` for JPEG/JPG image files."""
1bd55598
RD
3174 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3175 __repr__ = _swig_repr
3176 def __init__(self, *args, **kwargs):
27fb7603
RD
3177 """
3178 __init__(self) -> JPEGHandler
3179
3180 A `wx.ImageHandler` for JPEG/JPG image files.
3181 """
1bd55598 3182 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3183_core_.JPEGHandler_swigregister(JPEGHandler)
d55e5bfc 3184
5b5c9bc7 3185class PNMHandler(ImageHandler):
27fb7603 3186 """A `wx.ImageHandler` for PNM image files."""
1bd55598
RD
3187 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3188 __repr__ = _swig_repr
3189 def __init__(self, *args, **kwargs):
27fb7603
RD
3190 """
3191 __init__(self) -> PNMHandler
3192
3193 A `wx.ImageHandler` for PNM image files.
3194 """
1bd55598 3195 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3196_core_.PNMHandler_swigregister(PNMHandler)
d55e5bfc 3197
5b5c9bc7 3198class XPMHandler(ImageHandler):
27fb7603 3199 """A `wx.ImageHandler` for XPM image."""
1bd55598
RD
3200 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3201 __repr__ = _swig_repr
3202 def __init__(self, *args, **kwargs):
27fb7603
RD
3203 """
3204 __init__(self) -> XPMHandler
3205
3206 A `wx.ImageHandler` for XPM image.
3207 """
1bd55598 3208 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3209_core_.XPMHandler_swigregister(XPMHandler)
d55e5bfc 3210
5b5c9bc7 3211class TIFFHandler(ImageHandler):
27fb7603 3212 """A `wx.ImageHandler` for TIFF image files."""
1bd55598
RD
3213 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3214 __repr__ = _swig_repr
3215 def __init__(self, *args, **kwargs):
27fb7603
RD
3216 """
3217 __init__(self) -> TIFFHandler
3218
3219 A `wx.ImageHandler` for TIFF image files.
3220 """
1bd55598 3221 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3222_core_.TIFFHandler_swigregister(TIFFHandler)
d55e5bfc 3223
5b5c9bc7
RD
3224QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3225QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3226class Quantize(object):
c0de73ae 3227 """Performs quantization, or colour reduction, on a wxImage."""
1bd55598
RD
3228 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3229 def __init__(self): raise AttributeError, "No constructor defined"
3230 __repr__ = _swig_repr
c0de73ae
RD
3231 def Quantize(*args, **kwargs):
3232 """
5b5c9bc7 3233 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3234
3235 Reduce the colours in the source image and put the result into the
3236 destination image, setting the palette in the destination if
3237 needed. Both images may be the same, to overwrite the source image.
3238 """
5b5c9bc7 3239 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae
RD
3240
3241 Quantize = staticmethod(Quantize)
2131d850 3242_core_.Quantize_swigregister(Quantize)
c0de73ae 3243
5b5c9bc7 3244def Quantize_Quantize(*args, **kwargs):
1bd55598 3245 """
5b5c9bc7 3246 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3247
3248 Reduce the colours in the source image and put the result into the
3249 destination image, setting the palette in the destination if
3250 needed. Both images may be the same, to overwrite the source image.
3251 """
1bd55598 3252 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3253
d55e5bfc
RD
3254#---------------------------------------------------------------------------
3255
5b5c9bc7
RD
3256class EvtHandler(Object):
3257 """Proxy of C++ EvtHandler class"""
1bd55598
RD
3258 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3259 __repr__ = _swig_repr
3260 def __init__(self, *args, **kwargs):
5b5c9bc7 3261 """__init__(self) -> EvtHandler"""
1bd55598 3262 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d55e5bfc 3263 def GetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3264 """GetNextHandler(self) -> EvtHandler"""
3265 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
d55e5bfc
RD
3266
3267 def GetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3268 """GetPreviousHandler(self) -> EvtHandler"""
3269 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3270
3271 def SetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3272 """SetNextHandler(self, EvtHandler handler)"""
3273 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
d55e5bfc
RD
3274
3275 def SetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3276 """SetPreviousHandler(self, EvtHandler handler)"""
3277 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3278
3279 def GetEvtHandlerEnabled(*args, **kwargs):
3280 """GetEvtHandlerEnabled(self) -> bool"""
5b5c9bc7 3281 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3282
3283 def SetEvtHandlerEnabled(*args, **kwargs):
3284 """SetEvtHandlerEnabled(self, bool enabled)"""
5b5c9bc7 3285 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3286
3287 def ProcessEvent(*args, **kwargs):
5b5c9bc7
RD
3288 """ProcessEvent(self, Event event) -> bool"""
3289 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
d55e5bfc
RD
3290
3291 def AddPendingEvent(*args, **kwargs):
5b5c9bc7
RD
3292 """AddPendingEvent(self, Event event)"""
3293 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
d55e5bfc
RD
3294
3295 def ProcessPendingEvents(*args, **kwargs):
3296 """ProcessPendingEvents(self)"""
5b5c9bc7 3297 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
3298
3299 def Connect(*args, **kwargs):
3300 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
5b5c9bc7 3301 return _core_.EvtHandler_Connect(*args, **kwargs)
d55e5bfc
RD
3302
3303 def Disconnect(*args, **kwargs):
2131d850 3304 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
5b5c9bc7 3305 return _core_.EvtHandler_Disconnect(*args, **kwargs)
d55e5bfc
RD
3306
3307 def _setOORInfo(*args, **kwargs):
36ed4f51 3308 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3309 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3310 args[0].thisown = 0
3311 return val
d55e5bfc
RD
3312
3313 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3314 """
3315 Bind an event to an event handler.
3316
a5ee0656
RD
3317 :param event: One of the EVT_* objects that specifies the
3318 type of event to bind,
d55e5bfc 3319
a5ee0656
RD
3320 :param handler: A callable object to be invoked when the
3321 event is delivered to self. Pass None to
3322 disconnect an event handler.
d55e5bfc 3323
a5ee0656
RD
3324 :param source: Sometimes the event originates from a
3325 different window than self, but you still
3326 want to catch it in self. (For example, a
3327 button event delivered to a frame.) By
3328 passing the source of the event, the event
3329 handling system is able to differentiate
3330 between the same event type from different
3331 controls.
d55e5bfc 3332
a5ee0656
RD
3333 :param id: Used to spcify the event source by ID instead
3334 of instance.
3335
3336 :param id2: Used when it is desirable to bind a handler
3337 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3338 """
3339 if source is not None:
3340 id = source.GetId()
3341 event.Bind(self, id, id2, handler)
3342
d6c14a4c
RD
3343 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3344 """
3345 Disconencts the event handler binding for event from self.
3346 Returns True if successful.
3347 """
3348 if source is not None:
3349 id = source.GetId()
3350 return event.Unbind(self, id, id2)
d55e5bfc 3351
2131d850 3352_core_.EvtHandler_swigregister(EvtHandler)
d55e5bfc
RD
3353
3354#---------------------------------------------------------------------------
3355
3356class PyEventBinder(object):
3357 """
3358 Instances of this class are used to bind specific events to event
3359 handlers.
3360 """
3361 def __init__(self, evtType, expectedIDs=0):
3362 if expectedIDs not in [0, 1, 2]:
3363 raise ValueError, "Invalid number of expectedIDs"
3364 self.expectedIDs = expectedIDs
3365
3366 if type(evtType) == list or type(evtType) == tuple:
3367 self.evtType = evtType
3368 else:
3369 self.evtType = [evtType]
3370
3371
3372 def Bind(self, target, id1, id2, function):
3373 """Bind this set of event types to target."""
3374 for et in self.evtType:
3375 target.Connect(id1, id2, et, function)
3376
d6c14a4c
RD
3377
3378 def Unbind(self, target, id1, id2):
3379 """Remove an event binding."""
3380 success = 0
3381 for et in self.evtType:
3382 success += target.Disconnect(id1, id2, et)
3383 return success != 0
3384
d55e5bfc
RD
3385
3386 def __call__(self, *args):
3387 """
3388 For backwards compatibility with the old EVT_* functions.
3389 Should be called with either (window, func), (window, ID,
3390 func) or (window, ID1, ID2, func) parameters depending on the
3391 type of the event.
3392 """
3393 assert len(args) == 2 + self.expectedIDs
3394 id1 = wx.ID_ANY
3395 id2 = wx.ID_ANY
3396 target = args[0]
3397 if self.expectedIDs == 0:
3398 func = args[1]
3399 elif self.expectedIDs == 1:
3400 id1 = args[1]
3401 func = args[2]
3402 elif self.expectedIDs == 2:
3403 id1 = args[1]
3404 id2 = args[2]
3405 func = args[3]
3406 else:
3407 raise ValueError, "Unexpected number of IDs"
3408
3409 self.Bind(target, id1, id2, func)
3410
3411
3412# These two are square pegs that don't fit the PyEventBinder hole...
3413def EVT_COMMAND(win, id, cmd, func):
3414 win.Connect(id, -1, cmd, func)
3415def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3416 win.Connect(id1, id2, cmd, func)
3417
3418
3419#---------------------------------------------------------------------------
3420
3421#---------------------------------------------------------------------------
3422
5b5c9bc7
RD
3423EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3424EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3425
1bd55598 3426def NewEventType(*args):
2131d850 3427 """NewEventType() -> EventType"""
1bd55598 3428 return _core_.NewEventType(*args)
5b5c9bc7
RD
3429wxEVT_NULL = _core_.wxEVT_NULL
3430wxEVT_FIRST = _core_.wxEVT_FIRST
3431wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3432wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3433wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3434wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3435wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3436wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3437wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3438wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3439wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3440wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3441wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3442wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3443wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3444wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3445wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3446wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3447wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3448wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3449wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3450wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3451wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3452wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3453wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3454wxEVT_MOTION = _core_.wxEVT_MOTION
3455wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3456wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3457wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3458wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3459wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3460wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3461wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3462wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3463wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3464wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3465wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3466wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3467wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3468wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3469wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3470wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3471wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3472wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3473wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3474wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3475wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3476wxEVT_CHAR = _core_.wxEVT_CHAR
3477wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3478wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3479wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3480wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3481wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3482wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3483wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3484wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3485wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3486wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3487wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3488wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3489wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3490wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3491wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3492wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
5b5c9bc7
RD
3493wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3494wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3495wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3496wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3497wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3498wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3499wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3500wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3501wxEVT_SIZE = _core_.wxEVT_SIZE
3502wxEVT_MOVE = _core_.wxEVT_MOVE
3503wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3504wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3505wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3506wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
5b5c9bc7
RD
3507wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3508wxEVT_CREATE = _core_.wxEVT_CREATE
3509wxEVT_DESTROY = _core_.wxEVT_DESTROY
3510wxEVT_SHOW = _core_.wxEVT_SHOW
3511wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3512wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3513wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
34e0a3bb 3514wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
5b5c9bc7
RD
3515wxEVT_PAINT = _core_.wxEVT_PAINT
3516wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3517wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3518wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3519wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3520wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3521wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3522wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3523wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3524wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3525wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3526wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3527wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3528wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3529wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3530wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3531wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3532wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3533wxEVT_IDLE = _core_.wxEVT_IDLE
3534wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3535wxEVT_SIZING = _core_.wxEVT_SIZING
3536wxEVT_MOVING = _core_.wxEVT_MOVING
3537wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
3538wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3539wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3540wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
5b5c9bc7
RD
3541wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3542wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3543wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3544wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3545wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3546wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3547wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d55e5bfc
RD
3548#
3549# Create some event binders
3550EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3551EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3552EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3553EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3554EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3555EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3556EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3557EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3558EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3559EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3560EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3561EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3562EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 3563EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d55e5bfc
RD
3564EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3565EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3566EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3567EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3568EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3569EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3570EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3571EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3572EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3573EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 3574EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3575EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3576EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3577EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3578EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3579EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3580EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3581EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3582EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3583EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3584EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3585EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3586EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3587EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3588EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3589EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3590EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
34e0a3bb 3591EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
d55e5bfc
RD
3592
3593EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3594EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3595EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3596EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3597EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3598EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3599EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3600EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3601EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3602EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3603EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3604EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3605EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3606
3607EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3608 wxEVT_LEFT_UP,
3609 wxEVT_MIDDLE_DOWN,
3610 wxEVT_MIDDLE_UP,
3611 wxEVT_RIGHT_DOWN,
3612 wxEVT_RIGHT_UP,
3613 wxEVT_MOTION,
3614 wxEVT_LEFT_DCLICK,
3615 wxEVT_MIDDLE_DCLICK,
3616 wxEVT_RIGHT_DCLICK,
3617 wxEVT_ENTER_WINDOW,
3618 wxEVT_LEAVE_WINDOW,
3619 wxEVT_MOUSEWHEEL
3620 ])
3621
3622
3623# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 3624EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d55e5bfc
RD
3625 wxEVT_SCROLLWIN_BOTTOM,
3626 wxEVT_SCROLLWIN_LINEUP,
3627 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 3628 wxEVT_SCROLLWIN_PAGEUP,
d55e5bfc
RD
3629 wxEVT_SCROLLWIN_PAGEDOWN,
3630 wxEVT_SCROLLWIN_THUMBTRACK,
3631 wxEVT_SCROLLWIN_THUMBRELEASE,
3632 ])
3633
3634EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3635EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3636EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3637EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3638EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3639EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3640EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3641EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3642
27fb7603 3643# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
3644EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3645 wxEVT_SCROLL_BOTTOM,
3646 wxEVT_SCROLL_LINEUP,
3647 wxEVT_SCROLL_LINEDOWN,
3648 wxEVT_SCROLL_PAGEUP,
3649 wxEVT_SCROLL_PAGEDOWN,
3650 wxEVT_SCROLL_THUMBTRACK,
3651 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3652 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3653 ])
3654
3655EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3656EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3657EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3658EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3659EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3660EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3661EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3662EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3663EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3664EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 3665
27fb7603 3666# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
3667EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3668 wxEVT_SCROLL_BOTTOM,
3669 wxEVT_SCROLL_LINEUP,
3670 wxEVT_SCROLL_LINEDOWN,
3671 wxEVT_SCROLL_PAGEUP,
3672 wxEVT_SCROLL_PAGEDOWN,
3673 wxEVT_SCROLL_THUMBTRACK,
d55e5bfc 3674 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3675 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3676 ], 1)
3677
3678EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3679EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3680EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3681EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3682EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3683EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3684EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3685EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3686EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3687EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
3688
3689EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3690EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3691EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3692EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3693EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3694EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3695EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3696EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3697EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3698EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3699
3700EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3701EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3702EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3703EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3704EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3705EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3706EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3707EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3708EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3709
3710
3711EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3712EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3713EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3714EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3715EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3716EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3717EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3718
3719EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3720
3721EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3722EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3723
3724EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3725
2131d850
RD
3726EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3727EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3728EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d55e5bfc
RD
3729
3730
3731#---------------------------------------------------------------------------
3732
5b5c9bc7 3733class Event(Object):
27fb7603
RD
3734 """
3735 An event is a structure holding information about an event passed to a
3736 callback or member function. wx.Event is an abstract base class for
3737 other event classes
3738 """
1bd55598
RD
3739 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3740 def __init__(self): raise AttributeError, "No constructor defined"
3741 __repr__ = _swig_repr
3742 __swig_destroy__ = _core_.delete_Event
3743 __del__ = lambda self : None;
d55e5bfc 3744 def SetEventType(*args, **kwargs):
27fb7603 3745 """
2131d850 3746 SetEventType(self, EventType typ)
27fb7603
RD
3747
3748 Sets the specific type of the event.
3749 """
5b5c9bc7 3750 return _core_.Event_SetEventType(*args, **kwargs)
d55e5bfc
RD
3751
3752 def GetEventType(*args, **kwargs):
27fb7603 3753 """
2131d850 3754 GetEventType(self) -> EventType
27fb7603
RD
3755
3756 Returns the identifier of the given event type, such as
3757 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3758 """
5b5c9bc7 3759 return _core_.Event_GetEventType(*args, **kwargs)
d55e5bfc
RD
3760
3761 def GetEventObject(*args, **kwargs):
27fb7603
RD
3762 """
3763 GetEventObject(self) -> Object
3764
3765 Returns the object (usually a window) associated with the event, if
3766 any.
3767 """
5b5c9bc7 3768 return _core_.Event_GetEventObject(*args, **kwargs)
d55e5bfc
RD
3769
3770 def SetEventObject(*args, **kwargs):
27fb7603
RD
3771 """
3772 SetEventObject(self, Object obj)
3773
3774 Sets the originating object, or in other words, obj is normally the
3775 object that is sending the event.
3776 """
5b5c9bc7 3777 return _core_.Event_SetEventObject(*args, **kwargs)
d55e5bfc
RD
3778
3779 def GetTimestamp(*args, **kwargs):
3780 """GetTimestamp(self) -> long"""
5b5c9bc7 3781 return _core_.Event_GetTimestamp(*args, **kwargs)
d55e5bfc
RD
3782
3783 def SetTimestamp(*args, **kwargs):
3784 """SetTimestamp(self, long ts=0)"""
5b5c9bc7 3785 return _core_.Event_SetTimestamp(*args, **kwargs)
d55e5bfc
RD
3786
3787 def GetId(*args, **kwargs):
27fb7603
RD
3788 """
3789 GetId(self) -> int
3790
3791 Returns the identifier associated with this event, such as a button
3792 command id.
3793 """
5b5c9bc7 3794 return _core_.Event_GetId(*args, **kwargs)
d55e5bfc
RD
3795
3796 def SetId(*args, **kwargs):
27fb7603
RD
3797 """
3798 SetId(self, int Id)
3799
3800 Set's the ID for the event. This is usually the ID of the window that
3801 is sending the event, but it can also be a command id from a menu
3802 item, etc.
3803 """
5b5c9bc7 3804 return _core_.Event_SetId(*args, **kwargs)
d55e5bfc
RD
3805
3806 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
3807 """
3808 IsCommandEvent(self) -> bool
3809
3810 Returns true if the event is or is derived from `wx.CommandEvent` else
3811 it returns false. Note: Exists only for optimization purposes.
3812 """
5b5c9bc7 3813 return _core_.Event_IsCommandEvent(*args, **kwargs)
d55e5bfc
RD
3814
3815 def Skip(*args, **kwargs):
51b83b37
RD
3816 """
3817 Skip(self, bool skip=True)
3818
3819 Called by an event handler, it controls whether additional event
3820 handlers bound to this event will be called after the current event
3821 handler returns. Skip(false) (the default setting) will prevent
3822 additional event handlers from being called and control will be
3823 returned to the sender of the event immediately after the current
3824 handler has finished. Skip(True) will cause the event processing
3825 system to continue searching for a handler function for this event.
3826
3827 """
5b5c9bc7 3828 return _core_.Event_Skip(*args, **kwargs)
d55e5bfc
RD
3829
3830 def GetSkipped(*args, **kwargs):
27fb7603
RD
3831 """
3832 GetSkipped(self) -> bool
3833
3834 Returns true if the event handler should be skipped, false otherwise.
3835 :see: `Skip`
3836 """
5b5c9bc7 3837 return _core_.Event_GetSkipped(*args, **kwargs)
d55e5bfc
RD
3838
3839 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
3840 """
3841 ShouldPropagate(self) -> bool
3842
3843 Test if this event should be propagated to the parent window or not,
3844 i.e. if the propagation level is currently greater than 0.
3845 """
5b5c9bc7 3846 return _core_.Event_ShouldPropagate(*args, **kwargs)
d55e5bfc
RD
3847
3848 def StopPropagation(*args, **kwargs):
27fb7603
RD
3849 """
3850 StopPropagation(self) -> int
3851
3852 Stop the event from propagating to its parent window. Returns the old
3853 propagation level value which may be later passed to
3854 `ResumePropagation` to allow propagating the event again.
3855 """
5b5c9bc7 3856 return _core_.Event_StopPropagation(*args, **kwargs)
d55e5bfc
RD
3857
3858 def ResumePropagation(*args, **kwargs):
27fb7603
RD
3859 """
3860 ResumePropagation(self, int propagationLevel)
3861
3862 Resume the event propagation by restoring the propagation level. (For
3863 example, you can use the value returned by an earlier call to
3864 `StopPropagation`.)
3865
3866 """
5b5c9bc7 3867 return _core_.Event_ResumePropagation(*args, **kwargs)
d55e5bfc
RD
3868
3869 def Clone(*args, **kwargs):
5b5c9bc7
RD
3870 """Clone(self) -> Event"""
3871 return _core_.Event_Clone(*args, **kwargs)
d55e5bfc 3872
2131d850 3873_core_.Event_swigregister(Event)
d55e5bfc
RD
3874
3875#---------------------------------------------------------------------------
3876
5b5c9bc7 3877class PropagationDisabler(object):
27fb7603
RD
3878 """
3879 Helper class to temporarily change an event not to propagate. Simply
3880 create an instance of this class and then whe it is destroyed the
3881 propogation of the event will be restored.
3882 """
1bd55598
RD
3883 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3884 __repr__ = _swig_repr
3885 def __init__(self, *args, **kwargs):
27fb7603
RD
3886 """
3887 __init__(self, Event event) -> PropagationDisabler
3888
3889 Helper class to temporarily change an event not to propagate. Simply
3890 create an instance of this class and then whe it is destroyed the
3891 propogation of the event will be restored.
3892 """
1bd55598
RD
3893 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3894 __swig_destroy__ = _core_.delete_PropagationDisabler
3895 __del__ = lambda self : None;
2131d850 3896_core_.PropagationDisabler_swigregister(PropagationDisabler)
d55e5bfc 3897
5b5c9bc7 3898class PropagateOnce(object):
27fb7603
RD
3899 """
3900 A helper class that will temporarily lower propagation level of an
3901 event. Simply create an instance of this class and then whe it is
3902 destroyed the propogation of the event will be restored.
3903 """
1bd55598
RD
3904 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3905 __repr__ = _swig_repr
3906 def __init__(self, *args, **kwargs):
27fb7603
RD
3907 """
3908 __init__(self, Event event) -> PropagateOnce
3909
3910 A helper class that will temporarily lower propagation level of an
3911 event. Simply create an instance of this class and then whe it is
3912 destroyed the propogation of the event will be restored.
3913 """
1bd55598
RD
3914 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3915 __swig_destroy__ = _core_.delete_PropagateOnce
3916 __del__ = lambda self : None;
2131d850 3917_core_.PropagateOnce_swigregister(PropagateOnce)
d55e5bfc
RD
3918
3919#---------------------------------------------------------------------------
3920
5b5c9bc7 3921class CommandEvent(Event):
27fb7603
RD
3922 """
3923 This event class contains information about command events, which
3924 originate from a variety of simple controls, as well as menus and
3925 toolbars.
3926 """
1bd55598
RD
3927 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3928 __repr__ = _swig_repr
3929 def __init__(self, *args, **kwargs):
27fb7603 3930 """
2131d850 3931 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
3932
3933 This event class contains information about command events, which
3934 originate from a variety of simple controls, as well as menus and
3935 toolbars.
3936 """
1bd55598 3937 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
d55e5bfc 3938 def GetSelection(*args, **kwargs):
27fb7603
RD
3939 """
3940 GetSelection(self) -> int
3941
3942 Returns item index for a listbox or choice selection event (not valid
3943 for a deselection).
3944 """
5b5c9bc7 3945 return _core_.CommandEvent_GetSelection(*args, **kwargs)
d55e5bfc
RD
3946
3947 def SetString(*args, **kwargs):
5b5c9bc7
RD
3948 """SetString(self, String s)"""
3949 return _core_.CommandEvent_SetString(*args, **kwargs)
d55e5bfc
RD
3950
3951 def GetString(*args, **kwargs):
27fb7603
RD
3952 """
3953 GetString(self) -> String
3954
3955 Returns item string for a listbox or choice selection event (not valid
3956 for a deselection).
3957 """
5b5c9bc7 3958 return _core_.CommandEvent_GetString(*args, **kwargs)
d55e5bfc
RD
3959
3960 def IsChecked(*args, **kwargs):
27fb7603
RD
3961 """
3962 IsChecked(self) -> bool
3963
3964 This method can be used with checkbox and menu events: for the
3965 checkboxes, the method returns true for a selection event and false
3966 for a deselection one. For the menu events, this method indicates if
3967 the menu item just has become checked or unchecked (and thus only
3968 makes sense for checkable menu items).
3969 """
5b5c9bc7 3970 return _core_.CommandEvent_IsChecked(*args, **kwargs)
d55e5bfc
RD
3971
3972 Checked = IsChecked
3973 def IsSelection(*args, **kwargs):
27fb7603
RD
3974 """
3975 IsSelection(self) -> bool
3976
3977 For a listbox or similar event, returns true if it is a selection,
3978 false if it is a deselection.
3979 """
5b5c9bc7 3980 return _core_.CommandEvent_IsSelection(*args, **kwargs)
d55e5bfc
RD
3981
3982 def SetExtraLong(*args, **kwargs):
3983 """SetExtraLong(self, long extraLong)"""
5b5c9bc7 3984 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
d55e5bfc
RD
3985
3986 def GetExtraLong(*args, **kwargs):
27fb7603
RD
3987 """
3988 GetExtraLong(self) -> long
3989
5ba5649b
RD
3990 Returns extra information dependant on the event objects type. If the
3991 event comes from a listbox selection, it is a boolean determining
3992 whether the event was a selection (true) or a deselection (false). A
3993 listbox deselection only occurs for multiple-selection boxes, and in
3994 this case the index and string values are indeterminate and the
3995 listbox must be examined by the application.
27fb7603 3996 """
5b5c9bc7 3997 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
d55e5bfc
RD
3998
3999 def SetInt(*args, **kwargs):
4000 """SetInt(self, int i)"""
5b5c9bc7 4001 return _core_.CommandEvent_SetInt(*args, **kwargs)
d55e5bfc
RD
4002
4003 def GetInt(*args, **kwargs):
27fb7603 4004 """
2131d850 4005 GetInt(self) -> int
27fb7603 4006
5ba5649b
RD
4007 Returns the integer identifier corresponding to a listbox, choice or
4008 radiobox selection (only if the event was a selection, not a
4009 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4010 """
5b5c9bc7 4011 return _core_.CommandEvent_GetInt(*args, **kwargs)
d55e5bfc 4012
1bd55598
RD
4013 def GetClientData(*args, **kwargs):
4014 """
4015 GetClientData(self) -> PyObject
4016
4017 Returns the client data object for a listbox or choice selection event, (if any.)
4018 """
4019 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4020
4021 def SetClientData(*args, **kwargs):
4022 """
4023 SetClientData(self, PyObject clientData)
4024
4025 Associate the given client data with the item at position n.
4026 """
4027 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4028
4029 GetClientObject = GetClientData
4030 SetClientObject = SetClientData
4031
d55e5bfc 4032 def Clone(*args, **kwargs):
5b5c9bc7
RD
4033 """Clone(self) -> Event"""
4034 return _core_.CommandEvent_Clone(*args, **kwargs)
d55e5bfc 4035
2131d850 4036_core_.CommandEvent_swigregister(CommandEvent)
d55e5bfc
RD
4037
4038#---------------------------------------------------------------------------
4039
5b5c9bc7 4040class NotifyEvent(CommandEvent):
27fb7603
RD
4041 """
4042 An instance of this class (or one of its derived classes) is sent from
4043 a control when the control's state is being changed and the control
4044 allows that change to be prevented from happening. The event handler
4045 can call `Veto` or `Allow` to tell the control what to do.
4046 """
1bd55598
RD
4047 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4048 __repr__ = _swig_repr
4049 def __init__(self, *args, **kwargs):
27fb7603 4050 """
2131d850 4051 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4052
4053 An instance of this class (or one of its derived classes) is sent from
4054 a control when the control's state is being changed and the control
4055 allows that change to be prevented from happening. The event handler
4056 can call `Veto` or `Allow` to tell the control what to do.
4057 """
1bd55598 4058 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
d55e5bfc 4059 def Veto(*args, **kwargs):
27fb7603
RD
4060 """
4061 Veto(self)
4062
4063 Prevents the change announced by this event from happening.
4064
4065 It is in general a good idea to notify the user about the reasons for
4066 vetoing the change because otherwise the applications behaviour (which
4067 just refuses to do what the user wants) might be quite surprising.
4068 """
5b5c9bc7 4069 return _core_.NotifyEvent_Veto(*args, **kwargs)
d55e5bfc
RD
4070
4071 def Allow(*args, **kwargs):
27fb7603
RD
4072 """
4073 Allow(self)
4074
4075 This is the opposite of `Veto`: it explicitly allows the event to be
4076 processed. For most events it is not necessary to call this method as
4077 the events are allowed anyhow but some are forbidden by default (this
4078 will be mentioned in the corresponding event description).
4079 """
5b5c9bc7 4080 return _core_.NotifyEvent_Allow(*args, **kwargs)
d55e5bfc
RD
4081
4082 def IsAllowed(*args, **kwargs):
27fb7603
RD
4083 """
4084 IsAllowed(self) -> bool
4085
4086 Returns true if the change is allowed (`Veto` hasn't been called) or
4087 false otherwise (if it was).
4088 """
5b5c9bc7 4089 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
d55e5bfc 4090
2131d850 4091_core_.NotifyEvent_swigregister(NotifyEvent)
d55e5bfc
RD
4092
4093#---------------------------------------------------------------------------
4094
5b5c9bc7 4095class ScrollEvent(CommandEvent):
27fb7603
RD
4096 """
4097 A scroll event holds information about events sent from stand-alone
4098 scrollbars and sliders. Note that scrolled windows do not send
4099 instnaces of this event class, but send the `wx.ScrollWinEvent`
4100 instead.
4101 """
1bd55598
RD
4102 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4103 __repr__ = _swig_repr
4104 def __init__(self, *args, **kwargs):
d55e5bfc 4105 """
2131d850 4106 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
5b5c9bc7 4107 int orient=0) -> ScrollEvent
d55e5bfc 4108 """
1bd55598 4109 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
d55e5bfc 4110 def GetOrientation(*args, **kwargs):
27fb7603
RD
4111 """
4112 GetOrientation(self) -> int
4113
4114 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4115 the scrollbar.
4116 """
5b5c9bc7 4117 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4118
4119 def GetPosition(*args, **kwargs):
27fb7603
RD
4120 """
4121 GetPosition(self) -> int
4122
4123 Returns the position of the scrollbar.
4124 """
5b5c9bc7 4125 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4126
4127 def SetOrientation(*args, **kwargs):
4128 """SetOrientation(self, int orient)"""
5b5c9bc7 4129 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4130
4131 def SetPosition(*args, **kwargs):
4132 """SetPosition(self, int pos)"""
5b5c9bc7 4133 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
d55e5bfc 4134
2131d850 4135_core_.ScrollEvent_swigregister(ScrollEvent)
d55e5bfc
RD
4136
4137#---------------------------------------------------------------------------
4138
5b5c9bc7 4139class ScrollWinEvent(Event):
27fb7603
RD
4140 """
4141 A wx.ScrollWinEvent holds information about scrolling and is sent from
4142 scrolling windows.
4143 """
1bd55598
RD
4144 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4145 __repr__ = _swig_repr
4146 def __init__(self, *args, **kwargs):
27fb7603 4147 """
2131d850 4148 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4149
4150 A wx.ScrollWinEvent holds information about scrolling and is sent from
4151 scrolling windows.
4152 """
1bd55598 4153 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
d55e5bfc 4154 def GetOrientation(*args, **kwargs):
27fb7603
RD
4155 """
4156 GetOrientation(self) -> int
4157
4158 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4159 the scrollbar.
4160 """
5b5c9bc7 4161 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4162
4163 def GetPosition(*args, **kwargs):
27fb7603
RD
4164 """
4165 GetPosition(self) -> int
4166
4167 Returns the position of the scrollbar for the thumb track and release
4168 events. Note that this field can't be used for the other events, you
4169 need to query the window itself for the current position in that case.
4170 """
5b5c9bc7 4171 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4172
4173 def SetOrientation(*args, **kwargs):
4174 """SetOrientation(self, int orient)"""
5b5c9bc7 4175 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4176
4177 def SetPosition(*args, **kwargs):
4178 """SetPosition(self, int pos)"""
5b5c9bc7 4179 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
d55e5bfc 4180
2131d850 4181_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d55e5bfc
RD
4182
4183#---------------------------------------------------------------------------
4184
5b5c9bc7
RD
4185MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4186MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4187MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4188MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4189MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4190class MouseEvent(Event):
27fb7603
RD
4191 """
4192 This event class contains information about the events generated by
4193 the mouse: they include mouse buttons press and release events and
4194 mouse move events.
4195
4196 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4197 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4198 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4199 a middle button so a portable application should avoid relying on the
4200 events from it.
4201
4202 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4203 the former returns true when the event corresponds to the left mouse
4204 button click while the latter returns true if the left mouse button is
4205 currently being pressed. For example, when the user is dragging the
4206 mouse you can use `LeftIsDown` to test whether the left mouse button
4207 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4208 `LeftIsDown` will also return true in wxWidgets whatever the
4209 underlying GUI behaviour is (which is platform-dependent). The same
4210 applies, of course, to other mouse buttons as well.
4211 """
1bd55598
RD
4212 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4213 __repr__ = _swig_repr
4214 def __init__(self, *args, **kwargs):
27fb7603 4215 """
2131d850 4216 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4217
4218 Constructs a wx.MouseEvent. Valid event types are:
4219
4220 * wxEVT_ENTER_WINDOW
4221 * wxEVT_LEAVE_WINDOW
4222 * wxEVT_LEFT_DOWN
4223 * wxEVT_LEFT_UP
4224 * wxEVT_LEFT_DCLICK
4225 * wxEVT_MIDDLE_DOWN
4226 * wxEVT_MIDDLE_UP
4227 * wxEVT_MIDDLE_DCLICK
4228 * wxEVT_RIGHT_DOWN
4229 * wxEVT_RIGHT_UP
4230 * wxEVT_RIGHT_DCLICK
4231 * wxEVT_MOTION
4232 * wxEVT_MOUSEWHEEL
4233 """
1bd55598 4234 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
d55e5bfc 4235 def IsButton(*args, **kwargs):
27fb7603
RD
4236 """
4237 IsButton(self) -> bool
4238
4239 Returns true if the event was a mouse button event (not necessarily a
4240 button down event - that may be tested using `ButtonDown`).
4241 """
5b5c9bc7 4242 return _core_.MouseEvent_IsButton(*args, **kwargs)
d55e5bfc
RD
4243
4244 def ButtonDown(*args, **kwargs):
27fb7603
RD
4245 """
4246 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4247
5ba5649b
RD
4248 If the argument is omitted, this returns true if the event was any
4249 mouse button down event. Otherwise the argument specifies which
4250 button-down event shold be checked for (see `Button` for the possible
4251 values).
27fb7603 4252 """
5b5c9bc7 4253 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
d55e5bfc
RD
4254
4255 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4256 """
4257 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4258
4259 If the argument is omitted, this returns true if the event was any
4260 mouse double click event. Otherwise the argument specifies which
4261 double click event to check for (see `Button` for the possible
4262 values).
4263 """
5b5c9bc7 4264 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
d55e5bfc
RD
4265
4266 def ButtonUp(*args, **kwargs):
27fb7603
RD
4267 """
4268 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4269
4270 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4271 mouse button up event. Otherwise the argument specifies which button
4272 up event to check for (see `Button` for the possible values).
27fb7603 4273 """
5b5c9bc7 4274 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
d55e5bfc
RD
4275
4276 def Button(*args, **kwargs):
27fb7603
RD
4277 """
4278 Button(self, int button) -> bool
4279
4280 Returns true if the identified mouse button is changing state. Valid
4281 values of button are:
4282
4283 ==================== =====================================
4284 wx.MOUSE_BTN_LEFT check if left button was pressed
4285 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4286 wx.MOUSE_BTN_RIGHT check if right button was pressed
4287 wx.MOUSE_BTN_ANY check if any button was pressed
4288 ==================== =====================================
4289
4290 """
5b5c9bc7 4291 return _core_.MouseEvent_Button(*args, **kwargs)
d55e5bfc
RD
4292
4293 def ButtonIsDown(*args, **kwargs):
4294 """ButtonIsDown(self, int but) -> bool"""
5b5c9bc7 4295 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
d55e5bfc
RD
4296
4297 def GetButton(*args, **kwargs):
27fb7603
RD
4298 """
4299 GetButton(self) -> int
4300
4301 Returns the mouse button which generated this event or
4302 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4303 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4304 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4305 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4306 right buttons respectively.
4307 """
5b5c9bc7 4308 return _core_.MouseEvent_GetButton(*args, **kwargs)
d55e5bfc
RD
4309
4310 def ControlDown(*args, **kwargs):
27fb7603
RD
4311 """
4312 ControlDown(self) -> bool
4313
4314 Returns true if the control key was down at the time of the event.
4315 """
5b5c9bc7 4316 return _core_.MouseEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4317
4318 def MetaDown(*args, **kwargs):
27fb7603
RD
4319 """
4320 MetaDown(self) -> bool
4321
4322 Returns true if the Meta key was down at the time of the event.
4323 """
5b5c9bc7 4324 return _core_.MouseEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4325
4326 def AltDown(*args, **kwargs):
27fb7603
RD
4327 """
4328 AltDown(self) -> bool
4329
4330 Returns true if the Alt key was down at the time of the event.
4331 """
5b5c9bc7 4332 return _core_.MouseEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4333
4334 def ShiftDown(*args, **kwargs):
27fb7603
RD
4335 """
4336 ShiftDown(self) -> bool
4337
4338 Returns true if the Shift key was down at the time of the event.
4339 """
5b5c9bc7 4340 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4341
412d302d
RD
4342 def CmdDown(*args, **kwargs):
4343 """
4344 CmdDown(self) -> bool
4345
4346 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4347 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4348 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4349 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4350 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4351 purpose. So for non-Mac platforms this is the same as `ControlDown`
4352 and Macs this is the same as `MetaDown`.
4353 """
5b5c9bc7 4354 return _core_.MouseEvent_CmdDown(*args, **kwargs)
412d302d 4355
d55e5bfc 4356 def LeftDown(*args, **kwargs):
27fb7603
RD
4357 """
4358 LeftDown(self) -> bool
4359
4360 Returns true if the left mouse button state changed to down.
4361 """
5b5c9bc7 4362 return _core_.MouseEvent_LeftDown(*args, **kwargs)
d55e5bfc
RD
4363
4364 def MiddleDown(*args, **kwargs):
27fb7603
RD
4365 """
4366 MiddleDown(self) -> bool
4367
4368 Returns true if the middle mouse button state changed to down.
4369 """
5b5c9bc7 4370 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
d55e5bfc
RD
4371
4372 def RightDown(*args, **kwargs):
27fb7603
RD
4373 """
4374 RightDown(self) -> bool
4375
4376 Returns true if the right mouse button state changed to down.
4377 """
5b5c9bc7 4378 return _core_.MouseEvent_RightDown(*args, **kwargs)
d55e5bfc
RD
4379
4380 def LeftUp(*args, **kwargs):
27fb7603
RD
4381 """
4382 LeftUp(self) -> bool
4383
4384 Returns true if the left mouse button state changed to up.
4385 """
5b5c9bc7 4386 return _core_.MouseEvent_LeftUp(*args, **kwargs)
d55e5bfc
RD
4387
4388 def MiddleUp(*args, **kwargs):
27fb7603
RD
4389 """
4390 MiddleUp(self) -> bool
4391
4392 Returns true if the middle mouse button state changed to up.
4393 """
5b5c9bc7 4394 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
d55e5bfc
RD
4395
4396 def RightUp(*args, **kwargs):
27fb7603
RD
4397 """
4398 RightUp(self) -> bool
4399
4400 Returns true if the right mouse button state changed to up.
4401 """
5b5c9bc7 4402 return _core_.MouseEvent_RightUp(*args, **kwargs)
d55e5bfc
RD
4403
4404 def LeftDClick(*args, **kwargs):
27fb7603
RD
4405 """
4406 LeftDClick(self) -> bool
4407
4408 Returns true if the event was a left button double click.
4409 """
5b5c9bc7 4410 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
d55e5bfc
RD
4411
4412 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4413 """
4414 MiddleDClick(self) -> bool
4415
4416 Returns true if the event was a middle button double click.
4417 """
5b5c9bc7 4418 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
d55e5bfc
RD
4419
4420 def RightDClick(*args, **kwargs):
27fb7603
RD
4421 """
4422 RightDClick(self) -> bool
4423
4424 Returns true if the event was a right button double click.
4425 """
5b5c9bc7 4426 return _core_.MouseEvent_RightDClick(*args, **kwargs)
d55e5bfc
RD
4427
4428 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4429 """
4430 LeftIsDown(self) -> bool
4431
4432 Returns true if the left mouse button is currently down, independent
4433 of the current event type.
4434
4435 Please notice that it is not the same as LeftDown which returns true
4436 if the left mouse button was just pressed. Rather, it describes the
4437 state of the mouse button before the event happened.
4438
4439 This event is usually used in the mouse event handlers which process
4440 "move mouse" messages to determine whether the user is (still)
4441 dragging the mouse.
4442 """
5b5c9bc7 4443 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
d55e5bfc
RD
4444
4445 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4446 """
4447 MiddleIsDown(self) -> bool
4448
4449 Returns true if the middle mouse button is currently down, independent
4450 of the current event type.
4451 """
5b5c9bc7 4452 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
d55e5bfc
RD
4453
4454 def RightIsDown(*args, **kwargs):
27fb7603
RD
4455 """
4456 RightIsDown(self) -> bool
4457
4458 Returns true if the right mouse button is currently down, independent
4459 of the current event type.
4460 """
5b5c9bc7 4461 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
d55e5bfc
RD
4462
4463 def Dragging(*args, **kwargs):
27fb7603
RD
4464 """
4465 Dragging(self) -> bool
4466
4467 Returns true if this was a dragging event (motion while a button is
4468 depressed).
4469 """
5b5c9bc7 4470 return _core_.MouseEvent_Dragging(*args, **kwargs)
d55e5bfc
RD
4471
4472 def Moving(*args, **kwargs):
27fb7603
RD
4473 """
4474 Moving(self) -> bool
4475
4476 Returns true if this was a motion event and no mouse buttons were
4477 pressed. If any mouse button is held pressed, then this method returns
4478 false and Dragging returns true.
4479 """
5b5c9bc7 4480 return _core_.MouseEvent_Moving(*args, **kwargs)
d55e5bfc
RD
4481
4482 def Entering(*args, **kwargs):
27fb7603
RD
4483 """
4484 Entering(self) -> bool
4485
4486 Returns true if the mouse was entering the window.
4487 """
5b5c9bc7 4488 return _core_.MouseEvent_Entering(*args, **kwargs)
d55e5bfc
RD
4489
4490 def Leaving(*args, **kwargs):
27fb7603
RD
4491 """
4492 Leaving(self) -> bool
4493
4494 Returns true if the mouse was leaving the window.
4495 """
5b5c9bc7 4496 return _core_.MouseEvent_Leaving(*args, **kwargs)
d55e5bfc
RD
4497
4498 def GetPosition(*args, **kwargs):
4499 """
5b5c9bc7 4500 GetPosition(self) -> Point
d55e5bfc 4501
27fb7603
RD
4502 Returns the pixel position of the mouse in window coordinates when the
4503 event happened.
d55e5bfc 4504 """
5b5c9bc7 4505 return _core_.MouseEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4506
4507 def GetPositionTuple(*args, **kwargs):
4508 """
4509 GetPositionTuple() -> (x,y)
4510
27fb7603
RD
4511 Returns the pixel position of the mouse in window coordinates when the
4512 event happened.
d55e5bfc 4513 """
5b5c9bc7 4514 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4515
4516 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4517 """
4518 GetLogicalPosition(self, DC dc) -> Point
4519
4520 Returns the logical mouse position in pixels (i.e. translated
4521 according to the translation set for the DC, which usually indicates
4522 that the window has been scrolled).
4523 """
5b5c9bc7 4524 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
d55e5bfc
RD
4525
4526 def GetX(*args, **kwargs):
27fb7603
RD
4527 """
4528 GetX(self) -> int
4529
4530 Returns X coordinate of the physical mouse event position.
4531 """
5b5c9bc7 4532 return _core_.MouseEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4533
4534 def GetY(*args, **kwargs):
27fb7603
RD
4535 """
4536 GetY(self) -> int
4537
4538 Returns Y coordinate of the physical mouse event position.
4539 """
5b5c9bc7 4540 return _core_.MouseEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4541
4542 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4543 """
4544 GetWheelRotation(self) -> int
4545
4546 Get wheel rotation, positive or negative indicates direction of
4547 rotation. Current devices all send an event when rotation is equal to
4548 +/-WheelDelta, but this allows for finer resolution devices to be
4549 created in the future. Because of this you shouldn't assume that one
4550 event is equal to 1 line or whatever, but you should be able to either
4551 do partial line scrolling or wait until +/-WheelDelta rotation values
4552 have been accumulated before scrolling.
4553 """
5b5c9bc7 4554 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
d55e5bfc
RD
4555
4556 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4557 """
4558 GetWheelDelta(self) -> int
4559
4560 Get wheel delta, normally 120. This is the threshold for action to be
4561 taken, and one such action (for example, scrolling one increment)
4562 should occur for each delta.
4563 """
5b5c9bc7 4564 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
d55e5bfc
RD
4565
4566 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4567 """
4568 GetLinesPerAction(self) -> int
4569
4570 Returns the configured number of lines (or whatever) to be scrolled
4571 per wheel action. Defaults to three.
4572 """
5b5c9bc7 4573 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
d55e5bfc
RD
4574
4575 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4576 """
4577 IsPageScroll(self) -> bool
4578
4579 Returns true if the system has been setup to do page scrolling with
4580 the mouse wheel instead of line scrolling.
4581 """
5b5c9bc7
RD
4582 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4583
4584 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4585 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4586 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4587 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4588 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4589 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4590 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4591 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4592 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4593 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4594 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4595 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
2131d850 4596_core_.MouseEvent_swigregister(MouseEvent)
d55e5bfc
RD
4597
4598#---------------------------------------------------------------------------
4599
5b5c9bc7 4600class SetCursorEvent(Event):
5ba5649b
RD
4601 """
4602 A SetCursorEvent is generated when the mouse cursor is about to be set
4603 as a result of mouse motion. This event gives the application the
4604 chance to perform specific mouse cursor processing based on the
4605 current position of the mouse within the window. Use the `SetCursor`
4606 method to specify the cursor you want to be displayed.
4607 """
1bd55598
RD
4608 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4609 __repr__ = _swig_repr
4610 def __init__(self, *args, **kwargs):
5ba5649b
RD
4611 """
4612 __init__(self, int x=0, int y=0) -> SetCursorEvent
4613
4614 Construct a new `wx.SetCursorEvent`.
4615 """
1bd55598 4616 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
d55e5bfc 4617 def GetX(*args, **kwargs):
5ba5649b
RD
4618 """
4619 GetX(self) -> int
4620
4621 Returns the X coordinate of the mouse in client coordinates.
4622 """
5b5c9bc7 4623 return _core_.SetCursorEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4624
4625 def GetY(*args, **kwargs):
5ba5649b
RD
4626 """
4627 GetY(self) -> int
4628
4629 Returns the Y coordinate of the mouse in client coordinates.
4630 """
5b5c9bc7 4631 return _core_.SetCursorEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4632
4633 def SetCursor(*args, **kwargs):
5ba5649b
RD
4634 """
4635 SetCursor(self, Cursor cursor)
4636
4637 Sets the cursor associated with this event.
4638 """
5b5c9bc7 4639 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
d55e5bfc
RD
4640
4641 def GetCursor(*args, **kwargs):
5ba5649b
RD
4642 """
4643 GetCursor(self) -> Cursor
4644
4645 Returns a reference to the cursor specified by this event.
4646 """
5b5c9bc7 4647 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
d55e5bfc
RD
4648
4649 def HasCursor(*args, **kwargs):
5ba5649b
RD
4650 """
4651 HasCursor(self) -> bool
4652
4653 Returns true if the cursor specified by this event is a valid cursor.
4654 """
5b5c9bc7 4655 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
d55e5bfc 4656
2131d850 4657_core_.SetCursorEvent_swigregister(SetCursorEvent)
d55e5bfc
RD
4658
4659#---------------------------------------------------------------------------
4660
5b5c9bc7 4661class KeyEvent(Event):
5ba5649b
RD
4662 """
4663 This event class contains information about keypress and character
4664 events. These events are only sent to the widget that currently has
4665 the keyboard focus.
4666
4667 Notice that there are three different kinds of keyboard events in
4668 wxWidgets: key down and up events and char events. The difference
4669 between the first two is clear - the first corresponds to a key press
4670 and the second to a key release - otherwise they are identical. Just
4671 note that if the key is maintained in a pressed state you will
4672 typically get a lot of (automatically generated) down events but only
4673 one up so it is wrong to assume that there is one up event
4674 corresponding to each down one.
4675
4676 Both key events provide untranslated key codes while the char event
4677 carries the translated one. The untranslated code for alphanumeric
4678 keys is always an upper case value. For the other keys it is one of
4679 WXK_XXX values from the keycodes table. The translated key is, in
4680 general, the character the user expects to appear as the result of the
4681 key combination when typing the text into a text entry zone, for
4682 example.
4683
4684 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4685 and the standard US keyboard): when the 'A' key is pressed, the key
4686 down event key code is equal to ASCII A == 65. But the char event key
4687 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4688 'A' keys simultaneously , the key code in key down event will still be
4689 just 'A' while the char event key code parameter will now be 'A' as
4690 well.
4691
4692 Although in this simple case it is clear that the correct key code
4693 could be found in the key down event handler by checking the value
4694 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4695 as for non alphanumeric keys or non-US keyboard layouts the
4696 translation is keyboard-layout dependent and can only be done properly
4697 by the system itself.
4698
4699 Another kind of translation is done when the control key is pressed:
4700 for example, for CTRL-A key press the key down event still carries the
4701 same key code 'A' as usual but the char event will have key code of 1,
4702 the ASCII value of this key combination.
4703
4704 You may discover how the other keys on your system behave
4705 interactively by running the KeyEvents sample in the wxPython demo and
4706 pressing some keys while the blue box at the top has the keyboard
4707 focus.
4708
4709 **Note**: If a key down event is caught and the event handler does not
4710 call event.Skip() then the coresponding char event will not
4711 happen. This is by design and enables the programs that handle both
4712 types of events to be a bit simpler.
4713
4714 **Note for Windows programmers**: The key and char events in wxWidgets
4715 are similar to but slightly different from Windows WM_KEYDOWN and
4716 WM_CHAR events. In particular, Alt-x combination will generate a char
4717 event in wxWidgets (unless it is used as an accelerator).
4718
4719 **Tip**: be sure to call event.Skip() for events that you don't
4720 process in key event function, otherwise menu shortcuts may cease to
4721 work under Windows.
4722
4723 """
1bd55598
RD
4724 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4725 __repr__ = _swig_repr
4726 def __init__(self, *args, **kwargs):
5ba5649b 4727 """
2131d850 4728 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
4729
4730 Construct a new `wx.KeyEvent`. Valid event types are:
4731 *
4732 """
1bd55598 4733 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
4734 def GetModifiers(*args, **kwargs):
4735 """
4736 GetModifiers(self) -> int
4737
4738 Returns a bitmask of the current modifier settings. Can be used to
4739 check if the key event has exactly the given modifiers without having
4740 to explicitly check that the other modifiers are not down. For
4741 example::
4742
4743 if event.GetModifers() == wx.MOD_CONTROL:
4744 DoSomething()
4745
4746 """
4747 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4748
d55e5bfc 4749 def ControlDown(*args, **kwargs):
5ba5649b
RD
4750 """
4751 ControlDown(self) -> bool
4752
4753 Returns ``True`` if the Control key was down at the time of the event.
4754 """
5b5c9bc7 4755 return _core_.KeyEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4756
4757 def MetaDown(*args, **kwargs):
5ba5649b
RD
4758 """
4759 MetaDown(self) -> bool
4760
4761 Returns ``True`` if the Meta key was down at the time of the event.
4762 """
5b5c9bc7 4763 return _core_.KeyEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4764
4765 def AltDown(*args, **kwargs):
5ba5649b
RD
4766 """
4767 AltDown(self) -> bool
4768
4769 Returns ``True`` if the Alt key was down at the time of the event.
4770 """
5b5c9bc7 4771 return _core_.KeyEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4772
4773 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4774 """
4775 ShiftDown(self) -> bool
4776
4777 Returns ``True`` if the Shift key was down at the time of the event.
4778 """
5b5c9bc7 4779 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4780
412d302d
RD
4781 def CmdDown(*args, **kwargs):
4782 """
4783 CmdDown(self) -> bool
4784
4785 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4786 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4787 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
4788 because Cmd key is used for the same thing under Mac as Ctrl
4789 elsewhere. The Ctrl still exists, it's just not used for this
4790 purpose. So for non-Mac platforms this is the same as `ControlDown`
4791 and Macs this is the same as `MetaDown`.
4792 """
5b5c9bc7 4793 return _core_.KeyEvent_CmdDown(*args, **kwargs)
412d302d 4794
d55e5bfc 4795 def HasModifiers(*args, **kwargs):
5ba5649b
RD
4796 """
4797 HasModifiers(self) -> bool
4798
4799 Returns true if either CTRL or ALT keys was down at the time of the
4800 key event. Note that this function does not take into account neither
4801 SHIFT nor META key states (the reason for ignoring the latter is that
4802 it is common for NUMLOCK key to be configured as META under X but the
4803 key presses even while NUMLOCK is on should be still processed
4804 normally).
4805 """
5b5c9bc7 4806 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
d55e5bfc
RD
4807
4808 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
4809 """
4810 GetKeyCode(self) -> int
4811
4812 Returns the virtual key code. ASCII events return normal ASCII values,
4813 while non-ASCII events return values such as WXK_LEFT for the left
4814 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4815 codes.
4816
4817 Note that in Unicode build, the returned value is meaningful only if
4818 the user entered a character that can be represented in current
4819 locale's default charset. You can obtain the corresponding Unicode
4820 character using `GetUnicodeKey`.
4821 """
5b5c9bc7 4822 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
4823
4824 KeyCode = GetKeyCode
bb4524c4 4825 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
4826 """
4827 GetUnicodeKey(self) -> int
4828
4829 Returns the Unicode character corresponding to this key event. This
4830 function is only meaningfule in a Unicode build of wxPython.
4831 """
5b5c9bc7 4832 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 4833
bb4524c4 4834 GetUniChar = GetUnicodeKey
b850e7f3
RD
4835 def SetUnicodeKey(*args, **kwargs):
4836 """
4837 SetUnicodeKey(self, int uniChar)
4838
4839 Set the Unicode value of the key event, but only if this is a Unicode
4840 build of wxPython.
4841 """
4842 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
4843
d55e5bfc 4844 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
4845 """
4846 GetRawKeyCode(self) -> unsigned int
4847
4848 Returns the raw key code for this event. This is a platform-dependent
4849 scan code which should only be used in advanced
4850 applications. Currently the raw key codes are not supported by all
4851 ports.
4852 """
5b5c9bc7 4853 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
d55e5bfc
RD
4854
4855 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
4856 """
4857 GetRawKeyFlags(self) -> unsigned int
4858
4859 Returns the low level key flags for this event. The flags are
4860 platform-dependent and should only be used in advanced applications.
4861 Currently the raw key flags are not supported by all ports.
4862 """
5b5c9bc7 4863 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
d55e5bfc
RD
4864
4865 def GetPosition(*args, **kwargs):
4866 """
5b5c9bc7 4867 GetPosition(self) -> Point
d55e5bfc 4868
5ba5649b 4869 Find the position of the event, if applicable.
d55e5bfc 4870 """
5b5c9bc7 4871 return _core_.KeyEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4872
4873 def GetPositionTuple(*args, **kwargs):
4874 """
4875 GetPositionTuple() -> (x,y)
4876
5ba5649b 4877 Find the position of the event, if applicable.
d55e5bfc 4878 """
5b5c9bc7 4879 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4880
4881 def GetX(*args, **kwargs):
5ba5649b
RD
4882 """
4883 GetX(self) -> int
4884
4885 Returns the X position (in client coordinates) of the event, if
4886 applicable.
4887 """
5b5c9bc7 4888 return _core_.KeyEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4889
4890 def GetY(*args, **kwargs):
5ba5649b
RD
4891 """
4892 GetY(self) -> int
4893
4894 Returns the Y position (in client coordinates) of the event, if
4895 applicable.
4896 """
5b5c9bc7
RD
4897 return _core_.KeyEvent_GetY(*args, **kwargs)
4898
4899 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4900 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4901 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4902 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4903 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4904 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4905 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4906 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4907 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4908 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
2131d850 4909_core_.KeyEvent_swigregister(KeyEvent)
d55e5bfc
RD
4910
4911#---------------------------------------------------------------------------
4912
5b5c9bc7 4913class SizeEvent(Event):
5ba5649b
RD
4914 """
4915 A size event holds information about size change events. The EVT_SIZE
4916 handler function will be called when the window it is bound to has
4917 been resized.
4918
4919 Note that the size passed is of the whole window: call
4920 `wx.Window.GetClientSize` for the area which may be used by the
4921 application.
4922
4923 When a window is resized, usually only a small part of the window is
4924 damaged and and that area is all that is in the update region for the
4925 next paint event. However, if your drawing depends on the size of the
4926 window, you may need to clear the DC explicitly and repaint the whole
4927 window. In which case, you may need to call `wx.Window.Refresh` to
4928 invalidate the entire window.
4929
4930 """
1bd55598
RD
4931 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4932 __repr__ = _swig_repr
4933 def __init__(self, *args, **kwargs):
5ba5649b
RD
4934 """
4935 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4936
4937 Construct a new ``wx.SizeEvent``.
4938 """
1bd55598 4939 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
d55e5bfc 4940 def GetSize(*args, **kwargs):
5ba5649b
RD
4941 """
4942 GetSize(self) -> Size
4943
4944 Returns the entire size of the window generating the size change
4945 event.
4946 """
5b5c9bc7 4947 return _core_.SizeEvent_GetSize(*args, **kwargs)
d55e5bfc
RD
4948
4949 def GetRect(*args, **kwargs):
5b5c9bc7
RD
4950 """GetRect(self) -> Rect"""
4951 return _core_.SizeEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
4952
4953 def SetRect(*args, **kwargs):
5b5c9bc7
RD
4954 """SetRect(self, Rect rect)"""
4955 return _core_.SizeEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
4956
4957 def SetSize(*args, **kwargs):
5b5c9bc7
RD
4958 """SetSize(self, Size size)"""
4959 return _core_.SizeEvent_SetSize(*args, **kwargs)
d55e5bfc 4960
5b5c9bc7
RD
4961 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4962 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
2131d850 4963_core_.SizeEvent_swigregister(SizeEvent)
d55e5bfc
RD
4964
4965#---------------------------------------------------------------------------
4966
5b5c9bc7 4967class MoveEvent(Event):
5ba5649b
RD
4968 """
4969 This event object is sent for EVT_MOVE event bindings when a window is
4970 moved to a new position.
4971 """
1bd55598
RD
4972 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4973 __repr__ = _swig_repr
4974 def __init__(self, *args, **kwargs):
5ba5649b
RD
4975 """
4976 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
4977
4978 Constructor.
4979 """
1bd55598 4980 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
d55e5bfc 4981 def GetPosition(*args, **kwargs):
5ba5649b
RD
4982 """
4983 GetPosition(self) -> Point
4984
4985 Returns the position of the window generating the move change event.
4986 """
5b5c9bc7 4987 return _core_.MoveEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4988
4989 def GetRect(*args, **kwargs):
5b5c9bc7
RD
4990 """GetRect(self) -> Rect"""
4991 return _core_.MoveEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
4992
4993 def SetRect(*args, **kwargs):
5b5c9bc7
RD
4994 """SetRect(self, Rect rect)"""
4995 return _core_.MoveEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
4996
4997 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
4998 """SetPosition(self, Point pos)"""
4999 return _core_.MoveEvent_SetPosition(*args, **kwargs)
d55e5bfc 5000
fef4c27a
RD
5001 m_pos = property(GetPosition, SetPosition)
5002 m_rect = property(GetRect, SetRect)
5003
2131d850 5004_core_.MoveEvent_swigregister(MoveEvent)
d55e5bfc
RD
5005
5006#---------------------------------------------------------------------------
5007
5b5c9bc7 5008class PaintEvent(Event):
5ba5649b
RD
5009 """
5010 A paint event is sent when a window's contents needs to be repainted.
5011 Note that in an EVT_PAINT handler the application must *always* create
5012 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5013 Windows assumes that the window has not been painted yet and will send
5014 the event again, causing endless refreshes.
5015
5016 You can optimize painting by retrieving the rectangles that have been
5017 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5018 and only repainting these rectangles. The rectangles are in terms of
5019 the client area, and are unscrolled, so you will need to do some
5020 calculations using the current view position to obtain logical,
5021 scrolled units.
5022
5023 """
1bd55598
RD
5024 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5025 __repr__ = _swig_repr
5026 def __init__(self, *args, **kwargs):
5b5c9bc7 5027 """__init__(self, int Id=0) -> PaintEvent"""
1bd55598 5028 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5029_core_.PaintEvent_swigregister(PaintEvent)
d55e5bfc 5030
5b5c9bc7
RD
5031class NcPaintEvent(Event):
5032 """Proxy of C++ NcPaintEvent class"""
1bd55598
RD
5033 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5034 __repr__ = _swig_repr
5035 def __init__(self, *args, **kwargs):
5b5c9bc7 5036 """__init__(self, int winid=0) -> NcPaintEvent"""
1bd55598 5037 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5038_core_.NcPaintEvent_swigregister(NcPaintEvent)
d55e5bfc
RD
5039
5040#---------------------------------------------------------------------------
5041
5b5c9bc7 5042class EraseEvent(Event):
5ba5649b
RD
5043 """
5044 An erase event is sent whenever the background of a window needs to be
5045 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5046 binder. On some platforms, such as GTK+, this event is simulated
5047 (simply generated just before the paint event) and may cause flicker.
5048
5049 To paint a custom background use the `GetDC` method and use the returned
5050 device context if it is not ``None``, otherwise create a temporary
5051 `wx.ClientDC` and draw on that.
5052
5053 """
1bd55598
RD
5054 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5055 __repr__ = _swig_repr
5056 def __init__(self, *args, **kwargs):
5ba5649b
RD
5057 """
5058 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5059
5060 Constructor
5061 """
1bd55598 5062 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
d55e5bfc 5063 def GetDC(*args, **kwargs):
5ba5649b
RD
5064 """
5065 GetDC(self) -> DC
5066
5067 Returns the device context the event handler should draw upon. If
5068 ``None`` is returned then create a temporary `wx.ClientDC` and use
5069 that instead.
5070 """
5b5c9bc7 5071 return _core_.EraseEvent_GetDC(*args, **kwargs)
d55e5bfc 5072
2131d850 5073_core_.EraseEvent_swigregister(EraseEvent)
d55e5bfc
RD
5074
5075#---------------------------------------------------------------------------
5076
5b5c9bc7 5077class FocusEvent(Event):
5ba5649b
RD
5078 """
5079 A focus event is sent when a window's focus changes. The window losing
5080 focus receives an EVT_KILL_FOCUS event while the window gaining it
5081 gets an EVT_SET_FOCUS event.
5082
5083 Notice that the set focus event happens both when the user gives focus
5084 to the window (whether using the mouse or keyboard) and when it is
5085 done from the program itself using `wx.Window.SetFocus`.
5086
5087 """
1bd55598
RD
5088 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5089 __repr__ = _swig_repr
5090 def __init__(self, *args, **kwargs):
5ba5649b 5091 """
2131d850 5092 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5093
5094 Constructor
5095 """
1bd55598 5096 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
d55e5bfc 5097 def GetWindow(*args, **kwargs):
5ba5649b
RD
5098 """
5099 GetWindow(self) -> Window
5100
5101 Returns the other window associated with this event, that is the
5102 window which had the focus before for the EVT_SET_FOCUS event and the
5103 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5104
5105 Warning: the window returned may be None!
5106 """
5b5c9bc7 5107 return _core_.FocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
5108
5109 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
5110 """SetWindow(self, Window win)"""
5111 return _core_.FocusEvent_SetWindow(*args, **kwargs)
d55e5bfc 5112
2131d850 5113_core_.FocusEvent_swigregister(FocusEvent)
d55e5bfc
RD
5114
5115#---------------------------------------------------------------------------
5116
5b5c9bc7 5117class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5118 """
5119 wx.ChildFocusEvent notifies the parent that a child has received the
5120 focus. Unlike `wx.FocusEvent` it is propagated up the window
5121 heirarchy.
5122 """
1bd55598
RD
5123 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5124 __repr__ = _swig_repr
5125 def __init__(self, *args, **kwargs):
5ba5649b
RD
5126 """
5127 __init__(self, Window win=None) -> ChildFocusEvent
5128
5129 Constructor
5130 """
1bd55598 5131 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
d55e5bfc 5132 def GetWindow(*args, **kwargs):
5ba5649b
RD
5133 """
5134 GetWindow(self) -> Window
5135
5136 The window which has just received the focus.
5137 """
5b5c9bc7 5138 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
d55e5bfc 5139
2131d850 5140_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d55e5bfc
RD
5141
5142#---------------------------------------------------------------------------
5143
5b5c9bc7 5144class ActivateEvent(Event):
5ba5649b
RD
5145 """
5146 An activate event is sent when a top-level window or the entire
5147 application is being activated or deactivated.
5148
5149 A top-level window (a dialog or frame) receives an activate event when
5150 is being activated or deactivated. This is indicated visually by the
5151 title bar changing colour, and a subwindow gaining the keyboard focus.
5152 An application is activated or deactivated when one of its frames
5153 becomes activated, or a frame becomes inactivate resulting in all
5154 application frames being inactive.
5155
5156 Please note that usually you should call event.Skip() in your handlers
5157 for these events so the default handlers will still be called, as not
5158 doing so can result in strange effects.
5159
5160 """
1bd55598
RD
5161 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5162 __repr__ = _swig_repr
5163 def __init__(self, *args, **kwargs):
5ba5649b 5164 """
2131d850 5165 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5166
5167 Constructor
5168 """
1bd55598 5169 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
d55e5bfc 5170 def GetActive(*args, **kwargs):
5ba5649b
RD
5171 """
5172 GetActive(self) -> bool
5173
5174 Returns true if the application or window is being activated, false
5175 otherwise.
5176 """
5b5c9bc7 5177 return _core_.ActivateEvent_GetActive(*args, **kwargs)
d55e5bfc 5178
2131d850 5179_core_.ActivateEvent_swigregister(ActivateEvent)
d55e5bfc
RD
5180
5181#---------------------------------------------------------------------------
5182
5b5c9bc7 5183class InitDialogEvent(Event):
5ba5649b
RD
5184 """
5185 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5186 any window when `wx.Window.InitDialog` is called. Handlers for this
5187 event can transfer data to the window, or anything else that should be
5188 done before the user begins editing the form. The default handler
5189 calls `wx.Window.TransferDataToWindow`.
5190 """
1bd55598
RD
5191 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5192 __repr__ = _swig_repr
5193 def __init__(self, *args, **kwargs):
5ba5649b
RD
5194 """
5195 __init__(self, int Id=0) -> InitDialogEvent
5196
5197 Constructor
5198 """
1bd55598 5199 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5200_core_.InitDialogEvent_swigregister(InitDialogEvent)
d55e5bfc
RD
5201
5202#---------------------------------------------------------------------------
5203
5b5c9bc7 5204class MenuEvent(Event):
5ba5649b
RD
5205 """
5206 This class is used for a variety of menu-related events. Note that
5207 these do not include menu command events, which are handled by sending
5208 `wx.CommandEvent` objects.
5209
5210 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5211 text in the first field of the status bar.
5212 """
1bd55598
RD
5213 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5214 __repr__ = _swig_repr
5215 def __init__(self, *args, **kwargs):
5ba5649b 5216 """
2131d850 5217 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5218
5219 Constructor
5220 """
1bd55598 5221 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
d55e5bfc 5222 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5223 """
5224 GetMenuId(self) -> int
5225
5226 Returns the menu identifier associated with the event. This method
5227 should be only used with the HIGHLIGHT events.
5228 """
5b5c9bc7 5229 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
d55e5bfc
RD
5230
5231 def IsPopup(*args, **kwargs):
5ba5649b
RD
5232 """
5233 IsPopup(self) -> bool
5234
5235 Returns ``True`` if the menu which is being opened or closed is a
5236 popup menu, ``False`` if it is a normal one. This method should only
5237 be used with the OPEN and CLOSE events.
5238 """
5b5c9bc7 5239 return _core_.MenuEvent_IsPopup(*args, **kwargs)
d55e5bfc
RD
5240
5241 def GetMenu(*args, **kwargs):
5ba5649b
RD
5242 """
5243 GetMenu(self) -> Menu
5244
5245 Returns the menu which is being opened or closed. This method should
5246 only be used with the OPEN and CLOSE events.
5247 """
5b5c9bc7 5248 return _core_.MenuEvent_GetMenu(*args, **kwargs)
d55e5bfc 5249
2131d850 5250_core_.MenuEvent_swigregister(MenuEvent)
d55e5bfc
RD
5251
5252#---------------------------------------------------------------------------
5253
5b5c9bc7 5254class CloseEvent(Event):
5ba5649b
RD
5255 """
5256 This event class contains information about window and session close
5257 events.
5258
5259 The handler function for EVT_CLOSE is called when the user has tried
5260 to close a a frame or dialog box using the window manager controls or
5261 the system menu. It can also be invoked by the application itself
5262 programmatically, for example by calling the `wx.Window.Close`
5263 function.
5264
5265 You should check whether the application is forcing the deletion of
5266 the window using `CanVeto`. If it returns ``False``, you must destroy
5267 the window using `wx.Window.Destroy`. If the return value is ``True``,
5268 it is up to you whether you respond by destroying the window or not.
5269 For example you may wish to display a message dialog prompting to save
5270 files or to cancel the close.
5271
5272 If you don't destroy the window, you should call `Veto` to let the
5273 calling code know that you did not destroy the window. This allows the
5274 `wx.Window.Close` function to return ``True`` or ``False`` depending
5275 on whether the close instruction was honored or not.
5276 """
1bd55598
RD
5277 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5278 __repr__ = _swig_repr
5279 def __init__(self, *args, **kwargs):
5ba5649b 5280 """
2131d850 5281 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5282
5283 Constructor.
5284 """
1bd55598 5285 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
d55e5bfc 5286 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5287 """
5288 SetLoggingOff(self, bool logOff)
5289
5290 Sets the 'logging off' flag.
5291 """
5b5c9bc7 5292 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5293
5294 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5295 """
5296 GetLoggingOff(self) -> bool
5297
034e3677
RD
5298 Returns ``True`` if the user is logging off or ``False`` if the
5299 system is shutting down. This method can only be called for end
5300 session and query end session events, it doesn't make sense for close
5301 window event.
5ba5649b 5302 """
5b5c9bc7 5303 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5304
5305 def Veto(*args, **kwargs):
5ba5649b
RD
5306 """
5307 Veto(self, bool veto=True)
5308
5309 Call this from your event handler to veto a system shutdown or to
5310 signal to the calling application that a window close did not happen.
5311
5312 You can only veto a shutdown or close if `CanVeto` returns true.
5313 """
5b5c9bc7 5314 return _core_.CloseEvent_Veto(*args, **kwargs)
d55e5bfc 5315
5ba5649b
RD
5316 def GetVeto(*args, **kwargs):
5317 """GetVeto(self) -> bool"""
5318 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5319
d55e5bfc 5320 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5321 """
5322 SetCanVeto(self, bool canVeto)
5323
5324 Sets the 'can veto' flag.
5325 """
5b5c9bc7 5326 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
d55e5bfc
RD
5327
5328 def CanVeto(*args, **kwargs):
5ba5649b
RD
5329 """
5330 CanVeto(self) -> bool
d55e5bfc 5331
5ba5649b
RD
5332 Returns true if you can veto a system shutdown or a window close
5333 event. Vetoing a window close event is not possible if the calling
5334 code wishes to force the application to exit, and so this function
5335 must be called to check this.
5336 """
5337 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc 5338
2131d850 5339_core_.CloseEvent_swigregister(CloseEvent)
d55e5bfc
RD
5340
5341#---------------------------------------------------------------------------
5342
5b5c9bc7 5343class ShowEvent(Event):
5ba5649b 5344 """An EVT_SHOW event is sent when a window is shown or hidden."""
1bd55598
RD
5345 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5346 __repr__ = _swig_repr
5347 def __init__(self, *args, **kwargs):
5ba5649b
RD
5348 """
5349 __init__(self, int winid=0, bool show=False) -> ShowEvent
5350
5351 An EVT_SHOW event is sent when a window is shown or hidden.
5352 """
1bd55598 5353 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
d55e5bfc
RD
5354 def SetShow(*args, **kwargs):
5355 """SetShow(self, bool show)"""
5b5c9bc7 5356 return _core_.ShowEvent_SetShow(*args, **kwargs)
d55e5bfc
RD
5357
5358 def GetShow(*args, **kwargs):
5359 """GetShow(self) -> bool"""
5b5c9bc7 5360 return _core_.ShowEvent_GetShow(*args, **kwargs)
d55e5bfc 5361
2131d850 5362_core_.ShowEvent_swigregister(ShowEvent)
d55e5bfc
RD
5363
5364#---------------------------------------------------------------------------
5365
5b5c9bc7 5366class IconizeEvent(Event):
5ba5649b
RD
5367 """
5368 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5369 restored.
5370 """
1bd55598
RD
5371 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5372 __repr__ = _swig_repr
5373 def __init__(self, *args, **kwargs):
5ba5649b
RD
5374 """
5375 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5376
5377 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5378 restored.
5379 """
1bd55598 5380 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
d55e5bfc 5381 def Iconized(*args, **kwargs):
5ba5649b
RD
5382 """
5383 Iconized(self) -> bool
5384
5385 Returns ``True`` if the frame has been iconized, ``False`` if it has
5386 been restored.
5387 """
5b5c9bc7 5388 return _core_.IconizeEvent_Iconized(*args, **kwargs)
d55e5bfc 5389
2131d850 5390_core_.IconizeEvent_swigregister(IconizeEvent)
d55e5bfc
RD
5391
5392#---------------------------------------------------------------------------
5393
5b5c9bc7 5394class MaximizeEvent(Event):
5ba5649b 5395 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
1bd55598
RD
5396 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5397 __repr__ = _swig_repr
5398 def __init__(self, *args, **kwargs):
5ba5649b
RD
5399 """
5400 __init__(self, int id=0) -> MaximizeEvent
5401
5402 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5403 """
1bd55598 5404 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5405_core_.MaximizeEvent_swigregister(MaximizeEvent)
d55e5bfc
RD
5406
5407#---------------------------------------------------------------------------
5408
5b5c9bc7 5409class DropFilesEvent(Event):
5ba5649b
RD
5410 """
5411 This class is used for drop files events, that is, when files have
5412 been dropped onto the window. This functionality is only available
5413 under Windows. The window must have previously been enabled for
5414 dropping by calling `wx.Window.DragAcceptFiles`.
5415
5416 Important note: this is a separate implementation to the more general
5417 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5418 implementation uses the older, Windows message-based approach of
5419 dropping files.
5420
5421 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5422 events.
5423
5424 """
1bd55598
RD
5425 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5426 def __init__(self): raise AttributeError, "No constructor defined"
5427 __repr__ = _swig_repr
d55e5bfc 5428 def GetPosition(*args, **kwargs):
5ba5649b
RD
5429 """
5430 GetPosition(self) -> Point
5431
5432 Returns the position at which the files were dropped.
5433 """
5b5c9bc7 5434 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5435
5436 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5437 """
5438 GetNumberOfFiles(self) -> int
5439
5440 Returns the number of files dropped.
5441 """
5b5c9bc7 5442 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
d55e5bfc
RD
5443
5444 def GetFiles(*args, **kwargs):
5ba5649b
RD
5445 """
5446 GetFiles(self) -> PyObject
5447
5448 Returns a list of the filenames that were dropped.
5449 """
5b5c9bc7 5450 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
d55e5bfc 5451
2131d850 5452_core_.DropFilesEvent_swigregister(DropFilesEvent)
d55e5bfc
RD
5453
5454#---------------------------------------------------------------------------
5455
5b5c9bc7
RD
5456UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5457UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5458class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5459 """
5460 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5461 wxWidgets to give an application the chance to update various user
5462 interface elements.
5463
5464 Without update UI events, an application has to work hard to
5465 check/uncheck, enable/disable, and set the text for elements such as
5466 menu items and toolbar buttons. The code for doing this has to be
5467 mixed up with the code that is invoked when an action is invoked for a
5468 menu item or button.
5469
5470 With update UI events, you define an event handler to look at the
5471 state of the application and change UI elements accordingly. wxWidgets
5472 will call your handler functions in idle time, so you don't have to
5473 worry where to call this code. In addition to being a clearer and more
5474 declarative method, it also means you don't have to worry whether
5475 you're updating a toolbar or menubar identifier. The same handler can
5476 update a menu item and toolbar button, if the ID values are the same.
5477
5478 Instead of directly manipulating the menu or button, you call
5479 functions in the event object, such as `Check`. wxWidgets will
5480 determine whether such a call has been made, and which UI element to
5481 update.
5482
5483 These events will work for popup menus as well as menubars. Just
5484 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5485 any UI events for the window that owns the menu.
5486
5487 If you find that the overhead of UI update processing is affecting
5488 your application, you can do one or both of the following:
5489
5490 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5491 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5492 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5493 receive update events. No other windows will receive update
5494 events.
5495
5496 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5497 value to set the delay between updates. You may need to call
5498 `wx.Window.UpdateWindowUI` at critical points, for example when
5499 a dialog is about to be shown, in case the user sees a slight
5500 delay before windows are updated.
5501
5502 Note that although events are sent in idle time, defining a EVT_IDLE
5503 handler for a window does not affect this because the events are sent
5504 from an internal idle handler.
5505
5506 wxWidgets tries to optimize update events on some platforms. On
5507 Windows and GTK+, events for menubar items are only sent when the menu
5508 is about to be shown, and not in idle time.
5509
5510 """
1bd55598
RD
5511 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5512 __repr__ = _swig_repr
5513 def __init__(self, *args, **kwargs):
5ba5649b
RD
5514 """
5515 __init__(self, int commandId=0) -> UpdateUIEvent
5516
5517 Constructor
5518 """
1bd55598 5519 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
d55e5bfc 5520 def GetChecked(*args, **kwargs):
5ba5649b
RD
5521 """
5522 GetChecked(self) -> bool
5523
5524 Returns ``True`` if the UI element should be checked.
5525 """
5b5c9bc7 5526 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
d55e5bfc
RD
5527
5528 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5529 """
5530 GetEnabled(self) -> bool
5531
5532 Returns ``True`` if the UI element should be enabled.
5533 """
5b5c9bc7 5534 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
d55e5bfc 5535
b1fcee84
RD
5536 def GetShown(*args, **kwargs):
5537 """
5538 GetShown(self) -> bool
5539
5540 Returns ``True`` if the UI element should be shown.
5541 """
5542 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5543
d55e5bfc 5544 def GetText(*args, **kwargs):
5ba5649b
RD
5545 """
5546 GetText(self) -> String
5547
5548 Returns the text that should be set for the UI element.
5549 """
5b5c9bc7 5550 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
d55e5bfc
RD
5551
5552 def GetSetText(*args, **kwargs):
5ba5649b
RD
5553 """
5554 GetSetText(self) -> bool
5555
5556 Returns ``True`` if the application has called `SetText`. For
5557 wxWidgets internal use only.
5558 """
5b5c9bc7 5559 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
d55e5bfc
RD
5560
5561 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5562 """
5563 GetSetChecked(self) -> bool
5564
5565 Returns ``True`` if the application has called `Check`. For wxWidgets
5566 internal use only.
5567 """
5b5c9bc7 5568 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
d55e5bfc
RD
5569
5570 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5571 """
5572 GetSetEnabled(self) -> bool
5573
5574 Returns ``True`` if the application has called `Enable`. For wxWidgets
5575 internal use only.
5576 """
5b5c9bc7 5577 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
d55e5bfc 5578
b1fcee84
RD
5579 def GetSetShown(*args, **kwargs):
5580 """
5581 GetSetShown(self) -> bool
5582
5583 Returns ``True`` if the application has called `Show`. For wxWidgets
5584 internal use only.
5585 """
5586 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5587
d55e5bfc 5588 def Check(*args, **kwargs):
5ba5649b
RD
5589 """
5590 Check(self, bool check)
5591
5592 Check or uncheck the UI element.
5593 """
5b5c9bc7 5594 return _core_.UpdateUIEvent_Check(*args, **kwargs)
d55e5bfc
RD
5595
5596 def Enable(*args, **kwargs):
5ba5649b
RD
5597 """
5598 Enable(self, bool enable)
5599
5600 Enable or disable the UI element.
5601 """
5b5c9bc7 5602 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
d55e5bfc 5603
b1fcee84
RD
5604 def Show(*args, **kwargs):
5605 """
5606 Show(self, bool show)
5607
5608 Show or hide the UI element.
5609 """
5610 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5611
d55e5bfc 5612 def SetText(*args, **kwargs):
5ba5649b
RD
5613 """
5614 SetText(self, String text)
5615
5616 Sets the text for this UI element.
5617 """
5b5c9bc7 5618 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
d55e5bfc
RD
5619
5620 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5621 """
5622 SetUpdateInterval(long updateInterval)
5623
5624 Sets the interval between updates in milliseconds. Set to -1 to
5625 disable updates, or to 0 to update as frequently as possible. The
5626 default is 0.
5627
5628 Use this to reduce the overhead of UI update events if your
5629 application has a lot of windows. If you set the value to -1 or
5630 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5631 at appropriate points in your application, such as when a dialog is
5632 about to be shown.
5633 """
5b5c9bc7 5634 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5635
5636 SetUpdateInterval = staticmethod(SetUpdateInterval)
5637 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5638 """
5639 GetUpdateInterval() -> long
5640
5641 Returns the current interval between updates in milliseconds. -1
5642 disables updates, 0 updates as frequently as possible.
5643 """
5b5c9bc7 5644 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5645
5646 GetUpdateInterval = staticmethod(GetUpdateInterval)
5647 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5648 """
5649 CanUpdate(Window win) -> bool
5650
5651 Returns ``True`` if it is appropriate to update (send UI update events
5652 to) this window.
5653
5654 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5655 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5656 events were last sent in idle time, and the update interval, to
5657 determine whether events should be sent to this window now. By default
5658 this will always return true because the update mode is initially
5659 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5660 events will be sent as often as possible. You can reduce the frequency
5661 that events are sent by changing the mode and/or setting an update
5662 interval.
5663
5664 """
5b5c9bc7 5665 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc
RD
5666
5667 CanUpdate = staticmethod(CanUpdate)
5668 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5669 """
5670 ResetUpdateTime()
5671
5672 Used internally to reset the last-updated time to the current time. It
5673 is assumed that update events are normally sent in idle time, so this
5674 is called at the end of idle processing.
5675 """
5b5c9bc7 5676 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc
RD
5677
5678 ResetUpdateTime = staticmethod(ResetUpdateTime)
5679 def SetMode(*args, **kwargs):
5ba5649b
RD
5680 """
5681 SetMode(int mode)
5682
5683 Specify how wxWidgets will send update events: to all windows, or only
5684 to those which specify that they will process the events.
5685
5686 The mode may be one of the following values:
5687
5688 ============================= ==========================================
5689 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5690 is the default setting.
5691 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5692 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5693 style set.
5694 ============================= ==========================================
5695
5696 """
5b5c9bc7 5697 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
5698
5699 SetMode = staticmethod(SetMode)
5700 def GetMode(*args, **kwargs):
5ba5649b
RD
5701 """
5702 GetMode() -> int
5703
5704 Returns a value specifying how wxWidgets will send update events: to
5705 all windows, or only to those which specify that they will process the
5706 events.
5707 """
5b5c9bc7 5708 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
5709
5710 GetMode = staticmethod(GetMode)
2131d850 5711_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d55e5bfc 5712
5b5c9bc7 5713def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
1bd55598 5714 """
5ba5649b
RD
5715 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5716
5717 Sets the interval between updates in milliseconds. Set to -1 to
5718 disable updates, or to 0 to update as frequently as possible. The
5719 default is 0.
5720
5721 Use this to reduce the overhead of UI update events if your
5722 application has a lot of windows. If you set the value to -1 or
5723 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5724 at appropriate points in your application, such as when a dialog is
5725 about to be shown.
5726 """
1bd55598 5727 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 5728
1bd55598
RD
5729def UpdateUIEvent_GetUpdateInterval(*args):
5730 """
5ba5649b
RD
5731 UpdateUIEvent_GetUpdateInterval() -> long
5732
5733 Returns the current interval between updates in milliseconds. -1
5734 disables updates, 0 updates as frequently as possible.
5735 """
1bd55598 5736 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d55e5bfc 5737
5b5c9bc7 5738def UpdateUIEvent_CanUpdate(*args, **kwargs):
1bd55598 5739 """
5ba5649b
RD
5740 UpdateUIEvent_CanUpdate(Window win) -> bool
5741
5742 Returns ``True`` if it is appropriate to update (send UI update events
5743 to) this window.
5744
5745 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5746 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5747 events were last sent in idle time, and the update interval, to
5748 determine whether events should be sent to this window now. By default
5749 this will always return true because the update mode is initially
5750 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5751 events will be sent as often as possible. You can reduce the frequency
5752 that events are sent by changing the mode and/or setting an update
5753 interval.
5754
5755 """
1bd55598 5756 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 5757
1bd55598
RD
5758def UpdateUIEvent_ResetUpdateTime(*args):
5759 """
5ba5649b
RD
5760 UpdateUIEvent_ResetUpdateTime()
5761
5762 Used internally to reset the last-updated time to the current time. It
5763 is assumed that update events are normally sent in idle time, so this
5764 is called at the end of idle processing.
5765 """
1bd55598 5766 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d55e5bfc 5767
5b5c9bc7 5768def UpdateUIEvent_SetMode(*args, **kwargs):
1bd55598 5769 """
5ba5649b
RD
5770 UpdateUIEvent_SetMode(int mode)
5771
5772 Specify how wxWidgets will send update events: to all windows, or only
5773 to those which specify that they will process the events.
5774
5775 The mode may be one of the following values:
5776
5777 ============================= ==========================================
5778 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5779 is the default setting.
5780 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5781 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5782 style set.
5783 ============================= ==========================================
5784
5785 """
1bd55598 5786 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 5787
1bd55598
RD
5788def UpdateUIEvent_GetMode(*args):
5789 """
5ba5649b
RD
5790 UpdateUIEvent_GetMode() -> int
5791
5792 Returns a value specifying how wxWidgets will send update events: to
5793 all windows, or only to those which specify that they will process the
5794 events.
5795 """
1bd55598 5796 return _core_.UpdateUIEvent_GetMode(*args)
d55e5bfc
RD
5797
5798#---------------------------------------------------------------------------
5799
5b5c9bc7 5800class SysColourChangedEvent(Event):
5ba5649b
RD
5801 """
5802 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5803 when the user changes the colour settings using the control
5804 panel. This is only applicable under Windows.
5805
5806 The default event handler for this event propagates the event to child
5807 windows, since Windows only sends the events to top-level windows. If
5808 intercepting this event for a top-level window, remember to call
5809 `Skip` so the the base class handler will still be executed, or to
5810 pass the event on to the window's children explicitly.
5811
5812 """
1bd55598
RD
5813 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5814 __repr__ = _swig_repr
5815 def __init__(self, *args, **kwargs):
5ba5649b
RD
5816 """
5817 __init__(self) -> SysColourChangedEvent
5818
5819 Constructor
5820 """
1bd55598 5821 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 5822_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d55e5bfc
RD
5823
5824#---------------------------------------------------------------------------
5825
5b5c9bc7 5826class MouseCaptureChangedEvent(Event):
5ba5649b
RD
5827 """
5828 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5829 a window that loses its mouse capture. This is called even if
5830 `wx.Window.ReleaseMouse` was called by the application code. Handling
5831 this event allows an application to cater for unexpected capture
5832 releases which might otherwise confuse mouse handling code.
5833
5834 This event is implemented under Windows only.
5835 """
1bd55598
RD
5836 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5837 __repr__ = _swig_repr
5838 def __init__(self, *args, **kwargs):
5ba5649b
RD
5839 """
5840 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5841
5842 Constructor
5843 """
1bd55598 5844 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
d55e5bfc 5845 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
5846 """
5847 GetCapturedWindow(self) -> Window
5848
5849 Returns the window that gained the capture, or ``None`` if it was a
5850 non-wxWidgets window.
5851 """
5b5c9bc7 5852 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
d55e5bfc 5853
2131d850 5854_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d55e5bfc
RD
5855
5856#---------------------------------------------------------------------------
5857
34e0a3bb
RD
5858class MouseCaptureLostEvent(Event):
5859 """
5860 A mouse capture lost event is sent to a window that obtained mouse
5861 capture, which was subsequently loss due to "external" event, for
5862 example when a dialog box is shown or if another application captures
5863 the mouse.
5864
5865 If this happens, this event is sent to all windows that are on the
5866 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
5867 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
5868 if the capture changes because of a call to CaptureMouse or
5869 ReleaseMouse.
5870
5871 This event is currently emitted under Windows only.
5872
5873 """
5874 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5875 __repr__ = _swig_repr
5876 def __init__(self, *args, **kwargs):
5877 """
5878 __init__(self, int winid=0) -> MouseCaptureLostEvent
5879
5880 A mouse capture lost event is sent to a window that obtained mouse
5881 capture, which was subsequently loss due to "external" event, for
5882 example when a dialog box is shown or if another application captures
5883 the mouse.
5884
5885 If this happens, this event is sent to all windows that are on the
5886 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
5887 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
5888 if the capture changes because of a call to CaptureMouse or
5889 ReleaseMouse.
5890
5891 This event is currently emitted under Windows only.
5892
5893 """
5894 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
5895_core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
5896
5897#---------------------------------------------------------------------------
5898
5b5c9bc7 5899class DisplayChangedEvent(Event):
5ba5649b
RD
5900 """
5901 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5902 resolution has changed.
5903
5904 This event is implemented under Windows only.
5905 """
1bd55598
RD
5906 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5907 __repr__ = _swig_repr
5908 def __init__(self, *args, **kwargs):
5b5c9bc7 5909 """__init__(self) -> DisplayChangedEvent"""
1bd55598 5910 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 5911_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d55e5bfc
RD
5912
5913#---------------------------------------------------------------------------
5914
5b5c9bc7 5915class PaletteChangedEvent(Event):
5ba5649b
RD
5916 """
5917 An EVT_PALETTE_CHANGED event is sent when the system palette has
5918 changed, thereby giving each window a chance to redo their own to
5919 match.
5920
5921 This event is implemented under Windows only.
5922 """
1bd55598
RD
5923 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5924 __repr__ = _swig_repr
5925 def __init__(self, *args, **kwargs):
5ba5649b
RD
5926 """
5927 __init__(self, int id=0) -> PaletteChangedEvent
5928
5929 An EVT_PALETTE_CHANGED event is sent when the system palette has
5930 changed, thereby giving each window a chance to redo their own to
5931 match.
5932
5933 This event is implemented under Windows only.
5934 """
1bd55598 5935 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
d55e5bfc 5936 def SetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
5937 """SetChangedWindow(self, Window win)"""
5938 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
d55e5bfc
RD
5939
5940 def GetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
5941 """GetChangedWindow(self) -> Window"""
5942 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
d55e5bfc 5943
2131d850 5944_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d55e5bfc
RD
5945
5946#---------------------------------------------------------------------------
5947
5b5c9bc7 5948class QueryNewPaletteEvent(Event):
5ba5649b
RD
5949 """
5950 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5951 focus and should re-do its palette.
5952
5953 This event is implemented under Windows only.
5954 """
1bd55598
RD
5955 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5956 __repr__ = _swig_repr
5957 def __init__(self, *args, **kwargs):
5ba5649b
RD
5958 """
5959 __init__(self, int winid=0) -> QueryNewPaletteEvent
5960
5961 Constructor.
5962 """
1bd55598 5963 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
d55e5bfc 5964 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
5965 """
5966 SetPaletteRealized(self, bool realized)
5967
5968 App should set this if it changes the palette.
5969 """
5b5c9bc7 5970 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
5971
5972 def GetPaletteRealized(*args, **kwargs):
5973 """GetPaletteRealized(self) -> bool"""
5b5c9bc7 5974 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
d55e5bfc 5975
2131d850 5976_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d55e5bfc
RD
5977
5978#---------------------------------------------------------------------------
5979
5b5c9bc7 5980class NavigationKeyEvent(Event):
5ba5649b
RD
5981 """
5982 EVT_NAVIGATION_KEY events are used to control moving the focus between
5983 widgets, otherwise known as tab-traversal. You woudl normally not
5984 catch navigation events in applications as there are already
5985 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5986 it useful to send navigation events in certain situations to change
5987 the focus in certain ways, although it's probably easier to just call
5988 `wx.Window.Navigate`.
5989 """
1bd55598
RD
5990 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5991 __repr__ = _swig_repr
5992 def __init__(self, *args, **kwargs):
5b5c9bc7 5993 """__init__(self) -> NavigationKeyEvent"""
1bd55598 5994 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
d55e5bfc 5995 def GetDirection(*args, **kwargs):
5ba5649b
RD
5996 """
5997 GetDirection(self) -> bool
5998
5999 Returns ``True`` if the direction is forward, ``False`` otherwise.
6000 """
5b5c9bc7 6001 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
d55e5bfc
RD
6002
6003 def SetDirection(*args, **kwargs):
5ba5649b
RD
6004 """
6005 SetDirection(self, bool forward)
6006
6007 Specify the direction that the navigation should take. Usually the
6008 difference between using Tab and Shift-Tab.
6009 """
5b5c9bc7 6010 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
d55e5bfc
RD
6011
6012 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6013 """
6014 IsWindowChange(self) -> bool
6015
6016 Returns ``True`` if window change is allowed.
6017 """
5b5c9bc7 6018 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
d55e5bfc
RD
6019
6020 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6021 """
6022 SetWindowChange(self, bool ischange)
6023
6024 Specify if the navigation should be able to change parent windows.
6025 For example, changing notebook pages, etc. This is usually implemented
6026 by using Control-Tab.
6027 """
5b5c9bc7 6028 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
d55e5bfc 6029
68350608 6030 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6031 """
6032 IsFromTab(self) -> bool
6033
6034 Returns ``True`` if the navigation event is originated from the Tab
6035 key.
6036 """
5b5c9bc7 6037 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
68350608
RD
6038
6039 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6040 """
6041 SetFromTab(self, bool bIs)
6042
6043 Set to true under MSW if the event was generated using the tab key.
6044 This is required for proper navogation over radio buttons.
6045 """
5b5c9bc7 6046 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
68350608 6047
908b74cd 6048 def SetFlags(*args, **kwargs):
5ba5649b
RD
6049 """
6050 SetFlags(self, long flags)
6051
6052 Set the navigation flags to a combination of the following:
6053
6054 * wx.NavigationKeyEvent.IsBackward
6055 * wx.NavigationKeyEvent.IsForward
6056 * wx.NavigationKeyEvent.WinChange
6057 * wx.NavigationKeyEvent.FromTab
6058
6059 """
5b5c9bc7 6060 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
908b74cd 6061
d55e5bfc 6062 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6063 """
6064 GetCurrentFocus(self) -> Window
6065
6066 Returns the child window which currenty has the focus. May be
6067 ``None``.
6068 """
5b5c9bc7 6069 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
d55e5bfc
RD
6070
6071 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6072 """
6073 SetCurrentFocus(self, Window win)
6074
6075 Set the window that has the focus.
6076 """
5b5c9bc7 6077 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
d55e5bfc 6078
5b5c9bc7
RD
6079 IsBackward = _core_.NavigationKeyEvent_IsBackward
6080 IsForward = _core_.NavigationKeyEvent_IsForward
6081 WinChange = _core_.NavigationKeyEvent_WinChange
6082 FromTab = _core_.NavigationKeyEvent_FromTab
2131d850 6083_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d55e5bfc
RD
6084
6085#---------------------------------------------------------------------------
6086
5b5c9bc7 6087class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6088 """
6089 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6090 underlying GUI object) exists.
6091 """
1bd55598
RD
6092 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6093 __repr__ = _swig_repr
6094 def __init__(self, *args, **kwargs):
5ba5649b
RD
6095 """
6096 __init__(self, Window win=None) -> WindowCreateEvent
6097
6098 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6099 underlying GUI object) exists.
6100 """
1bd55598 6101 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
d55e5bfc 6102 def GetWindow(*args, **kwargs):
5ba5649b
RD
6103 """
6104 GetWindow(self) -> Window
6105
6106 Returns the window that this event refers to.
6107 """
5b5c9bc7 6108 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
d55e5bfc 6109
2131d850 6110_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d55e5bfc 6111
5b5c9bc7 6112class WindowDestroyEvent(CommandEvent):
5ba5649b 6113 """
943e8dfd
RD
6114 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6115 when the GUI window is destroyed.
6116
6117 When a class derived from `wx.Window` is destroyed its destructor will
6118 have already run by the time this event is sent. Therefore this event
6119 will not usually be received at all by the window itself. Since it is
6120 received after the destructor has run, an object should not try to
6121 handle its own wx.WindowDestroyEvent, but it can be used to get
6122 notification of the destruction of another window.
5ba5649b 6123 """
1bd55598
RD
6124 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6125 __repr__ = _swig_repr
6126 def __init__(self, *args, **kwargs):
5ba5649b
RD
6127 """
6128 __init__(self, Window win=None) -> WindowDestroyEvent
6129
943e8dfd
RD
6130 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6131 when the GUI window is destroyed.
6132
6133 When a class derived from `wx.Window` is destroyed its destructor will
6134 have already run by the time this event is sent. Therefore this event
6135 will not usually be received at all by the window itself. Since it is
6136 received after the destructor has run, an object should not try to
6137 handle its own wx.WindowDestroyEvent, but it can be used to get
6138 notification of the destruction of another window.
5ba5649b 6139 """
1bd55598 6140 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
d55e5bfc 6141 def GetWindow(*args, **kwargs):
5ba5649b
RD
6142 """
6143 GetWindow(self) -> Window
6144
6145 Returns the window that this event refers to.
6146 """
5b5c9bc7 6147 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
d55e5bfc 6148
2131d850 6149_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d55e5bfc
RD
6150
6151#---------------------------------------------------------------------------
6152
5b5c9bc7 6153class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6154 """
6155 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6156 give the application a chance to show a context (popup) menu.
6157 """
1bd55598
RD
6158 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6159 __repr__ = _swig_repr
6160 def __init__(self, *args, **kwargs):
5ba5649b 6161 """
2131d850 6162 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6163
6164 Constructor.
6165 """
1bd55598 6166 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
d55e5bfc 6167 def GetPosition(*args, **kwargs):
5ba5649b
RD
6168 """
6169 GetPosition(self) -> Point
6170
6171 Returns the position (in screen coordinants) at which the menu should
6172 be shown.
6173 """
5b5c9bc7 6174 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
6175
6176 def SetPosition(*args, **kwargs):
5ba5649b
RD
6177 """
6178 SetPosition(self, Point pos)
6179
6180 Sets the position at which the menu should be shown.
6181 """
5b5c9bc7 6182 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
d55e5bfc 6183
2131d850 6184_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d55e5bfc
RD
6185
6186#---------------------------------------------------------------------------
6187
5b5c9bc7
RD
6188IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6189IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6190class IdleEvent(Event):
5ba5649b
RD
6191 """
6192 This class is used for EVT_IDLE events, which are generated and sent
6193 when the application *becomes* idle. In other words, the when the
6194 event queue becomes empty then idle events are sent to all windows (by
6195 default) and as long as none of them call `RequestMore` then there are
6196 no more idle events until after the system event queue has some normal
6197 events and then becomes empty again.
6198
6199 By default, idle events are sent to all windows. If this is causing a
6200 significant overhead in your application, you can call
6201 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6202 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6203 which should receive idle events. Then idle events will only be sent
6204 to those windows and not to any others.
6205 """
1bd55598
RD
6206 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6207 __repr__ = _swig_repr
6208 def __init__(self, *args, **kwargs):
5ba5649b
RD
6209 """
6210 __init__(self) -> IdleEvent
6211
6212 Constructor
6213 """
1bd55598 6214 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
d55e5bfc 6215 def RequestMore(*args, **kwargs):
5ba5649b
RD
6216 """
6217 RequestMore(self, bool needMore=True)
6218
6219 Tells wxWidgets that more processing is required. This function can be
6220 called by an EVT_IDLE handler for a window to indicate that the
6221 application should forward the EVT_IDLE event once more to the
6222 application windows. If no window calls this function during its
6223 EVT_IDLE handler, then the application will remain in a passive event
6224 loop until a new event is posted to the application by the windowing
6225 system.
6226 """
5b5c9bc7 6227 return _core_.IdleEvent_RequestMore(*args, **kwargs)
d55e5bfc
RD
6228
6229 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6230 """
6231 MoreRequested(self) -> bool
6232
6233 Returns ``True`` if the OnIdle function processing this event
6234 requested more processing time.
6235 """
5b5c9bc7 6236 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
d55e5bfc
RD
6237
6238 def SetMode(*args, **kwargs):
5ba5649b
RD
6239 """
6240 SetMode(int mode)
6241
6242 Static method for specifying how wxWidgets will send idle events: to
6243 all windows, or only to those which specify that they will process the
6244 events.
6245
6246 The mode can be one of the following values:
6247
6248 ========================= ========================================
6249 wx.IDLE_PROCESS_ALL Send idle events to all windows
6250 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6251 the wx.WS_EX_PROCESS_IDLE extra style
6252 flag set.
6253 ========================= ========================================
6254
6255 """
5b5c9bc7 6256 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
6257
6258 SetMode = staticmethod(SetMode)
6259 def GetMode(*args, **kwargs):
5ba5649b
RD
6260 """
6261 GetMode() -> int
6262
6263 Static method returning a value specifying how wxWidgets will send
6264 idle events: to all windows, or only to those which specify that they
6265 will process the events.
6266 """
5b5c9bc7 6267 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6268
6269 GetMode = staticmethod(GetMode)
6270 def CanSend(*args, **kwargs):
5ba5649b
RD
6271 """
6272 CanSend(Window win) -> bool
6273
6274 Returns ``True`` if it is appropriate to send idle events to this
6275 window.
6276
6277 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6278 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6279 events should be sent to this window now. By default this will always
6280 return ``True`` because the update mode is initially
6281 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6282 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6283 """
5b5c9bc7 6284 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6285
6286 CanSend = staticmethod(CanSend)
2131d850 6287_core_.IdleEvent_swigregister(IdleEvent)
d55e5bfc 6288
5b5c9bc7 6289def IdleEvent_SetMode(*args, **kwargs):
1bd55598 6290 """
5ba5649b
RD
6291 IdleEvent_SetMode(int mode)
6292
6293 Static method for specifying how wxWidgets will send idle events: to
6294 all windows, or only to those which specify that they will process the
6295 events.
6296
6297 The mode can be one of the following values:
6298
6299 ========================= ========================================
6300 wx.IDLE_PROCESS_ALL Send idle events to all windows
6301 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6302 the wx.WS_EX_PROCESS_IDLE extra style
6303 flag set.
6304 ========================= ========================================
6305
6306 """
1bd55598 6307 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6308
1bd55598
RD
6309def IdleEvent_GetMode(*args):
6310 """
5ba5649b
RD
6311 IdleEvent_GetMode() -> int
6312
6313 Static method returning a value specifying how wxWidgets will send
6314 idle events: to all windows, or only to those which specify that they
6315 will process the events.
6316 """
1bd55598 6317 return _core_.IdleEvent_GetMode(*args)
d55e5bfc 6318
5b5c9bc7 6319def IdleEvent_CanSend(*args, **kwargs):
1bd55598 6320 """
5ba5649b
RD
6321 IdleEvent_CanSend(Window win) -> bool
6322
6323 Returns ``True`` if it is appropriate to send idle events to this
6324 window.
6325
6326 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6327 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6328 events should be sent to this window now. By default this will always
6329 return ``True`` because the update mode is initially
6330 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6331 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6332 """
1bd55598 6333 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6334
6335#---------------------------------------------------------------------------
6336
2131d850
RD
6337class ClipboardTextEvent(CommandEvent):
6338 """
6339 A Clipboard Text event is sent when a window intercepts a text
6340 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6341 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6342 popup menu command, etc. NOTE : under windows these events are *NOT*
6343 generated automatically for a Rich Edit text control.
6344 """
6345 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6346 __repr__ = _swig_repr
6347 def __init__(self, *args, **kwargs):
6348 """
6349 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6350
6351 A Clipboard Text event is sent when a window intercepts a text
6352 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6353 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6354 popup menu command, etc. NOTE : under windows these events are *NOT*
6355 generated automatically for a Rich Edit text control.
6356 """
6357 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6358_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6359
6360#---------------------------------------------------------------------------
6361
5b5c9bc7 6362class PyEvent(Event):
5ba5649b
RD
6363 """
6364 wx.PyEvent can be used as a base class for implementing custom event
6365 types in Python. You should derived from this class instead of
6366 `wx.Event` because this class is Python-aware and is able to transport
6367 its Python bits safely through the wxWidgets event system and have
6368 them still be there when the event handler is invoked.
6369
6370 :see: `wx.PyCommandEvent`
6371
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, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
1bd55598 6377 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6378 self._SetSelf(self)
d55e5bfc 6379
1bd55598
RD
6380 __swig_destroy__ = _core_.delete_PyEvent
6381 __del__ = lambda self : None;
5ba5649b
RD
6382 def _SetSelf(*args, **kwargs):
6383 """_SetSelf(self, PyObject self)"""
6384 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6385
5ba5649b
RD
6386 def _GetSelf(*args, **kwargs):
6387 """_GetSelf(self) -> PyObject"""
6388 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc 6389
2131d850 6390_core_.PyEvent_swigregister(PyEvent)
d55e5bfc 6391
5b5c9bc7 6392class PyCommandEvent(CommandEvent):
5ba5649b
RD
6393 """
6394 wx.PyCommandEvent can be used as a base class for implementing custom
6395 event types in Python, where the event shoudl travel up to parent
6396 windows looking for a handler. You should derived from this class
6397 instead of `wx.CommandEvent` because this class is Python-aware and is
6398 able to transport its Python bits safely through the wxWidgets event
6399 system and have them still be there when the event handler is invoked.
6400
6401 :see: `wx.PyEvent`
6402
6403 """
1bd55598
RD
6404 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6405 __repr__ = _swig_repr
6406 def __init__(self, *args, **kwargs):
2131d850 6407 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
1bd55598 6408 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6409 self._SetSelf(self)
d55e5bfc 6410
1bd55598
RD
6411 __swig_destroy__ = _core_.delete_PyCommandEvent
6412 __del__ = lambda self : None;
5ba5649b
RD
6413 def _SetSelf(*args, **kwargs):
6414 """_SetSelf(self, PyObject self)"""
6415 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6416
5ba5649b
RD
6417 def _GetSelf(*args, **kwargs):
6418 """_GetSelf(self) -> PyObject"""
6419 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc 6420
2131d850 6421_core_.PyCommandEvent_swigregister(PyCommandEvent)
d55e5bfc 6422
5b5c9bc7 6423class DateEvent(CommandEvent):
5ba5649b
RD
6424 """
6425 This event class holds information about a date change event and is
6426 used together with `wx.DatePickerCtrl`. It also serves as a base class
6427 for `wx.calendar.CalendarEvent`. Bind these event types with
6428 EVT_DATE_CHANGED.
6429 """
1bd55598
RD
6430 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6431 __repr__ = _swig_repr
6432 def __init__(self, *args, **kwargs):
2131d850 6433 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
1bd55598 6434 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6435 def GetDate(*args, **kwargs):
5ba5649b
RD
6436 """
6437 GetDate(self) -> DateTime
6438
6439 Returns the date.
6440 """
5b5c9bc7 6441 return _core_.DateEvent_GetDate(*args, **kwargs)
53aa7709
RD
6442
6443 def SetDate(*args, **kwargs):
5ba5649b
RD
6444 """
6445 SetDate(self, DateTime date)
6446
6447 Sets the date carried by the event, normally only used by the library
6448 internally.
6449 """
5b5c9bc7 6450 return _core_.DateEvent_SetDate(*args, **kwargs)
53aa7709 6451
2131d850 6452_core_.DateEvent_swigregister(DateEvent)
53aa7709 6453
5b5c9bc7 6454wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
53aa7709
RD
6455EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6456
d55e5bfc
RD
6457#---------------------------------------------------------------------------
6458
5b5c9bc7
RD
6459PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6460PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6461PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6462PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6463PRINT_WINDOWS = _core_.PRINT_WINDOWS
6464PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6465class PyApp(EvtHandler):
d6c14a4c
RD
6466 """
6467 The ``wx.PyApp`` class is an *implementation detail*, please use the
6468 `wx.App` class (or some other derived class) instead.
6469 """
1bd55598
RD
6470 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6471 __repr__ = _swig_repr
6472 def __init__(self, *args, **kwargs):
d55e5bfc 6473 """
5b5c9bc7 6474 __init__(self) -> PyApp
d55e5bfc
RD
6475
6476 Create a new application object, starting the bootstrap process.
6477 """
1bd55598 6478 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
7993762b
RD
6479 self._setCallbackInfo(self, PyApp, False)
6480 self._setOORInfo(self, False)
d55e5bfc 6481
1bd55598
RD
6482 __swig_destroy__ = _core_.delete_PyApp
6483 __del__ = lambda self : None;
d55e5bfc 6484 def _setCallbackInfo(*args, **kwargs):
7993762b 6485 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
5b5c9bc7 6486 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
6487
6488 def GetAppName(*args, **kwargs):
6489 """
5b5c9bc7 6490 GetAppName(self) -> String
d55e5bfc
RD
6491
6492 Get the application name.
6493 """
5b5c9bc7 6494 return _core_.PyApp_GetAppName(*args, **kwargs)
d55e5bfc
RD
6495
6496 def SetAppName(*args, **kwargs):
6497 """
5b5c9bc7 6498 SetAppName(self, String name)
d55e5bfc 6499
d6c14a4c
RD
6500 Set the application name. This value may be used automatically by
6501 `wx.Config` and such.
d55e5bfc 6502 """
5b5c9bc7 6503 return _core_.PyApp_SetAppName(*args, **kwargs)
d55e5bfc
RD
6504
6505 def GetClassName(*args, **kwargs):
6506 """
5b5c9bc7 6507 GetClassName(self) -> String
d55e5bfc
RD
6508
6509 Get the application's class name.
6510 """
5b5c9bc7 6511 return _core_.PyApp_GetClassName(*args, **kwargs)
d55e5bfc
RD
6512
6513 def SetClassName(*args, **kwargs):
6514 """
5b5c9bc7 6515 SetClassName(self, String name)
d55e5bfc 6516
d6c14a4c
RD
6517 Set the application's class name. This value may be used for
6518 X-resources if applicable for the platform
d55e5bfc 6519 """
5b5c9bc7 6520 return _core_.PyApp_SetClassName(*args, **kwargs)
d55e5bfc
RD
6521
6522 def GetVendorName(*args, **kwargs):
6523 """
5b5c9bc7 6524 GetVendorName(self) -> String
d55e5bfc
RD
6525
6526 Get the application's vendor name.
6527 """
5b5c9bc7 6528 return _core_.PyApp_GetVendorName(*args, **kwargs)
d55e5bfc
RD
6529
6530 def SetVendorName(*args, **kwargs):
6531 """
5b5c9bc7 6532 SetVendorName(self, String name)
d55e5bfc 6533
d6c14a4c
RD
6534 Set the application's vendor name. This value may be used
6535 automatically by `wx.Config` and such.
d55e5bfc 6536 """
5b5c9bc7 6537 return _core_.PyApp_SetVendorName(*args, **kwargs)
d55e5bfc
RD
6538
6539 def GetTraits(*args, **kwargs):
6540 """
6541 GetTraits(self) -> wxAppTraits
6542
d6c14a4c
RD
6543 Return (and create if necessary) the app traits object to which we
6544 delegate for everything which either should be configurable by the
6545 user (then he can change the default behaviour simply by overriding
6546 CreateTraits() and returning his own traits object) or which is
6547 GUI/console dependent as then wx.AppTraits allows us to abstract the
6548 differences behind the common facade.
6549
6550 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc 6551 """
5b5c9bc7 6552 return _core_.PyApp_GetTraits(*args, **kwargs)
d55e5bfc
RD
6553
6554 def ProcessPendingEvents(*args, **kwargs):
6555 """
6556 ProcessPendingEvents(self)
6557
d6c14a4c
RD
6558 Process all events in the Pending Events list -- it is necessary to
6559 call this function to process posted events. This normally happens
6560 during each event loop iteration.
d55e5bfc 6561 """
5b5c9bc7 6562 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
6563
6564 def Yield(*args, **kwargs):
6565 """
6566 Yield(self, bool onlyIfNeeded=False) -> bool
6567
d6c14a4c
RD
6568 Process all currently pending events right now, instead of waiting
6569 until return to the event loop. It is an error to call ``Yield``
6570 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 6571
d6c14a4c 6572 :warning: This function is dangerous as it can lead to unexpected
15817c7e
RD
6573 reentrancies (i.e. when called from an event handler it may
6574 result in calling the same event handler again), use with
6575 extreme care or, better, don't use at all!
d55e5bfc 6576
d6c14a4c 6577 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
15817c7e 6578
d55e5bfc 6579 """
5b5c9bc7 6580 return _core_.PyApp_Yield(*args, **kwargs)
d55e5bfc
RD
6581
6582 def WakeUpIdle(*args, **kwargs):
6583 """
6584 WakeUpIdle(self)
6585
d6c14a4c
RD
6586 Make sure that idle events are sent again.
6587 :see: `wx.WakeUpIdle`
d55e5bfc 6588 """
5b5c9bc7 6589 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
d55e5bfc 6590
84f85550
RD
6591 def IsMainLoopRunning(*args, **kwargs):
6592 """
6593 IsMainLoopRunning() -> bool
6594
6595 Returns True if we're running the main loop, i.e. if the events can
6596 currently be dispatched.
6597 """
5b5c9bc7 6598 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550
RD
6599
6600 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
6601 def MainLoop(*args, **kwargs):
6602 """
6603 MainLoop(self) -> int
6604
d6c14a4c
RD
6605 Execute the main GUI loop, the function doesn't normally return until
6606 all top level windows have been closed and destroyed.
d55e5bfc 6607 """
5b5c9bc7 6608 return _core_.PyApp_MainLoop(*args, **kwargs)
d55e5bfc
RD
6609
6610 def Exit(*args, **kwargs):
6611 """
6612 Exit(self)
6613
6614 Exit the main loop thus terminating the application.
d6c14a4c 6615 :see: `wx.Exit`
d55e5bfc 6616 """
5b5c9bc7 6617 return _core_.PyApp_Exit(*args, **kwargs)
d55e5bfc
RD
6618
6619 def ExitMainLoop(*args, **kwargs):
6620 """
6621 ExitMainLoop(self)
6622
d6c14a4c
RD
6623 Exit the main GUI loop during the next iteration of the main
6624 loop, (i.e. it does not stop the program immediately!)
d55e5bfc 6625 """
5b5c9bc7 6626 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
d55e5bfc
RD
6627
6628 def Pending(*args, **kwargs):
6629 """
6630 Pending(self) -> bool
6631
6632 Returns True if there are unprocessed events in the event queue.
6633 """
5b5c9bc7 6634 return _core_.PyApp_Pending(*args, **kwargs)
d55e5bfc
RD
6635
6636 def Dispatch(*args, **kwargs):
6637 """
6638 Dispatch(self) -> bool
6639
6640 Process the first event in the event queue (blocks until an event
6641 appears if there are none currently)
6642 """
5b5c9bc7 6643 return _core_.PyApp_Dispatch(*args, **kwargs)
d55e5bfc
RD
6644
6645 def ProcessIdle(*args, **kwargs):
6646 """
6647 ProcessIdle(self) -> bool
6648
d6c14a4c
RD
6649 Called from the MainLoop when the application becomes idle (there are
6650 no pending events) and sends a `wx.IdleEvent` to all interested
6651 parties. Returns True if more idle events are needed, False if not.
d55e5bfc 6652 """
5b5c9bc7 6653 return _core_.PyApp_ProcessIdle(*args, **kwargs)
d55e5bfc
RD
6654
6655 def SendIdleEvents(*args, **kwargs):
6656 """
5b5c9bc7 6657 SendIdleEvents(self, Window win, IdleEvent event) -> bool
d55e5bfc 6658
d6c14a4c
RD
6659 Send idle event to window and all subwindows. Returns True if more
6660 idle time is requested.
d55e5bfc 6661 """
5b5c9bc7 6662 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
d55e5bfc
RD
6663
6664 def IsActive(*args, **kwargs):
6665 """
6666 IsActive(self) -> bool
6667
6668 Return True if our app has focus.
6669 """
5b5c9bc7 6670 return _core_.PyApp_IsActive(*args, **kwargs)
d55e5bfc
RD
6671
6672 def SetTopWindow(*args, **kwargs):
6673 """
5b5c9bc7 6674 SetTopWindow(self, Window win)
d55e5bfc 6675
d6c14a4c 6676 Set the *main* top level window
d55e5bfc 6677 """
5b5c9bc7 6678 return _core_.PyApp_SetTopWindow(*args, **kwargs)
d55e5bfc
RD
6679
6680 def GetTopWindow(*args, **kwargs):
6681 """
5b5c9bc7 6682 GetTopWindow(self) -> Window
d55e5bfc 6683
d6c14a4c
RD
6684 Return the *main* top level window (if it hadn't been set previously
6685 with SetTopWindow(), will return just some top level window and, if
6686 there not any, will return None)
d55e5bfc 6687 """
5b5c9bc7 6688 return _core_.PyApp_GetTopWindow(*args, **kwargs)
d55e5bfc
RD
6689
6690 def SetExitOnFrameDelete(*args, **kwargs):
6691 """
6692 SetExitOnFrameDelete(self, bool flag)
6693
d6c14a4c
RD
6694 Control the exit behaviour: by default, the program will exit the main
6695 loop (and so, usually, terminate) when the last top-level program
6696 window is deleted. Beware that if you disable this behaviour (with
6697 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6698 explicitly from somewhere.
d55e5bfc 6699 """
5b5c9bc7 6700 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6701
6702 def GetExitOnFrameDelete(*args, **kwargs):
6703 """
6704 GetExitOnFrameDelete(self) -> bool
6705
6706 Get the current exit behaviour setting.
6707 """
5b5c9bc7 6708 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6709
6710 def SetUseBestVisual(*args, **kwargs):
6711 """
6712 SetUseBestVisual(self, bool flag)
6713
d6c14a4c
RD
6714 Set whether the app should try to use the best available visual on
6715 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc 6716 """
5b5c9bc7 6717 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
6718
6719 def GetUseBestVisual(*args, **kwargs):
6720 """
6721 GetUseBestVisual(self) -> bool
6722
6723 Get current UseBestVisual setting.
6724 """
5b5c9bc7 6725 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
6726
6727 def SetPrintMode(*args, **kwargs):
6728 """SetPrintMode(self, int mode)"""
5b5c9bc7 6729 return _core_.PyApp_SetPrintMode(*args, **kwargs)
d55e5bfc
RD
6730
6731 def GetPrintMode(*args, **kwargs):
6732 """GetPrintMode(self) -> int"""
5b5c9bc7 6733 return _core_.PyApp_GetPrintMode(*args, **kwargs)
d55e5bfc
RD
6734
6735 def SetAssertMode(*args, **kwargs):
6736 """
6737 SetAssertMode(self, int mode)
6738
15817c7e 6739 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc 6740 """
5b5c9bc7 6741 return _core_.PyApp_SetAssertMode(*args, **kwargs)
d55e5bfc
RD
6742
6743 def GetAssertMode(*args, **kwargs):
6744 """
6745 GetAssertMode(self) -> int
6746
6747 Get the current OnAssert behaviour setting.
6748 """
5b5c9bc7 6749 return _core_.PyApp_GetAssertMode(*args, **kwargs)
d55e5bfc
RD
6750
6751 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 6752 """GetMacSupportPCMenuShortcuts() -> bool"""
5b5c9bc7 6753 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
6754
6755 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6756 def GetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 6757 """GetMacAboutMenuItemId() -> long"""
5b5c9bc7 6758 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
6759
6760 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6761 def GetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 6762 """GetMacPreferencesMenuItemId() -> long"""
5b5c9bc7 6763 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
6764
6765 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6766 def GetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 6767 """GetMacExitMenuItemId() -> long"""
5b5c9bc7 6768 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
6769
6770 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6771 def GetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
6772 """GetMacHelpMenuTitleName() -> String"""
6773 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
6774
6775 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6776 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 6777 """SetMacSupportPCMenuShortcuts(bool val)"""
5b5c9bc7 6778 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
6779
6780 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6781 def SetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 6782 """SetMacAboutMenuItemId(long val)"""
5b5c9bc7 6783 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
6784
6785 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6786 def SetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 6787 """SetMacPreferencesMenuItemId(long val)"""
5b5c9bc7 6788 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
6789
6790 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6791 def SetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 6792 """SetMacExitMenuItemId(long val)"""
5b5c9bc7 6793 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
6794
6795 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6796 def SetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
6797 """SetMacHelpMenuTitleName(String val)"""
6798 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
6799
6800 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6801 def _BootstrapApp(*args, **kwargs):
6802 """
6803 _BootstrapApp(self)
6804
6805 For internal use only
6806 """
5b5c9bc7 6807 return _core_.PyApp__BootstrapApp(*args, **kwargs)
d55e5bfc
RD
6808
6809 def GetComCtl32Version(*args, **kwargs):
6810 """
d6c14a4c 6811 GetComCtl32Version() -> int
d55e5bfc 6812
d6c14a4c
RD
6813 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6814 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 6815 """
5b5c9bc7 6816 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
6817
6818 GetComCtl32Version = staticmethod(GetComCtl32Version)
2131d850 6819_core_.PyApp_swigregister(PyApp)
d55e5bfc 6820
1bd55598
RD
6821def PyApp_IsMainLoopRunning(*args):
6822 """
5b5c9bc7 6823 PyApp_IsMainLoopRunning() -> bool
84f85550
RD
6824
6825 Returns True if we're running the main loop, i.e. if the events can
6826 currently be dispatched.
6827 """
1bd55598 6828 return _core_.PyApp_IsMainLoopRunning(*args)
84f85550 6829
1bd55598
RD
6830def PyApp_GetMacSupportPCMenuShortcuts(*args):
6831 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6832 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d55e5bfc 6833
1bd55598
RD
6834def PyApp_GetMacAboutMenuItemId(*args):
6835 """PyApp_GetMacAboutMenuItemId() -> long"""
6836 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d55e5bfc 6837
1bd55598
RD
6838def PyApp_GetMacPreferencesMenuItemId(*args):
6839 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6840 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d55e5bfc 6841
1bd55598
RD
6842def PyApp_GetMacExitMenuItemId(*args):
6843 """PyApp_GetMacExitMenuItemId() -> long"""
6844 return _core_.PyApp_GetMacExitMenuItemId(*args)
d55e5bfc 6845
1bd55598
RD
6846def PyApp_GetMacHelpMenuTitleName(*args):
6847 """PyApp_GetMacHelpMenuTitleName() -> String"""
6848 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d55e5bfc 6849
5b5c9bc7 6850def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
1bd55598
RD
6851 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6852 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 6853
5b5c9bc7 6854def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
1bd55598
RD
6855 """PyApp_SetMacAboutMenuItemId(long val)"""
6856 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 6857
5b5c9bc7 6858def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
1bd55598
RD
6859 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6860 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 6861
5b5c9bc7 6862def PyApp_SetMacExitMenuItemId(*args, **kwargs):
1bd55598
RD
6863 """PyApp_SetMacExitMenuItemId(long val)"""
6864 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 6865
5b5c9bc7 6866def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
1bd55598
RD
6867 """PyApp_SetMacHelpMenuTitleName(String val)"""
6868 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 6869
1bd55598
RD
6870def PyApp_GetComCtl32Version(*args):
6871 """
5b5c9bc7 6872 PyApp_GetComCtl32Version() -> int
d55e5bfc 6873
d6c14a4c
RD
6874 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6875 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 6876 """
1bd55598 6877 return _core_.PyApp_GetComCtl32Version(*args)
d55e5bfc
RD
6878
6879#---------------------------------------------------------------------------
6880
6881
1bd55598
RD
6882def Exit(*args):
6883 """
5b5c9bc7 6884 Exit()
d55e5bfc
RD
6885
6886 Force an exit of the application. Convenience for wx.GetApp().Exit()
6887 """
1bd55598 6888 return _core_.Exit(*args)
d55e5bfc 6889
1bd55598
RD
6890def Yield(*args):
6891 """
5b5c9bc7 6892 Yield() -> bool
d55e5bfc
RD
6893
6894 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6895 """
1bd55598 6896 return _core_.Yield(*args)
d55e5bfc 6897
1bd55598
RD
6898def YieldIfNeeded(*args):
6899 """
5b5c9bc7 6900 YieldIfNeeded() -> bool
d55e5bfc
RD
6901
6902 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6903 """
1bd55598 6904 return _core_.YieldIfNeeded(*args)
d55e5bfc 6905
5b5c9bc7 6906def SafeYield(*args, **kwargs):
1bd55598 6907 """
5b5c9bc7 6908 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
d55e5bfc 6909
d6c14a4c
RD
6910 This function is similar to `wx.Yield`, except that it disables the
6911 user input to all program windows before calling `wx.Yield` and
6912 re-enables it again afterwards. If ``win`` is not None, this window
6913 will remain enabled, allowing the implementation of some limited user
6914 interaction.
d55e5bfc 6915
d6c14a4c 6916 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 6917 """
1bd55598 6918 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 6919
1bd55598
RD
6920def WakeUpIdle(*args):
6921 """
5b5c9bc7 6922 WakeUpIdle()
d55e5bfc 6923
d6c14a4c
RD
6924 Cause the message queue to become empty again, so idle events will be
6925 sent.
d55e5bfc 6926 """
1bd55598 6927 return _core_.WakeUpIdle(*args)
d55e5bfc 6928
5b5c9bc7 6929def PostEvent(*args, **kwargs):
1bd55598 6930 """
5b5c9bc7 6931 PostEvent(EvtHandler dest, Event event)
d55e5bfc 6932
d6c14a4c
RD
6933 Send an event to a window or other wx.EvtHandler to be processed
6934 later.
d55e5bfc 6935 """
1bd55598 6936 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 6937
1bd55598
RD
6938def App_CleanUp(*args):
6939 """
5b5c9bc7 6940 App_CleanUp()
d55e5bfc 6941
15817c7e 6942 For internal use only, it is used to cleanup after wxWidgets when
d6c14a4c 6943 Python shuts down.
d55e5bfc 6944 """
1bd55598 6945 return _core_.App_CleanUp(*args)
d55e5bfc 6946
1bd55598
RD
6947def GetApp(*args):
6948 """
5b5c9bc7 6949 GetApp() -> PyApp
d55e5bfc
RD
6950
6951 Return a reference to the current wx.App object.
6952 """
1bd55598 6953 return _core_.GetApp(*args)
5cbf236d 6954
5b5c9bc7 6955def SetDefaultPyEncoding(*args, **kwargs):
1bd55598 6956 """
5cbf236d
RD
6957 SetDefaultPyEncoding(string encoding)
6958
6959 Sets the encoding that wxPython will use when it needs to convert a
6960 Python string or unicode object to or from a wxString.
62d32a5f
RD
6961
6962 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6963 but please be aware that the default encoding within the same locale
6964 may be slightly different on different platforms. For example, please
6965 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6966 between the common latin/roman encodings.
5cbf236d 6967 """
1bd55598 6968 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 6969
1bd55598
RD
6970def GetDefaultPyEncoding(*args):
6971 """
5cbf236d
RD
6972 GetDefaultPyEncoding() -> string
6973
6974 Gets the current encoding that wxPython will use when it needs to
6975 convert a Python string or unicode object to or from a wxString.
6976 """
1bd55598 6977 return _core_.GetDefaultPyEncoding(*args)
d55e5bfc
RD
6978#----------------------------------------------------------------------
6979
6980class PyOnDemandOutputWindow:
6981 """
6982 A class that can be used for redirecting Python's stdout and
6983 stderr streams. It will do nothing until something is wrriten to
6984 the stream at which point it will create a Frame with a text area
6985 and write the text there.
6986 """
6987 def __init__(self, title = "wxPython: stdout/stderr"):
6988 self.frame = None
6989 self.title = title
412d302d
RD
6990 self.pos = wx.DefaultPosition
6991 self.size = (450, 300)
d55e5bfc
RD
6992 self.parent = None
6993
6994 def SetParent(self, parent):
6995 """Set the window to be used as the popup Frame's parent."""
6996 self.parent = parent
6997
6998
6999 def CreateOutputWindow(self, st):
412d302d
RD
7000 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7001 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 7002 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7003 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 7004 self.text.AppendText(st)
d55e5bfc 7005 self.frame.Show(True)
2131d850 7006 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
d55e5bfc
RD
7007
7008
7009 def OnCloseWindow(self, event):
7010 if self.frame is not None:
7011 self.frame.Destroy()
7012 self.frame = None
7013 self.text = None
7014
7015
7016 # These methods provide the file-like output behaviour.
7017 def write(self, text):
7018 """
7019 Create the output window if needed and write the string to it.
7020 If not called in the context of the gui thread then uses
7021 CallAfter to do the work there.
7022 """
7023 if self.frame is None:
7024 if not wx.Thread_IsMain():
7025 wx.CallAfter(self.CreateOutputWindow, text)
7026 else:
7027 self.CreateOutputWindow(text)
7028 else:
7029 if not wx.Thread_IsMain():
7030 wx.CallAfter(self.text.AppendText, text)
7031 else:
7032 self.text.AppendText(text)
7033
7034
7035 def close(self):
7036 if self.frame is not None:
7037 wx.CallAfter(self.frame.Close)
7038
7039
bb4524c4
RD
7040 def flush(self):
7041 pass
7042
7043
d55e5bfc
RD
7044
7045#----------------------------------------------------------------------
7046
7047_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7048
7049class App(wx.PyApp):
7050 """
d6c14a4c
RD
7051 The ``wx.App`` class represents the application and is used to:
7052
7053 * bootstrap the wxPython system and initialize the underlying
7054 gui toolkit
7055 * set and get application-wide properties
7056 * implement the windowing system main message or event loop,
7057 and to dispatch events to window instances
7058 * etc.
7059
7060 Every application must have a ``wx.App`` instance, and all
7061 creation of UI objects should be delayed until after the
7062 ``wx.App`` object has been created in order to ensure that the gui
7063 platform and wxWidgets have been fully initialized.
7064
7065 Normally you would derive from this class and implement an
7066 ``OnInit`` method that creates a frame and then calls
7067 ``self.SetTopWindow(frame)``.
7068
7069 :see: `wx.PySimpleApp` for a simpler app class that can be used
15817c7e 7070 directly.
d55e5bfc 7071 """
d6c14a4c 7072
d55e5bfc
RD
7073 outputWindowClass = PyOnDemandOutputWindow
7074
d6c14a4c
RD
7075 def __init__(self, redirect=_defRedirect, filename=None,
7076 useBestVisual=False, clearSigInt=True):
7077 """
7078 Construct a ``wx.App`` object.
7079
7080 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7081 redirected? Defaults to True on Windows and Mac, False
7082 otherwise. If `filename` is None then output will be
7083 redirected to a window that pops up as needed. (You can
7084 control what kind of window is created for the output by
7085 resetting the class variable ``outputWindowClass`` to a
7086 class of your choosing.)
7087
7088 :param filename: The name of a file to redirect output to, if
7089 redirect is True.
7090
7091 :param useBestVisual: Should the app try to use the best
7092 available visual provided by the system (only relevant on
7093 systems that have more than one visual.) This parameter
7094 must be used instead of calling `SetUseBestVisual` later
7095 on because it must be set before the underlying GUI
7096 toolkit is initialized.
7097
7098 :param clearSigInt: Should SIGINT be cleared? This allows the
7099 app to terminate upon a Ctrl-C in the console like other
7100 GUI apps will.
7101
7102 :note: You should override OnInit to do applicaition
7103 initialization to ensure that the system, toolkit and
7104 wxWidgets are fully initialized.
7105 """
d55e5bfc
RD
7106 wx.PyApp.__init__(self)
7107
7108 if wx.Platform == "__WXMAC__":
7109 try:
7110 import MacOS
7111 if not MacOS.WMAvailable():
7112 print """\
7113This program needs access to the screen. Please run with 'pythonw',
7114not 'python', and only when you are logged in on the main display of
7115your Mac."""
7116 _sys.exit(1)
0346c964
RD
7117 except SystemExit:
7118 raise
d55e5bfc
RD
7119 except:
7120 pass
7121
7122 # This has to be done before OnInit
7123 self.SetUseBestVisual(useBestVisual)
7124
7125 # Set the default handler for SIGINT. This fixes a problem
7126 # where if Ctrl-C is pressed in the console that started this
7127 # app then it will not appear to do anything, (not even send
7128 # KeyboardInterrupt???) but will later segfault on exit. By
7129 # setting the default handler then the app will exit, as
7130 # expected (depending on platform.)
d6c14a4c
RD
7131 if clearSigInt:
7132 try:
7133 import signal
7134 signal.signal(signal.SIGINT, signal.SIG_DFL)
7135 except:
7136 pass
d55e5bfc
RD
7137
7138 # Save and redirect the stdio to a window?
7139 self.stdioWin = None
7140 self.saveStdio = (_sys.stdout, _sys.stderr)
7141 if redirect:
7142 self.RedirectStdio(filename)
7143
8fb0e70a
RD
7144 # Use Python's install prefix as the default
7145 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7146
d55e5bfc
RD
7147 # This finishes the initialization of wxWindows and then calls
7148 # the OnInit that should be present in the derived class
7149 self._BootstrapApp()
7150
7151
2131d850
RD
7152 def OnPreInit(self):
7153 """
7154 Things that must be done after _BootstrapApp has done its
7155 thing, but would be nice if they were already done by the time
7156 that OnInit is called.
7157 """
7158 wx.StockGDI._initStockObjects()
7159
7160
66af7a75
RD
7161 def __del__(self, destroy=wx.PyApp.__del__):
7162 self.RestoreStdio() # Just in case the MainLoop was overridden
7163 destroy(self)
d55e5bfc 7164
7993762b
RD
7165 def Destroy(self):
7166 wx.PyApp.Destroy(self)
7167 self.thisown = 0
d55e5bfc
RD
7168
7169 def SetTopWindow(self, frame):
7170 """Set the \"main\" top level window"""
7171 if self.stdioWin:
7172 self.stdioWin.SetParent(frame)
7173 wx.PyApp.SetTopWindow(self, frame)
7174
7175
7176 def MainLoop(self):
7177 """Execute the main GUI event loop"""
7178 wx.PyApp.MainLoop(self)
7179 self.RestoreStdio()
7180
7181
7182 def RedirectStdio(self, filename=None):
7183 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7184 if filename:
7185 _sys.stdout = _sys.stderr = open(filename, 'a')
7186 else:
7187 self.stdioWin = self.outputWindowClass()
7188 _sys.stdout = _sys.stderr = self.stdioWin
7189
7190
7191 def RestoreStdio(self):
66af7a75
RD
7192 try:
7193 _sys.stdout, _sys.stderr = self.saveStdio
7194 except:
7195 pass
d55e5bfc
RD
7196
7197
412d302d
RD
7198 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7199 """
7200 Set the title, position and/or size of the output window if
f5b96ee1
RD
7201 the stdio has been redirected. This should be called before
7202 any output would cause the output window to be created.
412d302d
RD
7203 """
7204 if self.stdioWin:
7205 if title is not None:
7206 self.stdioWin.title = title
7207 if pos is not None:
7208 self.stdioWin.pos = pos
7209 if size is not None:
7210 self.stdioWin.size = size
7211
7212
7213
d55e5bfc 7214
d6c14a4c 7215# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7216App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7217App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7218App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7219App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7220App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7221App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7222App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7223App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7224App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7225App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7226App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7227
7228#----------------------------------------------------------------------------
7229
7230class PySimpleApp(wx.App):
7231 """
7232 A simple application class. You can just create one of these and
7233 then then make your top level windows later, and not have to worry
d6c14a4c 7234 about OnInit. For example::
d55e5bfc 7235
d6c14a4c
RD
7236 app = wx.PySimpleApp()
7237 frame = wx.Frame(None, title='Hello World')
7238 frame.Show()
7239 app.MainLoop()
7240
7241 :see: `wx.App`
7242 """
7243
7244 def __init__(self, redirect=False, filename=None,
7245 useBestVisual=False, clearSigInt=True):
7246 """
7247 :see: `wx.App.__init__`
7248 """
7249 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7250
7251 def OnInit(self):
d55e5bfc
RD
7252 return True
7253
7254
d6c14a4c 7255
d55e5bfc
RD
7256# Is anybody using this one?
7257class PyWidgetTester(wx.App):
7258 def __init__(self, size = (250, 100)):
7259 self.size = size
7260 wx.App.__init__(self, 0)
7261
7262 def OnInit(self):
7263 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7264 self.SetTopWindow(self.frame)
7265 return True
7266
d6c14a4c
RD
7267 def SetWidget(self, widgetClass, *args, **kwargs):
7268 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7269 self.frame.Show(True)
7270
7271#----------------------------------------------------------------------------
7272# DO NOT hold any other references to this object. This is how we
d6c14a4c 7273# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7274# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
d6c14a4c 7275# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7276
7277class __wxPyCleanup:
7278 def __init__(self):
7279 self.cleanup = _core_.App_CleanUp
7280 def __del__(self):
7281 self.cleanup()
7282
7283_sys.__wxPythonCleanup = __wxPyCleanup()
7284
7285## # another possible solution, but it gets called too early...
d6c14a4c
RD
7286## import atexit
7287## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7288
7289
7290#----------------------------------------------------------------------------
7291
7292#---------------------------------------------------------------------------
7293
5b5c9bc7
RD
7294class EventLoop(object):
7295 """Proxy of C++ EventLoop class"""
1bd55598
RD
7296 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7297 __repr__ = _swig_repr
7298 def __init__(self, *args, **kwargs):
5b5c9bc7 7299 """__init__(self) -> EventLoop"""
1bd55598
RD
7300 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7301 __swig_destroy__ = _core_.delete_EventLoop
7302 __del__ = lambda self : None;
b411df4a
RD
7303 def Run(*args, **kwargs):
7304 """Run(self) -> int"""
5b5c9bc7 7305 return _core_.EventLoop_Run(*args, **kwargs)
b411df4a
RD
7306
7307 def Exit(*args, **kwargs):
7308 """Exit(self, int rc=0)"""
5b5c9bc7 7309 return _core_.EventLoop_Exit(*args, **kwargs)
b411df4a
RD
7310
7311 def Pending(*args, **kwargs):
7312 """Pending(self) -> bool"""
5b5c9bc7 7313 return _core_.EventLoop_Pending(*args, **kwargs)
b411df4a
RD
7314
7315 def Dispatch(*args, **kwargs):
7316 """Dispatch(self) -> bool"""
5b5c9bc7 7317 return _core_.EventLoop_Dispatch(*args, **kwargs)
b411df4a
RD
7318
7319 def IsRunning(*args, **kwargs):
7320 """IsRunning(self) -> bool"""
5b5c9bc7 7321 return _core_.EventLoop_IsRunning(*args, **kwargs)
b411df4a
RD
7322
7323 def GetActive(*args, **kwargs):
5b5c9bc7
RD
7324 """GetActive() -> EventLoop"""
7325 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a
RD
7326
7327 GetActive = staticmethod(GetActive)
7328 def SetActive(*args, **kwargs):
5b5c9bc7
RD
7329 """SetActive(EventLoop loop)"""
7330 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a
RD
7331
7332 SetActive = staticmethod(SetActive)
2131d850 7333_core_.EventLoop_swigregister(EventLoop)
b411df4a 7334
1bd55598
RD
7335def EventLoop_GetActive(*args):
7336 """EventLoop_GetActive() -> EventLoop"""
7337 return _core_.EventLoop_GetActive(*args)
b411df4a 7338
5b5c9bc7 7339def EventLoop_SetActive(*args, **kwargs):
1bd55598
RD
7340 """EventLoop_SetActive(EventLoop loop)"""
7341 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a 7342
32fe5131
RD
7343class EventLoopActivator(object):
7344 """Proxy of C++ EventLoopActivator class"""
1bd55598
RD
7345 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7346 __repr__ = _swig_repr
7347 def __init__(self, *args, **kwargs):
32fe5131 7348 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
1bd55598
RD
7349 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7350 __swig_destroy__ = _core_.delete_EventLoopActivator
7351 __del__ = lambda self : None;
2131d850 7352_core_.EventLoopActivator_swigregister(EventLoopActivator)
32fe5131 7353
b411df4a
RD
7354#---------------------------------------------------------------------------
7355
5b5c9bc7 7356class AcceleratorEntry(object):
d6c14a4c
RD
7357 """
7358 A class used to define items in an `wx.AcceleratorTable`. wxPython
7359 programs can choose to use wx.AcceleratorEntry objects, but using a
7360 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
15817c7e 7361 as well. See `__init__` for of the tuple values.
d6c14a4c
RD
7362
7363 :see: `wx.AcceleratorTable`
7364 """
1bd55598
RD
7365 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7366 __repr__ = _swig_repr
7367 def __init__(self, *args, **kwargs):
d6c14a4c 7368 """
5b5c9bc7 7369 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
d6c14a4c
RD
7370
7371 Construct a wx.AcceleratorEntry.
d6c14a4c 7372 """
1bd55598
RD
7373 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7374 __swig_destroy__ = _core_.delete_AcceleratorEntry
7375 __del__ = lambda self : None;
d55e5bfc 7376 def Set(*args, **kwargs):
d6c14a4c
RD
7377 """
7378 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 7379
d6c14a4c
RD
7380 (Re)set the attributes of a wx.AcceleratorEntry.
7381 :see `__init__`
7382 """
5b5c9bc7 7383 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
7384
7385 def GetFlags(*args, **kwargs):
d6c14a4c
RD
7386 """
7387 GetFlags(self) -> int
7388
7389 Get the AcceleratorEntry's flags.
7390 """
5b5c9bc7 7391 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
d55e5bfc
RD
7392
7393 def GetKeyCode(*args, **kwargs):
d6c14a4c
RD
7394 """
7395 GetKeyCode(self) -> int
7396
7397 Get the AcceleratorEntry's keycode.
7398 """
5b5c9bc7 7399 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
7400
7401 def GetCommand(*args, **kwargs):
d6c14a4c
RD
7402 """
7403 GetCommand(self) -> int
7404
7405 Get the AcceleratorEntry's command ID.
7406 """
5b5c9bc7 7407 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
d55e5bfc 7408
2131d850 7409_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
d55e5bfc 7410
5b5c9bc7 7411class AcceleratorTable(Object):
d6c14a4c
RD
7412 """
7413 An accelerator table allows the application to specify a table of
7414 keyboard shortcuts for menus or other commands. On Windows, menu or
7415 button commands are supported; on GTK, only menu commands are
7416 supported.
d6c14a4c 7417 """
1bd55598
RD
7418 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7419 __repr__ = _swig_repr
7420 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7421 """
7422 __init__(entries) -> AcceleratorTable
7423
d6c14a4c
RD
7424 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7425 items or or of 3-tuples (flags, keyCode, cmdID)
7426
7427 :see: `wx.AcceleratorEntry`
d55e5bfc 7428 """
1bd55598
RD
7429 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7430 __swig_destroy__ = _core_.delete_AcceleratorTable
7431 __del__ = lambda self : None;
d55e5bfc
RD
7432 def Ok(*args, **kwargs):
7433 """Ok(self) -> bool"""
5b5c9bc7 7434 return _core_.AcceleratorTable_Ok(*args, **kwargs)
d55e5bfc 7435
2131d850 7436_core_.AcceleratorTable_swigregister(AcceleratorTable)
d55e5bfc
RD
7437
7438
5b5c9bc7 7439def GetAccelFromString(*args, **kwargs):
1bd55598
RD
7440 """GetAccelFromString(String label) -> AcceleratorEntry"""
7441 return _core_.GetAccelFromString(*args, **kwargs)
d55e5bfc
RD
7442#---------------------------------------------------------------------------
7443
5b5c9bc7 7444class VisualAttributes(object):
d55e5bfc 7445 """struct containing all the visual attributes of a control"""
1bd55598
RD
7446 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7447 __repr__ = _swig_repr
7448 def __init__(self, *args, **kwargs):
d55e5bfc 7449 """
5b5c9bc7 7450 __init__(self) -> VisualAttributes
d55e5bfc
RD
7451
7452 struct containing all the visual attributes of a control
7453 """
1bd55598
RD
7454 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7455 __swig_destroy__ = _core_.delete_VisualAttributes
7456 __del__ = lambda self : None;
5b5c9bc7
RD
7457 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7458 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7459 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 7460_core_.VisualAttributes_swigregister(VisualAttributes)
5b5c9bc7 7461NullAcceleratorTable = cvar.NullAcceleratorTable
d55e5bfc
RD
7462PanelNameStr = cvar.PanelNameStr
7463
5b5c9bc7
RD
7464WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7465WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7466WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7467WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7468WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7469class Window(EvtHandler):
d55e5bfc
RD
7470 """
7471 wx.Window is the base class for all windows and represents any visible
7472 object on the screen. All controls, top level windows and so on are
7473 wx.Windows. Sizers and device contexts are not however, as they don't
7474 appear on screen themselves.
7475
7476 """
1bd55598
RD
7477 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7478 __repr__ = _swig_repr
7479 def __init__(self, *args, **kwargs):
d55e5bfc 7480 """
5b5c9bc7
RD
7481 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7482 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
d55e5bfc
RD
7483
7484 Construct and show a generic Window.
7485 """
1bd55598 7486 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d55e5bfc
RD
7487 self._setOORInfo(self)
7488
7489 def Create(*args, **kwargs):
7490 """
5b5c9bc7
RD
7491 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7492 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
d55e5bfc
RD
7493
7494 Create the GUI part of the Window for 2-phase creation mode.
7495 """
5b5c9bc7 7496 return _core_.Window_Create(*args, **kwargs)
d55e5bfc
RD
7497
7498 def Close(*args, **kwargs):
7499 """
7500 Close(self, bool force=False) -> bool
7501
7502 This function simply generates a EVT_CLOSE event whose handler usually
7503 tries to close the window. It doesn't close the window itself,
7504 however. If force is False (the default) then the window's close
7505 handler will be allowed to veto the destruction of the window.
d55e5bfc 7506 """
5b5c9bc7 7507 return _core_.Window_Close(*args, **kwargs)
d55e5bfc
RD
7508
7509 def Destroy(*args, **kwargs):
7510 """
7511 Destroy(self) -> bool
7512
7513 Destroys the window safely. Frames and dialogs are not destroyed
7514 immediately when this function is called -- they are added to a list
7515 of windows to be deleted on idle time, when all the window's events
7516 have been processed. This prevents problems with events being sent to
7517 non-existent windows.
7518
7519 Returns True if the window has either been successfully deleted, or it
7520 has been added to the list of windows pending real deletion.
7521 """
7e08d4ef
RD
7522 val = _core_.Window_Destroy(*args, **kwargs)
7523 args[0].thisown = 0
7524 return val
d55e5bfc
RD
7525
7526 def DestroyChildren(*args, **kwargs):
7527 """
7528 DestroyChildren(self) -> bool
7529
15817c7e
RD
7530 Destroys all children of a window. Called automatically by the
7531 destructor.
d55e5bfc 7532 """
5b5c9bc7 7533 return _core_.Window_DestroyChildren(*args, **kwargs)
d55e5bfc
RD
7534
7535 def IsBeingDeleted(*args, **kwargs):
7536 """
7537 IsBeingDeleted(self) -> bool
7538
7539 Is the window in the process of being deleted?
7540 """
5b5c9bc7 7541 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d55e5bfc 7542
d55e5bfc
RD
7543 def SetLabel(*args, **kwargs):
7544 """
5b5c9bc7 7545 SetLabel(self, String label)
d55e5bfc
RD
7546
7547 Set the text which the window shows in its label if applicable.
7548 """
5b5c9bc7 7549 return _core_.Window_SetLabel(*args, **kwargs)
d55e5bfc
RD
7550
7551 def GetLabel(*args, **kwargs):
7552 """
5b5c9bc7 7553 GetLabel(self) -> String
d55e5bfc 7554
15817c7e
RD
7555 Generic way of getting a label from any window, for identification
7556 purposes. The interpretation of this function differs from class to
7557 class. For frames and dialogs, the value returned is the title. For
7558 buttons or static text controls, it is the button text. This function
7559 can be useful for meta-programs such as testing tools or special-needs
7560 access programs)which need to identify windows by name.
d55e5bfc 7561 """
5b5c9bc7 7562 return _core_.Window_GetLabel(*args, **kwargs)
d55e5bfc
RD
7563
7564 def SetName(*args, **kwargs):
7565 """
5b5c9bc7 7566 SetName(self, String name)
d55e5bfc 7567
15817c7e
RD
7568 Sets the window's name. The window name is used for ressource setting
7569 in X, it is not the same as the window title/label
d55e5bfc 7570 """
5b5c9bc7 7571 return _core_.Window_SetName(*args, **kwargs)
d55e5bfc
RD
7572
7573 def GetName(*args, **kwargs):
7574 """
5b5c9bc7 7575 GetName(self) -> String
d55e5bfc 7576
15817c7e
RD
7577 Returns the windows name. This name is not guaranteed to be unique;
7578 it is up to the programmer to supply an appropriate name in the window
7579 constructor or via wx.Window.SetName.
d55e5bfc 7580 """
5b5c9bc7 7581 return _core_.Window_GetName(*args, **kwargs)
d55e5bfc
RD
7582
7583 def SetWindowVariant(*args, **kwargs):
7584 """
7585 SetWindowVariant(self, int variant)
7586
15817c7e
RD
7587 Sets the variant of the window/font size to use for this window, if
7588 the platform supports variants, for example, wxMac.
d55e5bfc 7589 """
5b5c9bc7 7590 return _core_.Window_SetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7591
7592 def GetWindowVariant(*args, **kwargs):
7593 """GetWindowVariant(self) -> int"""
5b5c9bc7 7594 return _core_.Window_GetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7595
7596 def SetId(*args, **kwargs):
7597 """
7598 SetId(self, int winid)
7599
7600 Sets the identifier of the window. Each window has an integer
7601 identifier. If the application has not provided one, an identifier
7602 will be generated. Normally, the identifier should be provided on
7603 creation and should not be modified subsequently.
7604 """
5b5c9bc7 7605 return _core_.Window_SetId(*args, **kwargs)
d55e5bfc
RD
7606
7607 def GetId(*args, **kwargs):
7608 """
7609 GetId(self) -> int
7610
7611 Returns the identifier of the window. Each window has an integer
7612 identifier. If the application has not provided one (or the default Id
7613 -1 is used) then an unique identifier with a negative value will be
7614 generated.
7615 """
5b5c9bc7 7616 return _core_.Window_GetId(*args, **kwargs)
d55e5bfc
RD
7617
7618 def NewControlId(*args, **kwargs):
7619 """
d6c14a4c 7620 NewControlId() -> int
d55e5bfc
RD
7621
7622 Generate a control id for the controls which were not given one.
7623 """
5b5c9bc7 7624 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc
RD
7625
7626 NewControlId = staticmethod(NewControlId)
7627 def NextControlId(*args, **kwargs):
7628 """
d6c14a4c 7629 NextControlId(int winid) -> int
d55e5bfc
RD
7630
7631 Get the id of the control following the one with the given
15817c7e 7632 autogenerated) id
d55e5bfc 7633 """
5b5c9bc7 7634 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
7635
7636 NextControlId = staticmethod(NextControlId)
7637 def PrevControlId(*args, **kwargs):
7638 """
d6c14a4c 7639 PrevControlId(int winid) -> int
d55e5bfc
RD
7640
7641 Get the id of the control preceding the one with the given
15817c7e 7642 autogenerated) id
d55e5bfc 7643 """
5b5c9bc7 7644 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc
RD
7645
7646 PrevControlId = staticmethod(PrevControlId)
7647 def SetSize(*args, **kwargs):
7648 """
5b5c9bc7 7649 SetSize(self, Size size)
d55e5bfc
RD
7650
7651 Sets the size of the window in pixels.
7652 """
5b5c9bc7 7653 return _core_.Window_SetSize(*args, **kwargs)
d55e5bfc
RD
7654
7655 def SetDimensions(*args, **kwargs):
7656 """
5b5c9bc7 7657 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
7658
7659 Sets the position and size of the window in pixels. The sizeFlags
7660 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
7661 equal to -1.
7662
7663 ======================== ======================================
7664 wx.SIZE_AUTO A -1 indicates that a class-specific
7665 default should be used.
7666 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7667 -1 values are supplied.
7668 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7669 interpreted as real dimensions, not
7670 default values.
7671 ======================== ======================================
7672
d55e5bfc 7673 """
5b5c9bc7 7674 return _core_.Window_SetDimensions(*args, **kwargs)
d55e5bfc
RD
7675
7676 def SetRect(*args, **kwargs):
7677 """
5b5c9bc7 7678 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
7679
7680 Sets the position and size of the window in pixels using a wx.Rect.
7681 """
5b5c9bc7 7682 return _core_.Window_SetRect(*args, **kwargs)
d55e5bfc
RD
7683
7684 def SetSizeWH(*args, **kwargs):
7685 """
7686 SetSizeWH(self, int width, int height)
7687
7688 Sets the size of the window in pixels.
7689 """
5b5c9bc7 7690 return _core_.Window_SetSizeWH(*args, **kwargs)
d55e5bfc
RD
7691
7692 def Move(*args, **kwargs):
7693 """
5b5c9bc7 7694 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
7695
7696 Moves the window to the given position.
7697 """
5b5c9bc7 7698 return _core_.Window_Move(*args, **kwargs)
d55e5bfc
RD
7699
7700 SetPosition = Move
7701 def MoveXY(*args, **kwargs):
7702 """
5b5c9bc7 7703 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
7704
7705 Moves the window to the given position.
7706 """
5b5c9bc7 7707 return _core_.Window_MoveXY(*args, **kwargs)
d55e5bfc 7708
f8167d6e
RD
7709 def SetBestFittingSize(*args, **kwargs):
7710 """
5b5c9bc7 7711 SetBestFittingSize(self, Size size=DefaultSize)
f8167d6e
RD
7712
7713 A 'Smart' SetSize that will fill in default size components with the
7714 window's *best size* values. Also set's the minsize for use with sizers.
7715 """
5b5c9bc7 7716 return _core_.Window_SetBestFittingSize(*args, **kwargs)
f8167d6e 7717
d55e5bfc
RD
7718 def Raise(*args, **kwargs):
7719 """
7720 Raise(self)
7721
943e8dfd
RD
7722 Raises the window to the top of the window hierarchy. In current
7723 version of wxWidgets this works both for manage and child windows.
d55e5bfc 7724 """
5b5c9bc7 7725 return _core_.Window_Raise(*args, **kwargs)
d55e5bfc
RD
7726
7727 def Lower(*args, **kwargs):
7728 """
7729 Lower(self)
7730
943e8dfd
RD
7731 Lowers the window to the bottom of the window hierarchy. In current
7732 version of wxWidgets this works both for manage and child windows.
d55e5bfc 7733 """
5b5c9bc7 7734 return _core_.Window_Lower(*args, **kwargs)
d55e5bfc
RD
7735
7736 def SetClientSize(*args, **kwargs):
7737 """
5b5c9bc7 7738 SetClientSize(self, Size size)
d55e5bfc
RD
7739
7740 This sets the size of the window client area in pixels. Using this
7741 function to size a window tends to be more device-independent than
7742 wx.Window.SetSize, since the application need not worry about what
7743 dimensions the border or title bar have when trying to fit the window
7744 around panel items, for example.
7745 """
5b5c9bc7 7746 return _core_.Window_SetClientSize(*args, **kwargs)
d55e5bfc
RD
7747
7748 def SetClientSizeWH(*args, **kwargs):
7749 """
7750 SetClientSizeWH(self, int width, int height)
7751
7752 This sets the size of the window client area in pixels. Using this
7753 function to size a window tends to be more device-independent than
7754 wx.Window.SetSize, since the application need not worry about what
7755 dimensions the border or title bar have when trying to fit the window
7756 around panel items, for example.
7757 """
5b5c9bc7 7758 return _core_.Window_SetClientSizeWH(*args, **kwargs)
d55e5bfc
RD
7759
7760 def SetClientRect(*args, **kwargs):
7761 """
5b5c9bc7 7762 SetClientRect(self, Rect rect)
d55e5bfc
RD
7763
7764 This sets the size of the window client area in pixels. Using this
7765 function to size a window tends to be more device-independent than
7766 wx.Window.SetSize, since the application need not worry about what
7767 dimensions the border or title bar have when trying to fit the window
7768 around panel items, for example.
7769 """
5b5c9bc7 7770 return _core_.Window_SetClientRect(*args, **kwargs)
d55e5bfc
RD
7771
7772 def GetPosition(*args, **kwargs):
7773 """
5b5c9bc7 7774 GetPosition(self) -> Point
d55e5bfc 7775
1c71765a
RD
7776 Get the window's position. Notice that the position is in client
7777 coordinates for child windows and screen coordinates for the top level
7778 ones, use `GetScreenPosition` if you need screen coordinates for all
7779 kinds of windows.
d55e5bfc 7780 """
5b5c9bc7 7781 return _core_.Window_GetPosition(*args, **kwargs)
d55e5bfc
RD
7782
7783 def GetPositionTuple(*args, **kwargs):
7784 """
7785 GetPositionTuple() -> (x,y)
7786
1c71765a
RD
7787 Get the window's position. Notice that the position is in client
7788 coordinates for child windows and screen coordinates for the top level
7789 ones, use `GetScreenPosition` if you need screen coordinates for all
7790 kinds of windows.
d55e5bfc 7791 """
5b5c9bc7 7792 return _core_.Window_GetPositionTuple(*args, **kwargs)
d55e5bfc 7793
1c71765a
RD
7794 def GetScreenPosition(*args, **kwargs):
7795 """
7796 GetScreenPosition(self) -> Point
7797
7798 Get the position of the window in screen coordinantes.
7799 """
7800 return _core_.Window_GetScreenPosition(*args, **kwargs)
7801
7802 def GetScreenPositionTuple(*args, **kwargs):
7803 """
7804 GetScreenPositionTuple() -> (x,y)
7805
7806 Get the position of the window in screen coordinantes.
7807 """
7808 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7809
7810 def GetScreenRect(*args, **kwargs):
7811 """
7812 GetScreenRect(self) -> Rect
7813
7814 Returns the size and position of the window in screen coordinantes as
7815 a `wx.Rect` object.
7816 """
7817 return _core_.Window_GetScreenRect(*args, **kwargs)
7818
d55e5bfc
RD
7819 def GetSize(*args, **kwargs):
7820 """
5b5c9bc7 7821 GetSize(self) -> Size
d55e5bfc
RD
7822
7823 Get the window size.
7824 """
5b5c9bc7 7825 return _core_.Window_GetSize(*args, **kwargs)
d55e5bfc
RD
7826
7827 def GetSizeTuple(*args, **kwargs):
7828 """
7829 GetSizeTuple() -> (width, height)
7830
7831 Get the window size.
7832 """
5b5c9bc7 7833 return _core_.Window_GetSizeTuple(*args, **kwargs)
d55e5bfc
RD
7834
7835 def GetRect(*args, **kwargs):
7836 """
5b5c9bc7 7837 GetRect(self) -> Rect
d55e5bfc 7838
1c71765a 7839 Returns the size and position of the window as a `wx.Rect` object.
d55e5bfc 7840 """
5b5c9bc7 7841 return _core_.Window_GetRect(*args, **kwargs)
d55e5bfc
RD
7842
7843 def GetClientSize(*args, **kwargs):
7844 """
5b5c9bc7 7845 GetClientSize(self) -> Size
d55e5bfc
RD
7846
7847 This gets the size of the window's 'client area' in pixels. The client
7848 area is the area which may be drawn on by the programmer, excluding
7849 title bar, border, scrollbars, etc.
7850 """
5b5c9bc7 7851 return _core_.Window_GetClientSize(*args, **kwargs)
d55e5bfc
RD
7852
7853 def GetClientSizeTuple(*args, **kwargs):
7854 """
7855 GetClientSizeTuple() -> (width, height)
7856
7857 This gets the size of the window's 'client area' in pixels. The client
7858 area is the area which may be drawn on by the programmer, excluding
7859 title bar, border, scrollbars, etc.
7860 """
5b5c9bc7 7861 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
d55e5bfc
RD
7862
7863 def GetClientAreaOrigin(*args, **kwargs):
7864 """
5b5c9bc7 7865 GetClientAreaOrigin(self) -> Point
d55e5bfc
RD
7866
7867 Get the origin of the client area of the window relative to the
7868 window's top left corner (the client area may be shifted because of
7869 the borders, scrollbars, other decorations...)
7870 """
5b5c9bc7 7871 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
d55e5bfc
RD
7872
7873 def GetClientRect(*args, **kwargs):
7874 """
5b5c9bc7 7875 GetClientRect(self) -> Rect
d55e5bfc 7876
0439c23b 7877 Get the client area position and size as a `wx.Rect` object.
d55e5bfc 7878 """
5b5c9bc7 7879 return _core_.Window_GetClientRect(*args, **kwargs)
d55e5bfc
RD
7880
7881 def GetBestSize(*args, **kwargs):
7882 """
5b5c9bc7 7883 GetBestSize(self) -> Size
d55e5bfc 7884
bfddbb17 7885 This function returns the best acceptable minimal size for the
15817c7e
RD
7886 window, if applicable. For example, for a static text control, it will
7887 be the minimal size such that the control label is not truncated. For
7888 windows containing subwindows (suzh aswx.Panel), the size returned by
7889 this function will be the same as the size the window would have had
7890 after calling Fit.
d55e5bfc 7891 """
5b5c9bc7 7892 return _core_.Window_GetBestSize(*args, **kwargs)
d55e5bfc
RD
7893
7894 def GetBestSizeTuple(*args, **kwargs):
7895 """
7896 GetBestSizeTuple() -> (width, height)
7897
bfddbb17 7898 This function returns the best acceptable minimal size for the
15817c7e
RD
7899 window, if applicable. For example, for a static text control, it will
7900 be the minimal size such that the control label is not truncated. For
7901 windows containing subwindows (suzh aswx.Panel), the size returned by
7902 this function will be the same as the size the window would have had
7903 after calling Fit.
d55e5bfc 7904 """
5b5c9bc7 7905 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
d55e5bfc 7906
a001823c
RD
7907 def InvalidateBestSize(*args, **kwargs):
7908 """
7909 InvalidateBestSize(self)
7910
7911 Reset the cached best size value so it will be recalculated the next
7912 time it is needed.
7913 """
5b5c9bc7 7914 return _core_.Window_InvalidateBestSize(*args, **kwargs)
a001823c 7915
e2813725
RD
7916 def CacheBestSize(*args, **kwargs):
7917 """
7918 CacheBestSize(self, Size size)
7919
7920 Cache the best size so it doesn't need to be calculated again, (at least until
7921 some properties of the window change.)
7922 """
7923 return _core_.Window_CacheBestSize(*args, **kwargs)
7924
a001823c
RD
7925 def GetBestFittingSize(*args, **kwargs):
7926 """
5b5c9bc7 7927 GetBestFittingSize(self) -> Size
a001823c
RD
7928
7929 This function will merge the window's best size into the window's
7930 minimum size, giving priority to the min size components, and returns
7931 the results.
7932
7933 """
5b5c9bc7 7934 return _core_.Window_GetBestFittingSize(*args, **kwargs)
a001823c 7935
d55e5bfc
RD
7936 def GetAdjustedBestSize(*args, **kwargs):
7937 """
5b5c9bc7 7938 GetAdjustedBestSize(self) -> Size
d55e5bfc
RD
7939
7940 This method is similar to GetBestSize, except in one
7941 thing. GetBestSize should return the minimum untruncated size of the
7942 window, while this method will return the largest of BestSize and any
7943 user specified minimum size. ie. it is the minimum size the window
7944 should currently be drawn at, not the minimal size it can possibly
7945 tolerate.
7946 """
5b5c9bc7 7947 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
d55e5bfc
RD
7948
7949 def Center(*args, **kwargs):
7950 """
5b5c9bc7 7951 Center(self, int direction=BOTH)
d55e5bfc
RD
7952
7953 Centers the window. The parameter specifies the direction for
7954 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7955 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7956 on the entire screen and not on its parent window. If it is a
7957 top-level window and has no parent then it will always be centered
7958 relative to the screen.
7959 """
5b5c9bc7 7960 return _core_.Window_Center(*args, **kwargs)
d55e5bfc
RD
7961
7962 Centre = Center
d55e5bfc
RD
7963 def CenterOnParent(*args, **kwargs):
7964 """
5b5c9bc7 7965 CenterOnParent(self, int dir=BOTH)
d55e5bfc
RD
7966
7967 Center with respect to the the parent window
7968 """
5b5c9bc7 7969 return _core_.Window_CenterOnParent(*args, **kwargs)
d55e5bfc
RD
7970
7971 CentreOnParent = CenterOnParent
7972 def Fit(*args, **kwargs):
7973 """
7974 Fit(self)
7975
7976 Sizes the window so that it fits around its subwindows. This function
7977 won't do anything if there are no subwindows and will only really work
7978 correctly if sizers are used for the subwindows layout. Also, if the
7979 window has exactly one subwindow it is better (faster and the result
7980 is more precise as Fit adds some margin to account for fuzziness of
7981 its calculations) to call window.SetClientSize(child.GetSize())
7982 instead of calling Fit.
7983 """
5b5c9bc7 7984 return _core_.Window_Fit(*args, **kwargs)
d55e5bfc
RD
7985
7986 def FitInside(*args, **kwargs):
7987 """
7988 FitInside(self)
7989
7990 Similar to Fit, but sizes the interior (virtual) size of a
7991 window. Mainly useful with scrolled windows to reset scrollbars after
7992 sizing changes that do not trigger a size event, and/or scrolled
7993 windows without an interior sizer. This function similarly won't do
7994 anything if there are no subwindows.
7995 """
5b5c9bc7 7996 return _core_.Window_FitInside(*args, **kwargs)
d55e5bfc 7997
03837c5c 7998 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
7999 """
8000 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8001 int incH=-1)
d55e5bfc
RD
8002
8003 Allows specification of minimum and maximum window sizes, and window
8004 size increments. If a pair of values is not set (or set to -1), the
8005 default values will be used. If this function is called, the user
908b74cd
RD
8006 will not be able to size the window outside the given bounds (if it is
8007 a top-level window.) Sizers will also inspect the minimum window size
8008 and will use that value if set when calculating layout.
8009
8010 The resizing increments are only significant under Motif or Xt.
d55e5bfc 8011 """
5b5c9bc7 8012 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 8013
03837c5c
RD
8014 def SetSizeHintsSz(*args, **kwargs):
8015 """
5b5c9bc7 8016 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
03837c5c
RD
8017
8018 Allows specification of minimum and maximum window sizes, and window
8019 size increments. If a pair of values is not set (or set to -1), the
8020 default values will be used. If this function is called, the user
8021 will not be able to size the window outside the given bounds (if it is
8022 a top-level window.) Sizers will also inspect the minimum window size
8023 and will use that value if set when calculating layout.
8024
8025 The resizing increments are only significant under Motif or Xt.
8026 """
5b5c9bc7 8027 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
03837c5c
RD
8028
8029 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 8030 """
908b74cd 8031 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
8032
8033 Allows specification of minimum and maximum virtual window sizes. If a
8034 pair of values is not set (or set to -1), the default values will be
8035 used. If this function is called, the user will not be able to size
8036 the virtual area of the window outside the given bounds.
8037 """
5b5c9bc7 8038 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
03837c5c
RD
8039
8040 def SetVirtualSizeHintsSz(*args, **kwargs):
8041 """
5b5c9bc7 8042 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
03837c5c
RD
8043
8044 Allows specification of minimum and maximum virtual window sizes. If a
8045 pair of values is not set (or set to -1), the default values will be
8046 used. If this function is called, the user will not be able to size
8047 the virtual area of the window outside the given bounds.
8048 """
5b5c9bc7 8049 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 8050
908b74cd 8051 def GetMaxSize(*args, **kwargs):
5b5c9bc7
RD
8052 """GetMaxSize(self) -> Size"""
8053 return _core_.Window_GetMaxSize(*args, **kwargs)
908b74cd
RD
8054
8055 def GetMinSize(*args, **kwargs):
5b5c9bc7
RD
8056 """GetMinSize(self) -> Size"""
8057 return _core_.Window_GetMinSize(*args, **kwargs)
908b74cd
RD
8058
8059 def SetMinSize(*args, **kwargs):
8060 """
5b5c9bc7 8061 SetMinSize(self, Size minSize)
908b74cd
RD
8062
8063 A more convenient method than `SetSizeHints` for setting just the
8064 min size.
8065 """
5b5c9bc7 8066 return _core_.Window_SetMinSize(*args, **kwargs)
908b74cd
RD
8067
8068 def SetMaxSize(*args, **kwargs):
8069 """
5b5c9bc7 8070 SetMaxSize(self, Size maxSize)
908b74cd
RD
8071
8072 A more convenient method than `SetSizeHints` for setting just the
8073 max size.
8074 """
5b5c9bc7 8075 return _core_.Window_SetMaxSize(*args, **kwargs)
908b74cd 8076
d55e5bfc
RD
8077 def GetMinWidth(*args, **kwargs):
8078 """GetMinWidth(self) -> int"""
5b5c9bc7 8079 return _core_.Window_GetMinWidth(*args, **kwargs)
d55e5bfc
RD
8080
8081 def GetMinHeight(*args, **kwargs):
8082 """GetMinHeight(self) -> int"""
5b5c9bc7 8083 return _core_.Window_GetMinHeight(*args, **kwargs)
d55e5bfc
RD
8084
8085 def GetMaxWidth(*args, **kwargs):
8086 """GetMaxWidth(self) -> int"""
5b5c9bc7 8087 return _core_.Window_GetMaxWidth(*args, **kwargs)
d55e5bfc
RD
8088
8089 def GetMaxHeight(*args, **kwargs):
8090 """GetMaxHeight(self) -> int"""
5b5c9bc7 8091 return _core_.Window_GetMaxHeight(*args, **kwargs)
d55e5bfc 8092
d55e5bfc
RD
8093 def SetVirtualSize(*args, **kwargs):
8094 """
5b5c9bc7 8095 SetVirtualSize(self, Size size)
d55e5bfc
RD
8096
8097 Set the the virtual size of a window in pixels. For most windows this
8098 is just the client area of the window, but for some like scrolled
8099 windows it is more or less independent of the screen window size.
8100 """
5b5c9bc7 8101 return _core_.Window_SetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8102
8103 def SetVirtualSizeWH(*args, **kwargs):
8104 """
8105 SetVirtualSizeWH(self, int w, int h)
8106
8107 Set the the virtual size of a window in pixels. For most windows this
8108 is just the client area of the window, but for some like scrolled
8109 windows it is more or less independent of the screen window size.
8110 """
5b5c9bc7 8111 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
d55e5bfc
RD
8112
8113 def GetVirtualSize(*args, **kwargs):
8114 """
5b5c9bc7 8115 GetVirtualSize(self) -> Size
d55e5bfc
RD
8116
8117 Get the the virtual size of the window in pixels. For most windows
8118 this is just the client area of the window, but for some like scrolled
8119 windows it is more or less independent of the screen window size.
8120 """
5b5c9bc7 8121 return _core_.Window_GetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8122
8123 def GetVirtualSizeTuple(*args, **kwargs):
8124 """
8125 GetVirtualSizeTuple() -> (width, height)
8126
8127 Get the the virtual size of the window in pixels. For most windows
8128 this is just the client area of the window, but for some like scrolled
8129 windows it is more or less independent of the screen window size.
8130 """
5b5c9bc7 8131 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
d55e5bfc
RD
8132
8133 def GetBestVirtualSize(*args, **kwargs):
8134 """
5b5c9bc7 8135 GetBestVirtualSize(self) -> Size
d55e5bfc
RD
8136
8137 Return the largest of ClientSize and BestSize (as determined by a
8138 sizer, interior children, or other means)
8139 """
5b5c9bc7 8140 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
d55e5bfc
RD
8141
8142 def Show(*args, **kwargs):
8143 """
8144 Show(self, bool show=True) -> bool
8145
8146 Shows or hides the window. You may need to call Raise for a top level
8147 window if you want to bring it to top, although this is not needed if
8148 Show is called immediately after the frame creation. Returns True if
8149 the window has been shown or hidden or False if nothing was done
8150 because it already was in the requested state.
8151 """
5b5c9bc7 8152 return _core_.Window_Show(*args, **kwargs)
d55e5bfc
RD
8153
8154 def Hide(*args, **kwargs):
8155 """
8156 Hide(self) -> bool
8157
8158 Equivalent to calling Show(False).
8159 """
5b5c9bc7 8160 return _core_.Window_Hide(*args, **kwargs)
d55e5bfc
RD
8161
8162 def Enable(*args, **kwargs):
8163 """
8164 Enable(self, bool enable=True) -> bool
8165
8166 Enable or disable the window for user input. Note that when a parent
8167 window is disabled, all of its children are disabled as well and they
8168 are reenabled again when the parent is. Returns true if the window
8169 has been enabled or disabled, false if nothing was done, i.e. if the
8170 window had already been in the specified state.
8171 """
5b5c9bc7 8172 return _core_.Window_Enable(*args, **kwargs)
d55e5bfc
RD
8173
8174 def Disable(*args, **kwargs):
8175 """
8176 Disable(self) -> bool
8177
8178 Disables the window, same as Enable(false).
8179 """
5b5c9bc7 8180 return _core_.Window_Disable(*args, **kwargs)
d55e5bfc
RD
8181
8182 def IsShown(*args, **kwargs):
8183 """
8184 IsShown(self) -> bool
8185
8186 Returns true if the window is shown, false if it has been hidden.
8187 """
5b5c9bc7 8188 return _core_.Window_IsShown(*args, **kwargs)
d55e5bfc
RD
8189
8190 def IsEnabled(*args, **kwargs):
8191 """
8192 IsEnabled(self) -> bool
8193
8194 Returns true if the window is enabled for input, false otherwise.
8195 """
5b5c9bc7 8196 return _core_.Window_IsEnabled(*args, **kwargs)
d55e5bfc
RD
8197
8198 def SetWindowStyleFlag(*args, **kwargs):
8199 """
8200 SetWindowStyleFlag(self, long style)
8201
15817c7e
RD
8202 Sets the style of the window. Please note that some styles cannot be
8203 changed after the window creation and that Refresh() might need to be
8204 called after changing the others for the change to take place
8205 immediately.
d55e5bfc 8206 """
5b5c9bc7 8207 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8208
8209 def GetWindowStyleFlag(*args, **kwargs):
8210 """
8211 GetWindowStyleFlag(self) -> long
8212
8213 Gets the window style that was passed to the constructor or Create
8214 method.
8215 """
5b5c9bc7 8216 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8217
8218 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8219 def HasFlag(*args, **kwargs):
8220 """
8221 HasFlag(self, int flag) -> bool
8222
8223 Test if the given style is set for this window.
8224 """
5b5c9bc7 8225 return _core_.Window_HasFlag(*args, **kwargs)
d55e5bfc
RD
8226
8227 def IsRetained(*args, **kwargs):
8228 """
8229 IsRetained(self) -> bool
8230
8231 Returns true if the window is retained, false otherwise. Retained
8232 windows are only available on X platforms.
8233 """
5b5c9bc7 8234 return _core_.Window_IsRetained(*args, **kwargs)
d55e5bfc
RD
8235
8236 def SetExtraStyle(*args, **kwargs):
8237 """
8238 SetExtraStyle(self, long exStyle)
8239
8240 Sets the extra style bits for the window. Extra styles are the less
8241 often used style bits which can't be set with the constructor or with
8242 SetWindowStyleFlag()
8243 """
5b5c9bc7 8244 return _core_.Window_SetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8245
8246 def GetExtraStyle(*args, **kwargs):
8247 """
8248 GetExtraStyle(self) -> long
8249
8250 Returns the extra style bits for the window.
8251 """
5b5c9bc7 8252 return _core_.Window_GetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8253
8254 def MakeModal(*args, **kwargs):
8255 """
8256 MakeModal(self, bool modal=True)
8257
8258 Disables all other windows in the application so that the user can
8259 only interact with this window. Passing False will reverse this
8260 effect.
8261 """
5b5c9bc7 8262 return _core_.Window_MakeModal(*args, **kwargs)
d55e5bfc
RD
8263
8264 def SetThemeEnabled(*args, **kwargs):
8265 """
8266 SetThemeEnabled(self, bool enableTheme)
8267
8268 This function tells a window if it should use the system's "theme"
8269 code to draw the windows' background instead if its own background
8270 drawing code. This will only have an effect on platforms that support
8271 the notion of themes in user defined windows. One such platform is
8272 GTK+ where windows can have (very colourful) backgrounds defined by a
8273 user's selected theme.
8274
8275 Dialogs, notebook pages and the status bar have this flag set to true
8276 by default so that the default look and feel is simulated best.
8277 """
5b5c9bc7 8278 return _core_.Window_SetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8279
8280 def GetThemeEnabled(*args, **kwargs):
8281 """
8282 GetThemeEnabled(self) -> bool
8283
8284 Return the themeEnabled flag.
8285 """
5b5c9bc7 8286 return _core_.Window_GetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8287
8288 def SetFocus(*args, **kwargs):
8289 """
8290 SetFocus(self)
8291
8292 Set's the focus to this window, allowing it to receive keyboard input.
8293 """
5b5c9bc7 8294 return _core_.Window_SetFocus(*args, **kwargs)
d55e5bfc
RD
8295
8296 def SetFocusFromKbd(*args, **kwargs):
8297 """
8298 SetFocusFromKbd(self)
8299
8300 Set focus to this window as the result of a keyboard action. Normally
8301 only called internally.
8302 """
5b5c9bc7 8303 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
d55e5bfc
RD
8304
8305 def FindFocus(*args, **kwargs):
8306 """
5b5c9bc7 8307 FindFocus() -> Window
d55e5bfc
RD
8308
8309 Returns the window or control that currently has the keyboard focus,
8310 or None.
8311 """
5b5c9bc7 8312 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc
RD
8313
8314 FindFocus = staticmethod(FindFocus)
8315 def AcceptsFocus(*args, **kwargs):
8316 """
8317 AcceptsFocus(self) -> bool
8318
8319 Can this window have focus?
8320 """
5b5c9bc7 8321 return _core_.Window_AcceptsFocus(*args, **kwargs)
d55e5bfc
RD
8322
8323 def AcceptsFocusFromKeyboard(*args, **kwargs):
8324 """
8325 AcceptsFocusFromKeyboard(self) -> bool
8326
8327 Can this window be given focus by keyboard navigation? if not, the
8328 only way to give it focus (provided it accepts it at all) is to click
8329 it.
8330 """
5b5c9bc7 8331 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
d55e5bfc 8332
908b74cd
RD
8333 def Navigate(*args, **kwargs):
8334 """
8335 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8336
fd2dc343
RD
8337 Does keyboard navigation from this window to another, by sending a
8338 `wx.NavigationKeyEvent`.
908b74cd 8339 """
5b5c9bc7 8340 return _core_.Window_Navigate(*args, **kwargs)
908b74cd 8341
bf26d883
RD
8342 def MoveAfterInTabOrder(*args, **kwargs):
8343 """
5b5c9bc7 8344 MoveAfterInTabOrder(self, Window win)
bf26d883
RD
8345
8346 Moves this window in the tab navigation order after the specified
8347 sibling window. This means that when the user presses the TAB key on
8348 that other window, the focus switches to this window.
8349
8350 The default tab order is the same as creation order. This function
8351 and `MoveBeforeInTabOrder` allow to change it after creating all the
8352 windows.
8353
8354 """
5b5c9bc7 8355 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
bf26d883
RD
8356
8357 def MoveBeforeInTabOrder(*args, **kwargs):
8358 """
5b5c9bc7 8359 MoveBeforeInTabOrder(self, Window win)
bf26d883
RD
8360
8361 Same as `MoveAfterInTabOrder` except that it inserts this window just
8362 before win instead of putting it right after it.
8363 """
5b5c9bc7 8364 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
bf26d883 8365
d55e5bfc
RD
8366 def GetChildren(*args, **kwargs):
8367 """
8368 GetChildren(self) -> PyObject
8369
8370 Returns a list of the window's children. NOTE: Currently this is a
8371 copy of the child window list maintained by the window, so the return
8372 value of this function is only valid as long as the window's children
8373 do not change.
8374 """
5b5c9bc7 8375 return _core_.Window_GetChildren(*args, **kwargs)
d55e5bfc
RD
8376
8377 def GetParent(*args, **kwargs):
8378 """
5b5c9bc7 8379 GetParent(self) -> Window
d55e5bfc
RD
8380
8381 Returns the parent window of this window, or None if there isn't one.
8382 """
5b5c9bc7 8383 return _core_.Window_GetParent(*args, **kwargs)
d55e5bfc
RD
8384
8385 def GetGrandParent(*args, **kwargs):
8386 """
5b5c9bc7 8387 GetGrandParent(self) -> Window
d55e5bfc 8388
15817c7e
RD
8389 Returns the parent of the parent of this window, or None if there
8390 isn't one.
d55e5bfc 8391 """
5b5c9bc7 8392 return _core_.Window_GetGrandParent(*args, **kwargs)
d55e5bfc
RD
8393
8394 def IsTopLevel(*args, **kwargs):
8395 """
8396 IsTopLevel(self) -> bool
8397
8398 Returns true if the given window is a top-level one. Currently all
8399 frames and dialogs are always considered to be top-level windows (even
8400 if they have a parent window).
8401 """
5b5c9bc7 8402 return _core_.Window_IsTopLevel(*args, **kwargs)
d55e5bfc
RD
8403
8404 def Reparent(*args, **kwargs):
8405 """
5b5c9bc7 8406 Reparent(self, Window newParent) -> bool
d55e5bfc
RD
8407
8408 Reparents the window, i.e the window will be removed from its current
8409 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8410 re-inserted into another. Available on Windows and GTK. Returns True
8411 if the parent was changed, False otherwise (error or newParent ==
8412 oldParent)
8413 """
5b5c9bc7 8414 return _core_.Window_Reparent(*args, **kwargs)
d55e5bfc
RD
8415
8416 def AddChild(*args, **kwargs):
8417 """
5b5c9bc7 8418 AddChild(self, Window child)
d55e5bfc
RD
8419
8420 Adds a child window. This is called automatically by window creation
8421 functions so should not be required by the application programmer.
8422 """
5b5c9bc7 8423 return _core_.Window_AddChild(*args, **kwargs)
d55e5bfc
RD
8424
8425 def RemoveChild(*args, **kwargs):
8426 """
5b5c9bc7 8427 RemoveChild(self, Window child)
d55e5bfc
RD
8428
8429 Removes a child window. This is called automatically by window
8430 deletion functions so should not be required by the application
8431 programmer.
8432 """
5b5c9bc7 8433 return _core_.Window_RemoveChild(*args, **kwargs)
d55e5bfc 8434
704eda0c
RD
8435 def SetDoubleBuffered(*args, **kwargs):
8436 """
8437 SetDoubleBuffered(self, bool on)
8438
8439 Currently wxGTK2 only.
8440 """
8441 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8442
d55e5bfc
RD
8443 def FindWindowById(*args, **kwargs):
8444 """
5b5c9bc7 8445 FindWindowById(self, long winid) -> Window
d55e5bfc
RD
8446
8447 Find a chld of this window by window ID
8448 """
5b5c9bc7 8449 return _core_.Window_FindWindowById(*args, **kwargs)
d55e5bfc
RD
8450
8451 def FindWindowByName(*args, **kwargs):
8452 """
5b5c9bc7 8453 FindWindowByName(self, String name) -> Window
d55e5bfc
RD
8454
8455 Find a child of this window by name
8456 """
5b5c9bc7 8457 return _core_.Window_FindWindowByName(*args, **kwargs)
d55e5bfc
RD
8458
8459 def GetEventHandler(*args, **kwargs):
8460 """
5b5c9bc7 8461 GetEventHandler(self) -> EvtHandler
d55e5bfc
RD
8462
8463 Returns the event handler for this window. By default, the window is
8464 its own event handler.
8465 """
5b5c9bc7 8466 return _core_.Window_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
8467
8468 def SetEventHandler(*args, **kwargs):
8469 """
5b5c9bc7 8470 SetEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8471
8472 Sets the event handler for this window. An event handler is an object
8473 that is capable of processing the events sent to a window. By default,
8474 the window is its own event handler, but an application may wish to
8475 substitute another, for example to allow central implementation of
8476 event-handling for a variety of different window classes.
8477
15817c7e 8478 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
8479 up a chain of event handlers, where an event not handled by one event
8480 handler is handed to the next one in the chain.
8481 """
5b5c9bc7 8482 return _core_.Window_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
8483
8484 def PushEventHandler(*args, **kwargs):
8485 """
5b5c9bc7 8486 PushEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8487
8488 Pushes this event handler onto the event handler stack for the window.
8489 An event handler is an object that is capable of processing the events
8490 sent to a window. By default, the window is its own event handler, but
8491 an application may wish to substitute another, for example to allow
8492 central implementation of event-handling for a variety of different
8493 window classes.
8494
8495 wx.Window.PushEventHandler allows an application to set up a chain of
8496 event handlers, where an event not handled by one event handler is
15817c7e 8497 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
8498 remove the event handler.
8499 """
5b5c9bc7 8500 return _core_.Window_PushEventHandler(*args, **kwargs)
d55e5bfc
RD
8501
8502 def PopEventHandler(*args, **kwargs):
8503 """
5b5c9bc7 8504 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
d55e5bfc
RD
8505
8506 Removes and returns the top-most event handler on the event handler
8507 stack. If deleteHandler is True then the wx.EvtHandler object will be
8508 destroyed after it is popped.
8509 """
5b5c9bc7 8510 return _core_.Window_PopEventHandler(*args, **kwargs)
d55e5bfc
RD
8511
8512 def RemoveEventHandler(*args, **kwargs):
8513 """
5b5c9bc7 8514 RemoveEventHandler(self, EvtHandler handler) -> bool
d55e5bfc 8515
15817c7e
RD
8516 Find the given handler in the event handler chain and remove (but not
8517 delete) it from the event handler chain, return True if it was found
8518 and False otherwise (this also results in an assert failure so this
8519 function should only be called when the handler is supposed to be
8520 there.)
d55e5bfc 8521 """
5b5c9bc7 8522 return _core_.Window_RemoveEventHandler(*args, **kwargs)
d55e5bfc
RD
8523
8524 def SetValidator(*args, **kwargs):
8525 """
5b5c9bc7 8526 SetValidator(self, Validator validator)
d55e5bfc
RD
8527
8528 Deletes the current validator (if any) and sets the window validator,
8529 having called wx.Validator.Clone to create a new validator of this
8530 type.
8531 """
5b5c9bc7 8532 return _core_.Window_SetValidator(*args, **kwargs)
d55e5bfc
RD
8533
8534 def GetValidator(*args, **kwargs):
8535 """
5b5c9bc7 8536 GetValidator(self) -> Validator
d55e5bfc
RD
8537
8538 Returns a pointer to the current validator for the window, or None if
8539 there is none.
8540 """
5b5c9bc7 8541 return _core_.Window_GetValidator(*args, **kwargs)
d55e5bfc
RD
8542
8543 def Validate(*args, **kwargs):
8544 """
8545 Validate(self) -> bool
8546
8547 Validates the current values of the child controls using their
15817c7e
RD
8548 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8549 style flag set, the method will also call Validate() of all child
8550 windows. Returns false if any of the validations failed.
d55e5bfc 8551 """
5b5c9bc7 8552 return _core_.Window_Validate(*args, **kwargs)
d55e5bfc
RD
8553
8554 def TransferDataToWindow(*args, **kwargs):
8555 """
8556 TransferDataToWindow(self) -> bool
8557
15817c7e
RD
8558 Transfers values to child controls from data areas specified by their
8559 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8560 style flag set, the method will also call TransferDataToWindow() of
8561 all child windows.
d55e5bfc 8562 """
5b5c9bc7 8563 return _core_.Window_TransferDataToWindow(*args, **kwargs)
d55e5bfc
RD
8564
8565 def TransferDataFromWindow(*args, **kwargs):
8566 """
8567 TransferDataFromWindow(self) -> bool
8568
15817c7e
RD
8569 Transfers values from child controls to data areas specified by their
8570 validators. Returns false if a transfer failed. If the window has
8571 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8572 also call TransferDataFromWindow() of all child windows.
d55e5bfc 8573 """
5b5c9bc7 8574 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
d55e5bfc
RD
8575
8576 def InitDialog(*args, **kwargs):
8577 """
8578 InitDialog(self)
8579
15817c7e
RD
8580 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8581 to the dialog via validators.
d55e5bfc 8582 """
5b5c9bc7 8583 return _core_.Window_InitDialog(*args, **kwargs)
d55e5bfc
RD
8584
8585 def SetAcceleratorTable(*args, **kwargs):
8586 """
5b5c9bc7 8587 SetAcceleratorTable(self, AcceleratorTable accel)
d55e5bfc
RD
8588
8589 Sets the accelerator table for this window.
8590 """
5b5c9bc7 8591 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
8592
8593 def GetAcceleratorTable(*args, **kwargs):
8594 """
5b5c9bc7 8595 GetAcceleratorTable(self) -> AcceleratorTable
d55e5bfc
RD
8596
8597 Gets the accelerator table for this window.
8598 """
5b5c9bc7 8599 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
8600
8601 def RegisterHotKey(*args, **kwargs):
8602 """
8603 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8604
8605 Registers a system wide hotkey. Every time the user presses the hotkey
8606 registered here, this window will receive a hotkey event. It will
8607 receive the event even if the application is in the background and
8608 does not have the input focus because the user is working with some
8609 other application. To bind an event handler function to this hotkey
8610 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8611 hotkey was registered successfully.
8612 """
5b5c9bc7 8613 return _core_.Window_RegisterHotKey(*args, **kwargs)
d55e5bfc
RD
8614
8615 def UnregisterHotKey(*args, **kwargs):
8616 """
8617 UnregisterHotKey(self, int hotkeyId) -> bool
8618
8619 Unregisters a system wide hotkey.
8620 """
5b5c9bc7 8621 return _core_.Window_UnregisterHotKey(*args, **kwargs)
d55e5bfc
RD
8622
8623 def ConvertDialogPointToPixels(*args, **kwargs):
8624 """
5b5c9bc7 8625 ConvertDialogPointToPixels(self, Point pt) -> Point
d55e5bfc
RD
8626
8627 Converts a point or size from dialog units to pixels. Dialog units
8628 are used for maintaining a dialog's proportions even if the font
8629 changes. For the x dimension, the dialog units are multiplied by the
8630 average character width and then divided by 4. For the y dimension,
8631 the dialog units are multiplied by the average character height and
8632 then divided by 8.
8633 """
5b5c9bc7 8634 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
d55e5bfc
RD
8635
8636 def ConvertDialogSizeToPixels(*args, **kwargs):
8637 """
5b5c9bc7 8638 ConvertDialogSizeToPixels(self, Size sz) -> Size
d55e5bfc
RD
8639
8640 Converts a point or size from dialog units to pixels. Dialog units
8641 are used for maintaining a dialog's proportions even if the font
8642 changes. For the x dimension, the dialog units are multiplied by the
8643 average character width and then divided by 4. For the y dimension,
8644 the dialog units are multiplied by the average character height and
8645 then divided by 8.
8646 """
5b5c9bc7 8647 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
d55e5bfc
RD
8648
8649 def DLG_PNT(*args, **kwargs):
8650 """
5b5c9bc7 8651 DLG_PNT(self, Point pt) -> Point
d55e5bfc
RD
8652
8653 Converts a point or size from dialog units to pixels. Dialog units
8654 are used for maintaining a dialog's proportions even if the font
8655 changes. For the x dimension, the dialog units are multiplied by the
8656 average character width and then divided by 4. For the y dimension,
8657 the dialog units are multiplied by the average character height and
8658 then divided by 8.
8659 """
5b5c9bc7 8660 return _core_.Window_DLG_PNT(*args, **kwargs)
d55e5bfc
RD
8661
8662 def DLG_SZE(*args, **kwargs):
8663 """
5b5c9bc7 8664 DLG_SZE(self, Size sz) -> Size
d55e5bfc
RD
8665
8666 Converts a point or size from dialog units to pixels. Dialog units
8667 are used for maintaining a dialog's proportions even if the font
8668 changes. For the x dimension, the dialog units are multiplied by the
8669 average character width and then divided by 4. For the y dimension,
8670 the dialog units are multiplied by the average character height and
8671 then divided by 8.
8672 """
5b5c9bc7 8673 return _core_.Window_DLG_SZE(*args, **kwargs)
d55e5bfc
RD
8674
8675 def ConvertPixelPointToDialog(*args, **kwargs):
5b5c9bc7
RD
8676 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8677 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
d55e5bfc
RD
8678
8679 def ConvertPixelSizeToDialog(*args, **kwargs):
5b5c9bc7
RD
8680 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8681 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
d55e5bfc
RD
8682
8683 def WarpPointer(*args, **kwargs):
8684 """
8685 WarpPointer(self, int x, int y)
8686
8687 Moves the pointer to the given position on the window.
8688
8689 NOTE: This function is not supported under Mac because Apple Human
8690 Interface Guidelines forbid moving the mouse cursor programmatically.
8691 """
5b5c9bc7 8692 return _core_.Window_WarpPointer(*args, **kwargs)
d55e5bfc
RD
8693
8694 def CaptureMouse(*args, **kwargs):
8695 """
8696 CaptureMouse(self)
8697
8698 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8699 release the capture.
8700
8701 Note that wxWindows maintains the stack of windows having captured the
8702 mouse and when the mouse is released the capture returns to the window
8703 which had had captured it previously and it is only really released if
8704 there were no previous window. In particular, this means that you must
34e0a3bb
RD
8705 release the mouse as many times as you capture it, unless the window
8706 receives the `wx.MouseCaptureLostEvent` event.
8707
8708 Any application which captures the mouse in the beginning of some
8709 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
8710 operation when it receives the event. The event handler must not
8711 recapture mouse.
d55e5bfc 8712 """
5b5c9bc7 8713 return _core_.Window_CaptureMouse(*args, **kwargs)
d55e5bfc
RD
8714
8715 def ReleaseMouse(*args, **kwargs):
8716 """
8717 ReleaseMouse(self)
8718
8719 Releases mouse input captured with wx.Window.CaptureMouse.
8720 """
5b5c9bc7 8721 return _core_.Window_ReleaseMouse(*args, **kwargs)
d55e5bfc
RD
8722
8723 def GetCapture(*args, **kwargs):
8724 """
5b5c9bc7 8725 GetCapture() -> Window
d55e5bfc
RD
8726
8727 Returns the window which currently captures the mouse or None
8728 """
5b5c9bc7 8729 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc
RD
8730
8731 GetCapture = staticmethod(GetCapture)
8732 def HasCapture(*args, **kwargs):
8733 """
8734 HasCapture(self) -> bool
8735
8736 Returns true if this window has the current mouse capture.
8737 """
5b5c9bc7 8738 return _core_.Window_HasCapture(*args, **kwargs)
d55e5bfc
RD
8739
8740 def Refresh(*args, **kwargs):
8741 """
5b5c9bc7 8742 Refresh(self, bool eraseBackground=True, Rect rect=None)
d55e5bfc
RD
8743
8744 Mark the specified rectangle (or the whole window) as "dirty" so it
8745 will be repainted. Causes an EVT_PAINT event to be generated and sent
8746 to the window.
8747 """
5b5c9bc7 8748 return _core_.Window_Refresh(*args, **kwargs)
d55e5bfc
RD
8749
8750 def RefreshRect(*args, **kwargs):
8751 """
5b5c9bc7 8752 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
8753
8754 Redraws the contents of the given rectangle: the area inside it will
8755 be repainted. This is the same as Refresh but has a nicer syntax.
8756 """
5b5c9bc7 8757 return _core_.Window_RefreshRect(*args, **kwargs)
d55e5bfc
RD
8758
8759 def Update(*args, **kwargs):
8760 """
8761 Update(self)
8762
8763 Calling this method immediately repaints the invalidated area of the
8764 window instead of waiting for the EVT_PAINT event to happen, (normally
8765 this would usually only happen when the flow of control returns to the
8766 event loop.) Notice that this function doesn't refresh the window and
8767 does nothing if the window has been already repainted. Use Refresh
8768 first if you want to immediately redraw the window (or some portion of
8769 it) unconditionally.
8770 """
5b5c9bc7 8771 return _core_.Window_Update(*args, **kwargs)
d55e5bfc
RD
8772
8773 def ClearBackground(*args, **kwargs):
8774 """
8775 ClearBackground(self)
8776
8777 Clears the window by filling it with the current background
8778 colour. Does not cause an erase background event to be generated.
8779 """
5b5c9bc7 8780 return _core_.Window_ClearBackground(*args, **kwargs)
d55e5bfc
RD
8781
8782 def Freeze(*args, **kwargs):
8783 """
8784 Freeze(self)
8785
15817c7e
RD
8786 Freezes the window or, in other words, prevents any updates from
8787 taking place on screen, the window is not redrawn at all. Thaw must be
8788 called to reenable window redrawing. Calls to Freeze/Thaw may be
8789 nested, with the actual Thaw being delayed until all the nesting has
8790 been undone.
d55e5bfc
RD
8791
8792 This method is useful for visual appearance optimization (for example,
8793 it is a good idea to use it before inserting large amount of text into
8794 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8795 for all controls so it is mostly just a hint to wxWindows and not a
8796 mandatory directive.
8797 """
5b5c9bc7 8798 return _core_.Window_Freeze(*args, **kwargs)
d55e5bfc
RD
8799
8800 def Thaw(*args, **kwargs):
8801 """
8802 Thaw(self)
8803
8804 Reenables window updating after a previous call to Freeze. Calls to
15817c7e
RD
8805 Freeze/Thaw may be nested, so Thaw must be called the same number of
8806 times that Freeze was before the window will be updated.
d55e5bfc 8807 """
5b5c9bc7 8808 return _core_.Window_Thaw(*args, **kwargs)
d55e5bfc
RD
8809
8810 def PrepareDC(*args, **kwargs):
8811 """
5b5c9bc7 8812 PrepareDC(self, DC dc)
d55e5bfc
RD
8813
8814 Call this function to prepare the device context for drawing a
8815 scrolled image. It sets the device origin according to the current
8816 scroll position.
8817 """
5b5c9bc7 8818 return _core_.Window_PrepareDC(*args, **kwargs)
d55e5bfc
RD
8819
8820 def GetUpdateRegion(*args, **kwargs):
8821 """
5b5c9bc7 8822 GetUpdateRegion(self) -> Region
d55e5bfc
RD
8823
8824 Returns the region specifying which parts of the window have been
8825 damaged. Should only be called within an EVT_PAINT handler.
8826 """
5b5c9bc7 8827 return _core_.Window_GetUpdateRegion(*args, **kwargs)
d55e5bfc
RD
8828
8829 def GetUpdateClientRect(*args, **kwargs):
8830 """
5b5c9bc7 8831 GetUpdateClientRect(self) -> Rect
d55e5bfc
RD
8832
8833 Get the update rectangle region bounding box in client coords.
8834 """
5b5c9bc7 8835 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
d55e5bfc
RD
8836
8837 def IsExposed(*args, **kwargs):
8838 """
8839 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8840
8841 Returns true if the given point or rectangle area has been exposed
8842 since the last repaint. Call this in an paint event handler to
8843 optimize redrawing by only redrawing those areas, which have been
8844 exposed.
8845 """
5b5c9bc7 8846 return _core_.Window_IsExposed(*args, **kwargs)
d55e5bfc
RD
8847
8848 def IsExposedPoint(*args, **kwargs):
8849 """
5b5c9bc7 8850 IsExposedPoint(self, Point pt) -> bool
d55e5bfc
RD
8851
8852 Returns true if the given point or rectangle area has been exposed
8853 since the last repaint. Call this in an paint event handler to
8854 optimize redrawing by only redrawing those areas, which have been
8855 exposed.
8856 """
5b5c9bc7 8857 return _core_.Window_IsExposedPoint(*args, **kwargs)
d55e5bfc
RD
8858
8859 def IsExposedRect(*args, **kwargs):
8860 """
5b5c9bc7 8861 IsExposedRect(self, Rect rect) -> bool
d55e5bfc
RD
8862
8863 Returns true if the given point or rectangle area has been exposed
8864 since the last repaint. Call this in an paint event handler to
8865 optimize redrawing by only redrawing those areas, which have been
8866 exposed.
8867 """
5b5c9bc7 8868 return _core_.Window_IsExposedRect(*args, **kwargs)
d55e5bfc
RD
8869
8870 def GetDefaultAttributes(*args, **kwargs):
8871 """
5b5c9bc7 8872 GetDefaultAttributes(self) -> VisualAttributes
d55e5bfc 8873
15817c7e
RD
8874 Get the default attributes for an instance of this class. This is
8875 useful if you want to use the same font or colour in your own control
8876 as in a standard control -- which is a much better idea than hard
8877 coding specific colours or fonts which might look completely out of
a5ee0656 8878 place on the user's system, especially if it uses themes.
d55e5bfc 8879 """
5b5c9bc7 8880 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
8881
8882 def GetClassDefaultAttributes(*args, **kwargs):
8883 """
5b5c9bc7 8884 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 8885
15817c7e
RD
8886 Get the default attributes for this class. This is useful if you want
8887 to use the same font or colour in your own control as in a standard
8888 control -- which is a much better idea than hard coding specific
a5ee0656
RD
8889 colours or fonts which might look completely out of place on the
8890 user's system, especially if it uses themes.
d55e5bfc
RD
8891
8892 The variant parameter is only relevant under Mac currently and is
15817c7e 8893 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
8894 the returned font. See `wx.Window.SetWindowVariant` for more about
8895 this.
d55e5bfc 8896 """
5b5c9bc7 8897 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
8898
8899 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8900 def SetBackgroundColour(*args, **kwargs):
8901 """
5b5c9bc7 8902 SetBackgroundColour(self, Colour colour) -> bool
d55e5bfc
RD
8903
8904 Sets the background colour of the window. Returns True if the colour
8905 was changed. The background colour is usually painted by the default
8906 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
8907 automatically under GTK. Using `wx.NullColour` will reset the window
8908 to the default background colour.
d55e5bfc 8909
a5ee0656 8910 Note that setting the background colour may not cause an immediate
f8167d6e 8911 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
8912 calling this function.
8913
f8167d6e
RD
8914 Using this function will disable attempts to use themes for this
8915 window, if the system supports them. Use with care since usually the
8916 themes represent the appearance chosen by the user to be used for all
8917 applications on the system.
d55e5bfc 8918 """
5b5c9bc7 8919 return _core_.Window_SetBackgroundColour(*args, **kwargs)
d55e5bfc 8920
412d302d 8921 def SetOwnBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
8922 """SetOwnBackgroundColour(self, Colour colour)"""
8923 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
8924
8925 def SetForegroundColour(*args, **kwargs):
8926 """
5b5c9bc7 8927 SetForegroundColour(self, Colour colour) -> bool
d55e5bfc
RD
8928
8929 Sets the foreground colour of the window. Returns True is the colour
8930 was changed. The interpretation of foreground colour is dependent on
8931 the window class; it may be the text colour or other colour, or it may
8932 not be used at all.
8933 """
5b5c9bc7 8934 return _core_.Window_SetForegroundColour(*args, **kwargs)
d55e5bfc 8935
fa47d7a7 8936 def SetOwnForegroundColour(*args, **kwargs):
5b5c9bc7
RD
8937 """SetOwnForegroundColour(self, Colour colour)"""
8938 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
8939
8940 def GetBackgroundColour(*args, **kwargs):
8941 """
5b5c9bc7 8942 GetBackgroundColour(self) -> Colour
d55e5bfc
RD
8943
8944 Returns the background colour of the window.
8945 """
5b5c9bc7 8946 return _core_.Window_GetBackgroundColour(*args, **kwargs)
d55e5bfc
RD
8947
8948 def GetForegroundColour(*args, **kwargs):
8949 """
5b5c9bc7 8950 GetForegroundColour(self) -> Colour
d55e5bfc
RD
8951
8952 Returns the foreground colour of the window. The interpretation of
8953 foreground colour is dependent on the window class; it may be the text
8954 colour or other colour, or it may not be used at all.
8955 """
5b5c9bc7 8956 return _core_.Window_GetForegroundColour(*args, **kwargs)
d55e5bfc 8957
dcb8fc74
RD
8958 def InheritsBackgroundColour(*args, **kwargs):
8959 """InheritsBackgroundColour(self) -> bool"""
5b5c9bc7 8960 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
dcb8fc74
RD
8961
8962 def UseBgCol(*args, **kwargs):
8963 """UseBgCol(self) -> bool"""
5b5c9bc7 8964 return _core_.Window_UseBgCol(*args, **kwargs)
dcb8fc74 8965
0f63ec68
RD
8966 def SetBackgroundStyle(*args, **kwargs):
8967 """
8968 SetBackgroundStyle(self, int style) -> bool
8969
8970 Returns the background style of the window. The background style
8971 indicates how the background of the window is drawn.
8972
8973 ====================== ========================================
8974 wx.BG_STYLE_SYSTEM The background colour or pattern should
8975 be determined by the system
8976 wx.BG_STYLE_COLOUR The background should be a solid colour
8977 wx.BG_STYLE_CUSTOM The background will be implemented by the
8978 application.
8979 ====================== ========================================
8980
8981 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8982 a custom background, such as a tiled bitmap. Currently the style has
8983 no effect on other platforms.
8984
8985 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8986 """
5b5c9bc7 8987 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
0f63ec68
RD
8988
8989 def GetBackgroundStyle(*args, **kwargs):
8990 """
8991 GetBackgroundStyle(self) -> int
8992
8993 Returns the background style of the window.
8994
8995 :see: `SetBackgroundStyle`
8996 """
5b5c9bc7 8997 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
0f63ec68 8998
51b83b37
RD
8999 def HasTransparentBackground(*args, **kwargs):
9000 """
9001 HasTransparentBackground(self) -> bool
9002
9003 Returns True if this window's background is transparent (as, for
9004 example, for `wx.StaticText`) and should show the parent window's
9005 background.
9006
9007 This method is mostly used internally by the library itself and you
9008 normally shouldn't have to call it. You may, however, have to override
9009 it in your custom control classes to ensure that background is painted
9010 correctly.
9011 """
5b5c9bc7 9012 return _core_.Window_HasTransparentBackground(*args, **kwargs)
51b83b37 9013
d55e5bfc
RD
9014 def SetCursor(*args, **kwargs):
9015 """
5b5c9bc7 9016 SetCursor(self, Cursor cursor) -> bool
d55e5bfc
RD
9017
9018 Sets the window's cursor. Notice that the window cursor also sets it
9019 for the children of the window implicitly.
9020
9021 The cursor may be wx.NullCursor in which case the window cursor will
9022 be reset back to default.
9023 """
5b5c9bc7 9024 return _core_.Window_SetCursor(*args, **kwargs)
d55e5bfc
RD
9025
9026 def GetCursor(*args, **kwargs):
9027 """
5b5c9bc7 9028 GetCursor(self) -> Cursor
d55e5bfc
RD
9029
9030 Return the cursor associated with this window.
9031 """
5b5c9bc7 9032 return _core_.Window_GetCursor(*args, **kwargs)
d55e5bfc
RD
9033
9034 def SetFont(*args, **kwargs):
9035 """
5b5c9bc7 9036 SetFont(self, Font font) -> bool
d55e5bfc
RD
9037
9038 Sets the font for this window.
9039 """
5b5c9bc7 9040 return _core_.Window_SetFont(*args, **kwargs)
d55e5bfc 9041
fa47d7a7 9042 def SetOwnFont(*args, **kwargs):
5b5c9bc7
RD
9043 """SetOwnFont(self, Font font)"""
9044 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9045
9046 def GetFont(*args, **kwargs):
9047 """
5b5c9bc7 9048 GetFont(self) -> Font
d55e5bfc
RD
9049
9050 Returns the default font used for this window.
9051 """
5b5c9bc7 9052 return _core_.Window_GetFont(*args, **kwargs)
d55e5bfc
RD
9053
9054 def SetCaret(*args, **kwargs):
9055 """
5b5c9bc7 9056 SetCaret(self, Caret caret)
d55e5bfc
RD
9057
9058 Sets the caret associated with the window.
9059 """
5b5c9bc7 9060 return _core_.Window_SetCaret(*args, **kwargs)
d55e5bfc
RD
9061
9062 def GetCaret(*args, **kwargs):
9063 """
5b5c9bc7 9064 GetCaret(self) -> Caret
d55e5bfc
RD
9065
9066 Returns the caret associated with the window.
9067 """
5b5c9bc7 9068 return _core_.Window_GetCaret(*args, **kwargs)
d55e5bfc
RD
9069
9070 def GetCharHeight(*args, **kwargs):
9071 """
9072 GetCharHeight(self) -> int
9073
9074 Get the (average) character size for the current font.
9075 """
5b5c9bc7 9076 return _core_.Window_GetCharHeight(*args, **kwargs)
d55e5bfc
RD
9077
9078 def GetCharWidth(*args, **kwargs):
9079 """
9080 GetCharWidth(self) -> int
9081
9082 Get the (average) character size for the current font.
9083 """
5b5c9bc7 9084 return _core_.Window_GetCharWidth(*args, **kwargs)
d55e5bfc
RD
9085
9086 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9087 """
9088 GetTextExtent(String string) -> (width, height)
9089
9090 Get the width and height of the text using the current font.
9091 """
5b5c9bc7 9092 return _core_.Window_GetTextExtent(*args, **kwargs)
d55e5bfc
RD
9093
9094 def GetFullTextExtent(*args, **kwargs):
9095 """
9096 GetFullTextExtent(String string, Font font=None) ->
9097 (width, height, descent, externalLeading)
9098
9099 Get the width, height, decent and leading of the text using the
9100 current or specified font.
9101 """
5b5c9bc7 9102 return _core_.Window_GetFullTextExtent(*args, **kwargs)
d55e5bfc
RD
9103
9104 def ClientToScreenXY(*args, **kwargs):
9105 """
9106 ClientToScreenXY(int x, int y) -> (x,y)
9107
9108 Converts to screen coordinates from coordinates relative to this window.
9109 """
5b5c9bc7 9110 return _core_.Window_ClientToScreenXY(*args, **kwargs)
d55e5bfc
RD
9111
9112 def ScreenToClientXY(*args, **kwargs):
9113 """
9114 ScreenToClientXY(int x, int y) -> (x,y)
9115
9116 Converts from screen to client window coordinates.
9117 """
5b5c9bc7 9118 return _core_.Window_ScreenToClientXY(*args, **kwargs)
d55e5bfc
RD
9119
9120 def ClientToScreen(*args, **kwargs):
9121 """
5b5c9bc7 9122 ClientToScreen(self, Point pt) -> Point
d55e5bfc
RD
9123
9124 Converts to screen coordinates from coordinates relative to this window.
9125 """
5b5c9bc7 9126 return _core_.Window_ClientToScreen(*args, **kwargs)
d55e5bfc
RD
9127
9128 def ScreenToClient(*args, **kwargs):
9129 """
5b5c9bc7 9130 ScreenToClient(self, Point pt) -> Point
d55e5bfc
RD
9131
9132 Converts from screen to client window coordinates.
9133 """
5b5c9bc7 9134 return _core_.Window_ScreenToClient(*args, **kwargs)
d55e5bfc
RD
9135
9136 def HitTestXY(*args, **kwargs):
9137 """
9138 HitTestXY(self, int x, int y) -> int
9139
9140 Test where the given (in client coords) point lies
9141 """
5b5c9bc7 9142 return _core_.Window_HitTestXY(*args, **kwargs)
d55e5bfc
RD
9143
9144 def HitTest(*args, **kwargs):
9145 """
5b5c9bc7 9146 HitTest(self, Point pt) -> int
d55e5bfc
RD
9147
9148 Test where the given (in client coords) point lies
9149 """
5b5c9bc7 9150 return _core_.Window_HitTest(*args, **kwargs)
d55e5bfc
RD
9151
9152 def GetBorder(*args):
9153 """
9154 GetBorder(self, long flags) -> int
9155 GetBorder(self) -> int
9156
9157 Get border for the flags of this window
9158 """
5b5c9bc7 9159 return _core_.Window_GetBorder(*args)
d55e5bfc
RD
9160
9161 def UpdateWindowUI(*args, **kwargs):
9162 """
5b5c9bc7 9163 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
d55e5bfc
RD
9164
9165 This function sends EVT_UPDATE_UI events to the window. The particular
9166 implementation depends on the window; for example a wx.ToolBar will
9167 send an update UI event for each toolbar button, and a wx.Frame will
9168 send an update UI event for each menubar menu item. You can call this
9169 function from your application to ensure that your UI is up-to-date at
9170 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9171 concerned). This may be necessary if you have called
5ba5649b 9172 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9173 limit the overhead that wxWindows incurs by sending update UI events
9174 in idle time.
d55e5bfc 9175 """
5b5c9bc7 9176 return _core_.Window_UpdateWindowUI(*args, **kwargs)
d55e5bfc
RD
9177
9178 def PopupMenuXY(*args, **kwargs):
9179 """
5b5c9bc7 9180 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9181
b0503257
RD
9182 Pops up the given menu at the specified coordinates, relative to this window,
9183 and returns control when the user has dismissed the menu. If a menu item is
9184 selected, the corresponding menu event is generated and will be processed as
9185 usual. If the default position is given then the current position of the
9186 mouse cursor will be used.
d55e5bfc 9187 """
5b5c9bc7 9188 return _core_.Window_PopupMenuXY(*args, **kwargs)
d55e5bfc
RD
9189
9190 def PopupMenu(*args, **kwargs):
9191 """
5b5c9bc7 9192 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9193
b0503257
RD
9194 Pops up the given menu at the specified coordinates, relative to this window,
9195 and returns control when the user has dismissed the menu. If a menu item is
9196 selected, the corresponding menu event is generated and will be processed as
9197 usual. If the default position is given then the current position of the
9198 mouse cursor will be used.
d55e5bfc 9199 """
5b5c9bc7 9200 return _core_.Window_PopupMenu(*args, **kwargs)
d55e5bfc 9201
1eeb270e
RD
9202 def HasMultiplePages(*args, **kwargs):
9203 """HasMultiplePages(self) -> bool"""
9204 return _core_.Window_HasMultiplePages(*args, **kwargs)
9205
d55e5bfc
RD
9206 def GetHandle(*args, **kwargs):
9207 """
9208 GetHandle(self) -> long
9209
9210 Returns the platform-specific handle (as a long integer) of the
9211 physical window. Currently on wxMac it returns the handle of the
9212 toplevel parent of the window.
9213 """
5b5c9bc7 9214 return _core_.Window_GetHandle(*args, **kwargs)
d55e5bfc 9215
629e65c2
RD
9216 def AssociateHandle(*args, **kwargs):
9217 """
9218 AssociateHandle(self, long handle)
9219
9220 Associate the window with a new native handle
9221 """
5b5c9bc7 9222 return _core_.Window_AssociateHandle(*args, **kwargs)
629e65c2
RD
9223
9224 def DissociateHandle(*args, **kwargs):
9225 """
9226 DissociateHandle(self)
9227
9228 Dissociate the current native handle from the window
9229 """
5b5c9bc7 9230 return _core_.Window_DissociateHandle(*args, **kwargs)
629e65c2 9231
d55e5bfc
RD
9232 def HasScrollbar(*args, **kwargs):
9233 """
9234 HasScrollbar(self, int orient) -> bool
9235
9236 Does the window have the scrollbar for this orientation?
9237 """
5b5c9bc7 9238 return _core_.Window_HasScrollbar(*args, **kwargs)
d55e5bfc
RD
9239
9240 def SetScrollbar(*args, **kwargs):
9241 """
15817c7e 9242 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
9243 bool refresh=True)
9244
9245 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc 9246 """
5b5c9bc7 9247 return _core_.Window_SetScrollbar(*args, **kwargs)
d55e5bfc
RD
9248
9249 def SetScrollPos(*args, **kwargs):
9250 """
9251 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9252
9253 Sets the position of one of the built-in scrollbars.
9254 """
5b5c9bc7 9255 return _core_.Window_SetScrollPos(*args, **kwargs)
d55e5bfc
RD
9256
9257 def GetScrollPos(*args, **kwargs):
9258 """
9259 GetScrollPos(self, int orientation) -> int
9260
9261 Returns the built-in scrollbar position.
9262 """
5b5c9bc7 9263 return _core_.Window_GetScrollPos(*args, **kwargs)
d55e5bfc
RD
9264
9265 def GetScrollThumb(*args, **kwargs):
9266 """
9267 GetScrollThumb(self, int orientation) -> int
9268
9269 Returns the built-in scrollbar thumb size.
9270 """
5b5c9bc7 9271 return _core_.Window_GetScrollThumb(*args, **kwargs)
d55e5bfc
RD
9272
9273 def GetScrollRange(*args, **kwargs):
9274 """
9275 GetScrollRange(self, int orientation) -> int
9276
9277 Returns the built-in scrollbar range.
9278 """
5b5c9bc7 9279 return _core_.Window_GetScrollRange(*args, **kwargs)
d55e5bfc
RD
9280
9281 def ScrollWindow(*args, **kwargs):
9282 """
5b5c9bc7 9283 ScrollWindow(self, int dx, int dy, Rect rect=None)
d55e5bfc
RD
9284
9285 Physically scrolls the pixels in the window and move child windows
9286 accordingly. Use this function to optimise your scrolling
9287 implementations, to minimise the area that must be redrawn. Note that
9288 it is rarely required to call this function from a user program.
d55e5bfc 9289 """
5b5c9bc7 9290 return _core_.Window_ScrollWindow(*args, **kwargs)
d55e5bfc
RD
9291
9292 def ScrollLines(*args, **kwargs):
9293 """
9294 ScrollLines(self, int lines) -> bool
9295
9296 If the platform and window class supports it, scrolls the window by
9297 the given number of lines down, if lines is positive, or up if lines
9298 is negative. Returns True if the window was scrolled, False if it was
9299 already on top/bottom and nothing was done.
9300 """
5b5c9bc7 9301 return _core_.Window_ScrollLines(*args, **kwargs)
d55e5bfc
RD
9302
9303 def ScrollPages(*args, **kwargs):
9304 """
9305 ScrollPages(self, int pages) -> bool
9306
15817c7e 9307 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
9308 the given number of pages down, if pages is positive, or up if pages
9309 is negative. Returns True if the window was scrolled, False if it was
9310 already on top/bottom and nothing was done.
9311 """
5b5c9bc7 9312 return _core_.Window_ScrollPages(*args, **kwargs)
d55e5bfc
RD
9313
9314 def LineUp(*args, **kwargs):
9315 """
9316 LineUp(self) -> bool
9317
9318 This is just a wrapper for ScrollLines(-1).
9319 """
5b5c9bc7 9320 return _core_.Window_LineUp(*args, **kwargs)
d55e5bfc
RD
9321
9322 def LineDown(*args, **kwargs):
9323 """
9324 LineDown(self) -> bool
9325
9326 This is just a wrapper for ScrollLines(1).
9327 """
5b5c9bc7 9328 return _core_.Window_LineDown(*args, **kwargs)
d55e5bfc
RD
9329
9330 def PageUp(*args, **kwargs):
9331 """
9332 PageUp(self) -> bool
9333
9334 This is just a wrapper for ScrollPages(-1).
9335 """
5b5c9bc7 9336 return _core_.Window_PageUp(*args, **kwargs)
d55e5bfc
RD
9337
9338 def PageDown(*args, **kwargs):
9339 """
9340 PageDown(self) -> bool
9341
9342 This is just a wrapper for ScrollPages(1).
9343 """
5b5c9bc7 9344 return _core_.Window_PageDown(*args, **kwargs)
d55e5bfc
RD
9345
9346 def SetHelpText(*args, **kwargs):
9347 """
5b5c9bc7 9348 SetHelpText(self, String text)
d55e5bfc
RD
9349
9350 Sets the help text to be used as context-sensitive help for this
9351 window. Note that the text is actually stored by the current
f52cbe90 9352 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 9353 """
5b5c9bc7 9354 return _core_.Window_SetHelpText(*args, **kwargs)
d55e5bfc
RD
9355
9356 def SetHelpTextForId(*args, **kwargs):
9357 """
5b5c9bc7 9358 SetHelpTextForId(self, String text)
d55e5bfc
RD
9359
9360 Associate this help text with all windows with the same id as this
9361 one.
9362 """
5b5c9bc7 9363 return _core_.Window_SetHelpTextForId(*args, **kwargs)
d55e5bfc 9364
b850e7f3
RD
9365 def GetHelpTextAtPoint(*args, **kwargs):
9366 """
9367 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9368
9369 Get the help string associated with the given position in this window.
9370
9371 Notice that pt may be invalid if event origin is keyboard or unknown
9372 and this method should return the global window help text then
9373
9374 """
9375 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9376
d55e5bfc
RD
9377 def GetHelpText(*args, **kwargs):
9378 """
5b5c9bc7 9379 GetHelpText(self) -> String
d55e5bfc
RD
9380
9381 Gets the help text to be used as context-sensitive help for this
9382 window. Note that the text is actually stored by the current
f52cbe90 9383 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 9384 """
5b5c9bc7 9385 return _core_.Window_GetHelpText(*args, **kwargs)
d55e5bfc
RD
9386
9387 def SetToolTipString(*args, **kwargs):
9388 """
5b5c9bc7 9389 SetToolTipString(self, String tip)
d55e5bfc
RD
9390
9391 Attach a tooltip to the window.
9392 """
5b5c9bc7 9393 return _core_.Window_SetToolTipString(*args, **kwargs)
d55e5bfc
RD
9394
9395 def SetToolTip(*args, **kwargs):
9396 """
5b5c9bc7 9397 SetToolTip(self, ToolTip tip)
d55e5bfc
RD
9398
9399 Attach a tooltip to the window.
9400 """
5b5c9bc7 9401 return _core_.Window_SetToolTip(*args, **kwargs)
d55e5bfc
RD
9402
9403 def GetToolTip(*args, **kwargs):
9404 """
5b5c9bc7 9405 GetToolTip(self) -> ToolTip
d55e5bfc
RD
9406
9407 get the associated tooltip or None if none
9408 """
5b5c9bc7 9409 return _core_.Window_GetToolTip(*args, **kwargs)
d55e5bfc
RD
9410
9411 def SetDropTarget(*args, **kwargs):
9412 """
5b5c9bc7 9413 SetDropTarget(self, DropTarget dropTarget)
d55e5bfc
RD
9414
9415 Associates a drop target with this window. If the window already has
9416 a drop target, it is deleted.
9417 """
5b5c9bc7 9418 return _core_.Window_SetDropTarget(*args, **kwargs)
d55e5bfc
RD
9419
9420 def GetDropTarget(*args, **kwargs):
9421 """
5b5c9bc7 9422 GetDropTarget(self) -> DropTarget
d55e5bfc
RD
9423
9424 Returns the associated drop target, which may be None.
9425 """
5b5c9bc7 9426 return _core_.Window_GetDropTarget(*args, **kwargs)
d55e5bfc 9427
5ba5649b
RD
9428 def DragAcceptFiles(*args, **kwargs):
9429 """
9430 DragAcceptFiles(self, bool accept)
9431
9432 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9433 Only functional on Windows.
9434 """
9435 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9436
d55e5bfc
RD
9437 def SetConstraints(*args, **kwargs):
9438 """
5b5c9bc7 9439 SetConstraints(self, LayoutConstraints constraints)
d55e5bfc
RD
9440
9441 Sets the window to have the given layout constraints. If an existing
9442 layout constraints object is already owned by the window, it will be
9443 deleted. Pass None to disassociate and delete the window's current
9444 constraints.
9445
9446 You must call SetAutoLayout to tell a window to use the constraints
9447 automatically in its default EVT_SIZE handler; otherwise, you must
9448 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9449 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9450 effect.
9451 """
5b5c9bc7 9452 return _core_.Window_SetConstraints(*args, **kwargs)
d55e5bfc
RD
9453
9454 def GetConstraints(*args, **kwargs):
9455 """
5b5c9bc7 9456 GetConstraints(self) -> LayoutConstraints
d55e5bfc
RD
9457
9458 Returns a pointer to the window's layout constraints, or None if there
9459 are none.
9460 """
5b5c9bc7 9461 return _core_.Window_GetConstraints(*args, **kwargs)
d55e5bfc
RD
9462
9463 def SetAutoLayout(*args, **kwargs):
9464 """
9465 SetAutoLayout(self, bool autoLayout)
9466
9467 Determines whether the Layout function will be called automatically
b1fcee84
RD
9468 when the window is resized. lease note that this only happens for the
9469 windows usually used to contain children, namely `wx.Panel` and
9470 `wx.TopLevelWindow` (and the classes deriving from them).
9471
9472 This method is called implicitly by `SetSizer` but if you use
9473 `SetConstraints` you should call it manually or otherwise the window
9474 layout won't be correctly updated when its size changes.
d55e5bfc 9475 """
5b5c9bc7 9476 return _core_.Window_SetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9477
9478 def GetAutoLayout(*args, **kwargs):
9479 """
9480 GetAutoLayout(self) -> bool
9481
9482 Returns the current autoLayout setting
9483 """
5b5c9bc7 9484 return _core_.Window_GetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9485
9486 def Layout(*args, **kwargs):
9487 """
9488 Layout(self) -> bool
9489
9490 Invokes the constraint-based layout algorithm or the sizer-based
9491 algorithm for this window. See SetAutoLayout: when auto layout is on,
9492 this function gets called automatically by the default EVT_SIZE
9493 handler when the window is resized.
9494 """
5b5c9bc7 9495 return _core_.Window_Layout(*args, **kwargs)
d55e5bfc
RD
9496
9497 def SetSizer(*args, **kwargs):
9498 """
5b5c9bc7 9499 SetSizer(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9500
9501 Sets the window to have the given layout sizer. The window will then
9502 own the object, and will take care of its deletion. If an existing
9503 layout sizer object is already owned by the window, it will be deleted
9504 if the deleteOld parameter is true. Note that this function will also
9505 call SetAutoLayout implicitly with a True parameter if the sizer is
b411df4a 9506 non-None, and False otherwise.
d55e5bfc 9507 """
5b5c9bc7 9508 return _core_.Window_SetSizer(*args, **kwargs)
d55e5bfc
RD
9509
9510 def SetSizerAndFit(*args, **kwargs):
9511 """
5b5c9bc7 9512 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9513
9514 The same as SetSizer, except it also sets the size hints for the
9515 window based on the sizer's minimum size.
9516 """
5b5c9bc7 9517 return _core_.Window_SetSizerAndFit(*args, **kwargs)
d55e5bfc
RD
9518
9519 def GetSizer(*args, **kwargs):
9520 """
5b5c9bc7 9521 GetSizer(self) -> Sizer
d55e5bfc
RD
9522
9523 Return the sizer associated with the window by a previous call to
9524 SetSizer or None if there isn't one.
9525 """
5b5c9bc7 9526 return _core_.Window_GetSizer(*args, **kwargs)
d55e5bfc
RD
9527
9528 def SetContainingSizer(*args, **kwargs):
9529 """
5b5c9bc7 9530 SetContainingSizer(self, Sizer sizer)
d55e5bfc
RD
9531
9532 This normally does not need to be called by application code. It is
9533 called internally when a window is added to a sizer, and is used so
9534 the window can remove itself from the sizer when it is destroyed.
9535 """
5b5c9bc7 9536 return _core_.Window_SetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9537
9538 def GetContainingSizer(*args, **kwargs):
9539 """
5b5c9bc7 9540 GetContainingSizer(self) -> Sizer
d55e5bfc
RD
9541
9542 Return the sizer that this window is a member of, if any, otherwise None.
9543 """
5b5c9bc7 9544 return _core_.Window_GetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9545
9546 def InheritAttributes(*args, **kwargs):
9547 """
9548 InheritAttributes(self)
9549
15817c7e
RD
9550 This function is (or should be, in case of custom controls) called
9551 during window creation to intelligently set up the window visual
9552 attributes, that is the font and the foreground and background
9553 colours.
9554
9555 By 'intelligently' the following is meant: by default, all windows use
9556 their own default attributes. However if some of the parent's
9557 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 9558 SetOwnFont) and if the corresponding attribute hadn't been
15817c7e
RD
9559 explicitly set for this window itself, then this window takes the same
9560 value as used by the parent. In addition, if the window overrides
9561 ShouldInheritColours to return false, the colours will not be changed
9562 no matter what and only the font might.
9563
a7bb0a9d
RD
9564 This rather complicated logic is necessary in order to accommodate the
9565 different usage scenarios. The most common one is when all default
15817c7e
RD
9566 attributes are used and in this case, nothing should be inherited as
9567 in modern GUIs different controls use different fonts (and colours)
9568 than their siblings so they can't inherit the same value from the
9569 parent. However it was also deemed desirable to allow to simply change
9570 the attributes of all children at once by just changing the font or
9571 colour of their common parent, hence in this case we do inherit the
9572 parents attributes.
9573
d55e5bfc 9574 """
5b5c9bc7 9575 return _core_.Window_InheritAttributes(*args, **kwargs)
d55e5bfc
RD
9576
9577 def ShouldInheritColours(*args, **kwargs):
9578 """
9579 ShouldInheritColours(self) -> bool
9580
9581 Return true from here to allow the colours of this window to be
15817c7e
RD
9582 changed by InheritAttributes, returning false forbids inheriting them
9583 from the parent window.
d55e5bfc 9584
15817c7e
RD
9585 The base class version returns false, but this method is overridden in
9586 wxControl where it returns true.
d55e5bfc 9587 """
5b5c9bc7 9588 return _core_.Window_ShouldInheritColours(*args, **kwargs)
d55e5bfc
RD
9589
9590 def PostCreate(self, pre):
9591 """
9592 Phase 3 of the 2-phase create <wink!>
9593 Call this method after precreating the window with the 2-phase create method.
9594 """
9595 self.this = pre.this
9596 self.thisown = pre.thisown
9597 pre.thisown = 0
9598 if hasattr(self, '_setOORInfo'):
9599 self._setOORInfo(self)
9600 if hasattr(self, '_setCallbackInfo'):
9601 self._setCallbackInfo(self, self.__class__)
9602
7e08d4ef 9603 def SendSizeEvent(self):
92515dfc 9604 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
7e08d4ef 9605
2131d850 9606_core_.Window_swigregister(Window)
d55e5bfc
RD
9607
9608def PreWindow(*args, **kwargs):
9609 """
5b5c9bc7 9610 PreWindow() -> Window
d55e5bfc
RD
9611
9612 Precreate a Window for 2-phase creation.
9613 """
5b5c9bc7 9614 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
9615 return val
9616
1bd55598
RD
9617def Window_NewControlId(*args):
9618 """
5b5c9bc7 9619 Window_NewControlId() -> int
d55e5bfc
RD
9620
9621 Generate a control id for the controls which were not given one.
9622 """
1bd55598 9623 return _core_.Window_NewControlId(*args)
d55e5bfc 9624
5b5c9bc7 9625def Window_NextControlId(*args, **kwargs):
1bd55598 9626 """
5b5c9bc7 9627 Window_NextControlId(int winid) -> int
d55e5bfc
RD
9628
9629 Get the id of the control following the one with the given
15817c7e 9630 autogenerated) id
d55e5bfc 9631 """
1bd55598 9632 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc 9633
5b5c9bc7 9634def Window_PrevControlId(*args, **kwargs):
1bd55598 9635 """
5b5c9bc7 9636 Window_PrevControlId(int winid) -> int
d55e5bfc
RD
9637
9638 Get the id of the control preceding the one with the given
15817c7e 9639 autogenerated) id
d55e5bfc 9640 """
1bd55598 9641 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 9642
1bd55598
RD
9643def Window_FindFocus(*args):
9644 """
5b5c9bc7 9645 Window_FindFocus() -> Window
d55e5bfc
RD
9646
9647 Returns the window or control that currently has the keyboard focus,
9648 or None.
9649 """
1bd55598 9650 return _core_.Window_FindFocus(*args)
d55e5bfc 9651
1bd55598
RD
9652def Window_GetCapture(*args):
9653 """
5b5c9bc7 9654 Window_GetCapture() -> Window
d55e5bfc
RD
9655
9656 Returns the window which currently captures the mouse or None
9657 """
1bd55598 9658 return _core_.Window_GetCapture(*args)
d55e5bfc 9659
5b5c9bc7 9660def Window_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 9661 """
5b5c9bc7 9662 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9663
15817c7e
RD
9664 Get the default attributes for this class. This is useful if you want
9665 to use the same font or colour in your own control as in a standard
9666 control -- which is a much better idea than hard coding specific
a5ee0656
RD
9667 colours or fonts which might look completely out of place on the
9668 user's system, especially if it uses themes.
d55e5bfc
RD
9669
9670 The variant parameter is only relevant under Mac currently and is
15817c7e 9671 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
9672 the returned font. See `wx.Window.SetWindowVariant` for more about
9673 this.
d55e5bfc 9674 """
1bd55598 9675 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9676
9677def DLG_PNT(win, point_or_x, y=None):
9678 """
9679 Convenience function for converting a Point or (x,y) in
9680 dialog units to pixel units.
9681 """
9682 if y is None:
9683 return win.ConvertDialogPointToPixels(point_or_x)
9684 else:
9685 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9686
9687def DLG_SZE(win, size_width, height=None):
9688 """
9689 Convenience function for converting a Size or (w,h) in
9690 dialog units to pixel units.
9691 """
9692 if height is None:
9693 return win.ConvertDialogSizeToPixels(size_width)
9694 else:
9695 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9696
9697
5b5c9bc7 9698def FindWindowById(*args, **kwargs):
1bd55598 9699 """
5b5c9bc7 9700 FindWindowById(long id, Window parent=None) -> Window
d55e5bfc
RD
9701
9702 Find the first window in the application with the given id. If parent
9703 is None, the search will start from all top-level frames and dialog
9704 boxes; if non-None, the search will be limited to the given window
9705 hierarchy. The search is recursive in both cases.
9706 """
1bd55598 9707 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc 9708
5b5c9bc7 9709def FindWindowByName(*args, **kwargs):
1bd55598 9710 """
5b5c9bc7 9711 FindWindowByName(String name, Window parent=None) -> Window
d55e5bfc
RD
9712
9713 Find a window by its name (as given in a window constructor or Create
9714 function call). If parent is None, the search will start from all
9715 top-level frames and dialog boxes; if non-None, the search will be
9716 limited to the given window hierarchy. The search is recursive in both
9717 cases.
9718
9719 If no window with such name is found, wx.FindWindowByLabel is called.
9720 """
1bd55598 9721 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc 9722
5b5c9bc7 9723def FindWindowByLabel(*args, **kwargs):
1bd55598 9724 """
5b5c9bc7 9725 FindWindowByLabel(String label, Window parent=None) -> Window
d55e5bfc
RD
9726
9727 Find a window by its label. Depending on the type of window, the label
9728 may be a window title or panel item label. If parent is None, the
9729 search will start from all top-level frames and dialog boxes; if
9730 non-None, the search will be limited to the given window
9731 hierarchy. The search is recursive in both cases.
9732 """
1bd55598 9733 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc 9734
5b5c9bc7 9735def Window_FromHWND(*args, **kwargs):
1bd55598
RD
9736 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9737 return _core_.Window_FromHWND(*args, **kwargs)
3215336e 9738
1bd55598
RD
9739def GetTopLevelWindows(*args):
9740 """
3215336e
RD
9741 GetTopLevelWindows() -> PyObject
9742
9743 Returns a list of the the application's top-level windows, (frames,
9744 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9745 by wxWidgets, and so it is only valid as long as no top-level windows
9746 are closed or new top-level windows are created.
9747
9748 """
1bd55598 9749 return _core_.GetTopLevelWindows(*args)
d55e5bfc
RD
9750#---------------------------------------------------------------------------
9751
5b5c9bc7
RD
9752class Validator(EvtHandler):
9753 """Proxy of C++ Validator class"""
1bd55598
RD
9754 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9755 __repr__ = _swig_repr
9756 def __init__(self, *args, **kwargs):
5b5c9bc7 9757 """__init__(self) -> Validator"""
1bd55598 9758 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d55e5bfc
RD
9759 self._setOORInfo(self)
9760
9761 def Clone(*args, **kwargs):
5b5c9bc7
RD
9762 """Clone(self) -> Validator"""
9763 return _core_.Validator_Clone(*args, **kwargs)
d55e5bfc
RD
9764
9765 def Validate(*args, **kwargs):
5b5c9bc7
RD
9766 """Validate(self, Window parent) -> bool"""
9767 return _core_.Validator_Validate(*args, **kwargs)
d55e5bfc
RD
9768
9769 def TransferToWindow(*args, **kwargs):
9770 """TransferToWindow(self) -> bool"""
5b5c9bc7 9771 return _core_.Validator_TransferToWindow(*args, **kwargs)
d55e5bfc
RD
9772
9773 def TransferFromWindow(*args, **kwargs):
9774 """TransferFromWindow(self) -> bool"""
5b5c9bc7 9775 return _core_.Validator_TransferFromWindow(*args, **kwargs)
d55e5bfc
RD
9776
9777 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
9778 """GetWindow(self) -> Window"""
9779 return _core_.Validator_GetWindow(*args, **kwargs)
d55e5bfc
RD
9780
9781 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
9782 """SetWindow(self, Window window)"""
9783 return _core_.Validator_SetWindow(*args, **kwargs)
d55e5bfc
RD
9784
9785 def IsSilent(*args, **kwargs):
d6c14a4c 9786 """IsSilent() -> bool"""
5b5c9bc7 9787 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc
RD
9788
9789 IsSilent = staticmethod(IsSilent)
9790 def SetBellOnError(*args, **kwargs):
d6c14a4c 9791 """SetBellOnError(int doIt=True)"""
5b5c9bc7 9792 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
9793
9794 SetBellOnError = staticmethod(SetBellOnError)
2131d850 9795_core_.Validator_swigregister(Validator)
d55e5bfc 9796
1bd55598
RD
9797def Validator_IsSilent(*args):
9798 """Validator_IsSilent() -> bool"""
9799 return _core_.Validator_IsSilent(*args)
d55e5bfc 9800
5b5c9bc7 9801def Validator_SetBellOnError(*args, **kwargs):
1bd55598
RD
9802 """Validator_SetBellOnError(int doIt=True)"""
9803 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc 9804
5b5c9bc7
RD
9805class PyValidator(Validator):
9806 """Proxy of C++ PyValidator class"""
1bd55598
RD
9807 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9808 __repr__ = _swig_repr
9809 def __init__(self, *args, **kwargs):
5b5c9bc7 9810 """__init__(self) -> PyValidator"""
1bd55598 9811 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
d55e5bfc
RD
9812
9813 self._setCallbackInfo(self, PyValidator, 1)
9814 self._setOORInfo(self)
9815
9816 def _setCallbackInfo(*args, **kwargs):
9817 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
5b5c9bc7 9818 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
d55e5bfc 9819
2131d850 9820_core_.PyValidator_swigregister(PyValidator)
d55e5bfc
RD
9821
9822#---------------------------------------------------------------------------
9823
5b5c9bc7
RD
9824class Menu(EvtHandler):
9825 """Proxy of C++ Menu class"""
1bd55598
RD
9826 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9827 __repr__ = _swig_repr
9828 def __init__(self, *args, **kwargs):
5b5c9bc7 9829 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
1bd55598 9830 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
d55e5bfc
RD
9831 self._setOORInfo(self)
9832
9833 def Append(*args, **kwargs):
5b5c9bc7
RD
9834 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9835 return _core_.Menu_Append(*args, **kwargs)
d55e5bfc
RD
9836
9837 def AppendSeparator(*args, **kwargs):
5b5c9bc7
RD
9838 """AppendSeparator(self) -> MenuItem"""
9839 return _core_.Menu_AppendSeparator(*args, **kwargs)
d55e5bfc
RD
9840
9841 def AppendCheckItem(*args, **kwargs):
5b5c9bc7
RD
9842 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9843 return _core_.Menu_AppendCheckItem(*args, **kwargs)
d55e5bfc
RD
9844
9845 def AppendRadioItem(*args, **kwargs):
5b5c9bc7
RD
9846 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9847 return _core_.Menu_AppendRadioItem(*args, **kwargs)
d55e5bfc
RD
9848
9849 def AppendMenu(*args, **kwargs):
5b5c9bc7
RD
9850 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9851 return _core_.Menu_AppendMenu(*args, **kwargs)
d55e5bfc 9852
da91cb0f
RD
9853 def AppendSubMenu(*args, **kwargs):
9854 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9855 return _core_.Menu_AppendSubMenu(*args, **kwargs)
9856
d55e5bfc 9857 def AppendItem(*args, **kwargs):
5b5c9bc7
RD
9858 """AppendItem(self, MenuItem item) -> MenuItem"""
9859 return _core_.Menu_AppendItem(*args, **kwargs)
d55e5bfc 9860
d55e5bfc 9861 def InsertItem(*args, **kwargs):
5b5c9bc7
RD
9862 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9863 return _core_.Menu_InsertItem(*args, **kwargs)
d55e5bfc 9864
1bd55598
RD
9865 def PrependItem(*args, **kwargs):
9866 """PrependItem(self, MenuItem item) -> MenuItem"""
9867 return _core_.Menu_PrependItem(*args, **kwargs)
9868
9869 def Break(*args, **kwargs):
9870 """Break(self)"""
9871 return _core_.Menu_Break(*args, **kwargs)
9872
d55e5bfc
RD
9873 def Insert(*args, **kwargs):
9874 """
5b5c9bc7
RD
9875 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9876 int kind=ITEM_NORMAL) -> MenuItem
d55e5bfc 9877 """
5b5c9bc7 9878 return _core_.Menu_Insert(*args, **kwargs)
d55e5bfc
RD
9879
9880 def InsertSeparator(*args, **kwargs):
5b5c9bc7
RD
9881 """InsertSeparator(self, size_t pos) -> MenuItem"""
9882 return _core_.Menu_InsertSeparator(*args, **kwargs)
d55e5bfc
RD
9883
9884 def InsertCheckItem(*args, **kwargs):
5b5c9bc7
RD
9885 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9886 return _core_.Menu_InsertCheckItem(*args, **kwargs)
d55e5bfc
RD
9887
9888 def InsertRadioItem(*args, **kwargs):
5b5c9bc7
RD
9889 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9890 return _core_.Menu_InsertRadioItem(*args, **kwargs)
d55e5bfc
RD
9891
9892 def InsertMenu(*args, **kwargs):
5b5c9bc7
RD
9893 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9894 return _core_.Menu_InsertMenu(*args, **kwargs)
d55e5bfc 9895
d55e5bfc 9896 def Prepend(*args, **kwargs):
5b5c9bc7
RD
9897 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9898 return _core_.Menu_Prepend(*args, **kwargs)
d55e5bfc
RD
9899
9900 def PrependSeparator(*args, **kwargs):
5b5c9bc7
RD
9901 """PrependSeparator(self) -> MenuItem"""
9902 return _core_.Menu_PrependSeparator(*args, **kwargs)
d55e5bfc
RD
9903
9904 def PrependCheckItem(*args, **kwargs):
5b5c9bc7
RD
9905 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9906 return _core_.Menu_PrependCheckItem(*args, **kwargs)
d55e5bfc
RD
9907
9908 def PrependRadioItem(*args, **kwargs):
5b5c9bc7
RD
9909 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9910 return _core_.Menu_PrependRadioItem(*args, **kwargs)
d55e5bfc
RD
9911
9912 def PrependMenu(*args, **kwargs):
5b5c9bc7
RD
9913 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9914 return _core_.Menu_PrependMenu(*args, **kwargs)
d55e5bfc
RD
9915
9916 def Remove(*args, **kwargs):
5b5c9bc7
RD
9917 """Remove(self, int id) -> MenuItem"""
9918 return _core_.Menu_Remove(*args, **kwargs)
d55e5bfc
RD
9919
9920 def RemoveItem(*args, **kwargs):
5b5c9bc7
RD
9921 """RemoveItem(self, MenuItem item) -> MenuItem"""
9922 return _core_.Menu_RemoveItem(*args, **kwargs)
d55e5bfc
RD
9923
9924 def Delete(*args, **kwargs):
9925 """Delete(self, int id) -> bool"""
5b5c9bc7 9926 return _core_.Menu_Delete(*args, **kwargs)
d55e5bfc
RD
9927
9928 def DeleteItem(*args, **kwargs):
5b5c9bc7
RD
9929 """DeleteItem(self, MenuItem item) -> bool"""
9930 return _core_.Menu_DeleteItem(*args, **kwargs)
d55e5bfc
RD
9931
9932 def Destroy(*args, **kwargs):
9933 """
9934 Destroy(self)
9935
9936 Deletes the C++ object this Python object is a proxy for.
9937 """
7e08d4ef
RD
9938 val = _core_.Menu_Destroy(*args, **kwargs)
9939 args[0].thisown = 0
9940 return val
d55e5bfc
RD
9941
9942 def DestroyId(*args, **kwargs):
9943 """
9944 DestroyId(self, int id) -> bool
9945
9946 Deletes the C++ object this Python object is a proxy for.
9947 """
7e08d4ef
RD
9948 val = _core_.Menu_DestroyId(*args, **kwargs)
9949 args[0].thisown = 0
9950 return val
d55e5bfc
RD
9951
9952 def DestroyItem(*args, **kwargs):
9953 """
5b5c9bc7 9954 DestroyItem(self, MenuItem item) -> bool
d55e5bfc
RD
9955
9956 Deletes the C++ object this Python object is a proxy for.
9957 """
7e08d4ef
RD
9958 val = _core_.Menu_DestroyItem(*args, **kwargs)
9959 args[0].thisown = 0
9960 return val
d55e5bfc
RD
9961
9962 def GetMenuItemCount(*args, **kwargs):
9963 """GetMenuItemCount(self) -> size_t"""
5b5c9bc7 9964 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
d55e5bfc
RD
9965
9966 def GetMenuItems(*args, **kwargs):
9967 """GetMenuItems(self) -> PyObject"""
5b5c9bc7 9968 return _core_.Menu_GetMenuItems(*args, **kwargs)
d55e5bfc
RD
9969
9970 def FindItem(*args, **kwargs):
5b5c9bc7
RD
9971 """FindItem(self, String item) -> int"""
9972 return _core_.Menu_FindItem(*args, **kwargs)
d55e5bfc
RD
9973
9974 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
9975 """FindItemById(self, int id) -> MenuItem"""
9976 return _core_.Menu_FindItemById(*args, **kwargs)
d55e5bfc
RD
9977
9978 def FindItemByPosition(*args, **kwargs):
5b5c9bc7
RD
9979 """FindItemByPosition(self, size_t position) -> MenuItem"""
9980 return _core_.Menu_FindItemByPosition(*args, **kwargs)
d55e5bfc
RD
9981
9982 def Enable(*args, **kwargs):
9983 """Enable(self, int id, bool enable)"""
5b5c9bc7 9984 return _core_.Menu_Enable(*args, **kwargs)
d55e5bfc
RD
9985
9986 def IsEnabled(*args, **kwargs):
9987 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 9988 return _core_.Menu_IsEnabled(*args, **kwargs)
d55e5bfc
RD
9989
9990 def Check(*args, **kwargs):
9991 """Check(self, int id, bool check)"""
5b5c9bc7 9992 return _core_.Menu_Check(*args, **kwargs)
d55e5bfc
RD
9993
9994 def IsChecked(*args, **kwargs):
9995 """IsChecked(self, int id) -> bool"""
5b5c9bc7 9996 return _core_.Menu_IsChecked(*args, **kwargs)
d55e5bfc
RD
9997
9998 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
9999 """SetLabel(self, int id, String label)"""
10000 return _core_.Menu_SetLabel(*args, **kwargs)
d55e5bfc
RD
10001
10002 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10003 """GetLabel(self, int id) -> String"""
10004 return _core_.Menu_GetLabel(*args, **kwargs)
d55e5bfc
RD
10005
10006 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10007 """SetHelpString(self, int id, String helpString)"""
10008 return _core_.Menu_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10009
10010 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10011 """GetHelpString(self, int id) -> String"""
10012 return _core_.Menu_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10013
10014 def SetTitle(*args, **kwargs):
5b5c9bc7
RD
10015 """SetTitle(self, String title)"""
10016 return _core_.Menu_SetTitle(*args, **kwargs)
d55e5bfc
RD
10017
10018 def GetTitle(*args, **kwargs):
5b5c9bc7
RD
10019 """GetTitle(self) -> String"""
10020 return _core_.Menu_GetTitle(*args, **kwargs)
d55e5bfc
RD
10021
10022 def SetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10023 """SetEventHandler(self, EvtHandler handler)"""
10024 return _core_.Menu_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
10025
10026 def GetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10027 """GetEventHandler(self) -> EvtHandler"""
10028 return _core_.Menu_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
10029
10030 def SetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10031 """SetInvokingWindow(self, Window win)"""
10032 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10033
10034 def GetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10035 """GetInvokingWindow(self) -> Window"""
10036 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10037
10038 def GetStyle(*args, **kwargs):
10039 """GetStyle(self) -> long"""
5b5c9bc7 10040 return _core_.Menu_GetStyle(*args, **kwargs)
d55e5bfc
RD
10041
10042 def UpdateUI(*args, **kwargs):
5b5c9bc7
RD
10043 """UpdateUI(self, EvtHandler source=None)"""
10044 return _core_.Menu_UpdateUI(*args, **kwargs)
d55e5bfc
RD
10045
10046 def GetMenuBar(*args, **kwargs):
5b5c9bc7
RD
10047 """GetMenuBar(self) -> MenuBar"""
10048 return _core_.Menu_GetMenuBar(*args, **kwargs)
d55e5bfc
RD
10049
10050 def Attach(*args, **kwargs):
10051 """Attach(self, wxMenuBarBase menubar)"""
5b5c9bc7 10052 return _core_.Menu_Attach(*args, **kwargs)
d55e5bfc
RD
10053
10054 def Detach(*args, **kwargs):
10055 """Detach(self)"""
5b5c9bc7 10056 return _core_.Menu_Detach(*args, **kwargs)
d55e5bfc
RD
10057
10058 def IsAttached(*args, **kwargs):
10059 """IsAttached(self) -> bool"""
5b5c9bc7 10060 return _core_.Menu_IsAttached(*args, **kwargs)
d55e5bfc
RD
10061
10062 def SetParent(*args, **kwargs):
5b5c9bc7
RD
10063 """SetParent(self, Menu parent)"""
10064 return _core_.Menu_SetParent(*args, **kwargs)
d55e5bfc
RD
10065
10066 def GetParent(*args, **kwargs):
5b5c9bc7
RD
10067 """GetParent(self) -> Menu"""
10068 return _core_.Menu_GetParent(*args, **kwargs)
d55e5bfc 10069
2131d850 10070_core_.Menu_swigregister(Menu)
5b5c9bc7 10071DefaultValidator = cvar.DefaultValidator
d55e5bfc
RD
10072
10073#---------------------------------------------------------------------------
10074
5b5c9bc7
RD
10075class MenuBar(Window):
10076 """Proxy of C++ MenuBar class"""
1bd55598
RD
10077 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10078 __repr__ = _swig_repr
10079 def __init__(self, *args, **kwargs):
5b5c9bc7 10080 """__init__(self, long style=0) -> MenuBar"""
1bd55598 10081 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d55e5bfc
RD
10082 self._setOORInfo(self)
10083
10084 def Append(*args, **kwargs):
5b5c9bc7
RD
10085 """Append(self, Menu menu, String title) -> bool"""
10086 return _core_.MenuBar_Append(*args, **kwargs)
d55e5bfc
RD
10087
10088 def Insert(*args, **kwargs):
5b5c9bc7
RD
10089 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10090 return _core_.MenuBar_Insert(*args, **kwargs)
d55e5bfc
RD
10091
10092 def GetMenuCount(*args, **kwargs):
10093 """GetMenuCount(self) -> size_t"""
5b5c9bc7 10094 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
d55e5bfc
RD
10095
10096 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10097 """GetMenu(self, size_t pos) -> Menu"""
10098 return _core_.MenuBar_GetMenu(*args, **kwargs)
d55e5bfc
RD
10099
10100 def Replace(*args, **kwargs):
5b5c9bc7
RD
10101 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10102 return _core_.MenuBar_Replace(*args, **kwargs)
d55e5bfc
RD
10103
10104 def Remove(*args, **kwargs):
5b5c9bc7
RD
10105 """Remove(self, size_t pos) -> Menu"""
10106 return _core_.MenuBar_Remove(*args, **kwargs)
d55e5bfc
RD
10107
10108 def EnableTop(*args, **kwargs):
10109 """EnableTop(self, size_t pos, bool enable)"""
5b5c9bc7 10110 return _core_.MenuBar_EnableTop(*args, **kwargs)
d55e5bfc
RD
10111
10112 def IsEnabledTop(*args, **kwargs):
10113 """IsEnabledTop(self, size_t pos) -> bool"""
5b5c9bc7 10114 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
d55e5bfc
RD
10115
10116 def SetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10117 """SetLabelTop(self, size_t pos, String label)"""
10118 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
d55e5bfc
RD
10119
10120 def GetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10121 """GetLabelTop(self, size_t pos) -> String"""
10122 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
d55e5bfc
RD
10123
10124 def FindMenuItem(*args, **kwargs):
5b5c9bc7
RD
10125 """FindMenuItem(self, String menu, String item) -> int"""
10126 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
d55e5bfc
RD
10127
10128 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10129 """FindItemById(self, int id) -> MenuItem"""
10130 return _core_.MenuBar_FindItemById(*args, **kwargs)
d55e5bfc
RD
10131
10132 def FindMenu(*args, **kwargs):
5b5c9bc7
RD
10133 """FindMenu(self, String title) -> int"""
10134 return _core_.MenuBar_FindMenu(*args, **kwargs)
d55e5bfc
RD
10135
10136 def Enable(*args, **kwargs):
10137 """Enable(self, int id, bool enable)"""
5b5c9bc7 10138 return _core_.MenuBar_Enable(*args, **kwargs)
d55e5bfc
RD
10139
10140 def Check(*args, **kwargs):
10141 """Check(self, int id, bool check)"""
5b5c9bc7 10142 return _core_.MenuBar_Check(*args, **kwargs)
d55e5bfc
RD
10143
10144 def IsChecked(*args, **kwargs):
10145 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10146 return _core_.MenuBar_IsChecked(*args, **kwargs)
d55e5bfc
RD
10147
10148 def IsEnabled(*args, **kwargs):
10149 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10150 return _core_.MenuBar_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10151
10152 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10153 """SetLabel(self, int id, String label)"""
10154 return _core_.MenuBar_SetLabel(*args, **kwargs)
d55e5bfc
RD
10155
10156 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10157 """GetLabel(self, int id) -> String"""
10158 return _core_.MenuBar_GetLabel(*args, **kwargs)
d55e5bfc
RD
10159
10160 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10161 """SetHelpString(self, int id, String helpString)"""
10162 return _core_.MenuBar_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10163
10164 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10165 """GetHelpString(self, int id) -> String"""
10166 return _core_.MenuBar_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10167
10168 def GetFrame(*args, **kwargs):
10169 """GetFrame(self) -> wxFrame"""
5b5c9bc7 10170 return _core_.MenuBar_GetFrame(*args, **kwargs)
d55e5bfc
RD
10171
10172 def IsAttached(*args, **kwargs):
10173 """IsAttached(self) -> bool"""
5b5c9bc7 10174 return _core_.MenuBar_IsAttached(*args, **kwargs)
d55e5bfc
RD
10175
10176 def Attach(*args, **kwargs):
10177 """Attach(self, wxFrame frame)"""
5b5c9bc7 10178 return _core_.MenuBar_Attach(*args, **kwargs)
d55e5bfc
RD
10179
10180 def Detach(*args, **kwargs):
10181 """Detach(self)"""
5b5c9bc7 10182 return _core_.MenuBar_Detach(*args, **kwargs)
d55e5bfc 10183
587d0f36
RD
10184 def UpdateMenus(*args, **kwargs):
10185 """UpdateMenus(self)"""
10186 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
10187
4f433fef
RD
10188 def SetAutoWindowMenu(*args, **kwargs):
10189 """SetAutoWindowMenu(bool enable)"""
10190 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10191
10192 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10193 def GetAutoWindowMenu(*args, **kwargs):
10194 """GetAutoWindowMenu() -> bool"""
10195 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10196
10197 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
2131d850 10198_core_.MenuBar_swigregister(MenuBar)
d55e5bfc 10199
4f433fef 10200def MenuBar_SetAutoWindowMenu(*args, **kwargs):
1bd55598
RD
10201 """MenuBar_SetAutoWindowMenu(bool enable)"""
10202 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 10203
1bd55598
RD
10204def MenuBar_GetAutoWindowMenu(*args):
10205 """MenuBar_GetAutoWindowMenu() -> bool"""
10206 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 10207
d55e5bfc
RD
10208#---------------------------------------------------------------------------
10209
5b5c9bc7
RD
10210class MenuItem(Object):
10211 """Proxy of C++ MenuItem class"""
1bd55598
RD
10212 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10213 __repr__ = _swig_repr
10214 def __init__(self, *args, **kwargs):
d55e5bfc 10215 """
5b5c9bc7
RD
10216 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10217 String help=EmptyString, int kind=ITEM_NORMAL,
10218 Menu subMenu=None) -> MenuItem
d55e5bfc 10219 """
1bd55598
RD
10220 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10221 __swig_destroy__ = _core_.delete_MenuItem
10222 __del__ = lambda self : None;
d55e5bfc 10223 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10224 """GetMenu(self) -> Menu"""
10225 return _core_.MenuItem_GetMenu(*args, **kwargs)
d55e5bfc
RD
10226
10227 def SetMenu(*args, **kwargs):
5b5c9bc7
RD
10228 """SetMenu(self, Menu menu)"""
10229 return _core_.MenuItem_SetMenu(*args, **kwargs)
d55e5bfc
RD
10230
10231 def SetId(*args, **kwargs):
10232 """SetId(self, int id)"""
5b5c9bc7 10233 return _core_.MenuItem_SetId(*args, **kwargs)
d55e5bfc
RD
10234
10235 def GetId(*args, **kwargs):
10236 """GetId(self) -> int"""
5b5c9bc7 10237 return _core_.MenuItem_GetId(*args, **kwargs)
d55e5bfc
RD
10238
10239 def IsSeparator(*args, **kwargs):
10240 """IsSeparator(self) -> bool"""
5b5c9bc7 10241 return _core_.MenuItem_IsSeparator(*args, **kwargs)
d55e5bfc
RD
10242
10243 def SetText(*args, **kwargs):
5b5c9bc7
RD
10244 """SetText(self, String str)"""
10245 return _core_.MenuItem_SetText(*args, **kwargs)
d55e5bfc
RD
10246
10247 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10248 """GetLabel(self) -> String"""
10249 return _core_.MenuItem_GetLabel(*args, **kwargs)
d55e5bfc
RD
10250
10251 def GetText(*args, **kwargs):
5b5c9bc7
RD
10252 """GetText(self) -> String"""
10253 return _core_.MenuItem_GetText(*args, **kwargs)
d55e5bfc
RD
10254
10255 def GetLabelFromText(*args, **kwargs):
5b5c9bc7
RD
10256 """GetLabelFromText(String text) -> String"""
10257 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc
RD
10258
10259 GetLabelFromText = staticmethod(GetLabelFromText)
10260 def GetKind(*args, **kwargs):
10261 """GetKind(self) -> int"""
5b5c9bc7 10262 return _core_.MenuItem_GetKind(*args, **kwargs)
d55e5bfc
RD
10263
10264 def SetKind(*args, **kwargs):
10265 """SetKind(self, int kind)"""
5b5c9bc7 10266 return _core_.MenuItem_SetKind(*args, **kwargs)
d55e5bfc
RD
10267
10268 def SetCheckable(*args, **kwargs):
10269 """SetCheckable(self, bool checkable)"""
5b5c9bc7 10270 return _core_.MenuItem_SetCheckable(*args, **kwargs)
d55e5bfc
RD
10271
10272 def IsCheckable(*args, **kwargs):
10273 """IsCheckable(self) -> bool"""
5b5c9bc7 10274 return _core_.MenuItem_IsCheckable(*args, **kwargs)
d55e5bfc
RD
10275
10276 def IsSubMenu(*args, **kwargs):
10277 """IsSubMenu(self) -> bool"""
5b5c9bc7 10278 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
d55e5bfc
RD
10279
10280 def SetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10281 """SetSubMenu(self, Menu menu)"""
10282 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
d55e5bfc
RD
10283
10284 def GetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10285 """GetSubMenu(self) -> Menu"""
10286 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
d55e5bfc
RD
10287
10288 def Enable(*args, **kwargs):
10289 """Enable(self, bool enable=True)"""
5b5c9bc7 10290 return _core_.MenuItem_Enable(*args, **kwargs)
d55e5bfc
RD
10291
10292 def IsEnabled(*args, **kwargs):
10293 """IsEnabled(self) -> bool"""
5b5c9bc7 10294 return _core_.MenuItem_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10295
10296 def Check(*args, **kwargs):
10297 """Check(self, bool check=True)"""
5b5c9bc7 10298 return _core_.MenuItem_Check(*args, **kwargs)
d55e5bfc
RD
10299
10300 def IsChecked(*args, **kwargs):
10301 """IsChecked(self) -> bool"""
5b5c9bc7 10302 return _core_.MenuItem_IsChecked(*args, **kwargs)
d55e5bfc
RD
10303
10304 def Toggle(*args, **kwargs):
10305 """Toggle(self)"""
5b5c9bc7 10306 return _core_.MenuItem_Toggle(*args, **kwargs)
d55e5bfc
RD
10307
10308 def SetHelp(*args, **kwargs):
5b5c9bc7
RD
10309 """SetHelp(self, String str)"""
10310 return _core_.MenuItem_SetHelp(*args, **kwargs)
d55e5bfc
RD
10311
10312 def GetHelp(*args, **kwargs):
5b5c9bc7
RD
10313 """GetHelp(self) -> String"""
10314 return _core_.MenuItem_GetHelp(*args, **kwargs)
d55e5bfc
RD
10315
10316 def GetAccel(*args, **kwargs):
5b5c9bc7
RD
10317 """GetAccel(self) -> AcceleratorEntry"""
10318 return _core_.MenuItem_GetAccel(*args, **kwargs)
d55e5bfc
RD
10319
10320 def SetAccel(*args, **kwargs):
5b5c9bc7
RD
10321 """SetAccel(self, AcceleratorEntry accel)"""
10322 return _core_.MenuItem_SetAccel(*args, **kwargs)
d55e5bfc 10323
32fe5131
RD
10324 def SetBitmap(*args, **kwargs):
10325 """SetBitmap(self, Bitmap bitmap)"""
10326 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10327
10328 def GetBitmap(*args, **kwargs):
10329 """GetBitmap(self) -> Bitmap"""
10330 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10331
c1280d1e 10332 def SetFont(*args, **kwargs):
5b5c9bc7
RD
10333 """SetFont(self, Font font)"""
10334 return _core_.MenuItem_SetFont(*args, **kwargs)
c1280d1e
RD
10335
10336 def GetFont(*args, **kwargs):
5b5c9bc7
RD
10337 """GetFont(self) -> Font"""
10338 return _core_.MenuItem_GetFont(*args, **kwargs)
c1280d1e
RD
10339
10340 def SetTextColour(*args, **kwargs):
5b5c9bc7
RD
10341 """SetTextColour(self, Colour colText)"""
10342 return _core_.MenuItem_SetTextColour(*args, **kwargs)
c1280d1e
RD
10343
10344 def GetTextColour(*args, **kwargs):
5b5c9bc7
RD
10345 """GetTextColour(self) -> Colour"""
10346 return _core_.MenuItem_GetTextColour(*args, **kwargs)
c1280d1e
RD
10347
10348 def SetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10349 """SetBackgroundColour(self, Colour colBack)"""
10350 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10351
10352 def GetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10353 """GetBackgroundColour(self) -> Colour"""
10354 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10355
10356 def SetBitmaps(*args, **kwargs):
5b5c9bc7
RD
10357 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10358 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
c1280d1e
RD
10359
10360 def SetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10361 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10362 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10363
10364 def GetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10365 """GetDisabledBitmap(self) -> Bitmap"""
10366 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10367
10368 def SetMarginWidth(*args, **kwargs):
10369 """SetMarginWidth(self, int nWidth)"""
5b5c9bc7 10370 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
c1280d1e
RD
10371
10372 def GetMarginWidth(*args, **kwargs):
10373 """GetMarginWidth(self) -> int"""
5b5c9bc7 10374 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
c1280d1e 10375
d55e5bfc 10376 def GetDefaultMarginWidth(*args, **kwargs):
d6c14a4c 10377 """GetDefaultMarginWidth() -> int"""
5b5c9bc7 10378 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
10379
10380 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10381 def IsOwnerDrawn(*args, **kwargs):
10382 """IsOwnerDrawn(self) -> bool"""
5b5c9bc7 10383 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10384
10385 def SetOwnerDrawn(*args, **kwargs):
10386 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
5b5c9bc7 10387 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10388
10389 def ResetOwnerDrawn(*args, **kwargs):
10390 """ResetOwnerDrawn(self)"""
5b5c9bc7 10391 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
c1280d1e 10392
2131d850 10393_core_.MenuItem_swigregister(MenuItem)
d55e5bfc 10394
5b5c9bc7 10395def MenuItem_GetLabelFromText(*args, **kwargs):
1bd55598
RD
10396 """MenuItem_GetLabelFromText(String text) -> String"""
10397 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 10398
1bd55598
RD
10399def MenuItem_GetDefaultMarginWidth(*args):
10400 """MenuItem_GetDefaultMarginWidth() -> int"""
10401 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d55e5bfc
RD
10402
10403#---------------------------------------------------------------------------
10404
5b5c9bc7 10405class Control(Window):
d55e5bfc
RD
10406 """
10407 This is the base class for a control or 'widget'.
10408
15817c7e
RD
10409 A control is generally a small window which processes user input
10410 and/or displays one or more item of data.
d55e5bfc 10411 """
1bd55598
RD
10412 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10413 __repr__ = _swig_repr
10414 def __init__(self, *args, **kwargs):
d55e5bfc 10415 """
5b5c9bc7
RD
10416 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10417 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10418 String name=ControlNameStr) -> Control
d55e5bfc 10419
15817c7e
RD
10420 Create a Control. Normally you should only call this from a subclass'
10421 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 10422 """
1bd55598 10423 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d55e5bfc
RD
10424 self._setOORInfo(self)
10425
10426 def Create(*args, **kwargs):
10427 """
5b5c9bc7
RD
10428 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10429 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10430 String name=ControlNameStr) -> bool
d55e5bfc
RD
10431
10432 Do the 2nd phase and create the GUI control.
10433 """
5b5c9bc7 10434 return _core_.Control_Create(*args, **kwargs)
d55e5bfc 10435
1eeb270e
RD
10436 def GetAlignment(*args, **kwargs):
10437 """
10438 GetAlignment(self) -> int
10439
10440 Get the control alignment (left/right/centre, top/bottom/centre)
10441 """
10442 return _core_.Control_GetAlignment(*args, **kwargs)
10443
34e0a3bb 10444 def GetLabelText(*args, **kwargs):
1eeb270e 10445 """
1eeb270e
RD
10446 GetLabelText(self) -> String
10447
10448 Get just the text of the label, without mnemonic characters ('&')
10449 """
34e0a3bb 10450 return _core_.Control_GetLabelText(*args, **kwargs)
1eeb270e 10451
d55e5bfc
RD
10452 def Command(*args, **kwargs):
10453 """
5b5c9bc7 10454 Command(self, CommandEvent event)
d55e5bfc 10455
15817c7e
RD
10456 Simulates the effect of the user issuing a command to the item.
10457
10458 :see: `wx.CommandEvent`
10459
d55e5bfc 10460 """
5b5c9bc7 10461 return _core_.Control_Command(*args, **kwargs)
d55e5bfc
RD
10462
10463 def GetLabel(*args, **kwargs):
10464 """
5b5c9bc7 10465 GetLabel(self) -> String
d55e5bfc
RD
10466
10467 Return a control's text.
10468 """
5b5c9bc7 10469 return _core_.Control_GetLabel(*args, **kwargs)
d55e5bfc 10470
d55e5bfc 10471 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0 10472 """
5b5c9bc7 10473 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
10474
10475 Get the default attributes for this class. This is useful if you want
10476 to use the same font or colour in your own control as in a standard
10477 control -- which is a much better idea than hard coding specific
10478 colours or fonts which might look completely out of place on the
10479 user's system, especially if it uses themes.
10480
10481 The variant parameter is only relevant under Mac currently and is
10482 ignore under other platforms. Under Mac, it will change the size of
10483 the returned font. See `wx.Window.SetWindowVariant` for more about
10484 this.
10485 """
5b5c9bc7 10486 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10487
10488 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2131d850 10489_core_.Control_swigregister(Control)
d55e5bfc
RD
10490ControlNameStr = cvar.ControlNameStr
10491
10492def PreControl(*args, **kwargs):
10493 """
5b5c9bc7 10494 PreControl() -> Control
d55e5bfc
RD
10495
10496 Precreate a Control control for 2-phase creation
10497 """
5b5c9bc7 10498 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
10499 return val
10500
5b5c9bc7 10501def Control_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 10502 """
5b5c9bc7 10503 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
10504
10505 Get the default attributes for this class. This is useful if you want
10506 to use the same font or colour in your own control as in a standard
10507 control -- which is a much better idea than hard coding specific
10508 colours or fonts which might look completely out of place on the
10509 user's system, especially if it uses themes.
10510
10511 The variant parameter is only relevant under Mac currently and is
10512 ignore under other platforms. Under Mac, it will change the size of
10513 the returned font. See `wx.Window.SetWindowVariant` for more about
10514 this.
10515 """
1bd55598 10516 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10517
10518#---------------------------------------------------------------------------
10519
5b5c9bc7 10520class ItemContainer(object):
d55e5bfc 10521 """
53aa7709
RD
10522 The wx.ItemContainer class defines an interface which is implemented
10523 by all controls which have string subitems, each of which may be
10524 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10525 as `wx.ComboBox` which implements an extended interface deriving from
15817c7e 10526 this one.
d55e5bfc 10527
15817c7e
RD
10528 It defines the methods for accessing the control's items and although
10529 each of the derived classes implements them differently, they still
10530 all conform to the same interface.
d55e5bfc 10531
15817c7e
RD
10532 The items in a wx.ItemContainer have (non empty) string labels and,
10533 optionally, client data associated with them.
d55e5bfc
RD
10534
10535 """
1bd55598
RD
10536 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10537 def __init__(self): raise AttributeError, "No constructor defined"
10538 __repr__ = _swig_repr
d55e5bfc
RD
10539 def Append(*args, **kwargs):
10540 """
5b5c9bc7 10541 Append(self, String item, PyObject clientData=None) -> int
d55e5bfc 10542
15817c7e
RD
10543 Adds the item to the control, associating the given data with the item
10544 if not None. The return value is the index of the newly added item
10545 which may be different from the last one if the control is sorted (e.g.
10546 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc 10547 """
5b5c9bc7 10548 return _core_.ItemContainer_Append(*args, **kwargs)
d55e5bfc
RD
10549
10550 def AppendItems(*args, **kwargs):
10551 """
f5b96ee1 10552 AppendItems(self, List strings)
d55e5bfc 10553
15817c7e
RD
10554 Apend several items at once to the control. Notice that calling this
10555 method may be much faster than appending the items one by one if you
10556 need to add a lot of items.
d55e5bfc 10557 """
5b5c9bc7 10558 return _core_.ItemContainer_AppendItems(*args, **kwargs)
d55e5bfc
RD
10559
10560 def Insert(*args, **kwargs):
10561 """
50f151d7 10562 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
d55e5bfc 10563
15817c7e 10564 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
10565 optionally associating some data object with the item.
10566 """
5b5c9bc7 10567 return _core_.ItemContainer_Insert(*args, **kwargs)
d55e5bfc
RD
10568
10569 def Clear(*args, **kwargs):
10570 """
10571 Clear(self)
10572
10573 Removes all items from the control.
10574 """
5b5c9bc7 10575 return _core_.ItemContainer_Clear(*args, **kwargs)
d55e5bfc
RD
10576
10577 def Delete(*args, **kwargs):
10578 """
50f151d7 10579 Delete(self, unsigned int n)
d55e5bfc 10580
15817c7e
RD
10581 Deletes the item at the zero-based index 'n' from the control. Note
10582 that it is an error (signalled by a `wx.PyAssertionError` exception if
10583 enabled) to remove an item with the index negative or greater or equal
10584 than the number of items in the control.
d55e5bfc 10585 """
5b5c9bc7 10586 return _core_.ItemContainer_Delete(*args, **kwargs)
d55e5bfc 10587
53aa7709
RD
10588 def GetClientData(*args, **kwargs):
10589 """
50f151d7 10590 GetClientData(self, unsigned int n) -> PyObject
53aa7709
RD
10591
10592 Returns the client data associated with the given item, (if any.)
10593 """
5b5c9bc7 10594 return _core_.ItemContainer_GetClientData(*args, **kwargs)
53aa7709
RD
10595
10596 def SetClientData(*args, **kwargs):
10597 """
50f151d7 10598 SetClientData(self, unsigned int n, PyObject clientData)
53aa7709
RD
10599
10600 Associate the given client data with the item at position n.
10601 """
5b5c9bc7 10602 return _core_.ItemContainer_SetClientData(*args, **kwargs)
53aa7709 10603
d55e5bfc
RD
10604 def GetCount(*args, **kwargs):
10605 """
50f151d7 10606 GetCount(self) -> unsigned int
d55e5bfc
RD
10607
10608 Returns the number of items in the control.
10609 """
5b5c9bc7 10610 return _core_.ItemContainer_GetCount(*args, **kwargs)
d55e5bfc
RD
10611
10612 def IsEmpty(*args, **kwargs):
10613 """
10614 IsEmpty(self) -> bool
10615
10616 Returns True if the control is empty or False if it has some items.
10617 """
5b5c9bc7 10618 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
d55e5bfc
RD
10619
10620 def GetString(*args, **kwargs):
10621 """
50f151d7 10622 GetString(self, unsigned int n) -> String
d55e5bfc
RD
10623
10624 Returns the label of the item with the given index.
10625 """
5b5c9bc7 10626 return _core_.ItemContainer_GetString(*args, **kwargs)
d55e5bfc
RD
10627
10628 def GetStrings(*args, **kwargs):
10629 """GetStrings(self) -> wxArrayString"""
5b5c9bc7 10630 return _core_.ItemContainer_GetStrings(*args, **kwargs)
d55e5bfc
RD
10631
10632 def SetString(*args, **kwargs):
10633 """
50f151d7 10634 SetString(self, unsigned int n, String s)
d55e5bfc
RD
10635
10636 Sets the label for the given item.
10637 """
5b5c9bc7 10638 return _core_.ItemContainer_SetString(*args, **kwargs)
d55e5bfc
RD
10639
10640 def FindString(*args, **kwargs):
10641 """
5b5c9bc7 10642 FindString(self, String s) -> int
d55e5bfc
RD
10643
10644 Finds an item whose label matches the given string. Returns the
15817c7e
RD
10645 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10646 found.
d55e5bfc 10647 """
5b5c9bc7 10648 return _core_.ItemContainer_FindString(*args, **kwargs)
d55e5bfc 10649
53aa7709 10650 def SetSelection(*args, **kwargs):
d55e5bfc 10651 """
53aa7709 10652 SetSelection(self, int n)
d55e5bfc
RD
10653
10654 Sets the item at index 'n' to be the selected item.
10655 """
5b5c9bc7 10656 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 10657
d55e5bfc
RD
10658 def GetSelection(*args, **kwargs):
10659 """
10660 GetSelection(self) -> int
10661
15817c7e
RD
10662 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10663 is selected.
d55e5bfc 10664 """
5b5c9bc7 10665 return _core_.ItemContainer_GetSelection(*args, **kwargs)
d55e5bfc 10666
53aa7709 10667 def SetStringSelection(*args, **kwargs):
5b5c9bc7
RD
10668 """SetStringSelection(self, String s) -> bool"""
10669 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
53aa7709 10670
d55e5bfc
RD
10671 def GetStringSelection(*args, **kwargs):
10672 """
5b5c9bc7 10673 GetStringSelection(self) -> String
d55e5bfc 10674
15817c7e
RD
10675 Returns the label of the selected item or an empty string if no item
10676 is selected.
d55e5bfc 10677 """
5b5c9bc7 10678 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
d55e5bfc 10679
53aa7709 10680 def Select(*args, **kwargs):
d55e5bfc 10681 """
53aa7709 10682 Select(self, int n)
d55e5bfc 10683
53aa7709
RD
10684 This is the same as `SetSelection` and exists only because it is
10685 slightly more natural for controls which support multiple selection.
d55e5bfc 10686 """
5b5c9bc7 10687 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc 10688
2131d850 10689_core_.ItemContainer_swigregister(ItemContainer)
d55e5bfc
RD
10690
10691#---------------------------------------------------------------------------
10692
5b5c9bc7 10693class ControlWithItems(Control,ItemContainer):
d55e5bfc 10694 """
15817c7e
RD
10695 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10696 wx.Control class, and is used for the base class of various controls
10697 that have items.
d55e5bfc 10698 """
1bd55598
RD
10699 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10700 def __init__(self): raise AttributeError, "No constructor defined"
10701 __repr__ = _swig_repr
2131d850 10702_core_.ControlWithItems_swigregister(ControlWithItems)
d55e5bfc
RD
10703
10704#---------------------------------------------------------------------------
10705
5b5c9bc7 10706class SizerItem(Object):
bfddbb17
RD
10707 """
10708 The wx.SizerItem class is used to track the position, size and other
2131d850
RD
10709 attributes of each item managed by a `wx.Sizer`. It is not usually
10710 necessary to use this class because the sizer elements can also be
10711 identified by their positions or window or sizer references but
10712 sometimes it may be more convenient to use wx.SizerItem directly.
10713 Also, custom classes derived from `wx.PySizer` will probably need to
10714 use the collection of wx.SizerItems held by wx.Sizer when calculating
10715 layout.
bfddbb17
RD
10716
10717 :see: `wx.Sizer`, `wx.GBSizerItem`
10718 """
1bd55598
RD
10719 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10720 __repr__ = _swig_repr
10721 def __init__(self, *args, **kwargs):
bfddbb17 10722 """
5b5c9bc7 10723 __init__(self) -> SizerItem
bfddbb17
RD
10724
10725 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10726 size will need to be set before this item can be used in a Sizer.
10727
10728 You will probably never need to create a wx.SizerItem directly as they
10729 are created automatically when the sizer's Add, Insert or Prepend
10730 methods are called.
10731
10732 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10733 """
1bd55598
RD
10734 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10735 __swig_destroy__ = _core_.delete_SizerItem
10736 __del__ = lambda self : None;
d55e5bfc 10737 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
10738 """
10739 DeleteWindows(self)
10740
10741 Destroy the window or the windows in a subsizer, depending on the type
10742 of item.
10743 """
5b5c9bc7 10744 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
10745
10746 def DetachSizer(*args, **kwargs):
bfddbb17
RD
10747 """
10748 DetachSizer(self)
10749
10750 Enable deleting the SizerItem without destroying the contained sizer.
10751 """
5b5c9bc7 10752 return _core_.SizerItem_DetachSizer(*args, **kwargs)
d55e5bfc
RD
10753
10754 def GetSize(*args, **kwargs):
bfddbb17 10755 """
5b5c9bc7 10756 GetSize(self) -> Size
bfddbb17
RD
10757
10758 Get the current size of the item, as set in the last Layout.
10759 """
5b5c9bc7 10760 return _core_.SizerItem_GetSize(*args, **kwargs)
d55e5bfc
RD
10761
10762 def CalcMin(*args, **kwargs):
bfddbb17 10763 """
5b5c9bc7 10764 CalcMin(self) -> Size
bfddbb17
RD
10765
10766 Calculates the minimum desired size for the item, including any space
10767 needed by borders.
10768 """
5b5c9bc7 10769 return _core_.SizerItem_CalcMin(*args, **kwargs)
d55e5bfc
RD
10770
10771 def SetDimension(*args, **kwargs):
bfddbb17 10772 """
5b5c9bc7 10773 SetDimension(self, Point pos, Size size)
bfddbb17
RD
10774
10775 Set the position and size of the space allocated for this item by the
10776 sizer, and adjust the position and size of the item (window or
10777 subsizer) to be within that space taking alignment and borders into
10778 account.
10779 """
5b5c9bc7 10780 return _core_.SizerItem_SetDimension(*args, **kwargs)
d55e5bfc
RD
10781
10782 def GetMinSize(*args, **kwargs):
bfddbb17 10783 """
5b5c9bc7 10784 GetMinSize(self) -> Size
bfddbb17
RD
10785
10786 Get the minimum size needed for the item.
10787 """
5b5c9bc7 10788 return _core_.SizerItem_GetMinSize(*args, **kwargs)
d55e5bfc 10789
a001823c
RD
10790 def GetMinSizeWithBorder(*args, **kwargs):
10791 """
5b5c9bc7 10792 GetMinSizeWithBorder(self) -> Size
a001823c
RD
10793
10794 Get the minimum size needed for the item with space for the borders
10795 added, if needed.
10796 """
5b5c9bc7 10797 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
a001823c 10798
d55e5bfc
RD
10799 def SetInitSize(*args, **kwargs):
10800 """SetInitSize(self, int x, int y)"""
5b5c9bc7 10801 return _core_.SizerItem_SetInitSize(*args, **kwargs)
d55e5bfc
RD
10802
10803 def SetRatioWH(*args, **kwargs):
bfddbb17
RD
10804 """
10805 SetRatioWH(self, int width, int height)
10806
10807 Set the ratio item attribute.
10808 """
5b5c9bc7 10809 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
d55e5bfc
RD
10810
10811 def SetRatioSize(*args, **kwargs):
bfddbb17 10812 """
5b5c9bc7 10813 SetRatioSize(self, Size size)
bfddbb17
RD
10814
10815 Set the ratio item attribute.
10816 """
5b5c9bc7 10817 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
d55e5bfc
RD
10818
10819 def SetRatio(*args, **kwargs):
bfddbb17
RD
10820 """
10821 SetRatio(self, float ratio)
10822
10823 Set the ratio item attribute.
10824 """
5b5c9bc7 10825 return _core_.SizerItem_SetRatio(*args, **kwargs)
d55e5bfc
RD
10826
10827 def GetRatio(*args, **kwargs):
bfddbb17
RD
10828 """
10829 GetRatio(self) -> float
10830
10831 Set the ratio item attribute.
10832 """
5b5c9bc7 10833 return _core_.SizerItem_GetRatio(*args, **kwargs)
d55e5bfc 10834
070c48b4
RD
10835 def GetRect(*args, **kwargs):
10836 """
5b5c9bc7 10837 GetRect(self) -> Rect
070c48b4
RD
10838
10839 Returns the rectangle that the sizer item should occupy
10840 """
5b5c9bc7 10841 return _core_.SizerItem_GetRect(*args, **kwargs)
070c48b4 10842
d55e5bfc 10843 def IsWindow(*args, **kwargs):
bfddbb17
RD
10844 """
10845 IsWindow(self) -> bool
10846
10847 Is this sizer item a window?
10848 """
5b5c9bc7 10849 return _core_.SizerItem_IsWindow(*args, **kwargs)
d55e5bfc
RD
10850
10851 def IsSizer(*args, **kwargs):
bfddbb17
RD
10852 """
10853 IsSizer(self) -> bool
10854
10855 Is this sizer item a subsizer?
10856 """
5b5c9bc7 10857 return _core_.SizerItem_IsSizer(*args, **kwargs)
d55e5bfc
RD
10858
10859 def IsSpacer(*args, **kwargs):
bfddbb17
RD
10860 """
10861 IsSpacer(self) -> bool
10862
10863 Is this sizer item a spacer?
10864 """
5b5c9bc7 10865 return _core_.SizerItem_IsSpacer(*args, **kwargs)
d55e5bfc
RD
10866
10867 def SetProportion(*args, **kwargs):
bfddbb17
RD
10868 """
10869 SetProportion(self, int proportion)
10870
10871 Set the proportion value for this item.
10872 """
5b5c9bc7 10873 return _core_.SizerItem_SetProportion(*args, **kwargs)
d55e5bfc
RD
10874
10875 def GetProportion(*args, **kwargs):
bfddbb17
RD
10876 """
10877 GetProportion(self) -> int
10878
10879 Get the proportion value for this item.
10880 """
5b5c9bc7 10881 return _core_.SizerItem_GetProportion(*args, **kwargs)
d55e5bfc 10882
bfddbb17
RD
10883 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10884 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 10885 def SetFlag(*args, **kwargs):
bfddbb17
RD
10886 """
10887 SetFlag(self, int flag)
10888
10889 Set the flag value for this item.
10890 """
5b5c9bc7 10891 return _core_.SizerItem_SetFlag(*args, **kwargs)
d55e5bfc
RD
10892
10893 def GetFlag(*args, **kwargs):
bfddbb17
RD
10894 """
10895 GetFlag(self) -> int
10896
10897 Get the flag value for this item.
10898 """
5b5c9bc7 10899 return _core_.SizerItem_GetFlag(*args, **kwargs)
d55e5bfc
RD
10900
10901 def SetBorder(*args, **kwargs):
bfddbb17
RD
10902 """
10903 SetBorder(self, int border)
10904
10905 Set the border value for this item.
10906 """
5b5c9bc7 10907 return _core_.SizerItem_SetBorder(*args, **kwargs)
d55e5bfc
RD
10908
10909 def GetBorder(*args, **kwargs):
bfddbb17
RD
10910 """
10911 GetBorder(self) -> int
10912
10913 Get the border value for this item.
10914 """
5b5c9bc7 10915 return _core_.SizerItem_GetBorder(*args, **kwargs)
d55e5bfc
RD
10916
10917 def GetWindow(*args, **kwargs):
bfddbb17 10918 """
5b5c9bc7 10919 GetWindow(self) -> Window
bfddbb17
RD
10920
10921 Get the window (if any) that is managed by this sizer item.
10922 """
5b5c9bc7 10923 return _core_.SizerItem_GetWindow(*args, **kwargs)
d55e5bfc
RD
10924
10925 def SetWindow(*args, **kwargs):
bfddbb17 10926 """
5b5c9bc7 10927 SetWindow(self, Window window)
bfddbb17
RD
10928
10929 Set the window to be managed by this sizer item.
10930 """
5b5c9bc7 10931 return _core_.SizerItem_SetWindow(*args, **kwargs)
d55e5bfc
RD
10932
10933 def GetSizer(*args, **kwargs):
bfddbb17 10934 """
5b5c9bc7 10935 GetSizer(self) -> Sizer
bfddbb17
RD
10936
10937 Get the subsizer (if any) that is managed by this sizer item.
10938 """
5b5c9bc7 10939 return _core_.SizerItem_GetSizer(*args, **kwargs)
d55e5bfc
RD
10940
10941 def SetSizer(*args, **kwargs):
bfddbb17 10942 """
5b5c9bc7 10943 SetSizer(self, Sizer sizer)
bfddbb17
RD
10944
10945 Set the subsizer to be managed by this sizer item.
10946 """
5b5c9bc7 10947 return _core_.SizerItem_SetSizer(*args, **kwargs)
d55e5bfc
RD
10948
10949 def GetSpacer(*args, **kwargs):
bfddbb17 10950 """
5b5c9bc7 10951 GetSpacer(self) -> Size
bfddbb17
RD
10952
10953 Get the size of the spacer managed by this sizer item.
10954 """
5b5c9bc7 10955 return _core_.SizerItem_GetSpacer(*args, **kwargs)
d55e5bfc
RD
10956
10957 def SetSpacer(*args, **kwargs):
bfddbb17 10958 """
5b5c9bc7 10959 SetSpacer(self, Size size)
bfddbb17
RD
10960
10961 Set the size of the spacer to be managed by this sizer item.
10962 """
5b5c9bc7 10963 return _core_.SizerItem_SetSpacer(*args, **kwargs)
d55e5bfc
RD
10964
10965 def Show(*args, **kwargs):
bfddbb17
RD
10966 """
10967 Show(self, bool show)
10968
10969 Set the show item attribute, which sizers use to determine if the item
10970 is to be made part of the layout or not. If the item is tracking a
10971 window then it is shown or hidden as needed.
10972 """
5b5c9bc7 10973 return _core_.SizerItem_Show(*args, **kwargs)
d55e5bfc
RD
10974
10975 def IsShown(*args, **kwargs):
bfddbb17
RD
10976 """
10977 IsShown(self) -> bool
10978
10979 Is the item to be shown in the layout?
10980 """
5b5c9bc7 10981 return _core_.SizerItem_IsShown(*args, **kwargs)
d55e5bfc
RD
10982
10983 def GetPosition(*args, **kwargs):
bfddbb17 10984 """
5b5c9bc7 10985 GetPosition(self) -> Point
bfddbb17
RD
10986
10987 Returns the current position of the item, as set in the last Layout.
10988 """
5b5c9bc7 10989 return _core_.SizerItem_GetPosition(*args, **kwargs)
d55e5bfc
RD
10990
10991 def GetUserData(*args, **kwargs):
bfddbb17
RD
10992 """
10993 GetUserData(self) -> PyObject
10994
10995 Returns the userData associated with this sizer item, or None if there
10996 isn't any.
10997 """
5b5c9bc7 10998 return _core_.SizerItem_GetUserData(*args, **kwargs)
d55e5bfc 10999
32fe5131
RD
11000 def SetUserData(*args, **kwargs):
11001 """
11002 SetUserData(self, PyObject userData)
11003
11004 Associate a Python object with this sizer item.
11005 """
11006 return _core_.SizerItem_SetUserData(*args, **kwargs)
11007
2131d850 11008_core_.SizerItem_swigregister(SizerItem)
d55e5bfc 11009
bfddbb17 11010def SizerItemWindow(*args, **kwargs):
d55e5bfc 11011 """
5b5c9bc7
RD
11012 SizerItemWindow(Window window, int proportion, int flag, int border,
11013 PyObject userData=None) -> SizerItem
bfddbb17
RD
11014
11015 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 11016 """
5b5c9bc7 11017 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
11018 return val
11019
bfddbb17 11020def SizerItemSpacer(*args, **kwargs):
d55e5bfc 11021 """
bfddbb17 11022 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
5b5c9bc7 11023 PyObject userData=None) -> SizerItem
bfddbb17
RD
11024
11025 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 11026 """
5b5c9bc7 11027 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
11028 return val
11029
11030def SizerItemSizer(*args, **kwargs):
11031 """
5b5c9bc7
RD
11032 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11033 PyObject userData=None) -> SizerItem
bfddbb17
RD
11034
11035 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc 11036 """
5b5c9bc7 11037 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
11038 return val
11039
5b5c9bc7 11040class Sizer(Object):
bfddbb17
RD
11041 """
11042 wx.Sizer is the abstract base class used for laying out subwindows in
11043 a window. You cannot use wx.Sizer directly; instead, you will have to
11044 use one of the sizer classes derived from it such as `wx.BoxSizer`,
1d5ee749
RD
11045 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11046 `wx.GridBagSizer`.
bfddbb17
RD
11047
11048 The concept implemented by sizers in wxWidgets is closely related to
11049 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11050 toolkit or the Qt toolkit. It is based upon the idea of the individual
11051 subwindows reporting their minimal required size and their ability to
11052 get stretched if the size of the parent window has changed. This will
11053 most often mean that the programmer does not set the original size of
11054 a dialog in the beginning, rather the dialog will assigned a sizer and
11055 this sizer will be queried about the recommended size. The sizer in
11056 turn will query its children, which can be normal windows or contorls,
11057 empty space or other sizers, so that a hierarchy of sizers can be
11058 constructed. Note that wxSizer does not derive from wxWindow and thus
11059 do not interfere with tab ordering and requires very little resources
11060 compared to a real window on screen.
11061
11062 What makes sizers so well fitted for use in wxWidgets is the fact that
11063 every control reports its own minimal size and the algorithm can
11064 handle differences in font sizes or different window (dialog item)
11065 sizes on different platforms without problems. If for example the
11066 standard font as well as the overall design of Mac widgets requires
11067 more space than on Windows, then the initial size of a dialog using a
11068 sizer will automatically be bigger on Mac than on Windows.
11069 """
1bd55598
RD
11070 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11071 def __init__(self): raise AttributeError, "No constructor defined"
11072 __repr__ = _swig_repr
11073 __swig_destroy__ = _core_.delete_Sizer
11074 __del__ = lambda self : None;
d55e5bfc
RD
11075 def _setOORInfo(*args, **kwargs):
11076 """_setOORInfo(self, PyObject _self)"""
5b5c9bc7 11077 return _core_.Sizer__setOORInfo(*args, **kwargs)
d55e5bfc
RD
11078
11079 def Add(*args, **kwargs):
11080 """
bfddbb17 11081 Add(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11082 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11083
11084 Appends a child item to the sizer.
d55e5bfc 11085 """
5b5c9bc7 11086 return _core_.Sizer_Add(*args, **kwargs)
d55e5bfc
RD
11087
11088 def Insert(*args, **kwargs):
11089 """
bfddbb17 11090 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
070c48b4 11091 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11092
11093 Inserts a new item into the list of items managed by this sizer before
11094 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc 11095 """
5b5c9bc7 11096 return _core_.Sizer_Insert(*args, **kwargs)
d55e5bfc
RD
11097
11098 def Prepend(*args, **kwargs):
11099 """
bfddbb17 11100 Prepend(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11101 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11102
11103 Adds a new item to the begining of the list of sizer items managed by
11104 this sizer. See `Add` for a description of the parameters.
d55e5bfc 11105 """
5b5c9bc7 11106 return _core_.Sizer_Prepend(*args, **kwargs)
d55e5bfc
RD
11107
11108 def Remove(*args, **kwargs):
bfddbb17
RD
11109 """
11110 Remove(self, item) -> bool
11111
11112 Removes an item from the sizer and destroys it. This method does not
11113 cause any layout or resizing to take place, call `Layout` to update
11114 the layout on screen after removing a child from the sizer. The
11115 *item* parameter can be either a window, a sizer, or the zero-based
11116 index of an item to remove. Returns True if the child item was found
11117 and removed.
11118 """
5b5c9bc7 11119 return _core_.Sizer_Remove(*args, **kwargs)
d55e5bfc 11120
1a6bba1e 11121 def Detach(*args, **kwargs):
bfddbb17
RD
11122 """
11123 Detach(self, item) -> bool
11124
11125 Detaches an item from the sizer without destroying it. This method
11126 does not cause any layout or resizing to take place, call `Layout` to
11127 do so. The *item* parameter can be either a window, a sizer, or the
11128 zero-based index of the item to be detached. Returns True if the child item
11129 was found and detached.
11130 """
5b5c9bc7 11131 return _core_.Sizer_Detach(*args, **kwargs)
1a6bba1e 11132
070c48b4
RD
11133 def GetItem(*args, **kwargs):
11134 """
11135 GetItem(self, item) -> wx.SizerItem
11136
11137 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11138 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11139 the item to be found.
070c48b4 11140 """
5b5c9bc7 11141 return _core_.Sizer_GetItem(*args, **kwargs)
070c48b4 11142
d55e5bfc 11143 def _SetItemMinSize(*args, **kwargs):
5b5c9bc7
RD
11144 """_SetItemMinSize(self, PyObject item, Size size)"""
11145 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
d55e5bfc 11146
bfddbb17
RD
11147 def SetItemMinSize(self, item, *args):
11148 """
11149 SetItemMinSize(self, item, Size size)
11150
11151 Sets the minimum size that will be allocated for an item in the sizer.
11152 The *item* parameter can be either a window, a sizer, or the
11153 zero-based index of the item. If a window or sizer is given then it
11154 will be searched for recursivly in subsizers if neccessary.
11155 """
11156 if len(args) == 2:
11157 # for backward compatibility accept separate width,height args too
11158 return self._SetItemMinSize(item, args)
11159 else:
11160 return self._SetItemMinSize(item, args[0])
11161
d55e5bfc 11162 def AddItem(*args, **kwargs):
bfddbb17
RD
11163 """
11164 AddItem(self, SizerItem item)
11165
11166 Adds a `wx.SizerItem` to the sizer.
11167 """
5b5c9bc7 11168 return _core_.Sizer_AddItem(*args, **kwargs)
d55e5bfc
RD
11169
11170 def InsertItem(*args, **kwargs):
bfddbb17
RD
11171 """
11172 InsertItem(self, int index, SizerItem item)
11173
11174 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11175 """
5b5c9bc7 11176 return _core_.Sizer_InsertItem(*args, **kwargs)
d55e5bfc
RD
11177
11178 def PrependItem(*args, **kwargs):
bfddbb17
RD
11179 """
11180 PrependItem(self, SizerItem item)
11181
11182 Prepends a `wx.SizerItem` to the sizer.
11183 """
5b5c9bc7 11184 return _core_.Sizer_PrependItem(*args, **kwargs)
d55e5bfc 11185
bfddbb17 11186 def AddMany(self, items):
d6c14a4c
RD
11187 """
11188 AddMany is a convenience method for adding several items
11189 to a sizer at one time. Simply pass it a list of tuples,
11190 where each tuple consists of the parameters that you
11191 would normally pass to the `Add` method.
11192 """
bfddbb17
RD
11193 for item in items:
11194 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11195 item = (item, )
11196 self.Add(*item)
d55e5bfc
RD
11197
11198 # for backwards compatibility only, please do not use in new code
7fbf8399
RD
11199 def AddWindow(self, *args, **kw):
11200 """Compatibility alias for `Add`."""
11201 return self.Add(*args, **kw)
11202 def AddSizer(self, *args, **kw):
11203 """Compatibility alias for `Add`."""
11204 return self.Add(*args, **kw)
11205 def AddSpacer(self, *args, **kw):
11206 """Compatibility alias for `Add`."""
11207 return self.Add(*args, **kw)
11208
11209 def PrependWindow(self, *args, **kw):
11210 """Compatibility alias for `Prepend`."""
11211 return self.Prepend(*args, **kw)
11212 def PrependSizer(self, *args, **kw):
11213 """Compatibility alias for `Prepend`."""
11214 return self.Prepend(*args, **kw)
11215 def PrependSpacer(self, *args, **kw):
11216 """Compatibility alias for `Prepend`."""
11217 return self.Prepend(*args, **kw)
11218
11219 def InsertWindow(self, *args, **kw):
11220 """Compatibility alias for `Insert`."""
11221 return self.Insert(*args, **kw)
11222 def InsertSizer(self, *args, **kw):
11223 """Compatibility alias for `Insert`."""
11224 return self.Insert(*args, **kw)
11225 def InsertSpacer(self, *args, **kw):
11226 """Compatibility alias for `Insert`."""
11227 return self.Insert(*args, **kw)
11228
11229 def RemoveWindow(self, *args, **kw):
11230 """Compatibility alias for `Remove`."""
11231 return self.Remove(*args, **kw)
11232 def RemoveSizer(self, *args, **kw):
11233 """Compatibility alias for `Remove`."""
11234 return self.Remove(*args, **kw)
11235 def RemovePos(self, *args, **kw):
11236 """Compatibility alias for `Remove`."""
11237 return self.Remove(*args, **kw)
d55e5bfc
RD
11238
11239
d55e5bfc 11240 def SetDimension(*args, **kwargs):
bfddbb17
RD
11241 """
11242 SetDimension(self, int x, int y, int width, int height)
11243
11244 Call this to force the sizer to take the given dimension and thus
11245 force the items owned by the sizer to resize themselves according to
11246 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11247 methods.
11248 """
5b5c9bc7 11249 return _core_.Sizer_SetDimension(*args, **kwargs)
d55e5bfc
RD
11250
11251 def SetMinSize(*args, **kwargs):
bfddbb17 11252 """
5b5c9bc7 11253 SetMinSize(self, Size size)
bfddbb17
RD
11254
11255 Call this to give the sizer a minimal size. Normally, the sizer will
11256 calculate its minimal size based purely on how much space its children
11257 need. After calling this method `GetMinSize` will return either the
11258 minimal size as requested by its children or the minimal size set
11259 here, depending on which is bigger.
11260 """
5b5c9bc7 11261 return _core_.Sizer_SetMinSize(*args, **kwargs)
d55e5bfc
RD
11262
11263 def GetSize(*args, **kwargs):
bfddbb17 11264 """
5b5c9bc7 11265 GetSize(self) -> Size
bfddbb17
RD
11266
11267 Returns the current size of the space managed by the sizer.
11268 """
5b5c9bc7 11269 return _core_.Sizer_GetSize(*args, **kwargs)
d55e5bfc
RD
11270
11271 def GetPosition(*args, **kwargs):
bfddbb17 11272 """
5b5c9bc7 11273 GetPosition(self) -> Point
bfddbb17
RD
11274
11275 Returns the current position of the sizer's managed space.
11276 """
5b5c9bc7 11277 return _core_.Sizer_GetPosition(*args, **kwargs)
d55e5bfc
RD
11278
11279 def GetMinSize(*args, **kwargs):
bfddbb17 11280 """
5b5c9bc7 11281 GetMinSize(self) -> Size
bfddbb17
RD
11282
11283 Returns the minimal size of the sizer. This is either the combined
11284 minimal size of all the children and their borders or the minimal size
11285 set by SetMinSize, depending on which is bigger.
11286 """
5b5c9bc7 11287 return _core_.Sizer_GetMinSize(*args, **kwargs)
d55e5bfc
RD
11288
11289 def GetSizeTuple(self):
1a6bba1e 11290 return self.GetSize().Get()
d55e5bfc 11291 def GetPositionTuple(self):
1a6bba1e 11292 return self.GetPosition().Get()
d55e5bfc 11293 def GetMinSizeTuple(self):
1a6bba1e 11294 return self.GetMinSize().Get()
d55e5bfc
RD
11295
11296 def RecalcSizes(*args, **kwargs):
bfddbb17
RD
11297 """
11298 RecalcSizes(self)
11299
11300 Using the sizes calculated by `CalcMin` reposition and resize all the
11301 items managed by this sizer. You should not need to call this directly as
11302 it is called by `Layout`.
11303 """
5b5c9bc7 11304 return _core_.Sizer_RecalcSizes(*args, **kwargs)
d55e5bfc
RD
11305
11306 def CalcMin(*args, **kwargs):
bfddbb17 11307 """
5b5c9bc7 11308 CalcMin(self) -> Size
bfddbb17
RD
11309
11310 This method is where the sizer will do the actual calculation of its
11311 children's minimal sizes. You should not need to call this directly as
11312 it is called by `Layout`.
11313 """
5b5c9bc7 11314 return _core_.Sizer_CalcMin(*args, **kwargs)
d55e5bfc
RD
11315
11316 def Layout(*args, **kwargs):
bfddbb17
RD
11317 """
11318 Layout(self)
11319
11320 This method will force the recalculation and layout of the items
11321 controlled by the sizer using the current space allocated to the
11322 sizer. Normally this is called automatically from the owning window's
11323 EVT_SIZE handler, but it is also useful to call it from user code when
11324 one of the items in a sizer change size, or items are added or
11325 removed.
11326 """
5b5c9bc7 11327 return _core_.Sizer_Layout(*args, **kwargs)
d55e5bfc
RD
11328
11329 def Fit(*args, **kwargs):
bfddbb17 11330 """
5b5c9bc7 11331 Fit(self, Window window) -> Size
bfddbb17
RD
11332
11333 Tell the sizer to resize the *window* to match the sizer's minimal
11334 size. This is commonly done in the constructor of the window itself in
11335 order to set its initial size to match the needs of the children as
11336 determined by the sizer. Returns the new size.
11337
11338 For a top level window this is the total window size, not the client size.
11339 """
5b5c9bc7 11340 return _core_.Sizer_Fit(*args, **kwargs)
d55e5bfc
RD
11341
11342 def FitInside(*args, **kwargs):
bfddbb17 11343 """
5b5c9bc7 11344 FitInside(self, Window window)
bfddbb17
RD
11345
11346 Tell the sizer to resize the *virtual size* of the *window* to match the
11347 sizer's minimal size. This will not alter the on screen size of the
11348 window, but may cause the addition/removal/alteration of scrollbars
11349 required to view the virtual area in windows which manage it.
11350
11351 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11352
11353 """
5b5c9bc7 11354 return _core_.Sizer_FitInside(*args, **kwargs)
d55e5bfc
RD
11355
11356 def SetSizeHints(*args, **kwargs):
bfddbb17 11357 """
5b5c9bc7 11358 SetSizeHints(self, Window window)
bfddbb17
RD
11359
11360 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11361 match the sizer's minimal size. This is commonly done in the
11362 constructor of the window itself if the window is resizable (as are
11363 many dialogs under Unix and frames on probably all platforms) in order
11364 to prevent the window from being sized smaller than the minimal size
11365 required by the sizer.
11366 """
5b5c9bc7 11367 return _core_.Sizer_SetSizeHints(*args, **kwargs)
d55e5bfc
RD
11368
11369 def SetVirtualSizeHints(*args, **kwargs):
bfddbb17 11370 """
5b5c9bc7 11371 SetVirtualSizeHints(self, Window window)
bfddbb17
RD
11372
11373 Tell the sizer to set the minimal size of the window virtual area to
11374 match the sizer's minimal size. For windows with managed scrollbars
11375 this will set them appropriately.
11376
11377 :see: `wx.ScrolledWindow.SetScrollbars`
11378
11379 """
5b5c9bc7 11380 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
d55e5bfc
RD
11381
11382 def Clear(*args, **kwargs):
bfddbb17
RD
11383 """
11384 Clear(self, bool deleteWindows=False)
11385
11386 Clear all items from the sizer, optionally destroying the window items
11387 as well.
11388 """
5b5c9bc7 11389 return _core_.Sizer_Clear(*args, **kwargs)
d55e5bfc
RD
11390
11391 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
11392 """
11393 DeleteWindows(self)
11394
11395 Destroy all windows managed by the sizer.
11396 """
5b5c9bc7 11397 return _core_.Sizer_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
11398
11399 def GetChildren(*args, **kwargs):
bfddbb17 11400 """
51b83b37 11401 GetChildren(self) -> list
bfddbb17
RD
11402
11403 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11404 """
5b5c9bc7 11405 return _core_.Sizer_GetChildren(*args, **kwargs)
d55e5bfc
RD
11406
11407 def Show(*args, **kwargs):
bfddbb17 11408 """
b411df4a 11409 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 11410
bfddbb17
RD
11411 Shows or hides an item managed by the sizer. To make a sizer item
11412 disappear or reappear, use Show followed by `Layout`. The *item*
11413 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
11414 the item. Use the recursive parameter to show or hide an item in a
11415 subsizer. Returns True if the item was found.
bfddbb17 11416 """
5b5c9bc7 11417 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
11418
11419 def IsShown(*args, **kwargs):
bfddbb17
RD
11420 """
11421 IsShown(self, item)
11422
b1fcee84 11423 Determines if the item is currently shown. To make a sizer
bfddbb17
RD
11424 item disappear or reappear, use Show followed by `Layout`. The *item*
11425 parameter can be either a window, a sizer, or the zero-based index of
11426 the item.
11427 """
5b5c9bc7 11428 return _core_.Sizer_IsShown(*args, **kwargs)
d55e5bfc 11429
629e65c2 11430 def Hide(self, item, recursive=False):
bfddbb17 11431 """
27fb7603 11432 A convenience method for `Show` (item, False, recursive).
bfddbb17 11433 """
06759a38 11434 return self.Show(item, False, recursive)
bfddbb17 11435
d55e5bfc 11436 def ShowItems(*args, **kwargs):
bfddbb17
RD
11437 """
11438 ShowItems(self, bool show)
11439
84f85550 11440 Recursively call `wx.SizerItem.Show` on all sizer items.
bfddbb17 11441 """
5b5c9bc7 11442 return _core_.Sizer_ShowItems(*args, **kwargs)
d55e5bfc 11443
2131d850 11444_core_.Sizer_swigregister(Sizer)
d55e5bfc 11445
5b5c9bc7 11446class PySizer(Sizer):
bfddbb17
RD
11447 """
11448 wx.PySizer is a special version of `wx.Sizer` that has been
11449 instrumented to allow the C++ virtual methods to be overloaded in
11450 Python derived classes. You would derive from this class if you are
11451 wanting to implement a custom sizer in Python code. Simply implement
11452 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11453 For example::
11454
11455 class MySizer(wx.PySizer):
11456 def __init__(self):
11457 wx.PySizer.__init__(self)
11458
11459 def CalcMin(self):
11460 for item in self.GetChildren():
11461 # calculate the total minimum width and height needed
11462 # by all items in the sizer according to this sizer's
11463 # layout algorithm.
11464 ...
11465 return wx.Size(width, height)
11466
11467 def RecalcSizes(self):
11468 # find the space allotted to this sizer
11469 pos = self.GetPosition()
11470 size = self.GetSize()
11471 for item in self.GetChildren():
11472 # Recalculate (if necessary) the position and size of
11473 # each item and then call item.SetDimension to do the
11474 # actual positioning and sizing of the items within the
11475 # space alloted to this sizer.
11476 ...
11477 item.SetDimension(itemPos, itemSize)
11478
11479
11480 When `Layout` is called it first calls `CalcMin` followed by
11481 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 11482 `CalcMin` and reusing them in `RecalcSizes`.
bfddbb17
RD
11483
11484 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11485
11486
11487 """
1bd55598
RD
11488 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11489 __repr__ = _swig_repr
11490 def __init__(self, *args, **kwargs):
bfddbb17 11491 """
5b5c9bc7 11492 __init__(self) -> PySizer
bfddbb17
RD
11493
11494 Creates a wx.PySizer. Must be called from the __init__ in the derived
11495 class.
11496 """
1bd55598 11497 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
d55e5bfc
RD
11498 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11499
11500 def _setCallbackInfo(*args, **kwargs):
11501 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 11502 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
d55e5bfc 11503
2131d850 11504_core_.PySizer_swigregister(PySizer)
d55e5bfc
RD
11505
11506#---------------------------------------------------------------------------
11507
5b5c9bc7 11508class BoxSizer(Sizer):
bfddbb17
RD
11509 """
11510 The basic idea behind a box sizer is that windows will most often be
11511 laid out in rather simple basic geometry, typically in a row or a
11512 column or nested hierarchies of either. A wx.BoxSizer will lay out
11513 its items in a simple row or column, depending on the orientation
11514 parameter passed to the constructor.
11515 """
1bd55598
RD
11516 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11517 __repr__ = _swig_repr
11518 def __init__(self, *args, **kwargs):
bfddbb17 11519 """
5b5c9bc7 11520 __init__(self, int orient=HORIZONTAL) -> BoxSizer
bfddbb17
RD
11521
11522 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11523 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11524 sizer.
11525 """
1bd55598 11526 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d55e5bfc
RD
11527 self._setOORInfo(self)
11528
11529 def GetOrientation(*args, **kwargs):
bfddbb17
RD
11530 """
11531 GetOrientation(self) -> int
11532
11533 Returns the current orientation of the sizer.
11534 """
5b5c9bc7 11535 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
d55e5bfc
RD
11536
11537 def SetOrientation(*args, **kwargs):
bfddbb17
RD
11538 """
11539 SetOrientation(self, int orient)
d55e5bfc 11540
bfddbb17
RD
11541 Resets the orientation of the sizer.
11542 """
5b5c9bc7 11543 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc 11544
2131d850 11545_core_.BoxSizer_swigregister(BoxSizer)
d55e5bfc
RD
11546
11547#---------------------------------------------------------------------------
11548
5b5c9bc7 11549class StaticBoxSizer(BoxSizer):
bfddbb17
RD
11550 """
11551 wx.StaticBoxSizer derives from and functions identically to the
11552 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11553 manages. Note that this static box must be created separately and
11554 passed to the sizer constructor.
11555 """
1bd55598
RD
11556 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11557 __repr__ = _swig_repr
11558 def __init__(self, *args, **kwargs):
bfddbb17 11559 """
5b5c9bc7 11560 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
bfddbb17
RD
11561
11562 Constructor. It takes an associated static box and the orientation
11563 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11564 ``wx.HORIZONTAL``.
11565 """
1bd55598 11566 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d55e5bfc
RD
11567 self._setOORInfo(self)
11568
11569 def GetStaticBox(*args, **kwargs):
bfddbb17 11570 """
5b5c9bc7 11571 GetStaticBox(self) -> StaticBox
d55e5bfc 11572
bfddbb17
RD
11573 Returns the static box associated with this sizer.
11574 """
5b5c9bc7 11575 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc 11576
2131d850 11577_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d55e5bfc
RD
11578
11579#---------------------------------------------------------------------------
11580
5b5c9bc7 11581class GridSizer(Sizer):
bfddbb17
RD
11582 """
11583 A grid sizer is a sizer which lays out its children in a
11584 two-dimensional table with all cells having the same size. In other
11585 words, the width of each cell within the grid is the width of the
11586 widest item added to the sizer and the height of each grid cell is the
11587 height of the tallest item. An optional vertical and/or horizontal
11588 gap between items can also be specified (in pixels.)
11589
11590 Items are placed in the cells of the grid in the order they are added,
11591 in row-major order. In other words, the first row is filled first,
11592 then the second, and so on until all items have been added. (If
11593 neccessary, additional rows will be added as items are added.) If you
11594 need to have greater control over the cells that items are placed in
11595 then use the `wx.GridBagSizer`.
11596
11597 """
1bd55598
RD
11598 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11599 __repr__ = _swig_repr
11600 def __init__(self, *args, **kwargs):
bfddbb17 11601 """
5b5c9bc7 11602 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
bfddbb17
RD
11603
11604 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11605 of columns and rows in the sizer - if either of the parameters is
11606 zero, it will be calculated to from the total number of children in
11607 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11608 define extra space between all children.
11609 """
1bd55598 11610 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d55e5bfc
RD
11611 self._setOORInfo(self)
11612
d55e5bfc 11613 def SetCols(*args, **kwargs):
bfddbb17
RD
11614 """
11615 SetCols(self, int cols)
11616
11617 Sets the number of columns in the sizer.
11618 """
5b5c9bc7 11619 return _core_.GridSizer_SetCols(*args, **kwargs)
d55e5bfc
RD
11620
11621 def SetRows(*args, **kwargs):
bfddbb17
RD
11622 """
11623 SetRows(self, int rows)
11624
11625 Sets the number of rows in the sizer.
11626 """
5b5c9bc7 11627 return _core_.GridSizer_SetRows(*args, **kwargs)
d55e5bfc
RD
11628
11629 def SetVGap(*args, **kwargs):
bfddbb17
RD
11630 """
11631 SetVGap(self, int gap)
11632
11633 Sets the vertical gap (in pixels) between the cells in the sizer.
11634 """
5b5c9bc7 11635 return _core_.GridSizer_SetVGap(*args, **kwargs)
d55e5bfc
RD
11636
11637 def SetHGap(*args, **kwargs):
bfddbb17
RD
11638 """
11639 SetHGap(self, int gap)
11640
11641 Sets the horizontal gap (in pixels) between cells in the sizer
11642 """
5b5c9bc7 11643 return _core_.GridSizer_SetHGap(*args, **kwargs)
d55e5bfc
RD
11644
11645 def GetCols(*args, **kwargs):
bfddbb17
RD
11646 """
11647 GetCols(self) -> int
11648
11649 Returns the number of columns in the sizer.
11650 """
5b5c9bc7 11651 return _core_.GridSizer_GetCols(*args, **kwargs)
d55e5bfc
RD
11652
11653 def GetRows(*args, **kwargs):
bfddbb17
RD
11654 """
11655 GetRows(self) -> int
11656
11657 Returns the number of rows in the sizer.
11658 """
5b5c9bc7 11659 return _core_.GridSizer_GetRows(*args, **kwargs)
d55e5bfc
RD
11660
11661 def GetVGap(*args, **kwargs):
bfddbb17
RD
11662 """
11663 GetVGap(self) -> int
11664
11665 Returns the vertical gap (in pixels) between the cells in the sizer.
11666 """
5b5c9bc7 11667 return _core_.GridSizer_GetVGap(*args, **kwargs)
d55e5bfc
RD
11668
11669 def GetHGap(*args, **kwargs):
bfddbb17
RD
11670 """
11671 GetHGap(self) -> int
11672
11673 Returns the horizontal gap (in pixels) between cells in the sizer.
11674 """
5b5c9bc7 11675 return _core_.GridSizer_GetHGap(*args, **kwargs)
d55e5bfc 11676
1bd55598
RD
11677 def CalcRowsCols(self):
11678 """
11679 CalcRowsCols() -> (rows, cols)
11680
11681 Calculates how many rows and columns will be in the sizer based
11682 on the current number of items and also the rows, cols specified
11683 in the constructor.
11684 """
11685 nitems = len(self.GetChildren())
11686 rows = self.GetRows()
11687 cols = self.GetCols()
11688 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11689 if cols != 0:
11690 rows = (nitems + cols - 1) / cols
11691 elif rows != 0:
11692 cols = (nitems + rows - 1) / rows
11693 return (rows, cols)
d55e5bfc 11694
2131d850 11695_core_.GridSizer_swigregister(GridSizer)
d55e5bfc
RD
11696
11697#---------------------------------------------------------------------------
11698
5b5c9bc7
RD
11699FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11700FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11701FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11702class FlexGridSizer(GridSizer):
bfddbb17
RD
11703 """
11704 A flex grid sizer is a sizer which lays out its children in a
11705 two-dimensional table with all table cells in one row having the same
11706 height and all cells in one column having the same width, but all
11707 rows or all columns are not necessarily the same height or width as in
11708 the `wx.GridSizer`.
11709
11710 wx.FlexGridSizer can also size items equally in one direction but
11711 unequally ("flexibly") in the other. If the sizer is only flexible
11712 in one direction (this can be changed using `SetFlexibleDirection`), it
11713 needs to be decided how the sizer should grow in the other ("non
11714 flexible") direction in order to fill the available space. The
11715 `SetNonFlexibleGrowMode` method serves this purpose.
11716
11717
11718 """
1bd55598
RD
11719 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11720 __repr__ = _swig_repr
11721 def __init__(self, *args, **kwargs):
bfddbb17 11722 """
5b5c9bc7 11723 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
bfddbb17
RD
11724
11725 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11726 number of columns and rows in the sizer - if either of the parameters
11727 is zero, it will be calculated to from the total number of children in
11728 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11729 define extra space between all children.
11730 """
1bd55598 11731 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d55e5bfc
RD
11732 self._setOORInfo(self)
11733
bfddbb17
RD
11734 def AddGrowableRow(*args, **kwargs):
11735 """
11736 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 11737
bfddbb17
RD
11738 Specifies that row *idx* (starting from zero) should be grown if there
11739 is extra space available to the sizer.
d55e5bfc 11740
bfddbb17
RD
11741 The *proportion* parameter has the same meaning as the stretch factor
11742 for the box sizers except that if all proportions are 0, then all
11743 columns are resized equally (instead of not being resized at all).
11744 """
5b5c9bc7 11745 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
d55e5bfc
RD
11746
11747 def RemoveGrowableRow(*args, **kwargs):
bfddbb17
RD
11748 """
11749 RemoveGrowableRow(self, size_t idx)
11750
11751 Specifies that row *idx* is no longer growable.
11752 """
5b5c9bc7 11753 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
d55e5bfc
RD
11754
11755 def AddGrowableCol(*args, **kwargs):
bfddbb17
RD
11756 """
11757 AddGrowableCol(self, size_t idx, int proportion=0)
11758
11759 Specifies that column *idx* (starting from zero) should be grown if
11760 there is extra space available to the sizer.
11761
11762 The *proportion* parameter has the same meaning as the stretch factor
11763 for the box sizers except that if all proportions are 0, then all
11764 columns are resized equally (instead of not being resized at all).
11765 """
5b5c9bc7 11766 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
d55e5bfc
RD
11767
11768 def RemoveGrowableCol(*args, **kwargs):
bfddbb17
RD
11769 """
11770 RemoveGrowableCol(self, size_t idx)
11771
11772 Specifies that column *idx* is no longer growable.
11773 """
5b5c9bc7 11774 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
d55e5bfc
RD
11775
11776 def SetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
11777 """
11778 SetFlexibleDirection(self, int direction)
11779
11780 Specifies whether the sizer should flexibly resize its columns, rows,
11781 or both. Argument *direction* can be one of the following values. Any
11782 other value is ignored.
11783
11784 ============== =======================================
11785 wx.VERTICAL Rows are flexibly sized.
11786 wx.HORIZONTAL Columns are flexibly sized.
11787 wx.BOTH Both rows and columns are flexibly sized
11788 (this is the default value).
11789 ============== =======================================
11790
11791 Note that this method does not trigger relayout.
11792
11793 """
5b5c9bc7 11794 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
11795
11796 def GetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
11797 """
11798 GetFlexibleDirection(self) -> int
11799
11800 Returns a value that specifies whether the sizer
11801 flexibly resizes its columns, rows, or both (default).
11802
11803 :see: `SetFlexibleDirection`
11804 """
5b5c9bc7 11805 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
11806
11807 def SetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
11808 """
11809 SetNonFlexibleGrowMode(self, int mode)
11810
11811 Specifies how the sizer should grow in the non-flexible direction if
11812 there is one (so `SetFlexibleDirection` must have been called
11813 previously). Argument *mode* can be one of the following values:
11814
11815 ========================== =================================================
11816 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11817 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11818 `AddGrowableCol` and `AddGrowableRow`. In this
11819 case equal sizing applies to minimum sizes of
11820 columns or rows (this is the default value).
11821 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11822 the non flexible direction, whether they are
11823 growable or not in the flexbile direction.
11824 ========================== =================================================
11825
11826 Note that this method does not trigger relayout.
11827
11828
11829 """
5b5c9bc7 11830 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
11831
11832 def GetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
11833 """
11834 GetNonFlexibleGrowMode(self) -> int
11835
11836 Returns the value that specifies how the sizer grows in the
11837 non-flexible direction if there is one.
11838
11839 :see: `SetNonFlexibleGrowMode`
11840 """
5b5c9bc7 11841 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
11842
11843 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
11844 """
11845 GetRowHeights(self) -> list
11846
11847 Returns a list of integers representing the heights of each of the
11848 rows in the sizer.
11849 """
5b5c9bc7 11850 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
d55e5bfc
RD
11851
11852 def GetColWidths(*args, **kwargs):
fd2dc343
RD
11853 """
11854 GetColWidths(self) -> list
11855
11856 Returns a list of integers representing the widths of each of the
11857 columns in the sizer.
11858 """
5b5c9bc7 11859 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
d55e5bfc 11860
2131d850 11861_core_.FlexGridSizer_swigregister(FlexGridSizer)
d55e5bfc 11862
5b5c9bc7 11863class StdDialogButtonSizer(BoxSizer):
62d32a5f
RD
11864 """
11865 A special sizer that knows how to order and position standard buttons
11866 in order to conform to the current platform's standards. You simply
11867 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 11868 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
11869 will take care of the rest.
11870
11871 """
1bd55598
RD
11872 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11873 __repr__ = _swig_repr
11874 def __init__(self, *args, **kwargs):
5b5c9bc7 11875 """__init__(self) -> StdDialogButtonSizer"""
1bd55598 11876 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
62d32a5f
RD
11877 def AddButton(*args, **kwargs):
11878 """
11879 AddButton(self, wxButton button)
11880
11881 Use this to add the buttons to this sizer. Do not use the `Add`
11882 method in the base class.
11883 """
5b5c9bc7 11884 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
62d32a5f 11885
53aa7709 11886 def Realize(*args, **kwargs):
62d32a5f 11887 """
53aa7709 11888 Realize(self)
62d32a5f
RD
11889
11890 This funciton needs to be called after all the buttons have been added
11891 to the sizer. It will reorder them and position them in a platform
11892 specifc manner.
11893 """
5b5c9bc7 11894 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
11895
11896 def SetAffirmativeButton(*args, **kwargs):
11897 """SetAffirmativeButton(self, wxButton button)"""
5b5c9bc7 11898 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
51b83b37
RD
11899
11900 def SetNegativeButton(*args, **kwargs):
11901 """SetNegativeButton(self, wxButton button)"""
5b5c9bc7 11902 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
51b83b37
RD
11903
11904 def SetCancelButton(*args, **kwargs):
11905 """SetCancelButton(self, wxButton button)"""
5b5c9bc7 11906 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
11907
11908 def GetAffirmativeButton(*args, **kwargs):
11909 """GetAffirmativeButton(self) -> wxButton"""
5b5c9bc7 11910 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
62d32a5f
RD
11911
11912 def GetApplyButton(*args, **kwargs):
11913 """GetApplyButton(self) -> wxButton"""
5b5c9bc7 11914 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
62d32a5f
RD
11915
11916 def GetNegativeButton(*args, **kwargs):
11917 """GetNegativeButton(self) -> wxButton"""
5b5c9bc7 11918 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
62d32a5f
RD
11919
11920 def GetCancelButton(*args, **kwargs):
11921 """GetCancelButton(self) -> wxButton"""
5b5c9bc7 11922 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
62d32a5f
RD
11923
11924 def GetHelpButton(*args, **kwargs):
11925 """GetHelpButton(self) -> wxButton"""
5b5c9bc7 11926 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
62d32a5f 11927
2131d850 11928_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
62d32a5f 11929
d55e5bfc
RD
11930#---------------------------------------------------------------------------
11931
5b5c9bc7 11932class GBPosition(object):
bfddbb17
RD
11933 """
11934 This class represents the position of an item in a virtual grid of
11935 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11936 typemaps that will automatically convert from a 2-element sequence of
11937 integers to a wx.GBPosition, so you can use the more pythonic
11938 representation of the position nearly transparently in Python code.
11939 """
1bd55598
RD
11940 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11941 __repr__ = _swig_repr
11942 def __init__(self, *args, **kwargs):
bfddbb17 11943 """
5b5c9bc7 11944 __init__(self, int row=0, int col=0) -> GBPosition
bfddbb17
RD
11945
11946 This class represents the position of an item in a virtual grid of
11947 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11948 typemaps that will automatically convert from a 2-element sequence of
11949 integers to a wx.GBPosition, so you can use the more pythonic
11950 representation of the position nearly transparently in Python code.
11951 """
1bd55598
RD
11952 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11953 __swig_destroy__ = _core_.delete_GBPosition
11954 __del__ = lambda self : None;
d55e5bfc
RD
11955 def GetRow(*args, **kwargs):
11956 """GetRow(self) -> int"""
5b5c9bc7 11957 return _core_.GBPosition_GetRow(*args, **kwargs)
d55e5bfc
RD
11958
11959 def GetCol(*args, **kwargs):
11960 """GetCol(self) -> int"""
5b5c9bc7 11961 return _core_.GBPosition_GetCol(*args, **kwargs)
d55e5bfc
RD
11962
11963 def SetRow(*args, **kwargs):
11964 """SetRow(self, int row)"""
5b5c9bc7 11965 return _core_.GBPosition_SetRow(*args, **kwargs)
d55e5bfc
RD
11966
11967 def SetCol(*args, **kwargs):
11968 """SetCol(self, int col)"""
5b5c9bc7 11969 return _core_.GBPosition_SetCol(*args, **kwargs)
d55e5bfc
RD
11970
11971 def __eq__(*args, **kwargs):
e9d6f3a4
RD
11972 """
11973 __eq__(self, PyObject other) -> bool
11974
11975 Compare GBPosition for equality.
11976 """
5b5c9bc7 11977 return _core_.GBPosition___eq__(*args, **kwargs)
d55e5bfc
RD
11978
11979 def __ne__(*args, **kwargs):
e9d6f3a4
RD
11980 """
11981 __ne__(self, PyObject other) -> bool
11982
11983 Compare GBPosition for inequality.
11984 """
5b5c9bc7 11985 return _core_.GBPosition___ne__(*args, **kwargs)
d55e5bfc
RD
11986
11987 def Set(*args, **kwargs):
11988 """Set(self, int row=0, int col=0)"""
5b5c9bc7 11989 return _core_.GBPosition_Set(*args, **kwargs)
d55e5bfc
RD
11990
11991 def Get(*args, **kwargs):
11992 """Get(self) -> PyObject"""
5b5c9bc7 11993 return _core_.GBPosition_Get(*args, **kwargs)
d55e5bfc 11994
15817c7e 11995 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
11996 def __str__(self): return str(self.Get())
11997 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11998 def __len__(self): return len(self.Get())
11999 def __getitem__(self, index): return self.Get()[index]
12000 def __setitem__(self, index, val):
12001 if index == 0: self.SetRow(val)
12002 elif index == 1: self.SetCol(val)
12003 else: raise IndexError
12004 def __nonzero__(self): return self.Get() != (0,0)
12005 __safe_for_unpickling__ = True
12006 def __reduce__(self): return (wx.GBPosition, self.Get())
12007
12008 row = property(GetRow, SetRow)
12009 col = property(GetCol, SetCol)
12010
2131d850 12011_core_.GBPosition_swigregister(GBPosition)
d55e5bfc 12012
5b5c9bc7 12013class GBSpan(object):
bfddbb17
RD
12014 """
12015 This class is used to hold the row and column spanning attributes of
12016 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12017 automatically convert from a 2-element sequence of integers to a
12018 wx.GBSpan, so you can use the more pythonic representation of the span
12019 nearly transparently in Python code.
12020
12021 """
1bd55598
RD
12022 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12023 __repr__ = _swig_repr
12024 def __init__(self, *args, **kwargs):
bfddbb17 12025 """
5b5c9bc7 12026 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
bfddbb17
RD
12027
12028 Construct a new wxGBSpan, optionally setting the rowspan and
12029 colspan. The default is (1,1). (Meaning that the item occupies one
12030 cell in each direction.
12031 """
1bd55598
RD
12032 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12033 __swig_destroy__ = _core_.delete_GBSpan
12034 __del__ = lambda self : None;
d55e5bfc
RD
12035 def GetRowspan(*args, **kwargs):
12036 """GetRowspan(self) -> int"""
5b5c9bc7 12037 return _core_.GBSpan_GetRowspan(*args, **kwargs)
d55e5bfc
RD
12038
12039 def GetColspan(*args, **kwargs):
12040 """GetColspan(self) -> int"""
5b5c9bc7 12041 return _core_.GBSpan_GetColspan(*args, **kwargs)
d55e5bfc
RD
12042
12043 def SetRowspan(*args, **kwargs):
12044 """SetRowspan(self, int rowspan)"""
5b5c9bc7 12045 return _core_.GBSpan_SetRowspan(*args, **kwargs)
d55e5bfc
RD
12046
12047 def SetColspan(*args, **kwargs):
12048 """SetColspan(self, int colspan)"""
5b5c9bc7 12049 return _core_.GBSpan_SetColspan(*args, **kwargs)
d55e5bfc
RD
12050
12051 def __eq__(*args, **kwargs):
e9d6f3a4
RD
12052 """
12053 __eq__(self, PyObject other) -> bool
12054
12055 Compare wxGBSpan for equality.
12056 """
5b5c9bc7 12057 return _core_.GBSpan___eq__(*args, **kwargs)
d55e5bfc
RD
12058
12059 def __ne__(*args, **kwargs):
e9d6f3a4
RD
12060 """
12061 __ne__(self, PyObject other) -> bool
12062
12063 Compare GBSpan for inequality.
12064 """
5b5c9bc7 12065 return _core_.GBSpan___ne__(*args, **kwargs)
d55e5bfc
RD
12066
12067 def Set(*args, **kwargs):
12068 """Set(self, int rowspan=1, int colspan=1)"""
5b5c9bc7 12069 return _core_.GBSpan_Set(*args, **kwargs)
d55e5bfc
RD
12070
12071 def Get(*args, **kwargs):
12072 """Get(self) -> PyObject"""
5b5c9bc7 12073 return _core_.GBSpan_Get(*args, **kwargs)
d55e5bfc 12074
15817c7e 12075 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12076 def __str__(self): return str(self.Get())
12077 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12078 def __len__(self): return len(self.Get())
12079 def __getitem__(self, index): return self.Get()[index]
12080 def __setitem__(self, index, val):
12081 if index == 0: self.SetRowspan(val)
12082 elif index == 1: self.SetColspan(val)
12083 else: raise IndexError
12084 def __nonzero__(self): return self.Get() != (0,0)
12085 __safe_for_unpickling__ = True
12086 def __reduce__(self): return (wx.GBSpan, self.Get())
12087
12088 rowspan = property(GetRowspan, SetRowspan)
12089 colspan = property(GetColspan, SetColspan)
12090
2131d850 12091_core_.GBSpan_swigregister(GBSpan)
d55e5bfc 12092
5b5c9bc7 12093class GBSizerItem(SizerItem):
bfddbb17
RD
12094 """
12095 The wx.GBSizerItem class is used to track the additional data about
12096 items in a `wx.GridBagSizer` such as the item's position in the grid
12097 and how many rows or columns it spans.
12098
12099 """
1bd55598
RD
12100 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12101 __repr__ = _swig_repr
12102 def __init__(self, *args, **kwargs):
bfddbb17 12103 """
5b5c9bc7 12104 __init__(self) -> GBSizerItem
bfddbb17
RD
12105
12106 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12107 size will need to be set, as well as a position and span before this
12108 item can be used in a Sizer.
12109
12110 You will probably never need to create a wx.GBSizerItem directly as they
12111 are created automatically when the sizer's Add method is called.
12112 """
1bd55598
RD
12113 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12114 __swig_destroy__ = _core_.delete_GBSizerItem
12115 __del__ = lambda self : None;
d55e5bfc 12116 def GetPos(*args, **kwargs):
bfddbb17 12117 """
5b5c9bc7 12118 GetPos(self) -> GBPosition
bfddbb17
RD
12119
12120 Get the grid position of the item
12121 """
5b5c9bc7 12122 return _core_.GBSizerItem_GetPos(*args, **kwargs)
d55e5bfc
RD
12123
12124 def GetPosTuple(self): return self.GetPos().Get()
12125 def GetSpan(*args, **kwargs):
bfddbb17 12126 """
5b5c9bc7 12127 GetSpan(self) -> GBSpan
bfddbb17
RD
12128
12129 Get the row and column spanning of the item
12130 """
5b5c9bc7 12131 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
d55e5bfc
RD
12132
12133 def GetSpanTuple(self): return self.GetSpan().Get()
12134 def SetPos(*args, **kwargs):
bfddbb17 12135 """
5b5c9bc7 12136 SetPos(self, GBPosition pos) -> bool
bfddbb17
RD
12137
12138 If the item is already a member of a sizer then first ensure that
12139 there is no other item that would intersect with this one at the new
12140 position, then set the new position. Returns True if the change is
12141 successful and after the next Layout() the item will be moved.
12142 """
5b5c9bc7 12143 return _core_.GBSizerItem_SetPos(*args, **kwargs)
d55e5bfc
RD
12144
12145 def SetSpan(*args, **kwargs):
bfddbb17 12146 """
5b5c9bc7 12147 SetSpan(self, GBSpan span) -> bool
bfddbb17
RD
12148
12149 If the item is already a member of a sizer then first ensure that
12150 there is no other item that would intersect with this one with its new
12151 spanning size, then set the new spanning. Returns True if the change
12152 is successful and after the next Layout() the item will be resized.
12153
12154 """
5b5c9bc7 12155 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
d55e5bfc 12156
bfddbb17 12157 def Intersects(*args, **kwargs):
d55e5bfc 12158 """
5b5c9bc7 12159 Intersects(self, GBSizerItem other) -> bool
bfddbb17
RD
12160
12161 Returns True if this item and the other item instersect.
d55e5bfc 12162 """
5b5c9bc7 12163 return _core_.GBSizerItem_Intersects(*args, **kwargs)
bfddbb17
RD
12164
12165 def IntersectsPos(*args, **kwargs):
12166 """
5b5c9bc7 12167 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
bfddbb17
RD
12168
12169 Returns True if the given pos/span would intersect with this item.
12170 """
5b5c9bc7 12171 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
12172
12173 def GetEndPos(*args, **kwargs):
bfddbb17 12174 """
5b5c9bc7 12175 GetEndPos(self) -> GBPosition
bfddbb17
RD
12176
12177 Get the row and column of the endpoint of this item.
12178 """
5b5c9bc7 12179 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
d55e5bfc
RD
12180
12181 def GetGBSizer(*args, **kwargs):
bfddbb17 12182 """
5b5c9bc7 12183 GetGBSizer(self) -> GridBagSizer
bfddbb17
RD
12184
12185 Get the sizer this item is a member of.
12186 """
5b5c9bc7 12187 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
d55e5bfc
RD
12188
12189 def SetGBSizer(*args, **kwargs):
bfddbb17 12190 """
5b5c9bc7 12191 SetGBSizer(self, GridBagSizer sizer)
bfddbb17
RD
12192
12193 Set the sizer this item is a member of.
12194 """
5b5c9bc7 12195 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
d55e5bfc 12196
2131d850 12197_core_.GBSizerItem_swigregister(GBSizerItem)
5b5c9bc7 12198DefaultSpan = cvar.DefaultSpan
d55e5bfc
RD
12199
12200def GBSizerItemWindow(*args, **kwargs):
12201 """
5b5c9bc7
RD
12202 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12203 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12204
12205 Construct a `wx.GBSizerItem` for a window.
d55e5bfc 12206 """
5b5c9bc7 12207 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12208 return val
12209
12210def GBSizerItemSizer(*args, **kwargs):
12211 """
5b5c9bc7
RD
12212 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12213 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12214
12215 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc 12216 """
5b5c9bc7 12217 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12218 return val
12219
12220def GBSizerItemSpacer(*args, **kwargs):
12221 """
5b5c9bc7
RD
12222 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12223 int flag, int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12224
12225 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc 12226 """
5b5c9bc7 12227 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12228 return val
12229
5b5c9bc7 12230class GridBagSizer(FlexGridSizer):
bfddbb17
RD
12231 """
12232 A `wx.Sizer` that can lay out items in a virtual grid like a
12233 `wx.FlexGridSizer` but in this case explicit positioning of the items
12234 is allowed using `wx.GBPosition`, and items can optionally span more
12235 than one row and/or column using `wx.GBSpan`. The total size of the
12236 virtual grid is determined by the largest row and column that items are
12237 positioned at, adjusted for spanning.
12238
12239 """
1bd55598
RD
12240 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12241 __repr__ = _swig_repr
12242 def __init__(self, *args, **kwargs):
bfddbb17 12243 """
5b5c9bc7 12244 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
bfddbb17
RD
12245
12246 Constructor, with optional parameters to specify the gap between the
12247 rows and columns.
12248 """
1bd55598 12249 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
03e46024
RD
12250 self._setOORInfo(self)
12251
d55e5bfc
RD
12252 def Add(*args, **kwargs):
12253 """
bfddbb17 12254 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
070c48b4 12255 int border=0, userData=None) -> wx.GBSizerItem
bfddbb17
RD
12256
12257 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12258 more than one row or column as specified with *span*. The remaining
12259 args behave similarly to `wx.Sizer.Add`.
12260
12261 Returns True if the item was successfully placed at the given cell
12262 position, False if something was already there.
12263
d55e5bfc 12264 """
5b5c9bc7 12265 return _core_.GridBagSizer_Add(*args, **kwargs)
d55e5bfc
RD
12266
12267 def AddItem(*args, **kwargs):
bfddbb17 12268 """
070c48b4 12269 Add(self, GBSizerItem item) -> wx.GBSizerItem
bfddbb17
RD
12270
12271 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12272 the item was successfully placed at its given cell position, False if
12273 something was already there.
12274 """
5b5c9bc7 12275 return _core_.GridBagSizer_AddItem(*args, **kwargs)
d55e5bfc 12276
84f85550
RD
12277 def GetCellSize(*args, **kwargs):
12278 """
5b5c9bc7 12279 GetCellSize(self, int row, int col) -> Size
84f85550
RD
12280
12281 Get the size of the specified cell, including hgap and
12282 vgap. Only valid after a Layout.
12283 """
5b5c9bc7 12284 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
84f85550 12285
d55e5bfc 12286 def GetEmptyCellSize(*args, **kwargs):
bfddbb17 12287 """
5b5c9bc7 12288 GetEmptyCellSize(self) -> Size
bfddbb17
RD
12289
12290 Get the size used for cells in the grid with no item.
12291 """
5b5c9bc7 12292 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12293
12294 def SetEmptyCellSize(*args, **kwargs):
bfddbb17 12295 """
5b5c9bc7 12296 SetEmptyCellSize(self, Size sz)
bfddbb17
RD
12297
12298 Set the size used for cells in the grid with no item.
12299 """
5b5c9bc7 12300 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12301
12302 def GetItemPosition(*args):
12303 """
bfddbb17
RD
12304 GetItemPosition(self, item) -> GBPosition
12305
12306 Get the grid position of the specified *item* where *item* is either a
12307 window or subsizer that is a member of this sizer, or a zero-based
12308 index of an item.
d55e5bfc 12309 """
5b5c9bc7 12310 return _core_.GridBagSizer_GetItemPosition(*args)
d55e5bfc
RD
12311
12312 def SetItemPosition(*args):
12313 """
bfddbb17
RD
12314 SetItemPosition(self, item, GBPosition pos) -> bool
12315
12316 Set the grid position of the specified *item* where *item* is either a
12317 window or subsizer that is a member of this sizer, or a zero-based
12318 index of an item. Returns True on success. If the move is not
12319 allowed (because an item is already there) then False is returned.
12320
d55e5bfc 12321 """
5b5c9bc7 12322 return _core_.GridBagSizer_SetItemPosition(*args)
d55e5bfc
RD
12323
12324 def GetItemSpan(*args):
12325 """
bfddbb17
RD
12326 GetItemSpan(self, item) -> GBSpan
12327
12328 Get the row/col spanning of the specified *item* where *item* is
12329 either a window or subsizer that is a member of this sizer, or a
12330 zero-based index of an item.
d55e5bfc 12331 """
5b5c9bc7 12332 return _core_.GridBagSizer_GetItemSpan(*args)
d55e5bfc
RD
12333
12334 def SetItemSpan(*args):
12335 """
bfddbb17
RD
12336 SetItemSpan(self, item, GBSpan span) -> bool
12337
12338 Set the row/col spanning of the specified *item* where *item* is
12339 either a window or subsizer that is a member of this sizer, or a
12340 zero-based index of an item. Returns True on success. If the move is
12341 not allowed (because an item is already there) then False is returned.
d55e5bfc 12342 """
5b5c9bc7 12343 return _core_.GridBagSizer_SetItemSpan(*args)
d55e5bfc
RD
12344
12345 def FindItem(*args):
12346 """
bfddbb17
RD
12347 FindItem(self, item) -> GBSizerItem
12348
12349 Find the sizer item for the given window or subsizer, returns None if
12350 not found. (non-recursive)
d55e5bfc 12351 """
5b5c9bc7 12352 return _core_.GridBagSizer_FindItem(*args)
d55e5bfc
RD
12353
12354 def FindItemAtPosition(*args, **kwargs):
bfddbb17 12355 """
5b5c9bc7 12356 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
bfddbb17
RD
12357
12358 Return the sizer item for the given grid cell, or None if there is no
12359 item at that position. (non-recursive)
12360 """
5b5c9bc7 12361 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
d55e5bfc
RD
12362
12363 def FindItemAtPoint(*args, **kwargs):
bfddbb17 12364 """
5b5c9bc7 12365 FindItemAtPoint(self, Point pt) -> GBSizerItem
bfddbb17
RD
12366
12367 Return the sizer item located at the point given in *pt*, or None if
12368 there is no item at that point. The (x,y) coordinates in pt correspond
12369 to the client coordinates of the window using the sizer for
12370 layout. (non-recursive)
12371 """
5b5c9bc7 12372 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
d55e5bfc 12373
bfddbb17
RD
12374 def CheckForIntersection(*args, **kwargs):
12375 """
5b5c9bc7 12376 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 12377
bfddbb17
RD
12378 Look at all items and see if any intersect (or would overlap) the
12379 given *item*. Returns True if so, False if there would be no overlap.
12380 If an *excludeItem* is given then it will not be checked for
12381 intersection, for example it may be the item we are checking the
12382 position of.
d55e5bfc 12383
bfddbb17 12384 """
5b5c9bc7 12385 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 12386
bfddbb17 12387 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 12388 """
5b5c9bc7 12389 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
bfddbb17
RD
12390
12391 Look at all items and see if any intersect (or would overlap) the
12392 given position and span. Returns True if so, False if there would be
12393 no overlap. If an *excludeItem* is given then it will not be checked
12394 for intersection, for example it may be the item we are checking the
12395 position of.
d55e5bfc 12396 """
5b5c9bc7 12397 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc 12398
2131d850 12399_core_.GridBagSizer_swigregister(GridBagSizer)
d55e5bfc
RD
12400
12401#---------------------------------------------------------------------------
12402
5b5c9bc7
RD
12403Left = _core_.Left
12404Top = _core_.Top
12405Right = _core_.Right
12406Bottom = _core_.Bottom
12407Width = _core_.Width
12408Height = _core_.Height
12409Centre = _core_.Centre
12410Center = _core_.Center
12411CentreX = _core_.CentreX
12412CentreY = _core_.CentreY
12413Unconstrained = _core_.Unconstrained
12414AsIs = _core_.AsIs
12415PercentOf = _core_.PercentOf
12416Above = _core_.Above
12417Below = _core_.Below
12418LeftOf = _core_.LeftOf
12419RightOf = _core_.RightOf
12420SameAs = _core_.SameAs
12421Absolute = _core_.Absolute
12422class IndividualLayoutConstraint(Object):
d55e5bfc 12423 """
15817c7e
RD
12424 Objects of this class are stored in the `wx.LayoutConstraints` class as
12425 one of eight possible constraints that a window can be involved in.
12426 You will never need to create an instance of
12427 wx.IndividualLayoutConstraint, rather you should create a
12428 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 12429 that it contains.
d55e5bfc 12430 """
1bd55598
RD
12431 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12432 def __init__(self): raise AttributeError, "No constructor defined"
12433 __repr__ = _swig_repr
d55e5bfc 12434 def Set(*args, **kwargs):
15817c7e 12435 """
5b5c9bc7 12436 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
15817c7e
RD
12437
12438 Sets the properties of the constraint. Normally called by one of the
12439 convenience functions such as Above, RightOf, SameAs.
12440 """
5b5c9bc7 12441 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
d55e5bfc
RD
12442
12443 def LeftOf(*args, **kwargs):
12444 """
5b5c9bc7 12445 LeftOf(self, Window sibling, int marg=0)
d55e5bfc 12446
15817c7e
RD
12447 Constrains this edge to be to the left of the given window, with an
12448 optional margin. Implicitly, this is relative to the left edge of the
12449 other window.
d55e5bfc 12450 """
5b5c9bc7 12451 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
d55e5bfc
RD
12452
12453 def RightOf(*args, **kwargs):
12454 """
5b5c9bc7 12455 RightOf(self, Window sibling, int marg=0)
d55e5bfc 12456
15817c7e
RD
12457 Constrains this edge to be to the right of the given window, with an
12458 optional margin. Implicitly, this is relative to the right edge of the
12459 other window.
d55e5bfc 12460 """
5b5c9bc7 12461 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
d55e5bfc
RD
12462
12463 def Above(*args, **kwargs):
12464 """
5b5c9bc7 12465 Above(self, Window sibling, int marg=0)
d55e5bfc 12466
15817c7e
RD
12467 Constrains this edge to be above the given window, with an optional
12468 margin. Implicitly, this is relative to the top edge of the other
12469 window.
d55e5bfc 12470 """
5b5c9bc7 12471 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
d55e5bfc
RD
12472
12473 def Below(*args, **kwargs):
12474 """
5b5c9bc7 12475 Below(self, Window sibling, int marg=0)
d55e5bfc 12476
15817c7e
RD
12477 Constrains this edge to be below the given window, with an optional
12478 margin. Implicitly, this is relative to the bottom edge of the other
12479 window.
d55e5bfc 12480 """
5b5c9bc7 12481 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
d55e5bfc
RD
12482
12483 def SameAs(*args, **kwargs):
12484 """
5b5c9bc7 12485 SameAs(self, Window otherW, int edge, int marg=0)
d55e5bfc 12486
15817c7e
RD
12487 Constrains this edge or dimension to be to the same as the edge of the
12488 given window, with an optional margin.
d55e5bfc 12489 """
5b5c9bc7 12490 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
d55e5bfc
RD
12491
12492 def PercentOf(*args, **kwargs):
12493 """
5b5c9bc7 12494 PercentOf(self, Window otherW, int wh, int per)
d55e5bfc 12495
15817c7e
RD
12496 Constrains this edge or dimension to be to a percentage of the given
12497 window, with an optional margin.
d55e5bfc 12498 """
5b5c9bc7 12499 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
d55e5bfc
RD
12500
12501 def Absolute(*args, **kwargs):
12502 """
12503 Absolute(self, int val)
12504
15817c7e 12505 Constrains this edge or dimension to be the given absolute value.
d55e5bfc 12506 """
5b5c9bc7 12507 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
d55e5bfc
RD
12508
12509 def Unconstrained(*args, **kwargs):
12510 """
12511 Unconstrained(self)
12512
15817c7e
RD
12513 Sets this edge or dimension to be unconstrained, that is, dependent on
12514 other edges and dimensions from which this value can be deduced.
d55e5bfc 12515 """
5b5c9bc7 12516 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
d55e5bfc
RD
12517
12518 def AsIs(*args, **kwargs):
12519 """
12520 AsIs(self)
12521
15817c7e
RD
12522 Sets this edge or constraint to be whatever the window's value is at
12523 the moment. If either of the width and height constraints are *as is*,
12524 the window will not be resized, but moved instead. This is important
12525 when considering panel items which are intended to have a default
12526 size, such as a button, which may take its size from the size of the
12527 button label.
d55e5bfc 12528 """
5b5c9bc7 12529 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
d55e5bfc
RD
12530
12531 def GetOtherWindow(*args, **kwargs):
5b5c9bc7
RD
12532 """GetOtherWindow(self) -> Window"""
12533 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
d55e5bfc
RD
12534
12535 def GetMyEdge(*args, **kwargs):
12536 """GetMyEdge(self) -> int"""
5b5c9bc7 12537 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
d55e5bfc
RD
12538
12539 def SetEdge(*args, **kwargs):
12540 """SetEdge(self, int which)"""
5b5c9bc7 12541 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
d55e5bfc
RD
12542
12543 def SetValue(*args, **kwargs):
12544 """SetValue(self, int v)"""
5b5c9bc7 12545 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
d55e5bfc
RD
12546
12547 def GetMargin(*args, **kwargs):
12548 """GetMargin(self) -> int"""
5b5c9bc7 12549 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
d55e5bfc
RD
12550
12551 def SetMargin(*args, **kwargs):
12552 """SetMargin(self, int m)"""
5b5c9bc7 12553 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
d55e5bfc
RD
12554
12555 def GetValue(*args, **kwargs):
12556 """GetValue(self) -> int"""
5b5c9bc7 12557 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
d55e5bfc
RD
12558
12559 def GetPercent(*args, **kwargs):
12560 """GetPercent(self) -> int"""
5b5c9bc7 12561 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
d55e5bfc
RD
12562
12563 def GetOtherEdge(*args, **kwargs):
12564 """GetOtherEdge(self) -> int"""
5b5c9bc7 12565 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
d55e5bfc
RD
12566
12567 def GetDone(*args, **kwargs):
12568 """GetDone(self) -> bool"""
5b5c9bc7 12569 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
d55e5bfc
RD
12570
12571 def SetDone(*args, **kwargs):
12572 """SetDone(self, bool d)"""
5b5c9bc7 12573 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
d55e5bfc
RD
12574
12575 def GetRelationship(*args, **kwargs):
12576 """GetRelationship(self) -> int"""
5b5c9bc7 12577 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
d55e5bfc
RD
12578
12579 def SetRelationship(*args, **kwargs):
12580 """SetRelationship(self, int r)"""
5b5c9bc7 12581 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
d55e5bfc
RD
12582
12583 def ResetIfWin(*args, **kwargs):
12584 """
5b5c9bc7 12585 ResetIfWin(self, Window otherW) -> bool
d55e5bfc
RD
12586
12587 Reset constraint if it mentions otherWin
12588 """
5b5c9bc7 12589 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
d55e5bfc
RD
12590
12591 def SatisfyConstraint(*args, **kwargs):
12592 """
5b5c9bc7 12593 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
d55e5bfc
RD
12594
12595 Try to satisfy constraint
12596 """
5b5c9bc7 12597 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
d55e5bfc
RD
12598
12599 def GetEdge(*args, **kwargs):
12600 """
5b5c9bc7 12601 GetEdge(self, int which, Window thisWin, Window other) -> int
d55e5bfc
RD
12602
12603 Get the value of this edge or dimension, or if this
12604 is not determinable, -1.
12605 """
5b5c9bc7 12606 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
d55e5bfc 12607
2131d850 12608_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d55e5bfc 12609
5b5c9bc7 12610class LayoutConstraints(Object):
d55e5bfc 12611 """
15817c7e
RD
12612 **Note:** constraints are now deprecated and you should use sizers
12613 instead.
d55e5bfc 12614
15817c7e
RD
12615 Objects of this class can be associated with a window to define its
12616 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
12617
12618 The class consists of the following eight constraints of class
12619 wx.IndividualLayoutConstraint, some or all of which should be accessed
12620 directly to set the appropriate constraints.
12621
12622 * left: represents the left hand edge of the window
12623 * right: represents the right hand edge of the window
12624 * top: represents the top edge of the window
12625 * bottom: represents the bottom edge of the window
12626 * width: represents the width of the window
12627 * height: represents the height of the window
12628 * centreX: represents the horizontal centre point of the window
12629 * centreY: represents the vertical centre point of the window
12630
15817c7e
RD
12631 Most constraints are initially set to have the relationship
12632 wxUnconstrained, which means that their values should be calculated by
12633 looking at known constraints. The exceptions are width and height,
12634 which are set to wxAsIs to ensure that if the user does not specify a
12635 constraint, the existing width and height will be used, to be
12636 compatible with panel items which often have take a default size. If
12637 the constraint is ``wx.AsIs``, the dimension will not be changed.
12638
12639 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
12640
12641 """
1bd55598
RD
12642 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12643 __repr__ = _swig_repr
5b5c9bc7
RD
12644 left = property(_core_.LayoutConstraints_left_get)
12645 top = property(_core_.LayoutConstraints_top_get)
12646 right = property(_core_.LayoutConstraints_right_get)
12647 bottom = property(_core_.LayoutConstraints_bottom_get)
12648 width = property(_core_.LayoutConstraints_width_get)
12649 height = property(_core_.LayoutConstraints_height_get)
12650 centreX = property(_core_.LayoutConstraints_centreX_get)
12651 centreY = property(_core_.LayoutConstraints_centreY_get)
1bd55598 12652 def __init__(self, *args, **kwargs):
5b5c9bc7 12653 """__init__(self) -> LayoutConstraints"""
1bd55598
RD
12654 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12655 __swig_destroy__ = _core_.delete_LayoutConstraints
12656 __del__ = lambda self : None;
d55e5bfc
RD
12657 def SatisfyConstraints(*args, **kwargs):
12658 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
5b5c9bc7 12659 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
d55e5bfc
RD
12660
12661 def AreSatisfied(*args, **kwargs):
12662 """AreSatisfied(self) -> bool"""
5b5c9bc7 12663 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
d55e5bfc 12664
2131d850 12665_core_.LayoutConstraints_swigregister(LayoutConstraints)
d55e5bfc
RD
12666
12667#----------------------------------------------------------------------------
12668
12669# Use Python's bool constants if available, make some if not
12670try:
12671 True
12672except NameError:
12673 __builtins__.True = 1==1
12674 __builtins__.False = 1==0
12675 def bool(value): return not not value
12676 __builtins__.bool = bool
12677
12678
12679
12680# workarounds for bad wxRTTI names
12681__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12682__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12683__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12684
12685
12686#----------------------------------------------------------------------------
12687# Load version numbers from __version__... Ensure that major and minor
0f63ec68 12688# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
12689
12690from __version__ import *
12691__version__ = VERSION_STRING
12692
0f63ec68
RD
12693assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12694assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
12695if RELEASE_VERSION != _core_.RELEASE_VERSION:
12696 import warnings
0f63ec68 12697 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
12698
12699#----------------------------------------------------------------------------
12700
7993762b
RD
12701# Set wxPython's default string<-->unicode conversion encoding from
12702# the locale, but only if Python's default hasn't been changed. (We
12703# assume that if the user has customized it already then that is the
12704# encoding we need to use as well.)
12705#
12706# The encoding selected here is used when string or unicode objects
12707# need to be converted in order to pass them to wxWidgets. Please be
12708# aware that the default encoding within the same locale may be
12709# slightly different on different platforms. For example, please see
62d32a5f
RD
12710# http://www.alanwood.net/demos/charsetdiffs.html for differences
12711# between the common latin/roman encodings.
3837a853
RD
12712
12713default = _sys.getdefaultencoding()
12714if default == 'ascii':
12715 import locale
12716 import codecs
12717 try:
12718 default = locale.getdefaultlocale()[1]
12719 codecs.lookup(default)
7993762b 12720 except (ValueError, LookupError, TypeError):
3837a853
RD
12721 default = _sys.getdefaultencoding()
12722 del locale
12723 del codecs
5cbf236d
RD
12724if default:
12725 wx.SetDefaultPyEncoding(default)
12726del default
5cbf236d
RD
12727
12728#----------------------------------------------------------------------------
12729
d55e5bfc
RD
12730class PyDeadObjectError(AttributeError):
12731 pass
12732
12733class _wxPyDeadObject(object):
12734 """
12735 Instances of wx objects that are OOR capable will have their __class__
12736 changed to this class when the C++ object is deleted. This should help
12737 prevent crashes due to referencing a bogus C++ pointer.
12738 """
12739 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12740 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12741
12742 def __repr__(self):
12743 if not hasattr(self, "_name"):
12744 self._name = "[unknown]"
12745 return self.reprStr % self._name
12746
12747 def __getattr__(self, *args):
12748 if not hasattr(self, "_name"):
12749 self._name = "[unknown]"
12750 raise PyDeadObjectError(self.attrStr % self._name)
12751
12752 def __nonzero__(self):
12753 return 0
12754
12755
12756
12757class PyUnbornObjectError(AttributeError):
12758 pass
12759
12760class _wxPyUnbornObject(object):
12761 """
12762 Some stock objects are created when the wx._core module is
12763 imported, but their C++ instance is not created until the wx.App
12764 object is created and initialized. These object instances will
12765 temporarily have their __class__ changed to this class so an
12766 exception will be raised if they are used before the C++ instance
12767 is ready.
12768 """
12769
12770 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12771 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12772
12773 def __repr__(self):
12774 #if not hasattr(self, "_name"):
12775 # self._name = "[unknown]"
12776 return self.reprStr #% self._name
12777
12778 def __getattr__(self, *args):
12779 #if not hasattr(self, "_name"):
12780 # self._name = "[unknown]"
12781 raise PyUnbornObjectError(self.attrStr) # % self._name )
12782
12783 def __nonzero__(self):
12784 return 0
12785
12786
12787#----------------------------------------------------------------------------
d55e5bfc
RD
12788
12789def CallAfter(callable, *args, **kw):
12790 """
12791 Call the specified function after the current and pending event
12792 handlers have been completed. This is also good for making GUI
0439c23b
RD
12793 method calls from non-GUI threads. Any extra positional or
12794 keyword args are passed on to the callable when it is called.
12795
12796 :see: `wx.FutureCall`
d55e5bfc
RD
12797 """
12798 app = wx.GetApp()
a001823c 12799 assert app is not None, 'No wx.App created yet'
d55e5bfc 12800
891bb194
RD
12801 if not hasattr(app, "_CallAfterId"):
12802 app._CallAfterId = wx.NewEventType()
12803 app.Connect(-1, -1, app._CallAfterId,
12804 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 12805 evt = wx.PyEvent()
891bb194 12806 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
12807 evt.callable = callable
12808 evt.args = args
12809 evt.kw = kw
12810 wx.PostEvent(app, evt)
12811
d55e5bfc
RD
12812#----------------------------------------------------------------------------
12813
12814
12815class FutureCall:
12816 """
6e0de3df 12817 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
12818 object once after the given amount of milliseconds, passing any
12819 positional or keyword args. The return value of the callable is
0439c23b 12820 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
12821
12822 If you don't need to get the return value or restart the timer
12823 then there is no need to hold a reference to this object. It will
12824 hold a reference to itself while the timer is running (the timer
12825 has a reference to self.Notify) but the cycle will be broken when
12826 the timer completes, automatically cleaning up the wx.FutureCall
12827 object.
0439c23b
RD
12828
12829 :see: `wx.CallAfter`
d55e5bfc
RD
12830 """
12831 def __init__(self, millis, callable, *args, **kwargs):
12832 self.millis = millis
12833 self.callable = callable
12834 self.SetArgs(*args, **kwargs)
12835 self.runCount = 0
12836 self.running = False
12837 self.hasRun = False
12838 self.result = None
12839 self.timer = None
12840 self.Start()
12841
12842 def __del__(self):
12843 self.Stop()
12844
12845
12846 def Start(self, millis=None, *args, **kwargs):
12847 """
12848 (Re)start the timer
12849 """
12850 self.hasRun = False
12851 if millis is not None:
12852 self.millis = millis
12853 if args or kwargs:
12854 self.SetArgs(*args, **kwargs)
12855 self.Stop()
12856 self.timer = wx.PyTimer(self.Notify)
12857 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
12858 self.running = True
12859 Restart = Start
12860
12861
12862 def Stop(self):
12863 """
12864 Stop and destroy the timer.
12865 """
12866 if self.timer is not None:
12867 self.timer.Stop()
12868 self.timer = None
12869
12870
12871 def GetInterval(self):
12872 if self.timer is not None:
12873 return self.timer.GetInterval()
12874 else:
12875 return 0
12876
12877
12878 def IsRunning(self):
12879 return self.timer is not None and self.timer.IsRunning()
12880
12881
12882 def SetArgs(self, *args, **kwargs):
12883 """
12884 (Re)set the args passed to the callable object. This is
12885 useful in conjunction with Restart if you want to schedule a
12886 new call to the same callable object but with different
12887 parameters.
12888 """
12889 self.args = args
12890 self.kwargs = kwargs
12891
12892
12893 def HasRun(self):
12894 return self.hasRun
12895
12896 def GetResult(self):
12897 return self.result
12898
12899 def Notify(self):
12900 """
12901 The timer has expired so call the callable.
12902 """
12903 if self.callable and getattr(self.callable, 'im_self', True):
12904 self.runCount += 1
12905 self.running = False
12906 self.result = self.callable(*self.args, **self.kwargs)
12907 self.hasRun = True
12908 if not self.running:
12909 # if it wasn't restarted, then cleanup
12910 wx.CallAfter(self.Stop)
12911
12912
12913
12914#----------------------------------------------------------------------------
12915# Control which items in this module should be documented by epydoc.
12916# We allow only classes and functions, which will help reduce the size
12917# of the docs by filtering out the zillions of constants, EVT objects,
12918# and etc that don't make much sense by themselves, but are instead
12919# documented (or will be) as part of the classes/functions/methods
12920# where they should be used.
12921
d6c14a4c
RD
12922class __DocFilter:
12923 """
12924 A filter for epydoc that only allows non-Ptr classes and
34e0a3bb 12925 functions, in order to reduce the clutter in the API docs.
d6c14a4c
RD
12926 """
12927 def __init__(self, globals):
12928 self._globals = globals
12929
12930 def __call__(self, name):
12931 import types
12932 obj = self._globals.get(name, None)
34e0a3bb
RD
12933
12934 # only document classes and function
d6c14a4c
RD
12935 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12936 return False
34e0a3bb
RD
12937
12938 # skip other things that are private or will be documented as part of somethign else
1bd55598 12939 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
d6c14a4c 12940 return False
34e0a3bb
RD
12941
12942 # skip functions that are duplicates of static functions in a class
12943 if name.find('_') != -1:
12944 cls = self._globals.get(name.split('_')[0], None)
12945 methname = name.split('_')[1]
12946 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
12947 return False
12948
d6c14a4c 12949 return True
d55e5bfc
RD
12950
12951#----------------------------------------------------------------------------
12952#----------------------------------------------------------------------------
12953
12954# Import other modules in this package that should show up in the
12955# "core" wx namespace
12956from _gdi import *
12957from _windows import *
12958from _controls import *
12959from _misc import *
12960
d55e5bfc
RD
12961#----------------------------------------------------------------------------
12962#----------------------------------------------------------------------------
12963
12964
32fe5131 12965