]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gtk/_core.py
Forward port of changes for using themed drawing of owner-drawn buttons.
[wxWidgets.git] / wxPython / src / gtk / _core.py
CommitLineData
0085ce49 1# This file was created automatically by SWIG 1.3.29.
d14a1e28
RD
2# Don't modify this file, modify the SWIG interface instead.
3
54f9ee45 4import _core_
0085ce49
RD
5import new
6new_instancemethod = new.instancemethod
093d3ff1 7def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
0085ce49 8 if (name == "thisown"): return self.this.own(value)
093d3ff1 9 if (name == "this"):
0085ce49
RD
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
093d3ff1
RD
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
0085ce49 15 if (not static) or hasattr(self,name):
093d3ff1
RD
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
0085ce49 24 if (name == "thisown"): return self.this.own()
093d3ff1
RD
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
0085ce49
RD
29def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
093d3ff1
RD
34import types
35try:
36 _object = types.ObjectType
37 _newclass = 1
38except AttributeError:
39 class _object : pass
40 _newclass = 0
41del types
42
43
44def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
0085ce49
RD
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
093d3ff1
RD
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
d14a1e28
RD
54#// Give a reference to the dictionary of this module to the C++ extension
55#// code.
54f9ee45 56_core_._wxPySetDictionary(vars())
d14a1e28
RD
57
58#// A little trick to make 'wx' be a reference to this module so wx.Names can
59#// be used here.
60import sys as _sys
61wx = _sys.modules[__name__]
62
66c033b4
RD
63
64#----------------------------------------------------------------------------
65
66def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81#----------------------------------------------------------------------------
82
54f9ee45
RD
83NOT_FOUND = _core_.NOT_FOUND
84VSCROLL = _core_.VSCROLL
85HSCROLL = _core_.HSCROLL
86CAPTION = _core_.CAPTION
87DOUBLE_BORDER = _core_.DOUBLE_BORDER
88SUNKEN_BORDER = _core_.SUNKEN_BORDER
89RAISED_BORDER = _core_.RAISED_BORDER
90BORDER = _core_.BORDER
91SIMPLE_BORDER = _core_.SIMPLE_BORDER
92STATIC_BORDER = _core_.STATIC_BORDER
93TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94NO_BORDER = _core_.NO_BORDER
bcd0d7b6 95DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 96DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
54f9ee45
RD
97TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98WANTS_CHARS = _core_.WANTS_CHARS
99POPUP_WINDOW = _core_.POPUP_WINDOW
100CENTER_FRAME = _core_.CENTER_FRAME
101CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
54f9ee45
RD
103CLIP_CHILDREN = _core_.CLIP_CHILDREN
104CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
105ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
106RETAINED = _core_.RETAINED
107BACKINGSTORE = _core_.BACKINGSTORE
108COLOURED = _core_.COLOURED
109FIXED_LENGTH = _core_.FIXED_LENGTH
110LB_NEEDED_SB = _core_.LB_NEEDED_SB
111LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
112LB_SORT = _core_.LB_SORT
113LB_SINGLE = _core_.LB_SINGLE
114LB_MULTIPLE = _core_.LB_MULTIPLE
115LB_EXTENDED = _core_.LB_EXTENDED
116LB_OWNERDRAW = _core_.LB_OWNERDRAW
117LB_HSCROLL = _core_.LB_HSCROLL
118PROCESS_ENTER = _core_.PROCESS_ENTER
119PASSWORD = _core_.PASSWORD
120CB_SIMPLE = _core_.CB_SIMPLE
121CB_DROPDOWN = _core_.CB_DROPDOWN
122CB_SORT = _core_.CB_SORT
123CB_READONLY = _core_.CB_READONLY
124RA_HORIZONTAL = _core_.RA_HORIZONTAL
125RA_VERTICAL = _core_.RA_VERTICAL
126RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
127RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
fef4c27a 128RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
54f9ee45
RD
129RB_GROUP = _core_.RB_GROUP
130RB_SINGLE = _core_.RB_SINGLE
54f9ee45
RD
131SB_HORIZONTAL = _core_.SB_HORIZONTAL
132SB_VERTICAL = _core_.SB_VERTICAL
fef4c27a 133RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
54f9ee45
RD
134ST_SIZEGRIP = _core_.ST_SIZEGRIP
135ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
e9d6f3a4
RD
136ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
137ST_DOTS_END = _core_.ST_DOTS_END
54f9ee45
RD
138FLOOD_SURFACE = _core_.FLOOD_SURFACE
139FLOOD_BORDER = _core_.FLOOD_BORDER
140ODDEVEN_RULE = _core_.ODDEVEN_RULE
141WINDING_RULE = _core_.WINDING_RULE
142TOOL_TOP = _core_.TOOL_TOP
143TOOL_BOTTOM = _core_.TOOL_BOTTOM
144TOOL_LEFT = _core_.TOOL_LEFT
145TOOL_RIGHT = _core_.TOOL_RIGHT
146OK = _core_.OK
147YES_NO = _core_.YES_NO
148CANCEL = _core_.CANCEL
149YES = _core_.YES
150NO = _core_.NO
151NO_DEFAULT = _core_.NO_DEFAULT
152YES_DEFAULT = _core_.YES_DEFAULT
153ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
154ICON_HAND = _core_.ICON_HAND
155ICON_QUESTION = _core_.ICON_QUESTION
156ICON_INFORMATION = _core_.ICON_INFORMATION
157ICON_STOP = _core_.ICON_STOP
158ICON_ASTERISK = _core_.ICON_ASTERISK
159ICON_MASK = _core_.ICON_MASK
160ICON_WARNING = _core_.ICON_WARNING
161ICON_ERROR = _core_.ICON_ERROR
162FORWARD = _core_.FORWARD
163BACKWARD = _core_.BACKWARD
164RESET = _core_.RESET
165HELP = _core_.HELP
166MORE = _core_.MORE
167SETUP = _core_.SETUP
168SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
169SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
170SIZE_AUTO = _core_.SIZE_AUTO
171SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
172SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
943e8dfd 173SIZE_FORCE = _core_.SIZE_FORCE
54f9ee45
RD
174PORTRAIT = _core_.PORTRAIT
175LANDSCAPE = _core_.LANDSCAPE
176PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
177PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
178PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
179PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
180ID_ANY = _core_.ID_ANY
181ID_SEPARATOR = _core_.ID_SEPARATOR
943e8dfd 182ID_NONE = _core_.ID_NONE
54f9ee45
RD
183ID_LOWEST = _core_.ID_LOWEST
184ID_OPEN = _core_.ID_OPEN
185ID_CLOSE = _core_.ID_CLOSE
186ID_NEW = _core_.ID_NEW
187ID_SAVE = _core_.ID_SAVE
188ID_SAVEAS = _core_.ID_SAVEAS
189ID_REVERT = _core_.ID_REVERT
190ID_EXIT = _core_.ID_EXIT
191ID_UNDO = _core_.ID_UNDO
192ID_REDO = _core_.ID_REDO
193ID_HELP = _core_.ID_HELP
194ID_PRINT = _core_.ID_PRINT
195ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
196ID_PREVIEW = _core_.ID_PREVIEW
197ID_ABOUT = _core_.ID_ABOUT
198ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
199ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
200ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
201ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
202ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
203ID_PREFERENCES = _core_.ID_PREFERENCES
204ID_CUT = _core_.ID_CUT
205ID_COPY = _core_.ID_COPY
206ID_PASTE = _core_.ID_PASTE
207ID_CLEAR = _core_.ID_CLEAR
208ID_FIND = _core_.ID_FIND
209ID_DUPLICATE = _core_.ID_DUPLICATE
210ID_SELECTALL = _core_.ID_SELECTALL
211ID_DELETE = _core_.ID_DELETE
212ID_REPLACE = _core_.ID_REPLACE
213ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
214ID_PROPERTIES = _core_.ID_PROPERTIES
215ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
216ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
217ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
218ID_VIEW_LIST = _core_.ID_VIEW_LIST
219ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
220ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
221ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
222ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
223ID_FILE1 = _core_.ID_FILE1
224ID_FILE2 = _core_.ID_FILE2
225ID_FILE3 = _core_.ID_FILE3
226ID_FILE4 = _core_.ID_FILE4
227ID_FILE5 = _core_.ID_FILE5
228ID_FILE6 = _core_.ID_FILE6
229ID_FILE7 = _core_.ID_FILE7
230ID_FILE8 = _core_.ID_FILE8
231ID_FILE9 = _core_.ID_FILE9
232ID_OK = _core_.ID_OK
233ID_CANCEL = _core_.ID_CANCEL
234ID_APPLY = _core_.ID_APPLY
235ID_YES = _core_.ID_YES
236ID_NO = _core_.ID_NO
237ID_STATIC = _core_.ID_STATIC
238ID_FORWARD = _core_.ID_FORWARD
239ID_BACKWARD = _core_.ID_BACKWARD
240ID_DEFAULT = _core_.ID_DEFAULT
241ID_MORE = _core_.ID_MORE
242ID_SETUP = _core_.ID_SETUP
243ID_RESET = _core_.ID_RESET
244ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
245ID_YESTOALL = _core_.ID_YESTOALL
246ID_NOTOALL = _core_.ID_NOTOALL
247ID_ABORT = _core_.ID_ABORT
248ID_RETRY = _core_.ID_RETRY
249ID_IGNORE = _core_.ID_IGNORE
7bc1e663
RD
250ID_ADD = _core_.ID_ADD
251ID_REMOVE = _core_.ID_REMOVE
252ID_UP = _core_.ID_UP
253ID_DOWN = _core_.ID_DOWN
254ID_HOME = _core_.ID_HOME
255ID_REFRESH = _core_.ID_REFRESH
256ID_STOP = _core_.ID_STOP
257ID_INDEX = _core_.ID_INDEX
258ID_BOLD = _core_.ID_BOLD
259ID_ITALIC = _core_.ID_ITALIC
260ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
261ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
262ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
263ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
264ID_UNDERLINE = _core_.ID_UNDERLINE
265ID_INDENT = _core_.ID_INDENT
266ID_UNINDENT = _core_.ID_UNINDENT
267ID_ZOOM_100 = _core_.ID_ZOOM_100
268ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
269ID_ZOOM_IN = _core_.ID_ZOOM_IN
270ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
271ID_UNDELETE = _core_.ID_UNDELETE
272ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
54f9ee45 273ID_HIGHEST = _core_.ID_HIGHEST
54f9ee45
RD
274ACCEL_ALT = _core_.ACCEL_ALT
275ACCEL_CTRL = _core_.ACCEL_CTRL
276ACCEL_SHIFT = _core_.ACCEL_SHIFT
277ACCEL_NORMAL = _core_.ACCEL_NORMAL
278PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
279PD_APP_MODAL = _core_.PD_APP_MODAL
280PD_CAN_ABORT = _core_.PD_CAN_ABORT
281PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
282PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
283PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
e505d15e
RD
284PD_SMOOTH = _core_.PD_SMOOTH
285PD_CAN_SKIP = _core_.PD_CAN_SKIP
54f9ee45
RD
286MENU_TEAROFF = _core_.MENU_TEAROFF
287MB_DOCKABLE = _core_.MB_DOCKABLE
288NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
289FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
290LI_HORIZONTAL = _core_.LI_HORIZONTAL
291LI_VERTICAL = _core_.LI_VERTICAL
292WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
293WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
294WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
295WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
296WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
297WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
298MM_TEXT = _core_.MM_TEXT
299MM_LOMETRIC = _core_.MM_LOMETRIC
300MM_HIMETRIC = _core_.MM_HIMETRIC
301MM_LOENGLISH = _core_.MM_LOENGLISH
302MM_HIENGLISH = _core_.MM_HIENGLISH
303MM_TWIPS = _core_.MM_TWIPS
304MM_ISOTROPIC = _core_.MM_ISOTROPIC
305MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
306MM_POINTS = _core_.MM_POINTS
307MM_METRIC = _core_.MM_METRIC
308CENTRE = _core_.CENTRE
309CENTER = _core_.CENTER
310HORIZONTAL = _core_.HORIZONTAL
311VERTICAL = _core_.VERTICAL
312BOTH = _core_.BOTH
313LEFT = _core_.LEFT
314RIGHT = _core_.RIGHT
315UP = _core_.UP
316DOWN = _core_.DOWN
317TOP = _core_.TOP
318BOTTOM = _core_.BOTTOM
319NORTH = _core_.NORTH
320SOUTH = _core_.SOUTH
321WEST = _core_.WEST
322EAST = _core_.EAST
323ALL = _core_.ALL
324ALIGN_NOT = _core_.ALIGN_NOT
325ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
326ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
327ALIGN_LEFT = _core_.ALIGN_LEFT
328ALIGN_TOP = _core_.ALIGN_TOP
329ALIGN_RIGHT = _core_.ALIGN_RIGHT
330ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
331ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
332ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
333ALIGN_CENTER = _core_.ALIGN_CENTER
334ALIGN_CENTRE = _core_.ALIGN_CENTRE
335ALIGN_MASK = _core_.ALIGN_MASK
336STRETCH_NOT = _core_.STRETCH_NOT
337SHRINK = _core_.SHRINK
338GROW = _core_.GROW
339EXPAND = _core_.EXPAND
340SHAPED = _core_.SHAPED
341FIXED_MINSIZE = _core_.FIXED_MINSIZE
342TILE = _core_.TILE
343ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
344BORDER_DEFAULT = _core_.BORDER_DEFAULT
345BORDER_NONE = _core_.BORDER_NONE
346BORDER_STATIC = _core_.BORDER_STATIC
347BORDER_SIMPLE = _core_.BORDER_SIMPLE
348BORDER_RAISED = _core_.BORDER_RAISED
349BORDER_SUNKEN = _core_.BORDER_SUNKEN
350BORDER_DOUBLE = _core_.BORDER_DOUBLE
351BORDER_MASK = _core_.BORDER_MASK
7bc1e663
RD
352BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
353BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
354BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
54f9ee45
RD
355DEFAULT = _core_.DEFAULT
356DECORATIVE = _core_.DECORATIVE
357ROMAN = _core_.ROMAN
358SCRIPT = _core_.SCRIPT
359SWISS = _core_.SWISS
360MODERN = _core_.MODERN
361TELETYPE = _core_.TELETYPE
362VARIABLE = _core_.VARIABLE
363FIXED = _core_.FIXED
364NORMAL = _core_.NORMAL
365LIGHT = _core_.LIGHT
366BOLD = _core_.BOLD
367ITALIC = _core_.ITALIC
368SLANT = _core_.SLANT
369SOLID = _core_.SOLID
370DOT = _core_.DOT
371LONG_DASH = _core_.LONG_DASH
372SHORT_DASH = _core_.SHORT_DASH
373DOT_DASH = _core_.DOT_DASH
374USER_DASH = _core_.USER_DASH
375TRANSPARENT = _core_.TRANSPARENT
376STIPPLE = _core_.STIPPLE
d04418a7
RD
377STIPPLE_MASK = _core_.STIPPLE_MASK
378STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
54f9ee45
RD
379BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
380CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
381FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
382CROSS_HATCH = _core_.CROSS_HATCH
383HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
384VERTICAL_HATCH = _core_.VERTICAL_HATCH
385JOIN_BEVEL = _core_.JOIN_BEVEL
386JOIN_MITER = _core_.JOIN_MITER
387JOIN_ROUND = _core_.JOIN_ROUND
388CAP_ROUND = _core_.CAP_ROUND
389CAP_PROJECTING = _core_.CAP_PROJECTING
390CAP_BUTT = _core_.CAP_BUTT
391CLEAR = _core_.CLEAR
392XOR = _core_.XOR
393INVERT = _core_.INVERT
394OR_REVERSE = _core_.OR_REVERSE
395AND_REVERSE = _core_.AND_REVERSE
396COPY = _core_.COPY
397AND = _core_.AND
398AND_INVERT = _core_.AND_INVERT
399NO_OP = _core_.NO_OP
400NOR = _core_.NOR
401EQUIV = _core_.EQUIV
402SRC_INVERT = _core_.SRC_INVERT
403OR_INVERT = _core_.OR_INVERT
404NAND = _core_.NAND
405OR = _core_.OR
406SET = _core_.SET
407WXK_BACK = _core_.WXK_BACK
408WXK_TAB = _core_.WXK_TAB
409WXK_RETURN = _core_.WXK_RETURN
410WXK_ESCAPE = _core_.WXK_ESCAPE
411WXK_SPACE = _core_.WXK_SPACE
412WXK_DELETE = _core_.WXK_DELETE
413WXK_START = _core_.WXK_START
414WXK_LBUTTON = _core_.WXK_LBUTTON
415WXK_RBUTTON = _core_.WXK_RBUTTON
416WXK_CANCEL = _core_.WXK_CANCEL
417WXK_MBUTTON = _core_.WXK_MBUTTON
418WXK_CLEAR = _core_.WXK_CLEAR
419WXK_SHIFT = _core_.WXK_SHIFT
420WXK_ALT = _core_.WXK_ALT
421WXK_CONTROL = _core_.WXK_CONTROL
422WXK_MENU = _core_.WXK_MENU
423WXK_PAUSE = _core_.WXK_PAUSE
424WXK_CAPITAL = _core_.WXK_CAPITAL
425WXK_PRIOR = _core_.WXK_PRIOR
426WXK_NEXT = _core_.WXK_NEXT
427WXK_END = _core_.WXK_END
428WXK_HOME = _core_.WXK_HOME
429WXK_LEFT = _core_.WXK_LEFT
430WXK_UP = _core_.WXK_UP
431WXK_RIGHT = _core_.WXK_RIGHT
432WXK_DOWN = _core_.WXK_DOWN
433WXK_SELECT = _core_.WXK_SELECT
434WXK_PRINT = _core_.WXK_PRINT
435WXK_EXECUTE = _core_.WXK_EXECUTE
436WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
437WXK_INSERT = _core_.WXK_INSERT
438WXK_HELP = _core_.WXK_HELP
439WXK_NUMPAD0 = _core_.WXK_NUMPAD0
440WXK_NUMPAD1 = _core_.WXK_NUMPAD1
441WXK_NUMPAD2 = _core_.WXK_NUMPAD2
442WXK_NUMPAD3 = _core_.WXK_NUMPAD3
443WXK_NUMPAD4 = _core_.WXK_NUMPAD4
444WXK_NUMPAD5 = _core_.WXK_NUMPAD5
445WXK_NUMPAD6 = _core_.WXK_NUMPAD6
446WXK_NUMPAD7 = _core_.WXK_NUMPAD7
447WXK_NUMPAD8 = _core_.WXK_NUMPAD8
448WXK_NUMPAD9 = _core_.WXK_NUMPAD9
449WXK_MULTIPLY = _core_.WXK_MULTIPLY
450WXK_ADD = _core_.WXK_ADD
451WXK_SEPARATOR = _core_.WXK_SEPARATOR
452WXK_SUBTRACT = _core_.WXK_SUBTRACT
453WXK_DECIMAL = _core_.WXK_DECIMAL
454WXK_DIVIDE = _core_.WXK_DIVIDE
455WXK_F1 = _core_.WXK_F1
456WXK_F2 = _core_.WXK_F2
457WXK_F3 = _core_.WXK_F3
458WXK_F4 = _core_.WXK_F4
459WXK_F5 = _core_.WXK_F5
460WXK_F6 = _core_.WXK_F6
461WXK_F7 = _core_.WXK_F7
462WXK_F8 = _core_.WXK_F8
463WXK_F9 = _core_.WXK_F9
464WXK_F10 = _core_.WXK_F10
465WXK_F11 = _core_.WXK_F11
466WXK_F12 = _core_.WXK_F12
467WXK_F13 = _core_.WXK_F13
468WXK_F14 = _core_.WXK_F14
469WXK_F15 = _core_.WXK_F15
470WXK_F16 = _core_.WXK_F16
471WXK_F17 = _core_.WXK_F17
472WXK_F18 = _core_.WXK_F18
473WXK_F19 = _core_.WXK_F19
474WXK_F20 = _core_.WXK_F20
475WXK_F21 = _core_.WXK_F21
476WXK_F22 = _core_.WXK_F22
477WXK_F23 = _core_.WXK_F23
478WXK_F24 = _core_.WXK_F24
479WXK_NUMLOCK = _core_.WXK_NUMLOCK
480WXK_SCROLL = _core_.WXK_SCROLL
481WXK_PAGEUP = _core_.WXK_PAGEUP
482WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
483WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
484WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
485WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
486WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
487WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
488WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
489WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
490WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
491WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
492WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
493WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
494WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
495WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
496WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
497WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
498WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
499WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
500WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
501WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
502WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
503WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
504WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
505WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
506WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
507WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
508WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
509WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
510WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
511WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
512WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
88c6b281
RD
513WXK_COMMAND = _core_.WXK_COMMAND
514WXK_SPECIAL1 = _core_.WXK_SPECIAL1
515WXK_SPECIAL2 = _core_.WXK_SPECIAL2
516WXK_SPECIAL3 = _core_.WXK_SPECIAL3
517WXK_SPECIAL4 = _core_.WXK_SPECIAL4
518WXK_SPECIAL5 = _core_.WXK_SPECIAL5
519WXK_SPECIAL6 = _core_.WXK_SPECIAL6
520WXK_SPECIAL7 = _core_.WXK_SPECIAL7
521WXK_SPECIAL8 = _core_.WXK_SPECIAL8
522WXK_SPECIAL9 = _core_.WXK_SPECIAL9
523WXK_SPECIAL10 = _core_.WXK_SPECIAL10
524WXK_SPECIAL11 = _core_.WXK_SPECIAL11
525WXK_SPECIAL12 = _core_.WXK_SPECIAL12
526WXK_SPECIAL13 = _core_.WXK_SPECIAL13
527WXK_SPECIAL14 = _core_.WXK_SPECIAL14
528WXK_SPECIAL15 = _core_.WXK_SPECIAL15
529WXK_SPECIAL16 = _core_.WXK_SPECIAL16
530WXK_SPECIAL17 = _core_.WXK_SPECIAL17
531WXK_SPECIAL18 = _core_.WXK_SPECIAL18
532WXK_SPECIAL19 = _core_.WXK_SPECIAL19
533WXK_SPECIAL20 = _core_.WXK_SPECIAL20
54f9ee45
RD
534PAPER_NONE = _core_.PAPER_NONE
535PAPER_LETTER = _core_.PAPER_LETTER
536PAPER_LEGAL = _core_.PAPER_LEGAL
537PAPER_A4 = _core_.PAPER_A4
538PAPER_CSHEET = _core_.PAPER_CSHEET
539PAPER_DSHEET = _core_.PAPER_DSHEET
540PAPER_ESHEET = _core_.PAPER_ESHEET
541PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
542PAPER_TABLOID = _core_.PAPER_TABLOID
543PAPER_LEDGER = _core_.PAPER_LEDGER
544PAPER_STATEMENT = _core_.PAPER_STATEMENT
545PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
546PAPER_A3 = _core_.PAPER_A3
547PAPER_A4SMALL = _core_.PAPER_A4SMALL
548PAPER_A5 = _core_.PAPER_A5
549PAPER_B4 = _core_.PAPER_B4
550PAPER_B5 = _core_.PAPER_B5
551PAPER_FOLIO = _core_.PAPER_FOLIO
552PAPER_QUARTO = _core_.PAPER_QUARTO
553PAPER_10X14 = _core_.PAPER_10X14
554PAPER_11X17 = _core_.PAPER_11X17
555PAPER_NOTE = _core_.PAPER_NOTE
556PAPER_ENV_9 = _core_.PAPER_ENV_9
557PAPER_ENV_10 = _core_.PAPER_ENV_10
558PAPER_ENV_11 = _core_.PAPER_ENV_11
559PAPER_ENV_12 = _core_.PAPER_ENV_12
560PAPER_ENV_14 = _core_.PAPER_ENV_14
561PAPER_ENV_DL = _core_.PAPER_ENV_DL
562PAPER_ENV_C5 = _core_.PAPER_ENV_C5
563PAPER_ENV_C3 = _core_.PAPER_ENV_C3
564PAPER_ENV_C4 = _core_.PAPER_ENV_C4
565PAPER_ENV_C6 = _core_.PAPER_ENV_C6
566PAPER_ENV_C65 = _core_.PAPER_ENV_C65
567PAPER_ENV_B4 = _core_.PAPER_ENV_B4
568PAPER_ENV_B5 = _core_.PAPER_ENV_B5
569PAPER_ENV_B6 = _core_.PAPER_ENV_B6
570PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
571PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
572PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
573PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
574PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
575PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
576PAPER_ISO_B4 = _core_.PAPER_ISO_B4
577PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
578PAPER_9X11 = _core_.PAPER_9X11
579PAPER_10X11 = _core_.PAPER_10X11
580PAPER_15X11 = _core_.PAPER_15X11
581PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
582PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
583PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
584PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
585PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
586PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
587PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
588PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
589PAPER_A_PLUS = _core_.PAPER_A_PLUS
590PAPER_B_PLUS = _core_.PAPER_B_PLUS
591PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
592PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
593PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
594PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
595PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
596PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
597PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
598PAPER_A2 = _core_.PAPER_A2
599PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
600PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
6c75a4cf
RD
601PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
602PAPER_A6 = _core_.PAPER_A6
603PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
604PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
605PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
606PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
607PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
608PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
609PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
610PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
611PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
612PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
613PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
614PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
615PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
616PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
617PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
618PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
619PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
620PAPER_B6_JIS = _core_.PAPER_B6_JIS
621PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
622PAPER_12X11 = _core_.PAPER_12X11
623PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
624PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
625PAPER_P16K = _core_.PAPER_P16K
626PAPER_P32K = _core_.PAPER_P32K
627PAPER_P32KBIG = _core_.PAPER_P32KBIG
628PAPER_PENV_1 = _core_.PAPER_PENV_1
629PAPER_PENV_2 = _core_.PAPER_PENV_2
630PAPER_PENV_3 = _core_.PAPER_PENV_3
631PAPER_PENV_4 = _core_.PAPER_PENV_4
632PAPER_PENV_5 = _core_.PAPER_PENV_5
633PAPER_PENV_6 = _core_.PAPER_PENV_6
634PAPER_PENV_7 = _core_.PAPER_PENV_7
635PAPER_PENV_8 = _core_.PAPER_PENV_8
636PAPER_PENV_9 = _core_.PAPER_PENV_9
637PAPER_PENV_10 = _core_.PAPER_PENV_10
638PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
639PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
640PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
641PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
642PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
643PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
644PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
645PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
646PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
647PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
648PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
649PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
650PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
54f9ee45
RD
651DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
652DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
653DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
654ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
655ITEM_NORMAL = _core_.ITEM_NORMAL
656ITEM_CHECK = _core_.ITEM_CHECK
657ITEM_RADIO = _core_.ITEM_RADIO
658ITEM_MAX = _core_.ITEM_MAX
659HT_NOWHERE = _core_.HT_NOWHERE
660HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
661HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
662HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
663HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
664HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
665HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
666HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
667HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
668HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
669HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
670HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
671HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
672HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
673HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
674HT_MAX = _core_.HT_MAX
675MOD_NONE = _core_.MOD_NONE
676MOD_ALT = _core_.MOD_ALT
677MOD_CONTROL = _core_.MOD_CONTROL
943e8dfd 678MOD_ALTGR = _core_.MOD_ALTGR
54f9ee45 679MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 680MOD_META = _core_.MOD_META
54f9ee45 681MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
682MOD_CMD = _core_.MOD_CMD
683MOD_ALL = _core_.MOD_ALL
54f9ee45
RD
684UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
685UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
686UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d14a1e28
RD
687#---------------------------------------------------------------------------
688
689class Object(object):
0df68c9f
RD
690 """
691 The base class for most wx objects, although in wxPython not
692 much functionality is needed nor exposed.
693 """
0085ce49
RD
694 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
695 def __init__(self): raise AttributeError, "No constructor defined"
696 __repr__ = _swig_repr
e811c8ce 697 def GetClassName(*args, **kwargs):
0df68c9f 698 """
a95a7133 699 GetClassName(self) -> String
e811c8ce 700
a95a7133 701 Returns the class name of the C++ class using wxRTTI.
0df68c9f 702 """
54f9ee45 703 return _core_.Object_GetClassName(*args, **kwargs)
e811c8ce
RD
704
705 def Destroy(*args, **kwargs):
0df68c9f 706 """
a95a7133 707 Destroy(self)
e811c8ce 708
0df68c9f
RD
709 Deletes the C++ object this Python object is a proxy for.
710 """
7e08d4ef
RD
711 val = _core_.Object_Destroy(*args, **kwargs)
712 args[0].thisown = 0
713 return val
e811c8ce 714
2131d850 715_core_.Object_swigregister(Object)
54f9ee45 716_wxPySetDictionary = _core_._wxPySetDictionary
54f9ee45 717cvar = _core_.cvar
196addbf 718EmptyString = cvar.EmptyString
d14a1e28
RD
719
720#---------------------------------------------------------------------------
721
54f9ee45
RD
722BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
723BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
724BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
725BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
726BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
727BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
728BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
729BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
730BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
731BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
732BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
733BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
734BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
735BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
736BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
737BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
738BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
739BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
740BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
741BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
742CURSOR_NONE = _core_.CURSOR_NONE
743CURSOR_ARROW = _core_.CURSOR_ARROW
744CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
745CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
746CURSOR_CHAR = _core_.CURSOR_CHAR
747CURSOR_CROSS = _core_.CURSOR_CROSS
748CURSOR_HAND = _core_.CURSOR_HAND
749CURSOR_IBEAM = _core_.CURSOR_IBEAM
750CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
751CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
752CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
753CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
754CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
755CURSOR_PENCIL = _core_.CURSOR_PENCIL
756CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
757CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
758CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
759CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
760CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
761CURSOR_SIZENS = _core_.CURSOR_SIZENS
762CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
763CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
764CURSOR_SIZING = _core_.CURSOR_SIZING
765CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
766CURSOR_WAIT = _core_.CURSOR_WAIT
767CURSOR_WATCH = _core_.CURSOR_WATCH
768CURSOR_BLANK = _core_.CURSOR_BLANK
769CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
770CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
771CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
772CURSOR_MAX = _core_.CURSOR_MAX
d14a1e28
RD
773#---------------------------------------------------------------------------
774
775class Size(object):
0df68c9f 776 """
41e2b43e 777 wx.Size is a useful data structure used to represent the size of
0085ce49
RD
778 something. It simply contains integer width and height
779 properties. In most places in wxPython where a wx.Size is
093d3ff1 780 expected a (width, height) tuple can be used instead.
0df68c9f 781 """
0085ce49
RD
782 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
783 __repr__ = _swig_repr
54f9ee45
RD
784 width = property(_core_.Size_width_get, _core_.Size_width_set)
785 height = property(_core_.Size_height_get, _core_.Size_height_set)
242b7b46 786 x = width; y = height
0085ce49 787 def __init__(self, *args, **kwargs):
0df68c9f 788 """
a95a7133 789 __init__(self, int w=0, int h=0) -> Size
e811c8ce 790
0df68c9f
RD
791 Creates a size object.
792 """
0085ce49
RD
793 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
794 __swig_destroy__ = _core_.delete_Size
795 __del__ = lambda self : None;
e811c8ce 796 def __eq__(*args, **kwargs):
0df68c9f 797 """
e9d6f3a4 798 __eq__(self, PyObject other) -> bool
e811c8ce 799
0df68c9f
RD
800 Test for equality of wx.Size objects.
801 """
54f9ee45 802 return _core_.Size___eq__(*args, **kwargs)
e811c8ce
RD
803
804 def __ne__(*args, **kwargs):
0df68c9f 805 """
e9d6f3a4 806 __ne__(self, PyObject other) -> bool
e811c8ce 807
e9d6f3a4 808 Test for inequality of wx.Size objects.
0df68c9f 809 """
54f9ee45 810 return _core_.Size___ne__(*args, **kwargs)
e811c8ce
RD
811
812 def __add__(*args, **kwargs):
0df68c9f 813 """
a95a7133 814 __add__(self, Size sz) -> Size
e811c8ce 815
0df68c9f
RD
816 Add sz's proprties to this and return the result.
817 """
54f9ee45 818 return _core_.Size___add__(*args, **kwargs)
e811c8ce
RD
819
820 def __sub__(*args, **kwargs):
0df68c9f 821 """
a95a7133 822 __sub__(self, Size sz) -> Size
e811c8ce 823
0df68c9f
RD
824 Subtract sz's properties from this and return the result.
825 """
54f9ee45 826 return _core_.Size___sub__(*args, **kwargs)
e811c8ce
RD
827
828 def IncTo(*args, **kwargs):
0df68c9f 829 """
a95a7133 830 IncTo(self, Size sz)
e811c8ce 831
0df68c9f
RD
832 Increments this object so that both of its dimensions are not less
833 than the corresponding dimensions of the size.
834 """
54f9ee45 835 return _core_.Size_IncTo(*args, **kwargs)
e811c8ce
RD
836
837 def DecTo(*args, **kwargs):
0df68c9f 838 """
a95a7133 839 DecTo(self, Size sz)
e811c8ce 840
0df68c9f
RD
841 Decrements this object so that both of its dimensions are not greater
842 than the corresponding dimensions of the size.
843 """
54f9ee45 844 return _core_.Size_DecTo(*args, **kwargs)
e811c8ce
RD
845
846 def Set(*args, **kwargs):
0df68c9f 847 """
a95a7133 848 Set(self, int w, int h)
e811c8ce 849
0df68c9f
RD
850 Set both width and height.
851 """
54f9ee45 852 return _core_.Size_Set(*args, **kwargs)
e811c8ce
RD
853
854 def SetWidth(*args, **kwargs):
a95a7133 855 """SetWidth(self, int w)"""
54f9ee45 856 return _core_.Size_SetWidth(*args, **kwargs)
e811c8ce
RD
857
858 def SetHeight(*args, **kwargs):
a95a7133 859 """SetHeight(self, int h)"""
54f9ee45 860 return _core_.Size_SetHeight(*args, **kwargs)
e811c8ce
RD
861
862 def GetWidth(*args, **kwargs):
a95a7133 863 """GetWidth(self) -> int"""
54f9ee45 864 return _core_.Size_GetWidth(*args, **kwargs)
e811c8ce
RD
865
866 def GetHeight(*args, **kwargs):
a95a7133 867 """GetHeight(self) -> int"""
54f9ee45 868 return _core_.Size_GetHeight(*args, **kwargs)
e811c8ce 869
74a57fcd
RD
870 def IsFullySpecified(*args, **kwargs):
871 """
a95a7133 872 IsFullySpecified(self) -> bool
74a57fcd
RD
873
874 Returns True if both components of the size are non-default values.
875 """
54f9ee45 876 return _core_.Size_IsFullySpecified(*args, **kwargs)
74a57fcd
RD
877
878 def SetDefaults(*args, **kwargs):
879 """
a95a7133 880 SetDefaults(self, Size size)
74a57fcd 881
41e2b43e
RD
882 Combine this size with the other one replacing the default components
883 of this object (i.e. equal to -1) with those of the other.
74a57fcd 884 """
54f9ee45 885 return _core_.Size_SetDefaults(*args, **kwargs)
74a57fcd 886
e811c8ce 887 def Get(*args, **kwargs):
0df68c9f
RD
888 """
889 Get() -> (width,height)
e811c8ce 890
0df68c9f
RD
891 Returns the width and height properties as a tuple.
892 """
54f9ee45 893 return _core_.Size_Get(*args, **kwargs)
e811c8ce 894
41e2b43e 895 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
896 def __str__(self): return str(self.Get())
897 def __repr__(self): return 'wx.Size'+str(self.Get())
898 def __len__(self): return len(self.Get())
899 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
900 def __setitem__(self, index, val):
901 if index == 0: self.width = val
902 elif index == 1: self.height = val
903 else: raise IndexError
e811c8ce 904 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
905 __safe_for_unpickling__ = True
906 def __reduce__(self): return (wx.Size, self.Get())
d14a1e28 907
2131d850 908_core_.Size_swigregister(Size)
d14a1e28
RD
909
910#---------------------------------------------------------------------------
911
912class RealPoint(object):
0df68c9f 913 """
41e2b43e
RD
914 A data structure for representing a point or position with floating
915 point x and y properties. In wxPython most places that expect a
916 wx.RealPoint can also accept a (x,y) tuple.
0df68c9f 917 """
0085ce49
RD
918 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
919 __repr__ = _swig_repr
54f9ee45
RD
920 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
921 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
0085ce49 922 def __init__(self, *args, **kwargs):
0df68c9f 923 """
a95a7133 924 __init__(self, double x=0.0, double y=0.0) -> RealPoint
e811c8ce 925
0df68c9f
RD
926 Create a wx.RealPoint object
927 """
0085ce49
RD
928 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
929 __swig_destroy__ = _core_.delete_RealPoint
930 __del__ = lambda self : None;
e811c8ce 931 def __eq__(*args, **kwargs):
0df68c9f 932 """
e9d6f3a4 933 __eq__(self, PyObject other) -> bool
e811c8ce 934
0df68c9f
RD
935 Test for equality of wx.RealPoint objects.
936 """
54f9ee45 937 return _core_.RealPoint___eq__(*args, **kwargs)
e811c8ce
RD
938
939 def __ne__(*args, **kwargs):
0df68c9f 940 """
e9d6f3a4 941 __ne__(self, PyObject other) -> bool
e811c8ce 942
0df68c9f
RD
943 Test for inequality of wx.RealPoint objects.
944 """
54f9ee45 945 return _core_.RealPoint___ne__(*args, **kwargs)
e811c8ce
RD
946
947 def __add__(*args, **kwargs):
0df68c9f 948 """
a95a7133 949 __add__(self, RealPoint pt) -> RealPoint
e811c8ce 950
0df68c9f
RD
951 Add pt's proprties to this and return the result.
952 """
54f9ee45 953 return _core_.RealPoint___add__(*args, **kwargs)
e811c8ce
RD
954
955 def __sub__(*args, **kwargs):
0df68c9f 956 """
a95a7133 957 __sub__(self, RealPoint pt) -> RealPoint
e811c8ce 958
0df68c9f
RD
959 Subtract pt's proprties from this and return the result
960 """
54f9ee45 961 return _core_.RealPoint___sub__(*args, **kwargs)
e811c8ce
RD
962
963 def Set(*args, **kwargs):
0df68c9f 964 """
a95a7133 965 Set(self, double x, double y)
e811c8ce 966
0df68c9f
RD
967 Set both the x and y properties
968 """
54f9ee45 969 return _core_.RealPoint_Set(*args, **kwargs)
e811c8ce
RD
970
971 def Get(*args, **kwargs):
0df68c9f
RD
972 """
973 Get() -> (x,y)
e811c8ce 974
0df68c9f
RD
975 Return the x and y properties as a tuple.
976 """
54f9ee45 977 return _core_.RealPoint_Get(*args, **kwargs)
e811c8ce 978
41e2b43e 979 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
980 def __str__(self): return str(self.Get())
981 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
982 def __len__(self): return len(self.Get())
983 def __getitem__(self, index): return self.Get()[index]
d14a1e28 984 def __setitem__(self, index, val):
e811c8ce
RD
985 if index == 0: self.x = val
986 elif index == 1: self.y = val
d14a1e28 987 else: raise IndexError
e811c8ce 988 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
989 __safe_for_unpickling__ = True
990 def __reduce__(self): return (wx.RealPoint, self.Get())
d14a1e28 991
2131d850 992_core_.RealPoint_swigregister(RealPoint)
d14a1e28
RD
993
994#---------------------------------------------------------------------------
995
996class Point(object):
0df68c9f 997 """
41e2b43e
RD
998 A data structure for representing a point or position with integer x
999 and y properties. Most places in wxPython that expect a wx.Point can
1000 also accept a (x,y) tuple.
0df68c9f 1001 """
0085ce49
RD
1002 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1003 __repr__ = _swig_repr
54f9ee45
RD
1004 x = property(_core_.Point_x_get, _core_.Point_x_set)
1005 y = property(_core_.Point_y_get, _core_.Point_y_set)
0085ce49 1006 def __init__(self, *args, **kwargs):
0df68c9f 1007 """
a95a7133 1008 __init__(self, int x=0, int y=0) -> Point
e811c8ce 1009
0df68c9f
RD
1010 Create a wx.Point object
1011 """
0085ce49
RD
1012 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1013 __swig_destroy__ = _core_.delete_Point
1014 __del__ = lambda self : None;
e811c8ce 1015 def __eq__(*args, **kwargs):
0df68c9f 1016 """
e9d6f3a4 1017 __eq__(self, PyObject other) -> bool
e811c8ce 1018
0df68c9f
RD
1019 Test for equality of wx.Point objects.
1020 """
54f9ee45 1021 return _core_.Point___eq__(*args, **kwargs)
e811c8ce
RD
1022
1023 def __ne__(*args, **kwargs):
0df68c9f 1024 """
e9d6f3a4 1025 __ne__(self, PyObject other) -> bool
e811c8ce 1026
0df68c9f
RD
1027 Test for inequality of wx.Point objects.
1028 """
54f9ee45 1029 return _core_.Point___ne__(*args, **kwargs)
e811c8ce
RD
1030
1031 def __add__(*args, **kwargs):
0df68c9f 1032 """
a95a7133 1033 __add__(self, Point pt) -> Point
e811c8ce 1034
0df68c9f
RD
1035 Add pt's proprties to this and return the result.
1036 """
54f9ee45 1037 return _core_.Point___add__(*args, **kwargs)
e811c8ce
RD
1038
1039 def __sub__(*args, **kwargs):
0df68c9f 1040 """
a95a7133 1041 __sub__(self, Point pt) -> Point
e811c8ce 1042
0df68c9f
RD
1043 Subtract pt's proprties from this and return the result
1044 """
54f9ee45 1045 return _core_.Point___sub__(*args, **kwargs)
e811c8ce
RD
1046
1047 def __iadd__(*args, **kwargs):
0df68c9f 1048 """
a95a7133 1049 __iadd__(self, Point pt) -> Point
e811c8ce 1050
0df68c9f
RD
1051 Add pt to this object.
1052 """
54f9ee45 1053 return _core_.Point___iadd__(*args, **kwargs)
e811c8ce
RD
1054
1055 def __isub__(*args, **kwargs):
0df68c9f 1056 """
a95a7133 1057 __isub__(self, Point pt) -> Point
e811c8ce 1058
0df68c9f
RD
1059 Subtract pt from this object.
1060 """
54f9ee45 1061 return _core_.Point___isub__(*args, **kwargs)
e811c8ce
RD
1062
1063 def Set(*args, **kwargs):
0df68c9f 1064 """
a95a7133 1065 Set(self, long x, long y)
e811c8ce 1066
0df68c9f
RD
1067 Set both the x and y properties
1068 """
54f9ee45 1069 return _core_.Point_Set(*args, **kwargs)
e811c8ce
RD
1070
1071 def Get(*args, **kwargs):
0df68c9f
RD
1072 """
1073 Get() -> (x,y)
e811c8ce 1074
0df68c9f
RD
1075 Return the x and y properties as a tuple.
1076 """
54f9ee45 1077 return _core_.Point_Get(*args, **kwargs)
e811c8ce 1078
41e2b43e 1079 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1080 def __str__(self): return str(self.Get())
1081 def __repr__(self): return 'wx.Point'+str(self.Get())
1082 def __len__(self): return len(self.Get())
1083 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1084 def __setitem__(self, index, val):
1085 if index == 0: self.x = val
1086 elif index == 1: self.y = val
1087 else: raise IndexError
e811c8ce 1088 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
1089 __safe_for_unpickling__ = True
1090 def __reduce__(self): return (wx.Point, self.Get())
d14a1e28 1091
2131d850 1092_core_.Point_swigregister(Point)
d14a1e28
RD
1093
1094#---------------------------------------------------------------------------
1095
1096class Rect(object):
0df68c9f 1097 """
41e2b43e
RD
1098 A class for representing and manipulating rectangles. It has x, y,
1099 width and height properties. In wxPython most palces that expect a
1100 wx.Rect can also accept a (x,y,width,height) tuple.
0df68c9f 1101 """
0085ce49
RD
1102 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1103 __repr__ = _swig_repr
1104 def __init__(self, *args, **kwargs):
0df68c9f 1105 """
a95a7133 1106 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
e811c8ce 1107
0df68c9f
RD
1108 Create a new Rect object.
1109 """
0085ce49
RD
1110 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1111 __swig_destroy__ = _core_.delete_Rect
1112 __del__ = lambda self : None;
e811c8ce 1113 def GetX(*args, **kwargs):
a95a7133 1114 """GetX(self) -> int"""
54f9ee45 1115 return _core_.Rect_GetX(*args, **kwargs)
e811c8ce
RD
1116
1117 def SetX(*args, **kwargs):
a95a7133 1118 """SetX(self, int x)"""
54f9ee45 1119 return _core_.Rect_SetX(*args, **kwargs)
e811c8ce
RD
1120
1121 def GetY(*args, **kwargs):
a95a7133 1122 """GetY(self) -> int"""
54f9ee45 1123 return _core_.Rect_GetY(*args, **kwargs)
e811c8ce
RD
1124
1125 def SetY(*args, **kwargs):
a95a7133 1126 """SetY(self, int y)"""
54f9ee45 1127 return _core_.Rect_SetY(*args, **kwargs)
e811c8ce
RD
1128
1129 def GetWidth(*args, **kwargs):
a95a7133 1130 """GetWidth(self) -> int"""
54f9ee45 1131 return _core_.Rect_GetWidth(*args, **kwargs)
e811c8ce
RD
1132
1133 def SetWidth(*args, **kwargs):
a95a7133 1134 """SetWidth(self, int w)"""
54f9ee45 1135 return _core_.Rect_SetWidth(*args, **kwargs)
e811c8ce
RD
1136
1137 def GetHeight(*args, **kwargs):
a95a7133 1138 """GetHeight(self) -> int"""
54f9ee45 1139 return _core_.Rect_GetHeight(*args, **kwargs)
e811c8ce
RD
1140
1141 def SetHeight(*args, **kwargs):
a95a7133 1142 """SetHeight(self, int h)"""
54f9ee45 1143 return _core_.Rect_SetHeight(*args, **kwargs)
e811c8ce
RD
1144
1145 def GetPosition(*args, **kwargs):
a95a7133 1146 """GetPosition(self) -> Point"""
54f9ee45 1147 return _core_.Rect_GetPosition(*args, **kwargs)
e811c8ce
RD
1148
1149 def SetPosition(*args, **kwargs):
a95a7133 1150 """SetPosition(self, Point p)"""
54f9ee45 1151 return _core_.Rect_SetPosition(*args, **kwargs)
e811c8ce
RD
1152
1153 def GetSize(*args, **kwargs):
a95a7133 1154 """GetSize(self) -> Size"""
54f9ee45 1155 return _core_.Rect_GetSize(*args, **kwargs)
e811c8ce
RD
1156
1157 def SetSize(*args, **kwargs):
a95a7133 1158 """SetSize(self, Size s)"""
54f9ee45 1159 return _core_.Rect_SetSize(*args, **kwargs)
e811c8ce 1160
aff4cc5c
RD
1161 def IsEmpty(*args, **kwargs):
1162 """IsEmpty(self) -> bool"""
1163 return _core_.Rect_IsEmpty(*args, **kwargs)
1164
c9c7117a 1165 def GetTopLeft(*args, **kwargs):
a95a7133 1166 """GetTopLeft(self) -> Point"""
54f9ee45 1167 return _core_.Rect_GetTopLeft(*args, **kwargs)
c9c7117a
RD
1168
1169 def SetTopLeft(*args, **kwargs):
a95a7133 1170 """SetTopLeft(self, Point p)"""
54f9ee45 1171 return _core_.Rect_SetTopLeft(*args, **kwargs)
c9c7117a
RD
1172
1173 def GetBottomRight(*args, **kwargs):
a95a7133 1174 """GetBottomRight(self) -> Point"""
54f9ee45 1175 return _core_.Rect_GetBottomRight(*args, **kwargs)
c9c7117a
RD
1176
1177 def SetBottomRight(*args, **kwargs):
a95a7133 1178 """SetBottomRight(self, Point p)"""
54f9ee45 1179 return _core_.Rect_SetBottomRight(*args, **kwargs)
c9c7117a 1180
e811c8ce 1181 def GetLeft(*args, **kwargs):
a95a7133 1182 """GetLeft(self) -> int"""
54f9ee45 1183 return _core_.Rect_GetLeft(*args, **kwargs)
e811c8ce
RD
1184
1185 def GetTop(*args, **kwargs):
a95a7133 1186 """GetTop(self) -> int"""
54f9ee45 1187 return _core_.Rect_GetTop(*args, **kwargs)
e811c8ce
RD
1188
1189 def GetBottom(*args, **kwargs):
a95a7133 1190 """GetBottom(self) -> int"""
54f9ee45 1191 return _core_.Rect_GetBottom(*args, **kwargs)
e811c8ce
RD
1192
1193 def GetRight(*args, **kwargs):
a95a7133 1194 """GetRight(self) -> int"""
54f9ee45 1195 return _core_.Rect_GetRight(*args, **kwargs)
e811c8ce
RD
1196
1197 def SetLeft(*args, **kwargs):
a95a7133 1198 """SetLeft(self, int left)"""
54f9ee45 1199 return _core_.Rect_SetLeft(*args, **kwargs)
e811c8ce
RD
1200
1201 def SetRight(*args, **kwargs):
a95a7133 1202 """SetRight(self, int right)"""
54f9ee45 1203 return _core_.Rect_SetRight(*args, **kwargs)
e811c8ce
RD
1204
1205 def SetTop(*args, **kwargs):
a95a7133 1206 """SetTop(self, int top)"""
54f9ee45 1207 return _core_.Rect_SetTop(*args, **kwargs)
e811c8ce
RD
1208
1209 def SetBottom(*args, **kwargs):
a95a7133 1210 """SetBottom(self, int bottom)"""
54f9ee45 1211 return _core_.Rect_SetBottom(*args, **kwargs)
e811c8ce
RD
1212
1213 position = property(GetPosition, SetPosition)
1214 size = property(GetSize, SetSize)
1215 left = property(GetLeft, SetLeft)
1216 right = property(GetRight, SetRight)
1217 top = property(GetTop, SetTop)
1218 bottom = property(GetBottom, SetBottom)
1219
1220 def Inflate(*args, **kwargs):
0df68c9f 1221 """
a95a7133 1222 Inflate(self, int dx, int dy) -> Rect
e811c8ce 1223
8e738329
RD
1224 Increases the size of the rectangle.
1225
1226 The left border is moved farther left and the right border is moved
1227 farther right by ``dx``. The upper border is moved farther up and the
1228 bottom border is moved farther down by ``dy``. (Note the the width and
1229 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1230 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1231 opposite happens: the rectangle size decreases in the respective
1232 direction.
1233
1234 The change is made to the rectangle inplace, if instead you need a
1235 copy that is inflated, preserving the original then make the copy
1236 first::
1237
1238 copy = wx.Rect(*original)
1239 copy.Inflate(10,15)
1240
1241
0df68c9f 1242 """
54f9ee45 1243 return _core_.Rect_Inflate(*args, **kwargs)
e811c8ce
RD
1244
1245 def Deflate(*args, **kwargs):
0df68c9f 1246 """
a95a7133 1247 Deflate(self, int dx, int dy) -> Rect
e811c8ce 1248
8e738329
RD
1249 Decrease the rectangle size. This method is the opposite of `Inflate`
1250 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1251 `Inflate` for a full description.
0df68c9f 1252 """
54f9ee45 1253 return _core_.Rect_Deflate(*args, **kwargs)
e811c8ce
RD
1254
1255 def OffsetXY(*args, **kwargs):
0df68c9f 1256 """
a95a7133 1257 OffsetXY(self, int dx, int dy)
e811c8ce 1258
41e2b43e
RD
1259 Moves the rectangle by the specified offset. If dx is positive, the
1260 rectangle is moved to the right, if dy is positive, it is moved to the
1261 bottom, otherwise it is moved to the left or top respectively.
0df68c9f 1262 """
54f9ee45 1263 return _core_.Rect_OffsetXY(*args, **kwargs)
e811c8ce
RD
1264
1265 def Offset(*args, **kwargs):
0df68c9f 1266 """
a95a7133 1267 Offset(self, Point pt)
e811c8ce 1268
b1fcee84 1269 Same as `OffsetXY` but uses dx,dy from Point
0df68c9f 1270 """
54f9ee45 1271 return _core_.Rect_Offset(*args, **kwargs)
e811c8ce
RD
1272
1273 def Intersect(*args, **kwargs):
0df68c9f 1274 """
a95a7133 1275 Intersect(self, Rect rect) -> Rect
e811c8ce 1276
5cbf236d 1277 Returns the intersectsion of this rectangle and rect.
0df68c9f 1278 """
54f9ee45 1279 return _core_.Rect_Intersect(*args, **kwargs)
e811c8ce 1280
5cbf236d
RD
1281 def Union(*args, **kwargs):
1282 """
1283 Union(self, Rect rect) -> Rect
1284
1285 Returns the union of this rectangle and rect.
1286 """
1287 return _core_.Rect_Union(*args, **kwargs)
1288
e811c8ce 1289 def __add__(*args, **kwargs):
0df68c9f 1290 """
a95a7133 1291 __add__(self, Rect rect) -> Rect
e811c8ce 1292
0df68c9f
RD
1293 Add the properties of rect to this rectangle and return the result.
1294 """
54f9ee45 1295 return _core_.Rect___add__(*args, **kwargs)
e811c8ce
RD
1296
1297 def __iadd__(*args, **kwargs):
0df68c9f 1298 """
a95a7133 1299 __iadd__(self, Rect rect) -> Rect
e811c8ce 1300
0df68c9f
RD
1301 Add the properties of rect to this rectangle, updating this rectangle.
1302 """
54f9ee45 1303 return _core_.Rect___iadd__(*args, **kwargs)
e811c8ce
RD
1304
1305 def __eq__(*args, **kwargs):
0df68c9f 1306 """
e9d6f3a4 1307 __eq__(self, PyObject other) -> bool
e811c8ce 1308
e9d6f3a4 1309 Test for equality of wx.Rect objects.
0df68c9f 1310 """
54f9ee45 1311 return _core_.Rect___eq__(*args, **kwargs)
e811c8ce
RD
1312
1313 def __ne__(*args, **kwargs):
0df68c9f 1314 """
e9d6f3a4 1315 __ne__(self, PyObject other) -> bool
e811c8ce 1316
e9d6f3a4 1317 Test for inequality of wx.Rect objects.
0df68c9f 1318 """
54f9ee45 1319 return _core_.Rect___ne__(*args, **kwargs)
e811c8ce
RD
1320
1321 def InsideXY(*args, **kwargs):
0df68c9f 1322 """
a95a7133 1323 InsideXY(self, int x, int y) -> bool
e811c8ce 1324
0df68c9f
RD
1325 Return True if the point is (not strcitly) inside the rect.
1326 """
54f9ee45 1327 return _core_.Rect_InsideXY(*args, **kwargs)
e811c8ce
RD
1328
1329 def Inside(*args, **kwargs):
0df68c9f 1330 """
a95a7133 1331 Inside(self, Point pt) -> bool
e811c8ce 1332
0df68c9f
RD
1333 Return True if the point is (not strcitly) inside the rect.
1334 """
54f9ee45 1335 return _core_.Rect_Inside(*args, **kwargs)
e811c8ce
RD
1336
1337 def Intersects(*args, **kwargs):
0df68c9f 1338 """
a95a7133 1339 Intersects(self, Rect rect) -> bool
e811c8ce 1340
0df68c9f
RD
1341 Returns True if the rectangles have a non empty intersection.
1342 """
54f9ee45 1343 return _core_.Rect_Intersects(*args, **kwargs)
e811c8ce 1344
b1fcee84
RD
1345 def CenterIn(*args, **kwargs):
1346 """
1347 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1348
1349 Center this rectangle within the one passed to the method, which is
1350 usually, but not necessarily, the larger one.
1351 """
1352 return _core_.Rect_CenterIn(*args, **kwargs)
1353
1354 CentreIn = CenterIn
54f9ee45
RD
1355 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1356 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1357 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1358 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
e811c8ce 1359 def Set(*args, **kwargs):
0df68c9f 1360 """
a95a7133 1361 Set(self, int x=0, int y=0, int width=0, int height=0)
e811c8ce 1362
0df68c9f
RD
1363 Set all rectangle properties.
1364 """
54f9ee45 1365 return _core_.Rect_Set(*args, **kwargs)
e811c8ce
RD
1366
1367 def Get(*args, **kwargs):
0df68c9f
RD
1368 """
1369 Get() -> (x,y,width,height)
e811c8ce 1370
0df68c9f
RD
1371 Return the rectangle properties as a tuple.
1372 """
54f9ee45 1373 return _core_.Rect_Get(*args, **kwargs)
e811c8ce 1374
41e2b43e 1375 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1376 def __str__(self): return str(self.Get())
1377 def __repr__(self): return 'wx.Rect'+str(self.Get())
1378 def __len__(self): return len(self.Get())
1379 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1380 def __setitem__(self, index, val):
1381 if index == 0: self.x = val
1382 elif index == 1: self.y = val
1383 elif index == 2: self.width = val
1384 elif index == 3: self.height = val
1385 else: raise IndexError
e811c8ce 1386 def __nonzero__(self): return self.Get() != (0,0,0,0)
74e96f3d
RD
1387 __safe_for_unpickling__ = True
1388 def __reduce__(self): return (wx.Rect, self.Get())
d14a1e28 1389
2131d850 1390_core_.Rect_swigregister(Rect)
d14a1e28
RD
1391
1392def RectPP(*args, **kwargs):
0df68c9f
RD
1393 """
1394 RectPP(Point topLeft, Point bottomRight) -> Rect
e811c8ce 1395
0df68c9f
RD
1396 Create a new Rect object from Points representing two corners.
1397 """
54f9ee45 1398 val = _core_.new_RectPP(*args, **kwargs)
d14a1e28
RD
1399 return val
1400
1401def RectPS(*args, **kwargs):
0df68c9f
RD
1402 """
1403 RectPS(Point pos, Size size) -> Rect
e811c8ce 1404
0df68c9f
RD
1405 Create a new Rect from a position and size.
1406 """
54f9ee45 1407 val = _core_.new_RectPS(*args, **kwargs)
d14a1e28
RD
1408 return val
1409
d3b6e4ff
RD
1410def RectS(*args, **kwargs):
1411 """
1412 RectS(Size size) -> Rect
1413
1414 Create a new Rect from a size only.
1415 """
1416 val = _core_.new_RectS(*args, **kwargs)
d3b6e4ff
RD
1417 return val
1418
d14a1e28 1419
e811c8ce 1420def IntersectRect(*args, **kwargs):
0085ce49 1421 """
0df68c9f 1422 IntersectRect(Rect r1, Rect r2) -> Rect
e811c8ce 1423
0df68c9f
RD
1424 Calculate and return the intersection of r1 and r2.
1425 """
0085ce49 1426 return _core_.IntersectRect(*args, **kwargs)
d14a1e28
RD
1427#---------------------------------------------------------------------------
1428
1429class Point2D(object):
41e2b43e
RD
1430 """
1431 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1432 with floating point values.
1433 """
0085ce49
RD
1434 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1435 __repr__ = _swig_repr
1436 def __init__(self, *args, **kwargs):
0df68c9f 1437 """
a95a7133 1438 __init__(self, double x=0.0, double y=0.0) -> Point2D
e811c8ce 1439
0df68c9f
RD
1440 Create a w.Point2D object.
1441 """
0085ce49 1442 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
e811c8ce 1443 def GetFloor(*args, **kwargs):
fd2dc343
RD
1444 """
1445 GetFloor() -> (x,y)
1446
1447 Convert to integer
1448 """
54f9ee45 1449 return _core_.Point2D_GetFloor(*args, **kwargs)
e811c8ce
RD
1450
1451 def GetRounded(*args, **kwargs):
fd2dc343
RD
1452 """
1453 GetRounded() -> (x,y)
1454
1455 Convert to integer
1456 """
54f9ee45 1457 return _core_.Point2D_GetRounded(*args, **kwargs)
e811c8ce
RD
1458
1459 def GetVectorLength(*args, **kwargs):
a95a7133 1460 """GetVectorLength(self) -> double"""
54f9ee45 1461 return _core_.Point2D_GetVectorLength(*args, **kwargs)
e811c8ce
RD
1462
1463 def GetVectorAngle(*args, **kwargs):
a95a7133 1464 """GetVectorAngle(self) -> double"""
54f9ee45 1465 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
e811c8ce
RD
1466
1467 def SetVectorLength(*args, **kwargs):
a95a7133 1468 """SetVectorLength(self, double length)"""
54f9ee45 1469 return _core_.Point2D_SetVectorLength(*args, **kwargs)
e811c8ce
RD
1470
1471 def SetVectorAngle(*args, **kwargs):
a95a7133 1472 """SetVectorAngle(self, double degrees)"""
54f9ee45 1473 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
e811c8ce 1474
d14a1e28
RD
1475 def SetPolarCoordinates(self, angle, length):
1476 self.SetVectorLength(length)
1477 self.SetVectorAngle(angle)
1478 def Normalize(self):
1479 self.SetVectorLength(1.0)
1480
e811c8ce 1481 def GetDistance(*args, **kwargs):
a95a7133 1482 """GetDistance(self, Point2D pt) -> double"""
54f9ee45 1483 return _core_.Point2D_GetDistance(*args, **kwargs)
e811c8ce
RD
1484
1485 def GetDistanceSquare(*args, **kwargs):
a95a7133 1486 """GetDistanceSquare(self, Point2D pt) -> double"""
54f9ee45 1487 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
e811c8ce
RD
1488
1489 def GetDotProduct(*args, **kwargs):
a95a7133 1490 """GetDotProduct(self, Point2D vec) -> double"""
54f9ee45 1491 return _core_.Point2D_GetDotProduct(*args, **kwargs)
e811c8ce
RD
1492
1493 def GetCrossProduct(*args, **kwargs):
a95a7133 1494 """GetCrossProduct(self, Point2D vec) -> double"""
54f9ee45 1495 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
e811c8ce
RD
1496
1497 def __neg__(*args, **kwargs):
0df68c9f 1498 """
a95a7133 1499 __neg__(self) -> Point2D
e811c8ce 1500
0df68c9f
RD
1501 the reflection of this point
1502 """
54f9ee45 1503 return _core_.Point2D___neg__(*args, **kwargs)
e811c8ce
RD
1504
1505 def __iadd__(*args, **kwargs):
a95a7133 1506 """__iadd__(self, Point2D pt) -> Point2D"""
54f9ee45 1507 return _core_.Point2D___iadd__(*args, **kwargs)
e811c8ce
RD
1508
1509 def __isub__(*args, **kwargs):
a95a7133 1510 """__isub__(self, Point2D pt) -> Point2D"""
54f9ee45 1511 return _core_.Point2D___isub__(*args, **kwargs)
e811c8ce
RD
1512
1513 def __imul__(*args, **kwargs):
a95a7133 1514 """__imul__(self, Point2D pt) -> Point2D"""
54f9ee45 1515 return _core_.Point2D___imul__(*args, **kwargs)
e811c8ce
RD
1516
1517 def __idiv__(*args, **kwargs):
a95a7133 1518 """__idiv__(self, Point2D pt) -> Point2D"""
54f9ee45 1519 return _core_.Point2D___idiv__(*args, **kwargs)
e811c8ce
RD
1520
1521 def __eq__(*args, **kwargs):
0df68c9f 1522 """
e9d6f3a4 1523 __eq__(self, PyObject other) -> bool
e811c8ce 1524
e9d6f3a4 1525 Test for equality of wx.Point2D objects.
0df68c9f 1526 """
54f9ee45 1527 return _core_.Point2D___eq__(*args, **kwargs)
e811c8ce
RD
1528
1529 def __ne__(*args, **kwargs):
0df68c9f 1530 """
e9d6f3a4 1531 __ne__(self, PyObject other) -> bool
e811c8ce 1532
e9d6f3a4 1533 Test for inequality of wx.Point2D objects.
0df68c9f 1534 """
54f9ee45 1535 return _core_.Point2D___ne__(*args, **kwargs)
e811c8ce 1536
54f9ee45
RD
1537 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1538 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
e811c8ce 1539 def Set(*args, **kwargs):
a95a7133 1540 """Set(self, double x=0, double y=0)"""
54f9ee45 1541 return _core_.Point2D_Set(*args, **kwargs)
e811c8ce
RD
1542
1543 def Get(*args, **kwargs):
0df68c9f
RD
1544 """
1545 Get() -> (x,y)
e811c8ce 1546
0df68c9f
RD
1547 Return x and y properties as a tuple.
1548 """
54f9ee45 1549 return _core_.Point2D_Get(*args, **kwargs)
e811c8ce 1550
41e2b43e 1551 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1552 def __str__(self): return str(self.Get())
1553 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1554 def __len__(self): return len(self.Get())
1555 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1556 def __setitem__(self, index, val):
e811c8ce
RD
1557 if index == 0: self.x = val
1558 elif index == 1: self.y = val
d14a1e28 1559 else: raise IndexError
e811c8ce 1560 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1561 __safe_for_unpickling__ = True
1562 def __reduce__(self): return (wx.Point2D, self.Get())
d14a1e28 1563
2131d850 1564_core_.Point2D_swigregister(Point2D)
d14a1e28
RD
1565
1566def Point2DCopy(*args, **kwargs):
0df68c9f
RD
1567 """
1568 Point2DCopy(Point2D pt) -> Point2D
e811c8ce 1569
0df68c9f
RD
1570 Create a w.Point2D object.
1571 """
54f9ee45 1572 val = _core_.new_Point2DCopy(*args, **kwargs)
d14a1e28
RD
1573 return val
1574
1575def Point2DFromPoint(*args, **kwargs):
0df68c9f
RD
1576 """
1577 Point2DFromPoint(Point pt) -> Point2D
e811c8ce 1578
0df68c9f
RD
1579 Create a w.Point2D object.
1580 """
54f9ee45 1581 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d14a1e28
RD
1582 return val
1583
1584#---------------------------------------------------------------------------
1585
54f9ee45
RD
1586FromStart = _core_.FromStart
1587FromCurrent = _core_.FromCurrent
1588FromEnd = _core_.FromEnd
d14a1e28 1589class InputStream(object):
093d3ff1 1590 """Proxy of C++ InputStream class"""
0085ce49
RD
1591 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1592 __repr__ = _swig_repr
1593 def __init__(self, *args, **kwargs):
a95a7133 1594 """__init__(self, PyObject p) -> InputStream"""
0085ce49
RD
1595 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1596 __swig_destroy__ = _core_.delete_InputStream
1597 __del__ = lambda self : None;
e811c8ce 1598 def close(*args, **kwargs):
a95a7133 1599 """close(self)"""
54f9ee45 1600 return _core_.InputStream_close(*args, **kwargs)
e811c8ce
RD
1601
1602 def flush(*args, **kwargs):
a95a7133 1603 """flush(self)"""
54f9ee45 1604 return _core_.InputStream_flush(*args, **kwargs)
e811c8ce
RD
1605
1606 def eof(*args, **kwargs):
a95a7133 1607 """eof(self) -> bool"""
54f9ee45 1608 return _core_.InputStream_eof(*args, **kwargs)
e811c8ce
RD
1609
1610 def read(*args, **kwargs):
a95a7133 1611 """read(self, int size=-1) -> PyObject"""
54f9ee45 1612 return _core_.InputStream_read(*args, **kwargs)
e811c8ce
RD
1613
1614 def readline(*args, **kwargs):
a95a7133 1615 """readline(self, int size=-1) -> PyObject"""
54f9ee45 1616 return _core_.InputStream_readline(*args, **kwargs)
e811c8ce
RD
1617
1618 def readlines(*args, **kwargs):
a95a7133 1619 """readlines(self, int sizehint=-1) -> PyObject"""
54f9ee45 1620 return _core_.InputStream_readlines(*args, **kwargs)
e811c8ce
RD
1621
1622 def seek(*args, **kwargs):
a95a7133 1623 """seek(self, int offset, int whence=0)"""
54f9ee45 1624 return _core_.InputStream_seek(*args, **kwargs)
e811c8ce
RD
1625
1626 def tell(*args, **kwargs):
a95a7133 1627 """tell(self) -> int"""
54f9ee45 1628 return _core_.InputStream_tell(*args, **kwargs)
e811c8ce
RD
1629
1630 def Peek(*args, **kwargs):
a95a7133 1631 """Peek(self) -> char"""
54f9ee45 1632 return _core_.InputStream_Peek(*args, **kwargs)
e811c8ce
RD
1633
1634 def GetC(*args, **kwargs):
a95a7133 1635 """GetC(self) -> char"""
54f9ee45 1636 return _core_.InputStream_GetC(*args, **kwargs)
e811c8ce
RD
1637
1638 def LastRead(*args, **kwargs):
a95a7133 1639 """LastRead(self) -> size_t"""
54f9ee45 1640 return _core_.InputStream_LastRead(*args, **kwargs)
e811c8ce
RD
1641
1642 def CanRead(*args, **kwargs):
a95a7133 1643 """CanRead(self) -> bool"""
54f9ee45 1644 return _core_.InputStream_CanRead(*args, **kwargs)
e811c8ce
RD
1645
1646 def Eof(*args, **kwargs):
a95a7133 1647 """Eof(self) -> bool"""
54f9ee45 1648 return _core_.InputStream_Eof(*args, **kwargs)
e811c8ce
RD
1649
1650 def Ungetch(*args, **kwargs):
a95a7133 1651 """Ungetch(self, char c) -> bool"""
54f9ee45 1652 return _core_.InputStream_Ungetch(*args, **kwargs)
e811c8ce
RD
1653
1654 def SeekI(*args, **kwargs):
a95a7133 1655 """SeekI(self, long pos, int mode=FromStart) -> long"""
54f9ee45 1656 return _core_.InputStream_SeekI(*args, **kwargs)
e811c8ce
RD
1657
1658 def TellI(*args, **kwargs):
a95a7133 1659 """TellI(self) -> long"""
54f9ee45 1660 return _core_.InputStream_TellI(*args, **kwargs)
e811c8ce 1661
2131d850 1662_core_.InputStream_swigregister(InputStream)
d14a1e28
RD
1663DefaultPosition = cvar.DefaultPosition
1664DefaultSize = cvar.DefaultSize
1665
1666class OutputStream(object):
093d3ff1 1667 """Proxy of C++ OutputStream class"""
0085ce49
RD
1668 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1669 def __init__(self): raise AttributeError, "No constructor defined"
1670 __repr__ = _swig_repr
e811c8ce 1671 def write(*args, **kwargs):
a95a7133 1672 """write(self, PyObject obj)"""
54f9ee45 1673 return _core_.OutputStream_write(*args, **kwargs)
e811c8ce 1674
0085ce49
RD
1675 def LastWrite(*args, **kwargs):
1676 """LastWrite(self) -> size_t"""
1677 return _core_.OutputStream_LastWrite(*args, **kwargs)
d14a1e28 1678
2131d850 1679_core_.OutputStream_swigregister(OutputStream)
d14a1e28
RD
1680
1681#---------------------------------------------------------------------------
1682
1683class FSFile(Object):
093d3ff1 1684 """Proxy of C++ FSFile class"""
0085ce49
RD
1685 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1686 __repr__ = _swig_repr
1687 def __init__(self, *args, **kwargs):
0df68c9f 1688 """
a95a7133 1689 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
196addbf 1690 DateTime modif) -> FSFile
0df68c9f 1691 """
0085ce49 1692 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
e2950dbb 1693 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
4cf4100f 1694
0085ce49
RD
1695 __swig_destroy__ = _core_.delete_FSFile
1696 __del__ = lambda self : None;
e811c8ce 1697 def GetStream(*args, **kwargs):
a95a7133 1698 """GetStream(self) -> InputStream"""
54f9ee45 1699 return _core_.FSFile_GetStream(*args, **kwargs)
e811c8ce
RD
1700
1701 def GetMimeType(*args, **kwargs):
a95a7133 1702 """GetMimeType(self) -> String"""
54f9ee45 1703 return _core_.FSFile_GetMimeType(*args, **kwargs)
e811c8ce
RD
1704
1705 def GetLocation(*args, **kwargs):
a95a7133 1706 """GetLocation(self) -> String"""
54f9ee45 1707 return _core_.FSFile_GetLocation(*args, **kwargs)
e811c8ce
RD
1708
1709 def GetAnchor(*args, **kwargs):
a95a7133 1710 """GetAnchor(self) -> String"""
54f9ee45 1711 return _core_.FSFile_GetAnchor(*args, **kwargs)
e811c8ce
RD
1712
1713 def GetModificationTime(*args, **kwargs):
a95a7133 1714 """GetModificationTime(self) -> DateTime"""
54f9ee45 1715 return _core_.FSFile_GetModificationTime(*args, **kwargs)
e811c8ce 1716
2131d850 1717_core_.FSFile_swigregister(FSFile)
d14a1e28
RD
1718
1719class CPPFileSystemHandler(object):
093d3ff1 1720 """Proxy of C++ CPPFileSystemHandler class"""
0085ce49
RD
1721 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1722 def __init__(self): raise AttributeError, "No constructor defined"
1723 __repr__ = _swig_repr
50f151d7
RD
1724 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1725 __del__ = lambda self : None;
2131d850 1726_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d14a1e28
RD
1727
1728class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 1729 """Proxy of C++ FileSystemHandler class"""
0085ce49
RD
1730 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1731 __repr__ = _swig_repr
1732 def __init__(self, *args, **kwargs):
a95a7133 1733 """__init__(self) -> FileSystemHandler"""
0085ce49 1734 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
d14a1e28 1735 self._setCallbackInfo(self, FileSystemHandler)
e811c8ce
RD
1736
1737 def _setCallbackInfo(*args, **kwargs):
a95a7133 1738 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 1739 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
1740
1741 def CanOpen(*args, **kwargs):
a95a7133 1742 """CanOpen(self, String location) -> bool"""
54f9ee45 1743 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1744
1745 def OpenFile(*args, **kwargs):
a95a7133 1746 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1747 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1748
1749 def FindFirst(*args, **kwargs):
a95a7133 1750 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1751 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1752
1753 def FindNext(*args, **kwargs):
a95a7133 1754 """FindNext(self) -> String"""
54f9ee45 1755 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
e811c8ce
RD
1756
1757 def GetProtocol(*args, **kwargs):
a95a7133 1758 """GetProtocol(self, String location) -> String"""
54f9ee45 1759 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
e811c8ce
RD
1760
1761 def GetLeftLocation(*args, **kwargs):
a95a7133 1762 """GetLeftLocation(self, String location) -> String"""
54f9ee45 1763 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
e811c8ce
RD
1764
1765 def GetAnchor(*args, **kwargs):
a95a7133 1766 """GetAnchor(self, String location) -> String"""
54f9ee45 1767 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
e811c8ce
RD
1768
1769 def GetRightLocation(*args, **kwargs):
a95a7133 1770 """GetRightLocation(self, String location) -> String"""
54f9ee45 1771 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
e811c8ce
RD
1772
1773 def GetMimeTypeFromExt(*args, **kwargs):
a95a7133 1774 """GetMimeTypeFromExt(self, String location) -> String"""
54f9ee45 1775 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
e811c8ce 1776
2131d850 1777_core_.FileSystemHandler_swigregister(FileSystemHandler)
d14a1e28
RD
1778
1779class FileSystem(Object):
093d3ff1 1780 """Proxy of C++ FileSystem class"""
0085ce49
RD
1781 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1782 __repr__ = _swig_repr
1783 def __init__(self, *args, **kwargs):
a95a7133 1784 """__init__(self) -> FileSystem"""
0085ce49
RD
1785 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1786 __swig_destroy__ = _core_.delete_FileSystem
1787 __del__ = lambda self : None;
e811c8ce 1788 def ChangePathTo(*args, **kwargs):
a95a7133 1789 """ChangePathTo(self, String location, bool is_dir=False)"""
54f9ee45 1790 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
e811c8ce
RD
1791
1792 def GetPath(*args, **kwargs):
a95a7133 1793 """GetPath(self) -> String"""
54f9ee45 1794 return _core_.FileSystem_GetPath(*args, **kwargs)
e811c8ce
RD
1795
1796 def OpenFile(*args, **kwargs):
a95a7133 1797 """OpenFile(self, String location) -> FSFile"""
54f9ee45 1798 return _core_.FileSystem_OpenFile(*args, **kwargs)
e811c8ce
RD
1799
1800 def FindFirst(*args, **kwargs):
a95a7133 1801 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1802 return _core_.FileSystem_FindFirst(*args, **kwargs)
e811c8ce
RD
1803
1804 def FindNext(*args, **kwargs):
a95a7133 1805 """FindNext(self) -> String"""
54f9ee45 1806 return _core_.FileSystem_FindNext(*args, **kwargs)
e811c8ce
RD
1807
1808 def AddHandler(*args, **kwargs):
66c033b4 1809 """AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 1810 return _core_.FileSystem_AddHandler(*args, **kwargs)
e811c8ce
RD
1811
1812 AddHandler = staticmethod(AddHandler)
1813 def CleanUpHandlers(*args, **kwargs):
66c033b4 1814 """CleanUpHandlers()"""
54f9ee45 1815 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
e811c8ce
RD
1816
1817 CleanUpHandlers = staticmethod(CleanUpHandlers)
1818 def FileNameToURL(*args, **kwargs):
66c033b4 1819 """FileNameToURL(String filename) -> String"""
54f9ee45 1820 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
e811c8ce
RD
1821
1822 FileNameToURL = staticmethod(FileNameToURL)
2ef75293
RD
1823 def URLToFileName(*args, **kwargs):
1824 """URLToFileName(String url) -> String"""
1825 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1826
1827 URLToFileName = staticmethod(URLToFileName)
2131d850 1828_core_.FileSystem_swigregister(FileSystem)
d14a1e28 1829
e811c8ce 1830def FileSystem_AddHandler(*args, **kwargs):
0085ce49
RD
1831 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1832 return _core_.FileSystem_AddHandler(*args, **kwargs)
d14a1e28 1833
0085ce49
RD
1834def FileSystem_CleanUpHandlers(*args):
1835 """FileSystem_CleanUpHandlers()"""
1836 return _core_.FileSystem_CleanUpHandlers(*args)
d14a1e28 1837
e811c8ce 1838def FileSystem_FileNameToURL(*args, **kwargs):
0085ce49
RD
1839 """FileSystem_FileNameToURL(String filename) -> String"""
1840 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d14a1e28 1841
e811c8ce 1842def FileSystem_URLToFileName(*args, **kwargs):
0085ce49
RD
1843 """FileSystem_URLToFileName(String url) -> String"""
1844 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2ef75293 1845
d14a1e28 1846class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 1847 """Proxy of C++ InternetFSHandler class"""
0085ce49
RD
1848 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1849 __repr__ = _swig_repr
1850 def __init__(self, *args, **kwargs):
a95a7133 1851 """__init__(self) -> InternetFSHandler"""
0085ce49 1852 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
e811c8ce 1853 def CanOpen(*args, **kwargs):
a95a7133 1854 """CanOpen(self, String location) -> bool"""
54f9ee45 1855 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1856
1857 def OpenFile(*args, **kwargs):
a95a7133 1858 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1859 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
e811c8ce 1860
2131d850 1861_core_.InternetFSHandler_swigregister(InternetFSHandler)
d14a1e28
RD
1862
1863class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 1864 """Proxy of C++ ZipFSHandler class"""
0085ce49
RD
1865 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1866 __repr__ = _swig_repr
1867 def __init__(self, *args, **kwargs):
a95a7133 1868 """__init__(self) -> ZipFSHandler"""
0085ce49 1869 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
e811c8ce 1870 def CanOpen(*args, **kwargs):
a95a7133 1871 """CanOpen(self, String location) -> bool"""
54f9ee45 1872 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1873
1874 def OpenFile(*args, **kwargs):
a95a7133 1875 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1876 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1877
1878 def FindFirst(*args, **kwargs):
a95a7133 1879 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1880 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1881
1882 def FindNext(*args, **kwargs):
a95a7133 1883 """FindNext(self) -> String"""
54f9ee45 1884 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
e811c8ce 1885
2131d850 1886_core_.ZipFSHandler_swigregister(ZipFSHandler)
d14a1e28
RD
1887
1888
e811c8ce 1889def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
0085ce49
RD
1890 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1891 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d14a1e28 1892
e811c8ce 1893def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
0085ce49
RD
1894 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1895 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d14a1e28 1896
e811c8ce 1897def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
0085ce49
RD
1898 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1899 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
2ef75293
RD
1900def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1901 """
1902 Add 'file' to the memory filesystem. The dataItem parameter can
1903 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1904 arbitrary data. If a bitmap or image is used then the imgType
1905 parameter should specify what kind of image file it should be
1906 written as, wx.BITMAP_TYPE_PNG, etc.
1907 """
1908 if isinstance(dataItem, wx.Image):
1909 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1910 elif isinstance(dataItem, wx.Bitmap):
1911 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1912 elif type(dataItem) == str:
1913 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1914 else:
1915 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d14a1e28
RD
1916
1917class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 1918 """Proxy of C++ MemoryFSHandler class"""
0085ce49
RD
1919 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1920 __repr__ = _swig_repr
1921 def __init__(self, *args, **kwargs):
a95a7133 1922 """__init__(self) -> MemoryFSHandler"""
0085ce49 1923 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
e811c8ce 1924 def RemoveFile(*args, **kwargs):
66c033b4 1925 """RemoveFile(String filename)"""
54f9ee45 1926 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
e811c8ce
RD
1927
1928 RemoveFile = staticmethod(RemoveFile)
d14a1e28 1929 AddFile = staticmethod(MemoryFSHandler_AddFile)
e811c8ce 1930 def CanOpen(*args, **kwargs):
a95a7133 1931 """CanOpen(self, String location) -> bool"""
54f9ee45 1932 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1933
1934 def OpenFile(*args, **kwargs):
a95a7133 1935 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1936 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1937
1938 def FindFirst(*args, **kwargs):
a95a7133 1939 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1940 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1941
1942 def FindNext(*args, **kwargs):
a95a7133 1943 """FindNext(self) -> String"""
54f9ee45 1944 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
e811c8ce 1945
2131d850 1946_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d14a1e28 1947
e811c8ce 1948def MemoryFSHandler_RemoveFile(*args, **kwargs):
0085ce49
RD
1949 """MemoryFSHandler_RemoveFile(String filename)"""
1950 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d14a1e28 1951
bcd0d7b6
RD
1952IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1953IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1954IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d14a1e28
RD
1955#---------------------------------------------------------------------------
1956
1957class ImageHandler(Object):
27fb7603
RD
1958 """
1959 This is the base class for implementing image file loading/saving, and
1960 image creation from data. It is used within `wx.Image` and is not
1961 normally seen by the application.
1962 """
0085ce49
RD
1963 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1964 def __init__(self): raise AttributeError, "No constructor defined"
1965 __repr__ = _swig_repr
e811c8ce 1966 def GetName(*args, **kwargs):
a95a7133 1967 """GetName(self) -> String"""
54f9ee45 1968 return _core_.ImageHandler_GetName(*args, **kwargs)
e811c8ce
RD
1969
1970 def GetExtension(*args, **kwargs):
a95a7133 1971 """GetExtension(self) -> String"""
54f9ee45 1972 return _core_.ImageHandler_GetExtension(*args, **kwargs)
e811c8ce
RD
1973
1974 def GetType(*args, **kwargs):
a95a7133 1975 """GetType(self) -> long"""
54f9ee45 1976 return _core_.ImageHandler_GetType(*args, **kwargs)
e811c8ce
RD
1977
1978 def GetMimeType(*args, **kwargs):
a95a7133 1979 """GetMimeType(self) -> String"""
54f9ee45 1980 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
e811c8ce
RD
1981
1982 def CanRead(*args, **kwargs):
a95a7133 1983 """CanRead(self, String name) -> bool"""
54f9ee45 1984 return _core_.ImageHandler_CanRead(*args, **kwargs)
e811c8ce
RD
1985
1986 def SetName(*args, **kwargs):
a95a7133 1987 """SetName(self, String name)"""
54f9ee45 1988 return _core_.ImageHandler_SetName(*args, **kwargs)
e811c8ce
RD
1989
1990 def SetExtension(*args, **kwargs):
a95a7133 1991 """SetExtension(self, String extension)"""
54f9ee45 1992 return _core_.ImageHandler_SetExtension(*args, **kwargs)
e811c8ce
RD
1993
1994 def SetType(*args, **kwargs):
a95a7133 1995 """SetType(self, long type)"""
54f9ee45 1996 return _core_.ImageHandler_SetType(*args, **kwargs)
e811c8ce
RD
1997
1998 def SetMimeType(*args, **kwargs):
a95a7133 1999 """SetMimeType(self, String mimetype)"""
54f9ee45 2000 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
e811c8ce 2001
2131d850 2002_core_.ImageHandler_swigregister(ImageHandler)
d14a1e28 2003
943e8dfd
RD
2004class PyImageHandler(ImageHandler):
2005 """
2006 This is the base class for implementing image file loading/saving, and
2007 image creation from data, all written in Python. To create a custom
2008 image handler derive a new class from wx.PyImageHandler and provide
2009 the following methods::
2010
2011 def DoCanRead(self, stream) --> bool
2012 '''Check if this handler can read the image on the stream'''
2013
2014 def LoadFile(self, image, stream, verbose, index) --> bool
2015 '''Load image data from the stream and load it into image.'''
2016
2017 def SaveFile(self, image, stream, verbose) --> bool
2018 '''Save the iamge data in image to the stream using
2019 this handler's image file format.'''
2020
2021 def GetImageCount(self, stream) --> int
2022 '''If this image format can hold more than one image,
2023 how many does the image on the stream have?'''
2024
2025 To activate your handler create an instance of it and pass it to
2026 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2027 `SetExtension` from your constructor.
2028
2029 """
0085ce49
RD
2030 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2031 __repr__ = _swig_repr
2032 def __init__(self, *args, **kwargs):
943e8dfd
RD
2033 """
2034 __init__(self) -> PyImageHandler
2035
2036 This is the base class for implementing image file loading/saving, and
2037 image creation from data, all written in Python. To create a custom
2038 image handler derive a new class from wx.PyImageHandler and provide
2039 the following methods::
2040
2041 def DoCanRead(self, stream) --> bool
2042 '''Check if this handler can read the image on the stream'''
2043
2044 def LoadFile(self, image, stream, verbose, index) --> bool
2045 '''Load image data from the stream and load it into image.'''
2046
2047 def SaveFile(self, image, stream, verbose) --> bool
2048 '''Save the iamge data in image to the stream using
2049 this handler's image file format.'''
2050
2051 def GetImageCount(self, stream) --> int
2052 '''If this image format can hold more than one image,
2053 how many does the image on the stream have?'''
2054
2055 To activate your handler create an instance of it and pass it to
2056 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2057 `SetExtension` from your constructor.
2058
2059 """
0085ce49 2060 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
RD
2061 self._SetSelf(self)
2062
2063 def _SetSelf(*args, **kwargs):
2064 """_SetSelf(self, PyObject self)"""
2065 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2066
2131d850 2067_core_.PyImageHandler_swigregister(PyImageHandler)
943e8dfd 2068
d14a1e28 2069class ImageHistogram(object):
093d3ff1 2070 """Proxy of C++ ImageHistogram class"""
0085ce49
RD
2071 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2072 __repr__ = _swig_repr
2073 def __init__(self, *args, **kwargs):
a95a7133 2074 """__init__(self) -> ImageHistogram"""
0085ce49 2075 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
e811c8ce 2076 def MakeKey(*args, **kwargs):
0df68c9f 2077 """
7a27cf7c 2078 MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2079
0df68c9f
RD
2080 Get the key in the histogram for the given RGB values
2081 """
54f9ee45 2082 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
e811c8ce
RD
2083
2084 MakeKey = staticmethod(MakeKey)
2085 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2086 """
2087 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2088
2089 Find first colour that is not used in the image and has higher RGB
2090 values than startR, startG, startB. Returns a tuple consisting of a
2091 success flag and rgb values.
2092 """
54f9ee45 2093 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2094
f1cbd8fa
RD
2095 def GetCount(*args, **kwargs):
2096 """
2097 GetCount(self, unsigned long key) -> unsigned long
2098
2099 Returns the pixel count for the given key. Use `MakeKey` to create a
2100 key value from a RGB tripple.
2101 """
2102 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2103
2104 def GetCountRGB(*args, **kwargs):
2105 """
7a27cf7c 2106 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2107
2108 Returns the pixel count for the given RGB values.
2109 """
2110 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2111
2112 def GetCountColour(*args, **kwargs):
2113 """
2114 GetCountColour(self, Colour colour) -> unsigned long
2115
2116 Returns the pixel count for the given `wx.Colour` value.
2117 """
2118 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2119
2131d850 2120_core_.ImageHistogram_swigregister(ImageHistogram)
d14a1e28 2121
e811c8ce 2122def ImageHistogram_MakeKey(*args, **kwargs):
0085ce49 2123 """
7a27cf7c 2124 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2125
0df68c9f
RD
2126 Get the key in the histogram for the given RGB values
2127 """
0085ce49 2128 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d14a1e28 2129
943e8dfd
RD
2130class Image_RGBValue(object):
2131 """
2132 An object that contains values for red, green and blue which represent
2133 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2134 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2135 color space.
2136 """
0085ce49
RD
2137 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2138 __repr__ = _swig_repr
2139 def __init__(self, *args, **kwargs):
943e8dfd
RD
2140 """
2141 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2142
2143 Constructor.
2144 """
0085ce49 2145 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
2146 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2147 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2148 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2149_core_.Image_RGBValue_swigregister(Image_RGBValue)
943e8dfd
RD
2150
2151class Image_HSVValue(object):
2152 """
2153 An object that contains values for hue, saturation and value which
2154 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2155 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2156 color space.
2157 """
0085ce49
RD
2158 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2159 __repr__ = _swig_repr
2160 def __init__(self, *args, **kwargs):
943e8dfd
RD
2161 """
2162 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2163
2164 Constructor.
2165 """
0085ce49 2166 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
2167 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2168 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2169 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2170_core_.Image_HSVValue_swigregister(Image_HSVValue)
943e8dfd 2171
d14a1e28 2172class Image(Object):
7a27cf7c
RD
2173 """
2174 A platform-independent image class. An image can be created from
2175 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2176 variety of formats. Functions are available to set and get image
2177 bits, so it can be used for basic image manipulation.
2178
2179 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2180 platform-specific `wx.Bitmap` object must be created from it using the
2181 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2182 device context, using `wx.DC.DrawBitmap`.
2183
2184 One colour value of the image may be used as a mask colour which will
2185 lead to the automatic creation of a `wx.Mask` object associated to the
2186 bitmap object.
2187
2188 wx.Image supports alpha channel data, that is in addition to a byte
2189 for the red, green and blue colour components for each pixel it also
2190 stores a byte representing the pixel opacity. An alpha value of 0
2191 corresponds to a transparent pixel (null opacity) while a value of 255
2192 means that the pixel is 100% opaque.
2193
2194 Unlike RGB data, not all images have an alpha channel and before using
2195 `GetAlpha` you should check if this image contains an alpha channel
2196 with `HasAlpha`. Note that currently only images loaded from PNG files
2197 with transparency information will have an alpha channel.
2198 """
0085ce49
RD
2199 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2200 __repr__ = _swig_repr
2201 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2202 """
2203 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2204
2205 Loads an image from a file.
2206 """
0085ce49
RD
2207 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2208 __swig_destroy__ = _core_.delete_Image
2209 __del__ = lambda self : None;
e811c8ce 2210 def Create(*args, **kwargs):
7a27cf7c
RD
2211 """
2212 Create(self, int width, int height, bool clear=True)
2213
2214 Creates a fresh image. If clear is ``True``, the new image will be
2215 initialized to black. Otherwise, the image data will be uninitialized.
2216 """
54f9ee45 2217 return _core_.Image_Create(*args, **kwargs)
e811c8ce
RD
2218
2219 def Destroy(*args, **kwargs):
0df68c9f 2220 """
a95a7133 2221 Destroy(self)
e811c8ce 2222
7a27cf7c 2223 Destroys the image data.
0df68c9f 2224 """
7e08d4ef
RD
2225 val = _core_.Image_Destroy(*args, **kwargs)
2226 args[0].thisown = 0
2227 return val
e811c8ce
RD
2228
2229 def Scale(*args, **kwargs):
7a27cf7c
RD
2230 """
2231 Scale(self, int width, int height) -> Image
2232
2233 Returns a scaled version of the image. This is also useful for scaling
2234 bitmaps in general as the only other way to scale bitmaps is to blit a
2235 `wx.MemoryDC` into another `wx.MemoryDC`.
2236 """
54f9ee45 2237 return _core_.Image_Scale(*args, **kwargs)
e811c8ce
RD
2238
2239 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2240 """
2241 ShrinkBy(self, int xFactor, int yFactor) -> Image
2242
2243 Return a version of the image scaled smaller by the given factors.
2244 """
54f9ee45 2245 return _core_.Image_ShrinkBy(*args, **kwargs)
e811c8ce
RD
2246
2247 def Rescale(*args, **kwargs):
7a27cf7c
RD
2248 """
2249 Rescale(self, int width, int height) -> Image
2250
2251 Changes the size of the image in-place by scaling it: after a call to
2252 this function, the image will have the given width and height.
2253
2254 Returns the (modified) image itself.
2255 """
54f9ee45 2256 return _core_.Image_Rescale(*args, **kwargs)
e811c8ce 2257
aff4cc5c 2258 def Resize(*args, **kwargs):
7a27cf7c
RD
2259 """
2260 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2261
2262 Changes the size of the image in-place without scaling it, by adding
2263 either a border with the given colour or cropping as necessary. The
2264 image is pasted into a new image with the given size and background
2265 colour at the position pos relative to the upper left of the new
2266 image. If red = green = blue = -1 then use either the current mask
2267 colour if set or find, use, and set a suitable mask colour for any
2268 newly exposed areas.
2269
2270 Returns the (modified) image itself.
2271 """
aff4cc5c
RD
2272 return _core_.Image_Resize(*args, **kwargs)
2273
e811c8ce 2274 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2275 """
2276 SetRGB(self, int x, int y, byte r, byte g, byte b)
2277
2278 Sets the pixel at the given coordinate. This routine performs
2279 bounds-checks for the coordinate so it can be considered a safe way to
2280 manipulate the data, but in some cases this might be too slow so that
2281 the data will have to be set directly. In that case you will have to
2282 get access to the image data using the `GetData` method.
2283 """
54f9ee45 2284 return _core_.Image_SetRGB(*args, **kwargs)
e811c8ce 2285
aff4cc5c 2286 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2287 """
2288 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2289
2290 Sets the colour of the pixels within the given rectangle. This routine
2291 performs bounds-checks for the rectangle so it can be considered a
2292 safe way to manipulate the data.
2293 """
aff4cc5c
RD
2294 return _core_.Image_SetRGBRect(*args, **kwargs)
2295
e811c8ce 2296 def GetRed(*args, **kwargs):
7a27cf7c
RD
2297 """
2298 GetRed(self, int x, int y) -> byte
2299
2300 Returns the red intensity at the given coordinate.
2301 """
54f9ee45 2302 return _core_.Image_GetRed(*args, **kwargs)
e811c8ce
RD
2303
2304 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2305 """
2306 GetGreen(self, int x, int y) -> byte
2307
2308 Returns the green intensity at the given coordinate.
2309 """
54f9ee45 2310 return _core_.Image_GetGreen(*args, **kwargs)
e811c8ce
RD
2311
2312 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2313 """
2314 GetBlue(self, int x, int y) -> byte
2315
2316 Returns the blue intensity at the given coordinate.
2317 """
54f9ee45 2318 return _core_.Image_GetBlue(*args, **kwargs)
e811c8ce
RD
2319
2320 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2321 """
2322 SetAlpha(self, int x, int y, byte alpha)
2323
2324 Sets the alpha value for the given pixel. This function should only be
2325 called if the image has alpha channel data, use `HasAlpha` to check
2326 for this.
2327 """
54f9ee45 2328 return _core_.Image_SetAlpha(*args, **kwargs)
e811c8ce
RD
2329
2330 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2331 """
2332 GetAlpha(self, int x, int y) -> byte
2333
2334 Returns the alpha value for the given pixel. This function may only be
2335 called for the images with alpha channel, use `HasAlpha` to check for
2336 this.
2337
2338 The returned value is the *opacity* of the image, i.e. the value of 0
2339 corresponds to the fully transparent pixels while the value of 255 to
2340 the fully opaque pixels.
2341 """
54f9ee45 2342 return _core_.Image_GetAlpha(*args, **kwargs)
e811c8ce
RD
2343
2344 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2345 """
2346 HasAlpha(self) -> bool
2347
2348 Returns true if this image has alpha channel, false otherwise.
2349 """
54f9ee45 2350 return _core_.Image_HasAlpha(*args, **kwargs)
e811c8ce 2351
68350608
RD
2352 def InitAlpha(*args, **kwargs):
2353 """
2354 InitAlpha(self)
2355
2356 Initializes the image alpha channel data. It is an error to call it if
2357 the image already has alpha data. If it doesn't, alpha data will be by
2358 default initialized to all pixels being fully opaque. But if the image
2359 has a a mask colour, all mask pixels will be completely transparent.
2360 """
2361 return _core_.Image_InitAlpha(*args, **kwargs)
2362
bcd0d7b6
RD
2363 def IsTransparent(*args, **kwargs):
2364 """
7a27cf7c 2365 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
bcd0d7b6 2366
7a27cf7c
RD
2367 Returns ``True`` if this pixel is masked or has an alpha value less
2368 than the spcified threshold.
bcd0d7b6
RD
2369 """
2370 return _core_.Image_IsTransparent(*args, **kwargs)
2371
e811c8ce 2372 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2373 """
2374 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2375
2376 Find first colour that is not used in the image and has higher RGB
2377 values than startR, startG, startB. Returns a tuple consisting of a
2378 success flag and rgb values.
2379 """
54f9ee45 2380 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2381
4cf4100f
RD
2382 def ConvertAlphaToMask(*args, **kwargs):
2383 """
bcd0d7b6 2384 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2385
7a27cf7c
RD
2386 If the image has alpha channel, this method converts it to mask. All
2387 pixels with alpha value less than ``threshold`` are replaced with the
2388 mask colour and the alpha channel is removed. The mask colour is
2389 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2390
2391 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2392 nothing.
2393 """
2394 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2395
8fb0e70a
RD
2396 def ConvertColourToAlpha(*args, **kwargs):
2397 """
7a27cf7c 2398 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2399
2400 This method converts an image where the original alpha information is
2401 only available as a shades of a colour (actually shades of grey)
2402 typically when you draw anti-aliased text into a bitmap. The DC
2403 drawing routines draw grey values on the black background although
2404 they actually mean to draw white with differnt alpha values. This
2405 method reverses it, assuming a black (!) background and white text.
2406 The method will then fill up the whole image with the colour given.
2407 """
2408 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2409
e811c8ce 2410 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2411 """
2412 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2413
2414 Sets the image's mask so that the pixels that have RGB value of
2415 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2416 by first finding an unused colour in the image, setting this colour as
2417 the mask colour and then using this colour to draw all pixels in the
2418 image who corresponding pixel in mask has given RGB value.
2419
2420 Returns ``False`` if ``mask`` does not have same dimensions as the
2421 image or if there is no unused colour left. Returns ``True`` if the
2422 mask was successfully applied.
2423
2424 Note that this method involves computing the histogram, which is
2425 computationally intensive operation.
2426 """
54f9ee45 2427 return _core_.Image_SetMaskFromImage(*args, **kwargs)
e811c8ce
RD
2428
2429 def CanRead(*args, **kwargs):
7a27cf7c
RD
2430 """
2431 CanRead(String filename) -> bool
2432
2433 Returns True if the image handlers can read this file.
2434 """
54f9ee45 2435 return _core_.Image_CanRead(*args, **kwargs)
e811c8ce
RD
2436
2437 CanRead = staticmethod(CanRead)
2438 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2439 """
2440 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2441
2442 If the image file contains more than one image and the image handler
2443 is capable of retrieving these individually, this function will return
2444 the number of available images.
2445 """
54f9ee45 2446 return _core_.Image_GetImageCount(*args, **kwargs)
e811c8ce
RD
2447
2448 GetImageCount = staticmethod(GetImageCount)
2449 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2450 """
2451 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2452
2453 Loads an image from a file. If no handler type is provided, the
2454 library will try to autodetect the format.
2455 """
54f9ee45 2456 return _core_.Image_LoadFile(*args, **kwargs)
e811c8ce
RD
2457
2458 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2459 """
2460 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2461
2462 Loads an image from a file, specifying the image type with a MIME type
2463 string.
2464 """
54f9ee45 2465 return _core_.Image_LoadMimeFile(*args, **kwargs)
e811c8ce
RD
2466
2467 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2468 """
2469 SaveFile(self, String name, int type) -> bool
2470
2471 Saves an image in the named file.
2472 """
54f9ee45 2473 return _core_.Image_SaveFile(*args, **kwargs)
e811c8ce
RD
2474
2475 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2476 """
2477 SaveMimeFile(self, String name, String mimetype) -> bool
2478
2479 Saves an image in the named file.
2480 """
54f9ee45 2481 return _core_.Image_SaveMimeFile(*args, **kwargs)
e811c8ce
RD
2482
2483 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2484 """
2485 CanReadStream(InputStream stream) -> bool
2486
2487 Returns True if the image handlers can read an image file from the
2488 data currently on the input stream, or a readable Python file-like
2489 object.
2490 """
54f9ee45 2491 return _core_.Image_CanReadStream(*args, **kwargs)
e811c8ce
RD
2492
2493 CanReadStream = staticmethod(CanReadStream)
2494 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2495 """
2496 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2497
2498 Loads an image from an input stream or a readable Python file-like
2499 object. If no handler type is provided, the library will try to
2500 autodetect the format.
2501 """
54f9ee45 2502 return _core_.Image_LoadStream(*args, **kwargs)
e811c8ce
RD
2503
2504 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2505 """
2506 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2507
2508 Loads an image from an input stream or a readable Python file-like
2509 object, using a MIME type string to specify the image file format.
2510 """
54f9ee45 2511 return _core_.Image_LoadMimeStream(*args, **kwargs)
e811c8ce
RD
2512
2513 def Ok(*args, **kwargs):
7a27cf7c
RD
2514 """
2515 Ok(self) -> bool
2516
2517 Returns true if image data is present.
2518 """
54f9ee45 2519 return _core_.Image_Ok(*args, **kwargs)
e811c8ce
RD
2520
2521 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2522 """
2523 GetWidth(self) -> int
2524
2525 Gets the width of the image in pixels.
2526 """
54f9ee45 2527 return _core_.Image_GetWidth(*args, **kwargs)
e811c8ce
RD
2528
2529 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2530 """
2531 GetHeight(self) -> int
2532
2533 Gets the height of the image in pixels.
2534 """
54f9ee45 2535 return _core_.Image_GetHeight(*args, **kwargs)
e811c8ce 2536
b2df227b 2537 def GetSize(*args, **kwargs):
7a27cf7c
RD
2538 """
2539 GetSize(self) -> Size
2540
2541 Returns the size of the image in pixels.
2542 """
54f9ee45 2543 return _core_.Image_GetSize(*args, **kwargs)
b2df227b 2544
e811c8ce 2545 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2546 """
2547 GetSubImage(self, Rect rect) -> Image
2548
2549 Returns a sub image of the current one as long as the rect belongs
2550 entirely to the image.
2551 """
54f9ee45 2552 return _core_.Image_GetSubImage(*args, **kwargs)
e811c8ce 2553
aff4cc5c 2554 def Size(*args, **kwargs):
7a27cf7c
RD
2555 """
2556 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2557
2558 Returns a resized version of this image without scaling it by adding
2559 either a border with the given colour or cropping as necessary. The
2560 image is pasted into a new image with the given size and background
2561 colour at the position ``pos`` relative to the upper left of the new
2562 image. If red = green = blue = -1 then use either the current mask
2563 colour if set or find, use, and set a suitable mask colour for any
2564 newly exposed areas.
2565 """
aff4cc5c
RD
2566 return _core_.Image_Size(*args, **kwargs)
2567
e811c8ce 2568 def Copy(*args, **kwargs):
7a27cf7c
RD
2569 """
2570 Copy(self) -> Image
2571
2572 Returns an identical copy of the image.
2573 """
54f9ee45 2574 return _core_.Image_Copy(*args, **kwargs)
e811c8ce
RD
2575
2576 def Paste(*args, **kwargs):
7a27cf7c
RD
2577 """
2578 Paste(self, Image image, int x, int y)
2579
2580 Pastes ``image`` into this instance and takes care of the mask colour
2581 and any out of bounds problems.
2582 """
54f9ee45 2583 return _core_.Image_Paste(*args, **kwargs)
e811c8ce
RD
2584
2585 def GetData(*args, **kwargs):
61d07ac7
RD
2586 """
2587 GetData(self) -> PyObject
2588
2589 Returns a string containing a copy of the RGB bytes of the image.
2590 """
54f9ee45 2591 return _core_.Image_GetData(*args, **kwargs)
e811c8ce
RD
2592
2593 def SetData(*args, **kwargs):
61d07ac7
RD
2594 """
2595 SetData(self, buffer data)
2596
2597 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2598 either a string or a buffer object holding the data and the length of
2599 the data must be width*height*3.
2600 """
54f9ee45 2601 return _core_.Image_SetData(*args, **kwargs)
e811c8ce
RD
2602
2603 def GetDataBuffer(*args, **kwargs):
61d07ac7
RD
2604 """
2605 GetDataBuffer(self) -> PyObject
2606
2607 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2608 image data buffer inside the wx.Image. You need to ensure that you do
2609 not use this buffer object after the image has been destroyed.
61d07ac7 2610 """
54f9ee45 2611 return _core_.Image_GetDataBuffer(*args, **kwargs)
e811c8ce
RD
2612
2613 def SetDataBuffer(*args, **kwargs):
61d07ac7
RD
2614 """
2615 SetDataBuffer(self, buffer data)
2616
2617 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2618 object. This can save making an extra copy of the data but you must
2619 ensure that the buffer object lives longer than the wx.Image does.
61d07ac7 2620 """
54f9ee45 2621 return _core_.Image_SetDataBuffer(*args, **kwargs)
e811c8ce
RD
2622
2623 def GetAlphaData(*args, **kwargs):
61d07ac7
RD
2624 """
2625 GetAlphaData(self) -> PyObject
2626
2627 Returns a string containing a copy of the alpha bytes of the image.
2628 """
54f9ee45 2629 return _core_.Image_GetAlphaData(*args, **kwargs)
e811c8ce
RD
2630
2631 def SetAlphaData(*args, **kwargs):
61d07ac7
RD
2632 """
2633 SetAlphaData(self, buffer alpha)
2634
2635 Resets the Image's alpha data from a buffer of bytes. Accepts either
2636 a string or a buffer object holding the data and the length of the
2637 data must be width*height.
2638 """
54f9ee45 2639 return _core_.Image_SetAlphaData(*args, **kwargs)
e811c8ce
RD
2640
2641 def GetAlphaBuffer(*args, **kwargs):
a95a7133 2642 """GetAlphaBuffer(self) -> PyObject"""
54f9ee45 2643 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2644
2645 def SetAlphaBuffer(*args, **kwargs):
61d07ac7 2646 """SetAlphaBuffer(self, buffer alpha)"""
54f9ee45 2647 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2648
2649 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2650 """
2651 SetMaskColour(self, byte r, byte g, byte b)
2652
2653 Sets the mask colour for this image (and tells the image to use the
2654 mask).
2655 """
54f9ee45 2656 return _core_.Image_SetMaskColour(*args, **kwargs)
e811c8ce 2657
aff4cc5c
RD
2658 def GetOrFindMaskColour(*args, **kwargs):
2659 """
2660 GetOrFindMaskColour() -> (r,g,b)
2661
2662 Get the current mask colour or find a suitable colour.
2663 """
2664 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2665
e811c8ce 2666 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2667 """
2668 GetMaskRed(self) -> byte
2669
2670 Gets the red component of the mask colour.
2671 """
54f9ee45 2672 return _core_.Image_GetMaskRed(*args, **kwargs)
e811c8ce
RD
2673
2674 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2675 """
2676 GetMaskGreen(self) -> byte
2677
2678 Gets the green component of the mask colour.
2679 """
54f9ee45 2680 return _core_.Image_GetMaskGreen(*args, **kwargs)
e811c8ce
RD
2681
2682 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2683 """
2684 GetMaskBlue(self) -> byte
2685
2686 Gets the blue component of the mask colour.
2687 """
54f9ee45 2688 return _core_.Image_GetMaskBlue(*args, **kwargs)
e811c8ce
RD
2689
2690 def SetMask(*args, **kwargs):
7a27cf7c
RD
2691 """
2692 SetMask(self, bool mask=True)
2693
2694 Specifies whether there is a mask or not. The area of the mask is
2695 determined by the current mask colour.
2696 """
54f9ee45 2697 return _core_.Image_SetMask(*args, **kwargs)
e811c8ce
RD
2698
2699 def HasMask(*args, **kwargs):
7a27cf7c
RD
2700 """
2701 HasMask(self) -> bool
2702
2703 Returns ``True`` if there is a mask active, ``False`` otherwise.
2704 """
54f9ee45 2705 return _core_.Image_HasMask(*args, **kwargs)
e811c8ce
RD
2706
2707 def Rotate(*args, **kwargs):
0df68c9f 2708 """
a95a7133 2709 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
0df68c9f 2710 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2711
2712 Rotates the image about the given point, by ``angle`` radians. Passing
2713 ``True`` to ``interpolating`` results in better image quality, but is
2714 slower. If the image has a mask, then the mask colour is used for the
2715 uncovered pixels in the rotated image background. Otherwise, black
2716 will be used as the fill colour.
2717
2718 Returns the rotated image, leaving this image intact.
0df68c9f 2719 """
54f9ee45 2720 return _core_.Image_Rotate(*args, **kwargs)
e811c8ce
RD
2721
2722 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2723 """
2724 Rotate90(self, bool clockwise=True) -> Image
2725
2726 Returns a copy of the image rotated 90 degrees in the direction
2727 indicated by ``clockwise``.
2728 """
54f9ee45 2729 return _core_.Image_Rotate90(*args, **kwargs)
e811c8ce
RD
2730
2731 def Mirror(*args, **kwargs):
7a27cf7c
RD
2732 """
2733 Mirror(self, bool horizontally=True) -> Image
2734
2735 Returns a mirrored copy of the image. The parameter ``horizontally``
2736 indicates the orientation.
2737 """
54f9ee45 2738 return _core_.Image_Mirror(*args, **kwargs)
e811c8ce
RD
2739
2740 def Replace(*args, **kwargs):
0df68c9f 2741 """
7a27cf7c
RD
2742 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2743
2744 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2745 ``(r2,g2,b2)``.
0df68c9f 2746 """
54f9ee45 2747 return _core_.Image_Replace(*args, **kwargs)
e811c8ce 2748
32fe5131
RD
2749 def ConvertToGreyscale(*args, **kwargs):
2750 """
2751 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2752
2753 Convert to greyscale image. Uses the luminance component (Y) of the
2754 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2755 defaults to ITU-T BT.601
2756 """
2757 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2758
e811c8ce 2759 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2760 """
2761 ConvertToMono(self, byte r, byte g, byte b) -> Image
2762
2763 Returns monochromatic version of the image. The returned image has
2764 white colour where the original has ``(r,g,b)`` colour and black
2765 colour everywhere else.
2766 """
54f9ee45 2767 return _core_.Image_ConvertToMono(*args, **kwargs)
e811c8ce
RD
2768
2769 def SetOption(*args, **kwargs):
7a27cf7c
RD
2770 """
2771 SetOption(self, String name, String value)
2772
2773 Sets an image handler defined option. For example, when saving as a
2774 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2775 number between 0 and 100 (0 is terrible, 100 is very good).
2776 """
54f9ee45 2777 return _core_.Image_SetOption(*args, **kwargs)
e811c8ce
RD
2778
2779 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2780 """
2781 SetOptionInt(self, String name, int value)
2782
2783 Sets an image option as an integer.
2784 """
54f9ee45 2785 return _core_.Image_SetOptionInt(*args, **kwargs)
e811c8ce
RD
2786
2787 def GetOption(*args, **kwargs):
7a27cf7c
RD
2788 """
2789 GetOption(self, String name) -> String
2790
2791 Gets the value of an image handler option.
2792 """
54f9ee45 2793 return _core_.Image_GetOption(*args, **kwargs)
e811c8ce
RD
2794
2795 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2796 """
2797 GetOptionInt(self, String name) -> int
2798
2799 Gets the value of an image handler option as an integer. If the given
2800 option is not present, the function returns 0.
2801 """
54f9ee45 2802 return _core_.Image_GetOptionInt(*args, **kwargs)
e811c8ce
RD
2803
2804 def HasOption(*args, **kwargs):
7a27cf7c
RD
2805 """
2806 HasOption(self, String name) -> bool
2807
2808 Returns true if the given option is present.
2809 """
54f9ee45 2810 return _core_.Image_HasOption(*args, **kwargs)
e811c8ce
RD
2811
2812 def CountColours(*args, **kwargs):
a95a7133 2813 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
54f9ee45 2814 return _core_.Image_CountColours(*args, **kwargs)
e811c8ce
RD
2815
2816 def ComputeHistogram(*args, **kwargs):
a95a7133 2817 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
54f9ee45 2818 return _core_.Image_ComputeHistogram(*args, **kwargs)
e811c8ce
RD
2819
2820 def AddHandler(*args, **kwargs):
66c033b4 2821 """AddHandler(ImageHandler handler)"""
54f9ee45 2822 return _core_.Image_AddHandler(*args, **kwargs)
e811c8ce
RD
2823
2824 AddHandler = staticmethod(AddHandler)
2825 def InsertHandler(*args, **kwargs):
66c033b4 2826 """InsertHandler(ImageHandler handler)"""
54f9ee45 2827 return _core_.Image_InsertHandler(*args, **kwargs)
e811c8ce
RD
2828
2829 InsertHandler = staticmethod(InsertHandler)
2830 def RemoveHandler(*args, **kwargs):
66c033b4 2831 """RemoveHandler(String name) -> bool"""
54f9ee45 2832 return _core_.Image_RemoveHandler(*args, **kwargs)
e811c8ce
RD
2833
2834 RemoveHandler = staticmethod(RemoveHandler)
0085ce49
RD
2835 def GetHandlers(*args, **kwargs):
2836 """GetHandlers() -> PyObject"""
2837 return _core_.Image_GetHandlers(*args, **kwargs)
2838
2839 GetHandlers = staticmethod(GetHandlers)
e811c8ce 2840 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2841 """
2842 GetImageExtWildcard() -> String
2843
2844 Iterates all registered wxImageHandler objects, and returns a string
2845 containing file extension masks suitable for passing to file open/save
2846 dialog boxes.
2847 """
54f9ee45 2848 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
e811c8ce
RD
2849
2850 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2851 def ConvertToBitmap(*args, **kwargs):
1fbf26be 2852 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
54f9ee45 2853 return _core_.Image_ConvertToBitmap(*args, **kwargs)
e811c8ce
RD
2854
2855 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 2856 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
54f9ee45 2857 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
e811c8ce 2858
943e8dfd
RD
2859 def RotateHue(*args, **kwargs):
2860 """
2861 RotateHue(self, double angle)
2862
2863 Rotates the hue of each pixel of the image. Hue is a double in the
2864 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2865 """
2866 return _core_.Image_RotateHue(*args, **kwargs)
2867
2868 def RGBtoHSV(*args, **kwargs):
2869 """
2870 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2871
2872 Converts a color in RGB color space to HSV color space.
2873 """
2874 return _core_.Image_RGBtoHSV(*args, **kwargs)
2875
2876 RGBtoHSV = staticmethod(RGBtoHSV)
2877 def HSVtoRGB(*args, **kwargs):
2878 """
2879 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2880
2881 Converts a color in HSV color space to RGB color space.
2882 """
2883 return _core_.Image_HSVtoRGB(*args, **kwargs)
2884
2885 HSVtoRGB = staticmethod(HSVtoRGB)
e811c8ce 2886 def __nonzero__(self): return self.Ok()
2131d850 2887_core_.Image_swigregister(Image)
d14a1e28
RD
2888
2889def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
2890 """
2891 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2892
2893 Loads an image from a file, using a MIME type string (such as
2894 'image/jpeg') to specify image type.
2895 """
54f9ee45 2896 val = _core_.new_ImageFromMime(*args, **kwargs)
d14a1e28
RD
2897 return val
2898
2899def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
2900 """
2901 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2902
2903 Loads an image from an input stream, or any readable Python file-like
2904 object.
2905 """
54f9ee45 2906 val = _core_.new_ImageFromStream(*args, **kwargs)
d14a1e28
RD
2907 return val
2908
2909def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
2910 """
2911 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2912
2913 Loads an image from an input stream, or any readable Python file-like
2914 object, specifying the image format with a MIME type string.
2915 """
54f9ee45 2916 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d14a1e28
RD
2917 return val
2918
66c033b4 2919def EmptyImage(*args, **kwargs):
61d07ac7
RD
2920 """
2921 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2922
2923 Construct an empty image of a given size, optionally setting all
2924 pixels to black.
2925 """
66c033b4 2926 val = _core_.new_EmptyImage(*args, **kwargs)
d14a1e28
RD
2927 return val
2928
2929def ImageFromBitmap(*args, **kwargs):
61d07ac7
RD
2930 """
2931 ImageFromBitmap(Bitmap bitmap) -> Image
2932
2933 Construct an Image from a `wx.Bitmap`.
2934 """
54f9ee45 2935 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d14a1e28
RD
2936 return val
2937
2938def ImageFromData(*args, **kwargs):
61d07ac7
RD
2939 """
2940 ImageFromData(int width, int height, buffer data) -> Image
2941
2942 Construct an Image from a buffer of RGB bytes. Accepts either a
2943 string or a buffer object holding the data and the length of the data
2944 must be width*height*3.
2945 """
54f9ee45 2946 val = _core_.new_ImageFromData(*args, **kwargs)
d14a1e28
RD
2947 return val
2948
1823fbb4 2949def ImageFromDataWithAlpha(*args, **kwargs):
61d07ac7
RD
2950 """
2951 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2952
2953 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2954 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
2955 length of the data must be width*height*3 bytes, and the length of the
2956 alpha data must be width*height bytes.
61d07ac7 2957 """
1823fbb4 2958 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
1823fbb4
RD
2959 return val
2960
e811c8ce 2961def Image_CanRead(*args, **kwargs):
0085ce49 2962 """
7a27cf7c
RD
2963 Image_CanRead(String filename) -> bool
2964
2965 Returns True if the image handlers can read this file.
2966 """
0085ce49 2967 return _core_.Image_CanRead(*args, **kwargs)
d14a1e28 2968
e811c8ce 2969def Image_GetImageCount(*args, **kwargs):
0085ce49 2970 """
7a27cf7c
RD
2971 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2972
2973 If the image file contains more than one image and the image handler
2974 is capable of retrieving these individually, this function will return
2975 the number of available images.
2976 """
0085ce49 2977 return _core_.Image_GetImageCount(*args, **kwargs)
d14a1e28 2978
e811c8ce 2979def Image_CanReadStream(*args, **kwargs):
0085ce49 2980 """
7a27cf7c
RD
2981 Image_CanReadStream(InputStream stream) -> bool
2982
2983 Returns True if the image handlers can read an image file from the
2984 data currently on the input stream, or a readable Python file-like
2985 object.
2986 """
0085ce49 2987 return _core_.Image_CanReadStream(*args, **kwargs)
d14a1e28 2988
e811c8ce 2989def Image_AddHandler(*args, **kwargs):
0085ce49
RD
2990 """Image_AddHandler(ImageHandler handler)"""
2991 return _core_.Image_AddHandler(*args, **kwargs)
d14a1e28 2992
e811c8ce 2993def Image_InsertHandler(*args, **kwargs):
0085ce49
RD
2994 """Image_InsertHandler(ImageHandler handler)"""
2995 return _core_.Image_InsertHandler(*args, **kwargs)
d14a1e28 2996
e811c8ce 2997def Image_RemoveHandler(*args, **kwargs):
0085ce49
RD
2998 """Image_RemoveHandler(String name) -> bool"""
2999 return _core_.Image_RemoveHandler(*args, **kwargs)
d14a1e28 3000
0085ce49
RD
3001def Image_GetHandlers(*args):
3002 """Image_GetHandlers() -> PyObject"""
3003 return _core_.Image_GetHandlers(*args)
3004
3005def Image_GetImageExtWildcard(*args):
3006 """
7a27cf7c
RD
3007 Image_GetImageExtWildcard() -> String
3008
3009 Iterates all registered wxImageHandler objects, and returns a string
3010 containing file extension masks suitable for passing to file open/save
3011 dialog boxes.
3012 """
0085ce49 3013 return _core_.Image_GetImageExtWildcard(*args)
d14a1e28 3014
943e8dfd 3015def Image_RGBtoHSV(*args, **kwargs):
0085ce49 3016 """
943e8dfd
RD
3017 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3018
3019 Converts a color in RGB color space to HSV color space.
3020 """
0085ce49 3021 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3022
3023def Image_HSVtoRGB(*args, **kwargs):
0085ce49 3024 """
943e8dfd
RD
3025 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3026
3027 Converts a color in HSV color space to RGB color space.
3028 """
0085ce49 3029 return _core_.Image_HSVtoRGB(*args, **kwargs)
943e8dfd 3030
5e4ca4a8
RD
3031def InitAllImageHandlers():
3032 """
3033 The former functionality of InitAllImageHanders is now done internal to
3034 the _core_ extension module and so this function has become a simple NOP.
3035 """
3036 pass
d14a1e28 3037
54f9ee45
RD
3038IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3039IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
3040PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3041PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3042PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
54f9ee45
RD
3043BMP_24BPP = _core_.BMP_24BPP
3044BMP_8BPP = _core_.BMP_8BPP
3045BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3046BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3047BMP_8BPP_RED = _core_.BMP_8BPP_RED
3048BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3049BMP_4BPP = _core_.BMP_4BPP
3050BMP_1BPP = _core_.BMP_1BPP
3051BMP_1BPP_BW = _core_.BMP_1BPP_BW
d14a1e28 3052class BMPHandler(ImageHandler):
27fb7603 3053 """A `wx.ImageHandler` for \*.bmp bitmap files."""
0085ce49
RD
3054 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3055 __repr__ = _swig_repr
3056 def __init__(self, *args, **kwargs):
27fb7603
RD
3057 """
3058 __init__(self) -> BMPHandler
3059
3060 A `wx.ImageHandler` for \*.bmp bitmap files.
3061 """
0085ce49 3062 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3063_core_.BMPHandler_swigregister(BMPHandler)
d14a1e28 3064NullImage = cvar.NullImage
0c243d93 3065IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d14a1e28
RD
3066IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3067IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3068IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3069IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
0c243d93
RD
3070IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3071IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d14a1e28 3072IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3073IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
0c243d93
RD
3074IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3075IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3076IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3077IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
3078IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3079IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d14a1e28
RD
3080
3081class ICOHandler(BMPHandler):
27fb7603 3082 """A `wx.ImageHandler` for \*.ico icon files."""
0085ce49
RD
3083 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3084 __repr__ = _swig_repr
3085 def __init__(self, *args, **kwargs):
27fb7603
RD
3086 """
3087 __init__(self) -> ICOHandler
3088
3089 A `wx.ImageHandler` for \*.ico icon files.
3090 """
0085ce49 3091 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3092_core_.ICOHandler_swigregister(ICOHandler)
d14a1e28
RD
3093
3094class CURHandler(ICOHandler):
27fb7603 3095 """A `wx.ImageHandler` for \*.cur cursor files."""
0085ce49
RD
3096 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3097 __repr__ = _swig_repr
3098 def __init__(self, *args, **kwargs):
27fb7603
RD
3099 """
3100 __init__(self) -> CURHandler
3101
3102 A `wx.ImageHandler` for \*.cur cursor files.
3103 """
0085ce49 3104 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3105_core_.CURHandler_swigregister(CURHandler)
d14a1e28
RD
3106
3107class ANIHandler(CURHandler):
27fb7603 3108 """A `wx.ImageHandler` for \*.ani animated cursor files."""
0085ce49
RD
3109 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3110 __repr__ = _swig_repr
3111 def __init__(self, *args, **kwargs):
27fb7603
RD
3112 """
3113 __init__(self) -> ANIHandler
3114
3115 A `wx.ImageHandler` for \*.ani animated cursor files.
3116 """
0085ce49 3117 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3118_core_.ANIHandler_swigregister(ANIHandler)
d14a1e28
RD
3119
3120class PNGHandler(ImageHandler):
27fb7603 3121 """A `wx.ImageHandler` for PNG image files."""
0085ce49
RD
3122 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3123 __repr__ = _swig_repr
3124 def __init__(self, *args, **kwargs):
27fb7603
RD
3125 """
3126 __init__(self) -> PNGHandler
3127
3128 A `wx.ImageHandler` for PNG image files.
3129 """
0085ce49 3130 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3131_core_.PNGHandler_swigregister(PNGHandler)
d14a1e28
RD
3132
3133class GIFHandler(ImageHandler):
27fb7603 3134 """A `wx.ImageHandler` for GIF image files."""
0085ce49
RD
3135 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3136 __repr__ = _swig_repr
3137 def __init__(self, *args, **kwargs):
27fb7603
RD
3138 """
3139 __init__(self) -> GIFHandler
3140
3141 A `wx.ImageHandler` for GIF image files.
3142 """
0085ce49 3143 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3144_core_.GIFHandler_swigregister(GIFHandler)
d14a1e28
RD
3145
3146class PCXHandler(ImageHandler):
27fb7603 3147 """A `wx.ImageHandler` for PCX imager files."""
0085ce49
RD
3148 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3149 __repr__ = _swig_repr
3150 def __init__(self, *args, **kwargs):
27fb7603
RD
3151 """
3152 __init__(self) -> PCXHandler
3153
3154 A `wx.ImageHandler` for PCX imager files.
3155 """
0085ce49 3156 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3157_core_.PCXHandler_swigregister(PCXHandler)
d14a1e28
RD
3158
3159class JPEGHandler(ImageHandler):
27fb7603 3160 """A `wx.ImageHandler` for JPEG/JPG image files."""
0085ce49
RD
3161 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3162 __repr__ = _swig_repr
3163 def __init__(self, *args, **kwargs):
27fb7603
RD
3164 """
3165 __init__(self) -> JPEGHandler
3166
3167 A `wx.ImageHandler` for JPEG/JPG image files.
3168 """
0085ce49 3169 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3170_core_.JPEGHandler_swigregister(JPEGHandler)
d14a1e28
RD
3171
3172class PNMHandler(ImageHandler):
27fb7603 3173 """A `wx.ImageHandler` for PNM image files."""
0085ce49
RD
3174 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3175 __repr__ = _swig_repr
3176 def __init__(self, *args, **kwargs):
27fb7603
RD
3177 """
3178 __init__(self) -> PNMHandler
3179
3180 A `wx.ImageHandler` for PNM image files.
3181 """
0085ce49 3182 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3183_core_.PNMHandler_swigregister(PNMHandler)
d14a1e28
RD
3184
3185class XPMHandler(ImageHandler):
27fb7603 3186 """A `wx.ImageHandler` for XPM image."""
0085ce49
RD
3187 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3188 __repr__ = _swig_repr
3189 def __init__(self, *args, **kwargs):
27fb7603
RD
3190 """
3191 __init__(self) -> XPMHandler
3192
3193 A `wx.ImageHandler` for XPM image.
3194 """
0085ce49 3195 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3196_core_.XPMHandler_swigregister(XPMHandler)
d14a1e28
RD
3197
3198class TIFFHandler(ImageHandler):
27fb7603 3199 """A `wx.ImageHandler` for TIFF image files."""
0085ce49
RD
3200 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3201 __repr__ = _swig_repr
3202 def __init__(self, *args, **kwargs):
27fb7603
RD
3203 """
3204 __init__(self) -> TIFFHandler
3205
3206 A `wx.ImageHandler` for TIFF image files.
3207 """
0085ce49 3208 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3209_core_.TIFFHandler_swigregister(TIFFHandler)
d14a1e28 3210
c0de73ae
RD
3211QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3212QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3213class Quantize(object):
3214 """Performs quantization, or colour reduction, on a wxImage."""
0085ce49
RD
3215 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3216 def __init__(self): raise AttributeError, "No constructor defined"
3217 __repr__ = _swig_repr
c0de73ae
RD
3218 def Quantize(*args, **kwargs):
3219 """
3220 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3221
3222 Reduce the colours in the source image and put the result into the
3223 destination image, setting the palette in the destination if
3224 needed. Both images may be the same, to overwrite the source image.
3225 """
3226 return _core_.Quantize_Quantize(*args, **kwargs)
3227
3228 Quantize = staticmethod(Quantize)
2131d850 3229_core_.Quantize_swigregister(Quantize)
c0de73ae
RD
3230
3231def Quantize_Quantize(*args, **kwargs):
0085ce49 3232 """
c0de73ae
RD
3233 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3234
3235 Reduce the colours in the source image and put the result into the
3236 destination image, setting the palette in the destination if
3237 needed. Both images may be the same, to overwrite the source image.
3238 """
0085ce49 3239 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3240
d14a1e28
RD
3241#---------------------------------------------------------------------------
3242
3243class EvtHandler(Object):
093d3ff1 3244 """Proxy of C++ EvtHandler class"""
0085ce49
RD
3245 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3246 __repr__ = _swig_repr
3247 def __init__(self, *args, **kwargs):
a95a7133 3248 """__init__(self) -> EvtHandler"""
0085ce49 3249 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
e811c8ce 3250 def GetNextHandler(*args, **kwargs):
a95a7133 3251 """GetNextHandler(self) -> EvtHandler"""
54f9ee45 3252 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
e811c8ce
RD
3253
3254 def GetPreviousHandler(*args, **kwargs):
a95a7133 3255 """GetPreviousHandler(self) -> EvtHandler"""
54f9ee45 3256 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3257
3258 def SetNextHandler(*args, **kwargs):
a95a7133 3259 """SetNextHandler(self, EvtHandler handler)"""
54f9ee45 3260 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
e811c8ce
RD
3261
3262 def SetPreviousHandler(*args, **kwargs):
a95a7133 3263 """SetPreviousHandler(self, EvtHandler handler)"""
54f9ee45 3264 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3265
3266 def GetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3267 """GetEvtHandlerEnabled(self) -> bool"""
54f9ee45 3268 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3269
3270 def SetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3271 """SetEvtHandlerEnabled(self, bool enabled)"""
54f9ee45 3272 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3273
3274 def ProcessEvent(*args, **kwargs):
a95a7133 3275 """ProcessEvent(self, Event event) -> bool"""
54f9ee45 3276 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
e811c8ce
RD
3277
3278 def AddPendingEvent(*args, **kwargs):
a95a7133 3279 """AddPendingEvent(self, Event event)"""
54f9ee45 3280 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
e811c8ce
RD
3281
3282 def ProcessPendingEvents(*args, **kwargs):
a95a7133 3283 """ProcessPendingEvents(self)"""
54f9ee45 3284 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
3285
3286 def Connect(*args, **kwargs):
a95a7133 3287 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
54f9ee45 3288 return _core_.EvtHandler_Connect(*args, **kwargs)
e811c8ce
RD
3289
3290 def Disconnect(*args, **kwargs):
2131d850 3291 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
54f9ee45 3292 return _core_.EvtHandler_Disconnect(*args, **kwargs)
e811c8ce
RD
3293
3294 def _setOORInfo(*args, **kwargs):
689b42ee 3295 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3296 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3297 args[0].thisown = 0
3298 return val
e811c8ce 3299
d14a1e28
RD
3300 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3301 """
3302 Bind an event to an event handler.
3303
db3e571a
RD
3304 :param event: One of the EVT_* objects that specifies the
3305 type of event to bind,
d14a1e28 3306
db3e571a
RD
3307 :param handler: A callable object to be invoked when the
3308 event is delivered to self. Pass None to
3309 disconnect an event handler.
d14a1e28 3310
db3e571a
RD
3311 :param source: Sometimes the event originates from a
3312 different window than self, but you still
3313 want to catch it in self. (For example, a
3314 button event delivered to a frame.) By
3315 passing the source of the event, the event
3316 handling system is able to differentiate
3317 between the same event type from different
3318 controls.
d14a1e28 3319
db3e571a
RD
3320 :param id: Used to spcify the event source by ID instead
3321 of instance.
3322
3323 :param id2: Used when it is desirable to bind a handler
3324 to a range of IDs, such as with EVT_MENU_RANGE.
d14a1e28
RD
3325 """
3326 if source is not None:
3327 id = source.GetId()
3328 event.Bind(self, id, id2, handler)
3329
66c033b4
RD
3330 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3331 """
3332 Disconencts the event handler binding for event from self.
3333 Returns True if successful.
3334 """
3335 if source is not None:
3336 id = source.GetId()
3337 return event.Unbind(self, id, id2)
d14a1e28 3338
2131d850 3339_core_.EvtHandler_swigregister(EvtHandler)
d14a1e28
RD
3340
3341#---------------------------------------------------------------------------
3342
3343class PyEventBinder(object):
3344 """
3345 Instances of this class are used to bind specific events to event
3346 handlers.
3347 """
3348 def __init__(self, evtType, expectedIDs=0):
3349 if expectedIDs not in [0, 1, 2]:
3350 raise ValueError, "Invalid number of expectedIDs"
3351 self.expectedIDs = expectedIDs
3352
3353 if type(evtType) == list or type(evtType) == tuple:
3354 self.evtType = evtType
3355 else:
3356 self.evtType = [evtType]
3357
3358
3359 def Bind(self, target, id1, id2, function):
3360 """Bind this set of event types to target."""
3361 for et in self.evtType:
3362 target.Connect(id1, id2, et, function)
3363
66c033b4
RD
3364
3365 def Unbind(self, target, id1, id2):
3366 """Remove an event binding."""
3367 success = 0
3368 for et in self.evtType:
3369 success += target.Disconnect(id1, id2, et)
3370 return success != 0
3371
d14a1e28
RD
3372
3373 def __call__(self, *args):
3374 """
3375 For backwards compatibility with the old EVT_* functions.
3376 Should be called with either (window, func), (window, ID,
3377 func) or (window, ID1, ID2, func) parameters depending on the
3378 type of the event.
3379 """
3380 assert len(args) == 2 + self.expectedIDs
3381 id1 = wx.ID_ANY
3382 id2 = wx.ID_ANY
3383 target = args[0]
3384 if self.expectedIDs == 0:
3385 func = args[1]
3386 elif self.expectedIDs == 1:
3387 id1 = args[1]
3388 func = args[2]
3389 elif self.expectedIDs == 2:
3390 id1 = args[1]
3391 id2 = args[2]
3392 func = args[3]
3393 else:
3394 raise ValueError, "Unexpected number of IDs"
3395
3396 self.Bind(target, id1, id2, func)
3397
3398
3399# These two are square pegs that don't fit the PyEventBinder hole...
3400def EVT_COMMAND(win, id, cmd, func):
3401 win.Connect(id, -1, cmd, func)
3402def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3403 win.Connect(id1, id2, cmd, func)
3404
3405
3406#---------------------------------------------------------------------------
3407
3408#---------------------------------------------------------------------------
3409
54f9ee45
RD
3410EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3411EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
d14a1e28 3412
0085ce49 3413def NewEventType(*args):
2131d850 3414 """NewEventType() -> EventType"""
0085ce49 3415 return _core_.NewEventType(*args)
54f9ee45
RD
3416wxEVT_NULL = _core_.wxEVT_NULL
3417wxEVT_FIRST = _core_.wxEVT_FIRST
3418wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3419wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3420wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3421wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3422wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3423wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3424wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3425wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3426wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3427wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3428wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3429wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3430wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3431wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3432wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3433wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3434wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3435wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3436wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3437wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3438wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3439wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3440wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3441wxEVT_MOTION = _core_.wxEVT_MOTION
3442wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3443wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3444wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3445wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3446wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3447wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3448wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3449wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3450wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3451wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3452wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3453wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3454wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3455wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3456wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3457wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3458wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3459wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3460wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3461wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3462wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3463wxEVT_CHAR = _core_.wxEVT_CHAR
3464wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3465wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3466wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3467wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3468wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3469wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3470wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3471wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3472wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3473wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3474wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3475wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3476wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3477wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3478wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3479wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
54f9ee45
RD
3480wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3481wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3482wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3483wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3484wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3485wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3486wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3487wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3488wxEVT_SIZE = _core_.wxEVT_SIZE
3489wxEVT_MOVE = _core_.wxEVT_MOVE
3490wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3491wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3492wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3493wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
54f9ee45
RD
3494wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3495wxEVT_CREATE = _core_.wxEVT_CREATE
3496wxEVT_DESTROY = _core_.wxEVT_DESTROY
3497wxEVT_SHOW = _core_.wxEVT_SHOW
3498wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3499wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3500wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3501wxEVT_PAINT = _core_.wxEVT_PAINT
3502wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3503wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3504wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3505wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3506wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3507wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3508wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3509wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3510wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3511wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3512wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3513wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3514wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3515wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3516wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3517wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3518wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3519wxEVT_IDLE = _core_.wxEVT_IDLE
3520wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3521wxEVT_SIZING = _core_.wxEVT_SIZING
3522wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 3523wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
3524wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3525wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3526wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
54f9ee45
RD
3527wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3528wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3529wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3530wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3531wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3532wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3533wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d14a1e28
RD
3534#
3535# Create some event binders
3536EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3537EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3538EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3539EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3540EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3541EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3542EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3543EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3544EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3545EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3546EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3547EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3548EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 3549EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d14a1e28
RD
3550EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3551EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3552EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3553EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3554EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3555EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3556EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3557EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3558EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3559EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 3560EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d14a1e28
RD
3561EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3562EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3563EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3564EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3565EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3566EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3567EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3568EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3569EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3570EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3571EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3572EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3573EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3574EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3575EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3576EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3577
3578EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3579EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3580EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3581EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3582EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3583EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3584EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3585EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3586EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3587EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3588EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3589EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3590EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3591
3592EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3593 wxEVT_LEFT_UP,
3594 wxEVT_MIDDLE_DOWN,
3595 wxEVT_MIDDLE_UP,
3596 wxEVT_RIGHT_DOWN,
3597 wxEVT_RIGHT_UP,
3598 wxEVT_MOTION,
3599 wxEVT_LEFT_DCLICK,
3600 wxEVT_MIDDLE_DCLICK,
3601 wxEVT_RIGHT_DCLICK,
3602 wxEVT_ENTER_WINDOW,
3603 wxEVT_LEAVE_WINDOW,
3604 wxEVT_MOUSEWHEEL
3605 ])
3606
3607
3608# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 3609EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d14a1e28
RD
3610 wxEVT_SCROLLWIN_BOTTOM,
3611 wxEVT_SCROLLWIN_LINEUP,
3612 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 3613 wxEVT_SCROLLWIN_PAGEUP,
d14a1e28
RD
3614 wxEVT_SCROLLWIN_PAGEDOWN,
3615 wxEVT_SCROLLWIN_THUMBTRACK,
3616 wxEVT_SCROLLWIN_THUMBRELEASE,
3617 ])
3618
3619EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3620EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3621EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3622EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3623EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3624EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3625EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3626EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3627
27fb7603 3628# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
3629EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3630 wxEVT_SCROLL_BOTTOM,
3631 wxEVT_SCROLL_LINEUP,
3632 wxEVT_SCROLL_LINEDOWN,
3633 wxEVT_SCROLL_PAGEUP,
3634 wxEVT_SCROLL_PAGEDOWN,
3635 wxEVT_SCROLL_THUMBTRACK,
3636 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3637 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
3638 ])
3639
3640EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3641EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3642EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3643EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3644EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3645EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3646EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3647EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3648EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3649EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 3650
27fb7603 3651# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
3652EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3653 wxEVT_SCROLL_BOTTOM,
3654 wxEVT_SCROLL_LINEUP,
3655 wxEVT_SCROLL_LINEDOWN,
3656 wxEVT_SCROLL_PAGEUP,
3657 wxEVT_SCROLL_PAGEDOWN,
3658 wxEVT_SCROLL_THUMBTRACK,
d14a1e28 3659 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3660 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
3661 ], 1)
3662
3663EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3664EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3665EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3666EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3667EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3668EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3669EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3670EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3671EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3672EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d14a1e28 3673
d14a1e28
RD
3674EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3675EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3676EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3677EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3678EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3679EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3680EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3681EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3682EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3683EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3684
3685EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3686EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3687EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3688EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3689EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3690EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3691EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3692EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3693EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3694
3695
3696EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3697EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3698EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3699EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3700EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3701EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3702EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3703
3704EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3705
3706EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3707EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3708
3709EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3710
2131d850
RD
3711EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3712EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3713EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d14a1e28
RD
3714
3715
3716#---------------------------------------------------------------------------
3717
3718class Event(Object):
27fb7603
RD
3719 """
3720 An event is a structure holding information about an event passed to a
3721 callback or member function. wx.Event is an abstract base class for
3722 other event classes
3723 """
0085ce49
RD
3724 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3725 def __init__(self): raise AttributeError, "No constructor defined"
3726 __repr__ = _swig_repr
3727 __swig_destroy__ = _core_.delete_Event
3728 __del__ = lambda self : None;
e811c8ce 3729 def SetEventType(*args, **kwargs):
27fb7603 3730 """
2131d850 3731 SetEventType(self, EventType typ)
27fb7603
RD
3732
3733 Sets the specific type of the event.
3734 """
54f9ee45 3735 return _core_.Event_SetEventType(*args, **kwargs)
e811c8ce
RD
3736
3737 def GetEventType(*args, **kwargs):
27fb7603 3738 """
2131d850 3739 GetEventType(self) -> EventType
27fb7603
RD
3740
3741 Returns the identifier of the given event type, such as
3742 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3743 """
54f9ee45 3744 return _core_.Event_GetEventType(*args, **kwargs)
e811c8ce
RD
3745
3746 def GetEventObject(*args, **kwargs):
27fb7603
RD
3747 """
3748 GetEventObject(self) -> Object
3749
3750 Returns the object (usually a window) associated with the event, if
3751 any.
3752 """
54f9ee45 3753 return _core_.Event_GetEventObject(*args, **kwargs)
e811c8ce
RD
3754
3755 def SetEventObject(*args, **kwargs):
27fb7603
RD
3756 """
3757 SetEventObject(self, Object obj)
3758
3759 Sets the originating object, or in other words, obj is normally the
3760 object that is sending the event.
3761 """
54f9ee45 3762 return _core_.Event_SetEventObject(*args, **kwargs)
e811c8ce
RD
3763
3764 def GetTimestamp(*args, **kwargs):
a95a7133 3765 """GetTimestamp(self) -> long"""
54f9ee45 3766 return _core_.Event_GetTimestamp(*args, **kwargs)
e811c8ce
RD
3767
3768 def SetTimestamp(*args, **kwargs):
a95a7133 3769 """SetTimestamp(self, long ts=0)"""
54f9ee45 3770 return _core_.Event_SetTimestamp(*args, **kwargs)
e811c8ce
RD
3771
3772 def GetId(*args, **kwargs):
27fb7603
RD
3773 """
3774 GetId(self) -> int
3775
3776 Returns the identifier associated with this event, such as a button
3777 command id.
3778 """
54f9ee45 3779 return _core_.Event_GetId(*args, **kwargs)
e811c8ce
RD
3780
3781 def SetId(*args, **kwargs):
27fb7603
RD
3782 """
3783 SetId(self, int Id)
3784
3785 Set's the ID for the event. This is usually the ID of the window that
3786 is sending the event, but it can also be a command id from a menu
3787 item, etc.
3788 """
54f9ee45 3789 return _core_.Event_SetId(*args, **kwargs)
e811c8ce
RD
3790
3791 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
3792 """
3793 IsCommandEvent(self) -> bool
3794
3795 Returns true if the event is or is derived from `wx.CommandEvent` else
3796 it returns false. Note: Exists only for optimization purposes.
3797 """
54f9ee45 3798 return _core_.Event_IsCommandEvent(*args, **kwargs)
e811c8ce
RD
3799
3800 def Skip(*args, **kwargs):
51b83b37
RD
3801 """
3802 Skip(self, bool skip=True)
3803
3804 Called by an event handler, it controls whether additional event
3805 handlers bound to this event will be called after the current event
3806 handler returns. Skip(false) (the default setting) will prevent
3807 additional event handlers from being called and control will be
3808 returned to the sender of the event immediately after the current
3809 handler has finished. Skip(True) will cause the event processing
3810 system to continue searching for a handler function for this event.
3811
3812 """
54f9ee45 3813 return _core_.Event_Skip(*args, **kwargs)
e811c8ce
RD
3814
3815 def GetSkipped(*args, **kwargs):
27fb7603
RD
3816 """
3817 GetSkipped(self) -> bool
3818
3819 Returns true if the event handler should be skipped, false otherwise.
3820 :see: `Skip`
3821 """
54f9ee45 3822 return _core_.Event_GetSkipped(*args, **kwargs)
e811c8ce
RD
3823
3824 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
3825 """
3826 ShouldPropagate(self) -> bool
3827
3828 Test if this event should be propagated to the parent window or not,
3829 i.e. if the propagation level is currently greater than 0.
3830 """
54f9ee45 3831 return _core_.Event_ShouldPropagate(*args, **kwargs)
e811c8ce
RD
3832
3833 def StopPropagation(*args, **kwargs):
27fb7603
RD
3834 """
3835 StopPropagation(self) -> int
3836
3837 Stop the event from propagating to its parent window. Returns the old
3838 propagation level value which may be later passed to
3839 `ResumePropagation` to allow propagating the event again.
3840 """
54f9ee45 3841 return _core_.Event_StopPropagation(*args, **kwargs)
e811c8ce
RD
3842
3843 def ResumePropagation(*args, **kwargs):
27fb7603
RD
3844 """
3845 ResumePropagation(self, int propagationLevel)
3846
3847 Resume the event propagation by restoring the propagation level. (For
3848 example, you can use the value returned by an earlier call to
3849 `StopPropagation`.)
3850
3851 """
54f9ee45 3852 return _core_.Event_ResumePropagation(*args, **kwargs)
e811c8ce
RD
3853
3854 def Clone(*args, **kwargs):
a95a7133 3855 """Clone(self) -> Event"""
54f9ee45 3856 return _core_.Event_Clone(*args, **kwargs)
e811c8ce 3857
2131d850 3858_core_.Event_swigregister(Event)
d14a1e28
RD
3859
3860#---------------------------------------------------------------------------
3861
3862class PropagationDisabler(object):
27fb7603
RD
3863 """
3864 Helper class to temporarily change an event not to propagate. Simply
3865 create an instance of this class and then whe it is destroyed the
3866 propogation of the event will be restored.
3867 """
0085ce49
RD
3868 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3869 __repr__ = _swig_repr
3870 def __init__(self, *args, **kwargs):
27fb7603
RD
3871 """
3872 __init__(self, Event event) -> PropagationDisabler
3873
3874 Helper class to temporarily change an event not to propagate. Simply
3875 create an instance of this class and then whe it is destroyed the
3876 propogation of the event will be restored.
3877 """
0085ce49
RD
3878 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3879 __swig_destroy__ = _core_.delete_PropagationDisabler
3880 __del__ = lambda self : None;
2131d850 3881_core_.PropagationDisabler_swigregister(PropagationDisabler)
d14a1e28
RD
3882
3883class PropagateOnce(object):
27fb7603
RD
3884 """
3885 A helper class that will temporarily lower propagation level of an
3886 event. Simply create an instance of this class and then whe it is
3887 destroyed the propogation of the event will be restored.
3888 """
0085ce49
RD
3889 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3890 __repr__ = _swig_repr
3891 def __init__(self, *args, **kwargs):
27fb7603
RD
3892 """
3893 __init__(self, Event event) -> PropagateOnce
3894
3895 A helper class that will temporarily lower propagation level of an
3896 event. Simply create an instance of this class and then whe it is
3897 destroyed the propogation of the event will be restored.
3898 """
0085ce49
RD
3899 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3900 __swig_destroy__ = _core_.delete_PropagateOnce
3901 __del__ = lambda self : None;
2131d850 3902_core_.PropagateOnce_swigregister(PropagateOnce)
d14a1e28
RD
3903
3904#---------------------------------------------------------------------------
3905
3906class CommandEvent(Event):
27fb7603
RD
3907 """
3908 This event class contains information about command events, which
3909 originate from a variety of simple controls, as well as menus and
3910 toolbars.
3911 """
0085ce49
RD
3912 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3913 __repr__ = _swig_repr
3914 def __init__(self, *args, **kwargs):
27fb7603 3915 """
2131d850 3916 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
3917
3918 This event class contains information about command events, which
3919 originate from a variety of simple controls, as well as menus and
3920 toolbars.
3921 """
0085ce49 3922 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
e811c8ce 3923 def GetSelection(*args, **kwargs):
27fb7603
RD
3924 """
3925 GetSelection(self) -> int
3926
3927 Returns item index for a listbox or choice selection event (not valid
3928 for a deselection).
3929 """
54f9ee45 3930 return _core_.CommandEvent_GetSelection(*args, **kwargs)
e811c8ce
RD
3931
3932 def SetString(*args, **kwargs):
a95a7133 3933 """SetString(self, String s)"""
54f9ee45 3934 return _core_.CommandEvent_SetString(*args, **kwargs)
e811c8ce
RD
3935
3936 def GetString(*args, **kwargs):
27fb7603
RD
3937 """
3938 GetString(self) -> String
3939
3940 Returns item string for a listbox or choice selection event (not valid
3941 for a deselection).
3942 """
54f9ee45 3943 return _core_.CommandEvent_GetString(*args, **kwargs)
e811c8ce
RD
3944
3945 def IsChecked(*args, **kwargs):
27fb7603
RD
3946 """
3947 IsChecked(self) -> bool
3948
3949 This method can be used with checkbox and menu events: for the
3950 checkboxes, the method returns true for a selection event and false
3951 for a deselection one. For the menu events, this method indicates if
3952 the menu item just has become checked or unchecked (and thus only
3953 makes sense for checkable menu items).
3954 """
54f9ee45 3955 return _core_.CommandEvent_IsChecked(*args, **kwargs)
e811c8ce 3956
242b7b46 3957 Checked = IsChecked
e811c8ce 3958 def IsSelection(*args, **kwargs):
27fb7603
RD
3959 """
3960 IsSelection(self) -> bool
3961
3962 For a listbox or similar event, returns true if it is a selection,
3963 false if it is a deselection.
3964 """
54f9ee45 3965 return _core_.CommandEvent_IsSelection(*args, **kwargs)
e811c8ce
RD
3966
3967 def SetExtraLong(*args, **kwargs):
a95a7133 3968 """SetExtraLong(self, long extraLong)"""
54f9ee45 3969 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
e811c8ce
RD
3970
3971 def GetExtraLong(*args, **kwargs):
27fb7603
RD
3972 """
3973 GetExtraLong(self) -> long
3974
5ba5649b
RD
3975 Returns extra information dependant on the event objects type. If the
3976 event comes from a listbox selection, it is a boolean determining
3977 whether the event was a selection (true) or a deselection (false). A
3978 listbox deselection only occurs for multiple-selection boxes, and in
3979 this case the index and string values are indeterminate and the
3980 listbox must be examined by the application.
27fb7603 3981 """
54f9ee45 3982 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
e811c8ce
RD
3983
3984 def SetInt(*args, **kwargs):
a95a7133 3985 """SetInt(self, int i)"""
54f9ee45 3986 return _core_.CommandEvent_SetInt(*args, **kwargs)
e811c8ce
RD
3987
3988 def GetInt(*args, **kwargs):
27fb7603 3989 """
01f6b6d3 3990 GetInt(self) -> int
27fb7603 3991
5ba5649b
RD
3992 Returns the integer identifier corresponding to a listbox, choice or
3993 radiobox selection (only if the event was a selection, not a
3994 deselection), or a boolean value representing the value of a checkbox.
27fb7603 3995 """
54f9ee45 3996 return _core_.CommandEvent_GetInt(*args, **kwargs)
e811c8ce 3997
0085ce49
RD
3998 def GetClientData(*args, **kwargs):
3999 """
4000 GetClientData(self) -> PyObject
4001
4002 Returns the client data object for a listbox or choice selection event, (if any.)
4003 """
4004 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4005
4006 def SetClientData(*args, **kwargs):
4007 """
4008 SetClientData(self, PyObject clientData)
4009
4010 Associate the given client data with the item at position n.
4011 """
4012 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4013
4014 GetClientObject = GetClientData
4015 SetClientObject = SetClientData
4016
e811c8ce 4017 def Clone(*args, **kwargs):
a95a7133 4018 """Clone(self) -> Event"""
54f9ee45 4019 return _core_.CommandEvent_Clone(*args, **kwargs)
e811c8ce 4020
2131d850 4021_core_.CommandEvent_swigregister(CommandEvent)
d14a1e28
RD
4022
4023#---------------------------------------------------------------------------
4024
4025class NotifyEvent(CommandEvent):
27fb7603
RD
4026 """
4027 An instance of this class (or one of its derived classes) is sent from
4028 a control when the control's state is being changed and the control
4029 allows that change to be prevented from happening. The event handler
4030 can call `Veto` or `Allow` to tell the control what to do.
4031 """
0085ce49
RD
4032 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4033 __repr__ = _swig_repr
4034 def __init__(self, *args, **kwargs):
27fb7603 4035 """
2131d850 4036 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4037
4038 An instance of this class (or one of its derived classes) is sent from
4039 a control when the control's state is being changed and the control
4040 allows that change to be prevented from happening. The event handler
4041 can call `Veto` or `Allow` to tell the control what to do.
4042 """
0085ce49 4043 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
e811c8ce 4044 def Veto(*args, **kwargs):
27fb7603
RD
4045 """
4046 Veto(self)
4047
4048 Prevents the change announced by this event from happening.
4049
4050 It is in general a good idea to notify the user about the reasons for
4051 vetoing the change because otherwise the applications behaviour (which
4052 just refuses to do what the user wants) might be quite surprising.
4053 """
54f9ee45 4054 return _core_.NotifyEvent_Veto(*args, **kwargs)
e811c8ce
RD
4055
4056 def Allow(*args, **kwargs):
27fb7603
RD
4057 """
4058 Allow(self)
4059
4060 This is the opposite of `Veto`: it explicitly allows the event to be
4061 processed. For most events it is not necessary to call this method as
4062 the events are allowed anyhow but some are forbidden by default (this
4063 will be mentioned in the corresponding event description).
4064 """
54f9ee45 4065 return _core_.NotifyEvent_Allow(*args, **kwargs)
e811c8ce
RD
4066
4067 def IsAllowed(*args, **kwargs):
27fb7603
RD
4068 """
4069 IsAllowed(self) -> bool
4070
4071 Returns true if the change is allowed (`Veto` hasn't been called) or
4072 false otherwise (if it was).
4073 """
54f9ee45 4074 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
e811c8ce 4075
2131d850 4076_core_.NotifyEvent_swigregister(NotifyEvent)
d14a1e28
RD
4077
4078#---------------------------------------------------------------------------
4079
4080class ScrollEvent(CommandEvent):
27fb7603
RD
4081 """
4082 A scroll event holds information about events sent from stand-alone
4083 scrollbars and sliders. Note that scrolled windows do not send
4084 instnaces of this event class, but send the `wx.ScrollWinEvent`
4085 instead.
4086 """
0085ce49
RD
4087 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4088 __repr__ = _swig_repr
4089 def __init__(self, *args, **kwargs):
0df68c9f 4090 """
2131d850 4091 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
0df68c9f
RD
4092 int orient=0) -> ScrollEvent
4093 """
0085ce49 4094 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
e811c8ce 4095 def GetOrientation(*args, **kwargs):
27fb7603
RD
4096 """
4097 GetOrientation(self) -> int
4098
4099 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4100 the scrollbar.
4101 """
54f9ee45 4102 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4103
4104 def GetPosition(*args, **kwargs):
27fb7603
RD
4105 """
4106 GetPosition(self) -> int
4107
4108 Returns the position of the scrollbar.
4109 """
54f9ee45 4110 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4111
4112 def SetOrientation(*args, **kwargs):
a95a7133 4113 """SetOrientation(self, int orient)"""
54f9ee45 4114 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4115
4116 def SetPosition(*args, **kwargs):
a95a7133 4117 """SetPosition(self, int pos)"""
54f9ee45 4118 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
e811c8ce 4119
2131d850 4120_core_.ScrollEvent_swigregister(ScrollEvent)
d14a1e28
RD
4121
4122#---------------------------------------------------------------------------
4123
4124class ScrollWinEvent(Event):
27fb7603
RD
4125 """
4126 A wx.ScrollWinEvent holds information about scrolling and is sent from
4127 scrolling windows.
4128 """
0085ce49
RD
4129 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4130 __repr__ = _swig_repr
4131 def __init__(self, *args, **kwargs):
27fb7603 4132 """
2131d850 4133 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4134
4135 A wx.ScrollWinEvent holds information about scrolling and is sent from
4136 scrolling windows.
4137 """
0085ce49 4138 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
e811c8ce 4139 def GetOrientation(*args, **kwargs):
27fb7603
RD
4140 """
4141 GetOrientation(self) -> int
4142
4143 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4144 the scrollbar.
4145 """
54f9ee45 4146 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4147
4148 def GetPosition(*args, **kwargs):
27fb7603
RD
4149 """
4150 GetPosition(self) -> int
4151
4152 Returns the position of the scrollbar for the thumb track and release
4153 events. Note that this field can't be used for the other events, you
4154 need to query the window itself for the current position in that case.
4155 """
54f9ee45 4156 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4157
4158 def SetOrientation(*args, **kwargs):
a95a7133 4159 """SetOrientation(self, int orient)"""
54f9ee45 4160 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4161
4162 def SetPosition(*args, **kwargs):
a95a7133 4163 """SetPosition(self, int pos)"""
54f9ee45 4164 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
e811c8ce 4165
2131d850 4166_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d14a1e28
RD
4167
4168#---------------------------------------------------------------------------
4169
54f9ee45
RD
4170MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4171MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4172MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4173MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4174MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
d14a1e28 4175class MouseEvent(Event):
27fb7603
RD
4176 """
4177 This event class contains information about the events generated by
4178 the mouse: they include mouse buttons press and release events and
4179 mouse move events.
4180
4181 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4182 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4183 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4184 a middle button so a portable application should avoid relying on the
4185 events from it.
4186
4187 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4188 the former returns true when the event corresponds to the left mouse
4189 button click while the latter returns true if the left mouse button is
4190 currently being pressed. For example, when the user is dragging the
4191 mouse you can use `LeftIsDown` to test whether the left mouse button
4192 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4193 `LeftIsDown` will also return true in wxWidgets whatever the
4194 underlying GUI behaviour is (which is platform-dependent). The same
4195 applies, of course, to other mouse buttons as well.
4196 """
0085ce49
RD
4197 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4198 __repr__ = _swig_repr
4199 def __init__(self, *args, **kwargs):
27fb7603 4200 """
2131d850 4201 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4202
4203 Constructs a wx.MouseEvent. Valid event types are:
4204
4205 * wxEVT_ENTER_WINDOW
4206 * wxEVT_LEAVE_WINDOW
4207 * wxEVT_LEFT_DOWN
4208 * wxEVT_LEFT_UP
4209 * wxEVT_LEFT_DCLICK
4210 * wxEVT_MIDDLE_DOWN
4211 * wxEVT_MIDDLE_UP
4212 * wxEVT_MIDDLE_DCLICK
4213 * wxEVT_RIGHT_DOWN
4214 * wxEVT_RIGHT_UP
4215 * wxEVT_RIGHT_DCLICK
4216 * wxEVT_MOTION
4217 * wxEVT_MOUSEWHEEL
4218 """
0085ce49 4219 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
e811c8ce 4220 def IsButton(*args, **kwargs):
27fb7603
RD
4221 """
4222 IsButton(self) -> bool
4223
4224 Returns true if the event was a mouse button event (not necessarily a
4225 button down event - that may be tested using `ButtonDown`).
4226 """
54f9ee45 4227 return _core_.MouseEvent_IsButton(*args, **kwargs)
e811c8ce
RD
4228
4229 def ButtonDown(*args, **kwargs):
27fb7603
RD
4230 """
4231 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4232
5ba5649b
RD
4233 If the argument is omitted, this returns true if the event was any
4234 mouse button down event. Otherwise the argument specifies which
4235 button-down event shold be checked for (see `Button` for the possible
4236 values).
27fb7603 4237 """
54f9ee45 4238 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
e811c8ce
RD
4239
4240 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4241 """
4242 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4243
4244 If the argument is omitted, this returns true if the event was any
4245 mouse double click event. Otherwise the argument specifies which
4246 double click event to check for (see `Button` for the possible
4247 values).
4248 """
54f9ee45 4249 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
e811c8ce
RD
4250
4251 def ButtonUp(*args, **kwargs):
27fb7603
RD
4252 """
4253 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4254
4255 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4256 mouse button up event. Otherwise the argument specifies which button
4257 up event to check for (see `Button` for the possible values).
27fb7603 4258 """
54f9ee45 4259 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
e811c8ce
RD
4260
4261 def Button(*args, **kwargs):
27fb7603
RD
4262 """
4263 Button(self, int button) -> bool
4264
4265 Returns true if the identified mouse button is changing state. Valid
4266 values of button are:
4267
4268 ==================== =====================================
4269 wx.MOUSE_BTN_LEFT check if left button was pressed
4270 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4271 wx.MOUSE_BTN_RIGHT check if right button was pressed
4272 wx.MOUSE_BTN_ANY check if any button was pressed
4273 ==================== =====================================
4274
4275 """
54f9ee45 4276 return _core_.MouseEvent_Button(*args, **kwargs)
e811c8ce
RD
4277
4278 def ButtonIsDown(*args, **kwargs):
a95a7133 4279 """ButtonIsDown(self, int but) -> bool"""
54f9ee45 4280 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
e811c8ce
RD
4281
4282 def GetButton(*args, **kwargs):
27fb7603
RD
4283 """
4284 GetButton(self) -> int
4285
4286 Returns the mouse button which generated this event or
4287 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4288 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4289 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4290 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4291 right buttons respectively.
4292 """
54f9ee45 4293 return _core_.MouseEvent_GetButton(*args, **kwargs)
e811c8ce
RD
4294
4295 def ControlDown(*args, **kwargs):
27fb7603
RD
4296 """
4297 ControlDown(self) -> bool
4298
4299 Returns true if the control key was down at the time of the event.
4300 """
54f9ee45 4301 return _core_.MouseEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
4302
4303 def MetaDown(*args, **kwargs):
27fb7603
RD
4304 """
4305 MetaDown(self) -> bool
4306
4307 Returns true if the Meta key was down at the time of the event.
4308 """
54f9ee45 4309 return _core_.MouseEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
4310
4311 def AltDown(*args, **kwargs):
27fb7603
RD
4312 """
4313 AltDown(self) -> bool
4314
4315 Returns true if the Alt key was down at the time of the event.
4316 """
54f9ee45 4317 return _core_.MouseEvent_AltDown(*args, **kwargs)
e811c8ce
RD
4318
4319 def ShiftDown(*args, **kwargs):
27fb7603
RD
4320 """
4321 ShiftDown(self) -> bool
4322
4323 Returns true if the Shift key was down at the time of the event.
4324 """
54f9ee45 4325 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
e811c8ce 4326
412d302d
RD
4327 def CmdDown(*args, **kwargs):
4328 """
4329 CmdDown(self) -> bool
4330
4331 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4332 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4333 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4334 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4335 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4336 purpose. So for non-Mac platforms this is the same as `ControlDown`
4337 and Macs this is the same as `MetaDown`.
4338 """
4339 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4340
e811c8ce 4341 def LeftDown(*args, **kwargs):
27fb7603
RD
4342 """
4343 LeftDown(self) -> bool
4344
4345 Returns true if the left mouse button state changed to down.
4346 """
54f9ee45 4347 return _core_.MouseEvent_LeftDown(*args, **kwargs)
e811c8ce
RD
4348
4349 def MiddleDown(*args, **kwargs):
27fb7603
RD
4350 """
4351 MiddleDown(self) -> bool
4352
4353 Returns true if the middle mouse button state changed to down.
4354 """
54f9ee45 4355 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
e811c8ce
RD
4356
4357 def RightDown(*args, **kwargs):
27fb7603
RD
4358 """
4359 RightDown(self) -> bool
4360
4361 Returns true if the right mouse button state changed to down.
4362 """
54f9ee45 4363 return _core_.MouseEvent_RightDown(*args, **kwargs)
e811c8ce
RD
4364
4365 def LeftUp(*args, **kwargs):
27fb7603
RD
4366 """
4367 LeftUp(self) -> bool
4368
4369 Returns true if the left mouse button state changed to up.
4370 """
54f9ee45 4371 return _core_.MouseEvent_LeftUp(*args, **kwargs)
e811c8ce
RD
4372
4373 def MiddleUp(*args, **kwargs):
27fb7603
RD
4374 """
4375 MiddleUp(self) -> bool
4376
4377 Returns true if the middle mouse button state changed to up.
4378 """
54f9ee45 4379 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
e811c8ce
RD
4380
4381 def RightUp(*args, **kwargs):
27fb7603
RD
4382 """
4383 RightUp(self) -> bool
4384
4385 Returns true if the right mouse button state changed to up.
4386 """
54f9ee45 4387 return _core_.MouseEvent_RightUp(*args, **kwargs)
e811c8ce
RD
4388
4389 def LeftDClick(*args, **kwargs):
27fb7603
RD
4390 """
4391 LeftDClick(self) -> bool
4392
4393 Returns true if the event was a left button double click.
4394 """
54f9ee45 4395 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
e811c8ce
RD
4396
4397 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4398 """
4399 MiddleDClick(self) -> bool
4400
4401 Returns true if the event was a middle button double click.
4402 """
54f9ee45 4403 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
e811c8ce
RD
4404
4405 def RightDClick(*args, **kwargs):
27fb7603
RD
4406 """
4407 RightDClick(self) -> bool
4408
4409 Returns true if the event was a right button double click.
4410 """
54f9ee45 4411 return _core_.MouseEvent_RightDClick(*args, **kwargs)
e811c8ce
RD
4412
4413 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4414 """
4415 LeftIsDown(self) -> bool
4416
4417 Returns true if the left mouse button is currently down, independent
4418 of the current event type.
4419
4420 Please notice that it is not the same as LeftDown which returns true
4421 if the left mouse button was just pressed. Rather, it describes the
4422 state of the mouse button before the event happened.
4423
4424 This event is usually used in the mouse event handlers which process
4425 "move mouse" messages to determine whether the user is (still)
4426 dragging the mouse.
4427 """
54f9ee45 4428 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
e811c8ce
RD
4429
4430 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4431 """
4432 MiddleIsDown(self) -> bool
4433
4434 Returns true if the middle mouse button is currently down, independent
4435 of the current event type.
4436 """
54f9ee45 4437 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
e811c8ce
RD
4438
4439 def RightIsDown(*args, **kwargs):
27fb7603
RD
4440 """
4441 RightIsDown(self) -> bool
4442
4443 Returns true if the right mouse button is currently down, independent
4444 of the current event type.
4445 """
54f9ee45 4446 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
e811c8ce
RD
4447
4448 def Dragging(*args, **kwargs):
27fb7603
RD
4449 """
4450 Dragging(self) -> bool
4451
4452 Returns true if this was a dragging event (motion while a button is
4453 depressed).
4454 """
54f9ee45 4455 return _core_.MouseEvent_Dragging(*args, **kwargs)
e811c8ce
RD
4456
4457 def Moving(*args, **kwargs):
27fb7603
RD
4458 """
4459 Moving(self) -> bool
4460
4461 Returns true if this was a motion event and no mouse buttons were
4462 pressed. If any mouse button is held pressed, then this method returns
4463 false and Dragging returns true.
4464 """
54f9ee45 4465 return _core_.MouseEvent_Moving(*args, **kwargs)
e811c8ce
RD
4466
4467 def Entering(*args, **kwargs):
27fb7603
RD
4468 """
4469 Entering(self) -> bool
4470
4471 Returns true if the mouse was entering the window.
4472 """
54f9ee45 4473 return _core_.MouseEvent_Entering(*args, **kwargs)
e811c8ce
RD
4474
4475 def Leaving(*args, **kwargs):
27fb7603
RD
4476 """
4477 Leaving(self) -> bool
4478
4479 Returns true if the mouse was leaving the window.
4480 """
54f9ee45 4481 return _core_.MouseEvent_Leaving(*args, **kwargs)
e811c8ce
RD
4482
4483 def GetPosition(*args, **kwargs):
0df68c9f 4484 """
a95a7133 4485 GetPosition(self) -> Point
e811c8ce 4486
27fb7603
RD
4487 Returns the pixel position of the mouse in window coordinates when the
4488 event happened.
0df68c9f 4489 """
54f9ee45 4490 return _core_.MouseEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4491
4492 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
4493 """
4494 GetPositionTuple() -> (x,y)
e811c8ce 4495
27fb7603
RD
4496 Returns the pixel position of the mouse in window coordinates when the
4497 event happened.
0df68c9f 4498 """
54f9ee45 4499 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
4500
4501 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4502 """
4503 GetLogicalPosition(self, DC dc) -> Point
4504
4505 Returns the logical mouse position in pixels (i.e. translated
4506 according to the translation set for the DC, which usually indicates
4507 that the window has been scrolled).
4508 """
54f9ee45 4509 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
e811c8ce
RD
4510
4511 def GetX(*args, **kwargs):
27fb7603
RD
4512 """
4513 GetX(self) -> int
4514
4515 Returns X coordinate of the physical mouse event position.
4516 """
54f9ee45 4517 return _core_.MouseEvent_GetX(*args, **kwargs)
e811c8ce
RD
4518
4519 def GetY(*args, **kwargs):
27fb7603
RD
4520 """
4521 GetY(self) -> int
4522
4523 Returns Y coordinate of the physical mouse event position.
4524 """
54f9ee45 4525 return _core_.MouseEvent_GetY(*args, **kwargs)
e811c8ce
RD
4526
4527 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4528 """
4529 GetWheelRotation(self) -> int
4530
4531 Get wheel rotation, positive or negative indicates direction of
4532 rotation. Current devices all send an event when rotation is equal to
4533 +/-WheelDelta, but this allows for finer resolution devices to be
4534 created in the future. Because of this you shouldn't assume that one
4535 event is equal to 1 line or whatever, but you should be able to either
4536 do partial line scrolling or wait until +/-WheelDelta rotation values
4537 have been accumulated before scrolling.
4538 """
54f9ee45 4539 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
e811c8ce
RD
4540
4541 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4542 """
4543 GetWheelDelta(self) -> int
4544
4545 Get wheel delta, normally 120. This is the threshold for action to be
4546 taken, and one such action (for example, scrolling one increment)
4547 should occur for each delta.
4548 """
54f9ee45 4549 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
e811c8ce
RD
4550
4551 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4552 """
4553 GetLinesPerAction(self) -> int
4554
4555 Returns the configured number of lines (or whatever) to be scrolled
4556 per wheel action. Defaults to three.
4557 """
54f9ee45 4558 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
e811c8ce
RD
4559
4560 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4561 """
4562 IsPageScroll(self) -> bool
4563
4564 Returns true if the system has been setup to do page scrolling with
4565 the mouse wheel instead of line scrolling.
4566 """
54f9ee45
RD
4567 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4568
4569 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4570 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4571 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4572 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4573 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4574 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4575 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4576 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4577 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4578 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4579 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4580 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
2131d850 4581_core_.MouseEvent_swigregister(MouseEvent)
d14a1e28
RD
4582
4583#---------------------------------------------------------------------------
4584
4585class SetCursorEvent(Event):
5ba5649b
RD
4586 """
4587 A SetCursorEvent is generated when the mouse cursor is about to be set
4588 as a result of mouse motion. This event gives the application the
4589 chance to perform specific mouse cursor processing based on the
4590 current position of the mouse within the window. Use the `SetCursor`
4591 method to specify the cursor you want to be displayed.
4592 """
0085ce49
RD
4593 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4594 __repr__ = _swig_repr
4595 def __init__(self, *args, **kwargs):
5ba5649b
RD
4596 """
4597 __init__(self, int x=0, int y=0) -> SetCursorEvent
4598
4599 Construct a new `wx.SetCursorEvent`.
4600 """
0085ce49 4601 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
e811c8ce 4602 def GetX(*args, **kwargs):
5ba5649b
RD
4603 """
4604 GetX(self) -> int
4605
4606 Returns the X coordinate of the mouse in client coordinates.
4607 """
54f9ee45 4608 return _core_.SetCursorEvent_GetX(*args, **kwargs)
e811c8ce
RD
4609
4610 def GetY(*args, **kwargs):
5ba5649b
RD
4611 """
4612 GetY(self) -> int
4613
4614 Returns the Y coordinate of the mouse in client coordinates.
4615 """
54f9ee45 4616 return _core_.SetCursorEvent_GetY(*args, **kwargs)
e811c8ce
RD
4617
4618 def SetCursor(*args, **kwargs):
5ba5649b
RD
4619 """
4620 SetCursor(self, Cursor cursor)
4621
4622 Sets the cursor associated with this event.
4623 """
54f9ee45 4624 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
e811c8ce
RD
4625
4626 def GetCursor(*args, **kwargs):
5ba5649b
RD
4627 """
4628 GetCursor(self) -> Cursor
4629
4630 Returns a reference to the cursor specified by this event.
4631 """
54f9ee45 4632 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
e811c8ce
RD
4633
4634 def HasCursor(*args, **kwargs):
5ba5649b
RD
4635 """
4636 HasCursor(self) -> bool
4637
4638 Returns true if the cursor specified by this event is a valid cursor.
4639 """
54f9ee45 4640 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
e811c8ce 4641
2131d850 4642_core_.SetCursorEvent_swigregister(SetCursorEvent)
d14a1e28
RD
4643
4644#---------------------------------------------------------------------------
4645
4646class KeyEvent(Event):
5ba5649b
RD
4647 """
4648 This event class contains information about keypress and character
4649 events. These events are only sent to the widget that currently has
4650 the keyboard focus.
4651
4652 Notice that there are three different kinds of keyboard events in
4653 wxWidgets: key down and up events and char events. The difference
4654 between the first two is clear - the first corresponds to a key press
4655 and the second to a key release - otherwise they are identical. Just
4656 note that if the key is maintained in a pressed state you will
4657 typically get a lot of (automatically generated) down events but only
4658 one up so it is wrong to assume that there is one up event
4659 corresponding to each down one.
4660
4661 Both key events provide untranslated key codes while the char event
4662 carries the translated one. The untranslated code for alphanumeric
4663 keys is always an upper case value. For the other keys it is one of
4664 WXK_XXX values from the keycodes table. The translated key is, in
4665 general, the character the user expects to appear as the result of the
4666 key combination when typing the text into a text entry zone, for
4667 example.
4668
4669 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4670 and the standard US keyboard): when the 'A' key is pressed, the key
4671 down event key code is equal to ASCII A == 65. But the char event key
4672 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4673 'A' keys simultaneously , the key code in key down event will still be
4674 just 'A' while the char event key code parameter will now be 'A' as
4675 well.
4676
4677 Although in this simple case it is clear that the correct key code
4678 could be found in the key down event handler by checking the value
4679 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4680 as for non alphanumeric keys or non-US keyboard layouts the
4681 translation is keyboard-layout dependent and can only be done properly
4682 by the system itself.
4683
4684 Another kind of translation is done when the control key is pressed:
4685 for example, for CTRL-A key press the key down event still carries the
4686 same key code 'A' as usual but the char event will have key code of 1,
4687 the ASCII value of this key combination.
4688
4689 You may discover how the other keys on your system behave
4690 interactively by running the KeyEvents sample in the wxPython demo and
4691 pressing some keys while the blue box at the top has the keyboard
4692 focus.
4693
4694 **Note**: If a key down event is caught and the event handler does not
4695 call event.Skip() then the coresponding char event will not
4696 happen. This is by design and enables the programs that handle both
4697 types of events to be a bit simpler.
4698
4699 **Note for Windows programmers**: The key and char events in wxWidgets
4700 are similar to but slightly different from Windows WM_KEYDOWN and
4701 WM_CHAR events. In particular, Alt-x combination will generate a char
4702 event in wxWidgets (unless it is used as an accelerator).
4703
4704 **Tip**: be sure to call event.Skip() for events that you don't
4705 process in key event function, otherwise menu shortcuts may cease to
4706 work under Windows.
4707
4708 """
0085ce49
RD
4709 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4710 __repr__ = _swig_repr
4711 def __init__(self, *args, **kwargs):
5ba5649b 4712 """
2131d850 4713 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
4714
4715 Construct a new `wx.KeyEvent`. Valid event types are:
4716 *
4717 """
0085ce49 4718 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
4719 def GetModifiers(*args, **kwargs):
4720 """
4721 GetModifiers(self) -> int
4722
4723 Returns a bitmask of the current modifier settings. Can be used to
4724 check if the key event has exactly the given modifiers without having
4725 to explicitly check that the other modifiers are not down. For
4726 example::
4727
4728 if event.GetModifers() == wx.MOD_CONTROL:
4729 DoSomething()
4730
4731 """
4732 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4733
e811c8ce 4734 def ControlDown(*args, **kwargs):
5ba5649b
RD
4735 """
4736 ControlDown(self) -> bool
4737
4738 Returns ``True`` if the Control key was down at the time of the event.
4739 """
54f9ee45 4740 return _core_.KeyEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
4741
4742 def MetaDown(*args, **kwargs):
5ba5649b
RD
4743 """
4744 MetaDown(self) -> bool
4745
4746 Returns ``True`` if the Meta key was down at the time of the event.
4747 """
54f9ee45 4748 return _core_.KeyEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
4749
4750 def AltDown(*args, **kwargs):
5ba5649b
RD
4751 """
4752 AltDown(self) -> bool
4753
4754 Returns ``True`` if the Alt key was down at the time of the event.
4755 """
54f9ee45 4756 return _core_.KeyEvent_AltDown(*args, **kwargs)
e811c8ce
RD
4757
4758 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4759 """
4760 ShiftDown(self) -> bool
4761
4762 Returns ``True`` if the Shift key was down at the time of the event.
4763 """
54f9ee45 4764 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
e811c8ce 4765
412d302d
RD
4766 def CmdDown(*args, **kwargs):
4767 """
4768 CmdDown(self) -> bool
4769
4770 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4771 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4772 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
4773 because Cmd key is used for the same thing under Mac as Ctrl
4774 elsewhere. The Ctrl still exists, it's just not used for this
4775 purpose. So for non-Mac platforms this is the same as `ControlDown`
4776 and Macs this is the same as `MetaDown`.
4777 """
4778 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4779
e811c8ce 4780 def HasModifiers(*args, **kwargs):
5ba5649b
RD
4781 """
4782 HasModifiers(self) -> bool
4783
4784 Returns true if either CTRL or ALT keys was down at the time of the
4785 key event. Note that this function does not take into account neither
4786 SHIFT nor META key states (the reason for ignoring the latter is that
4787 it is common for NUMLOCK key to be configured as META under X but the
4788 key presses even while NUMLOCK is on should be still processed
4789 normally).
4790 """
54f9ee45 4791 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
e811c8ce
RD
4792
4793 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
4794 """
4795 GetKeyCode(self) -> int
4796
4797 Returns the virtual key code. ASCII events return normal ASCII values,
4798 while non-ASCII events return values such as WXK_LEFT for the left
4799 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4800 codes.
4801
4802 Note that in Unicode build, the returned value is meaningful only if
4803 the user entered a character that can be represented in current
4804 locale's default charset. You can obtain the corresponding Unicode
4805 character using `GetUnicodeKey`.
4806 """
54f9ee45 4807 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
e811c8ce 4808
d14a1e28 4809 KeyCode = GetKeyCode
19272049 4810 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
4811 """
4812 GetUnicodeKey(self) -> int
4813
4814 Returns the Unicode character corresponding to this key event. This
4815 function is only meaningfule in a Unicode build of wxPython.
4816 """
19272049 4817 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
e811c8ce 4818
19272049 4819 GetUniChar = GetUnicodeKey
e811c8ce 4820 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
4821 """
4822 GetRawKeyCode(self) -> unsigned int
4823
4824 Returns the raw key code for this event. This is a platform-dependent
4825 scan code which should only be used in advanced
4826 applications. Currently the raw key codes are not supported by all
4827 ports.
4828 """
54f9ee45 4829 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
e811c8ce
RD
4830
4831 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
4832 """
4833 GetRawKeyFlags(self) -> unsigned int
4834
4835 Returns the low level key flags for this event. The flags are
4836 platform-dependent and should only be used in advanced applications.
4837 Currently the raw key flags are not supported by all ports.
4838 """
54f9ee45 4839 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
e811c8ce
RD
4840
4841 def GetPosition(*args, **kwargs):
0df68c9f 4842 """
a95a7133 4843 GetPosition(self) -> Point
e811c8ce 4844
5ba5649b 4845 Find the position of the event, if applicable.
0df68c9f 4846 """
54f9ee45 4847 return _core_.KeyEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4848
4849 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
4850 """
4851 GetPositionTuple() -> (x,y)
e811c8ce 4852
5ba5649b 4853 Find the position of the event, if applicable.
0df68c9f 4854 """
54f9ee45 4855 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
4856
4857 def GetX(*args, **kwargs):
5ba5649b
RD
4858 """
4859 GetX(self) -> int
4860
4861 Returns the X position (in client coordinates) of the event, if
4862 applicable.
4863 """
54f9ee45 4864 return _core_.KeyEvent_GetX(*args, **kwargs)
e811c8ce
RD
4865
4866 def GetY(*args, **kwargs):
5ba5649b
RD
4867 """
4868 GetY(self) -> int
4869
4870 Returns the Y position (in client coordinates) of the event, if
4871 applicable.
4872 """
54f9ee45
RD
4873 return _core_.KeyEvent_GetY(*args, **kwargs)
4874
4875 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4876 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4877 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4878 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4879 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4880 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4881 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4882 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4883 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4884 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
2131d850 4885_core_.KeyEvent_swigregister(KeyEvent)
d14a1e28
RD
4886
4887#---------------------------------------------------------------------------
4888
4889class SizeEvent(Event):
5ba5649b
RD
4890 """
4891 A size event holds information about size change events. The EVT_SIZE
4892 handler function will be called when the window it is bound to has
4893 been resized.
4894
4895 Note that the size passed is of the whole window: call
4896 `wx.Window.GetClientSize` for the area which may be used by the
4897 application.
4898
4899 When a window is resized, usually only a small part of the window is
4900 damaged and and that area is all that is in the update region for the
4901 next paint event. However, if your drawing depends on the size of the
4902 window, you may need to clear the DC explicitly and repaint the whole
4903 window. In which case, you may need to call `wx.Window.Refresh` to
4904 invalidate the entire window.
4905
4906 """
0085ce49
RD
4907 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4908 __repr__ = _swig_repr
4909 def __init__(self, *args, **kwargs):
5ba5649b
RD
4910 """
4911 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4912
4913 Construct a new ``wx.SizeEvent``.
4914 """
0085ce49 4915 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
e811c8ce 4916 def GetSize(*args, **kwargs):
5ba5649b
RD
4917 """
4918 GetSize(self) -> Size
4919
4920 Returns the entire size of the window generating the size change
4921 event.
4922 """
54f9ee45 4923 return _core_.SizeEvent_GetSize(*args, **kwargs)
e811c8ce
RD
4924
4925 def GetRect(*args, **kwargs):
a95a7133 4926 """GetRect(self) -> Rect"""
54f9ee45 4927 return _core_.SizeEvent_GetRect(*args, **kwargs)
e811c8ce
RD
4928
4929 def SetRect(*args, **kwargs):
a95a7133 4930 """SetRect(self, Rect rect)"""
54f9ee45 4931 return _core_.SizeEvent_SetRect(*args, **kwargs)
e811c8ce
RD
4932
4933 def SetSize(*args, **kwargs):
a95a7133 4934 """SetSize(self, Size size)"""
54f9ee45 4935 return _core_.SizeEvent_SetSize(*args, **kwargs)
e811c8ce 4936
54f9ee45
RD
4937 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4938 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
2131d850 4939_core_.SizeEvent_swigregister(SizeEvent)
d14a1e28
RD
4940
4941#---------------------------------------------------------------------------
4942
4943class MoveEvent(Event):
5ba5649b
RD
4944 """
4945 This event object is sent for EVT_MOVE event bindings when a window is
4946 moved to a new position.
4947 """
0085ce49
RD
4948 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4949 __repr__ = _swig_repr
4950 def __init__(self, *args, **kwargs):
5ba5649b
RD
4951 """
4952 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
4953
4954 Constructor.
4955 """
0085ce49 4956 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
e811c8ce 4957 def GetPosition(*args, **kwargs):
5ba5649b
RD
4958 """
4959 GetPosition(self) -> Point
4960
4961 Returns the position of the window generating the move change event.
4962 """
54f9ee45 4963 return _core_.MoveEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4964
4965 def GetRect(*args, **kwargs):
a95a7133 4966 """GetRect(self) -> Rect"""
54f9ee45 4967 return _core_.MoveEvent_GetRect(*args, **kwargs)
e811c8ce
RD
4968
4969 def SetRect(*args, **kwargs):
a95a7133 4970 """SetRect(self, Rect rect)"""
54f9ee45 4971 return _core_.MoveEvent_SetRect(*args, **kwargs)
e811c8ce
RD
4972
4973 def SetPosition(*args, **kwargs):
a95a7133 4974 """SetPosition(self, Point pos)"""
54f9ee45 4975 return _core_.MoveEvent_SetPosition(*args, **kwargs)
e811c8ce 4976
7557b9b5
RD
4977 m_pos = property(GetPosition, SetPosition)
4978 m_rect = property(GetRect, SetRect)
4979
2131d850 4980_core_.MoveEvent_swigregister(MoveEvent)
d14a1e28
RD
4981
4982#---------------------------------------------------------------------------
4983
4984class PaintEvent(Event):
5ba5649b
RD
4985 """
4986 A paint event is sent when a window's contents needs to be repainted.
4987 Note that in an EVT_PAINT handler the application must *always* create
4988 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
4989 Windows assumes that the window has not been painted yet and will send
4990 the event again, causing endless refreshes.
4991
4992 You can optimize painting by retrieving the rectangles that have been
4993 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
4994 and only repainting these rectangles. The rectangles are in terms of
4995 the client area, and are unscrolled, so you will need to do some
4996 calculations using the current view position to obtain logical,
4997 scrolled units.
4998
4999 """
0085ce49
RD
5000 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5001 __repr__ = _swig_repr
5002 def __init__(self, *args, **kwargs):
a95a7133 5003 """__init__(self, int Id=0) -> PaintEvent"""
0085ce49 5004 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5005_core_.PaintEvent_swigregister(PaintEvent)
d14a1e28
RD
5006
5007class NcPaintEvent(Event):
093d3ff1 5008 """Proxy of C++ NcPaintEvent class"""
0085ce49
RD
5009 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5010 __repr__ = _swig_repr
5011 def __init__(self, *args, **kwargs):
a95a7133 5012 """__init__(self, int winid=0) -> NcPaintEvent"""
0085ce49 5013 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5014_core_.NcPaintEvent_swigregister(NcPaintEvent)
d14a1e28
RD
5015
5016#---------------------------------------------------------------------------
5017
5018class EraseEvent(Event):
5ba5649b
RD
5019 """
5020 An erase event is sent whenever the background of a window needs to be
5021 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5022 binder. On some platforms, such as GTK+, this event is simulated
5023 (simply generated just before the paint event) and may cause flicker.
5024
5025 To paint a custom background use the `GetDC` method and use the returned
5026 device context if it is not ``None``, otherwise create a temporary
5027 `wx.ClientDC` and draw on that.
5028
5029 """
0085ce49
RD
5030 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5031 __repr__ = _swig_repr
5032 def __init__(self, *args, **kwargs):
5ba5649b
RD
5033 """
5034 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5035
5036 Constructor
5037 """
0085ce49 5038 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
e811c8ce 5039 def GetDC(*args, **kwargs):
5ba5649b
RD
5040 """
5041 GetDC(self) -> DC
5042
5043 Returns the device context the event handler should draw upon. If
5044 ``None`` is returned then create a temporary `wx.ClientDC` and use
5045 that instead.
5046 """
54f9ee45 5047 return _core_.EraseEvent_GetDC(*args, **kwargs)
e811c8ce 5048
2131d850 5049_core_.EraseEvent_swigregister(EraseEvent)
d14a1e28
RD
5050
5051#---------------------------------------------------------------------------
5052
5053class FocusEvent(Event):
5ba5649b
RD
5054 """
5055 A focus event is sent when a window's focus changes. The window losing
5056 focus receives an EVT_KILL_FOCUS event while the window gaining it
5057 gets an EVT_SET_FOCUS event.
5058
5059 Notice that the set focus event happens both when the user gives focus
5060 to the window (whether using the mouse or keyboard) and when it is
5061 done from the program itself using `wx.Window.SetFocus`.
5062
5063 """
0085ce49
RD
5064 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5065 __repr__ = _swig_repr
5066 def __init__(self, *args, **kwargs):
5ba5649b 5067 """
2131d850 5068 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5069
5070 Constructor
5071 """
0085ce49 5072 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
e811c8ce 5073 def GetWindow(*args, **kwargs):
5ba5649b
RD
5074 """
5075 GetWindow(self) -> Window
5076
5077 Returns the other window associated with this event, that is the
5078 window which had the focus before for the EVT_SET_FOCUS event and the
5079 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5080
5081 Warning: the window returned may be None!
5082 """
54f9ee45 5083 return _core_.FocusEvent_GetWindow(*args, **kwargs)
e811c8ce
RD
5084
5085 def SetWindow(*args, **kwargs):
a95a7133 5086 """SetWindow(self, Window win)"""
54f9ee45 5087 return _core_.FocusEvent_SetWindow(*args, **kwargs)
e811c8ce 5088
2131d850 5089_core_.FocusEvent_swigregister(FocusEvent)
d14a1e28
RD
5090
5091#---------------------------------------------------------------------------
5092
5093class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5094 """
5095 wx.ChildFocusEvent notifies the parent that a child has received the
5096 focus. Unlike `wx.FocusEvent` it is propagated up the window
5097 heirarchy.
5098 """
0085ce49
RD
5099 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5100 __repr__ = _swig_repr
5101 def __init__(self, *args, **kwargs):
5ba5649b
RD
5102 """
5103 __init__(self, Window win=None) -> ChildFocusEvent
5104
5105 Constructor
5106 """
0085ce49 5107 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
e811c8ce 5108 def GetWindow(*args, **kwargs):
5ba5649b
RD
5109 """
5110 GetWindow(self) -> Window
5111
5112 The window which has just received the focus.
5113 """
54f9ee45 5114 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
e811c8ce 5115
2131d850 5116_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d14a1e28
RD
5117
5118#---------------------------------------------------------------------------
5119
5120class ActivateEvent(Event):
5ba5649b
RD
5121 """
5122 An activate event is sent when a top-level window or the entire
5123 application is being activated or deactivated.
5124
5125 A top-level window (a dialog or frame) receives an activate event when
5126 is being activated or deactivated. This is indicated visually by the
5127 title bar changing colour, and a subwindow gaining the keyboard focus.
5128 An application is activated or deactivated when one of its frames
5129 becomes activated, or a frame becomes inactivate resulting in all
5130 application frames being inactive.
5131
5132 Please note that usually you should call event.Skip() in your handlers
5133 for these events so the default handlers will still be called, as not
5134 doing so can result in strange effects.
5135
5136 """
0085ce49
RD
5137 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5138 __repr__ = _swig_repr
5139 def __init__(self, *args, **kwargs):
5ba5649b 5140 """
2131d850 5141 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5142
5143 Constructor
5144 """
0085ce49 5145 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
e811c8ce 5146 def GetActive(*args, **kwargs):
5ba5649b
RD
5147 """
5148 GetActive(self) -> bool
5149
5150 Returns true if the application or window is being activated, false
5151 otherwise.
5152 """
54f9ee45 5153 return _core_.ActivateEvent_GetActive(*args, **kwargs)
e811c8ce 5154
2131d850 5155_core_.ActivateEvent_swigregister(ActivateEvent)
d14a1e28
RD
5156
5157#---------------------------------------------------------------------------
5158
5159class InitDialogEvent(Event):
5ba5649b
RD
5160 """
5161 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5162 any window when `wx.Window.InitDialog` is called. Handlers for this
5163 event can transfer data to the window, or anything else that should be
5164 done before the user begins editing the form. The default handler
5165 calls `wx.Window.TransferDataToWindow`.
5166 """
0085ce49
RD
5167 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5168 __repr__ = _swig_repr
5169 def __init__(self, *args, **kwargs):
5ba5649b
RD
5170 """
5171 __init__(self, int Id=0) -> InitDialogEvent
5172
5173 Constructor
5174 """
0085ce49 5175 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5176_core_.InitDialogEvent_swigregister(InitDialogEvent)
d14a1e28
RD
5177
5178#---------------------------------------------------------------------------
5179
5180class MenuEvent(Event):
5ba5649b
RD
5181 """
5182 This class is used for a variety of menu-related events. Note that
5183 these do not include menu command events, which are handled by sending
5184 `wx.CommandEvent` objects.
5185
5186 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5187 text in the first field of the status bar.
5188 """
0085ce49
RD
5189 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5190 __repr__ = _swig_repr
5191 def __init__(self, *args, **kwargs):
5ba5649b 5192 """
2131d850 5193 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5194
5195 Constructor
5196 """
0085ce49 5197 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
e811c8ce 5198 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5199 """
5200 GetMenuId(self) -> int
5201
5202 Returns the menu identifier associated with the event. This method
5203 should be only used with the HIGHLIGHT events.
5204 """
54f9ee45 5205 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
e811c8ce
RD
5206
5207 def IsPopup(*args, **kwargs):
5ba5649b
RD
5208 """
5209 IsPopup(self) -> bool
5210
5211 Returns ``True`` if the menu which is being opened or closed is a
5212 popup menu, ``False`` if it is a normal one. This method should only
5213 be used with the OPEN and CLOSE events.
5214 """
54f9ee45 5215 return _core_.MenuEvent_IsPopup(*args, **kwargs)
e811c8ce
RD
5216
5217 def GetMenu(*args, **kwargs):
5ba5649b
RD
5218 """
5219 GetMenu(self) -> Menu
5220
5221 Returns the menu which is being opened or closed. This method should
5222 only be used with the OPEN and CLOSE events.
5223 """
54f9ee45 5224 return _core_.MenuEvent_GetMenu(*args, **kwargs)
e811c8ce 5225
2131d850 5226_core_.MenuEvent_swigregister(MenuEvent)
d14a1e28
RD
5227
5228#---------------------------------------------------------------------------
5229
5230class CloseEvent(Event):
5ba5649b
RD
5231 """
5232 This event class contains information about window and session close
5233 events.
5234
5235 The handler function for EVT_CLOSE is called when the user has tried
5236 to close a a frame or dialog box using the window manager controls or
5237 the system menu. It can also be invoked by the application itself
5238 programmatically, for example by calling the `wx.Window.Close`
5239 function.
5240
5241 You should check whether the application is forcing the deletion of
5242 the window using `CanVeto`. If it returns ``False``, you must destroy
5243 the window using `wx.Window.Destroy`. If the return value is ``True``,
5244 it is up to you whether you respond by destroying the window or not.
5245 For example you may wish to display a message dialog prompting to save
5246 files or to cancel the close.
5247
5248 If you don't destroy the window, you should call `Veto` to let the
5249 calling code know that you did not destroy the window. This allows the
5250 `wx.Window.Close` function to return ``True`` or ``False`` depending
5251 on whether the close instruction was honored or not.
5252 """
0085ce49
RD
5253 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5254 __repr__ = _swig_repr
5255 def __init__(self, *args, **kwargs):
5ba5649b 5256 """
2131d850 5257 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5258
5259 Constructor.
5260 """
0085ce49 5261 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
e811c8ce 5262 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5263 """
5264 SetLoggingOff(self, bool logOff)
5265
5266 Sets the 'logging off' flag.
5267 """
54f9ee45 5268 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
e811c8ce
RD
5269
5270 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5271 """
5272 GetLoggingOff(self) -> bool
5273
6c75a4cf
RD
5274 Returns ``True`` if the user is logging off or ``False`` if the
5275 system is shutting down. This method can only be called for end
5276 session and query end session events, it doesn't make sense for close
5277 window event.
5ba5649b 5278 """
54f9ee45 5279 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
e811c8ce
RD
5280
5281 def Veto(*args, **kwargs):
5ba5649b
RD
5282 """
5283 Veto(self, bool veto=True)
5284
5285 Call this from your event handler to veto a system shutdown or to
5286 signal to the calling application that a window close did not happen.
5287
5288 You can only veto a shutdown or close if `CanVeto` returns true.
5289 """
54f9ee45 5290 return _core_.CloseEvent_Veto(*args, **kwargs)
e811c8ce 5291
5ba5649b
RD
5292 def GetVeto(*args, **kwargs):
5293 """GetVeto(self) -> bool"""
5294 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5295
e811c8ce 5296 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5297 """
5298 SetCanVeto(self, bool canVeto)
5299
5300 Sets the 'can veto' flag.
5301 """
54f9ee45 5302 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
e811c8ce
RD
5303
5304 def CanVeto(*args, **kwargs):
5ba5649b
RD
5305 """
5306 CanVeto(self) -> bool
e811c8ce 5307
5ba5649b
RD
5308 Returns true if you can veto a system shutdown or a window close
5309 event. Vetoing a window close event is not possible if the calling
5310 code wishes to force the application to exit, and so this function
5311 must be called to check this.
5312 """
5313 return _core_.CloseEvent_CanVeto(*args, **kwargs)
e811c8ce 5314
2131d850 5315_core_.CloseEvent_swigregister(CloseEvent)
d14a1e28
RD
5316
5317#---------------------------------------------------------------------------
5318
5319class ShowEvent(Event):
5ba5649b 5320 """An EVT_SHOW event is sent when a window is shown or hidden."""
0085ce49
RD
5321 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5322 __repr__ = _swig_repr
5323 def __init__(self, *args, **kwargs):
5ba5649b
RD
5324 """
5325 __init__(self, int winid=0, bool show=False) -> ShowEvent
5326
5327 An EVT_SHOW event is sent when a window is shown or hidden.
5328 """
0085ce49 5329 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
e811c8ce 5330 def SetShow(*args, **kwargs):
a95a7133 5331 """SetShow(self, bool show)"""
54f9ee45 5332 return _core_.ShowEvent_SetShow(*args, **kwargs)
e811c8ce
RD
5333
5334 def GetShow(*args, **kwargs):
a95a7133 5335 """GetShow(self) -> bool"""
54f9ee45 5336 return _core_.ShowEvent_GetShow(*args, **kwargs)
e811c8ce 5337
2131d850 5338_core_.ShowEvent_swigregister(ShowEvent)
d14a1e28
RD
5339
5340#---------------------------------------------------------------------------
5341
5342class IconizeEvent(Event):
5ba5649b
RD
5343 """
5344 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5345 restored.
5346 """
0085ce49
RD
5347 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5348 __repr__ = _swig_repr
5349 def __init__(self, *args, **kwargs):
5ba5649b
RD
5350 """
5351 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5352
5353 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5354 restored.
5355 """
0085ce49 5356 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
e811c8ce 5357 def Iconized(*args, **kwargs):
5ba5649b
RD
5358 """
5359 Iconized(self) -> bool
5360
5361 Returns ``True`` if the frame has been iconized, ``False`` if it has
5362 been restored.
5363 """
54f9ee45 5364 return _core_.IconizeEvent_Iconized(*args, **kwargs)
e811c8ce 5365
2131d850 5366_core_.IconizeEvent_swigregister(IconizeEvent)
d14a1e28
RD
5367
5368#---------------------------------------------------------------------------
5369
5370class MaximizeEvent(Event):
5ba5649b 5371 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
0085ce49
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) -> MaximizeEvent
5377
5378 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5379 """
0085ce49 5380 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5381_core_.MaximizeEvent_swigregister(MaximizeEvent)
d14a1e28
RD
5382
5383#---------------------------------------------------------------------------
5384
5385class DropFilesEvent(Event):
5ba5649b
RD
5386 """
5387 This class is used for drop files events, that is, when files have
5388 been dropped onto the window. This functionality is only available
5389 under Windows. The window must have previously been enabled for
5390 dropping by calling `wx.Window.DragAcceptFiles`.
5391
5392 Important note: this is a separate implementation to the more general
5393 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5394 implementation uses the older, Windows message-based approach of
5395 dropping files.
5396
5397 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5398 events.
5399
5400 """
0085ce49
RD
5401 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5402 def __init__(self): raise AttributeError, "No constructor defined"
5403 __repr__ = _swig_repr
e811c8ce 5404 def GetPosition(*args, **kwargs):
5ba5649b
RD
5405 """
5406 GetPosition(self) -> Point
5407
5408 Returns the position at which the files were dropped.
5409 """
54f9ee45 5410 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5411
5412 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5413 """
5414 GetNumberOfFiles(self) -> int
5415
5416 Returns the number of files dropped.
5417 """
54f9ee45 5418 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
e811c8ce
RD
5419
5420 def GetFiles(*args, **kwargs):
5ba5649b
RD
5421 """
5422 GetFiles(self) -> PyObject
5423
5424 Returns a list of the filenames that were dropped.
5425 """
54f9ee45 5426 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
e811c8ce 5427
2131d850 5428_core_.DropFilesEvent_swigregister(DropFilesEvent)
d14a1e28
RD
5429
5430#---------------------------------------------------------------------------
5431
54f9ee45
RD
5432UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5433UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
d14a1e28 5434class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5435 """
5436 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5437 wxWidgets to give an application the chance to update various user
5438 interface elements.
5439
5440 Without update UI events, an application has to work hard to
5441 check/uncheck, enable/disable, and set the text for elements such as
5442 menu items and toolbar buttons. The code for doing this has to be
5443 mixed up with the code that is invoked when an action is invoked for a
5444 menu item or button.
5445
5446 With update UI events, you define an event handler to look at the
5447 state of the application and change UI elements accordingly. wxWidgets
5448 will call your handler functions in idle time, so you don't have to
5449 worry where to call this code. In addition to being a clearer and more
5450 declarative method, it also means you don't have to worry whether
5451 you're updating a toolbar or menubar identifier. The same handler can
5452 update a menu item and toolbar button, if the ID values are the same.
5453
5454 Instead of directly manipulating the menu or button, you call
5455 functions in the event object, such as `Check`. wxWidgets will
5456 determine whether such a call has been made, and which UI element to
5457 update.
5458
5459 These events will work for popup menus as well as menubars. Just
5460 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5461 any UI events for the window that owns the menu.
5462
5463 If you find that the overhead of UI update processing is affecting
5464 your application, you can do one or both of the following:
5465
5466 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5467 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5468 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5469 receive update events. No other windows will receive update
5470 events.
5471
5472 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5473 value to set the delay between updates. You may need to call
5474 `wx.Window.UpdateWindowUI` at critical points, for example when
5475 a dialog is about to be shown, in case the user sees a slight
5476 delay before windows are updated.
5477
5478 Note that although events are sent in idle time, defining a EVT_IDLE
5479 handler for a window does not affect this because the events are sent
5480 from an internal idle handler.
5481
5482 wxWidgets tries to optimize update events on some platforms. On
5483 Windows and GTK+, events for menubar items are only sent when the menu
5484 is about to be shown, and not in idle time.
5485
5486 """
0085ce49
RD
5487 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5488 __repr__ = _swig_repr
5489 def __init__(self, *args, **kwargs):
5ba5649b
RD
5490 """
5491 __init__(self, int commandId=0) -> UpdateUIEvent
5492
5493 Constructor
5494 """
0085ce49 5495 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
e811c8ce 5496 def GetChecked(*args, **kwargs):
5ba5649b
RD
5497 """
5498 GetChecked(self) -> bool
5499
5500 Returns ``True`` if the UI element should be checked.
5501 """
54f9ee45 5502 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
e811c8ce
RD
5503
5504 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5505 """
5506 GetEnabled(self) -> bool
5507
5508 Returns ``True`` if the UI element should be enabled.
5509 """
54f9ee45 5510 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
e811c8ce 5511
b1fcee84
RD
5512 def GetShown(*args, **kwargs):
5513 """
5514 GetShown(self) -> bool
5515
5516 Returns ``True`` if the UI element should be shown.
5517 """
5518 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5519
e811c8ce 5520 def GetText(*args, **kwargs):
5ba5649b
RD
5521 """
5522 GetText(self) -> String
5523
5524 Returns the text that should be set for the UI element.
5525 """
54f9ee45 5526 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
e811c8ce
RD
5527
5528 def GetSetText(*args, **kwargs):
5ba5649b
RD
5529 """
5530 GetSetText(self) -> bool
5531
5532 Returns ``True`` if the application has called `SetText`. For
5533 wxWidgets internal use only.
5534 """
54f9ee45 5535 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
e811c8ce
RD
5536
5537 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5538 """
5539 GetSetChecked(self) -> bool
5540
5541 Returns ``True`` if the application has called `Check`. For wxWidgets
5542 internal use only.
5543 """
54f9ee45 5544 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
e811c8ce
RD
5545
5546 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5547 """
5548 GetSetEnabled(self) -> bool
5549
5550 Returns ``True`` if the application has called `Enable`. For wxWidgets
5551 internal use only.
5552 """
54f9ee45 5553 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
e811c8ce 5554
b1fcee84
RD
5555 def GetSetShown(*args, **kwargs):
5556 """
5557 GetSetShown(self) -> bool
5558
5559 Returns ``True`` if the application has called `Show`. For wxWidgets
5560 internal use only.
5561 """
5562 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5563
e811c8ce 5564 def Check(*args, **kwargs):
5ba5649b
RD
5565 """
5566 Check(self, bool check)
5567
5568 Check or uncheck the UI element.
5569 """
54f9ee45 5570 return _core_.UpdateUIEvent_Check(*args, **kwargs)
e811c8ce
RD
5571
5572 def Enable(*args, **kwargs):
5ba5649b
RD
5573 """
5574 Enable(self, bool enable)
5575
5576 Enable or disable the UI element.
5577 """
54f9ee45 5578 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
e811c8ce 5579
b1fcee84
RD
5580 def Show(*args, **kwargs):
5581 """
5582 Show(self, bool show)
5583
5584 Show or hide the UI element.
5585 """
5586 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5587
e811c8ce 5588 def SetText(*args, **kwargs):
5ba5649b
RD
5589 """
5590 SetText(self, String text)
5591
5592 Sets the text for this UI element.
5593 """
54f9ee45 5594 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
e811c8ce
RD
5595
5596 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5597 """
5598 SetUpdateInterval(long updateInterval)
5599
5600 Sets the interval between updates in milliseconds. Set to -1 to
5601 disable updates, or to 0 to update as frequently as possible. The
5602 default is 0.
5603
5604 Use this to reduce the overhead of UI update events if your
5605 application has a lot of windows. If you set the value to -1 or
5606 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5607 at appropriate points in your application, such as when a dialog is
5608 about to be shown.
5609 """
54f9ee45 5610 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
e811c8ce
RD
5611
5612 SetUpdateInterval = staticmethod(SetUpdateInterval)
5613 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5614 """
5615 GetUpdateInterval() -> long
5616
5617 Returns the current interval between updates in milliseconds. -1
5618 disables updates, 0 updates as frequently as possible.
5619 """
54f9ee45 5620 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
e811c8ce
RD
5621
5622 GetUpdateInterval = staticmethod(GetUpdateInterval)
5623 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5624 """
5625 CanUpdate(Window win) -> bool
5626
5627 Returns ``True`` if it is appropriate to update (send UI update events
5628 to) this window.
5629
5630 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5631 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5632 events were last sent in idle time, and the update interval, to
5633 determine whether events should be sent to this window now. By default
5634 this will always return true because the update mode is initially
5635 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5636 events will be sent as often as possible. You can reduce the frequency
5637 that events are sent by changing the mode and/or setting an update
5638 interval.
5639
5640 """
54f9ee45 5641 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
e811c8ce
RD
5642
5643 CanUpdate = staticmethod(CanUpdate)
5644 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5645 """
5646 ResetUpdateTime()
5647
5648 Used internally to reset the last-updated time to the current time. It
5649 is assumed that update events are normally sent in idle time, so this
5650 is called at the end of idle processing.
5651 """
54f9ee45 5652 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
e811c8ce
RD
5653
5654 ResetUpdateTime = staticmethod(ResetUpdateTime)
5655 def SetMode(*args, **kwargs):
5ba5649b
RD
5656 """
5657 SetMode(int mode)
5658
5659 Specify how wxWidgets will send update events: to all windows, or only
5660 to those which specify that they will process the events.
5661
5662 The mode may be one of the following values:
5663
5664 ============================= ==========================================
5665 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5666 is the default setting.
5667 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5668 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5669 style set.
5670 ============================= ==========================================
5671
5672 """
54f9ee45 5673 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
e811c8ce
RD
5674
5675 SetMode = staticmethod(SetMode)
5676 def GetMode(*args, **kwargs):
5ba5649b
RD
5677 """
5678 GetMode() -> int
5679
5680 Returns a value specifying how wxWidgets will send update events: to
5681 all windows, or only to those which specify that they will process the
5682 events.
5683 """
54f9ee45 5684 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
e811c8ce
RD
5685
5686 GetMode = staticmethod(GetMode)
2131d850 5687_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d14a1e28 5688
e811c8ce 5689def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
0085ce49 5690 """
5ba5649b
RD
5691 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5692
5693 Sets the interval between updates in milliseconds. Set to -1 to
5694 disable updates, or to 0 to update as frequently as possible. The
5695 default is 0.
5696
5697 Use this to reduce the overhead of UI update events if your
5698 application has a lot of windows. If you set the value to -1 or
5699 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5700 at appropriate points in your application, such as when a dialog is
5701 about to be shown.
5702 """
0085ce49 5703 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d14a1e28 5704
0085ce49
RD
5705def UpdateUIEvent_GetUpdateInterval(*args):
5706 """
5ba5649b
RD
5707 UpdateUIEvent_GetUpdateInterval() -> long
5708
5709 Returns the current interval between updates in milliseconds. -1
5710 disables updates, 0 updates as frequently as possible.
5711 """
0085ce49 5712 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d14a1e28 5713
e811c8ce 5714def UpdateUIEvent_CanUpdate(*args, **kwargs):
0085ce49 5715 """
5ba5649b
RD
5716 UpdateUIEvent_CanUpdate(Window win) -> bool
5717
5718 Returns ``True`` if it is appropriate to update (send UI update events
5719 to) this window.
5720
5721 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5722 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5723 events were last sent in idle time, and the update interval, to
5724 determine whether events should be sent to this window now. By default
5725 this will always return true because the update mode is initially
5726 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5727 events will be sent as often as possible. You can reduce the frequency
5728 that events are sent by changing the mode and/or setting an update
5729 interval.
5730
5731 """
0085ce49 5732 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d14a1e28 5733
0085ce49
RD
5734def UpdateUIEvent_ResetUpdateTime(*args):
5735 """
5ba5649b
RD
5736 UpdateUIEvent_ResetUpdateTime()
5737
5738 Used internally to reset the last-updated time to the current time. It
5739 is assumed that update events are normally sent in idle time, so this
5740 is called at the end of idle processing.
5741 """
0085ce49 5742 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d14a1e28 5743
e811c8ce 5744def UpdateUIEvent_SetMode(*args, **kwargs):
0085ce49 5745 """
5ba5649b
RD
5746 UpdateUIEvent_SetMode(int mode)
5747
5748 Specify how wxWidgets will send update events: to all windows, or only
5749 to those which specify that they will process the events.
5750
5751 The mode may be one of the following values:
5752
5753 ============================= ==========================================
5754 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5755 is the default setting.
5756 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5757 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5758 style set.
5759 ============================= ==========================================
5760
5761 """
0085ce49 5762 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d14a1e28 5763
0085ce49
RD
5764def UpdateUIEvent_GetMode(*args):
5765 """
5ba5649b
RD
5766 UpdateUIEvent_GetMode() -> int
5767
5768 Returns a value specifying how wxWidgets will send update events: to
5769 all windows, or only to those which specify that they will process the
5770 events.
5771 """
0085ce49 5772 return _core_.UpdateUIEvent_GetMode(*args)
d14a1e28
RD
5773
5774#---------------------------------------------------------------------------
5775
5776class SysColourChangedEvent(Event):
5ba5649b
RD
5777 """
5778 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5779 when the user changes the colour settings using the control
5780 panel. This is only applicable under Windows.
5781
5782 The default event handler for this event propagates the event to child
5783 windows, since Windows only sends the events to top-level windows. If
5784 intercepting this event for a top-level window, remember to call
5785 `Skip` so the the base class handler will still be executed, or to
5786 pass the event on to the window's children explicitly.
5787
5788 """
0085ce49
RD
5789 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5790 __repr__ = _swig_repr
5791 def __init__(self, *args, **kwargs):
5ba5649b
RD
5792 """
5793 __init__(self) -> SysColourChangedEvent
5794
5795 Constructor
5796 """
0085ce49 5797 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 5798_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d14a1e28
RD
5799
5800#---------------------------------------------------------------------------
5801
5802class MouseCaptureChangedEvent(Event):
5ba5649b
RD
5803 """
5804 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5805 a window that loses its mouse capture. This is called even if
5806 `wx.Window.ReleaseMouse` was called by the application code. Handling
5807 this event allows an application to cater for unexpected capture
5808 releases which might otherwise confuse mouse handling code.
5809
5810 This event is implemented under Windows only.
5811 """
0085ce49
RD
5812 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5813 __repr__ = _swig_repr
5814 def __init__(self, *args, **kwargs):
5ba5649b
RD
5815 """
5816 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5817
5818 Constructor
5819 """
0085ce49 5820 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
e811c8ce 5821 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
5822 """
5823 GetCapturedWindow(self) -> Window
5824
5825 Returns the window that gained the capture, or ``None`` if it was a
5826 non-wxWidgets window.
5827 """
54f9ee45 5828 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
e811c8ce 5829
2131d850 5830_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d14a1e28
RD
5831
5832#---------------------------------------------------------------------------
5833
5834class DisplayChangedEvent(Event):
5ba5649b
RD
5835 """
5836 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5837 resolution has changed.
5838
5839 This event is implemented under Windows only.
5840 """
0085ce49
RD
5841 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5842 __repr__ = _swig_repr
5843 def __init__(self, *args, **kwargs):
a95a7133 5844 """__init__(self) -> DisplayChangedEvent"""
0085ce49 5845 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 5846_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d14a1e28
RD
5847
5848#---------------------------------------------------------------------------
5849
5850class PaletteChangedEvent(Event):
5ba5649b
RD
5851 """
5852 An EVT_PALETTE_CHANGED event is sent when the system palette has
5853 changed, thereby giving each window a chance to redo their own to
5854 match.
5855
5856 This event is implemented under Windows only.
5857 """
0085ce49
RD
5858 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5859 __repr__ = _swig_repr
5860 def __init__(self, *args, **kwargs):
5ba5649b
RD
5861 """
5862 __init__(self, int id=0) -> PaletteChangedEvent
5863
5864 An EVT_PALETTE_CHANGED event is sent when the system palette has
5865 changed, thereby giving each window a chance to redo their own to
5866 match.
5867
5868 This event is implemented under Windows only.
5869 """
0085ce49 5870 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
e811c8ce 5871 def SetChangedWindow(*args, **kwargs):
a95a7133 5872 """SetChangedWindow(self, Window win)"""
54f9ee45 5873 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
e811c8ce
RD
5874
5875 def GetChangedWindow(*args, **kwargs):
a95a7133 5876 """GetChangedWindow(self) -> Window"""
54f9ee45 5877 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
e811c8ce 5878
2131d850 5879_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d14a1e28
RD
5880
5881#---------------------------------------------------------------------------
5882
5883class QueryNewPaletteEvent(Event):
5ba5649b
RD
5884 """
5885 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5886 focus and should re-do its palette.
5887
5888 This event is implemented under Windows only.
5889 """
0085ce49
RD
5890 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5891 __repr__ = _swig_repr
5892 def __init__(self, *args, **kwargs):
5ba5649b
RD
5893 """
5894 __init__(self, int winid=0) -> QueryNewPaletteEvent
5895
5896 Constructor.
5897 """
0085ce49 5898 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
e811c8ce 5899 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
5900 """
5901 SetPaletteRealized(self, bool realized)
5902
5903 App should set this if it changes the palette.
5904 """
54f9ee45 5905 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
e811c8ce
RD
5906
5907 def GetPaletteRealized(*args, **kwargs):
a95a7133 5908 """GetPaletteRealized(self) -> bool"""
54f9ee45 5909 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
e811c8ce 5910
2131d850 5911_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d14a1e28
RD
5912
5913#---------------------------------------------------------------------------
5914
5915class NavigationKeyEvent(Event):
5ba5649b
RD
5916 """
5917 EVT_NAVIGATION_KEY events are used to control moving the focus between
5918 widgets, otherwise known as tab-traversal. You woudl normally not
5919 catch navigation events in applications as there are already
5920 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5921 it useful to send navigation events in certain situations to change
5922 the focus in certain ways, although it's probably easier to just call
5923 `wx.Window.Navigate`.
5924 """
0085ce49
RD
5925 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5926 __repr__ = _swig_repr
5927 def __init__(self, *args, **kwargs):
a95a7133 5928 """__init__(self) -> NavigationKeyEvent"""
0085ce49 5929 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
e811c8ce 5930 def GetDirection(*args, **kwargs):
5ba5649b
RD
5931 """
5932 GetDirection(self) -> bool
5933
5934 Returns ``True`` if the direction is forward, ``False`` otherwise.
5935 """
54f9ee45 5936 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
e811c8ce
RD
5937
5938 def SetDirection(*args, **kwargs):
5ba5649b
RD
5939 """
5940 SetDirection(self, bool forward)
5941
5942 Specify the direction that the navigation should take. Usually the
5943 difference between using Tab and Shift-Tab.
5944 """
54f9ee45 5945 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
e811c8ce
RD
5946
5947 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
5948 """
5949 IsWindowChange(self) -> bool
5950
5951 Returns ``True`` if window change is allowed.
5952 """
54f9ee45 5953 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
e811c8ce
RD
5954
5955 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
5956 """
5957 SetWindowChange(self, bool ischange)
5958
5959 Specify if the navigation should be able to change parent windows.
5960 For example, changing notebook pages, etc. This is usually implemented
5961 by using Control-Tab.
5962 """
54f9ee45 5963 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
e811c8ce 5964
68350608 5965 def IsFromTab(*args, **kwargs):
5ba5649b
RD
5966 """
5967 IsFromTab(self) -> bool
5968
5969 Returns ``True`` if the navigation event is originated from the Tab
5970 key.
5971 """
68350608
RD
5972 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
5973
5974 def SetFromTab(*args, **kwargs):
5ba5649b
RD
5975 """
5976 SetFromTab(self, bool bIs)
5977
5978 Set to true under MSW if the event was generated using the tab key.
5979 This is required for proper navogation over radio buttons.
5980 """
68350608
RD
5981 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
5982
908b74cd 5983 def SetFlags(*args, **kwargs):
5ba5649b
RD
5984 """
5985 SetFlags(self, long flags)
5986
5987 Set the navigation flags to a combination of the following:
5988
5989 * wx.NavigationKeyEvent.IsBackward
5990 * wx.NavigationKeyEvent.IsForward
5991 * wx.NavigationKeyEvent.WinChange
5992 * wx.NavigationKeyEvent.FromTab
5993
5994 """
908b74cd
RD
5995 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
5996
e811c8ce 5997 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
5998 """
5999 GetCurrentFocus(self) -> Window
6000
6001 Returns the child window which currenty has the focus. May be
6002 ``None``.
6003 """
54f9ee45 6004 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
e811c8ce
RD
6005
6006 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6007 """
6008 SetCurrentFocus(self, Window win)
6009
6010 Set the window that has the focus.
6011 """
54f9ee45 6012 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
e811c8ce 6013
b0f7404b 6014 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
6015 IsForward = _core_.NavigationKeyEvent_IsForward
6016 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 6017 FromTab = _core_.NavigationKeyEvent_FromTab
2131d850 6018_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d14a1e28
RD
6019
6020#---------------------------------------------------------------------------
6021
6022class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6023 """
6024 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6025 underlying GUI object) exists.
6026 """
0085ce49
RD
6027 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6028 __repr__ = _swig_repr
6029 def __init__(self, *args, **kwargs):
5ba5649b
RD
6030 """
6031 __init__(self, Window win=None) -> WindowCreateEvent
6032
6033 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6034 underlying GUI object) exists.
6035 """
0085ce49 6036 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
e811c8ce 6037 def GetWindow(*args, **kwargs):
5ba5649b
RD
6038 """
6039 GetWindow(self) -> Window
6040
6041 Returns the window that this event refers to.
6042 """
54f9ee45 6043 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
e811c8ce 6044
2131d850 6045_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d14a1e28
RD
6046
6047class WindowDestroyEvent(CommandEvent):
5ba5649b 6048 """
943e8dfd
RD
6049 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6050 when the GUI window is destroyed.
6051
6052 When a class derived from `wx.Window` is destroyed its destructor will
6053 have already run by the time this event is sent. Therefore this event
6054 will not usually be received at all by the window itself. Since it is
6055 received after the destructor has run, an object should not try to
6056 handle its own wx.WindowDestroyEvent, but it can be used to get
6057 notification of the destruction of another window.
5ba5649b 6058 """
0085ce49
RD
6059 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6060 __repr__ = _swig_repr
6061 def __init__(self, *args, **kwargs):
5ba5649b
RD
6062 """
6063 __init__(self, Window win=None) -> WindowDestroyEvent
6064
943e8dfd
RD
6065 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6066 when the GUI window is destroyed.
6067
6068 When a class derived from `wx.Window` is destroyed its destructor will
6069 have already run by the time this event is sent. Therefore this event
6070 will not usually be received at all by the window itself. Since it is
6071 received after the destructor has run, an object should not try to
6072 handle its own wx.WindowDestroyEvent, but it can be used to get
6073 notification of the destruction of another window.
5ba5649b 6074 """
0085ce49 6075 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
e811c8ce 6076 def GetWindow(*args, **kwargs):
5ba5649b
RD
6077 """
6078 GetWindow(self) -> Window
6079
6080 Returns the window that this event refers to.
6081 """
54f9ee45 6082 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
e811c8ce 6083
2131d850 6084_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d14a1e28
RD
6085
6086#---------------------------------------------------------------------------
6087
6088class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6089 """
6090 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6091 give the application a chance to show a context (popup) menu.
6092 """
0085ce49
RD
6093 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6094 __repr__ = _swig_repr
6095 def __init__(self, *args, **kwargs):
5ba5649b 6096 """
2131d850 6097 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6098
6099 Constructor.
6100 """
0085ce49 6101 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
e811c8ce 6102 def GetPosition(*args, **kwargs):
5ba5649b
RD
6103 """
6104 GetPosition(self) -> Point
6105
6106 Returns the position (in screen coordinants) at which the menu should
6107 be shown.
6108 """
54f9ee45 6109 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
6110
6111 def SetPosition(*args, **kwargs):
5ba5649b
RD
6112 """
6113 SetPosition(self, Point pos)
6114
6115 Sets the position at which the menu should be shown.
6116 """
54f9ee45 6117 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
e811c8ce 6118
2131d850 6119_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d14a1e28
RD
6120
6121#---------------------------------------------------------------------------
6122
54f9ee45
RD
6123IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6124IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
d14a1e28 6125class IdleEvent(Event):
5ba5649b
RD
6126 """
6127 This class is used for EVT_IDLE events, which are generated and sent
6128 when the application *becomes* idle. In other words, the when the
6129 event queue becomes empty then idle events are sent to all windows (by
6130 default) and as long as none of them call `RequestMore` then there are
6131 no more idle events until after the system event queue has some normal
6132 events and then becomes empty again.
6133
6134 By default, idle events are sent to all windows. If this is causing a
6135 significant overhead in your application, you can call
6136 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6137 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6138 which should receive idle events. Then idle events will only be sent
6139 to those windows and not to any others.
6140 """
0085ce49
RD
6141 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6142 __repr__ = _swig_repr
6143 def __init__(self, *args, **kwargs):
5ba5649b
RD
6144 """
6145 __init__(self) -> IdleEvent
6146
6147 Constructor
6148 """
0085ce49 6149 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
e811c8ce 6150 def RequestMore(*args, **kwargs):
5ba5649b
RD
6151 """
6152 RequestMore(self, bool needMore=True)
6153
6154 Tells wxWidgets that more processing is required. This function can be
6155 called by an EVT_IDLE handler for a window to indicate that the
6156 application should forward the EVT_IDLE event once more to the
6157 application windows. If no window calls this function during its
6158 EVT_IDLE handler, then the application will remain in a passive event
6159 loop until a new event is posted to the application by the windowing
6160 system.
6161 """
54f9ee45 6162 return _core_.IdleEvent_RequestMore(*args, **kwargs)
e811c8ce
RD
6163
6164 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6165 """
6166 MoreRequested(self) -> bool
6167
6168 Returns ``True`` if the OnIdle function processing this event
6169 requested more processing time.
6170 """
54f9ee45 6171 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
e811c8ce
RD
6172
6173 def SetMode(*args, **kwargs):
5ba5649b
RD
6174 """
6175 SetMode(int mode)
6176
6177 Static method for specifying how wxWidgets will send idle events: to
6178 all windows, or only to those which specify that they will process the
6179 events.
6180
6181 The mode can be one of the following values:
6182
6183 ========================= ========================================
6184 wx.IDLE_PROCESS_ALL Send idle events to all windows
6185 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6186 the wx.WS_EX_PROCESS_IDLE extra style
6187 flag set.
6188 ========================= ========================================
6189
6190 """
54f9ee45 6191 return _core_.IdleEvent_SetMode(*args, **kwargs)
e811c8ce
RD
6192
6193 SetMode = staticmethod(SetMode)
6194 def GetMode(*args, **kwargs):
5ba5649b
RD
6195 """
6196 GetMode() -> int
6197
6198 Static method returning a value specifying how wxWidgets will send
6199 idle events: to all windows, or only to those which specify that they
6200 will process the events.
6201 """
54f9ee45 6202 return _core_.IdleEvent_GetMode(*args, **kwargs)
e811c8ce
RD
6203
6204 GetMode = staticmethod(GetMode)
6205 def CanSend(*args, **kwargs):
5ba5649b
RD
6206 """
6207 CanSend(Window win) -> bool
6208
6209 Returns ``True`` if it is appropriate to send idle events to this
6210 window.
6211
6212 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6213 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6214 events should be sent to this window now. By default this will always
6215 return ``True`` because the update mode is initially
6216 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6217 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6218 """
54f9ee45 6219 return _core_.IdleEvent_CanSend(*args, **kwargs)
e811c8ce
RD
6220
6221 CanSend = staticmethod(CanSend)
2131d850 6222_core_.IdleEvent_swigregister(IdleEvent)
d14a1e28 6223
e811c8ce 6224def IdleEvent_SetMode(*args, **kwargs):
0085ce49 6225 """
5ba5649b
RD
6226 IdleEvent_SetMode(int mode)
6227
6228 Static method for specifying how wxWidgets will send idle events: to
6229 all windows, or only to those which specify that they will process the
6230 events.
6231
6232 The mode can be one of the following values:
6233
6234 ========================= ========================================
6235 wx.IDLE_PROCESS_ALL Send idle events to all windows
6236 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6237 the wx.WS_EX_PROCESS_IDLE extra style
6238 flag set.
6239 ========================= ========================================
6240
6241 """
0085ce49 6242 return _core_.IdleEvent_SetMode(*args, **kwargs)
d14a1e28 6243
0085ce49
RD
6244def IdleEvent_GetMode(*args):
6245 """
5ba5649b
RD
6246 IdleEvent_GetMode() -> int
6247
6248 Static method returning a value specifying how wxWidgets will send
6249 idle events: to all windows, or only to those which specify that they
6250 will process the events.
6251 """
0085ce49 6252 return _core_.IdleEvent_GetMode(*args)
d14a1e28 6253
e811c8ce 6254def IdleEvent_CanSend(*args, **kwargs):
0085ce49 6255 """
5ba5649b
RD
6256 IdleEvent_CanSend(Window win) -> bool
6257
6258 Returns ``True`` if it is appropriate to send idle events to this
6259 window.
6260
6261 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6262 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6263 events should be sent to this window now. By default this will always
6264 return ``True`` because the update mode is initially
6265 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6266 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6267 """
0085ce49 6268 return _core_.IdleEvent_CanSend(*args, **kwargs)
d14a1e28
RD
6269
6270#---------------------------------------------------------------------------
6271
2131d850
RD
6272class ClipboardTextEvent(CommandEvent):
6273 """
6274 A Clipboard Text event is sent when a window intercepts a text
6275 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6276 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6277 popup menu command, etc. NOTE : under windows these events are *NOT*
6278 generated automatically for a Rich Edit text control.
6279 """
6280 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6281 __repr__ = _swig_repr
6282 def __init__(self, *args, **kwargs):
6283 """
6284 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6285
6286 A Clipboard Text event is sent when a window intercepts a text
6287 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6288 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6289 popup menu command, etc. NOTE : under windows these events are *NOT*
6290 generated automatically for a Rich Edit text control.
6291 """
6292 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6293_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6294
6295#---------------------------------------------------------------------------
6296
d14a1e28 6297class PyEvent(Event):
5ba5649b
RD
6298 """
6299 wx.PyEvent can be used as a base class for implementing custom event
6300 types in Python. You should derived from this class instead of
6301 `wx.Event` because this class is Python-aware and is able to transport
6302 its Python bits safely through the wxWidgets event system and have
6303 them still be there when the event handler is invoked.
6304
6305 :see: `wx.PyCommandEvent`
6306
6307 """
0085ce49
RD
6308 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6309 __repr__ = _swig_repr
6310 def __init__(self, *args, **kwargs):
2131d850 6311 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
0085ce49 6312 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6313 self._SetSelf(self)
e811c8ce 6314
0085ce49
RD
6315 __swig_destroy__ = _core_.delete_PyEvent
6316 __del__ = lambda self : None;
5ba5649b
RD
6317 def _SetSelf(*args, **kwargs):
6318 """_SetSelf(self, PyObject self)"""
6319 return _core_.PyEvent__SetSelf(*args, **kwargs)
e811c8ce 6320
5ba5649b
RD
6321 def _GetSelf(*args, **kwargs):
6322 """_GetSelf(self) -> PyObject"""
6323 return _core_.PyEvent__GetSelf(*args, **kwargs)
e811c8ce 6324
2131d850 6325_core_.PyEvent_swigregister(PyEvent)
d14a1e28
RD
6326
6327class PyCommandEvent(CommandEvent):
5ba5649b
RD
6328 """
6329 wx.PyCommandEvent can be used as a base class for implementing custom
6330 event types in Python, where the event shoudl travel up to parent
6331 windows looking for a handler. You should derived from this class
6332 instead of `wx.CommandEvent` because this class is Python-aware and is
6333 able to transport its Python bits safely through the wxWidgets event
6334 system and have them still be there when the event handler is invoked.
6335
6336 :see: `wx.PyEvent`
6337
6338 """
0085ce49
RD
6339 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6340 __repr__ = _swig_repr
6341 def __init__(self, *args, **kwargs):
2131d850 6342 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
0085ce49 6343 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6344 self._SetSelf(self)
e811c8ce 6345
0085ce49
RD
6346 __swig_destroy__ = _core_.delete_PyCommandEvent
6347 __del__ = lambda self : None;
5ba5649b
RD
6348 def _SetSelf(*args, **kwargs):
6349 """_SetSelf(self, PyObject self)"""
6350 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
e811c8ce 6351
5ba5649b
RD
6352 def _GetSelf(*args, **kwargs):
6353 """_GetSelf(self) -> PyObject"""
6354 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
e811c8ce 6355
2131d850 6356_core_.PyCommandEvent_swigregister(PyCommandEvent)
d14a1e28 6357
53aa7709 6358class DateEvent(CommandEvent):
5ba5649b
RD
6359 """
6360 This event class holds information about a date change event and is
6361 used together with `wx.DatePickerCtrl`. It also serves as a base class
6362 for `wx.calendar.CalendarEvent`. Bind these event types with
6363 EVT_DATE_CHANGED.
6364 """
0085ce49
RD
6365 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6366 __repr__ = _swig_repr
6367 def __init__(self, *args, **kwargs):
2131d850 6368 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
0085ce49 6369 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6370 def GetDate(*args, **kwargs):
5ba5649b
RD
6371 """
6372 GetDate(self) -> DateTime
6373
6374 Returns the date.
6375 """
53aa7709
RD
6376 return _core_.DateEvent_GetDate(*args, **kwargs)
6377
6378 def SetDate(*args, **kwargs):
5ba5649b
RD
6379 """
6380 SetDate(self, DateTime date)
6381
6382 Sets the date carried by the event, normally only used by the library
6383 internally.
6384 """
53aa7709
RD
6385 return _core_.DateEvent_SetDate(*args, **kwargs)
6386
2131d850 6387_core_.DateEvent_swigregister(DateEvent)
53aa7709
RD
6388
6389wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6390EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6391
d14a1e28
RD
6392#---------------------------------------------------------------------------
6393
54f9ee45
RD
6394PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6395PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6396PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6397PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6398PRINT_WINDOWS = _core_.PRINT_WINDOWS
6399PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
d14a1e28 6400class PyApp(EvtHandler):
66c033b4
RD
6401 """
6402 The ``wx.PyApp`` class is an *implementation detail*, please use the
6403 `wx.App` class (or some other derived class) instead.
6404 """
0085ce49
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):
98e665d3 6408 """
a95a7133 6409 __init__(self) -> PyApp
98e665d3
RD
6410
6411 Create a new application object, starting the bootstrap process.
6412 """
0085ce49 6413 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
70b7a5fe
RD
6414 self._setCallbackInfo(self, PyApp, False)
6415 self._setOORInfo(self, False)
e811c8ce 6416
0085ce49
RD
6417 __swig_destroy__ = _core_.delete_PyApp
6418 __del__ = lambda self : None;
e811c8ce 6419 def _setCallbackInfo(*args, **kwargs):
70b7a5fe 6420 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
54f9ee45 6421 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
6422
6423 def GetAppName(*args, **kwargs):
0df68c9f 6424 """
a95a7133 6425 GetAppName(self) -> String
6c3b4aae 6426
0df68c9f
RD
6427 Get the application name.
6428 """
54f9ee45 6429 return _core_.PyApp_GetAppName(*args, **kwargs)
e811c8ce
RD
6430
6431 def SetAppName(*args, **kwargs):
0df68c9f 6432 """
a95a7133 6433 SetAppName(self, String name)
6c3b4aae 6434
66c033b4
RD
6435 Set the application name. This value may be used automatically by
6436 `wx.Config` and such.
0df68c9f 6437 """
54f9ee45 6438 return _core_.PyApp_SetAppName(*args, **kwargs)
e811c8ce
RD
6439
6440 def GetClassName(*args, **kwargs):
0df68c9f 6441 """
a95a7133 6442 GetClassName(self) -> String
e811c8ce 6443
0df68c9f
RD
6444 Get the application's class name.
6445 """
54f9ee45 6446 return _core_.PyApp_GetClassName(*args, **kwargs)
e811c8ce
RD
6447
6448 def SetClassName(*args, **kwargs):
0df68c9f 6449 """
a95a7133 6450 SetClassName(self, String name)
6c3b4aae 6451
66c033b4
RD
6452 Set the application's class name. This value may be used for
6453 X-resources if applicable for the platform
0df68c9f 6454 """
54f9ee45 6455 return _core_.PyApp_SetClassName(*args, **kwargs)
e811c8ce
RD
6456
6457 def GetVendorName(*args, **kwargs):
0df68c9f 6458 """
a95a7133 6459 GetVendorName(self) -> String
6c3b4aae 6460
0df68c9f
RD
6461 Get the application's vendor name.
6462 """
54f9ee45 6463 return _core_.PyApp_GetVendorName(*args, **kwargs)
e811c8ce
RD
6464
6465 def SetVendorName(*args, **kwargs):
0df68c9f 6466 """
a95a7133 6467 SetVendorName(self, String name)
6c3b4aae 6468
66c033b4
RD
6469 Set the application's vendor name. This value may be used
6470 automatically by `wx.Config` and such.
0df68c9f 6471 """
54f9ee45 6472 return _core_.PyApp_SetVendorName(*args, **kwargs)
e811c8ce
RD
6473
6474 def GetTraits(*args, **kwargs):
0df68c9f 6475 """
a95a7133 6476 GetTraits(self) -> wxAppTraits
6c3b4aae 6477
66c033b4
RD
6478 Return (and create if necessary) the app traits object to which we
6479 delegate for everything which either should be configurable by the
6480 user (then he can change the default behaviour simply by overriding
6481 CreateTraits() and returning his own traits object) or which is
6482 GUI/console dependent as then wx.AppTraits allows us to abstract the
6483 differences behind the common facade.
6484
6485 :todo: Add support for overriding CreateAppTraits in wxPython.
0df68c9f 6486 """
54f9ee45 6487 return _core_.PyApp_GetTraits(*args, **kwargs)
e811c8ce
RD
6488
6489 def ProcessPendingEvents(*args, **kwargs):
0df68c9f 6490 """
a95a7133 6491 ProcessPendingEvents(self)
6c3b4aae 6492
66c033b4
RD
6493 Process all events in the Pending Events list -- it is necessary to
6494 call this function to process posted events. This normally happens
6495 during each event loop iteration.
0df68c9f 6496 """
54f9ee45 6497 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
6498
6499 def Yield(*args, **kwargs):
0df68c9f 6500 """
a95a7133 6501 Yield(self, bool onlyIfNeeded=False) -> bool
6c3b4aae 6502
66c033b4
RD
6503 Process all currently pending events right now, instead of waiting
6504 until return to the event loop. It is an error to call ``Yield``
6505 recursively unless the value of ``onlyIfNeeded`` is True.
6c3b4aae 6506
66c033b4 6507 :warning: This function is dangerous as it can lead to unexpected
41e2b43e
RD
6508 reentrancies (i.e. when called from an event handler it may
6509 result in calling the same event handler again), use with
6510 extreme care or, better, don't use at all!
0df68c9f 6511
66c033b4 6512 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
41e2b43e 6513
0df68c9f 6514 """
54f9ee45 6515 return _core_.PyApp_Yield(*args, **kwargs)
e811c8ce
RD
6516
6517 def WakeUpIdle(*args, **kwargs):
0df68c9f 6518 """
a95a7133 6519 WakeUpIdle(self)
6c3b4aae 6520
66c033b4
RD
6521 Make sure that idle events are sent again.
6522 :see: `wx.WakeUpIdle`
0df68c9f 6523 """
54f9ee45 6524 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
e811c8ce 6525
1fc3b23a
RD
6526 def IsMainLoopRunning(*args, **kwargs):
6527 """
6528 IsMainLoopRunning() -> bool
6529
6530 Returns True if we're running the main loop, i.e. if the events can
6531 currently be dispatched.
6532 """
6533 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6534
6535 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
e811c8ce 6536 def MainLoop(*args, **kwargs):
0df68c9f 6537 """
a95a7133 6538 MainLoop(self) -> int
6c3b4aae 6539
66c033b4
RD
6540 Execute the main GUI loop, the function doesn't normally return until
6541 all top level windows have been closed and destroyed.
0df68c9f 6542 """
54f9ee45 6543 return _core_.PyApp_MainLoop(*args, **kwargs)
e811c8ce
RD
6544
6545 def Exit(*args, **kwargs):
0df68c9f 6546 """
a95a7133 6547 Exit(self)
6c3b4aae 6548
0df68c9f 6549 Exit the main loop thus terminating the application.
66c033b4 6550 :see: `wx.Exit`
0df68c9f 6551 """
54f9ee45 6552 return _core_.PyApp_Exit(*args, **kwargs)
e811c8ce
RD
6553
6554 def ExitMainLoop(*args, **kwargs):
0df68c9f 6555 """
a95a7133 6556 ExitMainLoop(self)
6c3b4aae 6557
66c033b4
RD
6558 Exit the main GUI loop during the next iteration of the main
6559 loop, (i.e. it does not stop the program immediately!)
0df68c9f 6560 """
54f9ee45 6561 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
e811c8ce
RD
6562
6563 def Pending(*args, **kwargs):
0df68c9f 6564 """
a95a7133 6565 Pending(self) -> bool
6c3b4aae 6566
0df68c9f
RD
6567 Returns True if there are unprocessed events in the event queue.
6568 """
54f9ee45 6569 return _core_.PyApp_Pending(*args, **kwargs)
e811c8ce
RD
6570
6571 def Dispatch(*args, **kwargs):
0df68c9f 6572 """
a95a7133 6573 Dispatch(self) -> bool
6c3b4aae 6574
0df68c9f
RD
6575 Process the first event in the event queue (blocks until an event
6576 appears if there are none currently)
6577 """
54f9ee45 6578 return _core_.PyApp_Dispatch(*args, **kwargs)
e811c8ce
RD
6579
6580 def ProcessIdle(*args, **kwargs):
0df68c9f 6581 """
a95a7133 6582 ProcessIdle(self) -> bool
6c3b4aae 6583
66c033b4
RD
6584 Called from the MainLoop when the application becomes idle (there are
6585 no pending events) and sends a `wx.IdleEvent` to all interested
6586 parties. Returns True if more idle events are needed, False if not.
0df68c9f 6587 """
54f9ee45 6588 return _core_.PyApp_ProcessIdle(*args, **kwargs)
e811c8ce
RD
6589
6590 def SendIdleEvents(*args, **kwargs):
0df68c9f 6591 """
a95a7133 6592 SendIdleEvents(self, Window win, IdleEvent event) -> bool
e811c8ce 6593
66c033b4
RD
6594 Send idle event to window and all subwindows. Returns True if more
6595 idle time is requested.
0df68c9f 6596 """
54f9ee45 6597 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
e811c8ce
RD
6598
6599 def IsActive(*args, **kwargs):
0df68c9f 6600 """
a95a7133 6601 IsActive(self) -> bool
6c3b4aae 6602
0df68c9f
RD
6603 Return True if our app has focus.
6604 """
54f9ee45 6605 return _core_.PyApp_IsActive(*args, **kwargs)
e811c8ce
RD
6606
6607 def SetTopWindow(*args, **kwargs):
0df68c9f 6608 """
a95a7133 6609 SetTopWindow(self, Window win)
6c3b4aae 6610
66c033b4 6611 Set the *main* top level window
0df68c9f 6612 """
54f9ee45 6613 return _core_.PyApp_SetTopWindow(*args, **kwargs)
e811c8ce
RD
6614
6615 def GetTopWindow(*args, **kwargs):
0df68c9f 6616 """
a95a7133 6617 GetTopWindow(self) -> Window
6c3b4aae 6618
66c033b4
RD
6619 Return the *main* top level window (if it hadn't been set previously
6620 with SetTopWindow(), will return just some top level window and, if
6621 there not any, will return None)
0df68c9f 6622 """
54f9ee45 6623 return _core_.PyApp_GetTopWindow(*args, **kwargs)
e811c8ce
RD
6624
6625 def SetExitOnFrameDelete(*args, **kwargs):
0df68c9f 6626 """
a95a7133 6627 SetExitOnFrameDelete(self, bool flag)
0df68c9f 6628
66c033b4
RD
6629 Control the exit behaviour: by default, the program will exit the main
6630 loop (and so, usually, terminate) when the last top-level program
6631 window is deleted. Beware that if you disable this behaviour (with
6632 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6633 explicitly from somewhere.
0df68c9f 6634 """
54f9ee45 6635 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
6636
6637 def GetExitOnFrameDelete(*args, **kwargs):
0df68c9f 6638 """
a95a7133 6639 GetExitOnFrameDelete(self) -> bool
6c3b4aae 6640
0df68c9f
RD
6641 Get the current exit behaviour setting.
6642 """
54f9ee45 6643 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
6644
6645 def SetUseBestVisual(*args, **kwargs):
0df68c9f 6646 """
a95a7133 6647 SetUseBestVisual(self, bool flag)
6c3b4aae 6648
66c033b4
RD
6649 Set whether the app should try to use the best available visual on
6650 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
0df68c9f 6651 """
54f9ee45 6652 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
e811c8ce
RD
6653
6654 def GetUseBestVisual(*args, **kwargs):
0df68c9f 6655 """
a95a7133 6656 GetUseBestVisual(self) -> bool
6c3b4aae 6657
0df68c9f
RD
6658 Get current UseBestVisual setting.
6659 """
54f9ee45 6660 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
e811c8ce
RD
6661
6662 def SetPrintMode(*args, **kwargs):
a95a7133 6663 """SetPrintMode(self, int mode)"""
54f9ee45 6664 return _core_.PyApp_SetPrintMode(*args, **kwargs)
e811c8ce
RD
6665
6666 def GetPrintMode(*args, **kwargs):
a95a7133 6667 """GetPrintMode(self) -> int"""
54f9ee45 6668 return _core_.PyApp_GetPrintMode(*args, **kwargs)
e811c8ce 6669
e811c8ce 6670 def SetAssertMode(*args, **kwargs):
0df68c9f 6671 """
a95a7133 6672 SetAssertMode(self, int mode)
6c3b4aae 6673
41e2b43e 6674 Set the OnAssert behaviour for debug and hybrid builds.
0df68c9f 6675 """
54f9ee45 6676 return _core_.PyApp_SetAssertMode(*args, **kwargs)
e811c8ce 6677
6c3b4aae 6678 def GetAssertMode(*args, **kwargs):
0df68c9f 6679 """
a95a7133 6680 GetAssertMode(self) -> int
6c3b4aae 6681
0df68c9f
RD
6682 Get the current OnAssert behaviour setting.
6683 """
54f9ee45 6684 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6c3b4aae 6685
e811c8ce 6686 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 6687 """GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 6688 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
6689
6690 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6691 def GetMacAboutMenuItemId(*args, **kwargs):
66c033b4 6692 """GetMacAboutMenuItemId() -> long"""
54f9ee45 6693 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
6694
6695 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6696 def GetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 6697 """GetMacPreferencesMenuItemId() -> long"""
54f9ee45 6698 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
6699
6700 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6701 def GetMacExitMenuItemId(*args, **kwargs):
66c033b4 6702 """GetMacExitMenuItemId() -> long"""
54f9ee45 6703 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
6704
6705 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6706 def GetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 6707 """GetMacHelpMenuTitleName() -> String"""
54f9ee45 6708 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
6709
6710 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6711 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 6712 """SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 6713 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
6714
6715 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6716 def SetMacAboutMenuItemId(*args, **kwargs):
66c033b4 6717 """SetMacAboutMenuItemId(long val)"""
54f9ee45 6718 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
6719
6720 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6721 def SetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 6722 """SetMacPreferencesMenuItemId(long val)"""
54f9ee45 6723 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
6724
6725 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6726 def SetMacExitMenuItemId(*args, **kwargs):
66c033b4 6727 """SetMacExitMenuItemId(long val)"""
54f9ee45 6728 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
6729
6730 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6731 def SetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 6732 """SetMacHelpMenuTitleName(String val)"""
54f9ee45 6733 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
6734
6735 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6736 def _BootstrapApp(*args, **kwargs):
0df68c9f 6737 """
a95a7133 6738 _BootstrapApp(self)
6c3b4aae 6739
0df68c9f
RD
6740 For internal use only
6741 """
54f9ee45 6742 return _core_.PyApp__BootstrapApp(*args, **kwargs)
e811c8ce
RD
6743
6744 def GetComCtl32Version(*args, **kwargs):
0df68c9f 6745 """
66c033b4 6746 GetComCtl32Version() -> int
6c3b4aae 6747
66c033b4
RD
6748 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6749 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 6750 """
54f9ee45 6751 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
e811c8ce
RD
6752
6753 GetComCtl32Version = staticmethod(GetComCtl32Version)
2131d850 6754_core_.PyApp_swigregister(PyApp)
d14a1e28 6755
0085ce49
RD
6756def PyApp_IsMainLoopRunning(*args):
6757 """
1fc3b23a
RD
6758 PyApp_IsMainLoopRunning() -> bool
6759
6760 Returns True if we're running the main loop, i.e. if the events can
6761 currently be dispatched.
6762 """
0085ce49 6763 return _core_.PyApp_IsMainLoopRunning(*args)
1fc3b23a 6764
0085ce49
RD
6765def PyApp_GetMacSupportPCMenuShortcuts(*args):
6766 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6767 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d14a1e28 6768
0085ce49
RD
6769def PyApp_GetMacAboutMenuItemId(*args):
6770 """PyApp_GetMacAboutMenuItemId() -> long"""
6771 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d14a1e28 6772
0085ce49
RD
6773def PyApp_GetMacPreferencesMenuItemId(*args):
6774 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6775 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d14a1e28 6776
0085ce49
RD
6777def PyApp_GetMacExitMenuItemId(*args):
6778 """PyApp_GetMacExitMenuItemId() -> long"""
6779 return _core_.PyApp_GetMacExitMenuItemId(*args)
d14a1e28 6780
0085ce49
RD
6781def PyApp_GetMacHelpMenuTitleName(*args):
6782 """PyApp_GetMacHelpMenuTitleName() -> String"""
6783 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d14a1e28 6784
e811c8ce 6785def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
0085ce49
RD
6786 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6787 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 6788
e811c8ce 6789def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
0085ce49
RD
6790 """PyApp_SetMacAboutMenuItemId(long val)"""
6791 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 6792
e811c8ce 6793def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
0085ce49
RD
6794 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6795 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 6796
e811c8ce 6797def PyApp_SetMacExitMenuItemId(*args, **kwargs):
0085ce49
RD
6798 """PyApp_SetMacExitMenuItemId(long val)"""
6799 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d14a1e28 6800
e811c8ce 6801def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
0085ce49
RD
6802 """PyApp_SetMacHelpMenuTitleName(String val)"""
6803 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 6804
0085ce49
RD
6805def PyApp_GetComCtl32Version(*args):
6806 """
0df68c9f 6807 PyApp_GetComCtl32Version() -> int
6c3b4aae 6808
66c033b4
RD
6809 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6810 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 6811 """
0085ce49 6812 return _core_.PyApp_GetComCtl32Version(*args)
d14a1e28
RD
6813
6814#---------------------------------------------------------------------------
6815
6816
0085ce49
RD
6817def Exit(*args):
6818 """
0df68c9f 6819 Exit()
6c3b4aae 6820
0df68c9f
RD
6821 Force an exit of the application. Convenience for wx.GetApp().Exit()
6822 """
0085ce49 6823 return _core_.Exit(*args)
d14a1e28 6824
0085ce49
RD
6825def Yield(*args):
6826 """
0df68c9f 6827 Yield() -> bool
6c3b4aae 6828
0df68c9f
RD
6829 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6830 """
0085ce49 6831 return _core_.Yield(*args)
d14a1e28 6832
0085ce49
RD
6833def YieldIfNeeded(*args):
6834 """
0df68c9f 6835 YieldIfNeeded() -> bool
6c3b4aae 6836
0df68c9f
RD
6837 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6838 """
0085ce49 6839 return _core_.YieldIfNeeded(*args)
d14a1e28 6840
e811c8ce 6841def SafeYield(*args, **kwargs):
0085ce49 6842 """
0df68c9f 6843 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6c3b4aae 6844
66c033b4
RD
6845 This function is similar to `wx.Yield`, except that it disables the
6846 user input to all program windows before calling `wx.Yield` and
6847 re-enables it again afterwards. If ``win`` is not None, this window
6848 will remain enabled, allowing the implementation of some limited user
6849 interaction.
6c3b4aae 6850
66c033b4 6851 :Returns: the result of the call to `wx.Yield`.
0df68c9f 6852 """
0085ce49 6853 return _core_.SafeYield(*args, **kwargs)
d14a1e28 6854
0085ce49
RD
6855def WakeUpIdle(*args):
6856 """
0df68c9f 6857 WakeUpIdle()
6c3b4aae 6858
66c033b4
RD
6859 Cause the message queue to become empty again, so idle events will be
6860 sent.
0df68c9f 6861 """
0085ce49 6862 return _core_.WakeUpIdle(*args)
d14a1e28 6863
e811c8ce 6864def PostEvent(*args, **kwargs):
0085ce49 6865 """
0df68c9f 6866 PostEvent(EvtHandler dest, Event event)
6c3b4aae 6867
66c033b4
RD
6868 Send an event to a window or other wx.EvtHandler to be processed
6869 later.
0df68c9f 6870 """
0085ce49 6871 return _core_.PostEvent(*args, **kwargs)
d14a1e28 6872
0085ce49
RD
6873def App_CleanUp(*args):
6874 """
0df68c9f 6875 App_CleanUp()
6c3b4aae 6876
41e2b43e 6877 For internal use only, it is used to cleanup after wxWidgets when
66c033b4 6878 Python shuts down.
0df68c9f 6879 """
0085ce49 6880 return _core_.App_CleanUp(*args)
d14a1e28 6881
0085ce49
RD
6882def GetApp(*args):
6883 """
0df68c9f 6884 GetApp() -> PyApp
6c3b4aae 6885
196addbf 6886 Return a reference to the current wx.App object.
0df68c9f 6887 """
0085ce49 6888 return _core_.GetApp(*args)
5cbf236d
RD
6889
6890def SetDefaultPyEncoding(*args, **kwargs):
0085ce49 6891 """
5cbf236d
RD
6892 SetDefaultPyEncoding(string encoding)
6893
6894 Sets the encoding that wxPython will use when it needs to convert a
6895 Python string or unicode object to or from a wxString.
e505d15e
RD
6896
6897 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6898 but please be aware that the default encoding within the same locale
6899 may be slightly different on different platforms. For example, please
6900 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6901 between the common latin/roman encodings.
5cbf236d 6902 """
0085ce49 6903 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 6904
0085ce49
RD
6905def GetDefaultPyEncoding(*args):
6906 """
5cbf236d
RD
6907 GetDefaultPyEncoding() -> string
6908
6909 Gets the current encoding that wxPython will use when it needs to
6910 convert a Python string or unicode object to or from a wxString.
6911 """
0085ce49 6912 return _core_.GetDefaultPyEncoding(*args)
d14a1e28
RD
6913#----------------------------------------------------------------------
6914
6915class PyOnDemandOutputWindow:
6c3b4aae
RD
6916 """
6917 A class that can be used for redirecting Python's stdout and
6918 stderr streams. It will do nothing until something is wrriten to
6919 the stream at which point it will create a Frame with a text area
6920 and write the text there.
6921 """
d14a1e28
RD
6922 def __init__(self, title = "wxPython: stdout/stderr"):
6923 self.frame = None
6924 self.title = title
412d302d
RD
6925 self.pos = wx.DefaultPosition
6926 self.size = (450, 300)
d14a1e28
RD
6927 self.parent = None
6928
6929 def SetParent(self, parent):
6c3b4aae 6930 """Set the window to be used as the popup Frame's parent."""
d14a1e28
RD
6931 self.parent = parent
6932
6c3b4aae
RD
6933
6934 def CreateOutputWindow(self, st):
412d302d
RD
6935 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
6936 style=wx.DEFAULT_FRAME_STYLE)
196addbf 6937 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 6938 style=wx.TE_MULTILINE|wx.TE_READONLY)
d1e20054 6939 self.text.AppendText(st)
6c3b4aae 6940 self.frame.Show(True)
2131d850 6941 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
6c3b4aae 6942
d14a1e28 6943
7409c0c6
RD
6944 def OnCloseWindow(self, event):
6945 if self.frame is not None:
6946 self.frame.Destroy()
6947 self.frame = None
6948 self.text = None
6949
6950
d14a1e28 6951 # These methods provide the file-like output behaviour.
6c3b4aae
RD
6952 def write(self, text):
6953 """
6954 Create the output window if needed and write the string to it.
6955 If not called in the context of the gui thread then uses
6956 CallAfter to do the work there.
6957 """
6958 if self.frame is None:
6959 if not wx.Thread_IsMain():
6960 wx.CallAfter(self.CreateOutputWindow, text)
6961 else:
6962 self.CreateOutputWindow(text)
6963 else:
6964 if not wx.Thread_IsMain():
6965 wx.CallAfter(self.text.AppendText, text)
6966 else:
6967 self.text.AppendText(text)
6968
d14a1e28
RD
6969
6970 def close(self):
6c3b4aae
RD
6971 if self.frame is not None:
6972 wx.CallAfter(self.frame.Close)
6973
d14a1e28 6974
19272049
RD
6975 def flush(self):
6976 pass
6977
6978
d14a1e28
RD
6979
6980#----------------------------------------------------------------------
d14a1e28
RD
6981
6982_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
6983
6984class App(wx.PyApp):
6c3b4aae 6985 """
66c033b4
RD
6986 The ``wx.App`` class represents the application and is used to:
6987
6988 * bootstrap the wxPython system and initialize the underlying
6989 gui toolkit
6990 * set and get application-wide properties
6991 * implement the windowing system main message or event loop,
6992 and to dispatch events to window instances
6993 * etc.
6994
6995 Every application must have a ``wx.App`` instance, and all
6996 creation of UI objects should be delayed until after the
03e37cd5
RD
6997 ``wx.App`` object has been created in order to ensure that the gui
6998 platform and wxWidgets have been fully initialized.
66c033b4
RD
6999
7000 Normally you would derive from this class and implement an
7001 ``OnInit`` method that creates a frame and then calls
7002 ``self.SetTopWindow(frame)``.
7003
03e37cd5 7004 :see: `wx.PySimpleApp` for a simpler app class that can be used
1c0f361b 7005 directly.
6c3b4aae 7006 """
66c033b4 7007
d14a1e28
RD
7008 outputWindowClass = PyOnDemandOutputWindow
7009
03e37cd5
RD
7010 def __init__(self, redirect=_defRedirect, filename=None,
7011 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7012 """
7013 Construct a ``wx.App`` object.
7014
03e37cd5
RD
7015 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7016 redirected? Defaults to True on Windows and Mac, False
7017 otherwise. If `filename` is None then output will be
7018 redirected to a window that pops up as needed. (You can
7019 control what kind of window is created for the output by
7020 resetting the class variable ``outputWindowClass`` to a
7021 class of your choosing.)
66c033b4 7022
03e37cd5
RD
7023 :param filename: The name of a file to redirect output to, if
7024 redirect is True.
66c033b4
RD
7025
7026 :param useBestVisual: Should the app try to use the best
03e37cd5
RD
7027 available visual provided by the system (only relevant on
7028 systems that have more than one visual.) This parameter
7029 must be used instead of calling `SetUseBestVisual` later
7030 on because it must be set before the underlying GUI
7031 toolkit is initialized.
7032
7033 :param clearSigInt: Should SIGINT be cleared? This allows the
7034 app to terminate upon a Ctrl-C in the console like other
7035 GUI apps will.
66c033b4
RD
7036
7037 :note: You should override OnInit to do applicaition
7038 initialization to ensure that the system, toolkit and
7039 wxWidgets are fully initialized.
7040 """
d14a1e28
RD
7041 wx.PyApp.__init__(self)
7042
7043 if wx.Platform == "__WXMAC__":
7044 try:
7045 import MacOS
7046 if not MacOS.WMAvailable():
7047 print """\
7048This program needs access to the screen. Please run with 'pythonw',
7049not 'python', and only when you are logged in on the main display of
7050your Mac."""
7051 _sys.exit(1)
36cadbf7
RD
7052 except SystemExit:
7053 raise
d14a1e28
RD
7054 except:
7055 pass
7056
7057 # This has to be done before OnInit
7058 self.SetUseBestVisual(useBestVisual)
7059
7060 # Set the default handler for SIGINT. This fixes a problem
7061 # where if Ctrl-C is pressed in the console that started this
7062 # app then it will not appear to do anything, (not even send
7063 # KeyboardInterrupt???) but will later segfault on exit. By
7064 # setting the default handler then the app will exit, as
7065 # expected (depending on platform.)
03e37cd5
RD
7066 if clearSigInt:
7067 try:
7068 import signal
7069 signal.signal(signal.SIGINT, signal.SIG_DFL)
7070 except:
7071 pass
d14a1e28
RD
7072
7073 # Save and redirect the stdio to a window?
7074 self.stdioWin = None
7075 self.saveStdio = (_sys.stdout, _sys.stderr)
7076 if redirect:
7077 self.RedirectStdio(filename)
7078
8fb0e70a
RD
7079 # Use Python's install prefix as the default
7080 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7081
d14a1e28
RD
7082 # This finishes the initialization of wxWindows and then calls
7083 # the OnInit that should be present in the derived class
7084 self._BootstrapApp()
7085
7086
01f6b6d3
RD
7087 def OnPreInit(self):
7088 """
7089 Things that must be done after _BootstrapApp has done its
7090 thing, but would be nice if they were already done by the time
7091 that OnInit is called.
7092 """
7093 wx.StockGDI._initStockObjects()
7094
7095
02b455f2
RD
7096 def __del__(self, destroy=wx.PyApp.__del__):
7097 self.RestoreStdio() # Just in case the MainLoop was overridden
7098 destroy(self)
d14a1e28 7099
70b7a5fe
RD
7100 def Destroy(self):
7101 wx.PyApp.Destroy(self)
7102 self.thisown = 0
d14a1e28
RD
7103
7104 def SetTopWindow(self, frame):
1e0c8722 7105 """Set the \"main\" top level window"""
d14a1e28
RD
7106 if self.stdioWin:
7107 self.stdioWin.SetParent(frame)
7108 wx.PyApp.SetTopWindow(self, frame)
7109
7110
7111 def MainLoop(self):
1e0c8722 7112 """Execute the main GUI event loop"""
d14a1e28
RD
7113 wx.PyApp.MainLoop(self)
7114 self.RestoreStdio()
7115
7116
7409c0c6 7117 def RedirectStdio(self, filename=None):
1e0c8722 7118 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
d14a1e28
RD
7119 if filename:
7120 _sys.stdout = _sys.stderr = open(filename, 'a')
7121 else:
7122 self.stdioWin = self.outputWindowClass()
7123 _sys.stdout = _sys.stderr = self.stdioWin
7124
7125
7126 def RestoreStdio(self):
02b455f2
RD
7127 try:
7128 _sys.stdout, _sys.stderr = self.saveStdio
7129 except:
7130 pass
d14a1e28
RD
7131
7132
412d302d
RD
7133 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7134 """
7135 Set the title, position and/or size of the output window if
f5b96ee1
RD
7136 the stdio has been redirected. This should be called before
7137 any output would cause the output window to be created.
412d302d
RD
7138 """
7139 if self.stdioWin:
7140 if title is not None:
7141 self.stdioWin.title = title
7142 if pos is not None:
7143 self.stdioWin.pos = pos
7144 if size is not None:
7145 self.stdioWin.size = size
7146
7147
7148
d14a1e28 7149
66c033b4 7150# change from wx.PyApp_XX to wx.App_XX
54f9ee45
RD
7151App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7152App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7153App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7154App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7155App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7156App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7157App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7158App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7159App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7160App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7161App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
d14a1e28
RD
7162
7163#----------------------------------------------------------------------------
7164
7165class PySimpleApp(wx.App):
6c3b4aae
RD
7166 """
7167 A simple application class. You can just create one of these and
7168 then then make your top level windows later, and not have to worry
66c033b4
RD
7169 about OnInit. For example::
7170
7171 app = wx.PySimpleApp()
7172 frame = wx.Frame(None, title='Hello World')
7173 frame.Show()
7174 app.MainLoop()
7175
7176 :see: `wx.App`
7177 """
6c3b4aae 7178
03e37cd5
RD
7179 def __init__(self, redirect=False, filename=None,
7180 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7181 """
7182 :see: `wx.App.__init__`
7183 """
03e37cd5 7184 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
6c3b4aae 7185
d14a1e28 7186 def OnInit(self):
d14a1e28
RD
7187 return True
7188
7189
66c033b4 7190
6c3b4aae 7191# Is anybody using this one?
d14a1e28
RD
7192class PyWidgetTester(wx.App):
7193 def __init__(self, size = (250, 100)):
7194 self.size = size
7195 wx.App.__init__(self, 0)
7196
7197 def OnInit(self):
196addbf 7198 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
d14a1e28
RD
7199 self.SetTopWindow(self.frame)
7200 return True
7201
66c033b4
RD
7202 def SetWidget(self, widgetClass, *args, **kwargs):
7203 w = widgetClass(self.frame, *args, **kwargs)
d14a1e28
RD
7204 self.frame.Show(True)
7205
7206#----------------------------------------------------------------------------
7207# DO NOT hold any other references to this object. This is how we
66c033b4 7208# know when to cleanup system resources that wxWidgets is holding. When
d14a1e28 7209# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
66c033b4 7210# goes to zero and it calls the wx.App_CleanUp function.
d14a1e28
RD
7211
7212class __wxPyCleanup:
7213 def __init__(self):
54f9ee45 7214 self.cleanup = _core_.App_CleanUp
d14a1e28
RD
7215 def __del__(self):
7216 self.cleanup()
7217
7218_sys.__wxPythonCleanup = __wxPyCleanup()
7219
7220## # another possible solution, but it gets called too early...
66c033b4
RD
7221## import atexit
7222## atexit.register(_core_.wxApp_CleanUp)
d14a1e28
RD
7223
7224
7225#----------------------------------------------------------------------------
7226
7227#---------------------------------------------------------------------------
2ef75293
RD
7228
7229class EventLoop(object):
093d3ff1 7230 """Proxy of C++ EventLoop class"""
0085ce49
RD
7231 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7232 __repr__ = _swig_repr
7233 def __init__(self, *args, **kwargs):
2ef75293 7234 """__init__(self) -> EventLoop"""
0085ce49
RD
7235 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7236 __swig_destroy__ = _core_.delete_EventLoop
7237 __del__ = lambda self : None;
2ef75293
RD
7238 def Run(*args, **kwargs):
7239 """Run(self) -> int"""
7240 return _core_.EventLoop_Run(*args, **kwargs)
7241
7242 def Exit(*args, **kwargs):
7243 """Exit(self, int rc=0)"""
7244 return _core_.EventLoop_Exit(*args, **kwargs)
7245
7246 def Pending(*args, **kwargs):
7247 """Pending(self) -> bool"""
7248 return _core_.EventLoop_Pending(*args, **kwargs)
7249
7250 def Dispatch(*args, **kwargs):
7251 """Dispatch(self) -> bool"""
7252 return _core_.EventLoop_Dispatch(*args, **kwargs)
7253
7254 def IsRunning(*args, **kwargs):
7255 """IsRunning(self) -> bool"""
7256 return _core_.EventLoop_IsRunning(*args, **kwargs)
7257
7258 def GetActive(*args, **kwargs):
7259 """GetActive() -> EventLoop"""
7260 return _core_.EventLoop_GetActive(*args, **kwargs)
7261
7262 GetActive = staticmethod(GetActive)
7263 def SetActive(*args, **kwargs):
7264 """SetActive(EventLoop loop)"""
7265 return _core_.EventLoop_SetActive(*args, **kwargs)
7266
7267 SetActive = staticmethod(SetActive)
2131d850 7268_core_.EventLoop_swigregister(EventLoop)
2ef75293 7269
0085ce49
RD
7270def EventLoop_GetActive(*args):
7271 """EventLoop_GetActive() -> EventLoop"""
7272 return _core_.EventLoop_GetActive(*args)
2ef75293
RD
7273
7274def EventLoop_SetActive(*args, **kwargs):
0085ce49
RD
7275 """EventLoop_SetActive(EventLoop loop)"""
7276 return _core_.EventLoop_SetActive(*args, **kwargs)
2ef75293 7277
091f5bed
RD
7278class EventLoopActivator(object):
7279 """Proxy of C++ EventLoopActivator class"""
0085ce49
RD
7280 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7281 __repr__ = _swig_repr
7282 def __init__(self, *args, **kwargs):
091f5bed 7283 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
0085ce49
RD
7284 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7285 __swig_destroy__ = _core_.delete_EventLoopActivator
7286 __del__ = lambda self : None;
2131d850 7287_core_.EventLoopActivator_swigregister(EventLoopActivator)
091f5bed 7288
2ef75293 7289#---------------------------------------------------------------------------
d14a1e28 7290
1e0c8722 7291class AcceleratorEntry(object):
66c033b4
RD
7292 """
7293 A class used to define items in an `wx.AcceleratorTable`. wxPython
7294 programs can choose to use wx.AcceleratorEntry objects, but using a
7295 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
41e2b43e 7296 as well. See `__init__` for of the tuple values.
66c033b4
RD
7297
7298 :see: `wx.AcceleratorTable`
7299 """
0085ce49
RD
7300 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7301 __repr__ = _swig_repr
7302 def __init__(self, *args, **kwargs):
66c033b4
RD
7303 """
7304 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7305
7306 Construct a wx.AcceleratorEntry.
66c033b4 7307 """
0085ce49
RD
7308 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7309 __swig_destroy__ = _core_.delete_AcceleratorEntry
7310 __del__ = lambda self : None;
1e0c8722 7311 def Set(*args, **kwargs):
66c033b4
RD
7312 """
7313 Set(self, int flags, int keyCode, int cmd)
1e0c8722 7314
66c033b4
RD
7315 (Re)set the attributes of a wx.AcceleratorEntry.
7316 :see `__init__`
7317 """
7318 return _core_.AcceleratorEntry_Set(*args, **kwargs)
1e0c8722
RD
7319
7320 def GetFlags(*args, **kwargs):
66c033b4
RD
7321 """
7322 GetFlags(self) -> int
7323
7324 Get the AcceleratorEntry's flags.
7325 """
54f9ee45 7326 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
1e0c8722
RD
7327
7328 def GetKeyCode(*args, **kwargs):
66c033b4
RD
7329 """
7330 GetKeyCode(self) -> int
7331
7332 Get the AcceleratorEntry's keycode.
7333 """
54f9ee45 7334 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
1e0c8722
RD
7335
7336 def GetCommand(*args, **kwargs):
66c033b4
RD
7337 """
7338 GetCommand(self) -> int
7339
7340 Get the AcceleratorEntry's command ID.
7341 """
54f9ee45 7342 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
1e0c8722 7343
2131d850 7344_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
1e0c8722
RD
7345
7346class AcceleratorTable(Object):
66c033b4
RD
7347 """
7348 An accelerator table allows the application to specify a table of
7349 keyboard shortcuts for menus or other commands. On Windows, menu or
7350 button commands are supported; on GTK, only menu commands are
7351 supported.
66c033b4 7352 """
0085ce49
RD
7353 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7354 __repr__ = _swig_repr
7355 def __init__(self, *args, **kwargs):
0df68c9f
RD
7356 """
7357 __init__(entries) -> AcceleratorTable
1e0c8722 7358
66c033b4
RD
7359 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7360 items or or of 3-tuples (flags, keyCode, cmdID)
7361
7362 :see: `wx.AcceleratorEntry`
0df68c9f 7363 """
0085ce49
RD
7364 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7365 __swig_destroy__ = _core_.delete_AcceleratorTable
7366 __del__ = lambda self : None;
1e0c8722 7367 def Ok(*args, **kwargs):
a95a7133 7368 """Ok(self) -> bool"""
54f9ee45 7369 return _core_.AcceleratorTable_Ok(*args, **kwargs)
1e0c8722 7370
2131d850 7371_core_.AcceleratorTable_swigregister(AcceleratorTable)
1e0c8722
RD
7372
7373
7374def GetAccelFromString(*args, **kwargs):
0085ce49
RD
7375 """GetAccelFromString(String label) -> AcceleratorEntry"""
7376 return _core_.GetAccelFromString(*args, **kwargs)
1e0c8722
RD
7377#---------------------------------------------------------------------------
7378
74a57fcd
RD
7379class VisualAttributes(object):
7380 """struct containing all the visual attributes of a control"""
0085ce49
RD
7381 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7382 __repr__ = _swig_repr
7383 def __init__(self, *args, **kwargs):
74a57fcd 7384 """
a95a7133 7385 __init__(self) -> VisualAttributes
74a57fcd
RD
7386
7387 struct containing all the visual attributes of a control
7388 """
0085ce49
RD
7389 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7390 __swig_destroy__ = _core_.delete_VisualAttributes
7391 __del__ = lambda self : None;
54f9ee45
RD
7392 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7393 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7394 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 7395_core_.VisualAttributes_swigregister(VisualAttributes)
74a57fcd
RD
7396NullAcceleratorTable = cvar.NullAcceleratorTable
7397PanelNameStr = cvar.PanelNameStr
7398
54f9ee45
RD
7399WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7400WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7401WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7402WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7403WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
d14a1e28 7404class Window(EvtHandler):
15afbcd0
RD
7405 """
7406 wx.Window is the base class for all windows and represents any visible
7407 object on the screen. All controls, top level windows and so on are
7408 wx.Windows. Sizers and device contexts are not however, as they don't
7409 appear on screen themselves.
7410
7411 """
0085ce49
RD
7412 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7413 __repr__ = _swig_repr
7414 def __init__(self, *args, **kwargs):
0df68c9f 7415 """
a95a7133 7416 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 7417 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
15afbcd0
RD
7418
7419 Construct and show a generic Window.
0df68c9f 7420 """
0085ce49 7421 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d14a1e28 7422 self._setOORInfo(self)
d14a1e28 7423
e811c8ce 7424 def Create(*args, **kwargs):
0df68c9f 7425 """
a95a7133 7426 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 7427 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
15afbcd0
RD
7428
7429 Create the GUI part of the Window for 2-phase creation mode.
0df68c9f 7430 """
54f9ee45 7431 return _core_.Window_Create(*args, **kwargs)
d14a1e28 7432
e811c8ce 7433 def Close(*args, **kwargs):
15afbcd0 7434 """
a95a7133 7435 Close(self, bool force=False) -> bool
15afbcd0
RD
7436
7437 This function simply generates a EVT_CLOSE event whose handler usually
7438 tries to close the window. It doesn't close the window itself,
7439 however. If force is False (the default) then the window's close
7440 handler will be allowed to veto the destruction of the window.
15afbcd0 7441 """
54f9ee45 7442 return _core_.Window_Close(*args, **kwargs)
d14a1e28 7443
e811c8ce 7444 def Destroy(*args, **kwargs):
0df68c9f 7445 """
a95a7133 7446 Destroy(self) -> bool
d14a1e28 7447
15afbcd0
RD
7448 Destroys the window safely. Frames and dialogs are not destroyed
7449 immediately when this function is called -- they are added to a list
7450 of windows to be deleted on idle time, when all the window's events
7451 have been processed. This prevents problems with events being sent to
7452 non-existent windows.
7453
7454 Returns True if the window has either been successfully deleted, or it
7455 has been added to the list of windows pending real deletion.
0df68c9f 7456 """
7e08d4ef
RD
7457 val = _core_.Window_Destroy(*args, **kwargs)
7458 args[0].thisown = 0
7459 return val
d14a1e28 7460
e811c8ce 7461 def DestroyChildren(*args, **kwargs):
15afbcd0 7462 """
a95a7133 7463 DestroyChildren(self) -> bool
15afbcd0 7464
41e2b43e
RD
7465 Destroys all children of a window. Called automatically by the
7466 destructor.
15afbcd0 7467 """
54f9ee45 7468 return _core_.Window_DestroyChildren(*args, **kwargs)
d14a1e28 7469
e811c8ce 7470 def IsBeingDeleted(*args, **kwargs):
15afbcd0 7471 """
a95a7133 7472 IsBeingDeleted(self) -> bool
15afbcd0
RD
7473
7474 Is the window in the process of being deleted?
7475 """
54f9ee45 7476 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d14a1e28 7477
e811c8ce 7478 def SetLabel(*args, **kwargs):
15afbcd0 7479 """
a95a7133 7480 SetLabel(self, String label)
15afbcd0
RD
7481
7482 Set the text which the window shows in its label if applicable.
7483 """
54f9ee45 7484 return _core_.Window_SetLabel(*args, **kwargs)
d14a1e28 7485
e811c8ce 7486 def GetLabel(*args, **kwargs):
15afbcd0 7487 """
a95a7133 7488 GetLabel(self) -> String
15afbcd0 7489
41e2b43e
RD
7490 Generic way of getting a label from any window, for identification
7491 purposes. The interpretation of this function differs from class to
7492 class. For frames and dialogs, the value returned is the title. For
7493 buttons or static text controls, it is the button text. This function
7494 can be useful for meta-programs such as testing tools or special-needs
7495 access programs)which need to identify windows by name.
15afbcd0 7496 """
54f9ee45 7497 return _core_.Window_GetLabel(*args, **kwargs)
d14a1e28 7498
e811c8ce 7499 def SetName(*args, **kwargs):
15afbcd0 7500 """
a95a7133 7501 SetName(self, String name)
15afbcd0 7502
41e2b43e
RD
7503 Sets the window's name. The window name is used for ressource setting
7504 in X, it is not the same as the window title/label
15afbcd0 7505 """
54f9ee45 7506 return _core_.Window_SetName(*args, **kwargs)
d14a1e28 7507
e811c8ce 7508 def GetName(*args, **kwargs):
15afbcd0 7509 """
a95a7133 7510 GetName(self) -> String
15afbcd0 7511
41e2b43e
RD
7512 Returns the windows name. This name is not guaranteed to be unique;
7513 it is up to the programmer to supply an appropriate name in the window
7514 constructor or via wx.Window.SetName.
15afbcd0 7515 """
54f9ee45 7516 return _core_.Window_GetName(*args, **kwargs)
d14a1e28 7517
4276dc52
RD
7518 def SetWindowVariant(*args, **kwargs):
7519 """
a95a7133 7520 SetWindowVariant(self, int variant)
4276dc52 7521
41e2b43e
RD
7522 Sets the variant of the window/font size to use for this window, if
7523 the platform supports variants, for example, wxMac.
4276dc52 7524 """
54f9ee45 7525 return _core_.Window_SetWindowVariant(*args, **kwargs)
4276dc52
RD
7526
7527 def GetWindowVariant(*args, **kwargs):
a95a7133 7528 """GetWindowVariant(self) -> int"""
54f9ee45 7529 return _core_.Window_GetWindowVariant(*args, **kwargs)
4276dc52 7530
e811c8ce 7531 def SetId(*args, **kwargs):
15afbcd0 7532 """
a95a7133 7533 SetId(self, int winid)
15afbcd0
RD
7534
7535 Sets the identifier of the window. Each window has an integer
7536 identifier. If the application has not provided one, an identifier
7537 will be generated. Normally, the identifier should be provided on
7538 creation and should not be modified subsequently.
7539 """
54f9ee45 7540 return _core_.Window_SetId(*args, **kwargs)
d14a1e28 7541
e811c8ce 7542 def GetId(*args, **kwargs):
15afbcd0 7543 """
a95a7133 7544 GetId(self) -> int
15afbcd0
RD
7545
7546 Returns the identifier of the window. Each window has an integer
7547 identifier. If the application has not provided one (or the default Id
7548 -1 is used) then an unique identifier with a negative value will be
7549 generated.
7550 """
54f9ee45 7551 return _core_.Window_GetId(*args, **kwargs)
d14a1e28 7552
e811c8ce 7553 def NewControlId(*args, **kwargs):
15afbcd0 7554 """
66c033b4 7555 NewControlId() -> int
15afbcd0
RD
7556
7557 Generate a control id for the controls which were not given one.
7558 """
54f9ee45 7559 return _core_.Window_NewControlId(*args, **kwargs)
d14a1e28 7560
e811c8ce
RD
7561 NewControlId = staticmethod(NewControlId)
7562 def NextControlId(*args, **kwargs):
15afbcd0 7563 """
66c033b4 7564 NextControlId(int winid) -> int
15afbcd0
RD
7565
7566 Get the id of the control following the one with the given
41e2b43e 7567 autogenerated) id
15afbcd0 7568 """
54f9ee45 7569 return _core_.Window_NextControlId(*args, **kwargs)
d14a1e28 7570
e811c8ce
RD
7571 NextControlId = staticmethod(NextControlId)
7572 def PrevControlId(*args, **kwargs):
15afbcd0 7573 """
66c033b4 7574 PrevControlId(int winid) -> int
15afbcd0
RD
7575
7576 Get the id of the control preceding the one with the given
41e2b43e 7577 autogenerated) id
15afbcd0 7578 """
54f9ee45 7579 return _core_.Window_PrevControlId(*args, **kwargs)
d14a1e28 7580
e811c8ce
RD
7581 PrevControlId = staticmethod(PrevControlId)
7582 def SetSize(*args, **kwargs):
15afbcd0 7583 """
a95a7133 7584 SetSize(self, Size size)
15afbcd0
RD
7585
7586 Sets the size of the window in pixels.
7587 """
54f9ee45 7588 return _core_.Window_SetSize(*args, **kwargs)
d14a1e28 7589
e811c8ce 7590 def SetDimensions(*args, **kwargs):
15afbcd0 7591 """
a95a7133 7592 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
7593
7594 Sets the position and size of the window in pixels. The sizeFlags
7595 parameter indicates the interpretation of the other params if they are
e505d15e
RD
7596 equal to -1.
7597
7598 ======================== ======================================
7599 wx.SIZE_AUTO A -1 indicates that a class-specific
7600 default should be used.
7601 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7602 -1 values are supplied.
7603 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7604 interpreted as real dimensions, not
7605 default values.
7606 ======================== ======================================
7607
15afbcd0 7608 """
54f9ee45 7609 return _core_.Window_SetDimensions(*args, **kwargs)
d14a1e28 7610
e811c8ce 7611 def SetRect(*args, **kwargs):
15afbcd0 7612 """
a95a7133 7613 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
7614
7615 Sets the position and size of the window in pixels using a wx.Rect.
7616 """
54f9ee45 7617 return _core_.Window_SetRect(*args, **kwargs)
d14a1e28 7618
e811c8ce 7619 def SetSizeWH(*args, **kwargs):
15afbcd0 7620 """
a95a7133 7621 SetSizeWH(self, int width, int height)
15afbcd0
RD
7622
7623 Sets the size of the window in pixels.
7624 """
54f9ee45 7625 return _core_.Window_SetSizeWH(*args, **kwargs)
d14a1e28 7626
e811c8ce 7627 def Move(*args, **kwargs):
15afbcd0 7628 """
a95a7133 7629 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
7630
7631 Moves the window to the given position.
7632 """
54f9ee45 7633 return _core_.Window_Move(*args, **kwargs)
d14a1e28 7634
e811c8ce
RD
7635 SetPosition = Move
7636 def MoveXY(*args, **kwargs):
15afbcd0 7637 """
a95a7133 7638 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
7639
7640 Moves the window to the given position.
7641 """
54f9ee45 7642 return _core_.Window_MoveXY(*args, **kwargs)
e811c8ce 7643
f8167d6e
RD
7644 def SetBestFittingSize(*args, **kwargs):
7645 """
7646 SetBestFittingSize(self, Size size=DefaultSize)
7647
7648 A 'Smart' SetSize that will fill in default size components with the
7649 window's *best size* values. Also set's the minsize for use with sizers.
7650 """
7651 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7652
e811c8ce 7653 def Raise(*args, **kwargs):
15afbcd0 7654 """
a95a7133 7655 Raise(self)
15afbcd0 7656
943e8dfd
RD
7657 Raises the window to the top of the window hierarchy. In current
7658 version of wxWidgets this works both for manage and child windows.
15afbcd0 7659 """
54f9ee45 7660 return _core_.Window_Raise(*args, **kwargs)
e811c8ce
RD
7661
7662 def Lower(*args, **kwargs):
15afbcd0 7663 """
a95a7133 7664 Lower(self)
15afbcd0 7665
943e8dfd
RD
7666 Lowers the window to the bottom of the window hierarchy. In current
7667 version of wxWidgets this works both for manage and child windows.
15afbcd0 7668 """
54f9ee45 7669 return _core_.Window_Lower(*args, **kwargs)
e811c8ce
RD
7670
7671 def SetClientSize(*args, **kwargs):
15afbcd0 7672 """
a95a7133 7673 SetClientSize(self, Size size)
15afbcd0
RD
7674
7675 This sets the size of the window client area in pixels. Using this
7676 function to size a window tends to be more device-independent than
7677 wx.Window.SetSize, since the application need not worry about what
7678 dimensions the border or title bar have when trying to fit the window
7679 around panel items, for example.
7680 """
54f9ee45 7681 return _core_.Window_SetClientSize(*args, **kwargs)
e811c8ce
RD
7682
7683 def SetClientSizeWH(*args, **kwargs):
15afbcd0 7684 """
a95a7133 7685 SetClientSizeWH(self, int width, int height)
15afbcd0
RD
7686
7687 This sets the size of the window client area in pixels. Using this
7688 function to size a window tends to be more device-independent than
7689 wx.Window.SetSize, since the application need not worry about what
7690 dimensions the border or title bar have when trying to fit the window
7691 around panel items, for example.
7692 """
54f9ee45 7693 return _core_.Window_SetClientSizeWH(*args, **kwargs)
e811c8ce
RD
7694
7695 def SetClientRect(*args, **kwargs):
15afbcd0 7696 """
a95a7133 7697 SetClientRect(self, Rect rect)
15afbcd0
RD
7698
7699 This sets the size of the window client area in pixels. Using this
7700 function to size a window tends to be more device-independent than
7701 wx.Window.SetSize, since the application need not worry about what
7702 dimensions the border or title bar have when trying to fit the window
7703 around panel items, for example.
7704 """
54f9ee45 7705 return _core_.Window_SetClientRect(*args, **kwargs)
e811c8ce
RD
7706
7707 def GetPosition(*args, **kwargs):
0df68c9f 7708 """
a95a7133 7709 GetPosition(self) -> Point
e811c8ce 7710
75219dcb
RD
7711 Get the window's position. Notice that the position is in client
7712 coordinates for child windows and screen coordinates for the top level
7713 ones, use `GetScreenPosition` if you need screen coordinates for all
7714 kinds of windows.
0df68c9f 7715 """
54f9ee45 7716 return _core_.Window_GetPosition(*args, **kwargs)
e811c8ce
RD
7717
7718 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
7719 """
7720 GetPositionTuple() -> (x,y)
e811c8ce 7721
75219dcb
RD
7722 Get the window's position. Notice that the position is in client
7723 coordinates for child windows and screen coordinates for the top level
7724 ones, use `GetScreenPosition` if you need screen coordinates for all
7725 kinds of windows.
0df68c9f 7726 """
54f9ee45 7727 return _core_.Window_GetPositionTuple(*args, **kwargs)
e811c8ce 7728
75219dcb
RD
7729 def GetScreenPosition(*args, **kwargs):
7730 """
7731 GetScreenPosition(self) -> Point
7732
7733 Get the position of the window in screen coordinantes.
7734 """
7735 return _core_.Window_GetScreenPosition(*args, **kwargs)
7736
7737 def GetScreenPositionTuple(*args, **kwargs):
7738 """
7739 GetScreenPositionTuple() -> (x,y)
7740
7741 Get the position of the window in screen coordinantes.
7742 """
7743 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7744
7745 def GetScreenRect(*args, **kwargs):
7746 """
7747 GetScreenRect(self) -> Rect
7748
7749 Returns the size and position of the window in screen coordinantes as
7750 a `wx.Rect` object.
7751 """
7752 return _core_.Window_GetScreenRect(*args, **kwargs)
7753
e811c8ce 7754 def GetSize(*args, **kwargs):
0df68c9f 7755 """
a95a7133 7756 GetSize(self) -> Size
e811c8ce 7757
0df68c9f
RD
7758 Get the window size.
7759 """
54f9ee45 7760 return _core_.Window_GetSize(*args, **kwargs)
e811c8ce
RD
7761
7762 def GetSizeTuple(*args, **kwargs):
0df68c9f
RD
7763 """
7764 GetSizeTuple() -> (width, height)
e811c8ce 7765
0df68c9f
RD
7766 Get the window size.
7767 """
54f9ee45 7768 return _core_.Window_GetSizeTuple(*args, **kwargs)
e811c8ce
RD
7769
7770 def GetRect(*args, **kwargs):
15afbcd0 7771 """
a95a7133 7772 GetRect(self) -> Rect
15afbcd0 7773
75219dcb 7774 Returns the size and position of the window as a `wx.Rect` object.
15afbcd0 7775 """
54f9ee45 7776 return _core_.Window_GetRect(*args, **kwargs)
e811c8ce
RD
7777
7778 def GetClientSize(*args, **kwargs):
0df68c9f 7779 """
a95a7133 7780 GetClientSize(self) -> Size
e811c8ce 7781
15afbcd0
RD
7782 This gets the size of the window's 'client area' in pixels. The client
7783 area is the area which may be drawn on by the programmer, excluding
7784 title bar, border, scrollbars, etc.
0df68c9f 7785 """
54f9ee45 7786 return _core_.Window_GetClientSize(*args, **kwargs)
e811c8ce
RD
7787
7788 def GetClientSizeTuple(*args, **kwargs):
0df68c9f
RD
7789 """
7790 GetClientSizeTuple() -> (width, height)
e811c8ce 7791
15afbcd0
RD
7792 This gets the size of the window's 'client area' in pixels. The client
7793 area is the area which may be drawn on by the programmer, excluding
7794 title bar, border, scrollbars, etc.
0df68c9f 7795 """
54f9ee45 7796 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
e811c8ce
RD
7797
7798 def GetClientAreaOrigin(*args, **kwargs):
15afbcd0 7799 """
a95a7133 7800 GetClientAreaOrigin(self) -> Point
15afbcd0
RD
7801
7802 Get the origin of the client area of the window relative to the
7803 window's top left corner (the client area may be shifted because of
7804 the borders, scrollbars, other decorations...)
7805 """
54f9ee45 7806 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
e811c8ce
RD
7807
7808 def GetClientRect(*args, **kwargs):
15afbcd0 7809 """
a95a7133 7810 GetClientRect(self) -> Rect
15afbcd0 7811
61863841 7812 Get the client area position and size as a `wx.Rect` object.
15afbcd0 7813 """
54f9ee45 7814 return _core_.Window_GetClientRect(*args, **kwargs)
e811c8ce
RD
7815
7816 def GetBestSize(*args, **kwargs):
0df68c9f 7817 """
a95a7133 7818 GetBestSize(self) -> Size
e811c8ce 7819
248ed943 7820 This function returns the best acceptable minimal size for the
41e2b43e
RD
7821 window, if applicable. For example, for a static text control, it will
7822 be the minimal size such that the control label is not truncated. For
7823 windows containing subwindows (suzh aswx.Panel), the size returned by
7824 this function will be the same as the size the window would have had
7825 after calling Fit.
0df68c9f 7826 """
54f9ee45 7827 return _core_.Window_GetBestSize(*args, **kwargs)
e811c8ce
RD
7828
7829 def GetBestSizeTuple(*args, **kwargs):
0df68c9f
RD
7830 """
7831 GetBestSizeTuple() -> (width, height)
e811c8ce 7832
248ed943 7833 This function returns the best acceptable minimal size for the
41e2b43e
RD
7834 window, if applicable. For example, for a static text control, it will
7835 be the minimal size such that the control label is not truncated. For
7836 windows containing subwindows (suzh aswx.Panel), the size returned by
7837 this function will be the same as the size the window would have had
7838 after calling Fit.
0df68c9f 7839 """
54f9ee45 7840 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
e811c8ce 7841
dfbb5885
RD
7842 def InvalidateBestSize(*args, **kwargs):
7843 """
7844 InvalidateBestSize(self)
7845
7846 Reset the cached best size value so it will be recalculated the next
7847 time it is needed.
7848 """
7849 return _core_.Window_InvalidateBestSize(*args, **kwargs)
7850
e2813725
RD
7851 def CacheBestSize(*args, **kwargs):
7852 """
7853 CacheBestSize(self, Size size)
7854
7855 Cache the best size so it doesn't need to be calculated again, (at least until
7856 some properties of the window change.)
7857 """
7858 return _core_.Window_CacheBestSize(*args, **kwargs)
7859
dfbb5885
RD
7860 def GetBestFittingSize(*args, **kwargs):
7861 """
7862 GetBestFittingSize(self) -> Size
7863
7864 This function will merge the window's best size into the window's
7865 minimum size, giving priority to the min size components, and returns
7866 the results.
7867
7868 """
7869 return _core_.Window_GetBestFittingSize(*args, **kwargs)
7870
e811c8ce 7871 def GetAdjustedBestSize(*args, **kwargs):
15afbcd0 7872 """
a95a7133 7873 GetAdjustedBestSize(self) -> Size
15afbcd0
RD
7874
7875 This method is similar to GetBestSize, except in one
7876 thing. GetBestSize should return the minimum untruncated size of the
7877 window, while this method will return the largest of BestSize and any
7878 user specified minimum size. ie. it is the minimum size the window
7879 should currently be drawn at, not the minimal size it can possibly
7880 tolerate.
7881 """
54f9ee45 7882 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
e811c8ce
RD
7883
7884 def Center(*args, **kwargs):
15afbcd0 7885 """
a95a7133 7886 Center(self, int direction=BOTH)
15afbcd0
RD
7887
7888 Centers the window. The parameter specifies the direction for
7889 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7890 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7891 on the entire screen and not on its parent window. If it is a
7892 top-level window and has no parent then it will always be centered
7893 relative to the screen.
7894 """
54f9ee45 7895 return _core_.Window_Center(*args, **kwargs)
e811c8ce
RD
7896
7897 Centre = Center
e811c8ce 7898 def CenterOnParent(*args, **kwargs):
15afbcd0 7899 """
a95a7133 7900 CenterOnParent(self, int dir=BOTH)
15afbcd0
RD
7901
7902 Center with respect to the the parent window
7903 """
54f9ee45 7904 return _core_.Window_CenterOnParent(*args, **kwargs)
e811c8ce
RD
7905
7906 CentreOnParent = CenterOnParent
7907 def Fit(*args, **kwargs):
15afbcd0 7908 """
a95a7133 7909 Fit(self)
15afbcd0
RD
7910
7911 Sizes the window so that it fits around its subwindows. This function
7912 won't do anything if there are no subwindows and will only really work
7913 correctly if sizers are used for the subwindows layout. Also, if the
7914 window has exactly one subwindow it is better (faster and the result
7915 is more precise as Fit adds some margin to account for fuzziness of
7916 its calculations) to call window.SetClientSize(child.GetSize())
7917 instead of calling Fit.
7918 """
54f9ee45 7919 return _core_.Window_Fit(*args, **kwargs)
e811c8ce
RD
7920
7921 def FitInside(*args, **kwargs):
15afbcd0 7922 """
a95a7133 7923 FitInside(self)
15afbcd0
RD
7924
7925 Similar to Fit, but sizes the interior (virtual) size of a
7926 window. Mainly useful with scrolled windows to reset scrollbars after
7927 sizing changes that do not trigger a size event, and/or scrolled
7928 windows without an interior sizer. This function similarly won't do
7929 anything if there are no subwindows.
7930 """
54f9ee45 7931 return _core_.Window_FitInside(*args, **kwargs)
e811c8ce 7932
f16ab95d 7933 def SetSizeHints(*args, **kwargs):
0df68c9f 7934 """
a95a7133 7935 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
0df68c9f 7936 int incH=-1)
15afbcd0
RD
7937
7938 Allows specification of minimum and maximum window sizes, and window
7939 size increments. If a pair of values is not set (or set to -1), the
7940 default values will be used. If this function is called, the user
908b74cd
RD
7941 will not be able to size the window outside the given bounds (if it is
7942 a top-level window.) Sizers will also inspect the minimum window size
7943 and will use that value if set when calculating layout.
7944
7945 The resizing increments are only significant under Motif or Xt.
0df68c9f 7946 """
f16ab95d 7947 return _core_.Window_SetSizeHints(*args, **kwargs)
e811c8ce 7948
f16ab95d
RD
7949 def SetSizeHintsSz(*args, **kwargs):
7950 """
7951 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
7952
7953 Allows specification of minimum and maximum window sizes, and window
7954 size increments. If a pair of values is not set (or set to -1), the
7955 default values will be used. If this function is called, the user
7956 will not be able to size the window outside the given bounds (if it is
7957 a top-level window.) Sizers will also inspect the minimum window size
7958 and will use that value if set when calculating layout.
7959
7960 The resizing increments are only significant under Motif or Xt.
7961 """
7962 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
7963
7964 def SetVirtualSizeHints(*args, **kwargs):
15afbcd0 7965 """
908b74cd 7966 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
15afbcd0
RD
7967
7968 Allows specification of minimum and maximum virtual window sizes. If a
7969 pair of values is not set (or set to -1), the default values will be
7970 used. If this function is called, the user will not be able to size
7971 the virtual area of the window outside the given bounds.
7972 """
f16ab95d
RD
7973 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
7974
7975 def SetVirtualSizeHintsSz(*args, **kwargs):
7976 """
7977 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
7978
7979 Allows specification of minimum and maximum virtual window sizes. If a
7980 pair of values is not set (or set to -1), the default values will be
7981 used. If this function is called, the user will not be able to size
7982 the virtual area of the window outside the given bounds.
7983 """
7984 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
e811c8ce 7985
908b74cd
RD
7986 def GetMaxSize(*args, **kwargs):
7987 """GetMaxSize(self) -> Size"""
7988 return _core_.Window_GetMaxSize(*args, **kwargs)
7989
7990 def GetMinSize(*args, **kwargs):
7991 """GetMinSize(self) -> Size"""
7992 return _core_.Window_GetMinSize(*args, **kwargs)
7993
7994 def SetMinSize(*args, **kwargs):
7995 """
7996 SetMinSize(self, Size minSize)
7997
7998 A more convenient method than `SetSizeHints` for setting just the
7999 min size.
8000 """
8001 return _core_.Window_SetMinSize(*args, **kwargs)
8002
8003 def SetMaxSize(*args, **kwargs):
8004 """
8005 SetMaxSize(self, Size maxSize)
8006
8007 A more convenient method than `SetSizeHints` for setting just the
8008 max size.
8009 """
8010 return _core_.Window_SetMaxSize(*args, **kwargs)
8011
e811c8ce 8012 def GetMinWidth(*args, **kwargs):
a95a7133 8013 """GetMinWidth(self) -> int"""
54f9ee45 8014 return _core_.Window_GetMinWidth(*args, **kwargs)
e811c8ce
RD
8015
8016 def GetMinHeight(*args, **kwargs):
a95a7133 8017 """GetMinHeight(self) -> int"""
54f9ee45 8018 return _core_.Window_GetMinHeight(*args, **kwargs)
e811c8ce
RD
8019
8020 def GetMaxWidth(*args, **kwargs):
a95a7133 8021 """GetMaxWidth(self) -> int"""
54f9ee45 8022 return _core_.Window_GetMaxWidth(*args, **kwargs)
e811c8ce
RD
8023
8024 def GetMaxHeight(*args, **kwargs):
a95a7133 8025 """GetMaxHeight(self) -> int"""
54f9ee45 8026 return _core_.Window_GetMaxHeight(*args, **kwargs)
e811c8ce 8027
e811c8ce 8028 def SetVirtualSize(*args, **kwargs):
0df68c9f 8029 """
a95a7133 8030 SetVirtualSize(self, Size size)
e811c8ce 8031
15afbcd0
RD
8032 Set the the virtual size of a window in pixels. For most windows this
8033 is just the client area of the window, but for some like scrolled
8034 windows it is more or less independent of the screen window size.
0df68c9f 8035 """
54f9ee45 8036 return _core_.Window_SetVirtualSize(*args, **kwargs)
e811c8ce
RD
8037
8038 def SetVirtualSizeWH(*args, **kwargs):
0df68c9f 8039 """
a95a7133 8040 SetVirtualSizeWH(self, int w, int h)
e811c8ce 8041
15afbcd0
RD
8042 Set the the virtual size of a window in pixels. For most windows this
8043 is just the client area of the window, but for some like scrolled
8044 windows it is more or less independent of the screen window size.
0df68c9f 8045 """
54f9ee45 8046 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
e811c8ce
RD
8047
8048 def GetVirtualSize(*args, **kwargs):
0df68c9f 8049 """
a95a7133 8050 GetVirtualSize(self) -> Size
e811c8ce 8051
15afbcd0
RD
8052 Get the the virtual size of the window in pixels. For most windows
8053 this is just the client area of the window, but for some like scrolled
8054 windows it is more or less independent of the screen window size.
0df68c9f 8055 """
54f9ee45 8056 return _core_.Window_GetVirtualSize(*args, **kwargs)
e811c8ce
RD
8057
8058 def GetVirtualSizeTuple(*args, **kwargs):
0df68c9f
RD
8059 """
8060 GetVirtualSizeTuple() -> (width, height)
e811c8ce 8061
15afbcd0
RD
8062 Get the the virtual size of the window in pixels. For most windows
8063 this is just the client area of the window, but for some like scrolled
8064 windows it is more or less independent of the screen window size.
0df68c9f 8065 """
54f9ee45 8066 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
e811c8ce
RD
8067
8068 def GetBestVirtualSize(*args, **kwargs):
15afbcd0 8069 """
a95a7133 8070 GetBestVirtualSize(self) -> Size
15afbcd0
RD
8071
8072 Return the largest of ClientSize and BestSize (as determined by a
8073 sizer, interior children, or other means)
8074 """
54f9ee45 8075 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
e811c8ce
RD
8076
8077 def Show(*args, **kwargs):
15afbcd0 8078 """
a95a7133 8079 Show(self, bool show=True) -> bool
15afbcd0
RD
8080
8081 Shows or hides the window. You may need to call Raise for a top level
8082 window if you want to bring it to top, although this is not needed if
8083 Show is called immediately after the frame creation. Returns True if
8084 the window has been shown or hidden or False if nothing was done
8085 because it already was in the requested state.
8086 """
54f9ee45 8087 return _core_.Window_Show(*args, **kwargs)
e811c8ce
RD
8088
8089 def Hide(*args, **kwargs):
15afbcd0 8090 """
a95a7133 8091 Hide(self) -> bool
15afbcd0
RD
8092
8093 Equivalent to calling Show(False).
8094 """
54f9ee45 8095 return _core_.Window_Hide(*args, **kwargs)
e811c8ce
RD
8096
8097 def Enable(*args, **kwargs):
15afbcd0 8098 """
a95a7133 8099 Enable(self, bool enable=True) -> bool
15afbcd0
RD
8100
8101 Enable or disable the window for user input. Note that when a parent
8102 window is disabled, all of its children are disabled as well and they
8103 are reenabled again when the parent is. Returns true if the window
8104 has been enabled or disabled, false if nothing was done, i.e. if the
8105 window had already been in the specified state.
8106 """
54f9ee45 8107 return _core_.Window_Enable(*args, **kwargs)
e811c8ce
RD
8108
8109 def Disable(*args, **kwargs):
15afbcd0 8110 """
a95a7133 8111 Disable(self) -> bool
15afbcd0
RD
8112
8113 Disables the window, same as Enable(false).
8114 """
54f9ee45 8115 return _core_.Window_Disable(*args, **kwargs)
e811c8ce
RD
8116
8117 def IsShown(*args, **kwargs):
15afbcd0 8118 """
a95a7133 8119 IsShown(self) -> bool
15afbcd0
RD
8120
8121 Returns true if the window is shown, false if it has been hidden.
8122 """
54f9ee45 8123 return _core_.Window_IsShown(*args, **kwargs)
e811c8ce
RD
8124
8125 def IsEnabled(*args, **kwargs):
15afbcd0 8126 """
a95a7133 8127 IsEnabled(self) -> bool
15afbcd0
RD
8128
8129 Returns true if the window is enabled for input, false otherwise.
8130 """
54f9ee45 8131 return _core_.Window_IsEnabled(*args, **kwargs)
e811c8ce
RD
8132
8133 def SetWindowStyleFlag(*args, **kwargs):
15afbcd0 8134 """
a95a7133 8135 SetWindowStyleFlag(self, long style)
15afbcd0 8136
41e2b43e
RD
8137 Sets the style of the window. Please note that some styles cannot be
8138 changed after the window creation and that Refresh() might need to be
8139 called after changing the others for the change to take place
8140 immediately.
15afbcd0 8141 """
54f9ee45 8142 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
e811c8ce
RD
8143
8144 def GetWindowStyleFlag(*args, **kwargs):
15afbcd0 8145 """
a95a7133 8146 GetWindowStyleFlag(self) -> long
e811c8ce 8147
15afbcd0
RD
8148 Gets the window style that was passed to the constructor or Create
8149 method.
8150 """
54f9ee45 8151 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
e811c8ce 8152
15afbcd0 8153 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
e811c8ce 8154 def HasFlag(*args, **kwargs):
15afbcd0 8155 """
a95a7133 8156 HasFlag(self, int flag) -> bool
15afbcd0
RD
8157
8158 Test if the given style is set for this window.
8159 """
54f9ee45 8160 return _core_.Window_HasFlag(*args, **kwargs)
e811c8ce
RD
8161
8162 def IsRetained(*args, **kwargs):
15afbcd0 8163 """
a95a7133 8164 IsRetained(self) -> bool
15afbcd0
RD
8165
8166 Returns true if the window is retained, false otherwise. Retained
8167 windows are only available on X platforms.
8168 """
54f9ee45 8169 return _core_.Window_IsRetained(*args, **kwargs)
e811c8ce
RD
8170
8171 def SetExtraStyle(*args, **kwargs):
15afbcd0 8172 """
a95a7133 8173 SetExtraStyle(self, long exStyle)
15afbcd0
RD
8174
8175 Sets the extra style bits for the window. Extra styles are the less
8176 often used style bits which can't be set with the constructor or with
8177 SetWindowStyleFlag()
8178 """
54f9ee45 8179 return _core_.Window_SetExtraStyle(*args, **kwargs)
e811c8ce
RD
8180
8181 def GetExtraStyle(*args, **kwargs):
15afbcd0 8182 """
a95a7133 8183 GetExtraStyle(self) -> long
15afbcd0
RD
8184
8185 Returns the extra style bits for the window.
8186 """
54f9ee45 8187 return _core_.Window_GetExtraStyle(*args, **kwargs)
e811c8ce
RD
8188
8189 def MakeModal(*args, **kwargs):
15afbcd0 8190 """
a95a7133 8191 MakeModal(self, bool modal=True)
15afbcd0
RD
8192
8193 Disables all other windows in the application so that the user can
8194 only interact with this window. Passing False will reverse this
8195 effect.
8196 """
54f9ee45 8197 return _core_.Window_MakeModal(*args, **kwargs)
e811c8ce
RD
8198
8199 def SetThemeEnabled(*args, **kwargs):
15afbcd0 8200 """
a95a7133 8201 SetThemeEnabled(self, bool enableTheme)
15afbcd0
RD
8202
8203 This function tells a window if it should use the system's "theme"
8204 code to draw the windows' background instead if its own background
8205 drawing code. This will only have an effect on platforms that support
8206 the notion of themes in user defined windows. One such platform is
8207 GTK+ where windows can have (very colourful) backgrounds defined by a
8208 user's selected theme.
8209
8210 Dialogs, notebook pages and the status bar have this flag set to true
8211 by default so that the default look and feel is simulated best.
8212 """
54f9ee45 8213 return _core_.Window_SetThemeEnabled(*args, **kwargs)
e811c8ce
RD
8214
8215 def GetThemeEnabled(*args, **kwargs):
15afbcd0 8216 """
a95a7133 8217 GetThemeEnabled(self) -> bool
e811c8ce 8218
15afbcd0
RD
8219 Return the themeEnabled flag.
8220 """
54f9ee45 8221 return _core_.Window_GetThemeEnabled(*args, **kwargs)
e811c8ce
RD
8222
8223 def SetFocus(*args, **kwargs):
15afbcd0 8224 """
a95a7133 8225 SetFocus(self)
15afbcd0
RD
8226
8227 Set's the focus to this window, allowing it to receive keyboard input.
8228 """
54f9ee45 8229 return _core_.Window_SetFocus(*args, **kwargs)
e811c8ce
RD
8230
8231 def SetFocusFromKbd(*args, **kwargs):
15afbcd0 8232 """
a95a7133 8233 SetFocusFromKbd(self)
15afbcd0
RD
8234
8235 Set focus to this window as the result of a keyboard action. Normally
8236 only called internally.
8237 """
54f9ee45 8238 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
e811c8ce
RD
8239
8240 def FindFocus(*args, **kwargs):
15afbcd0 8241 """
66c033b4 8242 FindFocus() -> Window
15afbcd0
RD
8243
8244 Returns the window or control that currently has the keyboard focus,
8245 or None.
8246 """
54f9ee45 8247 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
8248
8249 FindFocus = staticmethod(FindFocus)
8250 def AcceptsFocus(*args, **kwargs):
15afbcd0 8251 """
a95a7133 8252 AcceptsFocus(self) -> bool
15afbcd0
RD
8253
8254 Can this window have focus?
8255 """
54f9ee45 8256 return _core_.Window_AcceptsFocus(*args, **kwargs)
e811c8ce
RD
8257
8258 def AcceptsFocusFromKeyboard(*args, **kwargs):
15afbcd0 8259 """
a95a7133 8260 AcceptsFocusFromKeyboard(self) -> bool
15afbcd0
RD
8261
8262 Can this window be given focus by keyboard navigation? if not, the
8263 only way to give it focus (provided it accepts it at all) is to click
8264 it.
8265 """
54f9ee45 8266 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
e811c8ce
RD
8267
8268 def GetDefaultItem(*args, **kwargs):
15afbcd0 8269 """
a95a7133 8270 GetDefaultItem(self) -> Window
15afbcd0
RD
8271
8272 Get the default child of this parent, i.e. the one which is activated
8273 by pressing <Enter> such as the OK button on a wx.Dialog.
8274 """
54f9ee45 8275 return _core_.Window_GetDefaultItem(*args, **kwargs)
e811c8ce
RD
8276
8277 def SetDefaultItem(*args, **kwargs):
15afbcd0 8278 """
a95a7133 8279 SetDefaultItem(self, Window child) -> Window
15afbcd0
RD
8280
8281 Set this child as default, return the old default.
8282 """
54f9ee45 8283 return _core_.Window_SetDefaultItem(*args, **kwargs)
e811c8ce
RD
8284
8285 def SetTmpDefaultItem(*args, **kwargs):
15afbcd0 8286 """
a95a7133 8287 SetTmpDefaultItem(self, Window win)
15afbcd0
RD
8288
8289 Set this child as temporary default
8290 """
54f9ee45 8291 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
e811c8ce 8292
908b74cd
RD
8293 def Navigate(*args, **kwargs):
8294 """
8295 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8296
fd2dc343
RD
8297 Does keyboard navigation from this window to another, by sending a
8298 `wx.NavigationKeyEvent`.
908b74cd
RD
8299 """
8300 return _core_.Window_Navigate(*args, **kwargs)
8301
7f98d120
RD
8302 def MoveAfterInTabOrder(*args, **kwargs):
8303 """
8304 MoveAfterInTabOrder(self, Window win)
8305
8306 Moves this window in the tab navigation order after the specified
8307 sibling window. This means that when the user presses the TAB key on
8308 that other window, the focus switches to this window.
8309
8310 The default tab order is the same as creation order. This function
8311 and `MoveBeforeInTabOrder` allow to change it after creating all the
8312 windows.
8313
8314 """
8315 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8316
8317 def MoveBeforeInTabOrder(*args, **kwargs):
8318 """
8319 MoveBeforeInTabOrder(self, Window win)
8320
8321 Same as `MoveAfterInTabOrder` except that it inserts this window just
8322 before win instead of putting it right after it.
8323 """
8324 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8325
e811c8ce 8326 def GetChildren(*args, **kwargs):
15afbcd0 8327 """
a95a7133 8328 GetChildren(self) -> PyObject
15afbcd0
RD
8329
8330 Returns a list of the window's children. NOTE: Currently this is a
8331 copy of the child window list maintained by the window, so the return
8332 value of this function is only valid as long as the window's children
8333 do not change.
8334 """
54f9ee45 8335 return _core_.Window_GetChildren(*args, **kwargs)
e811c8ce
RD
8336
8337 def GetParent(*args, **kwargs):
15afbcd0 8338 """
a95a7133 8339 GetParent(self) -> Window
15afbcd0
RD
8340
8341 Returns the parent window of this window, or None if there isn't one.
8342 """
54f9ee45 8343 return _core_.Window_GetParent(*args, **kwargs)
e811c8ce
RD
8344
8345 def GetGrandParent(*args, **kwargs):
15afbcd0 8346 """
a95a7133 8347 GetGrandParent(self) -> Window
15afbcd0 8348
41e2b43e
RD
8349 Returns the parent of the parent of this window, or None if there
8350 isn't one.
15afbcd0 8351 """
54f9ee45 8352 return _core_.Window_GetGrandParent(*args, **kwargs)
e811c8ce
RD
8353
8354 def IsTopLevel(*args, **kwargs):
15afbcd0 8355 """
a95a7133 8356 IsTopLevel(self) -> bool
15afbcd0
RD
8357
8358 Returns true if the given window is a top-level one. Currently all
8359 frames and dialogs are always considered to be top-level windows (even
8360 if they have a parent window).
8361 """
54f9ee45 8362 return _core_.Window_IsTopLevel(*args, **kwargs)
e811c8ce
RD
8363
8364 def Reparent(*args, **kwargs):
15afbcd0 8365 """
a95a7133 8366 Reparent(self, Window newParent) -> bool
15afbcd0
RD
8367
8368 Reparents the window, i.e the window will be removed from its current
8369 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8370 re-inserted into another. Available on Windows and GTK. Returns True
8371 if the parent was changed, False otherwise (error or newParent ==
8372 oldParent)
8373 """
54f9ee45 8374 return _core_.Window_Reparent(*args, **kwargs)
e811c8ce
RD
8375
8376 def AddChild(*args, **kwargs):
15afbcd0 8377 """
a95a7133 8378 AddChild(self, Window child)
15afbcd0
RD
8379
8380 Adds a child window. This is called automatically by window creation
8381 functions so should not be required by the application programmer.
8382 """
54f9ee45 8383 return _core_.Window_AddChild(*args, **kwargs)
e811c8ce
RD
8384
8385 def RemoveChild(*args, **kwargs):
15afbcd0 8386 """
a95a7133 8387 RemoveChild(self, Window child)
15afbcd0
RD
8388
8389 Removes a child window. This is called automatically by window
8390 deletion functions so should not be required by the application
8391 programmer.
8392 """
54f9ee45 8393 return _core_.Window_RemoveChild(*args, **kwargs)
e811c8ce 8394
704eda0c
RD
8395 def SetDoubleBuffered(*args, **kwargs):
8396 """
8397 SetDoubleBuffered(self, bool on)
8398
8399 Currently wxGTK2 only.
8400 """
8401 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8402
e811c8ce 8403 def FindWindowById(*args, **kwargs):
15afbcd0 8404 """
a95a7133 8405 FindWindowById(self, long winid) -> Window
15afbcd0
RD
8406
8407 Find a chld of this window by window ID
8408 """
54f9ee45 8409 return _core_.Window_FindWindowById(*args, **kwargs)
e811c8ce
RD
8410
8411 def FindWindowByName(*args, **kwargs):
15afbcd0 8412 """
a95a7133 8413 FindWindowByName(self, String name) -> Window
15afbcd0
RD
8414
8415 Find a child of this window by name
8416 """
54f9ee45 8417 return _core_.Window_FindWindowByName(*args, **kwargs)
e811c8ce
RD
8418
8419 def GetEventHandler(*args, **kwargs):
15afbcd0 8420 """
a95a7133 8421 GetEventHandler(self) -> EvtHandler
15afbcd0
RD
8422
8423 Returns the event handler for this window. By default, the window is
8424 its own event handler.
8425 """
54f9ee45 8426 return _core_.Window_GetEventHandler(*args, **kwargs)
e811c8ce
RD
8427
8428 def SetEventHandler(*args, **kwargs):
15afbcd0 8429 """
a95a7133 8430 SetEventHandler(self, EvtHandler handler)
15afbcd0
RD
8431
8432 Sets the event handler for this window. An event handler is an object
8433 that is capable of processing the events sent to a window. By default,
8434 the window is its own event handler, but an application may wish to
8435 substitute another, for example to allow central implementation of
8436 event-handling for a variety of different window classes.
8437
41e2b43e 8438 It is usually better to use `wx.Window.PushEventHandler` since this sets
15afbcd0
RD
8439 up a chain of event handlers, where an event not handled by one event
8440 handler is handed to the next one in the chain.
8441 """
54f9ee45 8442 return _core_.Window_SetEventHandler(*args, **kwargs)
e811c8ce
RD
8443
8444 def PushEventHandler(*args, **kwargs):
15afbcd0 8445 """
a95a7133 8446 PushEventHandler(self, EvtHandler handler)
15afbcd0
RD
8447
8448 Pushes this event handler onto the event handler stack for the window.
8449 An event handler is an object that is capable of processing the events
8450 sent to a window. By default, the window is its own event handler, but
8451 an application may wish to substitute another, for example to allow
8452 central implementation of event-handling for a variety of different
8453 window classes.
8454
8455 wx.Window.PushEventHandler allows an application to set up a chain of
8456 event handlers, where an event not handled by one event handler is
41e2b43e 8457 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
15afbcd0
RD
8458 remove the event handler.
8459 """
54f9ee45 8460 return _core_.Window_PushEventHandler(*args, **kwargs)
e811c8ce
RD
8461
8462 def PopEventHandler(*args, **kwargs):
15afbcd0 8463 """
a95a7133 8464 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
15afbcd0
RD
8465
8466 Removes and returns the top-most event handler on the event handler
8467 stack. If deleteHandler is True then the wx.EvtHandler object will be
8468 destroyed after it is popped.
8469 """
54f9ee45 8470 return _core_.Window_PopEventHandler(*args, **kwargs)
e811c8ce
RD
8471
8472 def RemoveEventHandler(*args, **kwargs):
15afbcd0 8473 """
a95a7133 8474 RemoveEventHandler(self, EvtHandler handler) -> bool
15afbcd0 8475
41e2b43e
RD
8476 Find the given handler in the event handler chain and remove (but not
8477 delete) it from the event handler chain, return True if it was found
8478 and False otherwise (this also results in an assert failure so this
8479 function should only be called when the handler is supposed to be
8480 there.)
15afbcd0 8481 """
54f9ee45 8482 return _core_.Window_RemoveEventHandler(*args, **kwargs)
e811c8ce
RD
8483
8484 def SetValidator(*args, **kwargs):
15afbcd0 8485 """
a95a7133 8486 SetValidator(self, Validator validator)
15afbcd0
RD
8487
8488 Deletes the current validator (if any) and sets the window validator,
8489 having called wx.Validator.Clone to create a new validator of this
8490 type.
8491 """
54f9ee45 8492 return _core_.Window_SetValidator(*args, **kwargs)
e811c8ce
RD
8493
8494 def GetValidator(*args, **kwargs):
15afbcd0 8495 """
a95a7133 8496 GetValidator(self) -> Validator
15afbcd0
RD
8497
8498 Returns a pointer to the current validator for the window, or None if
8499 there is none.
8500 """
54f9ee45 8501 return _core_.Window_GetValidator(*args, **kwargs)
e811c8ce 8502
74a57fcd
RD
8503 def Validate(*args, **kwargs):
8504 """
a95a7133 8505 Validate(self) -> bool
74a57fcd
RD
8506
8507 Validates the current values of the child controls using their
41e2b43e
RD
8508 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8509 style flag set, the method will also call Validate() of all child
8510 windows. Returns false if any of the validations failed.
74a57fcd 8511 """
54f9ee45 8512 return _core_.Window_Validate(*args, **kwargs)
74a57fcd
RD
8513
8514 def TransferDataToWindow(*args, **kwargs):
8515 """
a95a7133 8516 TransferDataToWindow(self) -> bool
74a57fcd 8517
41e2b43e
RD
8518 Transfers values to child controls from data areas specified by their
8519 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8520 style flag set, the method will also call TransferDataToWindow() of
8521 all child windows.
74a57fcd 8522 """
54f9ee45 8523 return _core_.Window_TransferDataToWindow(*args, **kwargs)
74a57fcd
RD
8524
8525 def TransferDataFromWindow(*args, **kwargs):
8526 """
a95a7133 8527 TransferDataFromWindow(self) -> bool
74a57fcd 8528
41e2b43e
RD
8529 Transfers values from child controls to data areas specified by their
8530 validators. Returns false if a transfer failed. If the window has
8531 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8532 also call TransferDataFromWindow() of all child windows.
74a57fcd 8533 """
54f9ee45 8534 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
74a57fcd
RD
8535
8536 def InitDialog(*args, **kwargs):
8537 """
a95a7133 8538 InitDialog(self)
74a57fcd 8539
41e2b43e
RD
8540 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8541 to the dialog via validators.
74a57fcd 8542 """
54f9ee45 8543 return _core_.Window_InitDialog(*args, **kwargs)
74a57fcd 8544
e811c8ce 8545 def SetAcceleratorTable(*args, **kwargs):
15afbcd0 8546 """
a95a7133 8547 SetAcceleratorTable(self, AcceleratorTable accel)
15afbcd0
RD
8548
8549 Sets the accelerator table for this window.
8550 """
54f9ee45 8551 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
8552
8553 def GetAcceleratorTable(*args, **kwargs):
15afbcd0 8554 """
a95a7133 8555 GetAcceleratorTable(self) -> AcceleratorTable
15afbcd0
RD
8556
8557 Gets the accelerator table for this window.
8558 """
54f9ee45 8559 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
8560
8561 def RegisterHotKey(*args, **kwargs):
15afbcd0 8562 """
a95a7133 8563 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
15afbcd0
RD
8564
8565 Registers a system wide hotkey. Every time the user presses the hotkey
8566 registered here, this window will receive a hotkey event. It will
8567 receive the event even if the application is in the background and
8568 does not have the input focus because the user is working with some
8569 other application. To bind an event handler function to this hotkey
8570 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8571 hotkey was registered successfully.
8572 """
54f9ee45 8573 return _core_.Window_RegisterHotKey(*args, **kwargs)
e811c8ce
RD
8574
8575 def UnregisterHotKey(*args, **kwargs):
15afbcd0 8576 """
a95a7133 8577 UnregisterHotKey(self, int hotkeyId) -> bool
15afbcd0
RD
8578
8579 Unregisters a system wide hotkey.
8580 """
54f9ee45 8581 return _core_.Window_UnregisterHotKey(*args, **kwargs)
e811c8ce
RD
8582
8583 def ConvertDialogPointToPixels(*args, **kwargs):
15afbcd0 8584 """
a95a7133 8585 ConvertDialogPointToPixels(self, Point pt) -> Point
15afbcd0
RD
8586
8587 Converts a point or size from dialog units to pixels. Dialog units
8588 are used for maintaining a dialog's proportions even if the font
8589 changes. For the x dimension, the dialog units are multiplied by the
8590 average character width and then divided by 4. For the y dimension,
8591 the dialog units are multiplied by the average character height and
8592 then divided by 8.
8593 """
54f9ee45 8594 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
e811c8ce
RD
8595
8596 def ConvertDialogSizeToPixels(*args, **kwargs):
15afbcd0 8597 """
a95a7133 8598 ConvertDialogSizeToPixels(self, Size sz) -> Size
15afbcd0
RD
8599
8600 Converts a point or size from dialog units to pixels. Dialog units
8601 are used for maintaining a dialog's proportions even if the font
8602 changes. For the x dimension, the dialog units are multiplied by the
8603 average character width and then divided by 4. For the y dimension,
8604 the dialog units are multiplied by the average character height and
8605 then divided by 8.
8606 """
54f9ee45 8607 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
e811c8ce
RD
8608
8609 def DLG_PNT(*args, **kwargs):
15afbcd0 8610 """
a95a7133 8611 DLG_PNT(self, Point pt) -> Point
15afbcd0
RD
8612
8613 Converts a point or size from dialog units to pixels. Dialog units
8614 are used for maintaining a dialog's proportions even if the font
8615 changes. For the x dimension, the dialog units are multiplied by the
8616 average character width and then divided by 4. For the y dimension,
8617 the dialog units are multiplied by the average character height and
8618 then divided by 8.
8619 """
54f9ee45 8620 return _core_.Window_DLG_PNT(*args, **kwargs)
e811c8ce
RD
8621
8622 def DLG_SZE(*args, **kwargs):
15afbcd0 8623 """
a95a7133 8624 DLG_SZE(self, Size sz) -> Size
15afbcd0
RD
8625
8626 Converts a point or size from dialog units to pixels. Dialog units
8627 are used for maintaining a dialog's proportions even if the font
8628 changes. For the x dimension, the dialog units are multiplied by the
8629 average character width and then divided by 4. For the y dimension,
8630 the dialog units are multiplied by the average character height and
8631 then divided by 8.
8632 """
54f9ee45 8633 return _core_.Window_DLG_SZE(*args, **kwargs)
e811c8ce
RD
8634
8635 def ConvertPixelPointToDialog(*args, **kwargs):
a95a7133 8636 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
54f9ee45 8637 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
e811c8ce
RD
8638
8639 def ConvertPixelSizeToDialog(*args, **kwargs):
a95a7133 8640 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
54f9ee45 8641 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
e811c8ce
RD
8642
8643 def WarpPointer(*args, **kwargs):
15afbcd0 8644 """
a95a7133 8645 WarpPointer(self, int x, int y)
15afbcd0
RD
8646
8647 Moves the pointer to the given position on the window.
8648
8649 NOTE: This function is not supported under Mac because Apple Human
8650 Interface Guidelines forbid moving the mouse cursor programmatically.
8651 """
54f9ee45 8652 return _core_.Window_WarpPointer(*args, **kwargs)
e811c8ce
RD
8653
8654 def CaptureMouse(*args, **kwargs):
15afbcd0 8655 """
a95a7133 8656 CaptureMouse(self)
15afbcd0
RD
8657
8658 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8659 release the capture.
8660
8661 Note that wxWindows maintains the stack of windows having captured the
8662 mouse and when the mouse is released the capture returns to the window
8663 which had had captured it previously and it is only really released if
8664 there were no previous window. In particular, this means that you must
8665 release the mouse as many times as you capture it.
8666 """
54f9ee45 8667 return _core_.Window_CaptureMouse(*args, **kwargs)
e811c8ce
RD
8668
8669 def ReleaseMouse(*args, **kwargs):
15afbcd0 8670 """
a95a7133 8671 ReleaseMouse(self)
15afbcd0
RD
8672
8673 Releases mouse input captured with wx.Window.CaptureMouse.
8674 """
54f9ee45 8675 return _core_.Window_ReleaseMouse(*args, **kwargs)
e811c8ce
RD
8676
8677 def GetCapture(*args, **kwargs):
15afbcd0 8678 """
66c033b4 8679 GetCapture() -> Window
15afbcd0
RD
8680
8681 Returns the window which currently captures the mouse or None
8682 """
54f9ee45 8683 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce
RD
8684
8685 GetCapture = staticmethod(GetCapture)
8686 def HasCapture(*args, **kwargs):
15afbcd0 8687 """
a95a7133 8688 HasCapture(self) -> bool
15afbcd0
RD
8689
8690 Returns true if this window has the current mouse capture.
8691 """
54f9ee45 8692 return _core_.Window_HasCapture(*args, **kwargs)
e811c8ce
RD
8693
8694 def Refresh(*args, **kwargs):
15afbcd0 8695 """
a95a7133 8696 Refresh(self, bool eraseBackground=True, Rect rect=None)
15afbcd0
RD
8697
8698 Mark the specified rectangle (or the whole window) as "dirty" so it
8699 will be repainted. Causes an EVT_PAINT event to be generated and sent
8700 to the window.
8701 """
54f9ee45 8702 return _core_.Window_Refresh(*args, **kwargs)
e811c8ce
RD
8703
8704 def RefreshRect(*args, **kwargs):
15afbcd0 8705 """
fef4c27a 8706 RefreshRect(self, Rect rect, bool eraseBackground=True)
15afbcd0
RD
8707
8708 Redraws the contents of the given rectangle: the area inside it will
8709 be repainted. This is the same as Refresh but has a nicer syntax.
8710 """
54f9ee45 8711 return _core_.Window_RefreshRect(*args, **kwargs)
e811c8ce
RD
8712
8713 def Update(*args, **kwargs):
15afbcd0 8714 """
a95a7133 8715 Update(self)
15afbcd0
RD
8716
8717 Calling this method immediately repaints the invalidated area of the
8718 window instead of waiting for the EVT_PAINT event to happen, (normally
8719 this would usually only happen when the flow of control returns to the
8720 event loop.) Notice that this function doesn't refresh the window and
8721 does nothing if the window has been already repainted. Use Refresh
8722 first if you want to immediately redraw the window (or some portion of
8723 it) unconditionally.
8724 """
54f9ee45 8725 return _core_.Window_Update(*args, **kwargs)
e811c8ce
RD
8726
8727 def ClearBackground(*args, **kwargs):
15afbcd0 8728 """
a95a7133 8729 ClearBackground(self)
15afbcd0
RD
8730
8731 Clears the window by filling it with the current background
8732 colour. Does not cause an erase background event to be generated.
8733 """
54f9ee45 8734 return _core_.Window_ClearBackground(*args, **kwargs)
e811c8ce
RD
8735
8736 def Freeze(*args, **kwargs):
15afbcd0 8737 """
a95a7133 8738 Freeze(self)
15afbcd0 8739
41e2b43e
RD
8740 Freezes the window or, in other words, prevents any updates from
8741 taking place on screen, the window is not redrawn at all. Thaw must be
8742 called to reenable window redrawing. Calls to Freeze/Thaw may be
8743 nested, with the actual Thaw being delayed until all the nesting has
8744 been undone.
15afbcd0
RD
8745
8746 This method is useful for visual appearance optimization (for example,
8747 it is a good idea to use it before inserting large amount of text into
8748 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8749 for all controls so it is mostly just a hint to wxWindows and not a
8750 mandatory directive.
8751 """
54f9ee45 8752 return _core_.Window_Freeze(*args, **kwargs)
e811c8ce
RD
8753
8754 def Thaw(*args, **kwargs):
15afbcd0 8755 """
a95a7133 8756 Thaw(self)
15afbcd0 8757
4276dc52 8758 Reenables window updating after a previous call to Freeze. Calls to
41e2b43e
RD
8759 Freeze/Thaw may be nested, so Thaw must be called the same number of
8760 times that Freeze was before the window will be updated.
15afbcd0 8761 """
54f9ee45 8762 return _core_.Window_Thaw(*args, **kwargs)
e811c8ce
RD
8763
8764 def PrepareDC(*args, **kwargs):
15afbcd0 8765 """
a95a7133 8766 PrepareDC(self, DC dc)
15afbcd0
RD
8767
8768 Call this function to prepare the device context for drawing a
8769 scrolled image. It sets the device origin according to the current
8770 scroll position.
8771 """
54f9ee45 8772 return _core_.Window_PrepareDC(*args, **kwargs)
e811c8ce
RD
8773
8774 def GetUpdateRegion(*args, **kwargs):
15afbcd0 8775 """
a95a7133 8776 GetUpdateRegion(self) -> Region
15afbcd0
RD
8777
8778 Returns the region specifying which parts of the window have been
8779 damaged. Should only be called within an EVT_PAINT handler.
8780 """
54f9ee45 8781 return _core_.Window_GetUpdateRegion(*args, **kwargs)
e811c8ce
RD
8782
8783 def GetUpdateClientRect(*args, **kwargs):
15afbcd0 8784 """
a95a7133 8785 GetUpdateClientRect(self) -> Rect
15afbcd0
RD
8786
8787 Get the update rectangle region bounding box in client coords.
8788 """
54f9ee45 8789 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
e811c8ce
RD
8790
8791 def IsExposed(*args, **kwargs):
15afbcd0 8792 """
a95a7133 8793 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
15afbcd0
RD
8794
8795 Returns true if the given point or rectangle area has been exposed
8796 since the last repaint. Call this in an paint event handler to
8797 optimize redrawing by only redrawing those areas, which have been
8798 exposed.
8799 """
54f9ee45 8800 return _core_.Window_IsExposed(*args, **kwargs)
e811c8ce
RD
8801
8802 def IsExposedPoint(*args, **kwargs):
15afbcd0 8803 """
a95a7133 8804 IsExposedPoint(self, Point pt) -> bool
15afbcd0
RD
8805
8806 Returns true if the given point or rectangle area has been exposed
8807 since the last repaint. Call this in an paint event handler to
8808 optimize redrawing by only redrawing those areas, which have been
8809 exposed.
8810 """
54f9ee45 8811 return _core_.Window_IsExposedPoint(*args, **kwargs)
e811c8ce 8812
4276dc52 8813 def IsExposedRect(*args, **kwargs):
15afbcd0 8814 """
a95a7133 8815 IsExposedRect(self, Rect rect) -> bool
15afbcd0
RD
8816
8817 Returns true if the given point or rectangle area has been exposed
8818 since the last repaint. Call this in an paint event handler to
8819 optimize redrawing by only redrawing those areas, which have been
8820 exposed.
8821 """
54f9ee45 8822 return _core_.Window_IsExposedRect(*args, **kwargs)
e811c8ce 8823
74a57fcd
RD
8824 def GetDefaultAttributes(*args, **kwargs):
8825 """
a95a7133 8826 GetDefaultAttributes(self) -> VisualAttributes
74a57fcd 8827
41e2b43e
RD
8828 Get the default attributes for an instance of this class. This is
8829 useful if you want to use the same font or colour in your own control
8830 as in a standard control -- which is a much better idea than hard
8831 coding specific colours or fonts which might look completely out of
db3e571a 8832 place on the user's system, especially if it uses themes.
74a57fcd 8833 """
54f9ee45 8834 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
74a57fcd
RD
8835
8836 def GetClassDefaultAttributes(*args, **kwargs):
8837 """
66c033b4 8838 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
74a57fcd 8839
41e2b43e
RD
8840 Get the default attributes for this class. This is useful if you want
8841 to use the same font or colour in your own control as in a standard
8842 control -- which is a much better idea than hard coding specific
db3e571a
RD
8843 colours or fonts which might look completely out of place on the
8844 user's system, especially if it uses themes.
74a57fcd
RD
8845
8846 The variant parameter is only relevant under Mac currently and is
41e2b43e 8847 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
8848 the returned font. See `wx.Window.SetWindowVariant` for more about
8849 this.
74a57fcd 8850 """
54f9ee45 8851 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
8852
8853 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
e811c8ce 8854 def SetBackgroundColour(*args, **kwargs):
15afbcd0 8855 """
a95a7133 8856 SetBackgroundColour(self, Colour colour) -> bool
15afbcd0
RD
8857
8858 Sets the background colour of the window. Returns True if the colour
8859 was changed. The background colour is usually painted by the default
8860 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
8861 automatically under GTK. Using `wx.NullColour` will reset the window
8862 to the default background colour.
15afbcd0 8863
db3e571a 8864 Note that setting the background colour may not cause an immediate
f8167d6e 8865 refresh, so you may wish to call `ClearBackground` or `Refresh` after
15afbcd0
RD
8866 calling this function.
8867
f8167d6e
RD
8868 Using this function will disable attempts to use themes for this
8869 window, if the system supports them. Use with care since usually the
8870 themes represent the appearance chosen by the user to be used for all
8871 applications on the system.
15afbcd0 8872 """
54f9ee45 8873 return _core_.Window_SetBackgroundColour(*args, **kwargs)
e811c8ce 8874
412d302d
RD
8875 def SetOwnBackgroundColour(*args, **kwargs):
8876 """SetOwnBackgroundColour(self, Colour colour)"""
8877 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
b2df227b 8878
e811c8ce 8879 def SetForegroundColour(*args, **kwargs):
15afbcd0 8880 """
a95a7133 8881 SetForegroundColour(self, Colour colour) -> bool
15afbcd0
RD
8882
8883 Sets the foreground colour of the window. Returns True is the colour
8884 was changed. The interpretation of foreground colour is dependent on
8885 the window class; it may be the text colour or other colour, or it may
8886 not be used at all.
8887 """
54f9ee45 8888 return _core_.Window_SetForegroundColour(*args, **kwargs)
e811c8ce 8889
fa47d7a7
VS
8890 def SetOwnForegroundColour(*args, **kwargs):
8891 """SetOwnForegroundColour(self, Colour colour)"""
8892 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
b2df227b 8893
e811c8ce 8894 def GetBackgroundColour(*args, **kwargs):
15afbcd0 8895 """
a95a7133 8896 GetBackgroundColour(self) -> Colour
15afbcd0
RD
8897
8898 Returns the background colour of the window.
8899 """
54f9ee45 8900 return _core_.Window_GetBackgroundColour(*args, **kwargs)
e811c8ce
RD
8901
8902 def GetForegroundColour(*args, **kwargs):
15afbcd0 8903 """
a95a7133 8904 GetForegroundColour(self) -> Colour
15afbcd0
RD
8905
8906 Returns the foreground colour of the window. The interpretation of
8907 foreground colour is dependent on the window class; it may be the text
8908 colour or other colour, or it may not be used at all.
8909 """
54f9ee45 8910 return _core_.Window_GetForegroundColour(*args, **kwargs)
e811c8ce 8911
562ecc31
RD
8912 def InheritsBackgroundColour(*args, **kwargs):
8913 """InheritsBackgroundColour(self) -> bool"""
8914 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
8915
8916 def UseBgCol(*args, **kwargs):
8917 """UseBgCol(self) -> bool"""
8918 return _core_.Window_UseBgCol(*args, **kwargs)
8919
7bc1e663
RD
8920 def SetBackgroundStyle(*args, **kwargs):
8921 """
8922 SetBackgroundStyle(self, int style) -> bool
8923
8924 Returns the background style of the window. The background style
8925 indicates how the background of the window is drawn.
8926
8927 ====================== ========================================
8928 wx.BG_STYLE_SYSTEM The background colour or pattern should
8929 be determined by the system
8930 wx.BG_STYLE_COLOUR The background should be a solid colour
8931 wx.BG_STYLE_CUSTOM The background will be implemented by the
8932 application.
8933 ====================== ========================================
8934
8935 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8936 a custom background, such as a tiled bitmap. Currently the style has
8937 no effect on other platforms.
8938
8939 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8940 """
8941 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
8942
8943 def GetBackgroundStyle(*args, **kwargs):
8944 """
8945 GetBackgroundStyle(self) -> int
8946
8947 Returns the background style of the window.
8948
8949 :see: `SetBackgroundStyle`
8950 """
8951 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
8952
51b83b37
RD
8953 def HasTransparentBackground(*args, **kwargs):
8954 """
8955 HasTransparentBackground(self) -> bool
8956
8957 Returns True if this window's background is transparent (as, for
8958 example, for `wx.StaticText`) and should show the parent window's
8959 background.
8960
8961 This method is mostly used internally by the library itself and you
8962 normally shouldn't have to call it. You may, however, have to override
8963 it in your custom control classes to ensure that background is painted
8964 correctly.
8965 """
8966 return _core_.Window_HasTransparentBackground(*args, **kwargs)
8967
e811c8ce 8968 def SetCursor(*args, **kwargs):
15afbcd0 8969 """
a95a7133 8970 SetCursor(self, Cursor cursor) -> bool
15afbcd0
RD
8971
8972 Sets the window's cursor. Notice that the window cursor also sets it
8973 for the children of the window implicitly.
8974
8975 The cursor may be wx.NullCursor in which case the window cursor will
8976 be reset back to default.
8977 """
54f9ee45 8978 return _core_.Window_SetCursor(*args, **kwargs)
e811c8ce
RD
8979
8980 def GetCursor(*args, **kwargs):
15afbcd0 8981 """
a95a7133 8982 GetCursor(self) -> Cursor
15afbcd0
RD
8983
8984 Return the cursor associated with this window.
8985 """
54f9ee45 8986 return _core_.Window_GetCursor(*args, **kwargs)
e811c8ce
RD
8987
8988 def SetFont(*args, **kwargs):
15afbcd0 8989 """
a95a7133 8990 SetFont(self, Font font) -> bool
15afbcd0
RD
8991
8992 Sets the font for this window.
8993 """
54f9ee45 8994 return _core_.Window_SetFont(*args, **kwargs)
e811c8ce 8995
fa47d7a7
VS
8996 def SetOwnFont(*args, **kwargs):
8997 """SetOwnFont(self, Font font)"""
8998 return _core_.Window_SetOwnFont(*args, **kwargs)
b2df227b 8999
e811c8ce 9000 def GetFont(*args, **kwargs):
15afbcd0 9001 """
a95a7133 9002 GetFont(self) -> Font
15afbcd0 9003
4276dc52 9004 Returns the default font used for this window.
15afbcd0 9005 """
54f9ee45 9006 return _core_.Window_GetFont(*args, **kwargs)
e811c8ce
RD
9007
9008 def SetCaret(*args, **kwargs):
15afbcd0 9009 """
a95a7133 9010 SetCaret(self, Caret caret)
15afbcd0
RD
9011
9012 Sets the caret associated with the window.
9013 """
54f9ee45 9014 return _core_.Window_SetCaret(*args, **kwargs)
e811c8ce
RD
9015
9016 def GetCaret(*args, **kwargs):
15afbcd0 9017 """
a95a7133 9018 GetCaret(self) -> Caret
15afbcd0
RD
9019
9020 Returns the caret associated with the window.
9021 """
54f9ee45 9022 return _core_.Window_GetCaret(*args, **kwargs)
e811c8ce
RD
9023
9024 def GetCharHeight(*args, **kwargs):
15afbcd0 9025 """
a95a7133 9026 GetCharHeight(self) -> int
15afbcd0
RD
9027
9028 Get the (average) character size for the current font.
9029 """
54f9ee45 9030 return _core_.Window_GetCharHeight(*args, **kwargs)
e811c8ce
RD
9031
9032 def GetCharWidth(*args, **kwargs):
15afbcd0 9033 """
a95a7133 9034 GetCharWidth(self) -> int
15afbcd0
RD
9035
9036 Get the (average) character size for the current font.
9037 """
54f9ee45 9038 return _core_.Window_GetCharWidth(*args, **kwargs)
e811c8ce
RD
9039
9040 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9041 """
9042 GetTextExtent(String string) -> (width, height)
9043
9044 Get the width and height of the text using the current font.
9045 """
54f9ee45 9046 return _core_.Window_GetTextExtent(*args, **kwargs)
e811c8ce
RD
9047
9048 def GetFullTextExtent(*args, **kwargs):
0df68c9f 9049 """
196addbf 9050 GetFullTextExtent(String string, Font font=None) ->
0df68c9f 9051 (width, height, descent, externalLeading)
e811c8ce 9052
15afbcd0
RD
9053 Get the width, height, decent and leading of the text using the
9054 current or specified font.
0df68c9f 9055 """
54f9ee45 9056 return _core_.Window_GetFullTextExtent(*args, **kwargs)
e811c8ce
RD
9057
9058 def ClientToScreenXY(*args, **kwargs):
15afbcd0
RD
9059 """
9060 ClientToScreenXY(int x, int y) -> (x,y)
9061
9062 Converts to screen coordinates from coordinates relative to this window.
9063 """
54f9ee45 9064 return _core_.Window_ClientToScreenXY(*args, **kwargs)
e811c8ce
RD
9065
9066 def ScreenToClientXY(*args, **kwargs):
15afbcd0
RD
9067 """
9068 ScreenToClientXY(int x, int y) -> (x,y)
9069
9070 Converts from screen to client window coordinates.
9071 """
54f9ee45 9072 return _core_.Window_ScreenToClientXY(*args, **kwargs)
e811c8ce
RD
9073
9074 def ClientToScreen(*args, **kwargs):
15afbcd0 9075 """
a95a7133 9076 ClientToScreen(self, Point pt) -> Point
15afbcd0
RD
9077
9078 Converts to screen coordinates from coordinates relative to this window.
9079 """
54f9ee45 9080 return _core_.Window_ClientToScreen(*args, **kwargs)
e811c8ce
RD
9081
9082 def ScreenToClient(*args, **kwargs):
15afbcd0 9083 """
a95a7133 9084 ScreenToClient(self, Point pt) -> Point
15afbcd0
RD
9085
9086 Converts from screen to client window coordinates.
9087 """
54f9ee45 9088 return _core_.Window_ScreenToClient(*args, **kwargs)
e811c8ce
RD
9089
9090 def HitTestXY(*args, **kwargs):
15afbcd0 9091 """
a95a7133 9092 HitTestXY(self, int x, int y) -> int
15afbcd0
RD
9093
9094 Test where the given (in client coords) point lies
9095 """
54f9ee45 9096 return _core_.Window_HitTestXY(*args, **kwargs)
e811c8ce
RD
9097
9098 def HitTest(*args, **kwargs):
15afbcd0 9099 """
a95a7133 9100 HitTest(self, Point pt) -> int
15afbcd0
RD
9101
9102 Test where the given (in client coords) point lies
9103 """
54f9ee45 9104 return _core_.Window_HitTest(*args, **kwargs)
e811c8ce 9105
15afbcd0
RD
9106 def GetBorder(*args):
9107 """
a95a7133
RD
9108 GetBorder(self, long flags) -> int
9109 GetBorder(self) -> int
e811c8ce 9110
15afbcd0
RD
9111 Get border for the flags of this window
9112 """
54f9ee45 9113 return _core_.Window_GetBorder(*args)
e811c8ce
RD
9114
9115 def UpdateWindowUI(*args, **kwargs):
15afbcd0 9116 """
a95a7133 9117 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
15afbcd0
RD
9118
9119 This function sends EVT_UPDATE_UI events to the window. The particular
9120 implementation depends on the window; for example a wx.ToolBar will
9121 send an update UI event for each toolbar button, and a wx.Frame will
9122 send an update UI event for each menubar menu item. You can call this
9123 function from your application to ensure that your UI is up-to-date at
9124 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9125 concerned). This may be necessary if you have called
5ba5649b 9126 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
15afbcd0
RD
9127 limit the overhead that wxWindows incurs by sending update UI events
9128 in idle time.
15afbcd0 9129 """
54f9ee45 9130 return _core_.Window_UpdateWindowUI(*args, **kwargs)
e811c8ce
RD
9131
9132 def PopupMenuXY(*args, **kwargs):
15afbcd0 9133 """
b0503257 9134 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
15afbcd0 9135
b0503257
RD
9136 Pops up the given menu at the specified coordinates, relative to this window,
9137 and returns control when the user has dismissed the menu. If a menu item is
9138 selected, the corresponding menu event is generated and will be processed as
9139 usual. If the default position is given then the current position of the
9140 mouse cursor will be used.
15afbcd0 9141 """
54f9ee45 9142 return _core_.Window_PopupMenuXY(*args, **kwargs)
e811c8ce 9143
15afbcd0
RD
9144 def PopupMenu(*args, **kwargs):
9145 """
b0503257 9146 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
15afbcd0 9147
b0503257
RD
9148 Pops up the given menu at the specified coordinates, relative to this window,
9149 and returns control when the user has dismissed the menu. If a menu item is
9150 selected, the corresponding menu event is generated and will be processed as
9151 usual. If the default position is given then the current position of the
9152 mouse cursor will be used.
15afbcd0 9153 """
54f9ee45 9154 return _core_.Window_PopupMenu(*args, **kwargs)
15afbcd0
RD
9155
9156 def GetHandle(*args, **kwargs):
9157 """
a95a7133 9158 GetHandle(self) -> long
15afbcd0
RD
9159
9160 Returns the platform-specific handle (as a long integer) of the
9161 physical window. Currently on wxMac it returns the handle of the
9162 toplevel parent of the window.
9163 """
54f9ee45 9164 return _core_.Window_GetHandle(*args, **kwargs)
15afbcd0 9165
7e63a440
RD
9166 def AssociateHandle(*args, **kwargs):
9167 """
9168 AssociateHandle(self, long handle)
9169
9170 Associate the window with a new native handle
9171 """
9172 return _core_.Window_AssociateHandle(*args, **kwargs)
9173
9174 def DissociateHandle(*args, **kwargs):
9175 """
9176 DissociateHandle(self)
9177
9178 Dissociate the current native handle from the window
9179 """
9180 return _core_.Window_DissociateHandle(*args, **kwargs)
9181
15afbcd0
RD
9182 def HasScrollbar(*args, **kwargs):
9183 """
a95a7133 9184 HasScrollbar(self, int orient) -> bool
15afbcd0
RD
9185
9186 Does the window have the scrollbar for this orientation?
9187 """
54f9ee45 9188 return _core_.Window_HasScrollbar(*args, **kwargs)
15afbcd0
RD
9189
9190 def SetScrollbar(*args, **kwargs):
9191 """
41e2b43e 9192 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
15afbcd0
RD
9193 bool refresh=True)
9194
9195 Sets the scrollbar properties of a built-in scrollbar.
15afbcd0 9196 """
54f9ee45 9197 return _core_.Window_SetScrollbar(*args, **kwargs)
e811c8ce
RD
9198
9199 def SetScrollPos(*args, **kwargs):
15afbcd0 9200 """
a95a7133 9201 SetScrollPos(self, int orientation, int pos, bool refresh=True)
15afbcd0
RD
9202
9203 Sets the position of one of the built-in scrollbars.
9204 """
54f9ee45 9205 return _core_.Window_SetScrollPos(*args, **kwargs)
e811c8ce
RD
9206
9207 def GetScrollPos(*args, **kwargs):
15afbcd0 9208 """
a95a7133 9209 GetScrollPos(self, int orientation) -> int
15afbcd0
RD
9210
9211 Returns the built-in scrollbar position.
9212 """
54f9ee45 9213 return _core_.Window_GetScrollPos(*args, **kwargs)
e811c8ce
RD
9214
9215 def GetScrollThumb(*args, **kwargs):
15afbcd0 9216 """
a95a7133 9217 GetScrollThumb(self, int orientation) -> int
15afbcd0
RD
9218
9219 Returns the built-in scrollbar thumb size.
9220 """
54f9ee45 9221 return _core_.Window_GetScrollThumb(*args, **kwargs)
e811c8ce
RD
9222
9223 def GetScrollRange(*args, **kwargs):
15afbcd0 9224 """
a95a7133 9225 GetScrollRange(self, int orientation) -> int
15afbcd0
RD
9226
9227 Returns the built-in scrollbar range.
9228 """
54f9ee45 9229 return _core_.Window_GetScrollRange(*args, **kwargs)
e811c8ce
RD
9230
9231 def ScrollWindow(*args, **kwargs):
15afbcd0 9232 """
a95a7133 9233 ScrollWindow(self, int dx, int dy, Rect rect=None)
15afbcd0
RD
9234
9235 Physically scrolls the pixels in the window and move child windows
9236 accordingly. Use this function to optimise your scrolling
9237 implementations, to minimise the area that must be redrawn. Note that
9238 it is rarely required to call this function from a user program.
15afbcd0 9239 """
54f9ee45 9240 return _core_.Window_ScrollWindow(*args, **kwargs)
e811c8ce
RD
9241
9242 def ScrollLines(*args, **kwargs):
15afbcd0 9243 """
a95a7133 9244 ScrollLines(self, int lines) -> bool
15afbcd0
RD
9245
9246 If the platform and window class supports it, scrolls the window by
9247 the given number of lines down, if lines is positive, or up if lines
9248 is negative. Returns True if the window was scrolled, False if it was
9249 already on top/bottom and nothing was done.
9250 """
54f9ee45 9251 return _core_.Window_ScrollLines(*args, **kwargs)
e811c8ce
RD
9252
9253 def ScrollPages(*args, **kwargs):
15afbcd0 9254 """
a95a7133 9255 ScrollPages(self, int pages) -> bool
15afbcd0 9256
41e2b43e 9257 If the platform and window class supports it, scrolls the window by
15afbcd0
RD
9258 the given number of pages down, if pages is positive, or up if pages
9259 is negative. Returns True if the window was scrolled, False if it was
9260 already on top/bottom and nothing was done.
9261 """
54f9ee45 9262 return _core_.Window_ScrollPages(*args, **kwargs)
e811c8ce
RD
9263
9264 def LineUp(*args, **kwargs):
15afbcd0 9265 """
a95a7133 9266 LineUp(self) -> bool
15afbcd0
RD
9267
9268 This is just a wrapper for ScrollLines(-1).
9269 """
54f9ee45 9270 return _core_.Window_LineUp(*args, **kwargs)
e811c8ce
RD
9271
9272 def LineDown(*args, **kwargs):
15afbcd0 9273 """
a95a7133 9274 LineDown(self) -> bool
15afbcd0
RD
9275
9276 This is just a wrapper for ScrollLines(1).
9277 """
54f9ee45 9278 return _core_.Window_LineDown(*args, **kwargs)
e811c8ce
RD
9279
9280 def PageUp(*args, **kwargs):
15afbcd0 9281 """
a95a7133 9282 PageUp(self) -> bool
15afbcd0
RD
9283
9284 This is just a wrapper for ScrollPages(-1).
9285 """
54f9ee45 9286 return _core_.Window_PageUp(*args, **kwargs)
e811c8ce
RD
9287
9288 def PageDown(*args, **kwargs):
15afbcd0 9289 """
a95a7133 9290 PageDown(self) -> bool
15afbcd0
RD
9291
9292 This is just a wrapper for ScrollPages(1).
9293 """
54f9ee45 9294 return _core_.Window_PageDown(*args, **kwargs)
e811c8ce
RD
9295
9296 def SetHelpText(*args, **kwargs):
15afbcd0 9297 """
a95a7133 9298 SetHelpText(self, String text)
15afbcd0
RD
9299
9300 Sets the help text to be used as context-sensitive help for this
9301 window. Note that the text is actually stored by the current
f52cbe90 9302 `wx.HelpProvider` implementation, and not in the window object itself.
15afbcd0 9303 """
54f9ee45 9304 return _core_.Window_SetHelpText(*args, **kwargs)
e811c8ce
RD
9305
9306 def SetHelpTextForId(*args, **kwargs):
15afbcd0 9307 """
a95a7133 9308 SetHelpTextForId(self, String text)
15afbcd0
RD
9309
9310 Associate this help text with all windows with the same id as this
9311 one.
9312 """
54f9ee45 9313 return _core_.Window_SetHelpTextForId(*args, **kwargs)
e811c8ce
RD
9314
9315 def GetHelpText(*args, **kwargs):
15afbcd0 9316 """
a95a7133 9317 GetHelpText(self) -> String
15afbcd0
RD
9318
9319 Gets the help text to be used as context-sensitive help for this
9320 window. Note that the text is actually stored by the current
f52cbe90 9321 `wx.HelpProvider` implementation, and not in the window object itself.
15afbcd0 9322 """
54f9ee45 9323 return _core_.Window_GetHelpText(*args, **kwargs)
e811c8ce
RD
9324
9325 def SetToolTipString(*args, **kwargs):
15afbcd0 9326 """
a95a7133 9327 SetToolTipString(self, String tip)
15afbcd0
RD
9328
9329 Attach a tooltip to the window.
9330 """
54f9ee45 9331 return _core_.Window_SetToolTipString(*args, **kwargs)
e811c8ce
RD
9332
9333 def SetToolTip(*args, **kwargs):
15afbcd0 9334 """
a95a7133 9335 SetToolTip(self, ToolTip tip)
15afbcd0
RD
9336
9337 Attach a tooltip to the window.
9338 """
54f9ee45 9339 return _core_.Window_SetToolTip(*args, **kwargs)
e811c8ce
RD
9340
9341 def GetToolTip(*args, **kwargs):
15afbcd0 9342 """
a95a7133 9343 GetToolTip(self) -> ToolTip
15afbcd0
RD
9344
9345 get the associated tooltip or None if none
9346 """
54f9ee45 9347 return _core_.Window_GetToolTip(*args, **kwargs)
e811c8ce
RD
9348
9349 def SetDropTarget(*args, **kwargs):
15afbcd0 9350 """
a95a7133 9351 SetDropTarget(self, DropTarget dropTarget)
15afbcd0
RD
9352
9353 Associates a drop target with this window. If the window already has
9354 a drop target, it is deleted.
9355 """
54f9ee45 9356 return _core_.Window_SetDropTarget(*args, **kwargs)
e811c8ce
RD
9357
9358 def GetDropTarget(*args, **kwargs):
15afbcd0 9359 """
a95a7133 9360 GetDropTarget(self) -> DropTarget
15afbcd0
RD
9361
9362 Returns the associated drop target, which may be None.
9363 """
54f9ee45 9364 return _core_.Window_GetDropTarget(*args, **kwargs)
e811c8ce 9365
5ba5649b
RD
9366 def DragAcceptFiles(*args, **kwargs):
9367 """
9368 DragAcceptFiles(self, bool accept)
9369
9370 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9371 Only functional on Windows.
9372 """
9373 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9374
e811c8ce 9375 def SetConstraints(*args, **kwargs):
15afbcd0 9376 """
a95a7133 9377 SetConstraints(self, LayoutConstraints constraints)
15afbcd0
RD
9378
9379 Sets the window to have the given layout constraints. If an existing
9380 layout constraints object is already owned by the window, it will be
9381 deleted. Pass None to disassociate and delete the window's current
9382 constraints.
9383
9384 You must call SetAutoLayout to tell a window to use the constraints
9385 automatically in its default EVT_SIZE handler; otherwise, you must
9386 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9387 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9388 effect.
9389 """
54f9ee45 9390 return _core_.Window_SetConstraints(*args, **kwargs)
e811c8ce
RD
9391
9392 def GetConstraints(*args, **kwargs):
15afbcd0 9393 """
a95a7133 9394 GetConstraints(self) -> LayoutConstraints
15afbcd0
RD
9395
9396 Returns a pointer to the window's layout constraints, or None if there
9397 are none.
9398 """
54f9ee45 9399 return _core_.Window_GetConstraints(*args, **kwargs)
e811c8ce
RD
9400
9401 def SetAutoLayout(*args, **kwargs):
15afbcd0 9402 """
a95a7133 9403 SetAutoLayout(self, bool autoLayout)
15afbcd0
RD
9404
9405 Determines whether the Layout function will be called automatically
b1fcee84
RD
9406 when the window is resized. lease note that this only happens for the
9407 windows usually used to contain children, namely `wx.Panel` and
9408 `wx.TopLevelWindow` (and the classes deriving from them).
9409
9410 This method is called implicitly by `SetSizer` but if you use
9411 `SetConstraints` you should call it manually or otherwise the window
9412 layout won't be correctly updated when its size changes.
15afbcd0 9413 """
54f9ee45 9414 return _core_.Window_SetAutoLayout(*args, **kwargs)
e811c8ce
RD
9415
9416 def GetAutoLayout(*args, **kwargs):
15afbcd0 9417 """
a95a7133 9418 GetAutoLayout(self) -> bool
15afbcd0
RD
9419
9420 Returns the current autoLayout setting
9421 """
54f9ee45 9422 return _core_.Window_GetAutoLayout(*args, **kwargs)
e811c8ce
RD
9423
9424 def Layout(*args, **kwargs):
15afbcd0 9425 """
a95a7133 9426 Layout(self) -> bool
15afbcd0
RD
9427
9428 Invokes the constraint-based layout algorithm or the sizer-based
9429 algorithm for this window. See SetAutoLayout: when auto layout is on,
9430 this function gets called automatically by the default EVT_SIZE
9431 handler when the window is resized.
9432 """
54f9ee45 9433 return _core_.Window_Layout(*args, **kwargs)
e811c8ce
RD
9434
9435 def SetSizer(*args, **kwargs):
15afbcd0 9436 """
a95a7133 9437 SetSizer(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
9438
9439 Sets the window to have the given layout sizer. The window will then
9440 own the object, and will take care of its deletion. If an existing
9441 layout sizer object is already owned by the window, it will be deleted
9442 if the deleteOld parameter is true. Note that this function will also
9443 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 9444 non-None, and False otherwise.
15afbcd0 9445 """
54f9ee45 9446 return _core_.Window_SetSizer(*args, **kwargs)
e811c8ce
RD
9447
9448 def SetSizerAndFit(*args, **kwargs):
15afbcd0 9449 """
a95a7133 9450 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
9451
9452 The same as SetSizer, except it also sets the size hints for the
9453 window based on the sizer's minimum size.
9454 """
54f9ee45 9455 return _core_.Window_SetSizerAndFit(*args, **kwargs)
e811c8ce
RD
9456
9457 def GetSizer(*args, **kwargs):
15afbcd0 9458 """
a95a7133 9459 GetSizer(self) -> Sizer
15afbcd0
RD
9460
9461 Return the sizer associated with the window by a previous call to
9462 SetSizer or None if there isn't one.
9463 """
54f9ee45 9464 return _core_.Window_GetSizer(*args, **kwargs)
e811c8ce
RD
9465
9466 def SetContainingSizer(*args, **kwargs):
15afbcd0 9467 """
a95a7133 9468 SetContainingSizer(self, Sizer sizer)
15afbcd0
RD
9469
9470 This normally does not need to be called by application code. It is
9471 called internally when a window is added to a sizer, and is used so
9472 the window can remove itself from the sizer when it is destroyed.
9473 """
54f9ee45 9474 return _core_.Window_SetContainingSizer(*args, **kwargs)
e811c8ce
RD
9475
9476 def GetContainingSizer(*args, **kwargs):
15afbcd0 9477 """
a95a7133 9478 GetContainingSizer(self) -> Sizer
15afbcd0
RD
9479
9480 Return the sizer that this window is a member of, if any, otherwise None.
9481 """
54f9ee45 9482 return _core_.Window_GetContainingSizer(*args, **kwargs)
e811c8ce 9483
a95a7133
RD
9484 def InheritAttributes(*args, **kwargs):
9485 """
9486 InheritAttributes(self)
9487
41e2b43e
RD
9488 This function is (or should be, in case of custom controls) called
9489 during window creation to intelligently set up the window visual
9490 attributes, that is the font and the foreground and background
9491 colours.
9492
9493 By 'intelligently' the following is meant: by default, all windows use
9494 their own default attributes. However if some of the parent's
9495 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 9496 SetOwnFont) and if the corresponding attribute hadn't been
41e2b43e
RD
9497 explicitly set for this window itself, then this window takes the same
9498 value as used by the parent. In addition, if the window overrides
9499 ShouldInheritColours to return false, the colours will not be changed
9500 no matter what and only the font might.
9501
34621cc5 9502 This rather complicated logic is necessary in order to accommodate the
ec9b55ca 9503 different usage scenarios. The most common one is when all default
41e2b43e
RD
9504 attributes are used and in this case, nothing should be inherited as
9505 in modern GUIs different controls use different fonts (and colours)
9506 than their siblings so they can't inherit the same value from the
9507 parent. However it was also deemed desirable to allow to simply change
9508 the attributes of all children at once by just changing the font or
9509 colour of their common parent, hence in this case we do inherit the
9510 parents attributes.
9511
a95a7133 9512 """
54f9ee45 9513 return _core_.Window_InheritAttributes(*args, **kwargs)
a95a7133
RD
9514
9515 def ShouldInheritColours(*args, **kwargs):
9516 """
9517 ShouldInheritColours(self) -> bool
9518
9519 Return true from here to allow the colours of this window to be
41e2b43e
RD
9520 changed by InheritAttributes, returning false forbids inheriting them
9521 from the parent window.
a95a7133 9522
41e2b43e
RD
9523 The base class version returns false, but this method is overridden in
9524 wxControl where it returns true.
a95a7133 9525 """
54f9ee45 9526 return _core_.Window_ShouldInheritColours(*args, **kwargs)
a95a7133 9527
e811c8ce 9528 def PostCreate(self, pre):
15afbcd0
RD
9529 """
9530 Phase 3 of the 2-phase create <wink!>
9531 Call this method after precreating the window with the 2-phase create method.
9532 """
e811c8ce
RD
9533 self.this = pre.this
9534 self.thisown = pre.thisown
9535 pre.thisown = 0
9536 if hasattr(self, '_setOORInfo'):
9537 self._setOORInfo(self)
9538 if hasattr(self, '_setCallbackInfo'):
9539 self._setCallbackInfo(self, self.__class__)
9540
7e08d4ef
RD
9541 def SendSizeEvent(self):
9542 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9543
2131d850 9544_core_.Window_swigregister(Window)
e811c8ce
RD
9545
9546def PreWindow(*args, **kwargs):
15afbcd0
RD
9547 """
9548 PreWindow() -> Window
9549
9550 Precreate a Window for 2-phase creation.
9551 """
54f9ee45 9552 val = _core_.new_PreWindow(*args, **kwargs)
e811c8ce
RD
9553 return val
9554
0085ce49
RD
9555def Window_NewControlId(*args):
9556 """
15afbcd0
RD
9557 Window_NewControlId() -> int
9558
9559 Generate a control id for the controls which were not given one.
9560 """
0085ce49 9561 return _core_.Window_NewControlId(*args)
e811c8ce
RD
9562
9563def Window_NextControlId(*args, **kwargs):
0085ce49 9564 """
15afbcd0
RD
9565 Window_NextControlId(int winid) -> int
9566
9567 Get the id of the control following the one with the given
41e2b43e 9568 autogenerated) id
15afbcd0 9569 """
0085ce49 9570 return _core_.Window_NextControlId(*args, **kwargs)
e811c8ce
RD
9571
9572def Window_PrevControlId(*args, **kwargs):
0085ce49 9573 """
15afbcd0
RD
9574 Window_PrevControlId(int winid) -> int
9575
9576 Get the id of the control preceding the one with the given
41e2b43e 9577 autogenerated) id
15afbcd0 9578 """
0085ce49 9579 return _core_.Window_PrevControlId(*args, **kwargs)
e811c8ce 9580
0085ce49
RD
9581def Window_FindFocus(*args):
9582 """
15afbcd0
RD
9583 Window_FindFocus() -> Window
9584
9585 Returns the window or control that currently has the keyboard focus,
9586 or None.
9587 """
0085ce49 9588 return _core_.Window_FindFocus(*args)
e811c8ce 9589
0085ce49
RD
9590def Window_GetCapture(*args):
9591 """
15afbcd0
RD
9592 Window_GetCapture() -> Window
9593
9594 Returns the window which currently captures the mouse or None
9595 """
0085ce49 9596 return _core_.Window_GetCapture(*args)
e811c8ce 9597
74a57fcd 9598def Window_GetClassDefaultAttributes(*args, **kwargs):
0085ce49 9599 """
74a57fcd
RD
9600 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9601
41e2b43e
RD
9602 Get the default attributes for this class. This is useful if you want
9603 to use the same font or colour in your own control as in a standard
9604 control -- which is a much better idea than hard coding specific
db3e571a
RD
9605 colours or fonts which might look completely out of place on the
9606 user's system, especially if it uses themes.
74a57fcd
RD
9607
9608 The variant parameter is only relevant under Mac currently and is
41e2b43e 9609 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
9610 the returned font. See `wx.Window.SetWindowVariant` for more about
9611 this.
74a57fcd 9612 """
0085ce49 9613 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 9614
e811c8ce 9615def DLG_PNT(win, point_or_x, y=None):
15afbcd0
RD
9616 """
9617 Convenience function for converting a Point or (x,y) in
9618 dialog units to pixel units.
9619 """
e811c8ce
RD
9620 if y is None:
9621 return win.ConvertDialogPointToPixels(point_or_x)
9622 else:
fd3f2efe 9623 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
e811c8ce
RD
9624
9625def DLG_SZE(win, size_width, height=None):
15afbcd0
RD
9626 """
9627 Convenience function for converting a Size or (w,h) in
9628 dialog units to pixel units.
9629 """
e811c8ce
RD
9630 if height is None:
9631 return win.ConvertDialogSizeToPixels(size_width)
9632 else:
fd3f2efe 9633 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
e811c8ce
RD
9634
9635
9636def FindWindowById(*args, **kwargs):
0085ce49 9637 """
15afbcd0
RD
9638 FindWindowById(long id, Window parent=None) -> Window
9639
9640 Find the first window in the application with the given id. If parent
9641 is None, the search will start from all top-level frames and dialog
9642 boxes; if non-None, the search will be limited to the given window
9643 hierarchy. The search is recursive in both cases.
9644 """
0085ce49 9645 return _core_.FindWindowById(*args, **kwargs)
e811c8ce
RD
9646
9647def FindWindowByName(*args, **kwargs):
0085ce49 9648 """
15afbcd0
RD
9649 FindWindowByName(String name, Window parent=None) -> Window
9650
9651 Find a window by its name (as given in a window constructor or Create
9652 function call). If parent is None, the search will start from all
9653 top-level frames and dialog boxes; if non-None, the search will be
9654 limited to the given window hierarchy. The search is recursive in both
9655 cases.
9656
9657 If no window with such name is found, wx.FindWindowByLabel is called.
9658 """
0085ce49 9659 return _core_.FindWindowByName(*args, **kwargs)
e811c8ce
RD
9660
9661def FindWindowByLabel(*args, **kwargs):
0085ce49 9662 """
15afbcd0
RD
9663 FindWindowByLabel(String label, Window parent=None) -> Window
9664
9665 Find a window by its label. Depending on the type of window, the label
9666 may be a window title or panel item label. If parent is None, the
9667 search will start from all top-level frames and dialog boxes; if
9668 non-None, the search will be limited to the given window
9669 hierarchy. The search is recursive in both cases.
9670 """
0085ce49 9671 return _core_.FindWindowByLabel(*args, **kwargs)
e811c8ce
RD
9672
9673def Window_FromHWND(*args, **kwargs):
0085ce49
RD
9674 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9675 return _core_.Window_FromHWND(*args, **kwargs)
b6b0383e 9676
0085ce49
RD
9677def GetTopLevelWindows(*args):
9678 """
b6b0383e
RD
9679 GetTopLevelWindows() -> PyObject
9680
9681 Returns a list of the the application's top-level windows, (frames,
9682 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9683 by wxWidgets, and so it is only valid as long as no top-level windows
9684 are closed or new top-level windows are created.
9685
9686 """
0085ce49 9687 return _core_.GetTopLevelWindows(*args)
e811c8ce
RD
9688#---------------------------------------------------------------------------
9689
9690class Validator(EvtHandler):
093d3ff1 9691 """Proxy of C++ Validator class"""
0085ce49
RD
9692 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9693 __repr__ = _swig_repr
9694 def __init__(self, *args, **kwargs):
a95a7133 9695 """__init__(self) -> Validator"""
0085ce49 9696 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d14a1e28 9697 self._setOORInfo(self)
e811c8ce
RD
9698
9699 def Clone(*args, **kwargs):
a95a7133 9700 """Clone(self) -> Validator"""
54f9ee45 9701 return _core_.Validator_Clone(*args, **kwargs)
e811c8ce
RD
9702
9703 def Validate(*args, **kwargs):
a95a7133 9704 """Validate(self, Window parent) -> bool"""
54f9ee45 9705 return _core_.Validator_Validate(*args, **kwargs)
e811c8ce
RD
9706
9707 def TransferToWindow(*args, **kwargs):
a95a7133 9708 """TransferToWindow(self) -> bool"""
54f9ee45 9709 return _core_.Validator_TransferToWindow(*args, **kwargs)
e811c8ce
RD
9710
9711 def TransferFromWindow(*args, **kwargs):
a95a7133 9712 """TransferFromWindow(self) -> bool"""
54f9ee45 9713 return _core_.Validator_TransferFromWindow(*args, **kwargs)
e811c8ce
RD
9714
9715 def GetWindow(*args, **kwargs):
a95a7133 9716 """GetWindow(self) -> Window"""
54f9ee45 9717 return _core_.Validator_GetWindow(*args, **kwargs)
e811c8ce
RD
9718
9719 def SetWindow(*args, **kwargs):
a95a7133 9720 """SetWindow(self, Window window)"""
54f9ee45 9721 return _core_.Validator_SetWindow(*args, **kwargs)
e811c8ce
RD
9722
9723 def IsSilent(*args, **kwargs):
66c033b4 9724 """IsSilent() -> bool"""
54f9ee45 9725 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
9726
9727 IsSilent = staticmethod(IsSilent)
9728 def SetBellOnError(*args, **kwargs):
66c033b4 9729 """SetBellOnError(int doIt=True)"""
54f9ee45 9730 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
9731
9732 SetBellOnError = staticmethod(SetBellOnError)
2131d850 9733_core_.Validator_swigregister(Validator)
e811c8ce 9734
0085ce49
RD
9735def Validator_IsSilent(*args):
9736 """Validator_IsSilent() -> bool"""
9737 return _core_.Validator_IsSilent(*args)
e811c8ce
RD
9738
9739def Validator_SetBellOnError(*args, **kwargs):
0085ce49
RD
9740 """Validator_SetBellOnError(int doIt=True)"""
9741 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
9742
9743class PyValidator(Validator):
093d3ff1 9744 """Proxy of C++ PyValidator class"""
0085ce49
RD
9745 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9746 __repr__ = _swig_repr
9747 def __init__(self, *args, **kwargs):
a95a7133 9748 """__init__(self) -> PyValidator"""
0085ce49 9749 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
e811c8ce
RD
9750
9751 self._setCallbackInfo(self, PyValidator, 1)
9752 self._setOORInfo(self)
9753
9754 def _setCallbackInfo(*args, **kwargs):
a95a7133 9755 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
54f9ee45 9756 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
e811c8ce 9757
2131d850 9758_core_.PyValidator_swigregister(PyValidator)
e811c8ce
RD
9759
9760#---------------------------------------------------------------------------
9761
9762class Menu(EvtHandler):
093d3ff1 9763 """Proxy of C++ Menu class"""
0085ce49
RD
9764 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9765 __repr__ = _swig_repr
9766 def __init__(self, *args, **kwargs):
a95a7133 9767 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
0085ce49 9768 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
e811c8ce
RD
9769 self._setOORInfo(self)
9770
9771 def Append(*args, **kwargs):
a95a7133 9772 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 9773 return _core_.Menu_Append(*args, **kwargs)
e811c8ce
RD
9774
9775 def AppendSeparator(*args, **kwargs):
a95a7133 9776 """AppendSeparator(self) -> MenuItem"""
54f9ee45 9777 return _core_.Menu_AppendSeparator(*args, **kwargs)
e811c8ce
RD
9778
9779 def AppendCheckItem(*args, **kwargs):
a95a7133 9780 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9781 return _core_.Menu_AppendCheckItem(*args, **kwargs)
e811c8ce
RD
9782
9783 def AppendRadioItem(*args, **kwargs):
a95a7133 9784 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9785 return _core_.Menu_AppendRadioItem(*args, **kwargs)
e811c8ce
RD
9786
9787 def AppendMenu(*args, **kwargs):
a95a7133 9788 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 9789 return _core_.Menu_AppendMenu(*args, **kwargs)
e811c8ce 9790
50efceee
RD
9791 def AppendSubMenu(*args, **kwargs):
9792 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9793 return _core_.Menu_AppendSubMenu(*args, **kwargs)
9794
e811c8ce 9795 def AppendItem(*args, **kwargs):
a95a7133 9796 """AppendItem(self, MenuItem item) -> MenuItem"""
54f9ee45 9797 return _core_.Menu_AppendItem(*args, **kwargs)
e811c8ce 9798
e811c8ce 9799 def InsertItem(*args, **kwargs):
a95a7133 9800 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
54f9ee45 9801 return _core_.Menu_InsertItem(*args, **kwargs)
e811c8ce 9802
0085ce49
RD
9803 def PrependItem(*args, **kwargs):
9804 """PrependItem(self, MenuItem item) -> MenuItem"""
9805 return _core_.Menu_PrependItem(*args, **kwargs)
9806
9807 def Break(*args, **kwargs):
9808 """Break(self)"""
9809 return _core_.Menu_Break(*args, **kwargs)
9810
e811c8ce 9811 def Insert(*args, **kwargs):
0df68c9f 9812 """
a95a7133 9813 Insert(self, size_t pos, int id, String text, String help=EmptyString,
a41e16b6 9814 int kind=ITEM_NORMAL) -> MenuItem
0df68c9f 9815 """
54f9ee45 9816 return _core_.Menu_Insert(*args, **kwargs)
e811c8ce
RD
9817
9818 def InsertSeparator(*args, **kwargs):
a95a7133 9819 """InsertSeparator(self, size_t pos) -> MenuItem"""
54f9ee45 9820 return _core_.Menu_InsertSeparator(*args, **kwargs)
e811c8ce
RD
9821
9822 def InsertCheckItem(*args, **kwargs):
a95a7133 9823 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9824 return _core_.Menu_InsertCheckItem(*args, **kwargs)
e811c8ce
RD
9825
9826 def InsertRadioItem(*args, **kwargs):
a95a7133 9827 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9828 return _core_.Menu_InsertRadioItem(*args, **kwargs)
e811c8ce
RD
9829
9830 def InsertMenu(*args, **kwargs):
a95a7133 9831 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 9832 return _core_.Menu_InsertMenu(*args, **kwargs)
e811c8ce 9833
e811c8ce 9834 def Prepend(*args, **kwargs):
a95a7133 9835 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 9836 return _core_.Menu_Prepend(*args, **kwargs)
e811c8ce
RD
9837
9838 def PrependSeparator(*args, **kwargs):
a95a7133 9839 """PrependSeparator(self) -> MenuItem"""
54f9ee45 9840 return _core_.Menu_PrependSeparator(*args, **kwargs)
e811c8ce
RD
9841
9842 def PrependCheckItem(*args, **kwargs):
a95a7133 9843 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9844 return _core_.Menu_PrependCheckItem(*args, **kwargs)
e811c8ce
RD
9845
9846 def PrependRadioItem(*args, **kwargs):
a95a7133 9847 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9848 return _core_.Menu_PrependRadioItem(*args, **kwargs)
e811c8ce
RD
9849
9850 def PrependMenu(*args, **kwargs):
a95a7133 9851 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 9852 return _core_.Menu_PrependMenu(*args, **kwargs)
e811c8ce
RD
9853
9854 def Remove(*args, **kwargs):
a95a7133 9855 """Remove(self, int id) -> MenuItem"""
54f9ee45 9856 return _core_.Menu_Remove(*args, **kwargs)
e811c8ce
RD
9857
9858 def RemoveItem(*args, **kwargs):
a95a7133 9859 """RemoveItem(self, MenuItem item) -> MenuItem"""
54f9ee45 9860 return _core_.Menu_RemoveItem(*args, **kwargs)
e811c8ce
RD
9861
9862 def Delete(*args, **kwargs):
a95a7133 9863 """Delete(self, int id) -> bool"""
54f9ee45 9864 return _core_.Menu_Delete(*args, **kwargs)
e811c8ce
RD
9865
9866 def DeleteItem(*args, **kwargs):
a95a7133 9867 """DeleteItem(self, MenuItem item) -> bool"""
54f9ee45 9868 return _core_.Menu_DeleteItem(*args, **kwargs)
e811c8ce
RD
9869
9870 def Destroy(*args, **kwargs):
0df68c9f 9871 """
a95a7133 9872 Destroy(self)
e811c8ce 9873
0df68c9f
RD
9874 Deletes the C++ object this Python object is a proxy for.
9875 """
7e08d4ef
RD
9876 val = _core_.Menu_Destroy(*args, **kwargs)
9877 args[0].thisown = 0
9878 return val
e811c8ce
RD
9879
9880 def DestroyId(*args, **kwargs):
0df68c9f 9881 """
a95a7133 9882 DestroyId(self, int id) -> bool
e811c8ce 9883
0df68c9f
RD
9884 Deletes the C++ object this Python object is a proxy for.
9885 """
7e08d4ef
RD
9886 val = _core_.Menu_DestroyId(*args, **kwargs)
9887 args[0].thisown = 0
9888 return val
e811c8ce
RD
9889
9890 def DestroyItem(*args, **kwargs):
0df68c9f 9891 """
a95a7133 9892 DestroyItem(self, MenuItem item) -> bool
e811c8ce 9893
0df68c9f
RD
9894 Deletes the C++ object this Python object is a proxy for.
9895 """
7e08d4ef
RD
9896 val = _core_.Menu_DestroyItem(*args, **kwargs)
9897 args[0].thisown = 0
9898 return val
e811c8ce
RD
9899
9900 def GetMenuItemCount(*args, **kwargs):
a95a7133 9901 """GetMenuItemCount(self) -> size_t"""
54f9ee45 9902 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
e811c8ce
RD
9903
9904 def GetMenuItems(*args, **kwargs):
a95a7133 9905 """GetMenuItems(self) -> PyObject"""
54f9ee45 9906 return _core_.Menu_GetMenuItems(*args, **kwargs)
e811c8ce
RD
9907
9908 def FindItem(*args, **kwargs):
a95a7133 9909 """FindItem(self, String item) -> int"""
54f9ee45 9910 return _core_.Menu_FindItem(*args, **kwargs)
e811c8ce
RD
9911
9912 def FindItemById(*args, **kwargs):
a95a7133 9913 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 9914 return _core_.Menu_FindItemById(*args, **kwargs)
e811c8ce
RD
9915
9916 def FindItemByPosition(*args, **kwargs):
a95a7133 9917 """FindItemByPosition(self, size_t position) -> MenuItem"""
54f9ee45 9918 return _core_.Menu_FindItemByPosition(*args, **kwargs)
e811c8ce
RD
9919
9920 def Enable(*args, **kwargs):
a95a7133 9921 """Enable(self, int id, bool enable)"""
54f9ee45 9922 return _core_.Menu_Enable(*args, **kwargs)
e811c8ce
RD
9923
9924 def IsEnabled(*args, **kwargs):
a95a7133 9925 """IsEnabled(self, int id) -> bool"""
54f9ee45 9926 return _core_.Menu_IsEnabled(*args, **kwargs)
e811c8ce
RD
9927
9928 def Check(*args, **kwargs):
a95a7133 9929 """Check(self, int id, bool check)"""
54f9ee45 9930 return _core_.Menu_Check(*args, **kwargs)
e811c8ce
RD
9931
9932 def IsChecked(*args, **kwargs):
a95a7133 9933 """IsChecked(self, int id) -> bool"""
54f9ee45 9934 return _core_.Menu_IsChecked(*args, **kwargs)
e811c8ce
RD
9935
9936 def SetLabel(*args, **kwargs):
a95a7133 9937 """SetLabel(self, int id, String label)"""
54f9ee45 9938 return _core_.Menu_SetLabel(*args, **kwargs)
e811c8ce
RD
9939
9940 def GetLabel(*args, **kwargs):
a95a7133 9941 """GetLabel(self, int id) -> String"""
54f9ee45 9942 return _core_.Menu_GetLabel(*args, **kwargs)
e811c8ce
RD
9943
9944 def SetHelpString(*args, **kwargs):
a95a7133 9945 """SetHelpString(self, int id, String helpString)"""
54f9ee45 9946 return _core_.Menu_SetHelpString(*args, **kwargs)
e811c8ce
RD
9947
9948 def GetHelpString(*args, **kwargs):
a95a7133 9949 """GetHelpString(self, int id) -> String"""
54f9ee45 9950 return _core_.Menu_GetHelpString(*args, **kwargs)
e811c8ce
RD
9951
9952 def SetTitle(*args, **kwargs):
a95a7133 9953 """SetTitle(self, String title)"""
54f9ee45 9954 return _core_.Menu_SetTitle(*args, **kwargs)
e811c8ce
RD
9955
9956 def GetTitle(*args, **kwargs):
a95a7133 9957 """GetTitle(self) -> String"""
54f9ee45 9958 return _core_.Menu_GetTitle(*args, **kwargs)
e811c8ce
RD
9959
9960 def SetEventHandler(*args, **kwargs):
a95a7133 9961 """SetEventHandler(self, EvtHandler handler)"""
54f9ee45 9962 return _core_.Menu_SetEventHandler(*args, **kwargs)
e811c8ce
RD
9963
9964 def GetEventHandler(*args, **kwargs):
a95a7133 9965 """GetEventHandler(self) -> EvtHandler"""
54f9ee45 9966 return _core_.Menu_GetEventHandler(*args, **kwargs)
e811c8ce
RD
9967
9968 def SetInvokingWindow(*args, **kwargs):
a95a7133 9969 """SetInvokingWindow(self, Window win)"""
54f9ee45 9970 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
e811c8ce
RD
9971
9972 def GetInvokingWindow(*args, **kwargs):
a95a7133 9973 """GetInvokingWindow(self) -> Window"""
54f9ee45 9974 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
e811c8ce
RD
9975
9976 def GetStyle(*args, **kwargs):
a95a7133 9977 """GetStyle(self) -> long"""
54f9ee45 9978 return _core_.Menu_GetStyle(*args, **kwargs)
e811c8ce
RD
9979
9980 def UpdateUI(*args, **kwargs):
a95a7133 9981 """UpdateUI(self, EvtHandler source=None)"""
54f9ee45 9982 return _core_.Menu_UpdateUI(*args, **kwargs)
e811c8ce
RD
9983
9984 def GetMenuBar(*args, **kwargs):
a95a7133 9985 """GetMenuBar(self) -> MenuBar"""
54f9ee45 9986 return _core_.Menu_GetMenuBar(*args, **kwargs)
e811c8ce
RD
9987
9988 def Attach(*args, **kwargs):
a95a7133 9989 """Attach(self, wxMenuBarBase menubar)"""
54f9ee45 9990 return _core_.Menu_Attach(*args, **kwargs)
e811c8ce
RD
9991
9992 def Detach(*args, **kwargs):
a95a7133 9993 """Detach(self)"""
54f9ee45 9994 return _core_.Menu_Detach(*args, **kwargs)
e811c8ce
RD
9995
9996 def IsAttached(*args, **kwargs):
a95a7133 9997 """IsAttached(self) -> bool"""
54f9ee45 9998 return _core_.Menu_IsAttached(*args, **kwargs)
e811c8ce
RD
9999
10000 def SetParent(*args, **kwargs):
a95a7133 10001 """SetParent(self, Menu parent)"""
54f9ee45 10002 return _core_.Menu_SetParent(*args, **kwargs)
e811c8ce
RD
10003
10004 def GetParent(*args, **kwargs):
a95a7133 10005 """GetParent(self) -> Menu"""
54f9ee45 10006 return _core_.Menu_GetParent(*args, **kwargs)
e811c8ce 10007
2131d850 10008_core_.Menu_swigregister(Menu)
d14a1e28
RD
10009DefaultValidator = cvar.DefaultValidator
10010
10011#---------------------------------------------------------------------------
10012
10013class MenuBar(Window):
093d3ff1 10014 """Proxy of C++ MenuBar class"""
0085ce49
RD
10015 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10016 __repr__ = _swig_repr
10017 def __init__(self, *args, **kwargs):
a95a7133 10018 """__init__(self, long style=0) -> MenuBar"""
0085ce49 10019 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d14a1e28 10020 self._setOORInfo(self)
e811c8ce
RD
10021
10022 def Append(*args, **kwargs):
a95a7133 10023 """Append(self, Menu menu, String title) -> bool"""
54f9ee45 10024 return _core_.MenuBar_Append(*args, **kwargs)
e811c8ce
RD
10025
10026 def Insert(*args, **kwargs):
a95a7133 10027 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
54f9ee45 10028 return _core_.MenuBar_Insert(*args, **kwargs)
e811c8ce
RD
10029
10030 def GetMenuCount(*args, **kwargs):
a95a7133 10031 """GetMenuCount(self) -> size_t"""
54f9ee45 10032 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
e811c8ce
RD
10033
10034 def GetMenu(*args, **kwargs):
a95a7133 10035 """GetMenu(self, size_t pos) -> Menu"""
54f9ee45 10036 return _core_.MenuBar_GetMenu(*args, **kwargs)
e811c8ce
RD
10037
10038 def Replace(*args, **kwargs):
a95a7133 10039 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
54f9ee45 10040 return _core_.MenuBar_Replace(*args, **kwargs)
e811c8ce
RD
10041
10042 def Remove(*args, **kwargs):
a95a7133 10043 """Remove(self, size_t pos) -> Menu"""
54f9ee45 10044 return _core_.MenuBar_Remove(*args, **kwargs)
e811c8ce
RD
10045
10046 def EnableTop(*args, **kwargs):
a95a7133 10047 """EnableTop(self, size_t pos, bool enable)"""
54f9ee45 10048 return _core_.MenuBar_EnableTop(*args, **kwargs)
e811c8ce
RD
10049
10050 def IsEnabledTop(*args, **kwargs):
a95a7133 10051 """IsEnabledTop(self, size_t pos) -> bool"""
54f9ee45 10052 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
e811c8ce
RD
10053
10054 def SetLabelTop(*args, **kwargs):
a95a7133 10055 """SetLabelTop(self, size_t pos, String label)"""
54f9ee45 10056 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
e811c8ce
RD
10057
10058 def GetLabelTop(*args, **kwargs):
a95a7133 10059 """GetLabelTop(self, size_t pos) -> String"""
54f9ee45 10060 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
e811c8ce
RD
10061
10062 def FindMenuItem(*args, **kwargs):
a95a7133 10063 """FindMenuItem(self, String menu, String item) -> int"""
54f9ee45 10064 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
e811c8ce
RD
10065
10066 def FindItemById(*args, **kwargs):
a95a7133 10067 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 10068 return _core_.MenuBar_FindItemById(*args, **kwargs)
e811c8ce
RD
10069
10070 def FindMenu(*args, **kwargs):
a95a7133 10071 """FindMenu(self, String title) -> int"""
54f9ee45 10072 return _core_.MenuBar_FindMenu(*args, **kwargs)
e811c8ce
RD
10073
10074 def Enable(*args, **kwargs):
a95a7133 10075 """Enable(self, int id, bool enable)"""
54f9ee45 10076 return _core_.MenuBar_Enable(*args, **kwargs)
e811c8ce
RD
10077
10078 def Check(*args, **kwargs):
a95a7133 10079 """Check(self, int id, bool check)"""
54f9ee45 10080 return _core_.MenuBar_Check(*args, **kwargs)
e811c8ce
RD
10081
10082 def IsChecked(*args, **kwargs):
a95a7133 10083 """IsChecked(self, int id) -> bool"""
54f9ee45 10084 return _core_.MenuBar_IsChecked(*args, **kwargs)
e811c8ce
RD
10085
10086 def IsEnabled(*args, **kwargs):
a95a7133 10087 """IsEnabled(self, int id) -> bool"""
54f9ee45 10088 return _core_.MenuBar_IsEnabled(*args, **kwargs)
e811c8ce
RD
10089
10090 def SetLabel(*args, **kwargs):
a95a7133 10091 """SetLabel(self, int id, String label)"""
54f9ee45 10092 return _core_.MenuBar_SetLabel(*args, **kwargs)
e811c8ce
RD
10093
10094 def GetLabel(*args, **kwargs):
a95a7133 10095 """GetLabel(self, int id) -> String"""
54f9ee45 10096 return _core_.MenuBar_GetLabel(*args, **kwargs)
e811c8ce
RD
10097
10098 def SetHelpString(*args, **kwargs):
a95a7133 10099 """SetHelpString(self, int id, String helpString)"""
54f9ee45 10100 return _core_.MenuBar_SetHelpString(*args, **kwargs)
e811c8ce
RD
10101
10102 def GetHelpString(*args, **kwargs):
a95a7133 10103 """GetHelpString(self, int id) -> String"""
54f9ee45 10104 return _core_.MenuBar_GetHelpString(*args, **kwargs)
e811c8ce
RD
10105
10106 def GetFrame(*args, **kwargs):
a95a7133 10107 """GetFrame(self) -> wxFrame"""
54f9ee45 10108 return _core_.MenuBar_GetFrame(*args, **kwargs)
e811c8ce
RD
10109
10110 def IsAttached(*args, **kwargs):
a95a7133 10111 """IsAttached(self) -> bool"""
54f9ee45 10112 return _core_.MenuBar_IsAttached(*args, **kwargs)
e811c8ce
RD
10113
10114 def Attach(*args, **kwargs):
a95a7133 10115 """Attach(self, wxFrame frame)"""
54f9ee45 10116 return _core_.MenuBar_Attach(*args, **kwargs)
e811c8ce
RD
10117
10118 def Detach(*args, **kwargs):
a95a7133 10119 """Detach(self)"""
54f9ee45 10120 return _core_.MenuBar_Detach(*args, **kwargs)
e811c8ce 10121
4f433fef
RD
10122 def SetAutoWindowMenu(*args, **kwargs):
10123 """SetAutoWindowMenu(bool enable)"""
10124 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10125
10126 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10127 def GetAutoWindowMenu(*args, **kwargs):
10128 """GetAutoWindowMenu() -> bool"""
10129 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10130
10131 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
2131d850 10132_core_.MenuBar_swigregister(MenuBar)
d14a1e28 10133
4f433fef 10134def MenuBar_SetAutoWindowMenu(*args, **kwargs):
0085ce49
RD
10135 """MenuBar_SetAutoWindowMenu(bool enable)"""
10136 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 10137
0085ce49
RD
10138def MenuBar_GetAutoWindowMenu(*args):
10139 """MenuBar_GetAutoWindowMenu() -> bool"""
10140 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 10141
d14a1e28
RD
10142#---------------------------------------------------------------------------
10143
10144class MenuItem(Object):
093d3ff1 10145 """Proxy of C++ MenuItem class"""
0085ce49
RD
10146 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10147 __repr__ = _swig_repr
10148 def __init__(self, *args, **kwargs):
0df68c9f 10149 """
a95a7133 10150 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
196addbf
RD
10151 String help=EmptyString, int kind=ITEM_NORMAL,
10152 Menu subMenu=None) -> MenuItem
0df68c9f 10153 """
0085ce49
RD
10154 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10155 __swig_destroy__ = _core_.delete_MenuItem
10156 __del__ = lambda self : None;
e811c8ce 10157 def GetMenu(*args, **kwargs):
a95a7133 10158 """GetMenu(self) -> Menu"""
54f9ee45 10159 return _core_.MenuItem_GetMenu(*args, **kwargs)
e811c8ce
RD
10160
10161 def SetMenu(*args, **kwargs):
a95a7133 10162 """SetMenu(self, Menu menu)"""
54f9ee45 10163 return _core_.MenuItem_SetMenu(*args, **kwargs)
e811c8ce
RD
10164
10165 def SetId(*args, **kwargs):
a95a7133 10166 """SetId(self, int id)"""
54f9ee45 10167 return _core_.MenuItem_SetId(*args, **kwargs)
e811c8ce
RD
10168
10169 def GetId(*args, **kwargs):
a95a7133 10170 """GetId(self) -> int"""
54f9ee45 10171 return _core_.MenuItem_GetId(*args, **kwargs)
e811c8ce
RD
10172
10173 def IsSeparator(*args, **kwargs):
a95a7133 10174 """IsSeparator(self) -> bool"""
54f9ee45 10175 return _core_.MenuItem_IsSeparator(*args, **kwargs)
e811c8ce
RD
10176
10177 def SetText(*args, **kwargs):
a95a7133 10178 """SetText(self, String str)"""
54f9ee45 10179 return _core_.MenuItem_SetText(*args, **kwargs)
e811c8ce
RD
10180
10181 def GetLabel(*args, **kwargs):
a95a7133 10182 """GetLabel(self) -> String"""
54f9ee45 10183 return _core_.MenuItem_GetLabel(*args, **kwargs)
e811c8ce
RD
10184
10185 def GetText(*args, **kwargs):
a95a7133 10186 """GetText(self) -> String"""
54f9ee45 10187 return _core_.MenuItem_GetText(*args, **kwargs)
e811c8ce
RD
10188
10189 def GetLabelFromText(*args, **kwargs):
66c033b4 10190 """GetLabelFromText(String text) -> String"""
54f9ee45 10191 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
e811c8ce
RD
10192
10193 GetLabelFromText = staticmethod(GetLabelFromText)
10194 def GetKind(*args, **kwargs):
a95a7133 10195 """GetKind(self) -> int"""
54f9ee45 10196 return _core_.MenuItem_GetKind(*args, **kwargs)
e811c8ce 10197
a95a7133
RD
10198 def SetKind(*args, **kwargs):
10199 """SetKind(self, int kind)"""
54f9ee45 10200 return _core_.MenuItem_SetKind(*args, **kwargs)
a95a7133 10201
e811c8ce 10202 def SetCheckable(*args, **kwargs):
a95a7133 10203 """SetCheckable(self, bool checkable)"""
54f9ee45 10204 return _core_.MenuItem_SetCheckable(*args, **kwargs)
e811c8ce
RD
10205
10206 def IsCheckable(*args, **kwargs):
a95a7133 10207 """IsCheckable(self) -> bool"""
54f9ee45 10208 return _core_.MenuItem_IsCheckable(*args, **kwargs)
e811c8ce
RD
10209
10210 def IsSubMenu(*args, **kwargs):
a95a7133 10211 """IsSubMenu(self) -> bool"""
54f9ee45 10212 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
e811c8ce
RD
10213
10214 def SetSubMenu(*args, **kwargs):
a95a7133 10215 """SetSubMenu(self, Menu menu)"""
54f9ee45 10216 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
e811c8ce
RD
10217
10218 def GetSubMenu(*args, **kwargs):
a95a7133 10219 """GetSubMenu(self) -> Menu"""
54f9ee45 10220 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
e811c8ce
RD
10221
10222 def Enable(*args, **kwargs):
a95a7133 10223 """Enable(self, bool enable=True)"""
54f9ee45 10224 return _core_.MenuItem_Enable(*args, **kwargs)
e811c8ce
RD
10225
10226 def IsEnabled(*args, **kwargs):
a95a7133 10227 """IsEnabled(self) -> bool"""
54f9ee45 10228 return _core_.MenuItem_IsEnabled(*args, **kwargs)
e811c8ce
RD
10229
10230 def Check(*args, **kwargs):
a95a7133 10231 """Check(self, bool check=True)"""
54f9ee45 10232 return _core_.MenuItem_Check(*args, **kwargs)
e811c8ce
RD
10233
10234 def IsChecked(*args, **kwargs):
a95a7133 10235 """IsChecked(self) -> bool"""
54f9ee45 10236 return _core_.MenuItem_IsChecked(*args, **kwargs)
e811c8ce
RD
10237
10238 def Toggle(*args, **kwargs):
a95a7133 10239 """Toggle(self)"""
54f9ee45 10240 return _core_.MenuItem_Toggle(*args, **kwargs)
e811c8ce
RD
10241
10242 def SetHelp(*args, **kwargs):
a95a7133 10243 """SetHelp(self, String str)"""
54f9ee45 10244 return _core_.MenuItem_SetHelp(*args, **kwargs)
e811c8ce
RD
10245
10246 def GetHelp(*args, **kwargs):
a95a7133 10247 """GetHelp(self) -> String"""
54f9ee45 10248 return _core_.MenuItem_GetHelp(*args, **kwargs)
e811c8ce
RD
10249
10250 def GetAccel(*args, **kwargs):
a95a7133 10251 """GetAccel(self) -> AcceleratorEntry"""
54f9ee45 10252 return _core_.MenuItem_GetAccel(*args, **kwargs)
e811c8ce
RD
10253
10254 def SetAccel(*args, **kwargs):
a95a7133 10255 """SetAccel(self, AcceleratorEntry accel)"""
54f9ee45 10256 return _core_.MenuItem_SetAccel(*args, **kwargs)
e811c8ce 10257
091f5bed
RD
10258 def SetBitmap(*args, **kwargs):
10259 """SetBitmap(self, Bitmap bitmap)"""
10260 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10261
10262 def GetBitmap(*args, **kwargs):
10263 """GetBitmap(self) -> Bitmap"""
10264 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10265
c1280d1e
RD
10266 def SetFont(*args, **kwargs):
10267 """SetFont(self, Font font)"""
10268 return _core_.MenuItem_SetFont(*args, **kwargs)
10269
10270 def GetFont(*args, **kwargs):
10271 """GetFont(self) -> Font"""
10272 return _core_.MenuItem_GetFont(*args, **kwargs)
10273
10274 def SetTextColour(*args, **kwargs):
10275 """SetTextColour(self, Colour colText)"""
10276 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10277
10278 def GetTextColour(*args, **kwargs):
10279 """GetTextColour(self) -> Colour"""
10280 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10281
10282 def SetBackgroundColour(*args, **kwargs):
10283 """SetBackgroundColour(self, Colour colBack)"""
10284 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10285
10286 def GetBackgroundColour(*args, **kwargs):
10287 """GetBackgroundColour(self) -> Colour"""
10288 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10289
10290 def SetBitmaps(*args, **kwargs):
10291 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10292 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10293
10294 def SetDisabledBitmap(*args, **kwargs):
10295 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10296 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10297
10298 def GetDisabledBitmap(*args, **kwargs):
10299 """GetDisabledBitmap(self) -> Bitmap"""
10300 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10301
10302 def SetMarginWidth(*args, **kwargs):
10303 """SetMarginWidth(self, int nWidth)"""
10304 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10305
10306 def GetMarginWidth(*args, **kwargs):
10307 """GetMarginWidth(self) -> int"""
10308 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10309
e811c8ce 10310 def GetDefaultMarginWidth(*args, **kwargs):
66c033b4 10311 """GetDefaultMarginWidth() -> int"""
54f9ee45 10312 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
e811c8ce
RD
10313
10314 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10315 def IsOwnerDrawn(*args, **kwargs):
10316 """IsOwnerDrawn(self) -> bool"""
10317 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10318
10319 def SetOwnerDrawn(*args, **kwargs):
10320 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10321 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10322
10323 def ResetOwnerDrawn(*args, **kwargs):
10324 """ResetOwnerDrawn(self)"""
10325 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10326
2131d850 10327_core_.MenuItem_swigregister(MenuItem)
d14a1e28 10328
e811c8ce 10329def MenuItem_GetLabelFromText(*args, **kwargs):
0085ce49
RD
10330 """MenuItem_GetLabelFromText(String text) -> String"""
10331 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d14a1e28 10332
0085ce49
RD
10333def MenuItem_GetDefaultMarginWidth(*args):
10334 """MenuItem_GetDefaultMarginWidth() -> int"""
10335 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d14a1e28
RD
10336
10337#---------------------------------------------------------------------------
10338
10339class Control(Window):
15afbcd0
RD
10340 """
10341 This is the base class for a control or 'widget'.
10342
41e2b43e
RD
10343 A control is generally a small window which processes user input
10344 and/or displays one or more item of data.
15afbcd0 10345 """
0085ce49
RD
10346 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10347 __repr__ = _swig_repr
10348 def __init__(self, *args, **kwargs):
0df68c9f 10349 """
248ed943
RD
10350 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10351 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 10352 String name=ControlNameStr) -> Control
15afbcd0 10353
41e2b43e
RD
10354 Create a Control. Normally you should only call this from a subclass'
10355 __init__ as a plain old wx.Control is not very useful.
0df68c9f 10356 """
0085ce49 10357 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d14a1e28 10358 self._setOORInfo(self)
e811c8ce
RD
10359
10360 def Create(*args, **kwargs):
0df68c9f 10361 """
248ed943
RD
10362 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10363 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 10364 String name=ControlNameStr) -> bool
15afbcd0
RD
10365
10366 Do the 2nd phase and create the GUI control.
0df68c9f 10367 """
54f9ee45 10368 return _core_.Control_Create(*args, **kwargs)
e811c8ce
RD
10369
10370 def Command(*args, **kwargs):
15afbcd0 10371 """
a95a7133 10372 Command(self, CommandEvent event)
15afbcd0 10373
41e2b43e
RD
10374 Simulates the effect of the user issuing a command to the item.
10375
10376 :see: `wx.CommandEvent`
10377
15afbcd0 10378 """
54f9ee45 10379 return _core_.Control_Command(*args, **kwargs)
e811c8ce
RD
10380
10381 def GetLabel(*args, **kwargs):
15afbcd0 10382 """
a95a7133 10383 GetLabel(self) -> String
15afbcd0
RD
10384
10385 Return a control's text.
10386 """
54f9ee45 10387 return _core_.Control_GetLabel(*args, **kwargs)
e811c8ce 10388
74a57fcd 10389 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
10390 """
10391 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10392
10393 Get the default attributes for this class. This is useful if you want
10394 to use the same font or colour in your own control as in a standard
10395 control -- which is a much better idea than hard coding specific
10396 colours or fonts which might look completely out of place on the
10397 user's system, especially if it uses themes.
10398
10399 The variant parameter is only relevant under Mac currently and is
10400 ignore under other platforms. Under Mac, it will change the size of
10401 the returned font. See `wx.Window.SetWindowVariant` for more about
10402 this.
10403 """
54f9ee45 10404 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
10405
10406 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2131d850 10407_core_.Control_swigregister(Control)
b2dc1044 10408ControlNameStr = cvar.ControlNameStr
d14a1e28
RD
10409
10410def PreControl(*args, **kwargs):
15afbcd0
RD
10411 """
10412 PreControl() -> Control
10413
10414 Precreate a Control control for 2-phase creation
10415 """
54f9ee45 10416 val = _core_.new_PreControl(*args, **kwargs)
d14a1e28
RD
10417 return val
10418
74a57fcd 10419def Control_GetClassDefaultAttributes(*args, **kwargs):
0085ce49 10420 """
110da5b0
RD
10421 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10422
10423 Get the default attributes for this class. This is useful if you want
10424 to use the same font or colour in your own control as in a standard
10425 control -- which is a much better idea than hard coding specific
10426 colours or fonts which might look completely out of place on the
10427 user's system, especially if it uses themes.
10428
10429 The variant parameter is only relevant under Mac currently and is
10430 ignore under other platforms. Under Mac, it will change the size of
10431 the returned font. See `wx.Window.SetWindowVariant` for more about
10432 this.
10433 """
0085ce49 10434 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 10435
d14a1e28
RD
10436#---------------------------------------------------------------------------
10437
10438class ItemContainer(object):
15afbcd0 10439 """
53aa7709
RD
10440 The wx.ItemContainer class defines an interface which is implemented
10441 by all controls which have string subitems, each of which may be
10442 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10443 as `wx.ComboBox` which implements an extended interface deriving from
41e2b43e 10444 this one.
15afbcd0 10445
41e2b43e
RD
10446 It defines the methods for accessing the control's items and although
10447 each of the derived classes implements them differently, they still
10448 all conform to the same interface.
15afbcd0 10449
41e2b43e
RD
10450 The items in a wx.ItemContainer have (non empty) string labels and,
10451 optionally, client data associated with them.
15afbcd0
RD
10452
10453 """
0085ce49
RD
10454 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10455 def __init__(self): raise AttributeError, "No constructor defined"
10456 __repr__ = _swig_repr
e811c8ce 10457 def Append(*args, **kwargs):
15afbcd0 10458 """
a95a7133 10459 Append(self, String item, PyObject clientData=None) -> int
15afbcd0 10460
41e2b43e
RD
10461 Adds the item to the control, associating the given data with the item
10462 if not None. The return value is the index of the newly added item
10463 which may be different from the last one if the control is sorted (e.g.
10464 has wx.LB_SORT or wx.CB_SORT style).
15afbcd0 10465 """
54f9ee45 10466 return _core_.ItemContainer_Append(*args, **kwargs)
e811c8ce
RD
10467
10468 def AppendItems(*args, **kwargs):
15afbcd0 10469 """
f5b96ee1 10470 AppendItems(self, List strings)
15afbcd0 10471
41e2b43e
RD
10472 Apend several items at once to the control. Notice that calling this
10473 method may be much faster than appending the items one by one if you
10474 need to add a lot of items.
15afbcd0 10475 """
54f9ee45 10476 return _core_.ItemContainer_AppendItems(*args, **kwargs)
e811c8ce
RD
10477
10478 def Insert(*args, **kwargs):
15afbcd0 10479 """
50f151d7 10480 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
15afbcd0 10481
41e2b43e 10482 Insert an item into the control before the item at the ``pos`` index,
15afbcd0
RD
10483 optionally associating some data object with the item.
10484 """
54f9ee45 10485 return _core_.ItemContainer_Insert(*args, **kwargs)
e811c8ce
RD
10486
10487 def Clear(*args, **kwargs):
15afbcd0 10488 """
a95a7133 10489 Clear(self)
15afbcd0
RD
10490
10491 Removes all items from the control.
10492 """
54f9ee45 10493 return _core_.ItemContainer_Clear(*args, **kwargs)
e811c8ce
RD
10494
10495 def Delete(*args, **kwargs):
15afbcd0 10496 """
50f151d7 10497 Delete(self, unsigned int n)
15afbcd0 10498
41e2b43e
RD
10499 Deletes the item at the zero-based index 'n' from the control. Note
10500 that it is an error (signalled by a `wx.PyAssertionError` exception if
10501 enabled) to remove an item with the index negative or greater or equal
10502 than the number of items in the control.
15afbcd0 10503 """
54f9ee45 10504 return _core_.ItemContainer_Delete(*args, **kwargs)
e811c8ce 10505
53aa7709
RD
10506 def GetClientData(*args, **kwargs):
10507 """
50f151d7 10508 GetClientData(self, unsigned int n) -> PyObject
53aa7709
RD
10509
10510 Returns the client data associated with the given item, (if any.)
10511 """
10512 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10513
10514 def SetClientData(*args, **kwargs):
10515 """
50f151d7 10516 SetClientData(self, unsigned int n, PyObject clientData)
53aa7709
RD
10517
10518 Associate the given client data with the item at position n.
10519 """
10520 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10521
e811c8ce 10522 def GetCount(*args, **kwargs):
15afbcd0 10523 """
50f151d7 10524 GetCount(self) -> unsigned int
15afbcd0
RD
10525
10526 Returns the number of items in the control.
10527 """
54f9ee45 10528 return _core_.ItemContainer_GetCount(*args, **kwargs)
e811c8ce
RD
10529
10530 def IsEmpty(*args, **kwargs):
15afbcd0 10531 """
a95a7133 10532 IsEmpty(self) -> bool
15afbcd0
RD
10533
10534 Returns True if the control is empty or False if it has some items.
10535 """
54f9ee45 10536 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
e811c8ce
RD
10537
10538 def GetString(*args, **kwargs):
15afbcd0 10539 """
50f151d7 10540 GetString(self, unsigned int n) -> String
15afbcd0
RD
10541
10542 Returns the label of the item with the given index.
10543 """
54f9ee45 10544 return _core_.ItemContainer_GetString(*args, **kwargs)
e811c8ce
RD
10545
10546 def GetStrings(*args, **kwargs):
a95a7133 10547 """GetStrings(self) -> wxArrayString"""
54f9ee45 10548 return _core_.ItemContainer_GetStrings(*args, **kwargs)
e811c8ce
RD
10549
10550 def SetString(*args, **kwargs):
15afbcd0 10551 """
50f151d7 10552 SetString(self, unsigned int n, String s)
15afbcd0
RD
10553
10554 Sets the label for the given item.
10555 """
54f9ee45 10556 return _core_.ItemContainer_SetString(*args, **kwargs)
e811c8ce
RD
10557
10558 def FindString(*args, **kwargs):
15afbcd0 10559 """
a95a7133 10560 FindString(self, String s) -> int
15afbcd0
RD
10561
10562 Finds an item whose label matches the given string. Returns the
41e2b43e
RD
10563 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10564 found.
15afbcd0 10565 """
54f9ee45 10566 return _core_.ItemContainer_FindString(*args, **kwargs)
e811c8ce 10567
53aa7709 10568 def SetSelection(*args, **kwargs):
15afbcd0 10569 """
53aa7709 10570 SetSelection(self, int n)
15afbcd0
RD
10571
10572 Sets the item at index 'n' to be the selected item.
10573 """
53aa7709 10574 return _core_.ItemContainer_SetSelection(*args, **kwargs)
e811c8ce
RD
10575
10576 def GetSelection(*args, **kwargs):
15afbcd0 10577 """
a95a7133 10578 GetSelection(self) -> int
15afbcd0 10579
41e2b43e
RD
10580 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10581 is selected.
15afbcd0 10582 """
54f9ee45 10583 return _core_.ItemContainer_GetSelection(*args, **kwargs)
e811c8ce 10584
53aa7709
RD
10585 def SetStringSelection(*args, **kwargs):
10586 """SetStringSelection(self, String s) -> bool"""
10587 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
10588
e811c8ce 10589 def GetStringSelection(*args, **kwargs):
15afbcd0 10590 """
a95a7133 10591 GetStringSelection(self) -> String
15afbcd0 10592
41e2b43e
RD
10593 Returns the label of the selected item or an empty string if no item
10594 is selected.
15afbcd0 10595 """
54f9ee45 10596 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
e811c8ce 10597
53aa7709 10598 def Select(*args, **kwargs):
15afbcd0 10599 """
53aa7709 10600 Select(self, int n)
15afbcd0 10601
53aa7709
RD
10602 This is the same as `SetSelection` and exists only because it is
10603 slightly more natural for controls which support multiple selection.
15afbcd0 10604 """
53aa7709 10605 return _core_.ItemContainer_Select(*args, **kwargs)
e811c8ce 10606
2131d850 10607_core_.ItemContainer_swigregister(ItemContainer)
d14a1e28
RD
10608
10609#---------------------------------------------------------------------------
10610
10611class ControlWithItems(Control,ItemContainer):
15afbcd0 10612 """
41e2b43e
RD
10613 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10614 wx.Control class, and is used for the base class of various controls
10615 that have items.
15afbcd0 10616 """
0085ce49
RD
10617 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10618 def __init__(self): raise AttributeError, "No constructor defined"
10619 __repr__ = _swig_repr
2131d850 10620_core_.ControlWithItems_swigregister(ControlWithItems)
d14a1e28
RD
10621
10622#---------------------------------------------------------------------------
10623
10624class SizerItem(Object):
248ed943
RD
10625 """
10626 The wx.SizerItem class is used to track the position, size and other
01f6b6d3
RD
10627 attributes of each item managed by a `wx.Sizer`. It is not usually
10628 necessary to use this class because the sizer elements can also be
10629 identified by their positions or window or sizer references but
10630 sometimes it may be more convenient to use wx.SizerItem directly.
10631 Also, custom classes derived from `wx.PySizer` will probably need to
10632 use the collection of wx.SizerItems held by wx.Sizer when calculating
10633 layout.
248ed943
RD
10634
10635 :see: `wx.Sizer`, `wx.GBSizerItem`
10636 """
0085ce49
RD
10637 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10638 __repr__ = _swig_repr
10639 def __init__(self, *args, **kwargs):
248ed943
RD
10640 """
10641 __init__(self) -> SizerItem
10642
10643 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10644 size will need to be set before this item can be used in a Sizer.
10645
10646 You will probably never need to create a wx.SizerItem directly as they
10647 are created automatically when the sizer's Add, Insert or Prepend
10648 methods are called.
10649
10650 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10651 """
0085ce49
RD
10652 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10653 __swig_destroy__ = _core_.delete_SizerItem
10654 __del__ = lambda self : None;
e811c8ce 10655 def DeleteWindows(*args, **kwargs):
248ed943
RD
10656 """
10657 DeleteWindows(self)
10658
10659 Destroy the window or the windows in a subsizer, depending on the type
10660 of item.
10661 """
54f9ee45 10662 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
e811c8ce
RD
10663
10664 def DetachSizer(*args, **kwargs):
248ed943
RD
10665 """
10666 DetachSizer(self)
10667
10668 Enable deleting the SizerItem without destroying the contained sizer.
10669 """
54f9ee45 10670 return _core_.SizerItem_DetachSizer(*args, **kwargs)
e811c8ce
RD
10671
10672 def GetSize(*args, **kwargs):
248ed943
RD
10673 """
10674 GetSize(self) -> Size
10675
10676 Get the current size of the item, as set in the last Layout.
10677 """
54f9ee45 10678 return _core_.SizerItem_GetSize(*args, **kwargs)
e811c8ce
RD
10679
10680 def CalcMin(*args, **kwargs):
248ed943
RD
10681 """
10682 CalcMin(self) -> Size
10683
10684 Calculates the minimum desired size for the item, including any space
10685 needed by borders.
10686 """
54f9ee45 10687 return _core_.SizerItem_CalcMin(*args, **kwargs)
e811c8ce
RD
10688
10689 def SetDimension(*args, **kwargs):
248ed943
RD
10690 """
10691 SetDimension(self, Point pos, Size size)
10692
10693 Set the position and size of the space allocated for this item by the
10694 sizer, and adjust the position and size of the item (window or
10695 subsizer) to be within that space taking alignment and borders into
10696 account.
10697 """
54f9ee45 10698 return _core_.SizerItem_SetDimension(*args, **kwargs)
e811c8ce
RD
10699
10700 def GetMinSize(*args, **kwargs):
248ed943
RD
10701 """
10702 GetMinSize(self) -> Size
10703
10704 Get the minimum size needed for the item.
10705 """
54f9ee45 10706 return _core_.SizerItem_GetMinSize(*args, **kwargs)
e811c8ce 10707
dfbb5885
RD
10708 def GetMinSizeWithBorder(*args, **kwargs):
10709 """
10710 GetMinSizeWithBorder(self) -> Size
10711
10712 Get the minimum size needed for the item with space for the borders
10713 added, if needed.
10714 """
10715 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
10716
e811c8ce 10717 def SetInitSize(*args, **kwargs):
a95a7133 10718 """SetInitSize(self, int x, int y)"""
54f9ee45 10719 return _core_.SizerItem_SetInitSize(*args, **kwargs)
e811c8ce
RD
10720
10721 def SetRatioWH(*args, **kwargs):
248ed943
RD
10722 """
10723 SetRatioWH(self, int width, int height)
10724
10725 Set the ratio item attribute.
10726 """
54f9ee45 10727 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
e811c8ce
RD
10728
10729 def SetRatioSize(*args, **kwargs):
248ed943
RD
10730 """
10731 SetRatioSize(self, Size size)
10732
10733 Set the ratio item attribute.
10734 """
54f9ee45 10735 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
e811c8ce
RD
10736
10737 def SetRatio(*args, **kwargs):
248ed943
RD
10738 """
10739 SetRatio(self, float ratio)
10740
10741 Set the ratio item attribute.
10742 """
54f9ee45 10743 return _core_.SizerItem_SetRatio(*args, **kwargs)
e811c8ce
RD
10744
10745 def GetRatio(*args, **kwargs):
248ed943
RD
10746 """
10747 GetRatio(self) -> float
10748
10749 Set the ratio item attribute.
10750 """
54f9ee45 10751 return _core_.SizerItem_GetRatio(*args, **kwargs)
e811c8ce 10752
d3b6e4ff
RD
10753 def GetRect(*args, **kwargs):
10754 """
10755 GetRect(self) -> Rect
10756
10757 Returns the rectangle that the sizer item should occupy
10758 """
10759 return _core_.SizerItem_GetRect(*args, **kwargs)
10760
e811c8ce 10761 def IsWindow(*args, **kwargs):
248ed943
RD
10762 """
10763 IsWindow(self) -> bool
10764
10765 Is this sizer item a window?
10766 """
54f9ee45 10767 return _core_.SizerItem_IsWindow(*args, **kwargs)
e811c8ce
RD
10768
10769 def IsSizer(*args, **kwargs):
248ed943
RD
10770 """
10771 IsSizer(self) -> bool
10772
10773 Is this sizer item a subsizer?
10774 """
54f9ee45 10775 return _core_.SizerItem_IsSizer(*args, **kwargs)
e811c8ce
RD
10776
10777 def IsSpacer(*args, **kwargs):
248ed943
RD
10778 """
10779 IsSpacer(self) -> bool
10780
10781 Is this sizer item a spacer?
10782 """
54f9ee45 10783 return _core_.SizerItem_IsSpacer(*args, **kwargs)
e811c8ce
RD
10784
10785 def SetProportion(*args, **kwargs):
248ed943
RD
10786 """
10787 SetProportion(self, int proportion)
10788
10789 Set the proportion value for this item.
10790 """
54f9ee45 10791 return _core_.SizerItem_SetProportion(*args, **kwargs)
e811c8ce
RD
10792
10793 def GetProportion(*args, **kwargs):
248ed943
RD
10794 """
10795 GetProportion(self) -> int
10796
10797 Get the proportion value for this item.
10798 """
54f9ee45 10799 return _core_.SizerItem_GetProportion(*args, **kwargs)
e811c8ce 10800
248ed943
RD
10801 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10802 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
e811c8ce 10803 def SetFlag(*args, **kwargs):
248ed943
RD
10804 """
10805 SetFlag(self, int flag)
10806
10807 Set the flag value for this item.
10808 """
54f9ee45 10809 return _core_.SizerItem_SetFlag(*args, **kwargs)
e811c8ce
RD
10810
10811 def GetFlag(*args, **kwargs):
248ed943
RD
10812 """
10813 GetFlag(self) -> int
10814
10815 Get the flag value for this item.
10816 """
54f9ee45 10817 return _core_.SizerItem_GetFlag(*args, **kwargs)
e811c8ce
RD
10818
10819 def SetBorder(*args, **kwargs):
248ed943
RD
10820 """
10821 SetBorder(self, int border)
10822
10823 Set the border value for this item.
10824 """
54f9ee45 10825 return _core_.SizerItem_SetBorder(*args, **kwargs)
e811c8ce
RD
10826
10827 def GetBorder(*args, **kwargs):
248ed943
RD
10828 """
10829 GetBorder(self) -> int
10830
10831 Get the border value for this item.
10832 """
54f9ee45 10833 return _core_.SizerItem_GetBorder(*args, **kwargs)
e811c8ce
RD
10834
10835 def GetWindow(*args, **kwargs):
248ed943
RD
10836 """
10837 GetWindow(self) -> Window
10838
10839 Get the window (if any) that is managed by this sizer item.
10840 """
54f9ee45 10841 return _core_.SizerItem_GetWindow(*args, **kwargs)
e811c8ce
RD
10842
10843 def SetWindow(*args, **kwargs):
248ed943
RD
10844 """
10845 SetWindow(self, Window window)
10846
10847 Set the window to be managed by this sizer item.
10848 """
54f9ee45 10849 return _core_.SizerItem_SetWindow(*args, **kwargs)
e811c8ce
RD
10850
10851 def GetSizer(*args, **kwargs):
248ed943
RD
10852 """
10853 GetSizer(self) -> Sizer
10854
10855 Get the subsizer (if any) that is managed by this sizer item.
10856 """
54f9ee45 10857 return _core_.SizerItem_GetSizer(*args, **kwargs)
e811c8ce
RD
10858
10859 def SetSizer(*args, **kwargs):
248ed943
RD
10860 """
10861 SetSizer(self, Sizer sizer)
10862
10863 Set the subsizer to be managed by this sizer item.
10864 """
54f9ee45 10865 return _core_.SizerItem_SetSizer(*args, **kwargs)
e811c8ce
RD
10866
10867 def GetSpacer(*args, **kwargs):
248ed943
RD
10868 """
10869 GetSpacer(self) -> Size
10870
10871 Get the size of the spacer managed by this sizer item.
10872 """
54f9ee45 10873 return _core_.SizerItem_GetSpacer(*args, **kwargs)
e811c8ce
RD
10874
10875 def SetSpacer(*args, **kwargs):
248ed943
RD
10876 """
10877 SetSpacer(self, Size size)
10878
10879 Set the size of the spacer to be managed by this sizer item.
10880 """
54f9ee45 10881 return _core_.SizerItem_SetSpacer(*args, **kwargs)
e811c8ce
RD
10882
10883 def Show(*args, **kwargs):
248ed943
RD
10884 """
10885 Show(self, bool show)
10886
10887 Set the show item attribute, which sizers use to determine if the item
10888 is to be made part of the layout or not. If the item is tracking a
10889 window then it is shown or hidden as needed.
10890 """
54f9ee45 10891 return _core_.SizerItem_Show(*args, **kwargs)
e811c8ce
RD
10892
10893 def IsShown(*args, **kwargs):
248ed943
RD
10894 """
10895 IsShown(self) -> bool
10896
10897 Is the item to be shown in the layout?
10898 """
54f9ee45 10899 return _core_.SizerItem_IsShown(*args, **kwargs)
e811c8ce
RD
10900
10901 def GetPosition(*args, **kwargs):
248ed943
RD
10902 """
10903 GetPosition(self) -> Point
10904
10905 Returns the current position of the item, as set in the last Layout.
10906 """
54f9ee45 10907 return _core_.SizerItem_GetPosition(*args, **kwargs)
e811c8ce
RD
10908
10909 def GetUserData(*args, **kwargs):
248ed943
RD
10910 """
10911 GetUserData(self) -> PyObject
10912
10913 Returns the userData associated with this sizer item, or None if there
10914 isn't any.
10915 """
54f9ee45 10916 return _core_.SizerItem_GetUserData(*args, **kwargs)
e811c8ce 10917
091f5bed
RD
10918 def SetUserData(*args, **kwargs):
10919 """
10920 SetUserData(self, PyObject userData)
10921
10922 Associate a Python object with this sizer item.
10923 """
10924 return _core_.SizerItem_SetUserData(*args, **kwargs)
10925
2131d850 10926_core_.SizerItem_swigregister(SizerItem)
d14a1e28 10927
248ed943 10928def SizerItemWindow(*args, **kwargs):
0df68c9f 10929 """
248ed943
RD
10930 SizerItemWindow(Window window, int proportion, int flag, int border,
10931 PyObject userData=None) -> SizerItem
10932
10933 Constructs a `wx.SizerItem` for tracking a window.
0df68c9f 10934 """
248ed943 10935 val = _core_.new_SizerItemWindow(*args, **kwargs)
d14a1e28
RD
10936 return val
10937
248ed943 10938def SizerItemSpacer(*args, **kwargs):
0df68c9f 10939 """
248ed943
RD
10940 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
10941 PyObject userData=None) -> SizerItem
10942
10943 Constructs a `wx.SizerItem` for tracking a spacer.
0df68c9f 10944 """
248ed943 10945 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d14a1e28
RD
10946 return val
10947
10948def SizerItemSizer(*args, **kwargs):
0df68c9f
RD
10949 """
10950 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
10951 PyObject userData=None) -> SizerItem
10952
10953 Constructs a `wx.SizerItem` for tracking a subsizer
0df68c9f 10954 """
54f9ee45 10955 val = _core_.new_SizerItemSizer(*args, **kwargs)
d14a1e28
RD
10956 return val
10957
10958class Sizer(Object):
248ed943
RD
10959 """
10960 wx.Sizer is the abstract base class used for laying out subwindows in
10961 a window. You cannot use wx.Sizer directly; instead, you will have to
10962 use one of the sizer classes derived from it such as `wx.BoxSizer`,
10963 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
10964 and `wx.GridBagSizer`.
10965
10966 The concept implemented by sizers in wxWidgets is closely related to
10967 layout tools in other GUI toolkits, such as Java's AWT, the GTK
10968 toolkit or the Qt toolkit. It is based upon the idea of the individual
10969 subwindows reporting their minimal required size and their ability to
10970 get stretched if the size of the parent window has changed. This will
10971 most often mean that the programmer does not set the original size of
10972 a dialog in the beginning, rather the dialog will assigned a sizer and
10973 this sizer will be queried about the recommended size. The sizer in
10974 turn will query its children, which can be normal windows or contorls,
10975 empty space or other sizers, so that a hierarchy of sizers can be
10976 constructed. Note that wxSizer does not derive from wxWindow and thus
10977 do not interfere with tab ordering and requires very little resources
10978 compared to a real window on screen.
10979
10980 What makes sizers so well fitted for use in wxWidgets is the fact that
10981 every control reports its own minimal size and the algorithm can
10982 handle differences in font sizes or different window (dialog item)
10983 sizes on different platforms without problems. If for example the
10984 standard font as well as the overall design of Mac widgets requires
10985 more space than on Windows, then the initial size of a dialog using a
10986 sizer will automatically be bigger on Mac than on Windows.
10987 """
0085ce49
RD
10988 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10989 def __init__(self): raise AttributeError, "No constructor defined"
10990 __repr__ = _swig_repr
10991 __swig_destroy__ = _core_.delete_Sizer
10992 __del__ = lambda self : None;
e811c8ce 10993 def _setOORInfo(*args, **kwargs):
a95a7133 10994 """_setOORInfo(self, PyObject _self)"""
54f9ee45 10995 return _core_.Sizer__setOORInfo(*args, **kwargs)
e811c8ce
RD
10996
10997 def Add(*args, **kwargs):
0df68c9f 10998 """
248ed943 10999 Add(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11000 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11001
11002 Appends a child item to the sizer.
0df68c9f 11003 """
54f9ee45 11004 return _core_.Sizer_Add(*args, **kwargs)
e811c8ce
RD
11005
11006 def Insert(*args, **kwargs):
0df68c9f 11007 """
248ed943 11008 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11009 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11010
11011 Inserts a new item into the list of items managed by this sizer before
11012 the item at index *before*. See `Add` for a description of the parameters.
0df68c9f 11013 """
54f9ee45 11014 return _core_.Sizer_Insert(*args, **kwargs)
e811c8ce
RD
11015
11016 def Prepend(*args, **kwargs):
0df68c9f 11017 """
248ed943 11018 Prepend(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11019 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11020
11021 Adds a new item to the begining of the list of sizer items managed by
11022 this sizer. See `Add` for a description of the parameters.
0df68c9f 11023 """
54f9ee45 11024 return _core_.Sizer_Prepend(*args, **kwargs)
e811c8ce
RD
11025
11026 def Remove(*args, **kwargs):
248ed943
RD
11027 """
11028 Remove(self, item) -> bool
11029
11030 Removes an item from the sizer and destroys it. This method does not
11031 cause any layout or resizing to take place, call `Layout` to update
11032 the layout on screen after removing a child from the sizer. The
11033 *item* parameter can be either a window, a sizer, or the zero-based
11034 index of an item to remove. Returns True if the child item was found
11035 and removed.
11036 """
54f9ee45 11037 return _core_.Sizer_Remove(*args, **kwargs)
e811c8ce 11038
1c0f361b 11039 def Detach(*args, **kwargs):
248ed943
RD
11040 """
11041 Detach(self, item) -> bool
11042
11043 Detaches an item from the sizer without destroying it. This method
11044 does not cause any layout or resizing to take place, call `Layout` to
11045 do so. The *item* parameter can be either a window, a sizer, or the
11046 zero-based index of the item to be detached. Returns True if the child item
11047 was found and detached.
11048 """
1c0f361b
RD
11049 return _core_.Sizer_Detach(*args, **kwargs)
11050
d3b6e4ff
RD
11051 def GetItem(*args, **kwargs):
11052 """
11053 GetItem(self, item) -> wx.SizerItem
11054
11055 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11056 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11057 the item to be found.
d3b6e4ff
RD
11058 """
11059 return _core_.Sizer_GetItem(*args, **kwargs)
11060
e811c8ce 11061 def _SetItemMinSize(*args, **kwargs):
a95a7133 11062 """_SetItemMinSize(self, PyObject item, Size size)"""
54f9ee45 11063 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
e811c8ce 11064
248ed943
RD
11065 def SetItemMinSize(self, item, *args):
11066 """
11067 SetItemMinSize(self, item, Size size)
11068
11069 Sets the minimum size that will be allocated for an item in the sizer.
11070 The *item* parameter can be either a window, a sizer, or the
11071 zero-based index of the item. If a window or sizer is given then it
11072 will be searched for recursivly in subsizers if neccessary.
11073 """
11074 if len(args) == 2:
11075 # for backward compatibility accept separate width,height args too
11076 return self._SetItemMinSize(item, args)
11077 else:
11078 return self._SetItemMinSize(item, args[0])
11079
e811c8ce 11080 def AddItem(*args, **kwargs):
248ed943
RD
11081 """
11082 AddItem(self, SizerItem item)
11083
11084 Adds a `wx.SizerItem` to the sizer.
11085 """
54f9ee45 11086 return _core_.Sizer_AddItem(*args, **kwargs)
e811c8ce
RD
11087
11088 def InsertItem(*args, **kwargs):
248ed943
RD
11089 """
11090 InsertItem(self, int index, SizerItem item)
11091
11092 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11093 """
54f9ee45 11094 return _core_.Sizer_InsertItem(*args, **kwargs)
e811c8ce
RD
11095
11096 def PrependItem(*args, **kwargs):
248ed943
RD
11097 """
11098 PrependItem(self, SizerItem item)
11099
11100 Prepends a `wx.SizerItem` to the sizer.
11101 """
54f9ee45 11102 return _core_.Sizer_PrependItem(*args, **kwargs)
e811c8ce 11103
248ed943 11104 def AddMany(self, items):
66c033b4
RD
11105 """
11106 AddMany is a convenience method for adding several items
11107 to a sizer at one time. Simply pass it a list of tuples,
11108 where each tuple consists of the parameters that you
11109 would normally pass to the `Add` method.
11110 """
248ed943
RD
11111 for item in items:
11112 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11113 item = (item, )
11114 self.Add(*item)
d14a1e28 11115
74e96f3d 11116 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
11117 def AddWindow(self, *args, **kw):
11118 """Compatibility alias for `Add`."""
11119 return self.Add(*args, **kw)
11120 def AddSizer(self, *args, **kw):
11121 """Compatibility alias for `Add`."""
11122 return self.Add(*args, **kw)
11123 def AddSpacer(self, *args, **kw):
11124 """Compatibility alias for `Add`."""
11125 return self.Add(*args, **kw)
11126
11127 def PrependWindow(self, *args, **kw):
11128 """Compatibility alias for `Prepend`."""
11129 return self.Prepend(*args, **kw)
11130 def PrependSizer(self, *args, **kw):
11131 """Compatibility alias for `Prepend`."""
11132 return self.Prepend(*args, **kw)
11133 def PrependSpacer(self, *args, **kw):
11134 """Compatibility alias for `Prepend`."""
11135 return self.Prepend(*args, **kw)
11136
11137 def InsertWindow(self, *args, **kw):
11138 """Compatibility alias for `Insert`."""
11139 return self.Insert(*args, **kw)
11140 def InsertSizer(self, *args, **kw):
11141 """Compatibility alias for `Insert`."""
11142 return self.Insert(*args, **kw)
11143 def InsertSpacer(self, *args, **kw):
11144 """Compatibility alias for `Insert`."""
11145 return self.Insert(*args, **kw)
11146
11147 def RemoveWindow(self, *args, **kw):
11148 """Compatibility alias for `Remove`."""
11149 return self.Remove(*args, **kw)
11150 def RemoveSizer(self, *args, **kw):
11151 """Compatibility alias for `Remove`."""
11152 return self.Remove(*args, **kw)
11153 def RemovePos(self, *args, **kw):
11154 """Compatibility alias for `Remove`."""
11155 return self.Remove(*args, **kw)
d14a1e28
RD
11156
11157
e811c8ce 11158 def SetDimension(*args, **kwargs):
248ed943
RD
11159 """
11160 SetDimension(self, int x, int y, int width, int height)
11161
11162 Call this to force the sizer to take the given dimension and thus
11163 force the items owned by the sizer to resize themselves according to
11164 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11165 methods.
11166 """
54f9ee45 11167 return _core_.Sizer_SetDimension(*args, **kwargs)
e811c8ce
RD
11168
11169 def SetMinSize(*args, **kwargs):
248ed943
RD
11170 """
11171 SetMinSize(self, Size size)
11172
11173 Call this to give the sizer a minimal size. Normally, the sizer will
11174 calculate its minimal size based purely on how much space its children
11175 need. After calling this method `GetMinSize` will return either the
11176 minimal size as requested by its children or the minimal size set
11177 here, depending on which is bigger.
11178 """
54f9ee45 11179 return _core_.Sizer_SetMinSize(*args, **kwargs)
e811c8ce
RD
11180
11181 def GetSize(*args, **kwargs):
248ed943
RD
11182 """
11183 GetSize(self) -> Size
11184
11185 Returns the current size of the space managed by the sizer.
11186 """
54f9ee45 11187 return _core_.Sizer_GetSize(*args, **kwargs)
e811c8ce
RD
11188
11189 def GetPosition(*args, **kwargs):
248ed943
RD
11190 """
11191 GetPosition(self) -> Point
11192
11193 Returns the current position of the sizer's managed space.
11194 """
54f9ee45 11195 return _core_.Sizer_GetPosition(*args, **kwargs)
e811c8ce
RD
11196
11197 def GetMinSize(*args, **kwargs):
248ed943
RD
11198 """
11199 GetMinSize(self) -> Size
11200
11201 Returns the minimal size of the sizer. This is either the combined
11202 minimal size of all the children and their borders or the minimal size
11203 set by SetMinSize, depending on which is bigger.
11204 """
54f9ee45 11205 return _core_.Sizer_GetMinSize(*args, **kwargs)
e811c8ce 11206
d14a1e28 11207 def GetSizeTuple(self):
1c0f361b 11208 return self.GetSize().Get()
d14a1e28 11209 def GetPositionTuple(self):
1c0f361b 11210 return self.GetPosition().Get()
d14a1e28 11211 def GetMinSizeTuple(self):
1c0f361b 11212 return self.GetMinSize().Get()
d14a1e28 11213
e811c8ce 11214 def RecalcSizes(*args, **kwargs):
248ed943
RD
11215 """
11216 RecalcSizes(self)
11217
11218 Using the sizes calculated by `CalcMin` reposition and resize all the
11219 items managed by this sizer. You should not need to call this directly as
11220 it is called by `Layout`.
11221 """
54f9ee45 11222 return _core_.Sizer_RecalcSizes(*args, **kwargs)
e811c8ce
RD
11223
11224 def CalcMin(*args, **kwargs):
248ed943
RD
11225 """
11226 CalcMin(self) -> Size
11227
11228 This method is where the sizer will do the actual calculation of its
11229 children's minimal sizes. You should not need to call this directly as
11230 it is called by `Layout`.
11231 """
54f9ee45 11232 return _core_.Sizer_CalcMin(*args, **kwargs)
e811c8ce
RD
11233
11234 def Layout(*args, **kwargs):
248ed943
RD
11235 """
11236 Layout(self)
11237
11238 This method will force the recalculation and layout of the items
11239 controlled by the sizer using the current space allocated to the
11240 sizer. Normally this is called automatically from the owning window's
11241 EVT_SIZE handler, but it is also useful to call it from user code when
11242 one of the items in a sizer change size, or items are added or
11243 removed.
11244 """
54f9ee45 11245 return _core_.Sizer_Layout(*args, **kwargs)
e811c8ce
RD
11246
11247 def Fit(*args, **kwargs):
248ed943
RD
11248 """
11249 Fit(self, Window window) -> Size
11250
11251 Tell the sizer to resize the *window* to match the sizer's minimal
11252 size. This is commonly done in the constructor of the window itself in
11253 order to set its initial size to match the needs of the children as
11254 determined by the sizer. Returns the new size.
11255
11256 For a top level window this is the total window size, not the client size.
11257 """
54f9ee45 11258 return _core_.Sizer_Fit(*args, **kwargs)
e811c8ce
RD
11259
11260 def FitInside(*args, **kwargs):
248ed943
RD
11261 """
11262 FitInside(self, Window window)
11263
11264 Tell the sizer to resize the *virtual size* of the *window* to match the
11265 sizer's minimal size. This will not alter the on screen size of the
11266 window, but may cause the addition/removal/alteration of scrollbars
11267 required to view the virtual area in windows which manage it.
11268
11269 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11270
11271 """
54f9ee45 11272 return _core_.Sizer_FitInside(*args, **kwargs)
e811c8ce
RD
11273
11274 def SetSizeHints(*args, **kwargs):
248ed943
RD
11275 """
11276 SetSizeHints(self, Window window)
11277
11278 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11279 match the sizer's minimal size. This is commonly done in the
11280 constructor of the window itself if the window is resizable (as are
11281 many dialogs under Unix and frames on probably all platforms) in order
11282 to prevent the window from being sized smaller than the minimal size
11283 required by the sizer.
11284 """
54f9ee45 11285 return _core_.Sizer_SetSizeHints(*args, **kwargs)
e811c8ce
RD
11286
11287 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
11288 """
11289 SetVirtualSizeHints(self, Window window)
11290
11291 Tell the sizer to set the minimal size of the window virtual area to
11292 match the sizer's minimal size. For windows with managed scrollbars
11293 this will set them appropriately.
11294
11295 :see: `wx.ScrolledWindow.SetScrollbars`
11296
11297 """
54f9ee45 11298 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
e811c8ce
RD
11299
11300 def Clear(*args, **kwargs):
248ed943
RD
11301 """
11302 Clear(self, bool deleteWindows=False)
11303
11304 Clear all items from the sizer, optionally destroying the window items
11305 as well.
11306 """
54f9ee45 11307 return _core_.Sizer_Clear(*args, **kwargs)
e811c8ce
RD
11308
11309 def DeleteWindows(*args, **kwargs):
248ed943
RD
11310 """
11311 DeleteWindows(self)
11312
11313 Destroy all windows managed by the sizer.
11314 """
54f9ee45 11315 return _core_.Sizer_DeleteWindows(*args, **kwargs)
e811c8ce
RD
11316
11317 def GetChildren(*args, **kwargs):
248ed943 11318 """
51b83b37 11319 GetChildren(self) -> list
248ed943
RD
11320
11321 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11322 """
54f9ee45 11323 return _core_.Sizer_GetChildren(*args, **kwargs)
e811c8ce
RD
11324
11325 def Show(*args, **kwargs):
248ed943 11326 """
ae8162c8 11327 Show(self, item, bool show=True, bool recursive=false) -> bool
e811c8ce 11328
248ed943
RD
11329 Shows or hides an item managed by the sizer. To make a sizer item
11330 disappear or reappear, use Show followed by `Layout`. The *item*
11331 parameter can be either a window, a sizer, or the zero-based index of
7e63a440
RD
11332 the item. Use the recursive parameter to show or hide an item in a
11333 subsizer. Returns True if the item was found.
248ed943
RD
11334 """
11335 return _core_.Sizer_Show(*args, **kwargs)
e811c8ce
RD
11336
11337 def IsShown(*args, **kwargs):
248ed943
RD
11338 """
11339 IsShown(self, item)
11340
b1fcee84 11341 Determines if the item is currently shown. To make a sizer
248ed943
RD
11342 item disappear or reappear, use Show followed by `Layout`. The *item*
11343 parameter can be either a window, a sizer, or the zero-based index of
11344 the item.
11345 """
54f9ee45 11346 return _core_.Sizer_IsShown(*args, **kwargs)
e811c8ce 11347
7e63a440 11348 def Hide(self, item, recursive=False):
248ed943 11349 """
27fb7603 11350 A convenience method for `Show` (item, False, recursive).
248ed943 11351 """
06759a38 11352 return self.Show(item, False, recursive)
248ed943 11353
e811c8ce 11354 def ShowItems(*args, **kwargs):
248ed943
RD
11355 """
11356 ShowItems(self, bool show)
11357
84f85550 11358 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 11359 """
54f9ee45 11360 return _core_.Sizer_ShowItems(*args, **kwargs)
e811c8ce 11361
2131d850 11362_core_.Sizer_swigregister(Sizer)
d14a1e28
RD
11363
11364class PySizer(Sizer):
248ed943
RD
11365 """
11366 wx.PySizer is a special version of `wx.Sizer` that has been
11367 instrumented to allow the C++ virtual methods to be overloaded in
11368 Python derived classes. You would derive from this class if you are
11369 wanting to implement a custom sizer in Python code. Simply implement
11370 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11371 For example::
11372
11373 class MySizer(wx.PySizer):
11374 def __init__(self):
11375 wx.PySizer.__init__(self)
11376
11377 def CalcMin(self):
11378 for item in self.GetChildren():
11379 # calculate the total minimum width and height needed
11380 # by all items in the sizer according to this sizer's
11381 # layout algorithm.
11382 ...
11383 return wx.Size(width, height)
11384
11385 def RecalcSizes(self):
11386 # find the space allotted to this sizer
11387 pos = self.GetPosition()
11388 size = self.GetSize()
11389 for item in self.GetChildren():
11390 # Recalculate (if necessary) the position and size of
11391 # each item and then call item.SetDimension to do the
11392 # actual positioning and sizing of the items within the
11393 # space alloted to this sizer.
11394 ...
11395 item.SetDimension(itemPos, itemSize)
11396
11397
11398 When `Layout` is called it first calls `CalcMin` followed by
11399 `RecalcSizes` so you can optimize a bit by saving the results of
e505d15e 11400 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
11401
11402 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11403
11404
11405 """
0085ce49
RD
11406 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11407 __repr__ = _swig_repr
11408 def __init__(self, *args, **kwargs):
248ed943
RD
11409 """
11410 __init__(self) -> PySizer
11411
11412 Creates a wx.PySizer. Must be called from the __init__ in the derived
11413 class.
11414 """
0085ce49 11415 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
d14a1e28 11416 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
e811c8ce
RD
11417
11418 def _setCallbackInfo(*args, **kwargs):
a95a7133 11419 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 11420 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
e811c8ce 11421
2131d850 11422_core_.PySizer_swigregister(PySizer)
d14a1e28
RD
11423
11424#---------------------------------------------------------------------------
11425
11426class BoxSizer(Sizer):
248ed943
RD
11427 """
11428 The basic idea behind a box sizer is that windows will most often be
11429 laid out in rather simple basic geometry, typically in a row or a
11430 column or nested hierarchies of either. A wx.BoxSizer will lay out
11431 its items in a simple row or column, depending on the orientation
11432 parameter passed to the constructor.
11433 """
0085ce49
RD
11434 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11435 __repr__ = _swig_repr
11436 def __init__(self, *args, **kwargs):
248ed943
RD
11437 """
11438 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11439
11440 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11441 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11442 sizer.
11443 """
0085ce49 11444 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d14a1e28 11445 self._setOORInfo(self)
e811c8ce
RD
11446
11447 def GetOrientation(*args, **kwargs):
248ed943
RD
11448 """
11449 GetOrientation(self) -> int
11450
11451 Returns the current orientation of the sizer.
11452 """
54f9ee45 11453 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
e811c8ce
RD
11454
11455 def SetOrientation(*args, **kwargs):
248ed943
RD
11456 """
11457 SetOrientation(self, int orient)
e811c8ce 11458
248ed943
RD
11459 Resets the orientation of the sizer.
11460 """
11461 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
e811c8ce 11462
2131d850 11463_core_.BoxSizer_swigregister(BoxSizer)
d14a1e28
RD
11464
11465#---------------------------------------------------------------------------
11466
11467class StaticBoxSizer(BoxSizer):
248ed943
RD
11468 """
11469 wx.StaticBoxSizer derives from and functions identically to the
11470 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11471 manages. Note that this static box must be created separately and
11472 passed to the sizer constructor.
11473 """
0085ce49
RD
11474 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11475 __repr__ = _swig_repr
11476 def __init__(self, *args, **kwargs):
248ed943
RD
11477 """
11478 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11479
11480 Constructor. It takes an associated static box and the orientation
11481 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11482 ``wx.HORIZONTAL``.
11483 """
0085ce49 11484 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d14a1e28 11485 self._setOORInfo(self)
e811c8ce
RD
11486
11487 def GetStaticBox(*args, **kwargs):
248ed943
RD
11488 """
11489 GetStaticBox(self) -> StaticBox
e811c8ce 11490
248ed943
RD
11491 Returns the static box associated with this sizer.
11492 """
11493 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
e811c8ce 11494
2131d850 11495_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d14a1e28
RD
11496
11497#---------------------------------------------------------------------------
11498
11499class GridSizer(Sizer):
248ed943
RD
11500 """
11501 A grid sizer is a sizer which lays out its children in a
11502 two-dimensional table with all cells having the same size. In other
11503 words, the width of each cell within the grid is the width of the
11504 widest item added to the sizer and the height of each grid cell is the
11505 height of the tallest item. An optional vertical and/or horizontal
11506 gap between items can also be specified (in pixels.)
11507
11508 Items are placed in the cells of the grid in the order they are added,
11509 in row-major order. In other words, the first row is filled first,
11510 then the second, and so on until all items have been added. (If
11511 neccessary, additional rows will be added as items are added.) If you
11512 need to have greater control over the cells that items are placed in
11513 then use the `wx.GridBagSizer`.
11514
11515 """
0085ce49
RD
11516 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11517 __repr__ = _swig_repr
11518 def __init__(self, *args, **kwargs):
248ed943
RD
11519 """
11520 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11521
11522 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11523 of columns and rows in the sizer - if either of the parameters is
11524 zero, it will be calculated to from the total number of children in
11525 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11526 define extra space between all children.
11527 """
0085ce49 11528 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d14a1e28 11529 self._setOORInfo(self)
e811c8ce 11530
e811c8ce 11531 def SetCols(*args, **kwargs):
248ed943
RD
11532 """
11533 SetCols(self, int cols)
11534
11535 Sets the number of columns in the sizer.
11536 """
54f9ee45 11537 return _core_.GridSizer_SetCols(*args, **kwargs)
e811c8ce
RD
11538
11539 def SetRows(*args, **kwargs):
248ed943
RD
11540 """
11541 SetRows(self, int rows)
11542
11543 Sets the number of rows in the sizer.
11544 """
54f9ee45 11545 return _core_.GridSizer_SetRows(*args, **kwargs)
e811c8ce
RD
11546
11547 def SetVGap(*args, **kwargs):
248ed943
RD
11548 """
11549 SetVGap(self, int gap)
11550
11551 Sets the vertical gap (in pixels) between the cells in the sizer.
11552 """
54f9ee45 11553 return _core_.GridSizer_SetVGap(*args, **kwargs)
e811c8ce
RD
11554
11555 def SetHGap(*args, **kwargs):
248ed943
RD
11556 """
11557 SetHGap(self, int gap)
11558
11559 Sets the horizontal gap (in pixels) between cells in the sizer
11560 """
54f9ee45 11561 return _core_.GridSizer_SetHGap(*args, **kwargs)
e811c8ce
RD
11562
11563 def GetCols(*args, **kwargs):
248ed943
RD
11564 """
11565 GetCols(self) -> int
11566
11567 Returns the number of columns in the sizer.
11568 """
54f9ee45 11569 return _core_.GridSizer_GetCols(*args, **kwargs)
e811c8ce
RD
11570
11571 def GetRows(*args, **kwargs):
248ed943
RD
11572 """
11573 GetRows(self) -> int
11574
11575 Returns the number of rows in the sizer.
11576 """
54f9ee45 11577 return _core_.GridSizer_GetRows(*args, **kwargs)
e811c8ce
RD
11578
11579 def GetVGap(*args, **kwargs):
248ed943
RD
11580 """
11581 GetVGap(self) -> int
11582
11583 Returns the vertical gap (in pixels) between the cells in the sizer.
11584 """
54f9ee45 11585 return _core_.GridSizer_GetVGap(*args, **kwargs)
e811c8ce
RD
11586
11587 def GetHGap(*args, **kwargs):
248ed943
RD
11588 """
11589 GetHGap(self) -> int
11590
11591 Returns the horizontal gap (in pixels) between cells in the sizer.
11592 """
54f9ee45 11593 return _core_.GridSizer_GetHGap(*args, **kwargs)
e811c8ce 11594
0085ce49
RD
11595 def CalcRowsCols(self):
11596 """
11597 CalcRowsCols() -> (rows, cols)
11598
11599 Calculates how many rows and columns will be in the sizer based
11600 on the current number of items and also the rows, cols specified
11601 in the constructor.
11602 """
11603 nitems = len(self.GetChildren())
11604 rows = self.GetRows()
11605 cols = self.GetCols()
11606 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11607 if cols != 0:
11608 rows = (nitems + cols - 1) / cols
11609 elif rows != 0:
11610 cols = (nitems + rows - 1) / rows
11611 return (rows, cols)
d14a1e28 11612
2131d850 11613_core_.GridSizer_swigregister(GridSizer)
d14a1e28
RD
11614
11615#---------------------------------------------------------------------------
11616
54f9ee45
RD
11617FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11618FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11619FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
d14a1e28 11620class FlexGridSizer(GridSizer):
248ed943
RD
11621 """
11622 A flex grid sizer is a sizer which lays out its children in a
11623 two-dimensional table with all table cells in one row having the same
11624 height and all cells in one column having the same width, but all
11625 rows or all columns are not necessarily the same height or width as in
11626 the `wx.GridSizer`.
11627
11628 wx.FlexGridSizer can also size items equally in one direction but
11629 unequally ("flexibly") in the other. If the sizer is only flexible
11630 in one direction (this can be changed using `SetFlexibleDirection`), it
11631 needs to be decided how the sizer should grow in the other ("non
11632 flexible") direction in order to fill the available space. The
11633 `SetNonFlexibleGrowMode` method serves this purpose.
11634
11635
11636 """
0085ce49
RD
11637 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11638 __repr__ = _swig_repr
11639 def __init__(self, *args, **kwargs):
248ed943
RD
11640 """
11641 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11642
11643 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11644 number of columns and rows in the sizer - if either of the parameters
11645 is zero, it will be calculated to from the total number of children in
11646 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11647 define extra space between all children.
11648 """
0085ce49 11649 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d14a1e28 11650 self._setOORInfo(self)
e811c8ce 11651
248ed943
RD
11652 def AddGrowableRow(*args, **kwargs):
11653 """
11654 AddGrowableRow(self, size_t idx, int proportion=0)
e811c8ce 11655
248ed943
RD
11656 Specifies that row *idx* (starting from zero) should be grown if there
11657 is extra space available to the sizer.
e811c8ce 11658
248ed943
RD
11659 The *proportion* parameter has the same meaning as the stretch factor
11660 for the box sizers except that if all proportions are 0, then all
11661 columns are resized equally (instead of not being resized at all).
11662 """
54f9ee45 11663 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
e811c8ce
RD
11664
11665 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
11666 """
11667 RemoveGrowableRow(self, size_t idx)
11668
11669 Specifies that row *idx* is no longer growable.
11670 """
54f9ee45 11671 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
e811c8ce
RD
11672
11673 def AddGrowableCol(*args, **kwargs):
248ed943
RD
11674 """
11675 AddGrowableCol(self, size_t idx, int proportion=0)
11676
11677 Specifies that column *idx* (starting from zero) should be grown if
11678 there is extra space available to the sizer.
11679
11680 The *proportion* parameter has the same meaning as the stretch factor
11681 for the box sizers except that if all proportions are 0, then all
11682 columns are resized equally (instead of not being resized at all).
11683 """
54f9ee45 11684 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
e811c8ce
RD
11685
11686 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
11687 """
11688 RemoveGrowableCol(self, size_t idx)
11689
11690 Specifies that column *idx* is no longer growable.
11691 """
54f9ee45 11692 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
e811c8ce
RD
11693
11694 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
11695 """
11696 SetFlexibleDirection(self, int direction)
11697
11698 Specifies whether the sizer should flexibly resize its columns, rows,
11699 or both. Argument *direction* can be one of the following values. Any
11700 other value is ignored.
11701
11702 ============== =======================================
11703 wx.VERTICAL Rows are flexibly sized.
11704 wx.HORIZONTAL Columns are flexibly sized.
11705 wx.BOTH Both rows and columns are flexibly sized
11706 (this is the default value).
11707 ============== =======================================
11708
11709 Note that this method does not trigger relayout.
11710
11711 """
54f9ee45 11712 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
11713
11714 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
11715 """
11716 GetFlexibleDirection(self) -> int
11717
11718 Returns a value that specifies whether the sizer
11719 flexibly resizes its columns, rows, or both (default).
11720
11721 :see: `SetFlexibleDirection`
11722 """
54f9ee45 11723 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
11724
11725 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
11726 """
11727 SetNonFlexibleGrowMode(self, int mode)
11728
11729 Specifies how the sizer should grow in the non-flexible direction if
11730 there is one (so `SetFlexibleDirection` must have been called
11731 previously). Argument *mode* can be one of the following values:
11732
11733 ========================== =================================================
11734 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11735 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11736 `AddGrowableCol` and `AddGrowableRow`. In this
11737 case equal sizing applies to minimum sizes of
11738 columns or rows (this is the default value).
11739 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11740 the non flexible direction, whether they are
11741 growable or not in the flexbile direction.
11742 ========================== =================================================
11743
11744 Note that this method does not trigger relayout.
11745
11746
11747 """
54f9ee45 11748 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
11749
11750 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
11751 """
11752 GetNonFlexibleGrowMode(self) -> int
11753
11754 Returns the value that specifies how the sizer grows in the
11755 non-flexible direction if there is one.
11756
11757 :see: `SetNonFlexibleGrowMode`
11758 """
54f9ee45 11759 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
11760
11761 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
11762 """
11763 GetRowHeights(self) -> list
11764
11765 Returns a list of integers representing the heights of each of the
11766 rows in the sizer.
11767 """
54f9ee45 11768 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
e811c8ce
RD
11769
11770 def GetColWidths(*args, **kwargs):
fd2dc343
RD
11771 """
11772 GetColWidths(self) -> list
11773
11774 Returns a list of integers representing the widths of each of the
11775 columns in the sizer.
11776 """
54f9ee45 11777 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
e811c8ce 11778
2131d850 11779_core_.FlexGridSizer_swigregister(FlexGridSizer)
d14a1e28 11780
e505d15e
RD
11781class StdDialogButtonSizer(BoxSizer):
11782 """
11783 A special sizer that knows how to order and position standard buttons
11784 in order to conform to the current platform's standards. You simply
11785 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 11786 buttons using the standard ID's. Then call `Realize` and the sizer
e505d15e
RD
11787 will take care of the rest.
11788
11789 """
0085ce49
RD
11790 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11791 __repr__ = _swig_repr
11792 def __init__(self, *args, **kwargs):
e505d15e 11793 """__init__(self) -> StdDialogButtonSizer"""
0085ce49 11794 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
e505d15e
RD
11795 def AddButton(*args, **kwargs):
11796 """
11797 AddButton(self, wxButton button)
11798
11799 Use this to add the buttons to this sizer. Do not use the `Add`
11800 method in the base class.
11801 """
11802 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
11803
53aa7709 11804 def Realize(*args, **kwargs):
e505d15e 11805 """
53aa7709 11806 Realize(self)
e505d15e
RD
11807
11808 This funciton needs to be called after all the buttons have been added
11809 to the sizer. It will reorder them and position them in a platform
11810 specifc manner.
11811 """
53aa7709 11812 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
11813
11814 def SetAffirmativeButton(*args, **kwargs):
11815 """SetAffirmativeButton(self, wxButton button)"""
11816 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
11817
11818 def SetNegativeButton(*args, **kwargs):
11819 """SetNegativeButton(self, wxButton button)"""
11820 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
11821
11822 def SetCancelButton(*args, **kwargs):
11823 """SetCancelButton(self, wxButton button)"""
11824 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
e505d15e
RD
11825
11826 def GetAffirmativeButton(*args, **kwargs):
11827 """GetAffirmativeButton(self) -> wxButton"""
11828 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
11829
11830 def GetApplyButton(*args, **kwargs):
11831 """GetApplyButton(self) -> wxButton"""
11832 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
11833
11834 def GetNegativeButton(*args, **kwargs):
11835 """GetNegativeButton(self) -> wxButton"""
11836 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
11837
11838 def GetCancelButton(*args, **kwargs):
11839 """GetCancelButton(self) -> wxButton"""
11840 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
11841
11842 def GetHelpButton(*args, **kwargs):
11843 """GetHelpButton(self) -> wxButton"""
11844 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
11845
2131d850 11846_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
e505d15e 11847
d14a1e28
RD
11848#---------------------------------------------------------------------------
11849
11850class GBPosition(object):
248ed943
RD
11851 """
11852 This class represents the position of an item in a virtual grid of
11853 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11854 typemaps that will automatically convert from a 2-element sequence of
11855 integers to a wx.GBPosition, so you can use the more pythonic
11856 representation of the position nearly transparently in Python code.
11857 """
0085ce49
RD
11858 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11859 __repr__ = _swig_repr
11860 def __init__(self, *args, **kwargs):
248ed943
RD
11861 """
11862 __init__(self, int row=0, int col=0) -> GBPosition
11863
11864 This class represents the position of an item in a virtual grid of
11865 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11866 typemaps that will automatically convert from a 2-element sequence of
11867 integers to a wx.GBPosition, so you can use the more pythonic
11868 representation of the position nearly transparently in Python code.
11869 """
0085ce49
RD
11870 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11871 __swig_destroy__ = _core_.delete_GBPosition
11872 __del__ = lambda self : None;
e811c8ce 11873 def GetRow(*args, **kwargs):
a95a7133 11874 """GetRow(self) -> int"""
54f9ee45 11875 return _core_.GBPosition_GetRow(*args, **kwargs)
e811c8ce
RD
11876
11877 def GetCol(*args, **kwargs):
a95a7133 11878 """GetCol(self) -> int"""
54f9ee45 11879 return _core_.GBPosition_GetCol(*args, **kwargs)
e811c8ce
RD
11880
11881 def SetRow(*args, **kwargs):
a95a7133 11882 """SetRow(self, int row)"""
54f9ee45 11883 return _core_.GBPosition_SetRow(*args, **kwargs)
e811c8ce
RD
11884
11885 def SetCol(*args, **kwargs):
a95a7133 11886 """SetCol(self, int col)"""
54f9ee45 11887 return _core_.GBPosition_SetCol(*args, **kwargs)
e811c8ce
RD
11888
11889 def __eq__(*args, **kwargs):
e9d6f3a4
RD
11890 """
11891 __eq__(self, PyObject other) -> bool
11892
11893 Compare GBPosition for equality.
11894 """
54f9ee45 11895 return _core_.GBPosition___eq__(*args, **kwargs)
e811c8ce
RD
11896
11897 def __ne__(*args, **kwargs):
e9d6f3a4
RD
11898 """
11899 __ne__(self, PyObject other) -> bool
11900
11901 Compare GBPosition for inequality.
11902 """
54f9ee45 11903 return _core_.GBPosition___ne__(*args, **kwargs)
e811c8ce
RD
11904
11905 def Set(*args, **kwargs):
a95a7133 11906 """Set(self, int row=0, int col=0)"""
54f9ee45 11907 return _core_.GBPosition_Set(*args, **kwargs)
e811c8ce
RD
11908
11909 def Get(*args, **kwargs):
a95a7133 11910 """Get(self) -> PyObject"""
54f9ee45 11911 return _core_.GBPosition_Get(*args, **kwargs)
e811c8ce 11912
41e2b43e 11913 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
11914 def __str__(self): return str(self.Get())
11915 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11916 def __len__(self): return len(self.Get())
11917 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
11918 def __setitem__(self, index, val):
11919 if index == 0: self.SetRow(val)
11920 elif index == 1: self.SetCol(val)
11921 else: raise IndexError
e811c8ce 11922 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
11923 __safe_for_unpickling__ = True
11924 def __reduce__(self): return (wx.GBPosition, self.Get())
d14a1e28
RD
11925
11926 row = property(GetRow, SetRow)
11927 col = property(GetCol, SetCol)
11928
2131d850 11929_core_.GBPosition_swigregister(GBPosition)
d14a1e28
RD
11930
11931class GBSpan(object):
248ed943
RD
11932 """
11933 This class is used to hold the row and column spanning attributes of
11934 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11935 automatically convert from a 2-element sequence of integers to a
11936 wx.GBSpan, so you can use the more pythonic representation of the span
11937 nearly transparently in Python code.
11938
11939 """
0085ce49
RD
11940 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11941 __repr__ = _swig_repr
11942 def __init__(self, *args, **kwargs):
248ed943
RD
11943 """
11944 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
11945
11946 Construct a new wxGBSpan, optionally setting the rowspan and
11947 colspan. The default is (1,1). (Meaning that the item occupies one
11948 cell in each direction.
11949 """
0085ce49
RD
11950 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
11951 __swig_destroy__ = _core_.delete_GBSpan
11952 __del__ = lambda self : None;
e811c8ce 11953 def GetRowspan(*args, **kwargs):
a95a7133 11954 """GetRowspan(self) -> int"""
54f9ee45 11955 return _core_.GBSpan_GetRowspan(*args, **kwargs)
e811c8ce
RD
11956
11957 def GetColspan(*args, **kwargs):
a95a7133 11958 """GetColspan(self) -> int"""
54f9ee45 11959 return _core_.GBSpan_GetColspan(*args, **kwargs)
e811c8ce
RD
11960
11961 def SetRowspan(*args, **kwargs):
a95a7133 11962 """SetRowspan(self, int rowspan)"""
54f9ee45 11963 return _core_.GBSpan_SetRowspan(*args, **kwargs)
e811c8ce
RD
11964
11965 def SetColspan(*args, **kwargs):
a95a7133 11966 """SetColspan(self, int colspan)"""
54f9ee45 11967 return _core_.GBSpan_SetColspan(*args, **kwargs)
e811c8ce
RD
11968
11969 def __eq__(*args, **kwargs):
e9d6f3a4
RD
11970 """
11971 __eq__(self, PyObject other) -> bool
11972
11973 Compare wxGBSpan for equality.
11974 """
54f9ee45 11975 return _core_.GBSpan___eq__(*args, **kwargs)
e811c8ce
RD
11976
11977 def __ne__(*args, **kwargs):
e9d6f3a4
RD
11978 """
11979 __ne__(self, PyObject other) -> bool
11980
11981 Compare GBSpan for inequality.
11982 """
54f9ee45 11983 return _core_.GBSpan___ne__(*args, **kwargs)
e811c8ce
RD
11984
11985 def Set(*args, **kwargs):
a95a7133 11986 """Set(self, int rowspan=1, int colspan=1)"""
54f9ee45 11987 return _core_.GBSpan_Set(*args, **kwargs)
e811c8ce
RD
11988
11989 def Get(*args, **kwargs):
a95a7133 11990 """Get(self) -> PyObject"""
54f9ee45 11991 return _core_.GBSpan_Get(*args, **kwargs)
e811c8ce 11992
41e2b43e 11993 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
11994 def __str__(self): return str(self.Get())
11995 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
11996 def __len__(self): return len(self.Get())
11997 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
11998 def __setitem__(self, index, val):
11999 if index == 0: self.SetRowspan(val)
12000 elif index == 1: self.SetColspan(val)
12001 else: raise IndexError
e811c8ce 12002 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
12003 __safe_for_unpickling__ = True
12004 def __reduce__(self): return (wx.GBSpan, self.Get())
d14a1e28
RD
12005
12006 rowspan = property(GetRowspan, SetRowspan)
12007 colspan = property(GetColspan, SetColspan)
12008
2131d850 12009_core_.GBSpan_swigregister(GBSpan)
d14a1e28
RD
12010
12011class GBSizerItem(SizerItem):
248ed943
RD
12012 """
12013 The wx.GBSizerItem class is used to track the additional data about
12014 items in a `wx.GridBagSizer` such as the item's position in the grid
12015 and how many rows or columns it spans.
12016
12017 """
0085ce49
RD
12018 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12019 __repr__ = _swig_repr
12020 def __init__(self, *args, **kwargs):
248ed943
RD
12021 """
12022 __init__(self) -> GBSizerItem
12023
12024 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12025 size will need to be set, as well as a position and span before this
12026 item can be used in a Sizer.
12027
12028 You will probably never need to create a wx.GBSizerItem directly as they
12029 are created automatically when the sizer's Add method is called.
12030 """
0085ce49
RD
12031 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12032 __swig_destroy__ = _core_.delete_GBSizerItem
12033 __del__ = lambda self : None;
e811c8ce 12034 def GetPos(*args, **kwargs):
248ed943
RD
12035 """
12036 GetPos(self) -> GBPosition
12037
12038 Get the grid position of the item
12039 """
54f9ee45 12040 return _core_.GBSizerItem_GetPos(*args, **kwargs)
e811c8ce
RD
12041
12042 def GetPosTuple(self): return self.GetPos().Get()
12043 def GetSpan(*args, **kwargs):
248ed943
RD
12044 """
12045 GetSpan(self) -> GBSpan
12046
12047 Get the row and column spanning of the item
12048 """
54f9ee45 12049 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
e811c8ce
RD
12050
12051 def GetSpanTuple(self): return self.GetSpan().Get()
12052 def SetPos(*args, **kwargs):
248ed943
RD
12053 """
12054 SetPos(self, GBPosition pos) -> bool
12055
12056 If the item is already a member of a sizer then first ensure that
12057 there is no other item that would intersect with this one at the new
12058 position, then set the new position. Returns True if the change is
12059 successful and after the next Layout() the item will be moved.
12060 """
54f9ee45 12061 return _core_.GBSizerItem_SetPos(*args, **kwargs)
e811c8ce
RD
12062
12063 def SetSpan(*args, **kwargs):
248ed943
RD
12064 """
12065 SetSpan(self, GBSpan span) -> bool
12066
12067 If the item is already a member of a sizer then first ensure that
12068 there is no other item that would intersect with this one with its new
12069 spanning size, then set the new spanning. Returns True if the change
12070 is successful and after the next Layout() the item will be resized.
12071
12072 """
54f9ee45 12073 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
e811c8ce 12074
248ed943 12075 def Intersects(*args, **kwargs):
0df68c9f 12076 """
a95a7133 12077 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
12078
12079 Returns True if this item and the other item instersect.
0df68c9f 12080 """
248ed943
RD
12081 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12082
12083 def IntersectsPos(*args, **kwargs):
12084 """
12085 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12086
12087 Returns True if the given pos/span would intersect with this item.
12088 """
12089 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
e811c8ce
RD
12090
12091 def GetEndPos(*args, **kwargs):
248ed943
RD
12092 """
12093 GetEndPos(self) -> GBPosition
12094
12095 Get the row and column of the endpoint of this item.
12096 """
54f9ee45 12097 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
e811c8ce
RD
12098
12099 def GetGBSizer(*args, **kwargs):
248ed943
RD
12100 """
12101 GetGBSizer(self) -> GridBagSizer
12102
12103 Get the sizer this item is a member of.
12104 """
54f9ee45 12105 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
e811c8ce
RD
12106
12107 def SetGBSizer(*args, **kwargs):
248ed943
RD
12108 """
12109 SetGBSizer(self, GridBagSizer sizer)
12110
12111 Set the sizer this item is a member of.
12112 """
54f9ee45 12113 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
e811c8ce 12114
2131d850 12115_core_.GBSizerItem_swigregister(GBSizerItem)
d14a1e28
RD
12116DefaultSpan = cvar.DefaultSpan
12117
12118def GBSizerItemWindow(*args, **kwargs):
0df68c9f
RD
12119 """
12120 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12121 int border, PyObject userData=None) -> GBSizerItem
12122
12123 Construct a `wx.GBSizerItem` for a window.
0df68c9f 12124 """
54f9ee45 12125 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d14a1e28
RD
12126 return val
12127
12128def GBSizerItemSizer(*args, **kwargs):
0df68c9f
RD
12129 """
12130 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12131 int border, PyObject userData=None) -> GBSizerItem
12132
12133 Construct a `wx.GBSizerItem` for a sizer
0df68c9f 12134 """
54f9ee45 12135 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d14a1e28
RD
12136 return val
12137
12138def GBSizerItemSpacer(*args, **kwargs):
0df68c9f
RD
12139 """
12140 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
12141 int flag, int border, PyObject userData=None) -> GBSizerItem
12142
12143 Construct a `wx.GBSizerItem` for a spacer.
0df68c9f 12144 """
54f9ee45 12145 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d14a1e28
RD
12146 return val
12147
12148class GridBagSizer(FlexGridSizer):
248ed943
RD
12149 """
12150 A `wx.Sizer` that can lay out items in a virtual grid like a
12151 `wx.FlexGridSizer` but in this case explicit positioning of the items
12152 is allowed using `wx.GBPosition`, and items can optionally span more
12153 than one row and/or column using `wx.GBSpan`. The total size of the
12154 virtual grid is determined by the largest row and column that items are
12155 positioned at, adjusted for spanning.
12156
12157 """
0085ce49
RD
12158 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12159 __repr__ = _swig_repr
12160 def __init__(self, *args, **kwargs):
248ed943
RD
12161 """
12162 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12163
12164 Constructor, with optional parameters to specify the gap between the
12165 rows and columns.
12166 """
0085ce49 12167 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
1823fbb4
RD
12168 self._setOORInfo(self)
12169
e811c8ce 12170 def Add(*args, **kwargs):
0df68c9f 12171 """
248ed943 12172 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
d3b6e4ff 12173 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
12174
12175 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12176 more than one row or column as specified with *span*. The remaining
12177 args behave similarly to `wx.Sizer.Add`.
12178
12179 Returns True if the item was successfully placed at the given cell
12180 position, False if something was already there.
12181
0df68c9f 12182 """
54f9ee45 12183 return _core_.GridBagSizer_Add(*args, **kwargs)
e811c8ce
RD
12184
12185 def AddItem(*args, **kwargs):
248ed943 12186 """
d3b6e4ff 12187 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
12188
12189 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12190 the item was successfully placed at its given cell position, False if
12191 something was already there.
12192 """
54f9ee45 12193 return _core_.GridBagSizer_AddItem(*args, **kwargs)
e811c8ce 12194
84f85550
RD
12195 def GetCellSize(*args, **kwargs):
12196 """
12197 GetCellSize(self, int row, int col) -> Size
12198
12199 Get the size of the specified cell, including hgap and
12200 vgap. Only valid after a Layout.
12201 """
12202 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12203
e811c8ce 12204 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
12205 """
12206 GetEmptyCellSize(self) -> Size
12207
12208 Get the size used for cells in the grid with no item.
12209 """
54f9ee45 12210 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
12211
12212 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
12213 """
12214 SetEmptyCellSize(self, Size sz)
12215
12216 Set the size used for cells in the grid with no item.
12217 """
54f9ee45 12218 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
12219
12220 def GetItemPosition(*args):
0df68c9f 12221 """
248ed943
RD
12222 GetItemPosition(self, item) -> GBPosition
12223
12224 Get the grid position of the specified *item* where *item* is either a
12225 window or subsizer that is a member of this sizer, or a zero-based
12226 index of an item.
0df68c9f 12227 """
54f9ee45 12228 return _core_.GridBagSizer_GetItemPosition(*args)
e811c8ce
RD
12229
12230 def SetItemPosition(*args):
0df68c9f 12231 """
248ed943
RD
12232 SetItemPosition(self, item, GBPosition pos) -> bool
12233
12234 Set the grid position of the specified *item* where *item* is either a
12235 window or subsizer that is a member of this sizer, or a zero-based
12236 index of an item. Returns True on success. If the move is not
12237 allowed (because an item is already there) then False is returned.
12238
0df68c9f 12239 """
54f9ee45 12240 return _core_.GridBagSizer_SetItemPosition(*args)
e811c8ce
RD
12241
12242 def GetItemSpan(*args):
0df68c9f 12243 """
248ed943
RD
12244 GetItemSpan(self, item) -> GBSpan
12245
12246 Get the row/col spanning of the specified *item* where *item* is
12247 either a window or subsizer that is a member of this sizer, or a
12248 zero-based index of an item.
0df68c9f 12249 """
54f9ee45 12250 return _core_.GridBagSizer_GetItemSpan(*args)
e811c8ce
RD
12251
12252 def SetItemSpan(*args):
0df68c9f 12253 """
248ed943
RD
12254 SetItemSpan(self, item, GBSpan span) -> bool
12255
12256 Set the row/col spanning of the specified *item* where *item* is
12257 either a window or subsizer that is a member of this sizer, or a
12258 zero-based index of an item. Returns True on success. If the move is
12259 not allowed (because an item is already there) then False is returned.
0df68c9f 12260 """
54f9ee45 12261 return _core_.GridBagSizer_SetItemSpan(*args)
e811c8ce
RD
12262
12263 def FindItem(*args):
0df68c9f 12264 """
248ed943
RD
12265 FindItem(self, item) -> GBSizerItem
12266
12267 Find the sizer item for the given window or subsizer, returns None if
12268 not found. (non-recursive)
0df68c9f 12269 """
54f9ee45 12270 return _core_.GridBagSizer_FindItem(*args)
e811c8ce
RD
12271
12272 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
12273 """
12274 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12275
12276 Return the sizer item for the given grid cell, or None if there is no
12277 item at that position. (non-recursive)
12278 """
54f9ee45 12279 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
e811c8ce
RD
12280
12281 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
12282 """
12283 FindItemAtPoint(self, Point pt) -> GBSizerItem
12284
12285 Return the sizer item located at the point given in *pt*, or None if
12286 there is no item at that point. The (x,y) coordinates in pt correspond
12287 to the client coordinates of the window using the sizer for
12288 layout. (non-recursive)
12289 """
54f9ee45 12290 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
e811c8ce 12291
248ed943
RD
12292 def CheckForIntersection(*args, **kwargs):
12293 """
12294 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
e811c8ce 12295
248ed943
RD
12296 Look at all items and see if any intersect (or would overlap) the
12297 given *item*. Returns True if so, False if there would be no overlap.
12298 If an *excludeItem* is given then it will not be checked for
12299 intersection, for example it may be the item we are checking the
12300 position of.
e811c8ce 12301
248ed943
RD
12302 """
12303 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
e811c8ce 12304
248ed943 12305 def CheckForIntersectionPos(*args, **kwargs):
0df68c9f 12306 """
248ed943
RD
12307 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12308
12309 Look at all items and see if any intersect (or would overlap) the
12310 given position and span. Returns True if so, False if there would be
12311 no overlap. If an *excludeItem* is given then it will not be checked
12312 for intersection, for example it may be the item we are checking the
12313 position of.
0df68c9f 12314 """
248ed943 12315 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
e811c8ce 12316
2131d850 12317_core_.GridBagSizer_swigregister(GridBagSizer)
d14a1e28
RD
12318
12319#---------------------------------------------------------------------------
12320
54f9ee45
RD
12321Left = _core_.Left
12322Top = _core_.Top
12323Right = _core_.Right
12324Bottom = _core_.Bottom
12325Width = _core_.Width
12326Height = _core_.Height
12327Centre = _core_.Centre
12328Center = _core_.Center
12329CentreX = _core_.CentreX
12330CentreY = _core_.CentreY
12331Unconstrained = _core_.Unconstrained
12332AsIs = _core_.AsIs
12333PercentOf = _core_.PercentOf
12334Above = _core_.Above
12335Below = _core_.Below
12336LeftOf = _core_.LeftOf
12337RightOf = _core_.RightOf
12338SameAs = _core_.SameAs
12339Absolute = _core_.Absolute
d14a1e28 12340class IndividualLayoutConstraint(Object):
15afbcd0 12341 """
41e2b43e
RD
12342 Objects of this class are stored in the `wx.LayoutConstraints` class as
12343 one of eight possible constraints that a window can be involved in.
12344 You will never need to create an instance of
12345 wx.IndividualLayoutConstraint, rather you should create a
12346 `wx.LayoutConstraints` instance and use the individual contstraints
15afbcd0 12347 that it contains.
15afbcd0 12348 """
0085ce49
RD
12349 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12350 def __init__(self): raise AttributeError, "No constructor defined"
12351 __repr__ = _swig_repr
e811c8ce 12352 def Set(*args, **kwargs):
41e2b43e
RD
12353 """
12354 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12355
12356 Sets the properties of the constraint. Normally called by one of the
12357 convenience functions such as Above, RightOf, SameAs.
12358 """
54f9ee45 12359 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
e811c8ce
RD
12360
12361 def LeftOf(*args, **kwargs):
15afbcd0 12362 """
a95a7133 12363 LeftOf(self, Window sibling, int marg=0)
15afbcd0 12364
41e2b43e
RD
12365 Constrains this edge to be to the left of the given window, with an
12366 optional margin. Implicitly, this is relative to the left edge of the
12367 other window.
15afbcd0 12368 """
54f9ee45 12369 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
e811c8ce
RD
12370
12371 def RightOf(*args, **kwargs):
15afbcd0 12372 """
a95a7133 12373 RightOf(self, Window sibling, int marg=0)
15afbcd0 12374
41e2b43e
RD
12375 Constrains this edge to be to the right of the given window, with an
12376 optional margin. Implicitly, this is relative to the right edge of the
12377 other window.
15afbcd0 12378 """
54f9ee45 12379 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
e811c8ce
RD
12380
12381 def Above(*args, **kwargs):
15afbcd0 12382 """
a95a7133 12383 Above(self, Window sibling, int marg=0)
15afbcd0 12384
41e2b43e
RD
12385 Constrains this edge to be above the given window, with an optional
12386 margin. Implicitly, this is relative to the top edge of the other
12387 window.
15afbcd0 12388 """
54f9ee45 12389 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
e811c8ce
RD
12390
12391 def Below(*args, **kwargs):
15afbcd0 12392 """
a95a7133 12393 Below(self, Window sibling, int marg=0)
15afbcd0 12394
41e2b43e
RD
12395 Constrains this edge to be below the given window, with an optional
12396 margin. Implicitly, this is relative to the bottom edge of the other
12397 window.
15afbcd0 12398 """
54f9ee45 12399 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
e811c8ce
RD
12400
12401 def SameAs(*args, **kwargs):
15afbcd0 12402 """
a95a7133 12403 SameAs(self, Window otherW, int edge, int marg=0)
15afbcd0 12404
41e2b43e
RD
12405 Constrains this edge or dimension to be to the same as the edge of the
12406 given window, with an optional margin.
15afbcd0 12407 """
54f9ee45 12408 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
e811c8ce
RD
12409
12410 def PercentOf(*args, **kwargs):
15afbcd0 12411 """
a95a7133 12412 PercentOf(self, Window otherW, int wh, int per)
15afbcd0 12413
41e2b43e
RD
12414 Constrains this edge or dimension to be to a percentage of the given
12415 window, with an optional margin.
15afbcd0 12416 """
54f9ee45 12417 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
e811c8ce
RD
12418
12419 def Absolute(*args, **kwargs):
15afbcd0 12420 """
a95a7133 12421 Absolute(self, int val)
15afbcd0 12422
41e2b43e 12423 Constrains this edge or dimension to be the given absolute value.
15afbcd0 12424 """
54f9ee45 12425 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
e811c8ce
RD
12426
12427 def Unconstrained(*args, **kwargs):
15afbcd0 12428 """
a95a7133 12429 Unconstrained(self)
15afbcd0 12430
41e2b43e
RD
12431 Sets this edge or dimension to be unconstrained, that is, dependent on
12432 other edges and dimensions from which this value can be deduced.
15afbcd0 12433 """
54f9ee45 12434 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
e811c8ce
RD
12435
12436 def AsIs(*args, **kwargs):
15afbcd0 12437 """
a95a7133 12438 AsIs(self)
15afbcd0 12439
41e2b43e
RD
12440 Sets this edge or constraint to be whatever the window's value is at
12441 the moment. If either of the width and height constraints are *as is*,
12442 the window will not be resized, but moved instead. This is important
12443 when considering panel items which are intended to have a default
12444 size, such as a button, which may take its size from the size of the
12445 button label.
15afbcd0 12446 """
54f9ee45 12447 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
e811c8ce
RD
12448
12449 def GetOtherWindow(*args, **kwargs):
a95a7133 12450 """GetOtherWindow(self) -> Window"""
54f9ee45 12451 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
e811c8ce
RD
12452
12453 def GetMyEdge(*args, **kwargs):
a95a7133 12454 """GetMyEdge(self) -> int"""
54f9ee45 12455 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
e811c8ce
RD
12456
12457 def SetEdge(*args, **kwargs):
a95a7133 12458 """SetEdge(self, int which)"""
54f9ee45 12459 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
e811c8ce
RD
12460
12461 def SetValue(*args, **kwargs):
a95a7133 12462 """SetValue(self, int v)"""
54f9ee45 12463 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
e811c8ce
RD
12464
12465 def GetMargin(*args, **kwargs):
a95a7133 12466 """GetMargin(self) -> int"""
54f9ee45 12467 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
e811c8ce
RD
12468
12469 def SetMargin(*args, **kwargs):
a95a7133 12470 """SetMargin(self, int m)"""
54f9ee45 12471 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
e811c8ce
RD
12472
12473 def GetValue(*args, **kwargs):
a95a7133 12474 """GetValue(self) -> int"""
54f9ee45 12475 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
e811c8ce
RD
12476
12477 def GetPercent(*args, **kwargs):
a95a7133 12478 """GetPercent(self) -> int"""
54f9ee45 12479 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
e811c8ce
RD
12480
12481 def GetOtherEdge(*args, **kwargs):
a95a7133 12482 """GetOtherEdge(self) -> int"""
54f9ee45 12483 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
e811c8ce
RD
12484
12485 def GetDone(*args, **kwargs):
a95a7133 12486 """GetDone(self) -> bool"""
54f9ee45 12487 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
e811c8ce
RD
12488
12489 def SetDone(*args, **kwargs):
a95a7133 12490 """SetDone(self, bool d)"""
54f9ee45 12491 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
e811c8ce
RD
12492
12493 def GetRelationship(*args, **kwargs):
a95a7133 12494 """GetRelationship(self) -> int"""
54f9ee45 12495 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
e811c8ce
RD
12496
12497 def SetRelationship(*args, **kwargs):
a95a7133 12498 """SetRelationship(self, int r)"""
54f9ee45 12499 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
e811c8ce
RD
12500
12501 def ResetIfWin(*args, **kwargs):
15afbcd0 12502 """
a95a7133 12503 ResetIfWin(self, Window otherW) -> bool
15afbcd0
RD
12504
12505 Reset constraint if it mentions otherWin
12506 """
54f9ee45 12507 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
e811c8ce
RD
12508
12509 def SatisfyConstraint(*args, **kwargs):
15afbcd0 12510 """
a95a7133 12511 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
15afbcd0
RD
12512
12513 Try to satisfy constraint
12514 """
54f9ee45 12515 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
e811c8ce
RD
12516
12517 def GetEdge(*args, **kwargs):
15afbcd0 12518 """
a95a7133 12519 GetEdge(self, int which, Window thisWin, Window other) -> int
15afbcd0
RD
12520
12521 Get the value of this edge or dimension, or if this
12522 is not determinable, -1.
12523 """
54f9ee45 12524 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
e811c8ce 12525
2131d850 12526_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d14a1e28
RD
12527
12528class LayoutConstraints(Object):
15afbcd0 12529 """
41e2b43e
RD
12530 **Note:** constraints are now deprecated and you should use sizers
12531 instead.
15afbcd0 12532
41e2b43e
RD
12533 Objects of this class can be associated with a window to define its
12534 layout constraints, with respect to siblings or its parent.
15afbcd0
RD
12535
12536 The class consists of the following eight constraints of class
12537 wx.IndividualLayoutConstraint, some or all of which should be accessed
12538 directly to set the appropriate constraints.
12539
12540 * left: represents the left hand edge of the window
12541 * right: represents the right hand edge of the window
12542 * top: represents the top edge of the window
12543 * bottom: represents the bottom edge of the window
12544 * width: represents the width of the window
12545 * height: represents the height of the window
12546 * centreX: represents the horizontal centre point of the window
12547 * centreY: represents the vertical centre point of the window
12548
41e2b43e
RD
12549 Most constraints are initially set to have the relationship
12550 wxUnconstrained, which means that their values should be calculated by
12551 looking at known constraints. The exceptions are width and height,
12552 which are set to wxAsIs to ensure that if the user does not specify a
12553 constraint, the existing width and height will be used, to be
12554 compatible with panel items which often have take a default size. If
12555 the constraint is ``wx.AsIs``, the dimension will not be changed.
12556
12557 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
15afbcd0
RD
12558
12559 """
0085ce49
RD
12560 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12561 __repr__ = _swig_repr
54f9ee45
RD
12562 left = property(_core_.LayoutConstraints_left_get)
12563 top = property(_core_.LayoutConstraints_top_get)
12564 right = property(_core_.LayoutConstraints_right_get)
12565 bottom = property(_core_.LayoutConstraints_bottom_get)
12566 width = property(_core_.LayoutConstraints_width_get)
12567 height = property(_core_.LayoutConstraints_height_get)
12568 centreX = property(_core_.LayoutConstraints_centreX_get)
12569 centreY = property(_core_.LayoutConstraints_centreY_get)
0085ce49 12570 def __init__(self, *args, **kwargs):
a95a7133 12571 """__init__(self) -> LayoutConstraints"""
0085ce49
RD
12572 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12573 __swig_destroy__ = _core_.delete_LayoutConstraints
12574 __del__ = lambda self : None;
e811c8ce 12575 def SatisfyConstraints(*args, **kwargs):
6c3b4aae 12576 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
54f9ee45 12577 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
e811c8ce
RD
12578
12579 def AreSatisfied(*args, **kwargs):
a95a7133 12580 """AreSatisfied(self) -> bool"""
54f9ee45 12581 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
e811c8ce 12582
2131d850 12583_core_.LayoutConstraints_swigregister(LayoutConstraints)
d14a1e28
RD
12584
12585#----------------------------------------------------------------------------
12586
322913ce 12587# Use Python's bool constants if available, make some if not
d14a1e28
RD
12588try:
12589 True
12590except NameError:
322913ce
RD
12591 __builtins__.True = 1==1
12592 __builtins__.False = 1==0
4f89f6a3
RD
12593 def bool(value): return not not value
12594 __builtins__.bool = bool
d14a1e28 12595
d14a1e28
RD
12596
12597
12598# workarounds for bad wxRTTI names
12599__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12600__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12601__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12602
12603
12604#----------------------------------------------------------------------------
12605# Load version numbers from __version__... Ensure that major and minor
7bc1e663 12606# versions are the same for both wxPython and wxWidgets.
d14a1e28
RD
12607
12608from __version__ import *
12609__version__ = VERSION_STRING
12610
7bc1e663
RD
12611assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12612assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
54f9ee45 12613if RELEASE_VERSION != _core_.RELEASE_VERSION:
d14a1e28 12614 import warnings
7bc1e663 12615 warnings.warn("wxPython/wxWidgets release number mismatch")
d14a1e28
RD
12616
12617#----------------------------------------------------------------------------
12618
70b7a5fe
RD
12619# Set wxPython's default string<-->unicode conversion encoding from
12620# the locale, but only if Python's default hasn't been changed. (We
12621# assume that if the user has customized it already then that is the
12622# encoding we need to use as well.)
12623#
12624# The encoding selected here is used when string or unicode objects
12625# need to be converted in order to pass them to wxWidgets. Please be
12626# aware that the default encoding within the same locale may be
12627# slightly different on different platforms. For example, please see
e505d15e
RD
12628# http://www.alanwood.net/demos/charsetdiffs.html for differences
12629# between the common latin/roman encodings.
396fb509
RD
12630
12631default = _sys.getdefaultencoding()
12632if default == 'ascii':
12633 import locale
12634 import codecs
12635 try:
12636 default = locale.getdefaultlocale()[1]
12637 codecs.lookup(default)
70b7a5fe 12638 except (ValueError, LookupError, TypeError):
396fb509
RD
12639 default = _sys.getdefaultencoding()
12640 del locale
12641 del codecs
5cbf236d
RD
12642if default:
12643 wx.SetDefaultPyEncoding(default)
12644del default
5cbf236d
RD
12645
12646#----------------------------------------------------------------------------
12647
d14a1e28
RD
12648class PyDeadObjectError(AttributeError):
12649 pass
12650
d14a1e28
RD
12651class _wxPyDeadObject(object):
12652 """
12653 Instances of wx objects that are OOR capable will have their __class__
12654 changed to this class when the C++ object is deleted. This should help
12655 prevent crashes due to referencing a bogus C++ pointer.
12656 """
12657 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12658 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12659
3a04f143 12660 def __repr__(self):
d14a1e28
RD
12661 if not hasattr(self, "_name"):
12662 self._name = "[unknown]"
12663 return self.reprStr % self._name
12664
3a04f143 12665 def __getattr__(self, *args):
d14a1e28
RD
12666 if not hasattr(self, "_name"):
12667 self._name = "[unknown]"
3a04f143
RD
12668 raise PyDeadObjectError(self.attrStr % self._name)
12669
12670 def __nonzero__(self):
12671 return 0
12672
12673
12674
12675class PyUnbornObjectError(AttributeError):
12676 pass
12677
12678class _wxPyUnbornObject(object):
12679 """
54f9ee45 12680 Some stock objects are created when the wx._core module is
3a04f143
RD
12681 imported, but their C++ instance is not created until the wx.App
12682 object is created and initialized. These object instances will
12683 temporarily have their __class__ changed to this class so an
12684 exception will be raised if they are used before the C++ instance
12685 is ready.
12686 """
12687
12688 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12689 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12690
12691 def __repr__(self):
12692 #if not hasattr(self, "_name"):
12693 # self._name = "[unknown]"
12694 return self.reprStr #% self._name
12695
12696 def __getattr__(self, *args):
12697 #if not hasattr(self, "_name"):
12698 # self._name = "[unknown]"
12699 raise PyUnbornObjectError(self.attrStr) # % self._name )
d14a1e28
RD
12700
12701 def __nonzero__(self):
12702 return 0
12703
12704
12705#----------------------------------------------------------------------------
d14a1e28
RD
12706
12707def CallAfter(callable, *args, **kw):
12708 """
12709 Call the specified function after the current and pending event
12710 handlers have been completed. This is also good for making GUI
61863841
RD
12711 method calls from non-GUI threads. Any extra positional or
12712 keyword args are passed on to the callable when it is called.
12713
12714 :see: `wx.FutureCall`
d14a1e28
RD
12715 """
12716 app = wx.GetApp()
dfbb5885 12717 assert app is not None, 'No wx.App created yet'
d14a1e28 12718
148275d3
RD
12719 if not hasattr(app, "_CallAfterId"):
12720 app._CallAfterId = wx.NewEventType()
12721 app.Connect(-1, -1, app._CallAfterId,
12722 lambda event: event.callable(*event.args, **event.kw) )
d14a1e28 12723 evt = wx.PyEvent()
148275d3 12724 evt.SetEventType(app._CallAfterId)
d14a1e28
RD
12725 evt.callable = callable
12726 evt.args = args
12727 evt.kw = kw
12728 wx.PostEvent(app, evt)
12729
d14a1e28
RD
12730#----------------------------------------------------------------------------
12731
12732
12733class FutureCall:
12734 """
8ac8dba0 12735 A convenience class for `wx.Timer`, that calls the given callable
d14a1e28
RD
12736 object once after the given amount of milliseconds, passing any
12737 positional or keyword args. The return value of the callable is
61863841 12738 availbale after it has been run with the `GetResult` method.
d14a1e28
RD
12739
12740 If you don't need to get the return value or restart the timer
12741 then there is no need to hold a reference to this object. It will
12742 hold a reference to itself while the timer is running (the timer
12743 has a reference to self.Notify) but the cycle will be broken when
12744 the timer completes, automatically cleaning up the wx.FutureCall
12745 object.
61863841
RD
12746
12747 :see: `wx.CallAfter`
d14a1e28
RD
12748 """
12749 def __init__(self, millis, callable, *args, **kwargs):
12750 self.millis = millis
12751 self.callable = callable
12752 self.SetArgs(*args, **kwargs)
12753 self.runCount = 0
4276dc52 12754 self.running = False
d14a1e28
RD
12755 self.hasRun = False
12756 self.result = None
12757 self.timer = None
12758 self.Start()
12759
12760 def __del__(self):
12761 self.Stop()
12762
12763
12764 def Start(self, millis=None, *args, **kwargs):
12765 """
12766 (Re)start the timer
12767 """
12768 self.hasRun = False
12769 if millis is not None:
12770 self.millis = millis
12771 if args or kwargs:
12772 self.SetArgs(*args, **kwargs)
12773 self.Stop()
12774 self.timer = wx.PyTimer(self.Notify)
12775 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
4276dc52 12776 self.running = True
d14a1e28
RD
12777 Restart = Start
12778
12779
12780 def Stop(self):
12781 """
12782 Stop and destroy the timer.
12783 """
12784 if self.timer is not None:
12785 self.timer.Stop()
12786 self.timer = None
12787
12788
12789 def GetInterval(self):
12790 if self.timer is not None:
12791 return self.timer.GetInterval()
12792 else:
12793 return 0
12794
12795
12796 def IsRunning(self):
12797 return self.timer is not None and self.timer.IsRunning()
12798
12799
12800 def SetArgs(self, *args, **kwargs):
12801 """
12802 (Re)set the args passed to the callable object. This is
12803 useful in conjunction with Restart if you want to schedule a
12804 new call to the same callable object but with different
12805 parameters.
12806 """
12807 self.args = args
12808 self.kwargs = kwargs
12809
12810
12811 def HasRun(self):
12812 return self.hasRun
12813
12814 def GetResult(self):
12815 return self.result
12816
12817 def Notify(self):
12818 """
12819 The timer has expired so call the callable.
12820 """
12821 if self.callable and getattr(self.callable, 'im_self', True):
12822 self.runCount += 1
4276dc52 12823 self.running = False
d14a1e28
RD
12824 self.result = self.callable(*self.args, **self.kwargs)
12825 self.hasRun = True
4276dc52
RD
12826 if not self.running:
12827 # if it wasn't restarted, then cleanup
12828 wx.CallAfter(self.Stop)
d14a1e28
RD
12829
12830
a95a7133
RD
12831
12832#----------------------------------------------------------------------------
12833# Control which items in this module should be documented by epydoc.
12834# We allow only classes and functions, which will help reduce the size
12835# of the docs by filtering out the zillions of constants, EVT objects,
12836# and etc that don't make much sense by themselves, but are instead
12837# documented (or will be) as part of the classes/functions/methods
12838# where they should be used.
12839
66c033b4
RD
12840class __DocFilter:
12841 """
12842 A filter for epydoc that only allows non-Ptr classes and
12843 fucntions, in order to reduce the clutter in the API docs.
12844 """
12845 def __init__(self, globals):
12846 self._globals = globals
12847
12848 def __call__(self, name):
12849 import types
12850 obj = self._globals.get(name, None)
12851 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12852 return False
0085ce49 12853 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
66c033b4
RD
12854 return False
12855 return True
a95a7133 12856
d14a1e28
RD
12857#----------------------------------------------------------------------------
12858#----------------------------------------------------------------------------
12859
12860# Import other modules in this package that should show up in the
12861# "core" wx namespace
54f9ee45
RD
12862from _gdi import *
12863from _windows import *
12864from _controls import *
12865from _misc import *
d14a1e28
RD
12866
12867#----------------------------------------------------------------------------
12868#----------------------------------------------------------------------------
12869
12870
32fe5131 12871