]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/mac/_core.py
Add wx.menuBar.UpdateMenus
[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
34e0a3bb 125CB_FILENAME = _core_.CB_FILENAME
5b5c9bc7
RD
126RA_HORIZONTAL = _core_.RA_HORIZONTAL
127RA_VERTICAL = _core_.RA_VERTICAL
128RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
129RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
130RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
131RB_GROUP = _core_.RB_GROUP
132RB_SINGLE = _core_.RB_SINGLE
133SB_HORIZONTAL = _core_.SB_HORIZONTAL
134SB_VERTICAL = _core_.SB_VERTICAL
135RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
136ST_SIZEGRIP = _core_.ST_SIZEGRIP
137ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
e9d6f3a4
RD
138ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
139ST_DOTS_END = _core_.ST_DOTS_END
5b5c9bc7
RD
140FLOOD_SURFACE = _core_.FLOOD_SURFACE
141FLOOD_BORDER = _core_.FLOOD_BORDER
142ODDEVEN_RULE = _core_.ODDEVEN_RULE
143WINDING_RULE = _core_.WINDING_RULE
144TOOL_TOP = _core_.TOOL_TOP
145TOOL_BOTTOM = _core_.TOOL_BOTTOM
146TOOL_LEFT = _core_.TOOL_LEFT
147TOOL_RIGHT = _core_.TOOL_RIGHT
148OK = _core_.OK
149YES_NO = _core_.YES_NO
150CANCEL = _core_.CANCEL
151YES = _core_.YES
152NO = _core_.NO
153NO_DEFAULT = _core_.NO_DEFAULT
154YES_DEFAULT = _core_.YES_DEFAULT
155ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
156ICON_HAND = _core_.ICON_HAND
157ICON_QUESTION = _core_.ICON_QUESTION
158ICON_INFORMATION = _core_.ICON_INFORMATION
159ICON_STOP = _core_.ICON_STOP
160ICON_ASTERISK = _core_.ICON_ASTERISK
161ICON_MASK = _core_.ICON_MASK
162ICON_WARNING = _core_.ICON_WARNING
163ICON_ERROR = _core_.ICON_ERROR
164FORWARD = _core_.FORWARD
165BACKWARD = _core_.BACKWARD
166RESET = _core_.RESET
167HELP = _core_.HELP
168MORE = _core_.MORE
169SETUP = _core_.SETUP
170SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
171SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
172SIZE_AUTO = _core_.SIZE_AUTO
173SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
174SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
943e8dfd 175SIZE_FORCE = _core_.SIZE_FORCE
5b5c9bc7
RD
176PORTRAIT = _core_.PORTRAIT
177LANDSCAPE = _core_.LANDSCAPE
178PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
179PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
180PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
181PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
182ID_ANY = _core_.ID_ANY
183ID_SEPARATOR = _core_.ID_SEPARATOR
943e8dfd 184ID_NONE = _core_.ID_NONE
5b5c9bc7
RD
185ID_LOWEST = _core_.ID_LOWEST
186ID_OPEN = _core_.ID_OPEN
187ID_CLOSE = _core_.ID_CLOSE
188ID_NEW = _core_.ID_NEW
189ID_SAVE = _core_.ID_SAVE
190ID_SAVEAS = _core_.ID_SAVEAS
191ID_REVERT = _core_.ID_REVERT
192ID_EXIT = _core_.ID_EXIT
193ID_UNDO = _core_.ID_UNDO
194ID_REDO = _core_.ID_REDO
195ID_HELP = _core_.ID_HELP
196ID_PRINT = _core_.ID_PRINT
197ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
198ID_PREVIEW = _core_.ID_PREVIEW
199ID_ABOUT = _core_.ID_ABOUT
200ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
201ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
202ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
203ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
1eeb270e
RD
204ID_HELP_INDEX = _core_.ID_HELP_INDEX
205ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
5b5c9bc7
RD
206ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
207ID_PREFERENCES = _core_.ID_PREFERENCES
208ID_CUT = _core_.ID_CUT
209ID_COPY = _core_.ID_COPY
210ID_PASTE = _core_.ID_PASTE
211ID_CLEAR = _core_.ID_CLEAR
212ID_FIND = _core_.ID_FIND
213ID_DUPLICATE = _core_.ID_DUPLICATE
214ID_SELECTALL = _core_.ID_SELECTALL
215ID_DELETE = _core_.ID_DELETE
216ID_REPLACE = _core_.ID_REPLACE
217ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
218ID_PROPERTIES = _core_.ID_PROPERTIES
219ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
220ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
221ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
222ID_VIEW_LIST = _core_.ID_VIEW_LIST
223ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
224ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
225ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
226ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
227ID_FILE1 = _core_.ID_FILE1
228ID_FILE2 = _core_.ID_FILE2
229ID_FILE3 = _core_.ID_FILE3
230ID_FILE4 = _core_.ID_FILE4
231ID_FILE5 = _core_.ID_FILE5
232ID_FILE6 = _core_.ID_FILE6
233ID_FILE7 = _core_.ID_FILE7
234ID_FILE8 = _core_.ID_FILE8
235ID_FILE9 = _core_.ID_FILE9
236ID_OK = _core_.ID_OK
237ID_CANCEL = _core_.ID_CANCEL
238ID_APPLY = _core_.ID_APPLY
239ID_YES = _core_.ID_YES
240ID_NO = _core_.ID_NO
241ID_STATIC = _core_.ID_STATIC
242ID_FORWARD = _core_.ID_FORWARD
243ID_BACKWARD = _core_.ID_BACKWARD
244ID_DEFAULT = _core_.ID_DEFAULT
245ID_MORE = _core_.ID_MORE
246ID_SETUP = _core_.ID_SETUP
247ID_RESET = _core_.ID_RESET
248ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
249ID_YESTOALL = _core_.ID_YESTOALL
250ID_NOTOALL = _core_.ID_NOTOALL
251ID_ABORT = _core_.ID_ABORT
252ID_RETRY = _core_.ID_RETRY
253ID_IGNORE = _core_.ID_IGNORE
254ID_ADD = _core_.ID_ADD
255ID_REMOVE = _core_.ID_REMOVE
256ID_UP = _core_.ID_UP
257ID_DOWN = _core_.ID_DOWN
258ID_HOME = _core_.ID_HOME
259ID_REFRESH = _core_.ID_REFRESH
260ID_STOP = _core_.ID_STOP
261ID_INDEX = _core_.ID_INDEX
262ID_BOLD = _core_.ID_BOLD
263ID_ITALIC = _core_.ID_ITALIC
264ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
265ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
266ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
267ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
268ID_UNDERLINE = _core_.ID_UNDERLINE
269ID_INDENT = _core_.ID_INDENT
270ID_UNINDENT = _core_.ID_UNINDENT
271ID_ZOOM_100 = _core_.ID_ZOOM_100
272ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
273ID_ZOOM_IN = _core_.ID_ZOOM_IN
274ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
275ID_UNDELETE = _core_.ID_UNDELETE
276ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
277ID_HIGHEST = _core_.ID_HIGHEST
5b5c9bc7
RD
278ACCEL_ALT = _core_.ACCEL_ALT
279ACCEL_CTRL = _core_.ACCEL_CTRL
280ACCEL_SHIFT = _core_.ACCEL_SHIFT
281ACCEL_NORMAL = _core_.ACCEL_NORMAL
282PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
283PD_APP_MODAL = _core_.PD_APP_MODAL
284PD_CAN_ABORT = _core_.PD_CAN_ABORT
285PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
286PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
287PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
288PD_SMOOTH = _core_.PD_SMOOTH
289PD_CAN_SKIP = _core_.PD_CAN_SKIP
5b5c9bc7
RD
290MENU_TEAROFF = _core_.MENU_TEAROFF
291MB_DOCKABLE = _core_.MB_DOCKABLE
292NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
293FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
294LI_HORIZONTAL = _core_.LI_HORIZONTAL
295LI_VERTICAL = _core_.LI_VERTICAL
296WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
297WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
298WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
299WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
300WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
301WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
302MM_TEXT = _core_.MM_TEXT
303MM_LOMETRIC = _core_.MM_LOMETRIC
304MM_HIMETRIC = _core_.MM_HIMETRIC
305MM_LOENGLISH = _core_.MM_LOENGLISH
306MM_HIENGLISH = _core_.MM_HIENGLISH
307MM_TWIPS = _core_.MM_TWIPS
308MM_ISOTROPIC = _core_.MM_ISOTROPIC
309MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
310MM_POINTS = _core_.MM_POINTS
311MM_METRIC = _core_.MM_METRIC
312CENTRE = _core_.CENTRE
313CENTER = _core_.CENTER
314HORIZONTAL = _core_.HORIZONTAL
315VERTICAL = _core_.VERTICAL
316BOTH = _core_.BOTH
317LEFT = _core_.LEFT
318RIGHT = _core_.RIGHT
319UP = _core_.UP
320DOWN = _core_.DOWN
321TOP = _core_.TOP
322BOTTOM = _core_.BOTTOM
323NORTH = _core_.NORTH
324SOUTH = _core_.SOUTH
325WEST = _core_.WEST
326EAST = _core_.EAST
327ALL = _core_.ALL
328ALIGN_NOT = _core_.ALIGN_NOT
329ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
330ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
331ALIGN_LEFT = _core_.ALIGN_LEFT
332ALIGN_TOP = _core_.ALIGN_TOP
333ALIGN_RIGHT = _core_.ALIGN_RIGHT
334ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
335ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
336ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
337ALIGN_CENTER = _core_.ALIGN_CENTER
338ALIGN_CENTRE = _core_.ALIGN_CENTRE
339ALIGN_MASK = _core_.ALIGN_MASK
340STRETCH_NOT = _core_.STRETCH_NOT
341SHRINK = _core_.SHRINK
342GROW = _core_.GROW
343EXPAND = _core_.EXPAND
344SHAPED = _core_.SHAPED
345FIXED_MINSIZE = _core_.FIXED_MINSIZE
346TILE = _core_.TILE
347ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
348BORDER_DEFAULT = _core_.BORDER_DEFAULT
349BORDER_NONE = _core_.BORDER_NONE
350BORDER_STATIC = _core_.BORDER_STATIC
351BORDER_SIMPLE = _core_.BORDER_SIMPLE
352BORDER_RAISED = _core_.BORDER_RAISED
353BORDER_SUNKEN = _core_.BORDER_SUNKEN
354BORDER_DOUBLE = _core_.BORDER_DOUBLE
355BORDER_MASK = _core_.BORDER_MASK
356BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
357BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
358BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
359DEFAULT = _core_.DEFAULT
360DECORATIVE = _core_.DECORATIVE
361ROMAN = _core_.ROMAN
362SCRIPT = _core_.SCRIPT
363SWISS = _core_.SWISS
364MODERN = _core_.MODERN
365TELETYPE = _core_.TELETYPE
366VARIABLE = _core_.VARIABLE
367FIXED = _core_.FIXED
368NORMAL = _core_.NORMAL
369LIGHT = _core_.LIGHT
370BOLD = _core_.BOLD
371ITALIC = _core_.ITALIC
372SLANT = _core_.SLANT
373SOLID = _core_.SOLID
374DOT = _core_.DOT
375LONG_DASH = _core_.LONG_DASH
376SHORT_DASH = _core_.SHORT_DASH
377DOT_DASH = _core_.DOT_DASH
378USER_DASH = _core_.USER_DASH
379TRANSPARENT = _core_.TRANSPARENT
380STIPPLE = _core_.STIPPLE
d04418a7
RD
381STIPPLE_MASK = _core_.STIPPLE_MASK
382STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
5b5c9bc7
RD
383BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
384CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
385FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
386CROSS_HATCH = _core_.CROSS_HATCH
387HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
388VERTICAL_HATCH = _core_.VERTICAL_HATCH
389JOIN_BEVEL = _core_.JOIN_BEVEL
390JOIN_MITER = _core_.JOIN_MITER
391JOIN_ROUND = _core_.JOIN_ROUND
392CAP_ROUND = _core_.CAP_ROUND
393CAP_PROJECTING = _core_.CAP_PROJECTING
394CAP_BUTT = _core_.CAP_BUTT
395CLEAR = _core_.CLEAR
396XOR = _core_.XOR
397INVERT = _core_.INVERT
398OR_REVERSE = _core_.OR_REVERSE
399AND_REVERSE = _core_.AND_REVERSE
400COPY = _core_.COPY
401AND = _core_.AND
402AND_INVERT = _core_.AND_INVERT
403NO_OP = _core_.NO_OP
404NOR = _core_.NOR
405EQUIV = _core_.EQUIV
406SRC_INVERT = _core_.SRC_INVERT
407OR_INVERT = _core_.OR_INVERT
408NAND = _core_.NAND
409OR = _core_.OR
410SET = _core_.SET
411WXK_BACK = _core_.WXK_BACK
412WXK_TAB = _core_.WXK_TAB
413WXK_RETURN = _core_.WXK_RETURN
414WXK_ESCAPE = _core_.WXK_ESCAPE
415WXK_SPACE = _core_.WXK_SPACE
416WXK_DELETE = _core_.WXK_DELETE
417WXK_START = _core_.WXK_START
418WXK_LBUTTON = _core_.WXK_LBUTTON
419WXK_RBUTTON = _core_.WXK_RBUTTON
420WXK_CANCEL = _core_.WXK_CANCEL
421WXK_MBUTTON = _core_.WXK_MBUTTON
422WXK_CLEAR = _core_.WXK_CLEAR
423WXK_SHIFT = _core_.WXK_SHIFT
424WXK_ALT = _core_.WXK_ALT
425WXK_CONTROL = _core_.WXK_CONTROL
426WXK_MENU = _core_.WXK_MENU
427WXK_PAUSE = _core_.WXK_PAUSE
428WXK_CAPITAL = _core_.WXK_CAPITAL
429WXK_PRIOR = _core_.WXK_PRIOR
430WXK_NEXT = _core_.WXK_NEXT
431WXK_END = _core_.WXK_END
432WXK_HOME = _core_.WXK_HOME
433WXK_LEFT = _core_.WXK_LEFT
434WXK_UP = _core_.WXK_UP
435WXK_RIGHT = _core_.WXK_RIGHT
436WXK_DOWN = _core_.WXK_DOWN
437WXK_SELECT = _core_.WXK_SELECT
438WXK_PRINT = _core_.WXK_PRINT
439WXK_EXECUTE = _core_.WXK_EXECUTE
440WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
441WXK_INSERT = _core_.WXK_INSERT
442WXK_HELP = _core_.WXK_HELP
443WXK_NUMPAD0 = _core_.WXK_NUMPAD0
444WXK_NUMPAD1 = _core_.WXK_NUMPAD1
445WXK_NUMPAD2 = _core_.WXK_NUMPAD2
446WXK_NUMPAD3 = _core_.WXK_NUMPAD3
447WXK_NUMPAD4 = _core_.WXK_NUMPAD4
448WXK_NUMPAD5 = _core_.WXK_NUMPAD5
449WXK_NUMPAD6 = _core_.WXK_NUMPAD6
450WXK_NUMPAD7 = _core_.WXK_NUMPAD7
451WXK_NUMPAD8 = _core_.WXK_NUMPAD8
452WXK_NUMPAD9 = _core_.WXK_NUMPAD9
453WXK_MULTIPLY = _core_.WXK_MULTIPLY
454WXK_ADD = _core_.WXK_ADD
455WXK_SEPARATOR = _core_.WXK_SEPARATOR
456WXK_SUBTRACT = _core_.WXK_SUBTRACT
457WXK_DECIMAL = _core_.WXK_DECIMAL
458WXK_DIVIDE = _core_.WXK_DIVIDE
459WXK_F1 = _core_.WXK_F1
460WXK_F2 = _core_.WXK_F2
461WXK_F3 = _core_.WXK_F3
462WXK_F4 = _core_.WXK_F4
463WXK_F5 = _core_.WXK_F5
464WXK_F6 = _core_.WXK_F6
465WXK_F7 = _core_.WXK_F7
466WXK_F8 = _core_.WXK_F8
467WXK_F9 = _core_.WXK_F9
468WXK_F10 = _core_.WXK_F10
469WXK_F11 = _core_.WXK_F11
470WXK_F12 = _core_.WXK_F12
471WXK_F13 = _core_.WXK_F13
472WXK_F14 = _core_.WXK_F14
473WXK_F15 = _core_.WXK_F15
474WXK_F16 = _core_.WXK_F16
475WXK_F17 = _core_.WXK_F17
476WXK_F18 = _core_.WXK_F18
477WXK_F19 = _core_.WXK_F19
478WXK_F20 = _core_.WXK_F20
479WXK_F21 = _core_.WXK_F21
480WXK_F22 = _core_.WXK_F22
481WXK_F23 = _core_.WXK_F23
482WXK_F24 = _core_.WXK_F24
483WXK_NUMLOCK = _core_.WXK_NUMLOCK
484WXK_SCROLL = _core_.WXK_SCROLL
485WXK_PAGEUP = _core_.WXK_PAGEUP
486WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
487WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
488WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
489WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
490WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
491WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
492WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
493WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
494WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
495WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
496WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
497WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
498WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
499WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
500WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
501WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
502WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
503WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
504WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
505WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
506WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
507WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
508WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
509WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
510WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
511WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
512WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
513WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
514WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
515WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
516WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
517WXK_COMMAND = _core_.WXK_COMMAND
518WXK_SPECIAL1 = _core_.WXK_SPECIAL1
519WXK_SPECIAL2 = _core_.WXK_SPECIAL2
520WXK_SPECIAL3 = _core_.WXK_SPECIAL3
521WXK_SPECIAL4 = _core_.WXK_SPECIAL4
522WXK_SPECIAL5 = _core_.WXK_SPECIAL5
523WXK_SPECIAL6 = _core_.WXK_SPECIAL6
524WXK_SPECIAL7 = _core_.WXK_SPECIAL7
525WXK_SPECIAL8 = _core_.WXK_SPECIAL8
526WXK_SPECIAL9 = _core_.WXK_SPECIAL9
527WXK_SPECIAL10 = _core_.WXK_SPECIAL10
528WXK_SPECIAL11 = _core_.WXK_SPECIAL11
529WXK_SPECIAL12 = _core_.WXK_SPECIAL12
530WXK_SPECIAL13 = _core_.WXK_SPECIAL13
531WXK_SPECIAL14 = _core_.WXK_SPECIAL14
532WXK_SPECIAL15 = _core_.WXK_SPECIAL15
533WXK_SPECIAL16 = _core_.WXK_SPECIAL16
534WXK_SPECIAL17 = _core_.WXK_SPECIAL17
535WXK_SPECIAL18 = _core_.WXK_SPECIAL18
536WXK_SPECIAL19 = _core_.WXK_SPECIAL19
537WXK_SPECIAL20 = _core_.WXK_SPECIAL20
538PAPER_NONE = _core_.PAPER_NONE
539PAPER_LETTER = _core_.PAPER_LETTER
540PAPER_LEGAL = _core_.PAPER_LEGAL
541PAPER_A4 = _core_.PAPER_A4
542PAPER_CSHEET = _core_.PAPER_CSHEET
543PAPER_DSHEET = _core_.PAPER_DSHEET
544PAPER_ESHEET = _core_.PAPER_ESHEET
545PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
546PAPER_TABLOID = _core_.PAPER_TABLOID
547PAPER_LEDGER = _core_.PAPER_LEDGER
548PAPER_STATEMENT = _core_.PAPER_STATEMENT
549PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
550PAPER_A3 = _core_.PAPER_A3
551PAPER_A4SMALL = _core_.PAPER_A4SMALL
552PAPER_A5 = _core_.PAPER_A5
553PAPER_B4 = _core_.PAPER_B4
554PAPER_B5 = _core_.PAPER_B5
555PAPER_FOLIO = _core_.PAPER_FOLIO
556PAPER_QUARTO = _core_.PAPER_QUARTO
557PAPER_10X14 = _core_.PAPER_10X14
558PAPER_11X17 = _core_.PAPER_11X17
559PAPER_NOTE = _core_.PAPER_NOTE
560PAPER_ENV_9 = _core_.PAPER_ENV_9
561PAPER_ENV_10 = _core_.PAPER_ENV_10
562PAPER_ENV_11 = _core_.PAPER_ENV_11
563PAPER_ENV_12 = _core_.PAPER_ENV_12
564PAPER_ENV_14 = _core_.PAPER_ENV_14
565PAPER_ENV_DL = _core_.PAPER_ENV_DL
566PAPER_ENV_C5 = _core_.PAPER_ENV_C5
567PAPER_ENV_C3 = _core_.PAPER_ENV_C3
568PAPER_ENV_C4 = _core_.PAPER_ENV_C4
569PAPER_ENV_C6 = _core_.PAPER_ENV_C6
570PAPER_ENV_C65 = _core_.PAPER_ENV_C65
571PAPER_ENV_B4 = _core_.PAPER_ENV_B4
572PAPER_ENV_B5 = _core_.PAPER_ENV_B5
573PAPER_ENV_B6 = _core_.PAPER_ENV_B6
574PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
575PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
576PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
577PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
578PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
579PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
580PAPER_ISO_B4 = _core_.PAPER_ISO_B4
581PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
582PAPER_9X11 = _core_.PAPER_9X11
583PAPER_10X11 = _core_.PAPER_10X11
584PAPER_15X11 = _core_.PAPER_15X11
585PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
586PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
587PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
588PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
589PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
590PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
591PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
592PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
593PAPER_A_PLUS = _core_.PAPER_A_PLUS
594PAPER_B_PLUS = _core_.PAPER_B_PLUS
595PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
596PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
597PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
598PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
599PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
600PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
601PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
602PAPER_A2 = _core_.PAPER_A2
603PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
604PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
034e3677
RD
605PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
606PAPER_A6 = _core_.PAPER_A6
607PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
608PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
609PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
610PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
611PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
612PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
613PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
614PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
615PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
616PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
617PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
618PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
619PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
620PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
621PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
622PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
623PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
624PAPER_B6_JIS = _core_.PAPER_B6_JIS
625PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
626PAPER_12X11 = _core_.PAPER_12X11
627PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
628PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
629PAPER_P16K = _core_.PAPER_P16K
630PAPER_P32K = _core_.PAPER_P32K
631PAPER_P32KBIG = _core_.PAPER_P32KBIG
632PAPER_PENV_1 = _core_.PAPER_PENV_1
633PAPER_PENV_2 = _core_.PAPER_PENV_2
634PAPER_PENV_3 = _core_.PAPER_PENV_3
635PAPER_PENV_4 = _core_.PAPER_PENV_4
636PAPER_PENV_5 = _core_.PAPER_PENV_5
637PAPER_PENV_6 = _core_.PAPER_PENV_6
638PAPER_PENV_7 = _core_.PAPER_PENV_7
639PAPER_PENV_8 = _core_.PAPER_PENV_8
640PAPER_PENV_9 = _core_.PAPER_PENV_9
641PAPER_PENV_10 = _core_.PAPER_PENV_10
642PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
643PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
644PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
645PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
646PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
647PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
648PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
649PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
650PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
651PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
652PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
653PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
654PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
5b5c9bc7
RD
655DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
656DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
657DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
658ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
659ITEM_NORMAL = _core_.ITEM_NORMAL
660ITEM_CHECK = _core_.ITEM_CHECK
661ITEM_RADIO = _core_.ITEM_RADIO
662ITEM_MAX = _core_.ITEM_MAX
663HT_NOWHERE = _core_.HT_NOWHERE
664HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
665HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
666HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
667HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
668HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
669HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
670HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
671HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
672HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
673HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
674HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
675HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
676HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
677HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
678HT_MAX = _core_.HT_MAX
679MOD_NONE = _core_.MOD_NONE
680MOD_ALT = _core_.MOD_ALT
681MOD_CONTROL = _core_.MOD_CONTROL
943e8dfd 682MOD_ALTGR = _core_.MOD_ALTGR
5b5c9bc7 683MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 684MOD_META = _core_.MOD_META
5b5c9bc7 685MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
686MOD_CMD = _core_.MOD_CMD
687MOD_ALL = _core_.MOD_ALL
5b5c9bc7
RD
688UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
689UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
690UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d55e5bfc
RD
691#---------------------------------------------------------------------------
692
5b5c9bc7 693class Object(object):
d55e5bfc
RD
694 """
695 The base class for most wx objects, although in wxPython not
696 much functionality is needed nor exposed.
697 """
1bd55598
RD
698 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
699 def __init__(self): raise AttributeError, "No constructor defined"
700 __repr__ = _swig_repr
d55e5bfc
RD
701 def GetClassName(*args, **kwargs):
702 """
5b5c9bc7 703 GetClassName(self) -> String
d55e5bfc
RD
704
705 Returns the class name of the C++ class using wxRTTI.
706 """
5b5c9bc7 707 return _core_.Object_GetClassName(*args, **kwargs)
d55e5bfc
RD
708
709 def Destroy(*args, **kwargs):
710 """
711 Destroy(self)
712
713 Deletes the C++ object this Python object is a proxy for.
714 """
7e08d4ef
RD
715 val = _core_.Object_Destroy(*args, **kwargs)
716 args[0].thisown = 0
717 return val
d55e5bfc 718
2131d850 719_core_.Object_swigregister(Object)
5b5c9bc7 720_wxPySetDictionary = _core_._wxPySetDictionary
5b5c9bc7 721cvar = _core_.cvar
d55e5bfc
RD
722EmptyString = cvar.EmptyString
723
724#---------------------------------------------------------------------------
725
5b5c9bc7
RD
726BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
727BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
728BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
729BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
730BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
731BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
732BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
733BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
734BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
735BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
736BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
737BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
738BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
739BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
740BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
741BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
742BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
743BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
744BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
745BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
746CURSOR_NONE = _core_.CURSOR_NONE
747CURSOR_ARROW = _core_.CURSOR_ARROW
748CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
749CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
750CURSOR_CHAR = _core_.CURSOR_CHAR
751CURSOR_CROSS = _core_.CURSOR_CROSS
752CURSOR_HAND = _core_.CURSOR_HAND
753CURSOR_IBEAM = _core_.CURSOR_IBEAM
754CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
755CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
756CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
757CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
758CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
759CURSOR_PENCIL = _core_.CURSOR_PENCIL
760CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
761CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
762CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
763CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
764CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
765CURSOR_SIZENS = _core_.CURSOR_SIZENS
766CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
767CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
768CURSOR_SIZING = _core_.CURSOR_SIZING
769CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
770CURSOR_WAIT = _core_.CURSOR_WAIT
771CURSOR_WATCH = _core_.CURSOR_WATCH
772CURSOR_BLANK = _core_.CURSOR_BLANK
773CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
774CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
775CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
776CURSOR_MAX = _core_.CURSOR_MAX
d55e5bfc
RD
777#---------------------------------------------------------------------------
778
5b5c9bc7 779class Size(object):
d55e5bfc 780 """
15817c7e 781 wx.Size is a useful data structure used to represent the size of
1bd55598
RD
782 something. It simply contains integer width and height
783 properties. In most places in wxPython where a wx.Size is
36ed4f51 784 expected a (width, height) tuple can be used instead.
d55e5bfc 785 """
1bd55598
RD
786 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
787 __repr__ = _swig_repr
5b5c9bc7
RD
788 width = property(_core_.Size_width_get, _core_.Size_width_set)
789 height = property(_core_.Size_height_get, _core_.Size_height_set)
d55e5bfc 790 x = width; y = height
1bd55598 791 def __init__(self, *args, **kwargs):
d55e5bfc 792 """
5b5c9bc7 793 __init__(self, int w=0, int h=0) -> Size
d55e5bfc
RD
794
795 Creates a size object.
796 """
1bd55598
RD
797 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
798 __swig_destroy__ = _core_.delete_Size
799 __del__ = lambda self : None;
d55e5bfc
RD
800 def __eq__(*args, **kwargs):
801 """
e9d6f3a4 802 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
803
804 Test for equality of wx.Size objects.
805 """
5b5c9bc7 806 return _core_.Size___eq__(*args, **kwargs)
d55e5bfc
RD
807
808 def __ne__(*args, **kwargs):
809 """
e9d6f3a4 810 __ne__(self, PyObject other) -> bool
d55e5bfc 811
e9d6f3a4 812 Test for inequality of wx.Size objects.
d55e5bfc 813 """
5b5c9bc7 814 return _core_.Size___ne__(*args, **kwargs)
d55e5bfc
RD
815
816 def __add__(*args, **kwargs):
817 """
5b5c9bc7 818 __add__(self, Size sz) -> Size
d55e5bfc
RD
819
820 Add sz's proprties to this and return the result.
821 """
5b5c9bc7 822 return _core_.Size___add__(*args, **kwargs)
d55e5bfc
RD
823
824 def __sub__(*args, **kwargs):
825 """
5b5c9bc7 826 __sub__(self, Size sz) -> Size
d55e5bfc
RD
827
828 Subtract sz's properties from this and return the result.
829 """
5b5c9bc7 830 return _core_.Size___sub__(*args, **kwargs)
d55e5bfc
RD
831
832 def IncTo(*args, **kwargs):
833 """
5b5c9bc7 834 IncTo(self, Size sz)
d55e5bfc
RD
835
836 Increments this object so that both of its dimensions are not less
837 than the corresponding dimensions of the size.
838 """
5b5c9bc7 839 return _core_.Size_IncTo(*args, **kwargs)
d55e5bfc
RD
840
841 def DecTo(*args, **kwargs):
842 """
5b5c9bc7 843 DecTo(self, Size sz)
d55e5bfc
RD
844
845 Decrements this object so that both of its dimensions are not greater
846 than the corresponding dimensions of the size.
847 """
5b5c9bc7 848 return _core_.Size_DecTo(*args, **kwargs)
d55e5bfc 849
1eeb270e
RD
850 def Scale(*args, **kwargs):
851 """
852 Scale(self, float xscale, float yscale)
853
854 Scales the dimensions of this object by the given factors.
855 """
856 return _core_.Size_Scale(*args, **kwargs)
857
d55e5bfc
RD
858 def Set(*args, **kwargs):
859 """
860 Set(self, int w, int h)
861
862 Set both width and height.
863 """
5b5c9bc7 864 return _core_.Size_Set(*args, **kwargs)
d55e5bfc
RD
865
866 def SetWidth(*args, **kwargs):
867 """SetWidth(self, int w)"""
5b5c9bc7 868 return _core_.Size_SetWidth(*args, **kwargs)
d55e5bfc
RD
869
870 def SetHeight(*args, **kwargs):
871 """SetHeight(self, int h)"""
5b5c9bc7 872 return _core_.Size_SetHeight(*args, **kwargs)
d55e5bfc
RD
873
874 def GetWidth(*args, **kwargs):
875 """GetWidth(self) -> int"""
5b5c9bc7 876 return _core_.Size_GetWidth(*args, **kwargs)
d55e5bfc
RD
877
878 def GetHeight(*args, **kwargs):
879 """GetHeight(self) -> int"""
5b5c9bc7 880 return _core_.Size_GetHeight(*args, **kwargs)
d55e5bfc
RD
881
882 def IsFullySpecified(*args, **kwargs):
883 """
884 IsFullySpecified(self) -> bool
885
886 Returns True if both components of the size are non-default values.
887 """
5b5c9bc7 888 return _core_.Size_IsFullySpecified(*args, **kwargs)
d55e5bfc
RD
889
890 def SetDefaults(*args, **kwargs):
891 """
5b5c9bc7 892 SetDefaults(self, Size size)
d55e5bfc 893
15817c7e
RD
894 Combine this size with the other one replacing the default components
895 of this object (i.e. equal to -1) with those of the other.
d55e5bfc 896 """
5b5c9bc7 897 return _core_.Size_SetDefaults(*args, **kwargs)
d55e5bfc
RD
898
899 def Get(*args, **kwargs):
900 """
901 Get() -> (width,height)
902
903 Returns the width and height properties as a tuple.
904 """
5b5c9bc7 905 return _core_.Size_Get(*args, **kwargs)
d55e5bfc 906
15817c7e 907 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
908 def __str__(self): return str(self.Get())
909 def __repr__(self): return 'wx.Size'+str(self.Get())
910 def __len__(self): return len(self.Get())
911 def __getitem__(self, index): return self.Get()[index]
912 def __setitem__(self, index, val):
913 if index == 0: self.width = val
914 elif index == 1: self.height = val
915 else: raise IndexError
916 def __nonzero__(self): return self.Get() != (0,0)
917 __safe_for_unpickling__ = True
918 def __reduce__(self): return (wx.Size, self.Get())
919
2131d850 920_core_.Size_swigregister(Size)
d55e5bfc
RD
921
922#---------------------------------------------------------------------------
923
5b5c9bc7 924class RealPoint(object):
d55e5bfc 925 """
15817c7e
RD
926 A data structure for representing a point or position with floating
927 point x and y properties. In wxPython most places that expect a
928 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc 929 """
1bd55598
RD
930 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
931 __repr__ = _swig_repr
5b5c9bc7
RD
932 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
933 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
1bd55598 934 def __init__(self, *args, **kwargs):
d55e5bfc 935 """
5b5c9bc7 936 __init__(self, double x=0.0, double y=0.0) -> RealPoint
d55e5bfc
RD
937
938 Create a wx.RealPoint object
939 """
1bd55598
RD
940 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
941 __swig_destroy__ = _core_.delete_RealPoint
942 __del__ = lambda self : None;
d55e5bfc
RD
943 def __eq__(*args, **kwargs):
944 """
e9d6f3a4 945 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
946
947 Test for equality of wx.RealPoint objects.
948 """
5b5c9bc7 949 return _core_.RealPoint___eq__(*args, **kwargs)
d55e5bfc
RD
950
951 def __ne__(*args, **kwargs):
952 """
e9d6f3a4 953 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
954
955 Test for inequality of wx.RealPoint objects.
956 """
5b5c9bc7 957 return _core_.RealPoint___ne__(*args, **kwargs)
d55e5bfc
RD
958
959 def __add__(*args, **kwargs):
960 """
5b5c9bc7 961 __add__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
962
963 Add pt's proprties to this and return the result.
964 """
5b5c9bc7 965 return _core_.RealPoint___add__(*args, **kwargs)
d55e5bfc
RD
966
967 def __sub__(*args, **kwargs):
968 """
5b5c9bc7 969 __sub__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
970
971 Subtract pt's proprties from this and return the result
972 """
5b5c9bc7 973 return _core_.RealPoint___sub__(*args, **kwargs)
d55e5bfc
RD
974
975 def Set(*args, **kwargs):
976 """
977 Set(self, double x, double y)
978
979 Set both the x and y properties
980 """
5b5c9bc7 981 return _core_.RealPoint_Set(*args, **kwargs)
d55e5bfc
RD
982
983 def Get(*args, **kwargs):
984 """
985 Get() -> (x,y)
986
987 Return the x and y properties as a tuple.
988 """
5b5c9bc7 989 return _core_.RealPoint_Get(*args, **kwargs)
d55e5bfc 990
15817c7e 991 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
992 def __str__(self): return str(self.Get())
993 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
994 def __len__(self): return len(self.Get())
995 def __getitem__(self, index): return self.Get()[index]
996 def __setitem__(self, index, val):
997 if index == 0: self.x = val
998 elif index == 1: self.y = val
999 else: raise IndexError
1000 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1001 __safe_for_unpickling__ = True
1002 def __reduce__(self): return (wx.RealPoint, self.Get())
1003
2131d850 1004_core_.RealPoint_swigregister(RealPoint)
d55e5bfc
RD
1005
1006#---------------------------------------------------------------------------
1007
5b5c9bc7 1008class Point(object):
d55e5bfc 1009 """
15817c7e
RD
1010 A data structure for representing a point or position with integer x
1011 and y properties. Most places in wxPython that expect a wx.Point can
1012 also accept a (x,y) tuple.
d55e5bfc 1013 """
1bd55598
RD
1014 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1015 __repr__ = _swig_repr
5b5c9bc7
RD
1016 x = property(_core_.Point_x_get, _core_.Point_x_set)
1017 y = property(_core_.Point_y_get, _core_.Point_y_set)
1bd55598 1018 def __init__(self, *args, **kwargs):
d55e5bfc 1019 """
5b5c9bc7 1020 __init__(self, int x=0, int y=0) -> Point
d55e5bfc
RD
1021
1022 Create a wx.Point object
1023 """
1bd55598
RD
1024 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1025 __swig_destroy__ = _core_.delete_Point
1026 __del__ = lambda self : None;
d55e5bfc
RD
1027 def __eq__(*args, **kwargs):
1028 """
e9d6f3a4 1029 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
1030
1031 Test for equality of wx.Point objects.
1032 """
5b5c9bc7 1033 return _core_.Point___eq__(*args, **kwargs)
d55e5bfc
RD
1034
1035 def __ne__(*args, **kwargs):
1036 """
e9d6f3a4 1037 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
1038
1039 Test for inequality of wx.Point objects.
1040 """
5b5c9bc7 1041 return _core_.Point___ne__(*args, **kwargs)
d55e5bfc
RD
1042
1043 def __add__(*args, **kwargs):
1044 """
5b5c9bc7 1045 __add__(self, Point pt) -> Point
d55e5bfc
RD
1046
1047 Add pt's proprties to this and return the result.
1048 """
5b5c9bc7 1049 return _core_.Point___add__(*args, **kwargs)
d55e5bfc
RD
1050
1051 def __sub__(*args, **kwargs):
1052 """
5b5c9bc7 1053 __sub__(self, Point pt) -> Point
d55e5bfc
RD
1054
1055 Subtract pt's proprties from this and return the result
1056 """
5b5c9bc7 1057 return _core_.Point___sub__(*args, **kwargs)
d55e5bfc
RD
1058
1059 def __iadd__(*args, **kwargs):
1060 """
5b5c9bc7 1061 __iadd__(self, Point pt) -> Point
d55e5bfc
RD
1062
1063 Add pt to this object.
1064 """
5b5c9bc7 1065 return _core_.Point___iadd__(*args, **kwargs)
d55e5bfc
RD
1066
1067 def __isub__(*args, **kwargs):
1068 """
5b5c9bc7 1069 __isub__(self, Point pt) -> Point
d55e5bfc
RD
1070
1071 Subtract pt from this object.
1072 """
5b5c9bc7 1073 return _core_.Point___isub__(*args, **kwargs)
d55e5bfc
RD
1074
1075 def Set(*args, **kwargs):
1076 """
1077 Set(self, long x, long y)
1078
1079 Set both the x and y properties
1080 """
5b5c9bc7 1081 return _core_.Point_Set(*args, **kwargs)
d55e5bfc
RD
1082
1083 def Get(*args, **kwargs):
1084 """
1085 Get() -> (x,y)
1086
1087 Return the x and y properties as a tuple.
1088 """
5b5c9bc7 1089 return _core_.Point_Get(*args, **kwargs)
d55e5bfc 1090
15817c7e 1091 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1092 def __str__(self): return str(self.Get())
1093 def __repr__(self): return 'wx.Point'+str(self.Get())
1094 def __len__(self): return len(self.Get())
1095 def __getitem__(self, index): return self.Get()[index]
1096 def __setitem__(self, index, val):
1097 if index == 0: self.x = val
1098 elif index == 1: self.y = val
1099 else: raise IndexError
1100 def __nonzero__(self): return self.Get() != (0,0)
1101 __safe_for_unpickling__ = True
1102 def __reduce__(self): return (wx.Point, self.Get())
1103
2131d850 1104_core_.Point_swigregister(Point)
d55e5bfc
RD
1105
1106#---------------------------------------------------------------------------
1107
5b5c9bc7 1108class Rect(object):
d55e5bfc 1109 """
15817c7e
RD
1110 A class for representing and manipulating rectangles. It has x, y,
1111 width and height properties. In wxPython most palces that expect a
1112 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc 1113 """
1bd55598
RD
1114 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1115 __repr__ = _swig_repr
1116 def __init__(self, *args, **kwargs):
d55e5bfc 1117 """
5b5c9bc7 1118 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
d55e5bfc
RD
1119
1120 Create a new Rect object.
1121 """
1bd55598
RD
1122 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1123 __swig_destroy__ = _core_.delete_Rect
1124 __del__ = lambda self : None;
d55e5bfc
RD
1125 def GetX(*args, **kwargs):
1126 """GetX(self) -> int"""
5b5c9bc7 1127 return _core_.Rect_GetX(*args, **kwargs)
d55e5bfc
RD
1128
1129 def SetX(*args, **kwargs):
1130 """SetX(self, int x)"""
5b5c9bc7 1131 return _core_.Rect_SetX(*args, **kwargs)
d55e5bfc
RD
1132
1133 def GetY(*args, **kwargs):
1134 """GetY(self) -> int"""
5b5c9bc7 1135 return _core_.Rect_GetY(*args, **kwargs)
d55e5bfc
RD
1136
1137 def SetY(*args, **kwargs):
1138 """SetY(self, int y)"""
5b5c9bc7 1139 return _core_.Rect_SetY(*args, **kwargs)
d55e5bfc
RD
1140
1141 def GetWidth(*args, **kwargs):
1142 """GetWidth(self) -> int"""
5b5c9bc7 1143 return _core_.Rect_GetWidth(*args, **kwargs)
d55e5bfc
RD
1144
1145 def SetWidth(*args, **kwargs):
1146 """SetWidth(self, int w)"""
5b5c9bc7 1147 return _core_.Rect_SetWidth(*args, **kwargs)
d55e5bfc
RD
1148
1149 def GetHeight(*args, **kwargs):
1150 """GetHeight(self) -> int"""
5b5c9bc7 1151 return _core_.Rect_GetHeight(*args, **kwargs)
d55e5bfc
RD
1152
1153 def SetHeight(*args, **kwargs):
1154 """SetHeight(self, int h)"""
5b5c9bc7 1155 return _core_.Rect_SetHeight(*args, **kwargs)
d55e5bfc
RD
1156
1157 def GetPosition(*args, **kwargs):
5b5c9bc7
RD
1158 """GetPosition(self) -> Point"""
1159 return _core_.Rect_GetPosition(*args, **kwargs)
d55e5bfc
RD
1160
1161 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
1162 """SetPosition(self, Point p)"""
1163 return _core_.Rect_SetPosition(*args, **kwargs)
d55e5bfc
RD
1164
1165 def GetSize(*args, **kwargs):
5b5c9bc7
RD
1166 """GetSize(self) -> Size"""
1167 return _core_.Rect_GetSize(*args, **kwargs)
d55e5bfc
RD
1168
1169 def SetSize(*args, **kwargs):
5b5c9bc7
RD
1170 """SetSize(self, Size s)"""
1171 return _core_.Rect_SetSize(*args, **kwargs)
d55e5bfc 1172
aff4cc5c
RD
1173 def IsEmpty(*args, **kwargs):
1174 """IsEmpty(self) -> bool"""
5b5c9bc7 1175 return _core_.Rect_IsEmpty(*args, **kwargs)
aff4cc5c 1176
d55e5bfc 1177 def GetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1178 """GetTopLeft(self) -> Point"""
1179 return _core_.Rect_GetTopLeft(*args, **kwargs)
d55e5bfc
RD
1180
1181 def SetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1182 """SetTopLeft(self, Point p)"""
1183 return _core_.Rect_SetTopLeft(*args, **kwargs)
d55e5bfc
RD
1184
1185 def GetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1186 """GetBottomRight(self) -> Point"""
1187 return _core_.Rect_GetBottomRight(*args, **kwargs)
d55e5bfc
RD
1188
1189 def SetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1190 """SetBottomRight(self, Point p)"""
1191 return _core_.Rect_SetBottomRight(*args, **kwargs)
d55e5bfc
RD
1192
1193 def GetLeft(*args, **kwargs):
1194 """GetLeft(self) -> int"""
5b5c9bc7 1195 return _core_.Rect_GetLeft(*args, **kwargs)
d55e5bfc
RD
1196
1197 def GetTop(*args, **kwargs):
1198 """GetTop(self) -> int"""
5b5c9bc7 1199 return _core_.Rect_GetTop(*args, **kwargs)
d55e5bfc
RD
1200
1201 def GetBottom(*args, **kwargs):
1202 """GetBottom(self) -> int"""
5b5c9bc7 1203 return _core_.Rect_GetBottom(*args, **kwargs)
d55e5bfc
RD
1204
1205 def GetRight(*args, **kwargs):
1206 """GetRight(self) -> int"""
5b5c9bc7 1207 return _core_.Rect_GetRight(*args, **kwargs)
d55e5bfc
RD
1208
1209 def SetLeft(*args, **kwargs):
1210 """SetLeft(self, int left)"""
5b5c9bc7 1211 return _core_.Rect_SetLeft(*args, **kwargs)
d55e5bfc
RD
1212
1213 def SetRight(*args, **kwargs):
1214 """SetRight(self, int right)"""
5b5c9bc7 1215 return _core_.Rect_SetRight(*args, **kwargs)
d55e5bfc
RD
1216
1217 def SetTop(*args, **kwargs):
1218 """SetTop(self, int top)"""
5b5c9bc7 1219 return _core_.Rect_SetTop(*args, **kwargs)
d55e5bfc
RD
1220
1221 def SetBottom(*args, **kwargs):
1222 """SetBottom(self, int bottom)"""
5b5c9bc7 1223 return _core_.Rect_SetBottom(*args, **kwargs)
d55e5bfc
RD
1224
1225 position = property(GetPosition, SetPosition)
1226 size = property(GetSize, SetSize)
1227 left = property(GetLeft, SetLeft)
1228 right = property(GetRight, SetRight)
1229 top = property(GetTop, SetTop)
1230 bottom = property(GetBottom, SetBottom)
1231
1232 def Inflate(*args, **kwargs):
1233 """
5b5c9bc7 1234 Inflate(self, int dx, int dy) -> Rect
d55e5bfc 1235
091fdbfa
RD
1236 Increases the size of the rectangle.
1237
1238 The left border is moved farther left and the right border is moved
1239 farther right by ``dx``. The upper border is moved farther up and the
1240 bottom border is moved farther down by ``dy``. (Note the the width and
1241 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1242 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1243 opposite happens: the rectangle size decreases in the respective
1244 direction.
1245
1246 The change is made to the rectangle inplace, if instead you need a
1247 copy that is inflated, preserving the original then make the copy
1248 first::
1249
1250 copy = wx.Rect(*original)
1251 copy.Inflate(10,15)
1252
1253
d55e5bfc 1254 """
5b5c9bc7 1255 return _core_.Rect_Inflate(*args, **kwargs)
d55e5bfc
RD
1256
1257 def Deflate(*args, **kwargs):
1258 """
5b5c9bc7 1259 Deflate(self, int dx, int dy) -> Rect
d55e5bfc 1260
091fdbfa
RD
1261 Decrease the rectangle size. This method is the opposite of `Inflate`
1262 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1263 `Inflate` for a full description.
d55e5bfc 1264 """
5b5c9bc7 1265 return _core_.Rect_Deflate(*args, **kwargs)
d55e5bfc
RD
1266
1267 def OffsetXY(*args, **kwargs):
1268 """
1269 OffsetXY(self, int dx, int dy)
1270
15817c7e
RD
1271 Moves the rectangle by the specified offset. If dx is positive, the
1272 rectangle is moved to the right, if dy is positive, it is moved to the
1273 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc 1274 """
5b5c9bc7 1275 return _core_.Rect_OffsetXY(*args, **kwargs)
d55e5bfc
RD
1276
1277 def Offset(*args, **kwargs):
1278 """
5b5c9bc7 1279 Offset(self, Point pt)
d55e5bfc 1280
b1fcee84 1281 Same as `OffsetXY` but uses dx,dy from Point
d55e5bfc 1282 """
5b5c9bc7 1283 return _core_.Rect_Offset(*args, **kwargs)
d55e5bfc
RD
1284
1285 def Intersect(*args, **kwargs):
1286 """
5b5c9bc7 1287 Intersect(self, Rect rect) -> Rect
d55e5bfc 1288
5cbf236d 1289 Returns the intersectsion of this rectangle and rect.
d55e5bfc 1290 """
5b5c9bc7 1291 return _core_.Rect_Intersect(*args, **kwargs)
d55e5bfc 1292
5cbf236d
RD
1293 def Union(*args, **kwargs):
1294 """
5b5c9bc7 1295 Union(self, Rect rect) -> Rect
5cbf236d
RD
1296
1297 Returns the union of this rectangle and rect.
1298 """
5b5c9bc7 1299 return _core_.Rect_Union(*args, **kwargs)
5cbf236d 1300
d55e5bfc
RD
1301 def __add__(*args, **kwargs):
1302 """
5b5c9bc7 1303 __add__(self, Rect rect) -> Rect
d55e5bfc
RD
1304
1305 Add the properties of rect to this rectangle and return the result.
1306 """
5b5c9bc7 1307 return _core_.Rect___add__(*args, **kwargs)
d55e5bfc
RD
1308
1309 def __iadd__(*args, **kwargs):
1310 """
5b5c9bc7 1311 __iadd__(self, Rect rect) -> Rect
d55e5bfc
RD
1312
1313 Add the properties of rect to this rectangle, updating this rectangle.
1314 """
5b5c9bc7 1315 return _core_.Rect___iadd__(*args, **kwargs)
d55e5bfc
RD
1316
1317 def __eq__(*args, **kwargs):
1318 """
e9d6f3a4 1319 __eq__(self, PyObject other) -> bool
d55e5bfc 1320
e9d6f3a4 1321 Test for equality of wx.Rect objects.
d55e5bfc 1322 """
5b5c9bc7 1323 return _core_.Rect___eq__(*args, **kwargs)
d55e5bfc
RD
1324
1325 def __ne__(*args, **kwargs):
1326 """
e9d6f3a4 1327 __ne__(self, PyObject other) -> bool
d55e5bfc 1328
e9d6f3a4 1329 Test for inequality of wx.Rect objects.
d55e5bfc 1330 """
5b5c9bc7 1331 return _core_.Rect___ne__(*args, **kwargs)
d55e5bfc
RD
1332
1333 def InsideXY(*args, **kwargs):
1334 """
1335 InsideXY(self, int x, int y) -> bool
1336
1337 Return True if the point is (not strcitly) inside the rect.
1338 """
5b5c9bc7 1339 return _core_.Rect_InsideXY(*args, **kwargs)
d55e5bfc
RD
1340
1341 def Inside(*args, **kwargs):
1342 """
5b5c9bc7 1343 Inside(self, Point pt) -> bool
d55e5bfc
RD
1344
1345 Return True if the point is (not strcitly) inside the rect.
1346 """
5b5c9bc7 1347 return _core_.Rect_Inside(*args, **kwargs)
d55e5bfc
RD
1348
1349 def Intersects(*args, **kwargs):
1350 """
5b5c9bc7 1351 Intersects(self, Rect rect) -> bool
d55e5bfc
RD
1352
1353 Returns True if the rectangles have a non empty intersection.
1354 """
5b5c9bc7 1355 return _core_.Rect_Intersects(*args, **kwargs)
d55e5bfc 1356
b1fcee84
RD
1357 def CenterIn(*args, **kwargs):
1358 """
1359 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1360
1361 Center this rectangle within the one passed to the method, which is
1362 usually, but not necessarily, the larger one.
1363 """
1364 return _core_.Rect_CenterIn(*args, **kwargs)
1365
1366 CentreIn = CenterIn
5b5c9bc7
RD
1367 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1368 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1369 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1370 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
d55e5bfc
RD
1371 def Set(*args, **kwargs):
1372 """
1373 Set(self, int x=0, int y=0, int width=0, int height=0)
1374
1375 Set all rectangle properties.
1376 """
5b5c9bc7 1377 return _core_.Rect_Set(*args, **kwargs)
d55e5bfc
RD
1378
1379 def Get(*args, **kwargs):
1380 """
1381 Get() -> (x,y,width,height)
1382
1383 Return the rectangle properties as a tuple.
1384 """
5b5c9bc7 1385 return _core_.Rect_Get(*args, **kwargs)
d55e5bfc 1386
15817c7e 1387 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1388 def __str__(self): return str(self.Get())
1389 def __repr__(self): return 'wx.Rect'+str(self.Get())
1390 def __len__(self): return len(self.Get())
1391 def __getitem__(self, index): return self.Get()[index]
1392 def __setitem__(self, index, val):
1393 if index == 0: self.x = val
1394 elif index == 1: self.y = val
1395 elif index == 2: self.width = val
1396 elif index == 3: self.height = val
1397 else: raise IndexError
1398 def __nonzero__(self): return self.Get() != (0,0,0,0)
1399 __safe_for_unpickling__ = True
1400 def __reduce__(self): return (wx.Rect, self.Get())
1401
2131d850 1402_core_.Rect_swigregister(Rect)
d55e5bfc
RD
1403
1404def RectPP(*args, **kwargs):
1405 """
5b5c9bc7 1406 RectPP(Point topLeft, Point bottomRight) -> Rect
d55e5bfc
RD
1407
1408 Create a new Rect object from Points representing two corners.
1409 """
5b5c9bc7 1410 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1411 return val
1412
1413def RectPS(*args, **kwargs):
1414 """
5b5c9bc7 1415 RectPS(Point pos, Size size) -> Rect
d55e5bfc
RD
1416
1417 Create a new Rect from a position and size.
1418 """
5b5c9bc7 1419 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1420 return val
1421
070c48b4
RD
1422def RectS(*args, **kwargs):
1423 """
5b5c9bc7 1424 RectS(Size size) -> Rect
070c48b4
RD
1425
1426 Create a new Rect from a size only.
1427 """
5b5c9bc7 1428 val = _core_.new_RectS(*args, **kwargs)
070c48b4
RD
1429 return val
1430
d55e5bfc 1431
5b5c9bc7 1432def IntersectRect(*args, **kwargs):
1bd55598 1433 """
d55e5bfc
RD
1434 IntersectRect(Rect r1, Rect r2) -> Rect
1435
1436 Calculate and return the intersection of r1 and r2.
1437 """
1bd55598 1438 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1439#---------------------------------------------------------------------------
1440
5b5c9bc7 1441class Point2D(object):
15817c7e
RD
1442 """
1443 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1444 with floating point values.
1445 """
1bd55598
RD
1446 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1447 __repr__ = _swig_repr
1448 def __init__(self, *args, **kwargs):
d55e5bfc 1449 """
5b5c9bc7 1450 __init__(self, double x=0.0, double y=0.0) -> Point2D
d55e5bfc
RD
1451
1452 Create a w.Point2D object.
1453 """
1bd55598 1454 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
d55e5bfc 1455 def GetFloor(*args, **kwargs):
fd2dc343
RD
1456 """
1457 GetFloor() -> (x,y)
1458
1459 Convert to integer
1460 """
5b5c9bc7 1461 return _core_.Point2D_GetFloor(*args, **kwargs)
d55e5bfc
RD
1462
1463 def GetRounded(*args, **kwargs):
fd2dc343
RD
1464 """
1465 GetRounded() -> (x,y)
1466
1467 Convert to integer
1468 """
5b5c9bc7 1469 return _core_.Point2D_GetRounded(*args, **kwargs)
d55e5bfc
RD
1470
1471 def GetVectorLength(*args, **kwargs):
1472 """GetVectorLength(self) -> double"""
5b5c9bc7 1473 return _core_.Point2D_GetVectorLength(*args, **kwargs)
d55e5bfc
RD
1474
1475 def GetVectorAngle(*args, **kwargs):
1476 """GetVectorAngle(self) -> double"""
5b5c9bc7 1477 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1478
1479 def SetVectorLength(*args, **kwargs):
1480 """SetVectorLength(self, double length)"""
5b5c9bc7 1481 return _core_.Point2D_SetVectorLength(*args, **kwargs)
d55e5bfc
RD
1482
1483 def SetVectorAngle(*args, **kwargs):
1484 """SetVectorAngle(self, double degrees)"""
5b5c9bc7 1485 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1486
1487 def SetPolarCoordinates(self, angle, length):
1488 self.SetVectorLength(length)
1489 self.SetVectorAngle(angle)
1490 def Normalize(self):
1491 self.SetVectorLength(1.0)
1492
1493 def GetDistance(*args, **kwargs):
5b5c9bc7
RD
1494 """GetDistance(self, Point2D pt) -> double"""
1495 return _core_.Point2D_GetDistance(*args, **kwargs)
d55e5bfc
RD
1496
1497 def GetDistanceSquare(*args, **kwargs):
5b5c9bc7
RD
1498 """GetDistanceSquare(self, Point2D pt) -> double"""
1499 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
d55e5bfc
RD
1500
1501 def GetDotProduct(*args, **kwargs):
5b5c9bc7
RD
1502 """GetDotProduct(self, Point2D vec) -> double"""
1503 return _core_.Point2D_GetDotProduct(*args, **kwargs)
d55e5bfc
RD
1504
1505 def GetCrossProduct(*args, **kwargs):
5b5c9bc7
RD
1506 """GetCrossProduct(self, Point2D vec) -> double"""
1507 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
d55e5bfc
RD
1508
1509 def __neg__(*args, **kwargs):
1510 """
5b5c9bc7 1511 __neg__(self) -> Point2D
d55e5bfc
RD
1512
1513 the reflection of this point
1514 """
5b5c9bc7 1515 return _core_.Point2D___neg__(*args, **kwargs)
d55e5bfc
RD
1516
1517 def __iadd__(*args, **kwargs):
5b5c9bc7
RD
1518 """__iadd__(self, Point2D pt) -> Point2D"""
1519 return _core_.Point2D___iadd__(*args, **kwargs)
d55e5bfc
RD
1520
1521 def __isub__(*args, **kwargs):
5b5c9bc7
RD
1522 """__isub__(self, Point2D pt) -> Point2D"""
1523 return _core_.Point2D___isub__(*args, **kwargs)
d55e5bfc
RD
1524
1525 def __imul__(*args, **kwargs):
5b5c9bc7
RD
1526 """__imul__(self, Point2D pt) -> Point2D"""
1527 return _core_.Point2D___imul__(*args, **kwargs)
d55e5bfc
RD
1528
1529 def __idiv__(*args, **kwargs):
5b5c9bc7
RD
1530 """__idiv__(self, Point2D pt) -> Point2D"""
1531 return _core_.Point2D___idiv__(*args, **kwargs)
d55e5bfc
RD
1532
1533 def __eq__(*args, **kwargs):
1534 """
e9d6f3a4 1535 __eq__(self, PyObject other) -> bool
d55e5bfc 1536
e9d6f3a4 1537 Test for equality of wx.Point2D objects.
d55e5bfc 1538 """
5b5c9bc7 1539 return _core_.Point2D___eq__(*args, **kwargs)
d55e5bfc
RD
1540
1541 def __ne__(*args, **kwargs):
1542 """
e9d6f3a4 1543 __ne__(self, PyObject other) -> bool
d55e5bfc 1544
e9d6f3a4 1545 Test for inequality of wx.Point2D objects.
d55e5bfc 1546 """
5b5c9bc7 1547 return _core_.Point2D___ne__(*args, **kwargs)
d55e5bfc 1548
5b5c9bc7
RD
1549 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1550 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
d55e5bfc
RD
1551 def Set(*args, **kwargs):
1552 """Set(self, double x=0, double y=0)"""
5b5c9bc7 1553 return _core_.Point2D_Set(*args, **kwargs)
d55e5bfc
RD
1554
1555 def Get(*args, **kwargs):
1556 """
1557 Get() -> (x,y)
1558
1559 Return x and y properties as a tuple.
1560 """
5b5c9bc7 1561 return _core_.Point2D_Get(*args, **kwargs)
d55e5bfc 1562
15817c7e 1563 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1564 def __str__(self): return str(self.Get())
1565 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1566 def __len__(self): return len(self.Get())
1567 def __getitem__(self, index): return self.Get()[index]
1568 def __setitem__(self, index, val):
1569 if index == 0: self.x = val
1570 elif index == 1: self.y = val
1571 else: raise IndexError
1572 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1573 __safe_for_unpickling__ = True
1574 def __reduce__(self): return (wx.Point2D, self.Get())
1575
2131d850 1576_core_.Point2D_swigregister(Point2D)
d55e5bfc
RD
1577
1578def Point2DCopy(*args, **kwargs):
1579 """
5b5c9bc7 1580 Point2DCopy(Point2D pt) -> Point2D
d55e5bfc
RD
1581
1582 Create a w.Point2D object.
1583 """
5b5c9bc7 1584 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1585 return val
1586
1587def Point2DFromPoint(*args, **kwargs):
1588 """
5b5c9bc7 1589 Point2DFromPoint(Point pt) -> Point2D
d55e5bfc
RD
1590
1591 Create a w.Point2D object.
1592 """
5b5c9bc7 1593 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d55e5bfc
RD
1594 return val
1595
1596#---------------------------------------------------------------------------
1597
5b5c9bc7
RD
1598FromStart = _core_.FromStart
1599FromCurrent = _core_.FromCurrent
1600FromEnd = _core_.FromEnd
d55e5bfc 1601class InputStream(object):
36ed4f51 1602 """Proxy of C++ InputStream class"""
1bd55598
RD
1603 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1604 __repr__ = _swig_repr
1605 def __init__(self, *args, **kwargs):
d55e5bfc 1606 """__init__(self, PyObject p) -> InputStream"""
1bd55598
RD
1607 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1608 __swig_destroy__ = _core_.delete_InputStream
1609 __del__ = lambda self : None;
d55e5bfc
RD
1610 def close(*args, **kwargs):
1611 """close(self)"""
5b5c9bc7 1612 return _core_.InputStream_close(*args, **kwargs)
d55e5bfc
RD
1613
1614 def flush(*args, **kwargs):
1615 """flush(self)"""
5b5c9bc7 1616 return _core_.InputStream_flush(*args, **kwargs)
d55e5bfc
RD
1617
1618 def eof(*args, **kwargs):
1619 """eof(self) -> bool"""
5b5c9bc7 1620 return _core_.InputStream_eof(*args, **kwargs)
d55e5bfc
RD
1621
1622 def read(*args, **kwargs):
1623 """read(self, int size=-1) -> PyObject"""
5b5c9bc7 1624 return _core_.InputStream_read(*args, **kwargs)
d55e5bfc
RD
1625
1626 def readline(*args, **kwargs):
1627 """readline(self, int size=-1) -> PyObject"""
5b5c9bc7 1628 return _core_.InputStream_readline(*args, **kwargs)
d55e5bfc
RD
1629
1630 def readlines(*args, **kwargs):
1631 """readlines(self, int sizehint=-1) -> PyObject"""
5b5c9bc7 1632 return _core_.InputStream_readlines(*args, **kwargs)
d55e5bfc
RD
1633
1634 def seek(*args, **kwargs):
1635 """seek(self, int offset, int whence=0)"""
5b5c9bc7 1636 return _core_.InputStream_seek(*args, **kwargs)
d55e5bfc
RD
1637
1638 def tell(*args, **kwargs):
1639 """tell(self) -> int"""
5b5c9bc7 1640 return _core_.InputStream_tell(*args, **kwargs)
d55e5bfc
RD
1641
1642 def Peek(*args, **kwargs):
1643 """Peek(self) -> char"""
5b5c9bc7 1644 return _core_.InputStream_Peek(*args, **kwargs)
d55e5bfc
RD
1645
1646 def GetC(*args, **kwargs):
1647 """GetC(self) -> char"""
5b5c9bc7 1648 return _core_.InputStream_GetC(*args, **kwargs)
d55e5bfc
RD
1649
1650 def LastRead(*args, **kwargs):
1651 """LastRead(self) -> size_t"""
5b5c9bc7 1652 return _core_.InputStream_LastRead(*args, **kwargs)
d55e5bfc
RD
1653
1654 def CanRead(*args, **kwargs):
1655 """CanRead(self) -> bool"""
5b5c9bc7 1656 return _core_.InputStream_CanRead(*args, **kwargs)
d55e5bfc
RD
1657
1658 def Eof(*args, **kwargs):
1659 """Eof(self) -> bool"""
5b5c9bc7 1660 return _core_.InputStream_Eof(*args, **kwargs)
d55e5bfc
RD
1661
1662 def Ungetch(*args, **kwargs):
1663 """Ungetch(self, char c) -> bool"""
5b5c9bc7 1664 return _core_.InputStream_Ungetch(*args, **kwargs)
d55e5bfc
RD
1665
1666 def SeekI(*args, **kwargs):
5b5c9bc7
RD
1667 """SeekI(self, long pos, int mode=FromStart) -> long"""
1668 return _core_.InputStream_SeekI(*args, **kwargs)
d55e5bfc
RD
1669
1670 def TellI(*args, **kwargs):
1671 """TellI(self) -> long"""
5b5c9bc7 1672 return _core_.InputStream_TellI(*args, **kwargs)
d55e5bfc 1673
2131d850 1674_core_.InputStream_swigregister(InputStream)
5b5c9bc7
RD
1675DefaultPosition = cvar.DefaultPosition
1676DefaultSize = cvar.DefaultSize
d55e5bfc 1677
5b5c9bc7
RD
1678class OutputStream(object):
1679 """Proxy of C++ OutputStream class"""
1bd55598
RD
1680 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1681 def __init__(self): raise AttributeError, "No constructor defined"
1682 __repr__ = _swig_repr
d55e5bfc
RD
1683 def write(*args, **kwargs):
1684 """write(self, PyObject obj)"""
5b5c9bc7 1685 return _core_.OutputStream_write(*args, **kwargs)
d55e5bfc 1686
1bd55598
RD
1687 def LastWrite(*args, **kwargs):
1688 """LastWrite(self) -> size_t"""
1689 return _core_.OutputStream_LastWrite(*args, **kwargs)
d55e5bfc 1690
2131d850 1691_core_.OutputStream_swigregister(OutputStream)
d55e5bfc
RD
1692
1693#---------------------------------------------------------------------------
1694
5b5c9bc7
RD
1695class FSFile(Object):
1696 """Proxy of C++ FSFile class"""
1bd55598
RD
1697 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1698 __repr__ = _swig_repr
1699 def __init__(self, *args, **kwargs):
d55e5bfc 1700 """
5b5c9bc7
RD
1701 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1702 DateTime modif) -> FSFile
d55e5bfc 1703 """
1bd55598 1704 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1bd55598
RD
1705 __swig_destroy__ = _core_.delete_FSFile
1706 __del__ = lambda self : None;
d55e5bfc 1707 def GetStream(*args, **kwargs):
5b5c9bc7
RD
1708 """GetStream(self) -> InputStream"""
1709 return _core_.FSFile_GetStream(*args, **kwargs)
d55e5bfc
RD
1710
1711 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
1712 """GetMimeType(self) -> String"""
1713 return _core_.FSFile_GetMimeType(*args, **kwargs)
d55e5bfc
RD
1714
1715 def GetLocation(*args, **kwargs):
5b5c9bc7
RD
1716 """GetLocation(self) -> String"""
1717 return _core_.FSFile_GetLocation(*args, **kwargs)
d55e5bfc
RD
1718
1719 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1720 """GetAnchor(self) -> String"""
1721 return _core_.FSFile_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1722
1723 def GetModificationTime(*args, **kwargs):
5b5c9bc7
RD
1724 """GetModificationTime(self) -> DateTime"""
1725 return _core_.FSFile_GetModificationTime(*args, **kwargs)
d55e5bfc 1726
2131d850 1727_core_.FSFile_swigregister(FSFile)
d55e5bfc
RD
1728
1729class CPPFileSystemHandler(object):
36ed4f51 1730 """Proxy of C++ CPPFileSystemHandler class"""
1bd55598
RD
1731 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1732 def __init__(self): raise AttributeError, "No constructor defined"
1733 __repr__ = _swig_repr
50f151d7
RD
1734 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1735 __del__ = lambda self : None;
2131d850 1736_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d55e5bfc
RD
1737
1738class FileSystemHandler(CPPFileSystemHandler):
36ed4f51 1739 """Proxy of C++ FileSystemHandler class"""
1bd55598
RD
1740 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1741 __repr__ = _swig_repr
1742 def __init__(self, *args, **kwargs):
d55e5bfc 1743 """__init__(self) -> FileSystemHandler"""
1bd55598 1744 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
d55e5bfc
RD
1745 self._setCallbackInfo(self, FileSystemHandler)
1746
1747 def _setCallbackInfo(*args, **kwargs):
1748 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 1749 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
1750
1751 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1752 """CanOpen(self, String location) -> bool"""
1753 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1754
1755 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1756 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1757 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1758
1759 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1760 """FindFirst(self, String spec, int flags=0) -> String"""
1761 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1762
1763 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1764 """FindNext(self) -> String"""
1765 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
1766
1767 def GetProtocol(*args, **kwargs):
5b5c9bc7
RD
1768 """GetProtocol(self, String location) -> String"""
1769 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
d55e5bfc
RD
1770
1771 def GetLeftLocation(*args, **kwargs):
5b5c9bc7
RD
1772 """GetLeftLocation(self, String location) -> String"""
1773 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
d55e5bfc
RD
1774
1775 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1776 """GetAnchor(self, String location) -> String"""
1777 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1778
1779 def GetRightLocation(*args, **kwargs):
5b5c9bc7
RD
1780 """GetRightLocation(self, String location) -> String"""
1781 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
d55e5bfc
RD
1782
1783 def GetMimeTypeFromExt(*args, **kwargs):
5b5c9bc7
RD
1784 """GetMimeTypeFromExt(self, String location) -> String"""
1785 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
d55e5bfc 1786
2131d850 1787_core_.FileSystemHandler_swigregister(FileSystemHandler)
d55e5bfc 1788
5b5c9bc7
RD
1789class FileSystem(Object):
1790 """Proxy of C++ FileSystem class"""
1bd55598
RD
1791 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1792 __repr__ = _swig_repr
1793 def __init__(self, *args, **kwargs):
5b5c9bc7 1794 """__init__(self) -> FileSystem"""
1bd55598
RD
1795 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1796 __swig_destroy__ = _core_.delete_FileSystem
1797 __del__ = lambda self : None;
d55e5bfc 1798 def ChangePathTo(*args, **kwargs):
5b5c9bc7
RD
1799 """ChangePathTo(self, String location, bool is_dir=False)"""
1800 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
d55e5bfc
RD
1801
1802 def GetPath(*args, **kwargs):
5b5c9bc7
RD
1803 """GetPath(self) -> String"""
1804 return _core_.FileSystem_GetPath(*args, **kwargs)
d55e5bfc
RD
1805
1806 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1807 """OpenFile(self, String location) -> FSFile"""
1808 return _core_.FileSystem_OpenFile(*args, **kwargs)
d55e5bfc
RD
1809
1810 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1811 """FindFirst(self, String spec, int flags=0) -> String"""
1812 return _core_.FileSystem_FindFirst(*args, **kwargs)
d55e5bfc
RD
1813
1814 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1815 """FindNext(self) -> String"""
1816 return _core_.FileSystem_FindNext(*args, **kwargs)
d55e5bfc
RD
1817
1818 def AddHandler(*args, **kwargs):
d6c14a4c 1819 """AddHandler(CPPFileSystemHandler handler)"""
5b5c9bc7 1820 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc
RD
1821
1822 AddHandler = staticmethod(AddHandler)
1823 def CleanUpHandlers(*args, **kwargs):
d6c14a4c 1824 """CleanUpHandlers()"""
5b5c9bc7 1825 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc
RD
1826
1827 CleanUpHandlers = staticmethod(CleanUpHandlers)
1828 def FileNameToURL(*args, **kwargs):
5b5c9bc7
RD
1829 """FileNameToURL(String filename) -> String"""
1830 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc
RD
1831
1832 FileNameToURL = staticmethod(FileNameToURL)
b411df4a 1833 def URLToFileName(*args, **kwargs):
5b5c9bc7
RD
1834 """URLToFileName(String url) -> String"""
1835 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a
RD
1836
1837 URLToFileName = staticmethod(URLToFileName)
2131d850 1838_core_.FileSystem_swigregister(FileSystem)
d55e5bfc 1839
5b5c9bc7 1840def FileSystem_AddHandler(*args, **kwargs):
1bd55598
RD
1841 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1842 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 1843
1bd55598
RD
1844def FileSystem_CleanUpHandlers(*args):
1845 """FileSystem_CleanUpHandlers()"""
1846 return _core_.FileSystem_CleanUpHandlers(*args)
d55e5bfc 1847
5b5c9bc7 1848def FileSystem_FileNameToURL(*args, **kwargs):
1bd55598
RD
1849 """FileSystem_FileNameToURL(String filename) -> String"""
1850 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 1851
5b5c9bc7 1852def FileSystem_URLToFileName(*args, **kwargs):
1bd55598
RD
1853 """FileSystem_URLToFileName(String url) -> String"""
1854 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a 1855
5b5c9bc7
RD
1856class InternetFSHandler(CPPFileSystemHandler):
1857 """Proxy of C++ InternetFSHandler class"""
1bd55598
RD
1858 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1859 __repr__ = _swig_repr
1860 def __init__(self, *args, **kwargs):
5b5c9bc7 1861 """__init__(self) -> InternetFSHandler"""
1bd55598 1862 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
d55e5bfc 1863 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1864 """CanOpen(self, String location) -> bool"""
1865 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1866
1867 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1868 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1869 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
d55e5bfc 1870
2131d850 1871_core_.InternetFSHandler_swigregister(InternetFSHandler)
d55e5bfc 1872
5b5c9bc7
RD
1873class ZipFSHandler(CPPFileSystemHandler):
1874 """Proxy of C++ ZipFSHandler class"""
1bd55598
RD
1875 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1876 __repr__ = _swig_repr
1877 def __init__(self, *args, **kwargs):
5b5c9bc7 1878 """__init__(self) -> ZipFSHandler"""
1bd55598 1879 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
d55e5bfc 1880 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1881 """CanOpen(self, String location) -> bool"""
1882 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1883
1884 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1885 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1886 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1887
1888 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1889 """FindFirst(self, String spec, int flags=0) -> String"""
1890 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1891
1892 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1893 """FindNext(self) -> String"""
1894 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
d55e5bfc 1895
2131d850 1896_core_.ZipFSHandler_swigregister(ZipFSHandler)
d55e5bfc
RD
1897
1898
1899def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1bd55598
RD
1900 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1901 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d55e5bfc
RD
1902
1903def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1bd55598
RD
1904 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1905 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d55e5bfc
RD
1906
1907def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1bd55598
RD
1908 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1909 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
b411df4a
RD
1910def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1911 """
1912 Add 'file' to the memory filesystem. The dataItem parameter can
1913 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1914 arbitrary data. If a bitmap or image is used then the imgType
1915 parameter should specify what kind of image file it should be
1916 written as, wx.BITMAP_TYPE_PNG, etc.
1917 """
1918 if isinstance(dataItem, wx.Image):
1919 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1920 elif isinstance(dataItem, wx.Bitmap):
1921 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1922 elif type(dataItem) == str:
1923 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1924 else:
1925 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc 1926
5b5c9bc7
RD
1927class MemoryFSHandler(CPPFileSystemHandler):
1928 """Proxy of C++ MemoryFSHandler class"""
1bd55598
RD
1929 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1930 __repr__ = _swig_repr
1931 def __init__(self, *args, **kwargs):
5b5c9bc7 1932 """__init__(self) -> MemoryFSHandler"""
1bd55598 1933 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
d55e5bfc 1934 def RemoveFile(*args, **kwargs):
5b5c9bc7
RD
1935 """RemoveFile(String filename)"""
1936 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc
RD
1937
1938 RemoveFile = staticmethod(RemoveFile)
1939 AddFile = staticmethod(MemoryFSHandler_AddFile)
1940 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1941 """CanOpen(self, String location) -> bool"""
1942 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1943
1944 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1945 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1946 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1947
1948 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1949 """FindFirst(self, String spec, int flags=0) -> String"""
1950 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1951
1952 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1953 """FindNext(self) -> String"""
1954 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
d55e5bfc 1955
2131d850 1956_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d55e5bfc 1957
5b5c9bc7 1958def MemoryFSHandler_RemoveFile(*args, **kwargs):
1bd55598
RD
1959 """MemoryFSHandler_RemoveFile(String filename)"""
1960 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 1961
5b5c9bc7
RD
1962IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1963IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1964IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d55e5bfc
RD
1965#---------------------------------------------------------------------------
1966
5b5c9bc7 1967class ImageHandler(Object):
27fb7603
RD
1968 """
1969 This is the base class for implementing image file loading/saving, and
1970 image creation from data. It is used within `wx.Image` and is not
1971 normally seen by the application.
1972 """
1bd55598
RD
1973 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1974 def __init__(self): raise AttributeError, "No constructor defined"
1975 __repr__ = _swig_repr
d55e5bfc 1976 def GetName(*args, **kwargs):
5b5c9bc7
RD
1977 """GetName(self) -> String"""
1978 return _core_.ImageHandler_GetName(*args, **kwargs)
d55e5bfc
RD
1979
1980 def GetExtension(*args, **kwargs):
5b5c9bc7
RD
1981 """GetExtension(self) -> String"""
1982 return _core_.ImageHandler_GetExtension(*args, **kwargs)
d55e5bfc
RD
1983
1984 def GetType(*args, **kwargs):
1985 """GetType(self) -> long"""
5b5c9bc7 1986 return _core_.ImageHandler_GetType(*args, **kwargs)
d55e5bfc
RD
1987
1988 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
1989 """GetMimeType(self) -> String"""
1990 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
d55e5bfc
RD
1991
1992 def CanRead(*args, **kwargs):
5b5c9bc7
RD
1993 """CanRead(self, String name) -> bool"""
1994 return _core_.ImageHandler_CanRead(*args, **kwargs)
d55e5bfc 1995
b02396e8
RD
1996 def CanReadStream(*args, **kwargs):
1997 """CanReadStream(self, InputStream stream) -> bool"""
1998 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
1999
d55e5bfc 2000 def SetName(*args, **kwargs):
5b5c9bc7
RD
2001 """SetName(self, String name)"""
2002 return _core_.ImageHandler_SetName(*args, **kwargs)
d55e5bfc
RD
2003
2004 def SetExtension(*args, **kwargs):
5b5c9bc7
RD
2005 """SetExtension(self, String extension)"""
2006 return _core_.ImageHandler_SetExtension(*args, **kwargs)
d55e5bfc
RD
2007
2008 def SetType(*args, **kwargs):
2009 """SetType(self, long type)"""
5b5c9bc7 2010 return _core_.ImageHandler_SetType(*args, **kwargs)
d55e5bfc
RD
2011
2012 def SetMimeType(*args, **kwargs):
5b5c9bc7
RD
2013 """SetMimeType(self, String mimetype)"""
2014 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
d55e5bfc 2015
2131d850 2016_core_.ImageHandler_swigregister(ImageHandler)
d55e5bfc 2017
943e8dfd
RD
2018class PyImageHandler(ImageHandler):
2019 """
2020 This is the base class for implementing image file loading/saving, and
2021 image creation from data, all written in Python. To create a custom
2022 image handler derive a new class from wx.PyImageHandler and provide
2023 the following methods::
2024
2025 def DoCanRead(self, stream) --> bool
2026 '''Check if this handler can read the image on the stream'''
2027
2028 def LoadFile(self, image, stream, verbose, index) --> bool
2029 '''Load image data from the stream and load it into image.'''
2030
2031 def SaveFile(self, image, stream, verbose) --> bool
2032 '''Save the iamge data in image to the stream using
2033 this handler's image file format.'''
2034
2035 def GetImageCount(self, stream) --> int
2036 '''If this image format can hold more than one image,
2037 how many does the image on the stream have?'''
2038
2039 To activate your handler create an instance of it and pass it to
2040 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2041 `SetExtension` from your constructor.
2042
2043 """
1bd55598
RD
2044 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2045 __repr__ = _swig_repr
2046 def __init__(self, *args, **kwargs):
943e8dfd
RD
2047 """
2048 __init__(self) -> PyImageHandler
2049
2050 This is the base class for implementing image file loading/saving, and
2051 image creation from data, all written in Python. To create a custom
2052 image handler derive a new class from wx.PyImageHandler and provide
2053 the following methods::
2054
2055 def DoCanRead(self, stream) --> bool
2056 '''Check if this handler can read the image on the stream'''
2057
2058 def LoadFile(self, image, stream, verbose, index) --> bool
2059 '''Load image data from the stream and load it into image.'''
2060
2061 def SaveFile(self, image, stream, verbose) --> bool
2062 '''Save the iamge data in image to the stream using
2063 this handler's image file format.'''
2064
2065 def GetImageCount(self, stream) --> int
2066 '''If this image format can hold more than one image,
2067 how many does the image on the stream have?'''
2068
2069 To activate your handler create an instance of it and pass it to
2070 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2071 `SetExtension` from your constructor.
2072
2073 """
1bd55598 2074 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
RD
2075 self._SetSelf(self)
2076
2077 def _SetSelf(*args, **kwargs):
2078 """_SetSelf(self, PyObject self)"""
2079 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2080
2131d850 2081_core_.PyImageHandler_swigregister(PyImageHandler)
943e8dfd 2082
5b5c9bc7
RD
2083class ImageHistogram(object):
2084 """Proxy of C++ ImageHistogram class"""
1bd55598
RD
2085 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2086 __repr__ = _swig_repr
2087 def __init__(self, *args, **kwargs):
5b5c9bc7 2088 """__init__(self) -> ImageHistogram"""
1bd55598 2089 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
d55e5bfc
RD
2090 def MakeKey(*args, **kwargs):
2091 """
7a27cf7c 2092 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2093
2094 Get the key in the histogram for the given RGB values
2095 """
5b5c9bc7 2096 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc
RD
2097
2098 MakeKey = staticmethod(MakeKey)
2099 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2100 """
2101 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2102
2103 Find first colour that is not used in the image and has higher RGB
2104 values than startR, startG, startB. Returns a tuple consisting of a
2105 success flag and rgb values.
2106 """
5b5c9bc7 2107 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2108
f1cbd8fa
RD
2109 def GetCount(*args, **kwargs):
2110 """
2111 GetCount(self, unsigned long key) -> unsigned long
2112
2113 Returns the pixel count for the given key. Use `MakeKey` to create a
2114 key value from a RGB tripple.
2115 """
5b5c9bc7 2116 return _core_.ImageHistogram_GetCount(*args, **kwargs)
f1cbd8fa
RD
2117
2118 def GetCountRGB(*args, **kwargs):
2119 """
7a27cf7c 2120 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2121
2122 Returns the pixel count for the given RGB values.
2123 """
5b5c9bc7 2124 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
f1cbd8fa
RD
2125
2126 def GetCountColour(*args, **kwargs):
2127 """
5b5c9bc7 2128 GetCountColour(self, Colour colour) -> unsigned long
f1cbd8fa
RD
2129
2130 Returns the pixel count for the given `wx.Colour` value.
2131 """
5b5c9bc7 2132 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
f1cbd8fa 2133
2131d850 2134_core_.ImageHistogram_swigregister(ImageHistogram)
d55e5bfc 2135
5b5c9bc7 2136def ImageHistogram_MakeKey(*args, **kwargs):
1bd55598 2137 """
7a27cf7c 2138 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2139
2140 Get the key in the histogram for the given RGB values
2141 """
1bd55598 2142 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2143
943e8dfd
RD
2144class Image_RGBValue(object):
2145 """
2146 An object that contains values for red, green and blue which represent
2147 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2148 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2149 color space.
2150 """
1bd55598
RD
2151 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2152 __repr__ = _swig_repr
2153 def __init__(self, *args, **kwargs):
943e8dfd
RD
2154 """
2155 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2156
2157 Constructor.
2158 """
1bd55598 2159 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
2160 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2161 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2162 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2163_core_.Image_RGBValue_swigregister(Image_RGBValue)
943e8dfd
RD
2164
2165class Image_HSVValue(object):
2166 """
2167 An object that contains values for hue, saturation and value which
2168 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2169 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2170 color space.
2171 """
1bd55598
RD
2172 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2173 __repr__ = _swig_repr
2174 def __init__(self, *args, **kwargs):
943e8dfd
RD
2175 """
2176 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2177
2178 Constructor.
2179 """
1bd55598 2180 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
2181 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2182 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2183 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2184_core_.Image_HSVValue_swigregister(Image_HSVValue)
943e8dfd 2185
5b5c9bc7 2186class Image(Object):
7a27cf7c
RD
2187 """
2188 A platform-independent image class. An image can be created from
2189 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2190 variety of formats. Functions are available to set and get image
2191 bits, so it can be used for basic image manipulation.
2192
2193 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2194 platform-specific `wx.Bitmap` object must be created from it using the
2195 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2196 device context, using `wx.DC.DrawBitmap`.
2197
2198 One colour value of the image may be used as a mask colour which will
2199 lead to the automatic creation of a `wx.Mask` object associated to the
2200 bitmap object.
2201
2202 wx.Image supports alpha channel data, that is in addition to a byte
2203 for the red, green and blue colour components for each pixel it also
2204 stores a byte representing the pixel opacity. An alpha value of 0
2205 corresponds to a transparent pixel (null opacity) while a value of 255
2206 means that the pixel is 100% opaque.
2207
2208 Unlike RGB data, not all images have an alpha channel and before using
2209 `GetAlpha` you should check if this image contains an alpha channel
2210 with `HasAlpha`. Note that currently only images loaded from PNG files
2211 with transparency information will have an alpha channel.
2212 """
1bd55598
RD
2213 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2214 __repr__ = _swig_repr
2215 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2216 """
2217 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2218
2219 Loads an image from a file.
2220 """
1bd55598
RD
2221 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2222 __swig_destroy__ = _core_.delete_Image
2223 __del__ = lambda self : None;
d55e5bfc 2224 def Create(*args, **kwargs):
7a27cf7c
RD
2225 """
2226 Create(self, int width, int height, bool clear=True)
2227
2228 Creates a fresh image. If clear is ``True``, the new image will be
2229 initialized to black. Otherwise, the image data will be uninitialized.
2230 """
5b5c9bc7 2231 return _core_.Image_Create(*args, **kwargs)
d55e5bfc
RD
2232
2233 def Destroy(*args, **kwargs):
2234 """
2235 Destroy(self)
2236
7a27cf7c 2237 Destroys the image data.
d55e5bfc 2238 """
7e08d4ef
RD
2239 val = _core_.Image_Destroy(*args, **kwargs)
2240 args[0].thisown = 0
2241 return val
d55e5bfc
RD
2242
2243 def Scale(*args, **kwargs):
7a27cf7c
RD
2244 """
2245 Scale(self, int width, int height) -> Image
2246
2247 Returns a scaled version of the image. This is also useful for scaling
2248 bitmaps in general as the only other way to scale bitmaps is to blit a
2249 `wx.MemoryDC` into another `wx.MemoryDC`.
2250 """
5b5c9bc7 2251 return _core_.Image_Scale(*args, **kwargs)
d55e5bfc
RD
2252
2253 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2254 """
2255 ShrinkBy(self, int xFactor, int yFactor) -> Image
2256
2257 Return a version of the image scaled smaller by the given factors.
2258 """
5b5c9bc7 2259 return _core_.Image_ShrinkBy(*args, **kwargs)
d55e5bfc
RD
2260
2261 def Rescale(*args, **kwargs):
7a27cf7c
RD
2262 """
2263 Rescale(self, int width, int height) -> Image
2264
2265 Changes the size of the image in-place by scaling it: after a call to
2266 this function, the image will have the given width and height.
2267
2268 Returns the (modified) image itself.
2269 """
5b5c9bc7 2270 return _core_.Image_Rescale(*args, **kwargs)
d55e5bfc 2271
aff4cc5c 2272 def Resize(*args, **kwargs):
7a27cf7c
RD
2273 """
2274 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2275
2276 Changes the size of the image in-place without scaling it, by adding
2277 either a border with the given colour or cropping as necessary. The
2278 image is pasted into a new image with the given size and background
2279 colour at the position pos relative to the upper left of the new
2280 image. If red = green = blue = -1 then use either the current mask
2281 colour if set or find, use, and set a suitable mask colour for any
2282 newly exposed areas.
2283
2284 Returns the (modified) image itself.
2285 """
5b5c9bc7 2286 return _core_.Image_Resize(*args, **kwargs)
aff4cc5c 2287
d55e5bfc 2288 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2289 """
2290 SetRGB(self, int x, int y, byte r, byte g, byte b)
2291
2292 Sets the pixel at the given coordinate. This routine performs
2293 bounds-checks for the coordinate so it can be considered a safe way to
2294 manipulate the data, but in some cases this might be too slow so that
2295 the data will have to be set directly. In that case you will have to
2296 get access to the image data using the `GetData` method.
2297 """
5b5c9bc7 2298 return _core_.Image_SetRGB(*args, **kwargs)
d55e5bfc 2299
aff4cc5c 2300 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2301 """
2302 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2303
2304 Sets the colour of the pixels within the given rectangle. This routine
2305 performs bounds-checks for the rectangle so it can be considered a
2306 safe way to manipulate the data.
2307 """
5b5c9bc7 2308 return _core_.Image_SetRGBRect(*args, **kwargs)
aff4cc5c 2309
d55e5bfc 2310 def GetRed(*args, **kwargs):
7a27cf7c
RD
2311 """
2312 GetRed(self, int x, int y) -> byte
2313
2314 Returns the red intensity at the given coordinate.
2315 """
5b5c9bc7 2316 return _core_.Image_GetRed(*args, **kwargs)
d55e5bfc
RD
2317
2318 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2319 """
2320 GetGreen(self, int x, int y) -> byte
2321
2322 Returns the green intensity at the given coordinate.
2323 """
5b5c9bc7 2324 return _core_.Image_GetGreen(*args, **kwargs)
d55e5bfc
RD
2325
2326 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2327 """
2328 GetBlue(self, int x, int y) -> byte
2329
2330 Returns the blue intensity at the given coordinate.
2331 """
5b5c9bc7 2332 return _core_.Image_GetBlue(*args, **kwargs)
d55e5bfc
RD
2333
2334 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2335 """
2336 SetAlpha(self, int x, int y, byte alpha)
2337
2338 Sets the alpha value for the given pixel. This function should only be
2339 called if the image has alpha channel data, use `HasAlpha` to check
2340 for this.
2341 """
5b5c9bc7 2342 return _core_.Image_SetAlpha(*args, **kwargs)
d55e5bfc
RD
2343
2344 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2345 """
2346 GetAlpha(self, int x, int y) -> byte
2347
2348 Returns the alpha value for the given pixel. This function may only be
2349 called for the images with alpha channel, use `HasAlpha` to check for
2350 this.
2351
2352 The returned value is the *opacity* of the image, i.e. the value of 0
2353 corresponds to the fully transparent pixels while the value of 255 to
2354 the fully opaque pixels.
2355 """
5b5c9bc7 2356 return _core_.Image_GetAlpha(*args, **kwargs)
d55e5bfc
RD
2357
2358 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2359 """
2360 HasAlpha(self) -> bool
2361
2362 Returns true if this image has alpha channel, false otherwise.
2363 """
5b5c9bc7 2364 return _core_.Image_HasAlpha(*args, **kwargs)
d55e5bfc 2365
68350608
RD
2366 def InitAlpha(*args, **kwargs):
2367 """
2368 InitAlpha(self)
2369
2370 Initializes the image alpha channel data. It is an error to call it if
2371 the image already has alpha data. If it doesn't, alpha data will be by
2372 default initialized to all pixels being fully opaque. But if the image
2373 has a a mask colour, all mask pixels will be completely transparent.
2374 """
5b5c9bc7
RD
2375 return _core_.Image_InitAlpha(*args, **kwargs)
2376
2377 def IsTransparent(*args, **kwargs):
2378 """
7a27cf7c 2379 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
5b5c9bc7 2380
7a27cf7c
RD
2381 Returns ``True`` if this pixel is masked or has an alpha value less
2382 than the spcified threshold.
5b5c9bc7
RD
2383 """
2384 return _core_.Image_IsTransparent(*args, **kwargs)
68350608 2385
d55e5bfc 2386 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2387 """
2388 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2389
2390 Find first colour that is not used in the image and has higher RGB
2391 values than startR, startG, startB. Returns a tuple consisting of a
2392 success flag and rgb values.
2393 """
5b5c9bc7 2394 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2395
4cf4100f
RD
2396 def ConvertAlphaToMask(*args, **kwargs):
2397 """
5b5c9bc7 2398 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2399
7a27cf7c
RD
2400 If the image has alpha channel, this method converts it to mask. All
2401 pixels with alpha value less than ``threshold`` are replaced with the
2402 mask colour and the alpha channel is removed. The mask colour is
2403 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2404
2405 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2406 nothing.
2407 """
5b5c9bc7 2408 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
4cf4100f 2409
8fb0e70a
RD
2410 def ConvertColourToAlpha(*args, **kwargs):
2411 """
7a27cf7c 2412 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2413
2414 This method converts an image where the original alpha information is
2415 only available as a shades of a colour (actually shades of grey)
2416 typically when you draw anti-aliased text into a bitmap. The DC
2417 drawing routines draw grey values on the black background although
2418 they actually mean to draw white with differnt alpha values. This
2419 method reverses it, assuming a black (!) background and white text.
2420 The method will then fill up the whole image with the colour given.
2421 """
5b5c9bc7 2422 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
8fb0e70a 2423
d55e5bfc 2424 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2425 """
2426 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2427
2428 Sets the image's mask so that the pixels that have RGB value of
2429 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2430 by first finding an unused colour in the image, setting this colour as
2431 the mask colour and then using this colour to draw all pixels in the
2432 image who corresponding pixel in mask has given RGB value.
2433
2434 Returns ``False`` if ``mask`` does not have same dimensions as the
2435 image or if there is no unused colour left. Returns ``True`` if the
2436 mask was successfully applied.
2437
2438 Note that this method involves computing the histogram, which is
2439 computationally intensive operation.
2440 """
5b5c9bc7 2441 return _core_.Image_SetMaskFromImage(*args, **kwargs)
d55e5bfc
RD
2442
2443 def CanRead(*args, **kwargs):
7a27cf7c
RD
2444 """
2445 CanRead(String filename) -> bool
2446
2447 Returns True if the image handlers can read this file.
2448 """
5b5c9bc7 2449 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
RD
2450
2451 CanRead = staticmethod(CanRead)
2452 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2453 """
2454 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2455
2456 If the image file contains more than one image and the image handler
2457 is capable of retrieving these individually, this function will return
2458 the number of available images.
2459 """
5b5c9bc7 2460 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
RD
2461
2462 GetImageCount = staticmethod(GetImageCount)
2463 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2464 """
2465 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2466
2467 Loads an image from a file. If no handler type is provided, the
2468 library will try to autodetect the format.
2469 """
5b5c9bc7 2470 return _core_.Image_LoadFile(*args, **kwargs)
d55e5bfc
RD
2471
2472 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2473 """
2474 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2475
2476 Loads an image from a file, specifying the image type with a MIME type
2477 string.
2478 """
5b5c9bc7 2479 return _core_.Image_LoadMimeFile(*args, **kwargs)
d55e5bfc
RD
2480
2481 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2482 """
2483 SaveFile(self, String name, int type) -> bool
2484
2485 Saves an image in the named file.
2486 """
5b5c9bc7 2487 return _core_.Image_SaveFile(*args, **kwargs)
d55e5bfc
RD
2488
2489 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2490 """
2491 SaveMimeFile(self, String name, String mimetype) -> bool
2492
2493 Saves an image in the named file.
2494 """
5b5c9bc7 2495 return _core_.Image_SaveMimeFile(*args, **kwargs)
d55e5bfc
RD
2496
2497 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2498 """
2499 CanReadStream(InputStream stream) -> bool
2500
2501 Returns True if the image handlers can read an image file from the
2502 data currently on the input stream, or a readable Python file-like
2503 object.
2504 """
5b5c9bc7 2505 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
RD
2506
2507 CanReadStream = staticmethod(CanReadStream)
2508 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2509 """
2510 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2511
2512 Loads an image from an input stream or a readable Python file-like
2513 object. If no handler type is provided, the library will try to
2514 autodetect the format.
2515 """
5b5c9bc7 2516 return _core_.Image_LoadStream(*args, **kwargs)
d55e5bfc
RD
2517
2518 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2519 """
2520 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2521
2522 Loads an image from an input stream or a readable Python file-like
2523 object, using a MIME type string to specify the image file format.
2524 """
5b5c9bc7 2525 return _core_.Image_LoadMimeStream(*args, **kwargs)
d55e5bfc
RD
2526
2527 def Ok(*args, **kwargs):
7a27cf7c
RD
2528 """
2529 Ok(self) -> bool
2530
2531 Returns true if image data is present.
2532 """
5b5c9bc7 2533 return _core_.Image_Ok(*args, **kwargs)
d55e5bfc
RD
2534
2535 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2536 """
2537 GetWidth(self) -> int
2538
2539 Gets the width of the image in pixels.
2540 """
5b5c9bc7 2541 return _core_.Image_GetWidth(*args, **kwargs)
d55e5bfc
RD
2542
2543 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2544 """
2545 GetHeight(self) -> int
2546
2547 Gets the height of the image in pixels.
2548 """
5b5c9bc7 2549 return _core_.Image_GetHeight(*args, **kwargs)
d55e5bfc
RD
2550
2551 def GetSize(*args, **kwargs):
7a27cf7c
RD
2552 """
2553 GetSize(self) -> Size
2554
2555 Returns the size of the image in pixels.
2556 """
5b5c9bc7 2557 return _core_.Image_GetSize(*args, **kwargs)
d55e5bfc
RD
2558
2559 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2560 """
2561 GetSubImage(self, Rect rect) -> Image
2562
2563 Returns a sub image of the current one as long as the rect belongs
2564 entirely to the image.
2565 """
5b5c9bc7 2566 return _core_.Image_GetSubImage(*args, **kwargs)
d55e5bfc 2567
aff4cc5c 2568 def Size(*args, **kwargs):
7a27cf7c
RD
2569 """
2570 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2571
2572 Returns a resized version of this image without scaling it by adding
2573 either a border with the given colour or cropping as necessary. The
2574 image is pasted into a new image with the given size and background
2575 colour at the position ``pos`` relative to the upper left of the new
2576 image. If red = green = blue = -1 then use either the current mask
2577 colour if set or find, use, and set a suitable mask colour for any
2578 newly exposed areas.
2579 """
5b5c9bc7 2580 return _core_.Image_Size(*args, **kwargs)
aff4cc5c 2581
d55e5bfc 2582 def Copy(*args, **kwargs):
7a27cf7c
RD
2583 """
2584 Copy(self) -> Image
2585
2586 Returns an identical copy of the image.
2587 """
5b5c9bc7 2588 return _core_.Image_Copy(*args, **kwargs)
d55e5bfc
RD
2589
2590 def Paste(*args, **kwargs):
7a27cf7c
RD
2591 """
2592 Paste(self, Image image, int x, int y)
2593
2594 Pastes ``image`` into this instance and takes care of the mask colour
2595 and any out of bounds problems.
2596 """
5b5c9bc7 2597 return _core_.Image_Paste(*args, **kwargs)
d55e5bfc
RD
2598
2599 def GetData(*args, **kwargs):
bb2ef2cc
RD
2600 """
2601 GetData(self) -> PyObject
2602
2603 Returns a string containing a copy of the RGB bytes of the image.
2604 """
5b5c9bc7 2605 return _core_.Image_GetData(*args, **kwargs)
d55e5bfc
RD
2606
2607 def SetData(*args, **kwargs):
bb2ef2cc
RD
2608 """
2609 SetData(self, buffer data)
2610
2611 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2612 either a string or a buffer object holding the data and the length of
2613 the data must be width*height*3.
2614 """
5b5c9bc7 2615 return _core_.Image_SetData(*args, **kwargs)
d55e5bfc
RD
2616
2617 def GetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2618 """
2619 GetDataBuffer(self) -> PyObject
2620
2621 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2622 image data buffer inside the wx.Image. You need to ensure that you do
2623 not use this buffer object after the image has been destroyed.
bb2ef2cc 2624 """
5b5c9bc7 2625 return _core_.Image_GetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2626
2627 def SetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2628 """
2629 SetDataBuffer(self, buffer data)
2630
2631 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2632 object. This can save making an extra copy of the data but you must
2633 ensure that the buffer object lives longer than the wx.Image does.
bb2ef2cc 2634 """
5b5c9bc7 2635 return _core_.Image_SetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2636
2637 def GetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2638 """
2639 GetAlphaData(self) -> PyObject
2640
2641 Returns a string containing a copy of the alpha bytes of the image.
2642 """
5b5c9bc7 2643 return _core_.Image_GetAlphaData(*args, **kwargs)
d55e5bfc
RD
2644
2645 def SetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2646 """
2647 SetAlphaData(self, buffer alpha)
2648
2649 Resets the Image's alpha data from a buffer of bytes. Accepts either
2650 a string or a buffer object holding the data and the length of the
2651 data must be width*height.
2652 """
5b5c9bc7 2653 return _core_.Image_SetAlphaData(*args, **kwargs)
d55e5bfc
RD
2654
2655 def GetAlphaBuffer(*args, **kwargs):
2656 """GetAlphaBuffer(self) -> PyObject"""
5b5c9bc7 2657 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2658
2659 def SetAlphaBuffer(*args, **kwargs):
bb2ef2cc 2660 """SetAlphaBuffer(self, buffer alpha)"""
5b5c9bc7 2661 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2662
2663 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2664 """
2665 SetMaskColour(self, byte r, byte g, byte b)
2666
2667 Sets the mask colour for this image (and tells the image to use the
2668 mask).
2669 """
5b5c9bc7 2670 return _core_.Image_SetMaskColour(*args, **kwargs)
d55e5bfc 2671
aff4cc5c
RD
2672 def GetOrFindMaskColour(*args, **kwargs):
2673 """
2674 GetOrFindMaskColour() -> (r,g,b)
2675
2676 Get the current mask colour or find a suitable colour.
2677 """
5b5c9bc7 2678 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
aff4cc5c 2679
d55e5bfc 2680 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2681 """
2682 GetMaskRed(self) -> byte
2683
2684 Gets the red component of the mask colour.
2685 """
5b5c9bc7 2686 return _core_.Image_GetMaskRed(*args, **kwargs)
d55e5bfc
RD
2687
2688 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2689 """
2690 GetMaskGreen(self) -> byte
2691
2692 Gets the green component of the mask colour.
2693 """
5b5c9bc7 2694 return _core_.Image_GetMaskGreen(*args, **kwargs)
d55e5bfc
RD
2695
2696 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2697 """
2698 GetMaskBlue(self) -> byte
2699
2700 Gets the blue component of the mask colour.
2701 """
5b5c9bc7 2702 return _core_.Image_GetMaskBlue(*args, **kwargs)
d55e5bfc
RD
2703
2704 def SetMask(*args, **kwargs):
7a27cf7c
RD
2705 """
2706 SetMask(self, bool mask=True)
2707
2708 Specifies whether there is a mask or not. The area of the mask is
2709 determined by the current mask colour.
2710 """
5b5c9bc7 2711 return _core_.Image_SetMask(*args, **kwargs)
d55e5bfc
RD
2712
2713 def HasMask(*args, **kwargs):
7a27cf7c
RD
2714 """
2715 HasMask(self) -> bool
2716
2717 Returns ``True`` if there is a mask active, ``False`` otherwise.
2718 """
5b5c9bc7 2719 return _core_.Image_HasMask(*args, **kwargs)
d55e5bfc
RD
2720
2721 def Rotate(*args, **kwargs):
2722 """
5b5c9bc7
RD
2723 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2724 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2725
2726 Rotates the image about the given point, by ``angle`` radians. Passing
2727 ``True`` to ``interpolating`` results in better image quality, but is
2728 slower. If the image has a mask, then the mask colour is used for the
2729 uncovered pixels in the rotated image background. Otherwise, black
2730 will be used as the fill colour.
2731
2732 Returns the rotated image, leaving this image intact.
d55e5bfc 2733 """
5b5c9bc7 2734 return _core_.Image_Rotate(*args, **kwargs)
d55e5bfc
RD
2735
2736 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2737 """
2738 Rotate90(self, bool clockwise=True) -> Image
2739
2740 Returns a copy of the image rotated 90 degrees in the direction
2741 indicated by ``clockwise``.
2742 """
5b5c9bc7 2743 return _core_.Image_Rotate90(*args, **kwargs)
d55e5bfc
RD
2744
2745 def Mirror(*args, **kwargs):
7a27cf7c
RD
2746 """
2747 Mirror(self, bool horizontally=True) -> Image
2748
2749 Returns a mirrored copy of the image. The parameter ``horizontally``
2750 indicates the orientation.
2751 """
5b5c9bc7 2752 return _core_.Image_Mirror(*args, **kwargs)
d55e5bfc
RD
2753
2754 def Replace(*args, **kwargs):
2755 """
7a27cf7c
RD
2756 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2757
2758 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2759 ``(r2,g2,b2)``.
d55e5bfc 2760 """
5b5c9bc7 2761 return _core_.Image_Replace(*args, **kwargs)
d55e5bfc 2762
32fe5131
RD
2763 def ConvertToGreyscale(*args, **kwargs):
2764 """
2765 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2766
2767 Convert to greyscale image. Uses the luminance component (Y) of the
2768 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2769 defaults to ITU-T BT.601
2770 """
2771 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2772
d55e5bfc 2773 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2774 """
2775 ConvertToMono(self, byte r, byte g, byte b) -> Image
2776
2777 Returns monochromatic version of the image. The returned image has
2778 white colour where the original has ``(r,g,b)`` colour and black
2779 colour everywhere else.
2780 """
5b5c9bc7 2781 return _core_.Image_ConvertToMono(*args, **kwargs)
d55e5bfc
RD
2782
2783 def SetOption(*args, **kwargs):
7a27cf7c
RD
2784 """
2785 SetOption(self, String name, String value)
2786
2787 Sets an image handler defined option. For example, when saving as a
2788 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2789 number between 0 and 100 (0 is terrible, 100 is very good).
2790 """
5b5c9bc7 2791 return _core_.Image_SetOption(*args, **kwargs)
d55e5bfc
RD
2792
2793 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2794 """
2795 SetOptionInt(self, String name, int value)
2796
2797 Sets an image option as an integer.
2798 """
5b5c9bc7 2799 return _core_.Image_SetOptionInt(*args, **kwargs)
d55e5bfc
RD
2800
2801 def GetOption(*args, **kwargs):
7a27cf7c
RD
2802 """
2803 GetOption(self, String name) -> String
2804
2805 Gets the value of an image handler option.
2806 """
5b5c9bc7 2807 return _core_.Image_GetOption(*args, **kwargs)
d55e5bfc
RD
2808
2809 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2810 """
2811 GetOptionInt(self, String name) -> int
2812
2813 Gets the value of an image handler option as an integer. If the given
2814 option is not present, the function returns 0.
2815 """
5b5c9bc7 2816 return _core_.Image_GetOptionInt(*args, **kwargs)
d55e5bfc
RD
2817
2818 def HasOption(*args, **kwargs):
7a27cf7c
RD
2819 """
2820 HasOption(self, String name) -> bool
2821
2822 Returns true if the given option is present.
2823 """
5b5c9bc7 2824 return _core_.Image_HasOption(*args, **kwargs)
d55e5bfc
RD
2825
2826 def CountColours(*args, **kwargs):
2827 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
5b5c9bc7 2828 return _core_.Image_CountColours(*args, **kwargs)
d55e5bfc
RD
2829
2830 def ComputeHistogram(*args, **kwargs):
5b5c9bc7
RD
2831 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2832 return _core_.Image_ComputeHistogram(*args, **kwargs)
d55e5bfc
RD
2833
2834 def AddHandler(*args, **kwargs):
5b5c9bc7
RD
2835 """AddHandler(ImageHandler handler)"""
2836 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
2837
2838 AddHandler = staticmethod(AddHandler)
2839 def InsertHandler(*args, **kwargs):
5b5c9bc7
RD
2840 """InsertHandler(ImageHandler handler)"""
2841 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
2842
2843 InsertHandler = staticmethod(InsertHandler)
2844 def RemoveHandler(*args, **kwargs):
5b5c9bc7
RD
2845 """RemoveHandler(String name) -> bool"""
2846 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc
RD
2847
2848 RemoveHandler = staticmethod(RemoveHandler)
1bd55598
RD
2849 def GetHandlers(*args, **kwargs):
2850 """GetHandlers() -> PyObject"""
2851 return _core_.Image_GetHandlers(*args, **kwargs)
2852
2853 GetHandlers = staticmethod(GetHandlers)
d55e5bfc 2854 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2855 """
2856 GetImageExtWildcard() -> String
2857
2858 Iterates all registered wxImageHandler objects, and returns a string
2859 containing file extension masks suitable for passing to file open/save
2860 dialog boxes.
2861 """
5b5c9bc7 2862 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc
RD
2863
2864 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2865 def ConvertToBitmap(*args, **kwargs):
5b5c9bc7
RD
2866 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2867 return _core_.Image_ConvertToBitmap(*args, **kwargs)
d55e5bfc
RD
2868
2869 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 2870 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
5b5c9bc7 2871 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
d55e5bfc 2872
943e8dfd
RD
2873 def RotateHue(*args, **kwargs):
2874 """
2875 RotateHue(self, double angle)
2876
2877 Rotates the hue of each pixel of the image. Hue is a double in the
2878 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2879 """
2880 return _core_.Image_RotateHue(*args, **kwargs)
2881
2882 def RGBtoHSV(*args, **kwargs):
2883 """
2884 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2885
2886 Converts a color in RGB color space to HSV color space.
2887 """
2888 return _core_.Image_RGBtoHSV(*args, **kwargs)
2889
2890 RGBtoHSV = staticmethod(RGBtoHSV)
2891 def HSVtoRGB(*args, **kwargs):
2892 """
2893 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2894
2895 Converts a color in HSV color space to RGB color space.
2896 """
2897 return _core_.Image_HSVtoRGB(*args, **kwargs)
2898
2899 HSVtoRGB = staticmethod(HSVtoRGB)
d55e5bfc 2900 def __nonzero__(self): return self.Ok()
2131d850 2901_core_.Image_swigregister(Image)
d55e5bfc
RD
2902
2903def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
2904 """
2905 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2906
2907 Loads an image from a file, using a MIME type string (such as
2908 'image/jpeg') to specify image type.
2909 """
5b5c9bc7 2910 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
2911 return val
2912
2913def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
2914 """
2915 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2916
2917 Loads an image from an input stream, or any readable Python file-like
2918 object.
2919 """
5b5c9bc7 2920 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
2921 return val
2922
2923def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
2924 """
2925 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2926
2927 Loads an image from an input stream, or any readable Python file-like
2928 object, specifying the image format with a MIME type string.
2929 """
5b5c9bc7 2930 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
2931 return val
2932
d6c14a4c 2933def EmptyImage(*args, **kwargs):
bb2ef2cc 2934 """
5b5c9bc7 2935 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
bb2ef2cc
RD
2936
2937 Construct an empty image of a given size, optionally setting all
2938 pixels to black.
2939 """
5b5c9bc7 2940 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
2941 return val
2942
2943def ImageFromBitmap(*args, **kwargs):
bb2ef2cc 2944 """
5b5c9bc7 2945 ImageFromBitmap(Bitmap bitmap) -> Image
bb2ef2cc
RD
2946
2947 Construct an Image from a `wx.Bitmap`.
2948 """
5b5c9bc7 2949 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
2950 return val
2951
2952def ImageFromData(*args, **kwargs):
bb2ef2cc 2953 """
5b5c9bc7 2954 ImageFromData(int width, int height, buffer data) -> Image
bb2ef2cc
RD
2955
2956 Construct an Image from a buffer of RGB bytes. Accepts either a
2957 string or a buffer object holding the data and the length of the data
2958 must be width*height*3.
2959 """
5b5c9bc7 2960 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
2961 return val
2962
03e46024 2963def ImageFromDataWithAlpha(*args, **kwargs):
bb2ef2cc 2964 """
5b5c9bc7 2965 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
bb2ef2cc
RD
2966
2967 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2968 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
2969 length of the data must be width*height*3 bytes, and the length of the
2970 alpha data must be width*height bytes.
bb2ef2cc 2971 """
5b5c9bc7 2972 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
03e46024
RD
2973 return val
2974
5b5c9bc7 2975def Image_CanRead(*args, **kwargs):
1bd55598 2976 """
7a27cf7c
RD
2977 Image_CanRead(String filename) -> bool
2978
2979 Returns True if the image handlers can read this file.
2980 """
1bd55598 2981 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc 2982
5b5c9bc7 2983def Image_GetImageCount(*args, **kwargs):
1bd55598 2984 """
7a27cf7c
RD
2985 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2986
2987 If the image file contains more than one image and the image handler
2988 is capable of retrieving these individually, this function will return
2989 the number of available images.
2990 """
1bd55598 2991 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc 2992
5b5c9bc7 2993def Image_CanReadStream(*args, **kwargs):
1bd55598 2994 """
7a27cf7c
RD
2995 Image_CanReadStream(InputStream stream) -> bool
2996
2997 Returns True if the image handlers can read an image file from the
2998 data currently on the input stream, or a readable Python file-like
2999 object.
3000 """
1bd55598 3001 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc 3002
5b5c9bc7 3003def Image_AddHandler(*args, **kwargs):
1bd55598
RD
3004 """Image_AddHandler(ImageHandler handler)"""
3005 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc 3006
5b5c9bc7 3007def Image_InsertHandler(*args, **kwargs):
1bd55598
RD
3008 """Image_InsertHandler(ImageHandler handler)"""
3009 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc 3010
5b5c9bc7 3011def Image_RemoveHandler(*args, **kwargs):
1bd55598
RD
3012 """Image_RemoveHandler(String name) -> bool"""
3013 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 3014
1bd55598
RD
3015def Image_GetHandlers(*args):
3016 """Image_GetHandlers() -> PyObject"""
3017 return _core_.Image_GetHandlers(*args)
3018
3019def Image_GetImageExtWildcard(*args):
3020 """
7a27cf7c
RD
3021 Image_GetImageExtWildcard() -> String
3022
3023 Iterates all registered wxImageHandler objects, and returns a string
3024 containing file extension masks suitable for passing to file open/save
3025 dialog boxes.
3026 """
1bd55598 3027 return _core_.Image_GetImageExtWildcard(*args)
d55e5bfc 3028
943e8dfd 3029def Image_RGBtoHSV(*args, **kwargs):
1bd55598 3030 """
943e8dfd
RD
3031 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3032
3033 Converts a color in RGB color space to HSV color space.
3034 """
1bd55598 3035 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3036
3037def Image_HSVtoRGB(*args, **kwargs):
1bd55598 3038 """
943e8dfd
RD
3039 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3040
3041 Converts a color in HSV color space to RGB color space.
3042 """
1bd55598 3043 return _core_.Image_HSVtoRGB(*args, **kwargs)
943e8dfd 3044
68e533f8
RD
3045def InitAllImageHandlers():
3046 """
3047 The former functionality of InitAllImageHanders is now done internal to
3048 the _core_ extension module and so this function has become a simple NOP.
3049 """
3050 pass
d55e5bfc 3051
5b5c9bc7
RD
3052IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3053IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3054PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3055PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3056PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3057BMP_24BPP = _core_.BMP_24BPP
3058BMP_8BPP = _core_.BMP_8BPP
3059BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3060BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3061BMP_8BPP_RED = _core_.BMP_8BPP_RED
3062BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3063BMP_4BPP = _core_.BMP_4BPP
3064BMP_1BPP = _core_.BMP_1BPP
3065BMP_1BPP_BW = _core_.BMP_1BPP_BW
3066class BMPHandler(ImageHandler):
27fb7603 3067 """A `wx.ImageHandler` for \*.bmp bitmap files."""
1bd55598
RD
3068 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3069 __repr__ = _swig_repr
3070 def __init__(self, *args, **kwargs):
27fb7603
RD
3071 """
3072 __init__(self) -> BMPHandler
3073
3074 A `wx.ImageHandler` for \*.bmp bitmap files.
3075 """
1bd55598 3076 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3077_core_.BMPHandler_swigregister(BMPHandler)
5b5c9bc7 3078NullImage = cvar.NullImage
68350608 3079IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3080IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3081IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3082IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3083IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3084IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3085IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3086IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3087IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3088IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3089IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3090IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3091IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
7fbf8399
RD
3092IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3093IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc 3094
5b5c9bc7 3095class ICOHandler(BMPHandler):
27fb7603 3096 """A `wx.ImageHandler` for \*.ico icon files."""
1bd55598
RD
3097 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3098 __repr__ = _swig_repr
3099 def __init__(self, *args, **kwargs):
27fb7603
RD
3100 """
3101 __init__(self) -> ICOHandler
3102
3103 A `wx.ImageHandler` for \*.ico icon files.
3104 """
1bd55598 3105 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3106_core_.ICOHandler_swigregister(ICOHandler)
d55e5bfc 3107
5b5c9bc7 3108class CURHandler(ICOHandler):
27fb7603 3109 """A `wx.ImageHandler` for \*.cur cursor files."""
1bd55598
RD
3110 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3111 __repr__ = _swig_repr
3112 def __init__(self, *args, **kwargs):
27fb7603
RD
3113 """
3114 __init__(self) -> CURHandler
3115
3116 A `wx.ImageHandler` for \*.cur cursor files.
3117 """
1bd55598 3118 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3119_core_.CURHandler_swigregister(CURHandler)
d55e5bfc 3120
5b5c9bc7 3121class ANIHandler(CURHandler):
27fb7603 3122 """A `wx.ImageHandler` for \*.ani animated cursor files."""
1bd55598
RD
3123 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3124 __repr__ = _swig_repr
3125 def __init__(self, *args, **kwargs):
27fb7603
RD
3126 """
3127 __init__(self) -> ANIHandler
3128
3129 A `wx.ImageHandler` for \*.ani animated cursor files.
3130 """
1bd55598 3131 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3132_core_.ANIHandler_swigregister(ANIHandler)
d55e5bfc 3133
5b5c9bc7 3134class PNGHandler(ImageHandler):
27fb7603 3135 """A `wx.ImageHandler` for PNG image files."""
1bd55598
RD
3136 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3137 __repr__ = _swig_repr
3138 def __init__(self, *args, **kwargs):
27fb7603
RD
3139 """
3140 __init__(self) -> PNGHandler
3141
3142 A `wx.ImageHandler` for PNG image files.
3143 """
1bd55598 3144 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3145_core_.PNGHandler_swigregister(PNGHandler)
d55e5bfc 3146
5b5c9bc7 3147class GIFHandler(ImageHandler):
27fb7603 3148 """A `wx.ImageHandler` for GIF image files."""
1bd55598
RD
3149 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3150 __repr__ = _swig_repr
3151 def __init__(self, *args, **kwargs):
27fb7603
RD
3152 """
3153 __init__(self) -> GIFHandler
3154
3155 A `wx.ImageHandler` for GIF image files.
3156 """
1bd55598 3157 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3158_core_.GIFHandler_swigregister(GIFHandler)
d55e5bfc 3159
5b5c9bc7 3160class PCXHandler(ImageHandler):
27fb7603 3161 """A `wx.ImageHandler` for PCX imager files."""
1bd55598
RD
3162 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3163 __repr__ = _swig_repr
3164 def __init__(self, *args, **kwargs):
27fb7603
RD
3165 """
3166 __init__(self) -> PCXHandler
3167
3168 A `wx.ImageHandler` for PCX imager files.
3169 """
1bd55598 3170 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3171_core_.PCXHandler_swigregister(PCXHandler)
d55e5bfc 3172
5b5c9bc7 3173class JPEGHandler(ImageHandler):
27fb7603 3174 """A `wx.ImageHandler` for JPEG/JPG image files."""
1bd55598
RD
3175 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3176 __repr__ = _swig_repr
3177 def __init__(self, *args, **kwargs):
27fb7603
RD
3178 """
3179 __init__(self) -> JPEGHandler
3180
3181 A `wx.ImageHandler` for JPEG/JPG image files.
3182 """
1bd55598 3183 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3184_core_.JPEGHandler_swigregister(JPEGHandler)
d55e5bfc 3185
5b5c9bc7 3186class PNMHandler(ImageHandler):
27fb7603 3187 """A `wx.ImageHandler` for PNM image files."""
1bd55598
RD
3188 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3189 __repr__ = _swig_repr
3190 def __init__(self, *args, **kwargs):
27fb7603
RD
3191 """
3192 __init__(self) -> PNMHandler
3193
3194 A `wx.ImageHandler` for PNM image files.
3195 """
1bd55598 3196 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3197_core_.PNMHandler_swigregister(PNMHandler)
d55e5bfc 3198
5b5c9bc7 3199class XPMHandler(ImageHandler):
27fb7603 3200 """A `wx.ImageHandler` for XPM image."""
1bd55598
RD
3201 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3202 __repr__ = _swig_repr
3203 def __init__(self, *args, **kwargs):
27fb7603
RD
3204 """
3205 __init__(self) -> XPMHandler
3206
3207 A `wx.ImageHandler` for XPM image.
3208 """
1bd55598 3209 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3210_core_.XPMHandler_swigregister(XPMHandler)
d55e5bfc 3211
5b5c9bc7 3212class TIFFHandler(ImageHandler):
27fb7603 3213 """A `wx.ImageHandler` for TIFF image files."""
1bd55598
RD
3214 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3215 __repr__ = _swig_repr
3216 def __init__(self, *args, **kwargs):
27fb7603
RD
3217 """
3218 __init__(self) -> TIFFHandler
3219
3220 A `wx.ImageHandler` for TIFF image files.
3221 """
1bd55598 3222 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3223_core_.TIFFHandler_swigregister(TIFFHandler)
d55e5bfc 3224
5b5c9bc7
RD
3225QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3226QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3227class Quantize(object):
c0de73ae 3228 """Performs quantization, or colour reduction, on a wxImage."""
1bd55598
RD
3229 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3230 def __init__(self): raise AttributeError, "No constructor defined"
3231 __repr__ = _swig_repr
c0de73ae
RD
3232 def Quantize(*args, **kwargs):
3233 """
5b5c9bc7 3234 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3235
3236 Reduce the colours in the source image and put the result into the
3237 destination image, setting the palette in the destination if
3238 needed. Both images may be the same, to overwrite the source image.
3239 """
5b5c9bc7 3240 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae
RD
3241
3242 Quantize = staticmethod(Quantize)
2131d850 3243_core_.Quantize_swigregister(Quantize)
c0de73ae 3244
5b5c9bc7 3245def Quantize_Quantize(*args, **kwargs):
1bd55598 3246 """
5b5c9bc7 3247 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3248
3249 Reduce the colours in the source image and put the result into the
3250 destination image, setting the palette in the destination if
3251 needed. Both images may be the same, to overwrite the source image.
3252 """
1bd55598 3253 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3254
d55e5bfc
RD
3255#---------------------------------------------------------------------------
3256
5b5c9bc7
RD
3257class EvtHandler(Object):
3258 """Proxy of C++ EvtHandler class"""
1bd55598
RD
3259 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3260 __repr__ = _swig_repr
3261 def __init__(self, *args, **kwargs):
5b5c9bc7 3262 """__init__(self) -> EvtHandler"""
1bd55598 3263 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d55e5bfc 3264 def GetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3265 """GetNextHandler(self) -> EvtHandler"""
3266 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
d55e5bfc
RD
3267
3268 def GetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3269 """GetPreviousHandler(self) -> EvtHandler"""
3270 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3271
3272 def SetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3273 """SetNextHandler(self, EvtHandler handler)"""
3274 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
d55e5bfc
RD
3275
3276 def SetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3277 """SetPreviousHandler(self, EvtHandler handler)"""
3278 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3279
3280 def GetEvtHandlerEnabled(*args, **kwargs):
3281 """GetEvtHandlerEnabled(self) -> bool"""
5b5c9bc7 3282 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3283
3284 def SetEvtHandlerEnabled(*args, **kwargs):
3285 """SetEvtHandlerEnabled(self, bool enabled)"""
5b5c9bc7 3286 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3287
3288 def ProcessEvent(*args, **kwargs):
5b5c9bc7
RD
3289 """ProcessEvent(self, Event event) -> bool"""
3290 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
d55e5bfc
RD
3291
3292 def AddPendingEvent(*args, **kwargs):
5b5c9bc7
RD
3293 """AddPendingEvent(self, Event event)"""
3294 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
d55e5bfc
RD
3295
3296 def ProcessPendingEvents(*args, **kwargs):
3297 """ProcessPendingEvents(self)"""
5b5c9bc7 3298 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
3299
3300 def Connect(*args, **kwargs):
3301 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
5b5c9bc7 3302 return _core_.EvtHandler_Connect(*args, **kwargs)
d55e5bfc
RD
3303
3304 def Disconnect(*args, **kwargs):
2131d850 3305 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
5b5c9bc7 3306 return _core_.EvtHandler_Disconnect(*args, **kwargs)
d55e5bfc
RD
3307
3308 def _setOORInfo(*args, **kwargs):
36ed4f51 3309 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3310 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3311 args[0].thisown = 0
3312 return val
d55e5bfc
RD
3313
3314 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3315 """
3316 Bind an event to an event handler.
3317
a5ee0656
RD
3318 :param event: One of the EVT_* objects that specifies the
3319 type of event to bind,
d55e5bfc 3320
a5ee0656
RD
3321 :param handler: A callable object to be invoked when the
3322 event is delivered to self. Pass None to
3323 disconnect an event handler.
d55e5bfc 3324
a5ee0656
RD
3325 :param source: Sometimes the event originates from a
3326 different window than self, but you still
3327 want to catch it in self. (For example, a
3328 button event delivered to a frame.) By
3329 passing the source of the event, the event
3330 handling system is able to differentiate
3331 between the same event type from different
3332 controls.
d55e5bfc 3333
a5ee0656
RD
3334 :param id: Used to spcify the event source by ID instead
3335 of instance.
3336
3337 :param id2: Used when it is desirable to bind a handler
3338 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3339 """
3340 if source is not None:
3341 id = source.GetId()
3342 event.Bind(self, id, id2, handler)
3343
d6c14a4c
RD
3344 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3345 """
3346 Disconencts the event handler binding for event from self.
3347 Returns True if successful.
3348 """
3349 if source is not None:
3350 id = source.GetId()
3351 return event.Unbind(self, id, id2)
d55e5bfc 3352
2131d850 3353_core_.EvtHandler_swigregister(EvtHandler)
d55e5bfc
RD
3354
3355#---------------------------------------------------------------------------
3356
3357class PyEventBinder(object):
3358 """
3359 Instances of this class are used to bind specific events to event
3360 handlers.
3361 """
3362 def __init__(self, evtType, expectedIDs=0):
3363 if expectedIDs not in [0, 1, 2]:
3364 raise ValueError, "Invalid number of expectedIDs"
3365 self.expectedIDs = expectedIDs
3366
3367 if type(evtType) == list or type(evtType) == tuple:
3368 self.evtType = evtType
3369 else:
3370 self.evtType = [evtType]
3371
3372
3373 def Bind(self, target, id1, id2, function):
3374 """Bind this set of event types to target."""
3375 for et in self.evtType:
3376 target.Connect(id1, id2, et, function)
3377
d6c14a4c
RD
3378
3379 def Unbind(self, target, id1, id2):
3380 """Remove an event binding."""
3381 success = 0
3382 for et in self.evtType:
3383 success += target.Disconnect(id1, id2, et)
3384 return success != 0
3385
d55e5bfc
RD
3386
3387 def __call__(self, *args):
3388 """
3389 For backwards compatibility with the old EVT_* functions.
3390 Should be called with either (window, func), (window, ID,
3391 func) or (window, ID1, ID2, func) parameters depending on the
3392 type of the event.
3393 """
3394 assert len(args) == 2 + self.expectedIDs
3395 id1 = wx.ID_ANY
3396 id2 = wx.ID_ANY
3397 target = args[0]
3398 if self.expectedIDs == 0:
3399 func = args[1]
3400 elif self.expectedIDs == 1:
3401 id1 = args[1]
3402 func = args[2]
3403 elif self.expectedIDs == 2:
3404 id1 = args[1]
3405 id2 = args[2]
3406 func = args[3]
3407 else:
3408 raise ValueError, "Unexpected number of IDs"
3409
3410 self.Bind(target, id1, id2, func)
3411
3412
3413# These two are square pegs that don't fit the PyEventBinder hole...
3414def EVT_COMMAND(win, id, cmd, func):
3415 win.Connect(id, -1, cmd, func)
3416def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3417 win.Connect(id1, id2, cmd, func)
3418
3419
3420#---------------------------------------------------------------------------
3421
3422#---------------------------------------------------------------------------
3423
5b5c9bc7
RD
3424EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3425EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3426
1bd55598 3427def NewEventType(*args):
2131d850 3428 """NewEventType() -> EventType"""
1bd55598 3429 return _core_.NewEventType(*args)
5b5c9bc7
RD
3430wxEVT_NULL = _core_.wxEVT_NULL
3431wxEVT_FIRST = _core_.wxEVT_FIRST
3432wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3433wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3434wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3435wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3436wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3437wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3438wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3439wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3440wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3441wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3442wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3443wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3444wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3445wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3446wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3447wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3448wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3449wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3450wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3451wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3452wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3453wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3454wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3455wxEVT_MOTION = _core_.wxEVT_MOTION
3456wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3457wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3458wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3459wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3460wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3461wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3462wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3463wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3464wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3465wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3466wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3467wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3468wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3469wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3470wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3471wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3472wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3473wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3474wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3475wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3476wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3477wxEVT_CHAR = _core_.wxEVT_CHAR
3478wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3479wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3480wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3481wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3482wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3483wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3484wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3485wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3486wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3487wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3488wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3489wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3490wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3491wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3492wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3493wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
5b5c9bc7
RD
3494wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3495wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3496wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3497wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3498wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3499wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3500wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3501wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3502wxEVT_SIZE = _core_.wxEVT_SIZE
3503wxEVT_MOVE = _core_.wxEVT_MOVE
3504wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3505wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3506wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3507wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
5b5c9bc7
RD
3508wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3509wxEVT_CREATE = _core_.wxEVT_CREATE
3510wxEVT_DESTROY = _core_.wxEVT_DESTROY
3511wxEVT_SHOW = _core_.wxEVT_SHOW
3512wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3513wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3514wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
34e0a3bb 3515wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
5b5c9bc7
RD
3516wxEVT_PAINT = _core_.wxEVT_PAINT
3517wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3518wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3519wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3520wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3521wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3522wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3523wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3524wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3525wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3526wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3527wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3528wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3529wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3530wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3531wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3532wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3533wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3534wxEVT_IDLE = _core_.wxEVT_IDLE
3535wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3536wxEVT_SIZING = _core_.wxEVT_SIZING
3537wxEVT_MOVING = _core_.wxEVT_MOVING
3538wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
3539wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3540wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3541wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
5b5c9bc7
RD
3542wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3543wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3544wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3545wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3546wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3547wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3548wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d55e5bfc
RD
3549#
3550# Create some event binders
3551EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3552EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3553EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3554EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3555EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3556EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3557EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3558EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3559EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3560EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3561EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3562EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3563EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 3564EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d55e5bfc
RD
3565EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3566EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3567EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3568EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3569EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3570EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3571EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3572EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3573EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3574EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 3575EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3576EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3577EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3578EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3579EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3580EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3581EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3582EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3583EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3584EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3585EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3586EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3587EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3588EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3589EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3590EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3591EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
34e0a3bb 3592EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
d55e5bfc
RD
3593
3594EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3595EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3596EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3597EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3598EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3599EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3600EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3601EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3602EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3603EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3604EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3605EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3606EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3607
3608EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3609 wxEVT_LEFT_UP,
3610 wxEVT_MIDDLE_DOWN,
3611 wxEVT_MIDDLE_UP,
3612 wxEVT_RIGHT_DOWN,
3613 wxEVT_RIGHT_UP,
3614 wxEVT_MOTION,
3615 wxEVT_LEFT_DCLICK,
3616 wxEVT_MIDDLE_DCLICK,
3617 wxEVT_RIGHT_DCLICK,
3618 wxEVT_ENTER_WINDOW,
3619 wxEVT_LEAVE_WINDOW,
3620 wxEVT_MOUSEWHEEL
3621 ])
3622
3623
3624# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 3625EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d55e5bfc
RD
3626 wxEVT_SCROLLWIN_BOTTOM,
3627 wxEVT_SCROLLWIN_LINEUP,
3628 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 3629 wxEVT_SCROLLWIN_PAGEUP,
d55e5bfc
RD
3630 wxEVT_SCROLLWIN_PAGEDOWN,
3631 wxEVT_SCROLLWIN_THUMBTRACK,
3632 wxEVT_SCROLLWIN_THUMBRELEASE,
3633 ])
3634
3635EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3636EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3637EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3638EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3639EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3640EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3641EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3642EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3643
27fb7603 3644# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
3645EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3646 wxEVT_SCROLL_BOTTOM,
3647 wxEVT_SCROLL_LINEUP,
3648 wxEVT_SCROLL_LINEDOWN,
3649 wxEVT_SCROLL_PAGEUP,
3650 wxEVT_SCROLL_PAGEDOWN,
3651 wxEVT_SCROLL_THUMBTRACK,
3652 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3653 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3654 ])
3655
3656EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3657EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3658EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3659EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3660EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3661EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3662EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3663EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3664EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3665EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 3666
27fb7603 3667# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
3668EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3669 wxEVT_SCROLL_BOTTOM,
3670 wxEVT_SCROLL_LINEUP,
3671 wxEVT_SCROLL_LINEDOWN,
3672 wxEVT_SCROLL_PAGEUP,
3673 wxEVT_SCROLL_PAGEDOWN,
3674 wxEVT_SCROLL_THUMBTRACK,
d55e5bfc 3675 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3676 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3677 ], 1)
3678
3679EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3680EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3681EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3682EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3683EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3684EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3685EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3686EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3687EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3688EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
3689
3690EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3691EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3692EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3693EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3694EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3695EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3696EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3697EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3698EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3699EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3700
3701EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3702EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3703EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3704EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3705EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3706EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3707EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3708EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3709EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3710
3711
3712EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3713EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3714EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3715EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3716EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3717EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3718EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3719
3720EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3721
3722EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3723EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3724
3725EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3726
2131d850
RD
3727EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3728EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3729EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d55e5bfc
RD
3730
3731
3732#---------------------------------------------------------------------------
3733
5b5c9bc7 3734class Event(Object):
27fb7603
RD
3735 """
3736 An event is a structure holding information about an event passed to a
3737 callback or member function. wx.Event is an abstract base class for
3738 other event classes
3739 """
1bd55598
RD
3740 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3741 def __init__(self): raise AttributeError, "No constructor defined"
3742 __repr__ = _swig_repr
3743 __swig_destroy__ = _core_.delete_Event
3744 __del__ = lambda self : None;
d55e5bfc 3745 def SetEventType(*args, **kwargs):
27fb7603 3746 """
2131d850 3747 SetEventType(self, EventType typ)
27fb7603
RD
3748
3749 Sets the specific type of the event.
3750 """
5b5c9bc7 3751 return _core_.Event_SetEventType(*args, **kwargs)
d55e5bfc
RD
3752
3753 def GetEventType(*args, **kwargs):
27fb7603 3754 """
2131d850 3755 GetEventType(self) -> EventType
27fb7603
RD
3756
3757 Returns the identifier of the given event type, such as
3758 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3759 """
5b5c9bc7 3760 return _core_.Event_GetEventType(*args, **kwargs)
d55e5bfc
RD
3761
3762 def GetEventObject(*args, **kwargs):
27fb7603
RD
3763 """
3764 GetEventObject(self) -> Object
3765
3766 Returns the object (usually a window) associated with the event, if
3767 any.
3768 """
5b5c9bc7 3769 return _core_.Event_GetEventObject(*args, **kwargs)
d55e5bfc
RD
3770
3771 def SetEventObject(*args, **kwargs):
27fb7603
RD
3772 """
3773 SetEventObject(self, Object obj)
3774
3775 Sets the originating object, or in other words, obj is normally the
3776 object that is sending the event.
3777 """
5b5c9bc7 3778 return _core_.Event_SetEventObject(*args, **kwargs)
d55e5bfc
RD
3779
3780 def GetTimestamp(*args, **kwargs):
3781 """GetTimestamp(self) -> long"""
5b5c9bc7 3782 return _core_.Event_GetTimestamp(*args, **kwargs)
d55e5bfc
RD
3783
3784 def SetTimestamp(*args, **kwargs):
3785 """SetTimestamp(self, long ts=0)"""
5b5c9bc7 3786 return _core_.Event_SetTimestamp(*args, **kwargs)
d55e5bfc
RD
3787
3788 def GetId(*args, **kwargs):
27fb7603
RD
3789 """
3790 GetId(self) -> int
3791
3792 Returns the identifier associated with this event, such as a button
3793 command id.
3794 """
5b5c9bc7 3795 return _core_.Event_GetId(*args, **kwargs)
d55e5bfc
RD
3796
3797 def SetId(*args, **kwargs):
27fb7603
RD
3798 """
3799 SetId(self, int Id)
3800
3801 Set's the ID for the event. This is usually the ID of the window that
3802 is sending the event, but it can also be a command id from a menu
3803 item, etc.
3804 """
5b5c9bc7 3805 return _core_.Event_SetId(*args, **kwargs)
d55e5bfc
RD
3806
3807 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
3808 """
3809 IsCommandEvent(self) -> bool
3810
3811 Returns true if the event is or is derived from `wx.CommandEvent` else
3812 it returns false. Note: Exists only for optimization purposes.
3813 """
5b5c9bc7 3814 return _core_.Event_IsCommandEvent(*args, **kwargs)
d55e5bfc
RD
3815
3816 def Skip(*args, **kwargs):
51b83b37
RD
3817 """
3818 Skip(self, bool skip=True)
3819
3820 Called by an event handler, it controls whether additional event
3821 handlers bound to this event will be called after the current event
3822 handler returns. Skip(false) (the default setting) will prevent
3823 additional event handlers from being called and control will be
3824 returned to the sender of the event immediately after the current
3825 handler has finished. Skip(True) will cause the event processing
3826 system to continue searching for a handler function for this event.
3827
3828 """
5b5c9bc7 3829 return _core_.Event_Skip(*args, **kwargs)
d55e5bfc
RD
3830
3831 def GetSkipped(*args, **kwargs):
27fb7603
RD
3832 """
3833 GetSkipped(self) -> bool
3834
3835 Returns true if the event handler should be skipped, false otherwise.
3836 :see: `Skip`
3837 """
5b5c9bc7 3838 return _core_.Event_GetSkipped(*args, **kwargs)
d55e5bfc
RD
3839
3840 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
3841 """
3842 ShouldPropagate(self) -> bool
3843
3844 Test if this event should be propagated to the parent window or not,
3845 i.e. if the propagation level is currently greater than 0.
3846 """
5b5c9bc7 3847 return _core_.Event_ShouldPropagate(*args, **kwargs)
d55e5bfc
RD
3848
3849 def StopPropagation(*args, **kwargs):
27fb7603
RD
3850 """
3851 StopPropagation(self) -> int
3852
3853 Stop the event from propagating to its parent window. Returns the old
3854 propagation level value which may be later passed to
3855 `ResumePropagation` to allow propagating the event again.
3856 """
5b5c9bc7 3857 return _core_.Event_StopPropagation(*args, **kwargs)
d55e5bfc
RD
3858
3859 def ResumePropagation(*args, **kwargs):
27fb7603
RD
3860 """
3861 ResumePropagation(self, int propagationLevel)
3862
3863 Resume the event propagation by restoring the propagation level. (For
3864 example, you can use the value returned by an earlier call to
3865 `StopPropagation`.)
3866
3867 """
5b5c9bc7 3868 return _core_.Event_ResumePropagation(*args, **kwargs)
d55e5bfc
RD
3869
3870 def Clone(*args, **kwargs):
5b5c9bc7
RD
3871 """Clone(self) -> Event"""
3872 return _core_.Event_Clone(*args, **kwargs)
d55e5bfc 3873
2131d850 3874_core_.Event_swigregister(Event)
d55e5bfc
RD
3875
3876#---------------------------------------------------------------------------
3877
5b5c9bc7 3878class PropagationDisabler(object):
27fb7603
RD
3879 """
3880 Helper class to temporarily change an event not to propagate. Simply
3881 create an instance of this class and then whe it is destroyed the
3882 propogation of the event will be restored.
3883 """
1bd55598
RD
3884 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3885 __repr__ = _swig_repr
3886 def __init__(self, *args, **kwargs):
27fb7603
RD
3887 """
3888 __init__(self, Event event) -> PropagationDisabler
3889
3890 Helper class to temporarily change an event not to propagate. Simply
3891 create an instance of this class and then whe it is destroyed the
3892 propogation of the event will be restored.
3893 """
1bd55598
RD
3894 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3895 __swig_destroy__ = _core_.delete_PropagationDisabler
3896 __del__ = lambda self : None;
2131d850 3897_core_.PropagationDisabler_swigregister(PropagationDisabler)
d55e5bfc 3898
5b5c9bc7 3899class PropagateOnce(object):
27fb7603
RD
3900 """
3901 A helper class that will temporarily lower propagation level of an
3902 event. Simply create an instance of this class and then whe it is
3903 destroyed the propogation of the event will be restored.
3904 """
1bd55598
RD
3905 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3906 __repr__ = _swig_repr
3907 def __init__(self, *args, **kwargs):
27fb7603
RD
3908 """
3909 __init__(self, Event event) -> PropagateOnce
3910
3911 A helper class that will temporarily lower propagation level of an
3912 event. Simply create an instance of this class and then whe it is
3913 destroyed the propogation of the event will be restored.
3914 """
1bd55598
RD
3915 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3916 __swig_destroy__ = _core_.delete_PropagateOnce
3917 __del__ = lambda self : None;
2131d850 3918_core_.PropagateOnce_swigregister(PropagateOnce)
d55e5bfc
RD
3919
3920#---------------------------------------------------------------------------
3921
5b5c9bc7 3922class CommandEvent(Event):
27fb7603
RD
3923 """
3924 This event class contains information about command events, which
3925 originate from a variety of simple controls, as well as menus and
3926 toolbars.
3927 """
1bd55598
RD
3928 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3929 __repr__ = _swig_repr
3930 def __init__(self, *args, **kwargs):
27fb7603 3931 """
2131d850 3932 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
3933
3934 This event class contains information about command events, which
3935 originate from a variety of simple controls, as well as menus and
3936 toolbars.
3937 """
1bd55598 3938 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
d55e5bfc 3939 def GetSelection(*args, **kwargs):
27fb7603
RD
3940 """
3941 GetSelection(self) -> int
3942
3943 Returns item index for a listbox or choice selection event (not valid
3944 for a deselection).
3945 """
5b5c9bc7 3946 return _core_.CommandEvent_GetSelection(*args, **kwargs)
d55e5bfc
RD
3947
3948 def SetString(*args, **kwargs):
5b5c9bc7
RD
3949 """SetString(self, String s)"""
3950 return _core_.CommandEvent_SetString(*args, **kwargs)
d55e5bfc
RD
3951
3952 def GetString(*args, **kwargs):
27fb7603
RD
3953 """
3954 GetString(self) -> String
3955
3956 Returns item string for a listbox or choice selection event (not valid
3957 for a deselection).
3958 """
5b5c9bc7 3959 return _core_.CommandEvent_GetString(*args, **kwargs)
d55e5bfc
RD
3960
3961 def IsChecked(*args, **kwargs):
27fb7603
RD
3962 """
3963 IsChecked(self) -> bool
3964
3965 This method can be used with checkbox and menu events: for the
3966 checkboxes, the method returns true for a selection event and false
3967 for a deselection one. For the menu events, this method indicates if
3968 the menu item just has become checked or unchecked (and thus only
3969 makes sense for checkable menu items).
3970 """
5b5c9bc7 3971 return _core_.CommandEvent_IsChecked(*args, **kwargs)
d55e5bfc
RD
3972
3973 Checked = IsChecked
3974 def IsSelection(*args, **kwargs):
27fb7603
RD
3975 """
3976 IsSelection(self) -> bool
3977
3978 For a listbox or similar event, returns true if it is a selection,
3979 false if it is a deselection.
3980 """
5b5c9bc7 3981 return _core_.CommandEvent_IsSelection(*args, **kwargs)
d55e5bfc
RD
3982
3983 def SetExtraLong(*args, **kwargs):
3984 """SetExtraLong(self, long extraLong)"""
5b5c9bc7 3985 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
d55e5bfc
RD
3986
3987 def GetExtraLong(*args, **kwargs):
27fb7603
RD
3988 """
3989 GetExtraLong(self) -> long
3990
5ba5649b
RD
3991 Returns extra information dependant on the event objects type. If the
3992 event comes from a listbox selection, it is a boolean determining
3993 whether the event was a selection (true) or a deselection (false). A
3994 listbox deselection only occurs for multiple-selection boxes, and in
3995 this case the index and string values are indeterminate and the
3996 listbox must be examined by the application.
27fb7603 3997 """
5b5c9bc7 3998 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
d55e5bfc
RD
3999
4000 def SetInt(*args, **kwargs):
4001 """SetInt(self, int i)"""
5b5c9bc7 4002 return _core_.CommandEvent_SetInt(*args, **kwargs)
d55e5bfc
RD
4003
4004 def GetInt(*args, **kwargs):
27fb7603 4005 """
2131d850 4006 GetInt(self) -> int
27fb7603 4007
5ba5649b
RD
4008 Returns the integer identifier corresponding to a listbox, choice or
4009 radiobox selection (only if the event was a selection, not a
4010 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4011 """
5b5c9bc7 4012 return _core_.CommandEvent_GetInt(*args, **kwargs)
d55e5bfc 4013
1bd55598
RD
4014 def GetClientData(*args, **kwargs):
4015 """
4016 GetClientData(self) -> PyObject
4017
4018 Returns the client data object for a listbox or choice selection event, (if any.)
4019 """
4020 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4021
4022 def SetClientData(*args, **kwargs):
4023 """
4024 SetClientData(self, PyObject clientData)
4025
4026 Associate the given client data with the item at position n.
4027 """
4028 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4029
4030 GetClientObject = GetClientData
4031 SetClientObject = SetClientData
4032
d55e5bfc 4033 def Clone(*args, **kwargs):
5b5c9bc7
RD
4034 """Clone(self) -> Event"""
4035 return _core_.CommandEvent_Clone(*args, **kwargs)
d55e5bfc 4036
2131d850 4037_core_.CommandEvent_swigregister(CommandEvent)
d55e5bfc
RD
4038
4039#---------------------------------------------------------------------------
4040
5b5c9bc7 4041class NotifyEvent(CommandEvent):
27fb7603
RD
4042 """
4043 An instance of this class (or one of its derived classes) is sent from
4044 a control when the control's state is being changed and the control
4045 allows that change to be prevented from happening. The event handler
4046 can call `Veto` or `Allow` to tell the control what to do.
4047 """
1bd55598
RD
4048 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4049 __repr__ = _swig_repr
4050 def __init__(self, *args, **kwargs):
27fb7603 4051 """
2131d850 4052 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4053
4054 An instance of this class (or one of its derived classes) is sent from
4055 a control when the control's state is being changed and the control
4056 allows that change to be prevented from happening. The event handler
4057 can call `Veto` or `Allow` to tell the control what to do.
4058 """
1bd55598 4059 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
d55e5bfc 4060 def Veto(*args, **kwargs):
27fb7603
RD
4061 """
4062 Veto(self)
4063
4064 Prevents the change announced by this event from happening.
4065
4066 It is in general a good idea to notify the user about the reasons for
4067 vetoing the change because otherwise the applications behaviour (which
4068 just refuses to do what the user wants) might be quite surprising.
4069 """
5b5c9bc7 4070 return _core_.NotifyEvent_Veto(*args, **kwargs)
d55e5bfc
RD
4071
4072 def Allow(*args, **kwargs):
27fb7603
RD
4073 """
4074 Allow(self)
4075
4076 This is the opposite of `Veto`: it explicitly allows the event to be
4077 processed. For most events it is not necessary to call this method as
4078 the events are allowed anyhow but some are forbidden by default (this
4079 will be mentioned in the corresponding event description).
4080 """
5b5c9bc7 4081 return _core_.NotifyEvent_Allow(*args, **kwargs)
d55e5bfc
RD
4082
4083 def IsAllowed(*args, **kwargs):
27fb7603
RD
4084 """
4085 IsAllowed(self) -> bool
4086
4087 Returns true if the change is allowed (`Veto` hasn't been called) or
4088 false otherwise (if it was).
4089 """
5b5c9bc7 4090 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
d55e5bfc 4091
2131d850 4092_core_.NotifyEvent_swigregister(NotifyEvent)
d55e5bfc
RD
4093
4094#---------------------------------------------------------------------------
4095
5b5c9bc7 4096class ScrollEvent(CommandEvent):
27fb7603
RD
4097 """
4098 A scroll event holds information about events sent from stand-alone
4099 scrollbars and sliders. Note that scrolled windows do not send
4100 instnaces of this event class, but send the `wx.ScrollWinEvent`
4101 instead.
4102 """
1bd55598
RD
4103 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4104 __repr__ = _swig_repr
4105 def __init__(self, *args, **kwargs):
d55e5bfc 4106 """
2131d850 4107 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
5b5c9bc7 4108 int orient=0) -> ScrollEvent
d55e5bfc 4109 """
1bd55598 4110 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
d55e5bfc 4111 def GetOrientation(*args, **kwargs):
27fb7603
RD
4112 """
4113 GetOrientation(self) -> int
4114
4115 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4116 the scrollbar.
4117 """
5b5c9bc7 4118 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4119
4120 def GetPosition(*args, **kwargs):
27fb7603
RD
4121 """
4122 GetPosition(self) -> int
4123
4124 Returns the position of the scrollbar.
4125 """
5b5c9bc7 4126 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4127
4128 def SetOrientation(*args, **kwargs):
4129 """SetOrientation(self, int orient)"""
5b5c9bc7 4130 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4131
4132 def SetPosition(*args, **kwargs):
4133 """SetPosition(self, int pos)"""
5b5c9bc7 4134 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
d55e5bfc 4135
2131d850 4136_core_.ScrollEvent_swigregister(ScrollEvent)
d55e5bfc
RD
4137
4138#---------------------------------------------------------------------------
4139
5b5c9bc7 4140class ScrollWinEvent(Event):
27fb7603
RD
4141 """
4142 A wx.ScrollWinEvent holds information about scrolling and is sent from
4143 scrolling windows.
4144 """
1bd55598
RD
4145 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4146 __repr__ = _swig_repr
4147 def __init__(self, *args, **kwargs):
27fb7603 4148 """
2131d850 4149 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4150
4151 A wx.ScrollWinEvent holds information about scrolling and is sent from
4152 scrolling windows.
4153 """
1bd55598 4154 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
d55e5bfc 4155 def GetOrientation(*args, **kwargs):
27fb7603
RD
4156 """
4157 GetOrientation(self) -> int
4158
4159 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4160 the scrollbar.
4161 """
5b5c9bc7 4162 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4163
4164 def GetPosition(*args, **kwargs):
27fb7603
RD
4165 """
4166 GetPosition(self) -> int
4167
4168 Returns the position of the scrollbar for the thumb track and release
4169 events. Note that this field can't be used for the other events, you
4170 need to query the window itself for the current position in that case.
4171 """
5b5c9bc7 4172 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4173
4174 def SetOrientation(*args, **kwargs):
4175 """SetOrientation(self, int orient)"""
5b5c9bc7 4176 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4177
4178 def SetPosition(*args, **kwargs):
4179 """SetPosition(self, int pos)"""
5b5c9bc7 4180 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
d55e5bfc 4181
2131d850 4182_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d55e5bfc
RD
4183
4184#---------------------------------------------------------------------------
4185
5b5c9bc7
RD
4186MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4187MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4188MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4189MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4190MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4191class MouseEvent(Event):
27fb7603
RD
4192 """
4193 This event class contains information about the events generated by
4194 the mouse: they include mouse buttons press and release events and
4195 mouse move events.
4196
4197 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4198 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4199 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4200 a middle button so a portable application should avoid relying on the
4201 events from it.
4202
4203 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4204 the former returns true when the event corresponds to the left mouse
4205 button click while the latter returns true if the left mouse button is
4206 currently being pressed. For example, when the user is dragging the
4207 mouse you can use `LeftIsDown` to test whether the left mouse button
4208 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4209 `LeftIsDown` will also return true in wxWidgets whatever the
4210 underlying GUI behaviour is (which is platform-dependent). The same
4211 applies, of course, to other mouse buttons as well.
4212 """
1bd55598
RD
4213 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4214 __repr__ = _swig_repr
4215 def __init__(self, *args, **kwargs):
27fb7603 4216 """
2131d850 4217 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4218
4219 Constructs a wx.MouseEvent. Valid event types are:
4220
4221 * wxEVT_ENTER_WINDOW
4222 * wxEVT_LEAVE_WINDOW
4223 * wxEVT_LEFT_DOWN
4224 * wxEVT_LEFT_UP
4225 * wxEVT_LEFT_DCLICK
4226 * wxEVT_MIDDLE_DOWN
4227 * wxEVT_MIDDLE_UP
4228 * wxEVT_MIDDLE_DCLICK
4229 * wxEVT_RIGHT_DOWN
4230 * wxEVT_RIGHT_UP
4231 * wxEVT_RIGHT_DCLICK
4232 * wxEVT_MOTION
4233 * wxEVT_MOUSEWHEEL
4234 """
1bd55598 4235 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
d55e5bfc 4236 def IsButton(*args, **kwargs):
27fb7603
RD
4237 """
4238 IsButton(self) -> bool
4239
4240 Returns true if the event was a mouse button event (not necessarily a
4241 button down event - that may be tested using `ButtonDown`).
4242 """
5b5c9bc7 4243 return _core_.MouseEvent_IsButton(*args, **kwargs)
d55e5bfc
RD
4244
4245 def ButtonDown(*args, **kwargs):
27fb7603
RD
4246 """
4247 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4248
5ba5649b
RD
4249 If the argument is omitted, this returns true if the event was any
4250 mouse button down event. Otherwise the argument specifies which
4251 button-down event shold be checked for (see `Button` for the possible
4252 values).
27fb7603 4253 """
5b5c9bc7 4254 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
d55e5bfc
RD
4255
4256 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4257 """
4258 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4259
4260 If the argument is omitted, this returns true if the event was any
4261 mouse double click event. Otherwise the argument specifies which
4262 double click event to check for (see `Button` for the possible
4263 values).
4264 """
5b5c9bc7 4265 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
d55e5bfc
RD
4266
4267 def ButtonUp(*args, **kwargs):
27fb7603
RD
4268 """
4269 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4270
4271 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4272 mouse button up event. Otherwise the argument specifies which button
4273 up event to check for (see `Button` for the possible values).
27fb7603 4274 """
5b5c9bc7 4275 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
d55e5bfc
RD
4276
4277 def Button(*args, **kwargs):
27fb7603
RD
4278 """
4279 Button(self, int button) -> bool
4280
4281 Returns true if the identified mouse button is changing state. Valid
4282 values of button are:
4283
4284 ==================== =====================================
4285 wx.MOUSE_BTN_LEFT check if left button was pressed
4286 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4287 wx.MOUSE_BTN_RIGHT check if right button was pressed
4288 wx.MOUSE_BTN_ANY check if any button was pressed
4289 ==================== =====================================
4290
4291 """
5b5c9bc7 4292 return _core_.MouseEvent_Button(*args, **kwargs)
d55e5bfc
RD
4293
4294 def ButtonIsDown(*args, **kwargs):
4295 """ButtonIsDown(self, int but) -> bool"""
5b5c9bc7 4296 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
d55e5bfc
RD
4297
4298 def GetButton(*args, **kwargs):
27fb7603
RD
4299 """
4300 GetButton(self) -> int
4301
4302 Returns the mouse button which generated this event or
4303 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4304 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4305 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4306 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4307 right buttons respectively.
4308 """
5b5c9bc7 4309 return _core_.MouseEvent_GetButton(*args, **kwargs)
d55e5bfc
RD
4310
4311 def ControlDown(*args, **kwargs):
27fb7603
RD
4312 """
4313 ControlDown(self) -> bool
4314
4315 Returns true if the control key was down at the time of the event.
4316 """
5b5c9bc7 4317 return _core_.MouseEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4318
4319 def MetaDown(*args, **kwargs):
27fb7603
RD
4320 """
4321 MetaDown(self) -> bool
4322
4323 Returns true if the Meta key was down at the time of the event.
4324 """
5b5c9bc7 4325 return _core_.MouseEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4326
4327 def AltDown(*args, **kwargs):
27fb7603
RD
4328 """
4329 AltDown(self) -> bool
4330
4331 Returns true if the Alt key was down at the time of the event.
4332 """
5b5c9bc7 4333 return _core_.MouseEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4334
4335 def ShiftDown(*args, **kwargs):
27fb7603
RD
4336 """
4337 ShiftDown(self) -> bool
4338
4339 Returns true if the Shift key was down at the time of the event.
4340 """
5b5c9bc7 4341 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4342
412d302d
RD
4343 def CmdDown(*args, **kwargs):
4344 """
4345 CmdDown(self) -> bool
4346
4347 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4348 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4349 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4350 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4351 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4352 purpose. So for non-Mac platforms this is the same as `ControlDown`
4353 and Macs this is the same as `MetaDown`.
4354 """
5b5c9bc7 4355 return _core_.MouseEvent_CmdDown(*args, **kwargs)
412d302d 4356
d55e5bfc 4357 def LeftDown(*args, **kwargs):
27fb7603
RD
4358 """
4359 LeftDown(self) -> bool
4360
4361 Returns true if the left mouse button state changed to down.
4362 """
5b5c9bc7 4363 return _core_.MouseEvent_LeftDown(*args, **kwargs)
d55e5bfc
RD
4364
4365 def MiddleDown(*args, **kwargs):
27fb7603
RD
4366 """
4367 MiddleDown(self) -> bool
4368
4369 Returns true if the middle mouse button state changed to down.
4370 """
5b5c9bc7 4371 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
d55e5bfc
RD
4372
4373 def RightDown(*args, **kwargs):
27fb7603
RD
4374 """
4375 RightDown(self) -> bool
4376
4377 Returns true if the right mouse button state changed to down.
4378 """
5b5c9bc7 4379 return _core_.MouseEvent_RightDown(*args, **kwargs)
d55e5bfc
RD
4380
4381 def LeftUp(*args, **kwargs):
27fb7603
RD
4382 """
4383 LeftUp(self) -> bool
4384
4385 Returns true if the left mouse button state changed to up.
4386 """
5b5c9bc7 4387 return _core_.MouseEvent_LeftUp(*args, **kwargs)
d55e5bfc
RD
4388
4389 def MiddleUp(*args, **kwargs):
27fb7603
RD
4390 """
4391 MiddleUp(self) -> bool
4392
4393 Returns true if the middle mouse button state changed to up.
4394 """
5b5c9bc7 4395 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
d55e5bfc
RD
4396
4397 def RightUp(*args, **kwargs):
27fb7603
RD
4398 """
4399 RightUp(self) -> bool
4400
4401 Returns true if the right mouse button state changed to up.
4402 """
5b5c9bc7 4403 return _core_.MouseEvent_RightUp(*args, **kwargs)
d55e5bfc
RD
4404
4405 def LeftDClick(*args, **kwargs):
27fb7603
RD
4406 """
4407 LeftDClick(self) -> bool
4408
4409 Returns true if the event was a left button double click.
4410 """
5b5c9bc7 4411 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
d55e5bfc
RD
4412
4413 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4414 """
4415 MiddleDClick(self) -> bool
4416
4417 Returns true if the event was a middle button double click.
4418 """
5b5c9bc7 4419 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
d55e5bfc
RD
4420
4421 def RightDClick(*args, **kwargs):
27fb7603
RD
4422 """
4423 RightDClick(self) -> bool
4424
4425 Returns true if the event was a right button double click.
4426 """
5b5c9bc7 4427 return _core_.MouseEvent_RightDClick(*args, **kwargs)
d55e5bfc
RD
4428
4429 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4430 """
4431 LeftIsDown(self) -> bool
4432
4433 Returns true if the left mouse button is currently down, independent
4434 of the current event type.
4435
4436 Please notice that it is not the same as LeftDown which returns true
4437 if the left mouse button was just pressed. Rather, it describes the
4438 state of the mouse button before the event happened.
4439
4440 This event is usually used in the mouse event handlers which process
4441 "move mouse" messages to determine whether the user is (still)
4442 dragging the mouse.
4443 """
5b5c9bc7 4444 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
d55e5bfc
RD
4445
4446 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4447 """
4448 MiddleIsDown(self) -> bool
4449
4450 Returns true if the middle mouse button is currently down, independent
4451 of the current event type.
4452 """
5b5c9bc7 4453 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
d55e5bfc
RD
4454
4455 def RightIsDown(*args, **kwargs):
27fb7603
RD
4456 """
4457 RightIsDown(self) -> bool
4458
4459 Returns true if the right mouse button is currently down, independent
4460 of the current event type.
4461 """
5b5c9bc7 4462 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
d55e5bfc
RD
4463
4464 def Dragging(*args, **kwargs):
27fb7603
RD
4465 """
4466 Dragging(self) -> bool
4467
4468 Returns true if this was a dragging event (motion while a button is
4469 depressed).
4470 """
5b5c9bc7 4471 return _core_.MouseEvent_Dragging(*args, **kwargs)
d55e5bfc
RD
4472
4473 def Moving(*args, **kwargs):
27fb7603
RD
4474 """
4475 Moving(self) -> bool
4476
4477 Returns true if this was a motion event and no mouse buttons were
4478 pressed. If any mouse button is held pressed, then this method returns
4479 false and Dragging returns true.
4480 """
5b5c9bc7 4481 return _core_.MouseEvent_Moving(*args, **kwargs)
d55e5bfc
RD
4482
4483 def Entering(*args, **kwargs):
27fb7603
RD
4484 """
4485 Entering(self) -> bool
4486
4487 Returns true if the mouse was entering the window.
4488 """
5b5c9bc7 4489 return _core_.MouseEvent_Entering(*args, **kwargs)
d55e5bfc
RD
4490
4491 def Leaving(*args, **kwargs):
27fb7603
RD
4492 """
4493 Leaving(self) -> bool
4494
4495 Returns true if the mouse was leaving the window.
4496 """
5b5c9bc7 4497 return _core_.MouseEvent_Leaving(*args, **kwargs)
d55e5bfc
RD
4498
4499 def GetPosition(*args, **kwargs):
4500 """
5b5c9bc7 4501 GetPosition(self) -> Point
d55e5bfc 4502
27fb7603
RD
4503 Returns the pixel position of the mouse in window coordinates when the
4504 event happened.
d55e5bfc 4505 """
5b5c9bc7 4506 return _core_.MouseEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4507
4508 def GetPositionTuple(*args, **kwargs):
4509 """
4510 GetPositionTuple() -> (x,y)
4511
27fb7603
RD
4512 Returns the pixel position of the mouse in window coordinates when the
4513 event happened.
d55e5bfc 4514 """
5b5c9bc7 4515 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4516
4517 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4518 """
4519 GetLogicalPosition(self, DC dc) -> Point
4520
4521 Returns the logical mouse position in pixels (i.e. translated
4522 according to the translation set for the DC, which usually indicates
4523 that the window has been scrolled).
4524 """
5b5c9bc7 4525 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
d55e5bfc
RD
4526
4527 def GetX(*args, **kwargs):
27fb7603
RD
4528 """
4529 GetX(self) -> int
4530
4531 Returns X coordinate of the physical mouse event position.
4532 """
5b5c9bc7 4533 return _core_.MouseEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4534
4535 def GetY(*args, **kwargs):
27fb7603
RD
4536 """
4537 GetY(self) -> int
4538
4539 Returns Y coordinate of the physical mouse event position.
4540 """
5b5c9bc7 4541 return _core_.MouseEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4542
4543 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4544 """
4545 GetWheelRotation(self) -> int
4546
4547 Get wheel rotation, positive or negative indicates direction of
4548 rotation. Current devices all send an event when rotation is equal to
4549 +/-WheelDelta, but this allows for finer resolution devices to be
4550 created in the future. Because of this you shouldn't assume that one
4551 event is equal to 1 line or whatever, but you should be able to either
4552 do partial line scrolling or wait until +/-WheelDelta rotation values
4553 have been accumulated before scrolling.
4554 """
5b5c9bc7 4555 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
d55e5bfc
RD
4556
4557 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4558 """
4559 GetWheelDelta(self) -> int
4560
4561 Get wheel delta, normally 120. This is the threshold for action to be
4562 taken, and one such action (for example, scrolling one increment)
4563 should occur for each delta.
4564 """
5b5c9bc7 4565 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
d55e5bfc
RD
4566
4567 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4568 """
4569 GetLinesPerAction(self) -> int
4570
4571 Returns the configured number of lines (or whatever) to be scrolled
4572 per wheel action. Defaults to three.
4573 """
5b5c9bc7 4574 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
d55e5bfc
RD
4575
4576 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4577 """
4578 IsPageScroll(self) -> bool
4579
4580 Returns true if the system has been setup to do page scrolling with
4581 the mouse wheel instead of line scrolling.
4582 """
5b5c9bc7
RD
4583 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4584
4585 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4586 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4587 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4588 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4589 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4590 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4591 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4592 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4593 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4594 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4595 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4596 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
2131d850 4597_core_.MouseEvent_swigregister(MouseEvent)
d55e5bfc
RD
4598
4599#---------------------------------------------------------------------------
4600
5b5c9bc7 4601class SetCursorEvent(Event):
5ba5649b
RD
4602 """
4603 A SetCursorEvent is generated when the mouse cursor is about to be set
4604 as a result of mouse motion. This event gives the application the
4605 chance to perform specific mouse cursor processing based on the
4606 current position of the mouse within the window. Use the `SetCursor`
4607 method to specify the cursor you want to be displayed.
4608 """
1bd55598
RD
4609 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4610 __repr__ = _swig_repr
4611 def __init__(self, *args, **kwargs):
5ba5649b
RD
4612 """
4613 __init__(self, int x=0, int y=0) -> SetCursorEvent
4614
4615 Construct a new `wx.SetCursorEvent`.
4616 """
1bd55598 4617 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
d55e5bfc 4618 def GetX(*args, **kwargs):
5ba5649b
RD
4619 """
4620 GetX(self) -> int
4621
4622 Returns the X coordinate of the mouse in client coordinates.
4623 """
5b5c9bc7 4624 return _core_.SetCursorEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4625
4626 def GetY(*args, **kwargs):
5ba5649b
RD
4627 """
4628 GetY(self) -> int
4629
4630 Returns the Y coordinate of the mouse in client coordinates.
4631 """
5b5c9bc7 4632 return _core_.SetCursorEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4633
4634 def SetCursor(*args, **kwargs):
5ba5649b
RD
4635 """
4636 SetCursor(self, Cursor cursor)
4637
4638 Sets the cursor associated with this event.
4639 """
5b5c9bc7 4640 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
d55e5bfc
RD
4641
4642 def GetCursor(*args, **kwargs):
5ba5649b
RD
4643 """
4644 GetCursor(self) -> Cursor
4645
4646 Returns a reference to the cursor specified by this event.
4647 """
5b5c9bc7 4648 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
d55e5bfc
RD
4649
4650 def HasCursor(*args, **kwargs):
5ba5649b
RD
4651 """
4652 HasCursor(self) -> bool
4653
4654 Returns true if the cursor specified by this event is a valid cursor.
4655 """
5b5c9bc7 4656 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
d55e5bfc 4657
2131d850 4658_core_.SetCursorEvent_swigregister(SetCursorEvent)
d55e5bfc
RD
4659
4660#---------------------------------------------------------------------------
4661
5b5c9bc7 4662class KeyEvent(Event):
5ba5649b
RD
4663 """
4664 This event class contains information about keypress and character
4665 events. These events are only sent to the widget that currently has
4666 the keyboard focus.
4667
4668 Notice that there are three different kinds of keyboard events in
4669 wxWidgets: key down and up events and char events. The difference
4670 between the first two is clear - the first corresponds to a key press
4671 and the second to a key release - otherwise they are identical. Just
4672 note that if the key is maintained in a pressed state you will
4673 typically get a lot of (automatically generated) down events but only
4674 one up so it is wrong to assume that there is one up event
4675 corresponding to each down one.
4676
4677 Both key events provide untranslated key codes while the char event
4678 carries the translated one. The untranslated code for alphanumeric
4679 keys is always an upper case value. For the other keys it is one of
4680 WXK_XXX values from the keycodes table. The translated key is, in
4681 general, the character the user expects to appear as the result of the
4682 key combination when typing the text into a text entry zone, for
4683 example.
4684
4685 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4686 and the standard US keyboard): when the 'A' key is pressed, the key
4687 down event key code is equal to ASCII A == 65. But the char event key
4688 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4689 'A' keys simultaneously , the key code in key down event will still be
4690 just 'A' while the char event key code parameter will now be 'A' as
4691 well.
4692
4693 Although in this simple case it is clear that the correct key code
4694 could be found in the key down event handler by checking the value
4695 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4696 as for non alphanumeric keys or non-US keyboard layouts the
4697 translation is keyboard-layout dependent and can only be done properly
4698 by the system itself.
4699
4700 Another kind of translation is done when the control key is pressed:
4701 for example, for CTRL-A key press the key down event still carries the
4702 same key code 'A' as usual but the char event will have key code of 1,
4703 the ASCII value of this key combination.
4704
4705 You may discover how the other keys on your system behave
4706 interactively by running the KeyEvents sample in the wxPython demo and
4707 pressing some keys while the blue box at the top has the keyboard
4708 focus.
4709
4710 **Note**: If a key down event is caught and the event handler does not
4711 call event.Skip() then the coresponding char event will not
4712 happen. This is by design and enables the programs that handle both
4713 types of events to be a bit simpler.
4714
4715 **Note for Windows programmers**: The key and char events in wxWidgets
4716 are similar to but slightly different from Windows WM_KEYDOWN and
4717 WM_CHAR events. In particular, Alt-x combination will generate a char
4718 event in wxWidgets (unless it is used as an accelerator).
4719
4720 **Tip**: be sure to call event.Skip() for events that you don't
4721 process in key event function, otherwise menu shortcuts may cease to
4722 work under Windows.
4723
4724 """
1bd55598
RD
4725 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4726 __repr__ = _swig_repr
4727 def __init__(self, *args, **kwargs):
5ba5649b 4728 """
2131d850 4729 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
4730
4731 Construct a new `wx.KeyEvent`. Valid event types are:
4732 *
4733 """
1bd55598 4734 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
4735 def GetModifiers(*args, **kwargs):
4736 """
4737 GetModifiers(self) -> int
4738
4739 Returns a bitmask of the current modifier settings. Can be used to
4740 check if the key event has exactly the given modifiers without having
4741 to explicitly check that the other modifiers are not down. For
4742 example::
4743
4744 if event.GetModifers() == wx.MOD_CONTROL:
4745 DoSomething()
4746
4747 """
4748 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4749
d55e5bfc 4750 def ControlDown(*args, **kwargs):
5ba5649b
RD
4751 """
4752 ControlDown(self) -> bool
4753
4754 Returns ``True`` if the Control key was down at the time of the event.
4755 """
5b5c9bc7 4756 return _core_.KeyEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4757
4758 def MetaDown(*args, **kwargs):
5ba5649b
RD
4759 """
4760 MetaDown(self) -> bool
4761
4762 Returns ``True`` if the Meta key was down at the time of the event.
4763 """
5b5c9bc7 4764 return _core_.KeyEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4765
4766 def AltDown(*args, **kwargs):
5ba5649b
RD
4767 """
4768 AltDown(self) -> bool
4769
4770 Returns ``True`` if the Alt key was down at the time of the event.
4771 """
5b5c9bc7 4772 return _core_.KeyEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4773
4774 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4775 """
4776 ShiftDown(self) -> bool
4777
4778 Returns ``True`` if the Shift key was down at the time of the event.
4779 """
5b5c9bc7 4780 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4781
412d302d
RD
4782 def CmdDown(*args, **kwargs):
4783 """
4784 CmdDown(self) -> bool
4785
4786 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4787 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4788 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
4789 because Cmd key is used for the same thing under Mac as Ctrl
4790 elsewhere. The Ctrl still exists, it's just not used for this
4791 purpose. So for non-Mac platforms this is the same as `ControlDown`
4792 and Macs this is the same as `MetaDown`.
4793 """
5b5c9bc7 4794 return _core_.KeyEvent_CmdDown(*args, **kwargs)
412d302d 4795
d55e5bfc 4796 def HasModifiers(*args, **kwargs):
5ba5649b
RD
4797 """
4798 HasModifiers(self) -> bool
4799
4800 Returns true if either CTRL or ALT keys was down at the time of the
4801 key event. Note that this function does not take into account neither
4802 SHIFT nor META key states (the reason for ignoring the latter is that
4803 it is common for NUMLOCK key to be configured as META under X but the
4804 key presses even while NUMLOCK is on should be still processed
4805 normally).
4806 """
5b5c9bc7 4807 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
d55e5bfc
RD
4808
4809 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
4810 """
4811 GetKeyCode(self) -> int
4812
4813 Returns the virtual key code. ASCII events return normal ASCII values,
4814 while non-ASCII events return values such as WXK_LEFT for the left
4815 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4816 codes.
4817
4818 Note that in Unicode build, the returned value is meaningful only if
4819 the user entered a character that can be represented in current
4820 locale's default charset. You can obtain the corresponding Unicode
4821 character using `GetUnicodeKey`.
4822 """
5b5c9bc7 4823 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
4824
4825 KeyCode = GetKeyCode
bb4524c4 4826 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
4827 """
4828 GetUnicodeKey(self) -> int
4829
4830 Returns the Unicode character corresponding to this key event. This
4831 function is only meaningfule in a Unicode build of wxPython.
4832 """
5b5c9bc7 4833 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 4834
bb4524c4 4835 GetUniChar = GetUnicodeKey
b850e7f3
RD
4836 def SetUnicodeKey(*args, **kwargs):
4837 """
4838 SetUnicodeKey(self, int uniChar)
4839
4840 Set the Unicode value of the key event, but only if this is a Unicode
4841 build of wxPython.
4842 """
4843 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
4844
d55e5bfc 4845 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
4846 """
4847 GetRawKeyCode(self) -> unsigned int
4848
4849 Returns the raw key code for this event. This is a platform-dependent
4850 scan code which should only be used in advanced
4851 applications. Currently the raw key codes are not supported by all
4852 ports.
4853 """
5b5c9bc7 4854 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
d55e5bfc
RD
4855
4856 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
4857 """
4858 GetRawKeyFlags(self) -> unsigned int
4859
4860 Returns the low level key flags for this event. The flags are
4861 platform-dependent and should only be used in advanced applications.
4862 Currently the raw key flags are not supported by all ports.
4863 """
5b5c9bc7 4864 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
d55e5bfc
RD
4865
4866 def GetPosition(*args, **kwargs):
4867 """
5b5c9bc7 4868 GetPosition(self) -> Point
d55e5bfc 4869
5ba5649b 4870 Find the position of the event, if applicable.
d55e5bfc 4871 """
5b5c9bc7 4872 return _core_.KeyEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4873
4874 def GetPositionTuple(*args, **kwargs):
4875 """
4876 GetPositionTuple() -> (x,y)
4877
5ba5649b 4878 Find the position of the event, if applicable.
d55e5bfc 4879 """
5b5c9bc7 4880 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4881
4882 def GetX(*args, **kwargs):
5ba5649b
RD
4883 """
4884 GetX(self) -> int
4885
4886 Returns the X position (in client coordinates) of the event, if
4887 applicable.
4888 """
5b5c9bc7 4889 return _core_.KeyEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4890
4891 def GetY(*args, **kwargs):
5ba5649b
RD
4892 """
4893 GetY(self) -> int
4894
4895 Returns the Y position (in client coordinates) of the event, if
4896 applicable.
4897 """
5b5c9bc7
RD
4898 return _core_.KeyEvent_GetY(*args, **kwargs)
4899
4900 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4901 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4902 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4903 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4904 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4905 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4906 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4907 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4908 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4909 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
2131d850 4910_core_.KeyEvent_swigregister(KeyEvent)
d55e5bfc
RD
4911
4912#---------------------------------------------------------------------------
4913
5b5c9bc7 4914class SizeEvent(Event):
5ba5649b
RD
4915 """
4916 A size event holds information about size change events. The EVT_SIZE
4917 handler function will be called when the window it is bound to has
4918 been resized.
4919
4920 Note that the size passed is of the whole window: call
4921 `wx.Window.GetClientSize` for the area which may be used by the
4922 application.
4923
4924 When a window is resized, usually only a small part of the window is
4925 damaged and and that area is all that is in the update region for the
4926 next paint event. However, if your drawing depends on the size of the
4927 window, you may need to clear the DC explicitly and repaint the whole
4928 window. In which case, you may need to call `wx.Window.Refresh` to
4929 invalidate the entire window.
4930
4931 """
1bd55598
RD
4932 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4933 __repr__ = _swig_repr
4934 def __init__(self, *args, **kwargs):
5ba5649b
RD
4935 """
4936 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4937
4938 Construct a new ``wx.SizeEvent``.
4939 """
1bd55598 4940 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
d55e5bfc 4941 def GetSize(*args, **kwargs):
5ba5649b
RD
4942 """
4943 GetSize(self) -> Size
4944
4945 Returns the entire size of the window generating the size change
4946 event.
4947 """
5b5c9bc7 4948 return _core_.SizeEvent_GetSize(*args, **kwargs)
d55e5bfc
RD
4949
4950 def GetRect(*args, **kwargs):
5b5c9bc7
RD
4951 """GetRect(self) -> Rect"""
4952 return _core_.SizeEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
4953
4954 def SetRect(*args, **kwargs):
5b5c9bc7
RD
4955 """SetRect(self, Rect rect)"""
4956 return _core_.SizeEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
4957
4958 def SetSize(*args, **kwargs):
5b5c9bc7
RD
4959 """SetSize(self, Size size)"""
4960 return _core_.SizeEvent_SetSize(*args, **kwargs)
d55e5bfc 4961
5b5c9bc7
RD
4962 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4963 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
2131d850 4964_core_.SizeEvent_swigregister(SizeEvent)
d55e5bfc
RD
4965
4966#---------------------------------------------------------------------------
4967
5b5c9bc7 4968class MoveEvent(Event):
5ba5649b
RD
4969 """
4970 This event object is sent for EVT_MOVE event bindings when a window is
4971 moved to a new position.
4972 """
1bd55598
RD
4973 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4974 __repr__ = _swig_repr
4975 def __init__(self, *args, **kwargs):
5ba5649b
RD
4976 """
4977 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
4978
4979 Constructor.
4980 """
1bd55598 4981 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
d55e5bfc 4982 def GetPosition(*args, **kwargs):
5ba5649b
RD
4983 """
4984 GetPosition(self) -> Point
4985
4986 Returns the position of the window generating the move change event.
4987 """
5b5c9bc7 4988 return _core_.MoveEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4989
4990 def GetRect(*args, **kwargs):
5b5c9bc7
RD
4991 """GetRect(self) -> Rect"""
4992 return _core_.MoveEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
4993
4994 def SetRect(*args, **kwargs):
5b5c9bc7
RD
4995 """SetRect(self, Rect rect)"""
4996 return _core_.MoveEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
4997
4998 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
4999 """SetPosition(self, Point pos)"""
5000 return _core_.MoveEvent_SetPosition(*args, **kwargs)
d55e5bfc 5001
fef4c27a
RD
5002 m_pos = property(GetPosition, SetPosition)
5003 m_rect = property(GetRect, SetRect)
5004
2131d850 5005_core_.MoveEvent_swigregister(MoveEvent)
d55e5bfc
RD
5006
5007#---------------------------------------------------------------------------
5008
5b5c9bc7 5009class PaintEvent(Event):
5ba5649b
RD
5010 """
5011 A paint event is sent when a window's contents needs to be repainted.
5012 Note that in an EVT_PAINT handler the application must *always* create
5013 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5014 Windows assumes that the window has not been painted yet and will send
5015 the event again, causing endless refreshes.
5016
5017 You can optimize painting by retrieving the rectangles that have been
5018 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5019 and only repainting these rectangles. The rectangles are in terms of
5020 the client area, and are unscrolled, so you will need to do some
5021 calculations using the current view position to obtain logical,
5022 scrolled units.
5023
5024 """
1bd55598
RD
5025 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5026 __repr__ = _swig_repr
5027 def __init__(self, *args, **kwargs):
5b5c9bc7 5028 """__init__(self, int Id=0) -> PaintEvent"""
1bd55598 5029 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5030_core_.PaintEvent_swigregister(PaintEvent)
d55e5bfc 5031
5b5c9bc7
RD
5032class NcPaintEvent(Event):
5033 """Proxy of C++ NcPaintEvent class"""
1bd55598
RD
5034 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5035 __repr__ = _swig_repr
5036 def __init__(self, *args, **kwargs):
5b5c9bc7 5037 """__init__(self, int winid=0) -> NcPaintEvent"""
1bd55598 5038 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5039_core_.NcPaintEvent_swigregister(NcPaintEvent)
d55e5bfc
RD
5040
5041#---------------------------------------------------------------------------
5042
5b5c9bc7 5043class EraseEvent(Event):
5ba5649b
RD
5044 """
5045 An erase event is sent whenever the background of a window needs to be
5046 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5047 binder. On some platforms, such as GTK+, this event is simulated
5048 (simply generated just before the paint event) and may cause flicker.
5049
5050 To paint a custom background use the `GetDC` method and use the returned
5051 device context if it is not ``None``, otherwise create a temporary
5052 `wx.ClientDC` and draw on that.
5053
5054 """
1bd55598
RD
5055 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5056 __repr__ = _swig_repr
5057 def __init__(self, *args, **kwargs):
5ba5649b
RD
5058 """
5059 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5060
5061 Constructor
5062 """
1bd55598 5063 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
d55e5bfc 5064 def GetDC(*args, **kwargs):
5ba5649b
RD
5065 """
5066 GetDC(self) -> DC
5067
5068 Returns the device context the event handler should draw upon. If
5069 ``None`` is returned then create a temporary `wx.ClientDC` and use
5070 that instead.
5071 """
5b5c9bc7 5072 return _core_.EraseEvent_GetDC(*args, **kwargs)
d55e5bfc 5073
2131d850 5074_core_.EraseEvent_swigregister(EraseEvent)
d55e5bfc
RD
5075
5076#---------------------------------------------------------------------------
5077
5b5c9bc7 5078class FocusEvent(Event):
5ba5649b
RD
5079 """
5080 A focus event is sent when a window's focus changes. The window losing
5081 focus receives an EVT_KILL_FOCUS event while the window gaining it
5082 gets an EVT_SET_FOCUS event.
5083
5084 Notice that the set focus event happens both when the user gives focus
5085 to the window (whether using the mouse or keyboard) and when it is
5086 done from the program itself using `wx.Window.SetFocus`.
5087
5088 """
1bd55598
RD
5089 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5090 __repr__ = _swig_repr
5091 def __init__(self, *args, **kwargs):
5ba5649b 5092 """
2131d850 5093 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5094
5095 Constructor
5096 """
1bd55598 5097 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
d55e5bfc 5098 def GetWindow(*args, **kwargs):
5ba5649b
RD
5099 """
5100 GetWindow(self) -> Window
5101
5102 Returns the other window associated with this event, that is the
5103 window which had the focus before for the EVT_SET_FOCUS event and the
5104 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5105
5106 Warning: the window returned may be None!
5107 """
5b5c9bc7 5108 return _core_.FocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
5109
5110 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
5111 """SetWindow(self, Window win)"""
5112 return _core_.FocusEvent_SetWindow(*args, **kwargs)
d55e5bfc 5113
2131d850 5114_core_.FocusEvent_swigregister(FocusEvent)
d55e5bfc
RD
5115
5116#---------------------------------------------------------------------------
5117
5b5c9bc7 5118class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5119 """
5120 wx.ChildFocusEvent notifies the parent that a child has received the
5121 focus. Unlike `wx.FocusEvent` it is propagated up the window
5122 heirarchy.
5123 """
1bd55598
RD
5124 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5125 __repr__ = _swig_repr
5126 def __init__(self, *args, **kwargs):
5ba5649b
RD
5127 """
5128 __init__(self, Window win=None) -> ChildFocusEvent
5129
5130 Constructor
5131 """
1bd55598 5132 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
d55e5bfc 5133 def GetWindow(*args, **kwargs):
5ba5649b
RD
5134 """
5135 GetWindow(self) -> Window
5136
5137 The window which has just received the focus.
5138 """
5b5c9bc7 5139 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
d55e5bfc 5140
2131d850 5141_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d55e5bfc
RD
5142
5143#---------------------------------------------------------------------------
5144
5b5c9bc7 5145class ActivateEvent(Event):
5ba5649b
RD
5146 """
5147 An activate event is sent when a top-level window or the entire
5148 application is being activated or deactivated.
5149
5150 A top-level window (a dialog or frame) receives an activate event when
5151 is being activated or deactivated. This is indicated visually by the
5152 title bar changing colour, and a subwindow gaining the keyboard focus.
5153 An application is activated or deactivated when one of its frames
5154 becomes activated, or a frame becomes inactivate resulting in all
5155 application frames being inactive.
5156
5157 Please note that usually you should call event.Skip() in your handlers
5158 for these events so the default handlers will still be called, as not
5159 doing so can result in strange effects.
5160
5161 """
1bd55598
RD
5162 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5163 __repr__ = _swig_repr
5164 def __init__(self, *args, **kwargs):
5ba5649b 5165 """
2131d850 5166 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5167
5168 Constructor
5169 """
1bd55598 5170 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
d55e5bfc 5171 def GetActive(*args, **kwargs):
5ba5649b
RD
5172 """
5173 GetActive(self) -> bool
5174
5175 Returns true if the application or window is being activated, false
5176 otherwise.
5177 """
5b5c9bc7 5178 return _core_.ActivateEvent_GetActive(*args, **kwargs)
d55e5bfc 5179
2131d850 5180_core_.ActivateEvent_swigregister(ActivateEvent)
d55e5bfc
RD
5181
5182#---------------------------------------------------------------------------
5183
5b5c9bc7 5184class InitDialogEvent(Event):
5ba5649b
RD
5185 """
5186 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5187 any window when `wx.Window.InitDialog` is called. Handlers for this
5188 event can transfer data to the window, or anything else that should be
5189 done before the user begins editing the form. The default handler
5190 calls `wx.Window.TransferDataToWindow`.
5191 """
1bd55598
RD
5192 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5193 __repr__ = _swig_repr
5194 def __init__(self, *args, **kwargs):
5ba5649b
RD
5195 """
5196 __init__(self, int Id=0) -> InitDialogEvent
5197
5198 Constructor
5199 """
1bd55598 5200 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5201_core_.InitDialogEvent_swigregister(InitDialogEvent)
d55e5bfc
RD
5202
5203#---------------------------------------------------------------------------
5204
5b5c9bc7 5205class MenuEvent(Event):
5ba5649b
RD
5206 """
5207 This class is used for a variety of menu-related events. Note that
5208 these do not include menu command events, which are handled by sending
5209 `wx.CommandEvent` objects.
5210
5211 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5212 text in the first field of the status bar.
5213 """
1bd55598
RD
5214 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5215 __repr__ = _swig_repr
5216 def __init__(self, *args, **kwargs):
5ba5649b 5217 """
2131d850 5218 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5219
5220 Constructor
5221 """
1bd55598 5222 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
d55e5bfc 5223 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5224 """
5225 GetMenuId(self) -> int
5226
5227 Returns the menu identifier associated with the event. This method
5228 should be only used with the HIGHLIGHT events.
5229 """
5b5c9bc7 5230 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
d55e5bfc
RD
5231
5232 def IsPopup(*args, **kwargs):
5ba5649b
RD
5233 """
5234 IsPopup(self) -> bool
5235
5236 Returns ``True`` if the menu which is being opened or closed is a
5237 popup menu, ``False`` if it is a normal one. This method should only
5238 be used with the OPEN and CLOSE events.
5239 """
5b5c9bc7 5240 return _core_.MenuEvent_IsPopup(*args, **kwargs)
d55e5bfc
RD
5241
5242 def GetMenu(*args, **kwargs):
5ba5649b
RD
5243 """
5244 GetMenu(self) -> Menu
5245
5246 Returns the menu which is being opened or closed. This method should
5247 only be used with the OPEN and CLOSE events.
5248 """
5b5c9bc7 5249 return _core_.MenuEvent_GetMenu(*args, **kwargs)
d55e5bfc 5250
2131d850 5251_core_.MenuEvent_swigregister(MenuEvent)
d55e5bfc
RD
5252
5253#---------------------------------------------------------------------------
5254
5b5c9bc7 5255class CloseEvent(Event):
5ba5649b
RD
5256 """
5257 This event class contains information about window and session close
5258 events.
5259
5260 The handler function for EVT_CLOSE is called when the user has tried
5261 to close a a frame or dialog box using the window manager controls or
5262 the system menu. It can also be invoked by the application itself
5263 programmatically, for example by calling the `wx.Window.Close`
5264 function.
5265
5266 You should check whether the application is forcing the deletion of
5267 the window using `CanVeto`. If it returns ``False``, you must destroy
5268 the window using `wx.Window.Destroy`. If the return value is ``True``,
5269 it is up to you whether you respond by destroying the window or not.
5270 For example you may wish to display a message dialog prompting to save
5271 files or to cancel the close.
5272
5273 If you don't destroy the window, you should call `Veto` to let the
5274 calling code know that you did not destroy the window. This allows the
5275 `wx.Window.Close` function to return ``True`` or ``False`` depending
5276 on whether the close instruction was honored or not.
5277 """
1bd55598
RD
5278 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5279 __repr__ = _swig_repr
5280 def __init__(self, *args, **kwargs):
5ba5649b 5281 """
2131d850 5282 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5283
5284 Constructor.
5285 """
1bd55598 5286 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
d55e5bfc 5287 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5288 """
5289 SetLoggingOff(self, bool logOff)
5290
5291 Sets the 'logging off' flag.
5292 """
5b5c9bc7 5293 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5294
5295 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5296 """
5297 GetLoggingOff(self) -> bool
5298
034e3677
RD
5299 Returns ``True`` if the user is logging off or ``False`` if the
5300 system is shutting down. This method can only be called for end
5301 session and query end session events, it doesn't make sense for close
5302 window event.
5ba5649b 5303 """
5b5c9bc7 5304 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5305
5306 def Veto(*args, **kwargs):
5ba5649b
RD
5307 """
5308 Veto(self, bool veto=True)
5309
5310 Call this from your event handler to veto a system shutdown or to
5311 signal to the calling application that a window close did not happen.
5312
5313 You can only veto a shutdown or close if `CanVeto` returns true.
5314 """
5b5c9bc7 5315 return _core_.CloseEvent_Veto(*args, **kwargs)
d55e5bfc 5316
5ba5649b
RD
5317 def GetVeto(*args, **kwargs):
5318 """GetVeto(self) -> bool"""
5319 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5320
d55e5bfc 5321 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5322 """
5323 SetCanVeto(self, bool canVeto)
5324
5325 Sets the 'can veto' flag.
5326 """
5b5c9bc7 5327 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
d55e5bfc
RD
5328
5329 def CanVeto(*args, **kwargs):
5ba5649b
RD
5330 """
5331 CanVeto(self) -> bool
d55e5bfc 5332
5ba5649b
RD
5333 Returns true if you can veto a system shutdown or a window close
5334 event. Vetoing a window close event is not possible if the calling
5335 code wishes to force the application to exit, and so this function
5336 must be called to check this.
5337 """
5338 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc 5339
2131d850 5340_core_.CloseEvent_swigregister(CloseEvent)
d55e5bfc
RD
5341
5342#---------------------------------------------------------------------------
5343
5b5c9bc7 5344class ShowEvent(Event):
5ba5649b 5345 """An EVT_SHOW event is sent when a window is shown or hidden."""
1bd55598
RD
5346 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5347 __repr__ = _swig_repr
5348 def __init__(self, *args, **kwargs):
5ba5649b
RD
5349 """
5350 __init__(self, int winid=0, bool show=False) -> ShowEvent
5351
5352 An EVT_SHOW event is sent when a window is shown or hidden.
5353 """
1bd55598 5354 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
d55e5bfc
RD
5355 def SetShow(*args, **kwargs):
5356 """SetShow(self, bool show)"""
5b5c9bc7 5357 return _core_.ShowEvent_SetShow(*args, **kwargs)
d55e5bfc
RD
5358
5359 def GetShow(*args, **kwargs):
5360 """GetShow(self) -> bool"""
5b5c9bc7 5361 return _core_.ShowEvent_GetShow(*args, **kwargs)
d55e5bfc 5362
2131d850 5363_core_.ShowEvent_swigregister(ShowEvent)
d55e5bfc
RD
5364
5365#---------------------------------------------------------------------------
5366
5b5c9bc7 5367class IconizeEvent(Event):
5ba5649b
RD
5368 """
5369 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5370 restored.
5371 """
1bd55598
RD
5372 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5373 __repr__ = _swig_repr
5374 def __init__(self, *args, **kwargs):
5ba5649b
RD
5375 """
5376 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5377
5378 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5379 restored.
5380 """
1bd55598 5381 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
d55e5bfc 5382 def Iconized(*args, **kwargs):
5ba5649b
RD
5383 """
5384 Iconized(self) -> bool
5385
5386 Returns ``True`` if the frame has been iconized, ``False`` if it has
5387 been restored.
5388 """
5b5c9bc7 5389 return _core_.IconizeEvent_Iconized(*args, **kwargs)
d55e5bfc 5390
2131d850 5391_core_.IconizeEvent_swigregister(IconizeEvent)
d55e5bfc
RD
5392
5393#---------------------------------------------------------------------------
5394
5b5c9bc7 5395class MaximizeEvent(Event):
5ba5649b 5396 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
1bd55598
RD
5397 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5398 __repr__ = _swig_repr
5399 def __init__(self, *args, **kwargs):
5ba5649b
RD
5400 """
5401 __init__(self, int id=0) -> MaximizeEvent
5402
5403 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5404 """
1bd55598 5405 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5406_core_.MaximizeEvent_swigregister(MaximizeEvent)
d55e5bfc
RD
5407
5408#---------------------------------------------------------------------------
5409
5b5c9bc7 5410class DropFilesEvent(Event):
5ba5649b
RD
5411 """
5412 This class is used for drop files events, that is, when files have
5413 been dropped onto the window. This functionality is only available
5414 under Windows. The window must have previously been enabled for
5415 dropping by calling `wx.Window.DragAcceptFiles`.
5416
5417 Important note: this is a separate implementation to the more general
5418 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5419 implementation uses the older, Windows message-based approach of
5420 dropping files.
5421
5422 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5423 events.
5424
5425 """
1bd55598
RD
5426 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5427 def __init__(self): raise AttributeError, "No constructor defined"
5428 __repr__ = _swig_repr
d55e5bfc 5429 def GetPosition(*args, **kwargs):
5ba5649b
RD
5430 """
5431 GetPosition(self) -> Point
5432
5433 Returns the position at which the files were dropped.
5434 """
5b5c9bc7 5435 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5436
5437 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5438 """
5439 GetNumberOfFiles(self) -> int
5440
5441 Returns the number of files dropped.
5442 """
5b5c9bc7 5443 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
d55e5bfc
RD
5444
5445 def GetFiles(*args, **kwargs):
5ba5649b
RD
5446 """
5447 GetFiles(self) -> PyObject
5448
5449 Returns a list of the filenames that were dropped.
5450 """
5b5c9bc7 5451 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
d55e5bfc 5452
2131d850 5453_core_.DropFilesEvent_swigregister(DropFilesEvent)
d55e5bfc
RD
5454
5455#---------------------------------------------------------------------------
5456
5b5c9bc7
RD
5457UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5458UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5459class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5460 """
5461 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5462 wxWidgets to give an application the chance to update various user
5463 interface elements.
5464
5465 Without update UI events, an application has to work hard to
5466 check/uncheck, enable/disable, and set the text for elements such as
5467 menu items and toolbar buttons. The code for doing this has to be
5468 mixed up with the code that is invoked when an action is invoked for a
5469 menu item or button.
5470
5471 With update UI events, you define an event handler to look at the
5472 state of the application and change UI elements accordingly. wxWidgets
5473 will call your handler functions in idle time, so you don't have to
5474 worry where to call this code. In addition to being a clearer and more
5475 declarative method, it also means you don't have to worry whether
5476 you're updating a toolbar or menubar identifier. The same handler can
5477 update a menu item and toolbar button, if the ID values are the same.
5478
5479 Instead of directly manipulating the menu or button, you call
5480 functions in the event object, such as `Check`. wxWidgets will
5481 determine whether such a call has been made, and which UI element to
5482 update.
5483
5484 These events will work for popup menus as well as menubars. Just
5485 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5486 any UI events for the window that owns the menu.
5487
5488 If you find that the overhead of UI update processing is affecting
5489 your application, you can do one or both of the following:
5490
5491 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5492 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5493 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5494 receive update events. No other windows will receive update
5495 events.
5496
5497 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5498 value to set the delay between updates. You may need to call
5499 `wx.Window.UpdateWindowUI` at critical points, for example when
5500 a dialog is about to be shown, in case the user sees a slight
5501 delay before windows are updated.
5502
5503 Note that although events are sent in idle time, defining a EVT_IDLE
5504 handler for a window does not affect this because the events are sent
5505 from an internal idle handler.
5506
5507 wxWidgets tries to optimize update events on some platforms. On
5508 Windows and GTK+, events for menubar items are only sent when the menu
5509 is about to be shown, and not in idle time.
5510
5511 """
1bd55598
RD
5512 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5513 __repr__ = _swig_repr
5514 def __init__(self, *args, **kwargs):
5ba5649b
RD
5515 """
5516 __init__(self, int commandId=0) -> UpdateUIEvent
5517
5518 Constructor
5519 """
1bd55598 5520 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
d55e5bfc 5521 def GetChecked(*args, **kwargs):
5ba5649b
RD
5522 """
5523 GetChecked(self) -> bool
5524
5525 Returns ``True`` if the UI element should be checked.
5526 """
5b5c9bc7 5527 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
d55e5bfc
RD
5528
5529 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5530 """
5531 GetEnabled(self) -> bool
5532
5533 Returns ``True`` if the UI element should be enabled.
5534 """
5b5c9bc7 5535 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
d55e5bfc 5536
b1fcee84
RD
5537 def GetShown(*args, **kwargs):
5538 """
5539 GetShown(self) -> bool
5540
5541 Returns ``True`` if the UI element should be shown.
5542 """
5543 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5544
d55e5bfc 5545 def GetText(*args, **kwargs):
5ba5649b
RD
5546 """
5547 GetText(self) -> String
5548
5549 Returns the text that should be set for the UI element.
5550 """
5b5c9bc7 5551 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
d55e5bfc
RD
5552
5553 def GetSetText(*args, **kwargs):
5ba5649b
RD
5554 """
5555 GetSetText(self) -> bool
5556
5557 Returns ``True`` if the application has called `SetText`. For
5558 wxWidgets internal use only.
5559 """
5b5c9bc7 5560 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
d55e5bfc
RD
5561
5562 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5563 """
5564 GetSetChecked(self) -> bool
5565
5566 Returns ``True`` if the application has called `Check`. For wxWidgets
5567 internal use only.
5568 """
5b5c9bc7 5569 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
d55e5bfc
RD
5570
5571 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5572 """
5573 GetSetEnabled(self) -> bool
5574
5575 Returns ``True`` if the application has called `Enable`. For wxWidgets
5576 internal use only.
5577 """
5b5c9bc7 5578 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
d55e5bfc 5579
b1fcee84
RD
5580 def GetSetShown(*args, **kwargs):
5581 """
5582 GetSetShown(self) -> bool
5583
5584 Returns ``True`` if the application has called `Show`. For wxWidgets
5585 internal use only.
5586 """
5587 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5588
d55e5bfc 5589 def Check(*args, **kwargs):
5ba5649b
RD
5590 """
5591 Check(self, bool check)
5592
5593 Check or uncheck the UI element.
5594 """
5b5c9bc7 5595 return _core_.UpdateUIEvent_Check(*args, **kwargs)
d55e5bfc
RD
5596
5597 def Enable(*args, **kwargs):
5ba5649b
RD
5598 """
5599 Enable(self, bool enable)
5600
5601 Enable or disable the UI element.
5602 """
5b5c9bc7 5603 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
d55e5bfc 5604
b1fcee84
RD
5605 def Show(*args, **kwargs):
5606 """
5607 Show(self, bool show)
5608
5609 Show or hide the UI element.
5610 """
5611 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5612
d55e5bfc 5613 def SetText(*args, **kwargs):
5ba5649b
RD
5614 """
5615 SetText(self, String text)
5616
5617 Sets the text for this UI element.
5618 """
5b5c9bc7 5619 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
d55e5bfc
RD
5620
5621 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5622 """
5623 SetUpdateInterval(long updateInterval)
5624
5625 Sets the interval between updates in milliseconds. Set to -1 to
5626 disable updates, or to 0 to update as frequently as possible. The
5627 default is 0.
5628
5629 Use this to reduce the overhead of UI update events if your
5630 application has a lot of windows. If you set the value to -1 or
5631 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5632 at appropriate points in your application, such as when a dialog is
5633 about to be shown.
5634 """
5b5c9bc7 5635 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5636
5637 SetUpdateInterval = staticmethod(SetUpdateInterval)
5638 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5639 """
5640 GetUpdateInterval() -> long
5641
5642 Returns the current interval between updates in milliseconds. -1
5643 disables updates, 0 updates as frequently as possible.
5644 """
5b5c9bc7 5645 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5646
5647 GetUpdateInterval = staticmethod(GetUpdateInterval)
5648 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5649 """
5650 CanUpdate(Window win) -> bool
5651
5652 Returns ``True`` if it is appropriate to update (send UI update events
5653 to) this window.
5654
5655 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5656 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5657 events were last sent in idle time, and the update interval, to
5658 determine whether events should be sent to this window now. By default
5659 this will always return true because the update mode is initially
5660 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5661 events will be sent as often as possible. You can reduce the frequency
5662 that events are sent by changing the mode and/or setting an update
5663 interval.
5664
5665 """
5b5c9bc7 5666 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc
RD
5667
5668 CanUpdate = staticmethod(CanUpdate)
5669 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5670 """
5671 ResetUpdateTime()
5672
5673 Used internally to reset the last-updated time to the current time. It
5674 is assumed that update events are normally sent in idle time, so this
5675 is called at the end of idle processing.
5676 """
5b5c9bc7 5677 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc
RD
5678
5679 ResetUpdateTime = staticmethod(ResetUpdateTime)
5680 def SetMode(*args, **kwargs):
5ba5649b
RD
5681 """
5682 SetMode(int mode)
5683
5684 Specify how wxWidgets will send update events: to all windows, or only
5685 to those which specify that they will process the events.
5686
5687 The mode may be one of the following values:
5688
5689 ============================= ==========================================
5690 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5691 is the default setting.
5692 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5693 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5694 style set.
5695 ============================= ==========================================
5696
5697 """
5b5c9bc7 5698 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
5699
5700 SetMode = staticmethod(SetMode)
5701 def GetMode(*args, **kwargs):
5ba5649b
RD
5702 """
5703 GetMode() -> int
5704
5705 Returns a value specifying how wxWidgets will send update events: to
5706 all windows, or only to those which specify that they will process the
5707 events.
5708 """
5b5c9bc7 5709 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
5710
5711 GetMode = staticmethod(GetMode)
2131d850 5712_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d55e5bfc 5713
5b5c9bc7 5714def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
1bd55598 5715 """
5ba5649b
RD
5716 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5717
5718 Sets the interval between updates in milliseconds. Set to -1 to
5719 disable updates, or to 0 to update as frequently as possible. The
5720 default is 0.
5721
5722 Use this to reduce the overhead of UI update events if your
5723 application has a lot of windows. If you set the value to -1 or
5724 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5725 at appropriate points in your application, such as when a dialog is
5726 about to be shown.
5727 """
1bd55598 5728 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 5729
1bd55598
RD
5730def UpdateUIEvent_GetUpdateInterval(*args):
5731 """
5ba5649b
RD
5732 UpdateUIEvent_GetUpdateInterval() -> long
5733
5734 Returns the current interval between updates in milliseconds. -1
5735 disables updates, 0 updates as frequently as possible.
5736 """
1bd55598 5737 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d55e5bfc 5738
5b5c9bc7 5739def UpdateUIEvent_CanUpdate(*args, **kwargs):
1bd55598 5740 """
5ba5649b
RD
5741 UpdateUIEvent_CanUpdate(Window win) -> bool
5742
5743 Returns ``True`` if it is appropriate to update (send UI update events
5744 to) this window.
5745
5746 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5747 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5748 events were last sent in idle time, and the update interval, to
5749 determine whether events should be sent to this window now. By default
5750 this will always return true because the update mode is initially
5751 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5752 events will be sent as often as possible. You can reduce the frequency
5753 that events are sent by changing the mode and/or setting an update
5754 interval.
5755
5756 """
1bd55598 5757 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 5758
1bd55598
RD
5759def UpdateUIEvent_ResetUpdateTime(*args):
5760 """
5ba5649b
RD
5761 UpdateUIEvent_ResetUpdateTime()
5762
5763 Used internally to reset the last-updated time to the current time. It
5764 is assumed that update events are normally sent in idle time, so this
5765 is called at the end of idle processing.
5766 """
1bd55598 5767 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d55e5bfc 5768
5b5c9bc7 5769def UpdateUIEvent_SetMode(*args, **kwargs):
1bd55598 5770 """
5ba5649b
RD
5771 UpdateUIEvent_SetMode(int mode)
5772
5773 Specify how wxWidgets will send update events: to all windows, or only
5774 to those which specify that they will process the events.
5775
5776 The mode may be one of the following values:
5777
5778 ============================= ==========================================
5779 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5780 is the default setting.
5781 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5782 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5783 style set.
5784 ============================= ==========================================
5785
5786 """
1bd55598 5787 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 5788
1bd55598
RD
5789def UpdateUIEvent_GetMode(*args):
5790 """
5ba5649b
RD
5791 UpdateUIEvent_GetMode() -> int
5792
5793 Returns a value specifying how wxWidgets will send update events: to
5794 all windows, or only to those which specify that they will process the
5795 events.
5796 """
1bd55598 5797 return _core_.UpdateUIEvent_GetMode(*args)
d55e5bfc
RD
5798
5799#---------------------------------------------------------------------------
5800
5b5c9bc7 5801class SysColourChangedEvent(Event):
5ba5649b
RD
5802 """
5803 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5804 when the user changes the colour settings using the control
5805 panel. This is only applicable under Windows.
5806
5807 The default event handler for this event propagates the event to child
5808 windows, since Windows only sends the events to top-level windows. If
5809 intercepting this event for a top-level window, remember to call
5810 `Skip` so the the base class handler will still be executed, or to
5811 pass the event on to the window's children explicitly.
5812
5813 """
1bd55598
RD
5814 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5815 __repr__ = _swig_repr
5816 def __init__(self, *args, **kwargs):
5ba5649b
RD
5817 """
5818 __init__(self) -> SysColourChangedEvent
5819
5820 Constructor
5821 """
1bd55598 5822 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 5823_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d55e5bfc
RD
5824
5825#---------------------------------------------------------------------------
5826
5b5c9bc7 5827class MouseCaptureChangedEvent(Event):
5ba5649b
RD
5828 """
5829 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5830 a window that loses its mouse capture. This is called even if
5831 `wx.Window.ReleaseMouse` was called by the application code. Handling
5832 this event allows an application to cater for unexpected capture
5833 releases which might otherwise confuse mouse handling code.
5834
5835 This event is implemented under Windows only.
5836 """
1bd55598
RD
5837 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5838 __repr__ = _swig_repr
5839 def __init__(self, *args, **kwargs):
5ba5649b
RD
5840 """
5841 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5842
5843 Constructor
5844 """
1bd55598 5845 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
d55e5bfc 5846 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
5847 """
5848 GetCapturedWindow(self) -> Window
5849
5850 Returns the window that gained the capture, or ``None`` if it was a
5851 non-wxWidgets window.
5852 """
5b5c9bc7 5853 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
d55e5bfc 5854
2131d850 5855_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d55e5bfc
RD
5856
5857#---------------------------------------------------------------------------
5858
34e0a3bb
RD
5859class MouseCaptureLostEvent(Event):
5860 """
5861 A mouse capture lost event is sent to a window that obtained mouse
5862 capture, which was subsequently loss due to "external" event, for
5863 example when a dialog box is shown or if another application captures
5864 the mouse.
5865
5866 If this happens, this event is sent to all windows that are on the
5867 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
5868 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
5869 if the capture changes because of a call to CaptureMouse or
5870 ReleaseMouse.
5871
5872 This event is currently emitted under Windows only.
5873
5874 """
5875 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5876 __repr__ = _swig_repr
5877 def __init__(self, *args, **kwargs):
5878 """
5879 __init__(self, int winid=0) -> MouseCaptureLostEvent
5880
5881 A mouse capture lost event is sent to a window that obtained mouse
5882 capture, which was subsequently loss due to "external" event, for
5883 example when a dialog box is shown or if another application captures
5884 the mouse.
5885
5886 If this happens, this event is sent to all windows that are on the
5887 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
5888 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
5889 if the capture changes because of a call to CaptureMouse or
5890 ReleaseMouse.
5891
5892 This event is currently emitted under Windows only.
5893
5894 """
5895 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
5896_core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
5897
5898#---------------------------------------------------------------------------
5899
5b5c9bc7 5900class DisplayChangedEvent(Event):
5ba5649b
RD
5901 """
5902 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5903 resolution has changed.
5904
5905 This event is implemented under Windows only.
5906 """
1bd55598
RD
5907 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5908 __repr__ = _swig_repr
5909 def __init__(self, *args, **kwargs):
5b5c9bc7 5910 """__init__(self) -> DisplayChangedEvent"""
1bd55598 5911 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 5912_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d55e5bfc
RD
5913
5914#---------------------------------------------------------------------------
5915
5b5c9bc7 5916class PaletteChangedEvent(Event):
5ba5649b
RD
5917 """
5918 An EVT_PALETTE_CHANGED event is sent when the system palette has
5919 changed, thereby giving each window a chance to redo their own to
5920 match.
5921
5922 This event is implemented under Windows only.
5923 """
1bd55598
RD
5924 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5925 __repr__ = _swig_repr
5926 def __init__(self, *args, **kwargs):
5ba5649b
RD
5927 """
5928 __init__(self, int id=0) -> PaletteChangedEvent
5929
5930 An EVT_PALETTE_CHANGED event is sent when the system palette has
5931 changed, thereby giving each window a chance to redo their own to
5932 match.
5933
5934 This event is implemented under Windows only.
5935 """
1bd55598 5936 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
d55e5bfc 5937 def SetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
5938 """SetChangedWindow(self, Window win)"""
5939 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
d55e5bfc
RD
5940
5941 def GetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
5942 """GetChangedWindow(self) -> Window"""
5943 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
d55e5bfc 5944
2131d850 5945_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d55e5bfc
RD
5946
5947#---------------------------------------------------------------------------
5948
5b5c9bc7 5949class QueryNewPaletteEvent(Event):
5ba5649b
RD
5950 """
5951 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5952 focus and should re-do its palette.
5953
5954 This event is implemented under Windows only.
5955 """
1bd55598
RD
5956 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5957 __repr__ = _swig_repr
5958 def __init__(self, *args, **kwargs):
5ba5649b
RD
5959 """
5960 __init__(self, int winid=0) -> QueryNewPaletteEvent
5961
5962 Constructor.
5963 """
1bd55598 5964 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
d55e5bfc 5965 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
5966 """
5967 SetPaletteRealized(self, bool realized)
5968
5969 App should set this if it changes the palette.
5970 """
5b5c9bc7 5971 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
5972
5973 def GetPaletteRealized(*args, **kwargs):
5974 """GetPaletteRealized(self) -> bool"""
5b5c9bc7 5975 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
d55e5bfc 5976
2131d850 5977_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d55e5bfc
RD
5978
5979#---------------------------------------------------------------------------
5980
5b5c9bc7 5981class NavigationKeyEvent(Event):
5ba5649b
RD
5982 """
5983 EVT_NAVIGATION_KEY events are used to control moving the focus between
5984 widgets, otherwise known as tab-traversal. You woudl normally not
5985 catch navigation events in applications as there are already
5986 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5987 it useful to send navigation events in certain situations to change
5988 the focus in certain ways, although it's probably easier to just call
5989 `wx.Window.Navigate`.
5990 """
1bd55598
RD
5991 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5992 __repr__ = _swig_repr
5993 def __init__(self, *args, **kwargs):
5b5c9bc7 5994 """__init__(self) -> NavigationKeyEvent"""
1bd55598 5995 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
d55e5bfc 5996 def GetDirection(*args, **kwargs):
5ba5649b
RD
5997 """
5998 GetDirection(self) -> bool
5999
6000 Returns ``True`` if the direction is forward, ``False`` otherwise.
6001 """
5b5c9bc7 6002 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
d55e5bfc
RD
6003
6004 def SetDirection(*args, **kwargs):
5ba5649b
RD
6005 """
6006 SetDirection(self, bool forward)
6007
6008 Specify the direction that the navigation should take. Usually the
6009 difference between using Tab and Shift-Tab.
6010 """
5b5c9bc7 6011 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
d55e5bfc
RD
6012
6013 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6014 """
6015 IsWindowChange(self) -> bool
6016
6017 Returns ``True`` if window change is allowed.
6018 """
5b5c9bc7 6019 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
d55e5bfc
RD
6020
6021 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6022 """
6023 SetWindowChange(self, bool ischange)
6024
6025 Specify if the navigation should be able to change parent windows.
6026 For example, changing notebook pages, etc. This is usually implemented
6027 by using Control-Tab.
6028 """
5b5c9bc7 6029 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
d55e5bfc 6030
68350608 6031 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6032 """
6033 IsFromTab(self) -> bool
6034
6035 Returns ``True`` if the navigation event is originated from the Tab
6036 key.
6037 """
5b5c9bc7 6038 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
68350608
RD
6039
6040 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6041 """
6042 SetFromTab(self, bool bIs)
6043
6044 Set to true under MSW if the event was generated using the tab key.
6045 This is required for proper navogation over radio buttons.
6046 """
5b5c9bc7 6047 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
68350608 6048
908b74cd 6049 def SetFlags(*args, **kwargs):
5ba5649b
RD
6050 """
6051 SetFlags(self, long flags)
6052
6053 Set the navigation flags to a combination of the following:
6054
6055 * wx.NavigationKeyEvent.IsBackward
6056 * wx.NavigationKeyEvent.IsForward
6057 * wx.NavigationKeyEvent.WinChange
6058 * wx.NavigationKeyEvent.FromTab
6059
6060 """
5b5c9bc7 6061 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
908b74cd 6062
d55e5bfc 6063 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6064 """
6065 GetCurrentFocus(self) -> Window
6066
6067 Returns the child window which currenty has the focus. May be
6068 ``None``.
6069 """
5b5c9bc7 6070 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
d55e5bfc
RD
6071
6072 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6073 """
6074 SetCurrentFocus(self, Window win)
6075
6076 Set the window that has the focus.
6077 """
5b5c9bc7 6078 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
d55e5bfc 6079
5b5c9bc7
RD
6080 IsBackward = _core_.NavigationKeyEvent_IsBackward
6081 IsForward = _core_.NavigationKeyEvent_IsForward
6082 WinChange = _core_.NavigationKeyEvent_WinChange
6083 FromTab = _core_.NavigationKeyEvent_FromTab
2131d850 6084_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d55e5bfc
RD
6085
6086#---------------------------------------------------------------------------
6087
5b5c9bc7 6088class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6089 """
6090 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6091 underlying GUI object) exists.
6092 """
1bd55598
RD
6093 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6094 __repr__ = _swig_repr
6095 def __init__(self, *args, **kwargs):
5ba5649b
RD
6096 """
6097 __init__(self, Window win=None) -> WindowCreateEvent
6098
6099 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6100 underlying GUI object) exists.
6101 """
1bd55598 6102 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
d55e5bfc 6103 def GetWindow(*args, **kwargs):
5ba5649b
RD
6104 """
6105 GetWindow(self) -> Window
6106
6107 Returns the window that this event refers to.
6108 """
5b5c9bc7 6109 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
d55e5bfc 6110
2131d850 6111_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d55e5bfc 6112
5b5c9bc7 6113class WindowDestroyEvent(CommandEvent):
5ba5649b 6114 """
943e8dfd
RD
6115 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6116 when the GUI window is destroyed.
6117
6118 When a class derived from `wx.Window` is destroyed its destructor will
6119 have already run by the time this event is sent. Therefore this event
6120 will not usually be received at all by the window itself. Since it is
6121 received after the destructor has run, an object should not try to
6122 handle its own wx.WindowDestroyEvent, but it can be used to get
6123 notification of the destruction of another window.
5ba5649b 6124 """
1bd55598
RD
6125 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6126 __repr__ = _swig_repr
6127 def __init__(self, *args, **kwargs):
5ba5649b
RD
6128 """
6129 __init__(self, Window win=None) -> WindowDestroyEvent
6130
943e8dfd
RD
6131 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6132 when the GUI window is destroyed.
6133
6134 When a class derived from `wx.Window` is destroyed its destructor will
6135 have already run by the time this event is sent. Therefore this event
6136 will not usually be received at all by the window itself. Since it is
6137 received after the destructor has run, an object should not try to
6138 handle its own wx.WindowDestroyEvent, but it can be used to get
6139 notification of the destruction of another window.
5ba5649b 6140 """
1bd55598 6141 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
d55e5bfc 6142 def GetWindow(*args, **kwargs):
5ba5649b
RD
6143 """
6144 GetWindow(self) -> Window
6145
6146 Returns the window that this event refers to.
6147 """
5b5c9bc7 6148 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
d55e5bfc 6149
2131d850 6150_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d55e5bfc
RD
6151
6152#---------------------------------------------------------------------------
6153
5b5c9bc7 6154class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6155 """
6156 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6157 give the application a chance to show a context (popup) menu.
6158 """
1bd55598
RD
6159 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6160 __repr__ = _swig_repr
6161 def __init__(self, *args, **kwargs):
5ba5649b 6162 """
2131d850 6163 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6164
6165 Constructor.
6166 """
1bd55598 6167 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
d55e5bfc 6168 def GetPosition(*args, **kwargs):
5ba5649b
RD
6169 """
6170 GetPosition(self) -> Point
6171
6172 Returns the position (in screen coordinants) at which the menu should
6173 be shown.
6174 """
5b5c9bc7 6175 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
6176
6177 def SetPosition(*args, **kwargs):
5ba5649b
RD
6178 """
6179 SetPosition(self, Point pos)
6180
6181 Sets the position at which the menu should be shown.
6182 """
5b5c9bc7 6183 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
d55e5bfc 6184
2131d850 6185_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d55e5bfc
RD
6186
6187#---------------------------------------------------------------------------
6188
5b5c9bc7
RD
6189IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6190IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6191class IdleEvent(Event):
5ba5649b
RD
6192 """
6193 This class is used for EVT_IDLE events, which are generated and sent
6194 when the application *becomes* idle. In other words, the when the
6195 event queue becomes empty then idle events are sent to all windows (by
6196 default) and as long as none of them call `RequestMore` then there are
6197 no more idle events until after the system event queue has some normal
6198 events and then becomes empty again.
6199
6200 By default, idle events are sent to all windows. If this is causing a
6201 significant overhead in your application, you can call
6202 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6203 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6204 which should receive idle events. Then idle events will only be sent
6205 to those windows and not to any others.
6206 """
1bd55598
RD
6207 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6208 __repr__ = _swig_repr
6209 def __init__(self, *args, **kwargs):
5ba5649b
RD
6210 """
6211 __init__(self) -> IdleEvent
6212
6213 Constructor
6214 """
1bd55598 6215 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
d55e5bfc 6216 def RequestMore(*args, **kwargs):
5ba5649b
RD
6217 """
6218 RequestMore(self, bool needMore=True)
6219
6220 Tells wxWidgets that more processing is required. This function can be
6221 called by an EVT_IDLE handler for a window to indicate that the
6222 application should forward the EVT_IDLE event once more to the
6223 application windows. If no window calls this function during its
6224 EVT_IDLE handler, then the application will remain in a passive event
6225 loop until a new event is posted to the application by the windowing
6226 system.
6227 """
5b5c9bc7 6228 return _core_.IdleEvent_RequestMore(*args, **kwargs)
d55e5bfc
RD
6229
6230 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6231 """
6232 MoreRequested(self) -> bool
6233
6234 Returns ``True`` if the OnIdle function processing this event
6235 requested more processing time.
6236 """
5b5c9bc7 6237 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
d55e5bfc
RD
6238
6239 def SetMode(*args, **kwargs):
5ba5649b
RD
6240 """
6241 SetMode(int mode)
6242
6243 Static method for specifying how wxWidgets will send idle events: to
6244 all windows, or only to those which specify that they will process the
6245 events.
6246
6247 The mode can be one of the following values:
6248
6249 ========================= ========================================
6250 wx.IDLE_PROCESS_ALL Send idle events to all windows
6251 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6252 the wx.WS_EX_PROCESS_IDLE extra style
6253 flag set.
6254 ========================= ========================================
6255
6256 """
5b5c9bc7 6257 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
6258
6259 SetMode = staticmethod(SetMode)
6260 def GetMode(*args, **kwargs):
5ba5649b
RD
6261 """
6262 GetMode() -> int
6263
6264 Static method returning a value specifying how wxWidgets will send
6265 idle events: to all windows, or only to those which specify that they
6266 will process the events.
6267 """
5b5c9bc7 6268 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6269
6270 GetMode = staticmethod(GetMode)
6271 def CanSend(*args, **kwargs):
5ba5649b
RD
6272 """
6273 CanSend(Window win) -> bool
6274
6275 Returns ``True`` if it is appropriate to send idle events to this
6276 window.
6277
6278 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6279 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6280 events should be sent to this window now. By default this will always
6281 return ``True`` because the update mode is initially
6282 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6283 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6284 """
5b5c9bc7 6285 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6286
6287 CanSend = staticmethod(CanSend)
2131d850 6288_core_.IdleEvent_swigregister(IdleEvent)
d55e5bfc 6289
5b5c9bc7 6290def IdleEvent_SetMode(*args, **kwargs):
1bd55598 6291 """
5ba5649b
RD
6292 IdleEvent_SetMode(int mode)
6293
6294 Static method for specifying how wxWidgets will send idle events: to
6295 all windows, or only to those which specify that they will process the
6296 events.
6297
6298 The mode can be one of the following values:
6299
6300 ========================= ========================================
6301 wx.IDLE_PROCESS_ALL Send idle events to all windows
6302 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6303 the wx.WS_EX_PROCESS_IDLE extra style
6304 flag set.
6305 ========================= ========================================
6306
6307 """
1bd55598 6308 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6309
1bd55598
RD
6310def IdleEvent_GetMode(*args):
6311 """
5ba5649b
RD
6312 IdleEvent_GetMode() -> int
6313
6314 Static method returning a value specifying how wxWidgets will send
6315 idle events: to all windows, or only to those which specify that they
6316 will process the events.
6317 """
1bd55598 6318 return _core_.IdleEvent_GetMode(*args)
d55e5bfc 6319
5b5c9bc7 6320def IdleEvent_CanSend(*args, **kwargs):
1bd55598 6321 """
5ba5649b
RD
6322 IdleEvent_CanSend(Window win) -> bool
6323
6324 Returns ``True`` if it is appropriate to send idle events to this
6325 window.
6326
6327 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6328 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6329 events should be sent to this window now. By default this will always
6330 return ``True`` because the update mode is initially
6331 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6332 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6333 """
1bd55598 6334 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6335
6336#---------------------------------------------------------------------------
6337
2131d850
RD
6338class ClipboardTextEvent(CommandEvent):
6339 """
6340 A Clipboard Text event is sent when a window intercepts a text
6341 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6342 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6343 popup menu command, etc. NOTE : under windows these events are *NOT*
6344 generated automatically for a Rich Edit text control.
6345 """
6346 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6347 __repr__ = _swig_repr
6348 def __init__(self, *args, **kwargs):
6349 """
6350 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6351
6352 A Clipboard Text event is sent when a window intercepts a text
6353 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6354 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6355 popup menu command, etc. NOTE : under windows these events are *NOT*
6356 generated automatically for a Rich Edit text control.
6357 """
6358 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6359_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6360
6361#---------------------------------------------------------------------------
6362
5b5c9bc7 6363class PyEvent(Event):
5ba5649b
RD
6364 """
6365 wx.PyEvent can be used as a base class for implementing custom event
6366 types in Python. You should derived from this class instead of
6367 `wx.Event` because this class is Python-aware and is able to transport
6368 its Python bits safely through the wxWidgets event system and have
6369 them still be there when the event handler is invoked.
6370
6371 :see: `wx.PyCommandEvent`
6372
6373 """
1bd55598
RD
6374 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6375 __repr__ = _swig_repr
6376 def __init__(self, *args, **kwargs):
2131d850 6377 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
1bd55598 6378 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6379 self._SetSelf(self)
d55e5bfc 6380
1bd55598
RD
6381 __swig_destroy__ = _core_.delete_PyEvent
6382 __del__ = lambda self : None;
5ba5649b
RD
6383 def _SetSelf(*args, **kwargs):
6384 """_SetSelf(self, PyObject self)"""
6385 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6386
5ba5649b
RD
6387 def _GetSelf(*args, **kwargs):
6388 """_GetSelf(self) -> PyObject"""
6389 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc 6390
2131d850 6391_core_.PyEvent_swigregister(PyEvent)
d55e5bfc 6392
5b5c9bc7 6393class PyCommandEvent(CommandEvent):
5ba5649b
RD
6394 """
6395 wx.PyCommandEvent can be used as a base class for implementing custom
6396 event types in Python, where the event shoudl travel up to parent
6397 windows looking for a handler. You should derived from this class
6398 instead of `wx.CommandEvent` because this class is Python-aware and is
6399 able to transport its Python bits safely through the wxWidgets event
6400 system and have them still be there when the event handler is invoked.
6401
6402 :see: `wx.PyEvent`
6403
6404 """
1bd55598
RD
6405 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6406 __repr__ = _swig_repr
6407 def __init__(self, *args, **kwargs):
2131d850 6408 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
1bd55598 6409 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6410 self._SetSelf(self)
d55e5bfc 6411
1bd55598
RD
6412 __swig_destroy__ = _core_.delete_PyCommandEvent
6413 __del__ = lambda self : None;
5ba5649b
RD
6414 def _SetSelf(*args, **kwargs):
6415 """_SetSelf(self, PyObject self)"""
6416 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6417
5ba5649b
RD
6418 def _GetSelf(*args, **kwargs):
6419 """_GetSelf(self) -> PyObject"""
6420 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc 6421
2131d850 6422_core_.PyCommandEvent_swigregister(PyCommandEvent)
d55e5bfc 6423
5b5c9bc7 6424class DateEvent(CommandEvent):
5ba5649b
RD
6425 """
6426 This event class holds information about a date change event and is
6427 used together with `wx.DatePickerCtrl`. It also serves as a base class
6428 for `wx.calendar.CalendarEvent`. Bind these event types with
6429 EVT_DATE_CHANGED.
6430 """
1bd55598
RD
6431 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6432 __repr__ = _swig_repr
6433 def __init__(self, *args, **kwargs):
2131d850 6434 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
1bd55598 6435 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6436 def GetDate(*args, **kwargs):
5ba5649b
RD
6437 """
6438 GetDate(self) -> DateTime
6439
6440 Returns the date.
6441 """
5b5c9bc7 6442 return _core_.DateEvent_GetDate(*args, **kwargs)
53aa7709
RD
6443
6444 def SetDate(*args, **kwargs):
5ba5649b
RD
6445 """
6446 SetDate(self, DateTime date)
6447
6448 Sets the date carried by the event, normally only used by the library
6449 internally.
6450 """
5b5c9bc7 6451 return _core_.DateEvent_SetDate(*args, **kwargs)
53aa7709 6452
2131d850 6453_core_.DateEvent_swigregister(DateEvent)
53aa7709 6454
5b5c9bc7 6455wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
53aa7709
RD
6456EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6457
d55e5bfc
RD
6458#---------------------------------------------------------------------------
6459
5b5c9bc7
RD
6460PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6461PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6462PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6463PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6464PRINT_WINDOWS = _core_.PRINT_WINDOWS
6465PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6466class PyApp(EvtHandler):
d6c14a4c
RD
6467 """
6468 The ``wx.PyApp`` class is an *implementation detail*, please use the
6469 `wx.App` class (or some other derived class) instead.
6470 """
1bd55598
RD
6471 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6472 __repr__ = _swig_repr
6473 def __init__(self, *args, **kwargs):
d55e5bfc 6474 """
5b5c9bc7 6475 __init__(self) -> PyApp
d55e5bfc
RD
6476
6477 Create a new application object, starting the bootstrap process.
6478 """
1bd55598 6479 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
7993762b
RD
6480 self._setCallbackInfo(self, PyApp, False)
6481 self._setOORInfo(self, False)
d55e5bfc 6482
1bd55598
RD
6483 __swig_destroy__ = _core_.delete_PyApp
6484 __del__ = lambda self : None;
d55e5bfc 6485 def _setCallbackInfo(*args, **kwargs):
7993762b 6486 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
5b5c9bc7 6487 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
6488
6489 def GetAppName(*args, **kwargs):
6490 """
5b5c9bc7 6491 GetAppName(self) -> String
d55e5bfc
RD
6492
6493 Get the application name.
6494 """
5b5c9bc7 6495 return _core_.PyApp_GetAppName(*args, **kwargs)
d55e5bfc
RD
6496
6497 def SetAppName(*args, **kwargs):
6498 """
5b5c9bc7 6499 SetAppName(self, String name)
d55e5bfc 6500
d6c14a4c
RD
6501 Set the application name. This value may be used automatically by
6502 `wx.Config` and such.
d55e5bfc 6503 """
5b5c9bc7 6504 return _core_.PyApp_SetAppName(*args, **kwargs)
d55e5bfc
RD
6505
6506 def GetClassName(*args, **kwargs):
6507 """
5b5c9bc7 6508 GetClassName(self) -> String
d55e5bfc
RD
6509
6510 Get the application's class name.
6511 """
5b5c9bc7 6512 return _core_.PyApp_GetClassName(*args, **kwargs)
d55e5bfc
RD
6513
6514 def SetClassName(*args, **kwargs):
6515 """
5b5c9bc7 6516 SetClassName(self, String name)
d55e5bfc 6517
d6c14a4c
RD
6518 Set the application's class name. This value may be used for
6519 X-resources if applicable for the platform
d55e5bfc 6520 """
5b5c9bc7 6521 return _core_.PyApp_SetClassName(*args, **kwargs)
d55e5bfc
RD
6522
6523 def GetVendorName(*args, **kwargs):
6524 """
5b5c9bc7 6525 GetVendorName(self) -> String
d55e5bfc
RD
6526
6527 Get the application's vendor name.
6528 """
5b5c9bc7 6529 return _core_.PyApp_GetVendorName(*args, **kwargs)
d55e5bfc
RD
6530
6531 def SetVendorName(*args, **kwargs):
6532 """
5b5c9bc7 6533 SetVendorName(self, String name)
d55e5bfc 6534
d6c14a4c
RD
6535 Set the application's vendor name. This value may be used
6536 automatically by `wx.Config` and such.
d55e5bfc 6537 """
5b5c9bc7 6538 return _core_.PyApp_SetVendorName(*args, **kwargs)
d55e5bfc
RD
6539
6540 def GetTraits(*args, **kwargs):
6541 """
6542 GetTraits(self) -> wxAppTraits
6543
d6c14a4c
RD
6544 Return (and create if necessary) the app traits object to which we
6545 delegate for everything which either should be configurable by the
6546 user (then he can change the default behaviour simply by overriding
6547 CreateTraits() and returning his own traits object) or which is
6548 GUI/console dependent as then wx.AppTraits allows us to abstract the
6549 differences behind the common facade.
6550
6551 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc 6552 """
5b5c9bc7 6553 return _core_.PyApp_GetTraits(*args, **kwargs)
d55e5bfc
RD
6554
6555 def ProcessPendingEvents(*args, **kwargs):
6556 """
6557 ProcessPendingEvents(self)
6558
d6c14a4c
RD
6559 Process all events in the Pending Events list -- it is necessary to
6560 call this function to process posted events. This normally happens
6561 during each event loop iteration.
d55e5bfc 6562 """
5b5c9bc7 6563 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
6564
6565 def Yield(*args, **kwargs):
6566 """
6567 Yield(self, bool onlyIfNeeded=False) -> bool
6568
d6c14a4c
RD
6569 Process all currently pending events right now, instead of waiting
6570 until return to the event loop. It is an error to call ``Yield``
6571 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 6572
d6c14a4c 6573 :warning: This function is dangerous as it can lead to unexpected
15817c7e
RD
6574 reentrancies (i.e. when called from an event handler it may
6575 result in calling the same event handler again), use with
6576 extreme care or, better, don't use at all!
d55e5bfc 6577
d6c14a4c 6578 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
15817c7e 6579
d55e5bfc 6580 """
5b5c9bc7 6581 return _core_.PyApp_Yield(*args, **kwargs)
d55e5bfc
RD
6582
6583 def WakeUpIdle(*args, **kwargs):
6584 """
6585 WakeUpIdle(self)
6586
d6c14a4c
RD
6587 Make sure that idle events are sent again.
6588 :see: `wx.WakeUpIdle`
d55e5bfc 6589 """
5b5c9bc7 6590 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
d55e5bfc 6591
84f85550
RD
6592 def IsMainLoopRunning(*args, **kwargs):
6593 """
6594 IsMainLoopRunning() -> bool
6595
6596 Returns True if we're running the main loop, i.e. if the events can
6597 currently be dispatched.
6598 """
5b5c9bc7 6599 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550
RD
6600
6601 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
6602 def MainLoop(*args, **kwargs):
6603 """
6604 MainLoop(self) -> int
6605
d6c14a4c
RD
6606 Execute the main GUI loop, the function doesn't normally return until
6607 all top level windows have been closed and destroyed.
d55e5bfc 6608 """
5b5c9bc7 6609 return _core_.PyApp_MainLoop(*args, **kwargs)
d55e5bfc
RD
6610
6611 def Exit(*args, **kwargs):
6612 """
6613 Exit(self)
6614
6615 Exit the main loop thus terminating the application.
d6c14a4c 6616 :see: `wx.Exit`
d55e5bfc 6617 """
5b5c9bc7 6618 return _core_.PyApp_Exit(*args, **kwargs)
d55e5bfc
RD
6619
6620 def ExitMainLoop(*args, **kwargs):
6621 """
6622 ExitMainLoop(self)
6623
d6c14a4c
RD
6624 Exit the main GUI loop during the next iteration of the main
6625 loop, (i.e. it does not stop the program immediately!)
d55e5bfc 6626 """
5b5c9bc7 6627 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
d55e5bfc
RD
6628
6629 def Pending(*args, **kwargs):
6630 """
6631 Pending(self) -> bool
6632
6633 Returns True if there are unprocessed events in the event queue.
6634 """
5b5c9bc7 6635 return _core_.PyApp_Pending(*args, **kwargs)
d55e5bfc
RD
6636
6637 def Dispatch(*args, **kwargs):
6638 """
6639 Dispatch(self) -> bool
6640
6641 Process the first event in the event queue (blocks until an event
6642 appears if there are none currently)
6643 """
5b5c9bc7 6644 return _core_.PyApp_Dispatch(*args, **kwargs)
d55e5bfc
RD
6645
6646 def ProcessIdle(*args, **kwargs):
6647 """
6648 ProcessIdle(self) -> bool
6649
d6c14a4c
RD
6650 Called from the MainLoop when the application becomes idle (there are
6651 no pending events) and sends a `wx.IdleEvent` to all interested
6652 parties. Returns True if more idle events are needed, False if not.
d55e5bfc 6653 """
5b5c9bc7 6654 return _core_.PyApp_ProcessIdle(*args, **kwargs)
d55e5bfc
RD
6655
6656 def SendIdleEvents(*args, **kwargs):
6657 """
5b5c9bc7 6658 SendIdleEvents(self, Window win, IdleEvent event) -> bool
d55e5bfc 6659
d6c14a4c
RD
6660 Send idle event to window and all subwindows. Returns True if more
6661 idle time is requested.
d55e5bfc 6662 """
5b5c9bc7 6663 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
d55e5bfc
RD
6664
6665 def IsActive(*args, **kwargs):
6666 """
6667 IsActive(self) -> bool
6668
6669 Return True if our app has focus.
6670 """
5b5c9bc7 6671 return _core_.PyApp_IsActive(*args, **kwargs)
d55e5bfc
RD
6672
6673 def SetTopWindow(*args, **kwargs):
6674 """
5b5c9bc7 6675 SetTopWindow(self, Window win)
d55e5bfc 6676
d6c14a4c 6677 Set the *main* top level window
d55e5bfc 6678 """
5b5c9bc7 6679 return _core_.PyApp_SetTopWindow(*args, **kwargs)
d55e5bfc
RD
6680
6681 def GetTopWindow(*args, **kwargs):
6682 """
5b5c9bc7 6683 GetTopWindow(self) -> Window
d55e5bfc 6684
d6c14a4c
RD
6685 Return the *main* top level window (if it hadn't been set previously
6686 with SetTopWindow(), will return just some top level window and, if
6687 there not any, will return None)
d55e5bfc 6688 """
5b5c9bc7 6689 return _core_.PyApp_GetTopWindow(*args, **kwargs)
d55e5bfc
RD
6690
6691 def SetExitOnFrameDelete(*args, **kwargs):
6692 """
6693 SetExitOnFrameDelete(self, bool flag)
6694
d6c14a4c
RD
6695 Control the exit behaviour: by default, the program will exit the main
6696 loop (and so, usually, terminate) when the last top-level program
6697 window is deleted. Beware that if you disable this behaviour (with
6698 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6699 explicitly from somewhere.
d55e5bfc 6700 """
5b5c9bc7 6701 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6702
6703 def GetExitOnFrameDelete(*args, **kwargs):
6704 """
6705 GetExitOnFrameDelete(self) -> bool
6706
6707 Get the current exit behaviour setting.
6708 """
5b5c9bc7 6709 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6710
6711 def SetUseBestVisual(*args, **kwargs):
6712 """
6713 SetUseBestVisual(self, bool flag)
6714
d6c14a4c
RD
6715 Set whether the app should try to use the best available visual on
6716 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc 6717 """
5b5c9bc7 6718 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
6719
6720 def GetUseBestVisual(*args, **kwargs):
6721 """
6722 GetUseBestVisual(self) -> bool
6723
6724 Get current UseBestVisual setting.
6725 """
5b5c9bc7 6726 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
6727
6728 def SetPrintMode(*args, **kwargs):
6729 """SetPrintMode(self, int mode)"""
5b5c9bc7 6730 return _core_.PyApp_SetPrintMode(*args, **kwargs)
d55e5bfc
RD
6731
6732 def GetPrintMode(*args, **kwargs):
6733 """GetPrintMode(self) -> int"""
5b5c9bc7 6734 return _core_.PyApp_GetPrintMode(*args, **kwargs)
d55e5bfc
RD
6735
6736 def SetAssertMode(*args, **kwargs):
6737 """
6738 SetAssertMode(self, int mode)
6739
15817c7e 6740 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc 6741 """
5b5c9bc7 6742 return _core_.PyApp_SetAssertMode(*args, **kwargs)
d55e5bfc
RD
6743
6744 def GetAssertMode(*args, **kwargs):
6745 """
6746 GetAssertMode(self) -> int
6747
6748 Get the current OnAssert behaviour setting.
6749 """
5b5c9bc7 6750 return _core_.PyApp_GetAssertMode(*args, **kwargs)
d55e5bfc
RD
6751
6752 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 6753 """GetMacSupportPCMenuShortcuts() -> bool"""
5b5c9bc7 6754 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
6755
6756 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6757 def GetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 6758 """GetMacAboutMenuItemId() -> long"""
5b5c9bc7 6759 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
6760
6761 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6762 def GetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 6763 """GetMacPreferencesMenuItemId() -> long"""
5b5c9bc7 6764 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
6765
6766 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6767 def GetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 6768 """GetMacExitMenuItemId() -> long"""
5b5c9bc7 6769 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
6770
6771 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6772 def GetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
6773 """GetMacHelpMenuTitleName() -> String"""
6774 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
6775
6776 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6777 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 6778 """SetMacSupportPCMenuShortcuts(bool val)"""
5b5c9bc7 6779 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
6780
6781 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6782 def SetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 6783 """SetMacAboutMenuItemId(long val)"""
5b5c9bc7 6784 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
6785
6786 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6787 def SetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 6788 """SetMacPreferencesMenuItemId(long val)"""
5b5c9bc7 6789 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
6790
6791 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6792 def SetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 6793 """SetMacExitMenuItemId(long val)"""
5b5c9bc7 6794 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
6795
6796 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6797 def SetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
6798 """SetMacHelpMenuTitleName(String val)"""
6799 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
6800
6801 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6802 def _BootstrapApp(*args, **kwargs):
6803 """
6804 _BootstrapApp(self)
6805
6806 For internal use only
6807 """
5b5c9bc7 6808 return _core_.PyApp__BootstrapApp(*args, **kwargs)
d55e5bfc
RD
6809
6810 def GetComCtl32Version(*args, **kwargs):
6811 """
d6c14a4c 6812 GetComCtl32Version() -> int
d55e5bfc 6813
d6c14a4c
RD
6814 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6815 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 6816 """
5b5c9bc7 6817 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
6818
6819 GetComCtl32Version = staticmethod(GetComCtl32Version)
2131d850 6820_core_.PyApp_swigregister(PyApp)
d55e5bfc 6821
1bd55598
RD
6822def PyApp_IsMainLoopRunning(*args):
6823 """
5b5c9bc7 6824 PyApp_IsMainLoopRunning() -> bool
84f85550
RD
6825
6826 Returns True if we're running the main loop, i.e. if the events can
6827 currently be dispatched.
6828 """
1bd55598 6829 return _core_.PyApp_IsMainLoopRunning(*args)
84f85550 6830
1bd55598
RD
6831def PyApp_GetMacSupportPCMenuShortcuts(*args):
6832 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6833 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d55e5bfc 6834
1bd55598
RD
6835def PyApp_GetMacAboutMenuItemId(*args):
6836 """PyApp_GetMacAboutMenuItemId() -> long"""
6837 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d55e5bfc 6838
1bd55598
RD
6839def PyApp_GetMacPreferencesMenuItemId(*args):
6840 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6841 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d55e5bfc 6842
1bd55598
RD
6843def PyApp_GetMacExitMenuItemId(*args):
6844 """PyApp_GetMacExitMenuItemId() -> long"""
6845 return _core_.PyApp_GetMacExitMenuItemId(*args)
d55e5bfc 6846
1bd55598
RD
6847def PyApp_GetMacHelpMenuTitleName(*args):
6848 """PyApp_GetMacHelpMenuTitleName() -> String"""
6849 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d55e5bfc 6850
5b5c9bc7 6851def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
1bd55598
RD
6852 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6853 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 6854
5b5c9bc7 6855def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
1bd55598
RD
6856 """PyApp_SetMacAboutMenuItemId(long val)"""
6857 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 6858
5b5c9bc7 6859def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
1bd55598
RD
6860 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6861 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 6862
5b5c9bc7 6863def PyApp_SetMacExitMenuItemId(*args, **kwargs):
1bd55598
RD
6864 """PyApp_SetMacExitMenuItemId(long val)"""
6865 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 6866
5b5c9bc7 6867def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
1bd55598
RD
6868 """PyApp_SetMacHelpMenuTitleName(String val)"""
6869 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 6870
1bd55598
RD
6871def PyApp_GetComCtl32Version(*args):
6872 """
5b5c9bc7 6873 PyApp_GetComCtl32Version() -> int
d55e5bfc 6874
d6c14a4c
RD
6875 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6876 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 6877 """
1bd55598 6878 return _core_.PyApp_GetComCtl32Version(*args)
d55e5bfc
RD
6879
6880#---------------------------------------------------------------------------
6881
6882
1bd55598
RD
6883def Exit(*args):
6884 """
5b5c9bc7 6885 Exit()
d55e5bfc
RD
6886
6887 Force an exit of the application. Convenience for wx.GetApp().Exit()
6888 """
1bd55598 6889 return _core_.Exit(*args)
d55e5bfc 6890
1bd55598
RD
6891def Yield(*args):
6892 """
5b5c9bc7 6893 Yield() -> bool
d55e5bfc
RD
6894
6895 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6896 """
1bd55598 6897 return _core_.Yield(*args)
d55e5bfc 6898
1bd55598
RD
6899def YieldIfNeeded(*args):
6900 """
5b5c9bc7 6901 YieldIfNeeded() -> bool
d55e5bfc
RD
6902
6903 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6904 """
1bd55598 6905 return _core_.YieldIfNeeded(*args)
d55e5bfc 6906
5b5c9bc7 6907def SafeYield(*args, **kwargs):
1bd55598 6908 """
5b5c9bc7 6909 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
d55e5bfc 6910
d6c14a4c
RD
6911 This function is similar to `wx.Yield`, except that it disables the
6912 user input to all program windows before calling `wx.Yield` and
6913 re-enables it again afterwards. If ``win`` is not None, this window
6914 will remain enabled, allowing the implementation of some limited user
6915 interaction.
d55e5bfc 6916
d6c14a4c 6917 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 6918 """
1bd55598 6919 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 6920
1bd55598
RD
6921def WakeUpIdle(*args):
6922 """
5b5c9bc7 6923 WakeUpIdle()
d55e5bfc 6924
d6c14a4c
RD
6925 Cause the message queue to become empty again, so idle events will be
6926 sent.
d55e5bfc 6927 """
1bd55598 6928 return _core_.WakeUpIdle(*args)
d55e5bfc 6929
5b5c9bc7 6930def PostEvent(*args, **kwargs):
1bd55598 6931 """
5b5c9bc7 6932 PostEvent(EvtHandler dest, Event event)
d55e5bfc 6933
d6c14a4c
RD
6934 Send an event to a window or other wx.EvtHandler to be processed
6935 later.
d55e5bfc 6936 """
1bd55598 6937 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 6938
1bd55598
RD
6939def App_CleanUp(*args):
6940 """
5b5c9bc7 6941 App_CleanUp()
d55e5bfc 6942
15817c7e 6943 For internal use only, it is used to cleanup after wxWidgets when
d6c14a4c 6944 Python shuts down.
d55e5bfc 6945 """
1bd55598 6946 return _core_.App_CleanUp(*args)
d55e5bfc 6947
1bd55598
RD
6948def GetApp(*args):
6949 """
5b5c9bc7 6950 GetApp() -> PyApp
d55e5bfc
RD
6951
6952 Return a reference to the current wx.App object.
6953 """
1bd55598 6954 return _core_.GetApp(*args)
5cbf236d 6955
5b5c9bc7 6956def SetDefaultPyEncoding(*args, **kwargs):
1bd55598 6957 """
5cbf236d
RD
6958 SetDefaultPyEncoding(string encoding)
6959
6960 Sets the encoding that wxPython will use when it needs to convert a
6961 Python string or unicode object to or from a wxString.
62d32a5f
RD
6962
6963 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6964 but please be aware that the default encoding within the same locale
6965 may be slightly different on different platforms. For example, please
6966 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6967 between the common latin/roman encodings.
5cbf236d 6968 """
1bd55598 6969 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 6970
1bd55598
RD
6971def GetDefaultPyEncoding(*args):
6972 """
5cbf236d
RD
6973 GetDefaultPyEncoding() -> string
6974
6975 Gets the current encoding that wxPython will use when it needs to
6976 convert a Python string or unicode object to or from a wxString.
6977 """
1bd55598 6978 return _core_.GetDefaultPyEncoding(*args)
d55e5bfc
RD
6979#----------------------------------------------------------------------
6980
6981class PyOnDemandOutputWindow:
6982 """
6983 A class that can be used for redirecting Python's stdout and
6984 stderr streams. It will do nothing until something is wrriten to
6985 the stream at which point it will create a Frame with a text area
6986 and write the text there.
6987 """
6988 def __init__(self, title = "wxPython: stdout/stderr"):
6989 self.frame = None
6990 self.title = title
412d302d
RD
6991 self.pos = wx.DefaultPosition
6992 self.size = (450, 300)
d55e5bfc
RD
6993 self.parent = None
6994
6995 def SetParent(self, parent):
6996 """Set the window to be used as the popup Frame's parent."""
6997 self.parent = parent
6998
6999
7000 def CreateOutputWindow(self, st):
412d302d
RD
7001 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7002 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 7003 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7004 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 7005 self.text.AppendText(st)
d55e5bfc 7006 self.frame.Show(True)
2131d850 7007 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
d55e5bfc
RD
7008
7009
7010 def OnCloseWindow(self, event):
7011 if self.frame is not None:
7012 self.frame.Destroy()
7013 self.frame = None
7014 self.text = None
7015
7016
7017 # These methods provide the file-like output behaviour.
7018 def write(self, text):
7019 """
7020 Create the output window if needed and write the string to it.
7021 If not called in the context of the gui thread then uses
7022 CallAfter to do the work there.
7023 """
7024 if self.frame is None:
7025 if not wx.Thread_IsMain():
7026 wx.CallAfter(self.CreateOutputWindow, text)
7027 else:
7028 self.CreateOutputWindow(text)
7029 else:
7030 if not wx.Thread_IsMain():
7031 wx.CallAfter(self.text.AppendText, text)
7032 else:
7033 self.text.AppendText(text)
7034
7035
7036 def close(self):
7037 if self.frame is not None:
7038 wx.CallAfter(self.frame.Close)
7039
7040
bb4524c4
RD
7041 def flush(self):
7042 pass
7043
7044
d55e5bfc
RD
7045
7046#----------------------------------------------------------------------
7047
7048_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7049
7050class App(wx.PyApp):
7051 """
d6c14a4c
RD
7052 The ``wx.App`` class represents the application and is used to:
7053
7054 * bootstrap the wxPython system and initialize the underlying
7055 gui toolkit
7056 * set and get application-wide properties
7057 * implement the windowing system main message or event loop,
7058 and to dispatch events to window instances
7059 * etc.
7060
7061 Every application must have a ``wx.App`` instance, and all
7062 creation of UI objects should be delayed until after the
7063 ``wx.App`` object has been created in order to ensure that the gui
7064 platform and wxWidgets have been fully initialized.
7065
7066 Normally you would derive from this class and implement an
7067 ``OnInit`` method that creates a frame and then calls
7068 ``self.SetTopWindow(frame)``.
7069
7070 :see: `wx.PySimpleApp` for a simpler app class that can be used
15817c7e 7071 directly.
d55e5bfc 7072 """
d6c14a4c 7073
d55e5bfc
RD
7074 outputWindowClass = PyOnDemandOutputWindow
7075
d6c14a4c
RD
7076 def __init__(self, redirect=_defRedirect, filename=None,
7077 useBestVisual=False, clearSigInt=True):
7078 """
7079 Construct a ``wx.App`` object.
7080
7081 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7082 redirected? Defaults to True on Windows and Mac, False
7083 otherwise. If `filename` is None then output will be
7084 redirected to a window that pops up as needed. (You can
7085 control what kind of window is created for the output by
7086 resetting the class variable ``outputWindowClass`` to a
7087 class of your choosing.)
7088
7089 :param filename: The name of a file to redirect output to, if
7090 redirect is True.
7091
7092 :param useBestVisual: Should the app try to use the best
7093 available visual provided by the system (only relevant on
7094 systems that have more than one visual.) This parameter
7095 must be used instead of calling `SetUseBestVisual` later
7096 on because it must be set before the underlying GUI
7097 toolkit is initialized.
7098
7099 :param clearSigInt: Should SIGINT be cleared? This allows the
7100 app to terminate upon a Ctrl-C in the console like other
7101 GUI apps will.
7102
7103 :note: You should override OnInit to do applicaition
7104 initialization to ensure that the system, toolkit and
7105 wxWidgets are fully initialized.
7106 """
d55e5bfc
RD
7107 wx.PyApp.__init__(self)
7108
7109 if wx.Platform == "__WXMAC__":
7110 try:
7111 import MacOS
7112 if not MacOS.WMAvailable():
7113 print """\
7114This program needs access to the screen. Please run with 'pythonw',
7115not 'python', and only when you are logged in on the main display of
7116your Mac."""
7117 _sys.exit(1)
0346c964
RD
7118 except SystemExit:
7119 raise
d55e5bfc
RD
7120 except:
7121 pass
7122
7123 # This has to be done before OnInit
7124 self.SetUseBestVisual(useBestVisual)
7125
7126 # Set the default handler for SIGINT. This fixes a problem
7127 # where if Ctrl-C is pressed in the console that started this
7128 # app then it will not appear to do anything, (not even send
7129 # KeyboardInterrupt???) but will later segfault on exit. By
7130 # setting the default handler then the app will exit, as
7131 # expected (depending on platform.)
d6c14a4c
RD
7132 if clearSigInt:
7133 try:
7134 import signal
7135 signal.signal(signal.SIGINT, signal.SIG_DFL)
7136 except:
7137 pass
d55e5bfc
RD
7138
7139 # Save and redirect the stdio to a window?
7140 self.stdioWin = None
7141 self.saveStdio = (_sys.stdout, _sys.stderr)
7142 if redirect:
7143 self.RedirectStdio(filename)
7144
8fb0e70a
RD
7145 # Use Python's install prefix as the default
7146 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7147
d55e5bfc
RD
7148 # This finishes the initialization of wxWindows and then calls
7149 # the OnInit that should be present in the derived class
7150 self._BootstrapApp()
7151
7152
2131d850
RD
7153 def OnPreInit(self):
7154 """
7155 Things that must be done after _BootstrapApp has done its
7156 thing, but would be nice if they were already done by the time
7157 that OnInit is called.
7158 """
7159 wx.StockGDI._initStockObjects()
7160
7161
66af7a75
RD
7162 def __del__(self, destroy=wx.PyApp.__del__):
7163 self.RestoreStdio() # Just in case the MainLoop was overridden
7164 destroy(self)
d55e5bfc 7165
7993762b
RD
7166 def Destroy(self):
7167 wx.PyApp.Destroy(self)
7168 self.thisown = 0
d55e5bfc
RD
7169
7170 def SetTopWindow(self, frame):
7171 """Set the \"main\" top level window"""
7172 if self.stdioWin:
7173 self.stdioWin.SetParent(frame)
7174 wx.PyApp.SetTopWindow(self, frame)
7175
7176
7177 def MainLoop(self):
7178 """Execute the main GUI event loop"""
7179 wx.PyApp.MainLoop(self)
7180 self.RestoreStdio()
7181
7182
7183 def RedirectStdio(self, filename=None):
7184 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7185 if filename:
7186 _sys.stdout = _sys.stderr = open(filename, 'a')
7187 else:
7188 self.stdioWin = self.outputWindowClass()
7189 _sys.stdout = _sys.stderr = self.stdioWin
7190
7191
7192 def RestoreStdio(self):
66af7a75
RD
7193 try:
7194 _sys.stdout, _sys.stderr = self.saveStdio
7195 except:
7196 pass
d55e5bfc
RD
7197
7198
412d302d
RD
7199 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7200 """
7201 Set the title, position and/or size of the output window if
f5b96ee1
RD
7202 the stdio has been redirected. This should be called before
7203 any output would cause the output window to be created.
412d302d
RD
7204 """
7205 if self.stdioWin:
7206 if title is not None:
7207 self.stdioWin.title = title
7208 if pos is not None:
7209 self.stdioWin.pos = pos
7210 if size is not None:
7211 self.stdioWin.size = size
7212
7213
7214
d55e5bfc 7215
d6c14a4c 7216# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7217App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7218App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7219App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7220App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7221App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7222App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7223App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7224App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7225App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7226App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7227App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7228
7229#----------------------------------------------------------------------------
7230
7231class PySimpleApp(wx.App):
7232 """
7233 A simple application class. You can just create one of these and
7234 then then make your top level windows later, and not have to worry
d6c14a4c 7235 about OnInit. For example::
d55e5bfc 7236
d6c14a4c
RD
7237 app = wx.PySimpleApp()
7238 frame = wx.Frame(None, title='Hello World')
7239 frame.Show()
7240 app.MainLoop()
7241
7242 :see: `wx.App`
7243 """
7244
7245 def __init__(self, redirect=False, filename=None,
7246 useBestVisual=False, clearSigInt=True):
7247 """
7248 :see: `wx.App.__init__`
7249 """
7250 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7251
7252 def OnInit(self):
d55e5bfc
RD
7253 return True
7254
7255
d6c14a4c 7256
d55e5bfc
RD
7257# Is anybody using this one?
7258class PyWidgetTester(wx.App):
7259 def __init__(self, size = (250, 100)):
7260 self.size = size
7261 wx.App.__init__(self, 0)
7262
7263 def OnInit(self):
7264 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7265 self.SetTopWindow(self.frame)
7266 return True
7267
d6c14a4c
RD
7268 def SetWidget(self, widgetClass, *args, **kwargs):
7269 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7270 self.frame.Show(True)
7271
7272#----------------------------------------------------------------------------
7273# DO NOT hold any other references to this object. This is how we
d6c14a4c 7274# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7275# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
d6c14a4c 7276# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7277
7278class __wxPyCleanup:
7279 def __init__(self):
7280 self.cleanup = _core_.App_CleanUp
7281 def __del__(self):
7282 self.cleanup()
7283
7284_sys.__wxPythonCleanup = __wxPyCleanup()
7285
7286## # another possible solution, but it gets called too early...
d6c14a4c
RD
7287## import atexit
7288## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7289
7290
7291#----------------------------------------------------------------------------
7292
7293#---------------------------------------------------------------------------
7294
5b5c9bc7
RD
7295class EventLoop(object):
7296 """Proxy of C++ EventLoop class"""
1bd55598
RD
7297 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7298 __repr__ = _swig_repr
7299 def __init__(self, *args, **kwargs):
5b5c9bc7 7300 """__init__(self) -> EventLoop"""
1bd55598
RD
7301 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7302 __swig_destroy__ = _core_.delete_EventLoop
7303 __del__ = lambda self : None;
b411df4a
RD
7304 def Run(*args, **kwargs):
7305 """Run(self) -> int"""
5b5c9bc7 7306 return _core_.EventLoop_Run(*args, **kwargs)
b411df4a
RD
7307
7308 def Exit(*args, **kwargs):
7309 """Exit(self, int rc=0)"""
5b5c9bc7 7310 return _core_.EventLoop_Exit(*args, **kwargs)
b411df4a
RD
7311
7312 def Pending(*args, **kwargs):
7313 """Pending(self) -> bool"""
5b5c9bc7 7314 return _core_.EventLoop_Pending(*args, **kwargs)
b411df4a
RD
7315
7316 def Dispatch(*args, **kwargs):
7317 """Dispatch(self) -> bool"""
5b5c9bc7 7318 return _core_.EventLoop_Dispatch(*args, **kwargs)
b411df4a
RD
7319
7320 def IsRunning(*args, **kwargs):
7321 """IsRunning(self) -> bool"""
5b5c9bc7 7322 return _core_.EventLoop_IsRunning(*args, **kwargs)
b411df4a
RD
7323
7324 def GetActive(*args, **kwargs):
5b5c9bc7
RD
7325 """GetActive() -> EventLoop"""
7326 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a
RD
7327
7328 GetActive = staticmethod(GetActive)
7329 def SetActive(*args, **kwargs):
5b5c9bc7
RD
7330 """SetActive(EventLoop loop)"""
7331 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a
RD
7332
7333 SetActive = staticmethod(SetActive)
2131d850 7334_core_.EventLoop_swigregister(EventLoop)
b411df4a 7335
1bd55598
RD
7336def EventLoop_GetActive(*args):
7337 """EventLoop_GetActive() -> EventLoop"""
7338 return _core_.EventLoop_GetActive(*args)
b411df4a 7339
5b5c9bc7 7340def EventLoop_SetActive(*args, **kwargs):
1bd55598
RD
7341 """EventLoop_SetActive(EventLoop loop)"""
7342 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a 7343
32fe5131
RD
7344class EventLoopActivator(object):
7345 """Proxy of C++ EventLoopActivator class"""
1bd55598
RD
7346 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7347 __repr__ = _swig_repr
7348 def __init__(self, *args, **kwargs):
32fe5131 7349 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
1bd55598
RD
7350 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7351 __swig_destroy__ = _core_.delete_EventLoopActivator
7352 __del__ = lambda self : None;
2131d850 7353_core_.EventLoopActivator_swigregister(EventLoopActivator)
32fe5131 7354
b411df4a
RD
7355#---------------------------------------------------------------------------
7356
5b5c9bc7 7357class AcceleratorEntry(object):
d6c14a4c
RD
7358 """
7359 A class used to define items in an `wx.AcceleratorTable`. wxPython
7360 programs can choose to use wx.AcceleratorEntry objects, but using a
7361 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
15817c7e 7362 as well. See `__init__` for of the tuple values.
d6c14a4c
RD
7363
7364 :see: `wx.AcceleratorTable`
7365 """
1bd55598
RD
7366 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7367 __repr__ = _swig_repr
7368 def __init__(self, *args, **kwargs):
d6c14a4c 7369 """
5b5c9bc7 7370 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
d6c14a4c
RD
7371
7372 Construct a wx.AcceleratorEntry.
d6c14a4c 7373 """
1bd55598
RD
7374 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7375 __swig_destroy__ = _core_.delete_AcceleratorEntry
7376 __del__ = lambda self : None;
d55e5bfc 7377 def Set(*args, **kwargs):
d6c14a4c
RD
7378 """
7379 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 7380
d6c14a4c
RD
7381 (Re)set the attributes of a wx.AcceleratorEntry.
7382 :see `__init__`
7383 """
5b5c9bc7 7384 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
7385
7386 def GetFlags(*args, **kwargs):
d6c14a4c
RD
7387 """
7388 GetFlags(self) -> int
7389
7390 Get the AcceleratorEntry's flags.
7391 """
5b5c9bc7 7392 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
d55e5bfc
RD
7393
7394 def GetKeyCode(*args, **kwargs):
d6c14a4c
RD
7395 """
7396 GetKeyCode(self) -> int
7397
7398 Get the AcceleratorEntry's keycode.
7399 """
5b5c9bc7 7400 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
7401
7402 def GetCommand(*args, **kwargs):
d6c14a4c
RD
7403 """
7404 GetCommand(self) -> int
7405
7406 Get the AcceleratorEntry's command ID.
7407 """
5b5c9bc7 7408 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
d55e5bfc 7409
2131d850 7410_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
d55e5bfc 7411
5b5c9bc7 7412class AcceleratorTable(Object):
d6c14a4c
RD
7413 """
7414 An accelerator table allows the application to specify a table of
7415 keyboard shortcuts for menus or other commands. On Windows, menu or
7416 button commands are supported; on GTK, only menu commands are
7417 supported.
d6c14a4c 7418 """
1bd55598
RD
7419 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7420 __repr__ = _swig_repr
7421 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7422 """
7423 __init__(entries) -> AcceleratorTable
7424
d6c14a4c
RD
7425 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7426 items or or of 3-tuples (flags, keyCode, cmdID)
7427
7428 :see: `wx.AcceleratorEntry`
d55e5bfc 7429 """
1bd55598
RD
7430 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7431 __swig_destroy__ = _core_.delete_AcceleratorTable
7432 __del__ = lambda self : None;
d55e5bfc
RD
7433 def Ok(*args, **kwargs):
7434 """Ok(self) -> bool"""
5b5c9bc7 7435 return _core_.AcceleratorTable_Ok(*args, **kwargs)
d55e5bfc 7436
2131d850 7437_core_.AcceleratorTable_swigregister(AcceleratorTable)
d55e5bfc
RD
7438
7439
5b5c9bc7 7440def GetAccelFromString(*args, **kwargs):
1bd55598
RD
7441 """GetAccelFromString(String label) -> AcceleratorEntry"""
7442 return _core_.GetAccelFromString(*args, **kwargs)
d55e5bfc
RD
7443#---------------------------------------------------------------------------
7444
5b5c9bc7 7445class VisualAttributes(object):
d55e5bfc 7446 """struct containing all the visual attributes of a control"""
1bd55598
RD
7447 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7448 __repr__ = _swig_repr
7449 def __init__(self, *args, **kwargs):
d55e5bfc 7450 """
5b5c9bc7 7451 __init__(self) -> VisualAttributes
d55e5bfc
RD
7452
7453 struct containing all the visual attributes of a control
7454 """
1bd55598
RD
7455 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7456 __swig_destroy__ = _core_.delete_VisualAttributes
7457 __del__ = lambda self : None;
5b5c9bc7
RD
7458 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7459 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7460 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 7461_core_.VisualAttributes_swigregister(VisualAttributes)
5b5c9bc7 7462NullAcceleratorTable = cvar.NullAcceleratorTable
d55e5bfc
RD
7463PanelNameStr = cvar.PanelNameStr
7464
5b5c9bc7
RD
7465WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7466WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7467WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7468WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7469WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7470class Window(EvtHandler):
d55e5bfc
RD
7471 """
7472 wx.Window is the base class for all windows and represents any visible
7473 object on the screen. All controls, top level windows and so on are
7474 wx.Windows. Sizers and device contexts are not however, as they don't
7475 appear on screen themselves.
7476
7477 """
1bd55598
RD
7478 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7479 __repr__ = _swig_repr
7480 def __init__(self, *args, **kwargs):
d55e5bfc 7481 """
5b5c9bc7
RD
7482 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7483 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
d55e5bfc
RD
7484
7485 Construct and show a generic Window.
7486 """
1bd55598 7487 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d55e5bfc
RD
7488 self._setOORInfo(self)
7489
7490 def Create(*args, **kwargs):
7491 """
5b5c9bc7
RD
7492 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7493 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
d55e5bfc
RD
7494
7495 Create the GUI part of the Window for 2-phase creation mode.
7496 """
5b5c9bc7 7497 return _core_.Window_Create(*args, **kwargs)
d55e5bfc
RD
7498
7499 def Close(*args, **kwargs):
7500 """
7501 Close(self, bool force=False) -> bool
7502
7503 This function simply generates a EVT_CLOSE event whose handler usually
7504 tries to close the window. It doesn't close the window itself,
7505 however. If force is False (the default) then the window's close
7506 handler will be allowed to veto the destruction of the window.
d55e5bfc 7507 """
5b5c9bc7 7508 return _core_.Window_Close(*args, **kwargs)
d55e5bfc
RD
7509
7510 def Destroy(*args, **kwargs):
7511 """
7512 Destroy(self) -> bool
7513
7514 Destroys the window safely. Frames and dialogs are not destroyed
7515 immediately when this function is called -- they are added to a list
7516 of windows to be deleted on idle time, when all the window's events
7517 have been processed. This prevents problems with events being sent to
7518 non-existent windows.
7519
7520 Returns True if the window has either been successfully deleted, or it
7521 has been added to the list of windows pending real deletion.
7522 """
7e08d4ef
RD
7523 val = _core_.Window_Destroy(*args, **kwargs)
7524 args[0].thisown = 0
7525 return val
d55e5bfc
RD
7526
7527 def DestroyChildren(*args, **kwargs):
7528 """
7529 DestroyChildren(self) -> bool
7530
15817c7e
RD
7531 Destroys all children of a window. Called automatically by the
7532 destructor.
d55e5bfc 7533 """
5b5c9bc7 7534 return _core_.Window_DestroyChildren(*args, **kwargs)
d55e5bfc
RD
7535
7536 def IsBeingDeleted(*args, **kwargs):
7537 """
7538 IsBeingDeleted(self) -> bool
7539
7540 Is the window in the process of being deleted?
7541 """
5b5c9bc7 7542 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d55e5bfc 7543
d55e5bfc
RD
7544 def SetLabel(*args, **kwargs):
7545 """
5b5c9bc7 7546 SetLabel(self, String label)
d55e5bfc
RD
7547
7548 Set the text which the window shows in its label if applicable.
7549 """
5b5c9bc7 7550 return _core_.Window_SetLabel(*args, **kwargs)
d55e5bfc
RD
7551
7552 def GetLabel(*args, **kwargs):
7553 """
5b5c9bc7 7554 GetLabel(self) -> String
d55e5bfc 7555
15817c7e
RD
7556 Generic way of getting a label from any window, for identification
7557 purposes. The interpretation of this function differs from class to
7558 class. For frames and dialogs, the value returned is the title. For
7559 buttons or static text controls, it is the button text. This function
7560 can be useful for meta-programs such as testing tools or special-needs
7561 access programs)which need to identify windows by name.
d55e5bfc 7562 """
5b5c9bc7 7563 return _core_.Window_GetLabel(*args, **kwargs)
d55e5bfc
RD
7564
7565 def SetName(*args, **kwargs):
7566 """
5b5c9bc7 7567 SetName(self, String name)
d55e5bfc 7568
15817c7e
RD
7569 Sets the window's name. The window name is used for ressource setting
7570 in X, it is not the same as the window title/label
d55e5bfc 7571 """
5b5c9bc7 7572 return _core_.Window_SetName(*args, **kwargs)
d55e5bfc
RD
7573
7574 def GetName(*args, **kwargs):
7575 """
5b5c9bc7 7576 GetName(self) -> String
d55e5bfc 7577
15817c7e
RD
7578 Returns the windows name. This name is not guaranteed to be unique;
7579 it is up to the programmer to supply an appropriate name in the window
7580 constructor or via wx.Window.SetName.
d55e5bfc 7581 """
5b5c9bc7 7582 return _core_.Window_GetName(*args, **kwargs)
d55e5bfc
RD
7583
7584 def SetWindowVariant(*args, **kwargs):
7585 """
7586 SetWindowVariant(self, int variant)
7587
15817c7e
RD
7588 Sets the variant of the window/font size to use for this window, if
7589 the platform supports variants, for example, wxMac.
d55e5bfc 7590 """
5b5c9bc7 7591 return _core_.Window_SetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7592
7593 def GetWindowVariant(*args, **kwargs):
7594 """GetWindowVariant(self) -> int"""
5b5c9bc7 7595 return _core_.Window_GetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7596
7597 def SetId(*args, **kwargs):
7598 """
7599 SetId(self, int winid)
7600
7601 Sets the identifier of the window. Each window has an integer
7602 identifier. If the application has not provided one, an identifier
7603 will be generated. Normally, the identifier should be provided on
7604 creation and should not be modified subsequently.
7605 """
5b5c9bc7 7606 return _core_.Window_SetId(*args, **kwargs)
d55e5bfc
RD
7607
7608 def GetId(*args, **kwargs):
7609 """
7610 GetId(self) -> int
7611
7612 Returns the identifier of the window. Each window has an integer
7613 identifier. If the application has not provided one (or the default Id
7614 -1 is used) then an unique identifier with a negative value will be
7615 generated.
7616 """
5b5c9bc7 7617 return _core_.Window_GetId(*args, **kwargs)
d55e5bfc
RD
7618
7619 def NewControlId(*args, **kwargs):
7620 """
d6c14a4c 7621 NewControlId() -> int
d55e5bfc
RD
7622
7623 Generate a control id for the controls which were not given one.
7624 """
5b5c9bc7 7625 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc
RD
7626
7627 NewControlId = staticmethod(NewControlId)
7628 def NextControlId(*args, **kwargs):
7629 """
d6c14a4c 7630 NextControlId(int winid) -> int
d55e5bfc
RD
7631
7632 Get the id of the control following the one with the given
15817c7e 7633 autogenerated) id
d55e5bfc 7634 """
5b5c9bc7 7635 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
7636
7637 NextControlId = staticmethod(NextControlId)
7638 def PrevControlId(*args, **kwargs):
7639 """
d6c14a4c 7640 PrevControlId(int winid) -> int
d55e5bfc
RD
7641
7642 Get the id of the control preceding the one with the given
15817c7e 7643 autogenerated) id
d55e5bfc 7644 """
5b5c9bc7 7645 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc
RD
7646
7647 PrevControlId = staticmethod(PrevControlId)
7648 def SetSize(*args, **kwargs):
7649 """
5b5c9bc7 7650 SetSize(self, Size size)
d55e5bfc
RD
7651
7652 Sets the size of the window in pixels.
7653 """
5b5c9bc7 7654 return _core_.Window_SetSize(*args, **kwargs)
d55e5bfc
RD
7655
7656 def SetDimensions(*args, **kwargs):
7657 """
5b5c9bc7 7658 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
7659
7660 Sets the position and size of the window in pixels. The sizeFlags
7661 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
7662 equal to -1.
7663
7664 ======================== ======================================
7665 wx.SIZE_AUTO A -1 indicates that a class-specific
7666 default should be used.
7667 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7668 -1 values are supplied.
7669 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7670 interpreted as real dimensions, not
7671 default values.
7672 ======================== ======================================
7673
d55e5bfc 7674 """
5b5c9bc7 7675 return _core_.Window_SetDimensions(*args, **kwargs)
d55e5bfc
RD
7676
7677 def SetRect(*args, **kwargs):
7678 """
5b5c9bc7 7679 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
7680
7681 Sets the position and size of the window in pixels using a wx.Rect.
7682 """
5b5c9bc7 7683 return _core_.Window_SetRect(*args, **kwargs)
d55e5bfc
RD
7684
7685 def SetSizeWH(*args, **kwargs):
7686 """
7687 SetSizeWH(self, int width, int height)
7688
7689 Sets the size of the window in pixels.
7690 """
5b5c9bc7 7691 return _core_.Window_SetSizeWH(*args, **kwargs)
d55e5bfc
RD
7692
7693 def Move(*args, **kwargs):
7694 """
5b5c9bc7 7695 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
7696
7697 Moves the window to the given position.
7698 """
5b5c9bc7 7699 return _core_.Window_Move(*args, **kwargs)
d55e5bfc
RD
7700
7701 SetPosition = Move
7702 def MoveXY(*args, **kwargs):
7703 """
5b5c9bc7 7704 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
7705
7706 Moves the window to the given position.
7707 """
5b5c9bc7 7708 return _core_.Window_MoveXY(*args, **kwargs)
d55e5bfc 7709
f8167d6e
RD
7710 def SetBestFittingSize(*args, **kwargs):
7711 """
5b5c9bc7 7712 SetBestFittingSize(self, Size size=DefaultSize)
f8167d6e
RD
7713
7714 A 'Smart' SetSize that will fill in default size components with the
7715 window's *best size* values. Also set's the minsize for use with sizers.
7716 """
5b5c9bc7 7717 return _core_.Window_SetBestFittingSize(*args, **kwargs)
f8167d6e 7718
d55e5bfc
RD
7719 def Raise(*args, **kwargs):
7720 """
7721 Raise(self)
7722
943e8dfd
RD
7723 Raises the window to the top of the window hierarchy. In current
7724 version of wxWidgets this works both for manage and child windows.
d55e5bfc 7725 """
5b5c9bc7 7726 return _core_.Window_Raise(*args, **kwargs)
d55e5bfc
RD
7727
7728 def Lower(*args, **kwargs):
7729 """
7730 Lower(self)
7731
943e8dfd
RD
7732 Lowers the window to the bottom of the window hierarchy. In current
7733 version of wxWidgets this works both for manage and child windows.
d55e5bfc 7734 """
5b5c9bc7 7735 return _core_.Window_Lower(*args, **kwargs)
d55e5bfc
RD
7736
7737 def SetClientSize(*args, **kwargs):
7738 """
5b5c9bc7 7739 SetClientSize(self, Size size)
d55e5bfc
RD
7740
7741 This sets the size of the window client area in pixels. Using this
7742 function to size a window tends to be more device-independent than
7743 wx.Window.SetSize, since the application need not worry about what
7744 dimensions the border or title bar have when trying to fit the window
7745 around panel items, for example.
7746 """
5b5c9bc7 7747 return _core_.Window_SetClientSize(*args, **kwargs)
d55e5bfc
RD
7748
7749 def SetClientSizeWH(*args, **kwargs):
7750 """
7751 SetClientSizeWH(self, int width, int height)
7752
7753 This sets the size of the window client area in pixels. Using this
7754 function to size a window tends to be more device-independent than
7755 wx.Window.SetSize, since the application need not worry about what
7756 dimensions the border or title bar have when trying to fit the window
7757 around panel items, for example.
7758 """
5b5c9bc7 7759 return _core_.Window_SetClientSizeWH(*args, **kwargs)
d55e5bfc
RD
7760
7761 def SetClientRect(*args, **kwargs):
7762 """
5b5c9bc7 7763 SetClientRect(self, Rect rect)
d55e5bfc
RD
7764
7765 This sets the size of the window client area in pixels. Using this
7766 function to size a window tends to be more device-independent than
7767 wx.Window.SetSize, since the application need not worry about what
7768 dimensions the border or title bar have when trying to fit the window
7769 around panel items, for example.
7770 """
5b5c9bc7 7771 return _core_.Window_SetClientRect(*args, **kwargs)
d55e5bfc
RD
7772
7773 def GetPosition(*args, **kwargs):
7774 """
5b5c9bc7 7775 GetPosition(self) -> Point
d55e5bfc 7776
1c71765a
RD
7777 Get the window's position. Notice that the position is in client
7778 coordinates for child windows and screen coordinates for the top level
7779 ones, use `GetScreenPosition` if you need screen coordinates for all
7780 kinds of windows.
d55e5bfc 7781 """
5b5c9bc7 7782 return _core_.Window_GetPosition(*args, **kwargs)
d55e5bfc
RD
7783
7784 def GetPositionTuple(*args, **kwargs):
7785 """
7786 GetPositionTuple() -> (x,y)
7787
1c71765a
RD
7788 Get the window's position. Notice that the position is in client
7789 coordinates for child windows and screen coordinates for the top level
7790 ones, use `GetScreenPosition` if you need screen coordinates for all
7791 kinds of windows.
d55e5bfc 7792 """
5b5c9bc7 7793 return _core_.Window_GetPositionTuple(*args, **kwargs)
d55e5bfc 7794
1c71765a
RD
7795 def GetScreenPosition(*args, **kwargs):
7796 """
7797 GetScreenPosition(self) -> Point
7798
7799 Get the position of the window in screen coordinantes.
7800 """
7801 return _core_.Window_GetScreenPosition(*args, **kwargs)
7802
7803 def GetScreenPositionTuple(*args, **kwargs):
7804 """
7805 GetScreenPositionTuple() -> (x,y)
7806
7807 Get the position of the window in screen coordinantes.
7808 """
7809 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7810
7811 def GetScreenRect(*args, **kwargs):
7812 """
7813 GetScreenRect(self) -> Rect
7814
7815 Returns the size and position of the window in screen coordinantes as
7816 a `wx.Rect` object.
7817 """
7818 return _core_.Window_GetScreenRect(*args, **kwargs)
7819
d55e5bfc
RD
7820 def GetSize(*args, **kwargs):
7821 """
5b5c9bc7 7822 GetSize(self) -> Size
d55e5bfc
RD
7823
7824 Get the window size.
7825 """
5b5c9bc7 7826 return _core_.Window_GetSize(*args, **kwargs)
d55e5bfc
RD
7827
7828 def GetSizeTuple(*args, **kwargs):
7829 """
7830 GetSizeTuple() -> (width, height)
7831
7832 Get the window size.
7833 """
5b5c9bc7 7834 return _core_.Window_GetSizeTuple(*args, **kwargs)
d55e5bfc
RD
7835
7836 def GetRect(*args, **kwargs):
7837 """
5b5c9bc7 7838 GetRect(self) -> Rect
d55e5bfc 7839
1c71765a 7840 Returns the size and position of the window as a `wx.Rect` object.
d55e5bfc 7841 """
5b5c9bc7 7842 return _core_.Window_GetRect(*args, **kwargs)
d55e5bfc
RD
7843
7844 def GetClientSize(*args, **kwargs):
7845 """
5b5c9bc7 7846 GetClientSize(self) -> Size
d55e5bfc
RD
7847
7848 This gets the size of the window's 'client area' in pixels. The client
7849 area is the area which may be drawn on by the programmer, excluding
7850 title bar, border, scrollbars, etc.
7851 """
5b5c9bc7 7852 return _core_.Window_GetClientSize(*args, **kwargs)
d55e5bfc
RD
7853
7854 def GetClientSizeTuple(*args, **kwargs):
7855 """
7856 GetClientSizeTuple() -> (width, height)
7857
7858 This gets the size of the window's 'client area' in pixels. The client
7859 area is the area which may be drawn on by the programmer, excluding
7860 title bar, border, scrollbars, etc.
7861 """
5b5c9bc7 7862 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
d55e5bfc
RD
7863
7864 def GetClientAreaOrigin(*args, **kwargs):
7865 """
5b5c9bc7 7866 GetClientAreaOrigin(self) -> Point
d55e5bfc
RD
7867
7868 Get the origin of the client area of the window relative to the
7869 window's top left corner (the client area may be shifted because of
7870 the borders, scrollbars, other decorations...)
7871 """
5b5c9bc7 7872 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
d55e5bfc
RD
7873
7874 def GetClientRect(*args, **kwargs):
7875 """
5b5c9bc7 7876 GetClientRect(self) -> Rect
d55e5bfc 7877
0439c23b 7878 Get the client area position and size as a `wx.Rect` object.
d55e5bfc 7879 """
5b5c9bc7 7880 return _core_.Window_GetClientRect(*args, **kwargs)
d55e5bfc
RD
7881
7882 def GetBestSize(*args, **kwargs):
7883 """
5b5c9bc7 7884 GetBestSize(self) -> Size
d55e5bfc 7885
bfddbb17 7886 This function returns the best acceptable minimal size for the
15817c7e
RD
7887 window, if applicable. For example, for a static text control, it will
7888 be the minimal size such that the control label is not truncated. For
7889 windows containing subwindows (suzh aswx.Panel), the size returned by
7890 this function will be the same as the size the window would have had
7891 after calling Fit.
d55e5bfc 7892 """
5b5c9bc7 7893 return _core_.Window_GetBestSize(*args, **kwargs)
d55e5bfc
RD
7894
7895 def GetBestSizeTuple(*args, **kwargs):
7896 """
7897 GetBestSizeTuple() -> (width, height)
7898
bfddbb17 7899 This function returns the best acceptable minimal size for the
15817c7e
RD
7900 window, if applicable. For example, for a static text control, it will
7901 be the minimal size such that the control label is not truncated. For
7902 windows containing subwindows (suzh aswx.Panel), the size returned by
7903 this function will be the same as the size the window would have had
7904 after calling Fit.
d55e5bfc 7905 """
5b5c9bc7 7906 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
d55e5bfc 7907
a001823c
RD
7908 def InvalidateBestSize(*args, **kwargs):
7909 """
7910 InvalidateBestSize(self)
7911
7912 Reset the cached best size value so it will be recalculated the next
7913 time it is needed.
7914 """
5b5c9bc7 7915 return _core_.Window_InvalidateBestSize(*args, **kwargs)
a001823c 7916
e2813725
RD
7917 def CacheBestSize(*args, **kwargs):
7918 """
7919 CacheBestSize(self, Size size)
7920
7921 Cache the best size so it doesn't need to be calculated again, (at least until
7922 some properties of the window change.)
7923 """
7924 return _core_.Window_CacheBestSize(*args, **kwargs)
7925
a001823c
RD
7926 def GetBestFittingSize(*args, **kwargs):
7927 """
5b5c9bc7 7928 GetBestFittingSize(self) -> Size
a001823c
RD
7929
7930 This function will merge the window's best size into the window's
7931 minimum size, giving priority to the min size components, and returns
7932 the results.
7933
7934 """
5b5c9bc7 7935 return _core_.Window_GetBestFittingSize(*args, **kwargs)
a001823c 7936
d55e5bfc
RD
7937 def GetAdjustedBestSize(*args, **kwargs):
7938 """
5b5c9bc7 7939 GetAdjustedBestSize(self) -> Size
d55e5bfc
RD
7940
7941 This method is similar to GetBestSize, except in one
7942 thing. GetBestSize should return the minimum untruncated size of the
7943 window, while this method will return the largest of BestSize and any
7944 user specified minimum size. ie. it is the minimum size the window
7945 should currently be drawn at, not the minimal size it can possibly
7946 tolerate.
7947 """
5b5c9bc7 7948 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
d55e5bfc
RD
7949
7950 def Center(*args, **kwargs):
7951 """
5b5c9bc7 7952 Center(self, int direction=BOTH)
d55e5bfc
RD
7953
7954 Centers the window. The parameter specifies the direction for
7955 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7956 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7957 on the entire screen and not on its parent window. If it is a
7958 top-level window and has no parent then it will always be centered
7959 relative to the screen.
7960 """
5b5c9bc7 7961 return _core_.Window_Center(*args, **kwargs)
d55e5bfc
RD
7962
7963 Centre = Center
d55e5bfc
RD
7964 def CenterOnParent(*args, **kwargs):
7965 """
5b5c9bc7 7966 CenterOnParent(self, int dir=BOTH)
d55e5bfc
RD
7967
7968 Center with respect to the the parent window
7969 """
5b5c9bc7 7970 return _core_.Window_CenterOnParent(*args, **kwargs)
d55e5bfc
RD
7971
7972 CentreOnParent = CenterOnParent
7973 def Fit(*args, **kwargs):
7974 """
7975 Fit(self)
7976
7977 Sizes the window so that it fits around its subwindows. This function
7978 won't do anything if there are no subwindows and will only really work
7979 correctly if sizers are used for the subwindows layout. Also, if the
7980 window has exactly one subwindow it is better (faster and the result
7981 is more precise as Fit adds some margin to account for fuzziness of
7982 its calculations) to call window.SetClientSize(child.GetSize())
7983 instead of calling Fit.
7984 """
5b5c9bc7 7985 return _core_.Window_Fit(*args, **kwargs)
d55e5bfc
RD
7986
7987 def FitInside(*args, **kwargs):
7988 """
7989 FitInside(self)
7990
7991 Similar to Fit, but sizes the interior (virtual) size of a
7992 window. Mainly useful with scrolled windows to reset scrollbars after
7993 sizing changes that do not trigger a size event, and/or scrolled
7994 windows without an interior sizer. This function similarly won't do
7995 anything if there are no subwindows.
7996 """
5b5c9bc7 7997 return _core_.Window_FitInside(*args, **kwargs)
d55e5bfc 7998
03837c5c 7999 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
8000 """
8001 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8002 int incH=-1)
d55e5bfc
RD
8003
8004 Allows specification of minimum and maximum window sizes, and window
8005 size increments. If a pair of values is not set (or set to -1), the
8006 default values will be used. If this function is called, the user
908b74cd
RD
8007 will not be able to size the window outside the given bounds (if it is
8008 a top-level window.) Sizers will also inspect the minimum window size
8009 and will use that value if set when calculating layout.
8010
8011 The resizing increments are only significant under Motif or Xt.
d55e5bfc 8012 """
5b5c9bc7 8013 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 8014
03837c5c
RD
8015 def SetSizeHintsSz(*args, **kwargs):
8016 """
5b5c9bc7 8017 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
03837c5c
RD
8018
8019 Allows specification of minimum and maximum window sizes, and window
8020 size increments. If a pair of values is not set (or set to -1), the
8021 default values will be used. If this function is called, the user
8022 will not be able to size the window outside the given bounds (if it is
8023 a top-level window.) Sizers will also inspect the minimum window size
8024 and will use that value if set when calculating layout.
8025
8026 The resizing increments are only significant under Motif or Xt.
8027 """
5b5c9bc7 8028 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
03837c5c
RD
8029
8030 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 8031 """
908b74cd 8032 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
8033
8034 Allows specification of minimum and maximum virtual window sizes. If a
8035 pair of values is not set (or set to -1), the default values will be
8036 used. If this function is called, the user will not be able to size
8037 the virtual area of the window outside the given bounds.
8038 """
5b5c9bc7 8039 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
03837c5c
RD
8040
8041 def SetVirtualSizeHintsSz(*args, **kwargs):
8042 """
5b5c9bc7 8043 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
03837c5c
RD
8044
8045 Allows specification of minimum and maximum virtual window sizes. If a
8046 pair of values is not set (or set to -1), the default values will be
8047 used. If this function is called, the user will not be able to size
8048 the virtual area of the window outside the given bounds.
8049 """
5b5c9bc7 8050 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 8051
908b74cd 8052 def GetMaxSize(*args, **kwargs):
5b5c9bc7
RD
8053 """GetMaxSize(self) -> Size"""
8054 return _core_.Window_GetMaxSize(*args, **kwargs)
908b74cd
RD
8055
8056 def GetMinSize(*args, **kwargs):
5b5c9bc7
RD
8057 """GetMinSize(self) -> Size"""
8058 return _core_.Window_GetMinSize(*args, **kwargs)
908b74cd
RD
8059
8060 def SetMinSize(*args, **kwargs):
8061 """
5b5c9bc7 8062 SetMinSize(self, Size minSize)
908b74cd
RD
8063
8064 A more convenient method than `SetSizeHints` for setting just the
8065 min size.
8066 """
5b5c9bc7 8067 return _core_.Window_SetMinSize(*args, **kwargs)
908b74cd
RD
8068
8069 def SetMaxSize(*args, **kwargs):
8070 """
5b5c9bc7 8071 SetMaxSize(self, Size maxSize)
908b74cd
RD
8072
8073 A more convenient method than `SetSizeHints` for setting just the
8074 max size.
8075 """
5b5c9bc7 8076 return _core_.Window_SetMaxSize(*args, **kwargs)
908b74cd 8077
d55e5bfc
RD
8078 def GetMinWidth(*args, **kwargs):
8079 """GetMinWidth(self) -> int"""
5b5c9bc7 8080 return _core_.Window_GetMinWidth(*args, **kwargs)
d55e5bfc
RD
8081
8082 def GetMinHeight(*args, **kwargs):
8083 """GetMinHeight(self) -> int"""
5b5c9bc7 8084 return _core_.Window_GetMinHeight(*args, **kwargs)
d55e5bfc
RD
8085
8086 def GetMaxWidth(*args, **kwargs):
8087 """GetMaxWidth(self) -> int"""
5b5c9bc7 8088 return _core_.Window_GetMaxWidth(*args, **kwargs)
d55e5bfc
RD
8089
8090 def GetMaxHeight(*args, **kwargs):
8091 """GetMaxHeight(self) -> int"""
5b5c9bc7 8092 return _core_.Window_GetMaxHeight(*args, **kwargs)
d55e5bfc 8093
d55e5bfc
RD
8094 def SetVirtualSize(*args, **kwargs):
8095 """
5b5c9bc7 8096 SetVirtualSize(self, Size size)
d55e5bfc
RD
8097
8098 Set the the virtual size of a window in pixels. For most windows this
8099 is just the client area of the window, but for some like scrolled
8100 windows it is more or less independent of the screen window size.
8101 """
5b5c9bc7 8102 return _core_.Window_SetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8103
8104 def SetVirtualSizeWH(*args, **kwargs):
8105 """
8106 SetVirtualSizeWH(self, int w, int h)
8107
8108 Set the the virtual size of a window in pixels. For most windows this
8109 is just the client area of the window, but for some like scrolled
8110 windows it is more or less independent of the screen window size.
8111 """
5b5c9bc7 8112 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
d55e5bfc
RD
8113
8114 def GetVirtualSize(*args, **kwargs):
8115 """
5b5c9bc7 8116 GetVirtualSize(self) -> Size
d55e5bfc
RD
8117
8118 Get the the virtual size of the window in pixels. For most windows
8119 this is just the client area of the window, but for some like scrolled
8120 windows it is more or less independent of the screen window size.
8121 """
5b5c9bc7 8122 return _core_.Window_GetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8123
8124 def GetVirtualSizeTuple(*args, **kwargs):
8125 """
8126 GetVirtualSizeTuple() -> (width, height)
8127
8128 Get the the virtual size of the window in pixels. For most windows
8129 this is just the client area of the window, but for some like scrolled
8130 windows it is more or less independent of the screen window size.
8131 """
5b5c9bc7 8132 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
d55e5bfc
RD
8133
8134 def GetBestVirtualSize(*args, **kwargs):
8135 """
5b5c9bc7 8136 GetBestVirtualSize(self) -> Size
d55e5bfc
RD
8137
8138 Return the largest of ClientSize and BestSize (as determined by a
8139 sizer, interior children, or other means)
8140 """
5b5c9bc7 8141 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
d55e5bfc
RD
8142
8143 def Show(*args, **kwargs):
8144 """
8145 Show(self, bool show=True) -> bool
8146
8147 Shows or hides the window. You may need to call Raise for a top level
8148 window if you want to bring it to top, although this is not needed if
8149 Show is called immediately after the frame creation. Returns True if
8150 the window has been shown or hidden or False if nothing was done
8151 because it already was in the requested state.
8152 """
5b5c9bc7 8153 return _core_.Window_Show(*args, **kwargs)
d55e5bfc
RD
8154
8155 def Hide(*args, **kwargs):
8156 """
8157 Hide(self) -> bool
8158
8159 Equivalent to calling Show(False).
8160 """
5b5c9bc7 8161 return _core_.Window_Hide(*args, **kwargs)
d55e5bfc
RD
8162
8163 def Enable(*args, **kwargs):
8164 """
8165 Enable(self, bool enable=True) -> bool
8166
8167 Enable or disable the window for user input. Note that when a parent
8168 window is disabled, all of its children are disabled as well and they
8169 are reenabled again when the parent is. Returns true if the window
8170 has been enabled or disabled, false if nothing was done, i.e. if the
8171 window had already been in the specified state.
8172 """
5b5c9bc7 8173 return _core_.Window_Enable(*args, **kwargs)
d55e5bfc
RD
8174
8175 def Disable(*args, **kwargs):
8176 """
8177 Disable(self) -> bool
8178
8179 Disables the window, same as Enable(false).
8180 """
5b5c9bc7 8181 return _core_.Window_Disable(*args, **kwargs)
d55e5bfc
RD
8182
8183 def IsShown(*args, **kwargs):
8184 """
8185 IsShown(self) -> bool
8186
8187 Returns true if the window is shown, false if it has been hidden.
8188 """
5b5c9bc7 8189 return _core_.Window_IsShown(*args, **kwargs)
d55e5bfc
RD
8190
8191 def IsEnabled(*args, **kwargs):
8192 """
8193 IsEnabled(self) -> bool
8194
8195 Returns true if the window is enabled for input, false otherwise.
8196 """
5b5c9bc7 8197 return _core_.Window_IsEnabled(*args, **kwargs)
d55e5bfc
RD
8198
8199 def SetWindowStyleFlag(*args, **kwargs):
8200 """
8201 SetWindowStyleFlag(self, long style)
8202
15817c7e
RD
8203 Sets the style of the window. Please note that some styles cannot be
8204 changed after the window creation and that Refresh() might need to be
8205 called after changing the others for the change to take place
8206 immediately.
d55e5bfc 8207 """
5b5c9bc7 8208 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8209
8210 def GetWindowStyleFlag(*args, **kwargs):
8211 """
8212 GetWindowStyleFlag(self) -> long
8213
8214 Gets the window style that was passed to the constructor or Create
8215 method.
8216 """
5b5c9bc7 8217 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8218
8219 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8220 def HasFlag(*args, **kwargs):
8221 """
8222 HasFlag(self, int flag) -> bool
8223
8224 Test if the given style is set for this window.
8225 """
5b5c9bc7 8226 return _core_.Window_HasFlag(*args, **kwargs)
d55e5bfc
RD
8227
8228 def IsRetained(*args, **kwargs):
8229 """
8230 IsRetained(self) -> bool
8231
8232 Returns true if the window is retained, false otherwise. Retained
8233 windows are only available on X platforms.
8234 """
5b5c9bc7 8235 return _core_.Window_IsRetained(*args, **kwargs)
d55e5bfc
RD
8236
8237 def SetExtraStyle(*args, **kwargs):
8238 """
8239 SetExtraStyle(self, long exStyle)
8240
8241 Sets the extra style bits for the window. Extra styles are the less
8242 often used style bits which can't be set with the constructor or with
8243 SetWindowStyleFlag()
8244 """
5b5c9bc7 8245 return _core_.Window_SetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8246
8247 def GetExtraStyle(*args, **kwargs):
8248 """
8249 GetExtraStyle(self) -> long
8250
8251 Returns the extra style bits for the window.
8252 """
5b5c9bc7 8253 return _core_.Window_GetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8254
8255 def MakeModal(*args, **kwargs):
8256 """
8257 MakeModal(self, bool modal=True)
8258
8259 Disables all other windows in the application so that the user can
8260 only interact with this window. Passing False will reverse this
8261 effect.
8262 """
5b5c9bc7 8263 return _core_.Window_MakeModal(*args, **kwargs)
d55e5bfc
RD
8264
8265 def SetThemeEnabled(*args, **kwargs):
8266 """
8267 SetThemeEnabled(self, bool enableTheme)
8268
8269 This function tells a window if it should use the system's "theme"
8270 code to draw the windows' background instead if its own background
8271 drawing code. This will only have an effect on platforms that support
8272 the notion of themes in user defined windows. One such platform is
8273 GTK+ where windows can have (very colourful) backgrounds defined by a
8274 user's selected theme.
8275
8276 Dialogs, notebook pages and the status bar have this flag set to true
8277 by default so that the default look and feel is simulated best.
8278 """
5b5c9bc7 8279 return _core_.Window_SetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8280
8281 def GetThemeEnabled(*args, **kwargs):
8282 """
8283 GetThemeEnabled(self) -> bool
8284
8285 Return the themeEnabled flag.
8286 """
5b5c9bc7 8287 return _core_.Window_GetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8288
8289 def SetFocus(*args, **kwargs):
8290 """
8291 SetFocus(self)
8292
8293 Set's the focus to this window, allowing it to receive keyboard input.
8294 """
5b5c9bc7 8295 return _core_.Window_SetFocus(*args, **kwargs)
d55e5bfc
RD
8296
8297 def SetFocusFromKbd(*args, **kwargs):
8298 """
8299 SetFocusFromKbd(self)
8300
8301 Set focus to this window as the result of a keyboard action. Normally
8302 only called internally.
8303 """
5b5c9bc7 8304 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
d55e5bfc
RD
8305
8306 def FindFocus(*args, **kwargs):
8307 """
5b5c9bc7 8308 FindFocus() -> Window
d55e5bfc
RD
8309
8310 Returns the window or control that currently has the keyboard focus,
8311 or None.
8312 """
5b5c9bc7 8313 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc
RD
8314
8315 FindFocus = staticmethod(FindFocus)
8316 def AcceptsFocus(*args, **kwargs):
8317 """
8318 AcceptsFocus(self) -> bool
8319
8320 Can this window have focus?
8321 """
5b5c9bc7 8322 return _core_.Window_AcceptsFocus(*args, **kwargs)
d55e5bfc
RD
8323
8324 def AcceptsFocusFromKeyboard(*args, **kwargs):
8325 """
8326 AcceptsFocusFromKeyboard(self) -> bool
8327
8328 Can this window be given focus by keyboard navigation? if not, the
8329 only way to give it focus (provided it accepts it at all) is to click
8330 it.
8331 """
5b5c9bc7 8332 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
d55e5bfc 8333
908b74cd
RD
8334 def Navigate(*args, **kwargs):
8335 """
8336 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8337
fd2dc343
RD
8338 Does keyboard navigation from this window to another, by sending a
8339 `wx.NavigationKeyEvent`.
908b74cd 8340 """
5b5c9bc7 8341 return _core_.Window_Navigate(*args, **kwargs)
908b74cd 8342
bf26d883
RD
8343 def MoveAfterInTabOrder(*args, **kwargs):
8344 """
5b5c9bc7 8345 MoveAfterInTabOrder(self, Window win)
bf26d883
RD
8346
8347 Moves this window in the tab navigation order after the specified
8348 sibling window. This means that when the user presses the TAB key on
8349 that other window, the focus switches to this window.
8350
8351 The default tab order is the same as creation order. This function
8352 and `MoveBeforeInTabOrder` allow to change it after creating all the
8353 windows.
8354
8355 """
5b5c9bc7 8356 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
bf26d883
RD
8357
8358 def MoveBeforeInTabOrder(*args, **kwargs):
8359 """
5b5c9bc7 8360 MoveBeforeInTabOrder(self, Window win)
bf26d883
RD
8361
8362 Same as `MoveAfterInTabOrder` except that it inserts this window just
8363 before win instead of putting it right after it.
8364 """
5b5c9bc7 8365 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
bf26d883 8366
d55e5bfc
RD
8367 def GetChildren(*args, **kwargs):
8368 """
8369 GetChildren(self) -> PyObject
8370
8371 Returns a list of the window's children. NOTE: Currently this is a
8372 copy of the child window list maintained by the window, so the return
8373 value of this function is only valid as long as the window's children
8374 do not change.
8375 """
5b5c9bc7 8376 return _core_.Window_GetChildren(*args, **kwargs)
d55e5bfc
RD
8377
8378 def GetParent(*args, **kwargs):
8379 """
5b5c9bc7 8380 GetParent(self) -> Window
d55e5bfc
RD
8381
8382 Returns the parent window of this window, or None if there isn't one.
8383 """
5b5c9bc7 8384 return _core_.Window_GetParent(*args, **kwargs)
d55e5bfc
RD
8385
8386 def GetGrandParent(*args, **kwargs):
8387 """
5b5c9bc7 8388 GetGrandParent(self) -> Window
d55e5bfc 8389
15817c7e
RD
8390 Returns the parent of the parent of this window, or None if there
8391 isn't one.
d55e5bfc 8392 """
5b5c9bc7 8393 return _core_.Window_GetGrandParent(*args, **kwargs)
d55e5bfc
RD
8394
8395 def IsTopLevel(*args, **kwargs):
8396 """
8397 IsTopLevel(self) -> bool
8398
8399 Returns true if the given window is a top-level one. Currently all
8400 frames and dialogs are always considered to be top-level windows (even
8401 if they have a parent window).
8402 """
5b5c9bc7 8403 return _core_.Window_IsTopLevel(*args, **kwargs)
d55e5bfc
RD
8404
8405 def Reparent(*args, **kwargs):
8406 """
5b5c9bc7 8407 Reparent(self, Window newParent) -> bool
d55e5bfc
RD
8408
8409 Reparents the window, i.e the window will be removed from its current
8410 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8411 re-inserted into another. Available on Windows and GTK. Returns True
8412 if the parent was changed, False otherwise (error or newParent ==
8413 oldParent)
8414 """
5b5c9bc7 8415 return _core_.Window_Reparent(*args, **kwargs)
d55e5bfc
RD
8416
8417 def AddChild(*args, **kwargs):
8418 """
5b5c9bc7 8419 AddChild(self, Window child)
d55e5bfc
RD
8420
8421 Adds a child window. This is called automatically by window creation
8422 functions so should not be required by the application programmer.
8423 """
5b5c9bc7 8424 return _core_.Window_AddChild(*args, **kwargs)
d55e5bfc
RD
8425
8426 def RemoveChild(*args, **kwargs):
8427 """
5b5c9bc7 8428 RemoveChild(self, Window child)
d55e5bfc
RD
8429
8430 Removes a child window. This is called automatically by window
8431 deletion functions so should not be required by the application
8432 programmer.
8433 """
5b5c9bc7 8434 return _core_.Window_RemoveChild(*args, **kwargs)
d55e5bfc 8435
704eda0c
RD
8436 def SetDoubleBuffered(*args, **kwargs):
8437 """
8438 SetDoubleBuffered(self, bool on)
8439
8440 Currently wxGTK2 only.
8441 """
8442 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8443
d55e5bfc
RD
8444 def FindWindowById(*args, **kwargs):
8445 """
5b5c9bc7 8446 FindWindowById(self, long winid) -> Window
d55e5bfc
RD
8447
8448 Find a chld of this window by window ID
8449 """
5b5c9bc7 8450 return _core_.Window_FindWindowById(*args, **kwargs)
d55e5bfc
RD
8451
8452 def FindWindowByName(*args, **kwargs):
8453 """
5b5c9bc7 8454 FindWindowByName(self, String name) -> Window
d55e5bfc
RD
8455
8456 Find a child of this window by name
8457 """
5b5c9bc7 8458 return _core_.Window_FindWindowByName(*args, **kwargs)
d55e5bfc
RD
8459
8460 def GetEventHandler(*args, **kwargs):
8461 """
5b5c9bc7 8462 GetEventHandler(self) -> EvtHandler
d55e5bfc
RD
8463
8464 Returns the event handler for this window. By default, the window is
8465 its own event handler.
8466 """
5b5c9bc7 8467 return _core_.Window_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
8468
8469 def SetEventHandler(*args, **kwargs):
8470 """
5b5c9bc7 8471 SetEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8472
8473 Sets the event handler for this window. An event handler is an object
8474 that is capable of processing the events sent to a window. By default,
8475 the window is its own event handler, but an application may wish to
8476 substitute another, for example to allow central implementation of
8477 event-handling for a variety of different window classes.
8478
15817c7e 8479 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
8480 up a chain of event handlers, where an event not handled by one event
8481 handler is handed to the next one in the chain.
8482 """
5b5c9bc7 8483 return _core_.Window_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
8484
8485 def PushEventHandler(*args, **kwargs):
8486 """
5b5c9bc7 8487 PushEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8488
8489 Pushes this event handler onto the event handler stack for the window.
8490 An event handler is an object that is capable of processing the events
8491 sent to a window. By default, the window is its own event handler, but
8492 an application may wish to substitute another, for example to allow
8493 central implementation of event-handling for a variety of different
8494 window classes.
8495
8496 wx.Window.PushEventHandler allows an application to set up a chain of
8497 event handlers, where an event not handled by one event handler is
15817c7e 8498 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
8499 remove the event handler.
8500 """
5b5c9bc7 8501 return _core_.Window_PushEventHandler(*args, **kwargs)
d55e5bfc
RD
8502
8503 def PopEventHandler(*args, **kwargs):
8504 """
5b5c9bc7 8505 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
d55e5bfc
RD
8506
8507 Removes and returns the top-most event handler on the event handler
8508 stack. If deleteHandler is True then the wx.EvtHandler object will be
8509 destroyed after it is popped.
8510 """
5b5c9bc7 8511 return _core_.Window_PopEventHandler(*args, **kwargs)
d55e5bfc
RD
8512
8513 def RemoveEventHandler(*args, **kwargs):
8514 """
5b5c9bc7 8515 RemoveEventHandler(self, EvtHandler handler) -> bool
d55e5bfc 8516
15817c7e
RD
8517 Find the given handler in the event handler chain and remove (but not
8518 delete) it from the event handler chain, return True if it was found
8519 and False otherwise (this also results in an assert failure so this
8520 function should only be called when the handler is supposed to be
8521 there.)
d55e5bfc 8522 """
5b5c9bc7 8523 return _core_.Window_RemoveEventHandler(*args, **kwargs)
d55e5bfc
RD
8524
8525 def SetValidator(*args, **kwargs):
8526 """
5b5c9bc7 8527 SetValidator(self, Validator validator)
d55e5bfc
RD
8528
8529 Deletes the current validator (if any) and sets the window validator,
8530 having called wx.Validator.Clone to create a new validator of this
8531 type.
8532 """
5b5c9bc7 8533 return _core_.Window_SetValidator(*args, **kwargs)
d55e5bfc
RD
8534
8535 def GetValidator(*args, **kwargs):
8536 """
5b5c9bc7 8537 GetValidator(self) -> Validator
d55e5bfc
RD
8538
8539 Returns a pointer to the current validator for the window, or None if
8540 there is none.
8541 """
5b5c9bc7 8542 return _core_.Window_GetValidator(*args, **kwargs)
d55e5bfc
RD
8543
8544 def Validate(*args, **kwargs):
8545 """
8546 Validate(self) -> bool
8547
8548 Validates the current values of the child controls using their
15817c7e
RD
8549 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8550 style flag set, the method will also call Validate() of all child
8551 windows. Returns false if any of the validations failed.
d55e5bfc 8552 """
5b5c9bc7 8553 return _core_.Window_Validate(*args, **kwargs)
d55e5bfc
RD
8554
8555 def TransferDataToWindow(*args, **kwargs):
8556 """
8557 TransferDataToWindow(self) -> bool
8558
15817c7e
RD
8559 Transfers values to child controls from data areas specified by their
8560 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8561 style flag set, the method will also call TransferDataToWindow() of
8562 all child windows.
d55e5bfc 8563 """
5b5c9bc7 8564 return _core_.Window_TransferDataToWindow(*args, **kwargs)
d55e5bfc
RD
8565
8566 def TransferDataFromWindow(*args, **kwargs):
8567 """
8568 TransferDataFromWindow(self) -> bool
8569
15817c7e
RD
8570 Transfers values from child controls to data areas specified by their
8571 validators. Returns false if a transfer failed. If the window has
8572 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8573 also call TransferDataFromWindow() of all child windows.
d55e5bfc 8574 """
5b5c9bc7 8575 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
d55e5bfc
RD
8576
8577 def InitDialog(*args, **kwargs):
8578 """
8579 InitDialog(self)
8580
15817c7e
RD
8581 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8582 to the dialog via validators.
d55e5bfc 8583 """
5b5c9bc7 8584 return _core_.Window_InitDialog(*args, **kwargs)
d55e5bfc
RD
8585
8586 def SetAcceleratorTable(*args, **kwargs):
8587 """
5b5c9bc7 8588 SetAcceleratorTable(self, AcceleratorTable accel)
d55e5bfc
RD
8589
8590 Sets the accelerator table for this window.
8591 """
5b5c9bc7 8592 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
8593
8594 def GetAcceleratorTable(*args, **kwargs):
8595 """
5b5c9bc7 8596 GetAcceleratorTable(self) -> AcceleratorTable
d55e5bfc
RD
8597
8598 Gets the accelerator table for this window.
8599 """
5b5c9bc7 8600 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
8601
8602 def RegisterHotKey(*args, **kwargs):
8603 """
8604 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8605
8606 Registers a system wide hotkey. Every time the user presses the hotkey
8607 registered here, this window will receive a hotkey event. It will
8608 receive the event even if the application is in the background and
8609 does not have the input focus because the user is working with some
8610 other application. To bind an event handler function to this hotkey
8611 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8612 hotkey was registered successfully.
8613 """
5b5c9bc7 8614 return _core_.Window_RegisterHotKey(*args, **kwargs)
d55e5bfc
RD
8615
8616 def UnregisterHotKey(*args, **kwargs):
8617 """
8618 UnregisterHotKey(self, int hotkeyId) -> bool
8619
8620 Unregisters a system wide hotkey.
8621 """
5b5c9bc7 8622 return _core_.Window_UnregisterHotKey(*args, **kwargs)
d55e5bfc
RD
8623
8624 def ConvertDialogPointToPixels(*args, **kwargs):
8625 """
5b5c9bc7 8626 ConvertDialogPointToPixels(self, Point pt) -> Point
d55e5bfc
RD
8627
8628 Converts a point or size from dialog units to pixels. Dialog units
8629 are used for maintaining a dialog's proportions even if the font
8630 changes. For the x dimension, the dialog units are multiplied by the
8631 average character width and then divided by 4. For the y dimension,
8632 the dialog units are multiplied by the average character height and
8633 then divided by 8.
8634 """
5b5c9bc7 8635 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
d55e5bfc
RD
8636
8637 def ConvertDialogSizeToPixels(*args, **kwargs):
8638 """
5b5c9bc7 8639 ConvertDialogSizeToPixels(self, Size sz) -> Size
d55e5bfc
RD
8640
8641 Converts a point or size from dialog units to pixels. Dialog units
8642 are used for maintaining a dialog's proportions even if the font
8643 changes. For the x dimension, the dialog units are multiplied by the
8644 average character width and then divided by 4. For the y dimension,
8645 the dialog units are multiplied by the average character height and
8646 then divided by 8.
8647 """
5b5c9bc7 8648 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
d55e5bfc
RD
8649
8650 def DLG_PNT(*args, **kwargs):
8651 """
5b5c9bc7 8652 DLG_PNT(self, Point pt) -> Point
d55e5bfc
RD
8653
8654 Converts a point or size from dialog units to pixels. Dialog units
8655 are used for maintaining a dialog's proportions even if the font
8656 changes. For the x dimension, the dialog units are multiplied by the
8657 average character width and then divided by 4. For the y dimension,
8658 the dialog units are multiplied by the average character height and
8659 then divided by 8.
8660 """
5b5c9bc7 8661 return _core_.Window_DLG_PNT(*args, **kwargs)
d55e5bfc
RD
8662
8663 def DLG_SZE(*args, **kwargs):
8664 """
5b5c9bc7 8665 DLG_SZE(self, Size sz) -> Size
d55e5bfc
RD
8666
8667 Converts a point or size from dialog units to pixels. Dialog units
8668 are used for maintaining a dialog's proportions even if the font
8669 changes. For the x dimension, the dialog units are multiplied by the
8670 average character width and then divided by 4. For the y dimension,
8671 the dialog units are multiplied by the average character height and
8672 then divided by 8.
8673 """
5b5c9bc7 8674 return _core_.Window_DLG_SZE(*args, **kwargs)
d55e5bfc
RD
8675
8676 def ConvertPixelPointToDialog(*args, **kwargs):
5b5c9bc7
RD
8677 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8678 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
d55e5bfc
RD
8679
8680 def ConvertPixelSizeToDialog(*args, **kwargs):
5b5c9bc7
RD
8681 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8682 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
d55e5bfc
RD
8683
8684 def WarpPointer(*args, **kwargs):
8685 """
8686 WarpPointer(self, int x, int y)
8687
8688 Moves the pointer to the given position on the window.
8689
8690 NOTE: This function is not supported under Mac because Apple Human
8691 Interface Guidelines forbid moving the mouse cursor programmatically.
8692 """
5b5c9bc7 8693 return _core_.Window_WarpPointer(*args, **kwargs)
d55e5bfc
RD
8694
8695 def CaptureMouse(*args, **kwargs):
8696 """
8697 CaptureMouse(self)
8698
8699 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8700 release the capture.
8701
8702 Note that wxWindows maintains the stack of windows having captured the
8703 mouse and when the mouse is released the capture returns to the window
8704 which had had captured it previously and it is only really released if
8705 there were no previous window. In particular, this means that you must
34e0a3bb
RD
8706 release the mouse as many times as you capture it, unless the window
8707 receives the `wx.MouseCaptureLostEvent` event.
8708
8709 Any application which captures the mouse in the beginning of some
8710 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
8711 operation when it receives the event. The event handler must not
8712 recapture mouse.
d55e5bfc 8713 """
5b5c9bc7 8714 return _core_.Window_CaptureMouse(*args, **kwargs)
d55e5bfc
RD
8715
8716 def ReleaseMouse(*args, **kwargs):
8717 """
8718 ReleaseMouse(self)
8719
8720 Releases mouse input captured with wx.Window.CaptureMouse.
8721 """
5b5c9bc7 8722 return _core_.Window_ReleaseMouse(*args, **kwargs)
d55e5bfc
RD
8723
8724 def GetCapture(*args, **kwargs):
8725 """
5b5c9bc7 8726 GetCapture() -> Window
d55e5bfc
RD
8727
8728 Returns the window which currently captures the mouse or None
8729 """
5b5c9bc7 8730 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc
RD
8731
8732 GetCapture = staticmethod(GetCapture)
8733 def HasCapture(*args, **kwargs):
8734 """
8735 HasCapture(self) -> bool
8736
8737 Returns true if this window has the current mouse capture.
8738 """
5b5c9bc7 8739 return _core_.Window_HasCapture(*args, **kwargs)
d55e5bfc
RD
8740
8741 def Refresh(*args, **kwargs):
8742 """
5b5c9bc7 8743 Refresh(self, bool eraseBackground=True, Rect rect=None)
d55e5bfc
RD
8744
8745 Mark the specified rectangle (or the whole window) as "dirty" so it
8746 will be repainted. Causes an EVT_PAINT event to be generated and sent
8747 to the window.
8748 """
5b5c9bc7 8749 return _core_.Window_Refresh(*args, **kwargs)
d55e5bfc
RD
8750
8751 def RefreshRect(*args, **kwargs):
8752 """
5b5c9bc7 8753 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
8754
8755 Redraws the contents of the given rectangle: the area inside it will
8756 be repainted. This is the same as Refresh but has a nicer syntax.
8757 """
5b5c9bc7 8758 return _core_.Window_RefreshRect(*args, **kwargs)
d55e5bfc
RD
8759
8760 def Update(*args, **kwargs):
8761 """
8762 Update(self)
8763
8764 Calling this method immediately repaints the invalidated area of the
8765 window instead of waiting for the EVT_PAINT event to happen, (normally
8766 this would usually only happen when the flow of control returns to the
8767 event loop.) Notice that this function doesn't refresh the window and
8768 does nothing if the window has been already repainted. Use Refresh
8769 first if you want to immediately redraw the window (or some portion of
8770 it) unconditionally.
8771 """
5b5c9bc7 8772 return _core_.Window_Update(*args, **kwargs)
d55e5bfc
RD
8773
8774 def ClearBackground(*args, **kwargs):
8775 """
8776 ClearBackground(self)
8777
8778 Clears the window by filling it with the current background
8779 colour. Does not cause an erase background event to be generated.
8780 """
5b5c9bc7 8781 return _core_.Window_ClearBackground(*args, **kwargs)
d55e5bfc
RD
8782
8783 def Freeze(*args, **kwargs):
8784 """
8785 Freeze(self)
8786
15817c7e
RD
8787 Freezes the window or, in other words, prevents any updates from
8788 taking place on screen, the window is not redrawn at all. Thaw must be
8789 called to reenable window redrawing. Calls to Freeze/Thaw may be
8790 nested, with the actual Thaw being delayed until all the nesting has
8791 been undone.
d55e5bfc
RD
8792
8793 This method is useful for visual appearance optimization (for example,
8794 it is a good idea to use it before inserting large amount of text into
8795 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8796 for all controls so it is mostly just a hint to wxWindows and not a
8797 mandatory directive.
8798 """
5b5c9bc7 8799 return _core_.Window_Freeze(*args, **kwargs)
d55e5bfc
RD
8800
8801 def Thaw(*args, **kwargs):
8802 """
8803 Thaw(self)
8804
8805 Reenables window updating after a previous call to Freeze. Calls to
15817c7e
RD
8806 Freeze/Thaw may be nested, so Thaw must be called the same number of
8807 times that Freeze was before the window will be updated.
d55e5bfc 8808 """
5b5c9bc7 8809 return _core_.Window_Thaw(*args, **kwargs)
d55e5bfc
RD
8810
8811 def PrepareDC(*args, **kwargs):
8812 """
5b5c9bc7 8813 PrepareDC(self, DC dc)
d55e5bfc
RD
8814
8815 Call this function to prepare the device context for drawing a
8816 scrolled image. It sets the device origin according to the current
8817 scroll position.
8818 """
5b5c9bc7 8819 return _core_.Window_PrepareDC(*args, **kwargs)
d55e5bfc
RD
8820
8821 def GetUpdateRegion(*args, **kwargs):
8822 """
5b5c9bc7 8823 GetUpdateRegion(self) -> Region
d55e5bfc
RD
8824
8825 Returns the region specifying which parts of the window have been
8826 damaged. Should only be called within an EVT_PAINT handler.
8827 """
5b5c9bc7 8828 return _core_.Window_GetUpdateRegion(*args, **kwargs)
d55e5bfc
RD
8829
8830 def GetUpdateClientRect(*args, **kwargs):
8831 """
5b5c9bc7 8832 GetUpdateClientRect(self) -> Rect
d55e5bfc
RD
8833
8834 Get the update rectangle region bounding box in client coords.
8835 """
5b5c9bc7 8836 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
d55e5bfc
RD
8837
8838 def IsExposed(*args, **kwargs):
8839 """
8840 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8841
8842 Returns true if the given point or rectangle area has been exposed
8843 since the last repaint. Call this in an paint event handler to
8844 optimize redrawing by only redrawing those areas, which have been
8845 exposed.
8846 """
5b5c9bc7 8847 return _core_.Window_IsExposed(*args, **kwargs)
d55e5bfc
RD
8848
8849 def IsExposedPoint(*args, **kwargs):
8850 """
5b5c9bc7 8851 IsExposedPoint(self, Point pt) -> bool
d55e5bfc
RD
8852
8853 Returns true if the given point or rectangle area has been exposed
8854 since the last repaint. Call this in an paint event handler to
8855 optimize redrawing by only redrawing those areas, which have been
8856 exposed.
8857 """
5b5c9bc7 8858 return _core_.Window_IsExposedPoint(*args, **kwargs)
d55e5bfc
RD
8859
8860 def IsExposedRect(*args, **kwargs):
8861 """
5b5c9bc7 8862 IsExposedRect(self, Rect rect) -> bool
d55e5bfc
RD
8863
8864 Returns true if the given point or rectangle area has been exposed
8865 since the last repaint. Call this in an paint event handler to
8866 optimize redrawing by only redrawing those areas, which have been
8867 exposed.
8868 """
5b5c9bc7 8869 return _core_.Window_IsExposedRect(*args, **kwargs)
d55e5bfc
RD
8870
8871 def GetDefaultAttributes(*args, **kwargs):
8872 """
5b5c9bc7 8873 GetDefaultAttributes(self) -> VisualAttributes
d55e5bfc 8874
15817c7e
RD
8875 Get the default attributes for an instance of this class. This is
8876 useful if you want to use the same font or colour in your own control
8877 as in a standard control -- which is a much better idea than hard
8878 coding specific colours or fonts which might look completely out of
a5ee0656 8879 place on the user's system, especially if it uses themes.
d55e5bfc 8880 """
5b5c9bc7 8881 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
8882
8883 def GetClassDefaultAttributes(*args, **kwargs):
8884 """
5b5c9bc7 8885 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 8886
15817c7e
RD
8887 Get the default attributes for this class. This is useful if you want
8888 to use the same font or colour in your own control as in a standard
8889 control -- which is a much better idea than hard coding specific
a5ee0656
RD
8890 colours or fonts which might look completely out of place on the
8891 user's system, especially if it uses themes.
d55e5bfc
RD
8892
8893 The variant parameter is only relevant under Mac currently and is
15817c7e 8894 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
8895 the returned font. See `wx.Window.SetWindowVariant` for more about
8896 this.
d55e5bfc 8897 """
5b5c9bc7 8898 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
8899
8900 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8901 def SetBackgroundColour(*args, **kwargs):
8902 """
5b5c9bc7 8903 SetBackgroundColour(self, Colour colour) -> bool
d55e5bfc
RD
8904
8905 Sets the background colour of the window. Returns True if the colour
8906 was changed. The background colour is usually painted by the default
8907 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
8908 automatically under GTK. Using `wx.NullColour` will reset the window
8909 to the default background colour.
d55e5bfc 8910
a5ee0656 8911 Note that setting the background colour may not cause an immediate
f8167d6e 8912 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
8913 calling this function.
8914
f8167d6e
RD
8915 Using this function will disable attempts to use themes for this
8916 window, if the system supports them. Use with care since usually the
8917 themes represent the appearance chosen by the user to be used for all
8918 applications on the system.
d55e5bfc 8919 """
5b5c9bc7 8920 return _core_.Window_SetBackgroundColour(*args, **kwargs)
d55e5bfc 8921
412d302d 8922 def SetOwnBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
8923 """SetOwnBackgroundColour(self, Colour colour)"""
8924 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
8925
8926 def SetForegroundColour(*args, **kwargs):
8927 """
5b5c9bc7 8928 SetForegroundColour(self, Colour colour) -> bool
d55e5bfc
RD
8929
8930 Sets the foreground colour of the window. Returns True is the colour
8931 was changed. The interpretation of foreground colour is dependent on
8932 the window class; it may be the text colour or other colour, or it may
8933 not be used at all.
8934 """
5b5c9bc7 8935 return _core_.Window_SetForegroundColour(*args, **kwargs)
d55e5bfc 8936
fa47d7a7 8937 def SetOwnForegroundColour(*args, **kwargs):
5b5c9bc7
RD
8938 """SetOwnForegroundColour(self, Colour colour)"""
8939 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
8940
8941 def GetBackgroundColour(*args, **kwargs):
8942 """
5b5c9bc7 8943 GetBackgroundColour(self) -> Colour
d55e5bfc
RD
8944
8945 Returns the background colour of the window.
8946 """
5b5c9bc7 8947 return _core_.Window_GetBackgroundColour(*args, **kwargs)
d55e5bfc
RD
8948
8949 def GetForegroundColour(*args, **kwargs):
8950 """
5b5c9bc7 8951 GetForegroundColour(self) -> Colour
d55e5bfc
RD
8952
8953 Returns the foreground colour of the window. The interpretation of
8954 foreground colour is dependent on the window class; it may be the text
8955 colour or other colour, or it may not be used at all.
8956 """
5b5c9bc7 8957 return _core_.Window_GetForegroundColour(*args, **kwargs)
d55e5bfc 8958
dcb8fc74
RD
8959 def InheritsBackgroundColour(*args, **kwargs):
8960 """InheritsBackgroundColour(self) -> bool"""
5b5c9bc7 8961 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
dcb8fc74
RD
8962
8963 def UseBgCol(*args, **kwargs):
8964 """UseBgCol(self) -> bool"""
5b5c9bc7 8965 return _core_.Window_UseBgCol(*args, **kwargs)
dcb8fc74 8966
0f63ec68
RD
8967 def SetBackgroundStyle(*args, **kwargs):
8968 """
8969 SetBackgroundStyle(self, int style) -> bool
8970
8971 Returns the background style of the window. The background style
8972 indicates how the background of the window is drawn.
8973
8974 ====================== ========================================
8975 wx.BG_STYLE_SYSTEM The background colour or pattern should
8976 be determined by the system
8977 wx.BG_STYLE_COLOUR The background should be a solid colour
8978 wx.BG_STYLE_CUSTOM The background will be implemented by the
8979 application.
8980 ====================== ========================================
8981
8982 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8983 a custom background, such as a tiled bitmap. Currently the style has
8984 no effect on other platforms.
8985
8986 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8987 """
5b5c9bc7 8988 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
0f63ec68
RD
8989
8990 def GetBackgroundStyle(*args, **kwargs):
8991 """
8992 GetBackgroundStyle(self) -> int
8993
8994 Returns the background style of the window.
8995
8996 :see: `SetBackgroundStyle`
8997 """
5b5c9bc7 8998 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
0f63ec68 8999
51b83b37
RD
9000 def HasTransparentBackground(*args, **kwargs):
9001 """
9002 HasTransparentBackground(self) -> bool
9003
9004 Returns True if this window's background is transparent (as, for
9005 example, for `wx.StaticText`) and should show the parent window's
9006 background.
9007
9008 This method is mostly used internally by the library itself and you
9009 normally shouldn't have to call it. You may, however, have to override
9010 it in your custom control classes to ensure that background is painted
9011 correctly.
9012 """
5b5c9bc7 9013 return _core_.Window_HasTransparentBackground(*args, **kwargs)
51b83b37 9014
d55e5bfc
RD
9015 def SetCursor(*args, **kwargs):
9016 """
5b5c9bc7 9017 SetCursor(self, Cursor cursor) -> bool
d55e5bfc
RD
9018
9019 Sets the window's cursor. Notice that the window cursor also sets it
9020 for the children of the window implicitly.
9021
9022 The cursor may be wx.NullCursor in which case the window cursor will
9023 be reset back to default.
9024 """
5b5c9bc7 9025 return _core_.Window_SetCursor(*args, **kwargs)
d55e5bfc
RD
9026
9027 def GetCursor(*args, **kwargs):
9028 """
5b5c9bc7 9029 GetCursor(self) -> Cursor
d55e5bfc
RD
9030
9031 Return the cursor associated with this window.
9032 """
5b5c9bc7 9033 return _core_.Window_GetCursor(*args, **kwargs)
d55e5bfc
RD
9034
9035 def SetFont(*args, **kwargs):
9036 """
5b5c9bc7 9037 SetFont(self, Font font) -> bool
d55e5bfc
RD
9038
9039 Sets the font for this window.
9040 """
5b5c9bc7 9041 return _core_.Window_SetFont(*args, **kwargs)
d55e5bfc 9042
fa47d7a7 9043 def SetOwnFont(*args, **kwargs):
5b5c9bc7
RD
9044 """SetOwnFont(self, Font font)"""
9045 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9046
9047 def GetFont(*args, **kwargs):
9048 """
5b5c9bc7 9049 GetFont(self) -> Font
d55e5bfc
RD
9050
9051 Returns the default font used for this window.
9052 """
5b5c9bc7 9053 return _core_.Window_GetFont(*args, **kwargs)
d55e5bfc
RD
9054
9055 def SetCaret(*args, **kwargs):
9056 """
5b5c9bc7 9057 SetCaret(self, Caret caret)
d55e5bfc
RD
9058
9059 Sets the caret associated with the window.
9060 """
5b5c9bc7 9061 return _core_.Window_SetCaret(*args, **kwargs)
d55e5bfc
RD
9062
9063 def GetCaret(*args, **kwargs):
9064 """
5b5c9bc7 9065 GetCaret(self) -> Caret
d55e5bfc
RD
9066
9067 Returns the caret associated with the window.
9068 """
5b5c9bc7 9069 return _core_.Window_GetCaret(*args, **kwargs)
d55e5bfc
RD
9070
9071 def GetCharHeight(*args, **kwargs):
9072 """
9073 GetCharHeight(self) -> int
9074
9075 Get the (average) character size for the current font.
9076 """
5b5c9bc7 9077 return _core_.Window_GetCharHeight(*args, **kwargs)
d55e5bfc
RD
9078
9079 def GetCharWidth(*args, **kwargs):
9080 """
9081 GetCharWidth(self) -> int
9082
9083 Get the (average) character size for the current font.
9084 """
5b5c9bc7 9085 return _core_.Window_GetCharWidth(*args, **kwargs)
d55e5bfc
RD
9086
9087 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9088 """
9089 GetTextExtent(String string) -> (width, height)
9090
9091 Get the width and height of the text using the current font.
9092 """
5b5c9bc7 9093 return _core_.Window_GetTextExtent(*args, **kwargs)
d55e5bfc
RD
9094
9095 def GetFullTextExtent(*args, **kwargs):
9096 """
9097 GetFullTextExtent(String string, Font font=None) ->
9098 (width, height, descent, externalLeading)
9099
9100 Get the width, height, decent and leading of the text using the
9101 current or specified font.
9102 """
5b5c9bc7 9103 return _core_.Window_GetFullTextExtent(*args, **kwargs)
d55e5bfc
RD
9104
9105 def ClientToScreenXY(*args, **kwargs):
9106 """
9107 ClientToScreenXY(int x, int y) -> (x,y)
9108
9109 Converts to screen coordinates from coordinates relative to this window.
9110 """
5b5c9bc7 9111 return _core_.Window_ClientToScreenXY(*args, **kwargs)
d55e5bfc
RD
9112
9113 def ScreenToClientXY(*args, **kwargs):
9114 """
9115 ScreenToClientXY(int x, int y) -> (x,y)
9116
9117 Converts from screen to client window coordinates.
9118 """
5b5c9bc7 9119 return _core_.Window_ScreenToClientXY(*args, **kwargs)
d55e5bfc
RD
9120
9121 def ClientToScreen(*args, **kwargs):
9122 """
5b5c9bc7 9123 ClientToScreen(self, Point pt) -> Point
d55e5bfc
RD
9124
9125 Converts to screen coordinates from coordinates relative to this window.
9126 """
5b5c9bc7 9127 return _core_.Window_ClientToScreen(*args, **kwargs)
d55e5bfc
RD
9128
9129 def ScreenToClient(*args, **kwargs):
9130 """
5b5c9bc7 9131 ScreenToClient(self, Point pt) -> Point
d55e5bfc
RD
9132
9133 Converts from screen to client window coordinates.
9134 """
5b5c9bc7 9135 return _core_.Window_ScreenToClient(*args, **kwargs)
d55e5bfc
RD
9136
9137 def HitTestXY(*args, **kwargs):
9138 """
9139 HitTestXY(self, int x, int y) -> int
9140
9141 Test where the given (in client coords) point lies
9142 """
5b5c9bc7 9143 return _core_.Window_HitTestXY(*args, **kwargs)
d55e5bfc
RD
9144
9145 def HitTest(*args, **kwargs):
9146 """
5b5c9bc7 9147 HitTest(self, Point pt) -> int
d55e5bfc
RD
9148
9149 Test where the given (in client coords) point lies
9150 """
5b5c9bc7 9151 return _core_.Window_HitTest(*args, **kwargs)
d55e5bfc
RD
9152
9153 def GetBorder(*args):
9154 """
9155 GetBorder(self, long flags) -> int
9156 GetBorder(self) -> int
9157
9158 Get border for the flags of this window
9159 """
5b5c9bc7 9160 return _core_.Window_GetBorder(*args)
d55e5bfc
RD
9161
9162 def UpdateWindowUI(*args, **kwargs):
9163 """
5b5c9bc7 9164 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
d55e5bfc
RD
9165
9166 This function sends EVT_UPDATE_UI events to the window. The particular
9167 implementation depends on the window; for example a wx.ToolBar will
9168 send an update UI event for each toolbar button, and a wx.Frame will
9169 send an update UI event for each menubar menu item. You can call this
9170 function from your application to ensure that your UI is up-to-date at
9171 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9172 concerned). This may be necessary if you have called
5ba5649b 9173 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9174 limit the overhead that wxWindows incurs by sending update UI events
9175 in idle time.
d55e5bfc 9176 """
5b5c9bc7 9177 return _core_.Window_UpdateWindowUI(*args, **kwargs)
d55e5bfc
RD
9178
9179 def PopupMenuXY(*args, **kwargs):
9180 """
5b5c9bc7 9181 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9182
b0503257
RD
9183 Pops up the given menu at the specified coordinates, relative to this window,
9184 and returns control when the user has dismissed the menu. If a menu item is
9185 selected, the corresponding menu event is generated and will be processed as
9186 usual. If the default position is given then the current position of the
9187 mouse cursor will be used.
d55e5bfc 9188 """
5b5c9bc7 9189 return _core_.Window_PopupMenuXY(*args, **kwargs)
d55e5bfc
RD
9190
9191 def PopupMenu(*args, **kwargs):
9192 """
5b5c9bc7 9193 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9194
b0503257
RD
9195 Pops up the given menu at the specified coordinates, relative to this window,
9196 and returns control when the user has dismissed the menu. If a menu item is
9197 selected, the corresponding menu event is generated and will be processed as
9198 usual. If the default position is given then the current position of the
9199 mouse cursor will be used.
d55e5bfc 9200 """
5b5c9bc7 9201 return _core_.Window_PopupMenu(*args, **kwargs)
d55e5bfc 9202
1eeb270e
RD
9203 def HasMultiplePages(*args, **kwargs):
9204 """HasMultiplePages(self) -> bool"""
9205 return _core_.Window_HasMultiplePages(*args, **kwargs)
9206
d55e5bfc
RD
9207 def GetHandle(*args, **kwargs):
9208 """
9209 GetHandle(self) -> long
9210
9211 Returns the platform-specific handle (as a long integer) of the
9212 physical window. Currently on wxMac it returns the handle of the
9213 toplevel parent of the window.
9214 """
5b5c9bc7 9215 return _core_.Window_GetHandle(*args, **kwargs)
d55e5bfc 9216
629e65c2
RD
9217 def AssociateHandle(*args, **kwargs):
9218 """
9219 AssociateHandle(self, long handle)
9220
9221 Associate the window with a new native handle
9222 """
5b5c9bc7 9223 return _core_.Window_AssociateHandle(*args, **kwargs)
629e65c2
RD
9224
9225 def DissociateHandle(*args, **kwargs):
9226 """
9227 DissociateHandle(self)
9228
9229 Dissociate the current native handle from the window
9230 """
5b5c9bc7 9231 return _core_.Window_DissociateHandle(*args, **kwargs)
629e65c2 9232
d55e5bfc
RD
9233 def HasScrollbar(*args, **kwargs):
9234 """
9235 HasScrollbar(self, int orient) -> bool
9236
9237 Does the window have the scrollbar for this orientation?
9238 """
5b5c9bc7 9239 return _core_.Window_HasScrollbar(*args, **kwargs)
d55e5bfc
RD
9240
9241 def SetScrollbar(*args, **kwargs):
9242 """
15817c7e 9243 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
9244 bool refresh=True)
9245
9246 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc 9247 """
5b5c9bc7 9248 return _core_.Window_SetScrollbar(*args, **kwargs)
d55e5bfc
RD
9249
9250 def SetScrollPos(*args, **kwargs):
9251 """
9252 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9253
9254 Sets the position of one of the built-in scrollbars.
9255 """
5b5c9bc7 9256 return _core_.Window_SetScrollPos(*args, **kwargs)
d55e5bfc
RD
9257
9258 def GetScrollPos(*args, **kwargs):
9259 """
9260 GetScrollPos(self, int orientation) -> int
9261
9262 Returns the built-in scrollbar position.
9263 """
5b5c9bc7 9264 return _core_.Window_GetScrollPos(*args, **kwargs)
d55e5bfc
RD
9265
9266 def GetScrollThumb(*args, **kwargs):
9267 """
9268 GetScrollThumb(self, int orientation) -> int
9269
9270 Returns the built-in scrollbar thumb size.
9271 """
5b5c9bc7 9272 return _core_.Window_GetScrollThumb(*args, **kwargs)
d55e5bfc
RD
9273
9274 def GetScrollRange(*args, **kwargs):
9275 """
9276 GetScrollRange(self, int orientation) -> int
9277
9278 Returns the built-in scrollbar range.
9279 """
5b5c9bc7 9280 return _core_.Window_GetScrollRange(*args, **kwargs)
d55e5bfc
RD
9281
9282 def ScrollWindow(*args, **kwargs):
9283 """
5b5c9bc7 9284 ScrollWindow(self, int dx, int dy, Rect rect=None)
d55e5bfc
RD
9285
9286 Physically scrolls the pixels in the window and move child windows
9287 accordingly. Use this function to optimise your scrolling
9288 implementations, to minimise the area that must be redrawn. Note that
9289 it is rarely required to call this function from a user program.
d55e5bfc 9290 """
5b5c9bc7 9291 return _core_.Window_ScrollWindow(*args, **kwargs)
d55e5bfc
RD
9292
9293 def ScrollLines(*args, **kwargs):
9294 """
9295 ScrollLines(self, int lines) -> bool
9296
9297 If the platform and window class supports it, scrolls the window by
9298 the given number of lines down, if lines is positive, or up if lines
9299 is negative. Returns True if the window was scrolled, False if it was
9300 already on top/bottom and nothing was done.
9301 """
5b5c9bc7 9302 return _core_.Window_ScrollLines(*args, **kwargs)
d55e5bfc
RD
9303
9304 def ScrollPages(*args, **kwargs):
9305 """
9306 ScrollPages(self, int pages) -> bool
9307
15817c7e 9308 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
9309 the given number of pages down, if pages is positive, or up if pages
9310 is negative. Returns True if the window was scrolled, False if it was
9311 already on top/bottom and nothing was done.
9312 """
5b5c9bc7 9313 return _core_.Window_ScrollPages(*args, **kwargs)
d55e5bfc
RD
9314
9315 def LineUp(*args, **kwargs):
9316 """
9317 LineUp(self) -> bool
9318
9319 This is just a wrapper for ScrollLines(-1).
9320 """
5b5c9bc7 9321 return _core_.Window_LineUp(*args, **kwargs)
d55e5bfc
RD
9322
9323 def LineDown(*args, **kwargs):
9324 """
9325 LineDown(self) -> bool
9326
9327 This is just a wrapper for ScrollLines(1).
9328 """
5b5c9bc7 9329 return _core_.Window_LineDown(*args, **kwargs)
d55e5bfc
RD
9330
9331 def PageUp(*args, **kwargs):
9332 """
9333 PageUp(self) -> bool
9334
9335 This is just a wrapper for ScrollPages(-1).
9336 """
5b5c9bc7 9337 return _core_.Window_PageUp(*args, **kwargs)
d55e5bfc
RD
9338
9339 def PageDown(*args, **kwargs):
9340 """
9341 PageDown(self) -> bool
9342
9343 This is just a wrapper for ScrollPages(1).
9344 """
5b5c9bc7 9345 return _core_.Window_PageDown(*args, **kwargs)
d55e5bfc
RD
9346
9347 def SetHelpText(*args, **kwargs):
9348 """
5b5c9bc7 9349 SetHelpText(self, String text)
d55e5bfc
RD
9350
9351 Sets the help text to be used as context-sensitive help for this
9352 window. Note that the text is actually stored by the current
f52cbe90 9353 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 9354 """
5b5c9bc7 9355 return _core_.Window_SetHelpText(*args, **kwargs)
d55e5bfc
RD
9356
9357 def SetHelpTextForId(*args, **kwargs):
9358 """
5b5c9bc7 9359 SetHelpTextForId(self, String text)
d55e5bfc
RD
9360
9361 Associate this help text with all windows with the same id as this
9362 one.
9363 """
5b5c9bc7 9364 return _core_.Window_SetHelpTextForId(*args, **kwargs)
d55e5bfc 9365
b850e7f3
RD
9366 def GetHelpTextAtPoint(*args, **kwargs):
9367 """
9368 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9369
9370 Get the help string associated with the given position in this window.
9371
9372 Notice that pt may be invalid if event origin is keyboard or unknown
9373 and this method should return the global window help text then
9374
9375 """
9376 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9377
d55e5bfc
RD
9378 def GetHelpText(*args, **kwargs):
9379 """
5b5c9bc7 9380 GetHelpText(self) -> String
d55e5bfc
RD
9381
9382 Gets the help text to be used as context-sensitive help for this
9383 window. Note that the text is actually stored by the current
f52cbe90 9384 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 9385 """
5b5c9bc7 9386 return _core_.Window_GetHelpText(*args, **kwargs)
d55e5bfc
RD
9387
9388 def SetToolTipString(*args, **kwargs):
9389 """
5b5c9bc7 9390 SetToolTipString(self, String tip)
d55e5bfc
RD
9391
9392 Attach a tooltip to the window.
9393 """
5b5c9bc7 9394 return _core_.Window_SetToolTipString(*args, **kwargs)
d55e5bfc
RD
9395
9396 def SetToolTip(*args, **kwargs):
9397 """
5b5c9bc7 9398 SetToolTip(self, ToolTip tip)
d55e5bfc
RD
9399
9400 Attach a tooltip to the window.
9401 """
5b5c9bc7 9402 return _core_.Window_SetToolTip(*args, **kwargs)
d55e5bfc
RD
9403
9404 def GetToolTip(*args, **kwargs):
9405 """
5b5c9bc7 9406 GetToolTip(self) -> ToolTip
d55e5bfc
RD
9407
9408 get the associated tooltip or None if none
9409 """
5b5c9bc7 9410 return _core_.Window_GetToolTip(*args, **kwargs)
d55e5bfc
RD
9411
9412 def SetDropTarget(*args, **kwargs):
9413 """
5b5c9bc7 9414 SetDropTarget(self, DropTarget dropTarget)
d55e5bfc
RD
9415
9416 Associates a drop target with this window. If the window already has
9417 a drop target, it is deleted.
9418 """
5b5c9bc7 9419 return _core_.Window_SetDropTarget(*args, **kwargs)
d55e5bfc
RD
9420
9421 def GetDropTarget(*args, **kwargs):
9422 """
5b5c9bc7 9423 GetDropTarget(self) -> DropTarget
d55e5bfc
RD
9424
9425 Returns the associated drop target, which may be None.
9426 """
5b5c9bc7 9427 return _core_.Window_GetDropTarget(*args, **kwargs)
d55e5bfc 9428
5ba5649b
RD
9429 def DragAcceptFiles(*args, **kwargs):
9430 """
9431 DragAcceptFiles(self, bool accept)
9432
9433 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9434 Only functional on Windows.
9435 """
9436 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9437
d55e5bfc
RD
9438 def SetConstraints(*args, **kwargs):
9439 """
5b5c9bc7 9440 SetConstraints(self, LayoutConstraints constraints)
d55e5bfc
RD
9441
9442 Sets the window to have the given layout constraints. If an existing
9443 layout constraints object is already owned by the window, it will be
9444 deleted. Pass None to disassociate and delete the window's current
9445 constraints.
9446
9447 You must call SetAutoLayout to tell a window to use the constraints
9448 automatically in its default EVT_SIZE handler; otherwise, you must
9449 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9450 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9451 effect.
9452 """
5b5c9bc7 9453 return _core_.Window_SetConstraints(*args, **kwargs)
d55e5bfc
RD
9454
9455 def GetConstraints(*args, **kwargs):
9456 """
5b5c9bc7 9457 GetConstraints(self) -> LayoutConstraints
d55e5bfc
RD
9458
9459 Returns a pointer to the window's layout constraints, or None if there
9460 are none.
9461 """
5b5c9bc7 9462 return _core_.Window_GetConstraints(*args, **kwargs)
d55e5bfc
RD
9463
9464 def SetAutoLayout(*args, **kwargs):
9465 """
9466 SetAutoLayout(self, bool autoLayout)
9467
9468 Determines whether the Layout function will be called automatically
b1fcee84
RD
9469 when the window is resized. lease note that this only happens for the
9470 windows usually used to contain children, namely `wx.Panel` and
9471 `wx.TopLevelWindow` (and the classes deriving from them).
9472
9473 This method is called implicitly by `SetSizer` but if you use
9474 `SetConstraints` you should call it manually or otherwise the window
9475 layout won't be correctly updated when its size changes.
d55e5bfc 9476 """
5b5c9bc7 9477 return _core_.Window_SetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9478
9479 def GetAutoLayout(*args, **kwargs):
9480 """
9481 GetAutoLayout(self) -> bool
9482
9483 Returns the current autoLayout setting
9484 """
5b5c9bc7 9485 return _core_.Window_GetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9486
9487 def Layout(*args, **kwargs):
9488 """
9489 Layout(self) -> bool
9490
9491 Invokes the constraint-based layout algorithm or the sizer-based
9492 algorithm for this window. See SetAutoLayout: when auto layout is on,
9493 this function gets called automatically by the default EVT_SIZE
9494 handler when the window is resized.
9495 """
5b5c9bc7 9496 return _core_.Window_Layout(*args, **kwargs)
d55e5bfc
RD
9497
9498 def SetSizer(*args, **kwargs):
9499 """
5b5c9bc7 9500 SetSizer(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9501
9502 Sets the window to have the given layout sizer. The window will then
9503 own the object, and will take care of its deletion. If an existing
9504 layout sizer object is already owned by the window, it will be deleted
9505 if the deleteOld parameter is true. Note that this function will also
9506 call SetAutoLayout implicitly with a True parameter if the sizer is
b411df4a 9507 non-None, and False otherwise.
d55e5bfc 9508 """
5b5c9bc7 9509 return _core_.Window_SetSizer(*args, **kwargs)
d55e5bfc
RD
9510
9511 def SetSizerAndFit(*args, **kwargs):
9512 """
5b5c9bc7 9513 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9514
9515 The same as SetSizer, except it also sets the size hints for the
9516 window based on the sizer's minimum size.
9517 """
5b5c9bc7 9518 return _core_.Window_SetSizerAndFit(*args, **kwargs)
d55e5bfc
RD
9519
9520 def GetSizer(*args, **kwargs):
9521 """
5b5c9bc7 9522 GetSizer(self) -> Sizer
d55e5bfc
RD
9523
9524 Return the sizer associated with the window by a previous call to
9525 SetSizer or None if there isn't one.
9526 """
5b5c9bc7 9527 return _core_.Window_GetSizer(*args, **kwargs)
d55e5bfc
RD
9528
9529 def SetContainingSizer(*args, **kwargs):
9530 """
5b5c9bc7 9531 SetContainingSizer(self, Sizer sizer)
d55e5bfc
RD
9532
9533 This normally does not need to be called by application code. It is
9534 called internally when a window is added to a sizer, and is used so
9535 the window can remove itself from the sizer when it is destroyed.
9536 """
5b5c9bc7 9537 return _core_.Window_SetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9538
9539 def GetContainingSizer(*args, **kwargs):
9540 """
5b5c9bc7 9541 GetContainingSizer(self) -> Sizer
d55e5bfc
RD
9542
9543 Return the sizer that this window is a member of, if any, otherwise None.
9544 """
5b5c9bc7 9545 return _core_.Window_GetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9546
9547 def InheritAttributes(*args, **kwargs):
9548 """
9549 InheritAttributes(self)
9550
15817c7e
RD
9551 This function is (or should be, in case of custom controls) called
9552 during window creation to intelligently set up the window visual
9553 attributes, that is the font and the foreground and background
9554 colours.
9555
9556 By 'intelligently' the following is meant: by default, all windows use
9557 their own default attributes. However if some of the parent's
9558 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 9559 SetOwnFont) and if the corresponding attribute hadn't been
15817c7e
RD
9560 explicitly set for this window itself, then this window takes the same
9561 value as used by the parent. In addition, if the window overrides
9562 ShouldInheritColours to return false, the colours will not be changed
9563 no matter what and only the font might.
9564
a7bb0a9d
RD
9565 This rather complicated logic is necessary in order to accommodate the
9566 different usage scenarios. The most common one is when all default
15817c7e
RD
9567 attributes are used and in this case, nothing should be inherited as
9568 in modern GUIs different controls use different fonts (and colours)
9569 than their siblings so they can't inherit the same value from the
9570 parent. However it was also deemed desirable to allow to simply change
9571 the attributes of all children at once by just changing the font or
9572 colour of their common parent, hence in this case we do inherit the
9573 parents attributes.
9574
d55e5bfc 9575 """
5b5c9bc7 9576 return _core_.Window_InheritAttributes(*args, **kwargs)
d55e5bfc
RD
9577
9578 def ShouldInheritColours(*args, **kwargs):
9579 """
9580 ShouldInheritColours(self) -> bool
9581
9582 Return true from here to allow the colours of this window to be
15817c7e
RD
9583 changed by InheritAttributes, returning false forbids inheriting them
9584 from the parent window.
d55e5bfc 9585
15817c7e
RD
9586 The base class version returns false, but this method is overridden in
9587 wxControl where it returns true.
d55e5bfc 9588 """
5b5c9bc7 9589 return _core_.Window_ShouldInheritColours(*args, **kwargs)
d55e5bfc
RD
9590
9591 def PostCreate(self, pre):
9592 """
9593 Phase 3 of the 2-phase create <wink!>
9594 Call this method after precreating the window with the 2-phase create method.
9595 """
9596 self.this = pre.this
9597 self.thisown = pre.thisown
9598 pre.thisown = 0
9599 if hasattr(self, '_setOORInfo'):
9600 self._setOORInfo(self)
9601 if hasattr(self, '_setCallbackInfo'):
9602 self._setCallbackInfo(self, self.__class__)
9603
7e08d4ef 9604 def SendSizeEvent(self):
92515dfc 9605 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
7e08d4ef 9606
2131d850 9607_core_.Window_swigregister(Window)
d55e5bfc
RD
9608
9609def PreWindow(*args, **kwargs):
9610 """
5b5c9bc7 9611 PreWindow() -> Window
d55e5bfc
RD
9612
9613 Precreate a Window for 2-phase creation.
9614 """
5b5c9bc7 9615 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
9616 return val
9617
1bd55598
RD
9618def Window_NewControlId(*args):
9619 """
5b5c9bc7 9620 Window_NewControlId() -> int
d55e5bfc
RD
9621
9622 Generate a control id for the controls which were not given one.
9623 """
1bd55598 9624 return _core_.Window_NewControlId(*args)
d55e5bfc 9625
5b5c9bc7 9626def Window_NextControlId(*args, **kwargs):
1bd55598 9627 """
5b5c9bc7 9628 Window_NextControlId(int winid) -> int
d55e5bfc
RD
9629
9630 Get the id of the control following the one with the given
15817c7e 9631 autogenerated) id
d55e5bfc 9632 """
1bd55598 9633 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc 9634
5b5c9bc7 9635def Window_PrevControlId(*args, **kwargs):
1bd55598 9636 """
5b5c9bc7 9637 Window_PrevControlId(int winid) -> int
d55e5bfc
RD
9638
9639 Get the id of the control preceding the one with the given
15817c7e 9640 autogenerated) id
d55e5bfc 9641 """
1bd55598 9642 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 9643
1bd55598
RD
9644def Window_FindFocus(*args):
9645 """
5b5c9bc7 9646 Window_FindFocus() -> Window
d55e5bfc
RD
9647
9648 Returns the window or control that currently has the keyboard focus,
9649 or None.
9650 """
1bd55598 9651 return _core_.Window_FindFocus(*args)
d55e5bfc 9652
1bd55598
RD
9653def Window_GetCapture(*args):
9654 """
5b5c9bc7 9655 Window_GetCapture() -> Window
d55e5bfc
RD
9656
9657 Returns the window which currently captures the mouse or None
9658 """
1bd55598 9659 return _core_.Window_GetCapture(*args)
d55e5bfc 9660
5b5c9bc7 9661def Window_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 9662 """
5b5c9bc7 9663 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9664
15817c7e
RD
9665 Get the default attributes for this class. This is useful if you want
9666 to use the same font or colour in your own control as in a standard
9667 control -- which is a much better idea than hard coding specific
a5ee0656
RD
9668 colours or fonts which might look completely out of place on the
9669 user's system, especially if it uses themes.
d55e5bfc
RD
9670
9671 The variant parameter is only relevant under Mac currently and is
15817c7e 9672 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
9673 the returned font. See `wx.Window.SetWindowVariant` for more about
9674 this.
d55e5bfc 9675 """
1bd55598 9676 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9677
9678def DLG_PNT(win, point_or_x, y=None):
9679 """
9680 Convenience function for converting a Point or (x,y) in
9681 dialog units to pixel units.
9682 """
9683 if y is None:
9684 return win.ConvertDialogPointToPixels(point_or_x)
9685 else:
9686 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9687
9688def DLG_SZE(win, size_width, height=None):
9689 """
9690 Convenience function for converting a Size or (w,h) in
9691 dialog units to pixel units.
9692 """
9693 if height is None:
9694 return win.ConvertDialogSizeToPixels(size_width)
9695 else:
9696 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9697
9698
5b5c9bc7 9699def FindWindowById(*args, **kwargs):
1bd55598 9700 """
5b5c9bc7 9701 FindWindowById(long id, Window parent=None) -> Window
d55e5bfc
RD
9702
9703 Find the first window in the application with the given id. If parent
9704 is None, the search will start from all top-level frames and dialog
9705 boxes; if non-None, the search will be limited to the given window
9706 hierarchy. The search is recursive in both cases.
9707 """
1bd55598 9708 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc 9709
5b5c9bc7 9710def FindWindowByName(*args, **kwargs):
1bd55598 9711 """
5b5c9bc7 9712 FindWindowByName(String name, Window parent=None) -> Window
d55e5bfc
RD
9713
9714 Find a window by its name (as given in a window constructor or Create
9715 function call). If parent is None, the search will start from all
9716 top-level frames and dialog boxes; if non-None, the search will be
9717 limited to the given window hierarchy. The search is recursive in both
9718 cases.
9719
9720 If no window with such name is found, wx.FindWindowByLabel is called.
9721 """
1bd55598 9722 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc 9723
5b5c9bc7 9724def FindWindowByLabel(*args, **kwargs):
1bd55598 9725 """
5b5c9bc7 9726 FindWindowByLabel(String label, Window parent=None) -> Window
d55e5bfc
RD
9727
9728 Find a window by its label. Depending on the type of window, the label
9729 may be a window title or panel item label. If parent is None, the
9730 search will start from all top-level frames and dialog boxes; if
9731 non-None, the search will be limited to the given window
9732 hierarchy. The search is recursive in both cases.
9733 """
1bd55598 9734 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc 9735
5b5c9bc7 9736def Window_FromHWND(*args, **kwargs):
1bd55598
RD
9737 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9738 return _core_.Window_FromHWND(*args, **kwargs)
3215336e 9739
1bd55598
RD
9740def GetTopLevelWindows(*args):
9741 """
3215336e
RD
9742 GetTopLevelWindows() -> PyObject
9743
9744 Returns a list of the the application's top-level windows, (frames,
9745 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9746 by wxWidgets, and so it is only valid as long as no top-level windows
9747 are closed or new top-level windows are created.
9748
9749 """
1bd55598 9750 return _core_.GetTopLevelWindows(*args)
d55e5bfc
RD
9751#---------------------------------------------------------------------------
9752
5b5c9bc7
RD
9753class Validator(EvtHandler):
9754 """Proxy of C++ Validator class"""
1bd55598
RD
9755 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9756 __repr__ = _swig_repr
9757 def __init__(self, *args, **kwargs):
5b5c9bc7 9758 """__init__(self) -> Validator"""
1bd55598 9759 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d55e5bfc
RD
9760 self._setOORInfo(self)
9761
9762 def Clone(*args, **kwargs):
5b5c9bc7
RD
9763 """Clone(self) -> Validator"""
9764 return _core_.Validator_Clone(*args, **kwargs)
d55e5bfc
RD
9765
9766 def Validate(*args, **kwargs):
5b5c9bc7
RD
9767 """Validate(self, Window parent) -> bool"""
9768 return _core_.Validator_Validate(*args, **kwargs)
d55e5bfc
RD
9769
9770 def TransferToWindow(*args, **kwargs):
9771 """TransferToWindow(self) -> bool"""
5b5c9bc7 9772 return _core_.Validator_TransferToWindow(*args, **kwargs)
d55e5bfc
RD
9773
9774 def TransferFromWindow(*args, **kwargs):
9775 """TransferFromWindow(self) -> bool"""
5b5c9bc7 9776 return _core_.Validator_TransferFromWindow(*args, **kwargs)
d55e5bfc
RD
9777
9778 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
9779 """GetWindow(self) -> Window"""
9780 return _core_.Validator_GetWindow(*args, **kwargs)
d55e5bfc
RD
9781
9782 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
9783 """SetWindow(self, Window window)"""
9784 return _core_.Validator_SetWindow(*args, **kwargs)
d55e5bfc
RD
9785
9786 def IsSilent(*args, **kwargs):
d6c14a4c 9787 """IsSilent() -> bool"""
5b5c9bc7 9788 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc
RD
9789
9790 IsSilent = staticmethod(IsSilent)
9791 def SetBellOnError(*args, **kwargs):
d6c14a4c 9792 """SetBellOnError(int doIt=True)"""
5b5c9bc7 9793 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
9794
9795 SetBellOnError = staticmethod(SetBellOnError)
2131d850 9796_core_.Validator_swigregister(Validator)
d55e5bfc 9797
1bd55598
RD
9798def Validator_IsSilent(*args):
9799 """Validator_IsSilent() -> bool"""
9800 return _core_.Validator_IsSilent(*args)
d55e5bfc 9801
5b5c9bc7 9802def Validator_SetBellOnError(*args, **kwargs):
1bd55598
RD
9803 """Validator_SetBellOnError(int doIt=True)"""
9804 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc 9805
5b5c9bc7
RD
9806class PyValidator(Validator):
9807 """Proxy of C++ PyValidator class"""
1bd55598
RD
9808 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9809 __repr__ = _swig_repr
9810 def __init__(self, *args, **kwargs):
5b5c9bc7 9811 """__init__(self) -> PyValidator"""
1bd55598 9812 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
d55e5bfc
RD
9813
9814 self._setCallbackInfo(self, PyValidator, 1)
9815 self._setOORInfo(self)
9816
9817 def _setCallbackInfo(*args, **kwargs):
9818 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
5b5c9bc7 9819 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
d55e5bfc 9820
2131d850 9821_core_.PyValidator_swigregister(PyValidator)
d55e5bfc
RD
9822
9823#---------------------------------------------------------------------------
9824
5b5c9bc7
RD
9825class Menu(EvtHandler):
9826 """Proxy of C++ Menu class"""
1bd55598
RD
9827 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9828 __repr__ = _swig_repr
9829 def __init__(self, *args, **kwargs):
5b5c9bc7 9830 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
1bd55598 9831 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
d55e5bfc
RD
9832 self._setOORInfo(self)
9833
9834 def Append(*args, **kwargs):
5b5c9bc7
RD
9835 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9836 return _core_.Menu_Append(*args, **kwargs)
d55e5bfc
RD
9837
9838 def AppendSeparator(*args, **kwargs):
5b5c9bc7
RD
9839 """AppendSeparator(self) -> MenuItem"""
9840 return _core_.Menu_AppendSeparator(*args, **kwargs)
d55e5bfc
RD
9841
9842 def AppendCheckItem(*args, **kwargs):
5b5c9bc7
RD
9843 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9844 return _core_.Menu_AppendCheckItem(*args, **kwargs)
d55e5bfc
RD
9845
9846 def AppendRadioItem(*args, **kwargs):
5b5c9bc7
RD
9847 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9848 return _core_.Menu_AppendRadioItem(*args, **kwargs)
d55e5bfc
RD
9849
9850 def AppendMenu(*args, **kwargs):
5b5c9bc7
RD
9851 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9852 return _core_.Menu_AppendMenu(*args, **kwargs)
d55e5bfc 9853
da91cb0f
RD
9854 def AppendSubMenu(*args, **kwargs):
9855 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9856 return _core_.Menu_AppendSubMenu(*args, **kwargs)
9857
d55e5bfc 9858 def AppendItem(*args, **kwargs):
5b5c9bc7
RD
9859 """AppendItem(self, MenuItem item) -> MenuItem"""
9860 return _core_.Menu_AppendItem(*args, **kwargs)
d55e5bfc 9861
d55e5bfc 9862 def InsertItem(*args, **kwargs):
5b5c9bc7
RD
9863 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9864 return _core_.Menu_InsertItem(*args, **kwargs)
d55e5bfc 9865
1bd55598
RD
9866 def PrependItem(*args, **kwargs):
9867 """PrependItem(self, MenuItem item) -> MenuItem"""
9868 return _core_.Menu_PrependItem(*args, **kwargs)
9869
9870 def Break(*args, **kwargs):
9871 """Break(self)"""
9872 return _core_.Menu_Break(*args, **kwargs)
9873
d55e5bfc
RD
9874 def Insert(*args, **kwargs):
9875 """
5b5c9bc7
RD
9876 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9877 int kind=ITEM_NORMAL) -> MenuItem
d55e5bfc 9878 """
5b5c9bc7 9879 return _core_.Menu_Insert(*args, **kwargs)
d55e5bfc
RD
9880
9881 def InsertSeparator(*args, **kwargs):
5b5c9bc7
RD
9882 """InsertSeparator(self, size_t pos) -> MenuItem"""
9883 return _core_.Menu_InsertSeparator(*args, **kwargs)
d55e5bfc
RD
9884
9885 def InsertCheckItem(*args, **kwargs):
5b5c9bc7
RD
9886 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9887 return _core_.Menu_InsertCheckItem(*args, **kwargs)
d55e5bfc
RD
9888
9889 def InsertRadioItem(*args, **kwargs):
5b5c9bc7
RD
9890 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9891 return _core_.Menu_InsertRadioItem(*args, **kwargs)
d55e5bfc
RD
9892
9893 def InsertMenu(*args, **kwargs):
5b5c9bc7
RD
9894 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9895 return _core_.Menu_InsertMenu(*args, **kwargs)
d55e5bfc 9896
d55e5bfc 9897 def Prepend(*args, **kwargs):
5b5c9bc7
RD
9898 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9899 return _core_.Menu_Prepend(*args, **kwargs)
d55e5bfc
RD
9900
9901 def PrependSeparator(*args, **kwargs):
5b5c9bc7
RD
9902 """PrependSeparator(self) -> MenuItem"""
9903 return _core_.Menu_PrependSeparator(*args, **kwargs)
d55e5bfc
RD
9904
9905 def PrependCheckItem(*args, **kwargs):
5b5c9bc7
RD
9906 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9907 return _core_.Menu_PrependCheckItem(*args, **kwargs)
d55e5bfc
RD
9908
9909 def PrependRadioItem(*args, **kwargs):
5b5c9bc7
RD
9910 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9911 return _core_.Menu_PrependRadioItem(*args, **kwargs)
d55e5bfc
RD
9912
9913 def PrependMenu(*args, **kwargs):
5b5c9bc7
RD
9914 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9915 return _core_.Menu_PrependMenu(*args, **kwargs)
d55e5bfc
RD
9916
9917 def Remove(*args, **kwargs):
5b5c9bc7
RD
9918 """Remove(self, int id) -> MenuItem"""
9919 return _core_.Menu_Remove(*args, **kwargs)
d55e5bfc
RD
9920
9921 def RemoveItem(*args, **kwargs):
5b5c9bc7
RD
9922 """RemoveItem(self, MenuItem item) -> MenuItem"""
9923 return _core_.Menu_RemoveItem(*args, **kwargs)
d55e5bfc
RD
9924
9925 def Delete(*args, **kwargs):
9926 """Delete(self, int id) -> bool"""
5b5c9bc7 9927 return _core_.Menu_Delete(*args, **kwargs)
d55e5bfc
RD
9928
9929 def DeleteItem(*args, **kwargs):
5b5c9bc7
RD
9930 """DeleteItem(self, MenuItem item) -> bool"""
9931 return _core_.Menu_DeleteItem(*args, **kwargs)
d55e5bfc
RD
9932
9933 def Destroy(*args, **kwargs):
9934 """
9935 Destroy(self)
9936
9937 Deletes the C++ object this Python object is a proxy for.
9938 """
7e08d4ef
RD
9939 val = _core_.Menu_Destroy(*args, **kwargs)
9940 args[0].thisown = 0
9941 return val
d55e5bfc
RD
9942
9943 def DestroyId(*args, **kwargs):
9944 """
9945 DestroyId(self, int id) -> bool
9946
9947 Deletes the C++ object this Python object is a proxy for.
9948 """
7e08d4ef
RD
9949 val = _core_.Menu_DestroyId(*args, **kwargs)
9950 args[0].thisown = 0
9951 return val
d55e5bfc
RD
9952
9953 def DestroyItem(*args, **kwargs):
9954 """
5b5c9bc7 9955 DestroyItem(self, MenuItem item) -> bool
d55e5bfc
RD
9956
9957 Deletes the C++ object this Python object is a proxy for.
9958 """
7e08d4ef
RD
9959 val = _core_.Menu_DestroyItem(*args, **kwargs)
9960 args[0].thisown = 0
9961 return val
d55e5bfc
RD
9962
9963 def GetMenuItemCount(*args, **kwargs):
9964 """GetMenuItemCount(self) -> size_t"""
5b5c9bc7 9965 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
d55e5bfc
RD
9966
9967 def GetMenuItems(*args, **kwargs):
9968 """GetMenuItems(self) -> PyObject"""
5b5c9bc7 9969 return _core_.Menu_GetMenuItems(*args, **kwargs)
d55e5bfc
RD
9970
9971 def FindItem(*args, **kwargs):
5b5c9bc7
RD
9972 """FindItem(self, String item) -> int"""
9973 return _core_.Menu_FindItem(*args, **kwargs)
d55e5bfc
RD
9974
9975 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
9976 """FindItemById(self, int id) -> MenuItem"""
9977 return _core_.Menu_FindItemById(*args, **kwargs)
d55e5bfc
RD
9978
9979 def FindItemByPosition(*args, **kwargs):
5b5c9bc7
RD
9980 """FindItemByPosition(self, size_t position) -> MenuItem"""
9981 return _core_.Menu_FindItemByPosition(*args, **kwargs)
d55e5bfc
RD
9982
9983 def Enable(*args, **kwargs):
9984 """Enable(self, int id, bool enable)"""
5b5c9bc7 9985 return _core_.Menu_Enable(*args, **kwargs)
d55e5bfc
RD
9986
9987 def IsEnabled(*args, **kwargs):
9988 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 9989 return _core_.Menu_IsEnabled(*args, **kwargs)
d55e5bfc
RD
9990
9991 def Check(*args, **kwargs):
9992 """Check(self, int id, bool check)"""
5b5c9bc7 9993 return _core_.Menu_Check(*args, **kwargs)
d55e5bfc
RD
9994
9995 def IsChecked(*args, **kwargs):
9996 """IsChecked(self, int id) -> bool"""
5b5c9bc7 9997 return _core_.Menu_IsChecked(*args, **kwargs)
d55e5bfc
RD
9998
9999 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10000 """SetLabel(self, int id, String label)"""
10001 return _core_.Menu_SetLabel(*args, **kwargs)
d55e5bfc
RD
10002
10003 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10004 """GetLabel(self, int id) -> String"""
10005 return _core_.Menu_GetLabel(*args, **kwargs)
d55e5bfc
RD
10006
10007 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10008 """SetHelpString(self, int id, String helpString)"""
10009 return _core_.Menu_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10010
10011 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10012 """GetHelpString(self, int id) -> String"""
10013 return _core_.Menu_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10014
10015 def SetTitle(*args, **kwargs):
5b5c9bc7
RD
10016 """SetTitle(self, String title)"""
10017 return _core_.Menu_SetTitle(*args, **kwargs)
d55e5bfc
RD
10018
10019 def GetTitle(*args, **kwargs):
5b5c9bc7
RD
10020 """GetTitle(self) -> String"""
10021 return _core_.Menu_GetTitle(*args, **kwargs)
d55e5bfc
RD
10022
10023 def SetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10024 """SetEventHandler(self, EvtHandler handler)"""
10025 return _core_.Menu_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
10026
10027 def GetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10028 """GetEventHandler(self) -> EvtHandler"""
10029 return _core_.Menu_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
10030
10031 def SetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10032 """SetInvokingWindow(self, Window win)"""
10033 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10034
10035 def GetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10036 """GetInvokingWindow(self) -> Window"""
10037 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10038
10039 def GetStyle(*args, **kwargs):
10040 """GetStyle(self) -> long"""
5b5c9bc7 10041 return _core_.Menu_GetStyle(*args, **kwargs)
d55e5bfc
RD
10042
10043 def UpdateUI(*args, **kwargs):
5b5c9bc7
RD
10044 """UpdateUI(self, EvtHandler source=None)"""
10045 return _core_.Menu_UpdateUI(*args, **kwargs)
d55e5bfc
RD
10046
10047 def GetMenuBar(*args, **kwargs):
5b5c9bc7
RD
10048 """GetMenuBar(self) -> MenuBar"""
10049 return _core_.Menu_GetMenuBar(*args, **kwargs)
d55e5bfc
RD
10050
10051 def Attach(*args, **kwargs):
10052 """Attach(self, wxMenuBarBase menubar)"""
5b5c9bc7 10053 return _core_.Menu_Attach(*args, **kwargs)
d55e5bfc
RD
10054
10055 def Detach(*args, **kwargs):
10056 """Detach(self)"""
5b5c9bc7 10057 return _core_.Menu_Detach(*args, **kwargs)
d55e5bfc
RD
10058
10059 def IsAttached(*args, **kwargs):
10060 """IsAttached(self) -> bool"""
5b5c9bc7 10061 return _core_.Menu_IsAttached(*args, **kwargs)
d55e5bfc
RD
10062
10063 def SetParent(*args, **kwargs):
5b5c9bc7
RD
10064 """SetParent(self, Menu parent)"""
10065 return _core_.Menu_SetParent(*args, **kwargs)
d55e5bfc
RD
10066
10067 def GetParent(*args, **kwargs):
5b5c9bc7
RD
10068 """GetParent(self) -> Menu"""
10069 return _core_.Menu_GetParent(*args, **kwargs)
d55e5bfc 10070
2131d850 10071_core_.Menu_swigregister(Menu)
5b5c9bc7 10072DefaultValidator = cvar.DefaultValidator
d55e5bfc
RD
10073
10074#---------------------------------------------------------------------------
10075
5b5c9bc7
RD
10076class MenuBar(Window):
10077 """Proxy of C++ MenuBar class"""
1bd55598
RD
10078 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10079 __repr__ = _swig_repr
10080 def __init__(self, *args, **kwargs):
5b5c9bc7 10081 """__init__(self, long style=0) -> MenuBar"""
1bd55598 10082 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d55e5bfc
RD
10083 self._setOORInfo(self)
10084
10085 def Append(*args, **kwargs):
5b5c9bc7
RD
10086 """Append(self, Menu menu, String title) -> bool"""
10087 return _core_.MenuBar_Append(*args, **kwargs)
d55e5bfc
RD
10088
10089 def Insert(*args, **kwargs):
5b5c9bc7
RD
10090 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10091 return _core_.MenuBar_Insert(*args, **kwargs)
d55e5bfc
RD
10092
10093 def GetMenuCount(*args, **kwargs):
10094 """GetMenuCount(self) -> size_t"""
5b5c9bc7 10095 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
d55e5bfc
RD
10096
10097 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10098 """GetMenu(self, size_t pos) -> Menu"""
10099 return _core_.MenuBar_GetMenu(*args, **kwargs)
d55e5bfc
RD
10100
10101 def Replace(*args, **kwargs):
5b5c9bc7
RD
10102 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10103 return _core_.MenuBar_Replace(*args, **kwargs)
d55e5bfc
RD
10104
10105 def Remove(*args, **kwargs):
5b5c9bc7
RD
10106 """Remove(self, size_t pos) -> Menu"""
10107 return _core_.MenuBar_Remove(*args, **kwargs)
d55e5bfc
RD
10108
10109 def EnableTop(*args, **kwargs):
10110 """EnableTop(self, size_t pos, bool enable)"""
5b5c9bc7 10111 return _core_.MenuBar_EnableTop(*args, **kwargs)
d55e5bfc
RD
10112
10113 def IsEnabledTop(*args, **kwargs):
10114 """IsEnabledTop(self, size_t pos) -> bool"""
5b5c9bc7 10115 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
d55e5bfc
RD
10116
10117 def SetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10118 """SetLabelTop(self, size_t pos, String label)"""
10119 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
d55e5bfc
RD
10120
10121 def GetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10122 """GetLabelTop(self, size_t pos) -> String"""
10123 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
d55e5bfc
RD
10124
10125 def FindMenuItem(*args, **kwargs):
5b5c9bc7
RD
10126 """FindMenuItem(self, String menu, String item) -> int"""
10127 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
d55e5bfc
RD
10128
10129 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10130 """FindItemById(self, int id) -> MenuItem"""
10131 return _core_.MenuBar_FindItemById(*args, **kwargs)
d55e5bfc
RD
10132
10133 def FindMenu(*args, **kwargs):
5b5c9bc7
RD
10134 """FindMenu(self, String title) -> int"""
10135 return _core_.MenuBar_FindMenu(*args, **kwargs)
d55e5bfc
RD
10136
10137 def Enable(*args, **kwargs):
10138 """Enable(self, int id, bool enable)"""
5b5c9bc7 10139 return _core_.MenuBar_Enable(*args, **kwargs)
d55e5bfc
RD
10140
10141 def Check(*args, **kwargs):
10142 """Check(self, int id, bool check)"""
5b5c9bc7 10143 return _core_.MenuBar_Check(*args, **kwargs)
d55e5bfc
RD
10144
10145 def IsChecked(*args, **kwargs):
10146 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10147 return _core_.MenuBar_IsChecked(*args, **kwargs)
d55e5bfc
RD
10148
10149 def IsEnabled(*args, **kwargs):
10150 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10151 return _core_.MenuBar_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10152
10153 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10154 """SetLabel(self, int id, String label)"""
10155 return _core_.MenuBar_SetLabel(*args, **kwargs)
d55e5bfc
RD
10156
10157 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10158 """GetLabel(self, int id) -> String"""
10159 return _core_.MenuBar_GetLabel(*args, **kwargs)
d55e5bfc
RD
10160
10161 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10162 """SetHelpString(self, int id, String helpString)"""
10163 return _core_.MenuBar_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10164
10165 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10166 """GetHelpString(self, int id) -> String"""
10167 return _core_.MenuBar_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10168
10169 def GetFrame(*args, **kwargs):
10170 """GetFrame(self) -> wxFrame"""
5b5c9bc7 10171 return _core_.MenuBar_GetFrame(*args, **kwargs)
d55e5bfc
RD
10172
10173 def IsAttached(*args, **kwargs):
10174 """IsAttached(self) -> bool"""
5b5c9bc7 10175 return _core_.MenuBar_IsAttached(*args, **kwargs)
d55e5bfc
RD
10176
10177 def Attach(*args, **kwargs):
10178 """Attach(self, wxFrame frame)"""
5b5c9bc7 10179 return _core_.MenuBar_Attach(*args, **kwargs)
d55e5bfc
RD
10180
10181 def Detach(*args, **kwargs):
10182 """Detach(self)"""
5b5c9bc7 10183 return _core_.MenuBar_Detach(*args, **kwargs)
d55e5bfc 10184
4f433fef
RD
10185 def SetAutoWindowMenu(*args, **kwargs):
10186 """SetAutoWindowMenu(bool enable)"""
10187 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10188
10189 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10190 def GetAutoWindowMenu(*args, **kwargs):
10191 """GetAutoWindowMenu() -> bool"""
10192 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10193
10194 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
2131d850 10195_core_.MenuBar_swigregister(MenuBar)
d55e5bfc 10196
4f433fef 10197def MenuBar_SetAutoWindowMenu(*args, **kwargs):
1bd55598
RD
10198 """MenuBar_SetAutoWindowMenu(bool enable)"""
10199 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 10200
1bd55598
RD
10201def MenuBar_GetAutoWindowMenu(*args):
10202 """MenuBar_GetAutoWindowMenu() -> bool"""
10203 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 10204
d55e5bfc
RD
10205#---------------------------------------------------------------------------
10206
5b5c9bc7
RD
10207class MenuItem(Object):
10208 """Proxy of C++ MenuItem class"""
1bd55598
RD
10209 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10210 __repr__ = _swig_repr
10211 def __init__(self, *args, **kwargs):
d55e5bfc 10212 """
5b5c9bc7
RD
10213 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10214 String help=EmptyString, int kind=ITEM_NORMAL,
10215 Menu subMenu=None) -> MenuItem
d55e5bfc 10216 """
1bd55598
RD
10217 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10218 __swig_destroy__ = _core_.delete_MenuItem
10219 __del__ = lambda self : None;
d55e5bfc 10220 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10221 """GetMenu(self) -> Menu"""
10222 return _core_.MenuItem_GetMenu(*args, **kwargs)
d55e5bfc
RD
10223
10224 def SetMenu(*args, **kwargs):
5b5c9bc7
RD
10225 """SetMenu(self, Menu menu)"""
10226 return _core_.MenuItem_SetMenu(*args, **kwargs)
d55e5bfc
RD
10227
10228 def SetId(*args, **kwargs):
10229 """SetId(self, int id)"""
5b5c9bc7 10230 return _core_.MenuItem_SetId(*args, **kwargs)
d55e5bfc
RD
10231
10232 def GetId(*args, **kwargs):
10233 """GetId(self) -> int"""
5b5c9bc7 10234 return _core_.MenuItem_GetId(*args, **kwargs)
d55e5bfc
RD
10235
10236 def IsSeparator(*args, **kwargs):
10237 """IsSeparator(self) -> bool"""
5b5c9bc7 10238 return _core_.MenuItem_IsSeparator(*args, **kwargs)
d55e5bfc
RD
10239
10240 def SetText(*args, **kwargs):
5b5c9bc7
RD
10241 """SetText(self, String str)"""
10242 return _core_.MenuItem_SetText(*args, **kwargs)
d55e5bfc
RD
10243
10244 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10245 """GetLabel(self) -> String"""
10246 return _core_.MenuItem_GetLabel(*args, **kwargs)
d55e5bfc
RD
10247
10248 def GetText(*args, **kwargs):
5b5c9bc7
RD
10249 """GetText(self) -> String"""
10250 return _core_.MenuItem_GetText(*args, **kwargs)
d55e5bfc
RD
10251
10252 def GetLabelFromText(*args, **kwargs):
5b5c9bc7
RD
10253 """GetLabelFromText(String text) -> String"""
10254 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc
RD
10255
10256 GetLabelFromText = staticmethod(GetLabelFromText)
10257 def GetKind(*args, **kwargs):
10258 """GetKind(self) -> int"""
5b5c9bc7 10259 return _core_.MenuItem_GetKind(*args, **kwargs)
d55e5bfc
RD
10260
10261 def SetKind(*args, **kwargs):
10262 """SetKind(self, int kind)"""
5b5c9bc7 10263 return _core_.MenuItem_SetKind(*args, **kwargs)
d55e5bfc
RD
10264
10265 def SetCheckable(*args, **kwargs):
10266 """SetCheckable(self, bool checkable)"""
5b5c9bc7 10267 return _core_.MenuItem_SetCheckable(*args, **kwargs)
d55e5bfc
RD
10268
10269 def IsCheckable(*args, **kwargs):
10270 """IsCheckable(self) -> bool"""
5b5c9bc7 10271 return _core_.MenuItem_IsCheckable(*args, **kwargs)
d55e5bfc
RD
10272
10273 def IsSubMenu(*args, **kwargs):
10274 """IsSubMenu(self) -> bool"""
5b5c9bc7 10275 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
d55e5bfc
RD
10276
10277 def SetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10278 """SetSubMenu(self, Menu menu)"""
10279 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
d55e5bfc
RD
10280
10281 def GetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10282 """GetSubMenu(self) -> Menu"""
10283 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
d55e5bfc
RD
10284
10285 def Enable(*args, **kwargs):
10286 """Enable(self, bool enable=True)"""
5b5c9bc7 10287 return _core_.MenuItem_Enable(*args, **kwargs)
d55e5bfc
RD
10288
10289 def IsEnabled(*args, **kwargs):
10290 """IsEnabled(self) -> bool"""
5b5c9bc7 10291 return _core_.MenuItem_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10292
10293 def Check(*args, **kwargs):
10294 """Check(self, bool check=True)"""
5b5c9bc7 10295 return _core_.MenuItem_Check(*args, **kwargs)
d55e5bfc
RD
10296
10297 def IsChecked(*args, **kwargs):
10298 """IsChecked(self) -> bool"""
5b5c9bc7 10299 return _core_.MenuItem_IsChecked(*args, **kwargs)
d55e5bfc
RD
10300
10301 def Toggle(*args, **kwargs):
10302 """Toggle(self)"""
5b5c9bc7 10303 return _core_.MenuItem_Toggle(*args, **kwargs)
d55e5bfc
RD
10304
10305 def SetHelp(*args, **kwargs):
5b5c9bc7
RD
10306 """SetHelp(self, String str)"""
10307 return _core_.MenuItem_SetHelp(*args, **kwargs)
d55e5bfc
RD
10308
10309 def GetHelp(*args, **kwargs):
5b5c9bc7
RD
10310 """GetHelp(self) -> String"""
10311 return _core_.MenuItem_GetHelp(*args, **kwargs)
d55e5bfc
RD
10312
10313 def GetAccel(*args, **kwargs):
5b5c9bc7
RD
10314 """GetAccel(self) -> AcceleratorEntry"""
10315 return _core_.MenuItem_GetAccel(*args, **kwargs)
d55e5bfc
RD
10316
10317 def SetAccel(*args, **kwargs):
5b5c9bc7
RD
10318 """SetAccel(self, AcceleratorEntry accel)"""
10319 return _core_.MenuItem_SetAccel(*args, **kwargs)
d55e5bfc 10320
32fe5131
RD
10321 def SetBitmap(*args, **kwargs):
10322 """SetBitmap(self, Bitmap bitmap)"""
10323 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10324
10325 def GetBitmap(*args, **kwargs):
10326 """GetBitmap(self) -> Bitmap"""
10327 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10328
c1280d1e 10329 def SetFont(*args, **kwargs):
5b5c9bc7
RD
10330 """SetFont(self, Font font)"""
10331 return _core_.MenuItem_SetFont(*args, **kwargs)
c1280d1e
RD
10332
10333 def GetFont(*args, **kwargs):
5b5c9bc7
RD
10334 """GetFont(self) -> Font"""
10335 return _core_.MenuItem_GetFont(*args, **kwargs)
c1280d1e
RD
10336
10337 def SetTextColour(*args, **kwargs):
5b5c9bc7
RD
10338 """SetTextColour(self, Colour colText)"""
10339 return _core_.MenuItem_SetTextColour(*args, **kwargs)
c1280d1e
RD
10340
10341 def GetTextColour(*args, **kwargs):
5b5c9bc7
RD
10342 """GetTextColour(self) -> Colour"""
10343 return _core_.MenuItem_GetTextColour(*args, **kwargs)
c1280d1e
RD
10344
10345 def SetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10346 """SetBackgroundColour(self, Colour colBack)"""
10347 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10348
10349 def GetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10350 """GetBackgroundColour(self) -> Colour"""
10351 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10352
10353 def SetBitmaps(*args, **kwargs):
5b5c9bc7
RD
10354 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10355 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
c1280d1e
RD
10356
10357 def SetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10358 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10359 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10360
10361 def GetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10362 """GetDisabledBitmap(self) -> Bitmap"""
10363 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10364
10365 def SetMarginWidth(*args, **kwargs):
10366 """SetMarginWidth(self, int nWidth)"""
5b5c9bc7 10367 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
c1280d1e
RD
10368
10369 def GetMarginWidth(*args, **kwargs):
10370 """GetMarginWidth(self) -> int"""
5b5c9bc7 10371 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
c1280d1e 10372
d55e5bfc 10373 def GetDefaultMarginWidth(*args, **kwargs):
d6c14a4c 10374 """GetDefaultMarginWidth() -> int"""
5b5c9bc7 10375 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
10376
10377 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10378 def IsOwnerDrawn(*args, **kwargs):
10379 """IsOwnerDrawn(self) -> bool"""
5b5c9bc7 10380 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10381
10382 def SetOwnerDrawn(*args, **kwargs):
10383 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
5b5c9bc7 10384 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10385
10386 def ResetOwnerDrawn(*args, **kwargs):
10387 """ResetOwnerDrawn(self)"""
5b5c9bc7 10388 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
c1280d1e 10389
2131d850 10390_core_.MenuItem_swigregister(MenuItem)
d55e5bfc 10391
5b5c9bc7 10392def MenuItem_GetLabelFromText(*args, **kwargs):
1bd55598
RD
10393 """MenuItem_GetLabelFromText(String text) -> String"""
10394 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 10395
1bd55598
RD
10396def MenuItem_GetDefaultMarginWidth(*args):
10397 """MenuItem_GetDefaultMarginWidth() -> int"""
10398 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d55e5bfc
RD
10399
10400#---------------------------------------------------------------------------
10401
5b5c9bc7 10402class Control(Window):
d55e5bfc
RD
10403 """
10404 This is the base class for a control or 'widget'.
10405
15817c7e
RD
10406 A control is generally a small window which processes user input
10407 and/or displays one or more item of data.
d55e5bfc 10408 """
1bd55598
RD
10409 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10410 __repr__ = _swig_repr
10411 def __init__(self, *args, **kwargs):
d55e5bfc 10412 """
5b5c9bc7
RD
10413 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10414 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10415 String name=ControlNameStr) -> Control
d55e5bfc 10416
15817c7e
RD
10417 Create a Control. Normally you should only call this from a subclass'
10418 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 10419 """
1bd55598 10420 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d55e5bfc
RD
10421 self._setOORInfo(self)
10422
10423 def Create(*args, **kwargs):
10424 """
5b5c9bc7
RD
10425 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10426 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10427 String name=ControlNameStr) -> bool
d55e5bfc
RD
10428
10429 Do the 2nd phase and create the GUI control.
10430 """
5b5c9bc7 10431 return _core_.Control_Create(*args, **kwargs)
d55e5bfc 10432
1eeb270e
RD
10433 def GetAlignment(*args, **kwargs):
10434 """
10435 GetAlignment(self) -> int
10436
10437 Get the control alignment (left/right/centre, top/bottom/centre)
10438 """
10439 return _core_.Control_GetAlignment(*args, **kwargs)
10440
34e0a3bb 10441 def GetLabelText(*args, **kwargs):
1eeb270e 10442 """
1eeb270e
RD
10443 GetLabelText(self) -> String
10444
10445 Get just the text of the label, without mnemonic characters ('&')
10446 """
34e0a3bb 10447 return _core_.Control_GetLabelText(*args, **kwargs)
1eeb270e 10448
d55e5bfc
RD
10449 def Command(*args, **kwargs):
10450 """
5b5c9bc7 10451 Command(self, CommandEvent event)
d55e5bfc 10452
15817c7e
RD
10453 Simulates the effect of the user issuing a command to the item.
10454
10455 :see: `wx.CommandEvent`
10456
d55e5bfc 10457 """
5b5c9bc7 10458 return _core_.Control_Command(*args, **kwargs)
d55e5bfc
RD
10459
10460 def GetLabel(*args, **kwargs):
10461 """
5b5c9bc7 10462 GetLabel(self) -> String
d55e5bfc
RD
10463
10464 Return a control's text.
10465 """
5b5c9bc7 10466 return _core_.Control_GetLabel(*args, **kwargs)
d55e5bfc 10467
d55e5bfc 10468 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0 10469 """
5b5c9bc7 10470 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
10471
10472 Get the default attributes for this class. This is useful if you want
10473 to use the same font or colour in your own control as in a standard
10474 control -- which is a much better idea than hard coding specific
10475 colours or fonts which might look completely out of place on the
10476 user's system, especially if it uses themes.
10477
10478 The variant parameter is only relevant under Mac currently and is
10479 ignore under other platforms. Under Mac, it will change the size of
10480 the returned font. See `wx.Window.SetWindowVariant` for more about
10481 this.
10482 """
5b5c9bc7 10483 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10484
10485 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2131d850 10486_core_.Control_swigregister(Control)
d55e5bfc
RD
10487ControlNameStr = cvar.ControlNameStr
10488
10489def PreControl(*args, **kwargs):
10490 """
5b5c9bc7 10491 PreControl() -> Control
d55e5bfc
RD
10492
10493 Precreate a Control control for 2-phase creation
10494 """
5b5c9bc7 10495 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
10496 return val
10497
5b5c9bc7 10498def Control_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 10499 """
5b5c9bc7 10500 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
10501
10502 Get the default attributes for this class. This is useful if you want
10503 to use the same font or colour in your own control as in a standard
10504 control -- which is a much better idea than hard coding specific
10505 colours or fonts which might look completely out of place on the
10506 user's system, especially if it uses themes.
10507
10508 The variant parameter is only relevant under Mac currently and is
10509 ignore under other platforms. Under Mac, it will change the size of
10510 the returned font. See `wx.Window.SetWindowVariant` for more about
10511 this.
10512 """
1bd55598 10513 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10514
10515#---------------------------------------------------------------------------
10516
5b5c9bc7 10517class ItemContainer(object):
d55e5bfc 10518 """
53aa7709
RD
10519 The wx.ItemContainer class defines an interface which is implemented
10520 by all controls which have string subitems, each of which may be
10521 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10522 as `wx.ComboBox` which implements an extended interface deriving from
15817c7e 10523 this one.
d55e5bfc 10524
15817c7e
RD
10525 It defines the methods for accessing the control's items and although
10526 each of the derived classes implements them differently, they still
10527 all conform to the same interface.
d55e5bfc 10528
15817c7e
RD
10529 The items in a wx.ItemContainer have (non empty) string labels and,
10530 optionally, client data associated with them.
d55e5bfc
RD
10531
10532 """
1bd55598
RD
10533 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10534 def __init__(self): raise AttributeError, "No constructor defined"
10535 __repr__ = _swig_repr
d55e5bfc
RD
10536 def Append(*args, **kwargs):
10537 """
5b5c9bc7 10538 Append(self, String item, PyObject clientData=None) -> int
d55e5bfc 10539
15817c7e
RD
10540 Adds the item to the control, associating the given data with the item
10541 if not None. The return value is the index of the newly added item
10542 which may be different from the last one if the control is sorted (e.g.
10543 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc 10544 """
5b5c9bc7 10545 return _core_.ItemContainer_Append(*args, **kwargs)
d55e5bfc
RD
10546
10547 def AppendItems(*args, **kwargs):
10548 """
f5b96ee1 10549 AppendItems(self, List strings)
d55e5bfc 10550
15817c7e
RD
10551 Apend several items at once to the control. Notice that calling this
10552 method may be much faster than appending the items one by one if you
10553 need to add a lot of items.
d55e5bfc 10554 """
5b5c9bc7 10555 return _core_.ItemContainer_AppendItems(*args, **kwargs)
d55e5bfc
RD
10556
10557 def Insert(*args, **kwargs):
10558 """
50f151d7 10559 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
d55e5bfc 10560
15817c7e 10561 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
10562 optionally associating some data object with the item.
10563 """
5b5c9bc7 10564 return _core_.ItemContainer_Insert(*args, **kwargs)
d55e5bfc
RD
10565
10566 def Clear(*args, **kwargs):
10567 """
10568 Clear(self)
10569
10570 Removes all items from the control.
10571 """
5b5c9bc7 10572 return _core_.ItemContainer_Clear(*args, **kwargs)
d55e5bfc
RD
10573
10574 def Delete(*args, **kwargs):
10575 """
50f151d7 10576 Delete(self, unsigned int n)
d55e5bfc 10577
15817c7e
RD
10578 Deletes the item at the zero-based index 'n' from the control. Note
10579 that it is an error (signalled by a `wx.PyAssertionError` exception if
10580 enabled) to remove an item with the index negative or greater or equal
10581 than the number of items in the control.
d55e5bfc 10582 """
5b5c9bc7 10583 return _core_.ItemContainer_Delete(*args, **kwargs)
d55e5bfc 10584
53aa7709
RD
10585 def GetClientData(*args, **kwargs):
10586 """
50f151d7 10587 GetClientData(self, unsigned int n) -> PyObject
53aa7709
RD
10588
10589 Returns the client data associated with the given item, (if any.)
10590 """
5b5c9bc7 10591 return _core_.ItemContainer_GetClientData(*args, **kwargs)
53aa7709
RD
10592
10593 def SetClientData(*args, **kwargs):
10594 """
50f151d7 10595 SetClientData(self, unsigned int n, PyObject clientData)
53aa7709
RD
10596
10597 Associate the given client data with the item at position n.
10598 """
5b5c9bc7 10599 return _core_.ItemContainer_SetClientData(*args, **kwargs)
53aa7709 10600
d55e5bfc
RD
10601 def GetCount(*args, **kwargs):
10602 """
50f151d7 10603 GetCount(self) -> unsigned int
d55e5bfc
RD
10604
10605 Returns the number of items in the control.
10606 """
5b5c9bc7 10607 return _core_.ItemContainer_GetCount(*args, **kwargs)
d55e5bfc
RD
10608
10609 def IsEmpty(*args, **kwargs):
10610 """
10611 IsEmpty(self) -> bool
10612
10613 Returns True if the control is empty or False if it has some items.
10614 """
5b5c9bc7 10615 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
d55e5bfc
RD
10616
10617 def GetString(*args, **kwargs):
10618 """
50f151d7 10619 GetString(self, unsigned int n) -> String
d55e5bfc
RD
10620
10621 Returns the label of the item with the given index.
10622 """
5b5c9bc7 10623 return _core_.ItemContainer_GetString(*args, **kwargs)
d55e5bfc
RD
10624
10625 def GetStrings(*args, **kwargs):
10626 """GetStrings(self) -> wxArrayString"""
5b5c9bc7 10627 return _core_.ItemContainer_GetStrings(*args, **kwargs)
d55e5bfc
RD
10628
10629 def SetString(*args, **kwargs):
10630 """
50f151d7 10631 SetString(self, unsigned int n, String s)
d55e5bfc
RD
10632
10633 Sets the label for the given item.
10634 """
5b5c9bc7 10635 return _core_.ItemContainer_SetString(*args, **kwargs)
d55e5bfc
RD
10636
10637 def FindString(*args, **kwargs):
10638 """
5b5c9bc7 10639 FindString(self, String s) -> int
d55e5bfc
RD
10640
10641 Finds an item whose label matches the given string. Returns the
15817c7e
RD
10642 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10643 found.
d55e5bfc 10644 """
5b5c9bc7 10645 return _core_.ItemContainer_FindString(*args, **kwargs)
d55e5bfc 10646
53aa7709 10647 def SetSelection(*args, **kwargs):
d55e5bfc 10648 """
53aa7709 10649 SetSelection(self, int n)
d55e5bfc
RD
10650
10651 Sets the item at index 'n' to be the selected item.
10652 """
5b5c9bc7 10653 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 10654
d55e5bfc
RD
10655 def GetSelection(*args, **kwargs):
10656 """
10657 GetSelection(self) -> int
10658
15817c7e
RD
10659 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10660 is selected.
d55e5bfc 10661 """
5b5c9bc7 10662 return _core_.ItemContainer_GetSelection(*args, **kwargs)
d55e5bfc 10663
53aa7709 10664 def SetStringSelection(*args, **kwargs):
5b5c9bc7
RD
10665 """SetStringSelection(self, String s) -> bool"""
10666 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
53aa7709 10667
d55e5bfc
RD
10668 def GetStringSelection(*args, **kwargs):
10669 """
5b5c9bc7 10670 GetStringSelection(self) -> String
d55e5bfc 10671
15817c7e
RD
10672 Returns the label of the selected item or an empty string if no item
10673 is selected.
d55e5bfc 10674 """
5b5c9bc7 10675 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
d55e5bfc 10676
53aa7709 10677 def Select(*args, **kwargs):
d55e5bfc 10678 """
53aa7709 10679 Select(self, int n)
d55e5bfc 10680
53aa7709
RD
10681 This is the same as `SetSelection` and exists only because it is
10682 slightly more natural for controls which support multiple selection.
d55e5bfc 10683 """
5b5c9bc7 10684 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc 10685
2131d850 10686_core_.ItemContainer_swigregister(ItemContainer)
d55e5bfc
RD
10687
10688#---------------------------------------------------------------------------
10689
5b5c9bc7 10690class ControlWithItems(Control,ItemContainer):
d55e5bfc 10691 """
15817c7e
RD
10692 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10693 wx.Control class, and is used for the base class of various controls
10694 that have items.
d55e5bfc 10695 """
1bd55598
RD
10696 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10697 def __init__(self): raise AttributeError, "No constructor defined"
10698 __repr__ = _swig_repr
2131d850 10699_core_.ControlWithItems_swigregister(ControlWithItems)
d55e5bfc
RD
10700
10701#---------------------------------------------------------------------------
10702
5b5c9bc7 10703class SizerItem(Object):
bfddbb17
RD
10704 """
10705 The wx.SizerItem class is used to track the position, size and other
2131d850
RD
10706 attributes of each item managed by a `wx.Sizer`. It is not usually
10707 necessary to use this class because the sizer elements can also be
10708 identified by their positions or window or sizer references but
10709 sometimes it may be more convenient to use wx.SizerItem directly.
10710 Also, custom classes derived from `wx.PySizer` will probably need to
10711 use the collection of wx.SizerItems held by wx.Sizer when calculating
10712 layout.
bfddbb17
RD
10713
10714 :see: `wx.Sizer`, `wx.GBSizerItem`
10715 """
1bd55598
RD
10716 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10717 __repr__ = _swig_repr
10718 def __init__(self, *args, **kwargs):
bfddbb17 10719 """
5b5c9bc7 10720 __init__(self) -> SizerItem
bfddbb17
RD
10721
10722 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10723 size will need to be set before this item can be used in a Sizer.
10724
10725 You will probably never need to create a wx.SizerItem directly as they
10726 are created automatically when the sizer's Add, Insert or Prepend
10727 methods are called.
10728
10729 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10730 """
1bd55598
RD
10731 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10732 __swig_destroy__ = _core_.delete_SizerItem
10733 __del__ = lambda self : None;
d55e5bfc 10734 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
10735 """
10736 DeleteWindows(self)
10737
10738 Destroy the window or the windows in a subsizer, depending on the type
10739 of item.
10740 """
5b5c9bc7 10741 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
10742
10743 def DetachSizer(*args, **kwargs):
bfddbb17
RD
10744 """
10745 DetachSizer(self)
10746
10747 Enable deleting the SizerItem without destroying the contained sizer.
10748 """
5b5c9bc7 10749 return _core_.SizerItem_DetachSizer(*args, **kwargs)
d55e5bfc
RD
10750
10751 def GetSize(*args, **kwargs):
bfddbb17 10752 """
5b5c9bc7 10753 GetSize(self) -> Size
bfddbb17
RD
10754
10755 Get the current size of the item, as set in the last Layout.
10756 """
5b5c9bc7 10757 return _core_.SizerItem_GetSize(*args, **kwargs)
d55e5bfc
RD
10758
10759 def CalcMin(*args, **kwargs):
bfddbb17 10760 """
5b5c9bc7 10761 CalcMin(self) -> Size
bfddbb17
RD
10762
10763 Calculates the minimum desired size for the item, including any space
10764 needed by borders.
10765 """
5b5c9bc7 10766 return _core_.SizerItem_CalcMin(*args, **kwargs)
d55e5bfc
RD
10767
10768 def SetDimension(*args, **kwargs):
bfddbb17 10769 """
5b5c9bc7 10770 SetDimension(self, Point pos, Size size)
bfddbb17
RD
10771
10772 Set the position and size of the space allocated for this item by the
10773 sizer, and adjust the position and size of the item (window or
10774 subsizer) to be within that space taking alignment and borders into
10775 account.
10776 """
5b5c9bc7 10777 return _core_.SizerItem_SetDimension(*args, **kwargs)
d55e5bfc
RD
10778
10779 def GetMinSize(*args, **kwargs):
bfddbb17 10780 """
5b5c9bc7 10781 GetMinSize(self) -> Size
bfddbb17
RD
10782
10783 Get the minimum size needed for the item.
10784 """
5b5c9bc7 10785 return _core_.SizerItem_GetMinSize(*args, **kwargs)
d55e5bfc 10786
a001823c
RD
10787 def GetMinSizeWithBorder(*args, **kwargs):
10788 """
5b5c9bc7 10789 GetMinSizeWithBorder(self) -> Size
a001823c
RD
10790
10791 Get the minimum size needed for the item with space for the borders
10792 added, if needed.
10793 """
5b5c9bc7 10794 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
a001823c 10795
d55e5bfc
RD
10796 def SetInitSize(*args, **kwargs):
10797 """SetInitSize(self, int x, int y)"""
5b5c9bc7 10798 return _core_.SizerItem_SetInitSize(*args, **kwargs)
d55e5bfc
RD
10799
10800 def SetRatioWH(*args, **kwargs):
bfddbb17
RD
10801 """
10802 SetRatioWH(self, int width, int height)
10803
10804 Set the ratio item attribute.
10805 """
5b5c9bc7 10806 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
d55e5bfc
RD
10807
10808 def SetRatioSize(*args, **kwargs):
bfddbb17 10809 """
5b5c9bc7 10810 SetRatioSize(self, Size size)
bfddbb17
RD
10811
10812 Set the ratio item attribute.
10813 """
5b5c9bc7 10814 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
d55e5bfc
RD
10815
10816 def SetRatio(*args, **kwargs):
bfddbb17
RD
10817 """
10818 SetRatio(self, float ratio)
10819
10820 Set the ratio item attribute.
10821 """
5b5c9bc7 10822 return _core_.SizerItem_SetRatio(*args, **kwargs)
d55e5bfc
RD
10823
10824 def GetRatio(*args, **kwargs):
bfddbb17
RD
10825 """
10826 GetRatio(self) -> float
10827
10828 Set the ratio item attribute.
10829 """
5b5c9bc7 10830 return _core_.SizerItem_GetRatio(*args, **kwargs)
d55e5bfc 10831
070c48b4
RD
10832 def GetRect(*args, **kwargs):
10833 """
5b5c9bc7 10834 GetRect(self) -> Rect
070c48b4
RD
10835
10836 Returns the rectangle that the sizer item should occupy
10837 """
5b5c9bc7 10838 return _core_.SizerItem_GetRect(*args, **kwargs)
070c48b4 10839
d55e5bfc 10840 def IsWindow(*args, **kwargs):
bfddbb17
RD
10841 """
10842 IsWindow(self) -> bool
10843
10844 Is this sizer item a window?
10845 """
5b5c9bc7 10846 return _core_.SizerItem_IsWindow(*args, **kwargs)
d55e5bfc
RD
10847
10848 def IsSizer(*args, **kwargs):
bfddbb17
RD
10849 """
10850 IsSizer(self) -> bool
10851
10852 Is this sizer item a subsizer?
10853 """
5b5c9bc7 10854 return _core_.SizerItem_IsSizer(*args, **kwargs)
d55e5bfc
RD
10855
10856 def IsSpacer(*args, **kwargs):
bfddbb17
RD
10857 """
10858 IsSpacer(self) -> bool
10859
10860 Is this sizer item a spacer?
10861 """
5b5c9bc7 10862 return _core_.SizerItem_IsSpacer(*args, **kwargs)
d55e5bfc
RD
10863
10864 def SetProportion(*args, **kwargs):
bfddbb17
RD
10865 """
10866 SetProportion(self, int proportion)
10867
10868 Set the proportion value for this item.
10869 """
5b5c9bc7 10870 return _core_.SizerItem_SetProportion(*args, **kwargs)
d55e5bfc
RD
10871
10872 def GetProportion(*args, **kwargs):
bfddbb17
RD
10873 """
10874 GetProportion(self) -> int
10875
10876 Get the proportion value for this item.
10877 """
5b5c9bc7 10878 return _core_.SizerItem_GetProportion(*args, **kwargs)
d55e5bfc 10879
bfddbb17
RD
10880 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10881 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 10882 def SetFlag(*args, **kwargs):
bfddbb17
RD
10883 """
10884 SetFlag(self, int flag)
10885
10886 Set the flag value for this item.
10887 """
5b5c9bc7 10888 return _core_.SizerItem_SetFlag(*args, **kwargs)
d55e5bfc
RD
10889
10890 def GetFlag(*args, **kwargs):
bfddbb17
RD
10891 """
10892 GetFlag(self) -> int
10893
10894 Get the flag value for this item.
10895 """
5b5c9bc7 10896 return _core_.SizerItem_GetFlag(*args, **kwargs)
d55e5bfc
RD
10897
10898 def SetBorder(*args, **kwargs):
bfddbb17
RD
10899 """
10900 SetBorder(self, int border)
10901
10902 Set the border value for this item.
10903 """
5b5c9bc7 10904 return _core_.SizerItem_SetBorder(*args, **kwargs)
d55e5bfc
RD
10905
10906 def GetBorder(*args, **kwargs):
bfddbb17
RD
10907 """
10908 GetBorder(self) -> int
10909
10910 Get the border value for this item.
10911 """
5b5c9bc7 10912 return _core_.SizerItem_GetBorder(*args, **kwargs)
d55e5bfc
RD
10913
10914 def GetWindow(*args, **kwargs):
bfddbb17 10915 """
5b5c9bc7 10916 GetWindow(self) -> Window
bfddbb17
RD
10917
10918 Get the window (if any) that is managed by this sizer item.
10919 """
5b5c9bc7 10920 return _core_.SizerItem_GetWindow(*args, **kwargs)
d55e5bfc
RD
10921
10922 def SetWindow(*args, **kwargs):
bfddbb17 10923 """
5b5c9bc7 10924 SetWindow(self, Window window)
bfddbb17
RD
10925
10926 Set the window to be managed by this sizer item.
10927 """
5b5c9bc7 10928 return _core_.SizerItem_SetWindow(*args, **kwargs)
d55e5bfc
RD
10929
10930 def GetSizer(*args, **kwargs):
bfddbb17 10931 """
5b5c9bc7 10932 GetSizer(self) -> Sizer
bfddbb17
RD
10933
10934 Get the subsizer (if any) that is managed by this sizer item.
10935 """
5b5c9bc7 10936 return _core_.SizerItem_GetSizer(*args, **kwargs)
d55e5bfc
RD
10937
10938 def SetSizer(*args, **kwargs):
bfddbb17 10939 """
5b5c9bc7 10940 SetSizer(self, Sizer sizer)
bfddbb17
RD
10941
10942 Set the subsizer to be managed by this sizer item.
10943 """
5b5c9bc7 10944 return _core_.SizerItem_SetSizer(*args, **kwargs)
d55e5bfc
RD
10945
10946 def GetSpacer(*args, **kwargs):
bfddbb17 10947 """
5b5c9bc7 10948 GetSpacer(self) -> Size
bfddbb17
RD
10949
10950 Get the size of the spacer managed by this sizer item.
10951 """
5b5c9bc7 10952 return _core_.SizerItem_GetSpacer(*args, **kwargs)
d55e5bfc
RD
10953
10954 def SetSpacer(*args, **kwargs):
bfddbb17 10955 """
5b5c9bc7 10956 SetSpacer(self, Size size)
bfddbb17
RD
10957
10958 Set the size of the spacer to be managed by this sizer item.
10959 """
5b5c9bc7 10960 return _core_.SizerItem_SetSpacer(*args, **kwargs)
d55e5bfc
RD
10961
10962 def Show(*args, **kwargs):
bfddbb17
RD
10963 """
10964 Show(self, bool show)
10965
10966 Set the show item attribute, which sizers use to determine if the item
10967 is to be made part of the layout or not. If the item is tracking a
10968 window then it is shown or hidden as needed.
10969 """
5b5c9bc7 10970 return _core_.SizerItem_Show(*args, **kwargs)
d55e5bfc
RD
10971
10972 def IsShown(*args, **kwargs):
bfddbb17
RD
10973 """
10974 IsShown(self) -> bool
10975
10976 Is the item to be shown in the layout?
10977 """
5b5c9bc7 10978 return _core_.SizerItem_IsShown(*args, **kwargs)
d55e5bfc
RD
10979
10980 def GetPosition(*args, **kwargs):
bfddbb17 10981 """
5b5c9bc7 10982 GetPosition(self) -> Point
bfddbb17
RD
10983
10984 Returns the current position of the item, as set in the last Layout.
10985 """
5b5c9bc7 10986 return _core_.SizerItem_GetPosition(*args, **kwargs)
d55e5bfc
RD
10987
10988 def GetUserData(*args, **kwargs):
bfddbb17
RD
10989 """
10990 GetUserData(self) -> PyObject
10991
10992 Returns the userData associated with this sizer item, or None if there
10993 isn't any.
10994 """
5b5c9bc7 10995 return _core_.SizerItem_GetUserData(*args, **kwargs)
d55e5bfc 10996
32fe5131
RD
10997 def SetUserData(*args, **kwargs):
10998 """
10999 SetUserData(self, PyObject userData)
11000
11001 Associate a Python object with this sizer item.
11002 """
11003 return _core_.SizerItem_SetUserData(*args, **kwargs)
11004
2131d850 11005_core_.SizerItem_swigregister(SizerItem)
d55e5bfc 11006
bfddbb17 11007def SizerItemWindow(*args, **kwargs):
d55e5bfc 11008 """
5b5c9bc7
RD
11009 SizerItemWindow(Window window, int proportion, int flag, int border,
11010 PyObject userData=None) -> SizerItem
bfddbb17
RD
11011
11012 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 11013 """
5b5c9bc7 11014 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
11015 return val
11016
bfddbb17 11017def SizerItemSpacer(*args, **kwargs):
d55e5bfc 11018 """
bfddbb17 11019 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
5b5c9bc7 11020 PyObject userData=None) -> SizerItem
bfddbb17
RD
11021
11022 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 11023 """
5b5c9bc7 11024 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
11025 return val
11026
11027def SizerItemSizer(*args, **kwargs):
11028 """
5b5c9bc7
RD
11029 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
11030 PyObject userData=None) -> SizerItem
bfddbb17
RD
11031
11032 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc 11033 """
5b5c9bc7 11034 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
11035 return val
11036
5b5c9bc7 11037class Sizer(Object):
bfddbb17
RD
11038 """
11039 wx.Sizer is the abstract base class used for laying out subwindows in
11040 a window. You cannot use wx.Sizer directly; instead, you will have to
11041 use one of the sizer classes derived from it such as `wx.BoxSizer`,
1d5ee749
RD
11042 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11043 `wx.GridBagSizer`.
bfddbb17
RD
11044
11045 The concept implemented by sizers in wxWidgets is closely related to
11046 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11047 toolkit or the Qt toolkit. It is based upon the idea of the individual
11048 subwindows reporting their minimal required size and their ability to
11049 get stretched if the size of the parent window has changed. This will
11050 most often mean that the programmer does not set the original size of
11051 a dialog in the beginning, rather the dialog will assigned a sizer and
11052 this sizer will be queried about the recommended size. The sizer in
11053 turn will query its children, which can be normal windows or contorls,
11054 empty space or other sizers, so that a hierarchy of sizers can be
11055 constructed. Note that wxSizer does not derive from wxWindow and thus
11056 do not interfere with tab ordering and requires very little resources
11057 compared to a real window on screen.
11058
11059 What makes sizers so well fitted for use in wxWidgets is the fact that
11060 every control reports its own minimal size and the algorithm can
11061 handle differences in font sizes or different window (dialog item)
11062 sizes on different platforms without problems. If for example the
11063 standard font as well as the overall design of Mac widgets requires
11064 more space than on Windows, then the initial size of a dialog using a
11065 sizer will automatically be bigger on Mac than on Windows.
11066 """
1bd55598
RD
11067 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11068 def __init__(self): raise AttributeError, "No constructor defined"
11069 __repr__ = _swig_repr
11070 __swig_destroy__ = _core_.delete_Sizer
11071 __del__ = lambda self : None;
d55e5bfc
RD
11072 def _setOORInfo(*args, **kwargs):
11073 """_setOORInfo(self, PyObject _self)"""
5b5c9bc7 11074 return _core_.Sizer__setOORInfo(*args, **kwargs)
d55e5bfc
RD
11075
11076 def Add(*args, **kwargs):
11077 """
bfddbb17 11078 Add(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11079 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11080
11081 Appends a child item to the sizer.
d55e5bfc 11082 """
5b5c9bc7 11083 return _core_.Sizer_Add(*args, **kwargs)
d55e5bfc
RD
11084
11085 def Insert(*args, **kwargs):
11086 """
bfddbb17 11087 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
070c48b4 11088 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11089
11090 Inserts a new item into the list of items managed by this sizer before
11091 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc 11092 """
5b5c9bc7 11093 return _core_.Sizer_Insert(*args, **kwargs)
d55e5bfc
RD
11094
11095 def Prepend(*args, **kwargs):
11096 """
bfddbb17 11097 Prepend(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11098 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11099
11100 Adds a new item to the begining of the list of sizer items managed by
11101 this sizer. See `Add` for a description of the parameters.
d55e5bfc 11102 """
5b5c9bc7 11103 return _core_.Sizer_Prepend(*args, **kwargs)
d55e5bfc
RD
11104
11105 def Remove(*args, **kwargs):
bfddbb17
RD
11106 """
11107 Remove(self, item) -> bool
11108
11109 Removes an item from the sizer and destroys it. This method does not
11110 cause any layout or resizing to take place, call `Layout` to update
11111 the layout on screen after removing a child from the sizer. The
11112 *item* parameter can be either a window, a sizer, or the zero-based
11113 index of an item to remove. Returns True if the child item was found
11114 and removed.
11115 """
5b5c9bc7 11116 return _core_.Sizer_Remove(*args, **kwargs)
d55e5bfc 11117
1a6bba1e 11118 def Detach(*args, **kwargs):
bfddbb17
RD
11119 """
11120 Detach(self, item) -> bool
11121
11122 Detaches an item from the sizer without destroying it. This method
11123 does not cause any layout or resizing to take place, call `Layout` to
11124 do so. The *item* parameter can be either a window, a sizer, or the
11125 zero-based index of the item to be detached. Returns True if the child item
11126 was found and detached.
11127 """
5b5c9bc7 11128 return _core_.Sizer_Detach(*args, **kwargs)
1a6bba1e 11129
070c48b4
RD
11130 def GetItem(*args, **kwargs):
11131 """
11132 GetItem(self, item) -> wx.SizerItem
11133
11134 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11135 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11136 the item to be found.
070c48b4 11137 """
5b5c9bc7 11138 return _core_.Sizer_GetItem(*args, **kwargs)
070c48b4 11139
d55e5bfc 11140 def _SetItemMinSize(*args, **kwargs):
5b5c9bc7
RD
11141 """_SetItemMinSize(self, PyObject item, Size size)"""
11142 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
d55e5bfc 11143
bfddbb17
RD
11144 def SetItemMinSize(self, item, *args):
11145 """
11146 SetItemMinSize(self, item, Size size)
11147
11148 Sets the minimum size that will be allocated for an item in the sizer.
11149 The *item* parameter can be either a window, a sizer, or the
11150 zero-based index of the item. If a window or sizer is given then it
11151 will be searched for recursivly in subsizers if neccessary.
11152 """
11153 if len(args) == 2:
11154 # for backward compatibility accept separate width,height args too
11155 return self._SetItemMinSize(item, args)
11156 else:
11157 return self._SetItemMinSize(item, args[0])
11158
d55e5bfc 11159 def AddItem(*args, **kwargs):
bfddbb17
RD
11160 """
11161 AddItem(self, SizerItem item)
11162
11163 Adds a `wx.SizerItem` to the sizer.
11164 """
5b5c9bc7 11165 return _core_.Sizer_AddItem(*args, **kwargs)
d55e5bfc
RD
11166
11167 def InsertItem(*args, **kwargs):
bfddbb17
RD
11168 """
11169 InsertItem(self, int index, SizerItem item)
11170
11171 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11172 """
5b5c9bc7 11173 return _core_.Sizer_InsertItem(*args, **kwargs)
d55e5bfc
RD
11174
11175 def PrependItem(*args, **kwargs):
bfddbb17
RD
11176 """
11177 PrependItem(self, SizerItem item)
11178
11179 Prepends a `wx.SizerItem` to the sizer.
11180 """
5b5c9bc7 11181 return _core_.Sizer_PrependItem(*args, **kwargs)
d55e5bfc 11182
bfddbb17 11183 def AddMany(self, items):
d6c14a4c
RD
11184 """
11185 AddMany is a convenience method for adding several items
11186 to a sizer at one time. Simply pass it a list of tuples,
11187 where each tuple consists of the parameters that you
11188 would normally pass to the `Add` method.
11189 """
bfddbb17
RD
11190 for item in items:
11191 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11192 item = (item, )
11193 self.Add(*item)
d55e5bfc
RD
11194
11195 # for backwards compatibility only, please do not use in new code
7fbf8399
RD
11196 def AddWindow(self, *args, **kw):
11197 """Compatibility alias for `Add`."""
11198 return self.Add(*args, **kw)
11199 def AddSizer(self, *args, **kw):
11200 """Compatibility alias for `Add`."""
11201 return self.Add(*args, **kw)
11202 def AddSpacer(self, *args, **kw):
11203 """Compatibility alias for `Add`."""
11204 return self.Add(*args, **kw)
11205
11206 def PrependWindow(self, *args, **kw):
11207 """Compatibility alias for `Prepend`."""
11208 return self.Prepend(*args, **kw)
11209 def PrependSizer(self, *args, **kw):
11210 """Compatibility alias for `Prepend`."""
11211 return self.Prepend(*args, **kw)
11212 def PrependSpacer(self, *args, **kw):
11213 """Compatibility alias for `Prepend`."""
11214 return self.Prepend(*args, **kw)
11215
11216 def InsertWindow(self, *args, **kw):
11217 """Compatibility alias for `Insert`."""
11218 return self.Insert(*args, **kw)
11219 def InsertSizer(self, *args, **kw):
11220 """Compatibility alias for `Insert`."""
11221 return self.Insert(*args, **kw)
11222 def InsertSpacer(self, *args, **kw):
11223 """Compatibility alias for `Insert`."""
11224 return self.Insert(*args, **kw)
11225
11226 def RemoveWindow(self, *args, **kw):
11227 """Compatibility alias for `Remove`."""
11228 return self.Remove(*args, **kw)
11229 def RemoveSizer(self, *args, **kw):
11230 """Compatibility alias for `Remove`."""
11231 return self.Remove(*args, **kw)
11232 def RemovePos(self, *args, **kw):
11233 """Compatibility alias for `Remove`."""
11234 return self.Remove(*args, **kw)
d55e5bfc
RD
11235
11236
d55e5bfc 11237 def SetDimension(*args, **kwargs):
bfddbb17
RD
11238 """
11239 SetDimension(self, int x, int y, int width, int height)
11240
11241 Call this to force the sizer to take the given dimension and thus
11242 force the items owned by the sizer to resize themselves according to
11243 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11244 methods.
11245 """
5b5c9bc7 11246 return _core_.Sizer_SetDimension(*args, **kwargs)
d55e5bfc
RD
11247
11248 def SetMinSize(*args, **kwargs):
bfddbb17 11249 """
5b5c9bc7 11250 SetMinSize(self, Size size)
bfddbb17
RD
11251
11252 Call this to give the sizer a minimal size. Normally, the sizer will
11253 calculate its minimal size based purely on how much space its children
11254 need. After calling this method `GetMinSize` will return either the
11255 minimal size as requested by its children or the minimal size set
11256 here, depending on which is bigger.
11257 """
5b5c9bc7 11258 return _core_.Sizer_SetMinSize(*args, **kwargs)
d55e5bfc
RD
11259
11260 def GetSize(*args, **kwargs):
bfddbb17 11261 """
5b5c9bc7 11262 GetSize(self) -> Size
bfddbb17
RD
11263
11264 Returns the current size of the space managed by the sizer.
11265 """
5b5c9bc7 11266 return _core_.Sizer_GetSize(*args, **kwargs)
d55e5bfc
RD
11267
11268 def GetPosition(*args, **kwargs):
bfddbb17 11269 """
5b5c9bc7 11270 GetPosition(self) -> Point
bfddbb17
RD
11271
11272 Returns the current position of the sizer's managed space.
11273 """
5b5c9bc7 11274 return _core_.Sizer_GetPosition(*args, **kwargs)
d55e5bfc
RD
11275
11276 def GetMinSize(*args, **kwargs):
bfddbb17 11277 """
5b5c9bc7 11278 GetMinSize(self) -> Size
bfddbb17
RD
11279
11280 Returns the minimal size of the sizer. This is either the combined
11281 minimal size of all the children and their borders or the minimal size
11282 set by SetMinSize, depending on which is bigger.
11283 """
5b5c9bc7 11284 return _core_.Sizer_GetMinSize(*args, **kwargs)
d55e5bfc
RD
11285
11286 def GetSizeTuple(self):
1a6bba1e 11287 return self.GetSize().Get()
d55e5bfc 11288 def GetPositionTuple(self):
1a6bba1e 11289 return self.GetPosition().Get()
d55e5bfc 11290 def GetMinSizeTuple(self):
1a6bba1e 11291 return self.GetMinSize().Get()
d55e5bfc
RD
11292
11293 def RecalcSizes(*args, **kwargs):
bfddbb17
RD
11294 """
11295 RecalcSizes(self)
11296
11297 Using the sizes calculated by `CalcMin` reposition and resize all the
11298 items managed by this sizer. You should not need to call this directly as
11299 it is called by `Layout`.
11300 """
5b5c9bc7 11301 return _core_.Sizer_RecalcSizes(*args, **kwargs)
d55e5bfc
RD
11302
11303 def CalcMin(*args, **kwargs):
bfddbb17 11304 """
5b5c9bc7 11305 CalcMin(self) -> Size
bfddbb17
RD
11306
11307 This method is where the sizer will do the actual calculation of its
11308 children's minimal sizes. You should not need to call this directly as
11309 it is called by `Layout`.
11310 """
5b5c9bc7 11311 return _core_.Sizer_CalcMin(*args, **kwargs)
d55e5bfc
RD
11312
11313 def Layout(*args, **kwargs):
bfddbb17
RD
11314 """
11315 Layout(self)
11316
11317 This method will force the recalculation and layout of the items
11318 controlled by the sizer using the current space allocated to the
11319 sizer. Normally this is called automatically from the owning window's
11320 EVT_SIZE handler, but it is also useful to call it from user code when
11321 one of the items in a sizer change size, or items are added or
11322 removed.
11323 """
5b5c9bc7 11324 return _core_.Sizer_Layout(*args, **kwargs)
d55e5bfc
RD
11325
11326 def Fit(*args, **kwargs):
bfddbb17 11327 """
5b5c9bc7 11328 Fit(self, Window window) -> Size
bfddbb17
RD
11329
11330 Tell the sizer to resize the *window* to match the sizer's minimal
11331 size. This is commonly done in the constructor of the window itself in
11332 order to set its initial size to match the needs of the children as
11333 determined by the sizer. Returns the new size.
11334
11335 For a top level window this is the total window size, not the client size.
11336 """
5b5c9bc7 11337 return _core_.Sizer_Fit(*args, **kwargs)
d55e5bfc
RD
11338
11339 def FitInside(*args, **kwargs):
bfddbb17 11340 """
5b5c9bc7 11341 FitInside(self, Window window)
bfddbb17
RD
11342
11343 Tell the sizer to resize the *virtual size* of the *window* to match the
11344 sizer's minimal size. This will not alter the on screen size of the
11345 window, but may cause the addition/removal/alteration of scrollbars
11346 required to view the virtual area in windows which manage it.
11347
11348 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11349
11350 """
5b5c9bc7 11351 return _core_.Sizer_FitInside(*args, **kwargs)
d55e5bfc
RD
11352
11353 def SetSizeHints(*args, **kwargs):
bfddbb17 11354 """
5b5c9bc7 11355 SetSizeHints(self, Window window)
bfddbb17
RD
11356
11357 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11358 match the sizer's minimal size. This is commonly done in the
11359 constructor of the window itself if the window is resizable (as are
11360 many dialogs under Unix and frames on probably all platforms) in order
11361 to prevent the window from being sized smaller than the minimal size
11362 required by the sizer.
11363 """
5b5c9bc7 11364 return _core_.Sizer_SetSizeHints(*args, **kwargs)
d55e5bfc
RD
11365
11366 def SetVirtualSizeHints(*args, **kwargs):
bfddbb17 11367 """
5b5c9bc7 11368 SetVirtualSizeHints(self, Window window)
bfddbb17
RD
11369
11370 Tell the sizer to set the minimal size of the window virtual area to
11371 match the sizer's minimal size. For windows with managed scrollbars
11372 this will set them appropriately.
11373
11374 :see: `wx.ScrolledWindow.SetScrollbars`
11375
11376 """
5b5c9bc7 11377 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
d55e5bfc
RD
11378
11379 def Clear(*args, **kwargs):
bfddbb17
RD
11380 """
11381 Clear(self, bool deleteWindows=False)
11382
11383 Clear all items from the sizer, optionally destroying the window items
11384 as well.
11385 """
5b5c9bc7 11386 return _core_.Sizer_Clear(*args, **kwargs)
d55e5bfc
RD
11387
11388 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
11389 """
11390 DeleteWindows(self)
11391
11392 Destroy all windows managed by the sizer.
11393 """
5b5c9bc7 11394 return _core_.Sizer_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
11395
11396 def GetChildren(*args, **kwargs):
bfddbb17 11397 """
51b83b37 11398 GetChildren(self) -> list
bfddbb17
RD
11399
11400 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11401 """
5b5c9bc7 11402 return _core_.Sizer_GetChildren(*args, **kwargs)
d55e5bfc
RD
11403
11404 def Show(*args, **kwargs):
bfddbb17 11405 """
b411df4a 11406 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 11407
bfddbb17
RD
11408 Shows or hides an item managed by the sizer. To make a sizer item
11409 disappear or reappear, use Show followed by `Layout`. The *item*
11410 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
11411 the item. Use the recursive parameter to show or hide an item in a
11412 subsizer. Returns True if the item was found.
bfddbb17 11413 """
5b5c9bc7 11414 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
11415
11416 def IsShown(*args, **kwargs):
bfddbb17
RD
11417 """
11418 IsShown(self, item)
11419
b1fcee84 11420 Determines if the item is currently shown. To make a sizer
bfddbb17
RD
11421 item disappear or reappear, use Show followed by `Layout`. The *item*
11422 parameter can be either a window, a sizer, or the zero-based index of
11423 the item.
11424 """
5b5c9bc7 11425 return _core_.Sizer_IsShown(*args, **kwargs)
d55e5bfc 11426
629e65c2 11427 def Hide(self, item, recursive=False):
bfddbb17 11428 """
27fb7603 11429 A convenience method for `Show` (item, False, recursive).
bfddbb17 11430 """
06759a38 11431 return self.Show(item, False, recursive)
bfddbb17 11432
d55e5bfc 11433 def ShowItems(*args, **kwargs):
bfddbb17
RD
11434 """
11435 ShowItems(self, bool show)
11436
84f85550 11437 Recursively call `wx.SizerItem.Show` on all sizer items.
bfddbb17 11438 """
5b5c9bc7 11439 return _core_.Sizer_ShowItems(*args, **kwargs)
d55e5bfc 11440
2131d850 11441_core_.Sizer_swigregister(Sizer)
d55e5bfc 11442
5b5c9bc7 11443class PySizer(Sizer):
bfddbb17
RD
11444 """
11445 wx.PySizer is a special version of `wx.Sizer` that has been
11446 instrumented to allow the C++ virtual methods to be overloaded in
11447 Python derived classes. You would derive from this class if you are
11448 wanting to implement a custom sizer in Python code. Simply implement
11449 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11450 For example::
11451
11452 class MySizer(wx.PySizer):
11453 def __init__(self):
11454 wx.PySizer.__init__(self)
11455
11456 def CalcMin(self):
11457 for item in self.GetChildren():
11458 # calculate the total minimum width and height needed
11459 # by all items in the sizer according to this sizer's
11460 # layout algorithm.
11461 ...
11462 return wx.Size(width, height)
11463
11464 def RecalcSizes(self):
11465 # find the space allotted to this sizer
11466 pos = self.GetPosition()
11467 size = self.GetSize()
11468 for item in self.GetChildren():
11469 # Recalculate (if necessary) the position and size of
11470 # each item and then call item.SetDimension to do the
11471 # actual positioning and sizing of the items within the
11472 # space alloted to this sizer.
11473 ...
11474 item.SetDimension(itemPos, itemSize)
11475
11476
11477 When `Layout` is called it first calls `CalcMin` followed by
11478 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 11479 `CalcMin` and reusing them in `RecalcSizes`.
bfddbb17
RD
11480
11481 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11482
11483
11484 """
1bd55598
RD
11485 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11486 __repr__ = _swig_repr
11487 def __init__(self, *args, **kwargs):
bfddbb17 11488 """
5b5c9bc7 11489 __init__(self) -> PySizer
bfddbb17
RD
11490
11491 Creates a wx.PySizer. Must be called from the __init__ in the derived
11492 class.
11493 """
1bd55598 11494 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
d55e5bfc
RD
11495 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11496
11497 def _setCallbackInfo(*args, **kwargs):
11498 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 11499 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
d55e5bfc 11500
2131d850 11501_core_.PySizer_swigregister(PySizer)
d55e5bfc
RD
11502
11503#---------------------------------------------------------------------------
11504
5b5c9bc7 11505class BoxSizer(Sizer):
bfddbb17
RD
11506 """
11507 The basic idea behind a box sizer is that windows will most often be
11508 laid out in rather simple basic geometry, typically in a row or a
11509 column or nested hierarchies of either. A wx.BoxSizer will lay out
11510 its items in a simple row or column, depending on the orientation
11511 parameter passed to the constructor.
11512 """
1bd55598
RD
11513 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11514 __repr__ = _swig_repr
11515 def __init__(self, *args, **kwargs):
bfddbb17 11516 """
5b5c9bc7 11517 __init__(self, int orient=HORIZONTAL) -> BoxSizer
bfddbb17
RD
11518
11519 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11520 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11521 sizer.
11522 """
1bd55598 11523 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d55e5bfc
RD
11524 self._setOORInfo(self)
11525
11526 def GetOrientation(*args, **kwargs):
bfddbb17
RD
11527 """
11528 GetOrientation(self) -> int
11529
11530 Returns the current orientation of the sizer.
11531 """
5b5c9bc7 11532 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
d55e5bfc
RD
11533
11534 def SetOrientation(*args, **kwargs):
bfddbb17
RD
11535 """
11536 SetOrientation(self, int orient)
d55e5bfc 11537
bfddbb17
RD
11538 Resets the orientation of the sizer.
11539 """
5b5c9bc7 11540 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc 11541
2131d850 11542_core_.BoxSizer_swigregister(BoxSizer)
d55e5bfc
RD
11543
11544#---------------------------------------------------------------------------
11545
5b5c9bc7 11546class StaticBoxSizer(BoxSizer):
bfddbb17
RD
11547 """
11548 wx.StaticBoxSizer derives from and functions identically to the
11549 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11550 manages. Note that this static box must be created separately and
11551 passed to the sizer constructor.
11552 """
1bd55598
RD
11553 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11554 __repr__ = _swig_repr
11555 def __init__(self, *args, **kwargs):
bfddbb17 11556 """
5b5c9bc7 11557 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
bfddbb17
RD
11558
11559 Constructor. It takes an associated static box and the orientation
11560 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11561 ``wx.HORIZONTAL``.
11562 """
1bd55598 11563 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d55e5bfc
RD
11564 self._setOORInfo(self)
11565
11566 def GetStaticBox(*args, **kwargs):
bfddbb17 11567 """
5b5c9bc7 11568 GetStaticBox(self) -> StaticBox
d55e5bfc 11569
bfddbb17
RD
11570 Returns the static box associated with this sizer.
11571 """
5b5c9bc7 11572 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc 11573
2131d850 11574_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d55e5bfc
RD
11575
11576#---------------------------------------------------------------------------
11577
5b5c9bc7 11578class GridSizer(Sizer):
bfddbb17
RD
11579 """
11580 A grid sizer is a sizer which lays out its children in a
11581 two-dimensional table with all cells having the same size. In other
11582 words, the width of each cell within the grid is the width of the
11583 widest item added to the sizer and the height of each grid cell is the
11584 height of the tallest item. An optional vertical and/or horizontal
11585 gap between items can also be specified (in pixels.)
11586
11587 Items are placed in the cells of the grid in the order they are added,
11588 in row-major order. In other words, the first row is filled first,
11589 then the second, and so on until all items have been added. (If
11590 neccessary, additional rows will be added as items are added.) If you
11591 need to have greater control over the cells that items are placed in
11592 then use the `wx.GridBagSizer`.
11593
11594 """
1bd55598
RD
11595 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11596 __repr__ = _swig_repr
11597 def __init__(self, *args, **kwargs):
bfddbb17 11598 """
5b5c9bc7 11599 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
bfddbb17
RD
11600
11601 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11602 of columns and rows in the sizer - if either of the parameters is
11603 zero, it will be calculated to from the total number of children in
11604 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11605 define extra space between all children.
11606 """
1bd55598 11607 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d55e5bfc
RD
11608 self._setOORInfo(self)
11609
d55e5bfc 11610 def SetCols(*args, **kwargs):
bfddbb17
RD
11611 """
11612 SetCols(self, int cols)
11613
11614 Sets the number of columns in the sizer.
11615 """
5b5c9bc7 11616 return _core_.GridSizer_SetCols(*args, **kwargs)
d55e5bfc
RD
11617
11618 def SetRows(*args, **kwargs):
bfddbb17
RD
11619 """
11620 SetRows(self, int rows)
11621
11622 Sets the number of rows in the sizer.
11623 """
5b5c9bc7 11624 return _core_.GridSizer_SetRows(*args, **kwargs)
d55e5bfc
RD
11625
11626 def SetVGap(*args, **kwargs):
bfddbb17
RD
11627 """
11628 SetVGap(self, int gap)
11629
11630 Sets the vertical gap (in pixels) between the cells in the sizer.
11631 """
5b5c9bc7 11632 return _core_.GridSizer_SetVGap(*args, **kwargs)
d55e5bfc
RD
11633
11634 def SetHGap(*args, **kwargs):
bfddbb17
RD
11635 """
11636 SetHGap(self, int gap)
11637
11638 Sets the horizontal gap (in pixels) between cells in the sizer
11639 """
5b5c9bc7 11640 return _core_.GridSizer_SetHGap(*args, **kwargs)
d55e5bfc
RD
11641
11642 def GetCols(*args, **kwargs):
bfddbb17
RD
11643 """
11644 GetCols(self) -> int
11645
11646 Returns the number of columns in the sizer.
11647 """
5b5c9bc7 11648 return _core_.GridSizer_GetCols(*args, **kwargs)
d55e5bfc
RD
11649
11650 def GetRows(*args, **kwargs):
bfddbb17
RD
11651 """
11652 GetRows(self) -> int
11653
11654 Returns the number of rows in the sizer.
11655 """
5b5c9bc7 11656 return _core_.GridSizer_GetRows(*args, **kwargs)
d55e5bfc
RD
11657
11658 def GetVGap(*args, **kwargs):
bfddbb17
RD
11659 """
11660 GetVGap(self) -> int
11661
11662 Returns the vertical gap (in pixels) between the cells in the sizer.
11663 """
5b5c9bc7 11664 return _core_.GridSizer_GetVGap(*args, **kwargs)
d55e5bfc
RD
11665
11666 def GetHGap(*args, **kwargs):
bfddbb17
RD
11667 """
11668 GetHGap(self) -> int
11669
11670 Returns the horizontal gap (in pixels) between cells in the sizer.
11671 """
5b5c9bc7 11672 return _core_.GridSizer_GetHGap(*args, **kwargs)
d55e5bfc 11673
1bd55598
RD
11674 def CalcRowsCols(self):
11675 """
11676 CalcRowsCols() -> (rows, cols)
11677
11678 Calculates how many rows and columns will be in the sizer based
11679 on the current number of items and also the rows, cols specified
11680 in the constructor.
11681 """
11682 nitems = len(self.GetChildren())
11683 rows = self.GetRows()
11684 cols = self.GetCols()
11685 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11686 if cols != 0:
11687 rows = (nitems + cols - 1) / cols
11688 elif rows != 0:
11689 cols = (nitems + rows - 1) / rows
11690 return (rows, cols)
d55e5bfc 11691
2131d850 11692_core_.GridSizer_swigregister(GridSizer)
d55e5bfc
RD
11693
11694#---------------------------------------------------------------------------
11695
5b5c9bc7
RD
11696FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11697FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11698FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11699class FlexGridSizer(GridSizer):
bfddbb17
RD
11700 """
11701 A flex grid sizer is a sizer which lays out its children in a
11702 two-dimensional table with all table cells in one row having the same
11703 height and all cells in one column having the same width, but all
11704 rows or all columns are not necessarily the same height or width as in
11705 the `wx.GridSizer`.
11706
11707 wx.FlexGridSizer can also size items equally in one direction but
11708 unequally ("flexibly") in the other. If the sizer is only flexible
11709 in one direction (this can be changed using `SetFlexibleDirection`), it
11710 needs to be decided how the sizer should grow in the other ("non
11711 flexible") direction in order to fill the available space. The
11712 `SetNonFlexibleGrowMode` method serves this purpose.
11713
11714
11715 """
1bd55598
RD
11716 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11717 __repr__ = _swig_repr
11718 def __init__(self, *args, **kwargs):
bfddbb17 11719 """
5b5c9bc7 11720 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
bfddbb17
RD
11721
11722 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11723 number of columns and rows in the sizer - if either of the parameters
11724 is zero, it will be calculated to from the total number of children in
11725 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11726 define extra space between all children.
11727 """
1bd55598 11728 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d55e5bfc
RD
11729 self._setOORInfo(self)
11730
bfddbb17
RD
11731 def AddGrowableRow(*args, **kwargs):
11732 """
11733 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 11734
bfddbb17
RD
11735 Specifies that row *idx* (starting from zero) should be grown if there
11736 is extra space available to the sizer.
d55e5bfc 11737
bfddbb17
RD
11738 The *proportion* parameter has the same meaning as the stretch factor
11739 for the box sizers except that if all proportions are 0, then all
11740 columns are resized equally (instead of not being resized at all).
11741 """
5b5c9bc7 11742 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
d55e5bfc
RD
11743
11744 def RemoveGrowableRow(*args, **kwargs):
bfddbb17
RD
11745 """
11746 RemoveGrowableRow(self, size_t idx)
11747
11748 Specifies that row *idx* is no longer growable.
11749 """
5b5c9bc7 11750 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
d55e5bfc
RD
11751
11752 def AddGrowableCol(*args, **kwargs):
bfddbb17
RD
11753 """
11754 AddGrowableCol(self, size_t idx, int proportion=0)
11755
11756 Specifies that column *idx* (starting from zero) should be grown if
11757 there is extra space available to the sizer.
11758
11759 The *proportion* parameter has the same meaning as the stretch factor
11760 for the box sizers except that if all proportions are 0, then all
11761 columns are resized equally (instead of not being resized at all).
11762 """
5b5c9bc7 11763 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
d55e5bfc
RD
11764
11765 def RemoveGrowableCol(*args, **kwargs):
bfddbb17
RD
11766 """
11767 RemoveGrowableCol(self, size_t idx)
11768
11769 Specifies that column *idx* is no longer growable.
11770 """
5b5c9bc7 11771 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
d55e5bfc
RD
11772
11773 def SetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
11774 """
11775 SetFlexibleDirection(self, int direction)
11776
11777 Specifies whether the sizer should flexibly resize its columns, rows,
11778 or both. Argument *direction* can be one of the following values. Any
11779 other value is ignored.
11780
11781 ============== =======================================
11782 wx.VERTICAL Rows are flexibly sized.
11783 wx.HORIZONTAL Columns are flexibly sized.
11784 wx.BOTH Both rows and columns are flexibly sized
11785 (this is the default value).
11786 ============== =======================================
11787
11788 Note that this method does not trigger relayout.
11789
11790 """
5b5c9bc7 11791 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
11792
11793 def GetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
11794 """
11795 GetFlexibleDirection(self) -> int
11796
11797 Returns a value that specifies whether the sizer
11798 flexibly resizes its columns, rows, or both (default).
11799
11800 :see: `SetFlexibleDirection`
11801 """
5b5c9bc7 11802 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
11803
11804 def SetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
11805 """
11806 SetNonFlexibleGrowMode(self, int mode)
11807
11808 Specifies how the sizer should grow in the non-flexible direction if
11809 there is one (so `SetFlexibleDirection` must have been called
11810 previously). Argument *mode* can be one of the following values:
11811
11812 ========================== =================================================
11813 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11814 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11815 `AddGrowableCol` and `AddGrowableRow`. In this
11816 case equal sizing applies to minimum sizes of
11817 columns or rows (this is the default value).
11818 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11819 the non flexible direction, whether they are
11820 growable or not in the flexbile direction.
11821 ========================== =================================================
11822
11823 Note that this method does not trigger relayout.
11824
11825
11826 """
5b5c9bc7 11827 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
11828
11829 def GetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
11830 """
11831 GetNonFlexibleGrowMode(self) -> int
11832
11833 Returns the value that specifies how the sizer grows in the
11834 non-flexible direction if there is one.
11835
11836 :see: `SetNonFlexibleGrowMode`
11837 """
5b5c9bc7 11838 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
11839
11840 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
11841 """
11842 GetRowHeights(self) -> list
11843
11844 Returns a list of integers representing the heights of each of the
11845 rows in the sizer.
11846 """
5b5c9bc7 11847 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
d55e5bfc
RD
11848
11849 def GetColWidths(*args, **kwargs):
fd2dc343
RD
11850 """
11851 GetColWidths(self) -> list
11852
11853 Returns a list of integers representing the widths of each of the
11854 columns in the sizer.
11855 """
5b5c9bc7 11856 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
d55e5bfc 11857
2131d850 11858_core_.FlexGridSizer_swigregister(FlexGridSizer)
d55e5bfc 11859
5b5c9bc7 11860class StdDialogButtonSizer(BoxSizer):
62d32a5f
RD
11861 """
11862 A special sizer that knows how to order and position standard buttons
11863 in order to conform to the current platform's standards. You simply
11864 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 11865 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
11866 will take care of the rest.
11867
11868 """
1bd55598
RD
11869 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11870 __repr__ = _swig_repr
11871 def __init__(self, *args, **kwargs):
5b5c9bc7 11872 """__init__(self) -> StdDialogButtonSizer"""
1bd55598 11873 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
62d32a5f
RD
11874 def AddButton(*args, **kwargs):
11875 """
11876 AddButton(self, wxButton button)
11877
11878 Use this to add the buttons to this sizer. Do not use the `Add`
11879 method in the base class.
11880 """
5b5c9bc7 11881 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
62d32a5f 11882
53aa7709 11883 def Realize(*args, **kwargs):
62d32a5f 11884 """
53aa7709 11885 Realize(self)
62d32a5f
RD
11886
11887 This funciton needs to be called after all the buttons have been added
11888 to the sizer. It will reorder them and position them in a platform
11889 specifc manner.
11890 """
5b5c9bc7 11891 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
11892
11893 def SetAffirmativeButton(*args, **kwargs):
11894 """SetAffirmativeButton(self, wxButton button)"""
5b5c9bc7 11895 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
51b83b37
RD
11896
11897 def SetNegativeButton(*args, **kwargs):
11898 """SetNegativeButton(self, wxButton button)"""
5b5c9bc7 11899 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
51b83b37
RD
11900
11901 def SetCancelButton(*args, **kwargs):
11902 """SetCancelButton(self, wxButton button)"""
5b5c9bc7 11903 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
11904
11905 def GetAffirmativeButton(*args, **kwargs):
11906 """GetAffirmativeButton(self) -> wxButton"""
5b5c9bc7 11907 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
62d32a5f
RD
11908
11909 def GetApplyButton(*args, **kwargs):
11910 """GetApplyButton(self) -> wxButton"""
5b5c9bc7 11911 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
62d32a5f
RD
11912
11913 def GetNegativeButton(*args, **kwargs):
11914 """GetNegativeButton(self) -> wxButton"""
5b5c9bc7 11915 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
62d32a5f
RD
11916
11917 def GetCancelButton(*args, **kwargs):
11918 """GetCancelButton(self) -> wxButton"""
5b5c9bc7 11919 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
62d32a5f
RD
11920
11921 def GetHelpButton(*args, **kwargs):
11922 """GetHelpButton(self) -> wxButton"""
5b5c9bc7 11923 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
62d32a5f 11924
2131d850 11925_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
62d32a5f 11926
d55e5bfc
RD
11927#---------------------------------------------------------------------------
11928
5b5c9bc7 11929class GBPosition(object):
bfddbb17
RD
11930 """
11931 This class represents the position of an item in a virtual grid of
11932 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11933 typemaps that will automatically convert from a 2-element sequence of
11934 integers to a wx.GBPosition, so you can use the more pythonic
11935 representation of the position nearly transparently in Python code.
11936 """
1bd55598
RD
11937 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11938 __repr__ = _swig_repr
11939 def __init__(self, *args, **kwargs):
bfddbb17 11940 """
5b5c9bc7 11941 __init__(self, int row=0, int col=0) -> GBPosition
bfddbb17
RD
11942
11943 This class represents the position of an item in a virtual grid of
11944 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11945 typemaps that will automatically convert from a 2-element sequence of
11946 integers to a wx.GBPosition, so you can use the more pythonic
11947 representation of the position nearly transparently in Python code.
11948 """
1bd55598
RD
11949 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11950 __swig_destroy__ = _core_.delete_GBPosition
11951 __del__ = lambda self : None;
d55e5bfc
RD
11952 def GetRow(*args, **kwargs):
11953 """GetRow(self) -> int"""
5b5c9bc7 11954 return _core_.GBPosition_GetRow(*args, **kwargs)
d55e5bfc
RD
11955
11956 def GetCol(*args, **kwargs):
11957 """GetCol(self) -> int"""
5b5c9bc7 11958 return _core_.GBPosition_GetCol(*args, **kwargs)
d55e5bfc
RD
11959
11960 def SetRow(*args, **kwargs):
11961 """SetRow(self, int row)"""
5b5c9bc7 11962 return _core_.GBPosition_SetRow(*args, **kwargs)
d55e5bfc
RD
11963
11964 def SetCol(*args, **kwargs):
11965 """SetCol(self, int col)"""
5b5c9bc7 11966 return _core_.GBPosition_SetCol(*args, **kwargs)
d55e5bfc
RD
11967
11968 def __eq__(*args, **kwargs):
e9d6f3a4
RD
11969 """
11970 __eq__(self, PyObject other) -> bool
11971
11972 Compare GBPosition for equality.
11973 """
5b5c9bc7 11974 return _core_.GBPosition___eq__(*args, **kwargs)
d55e5bfc
RD
11975
11976 def __ne__(*args, **kwargs):
e9d6f3a4
RD
11977 """
11978 __ne__(self, PyObject other) -> bool
11979
11980 Compare GBPosition for inequality.
11981 """
5b5c9bc7 11982 return _core_.GBPosition___ne__(*args, **kwargs)
d55e5bfc
RD
11983
11984 def Set(*args, **kwargs):
11985 """Set(self, int row=0, int col=0)"""
5b5c9bc7 11986 return _core_.GBPosition_Set(*args, **kwargs)
d55e5bfc
RD
11987
11988 def Get(*args, **kwargs):
11989 """Get(self) -> PyObject"""
5b5c9bc7 11990 return _core_.GBPosition_Get(*args, **kwargs)
d55e5bfc 11991
15817c7e 11992 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
11993 def __str__(self): return str(self.Get())
11994 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11995 def __len__(self): return len(self.Get())
11996 def __getitem__(self, index): return self.Get()[index]
11997 def __setitem__(self, index, val):
11998 if index == 0: self.SetRow(val)
11999 elif index == 1: self.SetCol(val)
12000 else: raise IndexError
12001 def __nonzero__(self): return self.Get() != (0,0)
12002 __safe_for_unpickling__ = True
12003 def __reduce__(self): return (wx.GBPosition, self.Get())
12004
12005 row = property(GetRow, SetRow)
12006 col = property(GetCol, SetCol)
12007
2131d850 12008_core_.GBPosition_swigregister(GBPosition)
d55e5bfc 12009
5b5c9bc7 12010class GBSpan(object):
bfddbb17
RD
12011 """
12012 This class is used to hold the row and column spanning attributes of
12013 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12014 automatically convert from a 2-element sequence of integers to a
12015 wx.GBSpan, so you can use the more pythonic representation of the span
12016 nearly transparently in Python code.
12017
12018 """
1bd55598
RD
12019 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12020 __repr__ = _swig_repr
12021 def __init__(self, *args, **kwargs):
bfddbb17 12022 """
5b5c9bc7 12023 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
bfddbb17
RD
12024
12025 Construct a new wxGBSpan, optionally setting the rowspan and
12026 colspan. The default is (1,1). (Meaning that the item occupies one
12027 cell in each direction.
12028 """
1bd55598
RD
12029 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12030 __swig_destroy__ = _core_.delete_GBSpan
12031 __del__ = lambda self : None;
d55e5bfc
RD
12032 def GetRowspan(*args, **kwargs):
12033 """GetRowspan(self) -> int"""
5b5c9bc7 12034 return _core_.GBSpan_GetRowspan(*args, **kwargs)
d55e5bfc
RD
12035
12036 def GetColspan(*args, **kwargs):
12037 """GetColspan(self) -> int"""
5b5c9bc7 12038 return _core_.GBSpan_GetColspan(*args, **kwargs)
d55e5bfc
RD
12039
12040 def SetRowspan(*args, **kwargs):
12041 """SetRowspan(self, int rowspan)"""
5b5c9bc7 12042 return _core_.GBSpan_SetRowspan(*args, **kwargs)
d55e5bfc
RD
12043
12044 def SetColspan(*args, **kwargs):
12045 """SetColspan(self, int colspan)"""
5b5c9bc7 12046 return _core_.GBSpan_SetColspan(*args, **kwargs)
d55e5bfc
RD
12047
12048 def __eq__(*args, **kwargs):
e9d6f3a4
RD
12049 """
12050 __eq__(self, PyObject other) -> bool
12051
12052 Compare wxGBSpan for equality.
12053 """
5b5c9bc7 12054 return _core_.GBSpan___eq__(*args, **kwargs)
d55e5bfc
RD
12055
12056 def __ne__(*args, **kwargs):
e9d6f3a4
RD
12057 """
12058 __ne__(self, PyObject other) -> bool
12059
12060 Compare GBSpan for inequality.
12061 """
5b5c9bc7 12062 return _core_.GBSpan___ne__(*args, **kwargs)
d55e5bfc
RD
12063
12064 def Set(*args, **kwargs):
12065 """Set(self, int rowspan=1, int colspan=1)"""
5b5c9bc7 12066 return _core_.GBSpan_Set(*args, **kwargs)
d55e5bfc
RD
12067
12068 def Get(*args, **kwargs):
12069 """Get(self) -> PyObject"""
5b5c9bc7 12070 return _core_.GBSpan_Get(*args, **kwargs)
d55e5bfc 12071
15817c7e 12072 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12073 def __str__(self): return str(self.Get())
12074 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12075 def __len__(self): return len(self.Get())
12076 def __getitem__(self, index): return self.Get()[index]
12077 def __setitem__(self, index, val):
12078 if index == 0: self.SetRowspan(val)
12079 elif index == 1: self.SetColspan(val)
12080 else: raise IndexError
12081 def __nonzero__(self): return self.Get() != (0,0)
12082 __safe_for_unpickling__ = True
12083 def __reduce__(self): return (wx.GBSpan, self.Get())
12084
12085 rowspan = property(GetRowspan, SetRowspan)
12086 colspan = property(GetColspan, SetColspan)
12087
2131d850 12088_core_.GBSpan_swigregister(GBSpan)
d55e5bfc 12089
5b5c9bc7 12090class GBSizerItem(SizerItem):
bfddbb17
RD
12091 """
12092 The wx.GBSizerItem class is used to track the additional data about
12093 items in a `wx.GridBagSizer` such as the item's position in the grid
12094 and how many rows or columns it spans.
12095
12096 """
1bd55598
RD
12097 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12098 __repr__ = _swig_repr
12099 def __init__(self, *args, **kwargs):
bfddbb17 12100 """
5b5c9bc7 12101 __init__(self) -> GBSizerItem
bfddbb17
RD
12102
12103 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12104 size will need to be set, as well as a position and span before this
12105 item can be used in a Sizer.
12106
12107 You will probably never need to create a wx.GBSizerItem directly as they
12108 are created automatically when the sizer's Add method is called.
12109 """
1bd55598
RD
12110 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12111 __swig_destroy__ = _core_.delete_GBSizerItem
12112 __del__ = lambda self : None;
d55e5bfc 12113 def GetPos(*args, **kwargs):
bfddbb17 12114 """
5b5c9bc7 12115 GetPos(self) -> GBPosition
bfddbb17
RD
12116
12117 Get the grid position of the item
12118 """
5b5c9bc7 12119 return _core_.GBSizerItem_GetPos(*args, **kwargs)
d55e5bfc
RD
12120
12121 def GetPosTuple(self): return self.GetPos().Get()
12122 def GetSpan(*args, **kwargs):
bfddbb17 12123 """
5b5c9bc7 12124 GetSpan(self) -> GBSpan
bfddbb17
RD
12125
12126 Get the row and column spanning of the item
12127 """
5b5c9bc7 12128 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
d55e5bfc
RD
12129
12130 def GetSpanTuple(self): return self.GetSpan().Get()
12131 def SetPos(*args, **kwargs):
bfddbb17 12132 """
5b5c9bc7 12133 SetPos(self, GBPosition pos) -> bool
bfddbb17
RD
12134
12135 If the item is already a member of a sizer then first ensure that
12136 there is no other item that would intersect with this one at the new
12137 position, then set the new position. Returns True if the change is
12138 successful and after the next Layout() the item will be moved.
12139 """
5b5c9bc7 12140 return _core_.GBSizerItem_SetPos(*args, **kwargs)
d55e5bfc
RD
12141
12142 def SetSpan(*args, **kwargs):
bfddbb17 12143 """
5b5c9bc7 12144 SetSpan(self, GBSpan span) -> bool
bfddbb17
RD
12145
12146 If the item is already a member of a sizer then first ensure that
12147 there is no other item that would intersect with this one with its new
12148 spanning size, then set the new spanning. Returns True if the change
12149 is successful and after the next Layout() the item will be resized.
12150
12151 """
5b5c9bc7 12152 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
d55e5bfc 12153
bfddbb17 12154 def Intersects(*args, **kwargs):
d55e5bfc 12155 """
5b5c9bc7 12156 Intersects(self, GBSizerItem other) -> bool
bfddbb17
RD
12157
12158 Returns True if this item and the other item instersect.
d55e5bfc 12159 """
5b5c9bc7 12160 return _core_.GBSizerItem_Intersects(*args, **kwargs)
bfddbb17
RD
12161
12162 def IntersectsPos(*args, **kwargs):
12163 """
5b5c9bc7 12164 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
bfddbb17
RD
12165
12166 Returns True if the given pos/span would intersect with this item.
12167 """
5b5c9bc7 12168 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
12169
12170 def GetEndPos(*args, **kwargs):
bfddbb17 12171 """
5b5c9bc7 12172 GetEndPos(self) -> GBPosition
bfddbb17
RD
12173
12174 Get the row and column of the endpoint of this item.
12175 """
5b5c9bc7 12176 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
d55e5bfc
RD
12177
12178 def GetGBSizer(*args, **kwargs):
bfddbb17 12179 """
5b5c9bc7 12180 GetGBSizer(self) -> GridBagSizer
bfddbb17
RD
12181
12182 Get the sizer this item is a member of.
12183 """
5b5c9bc7 12184 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
d55e5bfc
RD
12185
12186 def SetGBSizer(*args, **kwargs):
bfddbb17 12187 """
5b5c9bc7 12188 SetGBSizer(self, GridBagSizer sizer)
bfddbb17
RD
12189
12190 Set the sizer this item is a member of.
12191 """
5b5c9bc7 12192 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
d55e5bfc 12193
2131d850 12194_core_.GBSizerItem_swigregister(GBSizerItem)
5b5c9bc7 12195DefaultSpan = cvar.DefaultSpan
d55e5bfc
RD
12196
12197def GBSizerItemWindow(*args, **kwargs):
12198 """
5b5c9bc7
RD
12199 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12200 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12201
12202 Construct a `wx.GBSizerItem` for a window.
d55e5bfc 12203 """
5b5c9bc7 12204 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12205 return val
12206
12207def GBSizerItemSizer(*args, **kwargs):
12208 """
5b5c9bc7
RD
12209 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12210 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12211
12212 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc 12213 """
5b5c9bc7 12214 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12215 return val
12216
12217def GBSizerItemSpacer(*args, **kwargs):
12218 """
5b5c9bc7
RD
12219 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12220 int flag, int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12221
12222 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc 12223 """
5b5c9bc7 12224 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12225 return val
12226
5b5c9bc7 12227class GridBagSizer(FlexGridSizer):
bfddbb17
RD
12228 """
12229 A `wx.Sizer` that can lay out items in a virtual grid like a
12230 `wx.FlexGridSizer` but in this case explicit positioning of the items
12231 is allowed using `wx.GBPosition`, and items can optionally span more
12232 than one row and/or column using `wx.GBSpan`. The total size of the
12233 virtual grid is determined by the largest row and column that items are
12234 positioned at, adjusted for spanning.
12235
12236 """
1bd55598
RD
12237 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12238 __repr__ = _swig_repr
12239 def __init__(self, *args, **kwargs):
bfddbb17 12240 """
5b5c9bc7 12241 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
bfddbb17
RD
12242
12243 Constructor, with optional parameters to specify the gap between the
12244 rows and columns.
12245 """
1bd55598 12246 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
03e46024
RD
12247 self._setOORInfo(self)
12248
d55e5bfc
RD
12249 def Add(*args, **kwargs):
12250 """
bfddbb17 12251 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
070c48b4 12252 int border=0, userData=None) -> wx.GBSizerItem
bfddbb17
RD
12253
12254 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12255 more than one row or column as specified with *span*. The remaining
12256 args behave similarly to `wx.Sizer.Add`.
12257
12258 Returns True if the item was successfully placed at the given cell
12259 position, False if something was already there.
12260
d55e5bfc 12261 """
5b5c9bc7 12262 return _core_.GridBagSizer_Add(*args, **kwargs)
d55e5bfc
RD
12263
12264 def AddItem(*args, **kwargs):
bfddbb17 12265 """
070c48b4 12266 Add(self, GBSizerItem item) -> wx.GBSizerItem
bfddbb17
RD
12267
12268 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12269 the item was successfully placed at its given cell position, False if
12270 something was already there.
12271 """
5b5c9bc7 12272 return _core_.GridBagSizer_AddItem(*args, **kwargs)
d55e5bfc 12273
84f85550
RD
12274 def GetCellSize(*args, **kwargs):
12275 """
5b5c9bc7 12276 GetCellSize(self, int row, int col) -> Size
84f85550
RD
12277
12278 Get the size of the specified cell, including hgap and
12279 vgap. Only valid after a Layout.
12280 """
5b5c9bc7 12281 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
84f85550 12282
d55e5bfc 12283 def GetEmptyCellSize(*args, **kwargs):
bfddbb17 12284 """
5b5c9bc7 12285 GetEmptyCellSize(self) -> Size
bfddbb17
RD
12286
12287 Get the size used for cells in the grid with no item.
12288 """
5b5c9bc7 12289 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12290
12291 def SetEmptyCellSize(*args, **kwargs):
bfddbb17 12292 """
5b5c9bc7 12293 SetEmptyCellSize(self, Size sz)
bfddbb17
RD
12294
12295 Set the size used for cells in the grid with no item.
12296 """
5b5c9bc7 12297 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12298
12299 def GetItemPosition(*args):
12300 """
bfddbb17
RD
12301 GetItemPosition(self, item) -> GBPosition
12302
12303 Get the grid position of the specified *item* where *item* is either a
12304 window or subsizer that is a member of this sizer, or a zero-based
12305 index of an item.
d55e5bfc 12306 """
5b5c9bc7 12307 return _core_.GridBagSizer_GetItemPosition(*args)
d55e5bfc
RD
12308
12309 def SetItemPosition(*args):
12310 """
bfddbb17
RD
12311 SetItemPosition(self, item, GBPosition pos) -> bool
12312
12313 Set the grid position of the specified *item* where *item* is either a
12314 window or subsizer that is a member of this sizer, or a zero-based
12315 index of an item. Returns True on success. If the move is not
12316 allowed (because an item is already there) then False is returned.
12317
d55e5bfc 12318 """
5b5c9bc7 12319 return _core_.GridBagSizer_SetItemPosition(*args)
d55e5bfc
RD
12320
12321 def GetItemSpan(*args):
12322 """
bfddbb17
RD
12323 GetItemSpan(self, item) -> GBSpan
12324
12325 Get the row/col spanning of the specified *item* where *item* is
12326 either a window or subsizer that is a member of this sizer, or a
12327 zero-based index of an item.
d55e5bfc 12328 """
5b5c9bc7 12329 return _core_.GridBagSizer_GetItemSpan(*args)
d55e5bfc
RD
12330
12331 def SetItemSpan(*args):
12332 """
bfddbb17
RD
12333 SetItemSpan(self, item, GBSpan span) -> bool
12334
12335 Set the row/col spanning of the specified *item* where *item* is
12336 either a window or subsizer that is a member of this sizer, or a
12337 zero-based index of an item. Returns True on success. If the move is
12338 not allowed (because an item is already there) then False is returned.
d55e5bfc 12339 """
5b5c9bc7 12340 return _core_.GridBagSizer_SetItemSpan(*args)
d55e5bfc
RD
12341
12342 def FindItem(*args):
12343 """
bfddbb17
RD
12344 FindItem(self, item) -> GBSizerItem
12345
12346 Find the sizer item for the given window or subsizer, returns None if
12347 not found. (non-recursive)
d55e5bfc 12348 """
5b5c9bc7 12349 return _core_.GridBagSizer_FindItem(*args)
d55e5bfc
RD
12350
12351 def FindItemAtPosition(*args, **kwargs):
bfddbb17 12352 """
5b5c9bc7 12353 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
bfddbb17
RD
12354
12355 Return the sizer item for the given grid cell, or None if there is no
12356 item at that position. (non-recursive)
12357 """
5b5c9bc7 12358 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
d55e5bfc
RD
12359
12360 def FindItemAtPoint(*args, **kwargs):
bfddbb17 12361 """
5b5c9bc7 12362 FindItemAtPoint(self, Point pt) -> GBSizerItem
bfddbb17
RD
12363
12364 Return the sizer item located at the point given in *pt*, or None if
12365 there is no item at that point. The (x,y) coordinates in pt correspond
12366 to the client coordinates of the window using the sizer for
12367 layout. (non-recursive)
12368 """
5b5c9bc7 12369 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
d55e5bfc 12370
bfddbb17
RD
12371 def CheckForIntersection(*args, **kwargs):
12372 """
5b5c9bc7 12373 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 12374
bfddbb17
RD
12375 Look at all items and see if any intersect (or would overlap) the
12376 given *item*. Returns True if so, False if there would be no overlap.
12377 If an *excludeItem* is given then it will not be checked for
12378 intersection, for example it may be the item we are checking the
12379 position of.
d55e5bfc 12380
bfddbb17 12381 """
5b5c9bc7 12382 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 12383
bfddbb17 12384 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 12385 """
5b5c9bc7 12386 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
bfddbb17
RD
12387
12388 Look at all items and see if any intersect (or would overlap) the
12389 given position and span. Returns True if so, False if there would be
12390 no overlap. If an *excludeItem* is given then it will not be checked
12391 for intersection, for example it may be the item we are checking the
12392 position of.
d55e5bfc 12393 """
5b5c9bc7 12394 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc 12395
2131d850 12396_core_.GridBagSizer_swigregister(GridBagSizer)
d55e5bfc
RD
12397
12398#---------------------------------------------------------------------------
12399
5b5c9bc7
RD
12400Left = _core_.Left
12401Top = _core_.Top
12402Right = _core_.Right
12403Bottom = _core_.Bottom
12404Width = _core_.Width
12405Height = _core_.Height
12406Centre = _core_.Centre
12407Center = _core_.Center
12408CentreX = _core_.CentreX
12409CentreY = _core_.CentreY
12410Unconstrained = _core_.Unconstrained
12411AsIs = _core_.AsIs
12412PercentOf = _core_.PercentOf
12413Above = _core_.Above
12414Below = _core_.Below
12415LeftOf = _core_.LeftOf
12416RightOf = _core_.RightOf
12417SameAs = _core_.SameAs
12418Absolute = _core_.Absolute
12419class IndividualLayoutConstraint(Object):
d55e5bfc 12420 """
15817c7e
RD
12421 Objects of this class are stored in the `wx.LayoutConstraints` class as
12422 one of eight possible constraints that a window can be involved in.
12423 You will never need to create an instance of
12424 wx.IndividualLayoutConstraint, rather you should create a
12425 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 12426 that it contains.
d55e5bfc 12427 """
1bd55598
RD
12428 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12429 def __init__(self): raise AttributeError, "No constructor defined"
12430 __repr__ = _swig_repr
d55e5bfc 12431 def Set(*args, **kwargs):
15817c7e 12432 """
5b5c9bc7 12433 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
15817c7e
RD
12434
12435 Sets the properties of the constraint. Normally called by one of the
12436 convenience functions such as Above, RightOf, SameAs.
12437 """
5b5c9bc7 12438 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
d55e5bfc
RD
12439
12440 def LeftOf(*args, **kwargs):
12441 """
5b5c9bc7 12442 LeftOf(self, Window sibling, int marg=0)
d55e5bfc 12443
15817c7e
RD
12444 Constrains this edge to be to the left of the given window, with an
12445 optional margin. Implicitly, this is relative to the left edge of the
12446 other window.
d55e5bfc 12447 """
5b5c9bc7 12448 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
d55e5bfc
RD
12449
12450 def RightOf(*args, **kwargs):
12451 """
5b5c9bc7 12452 RightOf(self, Window sibling, int marg=0)
d55e5bfc 12453
15817c7e
RD
12454 Constrains this edge to be to the right of the given window, with an
12455 optional margin. Implicitly, this is relative to the right edge of the
12456 other window.
d55e5bfc 12457 """
5b5c9bc7 12458 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
d55e5bfc
RD
12459
12460 def Above(*args, **kwargs):
12461 """
5b5c9bc7 12462 Above(self, Window sibling, int marg=0)
d55e5bfc 12463
15817c7e
RD
12464 Constrains this edge to be above the given window, with an optional
12465 margin. Implicitly, this is relative to the top edge of the other
12466 window.
d55e5bfc 12467 """
5b5c9bc7 12468 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
d55e5bfc
RD
12469
12470 def Below(*args, **kwargs):
12471 """
5b5c9bc7 12472 Below(self, Window sibling, int marg=0)
d55e5bfc 12473
15817c7e
RD
12474 Constrains this edge to be below the given window, with an optional
12475 margin. Implicitly, this is relative to the bottom edge of the other
12476 window.
d55e5bfc 12477 """
5b5c9bc7 12478 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
d55e5bfc
RD
12479
12480 def SameAs(*args, **kwargs):
12481 """
5b5c9bc7 12482 SameAs(self, Window otherW, int edge, int marg=0)
d55e5bfc 12483
15817c7e
RD
12484 Constrains this edge or dimension to be to the same as the edge of the
12485 given window, with an optional margin.
d55e5bfc 12486 """
5b5c9bc7 12487 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
d55e5bfc
RD
12488
12489 def PercentOf(*args, **kwargs):
12490 """
5b5c9bc7 12491 PercentOf(self, Window otherW, int wh, int per)
d55e5bfc 12492
15817c7e
RD
12493 Constrains this edge or dimension to be to a percentage of the given
12494 window, with an optional margin.
d55e5bfc 12495 """
5b5c9bc7 12496 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
d55e5bfc
RD
12497
12498 def Absolute(*args, **kwargs):
12499 """
12500 Absolute(self, int val)
12501
15817c7e 12502 Constrains this edge or dimension to be the given absolute value.
d55e5bfc 12503 """
5b5c9bc7 12504 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
d55e5bfc
RD
12505
12506 def Unconstrained(*args, **kwargs):
12507 """
12508 Unconstrained(self)
12509
15817c7e
RD
12510 Sets this edge or dimension to be unconstrained, that is, dependent on
12511 other edges and dimensions from which this value can be deduced.
d55e5bfc 12512 """
5b5c9bc7 12513 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
d55e5bfc
RD
12514
12515 def AsIs(*args, **kwargs):
12516 """
12517 AsIs(self)
12518
15817c7e
RD
12519 Sets this edge or constraint to be whatever the window's value is at
12520 the moment. If either of the width and height constraints are *as is*,
12521 the window will not be resized, but moved instead. This is important
12522 when considering panel items which are intended to have a default
12523 size, such as a button, which may take its size from the size of the
12524 button label.
d55e5bfc 12525 """
5b5c9bc7 12526 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
d55e5bfc
RD
12527
12528 def GetOtherWindow(*args, **kwargs):
5b5c9bc7
RD
12529 """GetOtherWindow(self) -> Window"""
12530 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
d55e5bfc
RD
12531
12532 def GetMyEdge(*args, **kwargs):
12533 """GetMyEdge(self) -> int"""
5b5c9bc7 12534 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
d55e5bfc
RD
12535
12536 def SetEdge(*args, **kwargs):
12537 """SetEdge(self, int which)"""
5b5c9bc7 12538 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
d55e5bfc
RD
12539
12540 def SetValue(*args, **kwargs):
12541 """SetValue(self, int v)"""
5b5c9bc7 12542 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
d55e5bfc
RD
12543
12544 def GetMargin(*args, **kwargs):
12545 """GetMargin(self) -> int"""
5b5c9bc7 12546 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
d55e5bfc
RD
12547
12548 def SetMargin(*args, **kwargs):
12549 """SetMargin(self, int m)"""
5b5c9bc7 12550 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
d55e5bfc
RD
12551
12552 def GetValue(*args, **kwargs):
12553 """GetValue(self) -> int"""
5b5c9bc7 12554 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
d55e5bfc
RD
12555
12556 def GetPercent(*args, **kwargs):
12557 """GetPercent(self) -> int"""
5b5c9bc7 12558 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
d55e5bfc
RD
12559
12560 def GetOtherEdge(*args, **kwargs):
12561 """GetOtherEdge(self) -> int"""
5b5c9bc7 12562 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
d55e5bfc
RD
12563
12564 def GetDone(*args, **kwargs):
12565 """GetDone(self) -> bool"""
5b5c9bc7 12566 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
d55e5bfc
RD
12567
12568 def SetDone(*args, **kwargs):
12569 """SetDone(self, bool d)"""
5b5c9bc7 12570 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
d55e5bfc
RD
12571
12572 def GetRelationship(*args, **kwargs):
12573 """GetRelationship(self) -> int"""
5b5c9bc7 12574 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
d55e5bfc
RD
12575
12576 def SetRelationship(*args, **kwargs):
12577 """SetRelationship(self, int r)"""
5b5c9bc7 12578 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
d55e5bfc
RD
12579
12580 def ResetIfWin(*args, **kwargs):
12581 """
5b5c9bc7 12582 ResetIfWin(self, Window otherW) -> bool
d55e5bfc
RD
12583
12584 Reset constraint if it mentions otherWin
12585 """
5b5c9bc7 12586 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
d55e5bfc
RD
12587
12588 def SatisfyConstraint(*args, **kwargs):
12589 """
5b5c9bc7 12590 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
d55e5bfc
RD
12591
12592 Try to satisfy constraint
12593 """
5b5c9bc7 12594 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
d55e5bfc
RD
12595
12596 def GetEdge(*args, **kwargs):
12597 """
5b5c9bc7 12598 GetEdge(self, int which, Window thisWin, Window other) -> int
d55e5bfc
RD
12599
12600 Get the value of this edge or dimension, or if this
12601 is not determinable, -1.
12602 """
5b5c9bc7 12603 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
d55e5bfc 12604
2131d850 12605_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d55e5bfc 12606
5b5c9bc7 12607class LayoutConstraints(Object):
d55e5bfc 12608 """
15817c7e
RD
12609 **Note:** constraints are now deprecated and you should use sizers
12610 instead.
d55e5bfc 12611
15817c7e
RD
12612 Objects of this class can be associated with a window to define its
12613 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
12614
12615 The class consists of the following eight constraints of class
12616 wx.IndividualLayoutConstraint, some or all of which should be accessed
12617 directly to set the appropriate constraints.
12618
12619 * left: represents the left hand edge of the window
12620 * right: represents the right hand edge of the window
12621 * top: represents the top edge of the window
12622 * bottom: represents the bottom edge of the window
12623 * width: represents the width of the window
12624 * height: represents the height of the window
12625 * centreX: represents the horizontal centre point of the window
12626 * centreY: represents the vertical centre point of the window
12627
15817c7e
RD
12628 Most constraints are initially set to have the relationship
12629 wxUnconstrained, which means that their values should be calculated by
12630 looking at known constraints. The exceptions are width and height,
12631 which are set to wxAsIs to ensure that if the user does not specify a
12632 constraint, the existing width and height will be used, to be
12633 compatible with panel items which often have take a default size. If
12634 the constraint is ``wx.AsIs``, the dimension will not be changed.
12635
12636 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
12637
12638 """
1bd55598
RD
12639 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12640 __repr__ = _swig_repr
5b5c9bc7
RD
12641 left = property(_core_.LayoutConstraints_left_get)
12642 top = property(_core_.LayoutConstraints_top_get)
12643 right = property(_core_.LayoutConstraints_right_get)
12644 bottom = property(_core_.LayoutConstraints_bottom_get)
12645 width = property(_core_.LayoutConstraints_width_get)
12646 height = property(_core_.LayoutConstraints_height_get)
12647 centreX = property(_core_.LayoutConstraints_centreX_get)
12648 centreY = property(_core_.LayoutConstraints_centreY_get)
1bd55598 12649 def __init__(self, *args, **kwargs):
5b5c9bc7 12650 """__init__(self) -> LayoutConstraints"""
1bd55598
RD
12651 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12652 __swig_destroy__ = _core_.delete_LayoutConstraints
12653 __del__ = lambda self : None;
d55e5bfc
RD
12654 def SatisfyConstraints(*args, **kwargs):
12655 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
5b5c9bc7 12656 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
d55e5bfc
RD
12657
12658 def AreSatisfied(*args, **kwargs):
12659 """AreSatisfied(self) -> bool"""
5b5c9bc7 12660 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
d55e5bfc 12661
2131d850 12662_core_.LayoutConstraints_swigregister(LayoutConstraints)
d55e5bfc
RD
12663
12664#----------------------------------------------------------------------------
12665
12666# Use Python's bool constants if available, make some if not
12667try:
12668 True
12669except NameError:
12670 __builtins__.True = 1==1
12671 __builtins__.False = 1==0
12672 def bool(value): return not not value
12673 __builtins__.bool = bool
12674
12675
12676
12677# workarounds for bad wxRTTI names
12678__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12679__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12680__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12681
12682
12683#----------------------------------------------------------------------------
12684# Load version numbers from __version__... Ensure that major and minor
0f63ec68 12685# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
12686
12687from __version__ import *
12688__version__ = VERSION_STRING
12689
0f63ec68
RD
12690assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12691assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
12692if RELEASE_VERSION != _core_.RELEASE_VERSION:
12693 import warnings
0f63ec68 12694 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
12695
12696#----------------------------------------------------------------------------
12697
7993762b
RD
12698# Set wxPython's default string<-->unicode conversion encoding from
12699# the locale, but only if Python's default hasn't been changed. (We
12700# assume that if the user has customized it already then that is the
12701# encoding we need to use as well.)
12702#
12703# The encoding selected here is used when string or unicode objects
12704# need to be converted in order to pass them to wxWidgets. Please be
12705# aware that the default encoding within the same locale may be
12706# slightly different on different platforms. For example, please see
62d32a5f
RD
12707# http://www.alanwood.net/demos/charsetdiffs.html for differences
12708# between the common latin/roman encodings.
3837a853
RD
12709
12710default = _sys.getdefaultencoding()
12711if default == 'ascii':
12712 import locale
12713 import codecs
12714 try:
12715 default = locale.getdefaultlocale()[1]
12716 codecs.lookup(default)
7993762b 12717 except (ValueError, LookupError, TypeError):
3837a853
RD
12718 default = _sys.getdefaultencoding()
12719 del locale
12720 del codecs
5cbf236d
RD
12721if default:
12722 wx.SetDefaultPyEncoding(default)
12723del default
5cbf236d
RD
12724
12725#----------------------------------------------------------------------------
12726
d55e5bfc
RD
12727class PyDeadObjectError(AttributeError):
12728 pass
12729
12730class _wxPyDeadObject(object):
12731 """
12732 Instances of wx objects that are OOR capable will have their __class__
12733 changed to this class when the C++ object is deleted. This should help
12734 prevent crashes due to referencing a bogus C++ pointer.
12735 """
12736 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12737 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12738
12739 def __repr__(self):
12740 if not hasattr(self, "_name"):
12741 self._name = "[unknown]"
12742 return self.reprStr % self._name
12743
12744 def __getattr__(self, *args):
12745 if not hasattr(self, "_name"):
12746 self._name = "[unknown]"
12747 raise PyDeadObjectError(self.attrStr % self._name)
12748
12749 def __nonzero__(self):
12750 return 0
12751
12752
12753
12754class PyUnbornObjectError(AttributeError):
12755 pass
12756
12757class _wxPyUnbornObject(object):
12758 """
12759 Some stock objects are created when the wx._core module is
12760 imported, but their C++ instance is not created until the wx.App
12761 object is created and initialized. These object instances will
12762 temporarily have their __class__ changed to this class so an
12763 exception will be raised if they are used before the C++ instance
12764 is ready.
12765 """
12766
12767 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12768 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12769
12770 def __repr__(self):
12771 #if not hasattr(self, "_name"):
12772 # self._name = "[unknown]"
12773 return self.reprStr #% self._name
12774
12775 def __getattr__(self, *args):
12776 #if not hasattr(self, "_name"):
12777 # self._name = "[unknown]"
12778 raise PyUnbornObjectError(self.attrStr) # % self._name )
12779
12780 def __nonzero__(self):
12781 return 0
12782
12783
12784#----------------------------------------------------------------------------
d55e5bfc
RD
12785
12786def CallAfter(callable, *args, **kw):
12787 """
12788 Call the specified function after the current and pending event
12789 handlers have been completed. This is also good for making GUI
0439c23b
RD
12790 method calls from non-GUI threads. Any extra positional or
12791 keyword args are passed on to the callable when it is called.
12792
12793 :see: `wx.FutureCall`
d55e5bfc
RD
12794 """
12795 app = wx.GetApp()
a001823c 12796 assert app is not None, 'No wx.App created yet'
d55e5bfc 12797
891bb194
RD
12798 if not hasattr(app, "_CallAfterId"):
12799 app._CallAfterId = wx.NewEventType()
12800 app.Connect(-1, -1, app._CallAfterId,
12801 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 12802 evt = wx.PyEvent()
891bb194 12803 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
12804 evt.callable = callable
12805 evt.args = args
12806 evt.kw = kw
12807 wx.PostEvent(app, evt)
12808
d55e5bfc
RD
12809#----------------------------------------------------------------------------
12810
12811
12812class FutureCall:
12813 """
6e0de3df 12814 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
12815 object once after the given amount of milliseconds, passing any
12816 positional or keyword args. The return value of the callable is
0439c23b 12817 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
12818
12819 If you don't need to get the return value or restart the timer
12820 then there is no need to hold a reference to this object. It will
12821 hold a reference to itself while the timer is running (the timer
12822 has a reference to self.Notify) but the cycle will be broken when
12823 the timer completes, automatically cleaning up the wx.FutureCall
12824 object.
0439c23b
RD
12825
12826 :see: `wx.CallAfter`
d55e5bfc
RD
12827 """
12828 def __init__(self, millis, callable, *args, **kwargs):
12829 self.millis = millis
12830 self.callable = callable
12831 self.SetArgs(*args, **kwargs)
12832 self.runCount = 0
12833 self.running = False
12834 self.hasRun = False
12835 self.result = None
12836 self.timer = None
12837 self.Start()
12838
12839 def __del__(self):
12840 self.Stop()
12841
12842
12843 def Start(self, millis=None, *args, **kwargs):
12844 """
12845 (Re)start the timer
12846 """
12847 self.hasRun = False
12848 if millis is not None:
12849 self.millis = millis
12850 if args or kwargs:
12851 self.SetArgs(*args, **kwargs)
12852 self.Stop()
12853 self.timer = wx.PyTimer(self.Notify)
12854 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
12855 self.running = True
12856 Restart = Start
12857
12858
12859 def Stop(self):
12860 """
12861 Stop and destroy the timer.
12862 """
12863 if self.timer is not None:
12864 self.timer.Stop()
12865 self.timer = None
12866
12867
12868 def GetInterval(self):
12869 if self.timer is not None:
12870 return self.timer.GetInterval()
12871 else:
12872 return 0
12873
12874
12875 def IsRunning(self):
12876 return self.timer is not None and self.timer.IsRunning()
12877
12878
12879 def SetArgs(self, *args, **kwargs):
12880 """
12881 (Re)set the args passed to the callable object. This is
12882 useful in conjunction with Restart if you want to schedule a
12883 new call to the same callable object but with different
12884 parameters.
12885 """
12886 self.args = args
12887 self.kwargs = kwargs
12888
12889
12890 def HasRun(self):
12891 return self.hasRun
12892
12893 def GetResult(self):
12894 return self.result
12895
12896 def Notify(self):
12897 """
12898 The timer has expired so call the callable.
12899 """
12900 if self.callable and getattr(self.callable, 'im_self', True):
12901 self.runCount += 1
12902 self.running = False
12903 self.result = self.callable(*self.args, **self.kwargs)
12904 self.hasRun = True
12905 if not self.running:
12906 # if it wasn't restarted, then cleanup
12907 wx.CallAfter(self.Stop)
12908
12909
12910
12911#----------------------------------------------------------------------------
12912# Control which items in this module should be documented by epydoc.
12913# We allow only classes and functions, which will help reduce the size
12914# of the docs by filtering out the zillions of constants, EVT objects,
12915# and etc that don't make much sense by themselves, but are instead
12916# documented (or will be) as part of the classes/functions/methods
12917# where they should be used.
12918
d6c14a4c
RD
12919class __DocFilter:
12920 """
12921 A filter for epydoc that only allows non-Ptr classes and
34e0a3bb 12922 functions, in order to reduce the clutter in the API docs.
d6c14a4c
RD
12923 """
12924 def __init__(self, globals):
12925 self._globals = globals
12926
12927 def __call__(self, name):
12928 import types
12929 obj = self._globals.get(name, None)
34e0a3bb
RD
12930
12931 # only document classes and function
d6c14a4c
RD
12932 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12933 return False
34e0a3bb
RD
12934
12935 # skip other things that are private or will be documented as part of somethign else
1bd55598 12936 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
d6c14a4c 12937 return False
34e0a3bb
RD
12938
12939 # skip functions that are duplicates of static functions in a class
12940 if name.find('_') != -1:
12941 cls = self._globals.get(name.split('_')[0], None)
12942 methname = name.split('_')[1]
12943 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
12944 return False
12945
d6c14a4c 12946 return True
d55e5bfc
RD
12947
12948#----------------------------------------------------------------------------
12949#----------------------------------------------------------------------------
12950
12951# Import other modules in this package that should show up in the
12952# "core" wx namespace
12953from _gdi import *
12954from _windows import *
12955from _controls import *
12956from _misc import *
12957
d55e5bfc
RD
12958#----------------------------------------------------------------------------
12959#----------------------------------------------------------------------------
12960
12961
32fe5131 12962