]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/msw/_core.py
new wxTreeEvent ctor
[wxWidgets.git] / wxPython / src / msw / _core.py
CommitLineData
554f62e9 1# This file was created automatically by SWIG 1.3.29.
d55e5bfc
RD
2# Don't modify this file, modify the SWIG interface instead.
3
4import _core_
554f62e9
RD
5import new
6new_instancemethod = new.instancemethod
093d3ff1 7def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
554f62e9 8 if (name == "thisown"): return self.this.own(value)
093d3ff1 9 if (name == "this"):
554f62e9
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)
554f62e9 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):
554f62e9 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
554f62e9
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):
554f62e9
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
d55e5bfc
RD
54#// Give a reference to the dictionary of this module to the C++ extension
55#// code.
56_core_._wxPySetDictionary(vars())
57
58#// A little trick to make 'wx' be a reference to this module so wx.Names can
59#// be used here.
60import sys as _sys
61wx = _sys.modules[__name__]
62
c24da6d6
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
d55e5bfc
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
57133d5c 95DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 96DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
d55e5bfc
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
d55e5bfc
RD
103CLIP_CHILDREN = _core_.CLIP_CHILDREN
104CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
092f0ed7 105WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
d55e5bfc
RD
106ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
107RETAINED = _core_.RETAINED
108BACKINGSTORE = _core_.BACKINGSTORE
109COLOURED = _core_.COLOURED
110FIXED_LENGTH = _core_.FIXED_LENGTH
111LB_NEEDED_SB = _core_.LB_NEEDED_SB
112LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
113LB_SORT = _core_.LB_SORT
114LB_SINGLE = _core_.LB_SINGLE
115LB_MULTIPLE = _core_.LB_MULTIPLE
116LB_EXTENDED = _core_.LB_EXTENDED
117LB_OWNERDRAW = _core_.LB_OWNERDRAW
118LB_HSCROLL = _core_.LB_HSCROLL
119PROCESS_ENTER = _core_.PROCESS_ENTER
120PASSWORD = _core_.PASSWORD
121CB_SIMPLE = _core_.CB_SIMPLE
122CB_DROPDOWN = _core_.CB_DROPDOWN
123CB_SORT = _core_.CB_SORT
124CB_READONLY = _core_.CB_READONLY
125RA_HORIZONTAL = _core_.RA_HORIZONTAL
126RA_VERTICAL = _core_.RA_VERTICAL
127RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
128RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
fef4c27a 129RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
d55e5bfc
RD
130RB_GROUP = _core_.RB_GROUP
131RB_SINGLE = _core_.RB_SINGLE
d55e5bfc
RD
132SB_HORIZONTAL = _core_.SB_HORIZONTAL
133SB_VERTICAL = _core_.SB_VERTICAL
fef4c27a 134RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
d55e5bfc
RD
135ST_SIZEGRIP = _core_.ST_SIZEGRIP
136ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
e9d6f3a4
RD
137ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
138ST_DOTS_END = _core_.ST_DOTS_END
d55e5bfc
RD
139FLOOD_SURFACE = _core_.FLOOD_SURFACE
140FLOOD_BORDER = _core_.FLOOD_BORDER
141ODDEVEN_RULE = _core_.ODDEVEN_RULE
142WINDING_RULE = _core_.WINDING_RULE
143TOOL_TOP = _core_.TOOL_TOP
144TOOL_BOTTOM = _core_.TOOL_BOTTOM
145TOOL_LEFT = _core_.TOOL_LEFT
146TOOL_RIGHT = _core_.TOOL_RIGHT
147OK = _core_.OK
148YES_NO = _core_.YES_NO
149CANCEL = _core_.CANCEL
150YES = _core_.YES
151NO = _core_.NO
152NO_DEFAULT = _core_.NO_DEFAULT
153YES_DEFAULT = _core_.YES_DEFAULT
154ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
155ICON_HAND = _core_.ICON_HAND
156ICON_QUESTION = _core_.ICON_QUESTION
157ICON_INFORMATION = _core_.ICON_INFORMATION
158ICON_STOP = _core_.ICON_STOP
159ICON_ASTERISK = _core_.ICON_ASTERISK
160ICON_MASK = _core_.ICON_MASK
161ICON_WARNING = _core_.ICON_WARNING
162ICON_ERROR = _core_.ICON_ERROR
163FORWARD = _core_.FORWARD
164BACKWARD = _core_.BACKWARD
165RESET = _core_.RESET
166HELP = _core_.HELP
167MORE = _core_.MORE
168SETUP = _core_.SETUP
169SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
170SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
171SIZE_AUTO = _core_.SIZE_AUTO
172SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
173SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
9d7dfdff 174SIZE_FORCE = _core_.SIZE_FORCE
d55e5bfc
RD
175PORTRAIT = _core_.PORTRAIT
176LANDSCAPE = _core_.LANDSCAPE
177PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
178PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
179PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
180PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
181ID_ANY = _core_.ID_ANY
182ID_SEPARATOR = _core_.ID_SEPARATOR
9d7dfdff 183ID_NONE = _core_.ID_NONE
d55e5bfc
RD
184ID_LOWEST = _core_.ID_LOWEST
185ID_OPEN = _core_.ID_OPEN
186ID_CLOSE = _core_.ID_CLOSE
187ID_NEW = _core_.ID_NEW
188ID_SAVE = _core_.ID_SAVE
189ID_SAVEAS = _core_.ID_SAVEAS
190ID_REVERT = _core_.ID_REVERT
191ID_EXIT = _core_.ID_EXIT
192ID_UNDO = _core_.ID_UNDO
193ID_REDO = _core_.ID_REDO
194ID_HELP = _core_.ID_HELP
195ID_PRINT = _core_.ID_PRINT
196ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
197ID_PREVIEW = _core_.ID_PREVIEW
198ID_ABOUT = _core_.ID_ABOUT
199ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
200ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
201ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
202ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
203ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
204ID_PREFERENCES = _core_.ID_PREFERENCES
205ID_CUT = _core_.ID_CUT
206ID_COPY = _core_.ID_COPY
207ID_PASTE = _core_.ID_PASTE
208ID_CLEAR = _core_.ID_CLEAR
209ID_FIND = _core_.ID_FIND
210ID_DUPLICATE = _core_.ID_DUPLICATE
211ID_SELECTALL = _core_.ID_SELECTALL
212ID_DELETE = _core_.ID_DELETE
213ID_REPLACE = _core_.ID_REPLACE
214ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
215ID_PROPERTIES = _core_.ID_PROPERTIES
216ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
217ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
218ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
219ID_VIEW_LIST = _core_.ID_VIEW_LIST
220ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
221ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
222ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
223ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
224ID_FILE1 = _core_.ID_FILE1
225ID_FILE2 = _core_.ID_FILE2
226ID_FILE3 = _core_.ID_FILE3
227ID_FILE4 = _core_.ID_FILE4
228ID_FILE5 = _core_.ID_FILE5
229ID_FILE6 = _core_.ID_FILE6
230ID_FILE7 = _core_.ID_FILE7
231ID_FILE8 = _core_.ID_FILE8
232ID_FILE9 = _core_.ID_FILE9
233ID_OK = _core_.ID_OK
234ID_CANCEL = _core_.ID_CANCEL
235ID_APPLY = _core_.ID_APPLY
236ID_YES = _core_.ID_YES
237ID_NO = _core_.ID_NO
238ID_STATIC = _core_.ID_STATIC
239ID_FORWARD = _core_.ID_FORWARD
240ID_BACKWARD = _core_.ID_BACKWARD
241ID_DEFAULT = _core_.ID_DEFAULT
242ID_MORE = _core_.ID_MORE
243ID_SETUP = _core_.ID_SETUP
244ID_RESET = _core_.ID_RESET
245ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
246ID_YESTOALL = _core_.ID_YESTOALL
247ID_NOTOALL = _core_.ID_NOTOALL
248ID_ABORT = _core_.ID_ABORT
249ID_RETRY = _core_.ID_RETRY
250ID_IGNORE = _core_.ID_IGNORE
0f63ec68
RD
251ID_ADD = _core_.ID_ADD
252ID_REMOVE = _core_.ID_REMOVE
253ID_UP = _core_.ID_UP
254ID_DOWN = _core_.ID_DOWN
255ID_HOME = _core_.ID_HOME
256ID_REFRESH = _core_.ID_REFRESH
257ID_STOP = _core_.ID_STOP
258ID_INDEX = _core_.ID_INDEX
259ID_BOLD = _core_.ID_BOLD
260ID_ITALIC = _core_.ID_ITALIC
261ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
262ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
263ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
264ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
265ID_UNDERLINE = _core_.ID_UNDERLINE
266ID_INDENT = _core_.ID_INDENT
267ID_UNINDENT = _core_.ID_UNINDENT
268ID_ZOOM_100 = _core_.ID_ZOOM_100
269ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
270ID_ZOOM_IN = _core_.ID_ZOOM_IN
271ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
272ID_UNDELETE = _core_.ID_UNDELETE
273ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
d55e5bfc 274ID_HIGHEST = _core_.ID_HIGHEST
d55e5bfc
RD
275ACCEL_ALT = _core_.ACCEL_ALT
276ACCEL_CTRL = _core_.ACCEL_CTRL
277ACCEL_SHIFT = _core_.ACCEL_SHIFT
278ACCEL_NORMAL = _core_.ACCEL_NORMAL
279PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
280PD_APP_MODAL = _core_.PD_APP_MODAL
281PD_CAN_ABORT = _core_.PD_CAN_ABORT
282PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
283PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
284PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
62d32a5f
RD
285PD_SMOOTH = _core_.PD_SMOOTH
286PD_CAN_SKIP = _core_.PD_CAN_SKIP
d55e5bfc
RD
287MENU_TEAROFF = _core_.MENU_TEAROFF
288MB_DOCKABLE = _core_.MB_DOCKABLE
289NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
290FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
291LI_HORIZONTAL = _core_.LI_HORIZONTAL
292LI_VERTICAL = _core_.LI_VERTICAL
293WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
294WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
295WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
296WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
297WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
298WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
299MM_TEXT = _core_.MM_TEXT
300MM_LOMETRIC = _core_.MM_LOMETRIC
301MM_HIMETRIC = _core_.MM_HIMETRIC
302MM_LOENGLISH = _core_.MM_LOENGLISH
303MM_HIENGLISH = _core_.MM_HIENGLISH
304MM_TWIPS = _core_.MM_TWIPS
305MM_ISOTROPIC = _core_.MM_ISOTROPIC
306MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
307MM_POINTS = _core_.MM_POINTS
308MM_METRIC = _core_.MM_METRIC
309CENTRE = _core_.CENTRE
310CENTER = _core_.CENTER
311HORIZONTAL = _core_.HORIZONTAL
312VERTICAL = _core_.VERTICAL
313BOTH = _core_.BOTH
314LEFT = _core_.LEFT
315RIGHT = _core_.RIGHT
316UP = _core_.UP
317DOWN = _core_.DOWN
318TOP = _core_.TOP
319BOTTOM = _core_.BOTTOM
320NORTH = _core_.NORTH
321SOUTH = _core_.SOUTH
322WEST = _core_.WEST
323EAST = _core_.EAST
324ALL = _core_.ALL
325ALIGN_NOT = _core_.ALIGN_NOT
326ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
327ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
328ALIGN_LEFT = _core_.ALIGN_LEFT
329ALIGN_TOP = _core_.ALIGN_TOP
330ALIGN_RIGHT = _core_.ALIGN_RIGHT
331ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
332ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
333ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
334ALIGN_CENTER = _core_.ALIGN_CENTER
335ALIGN_CENTRE = _core_.ALIGN_CENTRE
336ALIGN_MASK = _core_.ALIGN_MASK
337STRETCH_NOT = _core_.STRETCH_NOT
338SHRINK = _core_.SHRINK
339GROW = _core_.GROW
340EXPAND = _core_.EXPAND
341SHAPED = _core_.SHAPED
342FIXED_MINSIZE = _core_.FIXED_MINSIZE
343TILE = _core_.TILE
344ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
345BORDER_DEFAULT = _core_.BORDER_DEFAULT
346BORDER_NONE = _core_.BORDER_NONE
347BORDER_STATIC = _core_.BORDER_STATIC
348BORDER_SIMPLE = _core_.BORDER_SIMPLE
349BORDER_RAISED = _core_.BORDER_RAISED
350BORDER_SUNKEN = _core_.BORDER_SUNKEN
351BORDER_DOUBLE = _core_.BORDER_DOUBLE
352BORDER_MASK = _core_.BORDER_MASK
0f63ec68
RD
353BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
354BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
355BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
d55e5bfc
RD
356DEFAULT = _core_.DEFAULT
357DECORATIVE = _core_.DECORATIVE
358ROMAN = _core_.ROMAN
359SCRIPT = _core_.SCRIPT
360SWISS = _core_.SWISS
361MODERN = _core_.MODERN
362TELETYPE = _core_.TELETYPE
363VARIABLE = _core_.VARIABLE
364FIXED = _core_.FIXED
365NORMAL = _core_.NORMAL
366LIGHT = _core_.LIGHT
367BOLD = _core_.BOLD
368ITALIC = _core_.ITALIC
369SLANT = _core_.SLANT
370SOLID = _core_.SOLID
371DOT = _core_.DOT
372LONG_DASH = _core_.LONG_DASH
373SHORT_DASH = _core_.SHORT_DASH
374DOT_DASH = _core_.DOT_DASH
375USER_DASH = _core_.USER_DASH
376TRANSPARENT = _core_.TRANSPARENT
377STIPPLE = _core_.STIPPLE
d04418a7
RD
378STIPPLE_MASK = _core_.STIPPLE_MASK
379STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
d55e5bfc
RD
380BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
381CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
382FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
383CROSS_HATCH = _core_.CROSS_HATCH
384HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
385VERTICAL_HATCH = _core_.VERTICAL_HATCH
386JOIN_BEVEL = _core_.JOIN_BEVEL
387JOIN_MITER = _core_.JOIN_MITER
388JOIN_ROUND = _core_.JOIN_ROUND
389CAP_ROUND = _core_.CAP_ROUND
390CAP_PROJECTING = _core_.CAP_PROJECTING
391CAP_BUTT = _core_.CAP_BUTT
392CLEAR = _core_.CLEAR
393XOR = _core_.XOR
394INVERT = _core_.INVERT
395OR_REVERSE = _core_.OR_REVERSE
396AND_REVERSE = _core_.AND_REVERSE
397COPY = _core_.COPY
398AND = _core_.AND
399AND_INVERT = _core_.AND_INVERT
400NO_OP = _core_.NO_OP
401NOR = _core_.NOR
402EQUIV = _core_.EQUIV
403SRC_INVERT = _core_.SRC_INVERT
404OR_INVERT = _core_.OR_INVERT
405NAND = _core_.NAND
406OR = _core_.OR
407SET = _core_.SET
408WXK_BACK = _core_.WXK_BACK
409WXK_TAB = _core_.WXK_TAB
410WXK_RETURN = _core_.WXK_RETURN
411WXK_ESCAPE = _core_.WXK_ESCAPE
412WXK_SPACE = _core_.WXK_SPACE
413WXK_DELETE = _core_.WXK_DELETE
414WXK_START = _core_.WXK_START
415WXK_LBUTTON = _core_.WXK_LBUTTON
416WXK_RBUTTON = _core_.WXK_RBUTTON
417WXK_CANCEL = _core_.WXK_CANCEL
418WXK_MBUTTON = _core_.WXK_MBUTTON
419WXK_CLEAR = _core_.WXK_CLEAR
420WXK_SHIFT = _core_.WXK_SHIFT
421WXK_ALT = _core_.WXK_ALT
422WXK_CONTROL = _core_.WXK_CONTROL
423WXK_MENU = _core_.WXK_MENU
424WXK_PAUSE = _core_.WXK_PAUSE
425WXK_CAPITAL = _core_.WXK_CAPITAL
426WXK_PRIOR = _core_.WXK_PRIOR
427WXK_NEXT = _core_.WXK_NEXT
428WXK_END = _core_.WXK_END
429WXK_HOME = _core_.WXK_HOME
430WXK_LEFT = _core_.WXK_LEFT
431WXK_UP = _core_.WXK_UP
432WXK_RIGHT = _core_.WXK_RIGHT
433WXK_DOWN = _core_.WXK_DOWN
434WXK_SELECT = _core_.WXK_SELECT
435WXK_PRINT = _core_.WXK_PRINT
436WXK_EXECUTE = _core_.WXK_EXECUTE
437WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
438WXK_INSERT = _core_.WXK_INSERT
439WXK_HELP = _core_.WXK_HELP
440WXK_NUMPAD0 = _core_.WXK_NUMPAD0
441WXK_NUMPAD1 = _core_.WXK_NUMPAD1
442WXK_NUMPAD2 = _core_.WXK_NUMPAD2
443WXK_NUMPAD3 = _core_.WXK_NUMPAD3
444WXK_NUMPAD4 = _core_.WXK_NUMPAD4
445WXK_NUMPAD5 = _core_.WXK_NUMPAD5
446WXK_NUMPAD6 = _core_.WXK_NUMPAD6
447WXK_NUMPAD7 = _core_.WXK_NUMPAD7
448WXK_NUMPAD8 = _core_.WXK_NUMPAD8
449WXK_NUMPAD9 = _core_.WXK_NUMPAD9
450WXK_MULTIPLY = _core_.WXK_MULTIPLY
451WXK_ADD = _core_.WXK_ADD
452WXK_SEPARATOR = _core_.WXK_SEPARATOR
453WXK_SUBTRACT = _core_.WXK_SUBTRACT
454WXK_DECIMAL = _core_.WXK_DECIMAL
455WXK_DIVIDE = _core_.WXK_DIVIDE
456WXK_F1 = _core_.WXK_F1
457WXK_F2 = _core_.WXK_F2
458WXK_F3 = _core_.WXK_F3
459WXK_F4 = _core_.WXK_F4
460WXK_F5 = _core_.WXK_F5
461WXK_F6 = _core_.WXK_F6
462WXK_F7 = _core_.WXK_F7
463WXK_F8 = _core_.WXK_F8
464WXK_F9 = _core_.WXK_F9
465WXK_F10 = _core_.WXK_F10
466WXK_F11 = _core_.WXK_F11
467WXK_F12 = _core_.WXK_F12
468WXK_F13 = _core_.WXK_F13
469WXK_F14 = _core_.WXK_F14
470WXK_F15 = _core_.WXK_F15
471WXK_F16 = _core_.WXK_F16
472WXK_F17 = _core_.WXK_F17
473WXK_F18 = _core_.WXK_F18
474WXK_F19 = _core_.WXK_F19
475WXK_F20 = _core_.WXK_F20
476WXK_F21 = _core_.WXK_F21
477WXK_F22 = _core_.WXK_F22
478WXK_F23 = _core_.WXK_F23
479WXK_F24 = _core_.WXK_F24
480WXK_NUMLOCK = _core_.WXK_NUMLOCK
481WXK_SCROLL = _core_.WXK_SCROLL
482WXK_PAGEUP = _core_.WXK_PAGEUP
483WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
484WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
485WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
486WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
487WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
488WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
489WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
490WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
491WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
492WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
493WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
494WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
495WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
496WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
497WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
498WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
499WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
500WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
501WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
502WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
503WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
504WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
505WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
506WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
507WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
508WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
509WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
510WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
511WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
512WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
513WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
88c6b281
RD
514WXK_COMMAND = _core_.WXK_COMMAND
515WXK_SPECIAL1 = _core_.WXK_SPECIAL1
516WXK_SPECIAL2 = _core_.WXK_SPECIAL2
517WXK_SPECIAL3 = _core_.WXK_SPECIAL3
518WXK_SPECIAL4 = _core_.WXK_SPECIAL4
519WXK_SPECIAL5 = _core_.WXK_SPECIAL5
520WXK_SPECIAL6 = _core_.WXK_SPECIAL6
521WXK_SPECIAL7 = _core_.WXK_SPECIAL7
522WXK_SPECIAL8 = _core_.WXK_SPECIAL8
523WXK_SPECIAL9 = _core_.WXK_SPECIAL9
524WXK_SPECIAL10 = _core_.WXK_SPECIAL10
525WXK_SPECIAL11 = _core_.WXK_SPECIAL11
526WXK_SPECIAL12 = _core_.WXK_SPECIAL12
527WXK_SPECIAL13 = _core_.WXK_SPECIAL13
528WXK_SPECIAL14 = _core_.WXK_SPECIAL14
529WXK_SPECIAL15 = _core_.WXK_SPECIAL15
530WXK_SPECIAL16 = _core_.WXK_SPECIAL16
531WXK_SPECIAL17 = _core_.WXK_SPECIAL17
532WXK_SPECIAL18 = _core_.WXK_SPECIAL18
533WXK_SPECIAL19 = _core_.WXK_SPECIAL19
534WXK_SPECIAL20 = _core_.WXK_SPECIAL20
d55e5bfc
RD
535PAPER_NONE = _core_.PAPER_NONE
536PAPER_LETTER = _core_.PAPER_LETTER
537PAPER_LEGAL = _core_.PAPER_LEGAL
538PAPER_A4 = _core_.PAPER_A4
539PAPER_CSHEET = _core_.PAPER_CSHEET
540PAPER_DSHEET = _core_.PAPER_DSHEET
541PAPER_ESHEET = _core_.PAPER_ESHEET
542PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
543PAPER_TABLOID = _core_.PAPER_TABLOID
544PAPER_LEDGER = _core_.PAPER_LEDGER
545PAPER_STATEMENT = _core_.PAPER_STATEMENT
546PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
547PAPER_A3 = _core_.PAPER_A3
548PAPER_A4SMALL = _core_.PAPER_A4SMALL
549PAPER_A5 = _core_.PAPER_A5
550PAPER_B4 = _core_.PAPER_B4
551PAPER_B5 = _core_.PAPER_B5
552PAPER_FOLIO = _core_.PAPER_FOLIO
553PAPER_QUARTO = _core_.PAPER_QUARTO
554PAPER_10X14 = _core_.PAPER_10X14
555PAPER_11X17 = _core_.PAPER_11X17
556PAPER_NOTE = _core_.PAPER_NOTE
557PAPER_ENV_9 = _core_.PAPER_ENV_9
558PAPER_ENV_10 = _core_.PAPER_ENV_10
559PAPER_ENV_11 = _core_.PAPER_ENV_11
560PAPER_ENV_12 = _core_.PAPER_ENV_12
561PAPER_ENV_14 = _core_.PAPER_ENV_14
562PAPER_ENV_DL = _core_.PAPER_ENV_DL
563PAPER_ENV_C5 = _core_.PAPER_ENV_C5
564PAPER_ENV_C3 = _core_.PAPER_ENV_C3
565PAPER_ENV_C4 = _core_.PAPER_ENV_C4
566PAPER_ENV_C6 = _core_.PAPER_ENV_C6
567PAPER_ENV_C65 = _core_.PAPER_ENV_C65
568PAPER_ENV_B4 = _core_.PAPER_ENV_B4
569PAPER_ENV_B5 = _core_.PAPER_ENV_B5
570PAPER_ENV_B6 = _core_.PAPER_ENV_B6
571PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
572PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
573PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
574PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
575PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
576PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
577PAPER_ISO_B4 = _core_.PAPER_ISO_B4
578PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
579PAPER_9X11 = _core_.PAPER_9X11
580PAPER_10X11 = _core_.PAPER_10X11
581PAPER_15X11 = _core_.PAPER_15X11
582PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
583PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
584PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
585PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
586PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
587PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
588PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
589PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
590PAPER_A_PLUS = _core_.PAPER_A_PLUS
591PAPER_B_PLUS = _core_.PAPER_B_PLUS
592PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
593PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
594PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
595PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
596PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
597PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
598PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
599PAPER_A2 = _core_.PAPER_A2
600PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
601PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
034e3677
RD
602PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
603PAPER_A6 = _core_.PAPER_A6
604PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
605PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
606PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
607PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
608PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
609PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
610PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
611PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
612PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
613PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
614PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
615PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
616PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
617PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
618PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
619PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
620PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
621PAPER_B6_JIS = _core_.PAPER_B6_JIS
622PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
623PAPER_12X11 = _core_.PAPER_12X11
624PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
625PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
626PAPER_P16K = _core_.PAPER_P16K
627PAPER_P32K = _core_.PAPER_P32K
628PAPER_P32KBIG = _core_.PAPER_P32KBIG
629PAPER_PENV_1 = _core_.PAPER_PENV_1
630PAPER_PENV_2 = _core_.PAPER_PENV_2
631PAPER_PENV_3 = _core_.PAPER_PENV_3
632PAPER_PENV_4 = _core_.PAPER_PENV_4
633PAPER_PENV_5 = _core_.PAPER_PENV_5
634PAPER_PENV_6 = _core_.PAPER_PENV_6
635PAPER_PENV_7 = _core_.PAPER_PENV_7
636PAPER_PENV_8 = _core_.PAPER_PENV_8
637PAPER_PENV_9 = _core_.PAPER_PENV_9
638PAPER_PENV_10 = _core_.PAPER_PENV_10
639PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
640PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
641PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
642PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
643PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
644PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
645PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
646PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
647PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
648PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
649PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
650PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
651PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
d55e5bfc
RD
652DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
653DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
654DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
655ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
656ITEM_NORMAL = _core_.ITEM_NORMAL
657ITEM_CHECK = _core_.ITEM_CHECK
658ITEM_RADIO = _core_.ITEM_RADIO
659ITEM_MAX = _core_.ITEM_MAX
660HT_NOWHERE = _core_.HT_NOWHERE
661HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
662HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
663HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
664HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
665HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
666HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
667HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
668HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
669HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
670HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
671HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
672HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
673HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
674HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
675HT_MAX = _core_.HT_MAX
676MOD_NONE = _core_.MOD_NONE
677MOD_ALT = _core_.MOD_ALT
678MOD_CONTROL = _core_.MOD_CONTROL
9d7dfdff 679MOD_ALTGR = _core_.MOD_ALTGR
d55e5bfc 680MOD_SHIFT = _core_.MOD_SHIFT
9d7dfdff 681MOD_META = _core_.MOD_META
d55e5bfc 682MOD_WIN = _core_.MOD_WIN
9d7dfdff
RD
683MOD_CMD = _core_.MOD_CMD
684MOD_ALL = _core_.MOD_ALL
d55e5bfc
RD
685UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
686UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
687UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
688#---------------------------------------------------------------------------
689
690class Object(object):
691 """
692 The base class for most wx objects, although in wxPython not
693 much functionality is needed nor exposed.
694 """
554f62e9
RD
695 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
696 def __init__(self): raise AttributeError, "No constructor defined"
697 __repr__ = _swig_repr
d55e5bfc
RD
698 def GetClassName(*args, **kwargs):
699 """
700 GetClassName(self) -> String
701
702 Returns the class name of the C++ class using wxRTTI.
703 """
704 return _core_.Object_GetClassName(*args, **kwargs)
705
706 def Destroy(*args, **kwargs):
707 """
708 Destroy(self)
709
710 Deletes the C++ object this Python object is a proxy for.
711 """
7e08d4ef
RD
712 val = _core_.Object_Destroy(*args, **kwargs)
713 args[0].thisown = 0
714 return val
d55e5bfc 715
2131d850 716_core_.Object_swigregister(Object)
d55e5bfc 717_wxPySetDictionary = _core_._wxPySetDictionary
d55e5bfc
RD
718cvar = _core_.cvar
719EmptyString = cvar.EmptyString
720
721#---------------------------------------------------------------------------
722
723BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
724BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
725BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
726BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
727BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
728BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
729BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
730BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
731BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
732BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
733BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
734BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
735BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
736BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
737BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
738BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
739BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
740BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
741BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
742BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
743CURSOR_NONE = _core_.CURSOR_NONE
744CURSOR_ARROW = _core_.CURSOR_ARROW
745CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
746CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
747CURSOR_CHAR = _core_.CURSOR_CHAR
748CURSOR_CROSS = _core_.CURSOR_CROSS
749CURSOR_HAND = _core_.CURSOR_HAND
750CURSOR_IBEAM = _core_.CURSOR_IBEAM
751CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
752CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
753CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
754CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
755CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
756CURSOR_PENCIL = _core_.CURSOR_PENCIL
757CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
758CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
759CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
760CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
761CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
762CURSOR_SIZENS = _core_.CURSOR_SIZENS
763CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
764CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
765CURSOR_SIZING = _core_.CURSOR_SIZING
766CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
767CURSOR_WAIT = _core_.CURSOR_WAIT
768CURSOR_WATCH = _core_.CURSOR_WATCH
769CURSOR_BLANK = _core_.CURSOR_BLANK
770CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
771CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
772CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
773CURSOR_MAX = _core_.CURSOR_MAX
774#---------------------------------------------------------------------------
775
776class Size(object):
777 """
79fccf9d 778 wx.Size is a useful data structure used to represent the size of
554f62e9
RD
779 something. It simply contains integer width and height
780 properties. In most places in wxPython where a wx.Size is
093d3ff1 781 expected a (width, height) tuple can be used instead.
d55e5bfc 782 """
554f62e9
RD
783 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
784 __repr__ = _swig_repr
d55e5bfc
RD
785 width = property(_core_.Size_width_get, _core_.Size_width_set)
786 height = property(_core_.Size_height_get, _core_.Size_height_set)
787 x = width; y = height
554f62e9 788 def __init__(self, *args, **kwargs):
d55e5bfc
RD
789 """
790 __init__(self, int w=0, int h=0) -> Size
791
792 Creates a size object.
793 """
554f62e9
RD
794 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
795 __swig_destroy__ = _core_.delete_Size
796 __del__ = lambda self : None;
d55e5bfc
RD
797 def __eq__(*args, **kwargs):
798 """
e9d6f3a4 799 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
800
801 Test for equality of wx.Size objects.
802 """
803 return _core_.Size___eq__(*args, **kwargs)
804
805 def __ne__(*args, **kwargs):
806 """
e9d6f3a4 807 __ne__(self, PyObject other) -> bool
d55e5bfc 808
e9d6f3a4 809 Test for inequality of wx.Size objects.
d55e5bfc
RD
810 """
811 return _core_.Size___ne__(*args, **kwargs)
812
813 def __add__(*args, **kwargs):
814 """
815 __add__(self, Size sz) -> Size
816
817 Add sz's proprties to this and return the result.
818 """
819 return _core_.Size___add__(*args, **kwargs)
820
821 def __sub__(*args, **kwargs):
822 """
823 __sub__(self, Size sz) -> Size
824
825 Subtract sz's properties from this and return the result.
826 """
827 return _core_.Size___sub__(*args, **kwargs)
828
829 def IncTo(*args, **kwargs):
830 """
831 IncTo(self, Size sz)
832
833 Increments this object so that both of its dimensions are not less
834 than the corresponding dimensions of the size.
835 """
836 return _core_.Size_IncTo(*args, **kwargs)
837
838 def DecTo(*args, **kwargs):
839 """
840 DecTo(self, Size sz)
841
842 Decrements this object so that both of its dimensions are not greater
843 than the corresponding dimensions of the size.
844 """
845 return _core_.Size_DecTo(*args, **kwargs)
846
847 def Set(*args, **kwargs):
848 """
849 Set(self, int w, int h)
850
851 Set both width and height.
852 """
853 return _core_.Size_Set(*args, **kwargs)
854
855 def SetWidth(*args, **kwargs):
856 """SetWidth(self, int w)"""
857 return _core_.Size_SetWidth(*args, **kwargs)
858
859 def SetHeight(*args, **kwargs):
860 """SetHeight(self, int h)"""
861 return _core_.Size_SetHeight(*args, **kwargs)
862
863 def GetWidth(*args, **kwargs):
864 """GetWidth(self) -> int"""
865 return _core_.Size_GetWidth(*args, **kwargs)
866
867 def GetHeight(*args, **kwargs):
868 """GetHeight(self) -> int"""
869 return _core_.Size_GetHeight(*args, **kwargs)
870
871 def IsFullySpecified(*args, **kwargs):
872 """
873 IsFullySpecified(self) -> bool
874
875 Returns True if both components of the size are non-default values.
876 """
877 return _core_.Size_IsFullySpecified(*args, **kwargs)
878
879 def SetDefaults(*args, **kwargs):
880 """
881 SetDefaults(self, Size size)
882
79fccf9d
RD
883 Combine this size with the other one replacing the default components
884 of this object (i.e. equal to -1) with those of the other.
d55e5bfc
RD
885 """
886 return _core_.Size_SetDefaults(*args, **kwargs)
887
888 def Get(*args, **kwargs):
889 """
890 Get() -> (width,height)
891
892 Returns the width and height properties as a tuple.
893 """
894 return _core_.Size_Get(*args, **kwargs)
895
79fccf9d 896 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
897 def __str__(self): return str(self.Get())
898 def __repr__(self): return 'wx.Size'+str(self.Get())
899 def __len__(self): return len(self.Get())
900 def __getitem__(self, index): return self.Get()[index]
901 def __setitem__(self, index, val):
902 if index == 0: self.width = val
903 elif index == 1: self.height = val
904 else: raise IndexError
905 def __nonzero__(self): return self.Get() != (0,0)
906 __safe_for_unpickling__ = True
907 def __reduce__(self): return (wx.Size, self.Get())
908
2131d850 909_core_.Size_swigregister(Size)
d55e5bfc
RD
910
911#---------------------------------------------------------------------------
912
913class RealPoint(object):
914 """
79fccf9d
RD
915 A data structure for representing a point or position with floating
916 point x and y properties. In wxPython most places that expect a
917 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc 918 """
554f62e9
RD
919 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
920 __repr__ = _swig_repr
d55e5bfc
RD
921 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
922 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
554f62e9 923 def __init__(self, *args, **kwargs):
d55e5bfc
RD
924 """
925 __init__(self, double x=0.0, double y=0.0) -> RealPoint
926
927 Create a wx.RealPoint object
928 """
554f62e9
RD
929 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
930 __swig_destroy__ = _core_.delete_RealPoint
931 __del__ = lambda self : None;
d55e5bfc
RD
932 def __eq__(*args, **kwargs):
933 """
e9d6f3a4 934 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
935
936 Test for equality of wx.RealPoint objects.
937 """
938 return _core_.RealPoint___eq__(*args, **kwargs)
939
940 def __ne__(*args, **kwargs):
941 """
e9d6f3a4 942 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
943
944 Test for inequality of wx.RealPoint objects.
945 """
946 return _core_.RealPoint___ne__(*args, **kwargs)
947
948 def __add__(*args, **kwargs):
949 """
950 __add__(self, RealPoint pt) -> RealPoint
951
952 Add pt's proprties to this and return the result.
953 """
954 return _core_.RealPoint___add__(*args, **kwargs)
955
956 def __sub__(*args, **kwargs):
957 """
958 __sub__(self, RealPoint pt) -> RealPoint
959
960 Subtract pt's proprties from this and return the result
961 """
962 return _core_.RealPoint___sub__(*args, **kwargs)
963
964 def Set(*args, **kwargs):
965 """
966 Set(self, double x, double y)
967
968 Set both the x and y properties
969 """
970 return _core_.RealPoint_Set(*args, **kwargs)
971
972 def Get(*args, **kwargs):
973 """
974 Get() -> (x,y)
975
976 Return the x and y properties as a tuple.
977 """
978 return _core_.RealPoint_Get(*args, **kwargs)
979
79fccf9d 980 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
981 def __str__(self): return str(self.Get())
982 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
983 def __len__(self): return len(self.Get())
984 def __getitem__(self, index): return self.Get()[index]
985 def __setitem__(self, index, val):
986 if index == 0: self.x = val
987 elif index == 1: self.y = val
988 else: raise IndexError
989 def __nonzero__(self): return self.Get() != (0.0, 0.0)
990 __safe_for_unpickling__ = True
991 def __reduce__(self): return (wx.RealPoint, self.Get())
992
2131d850 993_core_.RealPoint_swigregister(RealPoint)
d55e5bfc
RD
994
995#---------------------------------------------------------------------------
996
997class Point(object):
998 """
79fccf9d
RD
999 A data structure for representing a point or position with integer x
1000 and y properties. Most places in wxPython that expect a wx.Point can
1001 also accept a (x,y) tuple.
d55e5bfc 1002 """
554f62e9
RD
1003 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1004 __repr__ = _swig_repr
d55e5bfc
RD
1005 x = property(_core_.Point_x_get, _core_.Point_x_set)
1006 y = property(_core_.Point_y_get, _core_.Point_y_set)
554f62e9 1007 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1008 """
1009 __init__(self, int x=0, int y=0) -> Point
1010
1011 Create a wx.Point object
1012 """
554f62e9
RD
1013 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1014 __swig_destroy__ = _core_.delete_Point
1015 __del__ = lambda self : None;
d55e5bfc
RD
1016 def __eq__(*args, **kwargs):
1017 """
e9d6f3a4 1018 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
1019
1020 Test for equality of wx.Point objects.
1021 """
1022 return _core_.Point___eq__(*args, **kwargs)
1023
1024 def __ne__(*args, **kwargs):
1025 """
e9d6f3a4 1026 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
1027
1028 Test for inequality of wx.Point objects.
1029 """
1030 return _core_.Point___ne__(*args, **kwargs)
1031
1032 def __add__(*args, **kwargs):
1033 """
1034 __add__(self, Point pt) -> Point
1035
1036 Add pt's proprties to this and return the result.
1037 """
1038 return _core_.Point___add__(*args, **kwargs)
1039
1040 def __sub__(*args, **kwargs):
1041 """
1042 __sub__(self, Point pt) -> Point
1043
1044 Subtract pt's proprties from this and return the result
1045 """
1046 return _core_.Point___sub__(*args, **kwargs)
1047
1048 def __iadd__(*args, **kwargs):
1049 """
1050 __iadd__(self, Point pt) -> Point
1051
1052 Add pt to this object.
1053 """
1054 return _core_.Point___iadd__(*args, **kwargs)
1055
1056 def __isub__(*args, **kwargs):
1057 """
1058 __isub__(self, Point pt) -> Point
1059
1060 Subtract pt from this object.
1061 """
1062 return _core_.Point___isub__(*args, **kwargs)
1063
1064 def Set(*args, **kwargs):
1065 """
1066 Set(self, long x, long y)
1067
1068 Set both the x and y properties
1069 """
1070 return _core_.Point_Set(*args, **kwargs)
1071
1072 def Get(*args, **kwargs):
1073 """
1074 Get() -> (x,y)
1075
1076 Return the x and y properties as a tuple.
1077 """
1078 return _core_.Point_Get(*args, **kwargs)
1079
79fccf9d 1080 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1081 def __str__(self): return str(self.Get())
1082 def __repr__(self): return 'wx.Point'+str(self.Get())
1083 def __len__(self): return len(self.Get())
1084 def __getitem__(self, index): return self.Get()[index]
1085 def __setitem__(self, index, val):
1086 if index == 0: self.x = val
1087 elif index == 1: self.y = val
1088 else: raise IndexError
1089 def __nonzero__(self): return self.Get() != (0,0)
1090 __safe_for_unpickling__ = True
1091 def __reduce__(self): return (wx.Point, self.Get())
1092
2131d850 1093_core_.Point_swigregister(Point)
d55e5bfc
RD
1094
1095#---------------------------------------------------------------------------
1096
1097class Rect(object):
1098 """
79fccf9d
RD
1099 A class for representing and manipulating rectangles. It has x, y,
1100 width and height properties. In wxPython most palces that expect a
1101 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc 1102 """
554f62e9
RD
1103 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1104 __repr__ = _swig_repr
1105 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1106 """
1107 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
1108
1109 Create a new Rect object.
1110 """
554f62e9
RD
1111 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1112 __swig_destroy__ = _core_.delete_Rect
1113 __del__ = lambda self : None;
d55e5bfc
RD
1114 def GetX(*args, **kwargs):
1115 """GetX(self) -> int"""
1116 return _core_.Rect_GetX(*args, **kwargs)
1117
1118 def SetX(*args, **kwargs):
1119 """SetX(self, int x)"""
1120 return _core_.Rect_SetX(*args, **kwargs)
1121
1122 def GetY(*args, **kwargs):
1123 """GetY(self) -> int"""
1124 return _core_.Rect_GetY(*args, **kwargs)
1125
1126 def SetY(*args, **kwargs):
1127 """SetY(self, int y)"""
1128 return _core_.Rect_SetY(*args, **kwargs)
1129
1130 def GetWidth(*args, **kwargs):
1131 """GetWidth(self) -> int"""
1132 return _core_.Rect_GetWidth(*args, **kwargs)
1133
1134 def SetWidth(*args, **kwargs):
1135 """SetWidth(self, int w)"""
1136 return _core_.Rect_SetWidth(*args, **kwargs)
1137
1138 def GetHeight(*args, **kwargs):
1139 """GetHeight(self) -> int"""
1140 return _core_.Rect_GetHeight(*args, **kwargs)
1141
1142 def SetHeight(*args, **kwargs):
1143 """SetHeight(self, int h)"""
1144 return _core_.Rect_SetHeight(*args, **kwargs)
1145
1146 def GetPosition(*args, **kwargs):
1147 """GetPosition(self) -> Point"""
1148 return _core_.Rect_GetPosition(*args, **kwargs)
1149
1150 def SetPosition(*args, **kwargs):
1151 """SetPosition(self, Point p)"""
1152 return _core_.Rect_SetPosition(*args, **kwargs)
1153
1154 def GetSize(*args, **kwargs):
1155 """GetSize(self) -> Size"""
1156 return _core_.Rect_GetSize(*args, **kwargs)
1157
1158 def SetSize(*args, **kwargs):
1159 """SetSize(self, Size s)"""
1160 return _core_.Rect_SetSize(*args, **kwargs)
1161
aff4cc5c
RD
1162 def IsEmpty(*args, **kwargs):
1163 """IsEmpty(self) -> bool"""
1164 return _core_.Rect_IsEmpty(*args, **kwargs)
1165
d55e5bfc
RD
1166 def GetTopLeft(*args, **kwargs):
1167 """GetTopLeft(self) -> Point"""
1168 return _core_.Rect_GetTopLeft(*args, **kwargs)
1169
1170 def SetTopLeft(*args, **kwargs):
1171 """SetTopLeft(self, Point p)"""
1172 return _core_.Rect_SetTopLeft(*args, **kwargs)
1173
1174 def GetBottomRight(*args, **kwargs):
1175 """GetBottomRight(self) -> Point"""
1176 return _core_.Rect_GetBottomRight(*args, **kwargs)
1177
1178 def SetBottomRight(*args, **kwargs):
1179 """SetBottomRight(self, Point p)"""
1180 return _core_.Rect_SetBottomRight(*args, **kwargs)
1181
1182 def GetLeft(*args, **kwargs):
1183 """GetLeft(self) -> int"""
1184 return _core_.Rect_GetLeft(*args, **kwargs)
1185
1186 def GetTop(*args, **kwargs):
1187 """GetTop(self) -> int"""
1188 return _core_.Rect_GetTop(*args, **kwargs)
1189
1190 def GetBottom(*args, **kwargs):
1191 """GetBottom(self) -> int"""
1192 return _core_.Rect_GetBottom(*args, **kwargs)
1193
1194 def GetRight(*args, **kwargs):
1195 """GetRight(self) -> int"""
1196 return _core_.Rect_GetRight(*args, **kwargs)
1197
1198 def SetLeft(*args, **kwargs):
1199 """SetLeft(self, int left)"""
1200 return _core_.Rect_SetLeft(*args, **kwargs)
1201
1202 def SetRight(*args, **kwargs):
1203 """SetRight(self, int right)"""
1204 return _core_.Rect_SetRight(*args, **kwargs)
1205
1206 def SetTop(*args, **kwargs):
1207 """SetTop(self, int top)"""
1208 return _core_.Rect_SetTop(*args, **kwargs)
1209
1210 def SetBottom(*args, **kwargs):
1211 """SetBottom(self, int bottom)"""
1212 return _core_.Rect_SetBottom(*args, **kwargs)
1213
1214 position = property(GetPosition, SetPosition)
1215 size = property(GetSize, SetSize)
1216 left = property(GetLeft, SetLeft)
1217 right = property(GetRight, SetRight)
1218 top = property(GetTop, SetTop)
1219 bottom = property(GetBottom, SetBottom)
1220
1221 def Inflate(*args, **kwargs):
1222 """
1223 Inflate(self, int dx, int dy) -> Rect
1224
091fdbfa
RD
1225 Increases the size of the rectangle.
1226
1227 The left border is moved farther left and the right border is moved
1228 farther right by ``dx``. The upper border is moved farther up and the
1229 bottom border is moved farther down by ``dy``. (Note the the width and
1230 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1231 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1232 opposite happens: the rectangle size decreases in the respective
1233 direction.
1234
1235 The change is made to the rectangle inplace, if instead you need a
1236 copy that is inflated, preserving the original then make the copy
1237 first::
1238
1239 copy = wx.Rect(*original)
1240 copy.Inflate(10,15)
1241
1242
d55e5bfc
RD
1243 """
1244 return _core_.Rect_Inflate(*args, **kwargs)
1245
1246 def Deflate(*args, **kwargs):
1247 """
1248 Deflate(self, int dx, int dy) -> Rect
1249
091fdbfa
RD
1250 Decrease the rectangle size. This method is the opposite of `Inflate`
1251 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1252 `Inflate` for a full description.
d55e5bfc
RD
1253 """
1254 return _core_.Rect_Deflate(*args, **kwargs)
1255
1256 def OffsetXY(*args, **kwargs):
1257 """
1258 OffsetXY(self, int dx, int dy)
1259
79fccf9d
RD
1260 Moves the rectangle by the specified offset. If dx is positive, the
1261 rectangle is moved to the right, if dy is positive, it is moved to the
1262 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc
RD
1263 """
1264 return _core_.Rect_OffsetXY(*args, **kwargs)
1265
1266 def Offset(*args, **kwargs):
1267 """
1268 Offset(self, Point pt)
1269
b1fcee84 1270 Same as `OffsetXY` but uses dx,dy from Point
d55e5bfc
RD
1271 """
1272 return _core_.Rect_Offset(*args, **kwargs)
1273
1274 def Intersect(*args, **kwargs):
1275 """
1276 Intersect(self, Rect rect) -> Rect
1277
b519803b 1278 Returns the intersectsion of this rectangle and rect.
d55e5bfc
RD
1279 """
1280 return _core_.Rect_Intersect(*args, **kwargs)
1281
b519803b
RD
1282 def Union(*args, **kwargs):
1283 """
1284 Union(self, Rect rect) -> Rect
1285
1286 Returns the union of this rectangle and rect.
1287 """
1288 return _core_.Rect_Union(*args, **kwargs)
1289
d55e5bfc
RD
1290 def __add__(*args, **kwargs):
1291 """
1292 __add__(self, Rect rect) -> Rect
1293
1294 Add the properties of rect to this rectangle and return the result.
1295 """
1296 return _core_.Rect___add__(*args, **kwargs)
1297
1298 def __iadd__(*args, **kwargs):
1299 """
1300 __iadd__(self, Rect rect) -> Rect
1301
1302 Add the properties of rect to this rectangle, updating this rectangle.
1303 """
1304 return _core_.Rect___iadd__(*args, **kwargs)
1305
1306 def __eq__(*args, **kwargs):
1307 """
e9d6f3a4 1308 __eq__(self, PyObject other) -> bool
d55e5bfc 1309
e9d6f3a4 1310 Test for equality of wx.Rect objects.
d55e5bfc
RD
1311 """
1312 return _core_.Rect___eq__(*args, **kwargs)
1313
1314 def __ne__(*args, **kwargs):
1315 """
e9d6f3a4 1316 __ne__(self, PyObject other) -> bool
d55e5bfc 1317
e9d6f3a4 1318 Test for inequality of wx.Rect objects.
d55e5bfc
RD
1319 """
1320 return _core_.Rect___ne__(*args, **kwargs)
1321
1322 def InsideXY(*args, **kwargs):
1323 """
1324 InsideXY(self, int x, int y) -> bool
1325
1326 Return True if the point is (not strcitly) inside the rect.
1327 """
1328 return _core_.Rect_InsideXY(*args, **kwargs)
1329
1330 def Inside(*args, **kwargs):
1331 """
1332 Inside(self, Point pt) -> bool
1333
1334 Return True if the point is (not strcitly) inside the rect.
1335 """
1336 return _core_.Rect_Inside(*args, **kwargs)
1337
1338 def Intersects(*args, **kwargs):
1339 """
1340 Intersects(self, Rect rect) -> bool
1341
1342 Returns True if the rectangles have a non empty intersection.
1343 """
1344 return _core_.Rect_Intersects(*args, **kwargs)
1345
b1fcee84
RD
1346 def CenterIn(*args, **kwargs):
1347 """
1348 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1349
1350 Center this rectangle within the one passed to the method, which is
1351 usually, but not necessarily, the larger one.
1352 """
1353 return _core_.Rect_CenterIn(*args, **kwargs)
1354
1355 CentreIn = CenterIn
d55e5bfc
RD
1356 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1357 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1358 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1359 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
1360 def Set(*args, **kwargs):
1361 """
1362 Set(self, int x=0, int y=0, int width=0, int height=0)
1363
1364 Set all rectangle properties.
1365 """
1366 return _core_.Rect_Set(*args, **kwargs)
1367
1368 def Get(*args, **kwargs):
1369 """
1370 Get() -> (x,y,width,height)
1371
1372 Return the rectangle properties as a tuple.
1373 """
1374 return _core_.Rect_Get(*args, **kwargs)
1375
79fccf9d 1376 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1377 def __str__(self): return str(self.Get())
1378 def __repr__(self): return 'wx.Rect'+str(self.Get())
1379 def __len__(self): return len(self.Get())
1380 def __getitem__(self, index): return self.Get()[index]
1381 def __setitem__(self, index, val):
1382 if index == 0: self.x = val
1383 elif index == 1: self.y = val
1384 elif index == 2: self.width = val
1385 elif index == 3: self.height = val
1386 else: raise IndexError
1387 def __nonzero__(self): return self.Get() != (0,0,0,0)
1388 __safe_for_unpickling__ = True
1389 def __reduce__(self): return (wx.Rect, self.Get())
1390
2131d850 1391_core_.Rect_swigregister(Rect)
d55e5bfc
RD
1392
1393def RectPP(*args, **kwargs):
1394 """
1395 RectPP(Point topLeft, Point bottomRight) -> Rect
1396
1397 Create a new Rect object from Points representing two corners.
1398 """
1399 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1400 return val
1401
1402def RectPS(*args, **kwargs):
1403 """
1404 RectPS(Point pos, Size size) -> Rect
1405
1406 Create a new Rect from a position and size.
1407 """
1408 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1409 return val
1410
c1cb24a4
RD
1411def RectS(*args, **kwargs):
1412 """
1413 RectS(Size size) -> Rect
1414
1415 Create a new Rect from a size only.
1416 """
1417 val = _core_.new_RectS(*args, **kwargs)
c1cb24a4
RD
1418 return val
1419
d55e5bfc
RD
1420
1421def IntersectRect(*args, **kwargs):
554f62e9 1422 """
d55e5bfc
RD
1423 IntersectRect(Rect r1, Rect r2) -> Rect
1424
1425 Calculate and return the intersection of r1 and r2.
1426 """
554f62e9 1427 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1428#---------------------------------------------------------------------------
1429
1430class Point2D(object):
79fccf9d
RD
1431 """
1432 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1433 with floating point values.
1434 """
554f62e9
RD
1435 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1436 __repr__ = _swig_repr
1437 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1438 """
1439 __init__(self, double x=0.0, double y=0.0) -> Point2D
1440
1441 Create a w.Point2D object.
1442 """
554f62e9 1443 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
d55e5bfc 1444 def GetFloor(*args, **kwargs):
a8eff060
RD
1445 """
1446 GetFloor() -> (x,y)
1447
1448 Convert to integer
1449 """
d55e5bfc
RD
1450 return _core_.Point2D_GetFloor(*args, **kwargs)
1451
1452 def GetRounded(*args, **kwargs):
a8eff060
RD
1453 """
1454 GetRounded() -> (x,y)
1455
1456 Convert to integer
1457 """
d55e5bfc
RD
1458 return _core_.Point2D_GetRounded(*args, **kwargs)
1459
1460 def GetVectorLength(*args, **kwargs):
1461 """GetVectorLength(self) -> double"""
1462 return _core_.Point2D_GetVectorLength(*args, **kwargs)
1463
1464 def GetVectorAngle(*args, **kwargs):
1465 """GetVectorAngle(self) -> double"""
1466 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
1467
1468 def SetVectorLength(*args, **kwargs):
1469 """SetVectorLength(self, double length)"""
1470 return _core_.Point2D_SetVectorLength(*args, **kwargs)
1471
1472 def SetVectorAngle(*args, **kwargs):
1473 """SetVectorAngle(self, double degrees)"""
1474 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
1475
1476 def SetPolarCoordinates(self, angle, length):
1477 self.SetVectorLength(length)
1478 self.SetVectorAngle(angle)
1479 def Normalize(self):
1480 self.SetVectorLength(1.0)
1481
1482 def GetDistance(*args, **kwargs):
1483 """GetDistance(self, Point2D pt) -> double"""
1484 return _core_.Point2D_GetDistance(*args, **kwargs)
1485
1486 def GetDistanceSquare(*args, **kwargs):
1487 """GetDistanceSquare(self, Point2D pt) -> double"""
1488 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
1489
1490 def GetDotProduct(*args, **kwargs):
1491 """GetDotProduct(self, Point2D vec) -> double"""
1492 return _core_.Point2D_GetDotProduct(*args, **kwargs)
1493
1494 def GetCrossProduct(*args, **kwargs):
1495 """GetCrossProduct(self, Point2D vec) -> double"""
1496 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
1497
1498 def __neg__(*args, **kwargs):
1499 """
1500 __neg__(self) -> Point2D
1501
1502 the reflection of this point
1503 """
1504 return _core_.Point2D___neg__(*args, **kwargs)
1505
1506 def __iadd__(*args, **kwargs):
1507 """__iadd__(self, Point2D pt) -> Point2D"""
1508 return _core_.Point2D___iadd__(*args, **kwargs)
1509
1510 def __isub__(*args, **kwargs):
1511 """__isub__(self, Point2D pt) -> Point2D"""
1512 return _core_.Point2D___isub__(*args, **kwargs)
1513
1514 def __imul__(*args, **kwargs):
1515 """__imul__(self, Point2D pt) -> Point2D"""
1516 return _core_.Point2D___imul__(*args, **kwargs)
1517
1518 def __idiv__(*args, **kwargs):
1519 """__idiv__(self, Point2D pt) -> Point2D"""
1520 return _core_.Point2D___idiv__(*args, **kwargs)
1521
1522 def __eq__(*args, **kwargs):
1523 """
e9d6f3a4 1524 __eq__(self, PyObject other) -> bool
d55e5bfc 1525
e9d6f3a4 1526 Test for equality of wx.Point2D objects.
d55e5bfc
RD
1527 """
1528 return _core_.Point2D___eq__(*args, **kwargs)
1529
1530 def __ne__(*args, **kwargs):
1531 """
e9d6f3a4 1532 __ne__(self, PyObject other) -> bool
d55e5bfc 1533
e9d6f3a4 1534 Test for inequality of wx.Point2D objects.
d55e5bfc
RD
1535 """
1536 return _core_.Point2D___ne__(*args, **kwargs)
1537
1538 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1539 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
1540 def Set(*args, **kwargs):
1541 """Set(self, double x=0, double y=0)"""
1542 return _core_.Point2D_Set(*args, **kwargs)
1543
1544 def Get(*args, **kwargs):
1545 """
1546 Get() -> (x,y)
1547
1548 Return x and y properties as a tuple.
1549 """
1550 return _core_.Point2D_Get(*args, **kwargs)
1551
79fccf9d 1552 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1553 def __str__(self): return str(self.Get())
1554 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1555 def __len__(self): return len(self.Get())
1556 def __getitem__(self, index): return self.Get()[index]
1557 def __setitem__(self, index, val):
1558 if index == 0: self.x = val
1559 elif index == 1: self.y = val
1560 else: raise IndexError
1561 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1562 __safe_for_unpickling__ = True
1563 def __reduce__(self): return (wx.Point2D, self.Get())
1564
2131d850 1565_core_.Point2D_swigregister(Point2D)
d55e5bfc
RD
1566
1567def Point2DCopy(*args, **kwargs):
1568 """
1569 Point2DCopy(Point2D pt) -> Point2D
1570
1571 Create a w.Point2D object.
1572 """
1573 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1574 return val
1575
1576def Point2DFromPoint(*args, **kwargs):
1577 """
1578 Point2DFromPoint(Point pt) -> Point2D
1579
1580 Create a w.Point2D object.
1581 """
1582 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d55e5bfc
RD
1583 return val
1584
1585#---------------------------------------------------------------------------
1586
1587FromStart = _core_.FromStart
1588FromCurrent = _core_.FromCurrent
1589FromEnd = _core_.FromEnd
1590class InputStream(object):
093d3ff1 1591 """Proxy of C++ InputStream class"""
554f62e9
RD
1592 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1593 __repr__ = _swig_repr
1594 def __init__(self, *args, **kwargs):
d55e5bfc 1595 """__init__(self, PyObject p) -> InputStream"""
554f62e9
RD
1596 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1597 __swig_destroy__ = _core_.delete_InputStream
1598 __del__ = lambda self : None;
d55e5bfc
RD
1599 def close(*args, **kwargs):
1600 """close(self)"""
1601 return _core_.InputStream_close(*args, **kwargs)
1602
1603 def flush(*args, **kwargs):
1604 """flush(self)"""
1605 return _core_.InputStream_flush(*args, **kwargs)
1606
1607 def eof(*args, **kwargs):
1608 """eof(self) -> bool"""
1609 return _core_.InputStream_eof(*args, **kwargs)
1610
1611 def read(*args, **kwargs):
1612 """read(self, int size=-1) -> PyObject"""
1613 return _core_.InputStream_read(*args, **kwargs)
1614
1615 def readline(*args, **kwargs):
1616 """readline(self, int size=-1) -> PyObject"""
1617 return _core_.InputStream_readline(*args, **kwargs)
1618
1619 def readlines(*args, **kwargs):
1620 """readlines(self, int sizehint=-1) -> PyObject"""
1621 return _core_.InputStream_readlines(*args, **kwargs)
1622
1623 def seek(*args, **kwargs):
1624 """seek(self, int offset, int whence=0)"""
1625 return _core_.InputStream_seek(*args, **kwargs)
1626
1627 def tell(*args, **kwargs):
1628 """tell(self) -> int"""
1629 return _core_.InputStream_tell(*args, **kwargs)
1630
1631 def Peek(*args, **kwargs):
1632 """Peek(self) -> char"""
1633 return _core_.InputStream_Peek(*args, **kwargs)
1634
1635 def GetC(*args, **kwargs):
1636 """GetC(self) -> char"""
1637 return _core_.InputStream_GetC(*args, **kwargs)
1638
1639 def LastRead(*args, **kwargs):
1640 """LastRead(self) -> size_t"""
1641 return _core_.InputStream_LastRead(*args, **kwargs)
1642
1643 def CanRead(*args, **kwargs):
1644 """CanRead(self) -> bool"""
1645 return _core_.InputStream_CanRead(*args, **kwargs)
1646
1647 def Eof(*args, **kwargs):
1648 """Eof(self) -> bool"""
1649 return _core_.InputStream_Eof(*args, **kwargs)
1650
1651 def Ungetch(*args, **kwargs):
1652 """Ungetch(self, char c) -> bool"""
1653 return _core_.InputStream_Ungetch(*args, **kwargs)
1654
1655 def SeekI(*args, **kwargs):
1656 """SeekI(self, long pos, int mode=FromStart) -> long"""
1657 return _core_.InputStream_SeekI(*args, **kwargs)
1658
1659 def TellI(*args, **kwargs):
1660 """TellI(self) -> long"""
1661 return _core_.InputStream_TellI(*args, **kwargs)
1662
2131d850 1663_core_.InputStream_swigregister(InputStream)
d55e5bfc
RD
1664DefaultPosition = cvar.DefaultPosition
1665DefaultSize = cvar.DefaultSize
1666
1667class OutputStream(object):
093d3ff1 1668 """Proxy of C++ OutputStream class"""
554f62e9
RD
1669 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1670 def __init__(self): raise AttributeError, "No constructor defined"
1671 __repr__ = _swig_repr
d55e5bfc
RD
1672 def write(*args, **kwargs):
1673 """write(self, PyObject obj)"""
1674 return _core_.OutputStream_write(*args, **kwargs)
1675
554f62e9
RD
1676 def LastWrite(*args, **kwargs):
1677 """LastWrite(self) -> size_t"""
1678 return _core_.OutputStream_LastWrite(*args, **kwargs)
d55e5bfc 1679
2131d850 1680_core_.OutputStream_swigregister(OutputStream)
d55e5bfc
RD
1681
1682#---------------------------------------------------------------------------
1683
1684class FSFile(Object):
093d3ff1 1685 """Proxy of C++ FSFile class"""
554f62e9
RD
1686 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1687 __repr__ = _swig_repr
1688 def __init__(self, *args, **kwargs):
d55e5bfc
RD
1689 """
1690 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1691 DateTime modif) -> FSFile
1692 """
554f62e9 1693 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
e2950dbb 1694 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
4cf4100f 1695
554f62e9
RD
1696 __swig_destroy__ = _core_.delete_FSFile
1697 __del__ = lambda self : None;
d55e5bfc
RD
1698 def GetStream(*args, **kwargs):
1699 """GetStream(self) -> InputStream"""
1700 return _core_.FSFile_GetStream(*args, **kwargs)
1701
1702 def GetMimeType(*args, **kwargs):
1703 """GetMimeType(self) -> String"""
1704 return _core_.FSFile_GetMimeType(*args, **kwargs)
1705
1706 def GetLocation(*args, **kwargs):
1707 """GetLocation(self) -> String"""
1708 return _core_.FSFile_GetLocation(*args, **kwargs)
1709
1710 def GetAnchor(*args, **kwargs):
1711 """GetAnchor(self) -> String"""
1712 return _core_.FSFile_GetAnchor(*args, **kwargs)
1713
1714 def GetModificationTime(*args, **kwargs):
1715 """GetModificationTime(self) -> DateTime"""
1716 return _core_.FSFile_GetModificationTime(*args, **kwargs)
1717
2131d850 1718_core_.FSFile_swigregister(FSFile)
d55e5bfc
RD
1719
1720class CPPFileSystemHandler(object):
093d3ff1 1721 """Proxy of C++ CPPFileSystemHandler class"""
554f62e9
RD
1722 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1723 def __init__(self): raise AttributeError, "No constructor defined"
1724 __repr__ = _swig_repr
50f151d7
RD
1725 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1726 __del__ = lambda self : None;
2131d850 1727_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d55e5bfc
RD
1728
1729class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 1730 """Proxy of C++ FileSystemHandler class"""
554f62e9
RD
1731 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1732 __repr__ = _swig_repr
1733 def __init__(self, *args, **kwargs):
d55e5bfc 1734 """__init__(self) -> FileSystemHandler"""
554f62e9 1735 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
d55e5bfc
RD
1736 self._setCallbackInfo(self, FileSystemHandler)
1737
1738 def _setCallbackInfo(*args, **kwargs):
1739 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
1740 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
1741
1742 def CanOpen(*args, **kwargs):
1743 """CanOpen(self, String location) -> bool"""
1744 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
1745
1746 def OpenFile(*args, **kwargs):
1747 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1748 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
1749
1750 def FindFirst(*args, **kwargs):
1751 """FindFirst(self, String spec, int flags=0) -> String"""
1752 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
1753
1754 def FindNext(*args, **kwargs):
1755 """FindNext(self) -> String"""
1756 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
1757
1758 def GetProtocol(*args, **kwargs):
1759 """GetProtocol(self, String location) -> String"""
1760 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
1761
1762 def GetLeftLocation(*args, **kwargs):
1763 """GetLeftLocation(self, String location) -> String"""
1764 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
1765
1766 def GetAnchor(*args, **kwargs):
1767 """GetAnchor(self, String location) -> String"""
1768 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
1769
1770 def GetRightLocation(*args, **kwargs):
1771 """GetRightLocation(self, String location) -> String"""
1772 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
1773
1774 def GetMimeTypeFromExt(*args, **kwargs):
1775 """GetMimeTypeFromExt(self, String location) -> String"""
1776 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
1777
2131d850 1778_core_.FileSystemHandler_swigregister(FileSystemHandler)
d55e5bfc
RD
1779
1780class FileSystem(Object):
093d3ff1 1781 """Proxy of C++ FileSystem class"""
554f62e9
RD
1782 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1783 __repr__ = _swig_repr
1784 def __init__(self, *args, **kwargs):
d55e5bfc 1785 """__init__(self) -> FileSystem"""
554f62e9
RD
1786 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1787 __swig_destroy__ = _core_.delete_FileSystem
1788 __del__ = lambda self : None;
d55e5bfc
RD
1789 def ChangePathTo(*args, **kwargs):
1790 """ChangePathTo(self, String location, bool is_dir=False)"""
1791 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
1792
1793 def GetPath(*args, **kwargs):
1794 """GetPath(self) -> String"""
1795 return _core_.FileSystem_GetPath(*args, **kwargs)
1796
1797 def OpenFile(*args, **kwargs):
1798 """OpenFile(self, String location) -> FSFile"""
1799 return _core_.FileSystem_OpenFile(*args, **kwargs)
1800
1801 def FindFirst(*args, **kwargs):
1802 """FindFirst(self, String spec, int flags=0) -> String"""
1803 return _core_.FileSystem_FindFirst(*args, **kwargs)
1804
1805 def FindNext(*args, **kwargs):
1806 """FindNext(self) -> String"""
1807 return _core_.FileSystem_FindNext(*args, **kwargs)
1808
1809 def AddHandler(*args, **kwargs):
c24da6d6 1810 """AddHandler(CPPFileSystemHandler handler)"""
d55e5bfc
RD
1811 return _core_.FileSystem_AddHandler(*args, **kwargs)
1812
1813 AddHandler = staticmethod(AddHandler)
1814 def CleanUpHandlers(*args, **kwargs):
c24da6d6 1815 """CleanUpHandlers()"""
d55e5bfc
RD
1816 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
1817
1818 CleanUpHandlers = staticmethod(CleanUpHandlers)
1819 def FileNameToURL(*args, **kwargs):
c24da6d6 1820 """FileNameToURL(String filename) -> String"""
d55e5bfc
RD
1821 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
1822
1823 FileNameToURL = staticmethod(FileNameToURL)
ae8162c8
RD
1824 def URLToFileName(*args, **kwargs):
1825 """URLToFileName(String url) -> String"""
1826 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1827
1828 URLToFileName = staticmethod(URLToFileName)
2131d850 1829_core_.FileSystem_swigregister(FileSystem)
d55e5bfc
RD
1830
1831def FileSystem_AddHandler(*args, **kwargs):
554f62e9
RD
1832 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1833 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 1834
554f62e9
RD
1835def FileSystem_CleanUpHandlers(*args):
1836 """FileSystem_CleanUpHandlers()"""
1837 return _core_.FileSystem_CleanUpHandlers(*args)
d55e5bfc
RD
1838
1839def FileSystem_FileNameToURL(*args, **kwargs):
554f62e9
RD
1840 """FileSystem_FileNameToURL(String filename) -> String"""
1841 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 1842
d55e5bfc 1843def FileSystem_URLToFileName(*args, **kwargs):
554f62e9
RD
1844 """FileSystem_URLToFileName(String url) -> String"""
1845 return _core_.FileSystem_URLToFileName(*args, **kwargs)
ae8162c8 1846
d55e5bfc 1847class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 1848 """Proxy of C++ InternetFSHandler class"""
554f62e9
RD
1849 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1850 __repr__ = _swig_repr
1851 def __init__(self, *args, **kwargs):
d55e5bfc 1852 """__init__(self) -> InternetFSHandler"""
554f62e9 1853 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
d55e5bfc
RD
1854 def CanOpen(*args, **kwargs):
1855 """CanOpen(self, String location) -> bool"""
1856 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
1857
1858 def OpenFile(*args, **kwargs):
1859 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1860 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
1861
2131d850 1862_core_.InternetFSHandler_swigregister(InternetFSHandler)
d55e5bfc
RD
1863
1864class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 1865 """Proxy of C++ ZipFSHandler class"""
554f62e9
RD
1866 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1867 __repr__ = _swig_repr
1868 def __init__(self, *args, **kwargs):
d55e5bfc 1869 """__init__(self) -> ZipFSHandler"""
554f62e9 1870 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
d55e5bfc
RD
1871 def CanOpen(*args, **kwargs):
1872 """CanOpen(self, String location) -> bool"""
1873 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
1874
1875 def OpenFile(*args, **kwargs):
1876 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1877 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
1878
1879 def FindFirst(*args, **kwargs):
1880 """FindFirst(self, String spec, int flags=0) -> String"""
1881 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
1882
1883 def FindNext(*args, **kwargs):
1884 """FindNext(self) -> String"""
1885 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
1886
2131d850 1887_core_.ZipFSHandler_swigregister(ZipFSHandler)
d55e5bfc
RD
1888
1889
1890def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
554f62e9
RD
1891 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1892 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d55e5bfc
RD
1893
1894def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
554f62e9
RD
1895 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1896 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d55e5bfc
RD
1897
1898def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
554f62e9
RD
1899 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1900 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
ae8162c8
RD
1901def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1902 """
1903 Add 'file' to the memory filesystem. The dataItem parameter can
1904 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1905 arbitrary data. If a bitmap or image is used then the imgType
1906 parameter should specify what kind of image file it should be
1907 written as, wx.BITMAP_TYPE_PNG, etc.
1908 """
1909 if isinstance(dataItem, wx.Image):
1910 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1911 elif isinstance(dataItem, wx.Bitmap):
1912 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1913 elif type(dataItem) == str:
1914 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1915 else:
1916 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc
RD
1917
1918class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 1919 """Proxy of C++ MemoryFSHandler class"""
554f62e9
RD
1920 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1921 __repr__ = _swig_repr
1922 def __init__(self, *args, **kwargs):
d55e5bfc 1923 """__init__(self) -> MemoryFSHandler"""
554f62e9 1924 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
d55e5bfc 1925 def RemoveFile(*args, **kwargs):
c24da6d6 1926 """RemoveFile(String filename)"""
d55e5bfc
RD
1927 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
1928
1929 RemoveFile = staticmethod(RemoveFile)
1930 AddFile = staticmethod(MemoryFSHandler_AddFile)
1931 def CanOpen(*args, **kwargs):
1932 """CanOpen(self, String location) -> bool"""
1933 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
1934
1935 def OpenFile(*args, **kwargs):
1936 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1937 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
1938
1939 def FindFirst(*args, **kwargs):
1940 """FindFirst(self, String spec, int flags=0) -> String"""
1941 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
1942
1943 def FindNext(*args, **kwargs):
1944 """FindNext(self) -> String"""
1945 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
1946
2131d850 1947_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d55e5bfc
RD
1948
1949def MemoryFSHandler_RemoveFile(*args, **kwargs):
554f62e9
RD
1950 """MemoryFSHandler_RemoveFile(String filename)"""
1951 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 1952
57133d5c
RD
1953IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1954IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1955IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d55e5bfc
RD
1956#---------------------------------------------------------------------------
1957
1958class ImageHandler(Object):
27fb7603
RD
1959 """
1960 This is the base class for implementing image file loading/saving, and
1961 image creation from data. It is used within `wx.Image` and is not
1962 normally seen by the application.
1963 """
554f62e9
RD
1964 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1965 def __init__(self): raise AttributeError, "No constructor defined"
1966 __repr__ = _swig_repr
d55e5bfc
RD
1967 def GetName(*args, **kwargs):
1968 """GetName(self) -> String"""
1969 return _core_.ImageHandler_GetName(*args, **kwargs)
1970
1971 def GetExtension(*args, **kwargs):
1972 """GetExtension(self) -> String"""
1973 return _core_.ImageHandler_GetExtension(*args, **kwargs)
1974
1975 def GetType(*args, **kwargs):
1976 """GetType(self) -> long"""
1977 return _core_.ImageHandler_GetType(*args, **kwargs)
1978
1979 def GetMimeType(*args, **kwargs):
1980 """GetMimeType(self) -> String"""
1981 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
1982
1983 def CanRead(*args, **kwargs):
1984 """CanRead(self, String name) -> bool"""
1985 return _core_.ImageHandler_CanRead(*args, **kwargs)
1986
1987 def SetName(*args, **kwargs):
1988 """SetName(self, String name)"""
1989 return _core_.ImageHandler_SetName(*args, **kwargs)
1990
1991 def SetExtension(*args, **kwargs):
1992 """SetExtension(self, String extension)"""
1993 return _core_.ImageHandler_SetExtension(*args, **kwargs)
1994
1995 def SetType(*args, **kwargs):
1996 """SetType(self, long type)"""
1997 return _core_.ImageHandler_SetType(*args, **kwargs)
1998
1999 def SetMimeType(*args, **kwargs):
2000 """SetMimeType(self, String mimetype)"""
2001 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
2002
2131d850 2003_core_.ImageHandler_swigregister(ImageHandler)
d55e5bfc 2004
9d7dfdff
RD
2005class PyImageHandler(ImageHandler):
2006 """
2007 This is the base class for implementing image file loading/saving, and
2008 image creation from data, all written in Python. To create a custom
2009 image handler derive a new class from wx.PyImageHandler and provide
2010 the following methods::
2011
2012 def DoCanRead(self, stream) --> bool
2013 '''Check if this handler can read the image on the stream'''
2014
2015 def LoadFile(self, image, stream, verbose, index) --> bool
2016 '''Load image data from the stream and load it into image.'''
2017
2018 def SaveFile(self, image, stream, verbose) --> bool
2019 '''Save the iamge data in image to the stream using
2020 this handler's image file format.'''
2021
2022 def GetImageCount(self, stream) --> int
2023 '''If this image format can hold more than one image,
2024 how many does the image on the stream have?'''
2025
2026 To activate your handler create an instance of it and pass it to
2027 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2028 `SetExtension` from your constructor.
2029
2030 """
554f62e9
RD
2031 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2032 __repr__ = _swig_repr
2033 def __init__(self, *args, **kwargs):
9d7dfdff
RD
2034 """
2035 __init__(self) -> PyImageHandler
2036
2037 This is the base class for implementing image file loading/saving, and
2038 image creation from data, all written in Python. To create a custom
2039 image handler derive a new class from wx.PyImageHandler and provide
2040 the following methods::
2041
2042 def DoCanRead(self, stream) --> bool
2043 '''Check if this handler can read the image on the stream'''
2044
2045 def LoadFile(self, image, stream, verbose, index) --> bool
2046 '''Load image data from the stream and load it into image.'''
2047
2048 def SaveFile(self, image, stream, verbose) --> bool
2049 '''Save the iamge data in image to the stream using
2050 this handler's image file format.'''
2051
2052 def GetImageCount(self, stream) --> int
2053 '''If this image format can hold more than one image,
2054 how many does the image on the stream have?'''
2055
2056 To activate your handler create an instance of it and pass it to
2057 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2058 `SetExtension` from your constructor.
2059
2060 """
554f62e9 2061 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
9d7dfdff
RD
2062 self._SetSelf(self)
2063
2064 def _SetSelf(*args, **kwargs):
2065 """_SetSelf(self, PyObject self)"""
2066 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2067
2131d850 2068_core_.PyImageHandler_swigregister(PyImageHandler)
9d7dfdff 2069
d55e5bfc 2070class ImageHistogram(object):
093d3ff1 2071 """Proxy of C++ ImageHistogram class"""
554f62e9
RD
2072 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2073 __repr__ = _swig_repr
2074 def __init__(self, *args, **kwargs):
d55e5bfc 2075 """__init__(self) -> ImageHistogram"""
554f62e9 2076 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
d55e5bfc
RD
2077 def MakeKey(*args, **kwargs):
2078 """
7a27cf7c 2079 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2080
2081 Get the key in the histogram for the given RGB values
2082 """
2083 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
2084
2085 MakeKey = staticmethod(MakeKey)
2086 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
2087 """
2088 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2089
2090 Find first colour that is not used in the image and has higher RGB
2091 values than startR, startG, startB. Returns a tuple consisting of a
2092 success flag and rgb values.
2093 """
d55e5bfc
RD
2094 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
2095
f1cbd8fa
RD
2096 def GetCount(*args, **kwargs):
2097 """
2098 GetCount(self, unsigned long key) -> unsigned long
2099
2100 Returns the pixel count for the given key. Use `MakeKey` to create a
2101 key value from a RGB tripple.
2102 """
2103 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2104
2105 def GetCountRGB(*args, **kwargs):
2106 """
7a27cf7c 2107 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2108
2109 Returns the pixel count for the given RGB values.
2110 """
2111 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2112
2113 def GetCountColour(*args, **kwargs):
2114 """
2115 GetCountColour(self, Colour colour) -> unsigned long
2116
2117 Returns the pixel count for the given `wx.Colour` value.
2118 """
2119 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2120
2131d850 2121_core_.ImageHistogram_swigregister(ImageHistogram)
d55e5bfc
RD
2122
2123def ImageHistogram_MakeKey(*args, **kwargs):
554f62e9 2124 """
7a27cf7c 2125 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2126
2127 Get the key in the histogram for the given RGB values
2128 """
554f62e9 2129 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2130
2f91e3df 2131class Image_RGBValue(object):
9d7dfdff
RD
2132 """
2133 An object that contains values for red, green and blue which represent
2134 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2135 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2136 color space.
2137 """
554f62e9
RD
2138 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2139 __repr__ = _swig_repr
2140 def __init__(self, *args, **kwargs):
9d7dfdff
RD
2141 """
2142 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2143
2144 Constructor.
2145 """
554f62e9 2146 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
2f91e3df
KO
2147 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2148 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2149 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2150_core_.Image_RGBValue_swigregister(Image_RGBValue)
2f91e3df
KO
2151
2152class Image_HSVValue(object):
9d7dfdff
RD
2153 """
2154 An object that contains values for hue, saturation and value which
2155 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2156 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2157 color space.
2158 """
554f62e9
RD
2159 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2160 __repr__ = _swig_repr
2161 def __init__(self, *args, **kwargs):
9d7dfdff
RD
2162 """
2163 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2164
2165 Constructor.
2166 """
554f62e9 2167 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
2f91e3df
KO
2168 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2169 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2170 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2171_core_.Image_HSVValue_swigregister(Image_HSVValue)
2f91e3df 2172
d55e5bfc 2173class Image(Object):
7a27cf7c
RD
2174 """
2175 A platform-independent image class. An image can be created from
2176 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2177 variety of formats. Functions are available to set and get image
2178 bits, so it can be used for basic image manipulation.
2179
2180 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2181 platform-specific `wx.Bitmap` object must be created from it using the
2182 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2183 device context, using `wx.DC.DrawBitmap`.
2184
2185 One colour value of the image may be used as a mask colour which will
2186 lead to the automatic creation of a `wx.Mask` object associated to the
2187 bitmap object.
2188
2189 wx.Image supports alpha channel data, that is in addition to a byte
2190 for the red, green and blue colour components for each pixel it also
2191 stores a byte representing the pixel opacity. An alpha value of 0
2192 corresponds to a transparent pixel (null opacity) while a value of 255
2193 means that the pixel is 100% opaque.
2194
2195 Unlike RGB data, not all images have an alpha channel and before using
2196 `GetAlpha` you should check if this image contains an alpha channel
2197 with `HasAlpha`. Note that currently only images loaded from PNG files
2198 with transparency information will have an alpha channel.
2199 """
554f62e9
RD
2200 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2201 __repr__ = _swig_repr
2202 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2203 """
2204 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2205
2206 Loads an image from a file.
2207 """
554f62e9
RD
2208 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2209 __swig_destroy__ = _core_.delete_Image
2210 __del__ = lambda self : None;
d55e5bfc 2211 def Create(*args, **kwargs):
7a27cf7c
RD
2212 """
2213 Create(self, int width, int height, bool clear=True)
2214
2215 Creates a fresh image. If clear is ``True``, the new image will be
2216 initialized to black. Otherwise, the image data will be uninitialized.
2217 """
d55e5bfc
RD
2218 return _core_.Image_Create(*args, **kwargs)
2219
2220 def Destroy(*args, **kwargs):
2221 """
2222 Destroy(self)
2223
7a27cf7c 2224 Destroys the image data.
d55e5bfc 2225 """
7e08d4ef
RD
2226 val = _core_.Image_Destroy(*args, **kwargs)
2227 args[0].thisown = 0
2228 return val
d55e5bfc
RD
2229
2230 def Scale(*args, **kwargs):
7a27cf7c
RD
2231 """
2232 Scale(self, int width, int height) -> Image
2233
2234 Returns a scaled version of the image. This is also useful for scaling
2235 bitmaps in general as the only other way to scale bitmaps is to blit a
2236 `wx.MemoryDC` into another `wx.MemoryDC`.
2237 """
d55e5bfc
RD
2238 return _core_.Image_Scale(*args, **kwargs)
2239
2240 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2241 """
2242 ShrinkBy(self, int xFactor, int yFactor) -> Image
2243
2244 Return a version of the image scaled smaller by the given factors.
2245 """
d55e5bfc
RD
2246 return _core_.Image_ShrinkBy(*args, **kwargs)
2247
2248 def Rescale(*args, **kwargs):
7a27cf7c
RD
2249 """
2250 Rescale(self, int width, int height) -> Image
2251
2252 Changes the size of the image in-place by scaling it: after a call to
2253 this function, the image will have the given width and height.
2254
2255 Returns the (modified) image itself.
2256 """
d55e5bfc
RD
2257 return _core_.Image_Rescale(*args, **kwargs)
2258
aff4cc5c 2259 def Resize(*args, **kwargs):
7a27cf7c
RD
2260 """
2261 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2262
2263 Changes the size of the image in-place without scaling it, by adding
2264 either a border with the given colour or cropping as necessary. The
2265 image is pasted into a new image with the given size and background
2266 colour at the position pos relative to the upper left of the new
2267 image. If red = green = blue = -1 then use either the current mask
2268 colour if set or find, use, and set a suitable mask colour for any
2269 newly exposed areas.
2270
2271 Returns the (modified) image itself.
2272 """
aff4cc5c
RD
2273 return _core_.Image_Resize(*args, **kwargs)
2274
d55e5bfc 2275 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2276 """
2277 SetRGB(self, int x, int y, byte r, byte g, byte b)
2278
2279 Sets the pixel at the given coordinate. This routine performs
2280 bounds-checks for the coordinate so it can be considered a safe way to
2281 manipulate the data, but in some cases this might be too slow so that
2282 the data will have to be set directly. In that case you will have to
2283 get access to the image data using the `GetData` method.
2284 """
d55e5bfc
RD
2285 return _core_.Image_SetRGB(*args, **kwargs)
2286
aff4cc5c 2287 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2288 """
2289 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2290
2291 Sets the colour of the pixels within the given rectangle. This routine
2292 performs bounds-checks for the rectangle so it can be considered a
2293 safe way to manipulate the data.
2294 """
aff4cc5c
RD
2295 return _core_.Image_SetRGBRect(*args, **kwargs)
2296
d55e5bfc 2297 def GetRed(*args, **kwargs):
7a27cf7c
RD
2298 """
2299 GetRed(self, int x, int y) -> byte
2300
2301 Returns the red intensity at the given coordinate.
2302 """
d55e5bfc
RD
2303 return _core_.Image_GetRed(*args, **kwargs)
2304
2305 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2306 """
2307 GetGreen(self, int x, int y) -> byte
2308
2309 Returns the green intensity at the given coordinate.
2310 """
d55e5bfc
RD
2311 return _core_.Image_GetGreen(*args, **kwargs)
2312
2313 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2314 """
2315 GetBlue(self, int x, int y) -> byte
2316
2317 Returns the blue intensity at the given coordinate.
2318 """
d55e5bfc
RD
2319 return _core_.Image_GetBlue(*args, **kwargs)
2320
2321 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2322 """
2323 SetAlpha(self, int x, int y, byte alpha)
2324
2325 Sets the alpha value for the given pixel. This function should only be
2326 called if the image has alpha channel data, use `HasAlpha` to check
2327 for this.
2328 """
d55e5bfc
RD
2329 return _core_.Image_SetAlpha(*args, **kwargs)
2330
2331 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2332 """
2333 GetAlpha(self, int x, int y) -> byte
2334
2335 Returns the alpha value for the given pixel. This function may only be
2336 called for the images with alpha channel, use `HasAlpha` to check for
2337 this.
2338
2339 The returned value is the *opacity* of the image, i.e. the value of 0
2340 corresponds to the fully transparent pixels while the value of 255 to
2341 the fully opaque pixels.
2342 """
d55e5bfc
RD
2343 return _core_.Image_GetAlpha(*args, **kwargs)
2344
2345 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2346 """
2347 HasAlpha(self) -> bool
2348
2349 Returns true if this image has alpha channel, false otherwise.
2350 """
d55e5bfc
RD
2351 return _core_.Image_HasAlpha(*args, **kwargs)
2352
68350608
RD
2353 def InitAlpha(*args, **kwargs):
2354 """
2355 InitAlpha(self)
2356
2357 Initializes the image alpha channel data. It is an error to call it if
2358 the image already has alpha data. If it doesn't, alpha data will be by
2359 default initialized to all pixels being fully opaque. But if the image
2360 has a a mask colour, all mask pixels will be completely transparent.
2361 """
2362 return _core_.Image_InitAlpha(*args, **kwargs)
2363
57133d5c
RD
2364 def IsTransparent(*args, **kwargs):
2365 """
7a27cf7c 2366 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
57133d5c 2367
7a27cf7c
RD
2368 Returns ``True`` if this pixel is masked or has an alpha value less
2369 than the spcified threshold.
57133d5c
RD
2370 """
2371 return _core_.Image_IsTransparent(*args, **kwargs)
2372
d55e5bfc 2373 def FindFirstUnusedColour(*args, **kwargs):
a8eff060
RD
2374 """
2375 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2376
2377 Find first colour that is not used in the image and has higher RGB
2378 values than startR, startG, startB. Returns a tuple consisting of a
2379 success flag and rgb values.
2380 """
d55e5bfc
RD
2381 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
2382
4cf4100f
RD
2383 def ConvertAlphaToMask(*args, **kwargs):
2384 """
57133d5c 2385 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2386
7a27cf7c
RD
2387 If the image has alpha channel, this method converts it to mask. All
2388 pixels with alpha value less than ``threshold`` are replaced with the
2389 mask colour and the alpha channel is removed. The mask colour is
2390 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2391
2392 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2393 nothing.
2394 """
2395 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2396
8fb0e70a
RD
2397 def ConvertColourToAlpha(*args, **kwargs):
2398 """
7a27cf7c 2399 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2400
2401 This method converts an image where the original alpha information is
2402 only available as a shades of a colour (actually shades of grey)
2403 typically when you draw anti-aliased text into a bitmap. The DC
2404 drawing routines draw grey values on the black background although
2405 they actually mean to draw white with differnt alpha values. This
2406 method reverses it, assuming a black (!) background and white text.
2407 The method will then fill up the whole image with the colour given.
2408 """
2409 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2410
d55e5bfc 2411 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2412 """
2413 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2414
2415 Sets the image's mask so that the pixels that have RGB value of
2416 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2417 by first finding an unused colour in the image, setting this colour as
2418 the mask colour and then using this colour to draw all pixels in the
2419 image who corresponding pixel in mask has given RGB value.
2420
2421 Returns ``False`` if ``mask`` does not have same dimensions as the
2422 image or if there is no unused colour left. Returns ``True`` if the
2423 mask was successfully applied.
2424
2425 Note that this method involves computing the histogram, which is
2426 computationally intensive operation.
2427 """
d55e5bfc
RD
2428 return _core_.Image_SetMaskFromImage(*args, **kwargs)
2429
2430 def CanRead(*args, **kwargs):
7a27cf7c
RD
2431 """
2432 CanRead(String filename) -> bool
2433
2434 Returns True if the image handlers can read this file.
2435 """
d55e5bfc
RD
2436 return _core_.Image_CanRead(*args, **kwargs)
2437
2438 CanRead = staticmethod(CanRead)
2439 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2440 """
2441 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2442
2443 If the image file contains more than one image and the image handler
2444 is capable of retrieving these individually, this function will return
2445 the number of available images.
2446 """
d55e5bfc
RD
2447 return _core_.Image_GetImageCount(*args, **kwargs)
2448
2449 GetImageCount = staticmethod(GetImageCount)
2450 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2451 """
2452 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2453
2454 Loads an image from a file. If no handler type is provided, the
2455 library will try to autodetect the format.
2456 """
d55e5bfc
RD
2457 return _core_.Image_LoadFile(*args, **kwargs)
2458
2459 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2460 """
2461 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2462
2463 Loads an image from a file, specifying the image type with a MIME type
2464 string.
2465 """
d55e5bfc
RD
2466 return _core_.Image_LoadMimeFile(*args, **kwargs)
2467
2468 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2469 """
2470 SaveFile(self, String name, int type) -> bool
2471
2472 Saves an image in the named file.
2473 """
d55e5bfc
RD
2474 return _core_.Image_SaveFile(*args, **kwargs)
2475
2476 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2477 """
2478 SaveMimeFile(self, String name, String mimetype) -> bool
2479
2480 Saves an image in the named file.
2481 """
d55e5bfc
RD
2482 return _core_.Image_SaveMimeFile(*args, **kwargs)
2483
2484 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2485 """
2486 CanReadStream(InputStream stream) -> bool
2487
2488 Returns True if the image handlers can read an image file from the
2489 data currently on the input stream, or a readable Python file-like
2490 object.
2491 """
d55e5bfc
RD
2492 return _core_.Image_CanReadStream(*args, **kwargs)
2493
2494 CanReadStream = staticmethod(CanReadStream)
2495 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2496 """
2497 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2498
2499 Loads an image from an input stream or a readable Python file-like
2500 object. If no handler type is provided, the library will try to
2501 autodetect the format.
2502 """
d55e5bfc
RD
2503 return _core_.Image_LoadStream(*args, **kwargs)
2504
2505 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2506 """
2507 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2508
2509 Loads an image from an input stream or a readable Python file-like
2510 object, using a MIME type string to specify the image file format.
2511 """
d55e5bfc
RD
2512 return _core_.Image_LoadMimeStream(*args, **kwargs)
2513
2514 def Ok(*args, **kwargs):
7a27cf7c
RD
2515 """
2516 Ok(self) -> bool
2517
2518 Returns true if image data is present.
2519 """
d55e5bfc
RD
2520 return _core_.Image_Ok(*args, **kwargs)
2521
2522 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2523 """
2524 GetWidth(self) -> int
2525
2526 Gets the width of the image in pixels.
2527 """
d55e5bfc
RD
2528 return _core_.Image_GetWidth(*args, **kwargs)
2529
2530 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2531 """
2532 GetHeight(self) -> int
2533
2534 Gets the height of the image in pixels.
2535 """
d55e5bfc
RD
2536 return _core_.Image_GetHeight(*args, **kwargs)
2537
2538 def GetSize(*args, **kwargs):
7a27cf7c
RD
2539 """
2540 GetSize(self) -> Size
2541
2542 Returns the size of the image in pixels.
2543 """
d55e5bfc
RD
2544 return _core_.Image_GetSize(*args, **kwargs)
2545
2546 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2547 """
2548 GetSubImage(self, Rect rect) -> Image
2549
2550 Returns a sub image of the current one as long as the rect belongs
2551 entirely to the image.
2552 """
d55e5bfc
RD
2553 return _core_.Image_GetSubImage(*args, **kwargs)
2554
aff4cc5c 2555 def Size(*args, **kwargs):
7a27cf7c
RD
2556 """
2557 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2558
2559 Returns a resized version of this image without scaling it by adding
2560 either a border with the given colour or cropping as necessary. The
2561 image is pasted into a new image with the given size and background
2562 colour at the position ``pos`` relative to the upper left of the new
2563 image. If red = green = blue = -1 then use either the current mask
2564 colour if set or find, use, and set a suitable mask colour for any
2565 newly exposed areas.
2566 """
aff4cc5c
RD
2567 return _core_.Image_Size(*args, **kwargs)
2568
d55e5bfc 2569 def Copy(*args, **kwargs):
7a27cf7c
RD
2570 """
2571 Copy(self) -> Image
2572
2573 Returns an identical copy of the image.
2574 """
d55e5bfc
RD
2575 return _core_.Image_Copy(*args, **kwargs)
2576
2577 def Paste(*args, **kwargs):
7a27cf7c
RD
2578 """
2579 Paste(self, Image image, int x, int y)
2580
2581 Pastes ``image`` into this instance and takes care of the mask colour
2582 and any out of bounds problems.
2583 """
d55e5bfc
RD
2584 return _core_.Image_Paste(*args, **kwargs)
2585
2586 def GetData(*args, **kwargs):
ea939623
RD
2587 """
2588 GetData(self) -> PyObject
2589
2590 Returns a string containing a copy of the RGB bytes of the image.
2591 """
d55e5bfc
RD
2592 return _core_.Image_GetData(*args, **kwargs)
2593
2594 def SetData(*args, **kwargs):
ea939623
RD
2595 """
2596 SetData(self, buffer data)
2597
2598 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2599 either a string or a buffer object holding the data and the length of
2600 the data must be width*height*3.
2601 """
d55e5bfc
RD
2602 return _core_.Image_SetData(*args, **kwargs)
2603
2604 def GetDataBuffer(*args, **kwargs):
ea939623
RD
2605 """
2606 GetDataBuffer(self) -> PyObject
2607
2608 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2609 image data buffer inside the wx.Image. You need to ensure that you do
2610 not use this buffer object after the image has been destroyed.
ea939623 2611 """
d55e5bfc
RD
2612 return _core_.Image_GetDataBuffer(*args, **kwargs)
2613
2614 def SetDataBuffer(*args, **kwargs):
ea939623
RD
2615 """
2616 SetDataBuffer(self, buffer data)
2617
2618 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2619 object. This can save making an extra copy of the data but you must
2620 ensure that the buffer object lives longer than the wx.Image does.
ea939623 2621 """
d55e5bfc
RD
2622 return _core_.Image_SetDataBuffer(*args, **kwargs)
2623
2624 def GetAlphaData(*args, **kwargs):
ea939623
RD
2625 """
2626 GetAlphaData(self) -> PyObject
2627
2628 Returns a string containing a copy of the alpha bytes of the image.
2629 """
d55e5bfc
RD
2630 return _core_.Image_GetAlphaData(*args, **kwargs)
2631
2632 def SetAlphaData(*args, **kwargs):
ea939623
RD
2633 """
2634 SetAlphaData(self, buffer alpha)
2635
2636 Resets the Image's alpha data from a buffer of bytes. Accepts either
2637 a string or a buffer object holding the data and the length of the
2638 data must be width*height.
2639 """
d55e5bfc
RD
2640 return _core_.Image_SetAlphaData(*args, **kwargs)
2641
2642 def GetAlphaBuffer(*args, **kwargs):
2643 """GetAlphaBuffer(self) -> PyObject"""
2644 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
2645
2646 def SetAlphaBuffer(*args, **kwargs):
ea939623 2647 """SetAlphaBuffer(self, buffer alpha)"""
d55e5bfc
RD
2648 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
2649
2650 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2651 """
2652 SetMaskColour(self, byte r, byte g, byte b)
2653
2654 Sets the mask colour for this image (and tells the image to use the
2655 mask).
2656 """
d55e5bfc
RD
2657 return _core_.Image_SetMaskColour(*args, **kwargs)
2658
aff4cc5c
RD
2659 def GetOrFindMaskColour(*args, **kwargs):
2660 """
2661 GetOrFindMaskColour() -> (r,g,b)
2662
2663 Get the current mask colour or find a suitable colour.
2664 """
2665 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2666
d55e5bfc 2667 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2668 """
2669 GetMaskRed(self) -> byte
2670
2671 Gets the red component of the mask colour.
2672 """
d55e5bfc
RD
2673 return _core_.Image_GetMaskRed(*args, **kwargs)
2674
2675 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2676 """
2677 GetMaskGreen(self) -> byte
2678
2679 Gets the green component of the mask colour.
2680 """
d55e5bfc
RD
2681 return _core_.Image_GetMaskGreen(*args, **kwargs)
2682
2683 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2684 """
2685 GetMaskBlue(self) -> byte
2686
2687 Gets the blue component of the mask colour.
2688 """
d55e5bfc
RD
2689 return _core_.Image_GetMaskBlue(*args, **kwargs)
2690
2691 def SetMask(*args, **kwargs):
7a27cf7c
RD
2692 """
2693 SetMask(self, bool mask=True)
2694
2695 Specifies whether there is a mask or not. The area of the mask is
2696 determined by the current mask colour.
2697 """
d55e5bfc
RD
2698 return _core_.Image_SetMask(*args, **kwargs)
2699
2700 def HasMask(*args, **kwargs):
7a27cf7c
RD
2701 """
2702 HasMask(self) -> bool
2703
2704 Returns ``True`` if there is a mask active, ``False`` otherwise.
2705 """
d55e5bfc
RD
2706 return _core_.Image_HasMask(*args, **kwargs)
2707
2708 def Rotate(*args, **kwargs):
2709 """
2710 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2711 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2712
2713 Rotates the image about the given point, by ``angle`` radians. Passing
2714 ``True`` to ``interpolating`` results in better image quality, but is
2715 slower. If the image has a mask, then the mask colour is used for the
2716 uncovered pixels in the rotated image background. Otherwise, black
2717 will be used as the fill colour.
2718
2719 Returns the rotated image, leaving this image intact.
d55e5bfc
RD
2720 """
2721 return _core_.Image_Rotate(*args, **kwargs)
2722
2723 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2724 """
2725 Rotate90(self, bool clockwise=True) -> Image
2726
2727 Returns a copy of the image rotated 90 degrees in the direction
2728 indicated by ``clockwise``.
2729 """
d55e5bfc
RD
2730 return _core_.Image_Rotate90(*args, **kwargs)
2731
2732 def Mirror(*args, **kwargs):
7a27cf7c
RD
2733 """
2734 Mirror(self, bool horizontally=True) -> Image
2735
2736 Returns a mirrored copy of the image. The parameter ``horizontally``
2737 indicates the orientation.
2738 """
d55e5bfc
RD
2739 return _core_.Image_Mirror(*args, **kwargs)
2740
2741 def Replace(*args, **kwargs):
2742 """
7a27cf7c
RD
2743 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2744
2745 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2746 ``(r2,g2,b2)``.
d55e5bfc
RD
2747 """
2748 return _core_.Image_Replace(*args, **kwargs)
2749
7449af73
RD
2750 def ConvertToGreyscale(*args, **kwargs):
2751 """
2752 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2753
2754 Convert to greyscale image. Uses the luminance component (Y) of the
2755 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2756 defaults to ITU-T BT.601
2757 """
2758 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2759
d55e5bfc 2760 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2761 """
2762 ConvertToMono(self, byte r, byte g, byte b) -> Image
2763
2764 Returns monochromatic version of the image. The returned image has
2765 white colour where the original has ``(r,g,b)`` colour and black
2766 colour everywhere else.
2767 """
d55e5bfc
RD
2768 return _core_.Image_ConvertToMono(*args, **kwargs)
2769
2770 def SetOption(*args, **kwargs):
7a27cf7c
RD
2771 """
2772 SetOption(self, String name, String value)
2773
2774 Sets an image handler defined option. For example, when saving as a
2775 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2776 number between 0 and 100 (0 is terrible, 100 is very good).
2777 """
d55e5bfc
RD
2778 return _core_.Image_SetOption(*args, **kwargs)
2779
2780 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2781 """
2782 SetOptionInt(self, String name, int value)
2783
2784 Sets an image option as an integer.
2785 """
d55e5bfc
RD
2786 return _core_.Image_SetOptionInt(*args, **kwargs)
2787
2788 def GetOption(*args, **kwargs):
7a27cf7c
RD
2789 """
2790 GetOption(self, String name) -> String
2791
2792 Gets the value of an image handler option.
2793 """
d55e5bfc
RD
2794 return _core_.Image_GetOption(*args, **kwargs)
2795
2796 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2797 """
2798 GetOptionInt(self, String name) -> int
2799
2800 Gets the value of an image handler option as an integer. If the given
2801 option is not present, the function returns 0.
2802 """
d55e5bfc
RD
2803 return _core_.Image_GetOptionInt(*args, **kwargs)
2804
2805 def HasOption(*args, **kwargs):
7a27cf7c
RD
2806 """
2807 HasOption(self, String name) -> bool
2808
2809 Returns true if the given option is present.
2810 """
d55e5bfc
RD
2811 return _core_.Image_HasOption(*args, **kwargs)
2812
2813 def CountColours(*args, **kwargs):
2814 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
2815 return _core_.Image_CountColours(*args, **kwargs)
2816
2817 def ComputeHistogram(*args, **kwargs):
2818 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2819 return _core_.Image_ComputeHistogram(*args, **kwargs)
2820
2821 def AddHandler(*args, **kwargs):
c24da6d6 2822 """AddHandler(ImageHandler handler)"""
d55e5bfc
RD
2823 return _core_.Image_AddHandler(*args, **kwargs)
2824
2825 AddHandler = staticmethod(AddHandler)
2826 def InsertHandler(*args, **kwargs):
c24da6d6 2827 """InsertHandler(ImageHandler handler)"""
d55e5bfc
RD
2828 return _core_.Image_InsertHandler(*args, **kwargs)
2829
2830 InsertHandler = staticmethod(InsertHandler)
2831 def RemoveHandler(*args, **kwargs):
c24da6d6 2832 """RemoveHandler(String name) -> bool"""
d55e5bfc
RD
2833 return _core_.Image_RemoveHandler(*args, **kwargs)
2834
2835 RemoveHandler = staticmethod(RemoveHandler)
554f62e9
RD
2836 def GetHandlers(*args, **kwargs):
2837 """GetHandlers() -> PyObject"""
2838 return _core_.Image_GetHandlers(*args, **kwargs)
2839
2840 GetHandlers = staticmethod(GetHandlers)
d55e5bfc 2841 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2842 """
2843 GetImageExtWildcard() -> String
2844
2845 Iterates all registered wxImageHandler objects, and returns a string
2846 containing file extension masks suitable for passing to file open/save
2847 dialog boxes.
2848 """
d55e5bfc
RD
2849 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
2850
2851 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2852 def ConvertToBitmap(*args, **kwargs):
1fbf26be 2853 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
d55e5bfc
RD
2854 return _core_.Image_ConvertToBitmap(*args, **kwargs)
2855
2856 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 2857 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
d55e5bfc
RD
2858 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
2859
2f91e3df
KO
2860 def RotateHue(*args, **kwargs):
2861 """
2862 RotateHue(self, double angle)
2863
2864 Rotates the hue of each pixel of the image. Hue is a double in the
2865 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2866 """
2867 return _core_.Image_RotateHue(*args, **kwargs)
2868
2869 def RGBtoHSV(*args, **kwargs):
9d7dfdff
RD
2870 """
2871 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2872
2873 Converts a color in RGB color space to HSV color space.
2874 """
2f91e3df
KO
2875 return _core_.Image_RGBtoHSV(*args, **kwargs)
2876
2877 RGBtoHSV = staticmethod(RGBtoHSV)
2878 def HSVtoRGB(*args, **kwargs):
9d7dfdff
RD
2879 """
2880 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2881
2882 Converts a color in HSV color space to RGB color space.
2883 """
2f91e3df
KO
2884 return _core_.Image_HSVtoRGB(*args, **kwargs)
2885
2886 HSVtoRGB = staticmethod(HSVtoRGB)
d55e5bfc 2887 def __nonzero__(self): return self.Ok()
2131d850 2888_core_.Image_swigregister(Image)
d55e5bfc
RD
2889
2890def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
2891 """
2892 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2893
2894 Loads an image from a file, using a MIME type string (such as
2895 'image/jpeg') to specify image type.
2896 """
d55e5bfc 2897 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
2898 return val
2899
2900def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
2901 """
2902 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2903
2904 Loads an image from an input stream, or any readable Python file-like
2905 object.
2906 """
d55e5bfc 2907 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
2908 return val
2909
2910def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
2911 """
2912 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2913
2914 Loads an image from an input stream, or any readable Python file-like
2915 object, specifying the image format with a MIME type string.
2916 """
d55e5bfc 2917 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
2918 return val
2919
c24da6d6 2920def EmptyImage(*args, **kwargs):
ea939623
RD
2921 """
2922 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2923
2924 Construct an empty image of a given size, optionally setting all
2925 pixels to black.
2926 """
c24da6d6 2927 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
2928 return val
2929
2930def ImageFromBitmap(*args, **kwargs):
ea939623
RD
2931 """
2932 ImageFromBitmap(Bitmap bitmap) -> Image
2933
2934 Construct an Image from a `wx.Bitmap`.
2935 """
d55e5bfc 2936 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
2937 return val
2938
2939def ImageFromData(*args, **kwargs):
ea939623
RD
2940 """
2941 ImageFromData(int width, int height, buffer data) -> Image
2942
2943 Construct an Image from a buffer of RGB bytes. Accepts either a
2944 string or a buffer object holding the data and the length of the data
2945 must be width*height*3.
2946 """
d55e5bfc 2947 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
2948 return val
2949
c9c2cf70 2950def ImageFromDataWithAlpha(*args, **kwargs):
ea939623
RD
2951 """
2952 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2953
2954 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2955 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
2956 length of the data must be width*height*3 bytes, and the length of the
2957 alpha data must be width*height bytes.
ea939623 2958 """
c9c2cf70 2959 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
c9c2cf70
RD
2960 return val
2961
d55e5bfc 2962def Image_CanRead(*args, **kwargs):
554f62e9 2963 """
7a27cf7c
RD
2964 Image_CanRead(String filename) -> bool
2965
2966 Returns True if the image handlers can read this file.
2967 """
554f62e9 2968 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
RD
2969
2970def Image_GetImageCount(*args, **kwargs):
554f62e9 2971 """
7a27cf7c
RD
2972 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2973
2974 If the image file contains more than one image and the image handler
2975 is capable of retrieving these individually, this function will return
2976 the number of available images.
2977 """
554f62e9 2978 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
RD
2979
2980def Image_CanReadStream(*args, **kwargs):
554f62e9 2981 """
7a27cf7c
RD
2982 Image_CanReadStream(InputStream stream) -> bool
2983
2984 Returns True if the image handlers can read an image file from the
2985 data currently on the input stream, or a readable Python file-like
2986 object.
2987 """
554f62e9 2988 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
RD
2989
2990def Image_AddHandler(*args, **kwargs):
554f62e9
RD
2991 """Image_AddHandler(ImageHandler handler)"""
2992 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
2993
2994def Image_InsertHandler(*args, **kwargs):
554f62e9
RD
2995 """Image_InsertHandler(ImageHandler handler)"""
2996 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
2997
2998def Image_RemoveHandler(*args, **kwargs):
554f62e9
RD
2999 """Image_RemoveHandler(String name) -> bool"""
3000 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 3001
554f62e9
RD
3002def Image_GetHandlers(*args):
3003 """Image_GetHandlers() -> PyObject"""
3004 return _core_.Image_GetHandlers(*args)
3005
3006def Image_GetImageExtWildcard(*args):
3007 """
7a27cf7c
RD
3008 Image_GetImageExtWildcard() -> String
3009
3010 Iterates all registered wxImageHandler objects, and returns a string
3011 containing file extension masks suitable for passing to file open/save
3012 dialog boxes.
3013 """
554f62e9 3014 return _core_.Image_GetImageExtWildcard(*args)
d55e5bfc 3015
2f91e3df 3016def Image_RGBtoHSV(*args, **kwargs):
554f62e9 3017 """
9d7dfdff
RD
3018 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3019
3020 Converts a color in RGB color space to HSV color space.
3021 """
554f62e9 3022 return _core_.Image_RGBtoHSV(*args, **kwargs)
2f91e3df
KO
3023
3024def Image_HSVtoRGB(*args, **kwargs):
554f62e9 3025 """
9d7dfdff
RD
3026 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3027
3028 Converts a color in HSV color space to RGB color space.
3029 """
554f62e9 3030 return _core_.Image_HSVtoRGB(*args, **kwargs)
2f91e3df 3031
a07a67e6
RD
3032def InitAllImageHandlers():
3033 """
3034 The former functionality of InitAllImageHanders is now done internal to
3035 the _core_ extension module and so this function has become a simple NOP.
3036 """
3037 pass
d55e5bfc 3038
d55e5bfc
RD
3039IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3040IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
3041PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3042PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3043PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
d55e5bfc
RD
3044BMP_24BPP = _core_.BMP_24BPP
3045BMP_8BPP = _core_.BMP_8BPP
3046BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3047BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3048BMP_8BPP_RED = _core_.BMP_8BPP_RED
3049BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3050BMP_4BPP = _core_.BMP_4BPP
3051BMP_1BPP = _core_.BMP_1BPP
3052BMP_1BPP_BW = _core_.BMP_1BPP_BW
3053class BMPHandler(ImageHandler):
27fb7603 3054 """A `wx.ImageHandler` for \*.bmp bitmap files."""
554f62e9
RD
3055 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3056 __repr__ = _swig_repr
3057 def __init__(self, *args, **kwargs):
27fb7603
RD
3058 """
3059 __init__(self) -> BMPHandler
3060
3061 A `wx.ImageHandler` for \*.bmp bitmap files.
3062 """
554f62e9 3063 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3064_core_.BMPHandler_swigregister(BMPHandler)
d55e5bfc 3065NullImage = cvar.NullImage
68350608 3066IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3067IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3068IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3069IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3070IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3071IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3072IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3073IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3074IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3075IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3076IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3077IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3078IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
3079IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3080IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc
RD
3081
3082class ICOHandler(BMPHandler):
27fb7603 3083 """A `wx.ImageHandler` for \*.ico icon files."""
554f62e9
RD
3084 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3085 __repr__ = _swig_repr
3086 def __init__(self, *args, **kwargs):
27fb7603
RD
3087 """
3088 __init__(self) -> ICOHandler
3089
3090 A `wx.ImageHandler` for \*.ico icon files.
3091 """
554f62e9 3092 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3093_core_.ICOHandler_swigregister(ICOHandler)
d55e5bfc
RD
3094
3095class CURHandler(ICOHandler):
27fb7603 3096 """A `wx.ImageHandler` for \*.cur cursor files."""
554f62e9
RD
3097 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3098 __repr__ = _swig_repr
3099 def __init__(self, *args, **kwargs):
27fb7603
RD
3100 """
3101 __init__(self) -> CURHandler
3102
3103 A `wx.ImageHandler` for \*.cur cursor files.
3104 """
554f62e9 3105 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3106_core_.CURHandler_swigregister(CURHandler)
d55e5bfc
RD
3107
3108class ANIHandler(CURHandler):
27fb7603 3109 """A `wx.ImageHandler` for \*.ani animated cursor files."""
554f62e9
RD
3110 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3111 __repr__ = _swig_repr
3112 def __init__(self, *args, **kwargs):
27fb7603
RD
3113 """
3114 __init__(self) -> ANIHandler
3115
3116 A `wx.ImageHandler` for \*.ani animated cursor files.
3117 """
554f62e9 3118 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3119_core_.ANIHandler_swigregister(ANIHandler)
d55e5bfc
RD
3120
3121class PNGHandler(ImageHandler):
27fb7603 3122 """A `wx.ImageHandler` for PNG image files."""
554f62e9
RD
3123 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3124 __repr__ = _swig_repr
3125 def __init__(self, *args, **kwargs):
27fb7603
RD
3126 """
3127 __init__(self) -> PNGHandler
3128
3129 A `wx.ImageHandler` for PNG image files.
3130 """
554f62e9 3131 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3132_core_.PNGHandler_swigregister(PNGHandler)
d55e5bfc
RD
3133
3134class GIFHandler(ImageHandler):
27fb7603 3135 """A `wx.ImageHandler` for GIF image files."""
554f62e9
RD
3136 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3137 __repr__ = _swig_repr
3138 def __init__(self, *args, **kwargs):
27fb7603
RD
3139 """
3140 __init__(self) -> GIFHandler
3141
3142 A `wx.ImageHandler` for GIF image files.
3143 """
554f62e9 3144 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3145_core_.GIFHandler_swigregister(GIFHandler)
d55e5bfc
RD
3146
3147class PCXHandler(ImageHandler):
27fb7603 3148 """A `wx.ImageHandler` for PCX imager files."""
554f62e9
RD
3149 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3150 __repr__ = _swig_repr
3151 def __init__(self, *args, **kwargs):
27fb7603
RD
3152 """
3153 __init__(self) -> PCXHandler
3154
3155 A `wx.ImageHandler` for PCX imager files.
3156 """
554f62e9 3157 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3158_core_.PCXHandler_swigregister(PCXHandler)
d55e5bfc
RD
3159
3160class JPEGHandler(ImageHandler):
27fb7603 3161 """A `wx.ImageHandler` for JPEG/JPG image files."""
554f62e9
RD
3162 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3163 __repr__ = _swig_repr
3164 def __init__(self, *args, **kwargs):
27fb7603
RD
3165 """
3166 __init__(self) -> JPEGHandler
3167
3168 A `wx.ImageHandler` for JPEG/JPG image files.
3169 """
554f62e9 3170 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3171_core_.JPEGHandler_swigregister(JPEGHandler)
d55e5bfc
RD
3172
3173class PNMHandler(ImageHandler):
27fb7603 3174 """A `wx.ImageHandler` for PNM image files."""
554f62e9
RD
3175 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3176 __repr__ = _swig_repr
3177 def __init__(self, *args, **kwargs):
27fb7603
RD
3178 """
3179 __init__(self) -> PNMHandler
3180
3181 A `wx.ImageHandler` for PNM image files.
3182 """
554f62e9 3183 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3184_core_.PNMHandler_swigregister(PNMHandler)
d55e5bfc
RD
3185
3186class XPMHandler(ImageHandler):
27fb7603 3187 """A `wx.ImageHandler` for XPM image."""
554f62e9
RD
3188 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3189 __repr__ = _swig_repr
3190 def __init__(self, *args, **kwargs):
27fb7603
RD
3191 """
3192 __init__(self) -> XPMHandler
3193
3194 A `wx.ImageHandler` for XPM image.
3195 """
554f62e9 3196 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3197_core_.XPMHandler_swigregister(XPMHandler)
d55e5bfc
RD
3198
3199class TIFFHandler(ImageHandler):
27fb7603 3200 """A `wx.ImageHandler` for TIFF image files."""
554f62e9
RD
3201 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3202 __repr__ = _swig_repr
3203 def __init__(self, *args, **kwargs):
27fb7603
RD
3204 """
3205 __init__(self) -> TIFFHandler
3206
3207 A `wx.ImageHandler` for TIFF image files.
3208 """
554f62e9 3209 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3210_core_.TIFFHandler_swigregister(TIFFHandler)
d55e5bfc 3211
c0de73ae
RD
3212QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3213QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3214class Quantize(object):
3215 """Performs quantization, or colour reduction, on a wxImage."""
554f62e9
RD
3216 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3217 def __init__(self): raise AttributeError, "No constructor defined"
3218 __repr__ = _swig_repr
c0de73ae
RD
3219 def Quantize(*args, **kwargs):
3220 """
3221 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3222
3223 Reduce the colours in the source image and put the result into the
3224 destination image, setting the palette in the destination if
3225 needed. Both images may be the same, to overwrite the source image.
3226 """
3227 return _core_.Quantize_Quantize(*args, **kwargs)
3228
3229 Quantize = staticmethod(Quantize)
2131d850 3230_core_.Quantize_swigregister(Quantize)
c0de73ae
RD
3231
3232def Quantize_Quantize(*args, **kwargs):
554f62e9 3233 """
c0de73ae
RD
3234 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3235
3236 Reduce the colours in the source image and put the result into the
3237 destination image, setting the palette in the destination if
3238 needed. Both images may be the same, to overwrite the source image.
3239 """
554f62e9 3240 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3241
d55e5bfc
RD
3242#---------------------------------------------------------------------------
3243
3244class EvtHandler(Object):
093d3ff1 3245 """Proxy of C++ EvtHandler class"""
554f62e9
RD
3246 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3247 __repr__ = _swig_repr
3248 def __init__(self, *args, **kwargs):
d55e5bfc 3249 """__init__(self) -> EvtHandler"""
554f62e9 3250 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d55e5bfc
RD
3251 def GetNextHandler(*args, **kwargs):
3252 """GetNextHandler(self) -> EvtHandler"""
3253 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
3254
3255 def GetPreviousHandler(*args, **kwargs):
3256 """GetPreviousHandler(self) -> EvtHandler"""
3257 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
3258
3259 def SetNextHandler(*args, **kwargs):
3260 """SetNextHandler(self, EvtHandler handler)"""
3261 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
3262
3263 def SetPreviousHandler(*args, **kwargs):
3264 """SetPreviousHandler(self, EvtHandler handler)"""
3265 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
3266
3267 def GetEvtHandlerEnabled(*args, **kwargs):
3268 """GetEvtHandlerEnabled(self) -> bool"""
3269 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
3270
3271 def SetEvtHandlerEnabled(*args, **kwargs):
3272 """SetEvtHandlerEnabled(self, bool enabled)"""
3273 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
3274
3275 def ProcessEvent(*args, **kwargs):
3276 """ProcessEvent(self, Event event) -> bool"""
3277 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
3278
3279 def AddPendingEvent(*args, **kwargs):
3280 """AddPendingEvent(self, Event event)"""
3281 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
3282
3283 def ProcessPendingEvents(*args, **kwargs):
3284 """ProcessPendingEvents(self)"""
3285 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
3286
3287 def Connect(*args, **kwargs):
3288 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
3289 return _core_.EvtHandler_Connect(*args, **kwargs)
3290
3291 def Disconnect(*args, **kwargs):
f460c29d 3292 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
d55e5bfc
RD
3293 return _core_.EvtHandler_Disconnect(*args, **kwargs)
3294
3295 def _setOORInfo(*args, **kwargs):
093d3ff1 3296 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3297 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3298 args[0].thisown = 0
3299 return val
d55e5bfc
RD
3300
3301 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3302 """
3303 Bind an event to an event handler.
3304
caef1a4d
RD
3305 :param event: One of the EVT_* objects that specifies the
3306 type of event to bind,
d55e5bfc 3307
caef1a4d
RD
3308 :param handler: A callable object to be invoked when the
3309 event is delivered to self. Pass None to
3310 disconnect an event handler.
d55e5bfc 3311
caef1a4d
RD
3312 :param source: Sometimes the event originates from a
3313 different window than self, but you still
3314 want to catch it in self. (For example, a
3315 button event delivered to a frame.) By
3316 passing the source of the event, the event
3317 handling system is able to differentiate
3318 between the same event type from different
3319 controls.
d55e5bfc 3320
caef1a4d
RD
3321 :param id: Used to spcify the event source by ID instead
3322 of instance.
3323
3324 :param id2: Used when it is desirable to bind a handler
3325 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3326 """
3327 if source is not None:
3328 id = source.GetId()
3329 event.Bind(self, id, id2, handler)
3330
c24da6d6
RD
3331 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3332 """
3333 Disconencts the event handler binding for event from self.
3334 Returns True if successful.
3335 """
3336 if source is not None:
3337 id = source.GetId()
3338 return event.Unbind(self, id, id2)
d55e5bfc 3339
2131d850 3340_core_.EvtHandler_swigregister(EvtHandler)
d55e5bfc
RD
3341
3342#---------------------------------------------------------------------------
3343
3344class PyEventBinder(object):
3345 """
3346 Instances of this class are used to bind specific events to event
3347 handlers.
3348 """
3349 def __init__(self, evtType, expectedIDs=0):
3350 if expectedIDs not in [0, 1, 2]:
3351 raise ValueError, "Invalid number of expectedIDs"
3352 self.expectedIDs = expectedIDs
3353
3354 if type(evtType) == list or type(evtType) == tuple:
3355 self.evtType = evtType
3356 else:
3357 self.evtType = [evtType]
3358
3359
3360 def Bind(self, target, id1, id2, function):
3361 """Bind this set of event types to target."""
3362 for et in self.evtType:
3363 target.Connect(id1, id2, et, function)
3364
c24da6d6
RD
3365
3366 def Unbind(self, target, id1, id2):
3367 """Remove an event binding."""
3368 success = 0
3369 for et in self.evtType:
3370 success += target.Disconnect(id1, id2, et)
3371 return success != 0
3372
d55e5bfc
RD
3373
3374 def __call__(self, *args):
3375 """
3376 For backwards compatibility with the old EVT_* functions.
3377 Should be called with either (window, func), (window, ID,
3378 func) or (window, ID1, ID2, func) parameters depending on the
3379 type of the event.
3380 """
3381 assert len(args) == 2 + self.expectedIDs
3382 id1 = wx.ID_ANY
3383 id2 = wx.ID_ANY
3384 target = args[0]
3385 if self.expectedIDs == 0:
3386 func = args[1]
3387 elif self.expectedIDs == 1:
3388 id1 = args[1]
3389 func = args[2]
3390 elif self.expectedIDs == 2:
3391 id1 = args[1]
3392 id2 = args[2]
3393 func = args[3]
3394 else:
3395 raise ValueError, "Unexpected number of IDs"
3396
3397 self.Bind(target, id1, id2, func)
3398
3399
3400# These two are square pegs that don't fit the PyEventBinder hole...
3401def EVT_COMMAND(win, id, cmd, func):
3402 win.Connect(id, -1, cmd, func)
3403def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3404 win.Connect(id1, id2, cmd, func)
3405
3406
3407#---------------------------------------------------------------------------
3408
3409#---------------------------------------------------------------------------
3410
3411EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3412EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3413
554f62e9 3414def NewEventType(*args):
f460c29d 3415 """NewEventType() -> EventType"""
554f62e9 3416 return _core_.NewEventType(*args)
d55e5bfc
RD
3417wxEVT_NULL = _core_.wxEVT_NULL
3418wxEVT_FIRST = _core_.wxEVT_FIRST
3419wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3420wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3421wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3422wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3423wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3424wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3425wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3426wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3427wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3428wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3429wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3430wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3431wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3432wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3433wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3434wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3435wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3436wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3437wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3438wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3439wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3440wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3441wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3442wxEVT_MOTION = _core_.wxEVT_MOTION
3443wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3444wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3445wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3446wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3447wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3448wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3449wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3450wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3451wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3452wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3453wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3454wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3455wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3456wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3457wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3458wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3459wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3460wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3461wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3462wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3463wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3464wxEVT_CHAR = _core_.wxEVT_CHAR
3465wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3466wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3467wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3468wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3469wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3470wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3471wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3472wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3473wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3474wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3475wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3476wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3477wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3478wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
db67f999
RD
3479wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3480wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
d55e5bfc
RD
3481wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3482wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3483wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3484wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3485wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3486wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3487wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3488wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3489wxEVT_SIZE = _core_.wxEVT_SIZE
3490wxEVT_MOVE = _core_.wxEVT_MOVE
3491wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3492wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3493wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3494wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
d55e5bfc
RD
3495wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3496wxEVT_CREATE = _core_.wxEVT_CREATE
3497wxEVT_DESTROY = _core_.wxEVT_DESTROY
3498wxEVT_SHOW = _core_.wxEVT_SHOW
3499wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3500wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3501wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3502wxEVT_PAINT = _core_.wxEVT_PAINT
3503wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3504wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3505wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3506wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3507wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3508wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3509wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3510wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3511wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3512wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3513wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3514wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3515wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3516wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3517wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3518wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3519wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3520wxEVT_IDLE = _core_.wxEVT_IDLE
3521wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3522wxEVT_SIZING = _core_.wxEVT_SIZING
3523wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 3524wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
3525wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3526wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3527wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
d55e5bfc
RD
3528wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3529wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3530wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3531wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3532wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3533wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3534wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
3535#
3536# Create some event binders
3537EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3538EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3539EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3540EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3541EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3542EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3543EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3544EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3545EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3546EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3547EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3548EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3549EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 3550EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d55e5bfc
RD
3551EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3552EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3553EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3554EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3555EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3556EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3557EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3558EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3559EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3560EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 3561EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3562EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3563EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3564EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3565EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3566EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3567EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3568EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3569EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3570EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3571EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3572EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3573EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3574EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3575EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3576EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3577EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3578
3579EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3580EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3581EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3582EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3583EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3584EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3585EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3586EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3587EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3588EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3589EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3590EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3591EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3592
3593EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3594 wxEVT_LEFT_UP,
3595 wxEVT_MIDDLE_DOWN,
3596 wxEVT_MIDDLE_UP,
3597 wxEVT_RIGHT_DOWN,
3598 wxEVT_RIGHT_UP,
3599 wxEVT_MOTION,
3600 wxEVT_LEFT_DCLICK,
3601 wxEVT_MIDDLE_DCLICK,
3602 wxEVT_RIGHT_DCLICK,
3603 wxEVT_ENTER_WINDOW,
3604 wxEVT_LEAVE_WINDOW,
3605 wxEVT_MOUSEWHEEL
3606 ])
3607
3608
3609# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 3610EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d55e5bfc
RD
3611 wxEVT_SCROLLWIN_BOTTOM,
3612 wxEVT_SCROLLWIN_LINEUP,
3613 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 3614 wxEVT_SCROLLWIN_PAGEUP,
d55e5bfc
RD
3615 wxEVT_SCROLLWIN_PAGEDOWN,
3616 wxEVT_SCROLLWIN_THUMBTRACK,
3617 wxEVT_SCROLLWIN_THUMBRELEASE,
3618 ])
3619
3620EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3621EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3622EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3623EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3624EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3625EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3626EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3627EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3628
27fb7603 3629# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
3630EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3631 wxEVT_SCROLL_BOTTOM,
3632 wxEVT_SCROLL_LINEUP,
3633 wxEVT_SCROLL_LINEDOWN,
3634 wxEVT_SCROLL_PAGEUP,
3635 wxEVT_SCROLL_PAGEDOWN,
3636 wxEVT_SCROLL_THUMBTRACK,
3637 wxEVT_SCROLL_THUMBRELEASE,
db67f999 3638 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3639 ])
3640
3641EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3642EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3643EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3644EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3645EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3646EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3647EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3648EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
db67f999
RD
3649EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3650EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 3651
27fb7603 3652# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
3653EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3654 wxEVT_SCROLL_BOTTOM,
3655 wxEVT_SCROLL_LINEUP,
3656 wxEVT_SCROLL_LINEDOWN,
3657 wxEVT_SCROLL_PAGEUP,
3658 wxEVT_SCROLL_PAGEDOWN,
3659 wxEVT_SCROLL_THUMBTRACK,
d55e5bfc 3660 wxEVT_SCROLL_THUMBRELEASE,
db67f999 3661 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3662 ], 1)
3663
3664EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3665EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3666EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3667EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3668EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3669EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3670EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3671EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
db67f999
RD
3672EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3673EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
3674
3675EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3676EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3677EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3678EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3679EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3680EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3681EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3682EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3683EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3684EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3685
3686EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3687EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3688EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3689EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3690EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3691EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3692EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3693EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3694EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3695
3696
3697EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3698EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3699EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3700EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3701EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3702EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3703EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3704
3705EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3706
3707EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3708EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3709
3710EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3711
2131d850
RD
3712EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3713EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3714EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d55e5bfc
RD
3715
3716
3717#---------------------------------------------------------------------------
3718
3719class Event(Object):
27fb7603
RD
3720 """
3721 An event is a structure holding information about an event passed to a
3722 callback or member function. wx.Event is an abstract base class for
3723 other event classes
3724 """
554f62e9
RD
3725 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3726 def __init__(self): raise AttributeError, "No constructor defined"
3727 __repr__ = _swig_repr
3728 __swig_destroy__ = _core_.delete_Event
3729 __del__ = lambda self : None;
d55e5bfc 3730 def SetEventType(*args, **kwargs):
27fb7603 3731 """
f460c29d 3732 SetEventType(self, EventType typ)
27fb7603
RD
3733
3734 Sets the specific type of the event.
3735 """
d55e5bfc
RD
3736 return _core_.Event_SetEventType(*args, **kwargs)
3737
3738 def GetEventType(*args, **kwargs):
27fb7603 3739 """
f460c29d 3740 GetEventType(self) -> EventType
27fb7603
RD
3741
3742 Returns the identifier of the given event type, such as
3743 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3744 """
d55e5bfc
RD
3745 return _core_.Event_GetEventType(*args, **kwargs)
3746
3747 def GetEventObject(*args, **kwargs):
27fb7603
RD
3748 """
3749 GetEventObject(self) -> Object
3750
3751 Returns the object (usually a window) associated with the event, if
3752 any.
3753 """
d55e5bfc
RD
3754 return _core_.Event_GetEventObject(*args, **kwargs)
3755
3756 def SetEventObject(*args, **kwargs):
27fb7603
RD
3757 """
3758 SetEventObject(self, Object obj)
3759
3760 Sets the originating object, or in other words, obj is normally the
3761 object that is sending the event.
3762 """
d55e5bfc
RD
3763 return _core_.Event_SetEventObject(*args, **kwargs)
3764
3765 def GetTimestamp(*args, **kwargs):
3766 """GetTimestamp(self) -> long"""
3767 return _core_.Event_GetTimestamp(*args, **kwargs)
3768
3769 def SetTimestamp(*args, **kwargs):
3770 """SetTimestamp(self, long ts=0)"""
3771 return _core_.Event_SetTimestamp(*args, **kwargs)
3772
3773 def GetId(*args, **kwargs):
27fb7603
RD
3774 """
3775 GetId(self) -> int
3776
3777 Returns the identifier associated with this event, such as a button
3778 command id.
3779 """
d55e5bfc
RD
3780 return _core_.Event_GetId(*args, **kwargs)
3781
3782 def SetId(*args, **kwargs):
27fb7603
RD
3783 """
3784 SetId(self, int Id)
3785
3786 Set's the ID for the event. This is usually the ID of the window that
3787 is sending the event, but it can also be a command id from a menu
3788 item, etc.
3789 """
d55e5bfc
RD
3790 return _core_.Event_SetId(*args, **kwargs)
3791
3792 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
3793 """
3794 IsCommandEvent(self) -> bool
3795
3796 Returns true if the event is or is derived from `wx.CommandEvent` else
3797 it returns false. Note: Exists only for optimization purposes.
3798 """
d55e5bfc
RD
3799 return _core_.Event_IsCommandEvent(*args, **kwargs)
3800
3801 def Skip(*args, **kwargs):
51b83b37
RD
3802 """
3803 Skip(self, bool skip=True)
3804
3805 Called by an event handler, it controls whether additional event
3806 handlers bound to this event will be called after the current event
3807 handler returns. Skip(false) (the default setting) will prevent
3808 additional event handlers from being called and control will be
3809 returned to the sender of the event immediately after the current
3810 handler has finished. Skip(True) will cause the event processing
3811 system to continue searching for a handler function for this event.
3812
3813 """
d55e5bfc
RD
3814 return _core_.Event_Skip(*args, **kwargs)
3815
3816 def GetSkipped(*args, **kwargs):
27fb7603
RD
3817 """
3818 GetSkipped(self) -> bool
3819
3820 Returns true if the event handler should be skipped, false otherwise.
3821 :see: `Skip`
3822 """
d55e5bfc
RD
3823 return _core_.Event_GetSkipped(*args, **kwargs)
3824
3825 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
3826 """
3827 ShouldPropagate(self) -> bool
3828
3829 Test if this event should be propagated to the parent window or not,
3830 i.e. if the propagation level is currently greater than 0.
3831 """
d55e5bfc
RD
3832 return _core_.Event_ShouldPropagate(*args, **kwargs)
3833
3834 def StopPropagation(*args, **kwargs):
27fb7603
RD
3835 """
3836 StopPropagation(self) -> int
3837
3838 Stop the event from propagating to its parent window. Returns the old
3839 propagation level value which may be later passed to
3840 `ResumePropagation` to allow propagating the event again.
3841 """
d55e5bfc
RD
3842 return _core_.Event_StopPropagation(*args, **kwargs)
3843
3844 def ResumePropagation(*args, **kwargs):
27fb7603
RD
3845 """
3846 ResumePropagation(self, int propagationLevel)
3847
3848 Resume the event propagation by restoring the propagation level. (For
3849 example, you can use the value returned by an earlier call to
3850 `StopPropagation`.)
3851
3852 """
d55e5bfc
RD
3853 return _core_.Event_ResumePropagation(*args, **kwargs)
3854
3855 def Clone(*args, **kwargs):
3856 """Clone(self) -> Event"""
3857 return _core_.Event_Clone(*args, **kwargs)
3858
2131d850 3859_core_.Event_swigregister(Event)
d55e5bfc
RD
3860
3861#---------------------------------------------------------------------------
3862
3863class PropagationDisabler(object):
27fb7603
RD
3864 """
3865 Helper class to temporarily change an event not to propagate. Simply
3866 create an instance of this class and then whe it is destroyed the
3867 propogation of the event will be restored.
3868 """
554f62e9
RD
3869 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3870 __repr__ = _swig_repr
3871 def __init__(self, *args, **kwargs):
27fb7603
RD
3872 """
3873 __init__(self, Event event) -> PropagationDisabler
3874
3875 Helper class to temporarily change an event not to propagate. Simply
3876 create an instance of this class and then whe it is destroyed the
3877 propogation of the event will be restored.
3878 """
554f62e9
RD
3879 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3880 __swig_destroy__ = _core_.delete_PropagationDisabler
3881 __del__ = lambda self : None;
2131d850 3882_core_.PropagationDisabler_swigregister(PropagationDisabler)
d55e5bfc
RD
3883
3884class PropagateOnce(object):
27fb7603
RD
3885 """
3886 A helper class that will temporarily lower propagation level of an
3887 event. Simply create an instance of this class and then whe it is
3888 destroyed the propogation of the event will be restored.
3889 """
554f62e9
RD
3890 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3891 __repr__ = _swig_repr
3892 def __init__(self, *args, **kwargs):
27fb7603
RD
3893 """
3894 __init__(self, Event event) -> PropagateOnce
3895
3896 A helper class that will temporarily lower propagation level of an
3897 event. Simply create an instance of this class and then whe it is
3898 destroyed the propogation of the event will be restored.
3899 """
554f62e9
RD
3900 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3901 __swig_destroy__ = _core_.delete_PropagateOnce
3902 __del__ = lambda self : None;
2131d850 3903_core_.PropagateOnce_swigregister(PropagateOnce)
d55e5bfc
RD
3904
3905#---------------------------------------------------------------------------
3906
3907class CommandEvent(Event):
27fb7603
RD
3908 """
3909 This event class contains information about command events, which
3910 originate from a variety of simple controls, as well as menus and
3911 toolbars.
3912 """
554f62e9
RD
3913 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3914 __repr__ = _swig_repr
3915 def __init__(self, *args, **kwargs):
27fb7603 3916 """
f460c29d 3917 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
3918
3919 This event class contains information about command events, which
3920 originate from a variety of simple controls, as well as menus and
3921 toolbars.
3922 """
554f62e9 3923 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
d55e5bfc 3924 def GetSelection(*args, **kwargs):
27fb7603
RD
3925 """
3926 GetSelection(self) -> int
3927
3928 Returns item index for a listbox or choice selection event (not valid
3929 for a deselection).
3930 """
d55e5bfc
RD
3931 return _core_.CommandEvent_GetSelection(*args, **kwargs)
3932
3933 def SetString(*args, **kwargs):
3934 """SetString(self, String s)"""
3935 return _core_.CommandEvent_SetString(*args, **kwargs)
3936
3937 def GetString(*args, **kwargs):
27fb7603
RD
3938 """
3939 GetString(self) -> String
3940
3941 Returns item string for a listbox or choice selection event (not valid
3942 for a deselection).
3943 """
d55e5bfc
RD
3944 return _core_.CommandEvent_GetString(*args, **kwargs)
3945
3946 def IsChecked(*args, **kwargs):
27fb7603
RD
3947 """
3948 IsChecked(self) -> bool
3949
3950 This method can be used with checkbox and menu events: for the
3951 checkboxes, the method returns true for a selection event and false
3952 for a deselection one. For the menu events, this method indicates if
3953 the menu item just has become checked or unchecked (and thus only
3954 makes sense for checkable menu items).
3955 """
d55e5bfc
RD
3956 return _core_.CommandEvent_IsChecked(*args, **kwargs)
3957
3958 Checked = IsChecked
3959 def IsSelection(*args, **kwargs):
27fb7603
RD
3960 """
3961 IsSelection(self) -> bool
3962
3963 For a listbox or similar event, returns true if it is a selection,
3964 false if it is a deselection.
3965 """
d55e5bfc
RD
3966 return _core_.CommandEvent_IsSelection(*args, **kwargs)
3967
3968 def SetExtraLong(*args, **kwargs):
3969 """SetExtraLong(self, long extraLong)"""
3970 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
3971
3972 def GetExtraLong(*args, **kwargs):
27fb7603
RD
3973 """
3974 GetExtraLong(self) -> long
3975
5ba5649b
RD
3976 Returns extra information dependant on the event objects type. If the
3977 event comes from a listbox selection, it is a boolean determining
3978 whether the event was a selection (true) or a deselection (false). A
3979 listbox deselection only occurs for multiple-selection boxes, and in
3980 this case the index and string values are indeterminate and the
3981 listbox must be examined by the application.
27fb7603 3982 """
d55e5bfc
RD
3983 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
3984
3985 def SetInt(*args, **kwargs):
3986 """SetInt(self, int i)"""
3987 return _core_.CommandEvent_SetInt(*args, **kwargs)
3988
3989 def GetInt(*args, **kwargs):
27fb7603 3990 """
f460c29d 3991 GetInt(self) -> int
27fb7603 3992
5ba5649b
RD
3993 Returns the integer identifier corresponding to a listbox, choice or
3994 radiobox selection (only if the event was a selection, not a
3995 deselection), or a boolean value representing the value of a checkbox.
27fb7603 3996 """
d55e5bfc
RD
3997 return _core_.CommandEvent_GetInt(*args, **kwargs)
3998
554f62e9
RD
3999 def GetClientData(*args, **kwargs):
4000 """
4001 GetClientData(self) -> PyObject
4002
4003 Returns the client data object for a listbox or choice selection event, (if any.)
4004 """
4005 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4006
4007 def SetClientData(*args, **kwargs):
4008 """
4009 SetClientData(self, PyObject clientData)
4010
4011 Associate the given client data with the item at position n.
4012 """
4013 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4014
4015 GetClientObject = GetClientData
4016 SetClientObject = SetClientData
4017
d55e5bfc
RD
4018 def Clone(*args, **kwargs):
4019 """Clone(self) -> Event"""
4020 return _core_.CommandEvent_Clone(*args, **kwargs)
4021
2131d850 4022_core_.CommandEvent_swigregister(CommandEvent)
d55e5bfc
RD
4023
4024#---------------------------------------------------------------------------
4025
4026class NotifyEvent(CommandEvent):
27fb7603
RD
4027 """
4028 An instance of this class (or one of its derived classes) is sent from
4029 a control when the control's state is being changed and the control
4030 allows that change to be prevented from happening. The event handler
4031 can call `Veto` or `Allow` to tell the control what to do.
4032 """
554f62e9
RD
4033 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4034 __repr__ = _swig_repr
4035 def __init__(self, *args, **kwargs):
27fb7603 4036 """
f460c29d 4037 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4038
4039 An instance of this class (or one of its derived classes) is sent from
4040 a control when the control's state is being changed and the control
4041 allows that change to be prevented from happening. The event handler
4042 can call `Veto` or `Allow` to tell the control what to do.
4043 """
554f62e9 4044 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
d55e5bfc 4045 def Veto(*args, **kwargs):
27fb7603
RD
4046 """
4047 Veto(self)
4048
4049 Prevents the change announced by this event from happening.
4050
4051 It is in general a good idea to notify the user about the reasons for
4052 vetoing the change because otherwise the applications behaviour (which
4053 just refuses to do what the user wants) might be quite surprising.
4054 """
d55e5bfc
RD
4055 return _core_.NotifyEvent_Veto(*args, **kwargs)
4056
4057 def Allow(*args, **kwargs):
27fb7603
RD
4058 """
4059 Allow(self)
4060
4061 This is the opposite of `Veto`: it explicitly allows the event to be
4062 processed. For most events it is not necessary to call this method as
4063 the events are allowed anyhow but some are forbidden by default (this
4064 will be mentioned in the corresponding event description).
4065 """
d55e5bfc
RD
4066 return _core_.NotifyEvent_Allow(*args, **kwargs)
4067
4068 def IsAllowed(*args, **kwargs):
27fb7603
RD
4069 """
4070 IsAllowed(self) -> bool
4071
4072 Returns true if the change is allowed (`Veto` hasn't been called) or
4073 false otherwise (if it was).
4074 """
d55e5bfc
RD
4075 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
4076
2131d850 4077_core_.NotifyEvent_swigregister(NotifyEvent)
d55e5bfc
RD
4078
4079#---------------------------------------------------------------------------
4080
4081class ScrollEvent(CommandEvent):
27fb7603
RD
4082 """
4083 A scroll event holds information about events sent from stand-alone
4084 scrollbars and sliders. Note that scrolled windows do not send
4085 instnaces of this event class, but send the `wx.ScrollWinEvent`
4086 instead.
4087 """
554f62e9
RD
4088 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4089 __repr__ = _swig_repr
4090 def __init__(self, *args, **kwargs):
d55e5bfc 4091 """
f460c29d 4092 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
d55e5bfc
RD
4093 int orient=0) -> ScrollEvent
4094 """
554f62e9 4095 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
d55e5bfc 4096 def GetOrientation(*args, **kwargs):
27fb7603
RD
4097 """
4098 GetOrientation(self) -> int
4099
4100 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4101 the scrollbar.
4102 """
d55e5bfc
RD
4103 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
4104
4105 def GetPosition(*args, **kwargs):
27fb7603
RD
4106 """
4107 GetPosition(self) -> int
4108
4109 Returns the position of the scrollbar.
4110 """
d55e5bfc
RD
4111 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
4112
4113 def SetOrientation(*args, **kwargs):
4114 """SetOrientation(self, int orient)"""
4115 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
4116
4117 def SetPosition(*args, **kwargs):
4118 """SetPosition(self, int pos)"""
4119 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
4120
2131d850 4121_core_.ScrollEvent_swigregister(ScrollEvent)
d55e5bfc
RD
4122
4123#---------------------------------------------------------------------------
4124
4125class ScrollWinEvent(Event):
27fb7603
RD
4126 """
4127 A wx.ScrollWinEvent holds information about scrolling and is sent from
4128 scrolling windows.
4129 """
554f62e9
RD
4130 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4131 __repr__ = _swig_repr
4132 def __init__(self, *args, **kwargs):
27fb7603 4133 """
f460c29d 4134 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4135
4136 A wx.ScrollWinEvent holds information about scrolling and is sent from
4137 scrolling windows.
4138 """
554f62e9 4139 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
d55e5bfc 4140 def GetOrientation(*args, **kwargs):
27fb7603
RD
4141 """
4142 GetOrientation(self) -> int
4143
4144 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4145 the scrollbar.
4146 """
d55e5bfc
RD
4147 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
4148
4149 def GetPosition(*args, **kwargs):
27fb7603
RD
4150 """
4151 GetPosition(self) -> int
4152
4153 Returns the position of the scrollbar for the thumb track and release
4154 events. Note that this field can't be used for the other events, you
4155 need to query the window itself for the current position in that case.
4156 """
d55e5bfc
RD
4157 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
4158
4159 def SetOrientation(*args, **kwargs):
4160 """SetOrientation(self, int orient)"""
4161 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
4162
4163 def SetPosition(*args, **kwargs):
4164 """SetPosition(self, int pos)"""
4165 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
4166
2131d850 4167_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d55e5bfc
RD
4168
4169#---------------------------------------------------------------------------
4170
4171MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4172MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4173MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4174MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4175MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4176class MouseEvent(Event):
27fb7603
RD
4177 """
4178 This event class contains information about the events generated by
4179 the mouse: they include mouse buttons press and release events and
4180 mouse move events.
4181
4182 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4183 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4184 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4185 a middle button so a portable application should avoid relying on the
4186 events from it.
4187
4188 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4189 the former returns true when the event corresponds to the left mouse
4190 button click while the latter returns true if the left mouse button is
4191 currently being pressed. For example, when the user is dragging the
4192 mouse you can use `LeftIsDown` to test whether the left mouse button
4193 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4194 `LeftIsDown` will also return true in wxWidgets whatever the
4195 underlying GUI behaviour is (which is platform-dependent). The same
4196 applies, of course, to other mouse buttons as well.
4197 """
554f62e9
RD
4198 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4199 __repr__ = _swig_repr
4200 def __init__(self, *args, **kwargs):
27fb7603 4201 """
f460c29d 4202 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4203
4204 Constructs a wx.MouseEvent. Valid event types are:
4205
4206 * wxEVT_ENTER_WINDOW
4207 * wxEVT_LEAVE_WINDOW
4208 * wxEVT_LEFT_DOWN
4209 * wxEVT_LEFT_UP
4210 * wxEVT_LEFT_DCLICK
4211 * wxEVT_MIDDLE_DOWN
4212 * wxEVT_MIDDLE_UP
4213 * wxEVT_MIDDLE_DCLICK
4214 * wxEVT_RIGHT_DOWN
4215 * wxEVT_RIGHT_UP
4216 * wxEVT_RIGHT_DCLICK
4217 * wxEVT_MOTION
4218 * wxEVT_MOUSEWHEEL
4219 """
554f62e9 4220 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
d55e5bfc 4221 def IsButton(*args, **kwargs):
27fb7603
RD
4222 """
4223 IsButton(self) -> bool
4224
4225 Returns true if the event was a mouse button event (not necessarily a
4226 button down event - that may be tested using `ButtonDown`).
4227 """
d55e5bfc
RD
4228 return _core_.MouseEvent_IsButton(*args, **kwargs)
4229
4230 def ButtonDown(*args, **kwargs):
27fb7603
RD
4231 """
4232 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4233
5ba5649b
RD
4234 If the argument is omitted, this returns true if the event was any
4235 mouse button down event. Otherwise the argument specifies which
4236 button-down event shold be checked for (see `Button` for the possible
4237 values).
27fb7603 4238 """
d55e5bfc
RD
4239 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
4240
4241 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4242 """
4243 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4244
4245 If the argument is omitted, this returns true if the event was any
4246 mouse double click event. Otherwise the argument specifies which
4247 double click event to check for (see `Button` for the possible
4248 values).
4249 """
d55e5bfc
RD
4250 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
4251
4252 def ButtonUp(*args, **kwargs):
27fb7603
RD
4253 """
4254 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4255
4256 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4257 mouse button up event. Otherwise the argument specifies which button
4258 up event to check for (see `Button` for the possible values).
27fb7603 4259 """
d55e5bfc
RD
4260 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
4261
4262 def Button(*args, **kwargs):
27fb7603
RD
4263 """
4264 Button(self, int button) -> bool
4265
4266 Returns true if the identified mouse button is changing state. Valid
4267 values of button are:
4268
4269 ==================== =====================================
4270 wx.MOUSE_BTN_LEFT check if left button was pressed
4271 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4272 wx.MOUSE_BTN_RIGHT check if right button was pressed
4273 wx.MOUSE_BTN_ANY check if any button was pressed
4274 ==================== =====================================
4275
4276 """
d55e5bfc
RD
4277 return _core_.MouseEvent_Button(*args, **kwargs)
4278
4279 def ButtonIsDown(*args, **kwargs):
4280 """ButtonIsDown(self, int but) -> bool"""
4281 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
4282
4283 def GetButton(*args, **kwargs):
27fb7603
RD
4284 """
4285 GetButton(self) -> int
4286
4287 Returns the mouse button which generated this event or
4288 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4289 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4290 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4291 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4292 right buttons respectively.
4293 """
d55e5bfc
RD
4294 return _core_.MouseEvent_GetButton(*args, **kwargs)
4295
4296 def ControlDown(*args, **kwargs):
27fb7603
RD
4297 """
4298 ControlDown(self) -> bool
4299
4300 Returns true if the control key was down at the time of the event.
4301 """
d55e5bfc
RD
4302 return _core_.MouseEvent_ControlDown(*args, **kwargs)
4303
4304 def MetaDown(*args, **kwargs):
27fb7603
RD
4305 """
4306 MetaDown(self) -> bool
4307
4308 Returns true if the Meta key was down at the time of the event.
4309 """
d55e5bfc
RD
4310 return _core_.MouseEvent_MetaDown(*args, **kwargs)
4311
4312 def AltDown(*args, **kwargs):
27fb7603
RD
4313 """
4314 AltDown(self) -> bool
4315
4316 Returns true if the Alt key was down at the time of the event.
4317 """
d55e5bfc
RD
4318 return _core_.MouseEvent_AltDown(*args, **kwargs)
4319
4320 def ShiftDown(*args, **kwargs):
27fb7603
RD
4321 """
4322 ShiftDown(self) -> bool
4323
4324 Returns true if the Shift key was down at the time of the event.
4325 """
d55e5bfc
RD
4326 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
4327
412d302d
RD
4328 def CmdDown(*args, **kwargs):
4329 """
4330 CmdDown(self) -> bool
4331
4332 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4333 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4334 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4335 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4336 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4337 purpose. So for non-Mac platforms this is the same as `ControlDown`
4338 and Macs this is the same as `MetaDown`.
4339 """
4340 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4341
d55e5bfc 4342 def LeftDown(*args, **kwargs):
27fb7603
RD
4343 """
4344 LeftDown(self) -> bool
4345
4346 Returns true if the left mouse button state changed to down.
4347 """
d55e5bfc
RD
4348 return _core_.MouseEvent_LeftDown(*args, **kwargs)
4349
4350 def MiddleDown(*args, **kwargs):
27fb7603
RD
4351 """
4352 MiddleDown(self) -> bool
4353
4354 Returns true if the middle mouse button state changed to down.
4355 """
d55e5bfc
RD
4356 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
4357
4358 def RightDown(*args, **kwargs):
27fb7603
RD
4359 """
4360 RightDown(self) -> bool
4361
4362 Returns true if the right mouse button state changed to down.
4363 """
d55e5bfc
RD
4364 return _core_.MouseEvent_RightDown(*args, **kwargs)
4365
4366 def LeftUp(*args, **kwargs):
27fb7603
RD
4367 """
4368 LeftUp(self) -> bool
4369
4370 Returns true if the left mouse button state changed to up.
4371 """
d55e5bfc
RD
4372 return _core_.MouseEvent_LeftUp(*args, **kwargs)
4373
4374 def MiddleUp(*args, **kwargs):
27fb7603
RD
4375 """
4376 MiddleUp(self) -> bool
4377
4378 Returns true if the middle mouse button state changed to up.
4379 """
d55e5bfc
RD
4380 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
4381
4382 def RightUp(*args, **kwargs):
27fb7603
RD
4383 """
4384 RightUp(self) -> bool
4385
4386 Returns true if the right mouse button state changed to up.
4387 """
d55e5bfc
RD
4388 return _core_.MouseEvent_RightUp(*args, **kwargs)
4389
4390 def LeftDClick(*args, **kwargs):
27fb7603
RD
4391 """
4392 LeftDClick(self) -> bool
4393
4394 Returns true if the event was a left button double click.
4395 """
d55e5bfc
RD
4396 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
4397
4398 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4399 """
4400 MiddleDClick(self) -> bool
4401
4402 Returns true if the event was a middle button double click.
4403 """
d55e5bfc
RD
4404 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
4405
4406 def RightDClick(*args, **kwargs):
27fb7603
RD
4407 """
4408 RightDClick(self) -> bool
4409
4410 Returns true if the event was a right button double click.
4411 """
d55e5bfc
RD
4412 return _core_.MouseEvent_RightDClick(*args, **kwargs)
4413
4414 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4415 """
4416 LeftIsDown(self) -> bool
4417
4418 Returns true if the left mouse button is currently down, independent
4419 of the current event type.
4420
4421 Please notice that it is not the same as LeftDown which returns true
4422 if the left mouse button was just pressed. Rather, it describes the
4423 state of the mouse button before the event happened.
4424
4425 This event is usually used in the mouse event handlers which process
4426 "move mouse" messages to determine whether the user is (still)
4427 dragging the mouse.
4428 """
d55e5bfc
RD
4429 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
4430
4431 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4432 """
4433 MiddleIsDown(self) -> bool
4434
4435 Returns true if the middle mouse button is currently down, independent
4436 of the current event type.
4437 """
d55e5bfc
RD
4438 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
4439
4440 def RightIsDown(*args, **kwargs):
27fb7603
RD
4441 """
4442 RightIsDown(self) -> bool
4443
4444 Returns true if the right mouse button is currently down, independent
4445 of the current event type.
4446 """
d55e5bfc
RD
4447 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
4448
4449 def Dragging(*args, **kwargs):
27fb7603
RD
4450 """
4451 Dragging(self) -> bool
4452
4453 Returns true if this was a dragging event (motion while a button is
4454 depressed).
4455 """
d55e5bfc
RD
4456 return _core_.MouseEvent_Dragging(*args, **kwargs)
4457
4458 def Moving(*args, **kwargs):
27fb7603
RD
4459 """
4460 Moving(self) -> bool
4461
4462 Returns true if this was a motion event and no mouse buttons were
4463 pressed. If any mouse button is held pressed, then this method returns
4464 false and Dragging returns true.
4465 """
d55e5bfc
RD
4466 return _core_.MouseEvent_Moving(*args, **kwargs)
4467
4468 def Entering(*args, **kwargs):
27fb7603
RD
4469 """
4470 Entering(self) -> bool
4471
4472 Returns true if the mouse was entering the window.
4473 """
d55e5bfc
RD
4474 return _core_.MouseEvent_Entering(*args, **kwargs)
4475
4476 def Leaving(*args, **kwargs):
27fb7603
RD
4477 """
4478 Leaving(self) -> bool
4479
4480 Returns true if the mouse was leaving the window.
4481 """
d55e5bfc
RD
4482 return _core_.MouseEvent_Leaving(*args, **kwargs)
4483
4484 def GetPosition(*args, **kwargs):
4485 """
4486 GetPosition(self) -> Point
4487
27fb7603
RD
4488 Returns the pixel position of the mouse in window coordinates when the
4489 event happened.
d55e5bfc
RD
4490 """
4491 return _core_.MouseEvent_GetPosition(*args, **kwargs)
4492
4493 def GetPositionTuple(*args, **kwargs):
4494 """
4495 GetPositionTuple() -> (x,y)
4496
27fb7603
RD
4497 Returns the pixel position of the mouse in window coordinates when the
4498 event happened.
d55e5bfc
RD
4499 """
4500 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
4501
4502 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4503 """
4504 GetLogicalPosition(self, DC dc) -> Point
4505
4506 Returns the logical mouse position in pixels (i.e. translated
4507 according to the translation set for the DC, which usually indicates
4508 that the window has been scrolled).
4509 """
d55e5bfc
RD
4510 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
4511
4512 def GetX(*args, **kwargs):
27fb7603
RD
4513 """
4514 GetX(self) -> int
4515
4516 Returns X coordinate of the physical mouse event position.
4517 """
d55e5bfc
RD
4518 return _core_.MouseEvent_GetX(*args, **kwargs)
4519
4520 def GetY(*args, **kwargs):
27fb7603
RD
4521 """
4522 GetY(self) -> int
4523
4524 Returns Y coordinate of the physical mouse event position.
4525 """
d55e5bfc
RD
4526 return _core_.MouseEvent_GetY(*args, **kwargs)
4527
4528 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4529 """
4530 GetWheelRotation(self) -> int
4531
4532 Get wheel rotation, positive or negative indicates direction of
4533 rotation. Current devices all send an event when rotation is equal to
4534 +/-WheelDelta, but this allows for finer resolution devices to be
4535 created in the future. Because of this you shouldn't assume that one
4536 event is equal to 1 line or whatever, but you should be able to either
4537 do partial line scrolling or wait until +/-WheelDelta rotation values
4538 have been accumulated before scrolling.
4539 """
d55e5bfc
RD
4540 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
4541
4542 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4543 """
4544 GetWheelDelta(self) -> int
4545
4546 Get wheel delta, normally 120. This is the threshold for action to be
4547 taken, and one such action (for example, scrolling one increment)
4548 should occur for each delta.
4549 """
d55e5bfc
RD
4550 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
4551
4552 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4553 """
4554 GetLinesPerAction(self) -> int
4555
4556 Returns the configured number of lines (or whatever) to be scrolled
4557 per wheel action. Defaults to three.
4558 """
d55e5bfc
RD
4559 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
4560
4561 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4562 """
4563 IsPageScroll(self) -> bool
4564
4565 Returns true if the system has been setup to do page scrolling with
4566 the mouse wheel instead of line scrolling.
4567 """
d55e5bfc
RD
4568 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4569
4570 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4571 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4572 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4573 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4574 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4575 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4576 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4577 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4578 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4579 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4580 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4581 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
2131d850 4582_core_.MouseEvent_swigregister(MouseEvent)
d55e5bfc
RD
4583
4584#---------------------------------------------------------------------------
4585
4586class SetCursorEvent(Event):
5ba5649b
RD
4587 """
4588 A SetCursorEvent is generated when the mouse cursor is about to be set
4589 as a result of mouse motion. This event gives the application the
4590 chance to perform specific mouse cursor processing based on the
4591 current position of the mouse within the window. Use the `SetCursor`
4592 method to specify the cursor you want to be displayed.
4593 """
554f62e9
RD
4594 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4595 __repr__ = _swig_repr
4596 def __init__(self, *args, **kwargs):
5ba5649b
RD
4597 """
4598 __init__(self, int x=0, int y=0) -> SetCursorEvent
4599
4600 Construct a new `wx.SetCursorEvent`.
4601 """
554f62e9 4602 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
d55e5bfc 4603 def GetX(*args, **kwargs):
5ba5649b
RD
4604 """
4605 GetX(self) -> int
4606
4607 Returns the X coordinate of the mouse in client coordinates.
4608 """
d55e5bfc
RD
4609 return _core_.SetCursorEvent_GetX(*args, **kwargs)
4610
4611 def GetY(*args, **kwargs):
5ba5649b
RD
4612 """
4613 GetY(self) -> int
4614
4615 Returns the Y coordinate of the mouse in client coordinates.
4616 """
d55e5bfc
RD
4617 return _core_.SetCursorEvent_GetY(*args, **kwargs)
4618
4619 def SetCursor(*args, **kwargs):
5ba5649b
RD
4620 """
4621 SetCursor(self, Cursor cursor)
4622
4623 Sets the cursor associated with this event.
4624 """
d55e5bfc
RD
4625 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
4626
4627 def GetCursor(*args, **kwargs):
5ba5649b
RD
4628 """
4629 GetCursor(self) -> Cursor
4630
4631 Returns a reference to the cursor specified by this event.
4632 """
d55e5bfc
RD
4633 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
4634
4635 def HasCursor(*args, **kwargs):
5ba5649b
RD
4636 """
4637 HasCursor(self) -> bool
4638
4639 Returns true if the cursor specified by this event is a valid cursor.
4640 """
d55e5bfc
RD
4641 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
4642
2131d850 4643_core_.SetCursorEvent_swigregister(SetCursorEvent)
d55e5bfc
RD
4644
4645#---------------------------------------------------------------------------
4646
4647class KeyEvent(Event):
5ba5649b
RD
4648 """
4649 This event class contains information about keypress and character
4650 events. These events are only sent to the widget that currently has
4651 the keyboard focus.
4652
4653 Notice that there are three different kinds of keyboard events in
4654 wxWidgets: key down and up events and char events. The difference
4655 between the first two is clear - the first corresponds to a key press
4656 and the second to a key release - otherwise they are identical. Just
4657 note that if the key is maintained in a pressed state you will
4658 typically get a lot of (automatically generated) down events but only
4659 one up so it is wrong to assume that there is one up event
4660 corresponding to each down one.
4661
4662 Both key events provide untranslated key codes while the char event
4663 carries the translated one. The untranslated code for alphanumeric
4664 keys is always an upper case value. For the other keys it is one of
4665 WXK_XXX values from the keycodes table. The translated key is, in
4666 general, the character the user expects to appear as the result of the
4667 key combination when typing the text into a text entry zone, for
4668 example.
4669
4670 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4671 and the standard US keyboard): when the 'A' key is pressed, the key
4672 down event key code is equal to ASCII A == 65. But the char event key
4673 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4674 'A' keys simultaneously , the key code in key down event will still be
4675 just 'A' while the char event key code parameter will now be 'A' as
4676 well.
4677
4678 Although in this simple case it is clear that the correct key code
4679 could be found in the key down event handler by checking the value
4680 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4681 as for non alphanumeric keys or non-US keyboard layouts the
4682 translation is keyboard-layout dependent and can only be done properly
4683 by the system itself.
4684
4685 Another kind of translation is done when the control key is pressed:
4686 for example, for CTRL-A key press the key down event still carries the
4687 same key code 'A' as usual but the char event will have key code of 1,
4688 the ASCII value of this key combination.
4689
4690 You may discover how the other keys on your system behave
4691 interactively by running the KeyEvents sample in the wxPython demo and
4692 pressing some keys while the blue box at the top has the keyboard
4693 focus.
4694
4695 **Note**: If a key down event is caught and the event handler does not
4696 call event.Skip() then the coresponding char event will not
4697 happen. This is by design and enables the programs that handle both
4698 types of events to be a bit simpler.
4699
4700 **Note for Windows programmers**: The key and char events in wxWidgets
4701 are similar to but slightly different from Windows WM_KEYDOWN and
4702 WM_CHAR events. In particular, Alt-x combination will generate a char
4703 event in wxWidgets (unless it is used as an accelerator).
4704
4705 **Tip**: be sure to call event.Skip() for events that you don't
4706 process in key event function, otherwise menu shortcuts may cease to
4707 work under Windows.
4708
4709 """
554f62e9
RD
4710 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4711 __repr__ = _swig_repr
4712 def __init__(self, *args, **kwargs):
5ba5649b 4713 """
f460c29d 4714 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
4715
4716 Construct a new `wx.KeyEvent`. Valid event types are:
4717 *
4718 """
554f62e9 4719 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
4720 def GetModifiers(*args, **kwargs):
4721 """
4722 GetModifiers(self) -> int
4723
4724 Returns a bitmask of the current modifier settings. Can be used to
4725 check if the key event has exactly the given modifiers without having
4726 to explicitly check that the other modifiers are not down. For
4727 example::
4728
4729 if event.GetModifers() == wx.MOD_CONTROL:
4730 DoSomething()
4731
4732 """
4733 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4734
d55e5bfc 4735 def ControlDown(*args, **kwargs):
5ba5649b
RD
4736 """
4737 ControlDown(self) -> bool
4738
4739 Returns ``True`` if the Control key was down at the time of the event.
4740 """
d55e5bfc
RD
4741 return _core_.KeyEvent_ControlDown(*args, **kwargs)
4742
4743 def MetaDown(*args, **kwargs):
5ba5649b
RD
4744 """
4745 MetaDown(self) -> bool
4746
4747 Returns ``True`` if the Meta key was down at the time of the event.
4748 """
d55e5bfc
RD
4749 return _core_.KeyEvent_MetaDown(*args, **kwargs)
4750
4751 def AltDown(*args, **kwargs):
5ba5649b
RD
4752 """
4753 AltDown(self) -> bool
4754
4755 Returns ``True`` if the Alt key was down at the time of the event.
4756 """
d55e5bfc
RD
4757 return _core_.KeyEvent_AltDown(*args, **kwargs)
4758
4759 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4760 """
4761 ShiftDown(self) -> bool
4762
4763 Returns ``True`` if the Shift key was down at the time of the event.
4764 """
d55e5bfc
RD
4765 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
4766
412d302d
RD
4767 def CmdDown(*args, **kwargs):
4768 """
4769 CmdDown(self) -> bool
4770
4771 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4772 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4773 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
4774 because Cmd key is used for the same thing under Mac as Ctrl
4775 elsewhere. The Ctrl still exists, it's just not used for this
4776 purpose. So for non-Mac platforms this is the same as `ControlDown`
4777 and Macs this is the same as `MetaDown`.
4778 """
4779 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4780
d55e5bfc 4781 def HasModifiers(*args, **kwargs):
5ba5649b
RD
4782 """
4783 HasModifiers(self) -> bool
4784
4785 Returns true if either CTRL or ALT keys was down at the time of the
4786 key event. Note that this function does not take into account neither
4787 SHIFT nor META key states (the reason for ignoring the latter is that
4788 it is common for NUMLOCK key to be configured as META under X but the
4789 key presses even while NUMLOCK is on should be still processed
4790 normally).
4791 """
d55e5bfc
RD
4792 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
4793
4794 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
4795 """
4796 GetKeyCode(self) -> int
4797
4798 Returns the virtual key code. ASCII events return normal ASCII values,
4799 while non-ASCII events return values such as WXK_LEFT for the left
4800 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4801 codes.
4802
4803 Note that in Unicode build, the returned value is meaningful only if
4804 the user entered a character that can be represented in current
4805 locale's default charset. You can obtain the corresponding Unicode
4806 character using `GetUnicodeKey`.
4807 """
d55e5bfc
RD
4808 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
4809
4810 KeyCode = GetKeyCode
19272049 4811 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
4812 """
4813 GetUnicodeKey(self) -> int
4814
4815 Returns the Unicode character corresponding to this key event. This
4816 function is only meaningfule in a Unicode build of wxPython.
4817 """
19272049 4818 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 4819
19272049 4820 GetUniChar = GetUnicodeKey
b850e7f3
RD
4821 def SetUnicodeKey(*args, **kwargs):
4822 """
4823 SetUnicodeKey(self, int uniChar)
4824
4825 Set the Unicode value of the key event, but only if this is a Unicode
4826 build of wxPython.
4827 """
4828 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
4829
d55e5bfc 4830 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
4831 """
4832 GetRawKeyCode(self) -> unsigned int
4833
4834 Returns the raw key code for this event. This is a platform-dependent
4835 scan code which should only be used in advanced
4836 applications. Currently the raw key codes are not supported by all
4837 ports.
4838 """
d55e5bfc
RD
4839 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
4840
4841 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
4842 """
4843 GetRawKeyFlags(self) -> unsigned int
4844
4845 Returns the low level key flags for this event. The flags are
4846 platform-dependent and should only be used in advanced applications.
4847 Currently the raw key flags are not supported by all ports.
4848 """
d55e5bfc
RD
4849 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
4850
4851 def GetPosition(*args, **kwargs):
4852 """
4853 GetPosition(self) -> Point
4854
5ba5649b 4855 Find the position of the event, if applicable.
d55e5bfc
RD
4856 """
4857 return _core_.KeyEvent_GetPosition(*args, **kwargs)
4858
4859 def GetPositionTuple(*args, **kwargs):
4860 """
4861 GetPositionTuple() -> (x,y)
4862
5ba5649b 4863 Find the position of the event, if applicable.
d55e5bfc
RD
4864 """
4865 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
4866
4867 def GetX(*args, **kwargs):
5ba5649b
RD
4868 """
4869 GetX(self) -> int
4870
4871 Returns the X position (in client coordinates) of the event, if
4872 applicable.
4873 """
d55e5bfc
RD
4874 return _core_.KeyEvent_GetX(*args, **kwargs)
4875
4876 def GetY(*args, **kwargs):
5ba5649b
RD
4877 """
4878 GetY(self) -> int
4879
4880 Returns the Y position (in client coordinates) of the event, if
4881 applicable.
4882 """
d55e5bfc
RD
4883 return _core_.KeyEvent_GetY(*args, **kwargs)
4884
4885 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4886 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4887 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4888 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4889 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4890 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4891 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4892 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4893 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4894 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
2131d850 4895_core_.KeyEvent_swigregister(KeyEvent)
d55e5bfc
RD
4896
4897#---------------------------------------------------------------------------
4898
4899class SizeEvent(Event):
5ba5649b
RD
4900 """
4901 A size event holds information about size change events. The EVT_SIZE
4902 handler function will be called when the window it is bound to has
4903 been resized.
4904
4905 Note that the size passed is of the whole window: call
4906 `wx.Window.GetClientSize` for the area which may be used by the
4907 application.
4908
4909 When a window is resized, usually only a small part of the window is
4910 damaged and and that area is all that is in the update region for the
4911 next paint event. However, if your drawing depends on the size of the
4912 window, you may need to clear the DC explicitly and repaint the whole
4913 window. In which case, you may need to call `wx.Window.Refresh` to
4914 invalidate the entire window.
4915
4916 """
554f62e9
RD
4917 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4918 __repr__ = _swig_repr
4919 def __init__(self, *args, **kwargs):
5ba5649b
RD
4920 """
4921 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4922
4923 Construct a new ``wx.SizeEvent``.
4924 """
554f62e9 4925 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
d55e5bfc 4926 def GetSize(*args, **kwargs):
5ba5649b
RD
4927 """
4928 GetSize(self) -> Size
4929
4930 Returns the entire size of the window generating the size change
4931 event.
4932 """
d55e5bfc
RD
4933 return _core_.SizeEvent_GetSize(*args, **kwargs)
4934
4935 def GetRect(*args, **kwargs):
4936 """GetRect(self) -> Rect"""
4937 return _core_.SizeEvent_GetRect(*args, **kwargs)
4938
4939 def SetRect(*args, **kwargs):
4940 """SetRect(self, Rect rect)"""
4941 return _core_.SizeEvent_SetRect(*args, **kwargs)
4942
4943 def SetSize(*args, **kwargs):
4944 """SetSize(self, Size size)"""
4945 return _core_.SizeEvent_SetSize(*args, **kwargs)
4946
4947 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4948 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
2131d850 4949_core_.SizeEvent_swigregister(SizeEvent)
d55e5bfc
RD
4950
4951#---------------------------------------------------------------------------
4952
4953class MoveEvent(Event):
5ba5649b
RD
4954 """
4955 This event object is sent for EVT_MOVE event bindings when a window is
4956 moved to a new position.
4957 """
554f62e9
RD
4958 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4959 __repr__ = _swig_repr
4960 def __init__(self, *args, **kwargs):
5ba5649b
RD
4961 """
4962 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
4963
4964 Constructor.
4965 """
554f62e9 4966 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
d55e5bfc 4967 def GetPosition(*args, **kwargs):
5ba5649b
RD
4968 """
4969 GetPosition(self) -> Point
4970
4971 Returns the position of the window generating the move change event.
4972 """
d55e5bfc
RD
4973 return _core_.MoveEvent_GetPosition(*args, **kwargs)
4974
4975 def GetRect(*args, **kwargs):
4976 """GetRect(self) -> Rect"""
4977 return _core_.MoveEvent_GetRect(*args, **kwargs)
4978
4979 def SetRect(*args, **kwargs):
4980 """SetRect(self, Rect rect)"""
4981 return _core_.MoveEvent_SetRect(*args, **kwargs)
4982
4983 def SetPosition(*args, **kwargs):
4984 """SetPosition(self, Point pos)"""
4985 return _core_.MoveEvent_SetPosition(*args, **kwargs)
4986
fef4c27a
RD
4987 m_pos = property(GetPosition, SetPosition)
4988 m_rect = property(GetRect, SetRect)
4989
2131d850 4990_core_.MoveEvent_swigregister(MoveEvent)
d55e5bfc
RD
4991
4992#---------------------------------------------------------------------------
4993
4994class PaintEvent(Event):
5ba5649b
RD
4995 """
4996 A paint event is sent when a window's contents needs to be repainted.
4997 Note that in an EVT_PAINT handler the application must *always* create
4998 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
4999 Windows assumes that the window has not been painted yet and will send
5000 the event again, causing endless refreshes.
5001
5002 You can optimize painting by retrieving the rectangles that have been
5003 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5004 and only repainting these rectangles. The rectangles are in terms of
5005 the client area, and are unscrolled, so you will need to do some
5006 calculations using the current view position to obtain logical,
5007 scrolled units.
5008
5009 """
554f62e9
RD
5010 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5011 __repr__ = _swig_repr
5012 def __init__(self, *args, **kwargs):
d55e5bfc 5013 """__init__(self, int Id=0) -> PaintEvent"""
554f62e9 5014 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5015_core_.PaintEvent_swigregister(PaintEvent)
d55e5bfc
RD
5016
5017class NcPaintEvent(Event):
093d3ff1 5018 """Proxy of C++ NcPaintEvent class"""
554f62e9
RD
5019 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5020 __repr__ = _swig_repr
5021 def __init__(self, *args, **kwargs):
d55e5bfc 5022 """__init__(self, int winid=0) -> NcPaintEvent"""
554f62e9 5023 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5024_core_.NcPaintEvent_swigregister(NcPaintEvent)
d55e5bfc
RD
5025
5026#---------------------------------------------------------------------------
5027
5028class EraseEvent(Event):
5ba5649b
RD
5029 """
5030 An erase event is sent whenever the background of a window needs to be
5031 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5032 binder. On some platforms, such as GTK+, this event is simulated
5033 (simply generated just before the paint event) and may cause flicker.
5034
5035 To paint a custom background use the `GetDC` method and use the returned
5036 device context if it is not ``None``, otherwise create a temporary
5037 `wx.ClientDC` and draw on that.
5038
5039 """
554f62e9
RD
5040 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5041 __repr__ = _swig_repr
5042 def __init__(self, *args, **kwargs):
5ba5649b
RD
5043 """
5044 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5045
5046 Constructor
5047 """
554f62e9 5048 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
d55e5bfc 5049 def GetDC(*args, **kwargs):
5ba5649b
RD
5050 """
5051 GetDC(self) -> DC
5052
5053 Returns the device context the event handler should draw upon. If
5054 ``None`` is returned then create a temporary `wx.ClientDC` and use
5055 that instead.
5056 """
d55e5bfc
RD
5057 return _core_.EraseEvent_GetDC(*args, **kwargs)
5058
2131d850 5059_core_.EraseEvent_swigregister(EraseEvent)
d55e5bfc
RD
5060
5061#---------------------------------------------------------------------------
5062
5063class FocusEvent(Event):
5ba5649b
RD
5064 """
5065 A focus event is sent when a window's focus changes. The window losing
5066 focus receives an EVT_KILL_FOCUS event while the window gaining it
5067 gets an EVT_SET_FOCUS event.
5068
5069 Notice that the set focus event happens both when the user gives focus
5070 to the window (whether using the mouse or keyboard) and when it is
5071 done from the program itself using `wx.Window.SetFocus`.
5072
5073 """
554f62e9
RD
5074 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5075 __repr__ = _swig_repr
5076 def __init__(self, *args, **kwargs):
5ba5649b 5077 """
f460c29d 5078 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5079
5080 Constructor
5081 """
554f62e9 5082 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
d55e5bfc 5083 def GetWindow(*args, **kwargs):
5ba5649b
RD
5084 """
5085 GetWindow(self) -> Window
5086
5087 Returns the other window associated with this event, that is the
5088 window which had the focus before for the EVT_SET_FOCUS event and the
5089 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5090
5091 Warning: the window returned may be None!
5092 """
d55e5bfc
RD
5093 return _core_.FocusEvent_GetWindow(*args, **kwargs)
5094
5095 def SetWindow(*args, **kwargs):
5096 """SetWindow(self, Window win)"""
5097 return _core_.FocusEvent_SetWindow(*args, **kwargs)
5098
2131d850 5099_core_.FocusEvent_swigregister(FocusEvent)
d55e5bfc
RD
5100
5101#---------------------------------------------------------------------------
5102
5103class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5104 """
5105 wx.ChildFocusEvent notifies the parent that a child has received the
5106 focus. Unlike `wx.FocusEvent` it is propagated up the window
5107 heirarchy.
5108 """
554f62e9
RD
5109 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5110 __repr__ = _swig_repr
5111 def __init__(self, *args, **kwargs):
5ba5649b
RD
5112 """
5113 __init__(self, Window win=None) -> ChildFocusEvent
5114
5115 Constructor
5116 """
554f62e9 5117 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
d55e5bfc 5118 def GetWindow(*args, **kwargs):
5ba5649b
RD
5119 """
5120 GetWindow(self) -> Window
5121
5122 The window which has just received the focus.
5123 """
d55e5bfc
RD
5124 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
5125
2131d850 5126_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d55e5bfc
RD
5127
5128#---------------------------------------------------------------------------
5129
5130class ActivateEvent(Event):
5ba5649b
RD
5131 """
5132 An activate event is sent when a top-level window or the entire
5133 application is being activated or deactivated.
5134
5135 A top-level window (a dialog or frame) receives an activate event when
5136 is being activated or deactivated. This is indicated visually by the
5137 title bar changing colour, and a subwindow gaining the keyboard focus.
5138 An application is activated or deactivated when one of its frames
5139 becomes activated, or a frame becomes inactivate resulting in all
5140 application frames being inactive.
5141
5142 Please note that usually you should call event.Skip() in your handlers
5143 for these events so the default handlers will still be called, as not
5144 doing so can result in strange effects.
5145
5146 """
554f62e9
RD
5147 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5148 __repr__ = _swig_repr
5149 def __init__(self, *args, **kwargs):
5ba5649b 5150 """
f460c29d 5151 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5152
5153 Constructor
5154 """
554f62e9 5155 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
d55e5bfc 5156 def GetActive(*args, **kwargs):
5ba5649b
RD
5157 """
5158 GetActive(self) -> bool
5159
5160 Returns true if the application or window is being activated, false
5161 otherwise.
5162 """
d55e5bfc
RD
5163 return _core_.ActivateEvent_GetActive(*args, **kwargs)
5164
2131d850 5165_core_.ActivateEvent_swigregister(ActivateEvent)
d55e5bfc
RD
5166
5167#---------------------------------------------------------------------------
5168
5169class InitDialogEvent(Event):
5ba5649b
RD
5170 """
5171 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5172 any window when `wx.Window.InitDialog` is called. Handlers for this
5173 event can transfer data to the window, or anything else that should be
5174 done before the user begins editing the form. The default handler
5175 calls `wx.Window.TransferDataToWindow`.
5176 """
554f62e9
RD
5177 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5178 __repr__ = _swig_repr
5179 def __init__(self, *args, **kwargs):
5ba5649b
RD
5180 """
5181 __init__(self, int Id=0) -> InitDialogEvent
5182
5183 Constructor
5184 """
554f62e9 5185 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5186_core_.InitDialogEvent_swigregister(InitDialogEvent)
d55e5bfc
RD
5187
5188#---------------------------------------------------------------------------
5189
5190class MenuEvent(Event):
5ba5649b
RD
5191 """
5192 This class is used for a variety of menu-related events. Note that
5193 these do not include menu command events, which are handled by sending
5194 `wx.CommandEvent` objects.
5195
5196 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5197 text in the first field of the status bar.
5198 """
554f62e9
RD
5199 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5200 __repr__ = _swig_repr
5201 def __init__(self, *args, **kwargs):
5ba5649b 5202 """
f460c29d 5203 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5204
5205 Constructor
5206 """
554f62e9 5207 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
d55e5bfc 5208 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5209 """
5210 GetMenuId(self) -> int
5211
5212 Returns the menu identifier associated with the event. This method
5213 should be only used with the HIGHLIGHT events.
5214 """
d55e5bfc
RD
5215 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
5216
5217 def IsPopup(*args, **kwargs):
5ba5649b
RD
5218 """
5219 IsPopup(self) -> bool
5220
5221 Returns ``True`` if the menu which is being opened or closed is a
5222 popup menu, ``False`` if it is a normal one. This method should only
5223 be used with the OPEN and CLOSE events.
5224 """
d55e5bfc
RD
5225 return _core_.MenuEvent_IsPopup(*args, **kwargs)
5226
5227 def GetMenu(*args, **kwargs):
5ba5649b
RD
5228 """
5229 GetMenu(self) -> Menu
5230
5231 Returns the menu which is being opened or closed. This method should
5232 only be used with the OPEN and CLOSE events.
5233 """
d55e5bfc
RD
5234 return _core_.MenuEvent_GetMenu(*args, **kwargs)
5235
2131d850 5236_core_.MenuEvent_swigregister(MenuEvent)
d55e5bfc
RD
5237
5238#---------------------------------------------------------------------------
5239
5240class CloseEvent(Event):
5ba5649b
RD
5241 """
5242 This event class contains information about window and session close
5243 events.
5244
5245 The handler function for EVT_CLOSE is called when the user has tried
5246 to close a a frame or dialog box using the window manager controls or
5247 the system menu. It can also be invoked by the application itself
5248 programmatically, for example by calling the `wx.Window.Close`
5249 function.
5250
5251 You should check whether the application is forcing the deletion of
5252 the window using `CanVeto`. If it returns ``False``, you must destroy
5253 the window using `wx.Window.Destroy`. If the return value is ``True``,
5254 it is up to you whether you respond by destroying the window or not.
5255 For example you may wish to display a message dialog prompting to save
5256 files or to cancel the close.
5257
5258 If you don't destroy the window, you should call `Veto` to let the
5259 calling code know that you did not destroy the window. This allows the
5260 `wx.Window.Close` function to return ``True`` or ``False`` depending
5261 on whether the close instruction was honored or not.
5262 """
554f62e9
RD
5263 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5264 __repr__ = _swig_repr
5265 def __init__(self, *args, **kwargs):
5ba5649b 5266 """
f460c29d 5267 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5268
5269 Constructor.
5270 """
554f62e9 5271 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
d55e5bfc 5272 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5273 """
5274 SetLoggingOff(self, bool logOff)
5275
5276 Sets the 'logging off' flag.
5277 """
d55e5bfc
RD
5278 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
5279
5280 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5281 """
5282 GetLoggingOff(self) -> bool
5283
034e3677
RD
5284 Returns ``True`` if the user is logging off or ``False`` if the
5285 system is shutting down. This method can only be called for end
5286 session and query end session events, it doesn't make sense for close
5287 window event.
5ba5649b 5288 """
d55e5bfc
RD
5289 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
5290
5291 def Veto(*args, **kwargs):
5ba5649b
RD
5292 """
5293 Veto(self, bool veto=True)
5294
5295 Call this from your event handler to veto a system shutdown or to
5296 signal to the calling application that a window close did not happen.
5297
5298 You can only veto a shutdown or close if `CanVeto` returns true.
5299 """
d55e5bfc
RD
5300 return _core_.CloseEvent_Veto(*args, **kwargs)
5301
5ba5649b
RD
5302 def GetVeto(*args, **kwargs):
5303 """GetVeto(self) -> bool"""
5304 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5305
d55e5bfc 5306 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5307 """
5308 SetCanVeto(self, bool canVeto)
5309
5310 Sets the 'can veto' flag.
5311 """
d55e5bfc
RD
5312 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
5313
5314 def CanVeto(*args, **kwargs):
5ba5649b
RD
5315 """
5316 CanVeto(self) -> bool
d55e5bfc 5317
5ba5649b
RD
5318 Returns true if you can veto a system shutdown or a window close
5319 event. Vetoing a window close event is not possible if the calling
5320 code wishes to force the application to exit, and so this function
5321 must be called to check this.
5322 """
5323 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc 5324
2131d850 5325_core_.CloseEvent_swigregister(CloseEvent)
d55e5bfc
RD
5326
5327#---------------------------------------------------------------------------
5328
5329class ShowEvent(Event):
5ba5649b 5330 """An EVT_SHOW event is sent when a window is shown or hidden."""
554f62e9
RD
5331 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5332 __repr__ = _swig_repr
5333 def __init__(self, *args, **kwargs):
5ba5649b
RD
5334 """
5335 __init__(self, int winid=0, bool show=False) -> ShowEvent
5336
5337 An EVT_SHOW event is sent when a window is shown or hidden.
5338 """
554f62e9 5339 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
d55e5bfc
RD
5340 def SetShow(*args, **kwargs):
5341 """SetShow(self, bool show)"""
5342 return _core_.ShowEvent_SetShow(*args, **kwargs)
5343
5344 def GetShow(*args, **kwargs):
5345 """GetShow(self) -> bool"""
5346 return _core_.ShowEvent_GetShow(*args, **kwargs)
5347
2131d850 5348_core_.ShowEvent_swigregister(ShowEvent)
d55e5bfc
RD
5349
5350#---------------------------------------------------------------------------
5351
5352class IconizeEvent(Event):
5ba5649b
RD
5353 """
5354 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5355 restored.
5356 """
554f62e9
RD
5357 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5358 __repr__ = _swig_repr
5359 def __init__(self, *args, **kwargs):
5ba5649b
RD
5360 """
5361 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5362
5363 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5364 restored.
5365 """
554f62e9 5366 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
d55e5bfc 5367 def Iconized(*args, **kwargs):
5ba5649b
RD
5368 """
5369 Iconized(self) -> bool
5370
5371 Returns ``True`` if the frame has been iconized, ``False`` if it has
5372 been restored.
5373 """
d55e5bfc
RD
5374 return _core_.IconizeEvent_Iconized(*args, **kwargs)
5375
2131d850 5376_core_.IconizeEvent_swigregister(IconizeEvent)
d55e5bfc
RD
5377
5378#---------------------------------------------------------------------------
5379
5380class MaximizeEvent(Event):
5ba5649b 5381 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
554f62e9
RD
5382 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5383 __repr__ = _swig_repr
5384 def __init__(self, *args, **kwargs):
5ba5649b
RD
5385 """
5386 __init__(self, int id=0) -> MaximizeEvent
5387
5388 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5389 """
554f62e9 5390 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5391_core_.MaximizeEvent_swigregister(MaximizeEvent)
d55e5bfc
RD
5392
5393#---------------------------------------------------------------------------
5394
5395class DropFilesEvent(Event):
5ba5649b
RD
5396 """
5397 This class is used for drop files events, that is, when files have
5398 been dropped onto the window. This functionality is only available
5399 under Windows. The window must have previously been enabled for
5400 dropping by calling `wx.Window.DragAcceptFiles`.
5401
5402 Important note: this is a separate implementation to the more general
5403 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5404 implementation uses the older, Windows message-based approach of
5405 dropping files.
5406
5407 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5408 events.
5409
5410 """
554f62e9
RD
5411 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5412 def __init__(self): raise AttributeError, "No constructor defined"
5413 __repr__ = _swig_repr
d55e5bfc 5414 def GetPosition(*args, **kwargs):
5ba5649b
RD
5415 """
5416 GetPosition(self) -> Point
5417
5418 Returns the position at which the files were dropped.
5419 """
d55e5bfc
RD
5420 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
5421
5422 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5423 """
5424 GetNumberOfFiles(self) -> int
5425
5426 Returns the number of files dropped.
5427 """
d55e5bfc
RD
5428 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
5429
5430 def GetFiles(*args, **kwargs):
5ba5649b
RD
5431 """
5432 GetFiles(self) -> PyObject
5433
5434 Returns a list of the filenames that were dropped.
5435 """
d55e5bfc
RD
5436 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
5437
2131d850 5438_core_.DropFilesEvent_swigregister(DropFilesEvent)
d55e5bfc
RD
5439
5440#---------------------------------------------------------------------------
5441
5442UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5443UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5444class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5445 """
5446 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5447 wxWidgets to give an application the chance to update various user
5448 interface elements.
5449
5450 Without update UI events, an application has to work hard to
5451 check/uncheck, enable/disable, and set the text for elements such as
5452 menu items and toolbar buttons. The code for doing this has to be
5453 mixed up with the code that is invoked when an action is invoked for a
5454 menu item or button.
5455
5456 With update UI events, you define an event handler to look at the
5457 state of the application and change UI elements accordingly. wxWidgets
5458 will call your handler functions in idle time, so you don't have to
5459 worry where to call this code. In addition to being a clearer and more
5460 declarative method, it also means you don't have to worry whether
5461 you're updating a toolbar or menubar identifier. The same handler can
5462 update a menu item and toolbar button, if the ID values are the same.
5463
5464 Instead of directly manipulating the menu or button, you call
5465 functions in the event object, such as `Check`. wxWidgets will
5466 determine whether such a call has been made, and which UI element to
5467 update.
5468
5469 These events will work for popup menus as well as menubars. Just
5470 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5471 any UI events for the window that owns the menu.
5472
5473 If you find that the overhead of UI update processing is affecting
5474 your application, you can do one or both of the following:
5475
5476 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5477 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5478 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5479 receive update events. No other windows will receive update
5480 events.
5481
5482 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5483 value to set the delay between updates. You may need to call
5484 `wx.Window.UpdateWindowUI` at critical points, for example when
5485 a dialog is about to be shown, in case the user sees a slight
5486 delay before windows are updated.
5487
5488 Note that although events are sent in idle time, defining a EVT_IDLE
5489 handler for a window does not affect this because the events are sent
5490 from an internal idle handler.
5491
5492 wxWidgets tries to optimize update events on some platforms. On
5493 Windows and GTK+, events for menubar items are only sent when the menu
5494 is about to be shown, and not in idle time.
5495
5496 """
554f62e9
RD
5497 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5498 __repr__ = _swig_repr
5499 def __init__(self, *args, **kwargs):
5ba5649b
RD
5500 """
5501 __init__(self, int commandId=0) -> UpdateUIEvent
5502
5503 Constructor
5504 """
554f62e9 5505 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
d55e5bfc 5506 def GetChecked(*args, **kwargs):
5ba5649b
RD
5507 """
5508 GetChecked(self) -> bool
5509
5510 Returns ``True`` if the UI element should be checked.
5511 """
d55e5bfc
RD
5512 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
5513
5514 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5515 """
5516 GetEnabled(self) -> bool
5517
5518 Returns ``True`` if the UI element should be enabled.
5519 """
d55e5bfc
RD
5520 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
5521
554f62e9
RD
5522 def GetShown(*args, **kwargs):
5523 """
5524 GetShown(self) -> bool
5525
5526 Returns ``True`` if the UI element should be shown.
5527 """
5528 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5529
d55e5bfc 5530 def GetText(*args, **kwargs):
5ba5649b
RD
5531 """
5532 GetText(self) -> String
5533
5534 Returns the text that should be set for the UI element.
5535 """
d55e5bfc
RD
5536 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
5537
5538 def GetSetText(*args, **kwargs):
5ba5649b
RD
5539 """
5540 GetSetText(self) -> bool
5541
5542 Returns ``True`` if the application has called `SetText`. For
5543 wxWidgets internal use only.
5544 """
d55e5bfc
RD
5545 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
5546
5547 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5548 """
5549 GetSetChecked(self) -> bool
5550
5551 Returns ``True`` if the application has called `Check`. For wxWidgets
5552 internal use only.
5553 """
d55e5bfc
RD
5554 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
5555
5556 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5557 """
5558 GetSetEnabled(self) -> bool
5559
5560 Returns ``True`` if the application has called `Enable`. For wxWidgets
5561 internal use only.
5562 """
d55e5bfc
RD
5563 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
5564
554f62e9
RD
5565 def GetSetShown(*args, **kwargs):
5566 """
5567 GetSetShown(self) -> bool
5568
5569 Returns ``True`` if the application has called `Show`. For wxWidgets
5570 internal use only.
5571 """
5572 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5573
d55e5bfc 5574 def Check(*args, **kwargs):
5ba5649b
RD
5575 """
5576 Check(self, bool check)
5577
5578 Check or uncheck the UI element.
5579 """
d55e5bfc
RD
5580 return _core_.UpdateUIEvent_Check(*args, **kwargs)
5581
5582 def Enable(*args, **kwargs):
5ba5649b
RD
5583 """
5584 Enable(self, bool enable)
5585
5586 Enable or disable the UI element.
5587 """
d55e5bfc
RD
5588 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
5589
554f62e9
RD
5590 def Show(*args, **kwargs):
5591 """
5592 Show(self, bool show)
5593
5594 Show or hide the UI element.
5595 """
5596 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5597
d55e5bfc 5598 def SetText(*args, **kwargs):
5ba5649b
RD
5599 """
5600 SetText(self, String text)
5601
5602 Sets the text for this UI element.
5603 """
d55e5bfc
RD
5604 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
5605
5606 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5607 """
5608 SetUpdateInterval(long updateInterval)
5609
5610 Sets the interval between updates in milliseconds. Set to -1 to
5611 disable updates, or to 0 to update as frequently as possible. The
5612 default is 0.
5613
5614 Use this to reduce the overhead of UI update events if your
5615 application has a lot of windows. If you set the value to -1 or
5616 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5617 at appropriate points in your application, such as when a dialog is
5618 about to be shown.
5619 """
d55e5bfc
RD
5620 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
5621
5622 SetUpdateInterval = staticmethod(SetUpdateInterval)
5623 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5624 """
5625 GetUpdateInterval() -> long
5626
5627 Returns the current interval between updates in milliseconds. -1
5628 disables updates, 0 updates as frequently as possible.
5629 """
d55e5bfc
RD
5630 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
5631
5632 GetUpdateInterval = staticmethod(GetUpdateInterval)
5633 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5634 """
5635 CanUpdate(Window win) -> bool
5636
5637 Returns ``True`` if it is appropriate to update (send UI update events
5638 to) this window.
5639
5640 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5641 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5642 events were last sent in idle time, and the update interval, to
5643 determine whether events should be sent to this window now. By default
5644 this will always return true because the update mode is initially
5645 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5646 events will be sent as often as possible. You can reduce the frequency
5647 that events are sent by changing the mode and/or setting an update
5648 interval.
5649
5650 """
d55e5bfc
RD
5651 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
5652
5653 CanUpdate = staticmethod(CanUpdate)
5654 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5655 """
5656 ResetUpdateTime()
5657
5658 Used internally to reset the last-updated time to the current time. It
5659 is assumed that update events are normally sent in idle time, so this
5660 is called at the end of idle processing.
5661 """
d55e5bfc
RD
5662 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
5663
5664 ResetUpdateTime = staticmethod(ResetUpdateTime)
5665 def SetMode(*args, **kwargs):
5ba5649b
RD
5666 """
5667 SetMode(int mode)
5668
5669 Specify how wxWidgets will send update events: to all windows, or only
5670 to those which specify that they will process the events.
5671
5672 The mode may be one of the following values:
5673
5674 ============================= ==========================================
5675 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5676 is the default setting.
5677 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5678 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5679 style set.
5680 ============================= ==========================================
5681
5682 """
d55e5bfc
RD
5683 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
5684
5685 SetMode = staticmethod(SetMode)
5686 def GetMode(*args, **kwargs):
5ba5649b
RD
5687 """
5688 GetMode() -> int
5689
5690 Returns a value specifying how wxWidgets will send update events: to
5691 all windows, or only to those which specify that they will process the
5692 events.
5693 """
d55e5bfc
RD
5694 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
5695
5696 GetMode = staticmethod(GetMode)
2131d850 5697_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d55e5bfc
RD
5698
5699def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
554f62e9 5700 """
5ba5649b
RD
5701 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5702
5703 Sets the interval between updates in milliseconds. Set to -1 to
5704 disable updates, or to 0 to update as frequently as possible. The
5705 default is 0.
5706
5707 Use this to reduce the overhead of UI update events if your
5708 application has a lot of windows. If you set the value to -1 or
5709 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5710 at appropriate points in your application, such as when a dialog is
5711 about to be shown.
5712 """
554f62e9 5713 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 5714
554f62e9
RD
5715def UpdateUIEvent_GetUpdateInterval(*args):
5716 """
5ba5649b
RD
5717 UpdateUIEvent_GetUpdateInterval() -> long
5718
5719 Returns the current interval between updates in milliseconds. -1
5720 disables updates, 0 updates as frequently as possible.
5721 """
554f62e9 5722 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d55e5bfc
RD
5723
5724def UpdateUIEvent_CanUpdate(*args, **kwargs):
554f62e9 5725 """
5ba5649b
RD
5726 UpdateUIEvent_CanUpdate(Window win) -> bool
5727
5728 Returns ``True`` if it is appropriate to update (send UI update events
5729 to) this window.
5730
5731 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5732 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5733 events were last sent in idle time, and the update interval, to
5734 determine whether events should be sent to this window now. By default
5735 this will always return true because the update mode is initially
5736 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5737 events will be sent as often as possible. You can reduce the frequency
5738 that events are sent by changing the mode and/or setting an update
5739 interval.
5740
5741 """
554f62e9 5742 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 5743
554f62e9
RD
5744def UpdateUIEvent_ResetUpdateTime(*args):
5745 """
5ba5649b
RD
5746 UpdateUIEvent_ResetUpdateTime()
5747
5748 Used internally to reset the last-updated time to the current time. It
5749 is assumed that update events are normally sent in idle time, so this
5750 is called at the end of idle processing.
5751 """
554f62e9 5752 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d55e5bfc
RD
5753
5754def UpdateUIEvent_SetMode(*args, **kwargs):
554f62e9 5755 """
5ba5649b
RD
5756 UpdateUIEvent_SetMode(int mode)
5757
5758 Specify how wxWidgets will send update events: to all windows, or only
5759 to those which specify that they will process the events.
5760
5761 The mode may be one of the following values:
5762
5763 ============================= ==========================================
5764 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5765 is the default setting.
5766 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5767 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5768 style set.
5769 ============================= ==========================================
5770
5771 """
554f62e9 5772 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 5773
554f62e9
RD
5774def UpdateUIEvent_GetMode(*args):
5775 """
5ba5649b
RD
5776 UpdateUIEvent_GetMode() -> int
5777
5778 Returns a value specifying how wxWidgets will send update events: to
5779 all windows, or only to those which specify that they will process the
5780 events.
5781 """
554f62e9 5782 return _core_.UpdateUIEvent_GetMode(*args)
d55e5bfc
RD
5783
5784#---------------------------------------------------------------------------
5785
5786class SysColourChangedEvent(Event):
5ba5649b
RD
5787 """
5788 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5789 when the user changes the colour settings using the control
5790 panel. This is only applicable under Windows.
5791
5792 The default event handler for this event propagates the event to child
5793 windows, since Windows only sends the events to top-level windows. If
5794 intercepting this event for a top-level window, remember to call
5795 `Skip` so the the base class handler will still be executed, or to
5796 pass the event on to the window's children explicitly.
5797
5798 """
554f62e9
RD
5799 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5800 __repr__ = _swig_repr
5801 def __init__(self, *args, **kwargs):
5ba5649b
RD
5802 """
5803 __init__(self) -> SysColourChangedEvent
5804
5805 Constructor
5806 """
554f62e9 5807 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 5808_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d55e5bfc
RD
5809
5810#---------------------------------------------------------------------------
5811
5812class MouseCaptureChangedEvent(Event):
5ba5649b
RD
5813 """
5814 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5815 a window that loses its mouse capture. This is called even if
5816 `wx.Window.ReleaseMouse` was called by the application code. Handling
5817 this event allows an application to cater for unexpected capture
5818 releases which might otherwise confuse mouse handling code.
5819
5820 This event is implemented under Windows only.
5821 """
554f62e9
RD
5822 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5823 __repr__ = _swig_repr
5824 def __init__(self, *args, **kwargs):
5ba5649b
RD
5825 """
5826 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5827
5828 Constructor
5829 """
554f62e9 5830 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
d55e5bfc 5831 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
5832 """
5833 GetCapturedWindow(self) -> Window
5834
5835 Returns the window that gained the capture, or ``None`` if it was a
5836 non-wxWidgets window.
5837 """
d55e5bfc
RD
5838 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
5839
2131d850 5840_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d55e5bfc
RD
5841
5842#---------------------------------------------------------------------------
5843
5844class DisplayChangedEvent(Event):
5ba5649b
RD
5845 """
5846 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5847 resolution has changed.
5848
5849 This event is implemented under Windows only.
5850 """
554f62e9
RD
5851 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5852 __repr__ = _swig_repr
5853 def __init__(self, *args, **kwargs):
d55e5bfc 5854 """__init__(self) -> DisplayChangedEvent"""
554f62e9 5855 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 5856_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d55e5bfc
RD
5857
5858#---------------------------------------------------------------------------
5859
5860class PaletteChangedEvent(Event):
5ba5649b
RD
5861 """
5862 An EVT_PALETTE_CHANGED event is sent when the system palette has
5863 changed, thereby giving each window a chance to redo their own to
5864 match.
5865
5866 This event is implemented under Windows only.
5867 """
554f62e9
RD
5868 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5869 __repr__ = _swig_repr
5870 def __init__(self, *args, **kwargs):
5ba5649b
RD
5871 """
5872 __init__(self, int id=0) -> PaletteChangedEvent
5873
5874 An EVT_PALETTE_CHANGED event is sent when the system palette has
5875 changed, thereby giving each window a chance to redo their own to
5876 match.
5877
5878 This event is implemented under Windows only.
5879 """
554f62e9 5880 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
d55e5bfc
RD
5881 def SetChangedWindow(*args, **kwargs):
5882 """SetChangedWindow(self, Window win)"""
5883 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
5884
5885 def GetChangedWindow(*args, **kwargs):
5886 """GetChangedWindow(self) -> Window"""
5887 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
5888
2131d850 5889_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d55e5bfc
RD
5890
5891#---------------------------------------------------------------------------
5892
5893class QueryNewPaletteEvent(Event):
5ba5649b
RD
5894 """
5895 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5896 focus and should re-do its palette.
5897
5898 This event is implemented under Windows only.
5899 """
554f62e9
RD
5900 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5901 __repr__ = _swig_repr
5902 def __init__(self, *args, **kwargs):
5ba5649b
RD
5903 """
5904 __init__(self, int winid=0) -> QueryNewPaletteEvent
5905
5906 Constructor.
5907 """
554f62e9 5908 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
d55e5bfc 5909 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
5910 """
5911 SetPaletteRealized(self, bool realized)
5912
5913 App should set this if it changes the palette.
5914 """
d55e5bfc
RD
5915 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
5916
5917 def GetPaletteRealized(*args, **kwargs):
5918 """GetPaletteRealized(self) -> bool"""
5919 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
5920
2131d850 5921_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d55e5bfc
RD
5922
5923#---------------------------------------------------------------------------
5924
5925class NavigationKeyEvent(Event):
5ba5649b
RD
5926 """
5927 EVT_NAVIGATION_KEY events are used to control moving the focus between
5928 widgets, otherwise known as tab-traversal. You woudl normally not
5929 catch navigation events in applications as there are already
5930 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5931 it useful to send navigation events in certain situations to change
5932 the focus in certain ways, although it's probably easier to just call
5933 `wx.Window.Navigate`.
5934 """
554f62e9
RD
5935 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5936 __repr__ = _swig_repr
5937 def __init__(self, *args, **kwargs):
d55e5bfc 5938 """__init__(self) -> NavigationKeyEvent"""
554f62e9 5939 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
d55e5bfc 5940 def GetDirection(*args, **kwargs):
5ba5649b
RD
5941 """
5942 GetDirection(self) -> bool
5943
5944 Returns ``True`` if the direction is forward, ``False`` otherwise.
5945 """
d55e5bfc
RD
5946 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
5947
5948 def SetDirection(*args, **kwargs):
5ba5649b
RD
5949 """
5950 SetDirection(self, bool forward)
5951
5952 Specify the direction that the navigation should take. Usually the
5953 difference between using Tab and Shift-Tab.
5954 """
d55e5bfc
RD
5955 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
5956
5957 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
5958 """
5959 IsWindowChange(self) -> bool
5960
5961 Returns ``True`` if window change is allowed.
5962 """
d55e5bfc
RD
5963 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
5964
5965 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
5966 """
5967 SetWindowChange(self, bool ischange)
5968
5969 Specify if the navigation should be able to change parent windows.
5970 For example, changing notebook pages, etc. This is usually implemented
5971 by using Control-Tab.
5972 """
d55e5bfc
RD
5973 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
5974
68350608 5975 def IsFromTab(*args, **kwargs):
5ba5649b
RD
5976 """
5977 IsFromTab(self) -> bool
5978
5979 Returns ``True`` if the navigation event is originated from the Tab
5980 key.
5981 """
68350608
RD
5982 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
5983
5984 def SetFromTab(*args, **kwargs):
5ba5649b
RD
5985 """
5986 SetFromTab(self, bool bIs)
5987
5988 Set to true under MSW if the event was generated using the tab key.
5989 This is required for proper navogation over radio buttons.
5990 """
68350608
RD
5991 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
5992
908b74cd 5993 def SetFlags(*args, **kwargs):
5ba5649b
RD
5994 """
5995 SetFlags(self, long flags)
5996
5997 Set the navigation flags to a combination of the following:
5998
5999 * wx.NavigationKeyEvent.IsBackward
6000 * wx.NavigationKeyEvent.IsForward
6001 * wx.NavigationKeyEvent.WinChange
6002 * wx.NavigationKeyEvent.FromTab
6003
6004 """
908b74cd
RD
6005 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6006
d55e5bfc 6007 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6008 """
6009 GetCurrentFocus(self) -> Window
6010
6011 Returns the child window which currenty has the focus. May be
6012 ``None``.
6013 """
d55e5bfc
RD
6014 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
6015
6016 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6017 """
6018 SetCurrentFocus(self, Window win)
6019
6020 Set the window that has the focus.
6021 """
d55e5bfc
RD
6022 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
6023
b0f7404b 6024 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
6025 IsForward = _core_.NavigationKeyEvent_IsForward
6026 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 6027 FromTab = _core_.NavigationKeyEvent_FromTab
2131d850 6028_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d55e5bfc
RD
6029
6030#---------------------------------------------------------------------------
6031
6032class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6033 """
6034 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6035 underlying GUI object) exists.
6036 """
554f62e9
RD
6037 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6038 __repr__ = _swig_repr
6039 def __init__(self, *args, **kwargs):
5ba5649b
RD
6040 """
6041 __init__(self, Window win=None) -> WindowCreateEvent
6042
6043 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6044 underlying GUI object) exists.
6045 """
554f62e9 6046 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
d55e5bfc 6047 def GetWindow(*args, **kwargs):
5ba5649b
RD
6048 """
6049 GetWindow(self) -> Window
6050
6051 Returns the window that this event refers to.
6052 """
d55e5bfc
RD
6053 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
6054
2131d850 6055_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d55e5bfc
RD
6056
6057class WindowDestroyEvent(CommandEvent):
5ba5649b 6058 """
9d7dfdff
RD
6059 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6060 when the GUI window is destroyed.
6061
6062 When a class derived from `wx.Window` is destroyed its destructor will
6063 have already run by the time this event is sent. Therefore this event
6064 will not usually be received at all by the window itself. Since it is
6065 received after the destructor has run, an object should not try to
6066 handle its own wx.WindowDestroyEvent, but it can be used to get
6067 notification of the destruction of another window.
5ba5649b 6068 """
554f62e9
RD
6069 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6070 __repr__ = _swig_repr
6071 def __init__(self, *args, **kwargs):
5ba5649b
RD
6072 """
6073 __init__(self, Window win=None) -> WindowDestroyEvent
6074
9d7dfdff
RD
6075 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6076 when the GUI window is destroyed.
6077
6078 When a class derived from `wx.Window` is destroyed its destructor will
6079 have already run by the time this event is sent. Therefore this event
6080 will not usually be received at all by the window itself. Since it is
6081 received after the destructor has run, an object should not try to
6082 handle its own wx.WindowDestroyEvent, but it can be used to get
6083 notification of the destruction of another window.
5ba5649b 6084 """
554f62e9 6085 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
d55e5bfc 6086 def GetWindow(*args, **kwargs):
5ba5649b
RD
6087 """
6088 GetWindow(self) -> Window
6089
6090 Returns the window that this event refers to.
6091 """
d55e5bfc
RD
6092 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
6093
2131d850 6094_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d55e5bfc
RD
6095
6096#---------------------------------------------------------------------------
6097
6098class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6099 """
6100 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6101 give the application a chance to show a context (popup) menu.
6102 """
554f62e9
RD
6103 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6104 __repr__ = _swig_repr
6105 def __init__(self, *args, **kwargs):
5ba5649b 6106 """
f460c29d 6107 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6108
6109 Constructor.
6110 """
554f62e9 6111 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
d55e5bfc 6112 def GetPosition(*args, **kwargs):
5ba5649b
RD
6113 """
6114 GetPosition(self) -> Point
6115
6116 Returns the position (in screen coordinants) at which the menu should
6117 be shown.
6118 """
d55e5bfc
RD
6119 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
6120
6121 def SetPosition(*args, **kwargs):
5ba5649b
RD
6122 """
6123 SetPosition(self, Point pos)
6124
6125 Sets the position at which the menu should be shown.
6126 """
d55e5bfc
RD
6127 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
6128
2131d850 6129_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d55e5bfc
RD
6130
6131#---------------------------------------------------------------------------
6132
6133IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6134IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6135class IdleEvent(Event):
5ba5649b
RD
6136 """
6137 This class is used for EVT_IDLE events, which are generated and sent
6138 when the application *becomes* idle. In other words, the when the
6139 event queue becomes empty then idle events are sent to all windows (by
6140 default) and as long as none of them call `RequestMore` then there are
6141 no more idle events until after the system event queue has some normal
6142 events and then becomes empty again.
6143
6144 By default, idle events are sent to all windows. If this is causing a
6145 significant overhead in your application, you can call
6146 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6147 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6148 which should receive idle events. Then idle events will only be sent
6149 to those windows and not to any others.
6150 """
554f62e9
RD
6151 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6152 __repr__ = _swig_repr
6153 def __init__(self, *args, **kwargs):
5ba5649b
RD
6154 """
6155 __init__(self) -> IdleEvent
6156
6157 Constructor
6158 """
554f62e9 6159 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
d55e5bfc 6160 def RequestMore(*args, **kwargs):
5ba5649b
RD
6161 """
6162 RequestMore(self, bool needMore=True)
6163
6164 Tells wxWidgets that more processing is required. This function can be
6165 called by an EVT_IDLE handler for a window to indicate that the
6166 application should forward the EVT_IDLE event once more to the
6167 application windows. If no window calls this function during its
6168 EVT_IDLE handler, then the application will remain in a passive event
6169 loop until a new event is posted to the application by the windowing
6170 system.
6171 """
d55e5bfc
RD
6172 return _core_.IdleEvent_RequestMore(*args, **kwargs)
6173
6174 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6175 """
6176 MoreRequested(self) -> bool
6177
6178 Returns ``True`` if the OnIdle function processing this event
6179 requested more processing time.
6180 """
d55e5bfc
RD
6181 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
6182
6183 def SetMode(*args, **kwargs):
5ba5649b
RD
6184 """
6185 SetMode(int mode)
6186
6187 Static method for specifying how wxWidgets will send idle events: to
6188 all windows, or only to those which specify that they will process the
6189 events.
6190
6191 The mode can be one of the following values:
6192
6193 ========================= ========================================
6194 wx.IDLE_PROCESS_ALL Send idle events to all windows
6195 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6196 the wx.WS_EX_PROCESS_IDLE extra style
6197 flag set.
6198 ========================= ========================================
6199
6200 """
d55e5bfc
RD
6201 return _core_.IdleEvent_SetMode(*args, **kwargs)
6202
6203 SetMode = staticmethod(SetMode)
6204 def GetMode(*args, **kwargs):
5ba5649b
RD
6205 """
6206 GetMode() -> int
6207
6208 Static method returning a value specifying how wxWidgets will send
6209 idle events: to all windows, or only to those which specify that they
6210 will process the events.
6211 """
d55e5bfc
RD
6212 return _core_.IdleEvent_GetMode(*args, **kwargs)
6213
6214 GetMode = staticmethod(GetMode)
6215 def CanSend(*args, **kwargs):
5ba5649b
RD
6216 """
6217 CanSend(Window win) -> bool
6218
6219 Returns ``True`` if it is appropriate to send idle events to this
6220 window.
6221
6222 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6223 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6224 events should be sent to this window now. By default this will always
6225 return ``True`` because the update mode is initially
6226 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6227 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6228 """
d55e5bfc
RD
6229 return _core_.IdleEvent_CanSend(*args, **kwargs)
6230
6231 CanSend = staticmethod(CanSend)
2131d850 6232_core_.IdleEvent_swigregister(IdleEvent)
d55e5bfc
RD
6233
6234def IdleEvent_SetMode(*args, **kwargs):
554f62e9 6235 """
5ba5649b
RD
6236 IdleEvent_SetMode(int mode)
6237
6238 Static method for specifying how wxWidgets will send idle events: to
6239 all windows, or only to those which specify that they will process the
6240 events.
6241
6242 The mode can be one of the following values:
6243
6244 ========================= ========================================
6245 wx.IDLE_PROCESS_ALL Send idle events to all windows
6246 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6247 the wx.WS_EX_PROCESS_IDLE extra style
6248 flag set.
6249 ========================= ========================================
6250
6251 """
554f62e9 6252 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6253
554f62e9
RD
6254def IdleEvent_GetMode(*args):
6255 """
5ba5649b
RD
6256 IdleEvent_GetMode() -> int
6257
6258 Static method returning a value specifying how wxWidgets will send
6259 idle events: to all windows, or only to those which specify that they
6260 will process the events.
6261 """
554f62e9 6262 return _core_.IdleEvent_GetMode(*args)
d55e5bfc
RD
6263
6264def IdleEvent_CanSend(*args, **kwargs):
554f62e9 6265 """
5ba5649b
RD
6266 IdleEvent_CanSend(Window win) -> bool
6267
6268 Returns ``True`` if it is appropriate to send idle events to this
6269 window.
6270
6271 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6272 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6273 events should be sent to this window now. By default this will always
6274 return ``True`` because the update mode is initially
6275 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6276 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6277 """
554f62e9 6278 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6279
6280#---------------------------------------------------------------------------
6281
2131d850
RD
6282class ClipboardTextEvent(CommandEvent):
6283 """
6284 A Clipboard Text event is sent when a window intercepts a text
6285 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6286 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6287 popup menu command, etc. NOTE : under windows these events are *NOT*
6288 generated automatically for a Rich Edit text control.
6289 """
6290 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6291 __repr__ = _swig_repr
6292 def __init__(self, *args, **kwargs):
6293 """
6294 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6295
6296 A Clipboard Text event is sent when a window intercepts a text
6297 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6298 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6299 popup menu command, etc. NOTE : under windows these events are *NOT*
6300 generated automatically for a Rich Edit text control.
6301 """
6302 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6303_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6304
6305#---------------------------------------------------------------------------
6306
d55e5bfc 6307class PyEvent(Event):
5ba5649b
RD
6308 """
6309 wx.PyEvent can be used as a base class for implementing custom event
6310 types in Python. You should derived from this class instead of
6311 `wx.Event` because this class is Python-aware and is able to transport
6312 its Python bits safely through the wxWidgets event system and have
6313 them still be there when the event handler is invoked.
6314
6315 :see: `wx.PyCommandEvent`
6316
6317 """
554f62e9
RD
6318 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6319 __repr__ = _swig_repr
6320 def __init__(self, *args, **kwargs):
f460c29d 6321 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
554f62e9 6322 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6323 self._SetSelf(self)
d55e5bfc 6324
554f62e9
RD
6325 __swig_destroy__ = _core_.delete_PyEvent
6326 __del__ = lambda self : None;
5ba5649b
RD
6327 def _SetSelf(*args, **kwargs):
6328 """_SetSelf(self, PyObject self)"""
6329 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6330
5ba5649b
RD
6331 def _GetSelf(*args, **kwargs):
6332 """_GetSelf(self) -> PyObject"""
6333 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc 6334
2131d850 6335_core_.PyEvent_swigregister(PyEvent)
d55e5bfc
RD
6336
6337class PyCommandEvent(CommandEvent):
5ba5649b
RD
6338 """
6339 wx.PyCommandEvent can be used as a base class for implementing custom
6340 event types in Python, where the event shoudl travel up to parent
6341 windows looking for a handler. You should derived from this class
6342 instead of `wx.CommandEvent` because this class is Python-aware and is
6343 able to transport its Python bits safely through the wxWidgets event
6344 system and have them still be there when the event handler is invoked.
6345
6346 :see: `wx.PyEvent`
6347
6348 """
554f62e9
RD
6349 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6350 __repr__ = _swig_repr
6351 def __init__(self, *args, **kwargs):
f460c29d 6352 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
554f62e9 6353 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6354 self._SetSelf(self)
d55e5bfc 6355
554f62e9
RD
6356 __swig_destroy__ = _core_.delete_PyCommandEvent
6357 __del__ = lambda self : None;
5ba5649b
RD
6358 def _SetSelf(*args, **kwargs):
6359 """_SetSelf(self, PyObject self)"""
6360 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6361
5ba5649b
RD
6362 def _GetSelf(*args, **kwargs):
6363 """_GetSelf(self) -> PyObject"""
6364 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc 6365
2131d850 6366_core_.PyCommandEvent_swigregister(PyCommandEvent)
d55e5bfc 6367
53aa7709 6368class DateEvent(CommandEvent):
5ba5649b
RD
6369 """
6370 This event class holds information about a date change event and is
6371 used together with `wx.DatePickerCtrl`. It also serves as a base class
6372 for `wx.calendar.CalendarEvent`. Bind these event types with
6373 EVT_DATE_CHANGED.
6374 """
554f62e9
RD
6375 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6376 __repr__ = _swig_repr
6377 def __init__(self, *args, **kwargs):
f460c29d 6378 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
554f62e9 6379 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6380 def GetDate(*args, **kwargs):
5ba5649b
RD
6381 """
6382 GetDate(self) -> DateTime
6383
6384 Returns the date.
6385 """
53aa7709
RD
6386 return _core_.DateEvent_GetDate(*args, **kwargs)
6387
6388 def SetDate(*args, **kwargs):
5ba5649b
RD
6389 """
6390 SetDate(self, DateTime date)
6391
6392 Sets the date carried by the event, normally only used by the library
6393 internally.
6394 """
53aa7709
RD
6395 return _core_.DateEvent_SetDate(*args, **kwargs)
6396
2131d850 6397_core_.DateEvent_swigregister(DateEvent)
53aa7709
RD
6398
6399wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6400EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6401
d55e5bfc
RD
6402#---------------------------------------------------------------------------
6403
6404PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6405PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6406PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6407PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6408PRINT_WINDOWS = _core_.PRINT_WINDOWS
6409PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6410class PyApp(EvtHandler):
c24da6d6
RD
6411 """
6412 The ``wx.PyApp`` class is an *implementation detail*, please use the
6413 `wx.App` class (or some other derived class) instead.
6414 """
554f62e9
RD
6415 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6416 __repr__ = _swig_repr
6417 def __init__(self, *args, **kwargs):
d55e5bfc
RD
6418 """
6419 __init__(self) -> PyApp
6420
6421 Create a new application object, starting the bootstrap process.
6422 """
554f62e9 6423 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
70b7a5fe
RD
6424 self._setCallbackInfo(self, PyApp, False)
6425 self._setOORInfo(self, False)
d55e5bfc 6426
554f62e9
RD
6427 __swig_destroy__ = _core_.delete_PyApp
6428 __del__ = lambda self : None;
d55e5bfc 6429 def _setCallbackInfo(*args, **kwargs):
70b7a5fe 6430 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
d55e5bfc
RD
6431 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
6432
6433 def GetAppName(*args, **kwargs):
6434 """
6435 GetAppName(self) -> String
6436
6437 Get the application name.
6438 """
6439 return _core_.PyApp_GetAppName(*args, **kwargs)
6440
6441 def SetAppName(*args, **kwargs):
6442 """
6443 SetAppName(self, String name)
6444
c24da6d6
RD
6445 Set the application name. This value may be used automatically by
6446 `wx.Config` and such.
d55e5bfc
RD
6447 """
6448 return _core_.PyApp_SetAppName(*args, **kwargs)
6449
6450 def GetClassName(*args, **kwargs):
6451 """
6452 GetClassName(self) -> String
6453
6454 Get the application's class name.
6455 """
6456 return _core_.PyApp_GetClassName(*args, **kwargs)
6457
6458 def SetClassName(*args, **kwargs):
6459 """
6460 SetClassName(self, String name)
6461
c24da6d6
RD
6462 Set the application's class name. This value may be used for
6463 X-resources if applicable for the platform
d55e5bfc
RD
6464 """
6465 return _core_.PyApp_SetClassName(*args, **kwargs)
6466
6467 def GetVendorName(*args, **kwargs):
6468 """
6469 GetVendorName(self) -> String
6470
6471 Get the application's vendor name.
6472 """
6473 return _core_.PyApp_GetVendorName(*args, **kwargs)
6474
6475 def SetVendorName(*args, **kwargs):
6476 """
6477 SetVendorName(self, String name)
6478
c24da6d6
RD
6479 Set the application's vendor name. This value may be used
6480 automatically by `wx.Config` and such.
d55e5bfc
RD
6481 """
6482 return _core_.PyApp_SetVendorName(*args, **kwargs)
6483
6484 def GetTraits(*args, **kwargs):
6485 """
6486 GetTraits(self) -> wxAppTraits
6487
c24da6d6
RD
6488 Return (and create if necessary) the app traits object to which we
6489 delegate for everything which either should be configurable by the
6490 user (then he can change the default behaviour simply by overriding
6491 CreateTraits() and returning his own traits object) or which is
6492 GUI/console dependent as then wx.AppTraits allows us to abstract the
6493 differences behind the common facade.
6494
6495 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc
RD
6496 """
6497 return _core_.PyApp_GetTraits(*args, **kwargs)
6498
6499 def ProcessPendingEvents(*args, **kwargs):
6500 """
6501 ProcessPendingEvents(self)
6502
c24da6d6
RD
6503 Process all events in the Pending Events list -- it is necessary to
6504 call this function to process posted events. This normally happens
6505 during each event loop iteration.
d55e5bfc
RD
6506 """
6507 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
6508
6509 def Yield(*args, **kwargs):
6510 """
6511 Yield(self, bool onlyIfNeeded=False) -> bool
6512
c24da6d6
RD
6513 Process all currently pending events right now, instead of waiting
6514 until return to the event loop. It is an error to call ``Yield``
6515 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 6516
c24da6d6 6517 :warning: This function is dangerous as it can lead to unexpected
79fccf9d
RD
6518 reentrancies (i.e. when called from an event handler it may
6519 result in calling the same event handler again), use with
6520 extreme care or, better, don't use at all!
d55e5bfc 6521
c24da6d6 6522 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
79fccf9d 6523
d55e5bfc
RD
6524 """
6525 return _core_.PyApp_Yield(*args, **kwargs)
6526
6527 def WakeUpIdle(*args, **kwargs):
6528 """
6529 WakeUpIdle(self)
6530
c24da6d6
RD
6531 Make sure that idle events are sent again.
6532 :see: `wx.WakeUpIdle`
d55e5bfc
RD
6533 """
6534 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
6535
84f85550
RD
6536 def IsMainLoopRunning(*args, **kwargs):
6537 """
6538 IsMainLoopRunning() -> bool
6539
6540 Returns True if we're running the main loop, i.e. if the events can
6541 currently be dispatched.
6542 """
6543 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6544
6545 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
6546 def MainLoop(*args, **kwargs):
6547 """
6548 MainLoop(self) -> int
6549
c24da6d6
RD
6550 Execute the main GUI loop, the function doesn't normally return until
6551 all top level windows have been closed and destroyed.
d55e5bfc
RD
6552 """
6553 return _core_.PyApp_MainLoop(*args, **kwargs)
6554
6555 def Exit(*args, **kwargs):
6556 """
6557 Exit(self)
6558
6559 Exit the main loop thus terminating the application.
c24da6d6 6560 :see: `wx.Exit`
d55e5bfc
RD
6561 """
6562 return _core_.PyApp_Exit(*args, **kwargs)
6563
6564 def ExitMainLoop(*args, **kwargs):
6565 """
6566 ExitMainLoop(self)
6567
c24da6d6
RD
6568 Exit the main GUI loop during the next iteration of the main
6569 loop, (i.e. it does not stop the program immediately!)
d55e5bfc
RD
6570 """
6571 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
6572
6573 def Pending(*args, **kwargs):
6574 """
6575 Pending(self) -> bool
6576
6577 Returns True if there are unprocessed events in the event queue.
6578 """
6579 return _core_.PyApp_Pending(*args, **kwargs)
6580
6581 def Dispatch(*args, **kwargs):
6582 """
6583 Dispatch(self) -> bool
6584
6585 Process the first event in the event queue (blocks until an event
6586 appears if there are none currently)
6587 """
6588 return _core_.PyApp_Dispatch(*args, **kwargs)
6589
6590 def ProcessIdle(*args, **kwargs):
6591 """
6592 ProcessIdle(self) -> bool
6593
c24da6d6
RD
6594 Called from the MainLoop when the application becomes idle (there are
6595 no pending events) and sends a `wx.IdleEvent` to all interested
6596 parties. Returns True if more idle events are needed, False if not.
d55e5bfc
RD
6597 """
6598 return _core_.PyApp_ProcessIdle(*args, **kwargs)
6599
6600 def SendIdleEvents(*args, **kwargs):
6601 """
6602 SendIdleEvents(self, Window win, IdleEvent event) -> bool
6603
c24da6d6
RD
6604 Send idle event to window and all subwindows. Returns True if more
6605 idle time is requested.
d55e5bfc
RD
6606 """
6607 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
6608
6609 def IsActive(*args, **kwargs):
6610 """
6611 IsActive(self) -> bool
6612
6613 Return True if our app has focus.
6614 """
6615 return _core_.PyApp_IsActive(*args, **kwargs)
6616
6617 def SetTopWindow(*args, **kwargs):
6618 """
6619 SetTopWindow(self, Window win)
6620
c24da6d6 6621 Set the *main* top level window
d55e5bfc
RD
6622 """
6623 return _core_.PyApp_SetTopWindow(*args, **kwargs)
6624
6625 def GetTopWindow(*args, **kwargs):
6626 """
6627 GetTopWindow(self) -> Window
6628
c24da6d6
RD
6629 Return the *main* top level window (if it hadn't been set previously
6630 with SetTopWindow(), will return just some top level window and, if
6631 there not any, will return None)
d55e5bfc
RD
6632 """
6633 return _core_.PyApp_GetTopWindow(*args, **kwargs)
6634
6635 def SetExitOnFrameDelete(*args, **kwargs):
6636 """
6637 SetExitOnFrameDelete(self, bool flag)
6638
c24da6d6
RD
6639 Control the exit behaviour: by default, the program will exit the main
6640 loop (and so, usually, terminate) when the last top-level program
6641 window is deleted. Beware that if you disable this behaviour (with
6642 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6643 explicitly from somewhere.
d55e5bfc
RD
6644 """
6645 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
6646
6647 def GetExitOnFrameDelete(*args, **kwargs):
6648 """
6649 GetExitOnFrameDelete(self) -> bool
6650
6651 Get the current exit behaviour setting.
6652 """
6653 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
6654
6655 def SetUseBestVisual(*args, **kwargs):
6656 """
6657 SetUseBestVisual(self, bool flag)
6658
c24da6d6
RD
6659 Set whether the app should try to use the best available visual on
6660 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc
RD
6661 """
6662 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
6663
6664 def GetUseBestVisual(*args, **kwargs):
6665 """
6666 GetUseBestVisual(self) -> bool
6667
6668 Get current UseBestVisual setting.
6669 """
6670 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
6671
6672 def SetPrintMode(*args, **kwargs):
6673 """SetPrintMode(self, int mode)"""
6674 return _core_.PyApp_SetPrintMode(*args, **kwargs)
6675
6676 def GetPrintMode(*args, **kwargs):
6677 """GetPrintMode(self) -> int"""
6678 return _core_.PyApp_GetPrintMode(*args, **kwargs)
6679
6680 def SetAssertMode(*args, **kwargs):
6681 """
6682 SetAssertMode(self, int mode)
6683
79fccf9d 6684 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc
RD
6685 """
6686 return _core_.PyApp_SetAssertMode(*args, **kwargs)
6687
6688 def GetAssertMode(*args, **kwargs):
6689 """
6690 GetAssertMode(self) -> int
6691
6692 Get the current OnAssert behaviour setting.
6693 """
6694 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6695
6696 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 6697 """GetMacSupportPCMenuShortcuts() -> bool"""
d55e5bfc
RD
6698 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
6699
6700 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6701 def GetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 6702 """GetMacAboutMenuItemId() -> long"""
d55e5bfc
RD
6703 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
6704
6705 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6706 def GetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 6707 """GetMacPreferencesMenuItemId() -> long"""
d55e5bfc
RD
6708 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
6709
6710 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6711 def GetMacExitMenuItemId(*args, **kwargs):
c24da6d6 6712 """GetMacExitMenuItemId() -> long"""
d55e5bfc
RD
6713 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
6714
6715 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6716 def GetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 6717 """GetMacHelpMenuTitleName() -> String"""
d55e5bfc
RD
6718 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
6719
6720 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6721 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
c24da6d6 6722 """SetMacSupportPCMenuShortcuts(bool val)"""
d55e5bfc
RD
6723 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
6724
6725 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6726 def SetMacAboutMenuItemId(*args, **kwargs):
c24da6d6 6727 """SetMacAboutMenuItemId(long val)"""
d55e5bfc
RD
6728 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
6729
6730 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6731 def SetMacPreferencesMenuItemId(*args, **kwargs):
c24da6d6 6732 """SetMacPreferencesMenuItemId(long val)"""
d55e5bfc
RD
6733 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
6734
6735 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6736 def SetMacExitMenuItemId(*args, **kwargs):
c24da6d6 6737 """SetMacExitMenuItemId(long val)"""
d55e5bfc
RD
6738 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
6739
6740 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6741 def SetMacHelpMenuTitleName(*args, **kwargs):
c24da6d6 6742 """SetMacHelpMenuTitleName(String val)"""
d55e5bfc
RD
6743 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
6744
6745 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6746 def _BootstrapApp(*args, **kwargs):
6747 """
6748 _BootstrapApp(self)
6749
6750 For internal use only
6751 """
6752 return _core_.PyApp__BootstrapApp(*args, **kwargs)
6753
6754 def GetComCtl32Version(*args, **kwargs):
6755 """
c24da6d6 6756 GetComCtl32Version() -> int
d55e5bfc 6757
c24da6d6
RD
6758 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6759 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc
RD
6760 """
6761 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
6762
6763 GetComCtl32Version = staticmethod(GetComCtl32Version)
2131d850 6764_core_.PyApp_swigregister(PyApp)
d55e5bfc 6765
554f62e9
RD
6766def PyApp_IsMainLoopRunning(*args):
6767 """
84f85550
RD
6768 PyApp_IsMainLoopRunning() -> bool
6769
6770 Returns True if we're running the main loop, i.e. if the events can
6771 currently be dispatched.
6772 """
554f62e9 6773 return _core_.PyApp_IsMainLoopRunning(*args)
84f85550 6774
554f62e9
RD
6775def PyApp_GetMacSupportPCMenuShortcuts(*args):
6776 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6777 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d55e5bfc 6778
554f62e9
RD
6779def PyApp_GetMacAboutMenuItemId(*args):
6780 """PyApp_GetMacAboutMenuItemId() -> long"""
6781 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d55e5bfc 6782
554f62e9
RD
6783def PyApp_GetMacPreferencesMenuItemId(*args):
6784 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6785 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d55e5bfc 6786
554f62e9
RD
6787def PyApp_GetMacExitMenuItemId(*args):
6788 """PyApp_GetMacExitMenuItemId() -> long"""
6789 return _core_.PyApp_GetMacExitMenuItemId(*args)
d55e5bfc 6790
554f62e9
RD
6791def PyApp_GetMacHelpMenuTitleName(*args):
6792 """PyApp_GetMacHelpMenuTitleName() -> String"""
6793 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d55e5bfc
RD
6794
6795def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
554f62e9
RD
6796 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6797 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
6798
6799def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
554f62e9
RD
6800 """PyApp_SetMacAboutMenuItemId(long val)"""
6801 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
6802
6803def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
554f62e9
RD
6804 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6805 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
6806
6807def PyApp_SetMacExitMenuItemId(*args, **kwargs):
554f62e9
RD
6808 """PyApp_SetMacExitMenuItemId(long val)"""
6809 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
6810
6811def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
554f62e9
RD
6812 """PyApp_SetMacHelpMenuTitleName(String val)"""
6813 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 6814
554f62e9
RD
6815def PyApp_GetComCtl32Version(*args):
6816 """
d55e5bfc
RD
6817 PyApp_GetComCtl32Version() -> int
6818
c24da6d6
RD
6819 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6820 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 6821 """
554f62e9 6822 return _core_.PyApp_GetComCtl32Version(*args)
d55e5bfc
RD
6823
6824#---------------------------------------------------------------------------
6825
6826
554f62e9
RD
6827def Exit(*args):
6828 """
d55e5bfc
RD
6829 Exit()
6830
6831 Force an exit of the application. Convenience for wx.GetApp().Exit()
6832 """
554f62e9 6833 return _core_.Exit(*args)
d55e5bfc 6834
554f62e9
RD
6835def Yield(*args):
6836 """
d55e5bfc
RD
6837 Yield() -> bool
6838
6839 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6840 """
554f62e9 6841 return _core_.Yield(*args)
d55e5bfc 6842
554f62e9
RD
6843def YieldIfNeeded(*args):
6844 """
d55e5bfc
RD
6845 YieldIfNeeded() -> bool
6846
6847 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6848 """
554f62e9 6849 return _core_.YieldIfNeeded(*args)
d55e5bfc
RD
6850
6851def SafeYield(*args, **kwargs):
554f62e9 6852 """
d55e5bfc
RD
6853 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6854
c24da6d6
RD
6855 This function is similar to `wx.Yield`, except that it disables the
6856 user input to all program windows before calling `wx.Yield` and
6857 re-enables it again afterwards. If ``win`` is not None, this window
6858 will remain enabled, allowing the implementation of some limited user
6859 interaction.
d55e5bfc 6860
c24da6d6 6861 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 6862 """
554f62e9 6863 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 6864
554f62e9
RD
6865def WakeUpIdle(*args):
6866 """
d55e5bfc
RD
6867 WakeUpIdle()
6868
c24da6d6
RD
6869 Cause the message queue to become empty again, so idle events will be
6870 sent.
d55e5bfc 6871 """
554f62e9 6872 return _core_.WakeUpIdle(*args)
d55e5bfc
RD
6873
6874def PostEvent(*args, **kwargs):
554f62e9 6875 """
d55e5bfc
RD
6876 PostEvent(EvtHandler dest, Event event)
6877
c24da6d6
RD
6878 Send an event to a window or other wx.EvtHandler to be processed
6879 later.
d55e5bfc 6880 """
554f62e9 6881 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 6882
554f62e9
RD
6883def App_CleanUp(*args):
6884 """
d55e5bfc
RD
6885 App_CleanUp()
6886
79fccf9d 6887 For internal use only, it is used to cleanup after wxWidgets when
c24da6d6 6888 Python shuts down.
d55e5bfc 6889 """
554f62e9 6890 return _core_.App_CleanUp(*args)
d55e5bfc 6891
554f62e9
RD
6892def GetApp(*args):
6893 """
d55e5bfc
RD
6894 GetApp() -> PyApp
6895
6896 Return a reference to the current wx.App object.
6897 """
554f62e9 6898 return _core_.GetApp(*args)
5cbf236d
RD
6899
6900def SetDefaultPyEncoding(*args, **kwargs):
554f62e9 6901 """
5cbf236d
RD
6902 SetDefaultPyEncoding(string encoding)
6903
6904 Sets the encoding that wxPython will use when it needs to convert a
6905 Python string or unicode object to or from a wxString.
62d32a5f
RD
6906
6907 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6908 but please be aware that the default encoding within the same locale
6909 may be slightly different on different platforms. For example, please
6910 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6911 between the common latin/roman encodings.
5cbf236d 6912 """
554f62e9 6913 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 6914
554f62e9
RD
6915def GetDefaultPyEncoding(*args):
6916 """
5cbf236d
RD
6917 GetDefaultPyEncoding() -> string
6918
6919 Gets the current encoding that wxPython will use when it needs to
6920 convert a Python string or unicode object to or from a wxString.
6921 """
554f62e9 6922 return _core_.GetDefaultPyEncoding(*args)
d55e5bfc
RD
6923#----------------------------------------------------------------------
6924
6925class PyOnDemandOutputWindow:
6926 """
6927 A class that can be used for redirecting Python's stdout and
6928 stderr streams. It will do nothing until something is wrriten to
6929 the stream at which point it will create a Frame with a text area
6930 and write the text there.
6931 """
6932 def __init__(self, title = "wxPython: stdout/stderr"):
6933 self.frame = None
6934 self.title = title
412d302d
RD
6935 self.pos = wx.DefaultPosition
6936 self.size = (450, 300)
d55e5bfc
RD
6937 self.parent = None
6938
6939 def SetParent(self, parent):
6940 """Set the window to be used as the popup Frame's parent."""
6941 self.parent = parent
6942
6943
6944 def CreateOutputWindow(self, st):
412d302d
RD
6945 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
6946 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 6947 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 6948 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 6949 self.text.AppendText(st)
d55e5bfc 6950 self.frame.Show(True)
2131d850 6951 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
d55e5bfc
RD
6952
6953
6954 def OnCloseWindow(self, event):
6955 if self.frame is not None:
6956 self.frame.Destroy()
6957 self.frame = None
6958 self.text = None
6959
6960
6961 # These methods provide the file-like output behaviour.
6962 def write(self, text):
6963 """
6964 Create the output window if needed and write the string to it.
6965 If not called in the context of the gui thread then uses
6966 CallAfter to do the work there.
6967 """
6968 if self.frame is None:
6969 if not wx.Thread_IsMain():
6970 wx.CallAfter(self.CreateOutputWindow, text)
6971 else:
6972 self.CreateOutputWindow(text)
6973 else:
6974 if not wx.Thread_IsMain():
6975 wx.CallAfter(self.text.AppendText, text)
6976 else:
6977 self.text.AppendText(text)
6978
6979
6980 def close(self):
6981 if self.frame is not None:
6982 wx.CallAfter(self.frame.Close)
6983
6984
19272049
RD
6985 def flush(self):
6986 pass
6987
6988
d55e5bfc
RD
6989
6990#----------------------------------------------------------------------
6991
6992_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
6993
6994class App(wx.PyApp):
6995 """
c24da6d6
RD
6996 The ``wx.App`` class represents the application and is used to:
6997
6998 * bootstrap the wxPython system and initialize the underlying
6999 gui toolkit
7000 * set and get application-wide properties
7001 * implement the windowing system main message or event loop,
7002 and to dispatch events to window instances
7003 * etc.
7004
7005 Every application must have a ``wx.App`` instance, and all
7006 creation of UI objects should be delayed until after the
7007 ``wx.App`` object has been created in order to ensure that the gui
7008 platform and wxWidgets have been fully initialized.
7009
7010 Normally you would derive from this class and implement an
7011 ``OnInit`` method that creates a frame and then calls
7012 ``self.SetTopWindow(frame)``.
7013
7014 :see: `wx.PySimpleApp` for a simpler app class that can be used
79fccf9d 7015 directly.
d55e5bfc 7016 """
c24da6d6 7017
d55e5bfc
RD
7018 outputWindowClass = PyOnDemandOutputWindow
7019
c24da6d6
RD
7020 def __init__(self, redirect=_defRedirect, filename=None,
7021 useBestVisual=False, clearSigInt=True):
7022 """
7023 Construct a ``wx.App`` object.
7024
7025 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7026 redirected? Defaults to True on Windows and Mac, False
7027 otherwise. If `filename` is None then output will be
7028 redirected to a window that pops up as needed. (You can
7029 control what kind of window is created for the output by
7030 resetting the class variable ``outputWindowClass`` to a
7031 class of your choosing.)
7032
7033 :param filename: The name of a file to redirect output to, if
7034 redirect is True.
7035
7036 :param useBestVisual: Should the app try to use the best
7037 available visual provided by the system (only relevant on
7038 systems that have more than one visual.) This parameter
7039 must be used instead of calling `SetUseBestVisual` later
7040 on because it must be set before the underlying GUI
7041 toolkit is initialized.
7042
7043 :param clearSigInt: Should SIGINT be cleared? This allows the
7044 app to terminate upon a Ctrl-C in the console like other
7045 GUI apps will.
7046
7047 :note: You should override OnInit to do applicaition
7048 initialization to ensure that the system, toolkit and
7049 wxWidgets are fully initialized.
7050 """
d55e5bfc
RD
7051 wx.PyApp.__init__(self)
7052
7053 if wx.Platform == "__WXMAC__":
7054 try:
7055 import MacOS
7056 if not MacOS.WMAvailable():
7057 print """\
7058This program needs access to the screen. Please run with 'pythonw',
7059not 'python', and only when you are logged in on the main display of
7060your Mac."""
7061 _sys.exit(1)
b1f29bf7
RD
7062 except SystemExit:
7063 raise
d55e5bfc
RD
7064 except:
7065 pass
7066
7067 # This has to be done before OnInit
7068 self.SetUseBestVisual(useBestVisual)
7069
7070 # Set the default handler for SIGINT. This fixes a problem
7071 # where if Ctrl-C is pressed in the console that started this
7072 # app then it will not appear to do anything, (not even send
7073 # KeyboardInterrupt???) but will later segfault on exit. By
7074 # setting the default handler then the app will exit, as
7075 # expected (depending on platform.)
c24da6d6
RD
7076 if clearSigInt:
7077 try:
7078 import signal
7079 signal.signal(signal.SIGINT, signal.SIG_DFL)
7080 except:
7081 pass
d55e5bfc
RD
7082
7083 # Save and redirect the stdio to a window?
7084 self.stdioWin = None
7085 self.saveStdio = (_sys.stdout, _sys.stderr)
7086 if redirect:
7087 self.RedirectStdio(filename)
7088
8fb0e70a
RD
7089 # Use Python's install prefix as the default
7090 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7091
d55e5bfc
RD
7092 # This finishes the initialization of wxWindows and then calls
7093 # the OnInit that should be present in the derived class
7094 self._BootstrapApp()
7095
7096
f460c29d
RD
7097 def OnPreInit(self):
7098 """
7099 Things that must be done after _BootstrapApp has done its
7100 thing, but would be nice if they were already done by the time
7101 that OnInit is called.
7102 """
7103 wx.StockGDI._initStockObjects()
7104
7105
66af7a75
RD
7106 def __del__(self, destroy=wx.PyApp.__del__):
7107 self.RestoreStdio() # Just in case the MainLoop was overridden
7108 destroy(self)
d55e5bfc 7109
70b7a5fe
RD
7110 def Destroy(self):
7111 wx.PyApp.Destroy(self)
7112 self.thisown = 0
d55e5bfc
RD
7113
7114 def SetTopWindow(self, frame):
7115 """Set the \"main\" top level window"""
7116 if self.stdioWin:
7117 self.stdioWin.SetParent(frame)
7118 wx.PyApp.SetTopWindow(self, frame)
7119
7120
7121 def MainLoop(self):
7122 """Execute the main GUI event loop"""
7123 wx.PyApp.MainLoop(self)
7124 self.RestoreStdio()
7125
7126
7127 def RedirectStdio(self, filename=None):
7128 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7129 if filename:
7130 _sys.stdout = _sys.stderr = open(filename, 'a')
7131 else:
7132 self.stdioWin = self.outputWindowClass()
7133 _sys.stdout = _sys.stderr = self.stdioWin
7134
7135
7136 def RestoreStdio(self):
66af7a75
RD
7137 try:
7138 _sys.stdout, _sys.stderr = self.saveStdio
7139 except:
7140 pass
d55e5bfc
RD
7141
7142
412d302d
RD
7143 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7144 """
7145 Set the title, position and/or size of the output window if
f5b96ee1
RD
7146 the stdio has been redirected. This should be called before
7147 any output would cause the output window to be created.
412d302d
RD
7148 """
7149 if self.stdioWin:
7150 if title is not None:
7151 self.stdioWin.title = title
7152 if pos is not None:
7153 self.stdioWin.pos = pos
7154 if size is not None:
7155 self.stdioWin.size = size
7156
7157
7158
d55e5bfc 7159
c24da6d6 7160# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7161App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7162App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7163App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7164App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7165App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7166App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7167App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7168App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7169App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7170App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7171App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7172
7173#----------------------------------------------------------------------------
7174
7175class PySimpleApp(wx.App):
7176 """
7177 A simple application class. You can just create one of these and
7178 then then make your top level windows later, and not have to worry
c24da6d6 7179 about OnInit. For example::
d55e5bfc 7180
c24da6d6
RD
7181 app = wx.PySimpleApp()
7182 frame = wx.Frame(None, title='Hello World')
7183 frame.Show()
7184 app.MainLoop()
7185
7186 :see: `wx.App`
7187 """
7188
7189 def __init__(self, redirect=False, filename=None,
7190 useBestVisual=False, clearSigInt=True):
7191 """
7192 :see: `wx.App.__init__`
7193 """
7194 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7195
7196 def OnInit(self):
d55e5bfc
RD
7197 return True
7198
7199
c24da6d6 7200
d55e5bfc
RD
7201# Is anybody using this one?
7202class PyWidgetTester(wx.App):
7203 def __init__(self, size = (250, 100)):
7204 self.size = size
7205 wx.App.__init__(self, 0)
7206
7207 def OnInit(self):
7208 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7209 self.SetTopWindow(self.frame)
7210 return True
7211
c24da6d6
RD
7212 def SetWidget(self, widgetClass, *args, **kwargs):
7213 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7214 self.frame.Show(True)
7215
7216#----------------------------------------------------------------------------
7217# DO NOT hold any other references to this object. This is how we
c24da6d6 7218# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7219# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
c24da6d6 7220# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7221
7222class __wxPyCleanup:
7223 def __init__(self):
7224 self.cleanup = _core_.App_CleanUp
7225 def __del__(self):
7226 self.cleanup()
7227
7228_sys.__wxPythonCleanup = __wxPyCleanup()
7229
7230## # another possible solution, but it gets called too early...
c24da6d6
RD
7231## import atexit
7232## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7233
7234
7235#----------------------------------------------------------------------------
7236
7237#---------------------------------------------------------------------------
7238
ae8162c8 7239class EventLoop(object):
093d3ff1 7240 """Proxy of C++ EventLoop class"""
554f62e9
RD
7241 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7242 __repr__ = _swig_repr
7243 def __init__(self, *args, **kwargs):
ae8162c8 7244 """__init__(self) -> EventLoop"""
554f62e9
RD
7245 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7246 __swig_destroy__ = _core_.delete_EventLoop
7247 __del__ = lambda self : None;
ae8162c8
RD
7248 def Run(*args, **kwargs):
7249 """Run(self) -> int"""
7250 return _core_.EventLoop_Run(*args, **kwargs)
7251
7252 def Exit(*args, **kwargs):
7253 """Exit(self, int rc=0)"""
7254 return _core_.EventLoop_Exit(*args, **kwargs)
7255
7256 def Pending(*args, **kwargs):
7257 """Pending(self) -> bool"""
7258 return _core_.EventLoop_Pending(*args, **kwargs)
7259
7260 def Dispatch(*args, **kwargs):
7261 """Dispatch(self) -> bool"""
7262 return _core_.EventLoop_Dispatch(*args, **kwargs)
7263
7264 def IsRunning(*args, **kwargs):
7265 """IsRunning(self) -> bool"""
7266 return _core_.EventLoop_IsRunning(*args, **kwargs)
7267
7268 def GetActive(*args, **kwargs):
7269 """GetActive() -> EventLoop"""
7270 return _core_.EventLoop_GetActive(*args, **kwargs)
7271
7272 GetActive = staticmethod(GetActive)
7273 def SetActive(*args, **kwargs):
7274 """SetActive(EventLoop loop)"""
7275 return _core_.EventLoop_SetActive(*args, **kwargs)
7276
7277 SetActive = staticmethod(SetActive)
2131d850 7278_core_.EventLoop_swigregister(EventLoop)
ae8162c8 7279
554f62e9
RD
7280def EventLoop_GetActive(*args):
7281 """EventLoop_GetActive() -> EventLoop"""
7282 return _core_.EventLoop_GetActive(*args)
ae8162c8
RD
7283
7284def EventLoop_SetActive(*args, **kwargs):
554f62e9
RD
7285 """EventLoop_SetActive(EventLoop loop)"""
7286 return _core_.EventLoop_SetActive(*args, **kwargs)
ae8162c8 7287
7449af73
RD
7288class EventLoopActivator(object):
7289 """Proxy of C++ EventLoopActivator class"""
554f62e9
RD
7290 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7291 __repr__ = _swig_repr
7292 def __init__(self, *args, **kwargs):
7449af73 7293 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
554f62e9
RD
7294 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7295 __swig_destroy__ = _core_.delete_EventLoopActivator
7296 __del__ = lambda self : None;
2131d850 7297_core_.EventLoopActivator_swigregister(EventLoopActivator)
7449af73 7298
ae8162c8
RD
7299#---------------------------------------------------------------------------
7300
d55e5bfc 7301class AcceleratorEntry(object):
c24da6d6
RD
7302 """
7303 A class used to define items in an `wx.AcceleratorTable`. wxPython
7304 programs can choose to use wx.AcceleratorEntry objects, but using a
7305 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
79fccf9d 7306 as well. See `__init__` for of the tuple values.
c24da6d6
RD
7307
7308 :see: `wx.AcceleratorTable`
7309 """
554f62e9
RD
7310 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7311 __repr__ = _swig_repr
7312 def __init__(self, *args, **kwargs):
c24da6d6
RD
7313 """
7314 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7315
7316 Construct a wx.AcceleratorEntry.
c24da6d6 7317 """
554f62e9
RD
7318 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7319 __swig_destroy__ = _core_.delete_AcceleratorEntry
7320 __del__ = lambda self : None;
d55e5bfc 7321 def Set(*args, **kwargs):
c24da6d6
RD
7322 """
7323 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 7324
c24da6d6
RD
7325 (Re)set the attributes of a wx.AcceleratorEntry.
7326 :see `__init__`
7327 """
7328 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
7329
7330 def GetFlags(*args, **kwargs):
c24da6d6
RD
7331 """
7332 GetFlags(self) -> int
7333
7334 Get the AcceleratorEntry's flags.
7335 """
d55e5bfc
RD
7336 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
7337
7338 def GetKeyCode(*args, **kwargs):
c24da6d6
RD
7339 """
7340 GetKeyCode(self) -> int
7341
7342 Get the AcceleratorEntry's keycode.
7343 """
d55e5bfc
RD
7344 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
7345
7346 def GetCommand(*args, **kwargs):
c24da6d6
RD
7347 """
7348 GetCommand(self) -> int
7349
7350 Get the AcceleratorEntry's command ID.
7351 """
d55e5bfc
RD
7352 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
7353
2131d850 7354_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
d55e5bfc
RD
7355
7356class AcceleratorTable(Object):
c24da6d6
RD
7357 """
7358 An accelerator table allows the application to specify a table of
7359 keyboard shortcuts for menus or other commands. On Windows, menu or
7360 button commands are supported; on GTK, only menu commands are
7361 supported.
c24da6d6 7362 """
554f62e9
RD
7363 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7364 __repr__ = _swig_repr
7365 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7366 """
7367 __init__(entries) -> AcceleratorTable
7368
c24da6d6
RD
7369 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7370 items or or of 3-tuples (flags, keyCode, cmdID)
7371
7372 :see: `wx.AcceleratorEntry`
d55e5bfc 7373 """
554f62e9
RD
7374 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7375 __swig_destroy__ = _core_.delete_AcceleratorTable
7376 __del__ = lambda self : None;
d55e5bfc
RD
7377 def Ok(*args, **kwargs):
7378 """Ok(self) -> bool"""
7379 return _core_.AcceleratorTable_Ok(*args, **kwargs)
7380
2131d850 7381_core_.AcceleratorTable_swigregister(AcceleratorTable)
d55e5bfc
RD
7382
7383
7384def GetAccelFromString(*args, **kwargs):
554f62e9
RD
7385 """GetAccelFromString(String label) -> AcceleratorEntry"""
7386 return _core_.GetAccelFromString(*args, **kwargs)
d55e5bfc
RD
7387#---------------------------------------------------------------------------
7388
7389class VisualAttributes(object):
7390 """struct containing all the visual attributes of a control"""
554f62e9
RD
7391 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7392 __repr__ = _swig_repr
7393 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7394 """
7395 __init__(self) -> VisualAttributes
7396
7397 struct containing all the visual attributes of a control
7398 """
554f62e9
RD
7399 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7400 __swig_destroy__ = _core_.delete_VisualAttributes
7401 __del__ = lambda self : None;
d55e5bfc
RD
7402 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7403 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7404 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 7405_core_.VisualAttributes_swigregister(VisualAttributes)
d55e5bfc
RD
7406NullAcceleratorTable = cvar.NullAcceleratorTable
7407PanelNameStr = cvar.PanelNameStr
7408
7409WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7410WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7411WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7412WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7413WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7414class Window(EvtHandler):
7415 """
7416 wx.Window is the base class for all windows and represents any visible
7417 object on the screen. All controls, top level windows and so on are
7418 wx.Windows. Sizers and device contexts are not however, as they don't
7419 appear on screen themselves.
7420
7421 """
554f62e9
RD
7422 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7423 __repr__ = _swig_repr
7424 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7425 """
7426 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7427 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
7428
7429 Construct and show a generic Window.
7430 """
554f62e9 7431 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d55e5bfc
RD
7432 self._setOORInfo(self)
7433
7434 def Create(*args, **kwargs):
7435 """
7436 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7437 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
7438
7439 Create the GUI part of the Window for 2-phase creation mode.
7440 """
7441 return _core_.Window_Create(*args, **kwargs)
7442
7443 def Close(*args, **kwargs):
7444 """
7445 Close(self, bool force=False) -> bool
7446
7447 This function simply generates a EVT_CLOSE event whose handler usually
7448 tries to close the window. It doesn't close the window itself,
7449 however. If force is False (the default) then the window's close
7450 handler will be allowed to veto the destruction of the window.
d55e5bfc
RD
7451 """
7452 return _core_.Window_Close(*args, **kwargs)
7453
7454 def Destroy(*args, **kwargs):
7455 """
7456 Destroy(self) -> bool
7457
7458 Destroys the window safely. Frames and dialogs are not destroyed
7459 immediately when this function is called -- they are added to a list
7460 of windows to be deleted on idle time, when all the window's events
7461 have been processed. This prevents problems with events being sent to
7462 non-existent windows.
7463
7464 Returns True if the window has either been successfully deleted, or it
7465 has been added to the list of windows pending real deletion.
7466 """
7e08d4ef
RD
7467 val = _core_.Window_Destroy(*args, **kwargs)
7468 args[0].thisown = 0
7469 return val
d55e5bfc
RD
7470
7471 def DestroyChildren(*args, **kwargs):
7472 """
7473 DestroyChildren(self) -> bool
7474
79fccf9d
RD
7475 Destroys all children of a window. Called automatically by the
7476 destructor.
d55e5bfc
RD
7477 """
7478 return _core_.Window_DestroyChildren(*args, **kwargs)
7479
7480 def IsBeingDeleted(*args, **kwargs):
7481 """
7482 IsBeingDeleted(self) -> bool
7483
7484 Is the window in the process of being deleted?
7485 """
7486 return _core_.Window_IsBeingDeleted(*args, **kwargs)
7487
d55e5bfc
RD
7488 def SetLabel(*args, **kwargs):
7489 """
7490 SetLabel(self, String label)
7491
7492 Set the text which the window shows in its label if applicable.
7493 """
7494 return _core_.Window_SetLabel(*args, **kwargs)
7495
7496 def GetLabel(*args, **kwargs):
7497 """
7498 GetLabel(self) -> String
7499
79fccf9d
RD
7500 Generic way of getting a label from any window, for identification
7501 purposes. The interpretation of this function differs from class to
7502 class. For frames and dialogs, the value returned is the title. For
7503 buttons or static text controls, it is the button text. This function
7504 can be useful for meta-programs such as testing tools or special-needs
7505 access programs)which need to identify windows by name.
d55e5bfc
RD
7506 """
7507 return _core_.Window_GetLabel(*args, **kwargs)
7508
7509 def SetName(*args, **kwargs):
7510 """
7511 SetName(self, String name)
7512
79fccf9d
RD
7513 Sets the window's name. The window name is used for ressource setting
7514 in X, it is not the same as the window title/label
d55e5bfc
RD
7515 """
7516 return _core_.Window_SetName(*args, **kwargs)
7517
7518 def GetName(*args, **kwargs):
7519 """
7520 GetName(self) -> String
7521
79fccf9d
RD
7522 Returns the windows name. This name is not guaranteed to be unique;
7523 it is up to the programmer to supply an appropriate name in the window
7524 constructor or via wx.Window.SetName.
d55e5bfc
RD
7525 """
7526 return _core_.Window_GetName(*args, **kwargs)
7527
7528 def SetWindowVariant(*args, **kwargs):
7529 """
7530 SetWindowVariant(self, int variant)
7531
79fccf9d
RD
7532 Sets the variant of the window/font size to use for this window, if
7533 the platform supports variants, for example, wxMac.
d55e5bfc
RD
7534 """
7535 return _core_.Window_SetWindowVariant(*args, **kwargs)
7536
7537 def GetWindowVariant(*args, **kwargs):
7538 """GetWindowVariant(self) -> int"""
7539 return _core_.Window_GetWindowVariant(*args, **kwargs)
7540
7541 def SetId(*args, **kwargs):
7542 """
7543 SetId(self, int winid)
7544
7545 Sets the identifier of the window. Each window has an integer
7546 identifier. If the application has not provided one, an identifier
7547 will be generated. Normally, the identifier should be provided on
7548 creation and should not be modified subsequently.
7549 """
7550 return _core_.Window_SetId(*args, **kwargs)
7551
7552 def GetId(*args, **kwargs):
7553 """
7554 GetId(self) -> int
7555
7556 Returns the identifier of the window. Each window has an integer
7557 identifier. If the application has not provided one (or the default Id
7558 -1 is used) then an unique identifier with a negative value will be
7559 generated.
7560 """
7561 return _core_.Window_GetId(*args, **kwargs)
7562
7563 def NewControlId(*args, **kwargs):
7564 """
c24da6d6 7565 NewControlId() -> int
d55e5bfc
RD
7566
7567 Generate a control id for the controls which were not given one.
7568 """
7569 return _core_.Window_NewControlId(*args, **kwargs)
7570
7571 NewControlId = staticmethod(NewControlId)
7572 def NextControlId(*args, **kwargs):
7573 """
c24da6d6 7574 NextControlId(int winid) -> int
d55e5bfc
RD
7575
7576 Get the id of the control following the one with the given
79fccf9d 7577 autogenerated) id
d55e5bfc
RD
7578 """
7579 return _core_.Window_NextControlId(*args, **kwargs)
7580
7581 NextControlId = staticmethod(NextControlId)
7582 def PrevControlId(*args, **kwargs):
7583 """
c24da6d6 7584 PrevControlId(int winid) -> int
d55e5bfc
RD
7585
7586 Get the id of the control preceding the one with the given
79fccf9d 7587 autogenerated) id
d55e5bfc
RD
7588 """
7589 return _core_.Window_PrevControlId(*args, **kwargs)
7590
7591 PrevControlId = staticmethod(PrevControlId)
7592 def SetSize(*args, **kwargs):
7593 """
7594 SetSize(self, Size size)
7595
7596 Sets the size of the window in pixels.
7597 """
7598 return _core_.Window_SetSize(*args, **kwargs)
7599
7600 def SetDimensions(*args, **kwargs):
7601 """
7602 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
7603
7604 Sets the position and size of the window in pixels. The sizeFlags
7605 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
7606 equal to -1.
7607
7608 ======================== ======================================
7609 wx.SIZE_AUTO A -1 indicates that a class-specific
7610 default should be used.
7611 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7612 -1 values are supplied.
7613 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7614 interpreted as real dimensions, not
7615 default values.
7616 ======================== ======================================
7617
d55e5bfc
RD
7618 """
7619 return _core_.Window_SetDimensions(*args, **kwargs)
7620
7621 def SetRect(*args, **kwargs):
7622 """
7623 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
7624
7625 Sets the position and size of the window in pixels using a wx.Rect.
7626 """
7627 return _core_.Window_SetRect(*args, **kwargs)
7628
7629 def SetSizeWH(*args, **kwargs):
7630 """
7631 SetSizeWH(self, int width, int height)
7632
7633 Sets the size of the window in pixels.
7634 """
7635 return _core_.Window_SetSizeWH(*args, **kwargs)
7636
7637 def Move(*args, **kwargs):
7638 """
7639 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
7640
7641 Moves the window to the given position.
7642 """
7643 return _core_.Window_Move(*args, **kwargs)
7644
7645 SetPosition = Move
7646 def MoveXY(*args, **kwargs):
7647 """
7648 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
7649
7650 Moves the window to the given position.
7651 """
7652 return _core_.Window_MoveXY(*args, **kwargs)
7653
f8167d6e
RD
7654 def SetBestFittingSize(*args, **kwargs):
7655 """
7656 SetBestFittingSize(self, Size size=DefaultSize)
7657
7658 A 'Smart' SetSize that will fill in default size components with the
7659 window's *best size* values. Also set's the minsize for use with sizers.
7660 """
7661 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7662
d55e5bfc
RD
7663 def Raise(*args, **kwargs):
7664 """
7665 Raise(self)
7666
9d7dfdff
RD
7667 Raises the window to the top of the window hierarchy. In current
7668 version of wxWidgets this works both for manage and child windows.
d55e5bfc
RD
7669 """
7670 return _core_.Window_Raise(*args, **kwargs)
7671
7672 def Lower(*args, **kwargs):
7673 """
7674 Lower(self)
7675
9d7dfdff
RD
7676 Lowers the window to the bottom of the window hierarchy. In current
7677 version of wxWidgets this works both for manage and child windows.
d55e5bfc
RD
7678 """
7679 return _core_.Window_Lower(*args, **kwargs)
7680
7681 def SetClientSize(*args, **kwargs):
7682 """
7683 SetClientSize(self, Size size)
7684
7685 This sets the size of the window client area in pixels. Using this
7686 function to size a window tends to be more device-independent than
7687 wx.Window.SetSize, since the application need not worry about what
7688 dimensions the border or title bar have when trying to fit the window
7689 around panel items, for example.
7690 """
7691 return _core_.Window_SetClientSize(*args, **kwargs)
7692
7693 def SetClientSizeWH(*args, **kwargs):
7694 """
7695 SetClientSizeWH(self, int width, int height)
7696
7697 This sets the size of the window client area in pixels. Using this
7698 function to size a window tends to be more device-independent than
7699 wx.Window.SetSize, since the application need not worry about what
7700 dimensions the border or title bar have when trying to fit the window
7701 around panel items, for example.
7702 """
7703 return _core_.Window_SetClientSizeWH(*args, **kwargs)
7704
7705 def SetClientRect(*args, **kwargs):
7706 """
7707 SetClientRect(self, Rect rect)
7708
7709 This sets the size of the window client area in pixels. Using this
7710 function to size a window tends to be more device-independent than
7711 wx.Window.SetSize, since the application need not worry about what
7712 dimensions the border or title bar have when trying to fit the window
7713 around panel items, for example.
7714 """
7715 return _core_.Window_SetClientRect(*args, **kwargs)
7716
7717 def GetPosition(*args, **kwargs):
7718 """
7719 GetPosition(self) -> Point
7720
1c71765a
RD
7721 Get the window's position. Notice that the position is in client
7722 coordinates for child windows and screen coordinates for the top level
7723 ones, use `GetScreenPosition` if you need screen coordinates for all
7724 kinds of windows.
d55e5bfc
RD
7725 """
7726 return _core_.Window_GetPosition(*args, **kwargs)
7727
7728 def GetPositionTuple(*args, **kwargs):
7729 """
7730 GetPositionTuple() -> (x,y)
7731
1c71765a
RD
7732 Get the window's position. Notice that the position is in client
7733 coordinates for child windows and screen coordinates for the top level
7734 ones, use `GetScreenPosition` if you need screen coordinates for all
7735 kinds of windows.
d55e5bfc
RD
7736 """
7737 return _core_.Window_GetPositionTuple(*args, **kwargs)
7738
1c71765a
RD
7739 def GetScreenPosition(*args, **kwargs):
7740 """
7741 GetScreenPosition(self) -> Point
7742
7743 Get the position of the window in screen coordinantes.
7744 """
7745 return _core_.Window_GetScreenPosition(*args, **kwargs)
7746
7747 def GetScreenPositionTuple(*args, **kwargs):
7748 """
7749 GetScreenPositionTuple() -> (x,y)
7750
7751 Get the position of the window in screen coordinantes.
7752 """
7753 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7754
7755 def GetScreenRect(*args, **kwargs):
7756 """
7757 GetScreenRect(self) -> Rect
7758
7759 Returns the size and position of the window in screen coordinantes as
7760 a `wx.Rect` object.
7761 """
7762 return _core_.Window_GetScreenRect(*args, **kwargs)
7763
d55e5bfc
RD
7764 def GetSize(*args, **kwargs):
7765 """
7766 GetSize(self) -> Size
7767
7768 Get the window size.
7769 """
7770 return _core_.Window_GetSize(*args, **kwargs)
7771
7772 def GetSizeTuple(*args, **kwargs):
7773 """
7774 GetSizeTuple() -> (width, height)
7775
7776 Get the window size.
7777 """
7778 return _core_.Window_GetSizeTuple(*args, **kwargs)
7779
7780 def GetRect(*args, **kwargs):
7781 """
7782 GetRect(self) -> Rect
7783
1c71765a 7784 Returns the size and position of the window as a `wx.Rect` object.
d55e5bfc
RD
7785 """
7786 return _core_.Window_GetRect(*args, **kwargs)
7787
7788 def GetClientSize(*args, **kwargs):
7789 """
7790 GetClientSize(self) -> Size
7791
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.
7795 """
7796 return _core_.Window_GetClientSize(*args, **kwargs)
7797
7798 def GetClientSizeTuple(*args, **kwargs):
7799 """
7800 GetClientSizeTuple() -> (width, height)
7801
7802 This gets the size of the window's 'client area' in pixels. The client
7803 area is the area which may be drawn on by the programmer, excluding
7804 title bar, border, scrollbars, etc.
7805 """
7806 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
7807
7808 def GetClientAreaOrigin(*args, **kwargs):
7809 """
7810 GetClientAreaOrigin(self) -> Point
7811
7812 Get the origin of the client area of the window relative to the
7813 window's top left corner (the client area may be shifted because of
7814 the borders, scrollbars, other decorations...)
7815 """
7816 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
7817
7818 def GetClientRect(*args, **kwargs):
7819 """
7820 GetClientRect(self) -> Rect
7821
629f3c1b 7822 Get the client area position and size as a `wx.Rect` object.
d55e5bfc
RD
7823 """
7824 return _core_.Window_GetClientRect(*args, **kwargs)
7825
7826 def GetBestSize(*args, **kwargs):
7827 """
7828 GetBestSize(self) -> Size
7829
248ed943 7830 This function returns the best acceptable minimal size for the
79fccf9d
RD
7831 window, if applicable. For example, for a static text control, it will
7832 be the minimal size such that the control label is not truncated. For
7833 windows containing subwindows (suzh aswx.Panel), the size returned by
7834 this function will be the same as the size the window would have had
7835 after calling Fit.
d55e5bfc
RD
7836 """
7837 return _core_.Window_GetBestSize(*args, **kwargs)
7838
7839 def GetBestSizeTuple(*args, **kwargs):
7840 """
7841 GetBestSizeTuple() -> (width, height)
7842
248ed943 7843 This function returns the best acceptable minimal size for the
79fccf9d
RD
7844 window, if applicable. For example, for a static text control, it will
7845 be the minimal size such that the control label is not truncated. For
7846 windows containing subwindows (suzh aswx.Panel), the size returned by
7847 this function will be the same as the size the window would have had
7848 after calling Fit.
d55e5bfc
RD
7849 """
7850 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
7851
a001823c
RD
7852 def InvalidateBestSize(*args, **kwargs):
7853 """
7854 InvalidateBestSize(self)
7855
7856 Reset the cached best size value so it will be recalculated the next
7857 time it is needed.
7858 """
7859 return _core_.Window_InvalidateBestSize(*args, **kwargs)
7860
e2813725
RD
7861 def CacheBestSize(*args, **kwargs):
7862 """
7863 CacheBestSize(self, Size size)
7864
7865 Cache the best size so it doesn't need to be calculated again, (at least until
7866 some properties of the window change.)
7867 """
7868 return _core_.Window_CacheBestSize(*args, **kwargs)
7869
a001823c
RD
7870 def GetBestFittingSize(*args, **kwargs):
7871 """
7872 GetBestFittingSize(self) -> Size
7873
7874 This function will merge the window's best size into the window's
7875 minimum size, giving priority to the min size components, and returns
7876 the results.
7877
7878 """
7879 return _core_.Window_GetBestFittingSize(*args, **kwargs)
7880
d55e5bfc
RD
7881 def GetAdjustedBestSize(*args, **kwargs):
7882 """
7883 GetAdjustedBestSize(self) -> Size
7884
7885 This method is similar to GetBestSize, except in one
7886 thing. GetBestSize should return the minimum untruncated size of the
7887 window, while this method will return the largest of BestSize and any
7888 user specified minimum size. ie. it is the minimum size the window
7889 should currently be drawn at, not the minimal size it can possibly
7890 tolerate.
7891 """
7892 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
7893
7894 def Center(*args, **kwargs):
7895 """
7896 Center(self, int direction=BOTH)
7897
7898 Centers the window. The parameter specifies the direction for
7899 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7900 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7901 on the entire screen and not on its parent window. If it is a
7902 top-level window and has no parent then it will always be centered
7903 relative to the screen.
7904 """
7905 return _core_.Window_Center(*args, **kwargs)
7906
7907 Centre = Center
d55e5bfc
RD
7908 def CenterOnParent(*args, **kwargs):
7909 """
7910 CenterOnParent(self, int dir=BOTH)
7911
7912 Center with respect to the the parent window
7913 """
7914 return _core_.Window_CenterOnParent(*args, **kwargs)
7915
7916 CentreOnParent = CenterOnParent
7917 def Fit(*args, **kwargs):
7918 """
7919 Fit(self)
7920
7921 Sizes the window so that it fits around its subwindows. This function
7922 won't do anything if there are no subwindows and will only really work
7923 correctly if sizers are used for the subwindows layout. Also, if the
7924 window has exactly one subwindow it is better (faster and the result
7925 is more precise as Fit adds some margin to account for fuzziness of
7926 its calculations) to call window.SetClientSize(child.GetSize())
7927 instead of calling Fit.
7928 """
7929 return _core_.Window_Fit(*args, **kwargs)
7930
7931 def FitInside(*args, **kwargs):
7932 """
7933 FitInside(self)
7934
7935 Similar to Fit, but sizes the interior (virtual) size of a
7936 window. Mainly useful with scrolled windows to reset scrollbars after
7937 sizing changes that do not trigger a size event, and/or scrolled
7938 windows without an interior sizer. This function similarly won't do
7939 anything if there are no subwindows.
7940 """
7941 return _core_.Window_FitInside(*args, **kwargs)
7942
03837c5c 7943 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
7944 """
7945 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
7946 int incH=-1)
d55e5bfc
RD
7947
7948 Allows specification of minimum and maximum window sizes, and window
7949 size increments. If a pair of values is not set (or set to -1), the
7950 default values will be used. If this function is called, the user
908b74cd
RD
7951 will not be able to size the window outside the given bounds (if it is
7952 a top-level window.) Sizers will also inspect the minimum window size
7953 and will use that value if set when calculating layout.
7954
7955 The resizing increments are only significant under Motif or Xt.
d55e5bfc 7956 """
03837c5c 7957 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 7958
03837c5c
RD
7959 def SetSizeHintsSz(*args, **kwargs):
7960 """
7961 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
7962
7963 Allows specification of minimum and maximum window sizes, and window
7964 size increments. If a pair of values is not set (or set to -1), the
7965 default values will be used. If this function is called, the user
7966 will not be able to size the window outside the given bounds (if it is
7967 a top-level window.) Sizers will also inspect the minimum window size
7968 and will use that value if set when calculating layout.
7969
7970 The resizing increments are only significant under Motif or Xt.
7971 """
7972 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
7973
7974 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 7975 """
908b74cd 7976 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
7977
7978 Allows specification of minimum and maximum virtual window sizes. If a
7979 pair of values is not set (or set to -1), the default values will be
7980 used. If this function is called, the user will not be able to size
7981 the virtual area of the window outside the given bounds.
7982 """
03837c5c
RD
7983 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
7984
7985 def SetVirtualSizeHintsSz(*args, **kwargs):
7986 """
7987 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
7988
7989 Allows specification of minimum and maximum virtual window sizes. If a
7990 pair of values is not set (or set to -1), the default values will be
7991 used. If this function is called, the user will not be able to size
7992 the virtual area of the window outside the given bounds.
7993 """
7994 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 7995
908b74cd
RD
7996 def GetMaxSize(*args, **kwargs):
7997 """GetMaxSize(self) -> Size"""
7998 return _core_.Window_GetMaxSize(*args, **kwargs)
7999
8000 def GetMinSize(*args, **kwargs):
8001 """GetMinSize(self) -> Size"""
8002 return _core_.Window_GetMinSize(*args, **kwargs)
8003
8004 def SetMinSize(*args, **kwargs):
8005 """
8006 SetMinSize(self, Size minSize)
8007
8008 A more convenient method than `SetSizeHints` for setting just the
8009 min size.
8010 """
8011 return _core_.Window_SetMinSize(*args, **kwargs)
8012
8013 def SetMaxSize(*args, **kwargs):
8014 """
8015 SetMaxSize(self, Size maxSize)
8016
8017 A more convenient method than `SetSizeHints` for setting just the
8018 max size.
8019 """
8020 return _core_.Window_SetMaxSize(*args, **kwargs)
8021
d55e5bfc
RD
8022 def GetMinWidth(*args, **kwargs):
8023 """GetMinWidth(self) -> int"""
8024 return _core_.Window_GetMinWidth(*args, **kwargs)
8025
8026 def GetMinHeight(*args, **kwargs):
8027 """GetMinHeight(self) -> int"""
8028 return _core_.Window_GetMinHeight(*args, **kwargs)
8029
8030 def GetMaxWidth(*args, **kwargs):
8031 """GetMaxWidth(self) -> int"""
8032 return _core_.Window_GetMaxWidth(*args, **kwargs)
8033
8034 def GetMaxHeight(*args, **kwargs):
8035 """GetMaxHeight(self) -> int"""
8036 return _core_.Window_GetMaxHeight(*args, **kwargs)
8037
d55e5bfc
RD
8038 def SetVirtualSize(*args, **kwargs):
8039 """
8040 SetVirtualSize(self, Size size)
8041
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.
8045 """
8046 return _core_.Window_SetVirtualSize(*args, **kwargs)
8047
8048 def SetVirtualSizeWH(*args, **kwargs):
8049 """
8050 SetVirtualSizeWH(self, int w, int h)
8051
8052 Set the the virtual size of a window in pixels. For most windows this
8053 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.
8055 """
8056 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
8057
8058 def GetVirtualSize(*args, **kwargs):
8059 """
8060 GetVirtualSize(self) -> Size
8061
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.
8065 """
8066 return _core_.Window_GetVirtualSize(*args, **kwargs)
8067
8068 def GetVirtualSizeTuple(*args, **kwargs):
8069 """
8070 GetVirtualSizeTuple() -> (width, height)
8071
8072 Get the the virtual size of the window in pixels. For most windows
8073 this is just the client area of the window, but for some like scrolled
8074 windows it is more or less independent of the screen window size.
8075 """
8076 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
8077
8078 def GetBestVirtualSize(*args, **kwargs):
8079 """
8080 GetBestVirtualSize(self) -> Size
8081
8082 Return the largest of ClientSize and BestSize (as determined by a
8083 sizer, interior children, or other means)
8084 """
8085 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
8086
8087 def Show(*args, **kwargs):
8088 """
8089 Show(self, bool show=True) -> bool
8090
8091 Shows or hides the window. You may need to call Raise for a top level
8092 window if you want to bring it to top, although this is not needed if
8093 Show is called immediately after the frame creation. Returns True if
8094 the window has been shown or hidden or False if nothing was done
8095 because it already was in the requested state.
8096 """
8097 return _core_.Window_Show(*args, **kwargs)
8098
8099 def Hide(*args, **kwargs):
8100 """
8101 Hide(self) -> bool
8102
8103 Equivalent to calling Show(False).
8104 """
8105 return _core_.Window_Hide(*args, **kwargs)
8106
8107 def Enable(*args, **kwargs):
8108 """
8109 Enable(self, bool enable=True) -> bool
8110
8111 Enable or disable the window for user input. Note that when a parent
8112 window is disabled, all of its children are disabled as well and they
8113 are reenabled again when the parent is. Returns true if the window
8114 has been enabled or disabled, false if nothing was done, i.e. if the
8115 window had already been in the specified state.
8116 """
8117 return _core_.Window_Enable(*args, **kwargs)
8118
8119 def Disable(*args, **kwargs):
8120 """
8121 Disable(self) -> bool
8122
8123 Disables the window, same as Enable(false).
8124 """
8125 return _core_.Window_Disable(*args, **kwargs)
8126
8127 def IsShown(*args, **kwargs):
8128 """
8129 IsShown(self) -> bool
8130
8131 Returns true if the window is shown, false if it has been hidden.
8132 """
8133 return _core_.Window_IsShown(*args, **kwargs)
8134
8135 def IsEnabled(*args, **kwargs):
8136 """
8137 IsEnabled(self) -> bool
8138
8139 Returns true if the window is enabled for input, false otherwise.
8140 """
8141 return _core_.Window_IsEnabled(*args, **kwargs)
8142
8143 def SetWindowStyleFlag(*args, **kwargs):
8144 """
8145 SetWindowStyleFlag(self, long style)
8146
79fccf9d
RD
8147 Sets the style of the window. Please note that some styles cannot be
8148 changed after the window creation and that Refresh() might need to be
8149 called after changing the others for the change to take place
8150 immediately.
d55e5bfc
RD
8151 """
8152 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
8153
8154 def GetWindowStyleFlag(*args, **kwargs):
8155 """
8156 GetWindowStyleFlag(self) -> long
8157
8158 Gets the window style that was passed to the constructor or Create
8159 method.
8160 """
8161 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
8162
8163 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8164 def HasFlag(*args, **kwargs):
8165 """
8166 HasFlag(self, int flag) -> bool
8167
8168 Test if the given style is set for this window.
8169 """
8170 return _core_.Window_HasFlag(*args, **kwargs)
8171
8172 def IsRetained(*args, **kwargs):
8173 """
8174 IsRetained(self) -> bool
8175
8176 Returns true if the window is retained, false otherwise. Retained
8177 windows are only available on X platforms.
8178 """
8179 return _core_.Window_IsRetained(*args, **kwargs)
8180
8181 def SetExtraStyle(*args, **kwargs):
8182 """
8183 SetExtraStyle(self, long exStyle)
8184
8185 Sets the extra style bits for the window. Extra styles are the less
8186 often used style bits which can't be set with the constructor or with
8187 SetWindowStyleFlag()
8188 """
8189 return _core_.Window_SetExtraStyle(*args, **kwargs)
8190
8191 def GetExtraStyle(*args, **kwargs):
8192 """
8193 GetExtraStyle(self) -> long
8194
8195 Returns the extra style bits for the window.
8196 """
8197 return _core_.Window_GetExtraStyle(*args, **kwargs)
8198
8199 def MakeModal(*args, **kwargs):
8200 """
8201 MakeModal(self, bool modal=True)
8202
8203 Disables all other windows in the application so that the user can
8204 only interact with this window. Passing False will reverse this
8205 effect.
8206 """
8207 return _core_.Window_MakeModal(*args, **kwargs)
8208
8209 def SetThemeEnabled(*args, **kwargs):
8210 """
8211 SetThemeEnabled(self, bool enableTheme)
8212
8213 This function tells a window if it should use the system's "theme"
8214 code to draw the windows' background instead if its own background
8215 drawing code. This will only have an effect on platforms that support
8216 the notion of themes in user defined windows. One such platform is
8217 GTK+ where windows can have (very colourful) backgrounds defined by a
8218 user's selected theme.
8219
8220 Dialogs, notebook pages and the status bar have this flag set to true
8221 by default so that the default look and feel is simulated best.
8222 """
8223 return _core_.Window_SetThemeEnabled(*args, **kwargs)
8224
8225 def GetThemeEnabled(*args, **kwargs):
8226 """
8227 GetThemeEnabled(self) -> bool
8228
8229 Return the themeEnabled flag.
8230 """
8231 return _core_.Window_GetThemeEnabled(*args, **kwargs)
8232
8233 def SetFocus(*args, **kwargs):
8234 """
8235 SetFocus(self)
8236
8237 Set's the focus to this window, allowing it to receive keyboard input.
8238 """
8239 return _core_.Window_SetFocus(*args, **kwargs)
8240
8241 def SetFocusFromKbd(*args, **kwargs):
8242 """
8243 SetFocusFromKbd(self)
8244
8245 Set focus to this window as the result of a keyboard action. Normally
8246 only called internally.
8247 """
8248 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
8249
8250 def FindFocus(*args, **kwargs):
8251 """
c24da6d6 8252 FindFocus() -> Window
d55e5bfc
RD
8253
8254 Returns the window or control that currently has the keyboard focus,
8255 or None.
8256 """
8257 return _core_.Window_FindFocus(*args, **kwargs)
8258
8259 FindFocus = staticmethod(FindFocus)
8260 def AcceptsFocus(*args, **kwargs):
8261 """
8262 AcceptsFocus(self) -> bool
8263
8264 Can this window have focus?
8265 """
8266 return _core_.Window_AcceptsFocus(*args, **kwargs)
8267
8268 def AcceptsFocusFromKeyboard(*args, **kwargs):
8269 """
8270 AcceptsFocusFromKeyboard(self) -> bool
8271
8272 Can this window be given focus by keyboard navigation? if not, the
8273 only way to give it focus (provided it accepts it at all) is to click
8274 it.
8275 """
8276 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
8277
8278 def GetDefaultItem(*args, **kwargs):
8279 """
8280 GetDefaultItem(self) -> Window
8281
8282 Get the default child of this parent, i.e. the one which is activated
8283 by pressing <Enter> such as the OK button on a wx.Dialog.
8284 """
8285 return _core_.Window_GetDefaultItem(*args, **kwargs)
8286
8287 def SetDefaultItem(*args, **kwargs):
8288 """
8289 SetDefaultItem(self, Window child) -> Window
8290
8291 Set this child as default, return the old default.
8292 """
8293 return _core_.Window_SetDefaultItem(*args, **kwargs)
8294
8295 def SetTmpDefaultItem(*args, **kwargs):
8296 """
8297 SetTmpDefaultItem(self, Window win)
8298
8299 Set this child as temporary default
8300 """
8301 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
8302
908b74cd
RD
8303 def Navigate(*args, **kwargs):
8304 """
8305 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8306
a8eff060
RD
8307 Does keyboard navigation from this window to another, by sending a
8308 `wx.NavigationKeyEvent`.
908b74cd
RD
8309 """
8310 return _core_.Window_Navigate(*args, **kwargs)
8311
bf26d883
RD
8312 def MoveAfterInTabOrder(*args, **kwargs):
8313 """
8314 MoveAfterInTabOrder(self, Window win)
8315
8316 Moves this window in the tab navigation order after the specified
8317 sibling window. This means that when the user presses the TAB key on
8318 that other window, the focus switches to this window.
8319
8320 The default tab order is the same as creation order. This function
8321 and `MoveBeforeInTabOrder` allow to change it after creating all the
8322 windows.
8323
8324 """
8325 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8326
8327 def MoveBeforeInTabOrder(*args, **kwargs):
8328 """
8329 MoveBeforeInTabOrder(self, Window win)
8330
8331 Same as `MoveAfterInTabOrder` except that it inserts this window just
8332 before win instead of putting it right after it.
8333 """
8334 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8335
d55e5bfc
RD
8336 def GetChildren(*args, **kwargs):
8337 """
8338 GetChildren(self) -> PyObject
8339
8340 Returns a list of the window's children. NOTE: Currently this is a
8341 copy of the child window list maintained by the window, so the return
8342 value of this function is only valid as long as the window's children
8343 do not change.
8344 """
8345 return _core_.Window_GetChildren(*args, **kwargs)
8346
8347 def GetParent(*args, **kwargs):
8348 """
8349 GetParent(self) -> Window
8350
8351 Returns the parent window of this window, or None if there isn't one.
8352 """
8353 return _core_.Window_GetParent(*args, **kwargs)
8354
8355 def GetGrandParent(*args, **kwargs):
8356 """
8357 GetGrandParent(self) -> Window
8358
79fccf9d
RD
8359 Returns the parent of the parent of this window, or None if there
8360 isn't one.
d55e5bfc
RD
8361 """
8362 return _core_.Window_GetGrandParent(*args, **kwargs)
8363
8364 def IsTopLevel(*args, **kwargs):
8365 """
8366 IsTopLevel(self) -> bool
8367
8368 Returns true if the given window is a top-level one. Currently all
8369 frames and dialogs are always considered to be top-level windows (even
8370 if they have a parent window).
8371 """
8372 return _core_.Window_IsTopLevel(*args, **kwargs)
8373
8374 def Reparent(*args, **kwargs):
8375 """
8376 Reparent(self, Window newParent) -> bool
8377
8378 Reparents the window, i.e the window will be removed from its current
8379 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8380 re-inserted into another. Available on Windows and GTK. Returns True
8381 if the parent was changed, False otherwise (error or newParent ==
8382 oldParent)
8383 """
8384 return _core_.Window_Reparent(*args, **kwargs)
8385
8386 def AddChild(*args, **kwargs):
8387 """
8388 AddChild(self, Window child)
8389
8390 Adds a child window. This is called automatically by window creation
8391 functions so should not be required by the application programmer.
8392 """
8393 return _core_.Window_AddChild(*args, **kwargs)
8394
8395 def RemoveChild(*args, **kwargs):
8396 """
8397 RemoveChild(self, Window child)
8398
8399 Removes a child window. This is called automatically by window
8400 deletion functions so should not be required by the application
8401 programmer.
8402 """
8403 return _core_.Window_RemoveChild(*args, **kwargs)
8404
704eda0c
RD
8405 def SetDoubleBuffered(*args, **kwargs):
8406 """
8407 SetDoubleBuffered(self, bool on)
8408
8409 Currently wxGTK2 only.
8410 """
8411 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8412
d55e5bfc
RD
8413 def FindWindowById(*args, **kwargs):
8414 """
8415 FindWindowById(self, long winid) -> Window
8416
8417 Find a chld of this window by window ID
8418 """
8419 return _core_.Window_FindWindowById(*args, **kwargs)
8420
8421 def FindWindowByName(*args, **kwargs):
8422 """
8423 FindWindowByName(self, String name) -> Window
8424
8425 Find a child of this window by name
8426 """
8427 return _core_.Window_FindWindowByName(*args, **kwargs)
8428
8429 def GetEventHandler(*args, **kwargs):
8430 """
8431 GetEventHandler(self) -> EvtHandler
8432
8433 Returns the event handler for this window. By default, the window is
8434 its own event handler.
8435 """
8436 return _core_.Window_GetEventHandler(*args, **kwargs)
8437
8438 def SetEventHandler(*args, **kwargs):
8439 """
8440 SetEventHandler(self, EvtHandler handler)
8441
8442 Sets the event handler for this window. An event handler is an object
8443 that is capable of processing the events sent to a window. By default,
8444 the window is its own event handler, but an application may wish to
8445 substitute another, for example to allow central implementation of
8446 event-handling for a variety of different window classes.
8447
79fccf9d 8448 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
8449 up a chain of event handlers, where an event not handled by one event
8450 handler is handed to the next one in the chain.
8451 """
8452 return _core_.Window_SetEventHandler(*args, **kwargs)
8453
8454 def PushEventHandler(*args, **kwargs):
8455 """
8456 PushEventHandler(self, EvtHandler handler)
8457
8458 Pushes this event handler onto the event handler stack for the window.
8459 An event handler is an object that is capable of processing the events
8460 sent to a window. By default, the window is its own event handler, but
8461 an application may wish to substitute another, for example to allow
8462 central implementation of event-handling for a variety of different
8463 window classes.
8464
8465 wx.Window.PushEventHandler allows an application to set up a chain of
8466 event handlers, where an event not handled by one event handler is
79fccf9d 8467 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
8468 remove the event handler.
8469 """
8470 return _core_.Window_PushEventHandler(*args, **kwargs)
8471
8472 def PopEventHandler(*args, **kwargs):
8473 """
8474 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
8475
8476 Removes and returns the top-most event handler on the event handler
8477 stack. If deleteHandler is True then the wx.EvtHandler object will be
8478 destroyed after it is popped.
8479 """
8480 return _core_.Window_PopEventHandler(*args, **kwargs)
8481
8482 def RemoveEventHandler(*args, **kwargs):
8483 """
8484 RemoveEventHandler(self, EvtHandler handler) -> bool
8485
79fccf9d
RD
8486 Find the given handler in the event handler chain and remove (but not
8487 delete) it from the event handler chain, return True if it was found
8488 and False otherwise (this also results in an assert failure so this
8489 function should only be called when the handler is supposed to be
8490 there.)
d55e5bfc
RD
8491 """
8492 return _core_.Window_RemoveEventHandler(*args, **kwargs)
8493
8494 def SetValidator(*args, **kwargs):
8495 """
8496 SetValidator(self, Validator validator)
8497
8498 Deletes the current validator (if any) and sets the window validator,
8499 having called wx.Validator.Clone to create a new validator of this
8500 type.
8501 """
8502 return _core_.Window_SetValidator(*args, **kwargs)
8503
8504 def GetValidator(*args, **kwargs):
8505 """
8506 GetValidator(self) -> Validator
8507
8508 Returns a pointer to the current validator for the window, or None if
8509 there is none.
8510 """
8511 return _core_.Window_GetValidator(*args, **kwargs)
8512
8513 def Validate(*args, **kwargs):
8514 """
8515 Validate(self) -> bool
8516
8517 Validates the current values of the child controls using their
79fccf9d
RD
8518 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8519 style flag set, the method will also call Validate() of all child
8520 windows. Returns false if any of the validations failed.
d55e5bfc
RD
8521 """
8522 return _core_.Window_Validate(*args, **kwargs)
8523
8524 def TransferDataToWindow(*args, **kwargs):
8525 """
8526 TransferDataToWindow(self) -> bool
8527
79fccf9d
RD
8528 Transfers values to child controls from data areas specified by their
8529 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8530 style flag set, the method will also call TransferDataToWindow() of
8531 all child windows.
d55e5bfc
RD
8532 """
8533 return _core_.Window_TransferDataToWindow(*args, **kwargs)
8534
8535 def TransferDataFromWindow(*args, **kwargs):
8536 """
8537 TransferDataFromWindow(self) -> bool
8538
79fccf9d
RD
8539 Transfers values from child controls to data areas specified by their
8540 validators. Returns false if a transfer failed. If the window has
8541 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8542 also call TransferDataFromWindow() of all child windows.
d55e5bfc
RD
8543 """
8544 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
8545
8546 def InitDialog(*args, **kwargs):
8547 """
8548 InitDialog(self)
8549
79fccf9d
RD
8550 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8551 to the dialog via validators.
d55e5bfc
RD
8552 """
8553 return _core_.Window_InitDialog(*args, **kwargs)
8554
8555 def SetAcceleratorTable(*args, **kwargs):
8556 """
8557 SetAcceleratorTable(self, AcceleratorTable accel)
8558
8559 Sets the accelerator table for this window.
8560 """
8561 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
8562
8563 def GetAcceleratorTable(*args, **kwargs):
8564 """
8565 GetAcceleratorTable(self) -> AcceleratorTable
8566
8567 Gets the accelerator table for this window.
8568 """
8569 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
8570
8571 def RegisterHotKey(*args, **kwargs):
8572 """
8573 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8574
8575 Registers a system wide hotkey. Every time the user presses the hotkey
8576 registered here, this window will receive a hotkey event. It will
8577 receive the event even if the application is in the background and
8578 does not have the input focus because the user is working with some
8579 other application. To bind an event handler function to this hotkey
8580 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8581 hotkey was registered successfully.
8582 """
8583 return _core_.Window_RegisterHotKey(*args, **kwargs)
8584
8585 def UnregisterHotKey(*args, **kwargs):
8586 """
8587 UnregisterHotKey(self, int hotkeyId) -> bool
8588
8589 Unregisters a system wide hotkey.
8590 """
8591 return _core_.Window_UnregisterHotKey(*args, **kwargs)
8592
8593 def ConvertDialogPointToPixels(*args, **kwargs):
8594 """
8595 ConvertDialogPointToPixels(self, Point pt) -> Point
8596
8597 Converts a point or size from dialog units to pixels. Dialog units
8598 are used for maintaining a dialog's proportions even if the font
8599 changes. For the x dimension, the dialog units are multiplied by the
8600 average character width and then divided by 4. For the y dimension,
8601 the dialog units are multiplied by the average character height and
8602 then divided by 8.
8603 """
8604 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
8605
8606 def ConvertDialogSizeToPixels(*args, **kwargs):
8607 """
8608 ConvertDialogSizeToPixels(self, Size sz) -> Size
8609
8610 Converts a point or size from dialog units to pixels. Dialog units
8611 are used for maintaining a dialog's proportions even if the font
8612 changes. For the x dimension, the dialog units are multiplied by the
8613 average character width and then divided by 4. For the y dimension,
8614 the dialog units are multiplied by the average character height and
8615 then divided by 8.
8616 """
8617 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
8618
8619 def DLG_PNT(*args, **kwargs):
8620 """
8621 DLG_PNT(self, Point pt) -> Point
8622
8623 Converts a point or size from dialog units to pixels. Dialog units
8624 are used for maintaining a dialog's proportions even if the font
8625 changes. For the x dimension, the dialog units are multiplied by the
8626 average character width and then divided by 4. For the y dimension,
8627 the dialog units are multiplied by the average character height and
8628 then divided by 8.
8629 """
8630 return _core_.Window_DLG_PNT(*args, **kwargs)
8631
8632 def DLG_SZE(*args, **kwargs):
8633 """
8634 DLG_SZE(self, Size sz) -> Size
8635
8636 Converts a point or size from dialog units to pixels. Dialog units
8637 are used for maintaining a dialog's proportions even if the font
8638 changes. For the x dimension, the dialog units are multiplied by the
8639 average character width and then divided by 4. For the y dimension,
8640 the dialog units are multiplied by the average character height and
8641 then divided by 8.
8642 """
8643 return _core_.Window_DLG_SZE(*args, **kwargs)
8644
8645 def ConvertPixelPointToDialog(*args, **kwargs):
8646 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8647 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
8648
8649 def ConvertPixelSizeToDialog(*args, **kwargs):
8650 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8651 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
8652
8653 def WarpPointer(*args, **kwargs):
8654 """
8655 WarpPointer(self, int x, int y)
8656
8657 Moves the pointer to the given position on the window.
8658
8659 NOTE: This function is not supported under Mac because Apple Human
8660 Interface Guidelines forbid moving the mouse cursor programmatically.
8661 """
8662 return _core_.Window_WarpPointer(*args, **kwargs)
8663
8664 def CaptureMouse(*args, **kwargs):
8665 """
8666 CaptureMouse(self)
8667
8668 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8669 release the capture.
8670
8671 Note that wxWindows maintains the stack of windows having captured the
8672 mouse and when the mouse is released the capture returns to the window
8673 which had had captured it previously and it is only really released if
8674 there were no previous window. In particular, this means that you must
8675 release the mouse as many times as you capture it.
8676 """
8677 return _core_.Window_CaptureMouse(*args, **kwargs)
8678
8679 def ReleaseMouse(*args, **kwargs):
8680 """
8681 ReleaseMouse(self)
8682
8683 Releases mouse input captured with wx.Window.CaptureMouse.
8684 """
8685 return _core_.Window_ReleaseMouse(*args, **kwargs)
8686
8687 def GetCapture(*args, **kwargs):
8688 """
c24da6d6 8689 GetCapture() -> Window
d55e5bfc
RD
8690
8691 Returns the window which currently captures the mouse or None
8692 """
8693 return _core_.Window_GetCapture(*args, **kwargs)
8694
8695 GetCapture = staticmethod(GetCapture)
8696 def HasCapture(*args, **kwargs):
8697 """
8698 HasCapture(self) -> bool
8699
8700 Returns true if this window has the current mouse capture.
8701 """
8702 return _core_.Window_HasCapture(*args, **kwargs)
8703
8704 def Refresh(*args, **kwargs):
8705 """
8706 Refresh(self, bool eraseBackground=True, Rect rect=None)
8707
8708 Mark the specified rectangle (or the whole window) as "dirty" so it
8709 will be repainted. Causes an EVT_PAINT event to be generated and sent
8710 to the window.
8711 """
8712 return _core_.Window_Refresh(*args, **kwargs)
8713
8714 def RefreshRect(*args, **kwargs):
8715 """
fef4c27a 8716 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
8717
8718 Redraws the contents of the given rectangle: the area inside it will
8719 be repainted. This is the same as Refresh but has a nicer syntax.
8720 """
8721 return _core_.Window_RefreshRect(*args, **kwargs)
8722
8723 def Update(*args, **kwargs):
8724 """
8725 Update(self)
8726
8727 Calling this method immediately repaints the invalidated area of the
8728 window instead of waiting for the EVT_PAINT event to happen, (normally
8729 this would usually only happen when the flow of control returns to the
8730 event loop.) Notice that this function doesn't refresh the window and
8731 does nothing if the window has been already repainted. Use Refresh
8732 first if you want to immediately redraw the window (or some portion of
8733 it) unconditionally.
8734 """
8735 return _core_.Window_Update(*args, **kwargs)
8736
8737 def ClearBackground(*args, **kwargs):
8738 """
8739 ClearBackground(self)
8740
8741 Clears the window by filling it with the current background
8742 colour. Does not cause an erase background event to be generated.
8743 """
8744 return _core_.Window_ClearBackground(*args, **kwargs)
8745
8746 def Freeze(*args, **kwargs):
8747 """
8748 Freeze(self)
8749
79fccf9d
RD
8750 Freezes the window or, in other words, prevents any updates from
8751 taking place on screen, the window is not redrawn at all. Thaw must be
8752 called to reenable window redrawing. Calls to Freeze/Thaw may be
8753 nested, with the actual Thaw being delayed until all the nesting has
8754 been undone.
d55e5bfc
RD
8755
8756 This method is useful for visual appearance optimization (for example,
8757 it is a good idea to use it before inserting large amount of text into
8758 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8759 for all controls so it is mostly just a hint to wxWindows and not a
8760 mandatory directive.
8761 """
8762 return _core_.Window_Freeze(*args, **kwargs)
8763
8764 def Thaw(*args, **kwargs):
8765 """
8766 Thaw(self)
8767
8768 Reenables window updating after a previous call to Freeze. Calls to
79fccf9d
RD
8769 Freeze/Thaw may be nested, so Thaw must be called the same number of
8770 times that Freeze was before the window will be updated.
d55e5bfc
RD
8771 """
8772 return _core_.Window_Thaw(*args, **kwargs)
8773
8774 def PrepareDC(*args, **kwargs):
8775 """
8776 PrepareDC(self, DC dc)
8777
8778 Call this function to prepare the device context for drawing a
8779 scrolled image. It sets the device origin according to the current
8780 scroll position.
8781 """
8782 return _core_.Window_PrepareDC(*args, **kwargs)
8783
8784 def GetUpdateRegion(*args, **kwargs):
8785 """
8786 GetUpdateRegion(self) -> Region
8787
8788 Returns the region specifying which parts of the window have been
8789 damaged. Should only be called within an EVT_PAINT handler.
8790 """
8791 return _core_.Window_GetUpdateRegion(*args, **kwargs)
8792
8793 def GetUpdateClientRect(*args, **kwargs):
8794 """
8795 GetUpdateClientRect(self) -> Rect
8796
8797 Get the update rectangle region bounding box in client coords.
8798 """
8799 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
8800
8801 def IsExposed(*args, **kwargs):
8802 """
8803 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8804
8805 Returns true if the given point or rectangle area has been exposed
8806 since the last repaint. Call this in an paint event handler to
8807 optimize redrawing by only redrawing those areas, which have been
8808 exposed.
8809 """
8810 return _core_.Window_IsExposed(*args, **kwargs)
8811
8812 def IsExposedPoint(*args, **kwargs):
8813 """
8814 IsExposedPoint(self, Point pt) -> bool
8815
8816 Returns true if the given point or rectangle area has been exposed
8817 since the last repaint. Call this in an paint event handler to
8818 optimize redrawing by only redrawing those areas, which have been
8819 exposed.
8820 """
8821 return _core_.Window_IsExposedPoint(*args, **kwargs)
8822
8823 def IsExposedRect(*args, **kwargs):
8824 """
8825 IsExposedRect(self, Rect rect) -> bool
8826
8827 Returns true if the given point or rectangle area has been exposed
8828 since the last repaint. Call this in an paint event handler to
8829 optimize redrawing by only redrawing those areas, which have been
8830 exposed.
8831 """
8832 return _core_.Window_IsExposedRect(*args, **kwargs)
8833
8834 def GetDefaultAttributes(*args, **kwargs):
8835 """
8836 GetDefaultAttributes(self) -> VisualAttributes
8837
79fccf9d
RD
8838 Get the default attributes for an instance of this class. This is
8839 useful if you want to use the same font or colour in your own control
8840 as in a standard control -- which is a much better idea than hard
8841 coding specific colours or fonts which might look completely out of
caef1a4d 8842 place on the user's system, especially if it uses themes.
d55e5bfc
RD
8843 """
8844 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
8845
8846 def GetClassDefaultAttributes(*args, **kwargs):
8847 """
c24da6d6 8848 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 8849
79fccf9d
RD
8850 Get the default attributes for this class. This is useful if you want
8851 to use the same font or colour in your own control as in a standard
8852 control -- which is a much better idea than hard coding specific
caef1a4d
RD
8853 colours or fonts which might look completely out of place on the
8854 user's system, especially if it uses themes.
d55e5bfc
RD
8855
8856 The variant parameter is only relevant under Mac currently and is
79fccf9d 8857 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
8858 the returned font. See `wx.Window.SetWindowVariant` for more about
8859 this.
d55e5bfc
RD
8860 """
8861 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
8862
8863 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8864 def SetBackgroundColour(*args, **kwargs):
8865 """
8866 SetBackgroundColour(self, Colour colour) -> bool
8867
8868 Sets the background colour of the window. Returns True if the colour
8869 was changed. The background colour is usually painted by the default
8870 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
8871 automatically under GTK. Using `wx.NullColour` will reset the window
8872 to the default background colour.
d55e5bfc 8873
caef1a4d 8874 Note that setting the background colour may not cause an immediate
f8167d6e 8875 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
8876 calling this function.
8877
f8167d6e
RD
8878 Using this function will disable attempts to use themes for this
8879 window, if the system supports them. Use with care since usually the
8880 themes represent the appearance chosen by the user to be used for all
8881 applications on the system.
d55e5bfc
RD
8882 """
8883 return _core_.Window_SetBackgroundColour(*args, **kwargs)
8884
412d302d
RD
8885 def SetOwnBackgroundColour(*args, **kwargs):
8886 """SetOwnBackgroundColour(self, Colour colour)"""
8887 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
8888
8889 def SetForegroundColour(*args, **kwargs):
8890 """
8891 SetForegroundColour(self, Colour colour) -> bool
8892
8893 Sets the foreground colour of the window. Returns True is the colour
8894 was changed. The interpretation of foreground colour is dependent on
8895 the window class; it may be the text colour or other colour, or it may
8896 not be used at all.
8897 """
8898 return _core_.Window_SetForegroundColour(*args, **kwargs)
8899
fa47d7a7
VS
8900 def SetOwnForegroundColour(*args, **kwargs):
8901 """SetOwnForegroundColour(self, Colour colour)"""
8902 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
8903
8904 def GetBackgroundColour(*args, **kwargs):
8905 """
8906 GetBackgroundColour(self) -> Colour
8907
8908 Returns the background colour of the window.
8909 """
8910 return _core_.Window_GetBackgroundColour(*args, **kwargs)
8911
8912 def GetForegroundColour(*args, **kwargs):
8913 """
8914 GetForegroundColour(self) -> Colour
8915
8916 Returns the foreground colour of the window. The interpretation of
8917 foreground colour is dependent on the window class; it may be the text
8918 colour or other colour, or it may not be used at all.
8919 """
8920 return _core_.Window_GetForegroundColour(*args, **kwargs)
8921
dcb8fc74
RD
8922 def InheritsBackgroundColour(*args, **kwargs):
8923 """InheritsBackgroundColour(self) -> bool"""
8924 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
8925
8926 def UseBgCol(*args, **kwargs):
8927 """UseBgCol(self) -> bool"""
8928 return _core_.Window_UseBgCol(*args, **kwargs)
8929
0f63ec68
RD
8930 def SetBackgroundStyle(*args, **kwargs):
8931 """
8932 SetBackgroundStyle(self, int style) -> bool
8933
8934 Returns the background style of the window. The background style
8935 indicates how the background of the window is drawn.
8936
8937 ====================== ========================================
8938 wx.BG_STYLE_SYSTEM The background colour or pattern should
8939 be determined by the system
8940 wx.BG_STYLE_COLOUR The background should be a solid colour
8941 wx.BG_STYLE_CUSTOM The background will be implemented by the
8942 application.
8943 ====================== ========================================
8944
8945 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8946 a custom background, such as a tiled bitmap. Currently the style has
8947 no effect on other platforms.
8948
8949 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8950 """
8951 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
8952
8953 def GetBackgroundStyle(*args, **kwargs):
8954 """
8955 GetBackgroundStyle(self) -> int
8956
8957 Returns the background style of the window.
8958
8959 :see: `SetBackgroundStyle`
8960 """
8961 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
8962
51b83b37
RD
8963 def HasTransparentBackground(*args, **kwargs):
8964 """
8965 HasTransparentBackground(self) -> bool
8966
8967 Returns True if this window's background is transparent (as, for
8968 example, for `wx.StaticText`) and should show the parent window's
8969 background.
8970
8971 This method is mostly used internally by the library itself and you
8972 normally shouldn't have to call it. You may, however, have to override
8973 it in your custom control classes to ensure that background is painted
8974 correctly.
8975 """
8976 return _core_.Window_HasTransparentBackground(*args, **kwargs)
8977
d55e5bfc
RD
8978 def SetCursor(*args, **kwargs):
8979 """
8980 SetCursor(self, Cursor cursor) -> bool
8981
8982 Sets the window's cursor. Notice that the window cursor also sets it
8983 for the children of the window implicitly.
8984
8985 The cursor may be wx.NullCursor in which case the window cursor will
8986 be reset back to default.
8987 """
8988 return _core_.Window_SetCursor(*args, **kwargs)
8989
8990 def GetCursor(*args, **kwargs):
8991 """
8992 GetCursor(self) -> Cursor
8993
8994 Return the cursor associated with this window.
8995 """
8996 return _core_.Window_GetCursor(*args, **kwargs)
8997
8998 def SetFont(*args, **kwargs):
8999 """
9000 SetFont(self, Font font) -> bool
9001
9002 Sets the font for this window.
9003 """
9004 return _core_.Window_SetFont(*args, **kwargs)
9005
fa47d7a7
VS
9006 def SetOwnFont(*args, **kwargs):
9007 """SetOwnFont(self, Font font)"""
9008 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9009
9010 def GetFont(*args, **kwargs):
9011 """
9012 GetFont(self) -> Font
9013
9014 Returns the default font used for this window.
9015 """
9016 return _core_.Window_GetFont(*args, **kwargs)
9017
9018 def SetCaret(*args, **kwargs):
9019 """
9020 SetCaret(self, Caret caret)
9021
9022 Sets the caret associated with the window.
9023 """
9024 return _core_.Window_SetCaret(*args, **kwargs)
9025
9026 def GetCaret(*args, **kwargs):
9027 """
9028 GetCaret(self) -> Caret
9029
9030 Returns the caret associated with the window.
9031 """
9032 return _core_.Window_GetCaret(*args, **kwargs)
9033
9034 def GetCharHeight(*args, **kwargs):
9035 """
9036 GetCharHeight(self) -> int
9037
9038 Get the (average) character size for the current font.
9039 """
9040 return _core_.Window_GetCharHeight(*args, **kwargs)
9041
9042 def GetCharWidth(*args, **kwargs):
9043 """
9044 GetCharWidth(self) -> int
9045
9046 Get the (average) character size for the current font.
9047 """
9048 return _core_.Window_GetCharWidth(*args, **kwargs)
9049
9050 def GetTextExtent(*args, **kwargs):
a8eff060
RD
9051 """
9052 GetTextExtent(String string) -> (width, height)
9053
9054 Get the width and height of the text using the current font.
9055 """
d55e5bfc
RD
9056 return _core_.Window_GetTextExtent(*args, **kwargs)
9057
9058 def GetFullTextExtent(*args, **kwargs):
9059 """
9060 GetFullTextExtent(String string, Font font=None) ->
9061 (width, height, descent, externalLeading)
9062
9063 Get the width, height, decent and leading of the text using the
9064 current or specified font.
9065 """
9066 return _core_.Window_GetFullTextExtent(*args, **kwargs)
9067
9068 def ClientToScreenXY(*args, **kwargs):
9069 """
9070 ClientToScreenXY(int x, int y) -> (x,y)
9071
9072 Converts to screen coordinates from coordinates relative to this window.
9073 """
9074 return _core_.Window_ClientToScreenXY(*args, **kwargs)
9075
9076 def ScreenToClientXY(*args, **kwargs):
9077 """
9078 ScreenToClientXY(int x, int y) -> (x,y)
9079
9080 Converts from screen to client window coordinates.
9081 """
9082 return _core_.Window_ScreenToClientXY(*args, **kwargs)
9083
9084 def ClientToScreen(*args, **kwargs):
9085 """
9086 ClientToScreen(self, Point pt) -> Point
9087
9088 Converts to screen coordinates from coordinates relative to this window.
9089 """
9090 return _core_.Window_ClientToScreen(*args, **kwargs)
9091
9092 def ScreenToClient(*args, **kwargs):
9093 """
9094 ScreenToClient(self, Point pt) -> Point
9095
9096 Converts from screen to client window coordinates.
9097 """
9098 return _core_.Window_ScreenToClient(*args, **kwargs)
9099
9100 def HitTestXY(*args, **kwargs):
9101 """
9102 HitTestXY(self, int x, int y) -> int
9103
9104 Test where the given (in client coords) point lies
9105 """
9106 return _core_.Window_HitTestXY(*args, **kwargs)
9107
9108 def HitTest(*args, **kwargs):
9109 """
9110 HitTest(self, Point pt) -> int
9111
9112 Test where the given (in client coords) point lies
9113 """
9114 return _core_.Window_HitTest(*args, **kwargs)
9115
9116 def GetBorder(*args):
9117 """
9118 GetBorder(self, long flags) -> int
9119 GetBorder(self) -> int
9120
9121 Get border for the flags of this window
9122 """
9123 return _core_.Window_GetBorder(*args)
9124
9125 def UpdateWindowUI(*args, **kwargs):
9126 """
9127 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
9128
9129 This function sends EVT_UPDATE_UI events to the window. The particular
9130 implementation depends on the window; for example a wx.ToolBar will
9131 send an update UI event for each toolbar button, and a wx.Frame will
9132 send an update UI event for each menubar menu item. You can call this
9133 function from your application to ensure that your UI is up-to-date at
9134 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9135 concerned). This may be necessary if you have called
5ba5649b 9136 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9137 limit the overhead that wxWindows incurs by sending update UI events
9138 in idle time.
d55e5bfc
RD
9139 """
9140 return _core_.Window_UpdateWindowUI(*args, **kwargs)
9141
9142 def PopupMenuXY(*args, **kwargs):
9143 """
7a0b95b0 9144 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9145
7a0b95b0
RD
9146 Pops up the given menu at the specified coordinates, relative to this window,
9147 and returns control when the user has dismissed the menu. If a menu item is
9148 selected, the corresponding menu event is generated and will be processed as
9149 usual. If the default position is given then the current position of the
9150 mouse cursor will be used.
d55e5bfc
RD
9151 """
9152 return _core_.Window_PopupMenuXY(*args, **kwargs)
9153
9154 def PopupMenu(*args, **kwargs):
9155 """
7a0b95b0 9156 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9157
7a0b95b0
RD
9158 Pops up the given menu at the specified coordinates, relative to this window,
9159 and returns control when the user has dismissed the menu. If a menu item is
9160 selected, the corresponding menu event is generated and will be processed as
9161 usual. If the default position is given then the current position of the
9162 mouse cursor will be used.
d55e5bfc
RD
9163 """
9164 return _core_.Window_PopupMenu(*args, **kwargs)
9165
9166 def GetHandle(*args, **kwargs):
9167 """
9168 GetHandle(self) -> long
9169
9170 Returns the platform-specific handle (as a long integer) of the
9171 physical window. Currently on wxMac it returns the handle of the
9172 toplevel parent of the window.
9173 """
9174 return _core_.Window_GetHandle(*args, **kwargs)
9175
629e65c2
RD
9176 def AssociateHandle(*args, **kwargs):
9177 """
9178 AssociateHandle(self, long handle)
9179
9180 Associate the window with a new native handle
9181 """
9182 return _core_.Window_AssociateHandle(*args, **kwargs)
9183
9184 def DissociateHandle(*args, **kwargs):
9185 """
9186 DissociateHandle(self)
9187
9188 Dissociate the current native handle from the window
9189 """
9190 return _core_.Window_DissociateHandle(*args, **kwargs)
9191
d55e5bfc
RD
9192 def OnPaint(*args, **kwargs):
9193 """OnPaint(self, PaintEvent event)"""
9194 return _core_.Window_OnPaint(*args, **kwargs)
9195
9196 def HasScrollbar(*args, **kwargs):
9197 """
9198 HasScrollbar(self, int orient) -> bool
9199
9200 Does the window have the scrollbar for this orientation?
9201 """
9202 return _core_.Window_HasScrollbar(*args, **kwargs)
9203
9204 def SetScrollbar(*args, **kwargs):
9205 """
79fccf9d 9206 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
9207 bool refresh=True)
9208
9209 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc
RD
9210 """
9211 return _core_.Window_SetScrollbar(*args, **kwargs)
9212
9213 def SetScrollPos(*args, **kwargs):
9214 """
9215 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9216
9217 Sets the position of one of the built-in scrollbars.
9218 """
9219 return _core_.Window_SetScrollPos(*args, **kwargs)
9220
9221 def GetScrollPos(*args, **kwargs):
9222 """
9223 GetScrollPos(self, int orientation) -> int
9224
9225 Returns the built-in scrollbar position.
9226 """
9227 return _core_.Window_GetScrollPos(*args, **kwargs)
9228
9229 def GetScrollThumb(*args, **kwargs):
9230 """
9231 GetScrollThumb(self, int orientation) -> int
9232
9233 Returns the built-in scrollbar thumb size.
9234 """
9235 return _core_.Window_GetScrollThumb(*args, **kwargs)
9236
9237 def GetScrollRange(*args, **kwargs):
9238 """
9239 GetScrollRange(self, int orientation) -> int
9240
9241 Returns the built-in scrollbar range.
9242 """
9243 return _core_.Window_GetScrollRange(*args, **kwargs)
9244
9245 def ScrollWindow(*args, **kwargs):
9246 """
9247 ScrollWindow(self, int dx, int dy, Rect rect=None)
9248
9249 Physically scrolls the pixels in the window and move child windows
9250 accordingly. Use this function to optimise your scrolling
9251 implementations, to minimise the area that must be redrawn. Note that
9252 it is rarely required to call this function from a user program.
d55e5bfc
RD
9253 """
9254 return _core_.Window_ScrollWindow(*args, **kwargs)
9255
9256 def ScrollLines(*args, **kwargs):
9257 """
9258 ScrollLines(self, int lines) -> bool
9259
9260 If the platform and window class supports it, scrolls the window by
9261 the given number of lines down, if lines is positive, or up if lines
9262 is negative. Returns True if the window was scrolled, False if it was
9263 already on top/bottom and nothing was done.
9264 """
9265 return _core_.Window_ScrollLines(*args, **kwargs)
9266
9267 def ScrollPages(*args, **kwargs):
9268 """
9269 ScrollPages(self, int pages) -> bool
9270
79fccf9d 9271 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
9272 the given number of pages down, if pages is positive, or up if pages
9273 is negative. Returns True if the window was scrolled, False if it was
9274 already on top/bottom and nothing was done.
9275 """
9276 return _core_.Window_ScrollPages(*args, **kwargs)
9277
9278 def LineUp(*args, **kwargs):
9279 """
9280 LineUp(self) -> bool
9281
9282 This is just a wrapper for ScrollLines(-1).
9283 """
9284 return _core_.Window_LineUp(*args, **kwargs)
9285
9286 def LineDown(*args, **kwargs):
9287 """
9288 LineDown(self) -> bool
9289
9290 This is just a wrapper for ScrollLines(1).
9291 """
9292 return _core_.Window_LineDown(*args, **kwargs)
9293
9294 def PageUp(*args, **kwargs):
9295 """
9296 PageUp(self) -> bool
9297
9298 This is just a wrapper for ScrollPages(-1).
9299 """
9300 return _core_.Window_PageUp(*args, **kwargs)
9301
9302 def PageDown(*args, **kwargs):
9303 """
9304 PageDown(self) -> bool
9305
9306 This is just a wrapper for ScrollPages(1).
9307 """
9308 return _core_.Window_PageDown(*args, **kwargs)
9309
9310 def SetHelpText(*args, **kwargs):
9311 """
9312 SetHelpText(self, String text)
9313
9314 Sets the help text to be used as context-sensitive help for this
9315 window. Note that the text is actually stored by the current
f52cbe90 9316 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc
RD
9317 """
9318 return _core_.Window_SetHelpText(*args, **kwargs)
9319
9320 def SetHelpTextForId(*args, **kwargs):
9321 """
9322 SetHelpTextForId(self, String text)
9323
9324 Associate this help text with all windows with the same id as this
9325 one.
9326 """
9327 return _core_.Window_SetHelpTextForId(*args, **kwargs)
9328
b850e7f3
RD
9329 def GetHelpTextAtPoint(*args, **kwargs):
9330 """
9331 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9332
9333 Get the help string associated with the given position in this window.
9334
9335 Notice that pt may be invalid if event origin is keyboard or unknown
9336 and this method should return the global window help text then
9337
9338 """
9339 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9340
d55e5bfc
RD
9341 def GetHelpText(*args, **kwargs):
9342 """
9343 GetHelpText(self) -> String
9344
9345 Gets the help text to be used as context-sensitive help for this
9346 window. Note that the text is actually stored by the current
f52cbe90 9347 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc
RD
9348 """
9349 return _core_.Window_GetHelpText(*args, **kwargs)
9350
9351 def SetToolTipString(*args, **kwargs):
9352 """
9353 SetToolTipString(self, String tip)
9354
9355 Attach a tooltip to the window.
9356 """
9357 return _core_.Window_SetToolTipString(*args, **kwargs)
9358
9359 def SetToolTip(*args, **kwargs):
9360 """
9361 SetToolTip(self, ToolTip tip)
9362
9363 Attach a tooltip to the window.
9364 """
9365 return _core_.Window_SetToolTip(*args, **kwargs)
9366
9367 def GetToolTip(*args, **kwargs):
9368 """
9369 GetToolTip(self) -> ToolTip
9370
9371 get the associated tooltip or None if none
9372 """
9373 return _core_.Window_GetToolTip(*args, **kwargs)
9374
9375 def SetDropTarget(*args, **kwargs):
9376 """
9377 SetDropTarget(self, DropTarget dropTarget)
9378
9379 Associates a drop target with this window. If the window already has
9380 a drop target, it is deleted.
9381 """
9382 return _core_.Window_SetDropTarget(*args, **kwargs)
9383
9384 def GetDropTarget(*args, **kwargs):
9385 """
9386 GetDropTarget(self) -> DropTarget
9387
9388 Returns the associated drop target, which may be None.
9389 """
9390 return _core_.Window_GetDropTarget(*args, **kwargs)
9391
9392 def DragAcceptFiles(*args, **kwargs):
9393 """
9394 DragAcceptFiles(self, bool accept)
9395
9396 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
5ba5649b 9397 Only functional on Windows.
d55e5bfc
RD
9398 """
9399 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9400
9401 def SetConstraints(*args, **kwargs):
9402 """
9403 SetConstraints(self, LayoutConstraints constraints)
9404
9405 Sets the window to have the given layout constraints. If an existing
9406 layout constraints object is already owned by the window, it will be
9407 deleted. Pass None to disassociate and delete the window's current
9408 constraints.
9409
9410 You must call SetAutoLayout to tell a window to use the constraints
9411 automatically in its default EVT_SIZE handler; otherwise, you must
9412 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9413 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9414 effect.
9415 """
9416 return _core_.Window_SetConstraints(*args, **kwargs)
9417
9418 def GetConstraints(*args, **kwargs):
9419 """
9420 GetConstraints(self) -> LayoutConstraints
9421
9422 Returns a pointer to the window's layout constraints, or None if there
9423 are none.
9424 """
9425 return _core_.Window_GetConstraints(*args, **kwargs)
9426
9427 def SetAutoLayout(*args, **kwargs):
9428 """
9429 SetAutoLayout(self, bool autoLayout)
9430
9431 Determines whether the Layout function will be called automatically
b1fcee84
RD
9432 when the window is resized. lease note that this only happens for the
9433 windows usually used to contain children, namely `wx.Panel` and
9434 `wx.TopLevelWindow` (and the classes deriving from them).
9435
9436 This method is called implicitly by `SetSizer` but if you use
9437 `SetConstraints` you should call it manually or otherwise the window
9438 layout won't be correctly updated when its size changes.
d55e5bfc
RD
9439 """
9440 return _core_.Window_SetAutoLayout(*args, **kwargs)
9441
9442 def GetAutoLayout(*args, **kwargs):
9443 """
9444 GetAutoLayout(self) -> bool
9445
9446 Returns the current autoLayout setting
9447 """
9448 return _core_.Window_GetAutoLayout(*args, **kwargs)
9449
9450 def Layout(*args, **kwargs):
9451 """
9452 Layout(self) -> bool
9453
9454 Invokes the constraint-based layout algorithm or the sizer-based
9455 algorithm for this window. See SetAutoLayout: when auto layout is on,
9456 this function gets called automatically by the default EVT_SIZE
9457 handler when the window is resized.
9458 """
9459 return _core_.Window_Layout(*args, **kwargs)
9460
9461 def SetSizer(*args, **kwargs):
9462 """
9463 SetSizer(self, Sizer sizer, bool deleteOld=True)
9464
9465 Sets the window to have the given layout sizer. The window will then
9466 own the object, and will take care of its deletion. If an existing
9467 layout sizer object is already owned by the window, it will be deleted
9468 if the deleteOld parameter is true. Note that this function will also
9469 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 9470 non-None, and False otherwise.
d55e5bfc
RD
9471 """
9472 return _core_.Window_SetSizer(*args, **kwargs)
9473
9474 def SetSizerAndFit(*args, **kwargs):
9475 """
9476 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
9477
9478 The same as SetSizer, except it also sets the size hints for the
9479 window based on the sizer's minimum size.
9480 """
9481 return _core_.Window_SetSizerAndFit(*args, **kwargs)
9482
9483 def GetSizer(*args, **kwargs):
9484 """
9485 GetSizer(self) -> Sizer
9486
9487 Return the sizer associated with the window by a previous call to
9488 SetSizer or None if there isn't one.
9489 """
9490 return _core_.Window_GetSizer(*args, **kwargs)
9491
9492 def SetContainingSizer(*args, **kwargs):
9493 """
9494 SetContainingSizer(self, Sizer sizer)
9495
9496 This normally does not need to be called by application code. It is
9497 called internally when a window is added to a sizer, and is used so
9498 the window can remove itself from the sizer when it is destroyed.
9499 """
9500 return _core_.Window_SetContainingSizer(*args, **kwargs)
9501
9502 def GetContainingSizer(*args, **kwargs):
9503 """
9504 GetContainingSizer(self) -> Sizer
9505
9506 Return the sizer that this window is a member of, if any, otherwise None.
9507 """
9508 return _core_.Window_GetContainingSizer(*args, **kwargs)
9509
9510 def InheritAttributes(*args, **kwargs):
9511 """
9512 InheritAttributes(self)
9513
79fccf9d
RD
9514 This function is (or should be, in case of custom controls) called
9515 during window creation to intelligently set up the window visual
9516 attributes, that is the font and the foreground and background
9517 colours.
9518
9519 By 'intelligently' the following is meant: by default, all windows use
9520 their own default attributes. However if some of the parent's
9521 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 9522 SetOwnFont) and if the corresponding attribute hadn't been
79fccf9d
RD
9523 explicitly set for this window itself, then this window takes the same
9524 value as used by the parent. In addition, if the window overrides
9525 ShouldInheritColours to return false, the colours will not be changed
9526 no matter what and only the font might.
9527
ec9b55ca
RD
9528 This rather complicated logic is necessary in order to accommodate the
9529 different usage scenarios. The most common one is when all default
79fccf9d
RD
9530 attributes are used and in this case, nothing should be inherited as
9531 in modern GUIs different controls use different fonts (and colours)
9532 than their siblings so they can't inherit the same value from the
9533 parent. However it was also deemed desirable to allow to simply change
9534 the attributes of all children at once by just changing the font or
9535 colour of their common parent, hence in this case we do inherit the
9536 parents attributes.
9537
d55e5bfc
RD
9538 """
9539 return _core_.Window_InheritAttributes(*args, **kwargs)
9540
9541 def ShouldInheritColours(*args, **kwargs):
9542 """
9543 ShouldInheritColours(self) -> bool
9544
9545 Return true from here to allow the colours of this window to be
79fccf9d
RD
9546 changed by InheritAttributes, returning false forbids inheriting them
9547 from the parent window.
d55e5bfc 9548
79fccf9d
RD
9549 The base class version returns false, but this method is overridden in
9550 wxControl where it returns true.
d55e5bfc
RD
9551 """
9552 return _core_.Window_ShouldInheritColours(*args, **kwargs)
9553
9554 def PostCreate(self, pre):
9555 """
9556 Phase 3 of the 2-phase create <wink!>
9557 Call this method after precreating the window with the 2-phase create method.
9558 """
9559 self.this = pre.this
9560 self.thisown = pre.thisown
9561 pre.thisown = 0
9562 if hasattr(self, '_setOORInfo'):
9563 self._setOORInfo(self)
9564 if hasattr(self, '_setCallbackInfo'):
9565 self._setCallbackInfo(self, self.__class__)
9566
7e08d4ef
RD
9567 def SendSizeEvent(self):
9568 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9569
2131d850 9570_core_.Window_swigregister(Window)
d55e5bfc
RD
9571
9572def PreWindow(*args, **kwargs):
9573 """
9574 PreWindow() -> Window
9575
9576 Precreate a Window for 2-phase creation.
9577 """
9578 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
9579 return val
9580
554f62e9
RD
9581def Window_NewControlId(*args):
9582 """
d55e5bfc
RD
9583 Window_NewControlId() -> int
9584
9585 Generate a control id for the controls which were not given one.
9586 """
554f62e9 9587 return _core_.Window_NewControlId(*args)
d55e5bfc
RD
9588
9589def Window_NextControlId(*args, **kwargs):
554f62e9 9590 """
d55e5bfc
RD
9591 Window_NextControlId(int winid) -> int
9592
9593 Get the id of the control following the one with the given
79fccf9d 9594 autogenerated) id
d55e5bfc 9595 """
554f62e9 9596 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
9597
9598def Window_PrevControlId(*args, **kwargs):
554f62e9 9599 """
d55e5bfc
RD
9600 Window_PrevControlId(int winid) -> int
9601
9602 Get the id of the control preceding the one with the given
79fccf9d 9603 autogenerated) id
d55e5bfc 9604 """
554f62e9 9605 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 9606
554f62e9
RD
9607def Window_FindFocus(*args):
9608 """
d55e5bfc
RD
9609 Window_FindFocus() -> Window
9610
9611 Returns the window or control that currently has the keyboard focus,
9612 or None.
9613 """
554f62e9 9614 return _core_.Window_FindFocus(*args)
d55e5bfc 9615
554f62e9
RD
9616def Window_GetCapture(*args):
9617 """
d55e5bfc
RD
9618 Window_GetCapture() -> Window
9619
9620 Returns the window which currently captures the mouse or None
9621 """
554f62e9 9622 return _core_.Window_GetCapture(*args)
d55e5bfc
RD
9623
9624def Window_GetClassDefaultAttributes(*args, **kwargs):
554f62e9 9625 """
d55e5bfc
RD
9626 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9627
79fccf9d
RD
9628 Get the default attributes for this class. This is useful if you want
9629 to use the same font or colour in your own control as in a standard
9630 control -- which is a much better idea than hard coding specific
caef1a4d
RD
9631 colours or fonts which might look completely out of place on the
9632 user's system, especially if it uses themes.
d55e5bfc
RD
9633
9634 The variant parameter is only relevant under Mac currently and is
79fccf9d 9635 ignore under other platforms. Under Mac, it will change the size of
caef1a4d
RD
9636 the returned font. See `wx.Window.SetWindowVariant` for more about
9637 this.
d55e5bfc 9638 """
554f62e9 9639 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9640
9641def DLG_PNT(win, point_or_x, y=None):
9642 """
9643 Convenience function for converting a Point or (x,y) in
9644 dialog units to pixel units.
9645 """
9646 if y is None:
9647 return win.ConvertDialogPointToPixels(point_or_x)
9648 else:
9649 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9650
9651def DLG_SZE(win, size_width, height=None):
9652 """
9653 Convenience function for converting a Size or (w,h) in
9654 dialog units to pixel units.
9655 """
9656 if height is None:
9657 return win.ConvertDialogSizeToPixels(size_width)
9658 else:
9659 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9660
9661
9662def FindWindowById(*args, **kwargs):
554f62e9 9663 """
d55e5bfc
RD
9664 FindWindowById(long id, Window parent=None) -> Window
9665
9666 Find the first window in the application with the given id. If parent
9667 is None, the search will start from all top-level frames and dialog
9668 boxes; if non-None, the search will be limited to the given window
9669 hierarchy. The search is recursive in both cases.
9670 """
554f62e9 9671 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc
RD
9672
9673def FindWindowByName(*args, **kwargs):
554f62e9 9674 """
d55e5bfc
RD
9675 FindWindowByName(String name, Window parent=None) -> Window
9676
9677 Find a window by its name (as given in a window constructor or Create
9678 function call). If parent is None, the search will start from all
9679 top-level frames and dialog boxes; if non-None, the search will be
9680 limited to the given window hierarchy. The search is recursive in both
9681 cases.
9682
9683 If no window with such name is found, wx.FindWindowByLabel is called.
9684 """
554f62e9 9685 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc
RD
9686
9687def FindWindowByLabel(*args, **kwargs):
554f62e9 9688 """
d55e5bfc
RD
9689 FindWindowByLabel(String label, Window parent=None) -> Window
9690
9691 Find a window by its label. Depending on the type of window, the label
9692 may be a window title or panel item label. If parent is None, the
9693 search will start from all top-level frames and dialog boxes; if
9694 non-None, the search will be limited to the given window
9695 hierarchy. The search is recursive in both cases.
9696 """
554f62e9 9697 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc
RD
9698
9699def Window_FromHWND(*args, **kwargs):
554f62e9
RD
9700 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9701 return _core_.Window_FromHWND(*args, **kwargs)
3215336e 9702
554f62e9
RD
9703def GetTopLevelWindows(*args):
9704 """
3215336e
RD
9705 GetTopLevelWindows() -> PyObject
9706
9707 Returns a list of the the application's top-level windows, (frames,
9708 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9709 by wxWidgets, and so it is only valid as long as no top-level windows
9710 are closed or new top-level windows are created.
9711
9712 """
554f62e9 9713 return _core_.GetTopLevelWindows(*args)
d55e5bfc
RD
9714#---------------------------------------------------------------------------
9715
9716class Validator(EvtHandler):
093d3ff1 9717 """Proxy of C++ Validator class"""
554f62e9
RD
9718 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9719 __repr__ = _swig_repr
9720 def __init__(self, *args, **kwargs):
d55e5bfc 9721 """__init__(self) -> Validator"""
554f62e9 9722 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d55e5bfc
RD
9723 self._setOORInfo(self)
9724
9725 def Clone(*args, **kwargs):
9726 """Clone(self) -> Validator"""
9727 return _core_.Validator_Clone(*args, **kwargs)
9728
9729 def Validate(*args, **kwargs):
9730 """Validate(self, Window parent) -> bool"""
9731 return _core_.Validator_Validate(*args, **kwargs)
9732
9733 def TransferToWindow(*args, **kwargs):
9734 """TransferToWindow(self) -> bool"""
9735 return _core_.Validator_TransferToWindow(*args, **kwargs)
9736
9737 def TransferFromWindow(*args, **kwargs):
9738 """TransferFromWindow(self) -> bool"""
9739 return _core_.Validator_TransferFromWindow(*args, **kwargs)
9740
9741 def GetWindow(*args, **kwargs):
9742 """GetWindow(self) -> Window"""
9743 return _core_.Validator_GetWindow(*args, **kwargs)
9744
9745 def SetWindow(*args, **kwargs):
9746 """SetWindow(self, Window window)"""
9747 return _core_.Validator_SetWindow(*args, **kwargs)
9748
9749 def IsSilent(*args, **kwargs):
c24da6d6 9750 """IsSilent() -> bool"""
d55e5bfc
RD
9751 return _core_.Validator_IsSilent(*args, **kwargs)
9752
9753 IsSilent = staticmethod(IsSilent)
9754 def SetBellOnError(*args, **kwargs):
c24da6d6 9755 """SetBellOnError(int doIt=True)"""
d55e5bfc
RD
9756 return _core_.Validator_SetBellOnError(*args, **kwargs)
9757
9758 SetBellOnError = staticmethod(SetBellOnError)
2131d850 9759_core_.Validator_swigregister(Validator)
d55e5bfc 9760
554f62e9
RD
9761def Validator_IsSilent(*args):
9762 """Validator_IsSilent() -> bool"""
9763 return _core_.Validator_IsSilent(*args)
d55e5bfc
RD
9764
9765def Validator_SetBellOnError(*args, **kwargs):
554f62e9
RD
9766 """Validator_SetBellOnError(int doIt=True)"""
9767 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
9768
9769class PyValidator(Validator):
093d3ff1 9770 """Proxy of C++ PyValidator class"""
554f62e9
RD
9771 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9772 __repr__ = _swig_repr
9773 def __init__(self, *args, **kwargs):
d55e5bfc 9774 """__init__(self) -> PyValidator"""
554f62e9 9775 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
d55e5bfc
RD
9776
9777 self._setCallbackInfo(self, PyValidator, 1)
9778 self._setOORInfo(self)
9779
9780 def _setCallbackInfo(*args, **kwargs):
9781 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
9782 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
9783
2131d850 9784_core_.PyValidator_swigregister(PyValidator)
d55e5bfc
RD
9785
9786#---------------------------------------------------------------------------
9787
9788class Menu(EvtHandler):
093d3ff1 9789 """Proxy of C++ Menu class"""
554f62e9
RD
9790 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9791 __repr__ = _swig_repr
9792 def __init__(self, *args, **kwargs):
d55e5bfc 9793 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
554f62e9 9794 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
d55e5bfc
RD
9795 self._setOORInfo(self)
9796
9797 def Append(*args, **kwargs):
9798 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9799 return _core_.Menu_Append(*args, **kwargs)
9800
9801 def AppendSeparator(*args, **kwargs):
9802 """AppendSeparator(self) -> MenuItem"""
9803 return _core_.Menu_AppendSeparator(*args, **kwargs)
9804
9805 def AppendCheckItem(*args, **kwargs):
9806 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9807 return _core_.Menu_AppendCheckItem(*args, **kwargs)
9808
9809 def AppendRadioItem(*args, **kwargs):
9810 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9811 return _core_.Menu_AppendRadioItem(*args, **kwargs)
9812
9813 def AppendMenu(*args, **kwargs):
9814 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9815 return _core_.Menu_AppendMenu(*args, **kwargs)
9816
50efceee
RD
9817 def AppendSubMenu(*args, **kwargs):
9818 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9819 return _core_.Menu_AppendSubMenu(*args, **kwargs)
9820
d55e5bfc
RD
9821 def AppendItem(*args, **kwargs):
9822 """AppendItem(self, MenuItem item) -> MenuItem"""
9823 return _core_.Menu_AppendItem(*args, **kwargs)
9824
d55e5bfc
RD
9825 def InsertItem(*args, **kwargs):
9826 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9827 return _core_.Menu_InsertItem(*args, **kwargs)
9828
554f62e9
RD
9829 def PrependItem(*args, **kwargs):
9830 """PrependItem(self, MenuItem item) -> MenuItem"""
9831 return _core_.Menu_PrependItem(*args, **kwargs)
9832
9833 def Break(*args, **kwargs):
9834 """Break(self)"""
9835 return _core_.Menu_Break(*args, **kwargs)
9836
d55e5bfc
RD
9837 def Insert(*args, **kwargs):
9838 """
9839 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9840 int kind=ITEM_NORMAL) -> MenuItem
9841 """
9842 return _core_.Menu_Insert(*args, **kwargs)
9843
9844 def InsertSeparator(*args, **kwargs):
9845 """InsertSeparator(self, size_t pos) -> MenuItem"""
9846 return _core_.Menu_InsertSeparator(*args, **kwargs)
9847
9848 def InsertCheckItem(*args, **kwargs):
9849 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9850 return _core_.Menu_InsertCheckItem(*args, **kwargs)
9851
9852 def InsertRadioItem(*args, **kwargs):
9853 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9854 return _core_.Menu_InsertRadioItem(*args, **kwargs)
9855
9856 def InsertMenu(*args, **kwargs):
9857 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9858 return _core_.Menu_InsertMenu(*args, **kwargs)
9859
d55e5bfc
RD
9860 def Prepend(*args, **kwargs):
9861 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9862 return _core_.Menu_Prepend(*args, **kwargs)
9863
9864 def PrependSeparator(*args, **kwargs):
9865 """PrependSeparator(self) -> MenuItem"""
9866 return _core_.Menu_PrependSeparator(*args, **kwargs)
9867
9868 def PrependCheckItem(*args, **kwargs):
9869 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9870 return _core_.Menu_PrependCheckItem(*args, **kwargs)
9871
9872 def PrependRadioItem(*args, **kwargs):
9873 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9874 return _core_.Menu_PrependRadioItem(*args, **kwargs)
9875
9876 def PrependMenu(*args, **kwargs):
9877 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9878 return _core_.Menu_PrependMenu(*args, **kwargs)
9879
9880 def Remove(*args, **kwargs):
9881 """Remove(self, int id) -> MenuItem"""
9882 return _core_.Menu_Remove(*args, **kwargs)
9883
9884 def RemoveItem(*args, **kwargs):
9885 """RemoveItem(self, MenuItem item) -> MenuItem"""
9886 return _core_.Menu_RemoveItem(*args, **kwargs)
9887
9888 def Delete(*args, **kwargs):
9889 """Delete(self, int id) -> bool"""
9890 return _core_.Menu_Delete(*args, **kwargs)
9891
9892 def DeleteItem(*args, **kwargs):
9893 """DeleteItem(self, MenuItem item) -> bool"""
9894 return _core_.Menu_DeleteItem(*args, **kwargs)
9895
9896 def Destroy(*args, **kwargs):
9897 """
9898 Destroy(self)
9899
9900 Deletes the C++ object this Python object is a proxy for.
9901 """
7e08d4ef
RD
9902 val = _core_.Menu_Destroy(*args, **kwargs)
9903 args[0].thisown = 0
9904 return val
d55e5bfc
RD
9905
9906 def DestroyId(*args, **kwargs):
9907 """
9908 DestroyId(self, int id) -> bool
9909
9910 Deletes the C++ object this Python object is a proxy for.
9911 """
7e08d4ef
RD
9912 val = _core_.Menu_DestroyId(*args, **kwargs)
9913 args[0].thisown = 0
9914 return val
d55e5bfc
RD
9915
9916 def DestroyItem(*args, **kwargs):
9917 """
9918 DestroyItem(self, MenuItem item) -> bool
9919
9920 Deletes the C++ object this Python object is a proxy for.
9921 """
7e08d4ef
RD
9922 val = _core_.Menu_DestroyItem(*args, **kwargs)
9923 args[0].thisown = 0
9924 return val
d55e5bfc
RD
9925
9926 def GetMenuItemCount(*args, **kwargs):
9927 """GetMenuItemCount(self) -> size_t"""
9928 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
9929
9930 def GetMenuItems(*args, **kwargs):
9931 """GetMenuItems(self) -> PyObject"""
9932 return _core_.Menu_GetMenuItems(*args, **kwargs)
9933
9934 def FindItem(*args, **kwargs):
9935 """FindItem(self, String item) -> int"""
9936 return _core_.Menu_FindItem(*args, **kwargs)
9937
9938 def FindItemById(*args, **kwargs):
9939 """FindItemById(self, int id) -> MenuItem"""
9940 return _core_.Menu_FindItemById(*args, **kwargs)
9941
9942 def FindItemByPosition(*args, **kwargs):
9943 """FindItemByPosition(self, size_t position) -> MenuItem"""
9944 return _core_.Menu_FindItemByPosition(*args, **kwargs)
9945
9946 def Enable(*args, **kwargs):
9947 """Enable(self, int id, bool enable)"""
9948 return _core_.Menu_Enable(*args, **kwargs)
9949
9950 def IsEnabled(*args, **kwargs):
9951 """IsEnabled(self, int id) -> bool"""
9952 return _core_.Menu_IsEnabled(*args, **kwargs)
9953
9954 def Check(*args, **kwargs):
9955 """Check(self, int id, bool check)"""
9956 return _core_.Menu_Check(*args, **kwargs)
9957
9958 def IsChecked(*args, **kwargs):
9959 """IsChecked(self, int id) -> bool"""
9960 return _core_.Menu_IsChecked(*args, **kwargs)
9961
9962 def SetLabel(*args, **kwargs):
9963 """SetLabel(self, int id, String label)"""
9964 return _core_.Menu_SetLabel(*args, **kwargs)
9965
9966 def GetLabel(*args, **kwargs):
9967 """GetLabel(self, int id) -> String"""
9968 return _core_.Menu_GetLabel(*args, **kwargs)
9969
9970 def SetHelpString(*args, **kwargs):
9971 """SetHelpString(self, int id, String helpString)"""
9972 return _core_.Menu_SetHelpString(*args, **kwargs)
9973
9974 def GetHelpString(*args, **kwargs):
9975 """GetHelpString(self, int id) -> String"""
9976 return _core_.Menu_GetHelpString(*args, **kwargs)
9977
9978 def SetTitle(*args, **kwargs):
9979 """SetTitle(self, String title)"""
9980 return _core_.Menu_SetTitle(*args, **kwargs)
9981
9982 def GetTitle(*args, **kwargs):
9983 """GetTitle(self) -> String"""
9984 return _core_.Menu_GetTitle(*args, **kwargs)
9985
9986 def SetEventHandler(*args, **kwargs):
9987 """SetEventHandler(self, EvtHandler handler)"""
9988 return _core_.Menu_SetEventHandler(*args, **kwargs)
9989
9990 def GetEventHandler(*args, **kwargs):
9991 """GetEventHandler(self) -> EvtHandler"""
9992 return _core_.Menu_GetEventHandler(*args, **kwargs)
9993
9994 def SetInvokingWindow(*args, **kwargs):
9995 """SetInvokingWindow(self, Window win)"""
9996 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
9997
9998 def GetInvokingWindow(*args, **kwargs):
9999 """GetInvokingWindow(self) -> Window"""
10000 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
10001
10002 def GetStyle(*args, **kwargs):
10003 """GetStyle(self) -> long"""
10004 return _core_.Menu_GetStyle(*args, **kwargs)
10005
10006 def UpdateUI(*args, **kwargs):
10007 """UpdateUI(self, EvtHandler source=None)"""
10008 return _core_.Menu_UpdateUI(*args, **kwargs)
10009
10010 def GetMenuBar(*args, **kwargs):
10011 """GetMenuBar(self) -> MenuBar"""
10012 return _core_.Menu_GetMenuBar(*args, **kwargs)
10013
10014 def Attach(*args, **kwargs):
10015 """Attach(self, wxMenuBarBase menubar)"""
10016 return _core_.Menu_Attach(*args, **kwargs)
10017
10018 def Detach(*args, **kwargs):
10019 """Detach(self)"""
10020 return _core_.Menu_Detach(*args, **kwargs)
10021
10022 def IsAttached(*args, **kwargs):
10023 """IsAttached(self) -> bool"""
10024 return _core_.Menu_IsAttached(*args, **kwargs)
10025
10026 def SetParent(*args, **kwargs):
10027 """SetParent(self, Menu parent)"""
10028 return _core_.Menu_SetParent(*args, **kwargs)
10029
10030 def GetParent(*args, **kwargs):
10031 """GetParent(self) -> Menu"""
10032 return _core_.Menu_GetParent(*args, **kwargs)
10033
2131d850 10034_core_.Menu_swigregister(Menu)
d55e5bfc
RD
10035DefaultValidator = cvar.DefaultValidator
10036
10037#---------------------------------------------------------------------------
10038
10039class MenuBar(Window):
093d3ff1 10040 """Proxy of C++ MenuBar class"""
554f62e9
RD
10041 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10042 __repr__ = _swig_repr
10043 def __init__(self, *args, **kwargs):
d55e5bfc 10044 """__init__(self, long style=0) -> MenuBar"""
554f62e9 10045 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d55e5bfc
RD
10046 self._setOORInfo(self)
10047
10048 def Append(*args, **kwargs):
10049 """Append(self, Menu menu, String title) -> bool"""
10050 return _core_.MenuBar_Append(*args, **kwargs)
10051
10052 def Insert(*args, **kwargs):
10053 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10054 return _core_.MenuBar_Insert(*args, **kwargs)
10055
10056 def GetMenuCount(*args, **kwargs):
10057 """GetMenuCount(self) -> size_t"""
10058 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
10059
10060 def GetMenu(*args, **kwargs):
10061 """GetMenu(self, size_t pos) -> Menu"""
10062 return _core_.MenuBar_GetMenu(*args, **kwargs)
10063
10064 def Replace(*args, **kwargs):
10065 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10066 return _core_.MenuBar_Replace(*args, **kwargs)
10067
10068 def Remove(*args, **kwargs):
10069 """Remove(self, size_t pos) -> Menu"""
10070 return _core_.MenuBar_Remove(*args, **kwargs)
10071
10072 def EnableTop(*args, **kwargs):
10073 """EnableTop(self, size_t pos, bool enable)"""
10074 return _core_.MenuBar_EnableTop(*args, **kwargs)
10075
10076 def IsEnabledTop(*args, **kwargs):
10077 """IsEnabledTop(self, size_t pos) -> bool"""
10078 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
10079
10080 def SetLabelTop(*args, **kwargs):
10081 """SetLabelTop(self, size_t pos, String label)"""
10082 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
10083
10084 def GetLabelTop(*args, **kwargs):
10085 """GetLabelTop(self, size_t pos) -> String"""
10086 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
10087
10088 def FindMenuItem(*args, **kwargs):
10089 """FindMenuItem(self, String menu, String item) -> int"""
10090 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
10091
10092 def FindItemById(*args, **kwargs):
10093 """FindItemById(self, int id) -> MenuItem"""
10094 return _core_.MenuBar_FindItemById(*args, **kwargs)
10095
10096 def FindMenu(*args, **kwargs):
10097 """FindMenu(self, String title) -> int"""
10098 return _core_.MenuBar_FindMenu(*args, **kwargs)
10099
10100 def Enable(*args, **kwargs):
10101 """Enable(self, int id, bool enable)"""
10102 return _core_.MenuBar_Enable(*args, **kwargs)
10103
10104 def Check(*args, **kwargs):
10105 """Check(self, int id, bool check)"""
10106 return _core_.MenuBar_Check(*args, **kwargs)
10107
10108 def IsChecked(*args, **kwargs):
10109 """IsChecked(self, int id) -> bool"""
10110 return _core_.MenuBar_IsChecked(*args, **kwargs)
10111
10112 def IsEnabled(*args, **kwargs):
10113 """IsEnabled(self, int id) -> bool"""
10114 return _core_.MenuBar_IsEnabled(*args, **kwargs)
10115
10116 def SetLabel(*args, **kwargs):
10117 """SetLabel(self, int id, String label)"""
10118 return _core_.MenuBar_SetLabel(*args, **kwargs)
10119
10120 def GetLabel(*args, **kwargs):
10121 """GetLabel(self, int id) -> String"""
10122 return _core_.MenuBar_GetLabel(*args, **kwargs)
10123
10124 def SetHelpString(*args, **kwargs):
10125 """SetHelpString(self, int id, String helpString)"""
10126 return _core_.MenuBar_SetHelpString(*args, **kwargs)
10127
10128 def GetHelpString(*args, **kwargs):
10129 """GetHelpString(self, int id) -> String"""
10130 return _core_.MenuBar_GetHelpString(*args, **kwargs)
10131
10132 def GetFrame(*args, **kwargs):
10133 """GetFrame(self) -> wxFrame"""
10134 return _core_.MenuBar_GetFrame(*args, **kwargs)
10135
10136 def IsAttached(*args, **kwargs):
10137 """IsAttached(self) -> bool"""
10138 return _core_.MenuBar_IsAttached(*args, **kwargs)
10139
10140 def Attach(*args, **kwargs):
10141 """Attach(self, wxFrame frame)"""
10142 return _core_.MenuBar_Attach(*args, **kwargs)
10143
10144 def Detach(*args, **kwargs):
10145 """Detach(self)"""
10146 return _core_.MenuBar_Detach(*args, **kwargs)
10147
db67f999
RD
10148 def SetAutoWindowMenu(*args, **kwargs):
10149 """SetAutoWindowMenu(bool enable)"""
10150 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10151
10152 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10153 def GetAutoWindowMenu(*args, **kwargs):
10154 """GetAutoWindowMenu() -> bool"""
10155 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10156
10157 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
2131d850 10158_core_.MenuBar_swigregister(MenuBar)
d55e5bfc 10159
db67f999 10160def MenuBar_SetAutoWindowMenu(*args, **kwargs):
554f62e9
RD
10161 """MenuBar_SetAutoWindowMenu(bool enable)"""
10162 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
db67f999 10163
554f62e9
RD
10164def MenuBar_GetAutoWindowMenu(*args):
10165 """MenuBar_GetAutoWindowMenu() -> bool"""
10166 return _core_.MenuBar_GetAutoWindowMenu(*args)
db67f999 10167
d55e5bfc
RD
10168#---------------------------------------------------------------------------
10169
10170class MenuItem(Object):
093d3ff1 10171 """Proxy of C++ MenuItem class"""
554f62e9
RD
10172 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10173 __repr__ = _swig_repr
10174 def __init__(self, *args, **kwargs):
d55e5bfc
RD
10175 """
10176 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10177 String help=EmptyString, int kind=ITEM_NORMAL,
10178 Menu subMenu=None) -> MenuItem
10179 """
554f62e9
RD
10180 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10181 __swig_destroy__ = _core_.delete_MenuItem
10182 __del__ = lambda self : None;
d55e5bfc
RD
10183 def GetMenu(*args, **kwargs):
10184 """GetMenu(self) -> Menu"""
10185 return _core_.MenuItem_GetMenu(*args, **kwargs)
10186
10187 def SetMenu(*args, **kwargs):
10188 """SetMenu(self, Menu menu)"""
10189 return _core_.MenuItem_SetMenu(*args, **kwargs)
10190
10191 def SetId(*args, **kwargs):
10192 """SetId(self, int id)"""
10193 return _core_.MenuItem_SetId(*args, **kwargs)
10194
10195 def GetId(*args, **kwargs):
10196 """GetId(self) -> int"""
10197 return _core_.MenuItem_GetId(*args, **kwargs)
10198
10199 def IsSeparator(*args, **kwargs):
10200 """IsSeparator(self) -> bool"""
10201 return _core_.MenuItem_IsSeparator(*args, **kwargs)
10202
10203 def SetText(*args, **kwargs):
10204 """SetText(self, String str)"""
10205 return _core_.MenuItem_SetText(*args, **kwargs)
10206
10207 def GetLabel(*args, **kwargs):
10208 """GetLabel(self) -> String"""
10209 return _core_.MenuItem_GetLabel(*args, **kwargs)
10210
10211 def GetText(*args, **kwargs):
10212 """GetText(self) -> String"""
10213 return _core_.MenuItem_GetText(*args, **kwargs)
10214
10215 def GetLabelFromText(*args, **kwargs):
c24da6d6 10216 """GetLabelFromText(String text) -> String"""
d55e5bfc
RD
10217 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
10218
10219 GetLabelFromText = staticmethod(GetLabelFromText)
10220 def GetKind(*args, **kwargs):
10221 """GetKind(self) -> int"""
10222 return _core_.MenuItem_GetKind(*args, **kwargs)
10223
10224 def SetKind(*args, **kwargs):
10225 """SetKind(self, int kind)"""
10226 return _core_.MenuItem_SetKind(*args, **kwargs)
10227
10228 def SetCheckable(*args, **kwargs):
10229 """SetCheckable(self, bool checkable)"""
10230 return _core_.MenuItem_SetCheckable(*args, **kwargs)
10231
10232 def IsCheckable(*args, **kwargs):
10233 """IsCheckable(self) -> bool"""
10234 return _core_.MenuItem_IsCheckable(*args, **kwargs)
10235
10236 def IsSubMenu(*args, **kwargs):
10237 """IsSubMenu(self) -> bool"""
10238 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
10239
10240 def SetSubMenu(*args, **kwargs):
10241 """SetSubMenu(self, Menu menu)"""
10242 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
10243
10244 def GetSubMenu(*args, **kwargs):
10245 """GetSubMenu(self) -> Menu"""
10246 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
10247
10248 def Enable(*args, **kwargs):
10249 """Enable(self, bool enable=True)"""
10250 return _core_.MenuItem_Enable(*args, **kwargs)
10251
10252 def IsEnabled(*args, **kwargs):
10253 """IsEnabled(self) -> bool"""
10254 return _core_.MenuItem_IsEnabled(*args, **kwargs)
10255
10256 def Check(*args, **kwargs):
10257 """Check(self, bool check=True)"""
10258 return _core_.MenuItem_Check(*args, **kwargs)
10259
10260 def IsChecked(*args, **kwargs):
10261 """IsChecked(self) -> bool"""
10262 return _core_.MenuItem_IsChecked(*args, **kwargs)
10263
10264 def Toggle(*args, **kwargs):
10265 """Toggle(self)"""
10266 return _core_.MenuItem_Toggle(*args, **kwargs)
10267
10268 def SetHelp(*args, **kwargs):
10269 """SetHelp(self, String str)"""
10270 return _core_.MenuItem_SetHelp(*args, **kwargs)
10271
10272 def GetHelp(*args, **kwargs):
10273 """GetHelp(self) -> String"""
10274 return _core_.MenuItem_GetHelp(*args, **kwargs)
10275
10276 def GetAccel(*args, **kwargs):
10277 """GetAccel(self) -> AcceleratorEntry"""
10278 return _core_.MenuItem_GetAccel(*args, **kwargs)
10279
10280 def SetAccel(*args, **kwargs):
10281 """SetAccel(self, AcceleratorEntry accel)"""
10282 return _core_.MenuItem_SetAccel(*args, **kwargs)
10283
7449af73
RD
10284 def SetBitmap(*args, **kwargs):
10285 """SetBitmap(self, Bitmap bitmap)"""
10286 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10287
10288 def GetBitmap(*args, **kwargs):
10289 """GetBitmap(self) -> Bitmap"""
10290 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10291
d55e5bfc
RD
10292 def SetFont(*args, **kwargs):
10293 """SetFont(self, Font font)"""
10294 return _core_.MenuItem_SetFont(*args, **kwargs)
10295
10296 def GetFont(*args, **kwargs):
10297 """GetFont(self) -> Font"""
10298 return _core_.MenuItem_GetFont(*args, **kwargs)
10299
10300 def SetTextColour(*args, **kwargs):
10301 """SetTextColour(self, Colour colText)"""
10302 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10303
10304 def GetTextColour(*args, **kwargs):
10305 """GetTextColour(self) -> Colour"""
10306 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10307
10308 def SetBackgroundColour(*args, **kwargs):
10309 """SetBackgroundColour(self, Colour colBack)"""
10310 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10311
10312 def GetBackgroundColour(*args, **kwargs):
10313 """GetBackgroundColour(self) -> Colour"""
10314 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10315
10316 def SetBitmaps(*args, **kwargs):
10317 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10318 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10319
10320 def SetDisabledBitmap(*args, **kwargs):
10321 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10322 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10323
10324 def GetDisabledBitmap(*args, **kwargs):
10325 """GetDisabledBitmap(self) -> Bitmap"""
10326 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10327
10328 def SetMarginWidth(*args, **kwargs):
10329 """SetMarginWidth(self, int nWidth)"""
10330 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10331
10332 def GetMarginWidth(*args, **kwargs):
10333 """GetMarginWidth(self) -> int"""
10334 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10335
10336 def GetDefaultMarginWidth(*args, **kwargs):
c24da6d6 10337 """GetDefaultMarginWidth() -> int"""
d55e5bfc
RD
10338 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
10339
10340 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
10341 def IsOwnerDrawn(*args, **kwargs):
10342 """IsOwnerDrawn(self) -> bool"""
10343 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10344
10345 def SetOwnerDrawn(*args, **kwargs):
10346 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10347 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10348
10349 def ResetOwnerDrawn(*args, **kwargs):
10350 """ResetOwnerDrawn(self)"""
10351 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10352
2131d850 10353_core_.MenuItem_swigregister(MenuItem)
d55e5bfc
RD
10354
10355def MenuItem_GetLabelFromText(*args, **kwargs):
554f62e9
RD
10356 """MenuItem_GetLabelFromText(String text) -> String"""
10357 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 10358
554f62e9
RD
10359def MenuItem_GetDefaultMarginWidth(*args):
10360 """MenuItem_GetDefaultMarginWidth() -> int"""
10361 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d55e5bfc
RD
10362
10363#---------------------------------------------------------------------------
10364
10365class Control(Window):
10366 """
10367 This is the base class for a control or 'widget'.
10368
79fccf9d
RD
10369 A control is generally a small window which processes user input
10370 and/or displays one or more item of data.
d55e5bfc 10371 """
554f62e9
RD
10372 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10373 __repr__ = _swig_repr
10374 def __init__(self, *args, **kwargs):
d55e5bfc 10375 """
248ed943
RD
10376 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10377 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
10378 String name=ControlNameStr) -> Control
10379
79fccf9d
RD
10380 Create a Control. Normally you should only call this from a subclass'
10381 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 10382 """
554f62e9 10383 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d55e5bfc
RD
10384 self._setOORInfo(self)
10385
10386 def Create(*args, **kwargs):
10387 """
248ed943
RD
10388 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10389 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
d55e5bfc
RD
10390 String name=ControlNameStr) -> bool
10391
10392 Do the 2nd phase and create the GUI control.
10393 """
10394 return _core_.Control_Create(*args, **kwargs)
10395
10396 def Command(*args, **kwargs):
10397 """
10398 Command(self, CommandEvent event)
10399
79fccf9d
RD
10400 Simulates the effect of the user issuing a command to the item.
10401
10402 :see: `wx.CommandEvent`
10403
d55e5bfc
RD
10404 """
10405 return _core_.Control_Command(*args, **kwargs)
10406
10407 def GetLabel(*args, **kwargs):
10408 """
10409 GetLabel(self) -> String
10410
10411 Return a control's text.
10412 """
10413 return _core_.Control_GetLabel(*args, **kwargs)
10414
a001823c 10415 def GetClassDefaultAttributes(*args, **kwargs):
f8167d6e 10416 """
a001823c 10417 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
f8167d6e 10418
a001823c
RD
10419 Get the default attributes for this class. This is useful if you want
10420 to use the same font or colour in your own control as in a standard
10421 control -- which is a much better idea than hard coding specific
10422 colours or fonts which might look completely out of place on the
10423 user's system, especially if it uses themes.
f8167d6e 10424
a001823c
RD
10425 The variant parameter is only relevant under Mac currently and is
10426 ignore under other platforms. Under Mac, it will change the size of
10427 the returned font. See `wx.Window.SetWindowVariant` for more about
10428 this.
f8167d6e 10429 """
d55e5bfc
RD
10430 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
10431
10432 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2131d850 10433_core_.Control_swigregister(Control)
d55e5bfc
RD
10434ControlNameStr = cvar.ControlNameStr
10435
10436def PreControl(*args, **kwargs):
10437 """
10438 PreControl() -> Control
10439
10440 Precreate a Control control for 2-phase creation
10441 """
10442 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
10443 return val
10444
10445def Control_GetClassDefaultAttributes(*args, **kwargs):
554f62e9 10446 """
a001823c
RD
10447 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10448
10449 Get the default attributes for this class. This is useful if you want
10450 to use the same font or colour in your own control as in a standard
10451 control -- which is a much better idea than hard coding specific
10452 colours or fonts which might look completely out of place on the
10453 user's system, especially if it uses themes.
10454
10455 The variant parameter is only relevant under Mac currently and is
10456 ignore under other platforms. Under Mac, it will change the size of
10457 the returned font. See `wx.Window.SetWindowVariant` for more about
10458 this.
10459 """
554f62e9 10460 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10461
10462#---------------------------------------------------------------------------
10463
10464class ItemContainer(object):
10465 """
53aa7709
RD
10466 The wx.ItemContainer class defines an interface which is implemented
10467 by all controls which have string subitems, each of which may be
10468 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10469 as `wx.ComboBox` which implements an extended interface deriving from
79fccf9d 10470 this one.
d55e5bfc 10471
79fccf9d
RD
10472 It defines the methods for accessing the control's items and although
10473 each of the derived classes implements them differently, they still
10474 all conform to the same interface.
d55e5bfc 10475
79fccf9d
RD
10476 The items in a wx.ItemContainer have (non empty) string labels and,
10477 optionally, client data associated with them.
d55e5bfc
RD
10478
10479 """
554f62e9
RD
10480 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10481 def __init__(self): raise AttributeError, "No constructor defined"
10482 __repr__ = _swig_repr
d55e5bfc
RD
10483 def Append(*args, **kwargs):
10484 """
10485 Append(self, String item, PyObject clientData=None) -> int
10486
79fccf9d
RD
10487 Adds the item to the control, associating the given data with the item
10488 if not None. The return value is the index of the newly added item
10489 which may be different from the last one if the control is sorted (e.g.
10490 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc
RD
10491 """
10492 return _core_.ItemContainer_Append(*args, **kwargs)
10493
10494 def AppendItems(*args, **kwargs):
10495 """
f5b96ee1 10496 AppendItems(self, List strings)
d55e5bfc 10497
79fccf9d
RD
10498 Apend several items at once to the control. Notice that calling this
10499 method may be much faster than appending the items one by one if you
10500 need to add a lot of items.
d55e5bfc
RD
10501 """
10502 return _core_.ItemContainer_AppendItems(*args, **kwargs)
10503
10504 def Insert(*args, **kwargs):
10505 """
50f151d7 10506 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
d55e5bfc 10507
79fccf9d 10508 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
10509 optionally associating some data object with the item.
10510 """
10511 return _core_.ItemContainer_Insert(*args, **kwargs)
10512
10513 def Clear(*args, **kwargs):
10514 """
10515 Clear(self)
10516
10517 Removes all items from the control.
10518 """
10519 return _core_.ItemContainer_Clear(*args, **kwargs)
10520
10521 def Delete(*args, **kwargs):
10522 """
50f151d7 10523 Delete(self, unsigned int n)
d55e5bfc 10524
79fccf9d
RD
10525 Deletes the item at the zero-based index 'n' from the control. Note
10526 that it is an error (signalled by a `wx.PyAssertionError` exception if
10527 enabled) to remove an item with the index negative or greater or equal
10528 than the number of items in the control.
d55e5bfc
RD
10529 """
10530 return _core_.ItemContainer_Delete(*args, **kwargs)
10531
53aa7709
RD
10532 def GetClientData(*args, **kwargs):
10533 """
50f151d7 10534 GetClientData(self, unsigned int n) -> PyObject
53aa7709
RD
10535
10536 Returns the client data associated with the given item, (if any.)
10537 """
10538 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10539
10540 def SetClientData(*args, **kwargs):
10541 """
50f151d7 10542 SetClientData(self, unsigned int n, PyObject clientData)
53aa7709
RD
10543
10544 Associate the given client data with the item at position n.
10545 """
10546 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10547
d55e5bfc
RD
10548 def GetCount(*args, **kwargs):
10549 """
50f151d7 10550 GetCount(self) -> unsigned int
d55e5bfc
RD
10551
10552 Returns the number of items in the control.
10553 """
10554 return _core_.ItemContainer_GetCount(*args, **kwargs)
10555
10556 def IsEmpty(*args, **kwargs):
10557 """
10558 IsEmpty(self) -> bool
10559
10560 Returns True if the control is empty or False if it has some items.
10561 """
10562 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
10563
10564 def GetString(*args, **kwargs):
10565 """
50f151d7 10566 GetString(self, unsigned int n) -> String
d55e5bfc
RD
10567
10568 Returns the label of the item with the given index.
10569 """
10570 return _core_.ItemContainer_GetString(*args, **kwargs)
10571
10572 def GetStrings(*args, **kwargs):
10573 """GetStrings(self) -> wxArrayString"""
10574 return _core_.ItemContainer_GetStrings(*args, **kwargs)
10575
10576 def SetString(*args, **kwargs):
10577 """
50f151d7 10578 SetString(self, unsigned int n, String s)
d55e5bfc
RD
10579
10580 Sets the label for the given item.
10581 """
10582 return _core_.ItemContainer_SetString(*args, **kwargs)
10583
10584 def FindString(*args, **kwargs):
10585 """
10586 FindString(self, String s) -> int
10587
10588 Finds an item whose label matches the given string. Returns the
79fccf9d
RD
10589 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10590 found.
d55e5bfc
RD
10591 """
10592 return _core_.ItemContainer_FindString(*args, **kwargs)
10593
53aa7709 10594 def SetSelection(*args, **kwargs):
d55e5bfc 10595 """
53aa7709 10596 SetSelection(self, int n)
d55e5bfc
RD
10597
10598 Sets the item at index 'n' to be the selected item.
10599 """
53aa7709 10600 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 10601
d55e5bfc
RD
10602 def GetSelection(*args, **kwargs):
10603 """
10604 GetSelection(self) -> int
10605
79fccf9d
RD
10606 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10607 is selected.
d55e5bfc
RD
10608 """
10609 return _core_.ItemContainer_GetSelection(*args, **kwargs)
10610
53aa7709
RD
10611 def SetStringSelection(*args, **kwargs):
10612 """SetStringSelection(self, String s) -> bool"""
10613 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
10614
d55e5bfc
RD
10615 def GetStringSelection(*args, **kwargs):
10616 """
10617 GetStringSelection(self) -> String
10618
79fccf9d
RD
10619 Returns the label of the selected item or an empty string if no item
10620 is selected.
d55e5bfc
RD
10621 """
10622 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
10623
53aa7709 10624 def Select(*args, **kwargs):
d55e5bfc 10625 """
53aa7709 10626 Select(self, int n)
d55e5bfc 10627
53aa7709
RD
10628 This is the same as `SetSelection` and exists only because it is
10629 slightly more natural for controls which support multiple selection.
d55e5bfc 10630 """
53aa7709 10631 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc 10632
2131d850 10633_core_.ItemContainer_swigregister(ItemContainer)
d55e5bfc
RD
10634
10635#---------------------------------------------------------------------------
10636
10637class ControlWithItems(Control,ItemContainer):
10638 """
79fccf9d
RD
10639 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10640 wx.Control class, and is used for the base class of various controls
10641 that have items.
d55e5bfc 10642 """
554f62e9
RD
10643 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10644 def __init__(self): raise AttributeError, "No constructor defined"
10645 __repr__ = _swig_repr
2131d850 10646_core_.ControlWithItems_swigregister(ControlWithItems)
d55e5bfc
RD
10647
10648#---------------------------------------------------------------------------
10649
10650class SizerItem(Object):
248ed943
RD
10651 """
10652 The wx.SizerItem class is used to track the position, size and other
f460c29d
RD
10653 attributes of each item managed by a `wx.Sizer`. It is not usually
10654 necessary to use this class because the sizer elements can also be
10655 identified by their positions or window or sizer references but
10656 sometimes it may be more convenient to use wx.SizerItem directly.
10657 Also, custom classes derived from `wx.PySizer` will probably need to
10658 use the collection of wx.SizerItems held by wx.Sizer when calculating
10659 layout.
248ed943
RD
10660
10661 :see: `wx.Sizer`, `wx.GBSizerItem`
10662 """
554f62e9
RD
10663 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10664 __repr__ = _swig_repr
10665 def __init__(self, *args, **kwargs):
248ed943
RD
10666 """
10667 __init__(self) -> SizerItem
10668
10669 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10670 size will need to be set before this item can be used in a Sizer.
10671
10672 You will probably never need to create a wx.SizerItem directly as they
10673 are created automatically when the sizer's Add, Insert or Prepend
10674 methods are called.
10675
10676 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10677 """
554f62e9
RD
10678 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10679 __swig_destroy__ = _core_.delete_SizerItem
10680 __del__ = lambda self : None;
d55e5bfc 10681 def DeleteWindows(*args, **kwargs):
248ed943
RD
10682 """
10683 DeleteWindows(self)
10684
10685 Destroy the window or the windows in a subsizer, depending on the type
10686 of item.
10687 """
d55e5bfc
RD
10688 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
10689
10690 def DetachSizer(*args, **kwargs):
248ed943
RD
10691 """
10692 DetachSizer(self)
10693
10694 Enable deleting the SizerItem without destroying the contained sizer.
10695 """
d55e5bfc
RD
10696 return _core_.SizerItem_DetachSizer(*args, **kwargs)
10697
10698 def GetSize(*args, **kwargs):
248ed943
RD
10699 """
10700 GetSize(self) -> Size
10701
10702 Get the current size of the item, as set in the last Layout.
10703 """
d55e5bfc
RD
10704 return _core_.SizerItem_GetSize(*args, **kwargs)
10705
10706 def CalcMin(*args, **kwargs):
248ed943
RD
10707 """
10708 CalcMin(self) -> Size
10709
10710 Calculates the minimum desired size for the item, including any space
10711 needed by borders.
10712 """
d55e5bfc
RD
10713 return _core_.SizerItem_CalcMin(*args, **kwargs)
10714
10715 def SetDimension(*args, **kwargs):
248ed943
RD
10716 """
10717 SetDimension(self, Point pos, Size size)
10718
10719 Set the position and size of the space allocated for this item by the
10720 sizer, and adjust the position and size of the item (window or
10721 subsizer) to be within that space taking alignment and borders into
10722 account.
10723 """
d55e5bfc
RD
10724 return _core_.SizerItem_SetDimension(*args, **kwargs)
10725
10726 def GetMinSize(*args, **kwargs):
248ed943
RD
10727 """
10728 GetMinSize(self) -> Size
10729
10730 Get the minimum size needed for the item.
10731 """
d55e5bfc
RD
10732 return _core_.SizerItem_GetMinSize(*args, **kwargs)
10733
a001823c
RD
10734 def GetMinSizeWithBorder(*args, **kwargs):
10735 """
10736 GetMinSizeWithBorder(self) -> Size
10737
10738 Get the minimum size needed for the item with space for the borders
10739 added, if needed.
10740 """
10741 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
10742
d55e5bfc
RD
10743 def SetInitSize(*args, **kwargs):
10744 """SetInitSize(self, int x, int y)"""
10745 return _core_.SizerItem_SetInitSize(*args, **kwargs)
10746
10747 def SetRatioWH(*args, **kwargs):
248ed943
RD
10748 """
10749 SetRatioWH(self, int width, int height)
10750
10751 Set the ratio item attribute.
10752 """
d55e5bfc
RD
10753 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
10754
10755 def SetRatioSize(*args, **kwargs):
248ed943
RD
10756 """
10757 SetRatioSize(self, Size size)
10758
10759 Set the ratio item attribute.
10760 """
d55e5bfc
RD
10761 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
10762
10763 def SetRatio(*args, **kwargs):
248ed943
RD
10764 """
10765 SetRatio(self, float ratio)
10766
10767 Set the ratio item attribute.
10768 """
d55e5bfc
RD
10769 return _core_.SizerItem_SetRatio(*args, **kwargs)
10770
10771 def GetRatio(*args, **kwargs):
248ed943
RD
10772 """
10773 GetRatio(self) -> float
10774
10775 Set the ratio item attribute.
10776 """
d55e5bfc
RD
10777 return _core_.SizerItem_GetRatio(*args, **kwargs)
10778
c1cb24a4
RD
10779 def GetRect(*args, **kwargs):
10780 """
10781 GetRect(self) -> Rect
10782
10783 Returns the rectangle that the sizer item should occupy
10784 """
10785 return _core_.SizerItem_GetRect(*args, **kwargs)
10786
d55e5bfc 10787 def IsWindow(*args, **kwargs):
248ed943
RD
10788 """
10789 IsWindow(self) -> bool
10790
10791 Is this sizer item a window?
10792 """
d55e5bfc
RD
10793 return _core_.SizerItem_IsWindow(*args, **kwargs)
10794
10795 def IsSizer(*args, **kwargs):
248ed943
RD
10796 """
10797 IsSizer(self) -> bool
10798
10799 Is this sizer item a subsizer?
10800 """
d55e5bfc
RD
10801 return _core_.SizerItem_IsSizer(*args, **kwargs)
10802
10803 def IsSpacer(*args, **kwargs):
248ed943
RD
10804 """
10805 IsSpacer(self) -> bool
10806
10807 Is this sizer item a spacer?
10808 """
d55e5bfc
RD
10809 return _core_.SizerItem_IsSpacer(*args, **kwargs)
10810
10811 def SetProportion(*args, **kwargs):
248ed943
RD
10812 """
10813 SetProportion(self, int proportion)
10814
10815 Set the proportion value for this item.
10816 """
d55e5bfc
RD
10817 return _core_.SizerItem_SetProportion(*args, **kwargs)
10818
10819 def GetProportion(*args, **kwargs):
248ed943
RD
10820 """
10821 GetProportion(self) -> int
10822
10823 Get the proportion value for this item.
10824 """
d55e5bfc
RD
10825 return _core_.SizerItem_GetProportion(*args, **kwargs)
10826
248ed943
RD
10827 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10828 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 10829 def SetFlag(*args, **kwargs):
248ed943
RD
10830 """
10831 SetFlag(self, int flag)
10832
10833 Set the flag value for this item.
10834 """
d55e5bfc
RD
10835 return _core_.SizerItem_SetFlag(*args, **kwargs)
10836
10837 def GetFlag(*args, **kwargs):
248ed943
RD
10838 """
10839 GetFlag(self) -> int
10840
10841 Get the flag value for this item.
10842 """
d55e5bfc
RD
10843 return _core_.SizerItem_GetFlag(*args, **kwargs)
10844
10845 def SetBorder(*args, **kwargs):
248ed943
RD
10846 """
10847 SetBorder(self, int border)
10848
10849 Set the border value for this item.
10850 """
d55e5bfc
RD
10851 return _core_.SizerItem_SetBorder(*args, **kwargs)
10852
10853 def GetBorder(*args, **kwargs):
248ed943
RD
10854 """
10855 GetBorder(self) -> int
10856
10857 Get the border value for this item.
10858 """
d55e5bfc
RD
10859 return _core_.SizerItem_GetBorder(*args, **kwargs)
10860
10861 def GetWindow(*args, **kwargs):
248ed943
RD
10862 """
10863 GetWindow(self) -> Window
10864
10865 Get the window (if any) that is managed by this sizer item.
10866 """
d55e5bfc
RD
10867 return _core_.SizerItem_GetWindow(*args, **kwargs)
10868
10869 def SetWindow(*args, **kwargs):
248ed943
RD
10870 """
10871 SetWindow(self, Window window)
10872
10873 Set the window to be managed by this sizer item.
10874 """
d55e5bfc
RD
10875 return _core_.SizerItem_SetWindow(*args, **kwargs)
10876
10877 def GetSizer(*args, **kwargs):
248ed943
RD
10878 """
10879 GetSizer(self) -> Sizer
10880
10881 Get the subsizer (if any) that is managed by this sizer item.
10882 """
d55e5bfc
RD
10883 return _core_.SizerItem_GetSizer(*args, **kwargs)
10884
10885 def SetSizer(*args, **kwargs):
248ed943
RD
10886 """
10887 SetSizer(self, Sizer sizer)
10888
10889 Set the subsizer to be managed by this sizer item.
10890 """
d55e5bfc
RD
10891 return _core_.SizerItem_SetSizer(*args, **kwargs)
10892
10893 def GetSpacer(*args, **kwargs):
248ed943
RD
10894 """
10895 GetSpacer(self) -> Size
10896
10897 Get the size of the spacer managed by this sizer item.
10898 """
d55e5bfc
RD
10899 return _core_.SizerItem_GetSpacer(*args, **kwargs)
10900
10901 def SetSpacer(*args, **kwargs):
248ed943
RD
10902 """
10903 SetSpacer(self, Size size)
10904
10905 Set the size of the spacer to be managed by this sizer item.
10906 """
d55e5bfc
RD
10907 return _core_.SizerItem_SetSpacer(*args, **kwargs)
10908
10909 def Show(*args, **kwargs):
248ed943
RD
10910 """
10911 Show(self, bool show)
10912
10913 Set the show item attribute, which sizers use to determine if the item
10914 is to be made part of the layout or not. If the item is tracking a
10915 window then it is shown or hidden as needed.
10916 """
d55e5bfc
RD
10917 return _core_.SizerItem_Show(*args, **kwargs)
10918
10919 def IsShown(*args, **kwargs):
248ed943
RD
10920 """
10921 IsShown(self) -> bool
10922
10923 Is the item to be shown in the layout?
10924 """
d55e5bfc
RD
10925 return _core_.SizerItem_IsShown(*args, **kwargs)
10926
10927 def GetPosition(*args, **kwargs):
248ed943
RD
10928 """
10929 GetPosition(self) -> Point
10930
10931 Returns the current position of the item, as set in the last Layout.
10932 """
d55e5bfc
RD
10933 return _core_.SizerItem_GetPosition(*args, **kwargs)
10934
10935 def GetUserData(*args, **kwargs):
248ed943
RD
10936 """
10937 GetUserData(self) -> PyObject
10938
10939 Returns the userData associated with this sizer item, or None if there
10940 isn't any.
10941 """
d55e5bfc
RD
10942 return _core_.SizerItem_GetUserData(*args, **kwargs)
10943
7449af73
RD
10944 def SetUserData(*args, **kwargs):
10945 """
10946 SetUserData(self, PyObject userData)
10947
10948 Associate a Python object with this sizer item.
10949 """
10950 return _core_.SizerItem_SetUserData(*args, **kwargs)
10951
2131d850 10952_core_.SizerItem_swigregister(SizerItem)
d55e5bfc 10953
248ed943 10954def SizerItemWindow(*args, **kwargs):
d55e5bfc 10955 """
248ed943
RD
10956 SizerItemWindow(Window window, int proportion, int flag, int border,
10957 PyObject userData=None) -> SizerItem
10958
10959 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 10960 """
248ed943 10961 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
10962 return val
10963
248ed943 10964def SizerItemSpacer(*args, **kwargs):
d55e5bfc 10965 """
248ed943
RD
10966 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
10967 PyObject userData=None) -> SizerItem
10968
10969 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 10970 """
248ed943 10971 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
10972 return val
10973
10974def SizerItemSizer(*args, **kwargs):
10975 """
10976 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
10977 PyObject userData=None) -> SizerItem
10978
10979 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc
RD
10980 """
10981 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
10982 return val
10983
10984class Sizer(Object):
248ed943
RD
10985 """
10986 wx.Sizer is the abstract base class used for laying out subwindows in
10987 a window. You cannot use wx.Sizer directly; instead, you will have to
10988 use one of the sizer classes derived from it such as `wx.BoxSizer`,
10989 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
10990 and `wx.GridBagSizer`.
10991
10992 The concept implemented by sizers in wxWidgets is closely related to
10993 layout tools in other GUI toolkits, such as Java's AWT, the GTK
10994 toolkit or the Qt toolkit. It is based upon the idea of the individual
10995 subwindows reporting their minimal required size and their ability to
10996 get stretched if the size of the parent window has changed. This will
10997 most often mean that the programmer does not set the original size of
10998 a dialog in the beginning, rather the dialog will assigned a sizer and
10999 this sizer will be queried about the recommended size. The sizer in
11000 turn will query its children, which can be normal windows or contorls,
11001 empty space or other sizers, so that a hierarchy of sizers can be
11002 constructed. Note that wxSizer does not derive from wxWindow and thus
11003 do not interfere with tab ordering and requires very little resources
11004 compared to a real window on screen.
11005
11006 What makes sizers so well fitted for use in wxWidgets is the fact that
11007 every control reports its own minimal size and the algorithm can
11008 handle differences in font sizes or different window (dialog item)
11009 sizes on different platforms without problems. If for example the
11010 standard font as well as the overall design of Mac widgets requires
11011 more space than on Windows, then the initial size of a dialog using a
11012 sizer will automatically be bigger on Mac than on Windows.
11013 """
554f62e9
RD
11014 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11015 def __init__(self): raise AttributeError, "No constructor defined"
11016 __repr__ = _swig_repr
11017 __swig_destroy__ = _core_.delete_Sizer
11018 __del__ = lambda self : None;
d55e5bfc
RD
11019 def _setOORInfo(*args, **kwargs):
11020 """_setOORInfo(self, PyObject _self)"""
11021 return _core_.Sizer__setOORInfo(*args, **kwargs)
11022
11023 def Add(*args, **kwargs):
11024 """
248ed943 11025 Add(self, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 11026 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11027
11028 Appends a child item to the sizer.
d55e5bfc
RD
11029 """
11030 return _core_.Sizer_Add(*args, **kwargs)
11031
11032 def Insert(*args, **kwargs):
11033 """
248ed943 11034 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 11035 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11036
11037 Inserts a new item into the list of items managed by this sizer before
11038 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc
RD
11039 """
11040 return _core_.Sizer_Insert(*args, **kwargs)
11041
11042 def Prepend(*args, **kwargs):
11043 """
248ed943 11044 Prepend(self, item, int proportion=0, int flag=0, int border=0,
c1cb24a4 11045 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11046
11047 Adds a new item to the begining of the list of sizer items managed by
11048 this sizer. See `Add` for a description of the parameters.
d55e5bfc
RD
11049 """
11050 return _core_.Sizer_Prepend(*args, **kwargs)
11051
11052 def Remove(*args, **kwargs):
248ed943
RD
11053 """
11054 Remove(self, item) -> bool
11055
11056 Removes an item from the sizer and destroys it. This method does not
11057 cause any layout or resizing to take place, call `Layout` to update
11058 the layout on screen after removing a child from the sizer. The
11059 *item* parameter can be either a window, a sizer, or the zero-based
11060 index of an item to remove. Returns True if the child item was found
11061 and removed.
11062 """
d55e5bfc
RD
11063 return _core_.Sizer_Remove(*args, **kwargs)
11064
1a6bba1e 11065 def Detach(*args, **kwargs):
248ed943
RD
11066 """
11067 Detach(self, item) -> bool
11068
11069 Detaches an item from the sizer without destroying it. This method
11070 does not cause any layout or resizing to take place, call `Layout` to
11071 do so. The *item* parameter can be either a window, a sizer, or the
11072 zero-based index of the item to be detached. Returns True if the child item
11073 was found and detached.
11074 """
1a6bba1e
RD
11075 return _core_.Sizer_Detach(*args, **kwargs)
11076
c1cb24a4
RD
11077 def GetItem(*args, **kwargs):
11078 """
11079 GetItem(self, item) -> wx.SizerItem
11080
11081 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11082 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11083 the item to be found.
c1cb24a4
RD
11084 """
11085 return _core_.Sizer_GetItem(*args, **kwargs)
11086
d55e5bfc
RD
11087 def _SetItemMinSize(*args, **kwargs):
11088 """_SetItemMinSize(self, PyObject item, Size size)"""
11089 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
11090
248ed943
RD
11091 def SetItemMinSize(self, item, *args):
11092 """
11093 SetItemMinSize(self, item, Size size)
11094
11095 Sets the minimum size that will be allocated for an item in the sizer.
11096 The *item* parameter can be either a window, a sizer, or the
11097 zero-based index of the item. If a window or sizer is given then it
11098 will be searched for recursivly in subsizers if neccessary.
11099 """
11100 if len(args) == 2:
11101 # for backward compatibility accept separate width,height args too
11102 return self._SetItemMinSize(item, args)
11103 else:
11104 return self._SetItemMinSize(item, args[0])
11105
d55e5bfc 11106 def AddItem(*args, **kwargs):
248ed943
RD
11107 """
11108 AddItem(self, SizerItem item)
11109
11110 Adds a `wx.SizerItem` to the sizer.
11111 """
d55e5bfc
RD
11112 return _core_.Sizer_AddItem(*args, **kwargs)
11113
11114 def InsertItem(*args, **kwargs):
248ed943
RD
11115 """
11116 InsertItem(self, int index, SizerItem item)
11117
11118 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11119 """
d55e5bfc
RD
11120 return _core_.Sizer_InsertItem(*args, **kwargs)
11121
11122 def PrependItem(*args, **kwargs):
248ed943
RD
11123 """
11124 PrependItem(self, SizerItem item)
11125
11126 Prepends a `wx.SizerItem` to the sizer.
11127 """
d55e5bfc
RD
11128 return _core_.Sizer_PrependItem(*args, **kwargs)
11129
248ed943 11130 def AddMany(self, items):
c24da6d6
RD
11131 """
11132 AddMany is a convenience method for adding several items
11133 to a sizer at one time. Simply pass it a list of tuples,
11134 where each tuple consists of the parameters that you
11135 would normally pass to the `Add` method.
11136 """
248ed943
RD
11137 for item in items:
11138 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11139 item = (item, )
11140 self.Add(*item)
d55e5bfc
RD
11141
11142 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
11143 def AddWindow(self, *args, **kw):
11144 """Compatibility alias for `Add`."""
11145 return self.Add(*args, **kw)
11146 def AddSizer(self, *args, **kw):
11147 """Compatibility alias for `Add`."""
11148 return self.Add(*args, **kw)
11149 def AddSpacer(self, *args, **kw):
11150 """Compatibility alias for `Add`."""
11151 return self.Add(*args, **kw)
11152
11153 def PrependWindow(self, *args, **kw):
11154 """Compatibility alias for `Prepend`."""
11155 return self.Prepend(*args, **kw)
11156 def PrependSizer(self, *args, **kw):
11157 """Compatibility alias for `Prepend`."""
11158 return self.Prepend(*args, **kw)
11159 def PrependSpacer(self, *args, **kw):
11160 """Compatibility alias for `Prepend`."""
11161 return self.Prepend(*args, **kw)
11162
11163 def InsertWindow(self, *args, **kw):
11164 """Compatibility alias for `Insert`."""
11165 return self.Insert(*args, **kw)
11166 def InsertSizer(self, *args, **kw):
11167 """Compatibility alias for `Insert`."""
11168 return self.Insert(*args, **kw)
11169 def InsertSpacer(self, *args, **kw):
11170 """Compatibility alias for `Insert`."""
11171 return self.Insert(*args, **kw)
11172
11173 def RemoveWindow(self, *args, **kw):
11174 """Compatibility alias for `Remove`."""
11175 return self.Remove(*args, **kw)
11176 def RemoveSizer(self, *args, **kw):
11177 """Compatibility alias for `Remove`."""
11178 return self.Remove(*args, **kw)
11179 def RemovePos(self, *args, **kw):
11180 """Compatibility alias for `Remove`."""
11181 return self.Remove(*args, **kw)
d55e5bfc
RD
11182
11183
d55e5bfc 11184 def SetDimension(*args, **kwargs):
248ed943
RD
11185 """
11186 SetDimension(self, int x, int y, int width, int height)
11187
11188 Call this to force the sizer to take the given dimension and thus
11189 force the items owned by the sizer to resize themselves according to
11190 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11191 methods.
11192 """
d55e5bfc
RD
11193 return _core_.Sizer_SetDimension(*args, **kwargs)
11194
11195 def SetMinSize(*args, **kwargs):
248ed943
RD
11196 """
11197 SetMinSize(self, Size size)
11198
11199 Call this to give the sizer a minimal size. Normally, the sizer will
11200 calculate its minimal size based purely on how much space its children
11201 need. After calling this method `GetMinSize` will return either the
11202 minimal size as requested by its children or the minimal size set
11203 here, depending on which is bigger.
11204 """
d55e5bfc
RD
11205 return _core_.Sizer_SetMinSize(*args, **kwargs)
11206
11207 def GetSize(*args, **kwargs):
248ed943
RD
11208 """
11209 GetSize(self) -> Size
11210
11211 Returns the current size of the space managed by the sizer.
11212 """
d55e5bfc
RD
11213 return _core_.Sizer_GetSize(*args, **kwargs)
11214
11215 def GetPosition(*args, **kwargs):
248ed943
RD
11216 """
11217 GetPosition(self) -> Point
11218
11219 Returns the current position of the sizer's managed space.
11220 """
d55e5bfc
RD
11221 return _core_.Sizer_GetPosition(*args, **kwargs)
11222
11223 def GetMinSize(*args, **kwargs):
248ed943
RD
11224 """
11225 GetMinSize(self) -> Size
11226
11227 Returns the minimal size of the sizer. This is either the combined
11228 minimal size of all the children and their borders or the minimal size
11229 set by SetMinSize, depending on which is bigger.
11230 """
d55e5bfc
RD
11231 return _core_.Sizer_GetMinSize(*args, **kwargs)
11232
11233 def GetSizeTuple(self):
1a6bba1e 11234 return self.GetSize().Get()
d55e5bfc 11235 def GetPositionTuple(self):
1a6bba1e 11236 return self.GetPosition().Get()
d55e5bfc 11237 def GetMinSizeTuple(self):
1a6bba1e 11238 return self.GetMinSize().Get()
d55e5bfc
RD
11239
11240 def RecalcSizes(*args, **kwargs):
248ed943
RD
11241 """
11242 RecalcSizes(self)
11243
11244 Using the sizes calculated by `CalcMin` reposition and resize all the
11245 items managed by this sizer. You should not need to call this directly as
11246 it is called by `Layout`.
11247 """
d55e5bfc
RD
11248 return _core_.Sizer_RecalcSizes(*args, **kwargs)
11249
11250 def CalcMin(*args, **kwargs):
248ed943
RD
11251 """
11252 CalcMin(self) -> Size
11253
11254 This method is where the sizer will do the actual calculation of its
11255 children's minimal sizes. You should not need to call this directly as
11256 it is called by `Layout`.
11257 """
d55e5bfc
RD
11258 return _core_.Sizer_CalcMin(*args, **kwargs)
11259
11260 def Layout(*args, **kwargs):
248ed943
RD
11261 """
11262 Layout(self)
11263
11264 This method will force the recalculation and layout of the items
11265 controlled by the sizer using the current space allocated to the
11266 sizer. Normally this is called automatically from the owning window's
11267 EVT_SIZE handler, but it is also useful to call it from user code when
11268 one of the items in a sizer change size, or items are added or
11269 removed.
11270 """
d55e5bfc
RD
11271 return _core_.Sizer_Layout(*args, **kwargs)
11272
11273 def Fit(*args, **kwargs):
248ed943
RD
11274 """
11275 Fit(self, Window window) -> Size
11276
11277 Tell the sizer to resize the *window* to match the sizer's minimal
11278 size. This is commonly done in the constructor of the window itself in
11279 order to set its initial size to match the needs of the children as
11280 determined by the sizer. Returns the new size.
11281
11282 For a top level window this is the total window size, not the client size.
11283 """
d55e5bfc
RD
11284 return _core_.Sizer_Fit(*args, **kwargs)
11285
11286 def FitInside(*args, **kwargs):
248ed943
RD
11287 """
11288 FitInside(self, Window window)
11289
11290 Tell the sizer to resize the *virtual size* of the *window* to match the
11291 sizer's minimal size. This will not alter the on screen size of the
11292 window, but may cause the addition/removal/alteration of scrollbars
11293 required to view the virtual area in windows which manage it.
11294
11295 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11296
11297 """
d55e5bfc
RD
11298 return _core_.Sizer_FitInside(*args, **kwargs)
11299
11300 def SetSizeHints(*args, **kwargs):
248ed943
RD
11301 """
11302 SetSizeHints(self, Window window)
11303
11304 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11305 match the sizer's minimal size. This is commonly done in the
11306 constructor of the window itself if the window is resizable (as are
11307 many dialogs under Unix and frames on probably all platforms) in order
11308 to prevent the window from being sized smaller than the minimal size
11309 required by the sizer.
11310 """
d55e5bfc
RD
11311 return _core_.Sizer_SetSizeHints(*args, **kwargs)
11312
11313 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
11314 """
11315 SetVirtualSizeHints(self, Window window)
11316
11317 Tell the sizer to set the minimal size of the window virtual area to
11318 match the sizer's minimal size. For windows with managed scrollbars
11319 this will set them appropriately.
11320
11321 :see: `wx.ScrolledWindow.SetScrollbars`
11322
11323 """
d55e5bfc
RD
11324 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
11325
11326 def Clear(*args, **kwargs):
248ed943
RD
11327 """
11328 Clear(self, bool deleteWindows=False)
11329
11330 Clear all items from the sizer, optionally destroying the window items
11331 as well.
11332 """
d55e5bfc
RD
11333 return _core_.Sizer_Clear(*args, **kwargs)
11334
11335 def DeleteWindows(*args, **kwargs):
248ed943
RD
11336 """
11337 DeleteWindows(self)
11338
11339 Destroy all windows managed by the sizer.
11340 """
d55e5bfc
RD
11341 return _core_.Sizer_DeleteWindows(*args, **kwargs)
11342
11343 def GetChildren(*args, **kwargs):
248ed943 11344 """
51b83b37 11345 GetChildren(self) -> list
248ed943
RD
11346
11347 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11348 """
d55e5bfc
RD
11349 return _core_.Sizer_GetChildren(*args, **kwargs)
11350
11351 def Show(*args, **kwargs):
248ed943 11352 """
ae8162c8 11353 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 11354
248ed943
RD
11355 Shows or hides an item managed by the sizer. To make a sizer item
11356 disappear or reappear, use Show followed by `Layout`. The *item*
11357 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
11358 the item. Use the recursive parameter to show or hide an item in a
11359 subsizer. Returns True if the item was found.
248ed943
RD
11360 """
11361 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
11362
11363 def IsShown(*args, **kwargs):
248ed943
RD
11364 """
11365 IsShown(self, item)
11366
b1fcee84 11367 Determines if the item is currently shown. To make a sizer
248ed943
RD
11368 item disappear or reappear, use Show followed by `Layout`. The *item*
11369 parameter can be either a window, a sizer, or the zero-based index of
11370 the item.
11371 """
d55e5bfc
RD
11372 return _core_.Sizer_IsShown(*args, **kwargs)
11373
629e65c2 11374 def Hide(self, item, recursive=False):
248ed943 11375 """
27fb7603 11376 A convenience method for `Show` (item, False, recursive).
248ed943 11377 """
06759a38 11378 return self.Show(item, False, recursive)
248ed943 11379
d55e5bfc 11380 def ShowItems(*args, **kwargs):
248ed943
RD
11381 """
11382 ShowItems(self, bool show)
11383
84f85550 11384 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 11385 """
d55e5bfc
RD
11386 return _core_.Sizer_ShowItems(*args, **kwargs)
11387
2131d850 11388_core_.Sizer_swigregister(Sizer)
d55e5bfc
RD
11389
11390class PySizer(Sizer):
248ed943
RD
11391 """
11392 wx.PySizer is a special version of `wx.Sizer` that has been
11393 instrumented to allow the C++ virtual methods to be overloaded in
11394 Python derived classes. You would derive from this class if you are
11395 wanting to implement a custom sizer in Python code. Simply implement
11396 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11397 For example::
11398
11399 class MySizer(wx.PySizer):
11400 def __init__(self):
11401 wx.PySizer.__init__(self)
11402
11403 def CalcMin(self):
11404 for item in self.GetChildren():
11405 # calculate the total minimum width and height needed
11406 # by all items in the sizer according to this sizer's
11407 # layout algorithm.
11408 ...
11409 return wx.Size(width, height)
11410
11411 def RecalcSizes(self):
11412 # find the space allotted to this sizer
11413 pos = self.GetPosition()
11414 size = self.GetSize()
11415 for item in self.GetChildren():
11416 # Recalculate (if necessary) the position and size of
11417 # each item and then call item.SetDimension to do the
11418 # actual positioning and sizing of the items within the
11419 # space alloted to this sizer.
11420 ...
11421 item.SetDimension(itemPos, itemSize)
11422
11423
11424 When `Layout` is called it first calls `CalcMin` followed by
11425 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 11426 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
11427
11428 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11429
11430
11431 """
554f62e9
RD
11432 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11433 __repr__ = _swig_repr
11434 def __init__(self, *args, **kwargs):
248ed943
RD
11435 """
11436 __init__(self) -> PySizer
11437
11438 Creates a wx.PySizer. Must be called from the __init__ in the derived
11439 class.
11440 """
554f62e9 11441 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
d55e5bfc
RD
11442 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11443
11444 def _setCallbackInfo(*args, **kwargs):
11445 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
11446 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
11447
2131d850 11448_core_.PySizer_swigregister(PySizer)
d55e5bfc
RD
11449
11450#---------------------------------------------------------------------------
11451
11452class BoxSizer(Sizer):
248ed943
RD
11453 """
11454 The basic idea behind a box sizer is that windows will most often be
11455 laid out in rather simple basic geometry, typically in a row or a
11456 column or nested hierarchies of either. A wx.BoxSizer will lay out
11457 its items in a simple row or column, depending on the orientation
11458 parameter passed to the constructor.
11459 """
554f62e9
RD
11460 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11461 __repr__ = _swig_repr
11462 def __init__(self, *args, **kwargs):
248ed943
RD
11463 """
11464 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11465
11466 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11467 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11468 sizer.
11469 """
554f62e9 11470 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d55e5bfc
RD
11471 self._setOORInfo(self)
11472
11473 def GetOrientation(*args, **kwargs):
248ed943
RD
11474 """
11475 GetOrientation(self) -> int
11476
11477 Returns the current orientation of the sizer.
11478 """
d55e5bfc
RD
11479 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
11480
11481 def SetOrientation(*args, **kwargs):
248ed943
RD
11482 """
11483 SetOrientation(self, int orient)
d55e5bfc 11484
248ed943
RD
11485 Resets the orientation of the sizer.
11486 """
11487 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc 11488
2131d850 11489_core_.BoxSizer_swigregister(BoxSizer)
d55e5bfc
RD
11490
11491#---------------------------------------------------------------------------
11492
11493class StaticBoxSizer(BoxSizer):
248ed943
RD
11494 """
11495 wx.StaticBoxSizer derives from and functions identically to the
11496 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11497 manages. Note that this static box must be created separately and
11498 passed to the sizer constructor.
11499 """
554f62e9
RD
11500 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11501 __repr__ = _swig_repr
11502 def __init__(self, *args, **kwargs):
248ed943
RD
11503 """
11504 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11505
11506 Constructor. It takes an associated static box and the orientation
11507 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11508 ``wx.HORIZONTAL``.
11509 """
554f62e9 11510 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d55e5bfc
RD
11511 self._setOORInfo(self)
11512
11513 def GetStaticBox(*args, **kwargs):
248ed943
RD
11514 """
11515 GetStaticBox(self) -> StaticBox
d55e5bfc 11516
248ed943
RD
11517 Returns the static box associated with this sizer.
11518 """
11519 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc 11520
2131d850 11521_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d55e5bfc
RD
11522
11523#---------------------------------------------------------------------------
11524
11525class GridSizer(Sizer):
248ed943
RD
11526 """
11527 A grid sizer is a sizer which lays out its children in a
11528 two-dimensional table with all cells having the same size. In other
11529 words, the width of each cell within the grid is the width of the
11530 widest item added to the sizer and the height of each grid cell is the
11531 height of the tallest item. An optional vertical and/or horizontal
11532 gap between items can also be specified (in pixels.)
11533
11534 Items are placed in the cells of the grid in the order they are added,
11535 in row-major order. In other words, the first row is filled first,
11536 then the second, and so on until all items have been added. (If
11537 neccessary, additional rows will be added as items are added.) If you
11538 need to have greater control over the cells that items are placed in
11539 then use the `wx.GridBagSizer`.
11540
11541 """
554f62e9
RD
11542 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11543 __repr__ = _swig_repr
11544 def __init__(self, *args, **kwargs):
248ed943
RD
11545 """
11546 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11547
11548 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11549 of columns and rows in the sizer - if either of the parameters is
11550 zero, it will be calculated to from the total number of children in
11551 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11552 define extra space between all children.
11553 """
554f62e9 11554 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d55e5bfc
RD
11555 self._setOORInfo(self)
11556
d55e5bfc 11557 def SetCols(*args, **kwargs):
248ed943
RD
11558 """
11559 SetCols(self, int cols)
11560
11561 Sets the number of columns in the sizer.
11562 """
d55e5bfc
RD
11563 return _core_.GridSizer_SetCols(*args, **kwargs)
11564
11565 def SetRows(*args, **kwargs):
248ed943
RD
11566 """
11567 SetRows(self, int rows)
11568
11569 Sets the number of rows in the sizer.
11570 """
d55e5bfc
RD
11571 return _core_.GridSizer_SetRows(*args, **kwargs)
11572
11573 def SetVGap(*args, **kwargs):
248ed943
RD
11574 """
11575 SetVGap(self, int gap)
11576
11577 Sets the vertical gap (in pixels) between the cells in the sizer.
11578 """
d55e5bfc
RD
11579 return _core_.GridSizer_SetVGap(*args, **kwargs)
11580
11581 def SetHGap(*args, **kwargs):
248ed943
RD
11582 """
11583 SetHGap(self, int gap)
11584
11585 Sets the horizontal gap (in pixels) between cells in the sizer
11586 """
d55e5bfc
RD
11587 return _core_.GridSizer_SetHGap(*args, **kwargs)
11588
11589 def GetCols(*args, **kwargs):
248ed943
RD
11590 """
11591 GetCols(self) -> int
11592
11593 Returns the number of columns in the sizer.
11594 """
d55e5bfc
RD
11595 return _core_.GridSizer_GetCols(*args, **kwargs)
11596
11597 def GetRows(*args, **kwargs):
248ed943
RD
11598 """
11599 GetRows(self) -> int
11600
11601 Returns the number of rows in the sizer.
11602 """
d55e5bfc
RD
11603 return _core_.GridSizer_GetRows(*args, **kwargs)
11604
11605 def GetVGap(*args, **kwargs):
248ed943
RD
11606 """
11607 GetVGap(self) -> int
11608
11609 Returns the vertical gap (in pixels) between the cells in the sizer.
11610 """
d55e5bfc
RD
11611 return _core_.GridSizer_GetVGap(*args, **kwargs)
11612
11613 def GetHGap(*args, **kwargs):
248ed943
RD
11614 """
11615 GetHGap(self) -> int
11616
11617 Returns the horizontal gap (in pixels) between cells in the sizer.
11618 """
d55e5bfc
RD
11619 return _core_.GridSizer_GetHGap(*args, **kwargs)
11620
554f62e9
RD
11621 def CalcRowsCols(self):
11622 """
11623 CalcRowsCols() -> (rows, cols)
d55e5bfc 11624
554f62e9
RD
11625 Calculates how many rows and columns will be in the sizer based
11626 on the current number of items and also the rows, cols specified
11627 in the constructor.
11628 """
11629 nitems = len(self.GetChildren())
11630 rows = self.GetRows()
11631 cols = self.GetCols()
11632 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11633 if cols != 0:
11634 rows = (nitems + cols - 1) / cols
11635 elif rows != 0:
11636 cols = (nitems + rows - 1) / rows
11637 return (rows, cols)
11638
2131d850 11639_core_.GridSizer_swigregister(GridSizer)
d55e5bfc
RD
11640
11641#---------------------------------------------------------------------------
11642
11643FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11644FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11645FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11646class FlexGridSizer(GridSizer):
248ed943
RD
11647 """
11648 A flex grid sizer is a sizer which lays out its children in a
11649 two-dimensional table with all table cells in one row having the same
11650 height and all cells in one column having the same width, but all
11651 rows or all columns are not necessarily the same height or width as in
11652 the `wx.GridSizer`.
11653
11654 wx.FlexGridSizer can also size items equally in one direction but
11655 unequally ("flexibly") in the other. If the sizer is only flexible
11656 in one direction (this can be changed using `SetFlexibleDirection`), it
11657 needs to be decided how the sizer should grow in the other ("non
11658 flexible") direction in order to fill the available space. The
11659 `SetNonFlexibleGrowMode` method serves this purpose.
11660
11661
11662 """
554f62e9
RD
11663 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11664 __repr__ = _swig_repr
11665 def __init__(self, *args, **kwargs):
248ed943
RD
11666 """
11667 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11668
11669 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11670 number of columns and rows in the sizer - if either of the parameters
11671 is zero, it will be calculated to from the total number of children in
11672 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11673 define extra space between all children.
11674 """
554f62e9 11675 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d55e5bfc
RD
11676 self._setOORInfo(self)
11677
248ed943
RD
11678 def AddGrowableRow(*args, **kwargs):
11679 """
11680 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 11681
248ed943
RD
11682 Specifies that row *idx* (starting from zero) should be grown if there
11683 is extra space available to the sizer.
d55e5bfc 11684
248ed943
RD
11685 The *proportion* parameter has the same meaning as the stretch factor
11686 for the box sizers except that if all proportions are 0, then all
11687 columns are resized equally (instead of not being resized at all).
11688 """
d55e5bfc
RD
11689 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
11690
11691 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
11692 """
11693 RemoveGrowableRow(self, size_t idx)
11694
11695 Specifies that row *idx* is no longer growable.
11696 """
d55e5bfc
RD
11697 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
11698
11699 def AddGrowableCol(*args, **kwargs):
248ed943
RD
11700 """
11701 AddGrowableCol(self, size_t idx, int proportion=0)
11702
11703 Specifies that column *idx* (starting from zero) should be grown if
11704 there is extra space available to the sizer.
11705
11706 The *proportion* parameter has the same meaning as the stretch factor
11707 for the box sizers except that if all proportions are 0, then all
11708 columns are resized equally (instead of not being resized at all).
11709 """
d55e5bfc
RD
11710 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
11711
11712 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
11713 """
11714 RemoveGrowableCol(self, size_t idx)
11715
11716 Specifies that column *idx* is no longer growable.
11717 """
d55e5bfc
RD
11718 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
11719
11720 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
11721 """
11722 SetFlexibleDirection(self, int direction)
11723
11724 Specifies whether the sizer should flexibly resize its columns, rows,
11725 or both. Argument *direction* can be one of the following values. Any
11726 other value is ignored.
11727
11728 ============== =======================================
11729 wx.VERTICAL Rows are flexibly sized.
11730 wx.HORIZONTAL Columns are flexibly sized.
11731 wx.BOTH Both rows and columns are flexibly sized
11732 (this is the default value).
11733 ============== =======================================
11734
11735 Note that this method does not trigger relayout.
11736
11737 """
d55e5bfc
RD
11738 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
11739
11740 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
11741 """
11742 GetFlexibleDirection(self) -> int
11743
11744 Returns a value that specifies whether the sizer
11745 flexibly resizes its columns, rows, or both (default).
11746
11747 :see: `SetFlexibleDirection`
11748 """
d55e5bfc
RD
11749 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
11750
11751 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
11752 """
11753 SetNonFlexibleGrowMode(self, int mode)
11754
11755 Specifies how the sizer should grow in the non-flexible direction if
11756 there is one (so `SetFlexibleDirection` must have been called
11757 previously). Argument *mode* can be one of the following values:
11758
11759 ========================== =================================================
11760 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11761 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11762 `AddGrowableCol` and `AddGrowableRow`. In this
11763 case equal sizing applies to minimum sizes of
11764 columns or rows (this is the default value).
11765 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11766 the non flexible direction, whether they are
11767 growable or not in the flexbile direction.
11768 ========================== =================================================
11769
11770 Note that this method does not trigger relayout.
11771
11772
11773 """
d55e5bfc
RD
11774 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
11775
11776 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
11777 """
11778 GetNonFlexibleGrowMode(self) -> int
11779
11780 Returns the value that specifies how the sizer grows in the
11781 non-flexible direction if there is one.
11782
11783 :see: `SetNonFlexibleGrowMode`
11784 """
d55e5bfc
RD
11785 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
11786
11787 def GetRowHeights(*args, **kwargs):
a8eff060
RD
11788 """
11789 GetRowHeights(self) -> list
11790
11791 Returns a list of integers representing the heights of each of the
11792 rows in the sizer.
11793 """
d55e5bfc
RD
11794 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
11795
11796 def GetColWidths(*args, **kwargs):
a8eff060
RD
11797 """
11798 GetColWidths(self) -> list
11799
11800 Returns a list of integers representing the widths of each of the
11801 columns in the sizer.
11802 """
d55e5bfc
RD
11803 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
11804
2131d850 11805_core_.FlexGridSizer_swigregister(FlexGridSizer)
d55e5bfc 11806
62d32a5f
RD
11807class StdDialogButtonSizer(BoxSizer):
11808 """
11809 A special sizer that knows how to order and position standard buttons
11810 in order to conform to the current platform's standards. You simply
11811 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 11812 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
11813 will take care of the rest.
11814
11815 """
554f62e9
RD
11816 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11817 __repr__ = _swig_repr
11818 def __init__(self, *args, **kwargs):
62d32a5f 11819 """__init__(self) -> StdDialogButtonSizer"""
554f62e9 11820 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
62d32a5f
RD
11821 def AddButton(*args, **kwargs):
11822 """
11823 AddButton(self, wxButton button)
11824
11825 Use this to add the buttons to this sizer. Do not use the `Add`
11826 method in the base class.
11827 """
11828 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
11829
53aa7709 11830 def Realize(*args, **kwargs):
62d32a5f 11831 """
53aa7709 11832 Realize(self)
62d32a5f
RD
11833
11834 This funciton needs to be called after all the buttons have been added
11835 to the sizer. It will reorder them and position them in a platform
11836 specifc manner.
11837 """
53aa7709 11838 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
11839
11840 def SetAffirmativeButton(*args, **kwargs):
11841 """SetAffirmativeButton(self, wxButton button)"""
11842 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
11843
11844 def SetNegativeButton(*args, **kwargs):
11845 """SetNegativeButton(self, wxButton button)"""
11846 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
11847
11848 def SetCancelButton(*args, **kwargs):
11849 """SetCancelButton(self, wxButton button)"""
11850 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
11851
11852 def GetAffirmativeButton(*args, **kwargs):
11853 """GetAffirmativeButton(self) -> wxButton"""
11854 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
11855
11856 def GetApplyButton(*args, **kwargs):
11857 """GetApplyButton(self) -> wxButton"""
11858 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
11859
11860 def GetNegativeButton(*args, **kwargs):
11861 """GetNegativeButton(self) -> wxButton"""
11862 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
11863
11864 def GetCancelButton(*args, **kwargs):
11865 """GetCancelButton(self) -> wxButton"""
11866 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
11867
11868 def GetHelpButton(*args, **kwargs):
11869 """GetHelpButton(self) -> wxButton"""
11870 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
11871
2131d850 11872_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
62d32a5f 11873
d55e5bfc
RD
11874#---------------------------------------------------------------------------
11875
11876class GBPosition(object):
248ed943
RD
11877 """
11878 This class represents the position of an item in a virtual grid of
11879 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11880 typemaps that will automatically convert from a 2-element sequence of
11881 integers to a wx.GBPosition, so you can use the more pythonic
11882 representation of the position nearly transparently in Python code.
11883 """
554f62e9
RD
11884 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11885 __repr__ = _swig_repr
11886 def __init__(self, *args, **kwargs):
248ed943
RD
11887 """
11888 __init__(self, int row=0, int col=0) -> GBPosition
11889
11890 This class represents the position of an item in a virtual grid of
11891 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11892 typemaps that will automatically convert from a 2-element sequence of
11893 integers to a wx.GBPosition, so you can use the more pythonic
11894 representation of the position nearly transparently in Python code.
11895 """
554f62e9
RD
11896 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11897 __swig_destroy__ = _core_.delete_GBPosition
11898 __del__ = lambda self : None;
d55e5bfc
RD
11899 def GetRow(*args, **kwargs):
11900 """GetRow(self) -> int"""
11901 return _core_.GBPosition_GetRow(*args, **kwargs)
11902
11903 def GetCol(*args, **kwargs):
11904 """GetCol(self) -> int"""
11905 return _core_.GBPosition_GetCol(*args, **kwargs)
11906
11907 def SetRow(*args, **kwargs):
11908 """SetRow(self, int row)"""
11909 return _core_.GBPosition_SetRow(*args, **kwargs)
11910
11911 def SetCol(*args, **kwargs):
11912 """SetCol(self, int col)"""
11913 return _core_.GBPosition_SetCol(*args, **kwargs)
11914
11915 def __eq__(*args, **kwargs):
e9d6f3a4
RD
11916 """
11917 __eq__(self, PyObject other) -> bool
11918
11919 Compare GBPosition for equality.
11920 """
d55e5bfc
RD
11921 return _core_.GBPosition___eq__(*args, **kwargs)
11922
11923 def __ne__(*args, **kwargs):
e9d6f3a4
RD
11924 """
11925 __ne__(self, PyObject other) -> bool
11926
11927 Compare GBPosition for inequality.
11928 """
d55e5bfc
RD
11929 return _core_.GBPosition___ne__(*args, **kwargs)
11930
11931 def Set(*args, **kwargs):
11932 """Set(self, int row=0, int col=0)"""
11933 return _core_.GBPosition_Set(*args, **kwargs)
11934
11935 def Get(*args, **kwargs):
11936 """Get(self) -> PyObject"""
11937 return _core_.GBPosition_Get(*args, **kwargs)
11938
79fccf9d 11939 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
11940 def __str__(self): return str(self.Get())
11941 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11942 def __len__(self): return len(self.Get())
11943 def __getitem__(self, index): return self.Get()[index]
11944 def __setitem__(self, index, val):
11945 if index == 0: self.SetRow(val)
11946 elif index == 1: self.SetCol(val)
11947 else: raise IndexError
11948 def __nonzero__(self): return self.Get() != (0,0)
11949 __safe_for_unpickling__ = True
11950 def __reduce__(self): return (wx.GBPosition, self.Get())
11951
11952 row = property(GetRow, SetRow)
11953 col = property(GetCol, SetCol)
11954
2131d850 11955_core_.GBPosition_swigregister(GBPosition)
d55e5bfc
RD
11956
11957class GBSpan(object):
248ed943
RD
11958 """
11959 This class is used to hold the row and column spanning attributes of
11960 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11961 automatically convert from a 2-element sequence of integers to a
11962 wx.GBSpan, so you can use the more pythonic representation of the span
11963 nearly transparently in Python code.
11964
11965 """
554f62e9
RD
11966 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11967 __repr__ = _swig_repr
11968 def __init__(self, *args, **kwargs):
248ed943
RD
11969 """
11970 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
11971
11972 Construct a new wxGBSpan, optionally setting the rowspan and
11973 colspan. The default is (1,1). (Meaning that the item occupies one
11974 cell in each direction.
11975 """
554f62e9
RD
11976 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
11977 __swig_destroy__ = _core_.delete_GBSpan
11978 __del__ = lambda self : None;
d55e5bfc
RD
11979 def GetRowspan(*args, **kwargs):
11980 """GetRowspan(self) -> int"""
11981 return _core_.GBSpan_GetRowspan(*args, **kwargs)
11982
11983 def GetColspan(*args, **kwargs):
11984 """GetColspan(self) -> int"""
11985 return _core_.GBSpan_GetColspan(*args, **kwargs)
11986
11987 def SetRowspan(*args, **kwargs):
11988 """SetRowspan(self, int rowspan)"""
11989 return _core_.GBSpan_SetRowspan(*args, **kwargs)
11990
11991 def SetColspan(*args, **kwargs):
11992 """SetColspan(self, int colspan)"""
11993 return _core_.GBSpan_SetColspan(*args, **kwargs)
11994
11995 def __eq__(*args, **kwargs):
e9d6f3a4
RD
11996 """
11997 __eq__(self, PyObject other) -> bool
11998
11999 Compare wxGBSpan for equality.
12000 """
d55e5bfc
RD
12001 return _core_.GBSpan___eq__(*args, **kwargs)
12002
12003 def __ne__(*args, **kwargs):
e9d6f3a4
RD
12004 """
12005 __ne__(self, PyObject other) -> bool
12006
12007 Compare GBSpan for inequality.
12008 """
d55e5bfc
RD
12009 return _core_.GBSpan___ne__(*args, **kwargs)
12010
12011 def Set(*args, **kwargs):
12012 """Set(self, int rowspan=1, int colspan=1)"""
12013 return _core_.GBSpan_Set(*args, **kwargs)
12014
12015 def Get(*args, **kwargs):
12016 """Get(self) -> PyObject"""
12017 return _core_.GBSpan_Get(*args, **kwargs)
12018
79fccf9d 12019 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
12020 def __str__(self): return str(self.Get())
12021 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12022 def __len__(self): return len(self.Get())
12023 def __getitem__(self, index): return self.Get()[index]
12024 def __setitem__(self, index, val):
12025 if index == 0: self.SetRowspan(val)
12026 elif index == 1: self.SetColspan(val)
12027 else: raise IndexError
12028 def __nonzero__(self): return self.Get() != (0,0)
12029 __safe_for_unpickling__ = True
12030 def __reduce__(self): return (wx.GBSpan, self.Get())
12031
12032 rowspan = property(GetRowspan, SetRowspan)
12033 colspan = property(GetColspan, SetColspan)
12034
2131d850 12035_core_.GBSpan_swigregister(GBSpan)
d55e5bfc
RD
12036
12037class GBSizerItem(SizerItem):
248ed943
RD
12038 """
12039 The wx.GBSizerItem class is used to track the additional data about
12040 items in a `wx.GridBagSizer` such as the item's position in the grid
12041 and how many rows or columns it spans.
12042
12043 """
554f62e9
RD
12044 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12045 __repr__ = _swig_repr
12046 def __init__(self, *args, **kwargs):
248ed943
RD
12047 """
12048 __init__(self) -> GBSizerItem
12049
12050 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12051 size will need to be set, as well as a position and span before this
12052 item can be used in a Sizer.
12053
12054 You will probably never need to create a wx.GBSizerItem directly as they
12055 are created automatically when the sizer's Add method is called.
12056 """
554f62e9
RD
12057 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12058 __swig_destroy__ = _core_.delete_GBSizerItem
12059 __del__ = lambda self : None;
d55e5bfc 12060 def GetPos(*args, **kwargs):
248ed943
RD
12061 """
12062 GetPos(self) -> GBPosition
12063
12064 Get the grid position of the item
12065 """
d55e5bfc
RD
12066 return _core_.GBSizerItem_GetPos(*args, **kwargs)
12067
12068 def GetPosTuple(self): return self.GetPos().Get()
12069 def GetSpan(*args, **kwargs):
248ed943
RD
12070 """
12071 GetSpan(self) -> GBSpan
12072
12073 Get the row and column spanning of the item
12074 """
d55e5bfc
RD
12075 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
12076
12077 def GetSpanTuple(self): return self.GetSpan().Get()
12078 def SetPos(*args, **kwargs):
248ed943
RD
12079 """
12080 SetPos(self, GBPosition pos) -> bool
12081
12082 If the item is already a member of a sizer then first ensure that
12083 there is no other item that would intersect with this one at the new
12084 position, then set the new position. Returns True if the change is
12085 successful and after the next Layout() the item will be moved.
12086 """
d55e5bfc
RD
12087 return _core_.GBSizerItem_SetPos(*args, **kwargs)
12088
12089 def SetSpan(*args, **kwargs):
248ed943
RD
12090 """
12091 SetSpan(self, GBSpan span) -> bool
12092
12093 If the item is already a member of a sizer then first ensure that
12094 there is no other item that would intersect with this one with its new
12095 spanning size, then set the new spanning. Returns True if the change
12096 is successful and after the next Layout() the item will be resized.
12097
12098 """
d55e5bfc
RD
12099 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
12100
248ed943 12101 def Intersects(*args, **kwargs):
d55e5bfc
RD
12102 """
12103 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
12104
12105 Returns True if this item and the other item instersect.
d55e5bfc 12106 """
248ed943
RD
12107 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12108
12109 def IntersectsPos(*args, **kwargs):
12110 """
12111 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12112
12113 Returns True if the given pos/span would intersect with this item.
12114 """
12115 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
12116
12117 def GetEndPos(*args, **kwargs):
248ed943
RD
12118 """
12119 GetEndPos(self) -> GBPosition
12120
12121 Get the row and column of the endpoint of this item.
12122 """
d55e5bfc
RD
12123 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
12124
12125 def GetGBSizer(*args, **kwargs):
248ed943
RD
12126 """
12127 GetGBSizer(self) -> GridBagSizer
12128
12129 Get the sizer this item is a member of.
12130 """
d55e5bfc
RD
12131 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
12132
12133 def SetGBSizer(*args, **kwargs):
248ed943
RD
12134 """
12135 SetGBSizer(self, GridBagSizer sizer)
12136
12137 Set the sizer this item is a member of.
12138 """
d55e5bfc
RD
12139 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
12140
2131d850 12141_core_.GBSizerItem_swigregister(GBSizerItem)
d55e5bfc
RD
12142DefaultSpan = cvar.DefaultSpan
12143
12144def GBSizerItemWindow(*args, **kwargs):
12145 """
12146 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12147 int border, PyObject userData=None) -> GBSizerItem
12148
12149 Construct a `wx.GBSizerItem` for a window.
d55e5bfc
RD
12150 """
12151 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12152 return val
12153
12154def GBSizerItemSizer(*args, **kwargs):
12155 """
12156 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12157 int border, PyObject userData=None) -> GBSizerItem
12158
12159 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc
RD
12160 """
12161 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12162 return val
12163
12164def GBSizerItemSpacer(*args, **kwargs):
12165 """
12166 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
12167 int flag, int border, PyObject userData=None) -> GBSizerItem
12168
12169 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc
RD
12170 """
12171 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12172 return val
12173
12174class GridBagSizer(FlexGridSizer):
248ed943
RD
12175 """
12176 A `wx.Sizer` that can lay out items in a virtual grid like a
12177 `wx.FlexGridSizer` but in this case explicit positioning of the items
12178 is allowed using `wx.GBPosition`, and items can optionally span more
12179 than one row and/or column using `wx.GBSpan`. The total size of the
12180 virtual grid is determined by the largest row and column that items are
12181 positioned at, adjusted for spanning.
12182
12183 """
554f62e9
RD
12184 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12185 __repr__ = _swig_repr
12186 def __init__(self, *args, **kwargs):
248ed943
RD
12187 """
12188 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12189
12190 Constructor, with optional parameters to specify the gap between the
12191 rows and columns.
12192 """
554f62e9 12193 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
c9c2cf70
RD
12194 self._setOORInfo(self)
12195
d55e5bfc
RD
12196 def Add(*args, **kwargs):
12197 """
248ed943 12198 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
c1cb24a4 12199 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
12200
12201 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12202 more than one row or column as specified with *span*. The remaining
12203 args behave similarly to `wx.Sizer.Add`.
12204
12205 Returns True if the item was successfully placed at the given cell
12206 position, False if something was already there.
12207
d55e5bfc
RD
12208 """
12209 return _core_.GridBagSizer_Add(*args, **kwargs)
12210
12211 def AddItem(*args, **kwargs):
248ed943 12212 """
c1cb24a4 12213 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
12214
12215 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12216 the item was successfully placed at its given cell position, False if
12217 something was already there.
12218 """
d55e5bfc
RD
12219 return _core_.GridBagSizer_AddItem(*args, **kwargs)
12220
84f85550
RD
12221 def GetCellSize(*args, **kwargs):
12222 """
12223 GetCellSize(self, int row, int col) -> Size
12224
12225 Get the size of the specified cell, including hgap and
12226 vgap. Only valid after a Layout.
12227 """
12228 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12229
d55e5bfc 12230 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
12231 """
12232 GetEmptyCellSize(self) -> Size
12233
12234 Get the size used for cells in the grid with no item.
12235 """
d55e5bfc
RD
12236 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
12237
12238 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
12239 """
12240 SetEmptyCellSize(self, Size sz)
12241
12242 Set the size used for cells in the grid with no item.
12243 """
d55e5bfc
RD
12244 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
12245
12246 def GetItemPosition(*args):
12247 """
248ed943
RD
12248 GetItemPosition(self, item) -> GBPosition
12249
12250 Get the grid position of the specified *item* where *item* is either a
12251 window or subsizer that is a member of this sizer, or a zero-based
12252 index of an item.
d55e5bfc
RD
12253 """
12254 return _core_.GridBagSizer_GetItemPosition(*args)
12255
12256 def SetItemPosition(*args):
12257 """
248ed943
RD
12258 SetItemPosition(self, item, GBPosition pos) -> bool
12259
12260 Set the grid position of the specified *item* where *item* is either a
12261 window or subsizer that is a member of this sizer, or a zero-based
12262 index of an item. Returns True on success. If the move is not
12263 allowed (because an item is already there) then False is returned.
12264
d55e5bfc
RD
12265 """
12266 return _core_.GridBagSizer_SetItemPosition(*args)
12267
12268 def GetItemSpan(*args):
12269 """
248ed943
RD
12270 GetItemSpan(self, item) -> GBSpan
12271
12272 Get the row/col spanning of the specified *item* where *item* is
12273 either a window or subsizer that is a member of this sizer, or a
12274 zero-based index of an item.
d55e5bfc
RD
12275 """
12276 return _core_.GridBagSizer_GetItemSpan(*args)
12277
12278 def SetItemSpan(*args):
12279 """
248ed943
RD
12280 SetItemSpan(self, item, GBSpan span) -> bool
12281
12282 Set the row/col spanning of the specified *item* where *item* is
12283 either a window or subsizer that is a member of this sizer, or a
12284 zero-based index of an item. Returns True on success. If the move is
12285 not allowed (because an item is already there) then False is returned.
d55e5bfc
RD
12286 """
12287 return _core_.GridBagSizer_SetItemSpan(*args)
12288
12289 def FindItem(*args):
12290 """
248ed943
RD
12291 FindItem(self, item) -> GBSizerItem
12292
12293 Find the sizer item for the given window or subsizer, returns None if
12294 not found. (non-recursive)
d55e5bfc
RD
12295 """
12296 return _core_.GridBagSizer_FindItem(*args)
12297
12298 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
12299 """
12300 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12301
12302 Return the sizer item for the given grid cell, or None if there is no
12303 item at that position. (non-recursive)
12304 """
d55e5bfc
RD
12305 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
12306
12307 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
12308 """
12309 FindItemAtPoint(self, Point pt) -> GBSizerItem
12310
12311 Return the sizer item located at the point given in *pt*, or None if
12312 there is no item at that point. The (x,y) coordinates in pt correspond
12313 to the client coordinates of the window using the sizer for
12314 layout. (non-recursive)
12315 """
d55e5bfc
RD
12316 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
12317
248ed943
RD
12318 def CheckForIntersection(*args, **kwargs):
12319 """
12320 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 12321
248ed943
RD
12322 Look at all items and see if any intersect (or would overlap) the
12323 given *item*. Returns True if so, False if there would be no overlap.
12324 If an *excludeItem* is given then it will not be checked for
12325 intersection, for example it may be the item we are checking the
12326 position of.
d55e5bfc 12327
248ed943
RD
12328 """
12329 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 12330
248ed943 12331 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 12332 """
248ed943
RD
12333 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12334
12335 Look at all items and see if any intersect (or would overlap) the
12336 given position and span. Returns True if so, False if there would be
12337 no overlap. If an *excludeItem* is given then it will not be checked
12338 for intersection, for example it may be the item we are checking the
12339 position of.
d55e5bfc 12340 """
248ed943 12341 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc 12342
2131d850 12343_core_.GridBagSizer_swigregister(GridBagSizer)
d55e5bfc
RD
12344
12345#---------------------------------------------------------------------------
12346
12347Left = _core_.Left
12348Top = _core_.Top
12349Right = _core_.Right
12350Bottom = _core_.Bottom
12351Width = _core_.Width
12352Height = _core_.Height
12353Centre = _core_.Centre
12354Center = _core_.Center
12355CentreX = _core_.CentreX
12356CentreY = _core_.CentreY
12357Unconstrained = _core_.Unconstrained
12358AsIs = _core_.AsIs
12359PercentOf = _core_.PercentOf
12360Above = _core_.Above
12361Below = _core_.Below
12362LeftOf = _core_.LeftOf
12363RightOf = _core_.RightOf
12364SameAs = _core_.SameAs
12365Absolute = _core_.Absolute
12366class IndividualLayoutConstraint(Object):
12367 """
79fccf9d
RD
12368 Objects of this class are stored in the `wx.LayoutConstraints` class as
12369 one of eight possible constraints that a window can be involved in.
12370 You will never need to create an instance of
12371 wx.IndividualLayoutConstraint, rather you should create a
12372 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 12373 that it contains.
d55e5bfc 12374 """
554f62e9
RD
12375 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12376 def __init__(self): raise AttributeError, "No constructor defined"
12377 __repr__ = _swig_repr
d55e5bfc 12378 def Set(*args, **kwargs):
79fccf9d
RD
12379 """
12380 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12381
12382 Sets the properties of the constraint. Normally called by one of the
12383 convenience functions such as Above, RightOf, SameAs.
12384 """
d55e5bfc
RD
12385 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
12386
12387 def LeftOf(*args, **kwargs):
12388 """
12389 LeftOf(self, Window sibling, int marg=0)
12390
79fccf9d
RD
12391 Constrains this edge to be to the left of the given window, with an
12392 optional margin. Implicitly, this is relative to the left edge of the
12393 other window.
d55e5bfc
RD
12394 """
12395 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
12396
12397 def RightOf(*args, **kwargs):
12398 """
12399 RightOf(self, Window sibling, int marg=0)
12400
79fccf9d
RD
12401 Constrains this edge to be to the right of the given window, with an
12402 optional margin. Implicitly, this is relative to the right edge of the
12403 other window.
d55e5bfc
RD
12404 """
12405 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
12406
12407 def Above(*args, **kwargs):
12408 """
12409 Above(self, Window sibling, int marg=0)
12410
79fccf9d
RD
12411 Constrains this edge to be above the given window, with an optional
12412 margin. Implicitly, this is relative to the top edge of the other
12413 window.
d55e5bfc
RD
12414 """
12415 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
12416
12417 def Below(*args, **kwargs):
12418 """
12419 Below(self, Window sibling, int marg=0)
12420
79fccf9d
RD
12421 Constrains this edge to be below the given window, with an optional
12422 margin. Implicitly, this is relative to the bottom edge of the other
12423 window.
d55e5bfc
RD
12424 """
12425 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
12426
12427 def SameAs(*args, **kwargs):
12428 """
12429 SameAs(self, Window otherW, int edge, int marg=0)
12430
79fccf9d
RD
12431 Constrains this edge or dimension to be to the same as the edge of the
12432 given window, with an optional margin.
d55e5bfc
RD
12433 """
12434 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
12435
12436 def PercentOf(*args, **kwargs):
12437 """
12438 PercentOf(self, Window otherW, int wh, int per)
12439
79fccf9d
RD
12440 Constrains this edge or dimension to be to a percentage of the given
12441 window, with an optional margin.
d55e5bfc
RD
12442 """
12443 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
12444
12445 def Absolute(*args, **kwargs):
12446 """
12447 Absolute(self, int val)
12448
79fccf9d 12449 Constrains this edge or dimension to be the given absolute value.
d55e5bfc
RD
12450 """
12451 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
12452
12453 def Unconstrained(*args, **kwargs):
12454 """
12455 Unconstrained(self)
12456
79fccf9d
RD
12457 Sets this edge or dimension to be unconstrained, that is, dependent on
12458 other edges and dimensions from which this value can be deduced.
d55e5bfc
RD
12459 """
12460 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
12461
12462 def AsIs(*args, **kwargs):
12463 """
12464 AsIs(self)
12465
79fccf9d
RD
12466 Sets this edge or constraint to be whatever the window's value is at
12467 the moment. If either of the width and height constraints are *as is*,
12468 the window will not be resized, but moved instead. This is important
12469 when considering panel items which are intended to have a default
12470 size, such as a button, which may take its size from the size of the
12471 button label.
d55e5bfc
RD
12472 """
12473 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
12474
12475 def GetOtherWindow(*args, **kwargs):
12476 """GetOtherWindow(self) -> Window"""
12477 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
12478
12479 def GetMyEdge(*args, **kwargs):
12480 """GetMyEdge(self) -> int"""
12481 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
12482
12483 def SetEdge(*args, **kwargs):
12484 """SetEdge(self, int which)"""
12485 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
12486
12487 def SetValue(*args, **kwargs):
12488 """SetValue(self, int v)"""
12489 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
12490
12491 def GetMargin(*args, **kwargs):
12492 """GetMargin(self) -> int"""
12493 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
12494
12495 def SetMargin(*args, **kwargs):
12496 """SetMargin(self, int m)"""
12497 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
12498
12499 def GetValue(*args, **kwargs):
12500 """GetValue(self) -> int"""
12501 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
12502
12503 def GetPercent(*args, **kwargs):
12504 """GetPercent(self) -> int"""
12505 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
12506
12507 def GetOtherEdge(*args, **kwargs):
12508 """GetOtherEdge(self) -> int"""
12509 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
12510
12511 def GetDone(*args, **kwargs):
12512 """GetDone(self) -> bool"""
12513 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
12514
12515 def SetDone(*args, **kwargs):
12516 """SetDone(self, bool d)"""
12517 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
12518
12519 def GetRelationship(*args, **kwargs):
12520 """GetRelationship(self) -> int"""
12521 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
12522
12523 def SetRelationship(*args, **kwargs):
12524 """SetRelationship(self, int r)"""
12525 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
12526
12527 def ResetIfWin(*args, **kwargs):
12528 """
12529 ResetIfWin(self, Window otherW) -> bool
12530
12531 Reset constraint if it mentions otherWin
12532 """
12533 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
12534
12535 def SatisfyConstraint(*args, **kwargs):
12536 """
12537 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
12538
12539 Try to satisfy constraint
12540 """
12541 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
12542
12543 def GetEdge(*args, **kwargs):
12544 """
12545 GetEdge(self, int which, Window thisWin, Window other) -> int
12546
12547 Get the value of this edge or dimension, or if this
12548 is not determinable, -1.
12549 """
12550 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
12551
2131d850 12552_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d55e5bfc
RD
12553
12554class LayoutConstraints(Object):
12555 """
79fccf9d
RD
12556 **Note:** constraints are now deprecated and you should use sizers
12557 instead.
d55e5bfc 12558
79fccf9d
RD
12559 Objects of this class can be associated with a window to define its
12560 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
12561
12562 The class consists of the following eight constraints of class
12563 wx.IndividualLayoutConstraint, some or all of which should be accessed
12564 directly to set the appropriate constraints.
12565
12566 * left: represents the left hand edge of the window
12567 * right: represents the right hand edge of the window
12568 * top: represents the top edge of the window
12569 * bottom: represents the bottom edge of the window
12570 * width: represents the width of the window
12571 * height: represents the height of the window
12572 * centreX: represents the horizontal centre point of the window
12573 * centreY: represents the vertical centre point of the window
12574
79fccf9d
RD
12575 Most constraints are initially set to have the relationship
12576 wxUnconstrained, which means that their values should be calculated by
12577 looking at known constraints. The exceptions are width and height,
12578 which are set to wxAsIs to ensure that if the user does not specify a
12579 constraint, the existing width and height will be used, to be
12580 compatible with panel items which often have take a default size. If
12581 the constraint is ``wx.AsIs``, the dimension will not be changed.
12582
12583 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
12584
12585 """
554f62e9
RD
12586 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12587 __repr__ = _swig_repr
d55e5bfc
RD
12588 left = property(_core_.LayoutConstraints_left_get)
12589 top = property(_core_.LayoutConstraints_top_get)
12590 right = property(_core_.LayoutConstraints_right_get)
12591 bottom = property(_core_.LayoutConstraints_bottom_get)
12592 width = property(_core_.LayoutConstraints_width_get)
12593 height = property(_core_.LayoutConstraints_height_get)
12594 centreX = property(_core_.LayoutConstraints_centreX_get)
12595 centreY = property(_core_.LayoutConstraints_centreY_get)
554f62e9 12596 def __init__(self, *args, **kwargs):
d55e5bfc 12597 """__init__(self) -> LayoutConstraints"""
554f62e9
RD
12598 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12599 __swig_destroy__ = _core_.delete_LayoutConstraints
12600 __del__ = lambda self : None;
d55e5bfc
RD
12601 def SatisfyConstraints(*args, **kwargs):
12602 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
12603 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
12604
12605 def AreSatisfied(*args, **kwargs):
12606 """AreSatisfied(self) -> bool"""
12607 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
12608
2131d850 12609_core_.LayoutConstraints_swigregister(LayoutConstraints)
d55e5bfc
RD
12610
12611#----------------------------------------------------------------------------
12612
12613# Use Python's bool constants if available, make some if not
12614try:
12615 True
12616except NameError:
12617 __builtins__.True = 1==1
12618 __builtins__.False = 1==0
12619 def bool(value): return not not value
12620 __builtins__.bool = bool
12621
12622
12623
12624# workarounds for bad wxRTTI names
12625__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12626__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12627__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12628
12629
12630#----------------------------------------------------------------------------
12631# Load version numbers from __version__... Ensure that major and minor
0f63ec68 12632# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
12633
12634from __version__ import *
12635__version__ = VERSION_STRING
12636
0f63ec68
RD
12637assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12638assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
12639if RELEASE_VERSION != _core_.RELEASE_VERSION:
12640 import warnings
0f63ec68 12641 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
12642
12643#----------------------------------------------------------------------------
12644
70b7a5fe
RD
12645# Set wxPython's default string<-->unicode conversion encoding from
12646# the locale, but only if Python's default hasn't been changed. (We
12647# assume that if the user has customized it already then that is the
12648# encoding we need to use as well.)
12649#
12650# The encoding selected here is used when string or unicode objects
12651# need to be converted in order to pass them to wxWidgets. Please be
12652# aware that the default encoding within the same locale may be
12653# slightly different on different platforms. For example, please see
62d32a5f
RD
12654# http://www.alanwood.net/demos/charsetdiffs.html for differences
12655# between the common latin/roman encodings.
396fb509
RD
12656
12657default = _sys.getdefaultencoding()
12658if default == 'ascii':
12659 import locale
12660 import codecs
12661 try:
12662 default = locale.getdefaultlocale()[1]
12663 codecs.lookup(default)
70b7a5fe 12664 except (ValueError, LookupError, TypeError):
396fb509
RD
12665 default = _sys.getdefaultencoding()
12666 del locale
12667 del codecs
5cbf236d
RD
12668if default:
12669 wx.SetDefaultPyEncoding(default)
12670del default
5cbf236d
RD
12671
12672#----------------------------------------------------------------------------
12673
d55e5bfc
RD
12674class PyDeadObjectError(AttributeError):
12675 pass
12676
12677class _wxPyDeadObject(object):
12678 """
12679 Instances of wx objects that are OOR capable will have their __class__
12680 changed to this class when the C++ object is deleted. This should help
12681 prevent crashes due to referencing a bogus C++ pointer.
12682 """
12683 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12684 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12685
12686 def __repr__(self):
12687 if not hasattr(self, "_name"):
12688 self._name = "[unknown]"
12689 return self.reprStr % self._name
12690
12691 def __getattr__(self, *args):
12692 if not hasattr(self, "_name"):
12693 self._name = "[unknown]"
12694 raise PyDeadObjectError(self.attrStr % self._name)
12695
12696 def __nonzero__(self):
12697 return 0
12698
12699
12700
12701class PyUnbornObjectError(AttributeError):
12702 pass
12703
12704class _wxPyUnbornObject(object):
12705 """
12706 Some stock objects are created when the wx._core module is
12707 imported, but their C++ instance is not created until the wx.App
12708 object is created and initialized. These object instances will
12709 temporarily have their __class__ changed to this class so an
12710 exception will be raised if they are used before the C++ instance
12711 is ready.
12712 """
12713
12714 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12715 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12716
12717 def __repr__(self):
12718 #if not hasattr(self, "_name"):
12719 # self._name = "[unknown]"
12720 return self.reprStr #% self._name
12721
12722 def __getattr__(self, *args):
12723 #if not hasattr(self, "_name"):
12724 # self._name = "[unknown]"
12725 raise PyUnbornObjectError(self.attrStr) # % self._name )
12726
12727 def __nonzero__(self):
12728 return 0
12729
12730
12731#----------------------------------------------------------------------------
d55e5bfc
RD
12732
12733def CallAfter(callable, *args, **kw):
12734 """
12735 Call the specified function after the current and pending event
12736 handlers have been completed. This is also good for making GUI
0439c23b
RD
12737 method calls from non-GUI threads. Any extra positional or
12738 keyword args are passed on to the callable when it is called.
12739
12740 :see: `wx.FutureCall`
d55e5bfc
RD
12741 """
12742 app = wx.GetApp()
a001823c 12743 assert app is not None, 'No wx.App created yet'
d55e5bfc 12744
891bb194
RD
12745 if not hasattr(app, "_CallAfterId"):
12746 app._CallAfterId = wx.NewEventType()
12747 app.Connect(-1, -1, app._CallAfterId,
12748 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 12749 evt = wx.PyEvent()
891bb194 12750 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
12751 evt.callable = callable
12752 evt.args = args
12753 evt.kw = kw
12754 wx.PostEvent(app, evt)
12755
d55e5bfc
RD
12756#----------------------------------------------------------------------------
12757
12758
12759class FutureCall:
12760 """
8ac8dba0 12761 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
12762 object once after the given amount of milliseconds, passing any
12763 positional or keyword args. The return value of the callable is
0439c23b 12764 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
12765
12766 If you don't need to get the return value or restart the timer
12767 then there is no need to hold a reference to this object. It will
12768 hold a reference to itself while the timer is running (the timer
12769 has a reference to self.Notify) but the cycle will be broken when
12770 the timer completes, automatically cleaning up the wx.FutureCall
12771 object.
0439c23b
RD
12772
12773 :see: `wx.CallAfter`
d55e5bfc
RD
12774 """
12775 def __init__(self, millis, callable, *args, **kwargs):
12776 self.millis = millis
12777 self.callable = callable
12778 self.SetArgs(*args, **kwargs)
12779 self.runCount = 0
12780 self.running = False
12781 self.hasRun = False
12782 self.result = None
12783 self.timer = None
12784 self.Start()
12785
12786 def __del__(self):
12787 self.Stop()
12788
12789
12790 def Start(self, millis=None, *args, **kwargs):
12791 """
12792 (Re)start the timer
12793 """
12794 self.hasRun = False
12795 if millis is not None:
12796 self.millis = millis
12797 if args or kwargs:
12798 self.SetArgs(*args, **kwargs)
12799 self.Stop()
12800 self.timer = wx.PyTimer(self.Notify)
12801 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
12802 self.running = True
12803 Restart = Start
12804
12805
12806 def Stop(self):
12807 """
12808 Stop and destroy the timer.
12809 """
12810 if self.timer is not None:
12811 self.timer.Stop()
12812 self.timer = None
12813
12814
12815 def GetInterval(self):
12816 if self.timer is not None:
12817 return self.timer.GetInterval()
12818 else:
12819 return 0
12820
12821
12822 def IsRunning(self):
12823 return self.timer is not None and self.timer.IsRunning()
12824
12825
12826 def SetArgs(self, *args, **kwargs):
12827 """
12828 (Re)set the args passed to the callable object. This is
12829 useful in conjunction with Restart if you want to schedule a
12830 new call to the same callable object but with different
12831 parameters.
12832 """
12833 self.args = args
12834 self.kwargs = kwargs
12835
12836
12837 def HasRun(self):
12838 return self.hasRun
12839
12840 def GetResult(self):
12841 return self.result
12842
12843 def Notify(self):
12844 """
12845 The timer has expired so call the callable.
12846 """
12847 if self.callable and getattr(self.callable, 'im_self', True):
12848 self.runCount += 1
12849 self.running = False
12850 self.result = self.callable(*self.args, **self.kwargs)
12851 self.hasRun = True
12852 if not self.running:
12853 # if it wasn't restarted, then cleanup
12854 wx.CallAfter(self.Stop)
12855
12856
12857
12858#----------------------------------------------------------------------------
12859# Control which items in this module should be documented by epydoc.
12860# We allow only classes and functions, which will help reduce the size
12861# of the docs by filtering out the zillions of constants, EVT objects,
12862# and etc that don't make much sense by themselves, but are instead
12863# documented (or will be) as part of the classes/functions/methods
12864# where they should be used.
12865
c24da6d6
RD
12866class __DocFilter:
12867 """
12868 A filter for epydoc that only allows non-Ptr classes and
12869 fucntions, in order to reduce the clutter in the API docs.
12870 """
12871 def __init__(self, globals):
12872 self._globals = globals
12873
12874 def __call__(self, name):
12875 import types
12876 obj = self._globals.get(name, None)
12877 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12878 return False
554f62e9 12879 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
c24da6d6
RD
12880 return False
12881 return True
d55e5bfc
RD
12882
12883#----------------------------------------------------------------------------
12884#----------------------------------------------------------------------------
12885
12886# Import other modules in this package that should show up in the
12887# "core" wx namespace
12888from _gdi import *
12889from _windows import *
12890from _controls import *
12891from _misc import *
12892
d55e5bfc
RD
12893#----------------------------------------------------------------------------
12894#----------------------------------------------------------------------------
12895
12896
7449af73 12897