]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gtk/_core.py
* wx.Panel doesn't have a SetTitle anymore. What was this used for
[wxWidgets.git] / wxPython / src / gtk / _core.py
CommitLineData
0085ce49 1# This file was created automatically by SWIG 1.3.29.
d14a1e28
RD
2# Don't modify this file, modify the SWIG interface instead.
3
54f9ee45 4import _core_
0085ce49
RD
5import new
6new_instancemethod = new.instancemethod
093d3ff1 7def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
0085ce49 8 if (name == "thisown"): return self.this.own(value)
093d3ff1 9 if (name == "this"):
0085ce49
RD
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
093d3ff1
RD
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
0085ce49 15 if (not static) or hasattr(self,name):
093d3ff1
RD
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
0085ce49 24 if (name == "thisown"): return self.this.own()
093d3ff1
RD
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
0085ce49
RD
29def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
093d3ff1
RD
34import types
35try:
36 _object = types.ObjectType
37 _newclass = 1
38except AttributeError:
39 class _object : pass
40 _newclass = 0
41del types
42
43
44def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
0085ce49
RD
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
093d3ff1
RD
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
d14a1e28
RD
54#// Give a reference to the dictionary of this module to the C++ extension
55#// code.
54f9ee45 56_core_._wxPySetDictionary(vars())
d14a1e28
RD
57
58#// A little trick to make 'wx' be a reference to this module so wx.Names can
59#// be used here.
60import sys as _sys
61wx = _sys.modules[__name__]
62
66c033b4
RD
63
64#----------------------------------------------------------------------------
65
66def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81#----------------------------------------------------------------------------
82
54f9ee45
RD
83NOT_FOUND = _core_.NOT_FOUND
84VSCROLL = _core_.VSCROLL
85HSCROLL = _core_.HSCROLL
86CAPTION = _core_.CAPTION
87DOUBLE_BORDER = _core_.DOUBLE_BORDER
88SUNKEN_BORDER = _core_.SUNKEN_BORDER
89RAISED_BORDER = _core_.RAISED_BORDER
90BORDER = _core_.BORDER
91SIMPLE_BORDER = _core_.SIMPLE_BORDER
92STATIC_BORDER = _core_.STATIC_BORDER
93TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94NO_BORDER = _core_.NO_BORDER
bcd0d7b6 95DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 96DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
54f9ee45
RD
97TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98WANTS_CHARS = _core_.WANTS_CHARS
99POPUP_WINDOW = _core_.POPUP_WINDOW
100CENTER_FRAME = _core_.CENTER_FRAME
101CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
54f9ee45
RD
103CLIP_CHILDREN = _core_.CLIP_CHILDREN
104CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
105ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
106RETAINED = _core_.RETAINED
107BACKINGSTORE = _core_.BACKINGSTORE
108COLOURED = _core_.COLOURED
109FIXED_LENGTH = _core_.FIXED_LENGTH
110LB_NEEDED_SB = _core_.LB_NEEDED_SB
111LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
112LB_SORT = _core_.LB_SORT
113LB_SINGLE = _core_.LB_SINGLE
114LB_MULTIPLE = _core_.LB_MULTIPLE
115LB_EXTENDED = _core_.LB_EXTENDED
116LB_OWNERDRAW = _core_.LB_OWNERDRAW
117LB_HSCROLL = _core_.LB_HSCROLL
118PROCESS_ENTER = _core_.PROCESS_ENTER
119PASSWORD = _core_.PASSWORD
120CB_SIMPLE = _core_.CB_SIMPLE
121CB_DROPDOWN = _core_.CB_DROPDOWN
122CB_SORT = _core_.CB_SORT
123CB_READONLY = _core_.CB_READONLY
124RA_HORIZONTAL = _core_.RA_HORIZONTAL
125RA_VERTICAL = _core_.RA_VERTICAL
126RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
127RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
fef4c27a 128RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
54f9ee45
RD
129RB_GROUP = _core_.RB_GROUP
130RB_SINGLE = _core_.RB_SINGLE
54f9ee45
RD
131SB_HORIZONTAL = _core_.SB_HORIZONTAL
132SB_VERTICAL = _core_.SB_VERTICAL
fef4c27a 133RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
54f9ee45
RD
134ST_SIZEGRIP = _core_.ST_SIZEGRIP
135ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
136FLOOD_SURFACE = _core_.FLOOD_SURFACE
137FLOOD_BORDER = _core_.FLOOD_BORDER
138ODDEVEN_RULE = _core_.ODDEVEN_RULE
139WINDING_RULE = _core_.WINDING_RULE
140TOOL_TOP = _core_.TOOL_TOP
141TOOL_BOTTOM = _core_.TOOL_BOTTOM
142TOOL_LEFT = _core_.TOOL_LEFT
143TOOL_RIGHT = _core_.TOOL_RIGHT
144OK = _core_.OK
145YES_NO = _core_.YES_NO
146CANCEL = _core_.CANCEL
147YES = _core_.YES
148NO = _core_.NO
149NO_DEFAULT = _core_.NO_DEFAULT
150YES_DEFAULT = _core_.YES_DEFAULT
151ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
152ICON_HAND = _core_.ICON_HAND
153ICON_QUESTION = _core_.ICON_QUESTION
154ICON_INFORMATION = _core_.ICON_INFORMATION
155ICON_STOP = _core_.ICON_STOP
156ICON_ASTERISK = _core_.ICON_ASTERISK
157ICON_MASK = _core_.ICON_MASK
158ICON_WARNING = _core_.ICON_WARNING
159ICON_ERROR = _core_.ICON_ERROR
160FORWARD = _core_.FORWARD
161BACKWARD = _core_.BACKWARD
162RESET = _core_.RESET
163HELP = _core_.HELP
164MORE = _core_.MORE
165SETUP = _core_.SETUP
166SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
167SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
168SIZE_AUTO = _core_.SIZE_AUTO
169SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
170SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
943e8dfd 171SIZE_FORCE = _core_.SIZE_FORCE
54f9ee45
RD
172PORTRAIT = _core_.PORTRAIT
173LANDSCAPE = _core_.LANDSCAPE
174PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
175PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
176PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
177PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
178ID_ANY = _core_.ID_ANY
179ID_SEPARATOR = _core_.ID_SEPARATOR
943e8dfd 180ID_NONE = _core_.ID_NONE
54f9ee45
RD
181ID_LOWEST = _core_.ID_LOWEST
182ID_OPEN = _core_.ID_OPEN
183ID_CLOSE = _core_.ID_CLOSE
184ID_NEW = _core_.ID_NEW
185ID_SAVE = _core_.ID_SAVE
186ID_SAVEAS = _core_.ID_SAVEAS
187ID_REVERT = _core_.ID_REVERT
188ID_EXIT = _core_.ID_EXIT
189ID_UNDO = _core_.ID_UNDO
190ID_REDO = _core_.ID_REDO
191ID_HELP = _core_.ID_HELP
192ID_PRINT = _core_.ID_PRINT
193ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
194ID_PREVIEW = _core_.ID_PREVIEW
195ID_ABOUT = _core_.ID_ABOUT
196ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
197ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
198ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
199ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
200ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
201ID_PREFERENCES = _core_.ID_PREFERENCES
202ID_CUT = _core_.ID_CUT
203ID_COPY = _core_.ID_COPY
204ID_PASTE = _core_.ID_PASTE
205ID_CLEAR = _core_.ID_CLEAR
206ID_FIND = _core_.ID_FIND
207ID_DUPLICATE = _core_.ID_DUPLICATE
208ID_SELECTALL = _core_.ID_SELECTALL
209ID_DELETE = _core_.ID_DELETE
210ID_REPLACE = _core_.ID_REPLACE
211ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
212ID_PROPERTIES = _core_.ID_PROPERTIES
213ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
214ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
215ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
216ID_VIEW_LIST = _core_.ID_VIEW_LIST
217ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
218ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
219ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
220ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
221ID_FILE1 = _core_.ID_FILE1
222ID_FILE2 = _core_.ID_FILE2
223ID_FILE3 = _core_.ID_FILE3
224ID_FILE4 = _core_.ID_FILE4
225ID_FILE5 = _core_.ID_FILE5
226ID_FILE6 = _core_.ID_FILE6
227ID_FILE7 = _core_.ID_FILE7
228ID_FILE8 = _core_.ID_FILE8
229ID_FILE9 = _core_.ID_FILE9
230ID_OK = _core_.ID_OK
231ID_CANCEL = _core_.ID_CANCEL
232ID_APPLY = _core_.ID_APPLY
233ID_YES = _core_.ID_YES
234ID_NO = _core_.ID_NO
235ID_STATIC = _core_.ID_STATIC
236ID_FORWARD = _core_.ID_FORWARD
237ID_BACKWARD = _core_.ID_BACKWARD
238ID_DEFAULT = _core_.ID_DEFAULT
239ID_MORE = _core_.ID_MORE
240ID_SETUP = _core_.ID_SETUP
241ID_RESET = _core_.ID_RESET
242ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
243ID_YESTOALL = _core_.ID_YESTOALL
244ID_NOTOALL = _core_.ID_NOTOALL
245ID_ABORT = _core_.ID_ABORT
246ID_RETRY = _core_.ID_RETRY
247ID_IGNORE = _core_.ID_IGNORE
7bc1e663
RD
248ID_ADD = _core_.ID_ADD
249ID_REMOVE = _core_.ID_REMOVE
250ID_UP = _core_.ID_UP
251ID_DOWN = _core_.ID_DOWN
252ID_HOME = _core_.ID_HOME
253ID_REFRESH = _core_.ID_REFRESH
254ID_STOP = _core_.ID_STOP
255ID_INDEX = _core_.ID_INDEX
256ID_BOLD = _core_.ID_BOLD
257ID_ITALIC = _core_.ID_ITALIC
258ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
259ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
260ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
261ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
262ID_UNDERLINE = _core_.ID_UNDERLINE
263ID_INDENT = _core_.ID_INDENT
264ID_UNINDENT = _core_.ID_UNINDENT
265ID_ZOOM_100 = _core_.ID_ZOOM_100
266ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
267ID_ZOOM_IN = _core_.ID_ZOOM_IN
268ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
269ID_UNDELETE = _core_.ID_UNDELETE
270ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
54f9ee45
RD
271ID_HIGHEST = _core_.ID_HIGHEST
272OPEN = _core_.OPEN
273SAVE = _core_.SAVE
274HIDE_READONLY = _core_.HIDE_READONLY
275OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
276FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
277MULTIPLE = _core_.MULTIPLE
278CHANGE_DIR = _core_.CHANGE_DIR
279ACCEL_ALT = _core_.ACCEL_ALT
280ACCEL_CTRL = _core_.ACCEL_CTRL
281ACCEL_SHIFT = _core_.ACCEL_SHIFT
282ACCEL_NORMAL = _core_.ACCEL_NORMAL
283PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
284PD_APP_MODAL = _core_.PD_APP_MODAL
285PD_CAN_ABORT = _core_.PD_CAN_ABORT
286PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
287PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
288PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
e505d15e
RD
289PD_SMOOTH = _core_.PD_SMOOTH
290PD_CAN_SKIP = _core_.PD_CAN_SKIP
54f9ee45
RD
291DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
292DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
293MENU_TEAROFF = _core_.MENU_TEAROFF
294MB_DOCKABLE = _core_.MB_DOCKABLE
295NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
296FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
297LI_HORIZONTAL = _core_.LI_HORIZONTAL
298LI_VERTICAL = _core_.LI_VERTICAL
299WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
300WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
301WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
302WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
303WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
304WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
305MM_TEXT = _core_.MM_TEXT
306MM_LOMETRIC = _core_.MM_LOMETRIC
307MM_HIMETRIC = _core_.MM_HIMETRIC
308MM_LOENGLISH = _core_.MM_LOENGLISH
309MM_HIENGLISH = _core_.MM_HIENGLISH
310MM_TWIPS = _core_.MM_TWIPS
311MM_ISOTROPIC = _core_.MM_ISOTROPIC
312MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
313MM_POINTS = _core_.MM_POINTS
314MM_METRIC = _core_.MM_METRIC
315CENTRE = _core_.CENTRE
316CENTER = _core_.CENTER
317HORIZONTAL = _core_.HORIZONTAL
318VERTICAL = _core_.VERTICAL
319BOTH = _core_.BOTH
320LEFT = _core_.LEFT
321RIGHT = _core_.RIGHT
322UP = _core_.UP
323DOWN = _core_.DOWN
324TOP = _core_.TOP
325BOTTOM = _core_.BOTTOM
326NORTH = _core_.NORTH
327SOUTH = _core_.SOUTH
328WEST = _core_.WEST
329EAST = _core_.EAST
330ALL = _core_.ALL
331ALIGN_NOT = _core_.ALIGN_NOT
332ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
333ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
334ALIGN_LEFT = _core_.ALIGN_LEFT
335ALIGN_TOP = _core_.ALIGN_TOP
336ALIGN_RIGHT = _core_.ALIGN_RIGHT
337ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
338ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
339ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
340ALIGN_CENTER = _core_.ALIGN_CENTER
341ALIGN_CENTRE = _core_.ALIGN_CENTRE
342ALIGN_MASK = _core_.ALIGN_MASK
343STRETCH_NOT = _core_.STRETCH_NOT
344SHRINK = _core_.SHRINK
345GROW = _core_.GROW
346EXPAND = _core_.EXPAND
347SHAPED = _core_.SHAPED
348FIXED_MINSIZE = _core_.FIXED_MINSIZE
349TILE = _core_.TILE
350ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
351BORDER_DEFAULT = _core_.BORDER_DEFAULT
352BORDER_NONE = _core_.BORDER_NONE
353BORDER_STATIC = _core_.BORDER_STATIC
354BORDER_SIMPLE = _core_.BORDER_SIMPLE
355BORDER_RAISED = _core_.BORDER_RAISED
356BORDER_SUNKEN = _core_.BORDER_SUNKEN
357BORDER_DOUBLE = _core_.BORDER_DOUBLE
358BORDER_MASK = _core_.BORDER_MASK
7bc1e663
RD
359BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
360BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
361BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
54f9ee45
RD
362DEFAULT = _core_.DEFAULT
363DECORATIVE = _core_.DECORATIVE
364ROMAN = _core_.ROMAN
365SCRIPT = _core_.SCRIPT
366SWISS = _core_.SWISS
367MODERN = _core_.MODERN
368TELETYPE = _core_.TELETYPE
369VARIABLE = _core_.VARIABLE
370FIXED = _core_.FIXED
371NORMAL = _core_.NORMAL
372LIGHT = _core_.LIGHT
373BOLD = _core_.BOLD
374ITALIC = _core_.ITALIC
375SLANT = _core_.SLANT
376SOLID = _core_.SOLID
377DOT = _core_.DOT
378LONG_DASH = _core_.LONG_DASH
379SHORT_DASH = _core_.SHORT_DASH
380DOT_DASH = _core_.DOT_DASH
381USER_DASH = _core_.USER_DASH
382TRANSPARENT = _core_.TRANSPARENT
383STIPPLE = _core_.STIPPLE
d04418a7
RD
384STIPPLE_MASK = _core_.STIPPLE_MASK
385STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
54f9ee45
RD
386BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
387CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
388FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
389CROSS_HATCH = _core_.CROSS_HATCH
390HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
391VERTICAL_HATCH = _core_.VERTICAL_HATCH
392JOIN_BEVEL = _core_.JOIN_BEVEL
393JOIN_MITER = _core_.JOIN_MITER
394JOIN_ROUND = _core_.JOIN_ROUND
395CAP_ROUND = _core_.CAP_ROUND
396CAP_PROJECTING = _core_.CAP_PROJECTING
397CAP_BUTT = _core_.CAP_BUTT
398CLEAR = _core_.CLEAR
399XOR = _core_.XOR
400INVERT = _core_.INVERT
401OR_REVERSE = _core_.OR_REVERSE
402AND_REVERSE = _core_.AND_REVERSE
403COPY = _core_.COPY
404AND = _core_.AND
405AND_INVERT = _core_.AND_INVERT
406NO_OP = _core_.NO_OP
407NOR = _core_.NOR
408EQUIV = _core_.EQUIV
409SRC_INVERT = _core_.SRC_INVERT
410OR_INVERT = _core_.OR_INVERT
411NAND = _core_.NAND
412OR = _core_.OR
413SET = _core_.SET
414WXK_BACK = _core_.WXK_BACK
415WXK_TAB = _core_.WXK_TAB
416WXK_RETURN = _core_.WXK_RETURN
417WXK_ESCAPE = _core_.WXK_ESCAPE
418WXK_SPACE = _core_.WXK_SPACE
419WXK_DELETE = _core_.WXK_DELETE
420WXK_START = _core_.WXK_START
421WXK_LBUTTON = _core_.WXK_LBUTTON
422WXK_RBUTTON = _core_.WXK_RBUTTON
423WXK_CANCEL = _core_.WXK_CANCEL
424WXK_MBUTTON = _core_.WXK_MBUTTON
425WXK_CLEAR = _core_.WXK_CLEAR
426WXK_SHIFT = _core_.WXK_SHIFT
427WXK_ALT = _core_.WXK_ALT
428WXK_CONTROL = _core_.WXK_CONTROL
429WXK_MENU = _core_.WXK_MENU
430WXK_PAUSE = _core_.WXK_PAUSE
431WXK_CAPITAL = _core_.WXK_CAPITAL
432WXK_PRIOR = _core_.WXK_PRIOR
433WXK_NEXT = _core_.WXK_NEXT
434WXK_END = _core_.WXK_END
435WXK_HOME = _core_.WXK_HOME
436WXK_LEFT = _core_.WXK_LEFT
437WXK_UP = _core_.WXK_UP
438WXK_RIGHT = _core_.WXK_RIGHT
439WXK_DOWN = _core_.WXK_DOWN
440WXK_SELECT = _core_.WXK_SELECT
441WXK_PRINT = _core_.WXK_PRINT
442WXK_EXECUTE = _core_.WXK_EXECUTE
443WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
444WXK_INSERT = _core_.WXK_INSERT
445WXK_HELP = _core_.WXK_HELP
446WXK_NUMPAD0 = _core_.WXK_NUMPAD0
447WXK_NUMPAD1 = _core_.WXK_NUMPAD1
448WXK_NUMPAD2 = _core_.WXK_NUMPAD2
449WXK_NUMPAD3 = _core_.WXK_NUMPAD3
450WXK_NUMPAD4 = _core_.WXK_NUMPAD4
451WXK_NUMPAD5 = _core_.WXK_NUMPAD5
452WXK_NUMPAD6 = _core_.WXK_NUMPAD6
453WXK_NUMPAD7 = _core_.WXK_NUMPAD7
454WXK_NUMPAD8 = _core_.WXK_NUMPAD8
455WXK_NUMPAD9 = _core_.WXK_NUMPAD9
456WXK_MULTIPLY = _core_.WXK_MULTIPLY
457WXK_ADD = _core_.WXK_ADD
458WXK_SEPARATOR = _core_.WXK_SEPARATOR
459WXK_SUBTRACT = _core_.WXK_SUBTRACT
460WXK_DECIMAL = _core_.WXK_DECIMAL
461WXK_DIVIDE = _core_.WXK_DIVIDE
462WXK_F1 = _core_.WXK_F1
463WXK_F2 = _core_.WXK_F2
464WXK_F3 = _core_.WXK_F3
465WXK_F4 = _core_.WXK_F4
466WXK_F5 = _core_.WXK_F5
467WXK_F6 = _core_.WXK_F6
468WXK_F7 = _core_.WXK_F7
469WXK_F8 = _core_.WXK_F8
470WXK_F9 = _core_.WXK_F9
471WXK_F10 = _core_.WXK_F10
472WXK_F11 = _core_.WXK_F11
473WXK_F12 = _core_.WXK_F12
474WXK_F13 = _core_.WXK_F13
475WXK_F14 = _core_.WXK_F14
476WXK_F15 = _core_.WXK_F15
477WXK_F16 = _core_.WXK_F16
478WXK_F17 = _core_.WXK_F17
479WXK_F18 = _core_.WXK_F18
480WXK_F19 = _core_.WXK_F19
481WXK_F20 = _core_.WXK_F20
482WXK_F21 = _core_.WXK_F21
483WXK_F22 = _core_.WXK_F22
484WXK_F23 = _core_.WXK_F23
485WXK_F24 = _core_.WXK_F24
486WXK_NUMLOCK = _core_.WXK_NUMLOCK
487WXK_SCROLL = _core_.WXK_SCROLL
488WXK_PAGEUP = _core_.WXK_PAGEUP
489WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
490WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
491WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
492WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
493WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
494WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
495WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
496WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
497WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
498WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
499WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
500WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
501WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
502WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
503WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
504WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
505WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
506WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
507WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
508WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
509WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
510WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
511WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
512WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
513WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
514WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
515WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
516WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
517WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
518WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
519WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
88c6b281
RD
520WXK_COMMAND = _core_.WXK_COMMAND
521WXK_SPECIAL1 = _core_.WXK_SPECIAL1
522WXK_SPECIAL2 = _core_.WXK_SPECIAL2
523WXK_SPECIAL3 = _core_.WXK_SPECIAL3
524WXK_SPECIAL4 = _core_.WXK_SPECIAL4
525WXK_SPECIAL5 = _core_.WXK_SPECIAL5
526WXK_SPECIAL6 = _core_.WXK_SPECIAL6
527WXK_SPECIAL7 = _core_.WXK_SPECIAL7
528WXK_SPECIAL8 = _core_.WXK_SPECIAL8
529WXK_SPECIAL9 = _core_.WXK_SPECIAL9
530WXK_SPECIAL10 = _core_.WXK_SPECIAL10
531WXK_SPECIAL11 = _core_.WXK_SPECIAL11
532WXK_SPECIAL12 = _core_.WXK_SPECIAL12
533WXK_SPECIAL13 = _core_.WXK_SPECIAL13
534WXK_SPECIAL14 = _core_.WXK_SPECIAL14
535WXK_SPECIAL15 = _core_.WXK_SPECIAL15
536WXK_SPECIAL16 = _core_.WXK_SPECIAL16
537WXK_SPECIAL17 = _core_.WXK_SPECIAL17
538WXK_SPECIAL18 = _core_.WXK_SPECIAL18
539WXK_SPECIAL19 = _core_.WXK_SPECIAL19
540WXK_SPECIAL20 = _core_.WXK_SPECIAL20
54f9ee45
RD
541PAPER_NONE = _core_.PAPER_NONE
542PAPER_LETTER = _core_.PAPER_LETTER
543PAPER_LEGAL = _core_.PAPER_LEGAL
544PAPER_A4 = _core_.PAPER_A4
545PAPER_CSHEET = _core_.PAPER_CSHEET
546PAPER_DSHEET = _core_.PAPER_DSHEET
547PAPER_ESHEET = _core_.PAPER_ESHEET
548PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
549PAPER_TABLOID = _core_.PAPER_TABLOID
550PAPER_LEDGER = _core_.PAPER_LEDGER
551PAPER_STATEMENT = _core_.PAPER_STATEMENT
552PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
553PAPER_A3 = _core_.PAPER_A3
554PAPER_A4SMALL = _core_.PAPER_A4SMALL
555PAPER_A5 = _core_.PAPER_A5
556PAPER_B4 = _core_.PAPER_B4
557PAPER_B5 = _core_.PAPER_B5
558PAPER_FOLIO = _core_.PAPER_FOLIO
559PAPER_QUARTO = _core_.PAPER_QUARTO
560PAPER_10X14 = _core_.PAPER_10X14
561PAPER_11X17 = _core_.PAPER_11X17
562PAPER_NOTE = _core_.PAPER_NOTE
563PAPER_ENV_9 = _core_.PAPER_ENV_9
564PAPER_ENV_10 = _core_.PAPER_ENV_10
565PAPER_ENV_11 = _core_.PAPER_ENV_11
566PAPER_ENV_12 = _core_.PAPER_ENV_12
567PAPER_ENV_14 = _core_.PAPER_ENV_14
568PAPER_ENV_DL = _core_.PAPER_ENV_DL
569PAPER_ENV_C5 = _core_.PAPER_ENV_C5
570PAPER_ENV_C3 = _core_.PAPER_ENV_C3
571PAPER_ENV_C4 = _core_.PAPER_ENV_C4
572PAPER_ENV_C6 = _core_.PAPER_ENV_C6
573PAPER_ENV_C65 = _core_.PAPER_ENV_C65
574PAPER_ENV_B4 = _core_.PAPER_ENV_B4
575PAPER_ENV_B5 = _core_.PAPER_ENV_B5
576PAPER_ENV_B6 = _core_.PAPER_ENV_B6
577PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
578PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
579PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
580PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
581PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
582PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
583PAPER_ISO_B4 = _core_.PAPER_ISO_B4
584PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
585PAPER_9X11 = _core_.PAPER_9X11
586PAPER_10X11 = _core_.PAPER_10X11
587PAPER_15X11 = _core_.PAPER_15X11
588PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
589PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
590PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
591PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
592PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
593PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
594PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
595PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
596PAPER_A_PLUS = _core_.PAPER_A_PLUS
597PAPER_B_PLUS = _core_.PAPER_B_PLUS
598PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
599PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
600PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
601PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
602PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
603PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
604PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
605PAPER_A2 = _core_.PAPER_A2
606PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
607PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
6c75a4cf
RD
608PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
609PAPER_A6 = _core_.PAPER_A6
610PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
611PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
612PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
613PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
614PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
615PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
616PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
617PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
618PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
619PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
620PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
621PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
622PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
623PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
624PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
625PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
626PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
627PAPER_B6_JIS = _core_.PAPER_B6_JIS
628PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
629PAPER_12X11 = _core_.PAPER_12X11
630PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
631PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
632PAPER_P16K = _core_.PAPER_P16K
633PAPER_P32K = _core_.PAPER_P32K
634PAPER_P32KBIG = _core_.PAPER_P32KBIG
635PAPER_PENV_1 = _core_.PAPER_PENV_1
636PAPER_PENV_2 = _core_.PAPER_PENV_2
637PAPER_PENV_3 = _core_.PAPER_PENV_3
638PAPER_PENV_4 = _core_.PAPER_PENV_4
639PAPER_PENV_5 = _core_.PAPER_PENV_5
640PAPER_PENV_6 = _core_.PAPER_PENV_6
641PAPER_PENV_7 = _core_.PAPER_PENV_7
642PAPER_PENV_8 = _core_.PAPER_PENV_8
643PAPER_PENV_9 = _core_.PAPER_PENV_9
644PAPER_PENV_10 = _core_.PAPER_PENV_10
645PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
646PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
647PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
648PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
649PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
650PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
651PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
652PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
653PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
654PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
655PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
656PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
657PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
54f9ee45
RD
658DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
659DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
660DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
661ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
662ITEM_NORMAL = _core_.ITEM_NORMAL
663ITEM_CHECK = _core_.ITEM_CHECK
664ITEM_RADIO = _core_.ITEM_RADIO
665ITEM_MAX = _core_.ITEM_MAX
666HT_NOWHERE = _core_.HT_NOWHERE
667HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
668HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
669HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
670HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
671HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
672HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
673HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
674HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
675HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
676HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
677HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
678HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
679HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
680HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
681HT_MAX = _core_.HT_MAX
682MOD_NONE = _core_.MOD_NONE
683MOD_ALT = _core_.MOD_ALT
684MOD_CONTROL = _core_.MOD_CONTROL
943e8dfd 685MOD_ALTGR = _core_.MOD_ALTGR
54f9ee45 686MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 687MOD_META = _core_.MOD_META
54f9ee45 688MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
689MOD_CMD = _core_.MOD_CMD
690MOD_ALL = _core_.MOD_ALL
54f9ee45
RD
691UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
692UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
693UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d14a1e28
RD
694#---------------------------------------------------------------------------
695
696class Object(object):
0df68c9f
RD
697 """
698 The base class for most wx objects, although in wxPython not
699 much functionality is needed nor exposed.
700 """
0085ce49
RD
701 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
702 def __init__(self): raise AttributeError, "No constructor defined"
703 __repr__ = _swig_repr
e811c8ce 704 def GetClassName(*args, **kwargs):
0df68c9f 705 """
a95a7133 706 GetClassName(self) -> String
e811c8ce 707
a95a7133 708 Returns the class name of the C++ class using wxRTTI.
0df68c9f 709 """
54f9ee45 710 return _core_.Object_GetClassName(*args, **kwargs)
e811c8ce
RD
711
712 def Destroy(*args, **kwargs):
0df68c9f 713 """
a95a7133 714 Destroy(self)
e811c8ce 715
0df68c9f
RD
716 Deletes the C++ object this Python object is a proxy for.
717 """
7e08d4ef
RD
718 val = _core_.Object_Destroy(*args, **kwargs)
719 args[0].thisown = 0
720 return val
e811c8ce 721
0085ce49
RD
722Object_swigregister = _core_.Object_swigregister
723Object_swigregister(Object)
54f9ee45 724_wxPySetDictionary = _core_._wxPySetDictionary
54f9ee45 725_wxPyFixStockObjects = _core_._wxPyFixStockObjects
54f9ee45 726cvar = _core_.cvar
196addbf 727EmptyString = cvar.EmptyString
d14a1e28
RD
728
729#---------------------------------------------------------------------------
730
54f9ee45
RD
731BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
732BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
733BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
734BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
735BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
736BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
737BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
738BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
739BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
740BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
741BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
742BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
743BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
744BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
745BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
746BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
747BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
748BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
749BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
750BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
751CURSOR_NONE = _core_.CURSOR_NONE
752CURSOR_ARROW = _core_.CURSOR_ARROW
753CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
754CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
755CURSOR_CHAR = _core_.CURSOR_CHAR
756CURSOR_CROSS = _core_.CURSOR_CROSS
757CURSOR_HAND = _core_.CURSOR_HAND
758CURSOR_IBEAM = _core_.CURSOR_IBEAM
759CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
760CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
761CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
762CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
763CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
764CURSOR_PENCIL = _core_.CURSOR_PENCIL
765CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
766CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
767CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
768CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
769CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
770CURSOR_SIZENS = _core_.CURSOR_SIZENS
771CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
772CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
773CURSOR_SIZING = _core_.CURSOR_SIZING
774CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
775CURSOR_WAIT = _core_.CURSOR_WAIT
776CURSOR_WATCH = _core_.CURSOR_WATCH
777CURSOR_BLANK = _core_.CURSOR_BLANK
778CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
779CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
780CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
781CURSOR_MAX = _core_.CURSOR_MAX
d14a1e28
RD
782#---------------------------------------------------------------------------
783
784class Size(object):
0df68c9f 785 """
41e2b43e 786 wx.Size is a useful data structure used to represent the size of
0085ce49
RD
787 something. It simply contains integer width and height
788 properties. In most places in wxPython where a wx.Size is
093d3ff1 789 expected a (width, height) tuple can be used instead.
0df68c9f 790 """
0085ce49
RD
791 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
792 __repr__ = _swig_repr
54f9ee45
RD
793 width = property(_core_.Size_width_get, _core_.Size_width_set)
794 height = property(_core_.Size_height_get, _core_.Size_height_set)
242b7b46 795 x = width; y = height
0085ce49 796 def __init__(self, *args, **kwargs):
0df68c9f 797 """
a95a7133 798 __init__(self, int w=0, int h=0) -> Size
e811c8ce 799
0df68c9f
RD
800 Creates a size object.
801 """
0085ce49
RD
802 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
803 __swig_destroy__ = _core_.delete_Size
804 __del__ = lambda self : None;
e811c8ce 805 def __eq__(*args, **kwargs):
0df68c9f 806 """
a95a7133 807 __eq__(self, Size sz) -> bool
e811c8ce 808
0df68c9f
RD
809 Test for equality of wx.Size objects.
810 """
54f9ee45 811 return _core_.Size___eq__(*args, **kwargs)
e811c8ce
RD
812
813 def __ne__(*args, **kwargs):
0df68c9f 814 """
a95a7133 815 __ne__(self, Size sz) -> bool
e811c8ce 816
0df68c9f
RD
817 Test for inequality.
818 """
54f9ee45 819 return _core_.Size___ne__(*args, **kwargs)
e811c8ce
RD
820
821 def __add__(*args, **kwargs):
0df68c9f 822 """
a95a7133 823 __add__(self, Size sz) -> Size
e811c8ce 824
0df68c9f
RD
825 Add sz's proprties to this and return the result.
826 """
54f9ee45 827 return _core_.Size___add__(*args, **kwargs)
e811c8ce
RD
828
829 def __sub__(*args, **kwargs):
0df68c9f 830 """
a95a7133 831 __sub__(self, Size sz) -> Size
e811c8ce 832
0df68c9f
RD
833 Subtract sz's properties from this and return the result.
834 """
54f9ee45 835 return _core_.Size___sub__(*args, **kwargs)
e811c8ce
RD
836
837 def IncTo(*args, **kwargs):
0df68c9f 838 """
a95a7133 839 IncTo(self, Size sz)
e811c8ce 840
0df68c9f
RD
841 Increments this object so that both of its dimensions are not less
842 than the corresponding dimensions of the size.
843 """
54f9ee45 844 return _core_.Size_IncTo(*args, **kwargs)
e811c8ce
RD
845
846 def DecTo(*args, **kwargs):
0df68c9f 847 """
a95a7133 848 DecTo(self, Size sz)
e811c8ce 849
0df68c9f
RD
850 Decrements this object so that both of its dimensions are not greater
851 than the corresponding dimensions of the size.
852 """
54f9ee45 853 return _core_.Size_DecTo(*args, **kwargs)
e811c8ce
RD
854
855 def Set(*args, **kwargs):
0df68c9f 856 """
a95a7133 857 Set(self, int w, int h)
e811c8ce 858
0df68c9f
RD
859 Set both width and height.
860 """
54f9ee45 861 return _core_.Size_Set(*args, **kwargs)
e811c8ce
RD
862
863 def SetWidth(*args, **kwargs):
a95a7133 864 """SetWidth(self, int w)"""
54f9ee45 865 return _core_.Size_SetWidth(*args, **kwargs)
e811c8ce
RD
866
867 def SetHeight(*args, **kwargs):
a95a7133 868 """SetHeight(self, int h)"""
54f9ee45 869 return _core_.Size_SetHeight(*args, **kwargs)
e811c8ce
RD
870
871 def GetWidth(*args, **kwargs):
a95a7133 872 """GetWidth(self) -> int"""
54f9ee45 873 return _core_.Size_GetWidth(*args, **kwargs)
e811c8ce
RD
874
875 def GetHeight(*args, **kwargs):
a95a7133 876 """GetHeight(self) -> int"""
54f9ee45 877 return _core_.Size_GetHeight(*args, **kwargs)
e811c8ce 878
74a57fcd
RD
879 def IsFullySpecified(*args, **kwargs):
880 """
a95a7133 881 IsFullySpecified(self) -> bool
74a57fcd
RD
882
883 Returns True if both components of the size are non-default values.
884 """
54f9ee45 885 return _core_.Size_IsFullySpecified(*args, **kwargs)
74a57fcd
RD
886
887 def SetDefaults(*args, **kwargs):
888 """
a95a7133 889 SetDefaults(self, Size size)
74a57fcd 890
41e2b43e
RD
891 Combine this size with the other one replacing the default components
892 of this object (i.e. equal to -1) with those of the other.
74a57fcd 893 """
54f9ee45 894 return _core_.Size_SetDefaults(*args, **kwargs)
74a57fcd 895
e811c8ce 896 def Get(*args, **kwargs):
0df68c9f
RD
897 """
898 Get() -> (width,height)
e811c8ce 899
0df68c9f
RD
900 Returns the width and height properties as a tuple.
901 """
54f9ee45 902 return _core_.Size_Get(*args, **kwargs)
e811c8ce 903
41e2b43e 904 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
905 def __str__(self): return str(self.Get())
906 def __repr__(self): return 'wx.Size'+str(self.Get())
907 def __len__(self): return len(self.Get())
908 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
909 def __setitem__(self, index, val):
910 if index == 0: self.width = val
911 elif index == 1: self.height = val
912 else: raise IndexError
e811c8ce 913 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
914 __safe_for_unpickling__ = True
915 def __reduce__(self): return (wx.Size, self.Get())
d14a1e28 916
0085ce49
RD
917Size_swigregister = _core_.Size_swigregister
918Size_swigregister(Size)
d14a1e28
RD
919
920#---------------------------------------------------------------------------
921
922class RealPoint(object):
0df68c9f 923 """
41e2b43e
RD
924 A data structure for representing a point or position with floating
925 point x and y properties. In wxPython most places that expect a
926 wx.RealPoint can also accept a (x,y) tuple.
0df68c9f 927 """
0085ce49
RD
928 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
929 __repr__ = _swig_repr
54f9ee45
RD
930 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
931 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
0085ce49 932 def __init__(self, *args, **kwargs):
0df68c9f 933 """
a95a7133 934 __init__(self, double x=0.0, double y=0.0) -> RealPoint
e811c8ce 935
0df68c9f
RD
936 Create a wx.RealPoint object
937 """
0085ce49
RD
938 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
939 __swig_destroy__ = _core_.delete_RealPoint
940 __del__ = lambda self : None;
e811c8ce 941 def __eq__(*args, **kwargs):
0df68c9f 942 """
a95a7133 943 __eq__(self, RealPoint pt) -> bool
e811c8ce 944
0df68c9f
RD
945 Test for equality of wx.RealPoint objects.
946 """
54f9ee45 947 return _core_.RealPoint___eq__(*args, **kwargs)
e811c8ce
RD
948
949 def __ne__(*args, **kwargs):
0df68c9f 950 """
a95a7133 951 __ne__(self, RealPoint pt) -> bool
e811c8ce 952
0df68c9f
RD
953 Test for inequality of wx.RealPoint objects.
954 """
54f9ee45 955 return _core_.RealPoint___ne__(*args, **kwargs)
e811c8ce
RD
956
957 def __add__(*args, **kwargs):
0df68c9f 958 """
a95a7133 959 __add__(self, RealPoint pt) -> RealPoint
e811c8ce 960
0df68c9f
RD
961 Add pt's proprties to this and return the result.
962 """
54f9ee45 963 return _core_.RealPoint___add__(*args, **kwargs)
e811c8ce
RD
964
965 def __sub__(*args, **kwargs):
0df68c9f 966 """
a95a7133 967 __sub__(self, RealPoint pt) -> RealPoint
e811c8ce 968
0df68c9f
RD
969 Subtract pt's proprties from this and return the result
970 """
54f9ee45 971 return _core_.RealPoint___sub__(*args, **kwargs)
e811c8ce
RD
972
973 def Set(*args, **kwargs):
0df68c9f 974 """
a95a7133 975 Set(self, double x, double y)
e811c8ce 976
0df68c9f
RD
977 Set both the x and y properties
978 """
54f9ee45 979 return _core_.RealPoint_Set(*args, **kwargs)
e811c8ce
RD
980
981 def Get(*args, **kwargs):
0df68c9f
RD
982 """
983 Get() -> (x,y)
e811c8ce 984
0df68c9f
RD
985 Return the x and y properties as a tuple.
986 """
54f9ee45 987 return _core_.RealPoint_Get(*args, **kwargs)
e811c8ce 988
41e2b43e 989 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
990 def __str__(self): return str(self.Get())
991 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
992 def __len__(self): return len(self.Get())
993 def __getitem__(self, index): return self.Get()[index]
d14a1e28 994 def __setitem__(self, index, val):
e811c8ce
RD
995 if index == 0: self.x = val
996 elif index == 1: self.y = val
d14a1e28 997 else: raise IndexError
e811c8ce 998 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
999 __safe_for_unpickling__ = True
1000 def __reduce__(self): return (wx.RealPoint, self.Get())
d14a1e28 1001
0085ce49
RD
1002RealPoint_swigregister = _core_.RealPoint_swigregister
1003RealPoint_swigregister(RealPoint)
d14a1e28
RD
1004
1005#---------------------------------------------------------------------------
1006
1007class Point(object):
0df68c9f 1008 """
41e2b43e
RD
1009 A data structure for representing a point or position with integer x
1010 and y properties. Most places in wxPython that expect a wx.Point can
1011 also accept a (x,y) tuple.
0df68c9f 1012 """
0085ce49
RD
1013 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1014 __repr__ = _swig_repr
54f9ee45
RD
1015 x = property(_core_.Point_x_get, _core_.Point_x_set)
1016 y = property(_core_.Point_y_get, _core_.Point_y_set)
0085ce49 1017 def __init__(self, *args, **kwargs):
0df68c9f 1018 """
a95a7133 1019 __init__(self, int x=0, int y=0) -> Point
e811c8ce 1020
0df68c9f
RD
1021 Create a wx.Point object
1022 """
0085ce49
RD
1023 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1024 __swig_destroy__ = _core_.delete_Point
1025 __del__ = lambda self : None;
e811c8ce 1026 def __eq__(*args, **kwargs):
0df68c9f 1027 """
a95a7133 1028 __eq__(self, Point pt) -> bool
e811c8ce 1029
0df68c9f
RD
1030 Test for equality of wx.Point objects.
1031 """
54f9ee45 1032 return _core_.Point___eq__(*args, **kwargs)
e811c8ce
RD
1033
1034 def __ne__(*args, **kwargs):
0df68c9f 1035 """
a95a7133 1036 __ne__(self, Point pt) -> bool
e811c8ce 1037
0df68c9f
RD
1038 Test for inequality of wx.Point objects.
1039 """
54f9ee45 1040 return _core_.Point___ne__(*args, **kwargs)
e811c8ce
RD
1041
1042 def __add__(*args, **kwargs):
0df68c9f 1043 """
a95a7133 1044 __add__(self, Point pt) -> Point
e811c8ce 1045
0df68c9f
RD
1046 Add pt's proprties to this and return the result.
1047 """
54f9ee45 1048 return _core_.Point___add__(*args, **kwargs)
e811c8ce
RD
1049
1050 def __sub__(*args, **kwargs):
0df68c9f 1051 """
a95a7133 1052 __sub__(self, Point pt) -> Point
e811c8ce 1053
0df68c9f
RD
1054 Subtract pt's proprties from this and return the result
1055 """
54f9ee45 1056 return _core_.Point___sub__(*args, **kwargs)
e811c8ce
RD
1057
1058 def __iadd__(*args, **kwargs):
0df68c9f 1059 """
a95a7133 1060 __iadd__(self, Point pt) -> Point
e811c8ce 1061
0df68c9f
RD
1062 Add pt to this object.
1063 """
54f9ee45 1064 return _core_.Point___iadd__(*args, **kwargs)
e811c8ce
RD
1065
1066 def __isub__(*args, **kwargs):
0df68c9f 1067 """
a95a7133 1068 __isub__(self, Point pt) -> Point
e811c8ce 1069
0df68c9f
RD
1070 Subtract pt from this object.
1071 """
54f9ee45 1072 return _core_.Point___isub__(*args, **kwargs)
e811c8ce
RD
1073
1074 def Set(*args, **kwargs):
0df68c9f 1075 """
a95a7133 1076 Set(self, long x, long y)
e811c8ce 1077
0df68c9f
RD
1078 Set both the x and y properties
1079 """
54f9ee45 1080 return _core_.Point_Set(*args, **kwargs)
e811c8ce
RD
1081
1082 def Get(*args, **kwargs):
0df68c9f
RD
1083 """
1084 Get() -> (x,y)
e811c8ce 1085
0df68c9f
RD
1086 Return the x and y properties as a tuple.
1087 """
54f9ee45 1088 return _core_.Point_Get(*args, **kwargs)
e811c8ce 1089
41e2b43e 1090 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1091 def __str__(self): return str(self.Get())
1092 def __repr__(self): return 'wx.Point'+str(self.Get())
1093 def __len__(self): return len(self.Get())
1094 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1095 def __setitem__(self, index, val):
1096 if index == 0: self.x = val
1097 elif index == 1: self.y = val
1098 else: raise IndexError
e811c8ce 1099 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
1100 __safe_for_unpickling__ = True
1101 def __reduce__(self): return (wx.Point, self.Get())
d14a1e28 1102
0085ce49
RD
1103Point_swigregister = _core_.Point_swigregister
1104Point_swigregister(Point)
d14a1e28
RD
1105
1106#---------------------------------------------------------------------------
1107
1108class Rect(object):
0df68c9f 1109 """
41e2b43e
RD
1110 A class for representing and manipulating rectangles. It has x, y,
1111 width and height properties. In wxPython most palces that expect a
1112 wx.Rect can also accept a (x,y,width,height) tuple.
0df68c9f 1113 """
0085ce49
RD
1114 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1115 __repr__ = _swig_repr
1116 def __init__(self, *args, **kwargs):
0df68c9f 1117 """
a95a7133 1118 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
e811c8ce 1119
0df68c9f
RD
1120 Create a new Rect object.
1121 """
0085ce49
RD
1122 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1123 __swig_destroy__ = _core_.delete_Rect
1124 __del__ = lambda self : None;
e811c8ce 1125 def GetX(*args, **kwargs):
a95a7133 1126 """GetX(self) -> int"""
54f9ee45 1127 return _core_.Rect_GetX(*args, **kwargs)
e811c8ce
RD
1128
1129 def SetX(*args, **kwargs):
a95a7133 1130 """SetX(self, int x)"""
54f9ee45 1131 return _core_.Rect_SetX(*args, **kwargs)
e811c8ce
RD
1132
1133 def GetY(*args, **kwargs):
a95a7133 1134 """GetY(self) -> int"""
54f9ee45 1135 return _core_.Rect_GetY(*args, **kwargs)
e811c8ce
RD
1136
1137 def SetY(*args, **kwargs):
a95a7133 1138 """SetY(self, int y)"""
54f9ee45 1139 return _core_.Rect_SetY(*args, **kwargs)
e811c8ce
RD
1140
1141 def GetWidth(*args, **kwargs):
a95a7133 1142 """GetWidth(self) -> int"""
54f9ee45 1143 return _core_.Rect_GetWidth(*args, **kwargs)
e811c8ce
RD
1144
1145 def SetWidth(*args, **kwargs):
a95a7133 1146 """SetWidth(self, int w)"""
54f9ee45 1147 return _core_.Rect_SetWidth(*args, **kwargs)
e811c8ce
RD
1148
1149 def GetHeight(*args, **kwargs):
a95a7133 1150 """GetHeight(self) -> int"""
54f9ee45 1151 return _core_.Rect_GetHeight(*args, **kwargs)
e811c8ce
RD
1152
1153 def SetHeight(*args, **kwargs):
a95a7133 1154 """SetHeight(self, int h)"""
54f9ee45 1155 return _core_.Rect_SetHeight(*args, **kwargs)
e811c8ce
RD
1156
1157 def GetPosition(*args, **kwargs):
a95a7133 1158 """GetPosition(self) -> Point"""
54f9ee45 1159 return _core_.Rect_GetPosition(*args, **kwargs)
e811c8ce
RD
1160
1161 def SetPosition(*args, **kwargs):
a95a7133 1162 """SetPosition(self, Point p)"""
54f9ee45 1163 return _core_.Rect_SetPosition(*args, **kwargs)
e811c8ce
RD
1164
1165 def GetSize(*args, **kwargs):
a95a7133 1166 """GetSize(self) -> Size"""
54f9ee45 1167 return _core_.Rect_GetSize(*args, **kwargs)
e811c8ce
RD
1168
1169 def SetSize(*args, **kwargs):
a95a7133 1170 """SetSize(self, Size s)"""
54f9ee45 1171 return _core_.Rect_SetSize(*args, **kwargs)
e811c8ce 1172
aff4cc5c
RD
1173 def IsEmpty(*args, **kwargs):
1174 """IsEmpty(self) -> bool"""
1175 return _core_.Rect_IsEmpty(*args, **kwargs)
1176
c9c7117a 1177 def GetTopLeft(*args, **kwargs):
a95a7133 1178 """GetTopLeft(self) -> Point"""
54f9ee45 1179 return _core_.Rect_GetTopLeft(*args, **kwargs)
c9c7117a
RD
1180
1181 def SetTopLeft(*args, **kwargs):
a95a7133 1182 """SetTopLeft(self, Point p)"""
54f9ee45 1183 return _core_.Rect_SetTopLeft(*args, **kwargs)
c9c7117a
RD
1184
1185 def GetBottomRight(*args, **kwargs):
a95a7133 1186 """GetBottomRight(self) -> Point"""
54f9ee45 1187 return _core_.Rect_GetBottomRight(*args, **kwargs)
c9c7117a
RD
1188
1189 def SetBottomRight(*args, **kwargs):
a95a7133 1190 """SetBottomRight(self, Point p)"""
54f9ee45 1191 return _core_.Rect_SetBottomRight(*args, **kwargs)
c9c7117a 1192
e811c8ce 1193 def GetLeft(*args, **kwargs):
a95a7133 1194 """GetLeft(self) -> int"""
54f9ee45 1195 return _core_.Rect_GetLeft(*args, **kwargs)
e811c8ce
RD
1196
1197 def GetTop(*args, **kwargs):
a95a7133 1198 """GetTop(self) -> int"""
54f9ee45 1199 return _core_.Rect_GetTop(*args, **kwargs)
e811c8ce
RD
1200
1201 def GetBottom(*args, **kwargs):
a95a7133 1202 """GetBottom(self) -> int"""
54f9ee45 1203 return _core_.Rect_GetBottom(*args, **kwargs)
e811c8ce
RD
1204
1205 def GetRight(*args, **kwargs):
a95a7133 1206 """GetRight(self) -> int"""
54f9ee45 1207 return _core_.Rect_GetRight(*args, **kwargs)
e811c8ce
RD
1208
1209 def SetLeft(*args, **kwargs):
a95a7133 1210 """SetLeft(self, int left)"""
54f9ee45 1211 return _core_.Rect_SetLeft(*args, **kwargs)
e811c8ce
RD
1212
1213 def SetRight(*args, **kwargs):
a95a7133 1214 """SetRight(self, int right)"""
54f9ee45 1215 return _core_.Rect_SetRight(*args, **kwargs)
e811c8ce
RD
1216
1217 def SetTop(*args, **kwargs):
a95a7133 1218 """SetTop(self, int top)"""
54f9ee45 1219 return _core_.Rect_SetTop(*args, **kwargs)
e811c8ce
RD
1220
1221 def SetBottom(*args, **kwargs):
a95a7133 1222 """SetBottom(self, int bottom)"""
54f9ee45 1223 return _core_.Rect_SetBottom(*args, **kwargs)
e811c8ce
RD
1224
1225 position = property(GetPosition, SetPosition)
1226 size = property(GetSize, SetSize)
1227 left = property(GetLeft, SetLeft)
1228 right = property(GetRight, SetRight)
1229 top = property(GetTop, SetTop)
1230 bottom = property(GetBottom, SetBottom)
1231
1232 def Inflate(*args, **kwargs):
0df68c9f 1233 """
a95a7133 1234 Inflate(self, int dx, int dy) -> Rect
e811c8ce 1235
8e738329
RD
1236 Increases the size of the rectangle.
1237
1238 The left border is moved farther left and the right border is moved
1239 farther right by ``dx``. The upper border is moved farther up and the
1240 bottom border is moved farther down by ``dy``. (Note the the width and
1241 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1242 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1243 opposite happens: the rectangle size decreases in the respective
1244 direction.
1245
1246 The change is made to the rectangle inplace, if instead you need a
1247 copy that is inflated, preserving the original then make the copy
1248 first::
1249
1250 copy = wx.Rect(*original)
1251 copy.Inflate(10,15)
1252
1253
0df68c9f 1254 """
54f9ee45 1255 return _core_.Rect_Inflate(*args, **kwargs)
e811c8ce
RD
1256
1257 def Deflate(*args, **kwargs):
0df68c9f 1258 """
a95a7133 1259 Deflate(self, int dx, int dy) -> Rect
e811c8ce 1260
8e738329
RD
1261 Decrease the rectangle size. This method is the opposite of `Inflate`
1262 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1263 `Inflate` for a full description.
0df68c9f 1264 """
54f9ee45 1265 return _core_.Rect_Deflate(*args, **kwargs)
e811c8ce
RD
1266
1267 def OffsetXY(*args, **kwargs):
0df68c9f 1268 """
a95a7133 1269 OffsetXY(self, int dx, int dy)
e811c8ce 1270
41e2b43e
RD
1271 Moves the rectangle by the specified offset. If dx is positive, the
1272 rectangle is moved to the right, if dy is positive, it is moved to the
1273 bottom, otherwise it is moved to the left or top respectively.
0df68c9f 1274 """
54f9ee45 1275 return _core_.Rect_OffsetXY(*args, **kwargs)
e811c8ce
RD
1276
1277 def Offset(*args, **kwargs):
0df68c9f 1278 """
a95a7133 1279 Offset(self, Point pt)
e811c8ce 1280
b1fcee84 1281 Same as `OffsetXY` but uses dx,dy from Point
0df68c9f 1282 """
54f9ee45 1283 return _core_.Rect_Offset(*args, **kwargs)
e811c8ce
RD
1284
1285 def Intersect(*args, **kwargs):
0df68c9f 1286 """
a95a7133 1287 Intersect(self, Rect rect) -> Rect
e811c8ce 1288
5cbf236d 1289 Returns the intersectsion of this rectangle and rect.
0df68c9f 1290 """
54f9ee45 1291 return _core_.Rect_Intersect(*args, **kwargs)
e811c8ce 1292
5cbf236d
RD
1293 def Union(*args, **kwargs):
1294 """
1295 Union(self, Rect rect) -> Rect
1296
1297 Returns the union of this rectangle and rect.
1298 """
1299 return _core_.Rect_Union(*args, **kwargs)
1300
e811c8ce 1301 def __add__(*args, **kwargs):
0df68c9f 1302 """
a95a7133 1303 __add__(self, Rect rect) -> Rect
e811c8ce 1304
0df68c9f
RD
1305 Add the properties of rect to this rectangle and return the result.
1306 """
54f9ee45 1307 return _core_.Rect___add__(*args, **kwargs)
e811c8ce
RD
1308
1309 def __iadd__(*args, **kwargs):
0df68c9f 1310 """
a95a7133 1311 __iadd__(self, Rect rect) -> Rect
e811c8ce 1312
0df68c9f
RD
1313 Add the properties of rect to this rectangle, updating this rectangle.
1314 """
54f9ee45 1315 return _core_.Rect___iadd__(*args, **kwargs)
e811c8ce
RD
1316
1317 def __eq__(*args, **kwargs):
0df68c9f 1318 """
a95a7133 1319 __eq__(self, Rect rect) -> bool
e811c8ce 1320
0df68c9f
RD
1321 Test for equality.
1322 """
54f9ee45 1323 return _core_.Rect___eq__(*args, **kwargs)
e811c8ce
RD
1324
1325 def __ne__(*args, **kwargs):
0df68c9f 1326 """
a95a7133 1327 __ne__(self, Rect rect) -> bool
e811c8ce 1328
0df68c9f
RD
1329 Test for inequality.
1330 """
54f9ee45 1331 return _core_.Rect___ne__(*args, **kwargs)
e811c8ce
RD
1332
1333 def InsideXY(*args, **kwargs):
0df68c9f 1334 """
a95a7133 1335 InsideXY(self, int x, int y) -> bool
e811c8ce 1336
0df68c9f
RD
1337 Return True if the point is (not strcitly) inside the rect.
1338 """
54f9ee45 1339 return _core_.Rect_InsideXY(*args, **kwargs)
e811c8ce
RD
1340
1341 def Inside(*args, **kwargs):
0df68c9f 1342 """
a95a7133 1343 Inside(self, Point pt) -> bool
e811c8ce 1344
0df68c9f
RD
1345 Return True if the point is (not strcitly) inside the rect.
1346 """
54f9ee45 1347 return _core_.Rect_Inside(*args, **kwargs)
e811c8ce
RD
1348
1349 def Intersects(*args, **kwargs):
0df68c9f 1350 """
a95a7133 1351 Intersects(self, Rect rect) -> bool
e811c8ce 1352
0df68c9f
RD
1353 Returns True if the rectangles have a non empty intersection.
1354 """
54f9ee45 1355 return _core_.Rect_Intersects(*args, **kwargs)
e811c8ce 1356
b1fcee84
RD
1357 def CenterIn(*args, **kwargs):
1358 """
1359 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1360
1361 Center this rectangle within the one passed to the method, which is
1362 usually, but not necessarily, the larger one.
1363 """
1364 return _core_.Rect_CenterIn(*args, **kwargs)
1365
1366 CentreIn = CenterIn
54f9ee45
RD
1367 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1368 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1369 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1370 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
e811c8ce 1371 def Set(*args, **kwargs):
0df68c9f 1372 """
a95a7133 1373 Set(self, int x=0, int y=0, int width=0, int height=0)
e811c8ce 1374
0df68c9f
RD
1375 Set all rectangle properties.
1376 """
54f9ee45 1377 return _core_.Rect_Set(*args, **kwargs)
e811c8ce
RD
1378
1379 def Get(*args, **kwargs):
0df68c9f
RD
1380 """
1381 Get() -> (x,y,width,height)
e811c8ce 1382
0df68c9f
RD
1383 Return the rectangle properties as a tuple.
1384 """
54f9ee45 1385 return _core_.Rect_Get(*args, **kwargs)
e811c8ce 1386
41e2b43e 1387 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1388 def __str__(self): return str(self.Get())
1389 def __repr__(self): return 'wx.Rect'+str(self.Get())
1390 def __len__(self): return len(self.Get())
1391 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1392 def __setitem__(self, index, val):
1393 if index == 0: self.x = val
1394 elif index == 1: self.y = val
1395 elif index == 2: self.width = val
1396 elif index == 3: self.height = val
1397 else: raise IndexError
e811c8ce 1398 def __nonzero__(self): return self.Get() != (0,0,0,0)
74e96f3d
RD
1399 __safe_for_unpickling__ = True
1400 def __reduce__(self): return (wx.Rect, self.Get())
d14a1e28 1401
0085ce49
RD
1402Rect_swigregister = _core_.Rect_swigregister
1403Rect_swigregister(Rect)
d14a1e28
RD
1404
1405def RectPP(*args, **kwargs):
0df68c9f
RD
1406 """
1407 RectPP(Point topLeft, Point bottomRight) -> Rect
e811c8ce 1408
0df68c9f
RD
1409 Create a new Rect object from Points representing two corners.
1410 """
54f9ee45 1411 val = _core_.new_RectPP(*args, **kwargs)
d14a1e28
RD
1412 return val
1413
1414def RectPS(*args, **kwargs):
0df68c9f
RD
1415 """
1416 RectPS(Point pos, Size size) -> Rect
e811c8ce 1417
0df68c9f
RD
1418 Create a new Rect from a position and size.
1419 """
54f9ee45 1420 val = _core_.new_RectPS(*args, **kwargs)
d14a1e28
RD
1421 return val
1422
d3b6e4ff
RD
1423def RectS(*args, **kwargs):
1424 """
1425 RectS(Size size) -> Rect
1426
1427 Create a new Rect from a size only.
1428 """
1429 val = _core_.new_RectS(*args, **kwargs)
d3b6e4ff
RD
1430 return val
1431
d14a1e28 1432
e811c8ce 1433def IntersectRect(*args, **kwargs):
0085ce49 1434 """
0df68c9f 1435 IntersectRect(Rect r1, Rect r2) -> Rect
e811c8ce 1436
0df68c9f
RD
1437 Calculate and return the intersection of r1 and r2.
1438 """
0085ce49 1439 return _core_.IntersectRect(*args, **kwargs)
d14a1e28
RD
1440#---------------------------------------------------------------------------
1441
1442class Point2D(object):
41e2b43e
RD
1443 """
1444 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1445 with floating point values.
1446 """
0085ce49
RD
1447 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1448 __repr__ = _swig_repr
1449 def __init__(self, *args, **kwargs):
0df68c9f 1450 """
a95a7133 1451 __init__(self, double x=0.0, double y=0.0) -> Point2D
e811c8ce 1452
0df68c9f
RD
1453 Create a w.Point2D object.
1454 """
0085ce49 1455 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
e811c8ce 1456 def GetFloor(*args, **kwargs):
fd2dc343
RD
1457 """
1458 GetFloor() -> (x,y)
1459
1460 Convert to integer
1461 """
54f9ee45 1462 return _core_.Point2D_GetFloor(*args, **kwargs)
e811c8ce
RD
1463
1464 def GetRounded(*args, **kwargs):
fd2dc343
RD
1465 """
1466 GetRounded() -> (x,y)
1467
1468 Convert to integer
1469 """
54f9ee45 1470 return _core_.Point2D_GetRounded(*args, **kwargs)
e811c8ce
RD
1471
1472 def GetVectorLength(*args, **kwargs):
a95a7133 1473 """GetVectorLength(self) -> double"""
54f9ee45 1474 return _core_.Point2D_GetVectorLength(*args, **kwargs)
e811c8ce
RD
1475
1476 def GetVectorAngle(*args, **kwargs):
a95a7133 1477 """GetVectorAngle(self) -> double"""
54f9ee45 1478 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
e811c8ce
RD
1479
1480 def SetVectorLength(*args, **kwargs):
a95a7133 1481 """SetVectorLength(self, double length)"""
54f9ee45 1482 return _core_.Point2D_SetVectorLength(*args, **kwargs)
e811c8ce
RD
1483
1484 def SetVectorAngle(*args, **kwargs):
a95a7133 1485 """SetVectorAngle(self, double degrees)"""
54f9ee45 1486 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
e811c8ce 1487
d14a1e28
RD
1488 def SetPolarCoordinates(self, angle, length):
1489 self.SetVectorLength(length)
1490 self.SetVectorAngle(angle)
1491 def Normalize(self):
1492 self.SetVectorLength(1.0)
1493
e811c8ce 1494 def GetDistance(*args, **kwargs):
a95a7133 1495 """GetDistance(self, Point2D pt) -> double"""
54f9ee45 1496 return _core_.Point2D_GetDistance(*args, **kwargs)
e811c8ce
RD
1497
1498 def GetDistanceSquare(*args, **kwargs):
a95a7133 1499 """GetDistanceSquare(self, Point2D pt) -> double"""
54f9ee45 1500 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
e811c8ce
RD
1501
1502 def GetDotProduct(*args, **kwargs):
a95a7133 1503 """GetDotProduct(self, Point2D vec) -> double"""
54f9ee45 1504 return _core_.Point2D_GetDotProduct(*args, **kwargs)
e811c8ce
RD
1505
1506 def GetCrossProduct(*args, **kwargs):
a95a7133 1507 """GetCrossProduct(self, Point2D vec) -> double"""
54f9ee45 1508 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
e811c8ce
RD
1509
1510 def __neg__(*args, **kwargs):
0df68c9f 1511 """
a95a7133 1512 __neg__(self) -> Point2D
e811c8ce 1513
0df68c9f
RD
1514 the reflection of this point
1515 """
54f9ee45 1516 return _core_.Point2D___neg__(*args, **kwargs)
e811c8ce
RD
1517
1518 def __iadd__(*args, **kwargs):
a95a7133 1519 """__iadd__(self, Point2D pt) -> Point2D"""
54f9ee45 1520 return _core_.Point2D___iadd__(*args, **kwargs)
e811c8ce
RD
1521
1522 def __isub__(*args, **kwargs):
a95a7133 1523 """__isub__(self, Point2D pt) -> Point2D"""
54f9ee45 1524 return _core_.Point2D___isub__(*args, **kwargs)
e811c8ce
RD
1525
1526 def __imul__(*args, **kwargs):
a95a7133 1527 """__imul__(self, Point2D pt) -> Point2D"""
54f9ee45 1528 return _core_.Point2D___imul__(*args, **kwargs)
e811c8ce
RD
1529
1530 def __idiv__(*args, **kwargs):
a95a7133 1531 """__idiv__(self, Point2D pt) -> Point2D"""
54f9ee45 1532 return _core_.Point2D___idiv__(*args, **kwargs)
e811c8ce
RD
1533
1534 def __eq__(*args, **kwargs):
0df68c9f 1535 """
a95a7133 1536 __eq__(self, Point2D pt) -> bool
e811c8ce 1537
0df68c9f
RD
1538 Test for equality
1539 """
54f9ee45 1540 return _core_.Point2D___eq__(*args, **kwargs)
e811c8ce
RD
1541
1542 def __ne__(*args, **kwargs):
0df68c9f 1543 """
a95a7133 1544 __ne__(self, Point2D pt) -> bool
e811c8ce 1545
0df68c9f
RD
1546 Test for inequality
1547 """
54f9ee45 1548 return _core_.Point2D___ne__(*args, **kwargs)
e811c8ce 1549
54f9ee45
RD
1550 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1551 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
e811c8ce 1552 def Set(*args, **kwargs):
a95a7133 1553 """Set(self, double x=0, double y=0)"""
54f9ee45 1554 return _core_.Point2D_Set(*args, **kwargs)
e811c8ce
RD
1555
1556 def Get(*args, **kwargs):
0df68c9f
RD
1557 """
1558 Get() -> (x,y)
e811c8ce 1559
0df68c9f
RD
1560 Return x and y properties as a tuple.
1561 """
54f9ee45 1562 return _core_.Point2D_Get(*args, **kwargs)
e811c8ce 1563
41e2b43e 1564 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1565 def __str__(self): return str(self.Get())
1566 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1567 def __len__(self): return len(self.Get())
1568 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1569 def __setitem__(self, index, val):
e811c8ce
RD
1570 if index == 0: self.x = val
1571 elif index == 1: self.y = val
d14a1e28 1572 else: raise IndexError
e811c8ce 1573 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1574 __safe_for_unpickling__ = True
1575 def __reduce__(self): return (wx.Point2D, self.Get())
d14a1e28 1576
0085ce49
RD
1577Point2D_swigregister = _core_.Point2D_swigregister
1578Point2D_swigregister(Point2D)
d14a1e28
RD
1579
1580def Point2DCopy(*args, **kwargs):
0df68c9f
RD
1581 """
1582 Point2DCopy(Point2D pt) -> Point2D
e811c8ce 1583
0df68c9f
RD
1584 Create a w.Point2D object.
1585 """
54f9ee45 1586 val = _core_.new_Point2DCopy(*args, **kwargs)
d14a1e28
RD
1587 return val
1588
1589def Point2DFromPoint(*args, **kwargs):
0df68c9f
RD
1590 """
1591 Point2DFromPoint(Point pt) -> Point2D
e811c8ce 1592
0df68c9f
RD
1593 Create a w.Point2D object.
1594 """
54f9ee45 1595 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d14a1e28
RD
1596 return val
1597
1598#---------------------------------------------------------------------------
1599
54f9ee45
RD
1600FromStart = _core_.FromStart
1601FromCurrent = _core_.FromCurrent
1602FromEnd = _core_.FromEnd
d14a1e28 1603class InputStream(object):
093d3ff1 1604 """Proxy of C++ InputStream class"""
0085ce49
RD
1605 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1606 __repr__ = _swig_repr
1607 def __init__(self, *args, **kwargs):
a95a7133 1608 """__init__(self, PyObject p) -> InputStream"""
0085ce49
RD
1609 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1610 __swig_destroy__ = _core_.delete_InputStream
1611 __del__ = lambda self : None;
e811c8ce 1612 def close(*args, **kwargs):
a95a7133 1613 """close(self)"""
54f9ee45 1614 return _core_.InputStream_close(*args, **kwargs)
e811c8ce
RD
1615
1616 def flush(*args, **kwargs):
a95a7133 1617 """flush(self)"""
54f9ee45 1618 return _core_.InputStream_flush(*args, **kwargs)
e811c8ce
RD
1619
1620 def eof(*args, **kwargs):
a95a7133 1621 """eof(self) -> bool"""
54f9ee45 1622 return _core_.InputStream_eof(*args, **kwargs)
e811c8ce
RD
1623
1624 def read(*args, **kwargs):
a95a7133 1625 """read(self, int size=-1) -> PyObject"""
54f9ee45 1626 return _core_.InputStream_read(*args, **kwargs)
e811c8ce
RD
1627
1628 def readline(*args, **kwargs):
a95a7133 1629 """readline(self, int size=-1) -> PyObject"""
54f9ee45 1630 return _core_.InputStream_readline(*args, **kwargs)
e811c8ce
RD
1631
1632 def readlines(*args, **kwargs):
a95a7133 1633 """readlines(self, int sizehint=-1) -> PyObject"""
54f9ee45 1634 return _core_.InputStream_readlines(*args, **kwargs)
e811c8ce
RD
1635
1636 def seek(*args, **kwargs):
a95a7133 1637 """seek(self, int offset, int whence=0)"""
54f9ee45 1638 return _core_.InputStream_seek(*args, **kwargs)
e811c8ce
RD
1639
1640 def tell(*args, **kwargs):
a95a7133 1641 """tell(self) -> int"""
54f9ee45 1642 return _core_.InputStream_tell(*args, **kwargs)
e811c8ce
RD
1643
1644 def Peek(*args, **kwargs):
a95a7133 1645 """Peek(self) -> char"""
54f9ee45 1646 return _core_.InputStream_Peek(*args, **kwargs)
e811c8ce
RD
1647
1648 def GetC(*args, **kwargs):
a95a7133 1649 """GetC(self) -> char"""
54f9ee45 1650 return _core_.InputStream_GetC(*args, **kwargs)
e811c8ce
RD
1651
1652 def LastRead(*args, **kwargs):
a95a7133 1653 """LastRead(self) -> size_t"""
54f9ee45 1654 return _core_.InputStream_LastRead(*args, **kwargs)
e811c8ce
RD
1655
1656 def CanRead(*args, **kwargs):
a95a7133 1657 """CanRead(self) -> bool"""
54f9ee45 1658 return _core_.InputStream_CanRead(*args, **kwargs)
e811c8ce
RD
1659
1660 def Eof(*args, **kwargs):
a95a7133 1661 """Eof(self) -> bool"""
54f9ee45 1662 return _core_.InputStream_Eof(*args, **kwargs)
e811c8ce
RD
1663
1664 def Ungetch(*args, **kwargs):
a95a7133 1665 """Ungetch(self, char c) -> bool"""
54f9ee45 1666 return _core_.InputStream_Ungetch(*args, **kwargs)
e811c8ce
RD
1667
1668 def SeekI(*args, **kwargs):
a95a7133 1669 """SeekI(self, long pos, int mode=FromStart) -> long"""
54f9ee45 1670 return _core_.InputStream_SeekI(*args, **kwargs)
e811c8ce
RD
1671
1672 def TellI(*args, **kwargs):
a95a7133 1673 """TellI(self) -> long"""
54f9ee45 1674 return _core_.InputStream_TellI(*args, **kwargs)
e811c8ce 1675
0085ce49
RD
1676InputStream_swigregister = _core_.InputStream_swigregister
1677InputStream_swigregister(InputStream)
d14a1e28
RD
1678DefaultPosition = cvar.DefaultPosition
1679DefaultSize = cvar.DefaultSize
1680
1681class OutputStream(object):
093d3ff1 1682 """Proxy of C++ OutputStream class"""
0085ce49
RD
1683 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1684 def __init__(self): raise AttributeError, "No constructor defined"
1685 __repr__ = _swig_repr
e811c8ce 1686 def write(*args, **kwargs):
a95a7133 1687 """write(self, PyObject obj)"""
54f9ee45 1688 return _core_.OutputStream_write(*args, **kwargs)
e811c8ce 1689
0085ce49
RD
1690 def LastWrite(*args, **kwargs):
1691 """LastWrite(self) -> size_t"""
1692 return _core_.OutputStream_LastWrite(*args, **kwargs)
d14a1e28 1693
0085ce49
RD
1694OutputStream_swigregister = _core_.OutputStream_swigregister
1695OutputStream_swigregister(OutputStream)
d14a1e28
RD
1696
1697#---------------------------------------------------------------------------
1698
1699class FSFile(Object):
093d3ff1 1700 """Proxy of C++ FSFile class"""
0085ce49
RD
1701 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1702 __repr__ = _swig_repr
1703 def __init__(self, *args, **kwargs):
0df68c9f 1704 """
a95a7133 1705 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
196addbf 1706 DateTime modif) -> FSFile
0df68c9f 1707 """
0085ce49 1708 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
e2950dbb 1709 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
4cf4100f 1710
0085ce49
RD
1711 __swig_destroy__ = _core_.delete_FSFile
1712 __del__ = lambda self : None;
e811c8ce 1713 def GetStream(*args, **kwargs):
a95a7133 1714 """GetStream(self) -> InputStream"""
54f9ee45 1715 return _core_.FSFile_GetStream(*args, **kwargs)
e811c8ce
RD
1716
1717 def GetMimeType(*args, **kwargs):
a95a7133 1718 """GetMimeType(self) -> String"""
54f9ee45 1719 return _core_.FSFile_GetMimeType(*args, **kwargs)
e811c8ce
RD
1720
1721 def GetLocation(*args, **kwargs):
a95a7133 1722 """GetLocation(self) -> String"""
54f9ee45 1723 return _core_.FSFile_GetLocation(*args, **kwargs)
e811c8ce
RD
1724
1725 def GetAnchor(*args, **kwargs):
a95a7133 1726 """GetAnchor(self) -> String"""
54f9ee45 1727 return _core_.FSFile_GetAnchor(*args, **kwargs)
e811c8ce
RD
1728
1729 def GetModificationTime(*args, **kwargs):
a95a7133 1730 """GetModificationTime(self) -> DateTime"""
54f9ee45 1731 return _core_.FSFile_GetModificationTime(*args, **kwargs)
e811c8ce 1732
0085ce49
RD
1733FSFile_swigregister = _core_.FSFile_swigregister
1734FSFile_swigregister(FSFile)
d14a1e28
RD
1735
1736class CPPFileSystemHandler(object):
093d3ff1 1737 """Proxy of C++ CPPFileSystemHandler class"""
0085ce49
RD
1738 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1739 def __init__(self): raise AttributeError, "No constructor defined"
1740 __repr__ = _swig_repr
1741CPPFileSystemHandler_swigregister = _core_.CPPFileSystemHandler_swigregister
1742CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d14a1e28
RD
1743
1744class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 1745 """Proxy of C++ FileSystemHandler class"""
0085ce49
RD
1746 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1747 __repr__ = _swig_repr
1748 def __init__(self, *args, **kwargs):
a95a7133 1749 """__init__(self) -> FileSystemHandler"""
0085ce49 1750 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
d14a1e28 1751 self._setCallbackInfo(self, FileSystemHandler)
e811c8ce
RD
1752
1753 def _setCallbackInfo(*args, **kwargs):
a95a7133 1754 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 1755 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
1756
1757 def CanOpen(*args, **kwargs):
a95a7133 1758 """CanOpen(self, String location) -> bool"""
54f9ee45 1759 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1760
1761 def OpenFile(*args, **kwargs):
a95a7133 1762 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1763 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1764
1765 def FindFirst(*args, **kwargs):
a95a7133 1766 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1767 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1768
1769 def FindNext(*args, **kwargs):
a95a7133 1770 """FindNext(self) -> String"""
54f9ee45 1771 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
e811c8ce
RD
1772
1773 def GetProtocol(*args, **kwargs):
a95a7133 1774 """GetProtocol(self, String location) -> String"""
54f9ee45 1775 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
e811c8ce
RD
1776
1777 def GetLeftLocation(*args, **kwargs):
a95a7133 1778 """GetLeftLocation(self, String location) -> String"""
54f9ee45 1779 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
e811c8ce
RD
1780
1781 def GetAnchor(*args, **kwargs):
a95a7133 1782 """GetAnchor(self, String location) -> String"""
54f9ee45 1783 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
e811c8ce
RD
1784
1785 def GetRightLocation(*args, **kwargs):
a95a7133 1786 """GetRightLocation(self, String location) -> String"""
54f9ee45 1787 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
e811c8ce
RD
1788
1789 def GetMimeTypeFromExt(*args, **kwargs):
a95a7133 1790 """GetMimeTypeFromExt(self, String location) -> String"""
54f9ee45 1791 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
e811c8ce 1792
0085ce49
RD
1793FileSystemHandler_swigregister = _core_.FileSystemHandler_swigregister
1794FileSystemHandler_swigregister(FileSystemHandler)
d14a1e28
RD
1795
1796class FileSystem(Object):
093d3ff1 1797 """Proxy of C++ FileSystem class"""
0085ce49
RD
1798 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1799 __repr__ = _swig_repr
1800 def __init__(self, *args, **kwargs):
a95a7133 1801 """__init__(self) -> FileSystem"""
0085ce49
RD
1802 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1803 __swig_destroy__ = _core_.delete_FileSystem
1804 __del__ = lambda self : None;
e811c8ce 1805 def ChangePathTo(*args, **kwargs):
a95a7133 1806 """ChangePathTo(self, String location, bool is_dir=False)"""
54f9ee45 1807 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
e811c8ce
RD
1808
1809 def GetPath(*args, **kwargs):
a95a7133 1810 """GetPath(self) -> String"""
54f9ee45 1811 return _core_.FileSystem_GetPath(*args, **kwargs)
e811c8ce
RD
1812
1813 def OpenFile(*args, **kwargs):
a95a7133 1814 """OpenFile(self, String location) -> FSFile"""
54f9ee45 1815 return _core_.FileSystem_OpenFile(*args, **kwargs)
e811c8ce
RD
1816
1817 def FindFirst(*args, **kwargs):
a95a7133 1818 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1819 return _core_.FileSystem_FindFirst(*args, **kwargs)
e811c8ce
RD
1820
1821 def FindNext(*args, **kwargs):
a95a7133 1822 """FindNext(self) -> String"""
54f9ee45 1823 return _core_.FileSystem_FindNext(*args, **kwargs)
e811c8ce
RD
1824
1825 def AddHandler(*args, **kwargs):
66c033b4 1826 """AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 1827 return _core_.FileSystem_AddHandler(*args, **kwargs)
e811c8ce
RD
1828
1829 AddHandler = staticmethod(AddHandler)
1830 def CleanUpHandlers(*args, **kwargs):
66c033b4 1831 """CleanUpHandlers()"""
54f9ee45 1832 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
e811c8ce
RD
1833
1834 CleanUpHandlers = staticmethod(CleanUpHandlers)
1835 def FileNameToURL(*args, **kwargs):
66c033b4 1836 """FileNameToURL(String filename) -> String"""
54f9ee45 1837 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
e811c8ce
RD
1838
1839 FileNameToURL = staticmethod(FileNameToURL)
2ef75293
RD
1840 def URLToFileName(*args, **kwargs):
1841 """URLToFileName(String url) -> String"""
1842 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1843
1844 URLToFileName = staticmethod(URLToFileName)
0085ce49
RD
1845FileSystem_swigregister = _core_.FileSystem_swigregister
1846FileSystem_swigregister(FileSystem)
d14a1e28 1847
e811c8ce 1848def FileSystem_AddHandler(*args, **kwargs):
0085ce49
RD
1849 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1850 return _core_.FileSystem_AddHandler(*args, **kwargs)
d14a1e28 1851
0085ce49
RD
1852def FileSystem_CleanUpHandlers(*args):
1853 """FileSystem_CleanUpHandlers()"""
1854 return _core_.FileSystem_CleanUpHandlers(*args)
d14a1e28 1855
e811c8ce 1856def FileSystem_FileNameToURL(*args, **kwargs):
0085ce49
RD
1857 """FileSystem_FileNameToURL(String filename) -> String"""
1858 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d14a1e28 1859
e811c8ce 1860def FileSystem_URLToFileName(*args, **kwargs):
0085ce49
RD
1861 """FileSystem_URLToFileName(String url) -> String"""
1862 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2ef75293 1863
d14a1e28 1864class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 1865 """Proxy of C++ InternetFSHandler class"""
0085ce49
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):
a95a7133 1869 """__init__(self) -> InternetFSHandler"""
0085ce49 1870 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
e811c8ce 1871 def CanOpen(*args, **kwargs):
a95a7133 1872 """CanOpen(self, String location) -> bool"""
54f9ee45 1873 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1874
1875 def OpenFile(*args, **kwargs):
a95a7133 1876 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1877 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
e811c8ce 1878
0085ce49
RD
1879InternetFSHandler_swigregister = _core_.InternetFSHandler_swigregister
1880InternetFSHandler_swigregister(InternetFSHandler)
d14a1e28
RD
1881
1882class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 1883 """Proxy of C++ ZipFSHandler class"""
0085ce49
RD
1884 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1885 __repr__ = _swig_repr
1886 def __init__(self, *args, **kwargs):
a95a7133 1887 """__init__(self) -> ZipFSHandler"""
0085ce49 1888 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
e811c8ce 1889 def CanOpen(*args, **kwargs):
a95a7133 1890 """CanOpen(self, String location) -> bool"""
54f9ee45 1891 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1892
1893 def OpenFile(*args, **kwargs):
a95a7133 1894 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1895 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1896
1897 def FindFirst(*args, **kwargs):
a95a7133 1898 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1899 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1900
1901 def FindNext(*args, **kwargs):
a95a7133 1902 """FindNext(self) -> String"""
54f9ee45 1903 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
e811c8ce 1904
0085ce49
RD
1905ZipFSHandler_swigregister = _core_.ZipFSHandler_swigregister
1906ZipFSHandler_swigregister(ZipFSHandler)
d14a1e28
RD
1907
1908
e811c8ce 1909def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
0085ce49
RD
1910 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1911 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d14a1e28 1912
e811c8ce 1913def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
0085ce49
RD
1914 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1915 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d14a1e28 1916
e811c8ce 1917def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
0085ce49
RD
1918 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1919 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
2ef75293
RD
1920def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1921 """
1922 Add 'file' to the memory filesystem. The dataItem parameter can
1923 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1924 arbitrary data. If a bitmap or image is used then the imgType
1925 parameter should specify what kind of image file it should be
1926 written as, wx.BITMAP_TYPE_PNG, etc.
1927 """
1928 if isinstance(dataItem, wx.Image):
1929 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1930 elif isinstance(dataItem, wx.Bitmap):
1931 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1932 elif type(dataItem) == str:
1933 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1934 else:
1935 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d14a1e28
RD
1936
1937class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 1938 """Proxy of C++ MemoryFSHandler class"""
0085ce49
RD
1939 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1940 __repr__ = _swig_repr
1941 def __init__(self, *args, **kwargs):
a95a7133 1942 """__init__(self) -> MemoryFSHandler"""
0085ce49 1943 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
e811c8ce 1944 def RemoveFile(*args, **kwargs):
66c033b4 1945 """RemoveFile(String filename)"""
54f9ee45 1946 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
e811c8ce
RD
1947
1948 RemoveFile = staticmethod(RemoveFile)
d14a1e28 1949 AddFile = staticmethod(MemoryFSHandler_AddFile)
e811c8ce 1950 def CanOpen(*args, **kwargs):
a95a7133 1951 """CanOpen(self, String location) -> bool"""
54f9ee45 1952 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1953
1954 def OpenFile(*args, **kwargs):
a95a7133 1955 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1956 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1957
1958 def FindFirst(*args, **kwargs):
a95a7133 1959 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1960 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1961
1962 def FindNext(*args, **kwargs):
a95a7133 1963 """FindNext(self) -> String"""
54f9ee45 1964 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
e811c8ce 1965
0085ce49
RD
1966MemoryFSHandler_swigregister = _core_.MemoryFSHandler_swigregister
1967MemoryFSHandler_swigregister(MemoryFSHandler)
d14a1e28 1968
e811c8ce 1969def MemoryFSHandler_RemoveFile(*args, **kwargs):
0085ce49
RD
1970 """MemoryFSHandler_RemoveFile(String filename)"""
1971 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d14a1e28 1972
bcd0d7b6
RD
1973IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1974IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1975IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d14a1e28
RD
1976#---------------------------------------------------------------------------
1977
1978class ImageHandler(Object):
27fb7603
RD
1979 """
1980 This is the base class for implementing image file loading/saving, and
1981 image creation from data. It is used within `wx.Image` and is not
1982 normally seen by the application.
1983 """
0085ce49
RD
1984 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1985 def __init__(self): raise AttributeError, "No constructor defined"
1986 __repr__ = _swig_repr
e811c8ce 1987 def GetName(*args, **kwargs):
a95a7133 1988 """GetName(self) -> String"""
54f9ee45 1989 return _core_.ImageHandler_GetName(*args, **kwargs)
e811c8ce
RD
1990
1991 def GetExtension(*args, **kwargs):
a95a7133 1992 """GetExtension(self) -> String"""
54f9ee45 1993 return _core_.ImageHandler_GetExtension(*args, **kwargs)
e811c8ce
RD
1994
1995 def GetType(*args, **kwargs):
a95a7133 1996 """GetType(self) -> long"""
54f9ee45 1997 return _core_.ImageHandler_GetType(*args, **kwargs)
e811c8ce
RD
1998
1999 def GetMimeType(*args, **kwargs):
a95a7133 2000 """GetMimeType(self) -> String"""
54f9ee45 2001 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
e811c8ce
RD
2002
2003 def CanRead(*args, **kwargs):
a95a7133 2004 """CanRead(self, String name) -> bool"""
54f9ee45 2005 return _core_.ImageHandler_CanRead(*args, **kwargs)
e811c8ce
RD
2006
2007 def SetName(*args, **kwargs):
a95a7133 2008 """SetName(self, String name)"""
54f9ee45 2009 return _core_.ImageHandler_SetName(*args, **kwargs)
e811c8ce
RD
2010
2011 def SetExtension(*args, **kwargs):
a95a7133 2012 """SetExtension(self, String extension)"""
54f9ee45 2013 return _core_.ImageHandler_SetExtension(*args, **kwargs)
e811c8ce
RD
2014
2015 def SetType(*args, **kwargs):
a95a7133 2016 """SetType(self, long type)"""
54f9ee45 2017 return _core_.ImageHandler_SetType(*args, **kwargs)
e811c8ce
RD
2018
2019 def SetMimeType(*args, **kwargs):
a95a7133 2020 """SetMimeType(self, String mimetype)"""
54f9ee45 2021 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
e811c8ce 2022
0085ce49
RD
2023ImageHandler_swigregister = _core_.ImageHandler_swigregister
2024ImageHandler_swigregister(ImageHandler)
d14a1e28 2025
943e8dfd
RD
2026class PyImageHandler(ImageHandler):
2027 """
2028 This is the base class for implementing image file loading/saving, and
2029 image creation from data, all written in Python. To create a custom
2030 image handler derive a new class from wx.PyImageHandler and provide
2031 the following methods::
2032
2033 def DoCanRead(self, stream) --> bool
2034 '''Check if this handler can read the image on the stream'''
2035
2036 def LoadFile(self, image, stream, verbose, index) --> bool
2037 '''Load image data from the stream and load it into image.'''
2038
2039 def SaveFile(self, image, stream, verbose) --> bool
2040 '''Save the iamge data in image to the stream using
2041 this handler's image file format.'''
2042
2043 def GetImageCount(self, stream) --> int
2044 '''If this image format can hold more than one image,
2045 how many does the image on the stream have?'''
2046
2047 To activate your handler create an instance of it and pass it to
2048 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2049 `SetExtension` from your constructor.
2050
2051 """
0085ce49
RD
2052 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2053 __repr__ = _swig_repr
2054 def __init__(self, *args, **kwargs):
943e8dfd
RD
2055 """
2056 __init__(self) -> PyImageHandler
2057
2058 This is the base class for implementing image file loading/saving, and
2059 image creation from data, all written in Python. To create a custom
2060 image handler derive a new class from wx.PyImageHandler and provide
2061 the following methods::
2062
2063 def DoCanRead(self, stream) --> bool
2064 '''Check if this handler can read the image on the stream'''
2065
2066 def LoadFile(self, image, stream, verbose, index) --> bool
2067 '''Load image data from the stream and load it into image.'''
2068
2069 def SaveFile(self, image, stream, verbose) --> bool
2070 '''Save the iamge data in image to the stream using
2071 this handler's image file format.'''
2072
2073 def GetImageCount(self, stream) --> int
2074 '''If this image format can hold more than one image,
2075 how many does the image on the stream have?'''
2076
2077 To activate your handler create an instance of it and pass it to
2078 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2079 `SetExtension` from your constructor.
2080
2081 """
0085ce49 2082 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
RD
2083 self._SetSelf(self)
2084
2085 def _SetSelf(*args, **kwargs):
2086 """_SetSelf(self, PyObject self)"""
2087 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2088
0085ce49
RD
2089PyImageHandler_swigregister = _core_.PyImageHandler_swigregister
2090PyImageHandler_swigregister(PyImageHandler)
943e8dfd 2091
d14a1e28 2092class ImageHistogram(object):
093d3ff1 2093 """Proxy of C++ ImageHistogram class"""
0085ce49
RD
2094 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2095 __repr__ = _swig_repr
2096 def __init__(self, *args, **kwargs):
a95a7133 2097 """__init__(self) -> ImageHistogram"""
0085ce49 2098 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
e811c8ce 2099 def MakeKey(*args, **kwargs):
0df68c9f 2100 """
7a27cf7c 2101 MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2102
0df68c9f
RD
2103 Get the key in the histogram for the given RGB values
2104 """
54f9ee45 2105 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
e811c8ce
RD
2106
2107 MakeKey = staticmethod(MakeKey)
2108 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2109 """
2110 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2111
2112 Find first colour that is not used in the image and has higher RGB
2113 values than startR, startG, startB. Returns a tuple consisting of a
2114 success flag and rgb values.
2115 """
54f9ee45 2116 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2117
f1cbd8fa
RD
2118 def GetCount(*args, **kwargs):
2119 """
2120 GetCount(self, unsigned long key) -> unsigned long
2121
2122 Returns the pixel count for the given key. Use `MakeKey` to create a
2123 key value from a RGB tripple.
2124 """
2125 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2126
2127 def GetCountRGB(*args, **kwargs):
2128 """
7a27cf7c 2129 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2130
2131 Returns the pixel count for the given RGB values.
2132 """
2133 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2134
2135 def GetCountColour(*args, **kwargs):
2136 """
2137 GetCountColour(self, Colour colour) -> unsigned long
2138
2139 Returns the pixel count for the given `wx.Colour` value.
2140 """
2141 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2142
0085ce49
RD
2143ImageHistogram_swigregister = _core_.ImageHistogram_swigregister
2144ImageHistogram_swigregister(ImageHistogram)
d14a1e28 2145
e811c8ce 2146def ImageHistogram_MakeKey(*args, **kwargs):
0085ce49 2147 """
7a27cf7c 2148 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2149
0df68c9f
RD
2150 Get the key in the histogram for the given RGB values
2151 """
0085ce49 2152 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d14a1e28 2153
943e8dfd
RD
2154class Image_RGBValue(object):
2155 """
2156 An object that contains values for red, green and blue which represent
2157 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2158 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2159 color space.
2160 """
0085ce49
RD
2161 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2162 __repr__ = _swig_repr
2163 def __init__(self, *args, **kwargs):
943e8dfd
RD
2164 """
2165 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2166
2167 Constructor.
2168 """
0085ce49 2169 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
2170 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2171 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2172 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
0085ce49
RD
2173Image_RGBValue_swigregister = _core_.Image_RGBValue_swigregister
2174Image_RGBValue_swigregister(Image_RGBValue)
943e8dfd
RD
2175
2176class Image_HSVValue(object):
2177 """
2178 An object that contains values for hue, saturation and value which
2179 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2180 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2181 color space.
2182 """
0085ce49
RD
2183 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2184 __repr__ = _swig_repr
2185 def __init__(self, *args, **kwargs):
943e8dfd
RD
2186 """
2187 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2188
2189 Constructor.
2190 """
0085ce49 2191 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
2192 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2193 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2194 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
0085ce49
RD
2195Image_HSVValue_swigregister = _core_.Image_HSVValue_swigregister
2196Image_HSVValue_swigregister(Image_HSVValue)
943e8dfd 2197
d14a1e28 2198class Image(Object):
7a27cf7c
RD
2199 """
2200 A platform-independent image class. An image can be created from
2201 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2202 variety of formats. Functions are available to set and get image
2203 bits, so it can be used for basic image manipulation.
2204
2205 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2206 platform-specific `wx.Bitmap` object must be created from it using the
2207 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2208 device context, using `wx.DC.DrawBitmap`.
2209
2210 One colour value of the image may be used as a mask colour which will
2211 lead to the automatic creation of a `wx.Mask` object associated to the
2212 bitmap object.
2213
2214 wx.Image supports alpha channel data, that is in addition to a byte
2215 for the red, green and blue colour components for each pixel it also
2216 stores a byte representing the pixel opacity. An alpha value of 0
2217 corresponds to a transparent pixel (null opacity) while a value of 255
2218 means that the pixel is 100% opaque.
2219
2220 Unlike RGB data, not all images have an alpha channel and before using
2221 `GetAlpha` you should check if this image contains an alpha channel
2222 with `HasAlpha`. Note that currently only images loaded from PNG files
2223 with transparency information will have an alpha channel.
2224 """
0085ce49
RD
2225 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2226 __repr__ = _swig_repr
2227 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2228 """
2229 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2230
2231 Loads an image from a file.
2232 """
0085ce49
RD
2233 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2234 __swig_destroy__ = _core_.delete_Image
2235 __del__ = lambda self : None;
e811c8ce 2236 def Create(*args, **kwargs):
7a27cf7c
RD
2237 """
2238 Create(self, int width, int height, bool clear=True)
2239
2240 Creates a fresh image. If clear is ``True``, the new image will be
2241 initialized to black. Otherwise, the image data will be uninitialized.
2242 """
54f9ee45 2243 return _core_.Image_Create(*args, **kwargs)
e811c8ce
RD
2244
2245 def Destroy(*args, **kwargs):
0df68c9f 2246 """
a95a7133 2247 Destroy(self)
e811c8ce 2248
7a27cf7c 2249 Destroys the image data.
0df68c9f 2250 """
7e08d4ef
RD
2251 val = _core_.Image_Destroy(*args, **kwargs)
2252 args[0].thisown = 0
2253 return val
e811c8ce
RD
2254
2255 def Scale(*args, **kwargs):
7a27cf7c
RD
2256 """
2257 Scale(self, int width, int height) -> Image
2258
2259 Returns a scaled version of the image. This is also useful for scaling
2260 bitmaps in general as the only other way to scale bitmaps is to blit a
2261 `wx.MemoryDC` into another `wx.MemoryDC`.
2262 """
54f9ee45 2263 return _core_.Image_Scale(*args, **kwargs)
e811c8ce
RD
2264
2265 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2266 """
2267 ShrinkBy(self, int xFactor, int yFactor) -> Image
2268
2269 Return a version of the image scaled smaller by the given factors.
2270 """
54f9ee45 2271 return _core_.Image_ShrinkBy(*args, **kwargs)
e811c8ce
RD
2272
2273 def Rescale(*args, **kwargs):
7a27cf7c
RD
2274 """
2275 Rescale(self, int width, int height) -> Image
2276
2277 Changes the size of the image in-place by scaling it: after a call to
2278 this function, the image will have the given width and height.
2279
2280 Returns the (modified) image itself.
2281 """
54f9ee45 2282 return _core_.Image_Rescale(*args, **kwargs)
e811c8ce 2283
aff4cc5c 2284 def Resize(*args, **kwargs):
7a27cf7c
RD
2285 """
2286 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2287
2288 Changes the size of the image in-place without scaling it, by adding
2289 either a border with the given colour or cropping as necessary. The
2290 image is pasted into a new image with the given size and background
2291 colour at the position pos relative to the upper left of the new
2292 image. If red = green = blue = -1 then use either the current mask
2293 colour if set or find, use, and set a suitable mask colour for any
2294 newly exposed areas.
2295
2296 Returns the (modified) image itself.
2297 """
aff4cc5c
RD
2298 return _core_.Image_Resize(*args, **kwargs)
2299
e811c8ce 2300 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2301 """
2302 SetRGB(self, int x, int y, byte r, byte g, byte b)
2303
2304 Sets the pixel at the given coordinate. This routine performs
2305 bounds-checks for the coordinate so it can be considered a safe way to
2306 manipulate the data, but in some cases this might be too slow so that
2307 the data will have to be set directly. In that case you will have to
2308 get access to the image data using the `GetData` method.
2309 """
54f9ee45 2310 return _core_.Image_SetRGB(*args, **kwargs)
e811c8ce 2311
aff4cc5c 2312 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2313 """
2314 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2315
2316 Sets the colour of the pixels within the given rectangle. This routine
2317 performs bounds-checks for the rectangle so it can be considered a
2318 safe way to manipulate the data.
2319 """
aff4cc5c
RD
2320 return _core_.Image_SetRGBRect(*args, **kwargs)
2321
e811c8ce 2322 def GetRed(*args, **kwargs):
7a27cf7c
RD
2323 """
2324 GetRed(self, int x, int y) -> byte
2325
2326 Returns the red intensity at the given coordinate.
2327 """
54f9ee45 2328 return _core_.Image_GetRed(*args, **kwargs)
e811c8ce
RD
2329
2330 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2331 """
2332 GetGreen(self, int x, int y) -> byte
2333
2334 Returns the green intensity at the given coordinate.
2335 """
54f9ee45 2336 return _core_.Image_GetGreen(*args, **kwargs)
e811c8ce
RD
2337
2338 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2339 """
2340 GetBlue(self, int x, int y) -> byte
2341
2342 Returns the blue intensity at the given coordinate.
2343 """
54f9ee45 2344 return _core_.Image_GetBlue(*args, **kwargs)
e811c8ce
RD
2345
2346 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2347 """
2348 SetAlpha(self, int x, int y, byte alpha)
2349
2350 Sets the alpha value for the given pixel. This function should only be
2351 called if the image has alpha channel data, use `HasAlpha` to check
2352 for this.
2353 """
54f9ee45 2354 return _core_.Image_SetAlpha(*args, **kwargs)
e811c8ce
RD
2355
2356 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2357 """
2358 GetAlpha(self, int x, int y) -> byte
2359
2360 Returns the alpha value for the given pixel. This function may only be
2361 called for the images with alpha channel, use `HasAlpha` to check for
2362 this.
2363
2364 The returned value is the *opacity* of the image, i.e. the value of 0
2365 corresponds to the fully transparent pixels while the value of 255 to
2366 the fully opaque pixels.
2367 """
54f9ee45 2368 return _core_.Image_GetAlpha(*args, **kwargs)
e811c8ce
RD
2369
2370 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2371 """
2372 HasAlpha(self) -> bool
2373
2374 Returns true if this image has alpha channel, false otherwise.
2375 """
54f9ee45 2376 return _core_.Image_HasAlpha(*args, **kwargs)
e811c8ce 2377
68350608
RD
2378 def InitAlpha(*args, **kwargs):
2379 """
2380 InitAlpha(self)
2381
2382 Initializes the image alpha channel data. It is an error to call it if
2383 the image already has alpha data. If it doesn't, alpha data will be by
2384 default initialized to all pixels being fully opaque. But if the image
2385 has a a mask colour, all mask pixels will be completely transparent.
2386 """
2387 return _core_.Image_InitAlpha(*args, **kwargs)
2388
bcd0d7b6
RD
2389 def IsTransparent(*args, **kwargs):
2390 """
7a27cf7c 2391 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
bcd0d7b6 2392
7a27cf7c
RD
2393 Returns ``True`` if this pixel is masked or has an alpha value less
2394 than the spcified threshold.
bcd0d7b6
RD
2395 """
2396 return _core_.Image_IsTransparent(*args, **kwargs)
2397
e811c8ce 2398 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2399 """
2400 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2401
2402 Find first colour that is not used in the image and has higher RGB
2403 values than startR, startG, startB. Returns a tuple consisting of a
2404 success flag and rgb values.
2405 """
54f9ee45 2406 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2407
4cf4100f
RD
2408 def ConvertAlphaToMask(*args, **kwargs):
2409 """
bcd0d7b6 2410 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2411
7a27cf7c
RD
2412 If the image has alpha channel, this method converts it to mask. All
2413 pixels with alpha value less than ``threshold`` are replaced with the
2414 mask colour and the alpha channel is removed. The mask colour is
2415 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2416
2417 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2418 nothing.
2419 """
2420 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2421
8fb0e70a
RD
2422 def ConvertColourToAlpha(*args, **kwargs):
2423 """
7a27cf7c 2424 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2425
2426 This method converts an image where the original alpha information is
2427 only available as a shades of a colour (actually shades of grey)
2428 typically when you draw anti-aliased text into a bitmap. The DC
2429 drawing routines draw grey values on the black background although
2430 they actually mean to draw white with differnt alpha values. This
2431 method reverses it, assuming a black (!) background and white text.
2432 The method will then fill up the whole image with the colour given.
2433 """
2434 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2435
e811c8ce 2436 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2437 """
2438 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2439
2440 Sets the image's mask so that the pixels that have RGB value of
2441 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2442 by first finding an unused colour in the image, setting this colour as
2443 the mask colour and then using this colour to draw all pixels in the
2444 image who corresponding pixel in mask has given RGB value.
2445
2446 Returns ``False`` if ``mask`` does not have same dimensions as the
2447 image or if there is no unused colour left. Returns ``True`` if the
2448 mask was successfully applied.
2449
2450 Note that this method involves computing the histogram, which is
2451 computationally intensive operation.
2452 """
54f9ee45 2453 return _core_.Image_SetMaskFromImage(*args, **kwargs)
e811c8ce
RD
2454
2455 def CanRead(*args, **kwargs):
7a27cf7c
RD
2456 """
2457 CanRead(String filename) -> bool
2458
2459 Returns True if the image handlers can read this file.
2460 """
54f9ee45 2461 return _core_.Image_CanRead(*args, **kwargs)
e811c8ce
RD
2462
2463 CanRead = staticmethod(CanRead)
2464 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2465 """
2466 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2467
2468 If the image file contains more than one image and the image handler
2469 is capable of retrieving these individually, this function will return
2470 the number of available images.
2471 """
54f9ee45 2472 return _core_.Image_GetImageCount(*args, **kwargs)
e811c8ce
RD
2473
2474 GetImageCount = staticmethod(GetImageCount)
2475 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2476 """
2477 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2478
2479 Loads an image from a file. If no handler type is provided, the
2480 library will try to autodetect the format.
2481 """
54f9ee45 2482 return _core_.Image_LoadFile(*args, **kwargs)
e811c8ce
RD
2483
2484 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2485 """
2486 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2487
2488 Loads an image from a file, specifying the image type with a MIME type
2489 string.
2490 """
54f9ee45 2491 return _core_.Image_LoadMimeFile(*args, **kwargs)
e811c8ce
RD
2492
2493 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2494 """
2495 SaveFile(self, String name, int type) -> bool
2496
2497 Saves an image in the named file.
2498 """
54f9ee45 2499 return _core_.Image_SaveFile(*args, **kwargs)
e811c8ce
RD
2500
2501 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2502 """
2503 SaveMimeFile(self, String name, String mimetype) -> bool
2504
2505 Saves an image in the named file.
2506 """
54f9ee45 2507 return _core_.Image_SaveMimeFile(*args, **kwargs)
e811c8ce
RD
2508
2509 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2510 """
2511 CanReadStream(InputStream stream) -> bool
2512
2513 Returns True if the image handlers can read an image file from the
2514 data currently on the input stream, or a readable Python file-like
2515 object.
2516 """
54f9ee45 2517 return _core_.Image_CanReadStream(*args, **kwargs)
e811c8ce
RD
2518
2519 CanReadStream = staticmethod(CanReadStream)
2520 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2521 """
2522 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2523
2524 Loads an image from an input stream or a readable Python file-like
2525 object. If no handler type is provided, the library will try to
2526 autodetect the format.
2527 """
54f9ee45 2528 return _core_.Image_LoadStream(*args, **kwargs)
e811c8ce
RD
2529
2530 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2531 """
2532 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2533
2534 Loads an image from an input stream or a readable Python file-like
2535 object, using a MIME type string to specify the image file format.
2536 """
54f9ee45 2537 return _core_.Image_LoadMimeStream(*args, **kwargs)
e811c8ce
RD
2538
2539 def Ok(*args, **kwargs):
7a27cf7c
RD
2540 """
2541 Ok(self) -> bool
2542
2543 Returns true if image data is present.
2544 """
54f9ee45 2545 return _core_.Image_Ok(*args, **kwargs)
e811c8ce
RD
2546
2547 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2548 """
2549 GetWidth(self) -> int
2550
2551 Gets the width of the image in pixels.
2552 """
54f9ee45 2553 return _core_.Image_GetWidth(*args, **kwargs)
e811c8ce
RD
2554
2555 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2556 """
2557 GetHeight(self) -> int
2558
2559 Gets the height of the image in pixels.
2560 """
54f9ee45 2561 return _core_.Image_GetHeight(*args, **kwargs)
e811c8ce 2562
b2df227b 2563 def GetSize(*args, **kwargs):
7a27cf7c
RD
2564 """
2565 GetSize(self) -> Size
2566
2567 Returns the size of the image in pixels.
2568 """
54f9ee45 2569 return _core_.Image_GetSize(*args, **kwargs)
b2df227b 2570
e811c8ce 2571 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2572 """
2573 GetSubImage(self, Rect rect) -> Image
2574
2575 Returns a sub image of the current one as long as the rect belongs
2576 entirely to the image.
2577 """
54f9ee45 2578 return _core_.Image_GetSubImage(*args, **kwargs)
e811c8ce 2579
aff4cc5c 2580 def Size(*args, **kwargs):
7a27cf7c
RD
2581 """
2582 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2583
2584 Returns a resized version of this image without scaling it by adding
2585 either a border with the given colour or cropping as necessary. The
2586 image is pasted into a new image with the given size and background
2587 colour at the position ``pos`` relative to the upper left of the new
2588 image. If red = green = blue = -1 then use either the current mask
2589 colour if set or find, use, and set a suitable mask colour for any
2590 newly exposed areas.
2591 """
aff4cc5c
RD
2592 return _core_.Image_Size(*args, **kwargs)
2593
e811c8ce 2594 def Copy(*args, **kwargs):
7a27cf7c
RD
2595 """
2596 Copy(self) -> Image
2597
2598 Returns an identical copy of the image.
2599 """
54f9ee45 2600 return _core_.Image_Copy(*args, **kwargs)
e811c8ce
RD
2601
2602 def Paste(*args, **kwargs):
7a27cf7c
RD
2603 """
2604 Paste(self, Image image, int x, int y)
2605
2606 Pastes ``image`` into this instance and takes care of the mask colour
2607 and any out of bounds problems.
2608 """
54f9ee45 2609 return _core_.Image_Paste(*args, **kwargs)
e811c8ce
RD
2610
2611 def GetData(*args, **kwargs):
61d07ac7
RD
2612 """
2613 GetData(self) -> PyObject
2614
2615 Returns a string containing a copy of the RGB bytes of the image.
2616 """
54f9ee45 2617 return _core_.Image_GetData(*args, **kwargs)
e811c8ce
RD
2618
2619 def SetData(*args, **kwargs):
61d07ac7
RD
2620 """
2621 SetData(self, buffer data)
2622
2623 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2624 either a string or a buffer object holding the data and the length of
2625 the data must be width*height*3.
2626 """
54f9ee45 2627 return _core_.Image_SetData(*args, **kwargs)
e811c8ce
RD
2628
2629 def GetDataBuffer(*args, **kwargs):
61d07ac7
RD
2630 """
2631 GetDataBuffer(self) -> PyObject
2632
2633 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2634 image data buffer inside the wx.Image. You need to ensure that you do
2635 not use this buffer object after the image has been destroyed.
61d07ac7 2636 """
54f9ee45 2637 return _core_.Image_GetDataBuffer(*args, **kwargs)
e811c8ce
RD
2638
2639 def SetDataBuffer(*args, **kwargs):
61d07ac7
RD
2640 """
2641 SetDataBuffer(self, buffer data)
2642
2643 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2644 object. This can save making an extra copy of the data but you must
2645 ensure that the buffer object lives longer than the wx.Image does.
61d07ac7 2646 """
54f9ee45 2647 return _core_.Image_SetDataBuffer(*args, **kwargs)
e811c8ce
RD
2648
2649 def GetAlphaData(*args, **kwargs):
61d07ac7
RD
2650 """
2651 GetAlphaData(self) -> PyObject
2652
2653 Returns a string containing a copy of the alpha bytes of the image.
2654 """
54f9ee45 2655 return _core_.Image_GetAlphaData(*args, **kwargs)
e811c8ce
RD
2656
2657 def SetAlphaData(*args, **kwargs):
61d07ac7
RD
2658 """
2659 SetAlphaData(self, buffer alpha)
2660
2661 Resets the Image's alpha data from a buffer of bytes. Accepts either
2662 a string or a buffer object holding the data and the length of the
2663 data must be width*height.
2664 """
54f9ee45 2665 return _core_.Image_SetAlphaData(*args, **kwargs)
e811c8ce
RD
2666
2667 def GetAlphaBuffer(*args, **kwargs):
a95a7133 2668 """GetAlphaBuffer(self) -> PyObject"""
54f9ee45 2669 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2670
2671 def SetAlphaBuffer(*args, **kwargs):
61d07ac7 2672 """SetAlphaBuffer(self, buffer alpha)"""
54f9ee45 2673 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2674
2675 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2676 """
2677 SetMaskColour(self, byte r, byte g, byte b)
2678
2679 Sets the mask colour for this image (and tells the image to use the
2680 mask).
2681 """
54f9ee45 2682 return _core_.Image_SetMaskColour(*args, **kwargs)
e811c8ce 2683
aff4cc5c
RD
2684 def GetOrFindMaskColour(*args, **kwargs):
2685 """
2686 GetOrFindMaskColour() -> (r,g,b)
2687
2688 Get the current mask colour or find a suitable colour.
2689 """
2690 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2691
e811c8ce 2692 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2693 """
2694 GetMaskRed(self) -> byte
2695
2696 Gets the red component of the mask colour.
2697 """
54f9ee45 2698 return _core_.Image_GetMaskRed(*args, **kwargs)
e811c8ce
RD
2699
2700 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2701 """
2702 GetMaskGreen(self) -> byte
2703
2704 Gets the green component of the mask colour.
2705 """
54f9ee45 2706 return _core_.Image_GetMaskGreen(*args, **kwargs)
e811c8ce
RD
2707
2708 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2709 """
2710 GetMaskBlue(self) -> byte
2711
2712 Gets the blue component of the mask colour.
2713 """
54f9ee45 2714 return _core_.Image_GetMaskBlue(*args, **kwargs)
e811c8ce
RD
2715
2716 def SetMask(*args, **kwargs):
7a27cf7c
RD
2717 """
2718 SetMask(self, bool mask=True)
2719
2720 Specifies whether there is a mask or not. The area of the mask is
2721 determined by the current mask colour.
2722 """
54f9ee45 2723 return _core_.Image_SetMask(*args, **kwargs)
e811c8ce
RD
2724
2725 def HasMask(*args, **kwargs):
7a27cf7c
RD
2726 """
2727 HasMask(self) -> bool
2728
2729 Returns ``True`` if there is a mask active, ``False`` otherwise.
2730 """
54f9ee45 2731 return _core_.Image_HasMask(*args, **kwargs)
e811c8ce
RD
2732
2733 def Rotate(*args, **kwargs):
0df68c9f 2734 """
a95a7133 2735 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
0df68c9f 2736 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2737
2738 Rotates the image about the given point, by ``angle`` radians. Passing
2739 ``True`` to ``interpolating`` results in better image quality, but is
2740 slower. If the image has a mask, then the mask colour is used for the
2741 uncovered pixels in the rotated image background. Otherwise, black
2742 will be used as the fill colour.
2743
2744 Returns the rotated image, leaving this image intact.
0df68c9f 2745 """
54f9ee45 2746 return _core_.Image_Rotate(*args, **kwargs)
e811c8ce
RD
2747
2748 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2749 """
2750 Rotate90(self, bool clockwise=True) -> Image
2751
2752 Returns a copy of the image rotated 90 degrees in the direction
2753 indicated by ``clockwise``.
2754 """
54f9ee45 2755 return _core_.Image_Rotate90(*args, **kwargs)
e811c8ce
RD
2756
2757 def Mirror(*args, **kwargs):
7a27cf7c
RD
2758 """
2759 Mirror(self, bool horizontally=True) -> Image
2760
2761 Returns a mirrored copy of the image. The parameter ``horizontally``
2762 indicates the orientation.
2763 """
54f9ee45 2764 return _core_.Image_Mirror(*args, **kwargs)
e811c8ce
RD
2765
2766 def Replace(*args, **kwargs):
0df68c9f 2767 """
7a27cf7c
RD
2768 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2769
2770 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2771 ``(r2,g2,b2)``.
0df68c9f 2772 """
54f9ee45 2773 return _core_.Image_Replace(*args, **kwargs)
e811c8ce 2774
32fe5131
RD
2775 def ConvertToGreyscale(*args, **kwargs):
2776 """
2777 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2778
2779 Convert to greyscale image. Uses the luminance component (Y) of the
2780 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2781 defaults to ITU-T BT.601
2782 """
2783 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2784
e811c8ce 2785 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2786 """
2787 ConvertToMono(self, byte r, byte g, byte b) -> Image
2788
2789 Returns monochromatic version of the image. The returned image has
2790 white colour where the original has ``(r,g,b)`` colour and black
2791 colour everywhere else.
2792 """
54f9ee45 2793 return _core_.Image_ConvertToMono(*args, **kwargs)
e811c8ce
RD
2794
2795 def SetOption(*args, **kwargs):
7a27cf7c
RD
2796 """
2797 SetOption(self, String name, String value)
2798
2799 Sets an image handler defined option. For example, when saving as a
2800 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2801 number between 0 and 100 (0 is terrible, 100 is very good).
2802 """
54f9ee45 2803 return _core_.Image_SetOption(*args, **kwargs)
e811c8ce
RD
2804
2805 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2806 """
2807 SetOptionInt(self, String name, int value)
2808
2809 Sets an image option as an integer.
2810 """
54f9ee45 2811 return _core_.Image_SetOptionInt(*args, **kwargs)
e811c8ce
RD
2812
2813 def GetOption(*args, **kwargs):
7a27cf7c
RD
2814 """
2815 GetOption(self, String name) -> String
2816
2817 Gets the value of an image handler option.
2818 """
54f9ee45 2819 return _core_.Image_GetOption(*args, **kwargs)
e811c8ce
RD
2820
2821 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2822 """
2823 GetOptionInt(self, String name) -> int
2824
2825 Gets the value of an image handler option as an integer. If the given
2826 option is not present, the function returns 0.
2827 """
54f9ee45 2828 return _core_.Image_GetOptionInt(*args, **kwargs)
e811c8ce
RD
2829
2830 def HasOption(*args, **kwargs):
7a27cf7c
RD
2831 """
2832 HasOption(self, String name) -> bool
2833
2834 Returns true if the given option is present.
2835 """
54f9ee45 2836 return _core_.Image_HasOption(*args, **kwargs)
e811c8ce
RD
2837
2838 def CountColours(*args, **kwargs):
a95a7133 2839 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
54f9ee45 2840 return _core_.Image_CountColours(*args, **kwargs)
e811c8ce
RD
2841
2842 def ComputeHistogram(*args, **kwargs):
a95a7133 2843 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
54f9ee45 2844 return _core_.Image_ComputeHistogram(*args, **kwargs)
e811c8ce
RD
2845
2846 def AddHandler(*args, **kwargs):
66c033b4 2847 """AddHandler(ImageHandler handler)"""
54f9ee45 2848 return _core_.Image_AddHandler(*args, **kwargs)
e811c8ce
RD
2849
2850 AddHandler = staticmethod(AddHandler)
2851 def InsertHandler(*args, **kwargs):
66c033b4 2852 """InsertHandler(ImageHandler handler)"""
54f9ee45 2853 return _core_.Image_InsertHandler(*args, **kwargs)
e811c8ce
RD
2854
2855 InsertHandler = staticmethod(InsertHandler)
2856 def RemoveHandler(*args, **kwargs):
66c033b4 2857 """RemoveHandler(String name) -> bool"""
54f9ee45 2858 return _core_.Image_RemoveHandler(*args, **kwargs)
e811c8ce
RD
2859
2860 RemoveHandler = staticmethod(RemoveHandler)
0085ce49
RD
2861 def GetHandlers(*args, **kwargs):
2862 """GetHandlers() -> PyObject"""
2863 return _core_.Image_GetHandlers(*args, **kwargs)
2864
2865 GetHandlers = staticmethod(GetHandlers)
e811c8ce 2866 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2867 """
2868 GetImageExtWildcard() -> String
2869
2870 Iterates all registered wxImageHandler objects, and returns a string
2871 containing file extension masks suitable for passing to file open/save
2872 dialog boxes.
2873 """
54f9ee45 2874 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
e811c8ce
RD
2875
2876 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2877 def ConvertToBitmap(*args, **kwargs):
1fbf26be 2878 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
54f9ee45 2879 return _core_.Image_ConvertToBitmap(*args, **kwargs)
e811c8ce
RD
2880
2881 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 2882 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
54f9ee45 2883 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
e811c8ce 2884
943e8dfd
RD
2885 def RotateHue(*args, **kwargs):
2886 """
2887 RotateHue(self, double angle)
2888
2889 Rotates the hue of each pixel of the image. Hue is a double in the
2890 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2891 """
2892 return _core_.Image_RotateHue(*args, **kwargs)
2893
2894 def RGBtoHSV(*args, **kwargs):
2895 """
2896 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2897
2898 Converts a color in RGB color space to HSV color space.
2899 """
2900 return _core_.Image_RGBtoHSV(*args, **kwargs)
2901
2902 RGBtoHSV = staticmethod(RGBtoHSV)
2903 def HSVtoRGB(*args, **kwargs):
2904 """
2905 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2906
2907 Converts a color in HSV color space to RGB color space.
2908 """
2909 return _core_.Image_HSVtoRGB(*args, **kwargs)
2910
2911 HSVtoRGB = staticmethod(HSVtoRGB)
e811c8ce 2912 def __nonzero__(self): return self.Ok()
0085ce49
RD
2913Image_swigregister = _core_.Image_swigregister
2914Image_swigregister(Image)
d14a1e28
RD
2915
2916def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
2917 """
2918 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2919
2920 Loads an image from a file, using a MIME type string (such as
2921 'image/jpeg') to specify image type.
2922 """
54f9ee45 2923 val = _core_.new_ImageFromMime(*args, **kwargs)
d14a1e28
RD
2924 return val
2925
2926def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
2927 """
2928 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2929
2930 Loads an image from an input stream, or any readable Python file-like
2931 object.
2932 """
54f9ee45 2933 val = _core_.new_ImageFromStream(*args, **kwargs)
d14a1e28
RD
2934 return val
2935
2936def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
2937 """
2938 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2939
2940 Loads an image from an input stream, or any readable Python file-like
2941 object, specifying the image format with a MIME type string.
2942 """
54f9ee45 2943 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d14a1e28
RD
2944 return val
2945
66c033b4 2946def EmptyImage(*args, **kwargs):
61d07ac7
RD
2947 """
2948 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2949
2950 Construct an empty image of a given size, optionally setting all
2951 pixels to black.
2952 """
66c033b4 2953 val = _core_.new_EmptyImage(*args, **kwargs)
d14a1e28
RD
2954 return val
2955
2956def ImageFromBitmap(*args, **kwargs):
61d07ac7
RD
2957 """
2958 ImageFromBitmap(Bitmap bitmap) -> Image
2959
2960 Construct an Image from a `wx.Bitmap`.
2961 """
54f9ee45 2962 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d14a1e28
RD
2963 return val
2964
2965def ImageFromData(*args, **kwargs):
61d07ac7
RD
2966 """
2967 ImageFromData(int width, int height, buffer data) -> Image
2968
2969 Construct an Image from a buffer of RGB bytes. Accepts either a
2970 string or a buffer object holding the data and the length of the data
2971 must be width*height*3.
2972 """
54f9ee45 2973 val = _core_.new_ImageFromData(*args, **kwargs)
d14a1e28
RD
2974 return val
2975
1823fbb4 2976def ImageFromDataWithAlpha(*args, **kwargs):
61d07ac7
RD
2977 """
2978 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
2979
2980 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2981 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
2982 length of the data must be width*height*3 bytes, and the length of the
2983 alpha data must be width*height bytes.
61d07ac7 2984 """
1823fbb4 2985 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
1823fbb4
RD
2986 return val
2987
e811c8ce 2988def Image_CanRead(*args, **kwargs):
0085ce49 2989 """
7a27cf7c
RD
2990 Image_CanRead(String filename) -> bool
2991
2992 Returns True if the image handlers can read this file.
2993 """
0085ce49 2994 return _core_.Image_CanRead(*args, **kwargs)
d14a1e28 2995
e811c8ce 2996def Image_GetImageCount(*args, **kwargs):
0085ce49 2997 """
7a27cf7c
RD
2998 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2999
3000 If the image file contains more than one image and the image handler
3001 is capable of retrieving these individually, this function will return
3002 the number of available images.
3003 """
0085ce49 3004 return _core_.Image_GetImageCount(*args, **kwargs)
d14a1e28 3005
e811c8ce 3006def Image_CanReadStream(*args, **kwargs):
0085ce49 3007 """
7a27cf7c
RD
3008 Image_CanReadStream(InputStream stream) -> bool
3009
3010 Returns True if the image handlers can read an image file from the
3011 data currently on the input stream, or a readable Python file-like
3012 object.
3013 """
0085ce49 3014 return _core_.Image_CanReadStream(*args, **kwargs)
d14a1e28 3015
e811c8ce 3016def Image_AddHandler(*args, **kwargs):
0085ce49
RD
3017 """Image_AddHandler(ImageHandler handler)"""
3018 return _core_.Image_AddHandler(*args, **kwargs)
d14a1e28 3019
e811c8ce 3020def Image_InsertHandler(*args, **kwargs):
0085ce49
RD
3021 """Image_InsertHandler(ImageHandler handler)"""
3022 return _core_.Image_InsertHandler(*args, **kwargs)
d14a1e28 3023
e811c8ce 3024def Image_RemoveHandler(*args, **kwargs):
0085ce49
RD
3025 """Image_RemoveHandler(String name) -> bool"""
3026 return _core_.Image_RemoveHandler(*args, **kwargs)
d14a1e28 3027
0085ce49
RD
3028def Image_GetHandlers(*args):
3029 """Image_GetHandlers() -> PyObject"""
3030 return _core_.Image_GetHandlers(*args)
3031
3032def Image_GetImageExtWildcard(*args):
3033 """
7a27cf7c
RD
3034 Image_GetImageExtWildcard() -> String
3035
3036 Iterates all registered wxImageHandler objects, and returns a string
3037 containing file extension masks suitable for passing to file open/save
3038 dialog boxes.
3039 """
0085ce49 3040 return _core_.Image_GetImageExtWildcard(*args)
d14a1e28 3041
943e8dfd 3042def Image_RGBtoHSV(*args, **kwargs):
0085ce49 3043 """
943e8dfd
RD
3044 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3045
3046 Converts a color in RGB color space to HSV color space.
3047 """
0085ce49 3048 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3049
3050def Image_HSVtoRGB(*args, **kwargs):
0085ce49 3051 """
943e8dfd
RD
3052 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3053
3054 Converts a color in HSV color space to RGB color space.
3055 """
0085ce49 3056 return _core_.Image_HSVtoRGB(*args, **kwargs)
943e8dfd 3057
5e4ca4a8
RD
3058def InitAllImageHandlers():
3059 """
3060 The former functionality of InitAllImageHanders is now done internal to
3061 the _core_ extension module and so this function has become a simple NOP.
3062 """
3063 pass
d14a1e28 3064
54f9ee45
RD
3065IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3066IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
3067PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3068PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3069PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
54f9ee45
RD
3070BMP_24BPP = _core_.BMP_24BPP
3071BMP_8BPP = _core_.BMP_8BPP
3072BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3073BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3074BMP_8BPP_RED = _core_.BMP_8BPP_RED
3075BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3076BMP_4BPP = _core_.BMP_4BPP
3077BMP_1BPP = _core_.BMP_1BPP
3078BMP_1BPP_BW = _core_.BMP_1BPP_BW
d14a1e28 3079class BMPHandler(ImageHandler):
27fb7603 3080 """A `wx.ImageHandler` for \*.bmp bitmap files."""
0085ce49
RD
3081 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3082 __repr__ = _swig_repr
3083 def __init__(self, *args, **kwargs):
27fb7603
RD
3084 """
3085 __init__(self) -> BMPHandler
3086
3087 A `wx.ImageHandler` for \*.bmp bitmap files.
3088 """
0085ce49
RD
3089 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
3090BMPHandler_swigregister = _core_.BMPHandler_swigregister
3091BMPHandler_swigregister(BMPHandler)
d14a1e28 3092NullImage = cvar.NullImage
0c243d93 3093IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d14a1e28
RD
3094IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3095IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3096IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3097IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
0c243d93
RD
3098IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3099IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d14a1e28 3100IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3101IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
0c243d93
RD
3102IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3103IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3104IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3105IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
3106IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3107IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d14a1e28
RD
3108
3109class ICOHandler(BMPHandler):
27fb7603 3110 """A `wx.ImageHandler` for \*.ico icon files."""
0085ce49
RD
3111 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3112 __repr__ = _swig_repr
3113 def __init__(self, *args, **kwargs):
27fb7603
RD
3114 """
3115 __init__(self) -> ICOHandler
3116
3117 A `wx.ImageHandler` for \*.ico icon files.
3118 """
0085ce49
RD
3119 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
3120ICOHandler_swigregister = _core_.ICOHandler_swigregister
3121ICOHandler_swigregister(ICOHandler)
d14a1e28
RD
3122
3123class CURHandler(ICOHandler):
27fb7603 3124 """A `wx.ImageHandler` for \*.cur cursor files."""
0085ce49
RD
3125 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3126 __repr__ = _swig_repr
3127 def __init__(self, *args, **kwargs):
27fb7603
RD
3128 """
3129 __init__(self) -> CURHandler
3130
3131 A `wx.ImageHandler` for \*.cur cursor files.
3132 """
0085ce49
RD
3133 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
3134CURHandler_swigregister = _core_.CURHandler_swigregister
3135CURHandler_swigregister(CURHandler)
d14a1e28
RD
3136
3137class ANIHandler(CURHandler):
27fb7603 3138 """A `wx.ImageHandler` for \*.ani animated cursor files."""
0085ce49
RD
3139 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3140 __repr__ = _swig_repr
3141 def __init__(self, *args, **kwargs):
27fb7603
RD
3142 """
3143 __init__(self) -> ANIHandler
3144
3145 A `wx.ImageHandler` for \*.ani animated cursor files.
3146 """
0085ce49
RD
3147 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
3148ANIHandler_swigregister = _core_.ANIHandler_swigregister
3149ANIHandler_swigregister(ANIHandler)
d14a1e28
RD
3150
3151class PNGHandler(ImageHandler):
27fb7603 3152 """A `wx.ImageHandler` for PNG image files."""
0085ce49
RD
3153 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3154 __repr__ = _swig_repr
3155 def __init__(self, *args, **kwargs):
27fb7603
RD
3156 """
3157 __init__(self) -> PNGHandler
3158
3159 A `wx.ImageHandler` for PNG image files.
3160 """
0085ce49
RD
3161 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
3162PNGHandler_swigregister = _core_.PNGHandler_swigregister
3163PNGHandler_swigregister(PNGHandler)
d14a1e28
RD
3164
3165class GIFHandler(ImageHandler):
27fb7603 3166 """A `wx.ImageHandler` for GIF image files."""
0085ce49
RD
3167 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3168 __repr__ = _swig_repr
3169 def __init__(self, *args, **kwargs):
27fb7603
RD
3170 """
3171 __init__(self) -> GIFHandler
3172
3173 A `wx.ImageHandler` for GIF image files.
3174 """
0085ce49
RD
3175 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
3176GIFHandler_swigregister = _core_.GIFHandler_swigregister
3177GIFHandler_swigregister(GIFHandler)
d14a1e28
RD
3178
3179class PCXHandler(ImageHandler):
27fb7603 3180 """A `wx.ImageHandler` for PCX imager files."""
0085ce49
RD
3181 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3182 __repr__ = _swig_repr
3183 def __init__(self, *args, **kwargs):
27fb7603
RD
3184 """
3185 __init__(self) -> PCXHandler
3186
3187 A `wx.ImageHandler` for PCX imager files.
3188 """
0085ce49
RD
3189 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
3190PCXHandler_swigregister = _core_.PCXHandler_swigregister
3191PCXHandler_swigregister(PCXHandler)
d14a1e28
RD
3192
3193class JPEGHandler(ImageHandler):
27fb7603 3194 """A `wx.ImageHandler` for JPEG/JPG image files."""
0085ce49
RD
3195 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3196 __repr__ = _swig_repr
3197 def __init__(self, *args, **kwargs):
27fb7603
RD
3198 """
3199 __init__(self) -> JPEGHandler
3200
3201 A `wx.ImageHandler` for JPEG/JPG image files.
3202 """
0085ce49
RD
3203 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
3204JPEGHandler_swigregister = _core_.JPEGHandler_swigregister
3205JPEGHandler_swigregister(JPEGHandler)
d14a1e28
RD
3206
3207class PNMHandler(ImageHandler):
27fb7603 3208 """A `wx.ImageHandler` for PNM image files."""
0085ce49
RD
3209 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3210 __repr__ = _swig_repr
3211 def __init__(self, *args, **kwargs):
27fb7603
RD
3212 """
3213 __init__(self) -> PNMHandler
3214
3215 A `wx.ImageHandler` for PNM image files.
3216 """
0085ce49
RD
3217 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
3218PNMHandler_swigregister = _core_.PNMHandler_swigregister
3219PNMHandler_swigregister(PNMHandler)
d14a1e28
RD
3220
3221class XPMHandler(ImageHandler):
27fb7603 3222 """A `wx.ImageHandler` for XPM image."""
0085ce49
RD
3223 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3224 __repr__ = _swig_repr
3225 def __init__(self, *args, **kwargs):
27fb7603
RD
3226 """
3227 __init__(self) -> XPMHandler
3228
3229 A `wx.ImageHandler` for XPM image.
3230 """
0085ce49
RD
3231 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
3232XPMHandler_swigregister = _core_.XPMHandler_swigregister
3233XPMHandler_swigregister(XPMHandler)
d14a1e28
RD
3234
3235class TIFFHandler(ImageHandler):
27fb7603 3236 """A `wx.ImageHandler` for TIFF image files."""
0085ce49
RD
3237 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3238 __repr__ = _swig_repr
3239 def __init__(self, *args, **kwargs):
27fb7603
RD
3240 """
3241 __init__(self) -> TIFFHandler
3242
3243 A `wx.ImageHandler` for TIFF image files.
3244 """
0085ce49
RD
3245 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
3246TIFFHandler_swigregister = _core_.TIFFHandler_swigregister
3247TIFFHandler_swigregister(TIFFHandler)
d14a1e28 3248
c0de73ae
RD
3249QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3250QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3251class Quantize(object):
3252 """Performs quantization, or colour reduction, on a wxImage."""
0085ce49
RD
3253 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3254 def __init__(self): raise AttributeError, "No constructor defined"
3255 __repr__ = _swig_repr
c0de73ae
RD
3256 def Quantize(*args, **kwargs):
3257 """
3258 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3259
3260 Reduce the colours in the source image and put the result into the
3261 destination image, setting the palette in the destination if
3262 needed. Both images may be the same, to overwrite the source image.
3263 """
3264 return _core_.Quantize_Quantize(*args, **kwargs)
3265
3266 Quantize = staticmethod(Quantize)
0085ce49
RD
3267Quantize_swigregister = _core_.Quantize_swigregister
3268Quantize_swigregister(Quantize)
c0de73ae
RD
3269
3270def Quantize_Quantize(*args, **kwargs):
0085ce49 3271 """
c0de73ae
RD
3272 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3273
3274 Reduce the colours in the source image and put the result into the
3275 destination image, setting the palette in the destination if
3276 needed. Both images may be the same, to overwrite the source image.
3277 """
0085ce49 3278 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3279
d14a1e28
RD
3280#---------------------------------------------------------------------------
3281
3282class EvtHandler(Object):
093d3ff1 3283 """Proxy of C++ EvtHandler class"""
0085ce49
RD
3284 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3285 __repr__ = _swig_repr
3286 def __init__(self, *args, **kwargs):
a95a7133 3287 """__init__(self) -> EvtHandler"""
0085ce49 3288 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
e811c8ce 3289 def GetNextHandler(*args, **kwargs):
a95a7133 3290 """GetNextHandler(self) -> EvtHandler"""
54f9ee45 3291 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
e811c8ce
RD
3292
3293 def GetPreviousHandler(*args, **kwargs):
a95a7133 3294 """GetPreviousHandler(self) -> EvtHandler"""
54f9ee45 3295 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3296
3297 def SetNextHandler(*args, **kwargs):
a95a7133 3298 """SetNextHandler(self, EvtHandler handler)"""
54f9ee45 3299 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
e811c8ce
RD
3300
3301 def SetPreviousHandler(*args, **kwargs):
a95a7133 3302 """SetPreviousHandler(self, EvtHandler handler)"""
54f9ee45 3303 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3304
3305 def GetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3306 """GetEvtHandlerEnabled(self) -> bool"""
54f9ee45 3307 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3308
3309 def SetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3310 """SetEvtHandlerEnabled(self, bool enabled)"""
54f9ee45 3311 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3312
3313 def ProcessEvent(*args, **kwargs):
a95a7133 3314 """ProcessEvent(self, Event event) -> bool"""
54f9ee45 3315 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
e811c8ce
RD
3316
3317 def AddPendingEvent(*args, **kwargs):
a95a7133 3318 """AddPendingEvent(self, Event event)"""
54f9ee45 3319 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
e811c8ce
RD
3320
3321 def ProcessPendingEvents(*args, **kwargs):
a95a7133 3322 """ProcessPendingEvents(self)"""
54f9ee45 3323 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
3324
3325 def Connect(*args, **kwargs):
a95a7133 3326 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
54f9ee45 3327 return _core_.EvtHandler_Connect(*args, **kwargs)
e811c8ce
RD
3328
3329 def Disconnect(*args, **kwargs):
a95a7133 3330 """Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool"""
54f9ee45 3331 return _core_.EvtHandler_Disconnect(*args, **kwargs)
e811c8ce
RD
3332
3333 def _setOORInfo(*args, **kwargs):
689b42ee 3334 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3335 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3336 args[0].thisown = 0
3337 return val
e811c8ce 3338
d14a1e28
RD
3339 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3340 """
3341 Bind an event to an event handler.
3342
db3e571a
RD
3343 :param event: One of the EVT_* objects that specifies the
3344 type of event to bind,
d14a1e28 3345
db3e571a
RD
3346 :param handler: A callable object to be invoked when the
3347 event is delivered to self. Pass None to
3348 disconnect an event handler.
d14a1e28 3349
db3e571a
RD
3350 :param source: Sometimes the event originates from a
3351 different window than self, but you still
3352 want to catch it in self. (For example, a
3353 button event delivered to a frame.) By
3354 passing the source of the event, the event
3355 handling system is able to differentiate
3356 between the same event type from different
3357 controls.
d14a1e28 3358
db3e571a
RD
3359 :param id: Used to spcify the event source by ID instead
3360 of instance.
3361
3362 :param id2: Used when it is desirable to bind a handler
3363 to a range of IDs, such as with EVT_MENU_RANGE.
d14a1e28
RD
3364 """
3365 if source is not None:
3366 id = source.GetId()
3367 event.Bind(self, id, id2, handler)
3368
66c033b4
RD
3369 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3370 """
3371 Disconencts the event handler binding for event from self.
3372 Returns True if successful.
3373 """
3374 if source is not None:
3375 id = source.GetId()
3376 return event.Unbind(self, id, id2)
d14a1e28 3377
0085ce49
RD
3378EvtHandler_swigregister = _core_.EvtHandler_swigregister
3379EvtHandler_swigregister(EvtHandler)
d14a1e28
RD
3380
3381#---------------------------------------------------------------------------
3382
3383class PyEventBinder(object):
3384 """
3385 Instances of this class are used to bind specific events to event
3386 handlers.
3387 """
3388 def __init__(self, evtType, expectedIDs=0):
3389 if expectedIDs not in [0, 1, 2]:
3390 raise ValueError, "Invalid number of expectedIDs"
3391 self.expectedIDs = expectedIDs
3392
3393 if type(evtType) == list or type(evtType) == tuple:
3394 self.evtType = evtType
3395 else:
3396 self.evtType = [evtType]
3397
3398
3399 def Bind(self, target, id1, id2, function):
3400 """Bind this set of event types to target."""
3401 for et in self.evtType:
3402 target.Connect(id1, id2, et, function)
3403
66c033b4
RD
3404
3405 def Unbind(self, target, id1, id2):
3406 """Remove an event binding."""
3407 success = 0
3408 for et in self.evtType:
3409 success += target.Disconnect(id1, id2, et)
3410 return success != 0
3411
d14a1e28
RD
3412
3413 def __call__(self, *args):
3414 """
3415 For backwards compatibility with the old EVT_* functions.
3416 Should be called with either (window, func), (window, ID,
3417 func) or (window, ID1, ID2, func) parameters depending on the
3418 type of the event.
3419 """
3420 assert len(args) == 2 + self.expectedIDs
3421 id1 = wx.ID_ANY
3422 id2 = wx.ID_ANY
3423 target = args[0]
3424 if self.expectedIDs == 0:
3425 func = args[1]
3426 elif self.expectedIDs == 1:
3427 id1 = args[1]
3428 func = args[2]
3429 elif self.expectedIDs == 2:
3430 id1 = args[1]
3431 id2 = args[2]
3432 func = args[3]
3433 else:
3434 raise ValueError, "Unexpected number of IDs"
3435
3436 self.Bind(target, id1, id2, func)
3437
3438
3439# These two are square pegs that don't fit the PyEventBinder hole...
3440def EVT_COMMAND(win, id, cmd, func):
3441 win.Connect(id, -1, cmd, func)
3442def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3443 win.Connect(id1, id2, cmd, func)
3444
3445
3446#---------------------------------------------------------------------------
3447
3448#---------------------------------------------------------------------------
3449
54f9ee45
RD
3450EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3451EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
d14a1e28 3452
0085ce49
RD
3453def NewEventType(*args):
3454 """NewEventType() -> wxEventType"""
3455 return _core_.NewEventType(*args)
54f9ee45
RD
3456wxEVT_NULL = _core_.wxEVT_NULL
3457wxEVT_FIRST = _core_.wxEVT_FIRST
3458wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3459wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3460wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3461wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3462wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3463wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3464wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3465wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3466wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3467wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3468wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3469wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3470wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3471wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3472wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3473wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3474wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3475wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3476wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3477wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3478wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3479wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3480wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3481wxEVT_MOTION = _core_.wxEVT_MOTION
3482wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3483wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3484wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3485wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3486wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3487wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3488wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3489wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3490wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3491wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3492wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3493wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3494wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3495wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3496wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3497wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3498wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3499wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3500wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3501wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3502wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3503wxEVT_CHAR = _core_.wxEVT_CHAR
3504wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3505wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3506wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3507wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3508wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3509wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3510wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3511wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3512wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3513wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3514wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3515wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3516wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3517wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3518wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3519wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
54f9ee45
RD
3520wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3521wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3522wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3523wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3524wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3525wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3526wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3527wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3528wxEVT_SIZE = _core_.wxEVT_SIZE
3529wxEVT_MOVE = _core_.wxEVT_MOVE
3530wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3531wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3532wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3533wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3534wxEVT_POWER = _core_.wxEVT_POWER
3535wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3536wxEVT_CREATE = _core_.wxEVT_CREATE
3537wxEVT_DESTROY = _core_.wxEVT_DESTROY
3538wxEVT_SHOW = _core_.wxEVT_SHOW
3539wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3540wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3541wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3542wxEVT_PAINT = _core_.wxEVT_PAINT
3543wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3544wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3545wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3546wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3547wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3548wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3549wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3550wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3551wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3552wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3553wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3554wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3555wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3556wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3557wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3558wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3559wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3560wxEVT_IDLE = _core_.wxEVT_IDLE
3561wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3562wxEVT_SIZING = _core_.wxEVT_SIZING
3563wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 3564wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
54f9ee45
RD
3565wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3566wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3567wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3568wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3569wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3570wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3571wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d14a1e28
RD
3572#
3573# Create some event binders
3574EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3575EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3576EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3577EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3578EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3579EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3580EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3581EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3582EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3583EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3584EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3585EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3586EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3587EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3588EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3589EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3590EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3591EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3592EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3593EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3594EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3595EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3596EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3597EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
88c6b281 3598EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d14a1e28
RD
3599EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3600EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3601EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3602EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3603EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3604EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3605EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3606EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3607EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3608EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3609EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3610EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3611EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3612EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3613EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3614EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3615
3616EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3617EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3618EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3619EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3620EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3621EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3622EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3623EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3624EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3625EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3626EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3627EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3628EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3629
3630EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3631 wxEVT_LEFT_UP,
3632 wxEVT_MIDDLE_DOWN,
3633 wxEVT_MIDDLE_UP,
3634 wxEVT_RIGHT_DOWN,
3635 wxEVT_RIGHT_UP,
3636 wxEVT_MOTION,
3637 wxEVT_LEFT_DCLICK,
3638 wxEVT_MIDDLE_DCLICK,
3639 wxEVT_RIGHT_DCLICK,
3640 wxEVT_ENTER_WINDOW,
3641 wxEVT_LEAVE_WINDOW,
3642 wxEVT_MOUSEWHEEL
3643 ])
3644
3645
3646# Scrolling from wxWindow (sent to wxScrolledWindow)
3647EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3648 wxEVT_SCROLLWIN_BOTTOM,
3649 wxEVT_SCROLLWIN_LINEUP,
3650 wxEVT_SCROLLWIN_LINEDOWN,
3651 wxEVT_SCROLLWIN_PAGEUP,
3652 wxEVT_SCROLLWIN_PAGEDOWN,
3653 wxEVT_SCROLLWIN_THUMBTRACK,
3654 wxEVT_SCROLLWIN_THUMBRELEASE,
3655 ])
3656
3657EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3658EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3659EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3660EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3661EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3662EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3663EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3664EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3665
27fb7603 3666# Scrolling from wx.Slider and wx.ScrollBar
d14a1e28
RD
3667EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3668 wxEVT_SCROLL_BOTTOM,
3669 wxEVT_SCROLL_LINEUP,
3670 wxEVT_SCROLL_LINEDOWN,
3671 wxEVT_SCROLL_PAGEUP,
3672 wxEVT_SCROLL_PAGEDOWN,
3673 wxEVT_SCROLL_THUMBTRACK,
3674 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3675 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
3676 ])
3677
3678EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3679EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3680EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3681EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3682EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3683EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3684EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3685EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3686EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3687EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3688
27fb7603 3689# Scrolling from wx.Slider and wx.ScrollBar, with an id
d14a1e28
RD
3690EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3691 wxEVT_SCROLL_BOTTOM,
3692 wxEVT_SCROLL_LINEUP,
3693 wxEVT_SCROLL_LINEDOWN,
3694 wxEVT_SCROLL_PAGEUP,
3695 wxEVT_SCROLL_PAGEDOWN,
3696 wxEVT_SCROLL_THUMBTRACK,
3697 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3698 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
3699 ], 1)
3700
3701EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3702EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3703EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3704EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3705EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3706EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3707EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3708EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3709EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3710EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d14a1e28 3711
d14a1e28
RD
3712EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3713EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3714EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3715EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3716EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3717EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3718EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3719EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3720EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3721EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3722
3723EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3724EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3725EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3726EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3727EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3728EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3729EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3730EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3731EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3732
3733
3734EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3735EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3736EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3737EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3738EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3739EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3740EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3741
3742EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3743
3744EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3745EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3746
3747EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3748
3749
3750
3751#---------------------------------------------------------------------------
3752
3753class Event(Object):
27fb7603
RD
3754 """
3755 An event is a structure holding information about an event passed to a
3756 callback or member function. wx.Event is an abstract base class for
3757 other event classes
3758 """
0085ce49
RD
3759 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3760 def __init__(self): raise AttributeError, "No constructor defined"
3761 __repr__ = _swig_repr
3762 __swig_destroy__ = _core_.delete_Event
3763 __del__ = lambda self : None;
e811c8ce 3764 def SetEventType(*args, **kwargs):
27fb7603
RD
3765 """
3766 SetEventType(self, wxEventType typ)
3767
3768 Sets the specific type of the event.
3769 """
54f9ee45 3770 return _core_.Event_SetEventType(*args, **kwargs)
e811c8ce
RD
3771
3772 def GetEventType(*args, **kwargs):
27fb7603
RD
3773 """
3774 GetEventType(self) -> wxEventType
3775
3776 Returns the identifier of the given event type, such as
3777 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3778 """
54f9ee45 3779 return _core_.Event_GetEventType(*args, **kwargs)
e811c8ce
RD
3780
3781 def GetEventObject(*args, **kwargs):
27fb7603
RD
3782 """
3783 GetEventObject(self) -> Object
3784
3785 Returns the object (usually a window) associated with the event, if
3786 any.
3787 """
54f9ee45 3788 return _core_.Event_GetEventObject(*args, **kwargs)
e811c8ce
RD
3789
3790 def SetEventObject(*args, **kwargs):
27fb7603
RD
3791 """
3792 SetEventObject(self, Object obj)
3793
3794 Sets the originating object, or in other words, obj is normally the
3795 object that is sending the event.
3796 """
54f9ee45 3797 return _core_.Event_SetEventObject(*args, **kwargs)
e811c8ce
RD
3798
3799 def GetTimestamp(*args, **kwargs):
a95a7133 3800 """GetTimestamp(self) -> long"""
54f9ee45 3801 return _core_.Event_GetTimestamp(*args, **kwargs)
e811c8ce
RD
3802
3803 def SetTimestamp(*args, **kwargs):
a95a7133 3804 """SetTimestamp(self, long ts=0)"""
54f9ee45 3805 return _core_.Event_SetTimestamp(*args, **kwargs)
e811c8ce
RD
3806
3807 def GetId(*args, **kwargs):
27fb7603
RD
3808 """
3809 GetId(self) -> int
3810
3811 Returns the identifier associated with this event, such as a button
3812 command id.
3813 """
54f9ee45 3814 return _core_.Event_GetId(*args, **kwargs)
e811c8ce
RD
3815
3816 def SetId(*args, **kwargs):
27fb7603
RD
3817 """
3818 SetId(self, int Id)
3819
3820 Set's the ID for the event. This is usually the ID of the window that
3821 is sending the event, but it can also be a command id from a menu
3822 item, etc.
3823 """
54f9ee45 3824 return _core_.Event_SetId(*args, **kwargs)
e811c8ce
RD
3825
3826 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
3827 """
3828 IsCommandEvent(self) -> bool
3829
3830 Returns true if the event is or is derived from `wx.CommandEvent` else
3831 it returns false. Note: Exists only for optimization purposes.
3832 """
54f9ee45 3833 return _core_.Event_IsCommandEvent(*args, **kwargs)
e811c8ce
RD
3834
3835 def Skip(*args, **kwargs):
51b83b37
RD
3836 """
3837 Skip(self, bool skip=True)
3838
3839 Called by an event handler, it controls whether additional event
3840 handlers bound to this event will be called after the current event
3841 handler returns. Skip(false) (the default setting) will prevent
3842 additional event handlers from being called and control will be
3843 returned to the sender of the event immediately after the current
3844 handler has finished. Skip(True) will cause the event processing
3845 system to continue searching for a handler function for this event.
3846
3847 """
54f9ee45 3848 return _core_.Event_Skip(*args, **kwargs)
e811c8ce
RD
3849
3850 def GetSkipped(*args, **kwargs):
27fb7603
RD
3851 """
3852 GetSkipped(self) -> bool
3853
3854 Returns true if the event handler should be skipped, false otherwise.
3855 :see: `Skip`
3856 """
54f9ee45 3857 return _core_.Event_GetSkipped(*args, **kwargs)
e811c8ce
RD
3858
3859 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
3860 """
3861 ShouldPropagate(self) -> bool
3862
3863 Test if this event should be propagated to the parent window or not,
3864 i.e. if the propagation level is currently greater than 0.
3865 """
54f9ee45 3866 return _core_.Event_ShouldPropagate(*args, **kwargs)
e811c8ce
RD
3867
3868 def StopPropagation(*args, **kwargs):
27fb7603
RD
3869 """
3870 StopPropagation(self) -> int
3871
3872 Stop the event from propagating to its parent window. Returns the old
3873 propagation level value which may be later passed to
3874 `ResumePropagation` to allow propagating the event again.
3875 """
54f9ee45 3876 return _core_.Event_StopPropagation(*args, **kwargs)
e811c8ce
RD
3877
3878 def ResumePropagation(*args, **kwargs):
27fb7603
RD
3879 """
3880 ResumePropagation(self, int propagationLevel)
3881
3882 Resume the event propagation by restoring the propagation level. (For
3883 example, you can use the value returned by an earlier call to
3884 `StopPropagation`.)
3885
3886 """
54f9ee45 3887 return _core_.Event_ResumePropagation(*args, **kwargs)
e811c8ce
RD
3888
3889 def Clone(*args, **kwargs):
a95a7133 3890 """Clone(self) -> Event"""
54f9ee45 3891 return _core_.Event_Clone(*args, **kwargs)
e811c8ce 3892
0085ce49
RD
3893Event_swigregister = _core_.Event_swigregister
3894Event_swigregister(Event)
d14a1e28
RD
3895
3896#---------------------------------------------------------------------------
3897
3898class PropagationDisabler(object):
27fb7603
RD
3899 """
3900 Helper class to temporarily change an event not to propagate. Simply
3901 create an instance of this class and then whe it is destroyed the
3902 propogation of the event will be restored.
3903 """
0085ce49
RD
3904 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3905 __repr__ = _swig_repr
3906 def __init__(self, *args, **kwargs):
27fb7603
RD
3907 """
3908 __init__(self, Event event) -> PropagationDisabler
3909
3910 Helper class to temporarily change an event not to propagate. Simply
3911 create an instance of this class and then whe it is destroyed the
3912 propogation of the event will be restored.
3913 """
0085ce49
RD
3914 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3915 __swig_destroy__ = _core_.delete_PropagationDisabler
3916 __del__ = lambda self : None;
3917PropagationDisabler_swigregister = _core_.PropagationDisabler_swigregister
3918PropagationDisabler_swigregister(PropagationDisabler)
d14a1e28
RD
3919
3920class PropagateOnce(object):
27fb7603
RD
3921 """
3922 A helper class that will temporarily lower propagation level of an
3923 event. Simply create an instance of this class and then whe it is
3924 destroyed the propogation of the event will be restored.
3925 """
0085ce49
RD
3926 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3927 __repr__ = _swig_repr
3928 def __init__(self, *args, **kwargs):
27fb7603
RD
3929 """
3930 __init__(self, Event event) -> PropagateOnce
3931
3932 A helper class that will temporarily lower propagation level of an
3933 event. Simply create an instance of this class and then whe it is
3934 destroyed the propogation of the event will be restored.
3935 """
0085ce49
RD
3936 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3937 __swig_destroy__ = _core_.delete_PropagateOnce
3938 __del__ = lambda self : None;
3939PropagateOnce_swigregister = _core_.PropagateOnce_swigregister
3940PropagateOnce_swigregister(PropagateOnce)
d14a1e28
RD
3941
3942#---------------------------------------------------------------------------
3943
3944class CommandEvent(Event):
27fb7603
RD
3945 """
3946 This event class contains information about command events, which
3947 originate from a variety of simple controls, as well as menus and
3948 toolbars.
3949 """
0085ce49
RD
3950 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3951 __repr__ = _swig_repr
3952 def __init__(self, *args, **kwargs):
27fb7603
RD
3953 """
3954 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
3955
3956 This event class contains information about command events, which
3957 originate from a variety of simple controls, as well as menus and
3958 toolbars.
3959 """
0085ce49 3960 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
e811c8ce 3961 def GetSelection(*args, **kwargs):
27fb7603
RD
3962 """
3963 GetSelection(self) -> int
3964
3965 Returns item index for a listbox or choice selection event (not valid
3966 for a deselection).
3967 """
54f9ee45 3968 return _core_.CommandEvent_GetSelection(*args, **kwargs)
e811c8ce
RD
3969
3970 def SetString(*args, **kwargs):
a95a7133 3971 """SetString(self, String s)"""
54f9ee45 3972 return _core_.CommandEvent_SetString(*args, **kwargs)
e811c8ce
RD
3973
3974 def GetString(*args, **kwargs):
27fb7603
RD
3975 """
3976 GetString(self) -> String
3977
3978 Returns item string for a listbox or choice selection event (not valid
3979 for a deselection).
3980 """
54f9ee45 3981 return _core_.CommandEvent_GetString(*args, **kwargs)
e811c8ce
RD
3982
3983 def IsChecked(*args, **kwargs):
27fb7603
RD
3984 """
3985 IsChecked(self) -> bool
3986
3987 This method can be used with checkbox and menu events: for the
3988 checkboxes, the method returns true for a selection event and false
3989 for a deselection one. For the menu events, this method indicates if
3990 the menu item just has become checked or unchecked (and thus only
3991 makes sense for checkable menu items).
3992 """
54f9ee45 3993 return _core_.CommandEvent_IsChecked(*args, **kwargs)
e811c8ce 3994
242b7b46 3995 Checked = IsChecked
e811c8ce 3996 def IsSelection(*args, **kwargs):
27fb7603
RD
3997 """
3998 IsSelection(self) -> bool
3999
4000 For a listbox or similar event, returns true if it is a selection,
4001 false if it is a deselection.
4002 """
54f9ee45 4003 return _core_.CommandEvent_IsSelection(*args, **kwargs)
e811c8ce
RD
4004
4005 def SetExtraLong(*args, **kwargs):
a95a7133 4006 """SetExtraLong(self, long extraLong)"""
54f9ee45 4007 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
e811c8ce
RD
4008
4009 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4010 """
4011 GetExtraLong(self) -> long
4012
5ba5649b
RD
4013 Returns extra information dependant on the event objects type. If the
4014 event comes from a listbox selection, it is a boolean determining
4015 whether the event was a selection (true) or a deselection (false). A
4016 listbox deselection only occurs for multiple-selection boxes, and in
4017 this case the index and string values are indeterminate and the
4018 listbox must be examined by the application.
27fb7603 4019 """
54f9ee45 4020 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
e811c8ce
RD
4021
4022 def SetInt(*args, **kwargs):
a95a7133 4023 """SetInt(self, int i)"""
54f9ee45 4024 return _core_.CommandEvent_SetInt(*args, **kwargs)
e811c8ce
RD
4025
4026 def GetInt(*args, **kwargs):
27fb7603
RD
4027 """
4028 GetInt(self) -> long
4029
5ba5649b
RD
4030 Returns the integer identifier corresponding to a listbox, choice or
4031 radiobox selection (only if the event was a selection, not a
4032 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4033 """
54f9ee45 4034 return _core_.CommandEvent_GetInt(*args, **kwargs)
e811c8ce 4035
0085ce49
RD
4036 def GetClientData(*args, **kwargs):
4037 """
4038 GetClientData(self) -> PyObject
4039
4040 Returns the client data object for a listbox or choice selection event, (if any.)
4041 """
4042 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4043
4044 def SetClientData(*args, **kwargs):
4045 """
4046 SetClientData(self, PyObject clientData)
4047
4048 Associate the given client data with the item at position n.
4049 """
4050 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4051
4052 GetClientObject = GetClientData
4053 SetClientObject = SetClientData
4054
e811c8ce 4055 def Clone(*args, **kwargs):
a95a7133 4056 """Clone(self) -> Event"""
54f9ee45 4057 return _core_.CommandEvent_Clone(*args, **kwargs)
e811c8ce 4058
0085ce49
RD
4059CommandEvent_swigregister = _core_.CommandEvent_swigregister
4060CommandEvent_swigregister(CommandEvent)
d14a1e28
RD
4061
4062#---------------------------------------------------------------------------
4063
4064class NotifyEvent(CommandEvent):
27fb7603
RD
4065 """
4066 An instance of this class (or one of its derived classes) is sent from
4067 a control when the control's state is being changed and the control
4068 allows that change to be prevented from happening. The event handler
4069 can call `Veto` or `Allow` to tell the control what to do.
4070 """
0085ce49
RD
4071 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4072 __repr__ = _swig_repr
4073 def __init__(self, *args, **kwargs):
27fb7603
RD
4074 """
4075 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
4076
4077 An instance of this class (or one of its derived classes) is sent from
4078 a control when the control's state is being changed and the control
4079 allows that change to be prevented from happening. The event handler
4080 can call `Veto` or `Allow` to tell the control what to do.
4081 """
0085ce49 4082 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
e811c8ce 4083 def Veto(*args, **kwargs):
27fb7603
RD
4084 """
4085 Veto(self)
4086
4087 Prevents the change announced by this event from happening.
4088
4089 It is in general a good idea to notify the user about the reasons for
4090 vetoing the change because otherwise the applications behaviour (which
4091 just refuses to do what the user wants) might be quite surprising.
4092 """
54f9ee45 4093 return _core_.NotifyEvent_Veto(*args, **kwargs)
e811c8ce
RD
4094
4095 def Allow(*args, **kwargs):
27fb7603
RD
4096 """
4097 Allow(self)
4098
4099 This is the opposite of `Veto`: it explicitly allows the event to be
4100 processed. For most events it is not necessary to call this method as
4101 the events are allowed anyhow but some are forbidden by default (this
4102 will be mentioned in the corresponding event description).
4103 """
54f9ee45 4104 return _core_.NotifyEvent_Allow(*args, **kwargs)
e811c8ce
RD
4105
4106 def IsAllowed(*args, **kwargs):
27fb7603
RD
4107 """
4108 IsAllowed(self) -> bool
4109
4110 Returns true if the change is allowed (`Veto` hasn't been called) or
4111 false otherwise (if it was).
4112 """
54f9ee45 4113 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
e811c8ce 4114
0085ce49
RD
4115NotifyEvent_swigregister = _core_.NotifyEvent_swigregister
4116NotifyEvent_swigregister(NotifyEvent)
d14a1e28
RD
4117
4118#---------------------------------------------------------------------------
4119
4120class ScrollEvent(CommandEvent):
27fb7603
RD
4121 """
4122 A scroll event holds information about events sent from stand-alone
4123 scrollbars and sliders. Note that scrolled windows do not send
4124 instnaces of this event class, but send the `wx.ScrollWinEvent`
4125 instead.
4126 """
0085ce49
RD
4127 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4128 __repr__ = _swig_repr
4129 def __init__(self, *args, **kwargs):
0df68c9f 4130 """
a95a7133 4131 __init__(self, wxEventType commandType=wxEVT_NULL, int winid=0, int pos=0,
0df68c9f
RD
4132 int orient=0) -> ScrollEvent
4133 """
0085ce49 4134 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
e811c8ce 4135 def GetOrientation(*args, **kwargs):
27fb7603
RD
4136 """
4137 GetOrientation(self) -> int
4138
4139 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4140 the scrollbar.
4141 """
54f9ee45 4142 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4143
4144 def GetPosition(*args, **kwargs):
27fb7603
RD
4145 """
4146 GetPosition(self) -> int
4147
4148 Returns the position of the scrollbar.
4149 """
54f9ee45 4150 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4151
4152 def SetOrientation(*args, **kwargs):
a95a7133 4153 """SetOrientation(self, int orient)"""
54f9ee45 4154 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4155
4156 def SetPosition(*args, **kwargs):
a95a7133 4157 """SetPosition(self, int pos)"""
54f9ee45 4158 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
e811c8ce 4159
0085ce49
RD
4160ScrollEvent_swigregister = _core_.ScrollEvent_swigregister
4161ScrollEvent_swigregister(ScrollEvent)
d14a1e28
RD
4162
4163#---------------------------------------------------------------------------
4164
4165class ScrollWinEvent(Event):
27fb7603
RD
4166 """
4167 A wx.ScrollWinEvent holds information about scrolling and is sent from
4168 scrolling windows.
4169 """
0085ce49
RD
4170 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4171 __repr__ = _swig_repr
4172 def __init__(self, *args, **kwargs):
27fb7603
RD
4173 """
4174 __init__(self, wxEventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
4175
4176 A wx.ScrollWinEvent holds information about scrolling and is sent from
4177 scrolling windows.
4178 """
0085ce49 4179 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
e811c8ce 4180 def GetOrientation(*args, **kwargs):
27fb7603
RD
4181 """
4182 GetOrientation(self) -> int
4183
4184 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4185 the scrollbar.
4186 """
54f9ee45 4187 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4188
4189 def GetPosition(*args, **kwargs):
27fb7603
RD
4190 """
4191 GetPosition(self) -> int
4192
4193 Returns the position of the scrollbar for the thumb track and release
4194 events. Note that this field can't be used for the other events, you
4195 need to query the window itself for the current position in that case.
4196 """
54f9ee45 4197 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4198
4199 def SetOrientation(*args, **kwargs):
a95a7133 4200 """SetOrientation(self, int orient)"""
54f9ee45 4201 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4202
4203 def SetPosition(*args, **kwargs):
a95a7133 4204 """SetPosition(self, int pos)"""
54f9ee45 4205 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
e811c8ce 4206
0085ce49
RD
4207ScrollWinEvent_swigregister = _core_.ScrollWinEvent_swigregister
4208ScrollWinEvent_swigregister(ScrollWinEvent)
d14a1e28
RD
4209
4210#---------------------------------------------------------------------------
4211
54f9ee45
RD
4212MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4213MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4214MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4215MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4216MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
d14a1e28 4217class MouseEvent(Event):
27fb7603
RD
4218 """
4219 This event class contains information about the events generated by
4220 the mouse: they include mouse buttons press and release events and
4221 mouse move events.
4222
4223 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4224 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4225 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4226 a middle button so a portable application should avoid relying on the
4227 events from it.
4228
4229 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4230 the former returns true when the event corresponds to the left mouse
4231 button click while the latter returns true if the left mouse button is
4232 currently being pressed. For example, when the user is dragging the
4233 mouse you can use `LeftIsDown` to test whether the left mouse button
4234 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4235 `LeftIsDown` will also return true in wxWidgets whatever the
4236 underlying GUI behaviour is (which is platform-dependent). The same
4237 applies, of course, to other mouse buttons as well.
4238 """
0085ce49
RD
4239 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4240 __repr__ = _swig_repr
4241 def __init__(self, *args, **kwargs):
27fb7603
RD
4242 """
4243 __init__(self, wxEventType mouseType=wxEVT_NULL) -> MouseEvent
4244
4245 Constructs a wx.MouseEvent. Valid event types are:
4246
4247 * wxEVT_ENTER_WINDOW
4248 * wxEVT_LEAVE_WINDOW
4249 * wxEVT_LEFT_DOWN
4250 * wxEVT_LEFT_UP
4251 * wxEVT_LEFT_DCLICK
4252 * wxEVT_MIDDLE_DOWN
4253 * wxEVT_MIDDLE_UP
4254 * wxEVT_MIDDLE_DCLICK
4255 * wxEVT_RIGHT_DOWN
4256 * wxEVT_RIGHT_UP
4257 * wxEVT_RIGHT_DCLICK
4258 * wxEVT_MOTION
4259 * wxEVT_MOUSEWHEEL
4260 """
0085ce49 4261 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
e811c8ce 4262 def IsButton(*args, **kwargs):
27fb7603
RD
4263 """
4264 IsButton(self) -> bool
4265
4266 Returns true if the event was a mouse button event (not necessarily a
4267 button down event - that may be tested using `ButtonDown`).
4268 """
54f9ee45 4269 return _core_.MouseEvent_IsButton(*args, **kwargs)
e811c8ce
RD
4270
4271 def ButtonDown(*args, **kwargs):
27fb7603
RD
4272 """
4273 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4274
5ba5649b
RD
4275 If the argument is omitted, this returns true if the event was any
4276 mouse button down event. Otherwise the argument specifies which
4277 button-down event shold be checked for (see `Button` for the possible
4278 values).
27fb7603 4279 """
54f9ee45 4280 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
e811c8ce
RD
4281
4282 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4283 """
4284 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4285
4286 If the argument is omitted, this returns true if the event was any
4287 mouse double click event. Otherwise the argument specifies which
4288 double click event to check for (see `Button` for the possible
4289 values).
4290 """
54f9ee45 4291 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
e811c8ce
RD
4292
4293 def ButtonUp(*args, **kwargs):
27fb7603
RD
4294 """
4295 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4296
4297 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4298 mouse button up event. Otherwise the argument specifies which button
4299 up event to check for (see `Button` for the possible values).
27fb7603 4300 """
54f9ee45 4301 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
e811c8ce
RD
4302
4303 def Button(*args, **kwargs):
27fb7603
RD
4304 """
4305 Button(self, int button) -> bool
4306
4307 Returns true if the identified mouse button is changing state. Valid
4308 values of button are:
4309
4310 ==================== =====================================
4311 wx.MOUSE_BTN_LEFT check if left button was pressed
4312 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4313 wx.MOUSE_BTN_RIGHT check if right button was pressed
4314 wx.MOUSE_BTN_ANY check if any button was pressed
4315 ==================== =====================================
4316
4317 """
54f9ee45 4318 return _core_.MouseEvent_Button(*args, **kwargs)
e811c8ce
RD
4319
4320 def ButtonIsDown(*args, **kwargs):
a95a7133 4321 """ButtonIsDown(self, int but) -> bool"""
54f9ee45 4322 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
e811c8ce
RD
4323
4324 def GetButton(*args, **kwargs):
27fb7603
RD
4325 """
4326 GetButton(self) -> int
4327
4328 Returns the mouse button which generated this event or
4329 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4330 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4331 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4332 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4333 right buttons respectively.
4334 """
54f9ee45 4335 return _core_.MouseEvent_GetButton(*args, **kwargs)
e811c8ce
RD
4336
4337 def ControlDown(*args, **kwargs):
27fb7603
RD
4338 """
4339 ControlDown(self) -> bool
4340
4341 Returns true if the control key was down at the time of the event.
4342 """
54f9ee45 4343 return _core_.MouseEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
4344
4345 def MetaDown(*args, **kwargs):
27fb7603
RD
4346 """
4347 MetaDown(self) -> bool
4348
4349 Returns true if the Meta key was down at the time of the event.
4350 """
54f9ee45 4351 return _core_.MouseEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
4352
4353 def AltDown(*args, **kwargs):
27fb7603
RD
4354 """
4355 AltDown(self) -> bool
4356
4357 Returns true if the Alt key was down at the time of the event.
4358 """
54f9ee45 4359 return _core_.MouseEvent_AltDown(*args, **kwargs)
e811c8ce
RD
4360
4361 def ShiftDown(*args, **kwargs):
27fb7603
RD
4362 """
4363 ShiftDown(self) -> bool
4364
4365 Returns true if the Shift key was down at the time of the event.
4366 """
54f9ee45 4367 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
e811c8ce 4368
412d302d
RD
4369 def CmdDown(*args, **kwargs):
4370 """
4371 CmdDown(self) -> bool
4372
4373 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4374 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4375 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4376 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4377 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4378 purpose. So for non-Mac platforms this is the same as `ControlDown`
4379 and Macs this is the same as `MetaDown`.
4380 """
4381 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4382
e811c8ce 4383 def LeftDown(*args, **kwargs):
27fb7603
RD
4384 """
4385 LeftDown(self) -> bool
4386
4387 Returns true if the left mouse button state changed to down.
4388 """
54f9ee45 4389 return _core_.MouseEvent_LeftDown(*args, **kwargs)
e811c8ce
RD
4390
4391 def MiddleDown(*args, **kwargs):
27fb7603
RD
4392 """
4393 MiddleDown(self) -> bool
4394
4395 Returns true if the middle mouse button state changed to down.
4396 """
54f9ee45 4397 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
e811c8ce
RD
4398
4399 def RightDown(*args, **kwargs):
27fb7603
RD
4400 """
4401 RightDown(self) -> bool
4402
4403 Returns true if the right mouse button state changed to down.
4404 """
54f9ee45 4405 return _core_.MouseEvent_RightDown(*args, **kwargs)
e811c8ce
RD
4406
4407 def LeftUp(*args, **kwargs):
27fb7603
RD
4408 """
4409 LeftUp(self) -> bool
4410
4411 Returns true if the left mouse button state changed to up.
4412 """
54f9ee45 4413 return _core_.MouseEvent_LeftUp(*args, **kwargs)
e811c8ce
RD
4414
4415 def MiddleUp(*args, **kwargs):
27fb7603
RD
4416 """
4417 MiddleUp(self) -> bool
4418
4419 Returns true if the middle mouse button state changed to up.
4420 """
54f9ee45 4421 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
e811c8ce
RD
4422
4423 def RightUp(*args, **kwargs):
27fb7603
RD
4424 """
4425 RightUp(self) -> bool
4426
4427 Returns true if the right mouse button state changed to up.
4428 """
54f9ee45 4429 return _core_.MouseEvent_RightUp(*args, **kwargs)
e811c8ce
RD
4430
4431 def LeftDClick(*args, **kwargs):
27fb7603
RD
4432 """
4433 LeftDClick(self) -> bool
4434
4435 Returns true if the event was a left button double click.
4436 """
54f9ee45 4437 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
e811c8ce
RD
4438
4439 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4440 """
4441 MiddleDClick(self) -> bool
4442
4443 Returns true if the event was a middle button double click.
4444 """
54f9ee45 4445 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
e811c8ce
RD
4446
4447 def RightDClick(*args, **kwargs):
27fb7603
RD
4448 """
4449 RightDClick(self) -> bool
4450
4451 Returns true if the event was a right button double click.
4452 """
54f9ee45 4453 return _core_.MouseEvent_RightDClick(*args, **kwargs)
e811c8ce
RD
4454
4455 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4456 """
4457 LeftIsDown(self) -> bool
4458
4459 Returns true if the left mouse button is currently down, independent
4460 of the current event type.
4461
4462 Please notice that it is not the same as LeftDown which returns true
4463 if the left mouse button was just pressed. Rather, it describes the
4464 state of the mouse button before the event happened.
4465
4466 This event is usually used in the mouse event handlers which process
4467 "move mouse" messages to determine whether the user is (still)
4468 dragging the mouse.
4469 """
54f9ee45 4470 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
e811c8ce
RD
4471
4472 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4473 """
4474 MiddleIsDown(self) -> bool
4475
4476 Returns true if the middle mouse button is currently down, independent
4477 of the current event type.
4478 """
54f9ee45 4479 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
e811c8ce
RD
4480
4481 def RightIsDown(*args, **kwargs):
27fb7603
RD
4482 """
4483 RightIsDown(self) -> bool
4484
4485 Returns true if the right mouse button is currently down, independent
4486 of the current event type.
4487 """
54f9ee45 4488 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
e811c8ce
RD
4489
4490 def Dragging(*args, **kwargs):
27fb7603
RD
4491 """
4492 Dragging(self) -> bool
4493
4494 Returns true if this was a dragging event (motion while a button is
4495 depressed).
4496 """
54f9ee45 4497 return _core_.MouseEvent_Dragging(*args, **kwargs)
e811c8ce
RD
4498
4499 def Moving(*args, **kwargs):
27fb7603
RD
4500 """
4501 Moving(self) -> bool
4502
4503 Returns true if this was a motion event and no mouse buttons were
4504 pressed. If any mouse button is held pressed, then this method returns
4505 false and Dragging returns true.
4506 """
54f9ee45 4507 return _core_.MouseEvent_Moving(*args, **kwargs)
e811c8ce
RD
4508
4509 def Entering(*args, **kwargs):
27fb7603
RD
4510 """
4511 Entering(self) -> bool
4512
4513 Returns true if the mouse was entering the window.
4514 """
54f9ee45 4515 return _core_.MouseEvent_Entering(*args, **kwargs)
e811c8ce
RD
4516
4517 def Leaving(*args, **kwargs):
27fb7603
RD
4518 """
4519 Leaving(self) -> bool
4520
4521 Returns true if the mouse was leaving the window.
4522 """
54f9ee45 4523 return _core_.MouseEvent_Leaving(*args, **kwargs)
e811c8ce
RD
4524
4525 def GetPosition(*args, **kwargs):
0df68c9f 4526 """
a95a7133 4527 GetPosition(self) -> Point
e811c8ce 4528
27fb7603
RD
4529 Returns the pixel position of the mouse in window coordinates when the
4530 event happened.
0df68c9f 4531 """
54f9ee45 4532 return _core_.MouseEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4533
4534 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
4535 """
4536 GetPositionTuple() -> (x,y)
e811c8ce 4537
27fb7603
RD
4538 Returns the pixel position of the mouse in window coordinates when the
4539 event happened.
0df68c9f 4540 """
54f9ee45 4541 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
4542
4543 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4544 """
4545 GetLogicalPosition(self, DC dc) -> Point
4546
4547 Returns the logical mouse position in pixels (i.e. translated
4548 according to the translation set for the DC, which usually indicates
4549 that the window has been scrolled).
4550 """
54f9ee45 4551 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
e811c8ce
RD
4552
4553 def GetX(*args, **kwargs):
27fb7603
RD
4554 """
4555 GetX(self) -> int
4556
4557 Returns X coordinate of the physical mouse event position.
4558 """
54f9ee45 4559 return _core_.MouseEvent_GetX(*args, **kwargs)
e811c8ce
RD
4560
4561 def GetY(*args, **kwargs):
27fb7603
RD
4562 """
4563 GetY(self) -> int
4564
4565 Returns Y coordinate of the physical mouse event position.
4566 """
54f9ee45 4567 return _core_.MouseEvent_GetY(*args, **kwargs)
e811c8ce
RD
4568
4569 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4570 """
4571 GetWheelRotation(self) -> int
4572
4573 Get wheel rotation, positive or negative indicates direction of
4574 rotation. Current devices all send an event when rotation is equal to
4575 +/-WheelDelta, but this allows for finer resolution devices to be
4576 created in the future. Because of this you shouldn't assume that one
4577 event is equal to 1 line or whatever, but you should be able to either
4578 do partial line scrolling or wait until +/-WheelDelta rotation values
4579 have been accumulated before scrolling.
4580 """
54f9ee45 4581 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
e811c8ce
RD
4582
4583 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4584 """
4585 GetWheelDelta(self) -> int
4586
4587 Get wheel delta, normally 120. This is the threshold for action to be
4588 taken, and one such action (for example, scrolling one increment)
4589 should occur for each delta.
4590 """
54f9ee45 4591 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
e811c8ce
RD
4592
4593 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4594 """
4595 GetLinesPerAction(self) -> int
4596
4597 Returns the configured number of lines (or whatever) to be scrolled
4598 per wheel action. Defaults to three.
4599 """
54f9ee45 4600 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
e811c8ce
RD
4601
4602 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4603 """
4604 IsPageScroll(self) -> bool
4605
4606 Returns true if the system has been setup to do page scrolling with
4607 the mouse wheel instead of line scrolling.
4608 """
54f9ee45
RD
4609 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4610
4611 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4612 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4613 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4614 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4615 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4616 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4617 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4618 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4619 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4620 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4621 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4622 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
0085ce49
RD
4623MouseEvent_swigregister = _core_.MouseEvent_swigregister
4624MouseEvent_swigregister(MouseEvent)
d14a1e28
RD
4625
4626#---------------------------------------------------------------------------
4627
4628class SetCursorEvent(Event):
5ba5649b
RD
4629 """
4630 A SetCursorEvent is generated when the mouse cursor is about to be set
4631 as a result of mouse motion. This event gives the application the
4632 chance to perform specific mouse cursor processing based on the
4633 current position of the mouse within the window. Use the `SetCursor`
4634 method to specify the cursor you want to be displayed.
4635 """
0085ce49
RD
4636 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4637 __repr__ = _swig_repr
4638 def __init__(self, *args, **kwargs):
5ba5649b
RD
4639 """
4640 __init__(self, int x=0, int y=0) -> SetCursorEvent
4641
4642 Construct a new `wx.SetCursorEvent`.
4643 """
0085ce49 4644 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
e811c8ce 4645 def GetX(*args, **kwargs):
5ba5649b
RD
4646 """
4647 GetX(self) -> int
4648
4649 Returns the X coordinate of the mouse in client coordinates.
4650 """
54f9ee45 4651 return _core_.SetCursorEvent_GetX(*args, **kwargs)
e811c8ce
RD
4652
4653 def GetY(*args, **kwargs):
5ba5649b
RD
4654 """
4655 GetY(self) -> int
4656
4657 Returns the Y coordinate of the mouse in client coordinates.
4658 """
54f9ee45 4659 return _core_.SetCursorEvent_GetY(*args, **kwargs)
e811c8ce
RD
4660
4661 def SetCursor(*args, **kwargs):
5ba5649b
RD
4662 """
4663 SetCursor(self, Cursor cursor)
4664
4665 Sets the cursor associated with this event.
4666 """
54f9ee45 4667 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
e811c8ce
RD
4668
4669 def GetCursor(*args, **kwargs):
5ba5649b
RD
4670 """
4671 GetCursor(self) -> Cursor
4672
4673 Returns a reference to the cursor specified by this event.
4674 """
54f9ee45 4675 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
e811c8ce
RD
4676
4677 def HasCursor(*args, **kwargs):
5ba5649b
RD
4678 """
4679 HasCursor(self) -> bool
4680
4681 Returns true if the cursor specified by this event is a valid cursor.
4682 """
54f9ee45 4683 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
e811c8ce 4684
0085ce49
RD
4685SetCursorEvent_swigregister = _core_.SetCursorEvent_swigregister
4686SetCursorEvent_swigregister(SetCursorEvent)
d14a1e28
RD
4687
4688#---------------------------------------------------------------------------
4689
4690class KeyEvent(Event):
5ba5649b
RD
4691 """
4692 This event class contains information about keypress and character
4693 events. These events are only sent to the widget that currently has
4694 the keyboard focus.
4695
4696 Notice that there are three different kinds of keyboard events in
4697 wxWidgets: key down and up events and char events. The difference
4698 between the first two is clear - the first corresponds to a key press
4699 and the second to a key release - otherwise they are identical. Just
4700 note that if the key is maintained in a pressed state you will
4701 typically get a lot of (automatically generated) down events but only
4702 one up so it is wrong to assume that there is one up event
4703 corresponding to each down one.
4704
4705 Both key events provide untranslated key codes while the char event
4706 carries the translated one. The untranslated code for alphanumeric
4707 keys is always an upper case value. For the other keys it is one of
4708 WXK_XXX values from the keycodes table. The translated key is, in
4709 general, the character the user expects to appear as the result of the
4710 key combination when typing the text into a text entry zone, for
4711 example.
4712
4713 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4714 and the standard US keyboard): when the 'A' key is pressed, the key
4715 down event key code is equal to ASCII A == 65. But the char event key
4716 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4717 'A' keys simultaneously , the key code in key down event will still be
4718 just 'A' while the char event key code parameter will now be 'A' as
4719 well.
4720
4721 Although in this simple case it is clear that the correct key code
4722 could be found in the key down event handler by checking the value
4723 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4724 as for non alphanumeric keys or non-US keyboard layouts the
4725 translation is keyboard-layout dependent and can only be done properly
4726 by the system itself.
4727
4728 Another kind of translation is done when the control key is pressed:
4729 for example, for CTRL-A key press the key down event still carries the
4730 same key code 'A' as usual but the char event will have key code of 1,
4731 the ASCII value of this key combination.
4732
4733 You may discover how the other keys on your system behave
4734 interactively by running the KeyEvents sample in the wxPython demo and
4735 pressing some keys while the blue box at the top has the keyboard
4736 focus.
4737
4738 **Note**: If a key down event is caught and the event handler does not
4739 call event.Skip() then the coresponding char event will not
4740 happen. This is by design and enables the programs that handle both
4741 types of events to be a bit simpler.
4742
4743 **Note for Windows programmers**: The key and char events in wxWidgets
4744 are similar to but slightly different from Windows WM_KEYDOWN and
4745 WM_CHAR events. In particular, Alt-x combination will generate a char
4746 event in wxWidgets (unless it is used as an accelerator).
4747
4748 **Tip**: be sure to call event.Skip() for events that you don't
4749 process in key event function, otherwise menu shortcuts may cease to
4750 work under Windows.
4751
4752 """
0085ce49
RD
4753 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4754 __repr__ = _swig_repr
4755 def __init__(self, *args, **kwargs):
5ba5649b
RD
4756 """
4757 __init__(self, wxEventType eventType=wxEVT_NULL) -> KeyEvent
4758
4759 Construct a new `wx.KeyEvent`. Valid event types are:
4760 *
4761 """
0085ce49 4762 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
4763 def GetModifiers(*args, **kwargs):
4764 """
4765 GetModifiers(self) -> int
4766
4767 Returns a bitmask of the current modifier settings. Can be used to
4768 check if the key event has exactly the given modifiers without having
4769 to explicitly check that the other modifiers are not down. For
4770 example::
4771
4772 if event.GetModifers() == wx.MOD_CONTROL:
4773 DoSomething()
4774
4775 """
4776 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4777
e811c8ce 4778 def ControlDown(*args, **kwargs):
5ba5649b
RD
4779 """
4780 ControlDown(self) -> bool
4781
4782 Returns ``True`` if the Control key was down at the time of the event.
4783 """
54f9ee45 4784 return _core_.KeyEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
4785
4786 def MetaDown(*args, **kwargs):
5ba5649b
RD
4787 """
4788 MetaDown(self) -> bool
4789
4790 Returns ``True`` if the Meta key was down at the time of the event.
4791 """
54f9ee45 4792 return _core_.KeyEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
4793
4794 def AltDown(*args, **kwargs):
5ba5649b
RD
4795 """
4796 AltDown(self) -> bool
4797
4798 Returns ``True`` if the Alt key was down at the time of the event.
4799 """
54f9ee45 4800 return _core_.KeyEvent_AltDown(*args, **kwargs)
e811c8ce
RD
4801
4802 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4803 """
4804 ShiftDown(self) -> bool
4805
4806 Returns ``True`` if the Shift key was down at the time of the event.
4807 """
54f9ee45 4808 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
e811c8ce 4809
412d302d
RD
4810 def CmdDown(*args, **kwargs):
4811 """
4812 CmdDown(self) -> bool
4813
4814 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4815 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4816 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
4817 because Cmd key is used for the same thing under Mac as Ctrl
4818 elsewhere. The Ctrl still exists, it's just not used for this
4819 purpose. So for non-Mac platforms this is the same as `ControlDown`
4820 and Macs this is the same as `MetaDown`.
4821 """
4822 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4823
e811c8ce 4824 def HasModifiers(*args, **kwargs):
5ba5649b
RD
4825 """
4826 HasModifiers(self) -> bool
4827
4828 Returns true if either CTRL or ALT keys was down at the time of the
4829 key event. Note that this function does not take into account neither
4830 SHIFT nor META key states (the reason for ignoring the latter is that
4831 it is common for NUMLOCK key to be configured as META under X but the
4832 key presses even while NUMLOCK is on should be still processed
4833 normally).
4834 """
54f9ee45 4835 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
e811c8ce
RD
4836
4837 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
4838 """
4839 GetKeyCode(self) -> int
4840
4841 Returns the virtual key code. ASCII events return normal ASCII values,
4842 while non-ASCII events return values such as WXK_LEFT for the left
4843 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4844 codes.
4845
4846 Note that in Unicode build, the returned value is meaningful only if
4847 the user entered a character that can be represented in current
4848 locale's default charset. You can obtain the corresponding Unicode
4849 character using `GetUnicodeKey`.
4850 """
54f9ee45 4851 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
e811c8ce 4852
d14a1e28 4853 KeyCode = GetKeyCode
19272049 4854 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
4855 """
4856 GetUnicodeKey(self) -> int
4857
4858 Returns the Unicode character corresponding to this key event. This
4859 function is only meaningfule in a Unicode build of wxPython.
4860 """
19272049 4861 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
e811c8ce 4862
19272049 4863 GetUniChar = GetUnicodeKey
e811c8ce 4864 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
4865 """
4866 GetRawKeyCode(self) -> unsigned int
4867
4868 Returns the raw key code for this event. This is a platform-dependent
4869 scan code which should only be used in advanced
4870 applications. Currently the raw key codes are not supported by all
4871 ports.
4872 """
54f9ee45 4873 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
e811c8ce
RD
4874
4875 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
4876 """
4877 GetRawKeyFlags(self) -> unsigned int
4878
4879 Returns the low level key flags for this event. The flags are
4880 platform-dependent and should only be used in advanced applications.
4881 Currently the raw key flags are not supported by all ports.
4882 """
54f9ee45 4883 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
e811c8ce
RD
4884
4885 def GetPosition(*args, **kwargs):
0df68c9f 4886 """
a95a7133 4887 GetPosition(self) -> Point
e811c8ce 4888
5ba5649b 4889 Find the position of the event, if applicable.
0df68c9f 4890 """
54f9ee45 4891 return _core_.KeyEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4892
4893 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
4894 """
4895 GetPositionTuple() -> (x,y)
e811c8ce 4896
5ba5649b 4897 Find the position of the event, if applicable.
0df68c9f 4898 """
54f9ee45 4899 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
4900
4901 def GetX(*args, **kwargs):
5ba5649b
RD
4902 """
4903 GetX(self) -> int
4904
4905 Returns the X position (in client coordinates) of the event, if
4906 applicable.
4907 """
54f9ee45 4908 return _core_.KeyEvent_GetX(*args, **kwargs)
e811c8ce
RD
4909
4910 def GetY(*args, **kwargs):
5ba5649b
RD
4911 """
4912 GetY(self) -> int
4913
4914 Returns the Y position (in client coordinates) of the event, if
4915 applicable.
4916 """
54f9ee45
RD
4917 return _core_.KeyEvent_GetY(*args, **kwargs)
4918
4919 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4920 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4921 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4922 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4923 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4924 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4925 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4926 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4927 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4928 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
0085ce49
RD
4929KeyEvent_swigregister = _core_.KeyEvent_swigregister
4930KeyEvent_swigregister(KeyEvent)
d14a1e28
RD
4931
4932#---------------------------------------------------------------------------
4933
4934class SizeEvent(Event):
5ba5649b
RD
4935 """
4936 A size event holds information about size change events. The EVT_SIZE
4937 handler function will be called when the window it is bound to has
4938 been resized.
4939
4940 Note that the size passed is of the whole window: call
4941 `wx.Window.GetClientSize` for the area which may be used by the
4942 application.
4943
4944 When a window is resized, usually only a small part of the window is
4945 damaged and and that area is all that is in the update region for the
4946 next paint event. However, if your drawing depends on the size of the
4947 window, you may need to clear the DC explicitly and repaint the whole
4948 window. In which case, you may need to call `wx.Window.Refresh` to
4949 invalidate the entire window.
4950
4951 """
0085ce49
RD
4952 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4953 __repr__ = _swig_repr
4954 def __init__(self, *args, **kwargs):
5ba5649b
RD
4955 """
4956 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4957
4958 Construct a new ``wx.SizeEvent``.
4959 """
0085ce49 4960 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
e811c8ce 4961 def GetSize(*args, **kwargs):
5ba5649b
RD
4962 """
4963 GetSize(self) -> Size
4964
4965 Returns the entire size of the window generating the size change
4966 event.
4967 """
54f9ee45 4968 return _core_.SizeEvent_GetSize(*args, **kwargs)
e811c8ce
RD
4969
4970 def GetRect(*args, **kwargs):
a95a7133 4971 """GetRect(self) -> Rect"""
54f9ee45 4972 return _core_.SizeEvent_GetRect(*args, **kwargs)
e811c8ce
RD
4973
4974 def SetRect(*args, **kwargs):
a95a7133 4975 """SetRect(self, Rect rect)"""
54f9ee45 4976 return _core_.SizeEvent_SetRect(*args, **kwargs)
e811c8ce
RD
4977
4978 def SetSize(*args, **kwargs):
a95a7133 4979 """SetSize(self, Size size)"""
54f9ee45 4980 return _core_.SizeEvent_SetSize(*args, **kwargs)
e811c8ce 4981
54f9ee45
RD
4982 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4983 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
0085ce49
RD
4984SizeEvent_swigregister = _core_.SizeEvent_swigregister
4985SizeEvent_swigregister(SizeEvent)
d14a1e28
RD
4986
4987#---------------------------------------------------------------------------
4988
4989class MoveEvent(Event):
5ba5649b
RD
4990 """
4991 This event object is sent for EVT_MOVE event bindings when a window is
4992 moved to a new position.
4993 """
0085ce49
RD
4994 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4995 __repr__ = _swig_repr
4996 def __init__(self, *args, **kwargs):
5ba5649b
RD
4997 """
4998 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
4999
5000 Constructor.
5001 """
0085ce49 5002 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
e811c8ce 5003 def GetPosition(*args, **kwargs):
5ba5649b
RD
5004 """
5005 GetPosition(self) -> Point
5006
5007 Returns the position of the window generating the move change event.
5008 """
54f9ee45 5009 return _core_.MoveEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5010
5011 def GetRect(*args, **kwargs):
a95a7133 5012 """GetRect(self) -> Rect"""
54f9ee45 5013 return _core_.MoveEvent_GetRect(*args, **kwargs)
e811c8ce
RD
5014
5015 def SetRect(*args, **kwargs):
a95a7133 5016 """SetRect(self, Rect rect)"""
54f9ee45 5017 return _core_.MoveEvent_SetRect(*args, **kwargs)
e811c8ce
RD
5018
5019 def SetPosition(*args, **kwargs):
a95a7133 5020 """SetPosition(self, Point pos)"""
54f9ee45 5021 return _core_.MoveEvent_SetPosition(*args, **kwargs)
e811c8ce 5022
7557b9b5
RD
5023 m_pos = property(GetPosition, SetPosition)
5024 m_rect = property(GetRect, SetRect)
5025
0085ce49
RD
5026MoveEvent_swigregister = _core_.MoveEvent_swigregister
5027MoveEvent_swigregister(MoveEvent)
d14a1e28
RD
5028
5029#---------------------------------------------------------------------------
5030
5031class PaintEvent(Event):
5ba5649b
RD
5032 """
5033 A paint event is sent when a window's contents needs to be repainted.
5034 Note that in an EVT_PAINT handler the application must *always* create
5035 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5036 Windows assumes that the window has not been painted yet and will send
5037 the event again, causing endless refreshes.
5038
5039 You can optimize painting by retrieving the rectangles that have been
5040 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5041 and only repainting these rectangles. The rectangles are in terms of
5042 the client area, and are unscrolled, so you will need to do some
5043 calculations using the current view position to obtain logical,
5044 scrolled units.
5045
5046 """
0085ce49
RD
5047 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5048 __repr__ = _swig_repr
5049 def __init__(self, *args, **kwargs):
a95a7133 5050 """__init__(self, int Id=0) -> PaintEvent"""
0085ce49
RD
5051 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
5052PaintEvent_swigregister = _core_.PaintEvent_swigregister
5053PaintEvent_swigregister(PaintEvent)
d14a1e28
RD
5054
5055class NcPaintEvent(Event):
093d3ff1 5056 """Proxy of C++ NcPaintEvent class"""
0085ce49
RD
5057 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5058 __repr__ = _swig_repr
5059 def __init__(self, *args, **kwargs):
a95a7133 5060 """__init__(self, int winid=0) -> NcPaintEvent"""
0085ce49
RD
5061 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
5062NcPaintEvent_swigregister = _core_.NcPaintEvent_swigregister
5063NcPaintEvent_swigregister(NcPaintEvent)
d14a1e28
RD
5064
5065#---------------------------------------------------------------------------
5066
5067class EraseEvent(Event):
5ba5649b
RD
5068 """
5069 An erase event is sent whenever the background of a window needs to be
5070 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5071 binder. On some platforms, such as GTK+, this event is simulated
5072 (simply generated just before the paint event) and may cause flicker.
5073
5074 To paint a custom background use the `GetDC` method and use the returned
5075 device context if it is not ``None``, otherwise create a temporary
5076 `wx.ClientDC` and draw on that.
5077
5078 """
0085ce49
RD
5079 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5080 __repr__ = _swig_repr
5081 def __init__(self, *args, **kwargs):
5ba5649b
RD
5082 """
5083 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5084
5085 Constructor
5086 """
0085ce49 5087 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
e811c8ce 5088 def GetDC(*args, **kwargs):
5ba5649b
RD
5089 """
5090 GetDC(self) -> DC
5091
5092 Returns the device context the event handler should draw upon. If
5093 ``None`` is returned then create a temporary `wx.ClientDC` and use
5094 that instead.
5095 """
54f9ee45 5096 return _core_.EraseEvent_GetDC(*args, **kwargs)
e811c8ce 5097
0085ce49
RD
5098EraseEvent_swigregister = _core_.EraseEvent_swigregister
5099EraseEvent_swigregister(EraseEvent)
d14a1e28
RD
5100
5101#---------------------------------------------------------------------------
5102
5103class FocusEvent(Event):
5ba5649b
RD
5104 """
5105 A focus event is sent when a window's focus changes. The window losing
5106 focus receives an EVT_KILL_FOCUS event while the window gaining it
5107 gets an EVT_SET_FOCUS event.
5108
5109 Notice that the set focus event happens both when the user gives focus
5110 to the window (whether using the mouse or keyboard) and when it is
5111 done from the program itself using `wx.Window.SetFocus`.
5112
5113 """
0085ce49
RD
5114 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5115 __repr__ = _swig_repr
5116 def __init__(self, *args, **kwargs):
5ba5649b
RD
5117 """
5118 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5119
5120 Constructor
5121 """
0085ce49 5122 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
e811c8ce 5123 def GetWindow(*args, **kwargs):
5ba5649b
RD
5124 """
5125 GetWindow(self) -> Window
5126
5127 Returns the other window associated with this event, that is the
5128 window which had the focus before for the EVT_SET_FOCUS event and the
5129 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5130
5131 Warning: the window returned may be None!
5132 """
54f9ee45 5133 return _core_.FocusEvent_GetWindow(*args, **kwargs)
e811c8ce
RD
5134
5135 def SetWindow(*args, **kwargs):
a95a7133 5136 """SetWindow(self, Window win)"""
54f9ee45 5137 return _core_.FocusEvent_SetWindow(*args, **kwargs)
e811c8ce 5138
0085ce49
RD
5139FocusEvent_swigregister = _core_.FocusEvent_swigregister
5140FocusEvent_swigregister(FocusEvent)
d14a1e28
RD
5141
5142#---------------------------------------------------------------------------
5143
5144class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5145 """
5146 wx.ChildFocusEvent notifies the parent that a child has received the
5147 focus. Unlike `wx.FocusEvent` it is propagated up the window
5148 heirarchy.
5149 """
0085ce49
RD
5150 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5151 __repr__ = _swig_repr
5152 def __init__(self, *args, **kwargs):
5ba5649b
RD
5153 """
5154 __init__(self, Window win=None) -> ChildFocusEvent
5155
5156 Constructor
5157 """
0085ce49 5158 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
e811c8ce 5159 def GetWindow(*args, **kwargs):
5ba5649b
RD
5160 """
5161 GetWindow(self) -> Window
5162
5163 The window which has just received the focus.
5164 """
54f9ee45 5165 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
e811c8ce 5166
0085ce49
RD
5167ChildFocusEvent_swigregister = _core_.ChildFocusEvent_swigregister
5168ChildFocusEvent_swigregister(ChildFocusEvent)
d14a1e28
RD
5169
5170#---------------------------------------------------------------------------
5171
5172class ActivateEvent(Event):
5ba5649b
RD
5173 """
5174 An activate event is sent when a top-level window or the entire
5175 application is being activated or deactivated.
5176
5177 A top-level window (a dialog or frame) receives an activate event when
5178 is being activated or deactivated. This is indicated visually by the
5179 title bar changing colour, and a subwindow gaining the keyboard focus.
5180 An application is activated or deactivated when one of its frames
5181 becomes activated, or a frame becomes inactivate resulting in all
5182 application frames being inactive.
5183
5184 Please note that usually you should call event.Skip() in your handlers
5185 for these events so the default handlers will still be called, as not
5186 doing so can result in strange effects.
5187
5188 """
0085ce49
RD
5189 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5190 __repr__ = _swig_repr
5191 def __init__(self, *args, **kwargs):
5ba5649b
RD
5192 """
5193 __init__(self, wxEventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5194
5195 Constructor
5196 """
0085ce49 5197 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
e811c8ce 5198 def GetActive(*args, **kwargs):
5ba5649b
RD
5199 """
5200 GetActive(self) -> bool
5201
5202 Returns true if the application or window is being activated, false
5203 otherwise.
5204 """
54f9ee45 5205 return _core_.ActivateEvent_GetActive(*args, **kwargs)
e811c8ce 5206
0085ce49
RD
5207ActivateEvent_swigregister = _core_.ActivateEvent_swigregister
5208ActivateEvent_swigregister(ActivateEvent)
d14a1e28
RD
5209
5210#---------------------------------------------------------------------------
5211
5212class InitDialogEvent(Event):
5ba5649b
RD
5213 """
5214 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5215 any window when `wx.Window.InitDialog` is called. Handlers for this
5216 event can transfer data to the window, or anything else that should be
5217 done before the user begins editing the form. The default handler
5218 calls `wx.Window.TransferDataToWindow`.
5219 """
0085ce49
RD
5220 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5221 __repr__ = _swig_repr
5222 def __init__(self, *args, **kwargs):
5ba5649b
RD
5223 """
5224 __init__(self, int Id=0) -> InitDialogEvent
5225
5226 Constructor
5227 """
0085ce49
RD
5228 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
5229InitDialogEvent_swigregister = _core_.InitDialogEvent_swigregister
5230InitDialogEvent_swigregister(InitDialogEvent)
d14a1e28
RD
5231
5232#---------------------------------------------------------------------------
5233
5234class MenuEvent(Event):
5ba5649b
RD
5235 """
5236 This class is used for a variety of menu-related events. Note that
5237 these do not include menu command events, which are handled by sending
5238 `wx.CommandEvent` objects.
5239
5240 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5241 text in the first field of the status bar.
5242 """
0085ce49
RD
5243 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5244 __repr__ = _swig_repr
5245 def __init__(self, *args, **kwargs):
5ba5649b
RD
5246 """
5247 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5248
5249 Constructor
5250 """
0085ce49 5251 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
e811c8ce 5252 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5253 """
5254 GetMenuId(self) -> int
5255
5256 Returns the menu identifier associated with the event. This method
5257 should be only used with the HIGHLIGHT events.
5258 """
54f9ee45 5259 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
e811c8ce
RD
5260
5261 def IsPopup(*args, **kwargs):
5ba5649b
RD
5262 """
5263 IsPopup(self) -> bool
5264
5265 Returns ``True`` if the menu which is being opened or closed is a
5266 popup menu, ``False`` if it is a normal one. This method should only
5267 be used with the OPEN and CLOSE events.
5268 """
54f9ee45 5269 return _core_.MenuEvent_IsPopup(*args, **kwargs)
e811c8ce
RD
5270
5271 def GetMenu(*args, **kwargs):
5ba5649b
RD
5272 """
5273 GetMenu(self) -> Menu
5274
5275 Returns the menu which is being opened or closed. This method should
5276 only be used with the OPEN and CLOSE events.
5277 """
54f9ee45 5278 return _core_.MenuEvent_GetMenu(*args, **kwargs)
e811c8ce 5279
0085ce49
RD
5280MenuEvent_swigregister = _core_.MenuEvent_swigregister
5281MenuEvent_swigregister(MenuEvent)
d14a1e28
RD
5282
5283#---------------------------------------------------------------------------
5284
5285class CloseEvent(Event):
5ba5649b
RD
5286 """
5287 This event class contains information about window and session close
5288 events.
5289
5290 The handler function for EVT_CLOSE is called when the user has tried
5291 to close a a frame or dialog box using the window manager controls or
5292 the system menu. It can also be invoked by the application itself
5293 programmatically, for example by calling the `wx.Window.Close`
5294 function.
5295
5296 You should check whether the application is forcing the deletion of
5297 the window using `CanVeto`. If it returns ``False``, you must destroy
5298 the window using `wx.Window.Destroy`. If the return value is ``True``,
5299 it is up to you whether you respond by destroying the window or not.
5300 For example you may wish to display a message dialog prompting to save
5301 files or to cancel the close.
5302
5303 If you don't destroy the window, you should call `Veto` to let the
5304 calling code know that you did not destroy the window. This allows the
5305 `wx.Window.Close` function to return ``True`` or ``False`` depending
5306 on whether the close instruction was honored or not.
5307 """
0085ce49
RD
5308 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5309 __repr__ = _swig_repr
5310 def __init__(self, *args, **kwargs):
5ba5649b
RD
5311 """
5312 __init__(self, wxEventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5313
5314 Constructor.
5315 """
0085ce49 5316 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
e811c8ce 5317 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5318 """
5319 SetLoggingOff(self, bool logOff)
5320
5321 Sets the 'logging off' flag.
5322 """
54f9ee45 5323 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
e811c8ce
RD
5324
5325 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5326 """
5327 GetLoggingOff(self) -> bool
5328
6c75a4cf
RD
5329 Returns ``True`` if the user is logging off or ``False`` if the
5330 system is shutting down. This method can only be called for end
5331 session and query end session events, it doesn't make sense for close
5332 window event.
5ba5649b 5333 """
54f9ee45 5334 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
e811c8ce
RD
5335
5336 def Veto(*args, **kwargs):
5ba5649b
RD
5337 """
5338 Veto(self, bool veto=True)
5339
5340 Call this from your event handler to veto a system shutdown or to
5341 signal to the calling application that a window close did not happen.
5342
5343 You can only veto a shutdown or close if `CanVeto` returns true.
5344 """
54f9ee45 5345 return _core_.CloseEvent_Veto(*args, **kwargs)
e811c8ce 5346
5ba5649b
RD
5347 def GetVeto(*args, **kwargs):
5348 """GetVeto(self) -> bool"""
5349 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5350
e811c8ce 5351 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5352 """
5353 SetCanVeto(self, bool canVeto)
5354
5355 Sets the 'can veto' flag.
5356 """
54f9ee45 5357 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
e811c8ce
RD
5358
5359 def CanVeto(*args, **kwargs):
5ba5649b
RD
5360 """
5361 CanVeto(self) -> bool
e811c8ce 5362
5ba5649b
RD
5363 Returns true if you can veto a system shutdown or a window close
5364 event. Vetoing a window close event is not possible if the calling
5365 code wishes to force the application to exit, and so this function
5366 must be called to check this.
5367 """
5368 return _core_.CloseEvent_CanVeto(*args, **kwargs)
e811c8ce 5369
0085ce49
RD
5370CloseEvent_swigregister = _core_.CloseEvent_swigregister
5371CloseEvent_swigregister(CloseEvent)
d14a1e28
RD
5372
5373#---------------------------------------------------------------------------
5374
5375class ShowEvent(Event):
5ba5649b 5376 """An EVT_SHOW event is sent when a window is shown or hidden."""
0085ce49
RD
5377 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5378 __repr__ = _swig_repr
5379 def __init__(self, *args, **kwargs):
5ba5649b
RD
5380 """
5381 __init__(self, int winid=0, bool show=False) -> ShowEvent
5382
5383 An EVT_SHOW event is sent when a window is shown or hidden.
5384 """
0085ce49 5385 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
e811c8ce 5386 def SetShow(*args, **kwargs):
a95a7133 5387 """SetShow(self, bool show)"""
54f9ee45 5388 return _core_.ShowEvent_SetShow(*args, **kwargs)
e811c8ce
RD
5389
5390 def GetShow(*args, **kwargs):
a95a7133 5391 """GetShow(self) -> bool"""
54f9ee45 5392 return _core_.ShowEvent_GetShow(*args, **kwargs)
e811c8ce 5393
0085ce49
RD
5394ShowEvent_swigregister = _core_.ShowEvent_swigregister
5395ShowEvent_swigregister(ShowEvent)
d14a1e28
RD
5396
5397#---------------------------------------------------------------------------
5398
5399class IconizeEvent(Event):
5ba5649b
RD
5400 """
5401 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5402 restored.
5403 """
0085ce49
RD
5404 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5405 __repr__ = _swig_repr
5406 def __init__(self, *args, **kwargs):
5ba5649b
RD
5407 """
5408 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5409
5410 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5411 restored.
5412 """
0085ce49 5413 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
e811c8ce 5414 def Iconized(*args, **kwargs):
5ba5649b
RD
5415 """
5416 Iconized(self) -> bool
5417
5418 Returns ``True`` if the frame has been iconized, ``False`` if it has
5419 been restored.
5420 """
54f9ee45 5421 return _core_.IconizeEvent_Iconized(*args, **kwargs)
e811c8ce 5422
0085ce49
RD
5423IconizeEvent_swigregister = _core_.IconizeEvent_swigregister
5424IconizeEvent_swigregister(IconizeEvent)
d14a1e28
RD
5425
5426#---------------------------------------------------------------------------
5427
5428class MaximizeEvent(Event):
5ba5649b 5429 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
0085ce49
RD
5430 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5431 __repr__ = _swig_repr
5432 def __init__(self, *args, **kwargs):
5ba5649b
RD
5433 """
5434 __init__(self, int id=0) -> MaximizeEvent
5435
5436 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5437 """
0085ce49
RD
5438 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
5439MaximizeEvent_swigregister = _core_.MaximizeEvent_swigregister
5440MaximizeEvent_swigregister(MaximizeEvent)
d14a1e28
RD
5441
5442#---------------------------------------------------------------------------
5443
5444class DropFilesEvent(Event):
5ba5649b
RD
5445 """
5446 This class is used for drop files events, that is, when files have
5447 been dropped onto the window. This functionality is only available
5448 under Windows. The window must have previously been enabled for
5449 dropping by calling `wx.Window.DragAcceptFiles`.
5450
5451 Important note: this is a separate implementation to the more general
5452 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5453 implementation uses the older, Windows message-based approach of
5454 dropping files.
5455
5456 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5457 events.
5458
5459 """
0085ce49
RD
5460 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5461 def __init__(self): raise AttributeError, "No constructor defined"
5462 __repr__ = _swig_repr
e811c8ce 5463 def GetPosition(*args, **kwargs):
5ba5649b
RD
5464 """
5465 GetPosition(self) -> Point
5466
5467 Returns the position at which the files were dropped.
5468 """
54f9ee45 5469 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5470
5471 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5472 """
5473 GetNumberOfFiles(self) -> int
5474
5475 Returns the number of files dropped.
5476 """
54f9ee45 5477 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
e811c8ce
RD
5478
5479 def GetFiles(*args, **kwargs):
5ba5649b
RD
5480 """
5481 GetFiles(self) -> PyObject
5482
5483 Returns a list of the filenames that were dropped.
5484 """
54f9ee45 5485 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
e811c8ce 5486
0085ce49
RD
5487DropFilesEvent_swigregister = _core_.DropFilesEvent_swigregister
5488DropFilesEvent_swigregister(DropFilesEvent)
d14a1e28
RD
5489
5490#---------------------------------------------------------------------------
5491
54f9ee45
RD
5492UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5493UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
d14a1e28 5494class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5495 """
5496 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5497 wxWidgets to give an application the chance to update various user
5498 interface elements.
5499
5500 Without update UI events, an application has to work hard to
5501 check/uncheck, enable/disable, and set the text for elements such as
5502 menu items and toolbar buttons. The code for doing this has to be
5503 mixed up with the code that is invoked when an action is invoked for a
5504 menu item or button.
5505
5506 With update UI events, you define an event handler to look at the
5507 state of the application and change UI elements accordingly. wxWidgets
5508 will call your handler functions in idle time, so you don't have to
5509 worry where to call this code. In addition to being a clearer and more
5510 declarative method, it also means you don't have to worry whether
5511 you're updating a toolbar or menubar identifier. The same handler can
5512 update a menu item and toolbar button, if the ID values are the same.
5513
5514 Instead of directly manipulating the menu or button, you call
5515 functions in the event object, such as `Check`. wxWidgets will
5516 determine whether such a call has been made, and which UI element to
5517 update.
5518
5519 These events will work for popup menus as well as menubars. Just
5520 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5521 any UI events for the window that owns the menu.
5522
5523 If you find that the overhead of UI update processing is affecting
5524 your application, you can do one or both of the following:
5525
5526 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5527 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5528 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5529 receive update events. No other windows will receive update
5530 events.
5531
5532 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5533 value to set the delay between updates. You may need to call
5534 `wx.Window.UpdateWindowUI` at critical points, for example when
5535 a dialog is about to be shown, in case the user sees a slight
5536 delay before windows are updated.
5537
5538 Note that although events are sent in idle time, defining a EVT_IDLE
5539 handler for a window does not affect this because the events are sent
5540 from an internal idle handler.
5541
5542 wxWidgets tries to optimize update events on some platforms. On
5543 Windows and GTK+, events for menubar items are only sent when the menu
5544 is about to be shown, and not in idle time.
5545
5546 """
0085ce49
RD
5547 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5548 __repr__ = _swig_repr
5549 def __init__(self, *args, **kwargs):
5ba5649b
RD
5550 """
5551 __init__(self, int commandId=0) -> UpdateUIEvent
5552
5553 Constructor
5554 """
0085ce49 5555 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
e811c8ce 5556 def GetChecked(*args, **kwargs):
5ba5649b
RD
5557 """
5558 GetChecked(self) -> bool
5559
5560 Returns ``True`` if the UI element should be checked.
5561 """
54f9ee45 5562 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
e811c8ce
RD
5563
5564 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5565 """
5566 GetEnabled(self) -> bool
5567
5568 Returns ``True`` if the UI element should be enabled.
5569 """
54f9ee45 5570 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
e811c8ce 5571
b1fcee84
RD
5572 def GetShown(*args, **kwargs):
5573 """
5574 GetShown(self) -> bool
5575
5576 Returns ``True`` if the UI element should be shown.
5577 """
5578 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5579
e811c8ce 5580 def GetText(*args, **kwargs):
5ba5649b
RD
5581 """
5582 GetText(self) -> String
5583
5584 Returns the text that should be set for the UI element.
5585 """
54f9ee45 5586 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
e811c8ce
RD
5587
5588 def GetSetText(*args, **kwargs):
5ba5649b
RD
5589 """
5590 GetSetText(self) -> bool
5591
5592 Returns ``True`` if the application has called `SetText`. For
5593 wxWidgets internal use only.
5594 """
54f9ee45 5595 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
e811c8ce
RD
5596
5597 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5598 """
5599 GetSetChecked(self) -> bool
5600
5601 Returns ``True`` if the application has called `Check`. For wxWidgets
5602 internal use only.
5603 """
54f9ee45 5604 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
e811c8ce
RD
5605
5606 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5607 """
5608 GetSetEnabled(self) -> bool
5609
5610 Returns ``True`` if the application has called `Enable`. For wxWidgets
5611 internal use only.
5612 """
54f9ee45 5613 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
e811c8ce 5614
b1fcee84
RD
5615 def GetSetShown(*args, **kwargs):
5616 """
5617 GetSetShown(self) -> bool
5618
5619 Returns ``True`` if the application has called `Show`. For wxWidgets
5620 internal use only.
5621 """
5622 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5623
e811c8ce 5624 def Check(*args, **kwargs):
5ba5649b
RD
5625 """
5626 Check(self, bool check)
5627
5628 Check or uncheck the UI element.
5629 """
54f9ee45 5630 return _core_.UpdateUIEvent_Check(*args, **kwargs)
e811c8ce
RD
5631
5632 def Enable(*args, **kwargs):
5ba5649b
RD
5633 """
5634 Enable(self, bool enable)
5635
5636 Enable or disable the UI element.
5637 """
54f9ee45 5638 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
e811c8ce 5639
b1fcee84
RD
5640 def Show(*args, **kwargs):
5641 """
5642 Show(self, bool show)
5643
5644 Show or hide the UI element.
5645 """
5646 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5647
e811c8ce 5648 def SetText(*args, **kwargs):
5ba5649b
RD
5649 """
5650 SetText(self, String text)
5651
5652 Sets the text for this UI element.
5653 """
54f9ee45 5654 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
e811c8ce
RD
5655
5656 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5657 """
5658 SetUpdateInterval(long updateInterval)
5659
5660 Sets the interval between updates in milliseconds. Set to -1 to
5661 disable updates, or to 0 to update as frequently as possible. The
5662 default is 0.
5663
5664 Use this to reduce the overhead of UI update events if your
5665 application has a lot of windows. If you set the value to -1 or
5666 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5667 at appropriate points in your application, such as when a dialog is
5668 about to be shown.
5669 """
54f9ee45 5670 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
e811c8ce
RD
5671
5672 SetUpdateInterval = staticmethod(SetUpdateInterval)
5673 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5674 """
5675 GetUpdateInterval() -> long
5676
5677 Returns the current interval between updates in milliseconds. -1
5678 disables updates, 0 updates as frequently as possible.
5679 """
54f9ee45 5680 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
e811c8ce
RD
5681
5682 GetUpdateInterval = staticmethod(GetUpdateInterval)
5683 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5684 """
5685 CanUpdate(Window win) -> bool
5686
5687 Returns ``True`` if it is appropriate to update (send UI update events
5688 to) this window.
5689
5690 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5691 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5692 events were last sent in idle time, and the update interval, to
5693 determine whether events should be sent to this window now. By default
5694 this will always return true because the update mode is initially
5695 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5696 events will be sent as often as possible. You can reduce the frequency
5697 that events are sent by changing the mode and/or setting an update
5698 interval.
5699
5700 """
54f9ee45 5701 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
e811c8ce
RD
5702
5703 CanUpdate = staticmethod(CanUpdate)
5704 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5705 """
5706 ResetUpdateTime()
5707
5708 Used internally to reset the last-updated time to the current time. It
5709 is assumed that update events are normally sent in idle time, so this
5710 is called at the end of idle processing.
5711 """
54f9ee45 5712 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
e811c8ce
RD
5713
5714 ResetUpdateTime = staticmethod(ResetUpdateTime)
5715 def SetMode(*args, **kwargs):
5ba5649b
RD
5716 """
5717 SetMode(int mode)
5718
5719 Specify how wxWidgets will send update events: to all windows, or only
5720 to those which specify that they will process the events.
5721
5722 The mode may be one of the following values:
5723
5724 ============================= ==========================================
5725 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5726 is the default setting.
5727 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5728 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5729 style set.
5730 ============================= ==========================================
5731
5732 """
54f9ee45 5733 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
e811c8ce
RD
5734
5735 SetMode = staticmethod(SetMode)
5736 def GetMode(*args, **kwargs):
5ba5649b
RD
5737 """
5738 GetMode() -> int
5739
5740 Returns a value specifying how wxWidgets will send update events: to
5741 all windows, or only to those which specify that they will process the
5742 events.
5743 """
54f9ee45 5744 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
e811c8ce
RD
5745
5746 GetMode = staticmethod(GetMode)
0085ce49
RD
5747UpdateUIEvent_swigregister = _core_.UpdateUIEvent_swigregister
5748UpdateUIEvent_swigregister(UpdateUIEvent)
d14a1e28 5749
e811c8ce 5750def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
0085ce49 5751 """
5ba5649b
RD
5752 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5753
5754 Sets the interval between updates in milliseconds. Set to -1 to
5755 disable updates, or to 0 to update as frequently as possible. The
5756 default is 0.
5757
5758 Use this to reduce the overhead of UI update events if your
5759 application has a lot of windows. If you set the value to -1 or
5760 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5761 at appropriate points in your application, such as when a dialog is
5762 about to be shown.
5763 """
0085ce49 5764 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d14a1e28 5765
0085ce49
RD
5766def UpdateUIEvent_GetUpdateInterval(*args):
5767 """
5ba5649b
RD
5768 UpdateUIEvent_GetUpdateInterval() -> long
5769
5770 Returns the current interval between updates in milliseconds. -1
5771 disables updates, 0 updates as frequently as possible.
5772 """
0085ce49 5773 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d14a1e28 5774
e811c8ce 5775def UpdateUIEvent_CanUpdate(*args, **kwargs):
0085ce49 5776 """
5ba5649b
RD
5777 UpdateUIEvent_CanUpdate(Window win) -> bool
5778
5779 Returns ``True`` if it is appropriate to update (send UI update events
5780 to) this window.
5781
5782 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5783 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5784 events were last sent in idle time, and the update interval, to
5785 determine whether events should be sent to this window now. By default
5786 this will always return true because the update mode is initially
5787 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5788 events will be sent as often as possible. You can reduce the frequency
5789 that events are sent by changing the mode and/or setting an update
5790 interval.
5791
5792 """
0085ce49 5793 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d14a1e28 5794
0085ce49
RD
5795def UpdateUIEvent_ResetUpdateTime(*args):
5796 """
5ba5649b
RD
5797 UpdateUIEvent_ResetUpdateTime()
5798
5799 Used internally to reset the last-updated time to the current time. It
5800 is assumed that update events are normally sent in idle time, so this
5801 is called at the end of idle processing.
5802 """
0085ce49 5803 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d14a1e28 5804
e811c8ce 5805def UpdateUIEvent_SetMode(*args, **kwargs):
0085ce49 5806 """
5ba5649b
RD
5807 UpdateUIEvent_SetMode(int mode)
5808
5809 Specify how wxWidgets will send update events: to all windows, or only
5810 to those which specify that they will process the events.
5811
5812 The mode may be one of the following values:
5813
5814 ============================= ==========================================
5815 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5816 is the default setting.
5817 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5818 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5819 style set.
5820 ============================= ==========================================
5821
5822 """
0085ce49 5823 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d14a1e28 5824
0085ce49
RD
5825def UpdateUIEvent_GetMode(*args):
5826 """
5ba5649b
RD
5827 UpdateUIEvent_GetMode() -> int
5828
5829 Returns a value specifying how wxWidgets will send update events: to
5830 all windows, or only to those which specify that they will process the
5831 events.
5832 """
0085ce49 5833 return _core_.UpdateUIEvent_GetMode(*args)
d14a1e28
RD
5834
5835#---------------------------------------------------------------------------
5836
5837class SysColourChangedEvent(Event):
5ba5649b
RD
5838 """
5839 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5840 when the user changes the colour settings using the control
5841 panel. This is only applicable under Windows.
5842
5843 The default event handler for this event propagates the event to child
5844 windows, since Windows only sends the events to top-level windows. If
5845 intercepting this event for a top-level window, remember to call
5846 `Skip` so the the base class handler will still be executed, or to
5847 pass the event on to the window's children explicitly.
5848
5849 """
0085ce49
RD
5850 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5851 __repr__ = _swig_repr
5852 def __init__(self, *args, **kwargs):
5ba5649b
RD
5853 """
5854 __init__(self) -> SysColourChangedEvent
5855
5856 Constructor
5857 """
0085ce49
RD
5858 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
5859SysColourChangedEvent_swigregister = _core_.SysColourChangedEvent_swigregister
5860SysColourChangedEvent_swigregister(SysColourChangedEvent)
d14a1e28
RD
5861
5862#---------------------------------------------------------------------------
5863
5864class MouseCaptureChangedEvent(Event):
5ba5649b
RD
5865 """
5866 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5867 a window that loses its mouse capture. This is called even if
5868 `wx.Window.ReleaseMouse` was called by the application code. Handling
5869 this event allows an application to cater for unexpected capture
5870 releases which might otherwise confuse mouse handling code.
5871
5872 This event is implemented under Windows only.
5873 """
0085ce49
RD
5874 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5875 __repr__ = _swig_repr
5876 def __init__(self, *args, **kwargs):
5ba5649b
RD
5877 """
5878 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5879
5880 Constructor
5881 """
0085ce49 5882 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
e811c8ce 5883 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
5884 """
5885 GetCapturedWindow(self) -> Window
5886
5887 Returns the window that gained the capture, or ``None`` if it was a
5888 non-wxWidgets window.
5889 """
54f9ee45 5890 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
e811c8ce 5891
0085ce49
RD
5892MouseCaptureChangedEvent_swigregister = _core_.MouseCaptureChangedEvent_swigregister
5893MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d14a1e28
RD
5894
5895#---------------------------------------------------------------------------
5896
5897class DisplayChangedEvent(Event):
5ba5649b
RD
5898 """
5899 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5900 resolution has changed.
5901
5902 This event is implemented under Windows only.
5903 """
0085ce49
RD
5904 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5905 __repr__ = _swig_repr
5906 def __init__(self, *args, **kwargs):
a95a7133 5907 """__init__(self) -> DisplayChangedEvent"""
0085ce49
RD
5908 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
5909DisplayChangedEvent_swigregister = _core_.DisplayChangedEvent_swigregister
5910DisplayChangedEvent_swigregister(DisplayChangedEvent)
d14a1e28
RD
5911
5912#---------------------------------------------------------------------------
5913
5914class PaletteChangedEvent(Event):
5ba5649b
RD
5915 """
5916 An EVT_PALETTE_CHANGED event is sent when the system palette has
5917 changed, thereby giving each window a chance to redo their own to
5918 match.
5919
5920 This event is implemented under Windows only.
5921 """
0085ce49
RD
5922 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5923 __repr__ = _swig_repr
5924 def __init__(self, *args, **kwargs):
5ba5649b
RD
5925 """
5926 __init__(self, int id=0) -> PaletteChangedEvent
5927
5928 An EVT_PALETTE_CHANGED event is sent when the system palette has
5929 changed, thereby giving each window a chance to redo their own to
5930 match.
5931
5932 This event is implemented under Windows only.
5933 """
0085ce49 5934 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
e811c8ce 5935 def SetChangedWindow(*args, **kwargs):
a95a7133 5936 """SetChangedWindow(self, Window win)"""
54f9ee45 5937 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
e811c8ce
RD
5938
5939 def GetChangedWindow(*args, **kwargs):
a95a7133 5940 """GetChangedWindow(self) -> Window"""
54f9ee45 5941 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
e811c8ce 5942
0085ce49
RD
5943PaletteChangedEvent_swigregister = _core_.PaletteChangedEvent_swigregister
5944PaletteChangedEvent_swigregister(PaletteChangedEvent)
d14a1e28
RD
5945
5946#---------------------------------------------------------------------------
5947
5948class QueryNewPaletteEvent(Event):
5ba5649b
RD
5949 """
5950 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5951 focus and should re-do its palette.
5952
5953 This event is implemented under Windows only.
5954 """
0085ce49
RD
5955 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5956 __repr__ = _swig_repr
5957 def __init__(self, *args, **kwargs):
5ba5649b
RD
5958 """
5959 __init__(self, int winid=0) -> QueryNewPaletteEvent
5960
5961 Constructor.
5962 """
0085ce49 5963 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
e811c8ce 5964 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
5965 """
5966 SetPaletteRealized(self, bool realized)
5967
5968 App should set this if it changes the palette.
5969 """
54f9ee45 5970 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
e811c8ce
RD
5971
5972 def GetPaletteRealized(*args, **kwargs):
a95a7133 5973 """GetPaletteRealized(self) -> bool"""
54f9ee45 5974 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
e811c8ce 5975
0085ce49
RD
5976QueryNewPaletteEvent_swigregister = _core_.QueryNewPaletteEvent_swigregister
5977QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d14a1e28
RD
5978
5979#---------------------------------------------------------------------------
5980
5981class NavigationKeyEvent(Event):
5ba5649b
RD
5982 """
5983 EVT_NAVIGATION_KEY events are used to control moving the focus between
5984 widgets, otherwise known as tab-traversal. You woudl normally not
5985 catch navigation events in applications as there are already
5986 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5987 it useful to send navigation events in certain situations to change
5988 the focus in certain ways, although it's probably easier to just call
5989 `wx.Window.Navigate`.
5990 """
0085ce49
RD
5991 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5992 __repr__ = _swig_repr
5993 def __init__(self, *args, **kwargs):
a95a7133 5994 """__init__(self) -> NavigationKeyEvent"""
0085ce49 5995 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
e811c8ce 5996 def GetDirection(*args, **kwargs):
5ba5649b
RD
5997 """
5998 GetDirection(self) -> bool
5999
6000 Returns ``True`` if the direction is forward, ``False`` otherwise.
6001 """
54f9ee45 6002 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
e811c8ce
RD
6003
6004 def SetDirection(*args, **kwargs):
5ba5649b
RD
6005 """
6006 SetDirection(self, bool forward)
6007
6008 Specify the direction that the navigation should take. Usually the
6009 difference between using Tab and Shift-Tab.
6010 """
54f9ee45 6011 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
e811c8ce
RD
6012
6013 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6014 """
6015 IsWindowChange(self) -> bool
6016
6017 Returns ``True`` if window change is allowed.
6018 """
54f9ee45 6019 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
e811c8ce
RD
6020
6021 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6022 """
6023 SetWindowChange(self, bool ischange)
6024
6025 Specify if the navigation should be able to change parent windows.
6026 For example, changing notebook pages, etc. This is usually implemented
6027 by using Control-Tab.
6028 """
54f9ee45 6029 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
e811c8ce 6030
68350608 6031 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6032 """
6033 IsFromTab(self) -> bool
6034
6035 Returns ``True`` if the navigation event is originated from the Tab
6036 key.
6037 """
68350608
RD
6038 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6039
6040 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6041 """
6042 SetFromTab(self, bool bIs)
6043
6044 Set to true under MSW if the event was generated using the tab key.
6045 This is required for proper navogation over radio buttons.
6046 """
68350608
RD
6047 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6048
908b74cd 6049 def SetFlags(*args, **kwargs):
5ba5649b
RD
6050 """
6051 SetFlags(self, long flags)
6052
6053 Set the navigation flags to a combination of the following:
6054
6055 * wx.NavigationKeyEvent.IsBackward
6056 * wx.NavigationKeyEvent.IsForward
6057 * wx.NavigationKeyEvent.WinChange
6058 * wx.NavigationKeyEvent.FromTab
6059
6060 """
908b74cd
RD
6061 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6062
e811c8ce 6063 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6064 """
6065 GetCurrentFocus(self) -> Window
6066
6067 Returns the child window which currenty has the focus. May be
6068 ``None``.
6069 """
54f9ee45 6070 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
e811c8ce
RD
6071
6072 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6073 """
6074 SetCurrentFocus(self, Window win)
6075
6076 Set the window that has the focus.
6077 """
54f9ee45 6078 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
e811c8ce 6079
b0f7404b 6080 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
6081 IsForward = _core_.NavigationKeyEvent_IsForward
6082 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 6083 FromTab = _core_.NavigationKeyEvent_FromTab
0085ce49
RD
6084NavigationKeyEvent_swigregister = _core_.NavigationKeyEvent_swigregister
6085NavigationKeyEvent_swigregister(NavigationKeyEvent)
d14a1e28
RD
6086
6087#---------------------------------------------------------------------------
6088
6089class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6090 """
6091 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6092 underlying GUI object) exists.
6093 """
0085ce49
RD
6094 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6095 __repr__ = _swig_repr
6096 def __init__(self, *args, **kwargs):
5ba5649b
RD
6097 """
6098 __init__(self, Window win=None) -> WindowCreateEvent
6099
6100 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6101 underlying GUI object) exists.
6102 """
0085ce49 6103 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
e811c8ce 6104 def GetWindow(*args, **kwargs):
5ba5649b
RD
6105 """
6106 GetWindow(self) -> Window
6107
6108 Returns the window that this event refers to.
6109 """
54f9ee45 6110 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
e811c8ce 6111
0085ce49
RD
6112WindowCreateEvent_swigregister = _core_.WindowCreateEvent_swigregister
6113WindowCreateEvent_swigregister(WindowCreateEvent)
d14a1e28
RD
6114
6115class WindowDestroyEvent(CommandEvent):
5ba5649b 6116 """
943e8dfd
RD
6117 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6118 when the GUI window is destroyed.
6119
6120 When a class derived from `wx.Window` is destroyed its destructor will
6121 have already run by the time this event is sent. Therefore this event
6122 will not usually be received at all by the window itself. Since it is
6123 received after the destructor has run, an object should not try to
6124 handle its own wx.WindowDestroyEvent, but it can be used to get
6125 notification of the destruction of another window.
5ba5649b 6126 """
0085ce49
RD
6127 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6128 __repr__ = _swig_repr
6129 def __init__(self, *args, **kwargs):
5ba5649b
RD
6130 """
6131 __init__(self, Window win=None) -> WindowDestroyEvent
6132
943e8dfd
RD
6133 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6134 when the GUI window is destroyed.
6135
6136 When a class derived from `wx.Window` is destroyed its destructor will
6137 have already run by the time this event is sent. Therefore this event
6138 will not usually be received at all by the window itself. Since it is
6139 received after the destructor has run, an object should not try to
6140 handle its own wx.WindowDestroyEvent, but it can be used to get
6141 notification of the destruction of another window.
5ba5649b 6142 """
0085ce49 6143 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
e811c8ce 6144 def GetWindow(*args, **kwargs):
5ba5649b
RD
6145 """
6146 GetWindow(self) -> Window
6147
6148 Returns the window that this event refers to.
6149 """
54f9ee45 6150 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
e811c8ce 6151
0085ce49
RD
6152WindowDestroyEvent_swigregister = _core_.WindowDestroyEvent_swigregister
6153WindowDestroyEvent_swigregister(WindowDestroyEvent)
d14a1e28
RD
6154
6155#---------------------------------------------------------------------------
6156
6157class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6158 """
6159 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6160 give the application a chance to show a context (popup) menu.
6161 """
0085ce49
RD
6162 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6163 __repr__ = _swig_repr
6164 def __init__(self, *args, **kwargs):
5ba5649b
RD
6165 """
6166 __init__(self, wxEventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
6167
6168 Constructor.
6169 """
0085ce49 6170 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
e811c8ce 6171 def GetPosition(*args, **kwargs):
5ba5649b
RD
6172 """
6173 GetPosition(self) -> Point
6174
6175 Returns the position (in screen coordinants) at which the menu should
6176 be shown.
6177 """
54f9ee45 6178 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
6179
6180 def SetPosition(*args, **kwargs):
5ba5649b
RD
6181 """
6182 SetPosition(self, Point pos)
6183
6184 Sets the position at which the menu should be shown.
6185 """
54f9ee45 6186 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
e811c8ce 6187
0085ce49
RD
6188ContextMenuEvent_swigregister = _core_.ContextMenuEvent_swigregister
6189ContextMenuEvent_swigregister(ContextMenuEvent)
d14a1e28
RD
6190
6191#---------------------------------------------------------------------------
6192
54f9ee45
RD
6193IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6194IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
d14a1e28 6195class IdleEvent(Event):
5ba5649b
RD
6196 """
6197 This class is used for EVT_IDLE events, which are generated and sent
6198 when the application *becomes* idle. In other words, the when the
6199 event queue becomes empty then idle events are sent to all windows (by
6200 default) and as long as none of them call `RequestMore` then there are
6201 no more idle events until after the system event queue has some normal
6202 events and then becomes empty again.
6203
6204 By default, idle events are sent to all windows. If this is causing a
6205 significant overhead in your application, you can call
6206 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6207 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6208 which should receive idle events. Then idle events will only be sent
6209 to those windows and not to any others.
6210 """
0085ce49
RD
6211 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6212 __repr__ = _swig_repr
6213 def __init__(self, *args, **kwargs):
5ba5649b
RD
6214 """
6215 __init__(self) -> IdleEvent
6216
6217 Constructor
6218 """
0085ce49 6219 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
e811c8ce 6220 def RequestMore(*args, **kwargs):
5ba5649b
RD
6221 """
6222 RequestMore(self, bool needMore=True)
6223
6224 Tells wxWidgets that more processing is required. This function can be
6225 called by an EVT_IDLE handler for a window to indicate that the
6226 application should forward the EVT_IDLE event once more to the
6227 application windows. If no window calls this function during its
6228 EVT_IDLE handler, then the application will remain in a passive event
6229 loop until a new event is posted to the application by the windowing
6230 system.
6231 """
54f9ee45 6232 return _core_.IdleEvent_RequestMore(*args, **kwargs)
e811c8ce
RD
6233
6234 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6235 """
6236 MoreRequested(self) -> bool
6237
6238 Returns ``True`` if the OnIdle function processing this event
6239 requested more processing time.
6240 """
54f9ee45 6241 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
e811c8ce
RD
6242
6243 def SetMode(*args, **kwargs):
5ba5649b
RD
6244 """
6245 SetMode(int mode)
6246
6247 Static method for specifying how wxWidgets will send idle events: to
6248 all windows, or only to those which specify that they will process the
6249 events.
6250
6251 The mode can be one of the following values:
6252
6253 ========================= ========================================
6254 wx.IDLE_PROCESS_ALL Send idle events to all windows
6255 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6256 the wx.WS_EX_PROCESS_IDLE extra style
6257 flag set.
6258 ========================= ========================================
6259
6260 """
54f9ee45 6261 return _core_.IdleEvent_SetMode(*args, **kwargs)
e811c8ce
RD
6262
6263 SetMode = staticmethod(SetMode)
6264 def GetMode(*args, **kwargs):
5ba5649b
RD
6265 """
6266 GetMode() -> int
6267
6268 Static method returning a value specifying how wxWidgets will send
6269 idle events: to all windows, or only to those which specify that they
6270 will process the events.
6271 """
54f9ee45 6272 return _core_.IdleEvent_GetMode(*args, **kwargs)
e811c8ce
RD
6273
6274 GetMode = staticmethod(GetMode)
6275 def CanSend(*args, **kwargs):
5ba5649b
RD
6276 """
6277 CanSend(Window win) -> bool
6278
6279 Returns ``True`` if it is appropriate to send idle events to this
6280 window.
6281
6282 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6283 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6284 events should be sent to this window now. By default this will always
6285 return ``True`` because the update mode is initially
6286 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6287 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6288 """
54f9ee45 6289 return _core_.IdleEvent_CanSend(*args, **kwargs)
e811c8ce
RD
6290
6291 CanSend = staticmethod(CanSend)
0085ce49
RD
6292IdleEvent_swigregister = _core_.IdleEvent_swigregister
6293IdleEvent_swigregister(IdleEvent)
d14a1e28 6294
e811c8ce 6295def IdleEvent_SetMode(*args, **kwargs):
0085ce49 6296 """
5ba5649b
RD
6297 IdleEvent_SetMode(int mode)
6298
6299 Static method for specifying how wxWidgets will send idle events: to
6300 all windows, or only to those which specify that they will process the
6301 events.
6302
6303 The mode can be one of the following values:
6304
6305 ========================= ========================================
6306 wx.IDLE_PROCESS_ALL Send idle events to all windows
6307 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6308 the wx.WS_EX_PROCESS_IDLE extra style
6309 flag set.
6310 ========================= ========================================
6311
6312 """
0085ce49 6313 return _core_.IdleEvent_SetMode(*args, **kwargs)
d14a1e28 6314
0085ce49
RD
6315def IdleEvent_GetMode(*args):
6316 """
5ba5649b
RD
6317 IdleEvent_GetMode() -> int
6318
6319 Static method returning a value specifying how wxWidgets will send
6320 idle events: to all windows, or only to those which specify that they
6321 will process the events.
6322 """
0085ce49 6323 return _core_.IdleEvent_GetMode(*args)
d14a1e28 6324
e811c8ce 6325def IdleEvent_CanSend(*args, **kwargs):
0085ce49 6326 """
5ba5649b
RD
6327 IdleEvent_CanSend(Window win) -> bool
6328
6329 Returns ``True`` if it is appropriate to send idle events to this
6330 window.
6331
6332 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6333 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6334 events should be sent to this window now. By default this will always
6335 return ``True`` because the update mode is initially
6336 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6337 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6338 """
0085ce49 6339 return _core_.IdleEvent_CanSend(*args, **kwargs)
d14a1e28
RD
6340
6341#---------------------------------------------------------------------------
6342
6343class PyEvent(Event):
5ba5649b
RD
6344 """
6345 wx.PyEvent can be used as a base class for implementing custom event
6346 types in Python. You should derived from this class instead of
6347 `wx.Event` because this class is Python-aware and is able to transport
6348 its Python bits safely through the wxWidgets event system and have
6349 them still be there when the event handler is invoked.
6350
6351 :see: `wx.PyCommandEvent`
6352
6353 """
0085ce49
RD
6354 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6355 __repr__ = _swig_repr
6356 def __init__(self, *args, **kwargs):
5ba5649b 6357 """__init__(self, int winid=0, wxEventType eventType=wxEVT_NULL) -> PyEvent"""
0085ce49 6358 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6359 self._SetSelf(self)
e811c8ce 6360
0085ce49
RD
6361 __swig_destroy__ = _core_.delete_PyEvent
6362 __del__ = lambda self : None;
5ba5649b
RD
6363 def _SetSelf(*args, **kwargs):
6364 """_SetSelf(self, PyObject self)"""
6365 return _core_.PyEvent__SetSelf(*args, **kwargs)
e811c8ce 6366
5ba5649b
RD
6367 def _GetSelf(*args, **kwargs):
6368 """_GetSelf(self) -> PyObject"""
6369 return _core_.PyEvent__GetSelf(*args, **kwargs)
e811c8ce 6370
0085ce49
RD
6371PyEvent_swigregister = _core_.PyEvent_swigregister
6372PyEvent_swigregister(PyEvent)
d14a1e28
RD
6373
6374class PyCommandEvent(CommandEvent):
5ba5649b
RD
6375 """
6376 wx.PyCommandEvent can be used as a base class for implementing custom
6377 event types in Python, where the event shoudl travel up to parent
6378 windows looking for a handler. You should derived from this class
6379 instead of `wx.CommandEvent` because this class is Python-aware and is
6380 able to transport its Python bits safely through the wxWidgets event
6381 system and have them still be there when the event handler is invoked.
6382
6383 :see: `wx.PyEvent`
6384
6385 """
0085ce49
RD
6386 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6387 __repr__ = _swig_repr
6388 def __init__(self, *args, **kwargs):
5ba5649b 6389 """__init__(self, wxEventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
0085ce49 6390 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6391 self._SetSelf(self)
e811c8ce 6392
0085ce49
RD
6393 __swig_destroy__ = _core_.delete_PyCommandEvent
6394 __del__ = lambda self : None;
5ba5649b
RD
6395 def _SetSelf(*args, **kwargs):
6396 """_SetSelf(self, PyObject self)"""
6397 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
e811c8ce 6398
5ba5649b
RD
6399 def _GetSelf(*args, **kwargs):
6400 """_GetSelf(self) -> PyObject"""
6401 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
e811c8ce 6402
0085ce49
RD
6403PyCommandEvent_swigregister = _core_.PyCommandEvent_swigregister
6404PyCommandEvent_swigregister(PyCommandEvent)
d14a1e28 6405
53aa7709 6406class DateEvent(CommandEvent):
5ba5649b
RD
6407 """
6408 This event class holds information about a date change event and is
6409 used together with `wx.DatePickerCtrl`. It also serves as a base class
6410 for `wx.calendar.CalendarEvent`. Bind these event types with
6411 EVT_DATE_CHANGED.
6412 """
0085ce49
RD
6413 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6414 __repr__ = _swig_repr
6415 def __init__(self, *args, **kwargs):
53aa7709 6416 """__init__(self, Window win, DateTime dt, wxEventType type) -> DateEvent"""
0085ce49 6417 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6418 def GetDate(*args, **kwargs):
5ba5649b
RD
6419 """
6420 GetDate(self) -> DateTime
6421
6422 Returns the date.
6423 """
53aa7709
RD
6424 return _core_.DateEvent_GetDate(*args, **kwargs)
6425
6426 def SetDate(*args, **kwargs):
5ba5649b
RD
6427 """
6428 SetDate(self, DateTime date)
6429
6430 Sets the date carried by the event, normally only used by the library
6431 internally.
6432 """
53aa7709
RD
6433 return _core_.DateEvent_SetDate(*args, **kwargs)
6434
0085ce49
RD
6435DateEvent_swigregister = _core_.DateEvent_swigregister
6436DateEvent_swigregister(DateEvent)
53aa7709
RD
6437
6438wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6439EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6440
d14a1e28
RD
6441#---------------------------------------------------------------------------
6442
54f9ee45
RD
6443PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6444PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6445PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6446PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6447PRINT_WINDOWS = _core_.PRINT_WINDOWS
6448PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
d14a1e28 6449class PyApp(EvtHandler):
66c033b4
RD
6450 """
6451 The ``wx.PyApp`` class is an *implementation detail*, please use the
6452 `wx.App` class (or some other derived class) instead.
6453 """
0085ce49
RD
6454 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6455 __repr__ = _swig_repr
6456 def __init__(self, *args, **kwargs):
98e665d3 6457 """
a95a7133 6458 __init__(self) -> PyApp
98e665d3
RD
6459
6460 Create a new application object, starting the bootstrap process.
6461 """
0085ce49 6462 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
70b7a5fe
RD
6463 self._setCallbackInfo(self, PyApp, False)
6464 self._setOORInfo(self, False)
e811c8ce 6465
0085ce49
RD
6466 __swig_destroy__ = _core_.delete_PyApp
6467 __del__ = lambda self : None;
e811c8ce 6468 def _setCallbackInfo(*args, **kwargs):
70b7a5fe 6469 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
54f9ee45 6470 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
6471
6472 def GetAppName(*args, **kwargs):
0df68c9f 6473 """
a95a7133 6474 GetAppName(self) -> String
6c3b4aae 6475
0df68c9f
RD
6476 Get the application name.
6477 """
54f9ee45 6478 return _core_.PyApp_GetAppName(*args, **kwargs)
e811c8ce
RD
6479
6480 def SetAppName(*args, **kwargs):
0df68c9f 6481 """
a95a7133 6482 SetAppName(self, String name)
6c3b4aae 6483
66c033b4
RD
6484 Set the application name. This value may be used automatically by
6485 `wx.Config` and such.
0df68c9f 6486 """
54f9ee45 6487 return _core_.PyApp_SetAppName(*args, **kwargs)
e811c8ce
RD
6488
6489 def GetClassName(*args, **kwargs):
0df68c9f 6490 """
a95a7133 6491 GetClassName(self) -> String
e811c8ce 6492
0df68c9f
RD
6493 Get the application's class name.
6494 """
54f9ee45 6495 return _core_.PyApp_GetClassName(*args, **kwargs)
e811c8ce
RD
6496
6497 def SetClassName(*args, **kwargs):
0df68c9f 6498 """
a95a7133 6499 SetClassName(self, String name)
6c3b4aae 6500
66c033b4
RD
6501 Set the application's class name. This value may be used for
6502 X-resources if applicable for the platform
0df68c9f 6503 """
54f9ee45 6504 return _core_.PyApp_SetClassName(*args, **kwargs)
e811c8ce
RD
6505
6506 def GetVendorName(*args, **kwargs):
0df68c9f 6507 """
a95a7133 6508 GetVendorName(self) -> String
6c3b4aae 6509
0df68c9f
RD
6510 Get the application's vendor name.
6511 """
54f9ee45 6512 return _core_.PyApp_GetVendorName(*args, **kwargs)
e811c8ce
RD
6513
6514 def SetVendorName(*args, **kwargs):
0df68c9f 6515 """
a95a7133 6516 SetVendorName(self, String name)
6c3b4aae 6517
66c033b4
RD
6518 Set the application's vendor name. This value may be used
6519 automatically by `wx.Config` and such.
0df68c9f 6520 """
54f9ee45 6521 return _core_.PyApp_SetVendorName(*args, **kwargs)
e811c8ce
RD
6522
6523 def GetTraits(*args, **kwargs):
0df68c9f 6524 """
a95a7133 6525 GetTraits(self) -> wxAppTraits
6c3b4aae 6526
66c033b4
RD
6527 Return (and create if necessary) the app traits object to which we
6528 delegate for everything which either should be configurable by the
6529 user (then he can change the default behaviour simply by overriding
6530 CreateTraits() and returning his own traits object) or which is
6531 GUI/console dependent as then wx.AppTraits allows us to abstract the
6532 differences behind the common facade.
6533
6534 :todo: Add support for overriding CreateAppTraits in wxPython.
0df68c9f 6535 """
54f9ee45 6536 return _core_.PyApp_GetTraits(*args, **kwargs)
e811c8ce
RD
6537
6538 def ProcessPendingEvents(*args, **kwargs):
0df68c9f 6539 """
a95a7133 6540 ProcessPendingEvents(self)
6c3b4aae 6541
66c033b4
RD
6542 Process all events in the Pending Events list -- it is necessary to
6543 call this function to process posted events. This normally happens
6544 during each event loop iteration.
0df68c9f 6545 """
54f9ee45 6546 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
6547
6548 def Yield(*args, **kwargs):
0df68c9f 6549 """
a95a7133 6550 Yield(self, bool onlyIfNeeded=False) -> bool
6c3b4aae 6551
66c033b4
RD
6552 Process all currently pending events right now, instead of waiting
6553 until return to the event loop. It is an error to call ``Yield``
6554 recursively unless the value of ``onlyIfNeeded`` is True.
6c3b4aae 6555
66c033b4 6556 :warning: This function is dangerous as it can lead to unexpected
41e2b43e
RD
6557 reentrancies (i.e. when called from an event handler it may
6558 result in calling the same event handler again), use with
6559 extreme care or, better, don't use at all!
0df68c9f 6560
66c033b4 6561 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
41e2b43e 6562
0df68c9f 6563 """
54f9ee45 6564 return _core_.PyApp_Yield(*args, **kwargs)
e811c8ce
RD
6565
6566 def WakeUpIdle(*args, **kwargs):
0df68c9f 6567 """
a95a7133 6568 WakeUpIdle(self)
6c3b4aae 6569
66c033b4
RD
6570 Make sure that idle events are sent again.
6571 :see: `wx.WakeUpIdle`
0df68c9f 6572 """
54f9ee45 6573 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
e811c8ce 6574
1fc3b23a
RD
6575 def IsMainLoopRunning(*args, **kwargs):
6576 """
6577 IsMainLoopRunning() -> bool
6578
6579 Returns True if we're running the main loop, i.e. if the events can
6580 currently be dispatched.
6581 """
6582 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6583
6584 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
e811c8ce 6585 def MainLoop(*args, **kwargs):
0df68c9f 6586 """
a95a7133 6587 MainLoop(self) -> int
6c3b4aae 6588
66c033b4
RD
6589 Execute the main GUI loop, the function doesn't normally return until
6590 all top level windows have been closed and destroyed.
0df68c9f 6591 """
54f9ee45 6592 return _core_.PyApp_MainLoop(*args, **kwargs)
e811c8ce
RD
6593
6594 def Exit(*args, **kwargs):
0df68c9f 6595 """
a95a7133 6596 Exit(self)
6c3b4aae 6597
0df68c9f 6598 Exit the main loop thus terminating the application.
66c033b4 6599 :see: `wx.Exit`
0df68c9f 6600 """
54f9ee45 6601 return _core_.PyApp_Exit(*args, **kwargs)
e811c8ce
RD
6602
6603 def ExitMainLoop(*args, **kwargs):
0df68c9f 6604 """
a95a7133 6605 ExitMainLoop(self)
6c3b4aae 6606
66c033b4
RD
6607 Exit the main GUI loop during the next iteration of the main
6608 loop, (i.e. it does not stop the program immediately!)
0df68c9f 6609 """
54f9ee45 6610 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
e811c8ce
RD
6611
6612 def Pending(*args, **kwargs):
0df68c9f 6613 """
a95a7133 6614 Pending(self) -> bool
6c3b4aae 6615
0df68c9f
RD
6616 Returns True if there are unprocessed events in the event queue.
6617 """
54f9ee45 6618 return _core_.PyApp_Pending(*args, **kwargs)
e811c8ce
RD
6619
6620 def Dispatch(*args, **kwargs):
0df68c9f 6621 """
a95a7133 6622 Dispatch(self) -> bool
6c3b4aae 6623
0df68c9f
RD
6624 Process the first event in the event queue (blocks until an event
6625 appears if there are none currently)
6626 """
54f9ee45 6627 return _core_.PyApp_Dispatch(*args, **kwargs)
e811c8ce
RD
6628
6629 def ProcessIdle(*args, **kwargs):
0df68c9f 6630 """
a95a7133 6631 ProcessIdle(self) -> bool
6c3b4aae 6632
66c033b4
RD
6633 Called from the MainLoop when the application becomes idle (there are
6634 no pending events) and sends a `wx.IdleEvent` to all interested
6635 parties. Returns True if more idle events are needed, False if not.
0df68c9f 6636 """
54f9ee45 6637 return _core_.PyApp_ProcessIdle(*args, **kwargs)
e811c8ce
RD
6638
6639 def SendIdleEvents(*args, **kwargs):
0df68c9f 6640 """
a95a7133 6641 SendIdleEvents(self, Window win, IdleEvent event) -> bool
e811c8ce 6642
66c033b4
RD
6643 Send idle event to window and all subwindows. Returns True if more
6644 idle time is requested.
0df68c9f 6645 """
54f9ee45 6646 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
e811c8ce
RD
6647
6648 def IsActive(*args, **kwargs):
0df68c9f 6649 """
a95a7133 6650 IsActive(self) -> bool
6c3b4aae 6651
0df68c9f
RD
6652 Return True if our app has focus.
6653 """
54f9ee45 6654 return _core_.PyApp_IsActive(*args, **kwargs)
e811c8ce
RD
6655
6656 def SetTopWindow(*args, **kwargs):
0df68c9f 6657 """
a95a7133 6658 SetTopWindow(self, Window win)
6c3b4aae 6659
66c033b4 6660 Set the *main* top level window
0df68c9f 6661 """
54f9ee45 6662 return _core_.PyApp_SetTopWindow(*args, **kwargs)
e811c8ce
RD
6663
6664 def GetTopWindow(*args, **kwargs):
0df68c9f 6665 """
a95a7133 6666 GetTopWindow(self) -> Window
6c3b4aae 6667
66c033b4
RD
6668 Return the *main* top level window (if it hadn't been set previously
6669 with SetTopWindow(), will return just some top level window and, if
6670 there not any, will return None)
0df68c9f 6671 """
54f9ee45 6672 return _core_.PyApp_GetTopWindow(*args, **kwargs)
e811c8ce
RD
6673
6674 def SetExitOnFrameDelete(*args, **kwargs):
0df68c9f 6675 """
a95a7133 6676 SetExitOnFrameDelete(self, bool flag)
0df68c9f 6677
66c033b4
RD
6678 Control the exit behaviour: by default, the program will exit the main
6679 loop (and so, usually, terminate) when the last top-level program
6680 window is deleted. Beware that if you disable this behaviour (with
6681 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6682 explicitly from somewhere.
0df68c9f 6683 """
54f9ee45 6684 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
6685
6686 def GetExitOnFrameDelete(*args, **kwargs):
0df68c9f 6687 """
a95a7133 6688 GetExitOnFrameDelete(self) -> bool
6c3b4aae 6689
0df68c9f
RD
6690 Get the current exit behaviour setting.
6691 """
54f9ee45 6692 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
6693
6694 def SetUseBestVisual(*args, **kwargs):
0df68c9f 6695 """
a95a7133 6696 SetUseBestVisual(self, bool flag)
6c3b4aae 6697
66c033b4
RD
6698 Set whether the app should try to use the best available visual on
6699 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
0df68c9f 6700 """
54f9ee45 6701 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
e811c8ce
RD
6702
6703 def GetUseBestVisual(*args, **kwargs):
0df68c9f 6704 """
a95a7133 6705 GetUseBestVisual(self) -> bool
6c3b4aae 6706
0df68c9f
RD
6707 Get current UseBestVisual setting.
6708 """
54f9ee45 6709 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
e811c8ce
RD
6710
6711 def SetPrintMode(*args, **kwargs):
a95a7133 6712 """SetPrintMode(self, int mode)"""
54f9ee45 6713 return _core_.PyApp_SetPrintMode(*args, **kwargs)
e811c8ce
RD
6714
6715 def GetPrintMode(*args, **kwargs):
a95a7133 6716 """GetPrintMode(self) -> int"""
54f9ee45 6717 return _core_.PyApp_GetPrintMode(*args, **kwargs)
e811c8ce 6718
e811c8ce 6719 def SetAssertMode(*args, **kwargs):
0df68c9f 6720 """
a95a7133 6721 SetAssertMode(self, int mode)
6c3b4aae 6722
41e2b43e 6723 Set the OnAssert behaviour for debug and hybrid builds.
0df68c9f 6724 """
54f9ee45 6725 return _core_.PyApp_SetAssertMode(*args, **kwargs)
e811c8ce 6726
6c3b4aae 6727 def GetAssertMode(*args, **kwargs):
0df68c9f 6728 """
a95a7133 6729 GetAssertMode(self) -> int
6c3b4aae 6730
0df68c9f
RD
6731 Get the current OnAssert behaviour setting.
6732 """
54f9ee45 6733 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6c3b4aae 6734
e811c8ce 6735 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 6736 """GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 6737 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
6738
6739 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6740 def GetMacAboutMenuItemId(*args, **kwargs):
66c033b4 6741 """GetMacAboutMenuItemId() -> long"""
54f9ee45 6742 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
6743
6744 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6745 def GetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 6746 """GetMacPreferencesMenuItemId() -> long"""
54f9ee45 6747 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
6748
6749 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6750 def GetMacExitMenuItemId(*args, **kwargs):
66c033b4 6751 """GetMacExitMenuItemId() -> long"""
54f9ee45 6752 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
6753
6754 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6755 def GetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 6756 """GetMacHelpMenuTitleName() -> String"""
54f9ee45 6757 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
6758
6759 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6760 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 6761 """SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 6762 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
6763
6764 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6765 def SetMacAboutMenuItemId(*args, **kwargs):
66c033b4 6766 """SetMacAboutMenuItemId(long val)"""
54f9ee45 6767 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
6768
6769 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6770 def SetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 6771 """SetMacPreferencesMenuItemId(long val)"""
54f9ee45 6772 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
6773
6774 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6775 def SetMacExitMenuItemId(*args, **kwargs):
66c033b4 6776 """SetMacExitMenuItemId(long val)"""
54f9ee45 6777 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
6778
6779 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6780 def SetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 6781 """SetMacHelpMenuTitleName(String val)"""
54f9ee45 6782 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
6783
6784 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6785 def _BootstrapApp(*args, **kwargs):
0df68c9f 6786 """
a95a7133 6787 _BootstrapApp(self)
6c3b4aae 6788
0df68c9f
RD
6789 For internal use only
6790 """
54f9ee45 6791 return _core_.PyApp__BootstrapApp(*args, **kwargs)
e811c8ce
RD
6792
6793 def GetComCtl32Version(*args, **kwargs):
0df68c9f 6794 """
66c033b4 6795 GetComCtl32Version() -> int
6c3b4aae 6796
66c033b4
RD
6797 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6798 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 6799 """
54f9ee45 6800 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
e811c8ce
RD
6801
6802 GetComCtl32Version = staticmethod(GetComCtl32Version)
0085ce49
RD
6803PyApp_swigregister = _core_.PyApp_swigregister
6804PyApp_swigregister(PyApp)
d14a1e28 6805
0085ce49
RD
6806def PyApp_IsMainLoopRunning(*args):
6807 """
1fc3b23a
RD
6808 PyApp_IsMainLoopRunning() -> bool
6809
6810 Returns True if we're running the main loop, i.e. if the events can
6811 currently be dispatched.
6812 """
0085ce49 6813 return _core_.PyApp_IsMainLoopRunning(*args)
1fc3b23a 6814
0085ce49
RD
6815def PyApp_GetMacSupportPCMenuShortcuts(*args):
6816 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6817 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d14a1e28 6818
0085ce49
RD
6819def PyApp_GetMacAboutMenuItemId(*args):
6820 """PyApp_GetMacAboutMenuItemId() -> long"""
6821 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d14a1e28 6822
0085ce49
RD
6823def PyApp_GetMacPreferencesMenuItemId(*args):
6824 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6825 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d14a1e28 6826
0085ce49
RD
6827def PyApp_GetMacExitMenuItemId(*args):
6828 """PyApp_GetMacExitMenuItemId() -> long"""
6829 return _core_.PyApp_GetMacExitMenuItemId(*args)
d14a1e28 6830
0085ce49
RD
6831def PyApp_GetMacHelpMenuTitleName(*args):
6832 """PyApp_GetMacHelpMenuTitleName() -> String"""
6833 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d14a1e28 6834
e811c8ce 6835def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
0085ce49
RD
6836 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6837 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 6838
e811c8ce 6839def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
0085ce49
RD
6840 """PyApp_SetMacAboutMenuItemId(long val)"""
6841 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 6842
e811c8ce 6843def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
0085ce49
RD
6844 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6845 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 6846
e811c8ce 6847def PyApp_SetMacExitMenuItemId(*args, **kwargs):
0085ce49
RD
6848 """PyApp_SetMacExitMenuItemId(long val)"""
6849 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d14a1e28 6850
e811c8ce 6851def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
0085ce49
RD
6852 """PyApp_SetMacHelpMenuTitleName(String val)"""
6853 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 6854
0085ce49
RD
6855def PyApp_GetComCtl32Version(*args):
6856 """
0df68c9f 6857 PyApp_GetComCtl32Version() -> int
6c3b4aae 6858
66c033b4
RD
6859 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6860 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 6861 """
0085ce49 6862 return _core_.PyApp_GetComCtl32Version(*args)
d14a1e28
RD
6863
6864#---------------------------------------------------------------------------
6865
6866
0085ce49
RD
6867def Exit(*args):
6868 """
0df68c9f 6869 Exit()
6c3b4aae 6870
0df68c9f
RD
6871 Force an exit of the application. Convenience for wx.GetApp().Exit()
6872 """
0085ce49 6873 return _core_.Exit(*args)
d14a1e28 6874
0085ce49
RD
6875def Yield(*args):
6876 """
0df68c9f 6877 Yield() -> bool
6c3b4aae 6878
0df68c9f
RD
6879 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6880 """
0085ce49 6881 return _core_.Yield(*args)
d14a1e28 6882
0085ce49
RD
6883def YieldIfNeeded(*args):
6884 """
0df68c9f 6885 YieldIfNeeded() -> bool
6c3b4aae 6886
0df68c9f
RD
6887 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6888 """
0085ce49 6889 return _core_.YieldIfNeeded(*args)
d14a1e28 6890
e811c8ce 6891def SafeYield(*args, **kwargs):
0085ce49 6892 """
0df68c9f 6893 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6c3b4aae 6894
66c033b4
RD
6895 This function is similar to `wx.Yield`, except that it disables the
6896 user input to all program windows before calling `wx.Yield` and
6897 re-enables it again afterwards. If ``win`` is not None, this window
6898 will remain enabled, allowing the implementation of some limited user
6899 interaction.
6c3b4aae 6900
66c033b4 6901 :Returns: the result of the call to `wx.Yield`.
0df68c9f 6902 """
0085ce49 6903 return _core_.SafeYield(*args, **kwargs)
d14a1e28 6904
0085ce49
RD
6905def WakeUpIdle(*args):
6906 """
0df68c9f 6907 WakeUpIdle()
6c3b4aae 6908
66c033b4
RD
6909 Cause the message queue to become empty again, so idle events will be
6910 sent.
0df68c9f 6911 """
0085ce49 6912 return _core_.WakeUpIdle(*args)
d14a1e28 6913
e811c8ce 6914def PostEvent(*args, **kwargs):
0085ce49 6915 """
0df68c9f 6916 PostEvent(EvtHandler dest, Event event)
6c3b4aae 6917
66c033b4
RD
6918 Send an event to a window or other wx.EvtHandler to be processed
6919 later.
0df68c9f 6920 """
0085ce49 6921 return _core_.PostEvent(*args, **kwargs)
d14a1e28 6922
0085ce49
RD
6923def App_CleanUp(*args):
6924 """
0df68c9f 6925 App_CleanUp()
6c3b4aae 6926
41e2b43e 6927 For internal use only, it is used to cleanup after wxWidgets when
66c033b4 6928 Python shuts down.
0df68c9f 6929 """
0085ce49 6930 return _core_.App_CleanUp(*args)
d14a1e28 6931
0085ce49
RD
6932def GetApp(*args):
6933 """
0df68c9f 6934 GetApp() -> PyApp
6c3b4aae 6935
196addbf 6936 Return a reference to the current wx.App object.
0df68c9f 6937 """
0085ce49 6938 return _core_.GetApp(*args)
5cbf236d
RD
6939
6940def SetDefaultPyEncoding(*args, **kwargs):
0085ce49 6941 """
5cbf236d
RD
6942 SetDefaultPyEncoding(string encoding)
6943
6944 Sets the encoding that wxPython will use when it needs to convert a
6945 Python string or unicode object to or from a wxString.
e505d15e
RD
6946
6947 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6948 but please be aware that the default encoding within the same locale
6949 may be slightly different on different platforms. For example, please
6950 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6951 between the common latin/roman encodings.
5cbf236d 6952 """
0085ce49 6953 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 6954
0085ce49
RD
6955def GetDefaultPyEncoding(*args):
6956 """
5cbf236d
RD
6957 GetDefaultPyEncoding() -> string
6958
6959 Gets the current encoding that wxPython will use when it needs to
6960 convert a Python string or unicode object to or from a wxString.
6961 """
0085ce49 6962 return _core_.GetDefaultPyEncoding(*args)
d14a1e28
RD
6963#----------------------------------------------------------------------
6964
6965class PyOnDemandOutputWindow:
6c3b4aae
RD
6966 """
6967 A class that can be used for redirecting Python's stdout and
6968 stderr streams. It will do nothing until something is wrriten to
6969 the stream at which point it will create a Frame with a text area
6970 and write the text there.
6971 """
d14a1e28
RD
6972 def __init__(self, title = "wxPython: stdout/stderr"):
6973 self.frame = None
6974 self.title = title
412d302d
RD
6975 self.pos = wx.DefaultPosition
6976 self.size = (450, 300)
d14a1e28
RD
6977 self.parent = None
6978
6979 def SetParent(self, parent):
6c3b4aae 6980 """Set the window to be used as the popup Frame's parent."""
d14a1e28
RD
6981 self.parent = parent
6982
6c3b4aae
RD
6983
6984 def CreateOutputWindow(self, st):
412d302d
RD
6985 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
6986 style=wx.DEFAULT_FRAME_STYLE)
196addbf 6987 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 6988 style=wx.TE_MULTILINE|wx.TE_READONLY)
d1e20054 6989 self.text.AppendText(st)
6c3b4aae
RD
6990 self.frame.Show(True)
6991 EVT_CLOSE(self.frame, self.OnCloseWindow)
6992
d14a1e28 6993
7409c0c6
RD
6994 def OnCloseWindow(self, event):
6995 if self.frame is not None:
6996 self.frame.Destroy()
6997 self.frame = None
6998 self.text = None
6999
7000
d14a1e28 7001 # These methods provide the file-like output behaviour.
6c3b4aae
RD
7002 def write(self, text):
7003 """
7004 Create the output window if needed and write the string to it.
7005 If not called in the context of the gui thread then uses
7006 CallAfter to do the work there.
7007 """
7008 if self.frame is None:
7009 if not wx.Thread_IsMain():
7010 wx.CallAfter(self.CreateOutputWindow, text)
7011 else:
7012 self.CreateOutputWindow(text)
7013 else:
7014 if not wx.Thread_IsMain():
7015 wx.CallAfter(self.text.AppendText, text)
7016 else:
7017 self.text.AppendText(text)
7018
d14a1e28
RD
7019
7020 def close(self):
6c3b4aae
RD
7021 if self.frame is not None:
7022 wx.CallAfter(self.frame.Close)
7023
d14a1e28 7024
19272049
RD
7025 def flush(self):
7026 pass
7027
7028
d14a1e28
RD
7029
7030#----------------------------------------------------------------------
d14a1e28
RD
7031
7032_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
7033
7034class App(wx.PyApp):
6c3b4aae 7035 """
66c033b4
RD
7036 The ``wx.App`` class represents the application and is used to:
7037
7038 * bootstrap the wxPython system and initialize the underlying
7039 gui toolkit
7040 * set and get application-wide properties
7041 * implement the windowing system main message or event loop,
7042 and to dispatch events to window instances
7043 * etc.
7044
7045 Every application must have a ``wx.App`` instance, and all
7046 creation of UI objects should be delayed until after the
03e37cd5
RD
7047 ``wx.App`` object has been created in order to ensure that the gui
7048 platform and wxWidgets have been fully initialized.
66c033b4
RD
7049
7050 Normally you would derive from this class and implement an
7051 ``OnInit`` method that creates a frame and then calls
7052 ``self.SetTopWindow(frame)``.
7053
03e37cd5 7054 :see: `wx.PySimpleApp` for a simpler app class that can be used
1c0f361b 7055 directly.
6c3b4aae 7056 """
66c033b4 7057
d14a1e28
RD
7058 outputWindowClass = PyOnDemandOutputWindow
7059
03e37cd5
RD
7060 def __init__(self, redirect=_defRedirect, filename=None,
7061 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7062 """
7063 Construct a ``wx.App`` object.
7064
03e37cd5
RD
7065 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7066 redirected? Defaults to True on Windows and Mac, False
7067 otherwise. If `filename` is None then output will be
7068 redirected to a window that pops up as needed. (You can
7069 control what kind of window is created for the output by
7070 resetting the class variable ``outputWindowClass`` to a
7071 class of your choosing.)
66c033b4 7072
03e37cd5
RD
7073 :param filename: The name of a file to redirect output to, if
7074 redirect is True.
66c033b4
RD
7075
7076 :param useBestVisual: Should the app try to use the best
03e37cd5
RD
7077 available visual provided by the system (only relevant on
7078 systems that have more than one visual.) This parameter
7079 must be used instead of calling `SetUseBestVisual` later
7080 on because it must be set before the underlying GUI
7081 toolkit is initialized.
7082
7083 :param clearSigInt: Should SIGINT be cleared? This allows the
7084 app to terminate upon a Ctrl-C in the console like other
7085 GUI apps will.
66c033b4
RD
7086
7087 :note: You should override OnInit to do applicaition
7088 initialization to ensure that the system, toolkit and
7089 wxWidgets are fully initialized.
7090 """
d14a1e28
RD
7091 wx.PyApp.__init__(self)
7092
7093 if wx.Platform == "__WXMAC__":
7094 try:
7095 import MacOS
7096 if not MacOS.WMAvailable():
7097 print """\
7098This program needs access to the screen. Please run with 'pythonw',
7099not 'python', and only when you are logged in on the main display of
7100your Mac."""
7101 _sys.exit(1)
36cadbf7
RD
7102 except SystemExit:
7103 raise
d14a1e28
RD
7104 except:
7105 pass
7106
7107 # This has to be done before OnInit
7108 self.SetUseBestVisual(useBestVisual)
7109
7110 # Set the default handler for SIGINT. This fixes a problem
7111 # where if Ctrl-C is pressed in the console that started this
7112 # app then it will not appear to do anything, (not even send
7113 # KeyboardInterrupt???) but will later segfault on exit. By
7114 # setting the default handler then the app will exit, as
7115 # expected (depending on platform.)
03e37cd5
RD
7116 if clearSigInt:
7117 try:
7118 import signal
7119 signal.signal(signal.SIGINT, signal.SIG_DFL)
7120 except:
7121 pass
d14a1e28
RD
7122
7123 # Save and redirect the stdio to a window?
7124 self.stdioWin = None
7125 self.saveStdio = (_sys.stdout, _sys.stderr)
7126 if redirect:
7127 self.RedirectStdio(filename)
7128
8fb0e70a
RD
7129 # Use Python's install prefix as the default
7130 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7131
d14a1e28
RD
7132 # This finishes the initialization of wxWindows and then calls
7133 # the OnInit that should be present in the derived class
7134 self._BootstrapApp()
7135
7136
02b455f2
RD
7137 def __del__(self, destroy=wx.PyApp.__del__):
7138 self.RestoreStdio() # Just in case the MainLoop was overridden
7139 destroy(self)
d14a1e28 7140
70b7a5fe
RD
7141 def Destroy(self):
7142 wx.PyApp.Destroy(self)
7143 self.thisown = 0
d14a1e28
RD
7144
7145 def SetTopWindow(self, frame):
1e0c8722 7146 """Set the \"main\" top level window"""
d14a1e28
RD
7147 if self.stdioWin:
7148 self.stdioWin.SetParent(frame)
7149 wx.PyApp.SetTopWindow(self, frame)
7150
7151
7152 def MainLoop(self):
1e0c8722 7153 """Execute the main GUI event loop"""
d14a1e28
RD
7154 wx.PyApp.MainLoop(self)
7155 self.RestoreStdio()
7156
7157
7409c0c6 7158 def RedirectStdio(self, filename=None):
1e0c8722 7159 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
d14a1e28
RD
7160 if filename:
7161 _sys.stdout = _sys.stderr = open(filename, 'a')
7162 else:
7163 self.stdioWin = self.outputWindowClass()
7164 _sys.stdout = _sys.stderr = self.stdioWin
7165
7166
7167 def RestoreStdio(self):
02b455f2
RD
7168 try:
7169 _sys.stdout, _sys.stderr = self.saveStdio
7170 except:
7171 pass
d14a1e28
RD
7172
7173
412d302d
RD
7174 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7175 """
7176 Set the title, position and/or size of the output window if
f5b96ee1
RD
7177 the stdio has been redirected. This should be called before
7178 any output would cause the output window to be created.
412d302d
RD
7179 """
7180 if self.stdioWin:
7181 if title is not None:
7182 self.stdioWin.title = title
7183 if pos is not None:
7184 self.stdioWin.pos = pos
7185 if size is not None:
7186 self.stdioWin.size = size
7187
7188
7189
d14a1e28 7190
66c033b4 7191# change from wx.PyApp_XX to wx.App_XX
54f9ee45
RD
7192App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7193App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7194App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7195App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7196App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7197App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7198App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7199App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7200App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7201App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7202App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
d14a1e28
RD
7203
7204#----------------------------------------------------------------------------
7205
7206class PySimpleApp(wx.App):
6c3b4aae
RD
7207 """
7208 A simple application class. You can just create one of these and
7209 then then make your top level windows later, and not have to worry
66c033b4
RD
7210 about OnInit. For example::
7211
7212 app = wx.PySimpleApp()
7213 frame = wx.Frame(None, title='Hello World')
7214 frame.Show()
7215 app.MainLoop()
7216
7217 :see: `wx.App`
7218 """
6c3b4aae 7219
03e37cd5
RD
7220 def __init__(self, redirect=False, filename=None,
7221 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7222 """
7223 :see: `wx.App.__init__`
7224 """
03e37cd5 7225 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
6c3b4aae 7226
d14a1e28 7227 def OnInit(self):
d14a1e28
RD
7228 return True
7229
7230
66c033b4 7231
6c3b4aae 7232# Is anybody using this one?
d14a1e28
RD
7233class PyWidgetTester(wx.App):
7234 def __init__(self, size = (250, 100)):
7235 self.size = size
7236 wx.App.__init__(self, 0)
7237
7238 def OnInit(self):
196addbf 7239 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
d14a1e28
RD
7240 self.SetTopWindow(self.frame)
7241 return True
7242
66c033b4
RD
7243 def SetWidget(self, widgetClass, *args, **kwargs):
7244 w = widgetClass(self.frame, *args, **kwargs)
d14a1e28
RD
7245 self.frame.Show(True)
7246
7247#----------------------------------------------------------------------------
7248# DO NOT hold any other references to this object. This is how we
66c033b4 7249# know when to cleanup system resources that wxWidgets is holding. When
d14a1e28 7250# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
66c033b4 7251# goes to zero and it calls the wx.App_CleanUp function.
d14a1e28
RD
7252
7253class __wxPyCleanup:
7254 def __init__(self):
54f9ee45 7255 self.cleanup = _core_.App_CleanUp
d14a1e28
RD
7256 def __del__(self):
7257 self.cleanup()
7258
7259_sys.__wxPythonCleanup = __wxPyCleanup()
7260
7261## # another possible solution, but it gets called too early...
66c033b4
RD
7262## import atexit
7263## atexit.register(_core_.wxApp_CleanUp)
d14a1e28
RD
7264
7265
7266#----------------------------------------------------------------------------
7267
7268#---------------------------------------------------------------------------
2ef75293
RD
7269
7270class EventLoop(object):
093d3ff1 7271 """Proxy of C++ EventLoop class"""
0085ce49
RD
7272 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7273 __repr__ = _swig_repr
7274 def __init__(self, *args, **kwargs):
2ef75293 7275 """__init__(self) -> EventLoop"""
0085ce49
RD
7276 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7277 __swig_destroy__ = _core_.delete_EventLoop
7278 __del__ = lambda self : None;
2ef75293
RD
7279 def Run(*args, **kwargs):
7280 """Run(self) -> int"""
7281 return _core_.EventLoop_Run(*args, **kwargs)
7282
7283 def Exit(*args, **kwargs):
7284 """Exit(self, int rc=0)"""
7285 return _core_.EventLoop_Exit(*args, **kwargs)
7286
7287 def Pending(*args, **kwargs):
7288 """Pending(self) -> bool"""
7289 return _core_.EventLoop_Pending(*args, **kwargs)
7290
7291 def Dispatch(*args, **kwargs):
7292 """Dispatch(self) -> bool"""
7293 return _core_.EventLoop_Dispatch(*args, **kwargs)
7294
7295 def IsRunning(*args, **kwargs):
7296 """IsRunning(self) -> bool"""
7297 return _core_.EventLoop_IsRunning(*args, **kwargs)
7298
7299 def GetActive(*args, **kwargs):
7300 """GetActive() -> EventLoop"""
7301 return _core_.EventLoop_GetActive(*args, **kwargs)
7302
7303 GetActive = staticmethod(GetActive)
7304 def SetActive(*args, **kwargs):
7305 """SetActive(EventLoop loop)"""
7306 return _core_.EventLoop_SetActive(*args, **kwargs)
7307
7308 SetActive = staticmethod(SetActive)
0085ce49
RD
7309EventLoop_swigregister = _core_.EventLoop_swigregister
7310EventLoop_swigregister(EventLoop)
2ef75293 7311
0085ce49
RD
7312def EventLoop_GetActive(*args):
7313 """EventLoop_GetActive() -> EventLoop"""
7314 return _core_.EventLoop_GetActive(*args)
2ef75293
RD
7315
7316def EventLoop_SetActive(*args, **kwargs):
0085ce49
RD
7317 """EventLoop_SetActive(EventLoop loop)"""
7318 return _core_.EventLoop_SetActive(*args, **kwargs)
2ef75293 7319
091f5bed
RD
7320class EventLoopActivator(object):
7321 """Proxy of C++ EventLoopActivator class"""
0085ce49
RD
7322 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7323 __repr__ = _swig_repr
7324 def __init__(self, *args, **kwargs):
091f5bed 7325 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
0085ce49
RD
7326 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7327 __swig_destroy__ = _core_.delete_EventLoopActivator
7328 __del__ = lambda self : None;
7329EventLoopActivator_swigregister = _core_.EventLoopActivator_swigregister
7330EventLoopActivator_swigregister(EventLoopActivator)
091f5bed 7331
2ef75293 7332#---------------------------------------------------------------------------
d14a1e28 7333
1e0c8722 7334class AcceleratorEntry(object):
66c033b4
RD
7335 """
7336 A class used to define items in an `wx.AcceleratorTable`. wxPython
7337 programs can choose to use wx.AcceleratorEntry objects, but using a
7338 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
41e2b43e 7339 as well. See `__init__` for of the tuple values.
66c033b4
RD
7340
7341 :see: `wx.AcceleratorTable`
7342 """
0085ce49
RD
7343 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7344 __repr__ = _swig_repr
7345 def __init__(self, *args, **kwargs):
66c033b4
RD
7346 """
7347 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7348
7349 Construct a wx.AcceleratorEntry.
66c033b4 7350 """
0085ce49
RD
7351 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7352 __swig_destroy__ = _core_.delete_AcceleratorEntry
7353 __del__ = lambda self : None;
1e0c8722 7354 def Set(*args, **kwargs):
66c033b4
RD
7355 """
7356 Set(self, int flags, int keyCode, int cmd)
1e0c8722 7357
66c033b4
RD
7358 (Re)set the attributes of a wx.AcceleratorEntry.
7359 :see `__init__`
7360 """
7361 return _core_.AcceleratorEntry_Set(*args, **kwargs)
1e0c8722
RD
7362
7363 def GetFlags(*args, **kwargs):
66c033b4
RD
7364 """
7365 GetFlags(self) -> int
7366
7367 Get the AcceleratorEntry's flags.
7368 """
54f9ee45 7369 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
1e0c8722
RD
7370
7371 def GetKeyCode(*args, **kwargs):
66c033b4
RD
7372 """
7373 GetKeyCode(self) -> int
7374
7375 Get the AcceleratorEntry's keycode.
7376 """
54f9ee45 7377 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
1e0c8722
RD
7378
7379 def GetCommand(*args, **kwargs):
66c033b4
RD
7380 """
7381 GetCommand(self) -> int
7382
7383 Get the AcceleratorEntry's command ID.
7384 """
54f9ee45 7385 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
1e0c8722 7386
0085ce49
RD
7387AcceleratorEntry_swigregister = _core_.AcceleratorEntry_swigregister
7388AcceleratorEntry_swigregister(AcceleratorEntry)
1e0c8722
RD
7389
7390class AcceleratorTable(Object):
66c033b4
RD
7391 """
7392 An accelerator table allows the application to specify a table of
7393 keyboard shortcuts for menus or other commands. On Windows, menu or
7394 button commands are supported; on GTK, only menu commands are
7395 supported.
66c033b4 7396 """
0085ce49
RD
7397 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7398 __repr__ = _swig_repr
7399 def __init__(self, *args, **kwargs):
0df68c9f
RD
7400 """
7401 __init__(entries) -> AcceleratorTable
1e0c8722 7402
66c033b4
RD
7403 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7404 items or or of 3-tuples (flags, keyCode, cmdID)
7405
7406 :see: `wx.AcceleratorEntry`
0df68c9f 7407 """
0085ce49
RD
7408 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7409 __swig_destroy__ = _core_.delete_AcceleratorTable
7410 __del__ = lambda self : None;
1e0c8722 7411 def Ok(*args, **kwargs):
a95a7133 7412 """Ok(self) -> bool"""
54f9ee45 7413 return _core_.AcceleratorTable_Ok(*args, **kwargs)
1e0c8722 7414
0085ce49
RD
7415AcceleratorTable_swigregister = _core_.AcceleratorTable_swigregister
7416AcceleratorTable_swigregister(AcceleratorTable)
1e0c8722
RD
7417
7418
7419def GetAccelFromString(*args, **kwargs):
0085ce49
RD
7420 """GetAccelFromString(String label) -> AcceleratorEntry"""
7421 return _core_.GetAccelFromString(*args, **kwargs)
1e0c8722
RD
7422#---------------------------------------------------------------------------
7423
74a57fcd
RD
7424class VisualAttributes(object):
7425 """struct containing all the visual attributes of a control"""
0085ce49
RD
7426 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7427 __repr__ = _swig_repr
7428 def __init__(self, *args, **kwargs):
74a57fcd 7429 """
a95a7133 7430 __init__(self) -> VisualAttributes
74a57fcd
RD
7431
7432 struct containing all the visual attributes of a control
7433 """
0085ce49
RD
7434 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7435 __swig_destroy__ = _core_.delete_VisualAttributes
7436 __del__ = lambda self : None;
54f9ee45
RD
7437 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7438 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7439 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
0085ce49
RD
7440VisualAttributes_swigregister = _core_.VisualAttributes_swigregister
7441VisualAttributes_swigregister(VisualAttributes)
74a57fcd
RD
7442NullAcceleratorTable = cvar.NullAcceleratorTable
7443PanelNameStr = cvar.PanelNameStr
7444
54f9ee45
RD
7445WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7446WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7447WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7448WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7449WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
d14a1e28 7450class Window(EvtHandler):
15afbcd0
RD
7451 """
7452 wx.Window is the base class for all windows and represents any visible
7453 object on the screen. All controls, top level windows and so on are
7454 wx.Windows. Sizers and device contexts are not however, as they don't
7455 appear on screen themselves.
7456
7457 """
0085ce49
RD
7458 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7459 __repr__ = _swig_repr
7460 def __init__(self, *args, **kwargs):
0df68c9f 7461 """
a95a7133 7462 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 7463 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
15afbcd0
RD
7464
7465 Construct and show a generic Window.
0df68c9f 7466 """
0085ce49 7467 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d14a1e28 7468 self._setOORInfo(self)
d14a1e28 7469
e811c8ce 7470 def Create(*args, **kwargs):
0df68c9f 7471 """
a95a7133 7472 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 7473 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
15afbcd0
RD
7474
7475 Create the GUI part of the Window for 2-phase creation mode.
0df68c9f 7476 """
54f9ee45 7477 return _core_.Window_Create(*args, **kwargs)
d14a1e28 7478
e811c8ce 7479 def Close(*args, **kwargs):
15afbcd0 7480 """
a95a7133 7481 Close(self, bool force=False) -> bool
15afbcd0
RD
7482
7483 This function simply generates a EVT_CLOSE event whose handler usually
7484 tries to close the window. It doesn't close the window itself,
7485 however. If force is False (the default) then the window's close
7486 handler will be allowed to veto the destruction of the window.
15afbcd0 7487 """
54f9ee45 7488 return _core_.Window_Close(*args, **kwargs)
d14a1e28 7489
e811c8ce 7490 def Destroy(*args, **kwargs):
0df68c9f 7491 """
a95a7133 7492 Destroy(self) -> bool
d14a1e28 7493
15afbcd0
RD
7494 Destroys the window safely. Frames and dialogs are not destroyed
7495 immediately when this function is called -- they are added to a list
7496 of windows to be deleted on idle time, when all the window's events
7497 have been processed. This prevents problems with events being sent to
7498 non-existent windows.
7499
7500 Returns True if the window has either been successfully deleted, or it
7501 has been added to the list of windows pending real deletion.
0df68c9f 7502 """
7e08d4ef
RD
7503 val = _core_.Window_Destroy(*args, **kwargs)
7504 args[0].thisown = 0
7505 return val
d14a1e28 7506
e811c8ce 7507 def DestroyChildren(*args, **kwargs):
15afbcd0 7508 """
a95a7133 7509 DestroyChildren(self) -> bool
15afbcd0 7510
41e2b43e
RD
7511 Destroys all children of a window. Called automatically by the
7512 destructor.
15afbcd0 7513 """
54f9ee45 7514 return _core_.Window_DestroyChildren(*args, **kwargs)
d14a1e28 7515
e811c8ce 7516 def IsBeingDeleted(*args, **kwargs):
15afbcd0 7517 """
a95a7133 7518 IsBeingDeleted(self) -> bool
15afbcd0
RD
7519
7520 Is the window in the process of being deleted?
7521 """
54f9ee45 7522 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d14a1e28 7523
e811c8ce 7524 def SetLabel(*args, **kwargs):
15afbcd0 7525 """
a95a7133 7526 SetLabel(self, String label)
15afbcd0
RD
7527
7528 Set the text which the window shows in its label if applicable.
7529 """
54f9ee45 7530 return _core_.Window_SetLabel(*args, **kwargs)
d14a1e28 7531
e811c8ce 7532 def GetLabel(*args, **kwargs):
15afbcd0 7533 """
a95a7133 7534 GetLabel(self) -> String
15afbcd0 7535
41e2b43e
RD
7536 Generic way of getting a label from any window, for identification
7537 purposes. The interpretation of this function differs from class to
7538 class. For frames and dialogs, the value returned is the title. For
7539 buttons or static text controls, it is the button text. This function
7540 can be useful for meta-programs such as testing tools or special-needs
7541 access programs)which need to identify windows by name.
15afbcd0 7542 """
54f9ee45 7543 return _core_.Window_GetLabel(*args, **kwargs)
d14a1e28 7544
e811c8ce 7545 def SetName(*args, **kwargs):
15afbcd0 7546 """
a95a7133 7547 SetName(self, String name)
15afbcd0 7548
41e2b43e
RD
7549 Sets the window's name. The window name is used for ressource setting
7550 in X, it is not the same as the window title/label
15afbcd0 7551 """
54f9ee45 7552 return _core_.Window_SetName(*args, **kwargs)
d14a1e28 7553
e811c8ce 7554 def GetName(*args, **kwargs):
15afbcd0 7555 """
a95a7133 7556 GetName(self) -> String
15afbcd0 7557
41e2b43e
RD
7558 Returns the windows name. This name is not guaranteed to be unique;
7559 it is up to the programmer to supply an appropriate name in the window
7560 constructor or via wx.Window.SetName.
15afbcd0 7561 """
54f9ee45 7562 return _core_.Window_GetName(*args, **kwargs)
d14a1e28 7563
4276dc52
RD
7564 def SetWindowVariant(*args, **kwargs):
7565 """
a95a7133 7566 SetWindowVariant(self, int variant)
4276dc52 7567
41e2b43e
RD
7568 Sets the variant of the window/font size to use for this window, if
7569 the platform supports variants, for example, wxMac.
4276dc52 7570 """
54f9ee45 7571 return _core_.Window_SetWindowVariant(*args, **kwargs)
4276dc52
RD
7572
7573 def GetWindowVariant(*args, **kwargs):
a95a7133 7574 """GetWindowVariant(self) -> int"""
54f9ee45 7575 return _core_.Window_GetWindowVariant(*args, **kwargs)
4276dc52 7576
e811c8ce 7577 def SetId(*args, **kwargs):
15afbcd0 7578 """
a95a7133 7579 SetId(self, int winid)
15afbcd0
RD
7580
7581 Sets the identifier of the window. Each window has an integer
7582 identifier. If the application has not provided one, an identifier
7583 will be generated. Normally, the identifier should be provided on
7584 creation and should not be modified subsequently.
7585 """
54f9ee45 7586 return _core_.Window_SetId(*args, **kwargs)
d14a1e28 7587
e811c8ce 7588 def GetId(*args, **kwargs):
15afbcd0 7589 """
a95a7133 7590 GetId(self) -> int
15afbcd0
RD
7591
7592 Returns the identifier of the window. Each window has an integer
7593 identifier. If the application has not provided one (or the default Id
7594 -1 is used) then an unique identifier with a negative value will be
7595 generated.
7596 """
54f9ee45 7597 return _core_.Window_GetId(*args, **kwargs)
d14a1e28 7598
e811c8ce 7599 def NewControlId(*args, **kwargs):
15afbcd0 7600 """
66c033b4 7601 NewControlId() -> int
15afbcd0
RD
7602
7603 Generate a control id for the controls which were not given one.
7604 """
54f9ee45 7605 return _core_.Window_NewControlId(*args, **kwargs)
d14a1e28 7606
e811c8ce
RD
7607 NewControlId = staticmethod(NewControlId)
7608 def NextControlId(*args, **kwargs):
15afbcd0 7609 """
66c033b4 7610 NextControlId(int winid) -> int
15afbcd0
RD
7611
7612 Get the id of the control following the one with the given
41e2b43e 7613 autogenerated) id
15afbcd0 7614 """
54f9ee45 7615 return _core_.Window_NextControlId(*args, **kwargs)
d14a1e28 7616
e811c8ce
RD
7617 NextControlId = staticmethod(NextControlId)
7618 def PrevControlId(*args, **kwargs):
15afbcd0 7619 """
66c033b4 7620 PrevControlId(int winid) -> int
15afbcd0
RD
7621
7622 Get the id of the control preceding the one with the given
41e2b43e 7623 autogenerated) id
15afbcd0 7624 """
54f9ee45 7625 return _core_.Window_PrevControlId(*args, **kwargs)
d14a1e28 7626
e811c8ce
RD
7627 PrevControlId = staticmethod(PrevControlId)
7628 def SetSize(*args, **kwargs):
15afbcd0 7629 """
a95a7133 7630 SetSize(self, Size size)
15afbcd0
RD
7631
7632 Sets the size of the window in pixels.
7633 """
54f9ee45 7634 return _core_.Window_SetSize(*args, **kwargs)
d14a1e28 7635
e811c8ce 7636 def SetDimensions(*args, **kwargs):
15afbcd0 7637 """
a95a7133 7638 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
7639
7640 Sets the position and size of the window in pixels. The sizeFlags
7641 parameter indicates the interpretation of the other params if they are
e505d15e
RD
7642 equal to -1.
7643
7644 ======================== ======================================
7645 wx.SIZE_AUTO A -1 indicates that a class-specific
7646 default should be used.
7647 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7648 -1 values are supplied.
7649 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7650 interpreted as real dimensions, not
7651 default values.
7652 ======================== ======================================
7653
15afbcd0 7654 """
54f9ee45 7655 return _core_.Window_SetDimensions(*args, **kwargs)
d14a1e28 7656
e811c8ce 7657 def SetRect(*args, **kwargs):
15afbcd0 7658 """
a95a7133 7659 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
7660
7661 Sets the position and size of the window in pixels using a wx.Rect.
7662 """
54f9ee45 7663 return _core_.Window_SetRect(*args, **kwargs)
d14a1e28 7664
e811c8ce 7665 def SetSizeWH(*args, **kwargs):
15afbcd0 7666 """
a95a7133 7667 SetSizeWH(self, int width, int height)
15afbcd0
RD
7668
7669 Sets the size of the window in pixels.
7670 """
54f9ee45 7671 return _core_.Window_SetSizeWH(*args, **kwargs)
d14a1e28 7672
e811c8ce 7673 def Move(*args, **kwargs):
15afbcd0 7674 """
a95a7133 7675 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
7676
7677 Moves the window to the given position.
7678 """
54f9ee45 7679 return _core_.Window_Move(*args, **kwargs)
d14a1e28 7680
e811c8ce
RD
7681 SetPosition = Move
7682 def MoveXY(*args, **kwargs):
15afbcd0 7683 """
a95a7133 7684 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
7685
7686 Moves the window to the given position.
7687 """
54f9ee45 7688 return _core_.Window_MoveXY(*args, **kwargs)
e811c8ce 7689
f8167d6e
RD
7690 def SetBestFittingSize(*args, **kwargs):
7691 """
7692 SetBestFittingSize(self, Size size=DefaultSize)
7693
7694 A 'Smart' SetSize that will fill in default size components with the
7695 window's *best size* values. Also set's the minsize for use with sizers.
7696 """
7697 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7698
e811c8ce 7699 def Raise(*args, **kwargs):
15afbcd0 7700 """
a95a7133 7701 Raise(self)
15afbcd0 7702
943e8dfd
RD
7703 Raises the window to the top of the window hierarchy. In current
7704 version of wxWidgets this works both for manage and child windows.
15afbcd0 7705 """
54f9ee45 7706 return _core_.Window_Raise(*args, **kwargs)
e811c8ce
RD
7707
7708 def Lower(*args, **kwargs):
15afbcd0 7709 """
a95a7133 7710 Lower(self)
15afbcd0 7711
943e8dfd
RD
7712 Lowers the window to the bottom of the window hierarchy. In current
7713 version of wxWidgets this works both for manage and child windows.
15afbcd0 7714 """
54f9ee45 7715 return _core_.Window_Lower(*args, **kwargs)
e811c8ce
RD
7716
7717 def SetClientSize(*args, **kwargs):
15afbcd0 7718 """
a95a7133 7719 SetClientSize(self, Size size)
15afbcd0
RD
7720
7721 This sets the size of the window client area in pixels. Using this
7722 function to size a window tends to be more device-independent than
7723 wx.Window.SetSize, since the application need not worry about what
7724 dimensions the border or title bar have when trying to fit the window
7725 around panel items, for example.
7726 """
54f9ee45 7727 return _core_.Window_SetClientSize(*args, **kwargs)
e811c8ce
RD
7728
7729 def SetClientSizeWH(*args, **kwargs):
15afbcd0 7730 """
a95a7133 7731 SetClientSizeWH(self, int width, int height)
15afbcd0
RD
7732
7733 This sets the size of the window client area in pixels. Using this
7734 function to size a window tends to be more device-independent than
7735 wx.Window.SetSize, since the application need not worry about what
7736 dimensions the border or title bar have when trying to fit the window
7737 around panel items, for example.
7738 """
54f9ee45 7739 return _core_.Window_SetClientSizeWH(*args, **kwargs)
e811c8ce
RD
7740
7741 def SetClientRect(*args, **kwargs):
15afbcd0 7742 """
a95a7133 7743 SetClientRect(self, Rect rect)
15afbcd0
RD
7744
7745 This sets the size of the window client area in pixels. Using this
7746 function to size a window tends to be more device-independent than
7747 wx.Window.SetSize, since the application need not worry about what
7748 dimensions the border or title bar have when trying to fit the window
7749 around panel items, for example.
7750 """
54f9ee45 7751 return _core_.Window_SetClientRect(*args, **kwargs)
e811c8ce
RD
7752
7753 def GetPosition(*args, **kwargs):
0df68c9f 7754 """
a95a7133 7755 GetPosition(self) -> Point
e811c8ce 7756
75219dcb
RD
7757 Get the window's position. Notice that the position is in client
7758 coordinates for child windows and screen coordinates for the top level
7759 ones, use `GetScreenPosition` if you need screen coordinates for all
7760 kinds of windows.
0df68c9f 7761 """
54f9ee45 7762 return _core_.Window_GetPosition(*args, **kwargs)
e811c8ce
RD
7763
7764 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
7765 """
7766 GetPositionTuple() -> (x,y)
e811c8ce 7767
75219dcb
RD
7768 Get the window's position. Notice that the position is in client
7769 coordinates for child windows and screen coordinates for the top level
7770 ones, use `GetScreenPosition` if you need screen coordinates for all
7771 kinds of windows.
0df68c9f 7772 """
54f9ee45 7773 return _core_.Window_GetPositionTuple(*args, **kwargs)
e811c8ce 7774
75219dcb
RD
7775 def GetScreenPosition(*args, **kwargs):
7776 """
7777 GetScreenPosition(self) -> Point
7778
7779 Get the position of the window in screen coordinantes.
7780 """
7781 return _core_.Window_GetScreenPosition(*args, **kwargs)
7782
7783 def GetScreenPositionTuple(*args, **kwargs):
7784 """
7785 GetScreenPositionTuple() -> (x,y)
7786
7787 Get the position of the window in screen coordinantes.
7788 """
7789 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7790
7791 def GetScreenRect(*args, **kwargs):
7792 """
7793 GetScreenRect(self) -> Rect
7794
7795 Returns the size and position of the window in screen coordinantes as
7796 a `wx.Rect` object.
7797 """
7798 return _core_.Window_GetScreenRect(*args, **kwargs)
7799
e811c8ce 7800 def GetSize(*args, **kwargs):
0df68c9f 7801 """
a95a7133 7802 GetSize(self) -> Size
e811c8ce 7803
0df68c9f
RD
7804 Get the window size.
7805 """
54f9ee45 7806 return _core_.Window_GetSize(*args, **kwargs)
e811c8ce
RD
7807
7808 def GetSizeTuple(*args, **kwargs):
0df68c9f
RD
7809 """
7810 GetSizeTuple() -> (width, height)
e811c8ce 7811
0df68c9f
RD
7812 Get the window size.
7813 """
54f9ee45 7814 return _core_.Window_GetSizeTuple(*args, **kwargs)
e811c8ce
RD
7815
7816 def GetRect(*args, **kwargs):
15afbcd0 7817 """
a95a7133 7818 GetRect(self) -> Rect
15afbcd0 7819
75219dcb 7820 Returns the size and position of the window as a `wx.Rect` object.
15afbcd0 7821 """
54f9ee45 7822 return _core_.Window_GetRect(*args, **kwargs)
e811c8ce
RD
7823
7824 def GetClientSize(*args, **kwargs):
0df68c9f 7825 """
a95a7133 7826 GetClientSize(self) -> Size
e811c8ce 7827
15afbcd0
RD
7828 This gets the size of the window's 'client area' in pixels. The client
7829 area is the area which may be drawn on by the programmer, excluding
7830 title bar, border, scrollbars, etc.
0df68c9f 7831 """
54f9ee45 7832 return _core_.Window_GetClientSize(*args, **kwargs)
e811c8ce
RD
7833
7834 def GetClientSizeTuple(*args, **kwargs):
0df68c9f
RD
7835 """
7836 GetClientSizeTuple() -> (width, height)
e811c8ce 7837
15afbcd0
RD
7838 This gets the size of the window's 'client area' in pixels. The client
7839 area is the area which may be drawn on by the programmer, excluding
7840 title bar, border, scrollbars, etc.
0df68c9f 7841 """
54f9ee45 7842 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
e811c8ce
RD
7843
7844 def GetClientAreaOrigin(*args, **kwargs):
15afbcd0 7845 """
a95a7133 7846 GetClientAreaOrigin(self) -> Point
15afbcd0
RD
7847
7848 Get the origin of the client area of the window relative to the
7849 window's top left corner (the client area may be shifted because of
7850 the borders, scrollbars, other decorations...)
7851 """
54f9ee45 7852 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
e811c8ce
RD
7853
7854 def GetClientRect(*args, **kwargs):
15afbcd0 7855 """
a95a7133 7856 GetClientRect(self) -> Rect
15afbcd0 7857
61863841 7858 Get the client area position and size as a `wx.Rect` object.
15afbcd0 7859 """
54f9ee45 7860 return _core_.Window_GetClientRect(*args, **kwargs)
e811c8ce
RD
7861
7862 def GetBestSize(*args, **kwargs):
0df68c9f 7863 """
a95a7133 7864 GetBestSize(self) -> Size
e811c8ce 7865
248ed943 7866 This function returns the best acceptable minimal size for the
41e2b43e
RD
7867 window, if applicable. For example, for a static text control, it will
7868 be the minimal size such that the control label is not truncated. For
7869 windows containing subwindows (suzh aswx.Panel), the size returned by
7870 this function will be the same as the size the window would have had
7871 after calling Fit.
0df68c9f 7872 """
54f9ee45 7873 return _core_.Window_GetBestSize(*args, **kwargs)
e811c8ce
RD
7874
7875 def GetBestSizeTuple(*args, **kwargs):
0df68c9f
RD
7876 """
7877 GetBestSizeTuple() -> (width, height)
e811c8ce 7878
248ed943 7879 This function returns the best acceptable minimal size for the
41e2b43e
RD
7880 window, if applicable. For example, for a static text control, it will
7881 be the minimal size such that the control label is not truncated. For
7882 windows containing subwindows (suzh aswx.Panel), the size returned by
7883 this function will be the same as the size the window would have had
7884 after calling Fit.
0df68c9f 7885 """
54f9ee45 7886 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
e811c8ce 7887
dfbb5885
RD
7888 def InvalidateBestSize(*args, **kwargs):
7889 """
7890 InvalidateBestSize(self)
7891
7892 Reset the cached best size value so it will be recalculated the next
7893 time it is needed.
7894 """
7895 return _core_.Window_InvalidateBestSize(*args, **kwargs)
7896
e2813725
RD
7897 def CacheBestSize(*args, **kwargs):
7898 """
7899 CacheBestSize(self, Size size)
7900
7901 Cache the best size so it doesn't need to be calculated again, (at least until
7902 some properties of the window change.)
7903 """
7904 return _core_.Window_CacheBestSize(*args, **kwargs)
7905
dfbb5885
RD
7906 def GetBestFittingSize(*args, **kwargs):
7907 """
7908 GetBestFittingSize(self) -> Size
7909
7910 This function will merge the window's best size into the window's
7911 minimum size, giving priority to the min size components, and returns
7912 the results.
7913
7914 """
7915 return _core_.Window_GetBestFittingSize(*args, **kwargs)
7916
e811c8ce 7917 def GetAdjustedBestSize(*args, **kwargs):
15afbcd0 7918 """
a95a7133 7919 GetAdjustedBestSize(self) -> Size
15afbcd0
RD
7920
7921 This method is similar to GetBestSize, except in one
7922 thing. GetBestSize should return the minimum untruncated size of the
7923 window, while this method will return the largest of BestSize and any
7924 user specified minimum size. ie. it is the minimum size the window
7925 should currently be drawn at, not the minimal size it can possibly
7926 tolerate.
7927 """
54f9ee45 7928 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
e811c8ce
RD
7929
7930 def Center(*args, **kwargs):
15afbcd0 7931 """
a95a7133 7932 Center(self, int direction=BOTH)
15afbcd0
RD
7933
7934 Centers the window. The parameter specifies the direction for
7935 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7936 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7937 on the entire screen and not on its parent window. If it is a
7938 top-level window and has no parent then it will always be centered
7939 relative to the screen.
7940 """
54f9ee45 7941 return _core_.Window_Center(*args, **kwargs)
e811c8ce
RD
7942
7943 Centre = Center
e811c8ce 7944 def CenterOnParent(*args, **kwargs):
15afbcd0 7945 """
a95a7133 7946 CenterOnParent(self, int dir=BOTH)
15afbcd0
RD
7947
7948 Center with respect to the the parent window
7949 """
54f9ee45 7950 return _core_.Window_CenterOnParent(*args, **kwargs)
e811c8ce
RD
7951
7952 CentreOnParent = CenterOnParent
7953 def Fit(*args, **kwargs):
15afbcd0 7954 """
a95a7133 7955 Fit(self)
15afbcd0
RD
7956
7957 Sizes the window so that it fits around its subwindows. This function
7958 won't do anything if there are no subwindows and will only really work
7959 correctly if sizers are used for the subwindows layout. Also, if the
7960 window has exactly one subwindow it is better (faster and the result
7961 is more precise as Fit adds some margin to account for fuzziness of
7962 its calculations) to call window.SetClientSize(child.GetSize())
7963 instead of calling Fit.
7964 """
54f9ee45 7965 return _core_.Window_Fit(*args, **kwargs)
e811c8ce
RD
7966
7967 def FitInside(*args, **kwargs):
15afbcd0 7968 """
a95a7133 7969 FitInside(self)
15afbcd0
RD
7970
7971 Similar to Fit, but sizes the interior (virtual) size of a
7972 window. Mainly useful with scrolled windows to reset scrollbars after
7973 sizing changes that do not trigger a size event, and/or scrolled
7974 windows without an interior sizer. This function similarly won't do
7975 anything if there are no subwindows.
7976 """
54f9ee45 7977 return _core_.Window_FitInside(*args, **kwargs)
e811c8ce 7978
f16ab95d 7979 def SetSizeHints(*args, **kwargs):
0df68c9f 7980 """
a95a7133 7981 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
0df68c9f 7982 int incH=-1)
15afbcd0
RD
7983
7984 Allows specification of minimum and maximum window sizes, and window
7985 size increments. If a pair of values is not set (or set to -1), the
7986 default values will be used. If this function is called, the user
908b74cd
RD
7987 will not be able to size the window outside the given bounds (if it is
7988 a top-level window.) Sizers will also inspect the minimum window size
7989 and will use that value if set when calculating layout.
7990
7991 The resizing increments are only significant under Motif or Xt.
0df68c9f 7992 """
f16ab95d 7993 return _core_.Window_SetSizeHints(*args, **kwargs)
e811c8ce 7994
f16ab95d
RD
7995 def SetSizeHintsSz(*args, **kwargs):
7996 """
7997 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
7998
7999 Allows specification of minimum and maximum window sizes, and window
8000 size increments. If a pair of values is not set (or set to -1), the
8001 default values will be used. If this function is called, the user
8002 will not be able to size the window outside the given bounds (if it is
8003 a top-level window.) Sizers will also inspect the minimum window size
8004 and will use that value if set when calculating layout.
8005
8006 The resizing increments are only significant under Motif or Xt.
8007 """
8008 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8009
8010 def SetVirtualSizeHints(*args, **kwargs):
15afbcd0 8011 """
908b74cd 8012 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
15afbcd0
RD
8013
8014 Allows specification of minimum and maximum virtual window sizes. If a
8015 pair of values is not set (or set to -1), the default values will be
8016 used. If this function is called, the user will not be able to size
8017 the virtual area of the window outside the given bounds.
8018 """
f16ab95d
RD
8019 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8020
8021 def SetVirtualSizeHintsSz(*args, **kwargs):
8022 """
8023 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8024
8025 Allows specification of minimum and maximum virtual window sizes. If a
8026 pair of values is not set (or set to -1), the default values will be
8027 used. If this function is called, the user will not be able to size
8028 the virtual area of the window outside the given bounds.
8029 """
8030 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
e811c8ce 8031
908b74cd
RD
8032 def GetMaxSize(*args, **kwargs):
8033 """GetMaxSize(self) -> Size"""
8034 return _core_.Window_GetMaxSize(*args, **kwargs)
8035
8036 def GetMinSize(*args, **kwargs):
8037 """GetMinSize(self) -> Size"""
8038 return _core_.Window_GetMinSize(*args, **kwargs)
8039
8040 def SetMinSize(*args, **kwargs):
8041 """
8042 SetMinSize(self, Size minSize)
8043
8044 A more convenient method than `SetSizeHints` for setting just the
8045 min size.
8046 """
8047 return _core_.Window_SetMinSize(*args, **kwargs)
8048
8049 def SetMaxSize(*args, **kwargs):
8050 """
8051 SetMaxSize(self, Size maxSize)
8052
8053 A more convenient method than `SetSizeHints` for setting just the
8054 max size.
8055 """
8056 return _core_.Window_SetMaxSize(*args, **kwargs)
8057
e811c8ce 8058 def GetMinWidth(*args, **kwargs):
a95a7133 8059 """GetMinWidth(self) -> int"""
54f9ee45 8060 return _core_.Window_GetMinWidth(*args, **kwargs)
e811c8ce
RD
8061
8062 def GetMinHeight(*args, **kwargs):
a95a7133 8063 """GetMinHeight(self) -> int"""
54f9ee45 8064 return _core_.Window_GetMinHeight(*args, **kwargs)
e811c8ce
RD
8065
8066 def GetMaxWidth(*args, **kwargs):
a95a7133 8067 """GetMaxWidth(self) -> int"""
54f9ee45 8068 return _core_.Window_GetMaxWidth(*args, **kwargs)
e811c8ce
RD
8069
8070 def GetMaxHeight(*args, **kwargs):
a95a7133 8071 """GetMaxHeight(self) -> int"""
54f9ee45 8072 return _core_.Window_GetMaxHeight(*args, **kwargs)
e811c8ce 8073
e811c8ce 8074 def SetVirtualSize(*args, **kwargs):
0df68c9f 8075 """
a95a7133 8076 SetVirtualSize(self, Size size)
e811c8ce 8077
15afbcd0
RD
8078 Set the the virtual size of a window in pixels. For most windows this
8079 is just the client area of the window, but for some like scrolled
8080 windows it is more or less independent of the screen window size.
0df68c9f 8081 """
54f9ee45 8082 return _core_.Window_SetVirtualSize(*args, **kwargs)
e811c8ce
RD
8083
8084 def SetVirtualSizeWH(*args, **kwargs):
0df68c9f 8085 """
a95a7133 8086 SetVirtualSizeWH(self, int w, int h)
e811c8ce 8087
15afbcd0
RD
8088 Set the the virtual size of a window in pixels. For most windows this
8089 is just the client area of the window, but for some like scrolled
8090 windows it is more or less independent of the screen window size.
0df68c9f 8091 """
54f9ee45 8092 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
e811c8ce
RD
8093
8094 def GetVirtualSize(*args, **kwargs):
0df68c9f 8095 """
a95a7133 8096 GetVirtualSize(self) -> Size
e811c8ce 8097
15afbcd0
RD
8098 Get the the virtual size of the window in pixels. For most windows
8099 this is just the client area of the window, but for some like scrolled
8100 windows it is more or less independent of the screen window size.
0df68c9f 8101 """
54f9ee45 8102 return _core_.Window_GetVirtualSize(*args, **kwargs)
e811c8ce
RD
8103
8104 def GetVirtualSizeTuple(*args, **kwargs):
0df68c9f
RD
8105 """
8106 GetVirtualSizeTuple() -> (width, height)
e811c8ce 8107
15afbcd0
RD
8108 Get the the virtual size of the window in pixels. For most windows
8109 this is just the client area of the window, but for some like scrolled
8110 windows it is more or less independent of the screen window size.
0df68c9f 8111 """
54f9ee45 8112 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
e811c8ce
RD
8113
8114 def GetBestVirtualSize(*args, **kwargs):
15afbcd0 8115 """
a95a7133 8116 GetBestVirtualSize(self) -> Size
15afbcd0
RD
8117
8118 Return the largest of ClientSize and BestSize (as determined by a
8119 sizer, interior children, or other means)
8120 """
54f9ee45 8121 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
e811c8ce
RD
8122
8123 def Show(*args, **kwargs):
15afbcd0 8124 """
a95a7133 8125 Show(self, bool show=True) -> bool
15afbcd0
RD
8126
8127 Shows or hides the window. You may need to call Raise for a top level
8128 window if you want to bring it to top, although this is not needed if
8129 Show is called immediately after the frame creation. Returns True if
8130 the window has been shown or hidden or False if nothing was done
8131 because it already was in the requested state.
8132 """
54f9ee45 8133 return _core_.Window_Show(*args, **kwargs)
e811c8ce
RD
8134
8135 def Hide(*args, **kwargs):
15afbcd0 8136 """
a95a7133 8137 Hide(self) -> bool
15afbcd0
RD
8138
8139 Equivalent to calling Show(False).
8140 """
54f9ee45 8141 return _core_.Window_Hide(*args, **kwargs)
e811c8ce
RD
8142
8143 def Enable(*args, **kwargs):
15afbcd0 8144 """
a95a7133 8145 Enable(self, bool enable=True) -> bool
15afbcd0
RD
8146
8147 Enable or disable the window for user input. Note that when a parent
8148 window is disabled, all of its children are disabled as well and they
8149 are reenabled again when the parent is. Returns true if the window
8150 has been enabled or disabled, false if nothing was done, i.e. if the
8151 window had already been in the specified state.
8152 """
54f9ee45 8153 return _core_.Window_Enable(*args, **kwargs)
e811c8ce
RD
8154
8155 def Disable(*args, **kwargs):
15afbcd0 8156 """
a95a7133 8157 Disable(self) -> bool
15afbcd0
RD
8158
8159 Disables the window, same as Enable(false).
8160 """
54f9ee45 8161 return _core_.Window_Disable(*args, **kwargs)
e811c8ce
RD
8162
8163 def IsShown(*args, **kwargs):
15afbcd0 8164 """
a95a7133 8165 IsShown(self) -> bool
15afbcd0
RD
8166
8167 Returns true if the window is shown, false if it has been hidden.
8168 """
54f9ee45 8169 return _core_.Window_IsShown(*args, **kwargs)
e811c8ce
RD
8170
8171 def IsEnabled(*args, **kwargs):
15afbcd0 8172 """
a95a7133 8173 IsEnabled(self) -> bool
15afbcd0
RD
8174
8175 Returns true if the window is enabled for input, false otherwise.
8176 """
54f9ee45 8177 return _core_.Window_IsEnabled(*args, **kwargs)
e811c8ce
RD
8178
8179 def SetWindowStyleFlag(*args, **kwargs):
15afbcd0 8180 """
a95a7133 8181 SetWindowStyleFlag(self, long style)
15afbcd0 8182
41e2b43e
RD
8183 Sets the style of the window. Please note that some styles cannot be
8184 changed after the window creation and that Refresh() might need to be
8185 called after changing the others for the change to take place
8186 immediately.
15afbcd0 8187 """
54f9ee45 8188 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
e811c8ce
RD
8189
8190 def GetWindowStyleFlag(*args, **kwargs):
15afbcd0 8191 """
a95a7133 8192 GetWindowStyleFlag(self) -> long
e811c8ce 8193
15afbcd0
RD
8194 Gets the window style that was passed to the constructor or Create
8195 method.
8196 """
54f9ee45 8197 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
e811c8ce 8198
15afbcd0 8199 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
e811c8ce 8200 def HasFlag(*args, **kwargs):
15afbcd0 8201 """
a95a7133 8202 HasFlag(self, int flag) -> bool
15afbcd0
RD
8203
8204 Test if the given style is set for this window.
8205 """
54f9ee45 8206 return _core_.Window_HasFlag(*args, **kwargs)
e811c8ce
RD
8207
8208 def IsRetained(*args, **kwargs):
15afbcd0 8209 """
a95a7133 8210 IsRetained(self) -> bool
15afbcd0
RD
8211
8212 Returns true if the window is retained, false otherwise. Retained
8213 windows are only available on X platforms.
8214 """
54f9ee45 8215 return _core_.Window_IsRetained(*args, **kwargs)
e811c8ce
RD
8216
8217 def SetExtraStyle(*args, **kwargs):
15afbcd0 8218 """
a95a7133 8219 SetExtraStyle(self, long exStyle)
15afbcd0
RD
8220
8221 Sets the extra style bits for the window. Extra styles are the less
8222 often used style bits which can't be set with the constructor or with
8223 SetWindowStyleFlag()
8224 """
54f9ee45 8225 return _core_.Window_SetExtraStyle(*args, **kwargs)
e811c8ce
RD
8226
8227 def GetExtraStyle(*args, **kwargs):
15afbcd0 8228 """
a95a7133 8229 GetExtraStyle(self) -> long
15afbcd0
RD
8230
8231 Returns the extra style bits for the window.
8232 """
54f9ee45 8233 return _core_.Window_GetExtraStyle(*args, **kwargs)
e811c8ce
RD
8234
8235 def MakeModal(*args, **kwargs):
15afbcd0 8236 """
a95a7133 8237 MakeModal(self, bool modal=True)
15afbcd0
RD
8238
8239 Disables all other windows in the application so that the user can
8240 only interact with this window. Passing False will reverse this
8241 effect.
8242 """
54f9ee45 8243 return _core_.Window_MakeModal(*args, **kwargs)
e811c8ce
RD
8244
8245 def SetThemeEnabled(*args, **kwargs):
15afbcd0 8246 """
a95a7133 8247 SetThemeEnabled(self, bool enableTheme)
15afbcd0
RD
8248
8249 This function tells a window if it should use the system's "theme"
8250 code to draw the windows' background instead if its own background
8251 drawing code. This will only have an effect on platforms that support
8252 the notion of themes in user defined windows. One such platform is
8253 GTK+ where windows can have (very colourful) backgrounds defined by a
8254 user's selected theme.
8255
8256 Dialogs, notebook pages and the status bar have this flag set to true
8257 by default so that the default look and feel is simulated best.
8258 """
54f9ee45 8259 return _core_.Window_SetThemeEnabled(*args, **kwargs)
e811c8ce
RD
8260
8261 def GetThemeEnabled(*args, **kwargs):
15afbcd0 8262 """
a95a7133 8263 GetThemeEnabled(self) -> bool
e811c8ce 8264
15afbcd0
RD
8265 Return the themeEnabled flag.
8266 """
54f9ee45 8267 return _core_.Window_GetThemeEnabled(*args, **kwargs)
e811c8ce
RD
8268
8269 def SetFocus(*args, **kwargs):
15afbcd0 8270 """
a95a7133 8271 SetFocus(self)
15afbcd0
RD
8272
8273 Set's the focus to this window, allowing it to receive keyboard input.
8274 """
54f9ee45 8275 return _core_.Window_SetFocus(*args, **kwargs)
e811c8ce
RD
8276
8277 def SetFocusFromKbd(*args, **kwargs):
15afbcd0 8278 """
a95a7133 8279 SetFocusFromKbd(self)
15afbcd0
RD
8280
8281 Set focus to this window as the result of a keyboard action. Normally
8282 only called internally.
8283 """
54f9ee45 8284 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
e811c8ce
RD
8285
8286 def FindFocus(*args, **kwargs):
15afbcd0 8287 """
66c033b4 8288 FindFocus() -> Window
15afbcd0
RD
8289
8290 Returns the window or control that currently has the keyboard focus,
8291 or None.
8292 """
54f9ee45 8293 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
8294
8295 FindFocus = staticmethod(FindFocus)
8296 def AcceptsFocus(*args, **kwargs):
15afbcd0 8297 """
a95a7133 8298 AcceptsFocus(self) -> bool
15afbcd0
RD
8299
8300 Can this window have focus?
8301 """
54f9ee45 8302 return _core_.Window_AcceptsFocus(*args, **kwargs)
e811c8ce
RD
8303
8304 def AcceptsFocusFromKeyboard(*args, **kwargs):
15afbcd0 8305 """
a95a7133 8306 AcceptsFocusFromKeyboard(self) -> bool
15afbcd0
RD
8307
8308 Can this window be given focus by keyboard navigation? if not, the
8309 only way to give it focus (provided it accepts it at all) is to click
8310 it.
8311 """
54f9ee45 8312 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
e811c8ce
RD
8313
8314 def GetDefaultItem(*args, **kwargs):
15afbcd0 8315 """
a95a7133 8316 GetDefaultItem(self) -> Window
15afbcd0
RD
8317
8318 Get the default child of this parent, i.e. the one which is activated
8319 by pressing <Enter> such as the OK button on a wx.Dialog.
8320 """
54f9ee45 8321 return _core_.Window_GetDefaultItem(*args, **kwargs)
e811c8ce
RD
8322
8323 def SetDefaultItem(*args, **kwargs):
15afbcd0 8324 """
a95a7133 8325 SetDefaultItem(self, Window child) -> Window
15afbcd0
RD
8326
8327 Set this child as default, return the old default.
8328 """
54f9ee45 8329 return _core_.Window_SetDefaultItem(*args, **kwargs)
e811c8ce
RD
8330
8331 def SetTmpDefaultItem(*args, **kwargs):
15afbcd0 8332 """
a95a7133 8333 SetTmpDefaultItem(self, Window win)
15afbcd0
RD
8334
8335 Set this child as temporary default
8336 """
54f9ee45 8337 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
e811c8ce 8338
908b74cd
RD
8339 def Navigate(*args, **kwargs):
8340 """
8341 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8342
fd2dc343
RD
8343 Does keyboard navigation from this window to another, by sending a
8344 `wx.NavigationKeyEvent`.
908b74cd
RD
8345 """
8346 return _core_.Window_Navigate(*args, **kwargs)
8347
7f98d120
RD
8348 def MoveAfterInTabOrder(*args, **kwargs):
8349 """
8350 MoveAfterInTabOrder(self, Window win)
8351
8352 Moves this window in the tab navigation order after the specified
8353 sibling window. This means that when the user presses the TAB key on
8354 that other window, the focus switches to this window.
8355
8356 The default tab order is the same as creation order. This function
8357 and `MoveBeforeInTabOrder` allow to change it after creating all the
8358 windows.
8359
8360 """
8361 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8362
8363 def MoveBeforeInTabOrder(*args, **kwargs):
8364 """
8365 MoveBeforeInTabOrder(self, Window win)
8366
8367 Same as `MoveAfterInTabOrder` except that it inserts this window just
8368 before win instead of putting it right after it.
8369 """
8370 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8371
e811c8ce 8372 def GetChildren(*args, **kwargs):
15afbcd0 8373 """
a95a7133 8374 GetChildren(self) -> PyObject
15afbcd0
RD
8375
8376 Returns a list of the window's children. NOTE: Currently this is a
8377 copy of the child window list maintained by the window, so the return
8378 value of this function is only valid as long as the window's children
8379 do not change.
8380 """
54f9ee45 8381 return _core_.Window_GetChildren(*args, **kwargs)
e811c8ce
RD
8382
8383 def GetParent(*args, **kwargs):
15afbcd0 8384 """
a95a7133 8385 GetParent(self) -> Window
15afbcd0
RD
8386
8387 Returns the parent window of this window, or None if there isn't one.
8388 """
54f9ee45 8389 return _core_.Window_GetParent(*args, **kwargs)
e811c8ce
RD
8390
8391 def GetGrandParent(*args, **kwargs):
15afbcd0 8392 """
a95a7133 8393 GetGrandParent(self) -> Window
15afbcd0 8394
41e2b43e
RD
8395 Returns the parent of the parent of this window, or None if there
8396 isn't one.
15afbcd0 8397 """
54f9ee45 8398 return _core_.Window_GetGrandParent(*args, **kwargs)
e811c8ce
RD
8399
8400 def IsTopLevel(*args, **kwargs):
15afbcd0 8401 """
a95a7133 8402 IsTopLevel(self) -> bool
15afbcd0
RD
8403
8404 Returns true if the given window is a top-level one. Currently all
8405 frames and dialogs are always considered to be top-level windows (even
8406 if they have a parent window).
8407 """
54f9ee45 8408 return _core_.Window_IsTopLevel(*args, **kwargs)
e811c8ce
RD
8409
8410 def Reparent(*args, **kwargs):
15afbcd0 8411 """
a95a7133 8412 Reparent(self, Window newParent) -> bool
15afbcd0
RD
8413
8414 Reparents the window, i.e the window will be removed from its current
8415 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8416 re-inserted into another. Available on Windows and GTK. Returns True
8417 if the parent was changed, False otherwise (error or newParent ==
8418 oldParent)
8419 """
54f9ee45 8420 return _core_.Window_Reparent(*args, **kwargs)
e811c8ce
RD
8421
8422 def AddChild(*args, **kwargs):
15afbcd0 8423 """
a95a7133 8424 AddChild(self, Window child)
15afbcd0
RD
8425
8426 Adds a child window. This is called automatically by window creation
8427 functions so should not be required by the application programmer.
8428 """
54f9ee45 8429 return _core_.Window_AddChild(*args, **kwargs)
e811c8ce
RD
8430
8431 def RemoveChild(*args, **kwargs):
15afbcd0 8432 """
a95a7133 8433 RemoveChild(self, Window child)
15afbcd0
RD
8434
8435 Removes a child window. This is called automatically by window
8436 deletion functions so should not be required by the application
8437 programmer.
8438 """
54f9ee45 8439 return _core_.Window_RemoveChild(*args, **kwargs)
e811c8ce
RD
8440
8441 def FindWindowById(*args, **kwargs):
15afbcd0 8442 """
a95a7133 8443 FindWindowById(self, long winid) -> Window
15afbcd0
RD
8444
8445 Find a chld of this window by window ID
8446 """
54f9ee45 8447 return _core_.Window_FindWindowById(*args, **kwargs)
e811c8ce
RD
8448
8449 def FindWindowByName(*args, **kwargs):
15afbcd0 8450 """
a95a7133 8451 FindWindowByName(self, String name) -> Window
15afbcd0
RD
8452
8453 Find a child of this window by name
8454 """
54f9ee45 8455 return _core_.Window_FindWindowByName(*args, **kwargs)
e811c8ce
RD
8456
8457 def GetEventHandler(*args, **kwargs):
15afbcd0 8458 """
a95a7133 8459 GetEventHandler(self) -> EvtHandler
15afbcd0
RD
8460
8461 Returns the event handler for this window. By default, the window is
8462 its own event handler.
8463 """
54f9ee45 8464 return _core_.Window_GetEventHandler(*args, **kwargs)
e811c8ce
RD
8465
8466 def SetEventHandler(*args, **kwargs):
15afbcd0 8467 """
a95a7133 8468 SetEventHandler(self, EvtHandler handler)
15afbcd0
RD
8469
8470 Sets the event handler for this window. An event handler is an object
8471 that is capable of processing the events sent to a window. By default,
8472 the window is its own event handler, but an application may wish to
8473 substitute another, for example to allow central implementation of
8474 event-handling for a variety of different window classes.
8475
41e2b43e 8476 It is usually better to use `wx.Window.PushEventHandler` since this sets
15afbcd0
RD
8477 up a chain of event handlers, where an event not handled by one event
8478 handler is handed to the next one in the chain.
8479 """
54f9ee45 8480 return _core_.Window_SetEventHandler(*args, **kwargs)
e811c8ce
RD
8481
8482 def PushEventHandler(*args, **kwargs):
15afbcd0 8483 """
a95a7133 8484 PushEventHandler(self, EvtHandler handler)
15afbcd0
RD
8485
8486 Pushes this event handler onto the event handler stack for the window.
8487 An event handler is an object that is capable of processing the events
8488 sent to a window. By default, the window is its own event handler, but
8489 an application may wish to substitute another, for example to allow
8490 central implementation of event-handling for a variety of different
8491 window classes.
8492
8493 wx.Window.PushEventHandler allows an application to set up a chain of
8494 event handlers, where an event not handled by one event handler is
41e2b43e 8495 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
15afbcd0
RD
8496 remove the event handler.
8497 """
54f9ee45 8498 return _core_.Window_PushEventHandler(*args, **kwargs)
e811c8ce
RD
8499
8500 def PopEventHandler(*args, **kwargs):
15afbcd0 8501 """
a95a7133 8502 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
15afbcd0
RD
8503
8504 Removes and returns the top-most event handler on the event handler
8505 stack. If deleteHandler is True then the wx.EvtHandler object will be
8506 destroyed after it is popped.
8507 """
54f9ee45 8508 return _core_.Window_PopEventHandler(*args, **kwargs)
e811c8ce
RD
8509
8510 def RemoveEventHandler(*args, **kwargs):
15afbcd0 8511 """
a95a7133 8512 RemoveEventHandler(self, EvtHandler handler) -> bool
15afbcd0 8513
41e2b43e
RD
8514 Find the given handler in the event handler chain and remove (but not
8515 delete) it from the event handler chain, return True if it was found
8516 and False otherwise (this also results in an assert failure so this
8517 function should only be called when the handler is supposed to be
8518 there.)
15afbcd0 8519 """
54f9ee45 8520 return _core_.Window_RemoveEventHandler(*args, **kwargs)
e811c8ce
RD
8521
8522 def SetValidator(*args, **kwargs):
15afbcd0 8523 """
a95a7133 8524 SetValidator(self, Validator validator)
15afbcd0
RD
8525
8526 Deletes the current validator (if any) and sets the window validator,
8527 having called wx.Validator.Clone to create a new validator of this
8528 type.
8529 """
54f9ee45 8530 return _core_.Window_SetValidator(*args, **kwargs)
e811c8ce
RD
8531
8532 def GetValidator(*args, **kwargs):
15afbcd0 8533 """
a95a7133 8534 GetValidator(self) -> Validator
15afbcd0
RD
8535
8536 Returns a pointer to the current validator for the window, or None if
8537 there is none.
8538 """
54f9ee45 8539 return _core_.Window_GetValidator(*args, **kwargs)
e811c8ce 8540
74a57fcd
RD
8541 def Validate(*args, **kwargs):
8542 """
a95a7133 8543 Validate(self) -> bool
74a57fcd
RD
8544
8545 Validates the current values of the child controls using their
41e2b43e
RD
8546 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8547 style flag set, the method will also call Validate() of all child
8548 windows. Returns false if any of the validations failed.
74a57fcd 8549 """
54f9ee45 8550 return _core_.Window_Validate(*args, **kwargs)
74a57fcd
RD
8551
8552 def TransferDataToWindow(*args, **kwargs):
8553 """
a95a7133 8554 TransferDataToWindow(self) -> bool
74a57fcd 8555
41e2b43e
RD
8556 Transfers values to child controls from data areas specified by their
8557 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8558 style flag set, the method will also call TransferDataToWindow() of
8559 all child windows.
74a57fcd 8560 """
54f9ee45 8561 return _core_.Window_TransferDataToWindow(*args, **kwargs)
74a57fcd
RD
8562
8563 def TransferDataFromWindow(*args, **kwargs):
8564 """
a95a7133 8565 TransferDataFromWindow(self) -> bool
74a57fcd 8566
41e2b43e
RD
8567 Transfers values from child controls to data areas specified by their
8568 validators. Returns false if a transfer failed. If the window has
8569 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8570 also call TransferDataFromWindow() of all child windows.
74a57fcd 8571 """
54f9ee45 8572 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
74a57fcd
RD
8573
8574 def InitDialog(*args, **kwargs):
8575 """
a95a7133 8576 InitDialog(self)
74a57fcd 8577
41e2b43e
RD
8578 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8579 to the dialog via validators.
74a57fcd 8580 """
54f9ee45 8581 return _core_.Window_InitDialog(*args, **kwargs)
74a57fcd 8582
e811c8ce 8583 def SetAcceleratorTable(*args, **kwargs):
15afbcd0 8584 """
a95a7133 8585 SetAcceleratorTable(self, AcceleratorTable accel)
15afbcd0
RD
8586
8587 Sets the accelerator table for this window.
8588 """
54f9ee45 8589 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
8590
8591 def GetAcceleratorTable(*args, **kwargs):
15afbcd0 8592 """
a95a7133 8593 GetAcceleratorTable(self) -> AcceleratorTable
15afbcd0
RD
8594
8595 Gets the accelerator table for this window.
8596 """
54f9ee45 8597 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
8598
8599 def RegisterHotKey(*args, **kwargs):
15afbcd0 8600 """
a95a7133 8601 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
15afbcd0
RD
8602
8603 Registers a system wide hotkey. Every time the user presses the hotkey
8604 registered here, this window will receive a hotkey event. It will
8605 receive the event even if the application is in the background and
8606 does not have the input focus because the user is working with some
8607 other application. To bind an event handler function to this hotkey
8608 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8609 hotkey was registered successfully.
8610 """
54f9ee45 8611 return _core_.Window_RegisterHotKey(*args, **kwargs)
e811c8ce
RD
8612
8613 def UnregisterHotKey(*args, **kwargs):
15afbcd0 8614 """
a95a7133 8615 UnregisterHotKey(self, int hotkeyId) -> bool
15afbcd0
RD
8616
8617 Unregisters a system wide hotkey.
8618 """
54f9ee45 8619 return _core_.Window_UnregisterHotKey(*args, **kwargs)
e811c8ce
RD
8620
8621 def ConvertDialogPointToPixels(*args, **kwargs):
15afbcd0 8622 """
a95a7133 8623 ConvertDialogPointToPixels(self, Point pt) -> Point
15afbcd0
RD
8624
8625 Converts a point or size from dialog units to pixels. Dialog units
8626 are used for maintaining a dialog's proportions even if the font
8627 changes. For the x dimension, the dialog units are multiplied by the
8628 average character width and then divided by 4. For the y dimension,
8629 the dialog units are multiplied by the average character height and
8630 then divided by 8.
8631 """
54f9ee45 8632 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
e811c8ce
RD
8633
8634 def ConvertDialogSizeToPixels(*args, **kwargs):
15afbcd0 8635 """
a95a7133 8636 ConvertDialogSizeToPixels(self, Size sz) -> Size
15afbcd0
RD
8637
8638 Converts a point or size from dialog units to pixels. Dialog units
8639 are used for maintaining a dialog's proportions even if the font
8640 changes. For the x dimension, the dialog units are multiplied by the
8641 average character width and then divided by 4. For the y dimension,
8642 the dialog units are multiplied by the average character height and
8643 then divided by 8.
8644 """
54f9ee45 8645 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
e811c8ce
RD
8646
8647 def DLG_PNT(*args, **kwargs):
15afbcd0 8648 """
a95a7133 8649 DLG_PNT(self, Point pt) -> Point
15afbcd0
RD
8650
8651 Converts a point or size from dialog units to pixels. Dialog units
8652 are used for maintaining a dialog's proportions even if the font
8653 changes. For the x dimension, the dialog units are multiplied by the
8654 average character width and then divided by 4. For the y dimension,
8655 the dialog units are multiplied by the average character height and
8656 then divided by 8.
8657 """
54f9ee45 8658 return _core_.Window_DLG_PNT(*args, **kwargs)
e811c8ce
RD
8659
8660 def DLG_SZE(*args, **kwargs):
15afbcd0 8661 """
a95a7133 8662 DLG_SZE(self, Size sz) -> Size
15afbcd0
RD
8663
8664 Converts a point or size from dialog units to pixels. Dialog units
8665 are used for maintaining a dialog's proportions even if the font
8666 changes. For the x dimension, the dialog units are multiplied by the
8667 average character width and then divided by 4. For the y dimension,
8668 the dialog units are multiplied by the average character height and
8669 then divided by 8.
8670 """
54f9ee45 8671 return _core_.Window_DLG_SZE(*args, **kwargs)
e811c8ce
RD
8672
8673 def ConvertPixelPointToDialog(*args, **kwargs):
a95a7133 8674 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
54f9ee45 8675 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
e811c8ce
RD
8676
8677 def ConvertPixelSizeToDialog(*args, **kwargs):
a95a7133 8678 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
54f9ee45 8679 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
e811c8ce
RD
8680
8681 def WarpPointer(*args, **kwargs):
15afbcd0 8682 """
a95a7133 8683 WarpPointer(self, int x, int y)
15afbcd0
RD
8684
8685 Moves the pointer to the given position on the window.
8686
8687 NOTE: This function is not supported under Mac because Apple Human
8688 Interface Guidelines forbid moving the mouse cursor programmatically.
8689 """
54f9ee45 8690 return _core_.Window_WarpPointer(*args, **kwargs)
e811c8ce
RD
8691
8692 def CaptureMouse(*args, **kwargs):
15afbcd0 8693 """
a95a7133 8694 CaptureMouse(self)
15afbcd0
RD
8695
8696 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8697 release the capture.
8698
8699 Note that wxWindows maintains the stack of windows having captured the
8700 mouse and when the mouse is released the capture returns to the window
8701 which had had captured it previously and it is only really released if
8702 there were no previous window. In particular, this means that you must
8703 release the mouse as many times as you capture it.
8704 """
54f9ee45 8705 return _core_.Window_CaptureMouse(*args, **kwargs)
e811c8ce
RD
8706
8707 def ReleaseMouse(*args, **kwargs):
15afbcd0 8708 """
a95a7133 8709 ReleaseMouse(self)
15afbcd0
RD
8710
8711 Releases mouse input captured with wx.Window.CaptureMouse.
8712 """
54f9ee45 8713 return _core_.Window_ReleaseMouse(*args, **kwargs)
e811c8ce
RD
8714
8715 def GetCapture(*args, **kwargs):
15afbcd0 8716 """
66c033b4 8717 GetCapture() -> Window
15afbcd0
RD
8718
8719 Returns the window which currently captures the mouse or None
8720 """
54f9ee45 8721 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce
RD
8722
8723 GetCapture = staticmethod(GetCapture)
8724 def HasCapture(*args, **kwargs):
15afbcd0 8725 """
a95a7133 8726 HasCapture(self) -> bool
15afbcd0
RD
8727
8728 Returns true if this window has the current mouse capture.
8729 """
54f9ee45 8730 return _core_.Window_HasCapture(*args, **kwargs)
e811c8ce
RD
8731
8732 def Refresh(*args, **kwargs):
15afbcd0 8733 """
a95a7133 8734 Refresh(self, bool eraseBackground=True, Rect rect=None)
15afbcd0
RD
8735
8736 Mark the specified rectangle (or the whole window) as "dirty" so it
8737 will be repainted. Causes an EVT_PAINT event to be generated and sent
8738 to the window.
8739 """
54f9ee45 8740 return _core_.Window_Refresh(*args, **kwargs)
e811c8ce
RD
8741
8742 def RefreshRect(*args, **kwargs):
15afbcd0 8743 """
fef4c27a 8744 RefreshRect(self, Rect rect, bool eraseBackground=True)
15afbcd0
RD
8745
8746 Redraws the contents of the given rectangle: the area inside it will
8747 be repainted. This is the same as Refresh but has a nicer syntax.
8748 """
54f9ee45 8749 return _core_.Window_RefreshRect(*args, **kwargs)
e811c8ce
RD
8750
8751 def Update(*args, **kwargs):
15afbcd0 8752 """
a95a7133 8753 Update(self)
15afbcd0
RD
8754
8755 Calling this method immediately repaints the invalidated area of the
8756 window instead of waiting for the EVT_PAINT event to happen, (normally
8757 this would usually only happen when the flow of control returns to the
8758 event loop.) Notice that this function doesn't refresh the window and
8759 does nothing if the window has been already repainted. Use Refresh
8760 first if you want to immediately redraw the window (or some portion of
8761 it) unconditionally.
8762 """
54f9ee45 8763 return _core_.Window_Update(*args, **kwargs)
e811c8ce
RD
8764
8765 def ClearBackground(*args, **kwargs):
15afbcd0 8766 """
a95a7133 8767 ClearBackground(self)
15afbcd0
RD
8768
8769 Clears the window by filling it with the current background
8770 colour. Does not cause an erase background event to be generated.
8771 """
54f9ee45 8772 return _core_.Window_ClearBackground(*args, **kwargs)
e811c8ce
RD
8773
8774 def Freeze(*args, **kwargs):
15afbcd0 8775 """
a95a7133 8776 Freeze(self)
15afbcd0 8777
41e2b43e
RD
8778 Freezes the window or, in other words, prevents any updates from
8779 taking place on screen, the window is not redrawn at all. Thaw must be
8780 called to reenable window redrawing. Calls to Freeze/Thaw may be
8781 nested, with the actual Thaw being delayed until all the nesting has
8782 been undone.
15afbcd0
RD
8783
8784 This method is useful for visual appearance optimization (for example,
8785 it is a good idea to use it before inserting large amount of text into
8786 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8787 for all controls so it is mostly just a hint to wxWindows and not a
8788 mandatory directive.
8789 """
54f9ee45 8790 return _core_.Window_Freeze(*args, **kwargs)
e811c8ce
RD
8791
8792 def Thaw(*args, **kwargs):
15afbcd0 8793 """
a95a7133 8794 Thaw(self)
15afbcd0 8795
4276dc52 8796 Reenables window updating after a previous call to Freeze. Calls to
41e2b43e
RD
8797 Freeze/Thaw may be nested, so Thaw must be called the same number of
8798 times that Freeze was before the window will be updated.
15afbcd0 8799 """
54f9ee45 8800 return _core_.Window_Thaw(*args, **kwargs)
e811c8ce
RD
8801
8802 def PrepareDC(*args, **kwargs):
15afbcd0 8803 """
a95a7133 8804 PrepareDC(self, DC dc)
15afbcd0
RD
8805
8806 Call this function to prepare the device context for drawing a
8807 scrolled image. It sets the device origin according to the current
8808 scroll position.
8809 """
54f9ee45 8810 return _core_.Window_PrepareDC(*args, **kwargs)
e811c8ce
RD
8811
8812 def GetUpdateRegion(*args, **kwargs):
15afbcd0 8813 """
a95a7133 8814 GetUpdateRegion(self) -> Region
15afbcd0
RD
8815
8816 Returns the region specifying which parts of the window have been
8817 damaged. Should only be called within an EVT_PAINT handler.
8818 """
54f9ee45 8819 return _core_.Window_GetUpdateRegion(*args, **kwargs)
e811c8ce
RD
8820
8821 def GetUpdateClientRect(*args, **kwargs):
15afbcd0 8822 """
a95a7133 8823 GetUpdateClientRect(self) -> Rect
15afbcd0
RD
8824
8825 Get the update rectangle region bounding box in client coords.
8826 """
54f9ee45 8827 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
e811c8ce
RD
8828
8829 def IsExposed(*args, **kwargs):
15afbcd0 8830 """
a95a7133 8831 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
15afbcd0
RD
8832
8833 Returns true if the given point or rectangle area has been exposed
8834 since the last repaint. Call this in an paint event handler to
8835 optimize redrawing by only redrawing those areas, which have been
8836 exposed.
8837 """
54f9ee45 8838 return _core_.Window_IsExposed(*args, **kwargs)
e811c8ce
RD
8839
8840 def IsExposedPoint(*args, **kwargs):
15afbcd0 8841 """
a95a7133 8842 IsExposedPoint(self, Point pt) -> bool
15afbcd0
RD
8843
8844 Returns true if the given point or rectangle area has been exposed
8845 since the last repaint. Call this in an paint event handler to
8846 optimize redrawing by only redrawing those areas, which have been
8847 exposed.
8848 """
54f9ee45 8849 return _core_.Window_IsExposedPoint(*args, **kwargs)
e811c8ce 8850
4276dc52 8851 def IsExposedRect(*args, **kwargs):
15afbcd0 8852 """
a95a7133 8853 IsExposedRect(self, Rect rect) -> bool
15afbcd0
RD
8854
8855 Returns true if the given point or rectangle area has been exposed
8856 since the last repaint. Call this in an paint event handler to
8857 optimize redrawing by only redrawing those areas, which have been
8858 exposed.
8859 """
54f9ee45 8860 return _core_.Window_IsExposedRect(*args, **kwargs)
e811c8ce 8861
74a57fcd
RD
8862 def GetDefaultAttributes(*args, **kwargs):
8863 """
a95a7133 8864 GetDefaultAttributes(self) -> VisualAttributes
74a57fcd 8865
41e2b43e
RD
8866 Get the default attributes for an instance of this class. This is
8867 useful if you want to use the same font or colour in your own control
8868 as in a standard control -- which is a much better idea than hard
8869 coding specific colours or fonts which might look completely out of
db3e571a 8870 place on the user's system, especially if it uses themes.
74a57fcd 8871 """
54f9ee45 8872 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
74a57fcd
RD
8873
8874 def GetClassDefaultAttributes(*args, **kwargs):
8875 """
66c033b4 8876 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
74a57fcd 8877
41e2b43e
RD
8878 Get the default attributes for this class. This is useful if you want
8879 to use the same font or colour in your own control as in a standard
8880 control -- which is a much better idea than hard coding specific
db3e571a
RD
8881 colours or fonts which might look completely out of place on the
8882 user's system, especially if it uses themes.
74a57fcd
RD
8883
8884 The variant parameter is only relevant under Mac currently and is
41e2b43e 8885 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
8886 the returned font. See `wx.Window.SetWindowVariant` for more about
8887 this.
74a57fcd 8888 """
54f9ee45 8889 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
8890
8891 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
e811c8ce 8892 def SetBackgroundColour(*args, **kwargs):
15afbcd0 8893 """
a95a7133 8894 SetBackgroundColour(self, Colour colour) -> bool
15afbcd0
RD
8895
8896 Sets the background colour of the window. Returns True if the colour
8897 was changed. The background colour is usually painted by the default
8898 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
8899 automatically under GTK. Using `wx.NullColour` will reset the window
8900 to the default background colour.
15afbcd0 8901
db3e571a 8902 Note that setting the background colour may not cause an immediate
f8167d6e 8903 refresh, so you may wish to call `ClearBackground` or `Refresh` after
15afbcd0
RD
8904 calling this function.
8905
f8167d6e
RD
8906 Using this function will disable attempts to use themes for this
8907 window, if the system supports them. Use with care since usually the
8908 themes represent the appearance chosen by the user to be used for all
8909 applications on the system.
15afbcd0 8910 """
54f9ee45 8911 return _core_.Window_SetBackgroundColour(*args, **kwargs)
e811c8ce 8912
412d302d
RD
8913 def SetOwnBackgroundColour(*args, **kwargs):
8914 """SetOwnBackgroundColour(self, Colour colour)"""
8915 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
b2df227b 8916
e811c8ce 8917 def SetForegroundColour(*args, **kwargs):
15afbcd0 8918 """
a95a7133 8919 SetForegroundColour(self, Colour colour) -> bool
15afbcd0
RD
8920
8921 Sets the foreground colour of the window. Returns True is the colour
8922 was changed. The interpretation of foreground colour is dependent on
8923 the window class; it may be the text colour or other colour, or it may
8924 not be used at all.
8925 """
54f9ee45 8926 return _core_.Window_SetForegroundColour(*args, **kwargs)
e811c8ce 8927
fa47d7a7
VS
8928 def SetOwnForegroundColour(*args, **kwargs):
8929 """SetOwnForegroundColour(self, Colour colour)"""
8930 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
b2df227b 8931
e811c8ce 8932 def GetBackgroundColour(*args, **kwargs):
15afbcd0 8933 """
a95a7133 8934 GetBackgroundColour(self) -> Colour
15afbcd0
RD
8935
8936 Returns the background colour of the window.
8937 """
54f9ee45 8938 return _core_.Window_GetBackgroundColour(*args, **kwargs)
e811c8ce
RD
8939
8940 def GetForegroundColour(*args, **kwargs):
15afbcd0 8941 """
a95a7133 8942 GetForegroundColour(self) -> Colour
15afbcd0
RD
8943
8944 Returns the foreground colour of the window. The interpretation of
8945 foreground colour is dependent on the window class; it may be the text
8946 colour or other colour, or it may not be used at all.
8947 """
54f9ee45 8948 return _core_.Window_GetForegroundColour(*args, **kwargs)
e811c8ce 8949
562ecc31
RD
8950 def InheritsBackgroundColour(*args, **kwargs):
8951 """InheritsBackgroundColour(self) -> bool"""
8952 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
8953
8954 def UseBgCol(*args, **kwargs):
8955 """UseBgCol(self) -> bool"""
8956 return _core_.Window_UseBgCol(*args, **kwargs)
8957
7bc1e663
RD
8958 def SetBackgroundStyle(*args, **kwargs):
8959 """
8960 SetBackgroundStyle(self, int style) -> bool
8961
8962 Returns the background style of the window. The background style
8963 indicates how the background of the window is drawn.
8964
8965 ====================== ========================================
8966 wx.BG_STYLE_SYSTEM The background colour or pattern should
8967 be determined by the system
8968 wx.BG_STYLE_COLOUR The background should be a solid colour
8969 wx.BG_STYLE_CUSTOM The background will be implemented by the
8970 application.
8971 ====================== ========================================
8972
8973 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8974 a custom background, such as a tiled bitmap. Currently the style has
8975 no effect on other platforms.
8976
8977 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8978 """
8979 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
8980
8981 def GetBackgroundStyle(*args, **kwargs):
8982 """
8983 GetBackgroundStyle(self) -> int
8984
8985 Returns the background style of the window.
8986
8987 :see: `SetBackgroundStyle`
8988 """
8989 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
8990
51b83b37
RD
8991 def HasTransparentBackground(*args, **kwargs):
8992 """
8993 HasTransparentBackground(self) -> bool
8994
8995 Returns True if this window's background is transparent (as, for
8996 example, for `wx.StaticText`) and should show the parent window's
8997 background.
8998
8999 This method is mostly used internally by the library itself and you
9000 normally shouldn't have to call it. You may, however, have to override
9001 it in your custom control classes to ensure that background is painted
9002 correctly.
9003 """
9004 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9005
e811c8ce 9006 def SetCursor(*args, **kwargs):
15afbcd0 9007 """
a95a7133 9008 SetCursor(self, Cursor cursor) -> bool
15afbcd0
RD
9009
9010 Sets the window's cursor. Notice that the window cursor also sets it
9011 for the children of the window implicitly.
9012
9013 The cursor may be wx.NullCursor in which case the window cursor will
9014 be reset back to default.
9015 """
54f9ee45 9016 return _core_.Window_SetCursor(*args, **kwargs)
e811c8ce
RD
9017
9018 def GetCursor(*args, **kwargs):
15afbcd0 9019 """
a95a7133 9020 GetCursor(self) -> Cursor
15afbcd0
RD
9021
9022 Return the cursor associated with this window.
9023 """
54f9ee45 9024 return _core_.Window_GetCursor(*args, **kwargs)
e811c8ce
RD
9025
9026 def SetFont(*args, **kwargs):
15afbcd0 9027 """
a95a7133 9028 SetFont(self, Font font) -> bool
15afbcd0
RD
9029
9030 Sets the font for this window.
9031 """
54f9ee45 9032 return _core_.Window_SetFont(*args, **kwargs)
e811c8ce 9033
fa47d7a7
VS
9034 def SetOwnFont(*args, **kwargs):
9035 """SetOwnFont(self, Font font)"""
9036 return _core_.Window_SetOwnFont(*args, **kwargs)
b2df227b 9037
e811c8ce 9038 def GetFont(*args, **kwargs):
15afbcd0 9039 """
a95a7133 9040 GetFont(self) -> Font
15afbcd0 9041
4276dc52 9042 Returns the default font used for this window.
15afbcd0 9043 """
54f9ee45 9044 return _core_.Window_GetFont(*args, **kwargs)
e811c8ce
RD
9045
9046 def SetCaret(*args, **kwargs):
15afbcd0 9047 """
a95a7133 9048 SetCaret(self, Caret caret)
15afbcd0
RD
9049
9050 Sets the caret associated with the window.
9051 """
54f9ee45 9052 return _core_.Window_SetCaret(*args, **kwargs)
e811c8ce
RD
9053
9054 def GetCaret(*args, **kwargs):
15afbcd0 9055 """
a95a7133 9056 GetCaret(self) -> Caret
15afbcd0
RD
9057
9058 Returns the caret associated with the window.
9059 """
54f9ee45 9060 return _core_.Window_GetCaret(*args, **kwargs)
e811c8ce
RD
9061
9062 def GetCharHeight(*args, **kwargs):
15afbcd0 9063 """
a95a7133 9064 GetCharHeight(self) -> int
15afbcd0
RD
9065
9066 Get the (average) character size for the current font.
9067 """
54f9ee45 9068 return _core_.Window_GetCharHeight(*args, **kwargs)
e811c8ce
RD
9069
9070 def GetCharWidth(*args, **kwargs):
15afbcd0 9071 """
a95a7133 9072 GetCharWidth(self) -> int
15afbcd0
RD
9073
9074 Get the (average) character size for the current font.
9075 """
54f9ee45 9076 return _core_.Window_GetCharWidth(*args, **kwargs)
e811c8ce
RD
9077
9078 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9079 """
9080 GetTextExtent(String string) -> (width, height)
9081
9082 Get the width and height of the text using the current font.
9083 """
54f9ee45 9084 return _core_.Window_GetTextExtent(*args, **kwargs)
e811c8ce
RD
9085
9086 def GetFullTextExtent(*args, **kwargs):
0df68c9f 9087 """
196addbf 9088 GetFullTextExtent(String string, Font font=None) ->
0df68c9f 9089 (width, height, descent, externalLeading)
e811c8ce 9090
15afbcd0
RD
9091 Get the width, height, decent and leading of the text using the
9092 current or specified font.
0df68c9f 9093 """
54f9ee45 9094 return _core_.Window_GetFullTextExtent(*args, **kwargs)
e811c8ce
RD
9095
9096 def ClientToScreenXY(*args, **kwargs):
15afbcd0
RD
9097 """
9098 ClientToScreenXY(int x, int y) -> (x,y)
9099
9100 Converts to screen coordinates from coordinates relative to this window.
9101 """
54f9ee45 9102 return _core_.Window_ClientToScreenXY(*args, **kwargs)
e811c8ce
RD
9103
9104 def ScreenToClientXY(*args, **kwargs):
15afbcd0
RD
9105 """
9106 ScreenToClientXY(int x, int y) -> (x,y)
9107
9108 Converts from screen to client window coordinates.
9109 """
54f9ee45 9110 return _core_.Window_ScreenToClientXY(*args, **kwargs)
e811c8ce
RD
9111
9112 def ClientToScreen(*args, **kwargs):
15afbcd0 9113 """
a95a7133 9114 ClientToScreen(self, Point pt) -> Point
15afbcd0
RD
9115
9116 Converts to screen coordinates from coordinates relative to this window.
9117 """
54f9ee45 9118 return _core_.Window_ClientToScreen(*args, **kwargs)
e811c8ce
RD
9119
9120 def ScreenToClient(*args, **kwargs):
15afbcd0 9121 """
a95a7133 9122 ScreenToClient(self, Point pt) -> Point
15afbcd0
RD
9123
9124 Converts from screen to client window coordinates.
9125 """
54f9ee45 9126 return _core_.Window_ScreenToClient(*args, **kwargs)
e811c8ce
RD
9127
9128 def HitTestXY(*args, **kwargs):
15afbcd0 9129 """
a95a7133 9130 HitTestXY(self, int x, int y) -> int
15afbcd0
RD
9131
9132 Test where the given (in client coords) point lies
9133 """
54f9ee45 9134 return _core_.Window_HitTestXY(*args, **kwargs)
e811c8ce
RD
9135
9136 def HitTest(*args, **kwargs):
15afbcd0 9137 """
a95a7133 9138 HitTest(self, Point pt) -> int
15afbcd0
RD
9139
9140 Test where the given (in client coords) point lies
9141 """
54f9ee45 9142 return _core_.Window_HitTest(*args, **kwargs)
e811c8ce 9143
15afbcd0
RD
9144 def GetBorder(*args):
9145 """
a95a7133
RD
9146 GetBorder(self, long flags) -> int
9147 GetBorder(self) -> int
e811c8ce 9148
15afbcd0
RD
9149 Get border for the flags of this window
9150 """
54f9ee45 9151 return _core_.Window_GetBorder(*args)
e811c8ce
RD
9152
9153 def UpdateWindowUI(*args, **kwargs):
15afbcd0 9154 """
a95a7133 9155 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
15afbcd0
RD
9156
9157 This function sends EVT_UPDATE_UI events to the window. The particular
9158 implementation depends on the window; for example a wx.ToolBar will
9159 send an update UI event for each toolbar button, and a wx.Frame will
9160 send an update UI event for each menubar menu item. You can call this
9161 function from your application to ensure that your UI is up-to-date at
9162 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9163 concerned). This may be necessary if you have called
5ba5649b 9164 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
15afbcd0
RD
9165 limit the overhead that wxWindows incurs by sending update UI events
9166 in idle time.
15afbcd0 9167 """
54f9ee45 9168 return _core_.Window_UpdateWindowUI(*args, **kwargs)
e811c8ce
RD
9169
9170 def PopupMenuXY(*args, **kwargs):
15afbcd0 9171 """
b0503257 9172 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
15afbcd0 9173
b0503257
RD
9174 Pops up the given menu at the specified coordinates, relative to this window,
9175 and returns control when the user has dismissed the menu. If a menu item is
9176 selected, the corresponding menu event is generated and will be processed as
9177 usual. If the default position is given then the current position of the
9178 mouse cursor will be used.
15afbcd0 9179 """
54f9ee45 9180 return _core_.Window_PopupMenuXY(*args, **kwargs)
e811c8ce 9181
15afbcd0
RD
9182 def PopupMenu(*args, **kwargs):
9183 """
b0503257 9184 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
15afbcd0 9185
b0503257
RD
9186 Pops up the given menu at the specified coordinates, relative to this window,
9187 and returns control when the user has dismissed the menu. If a menu item is
9188 selected, the corresponding menu event is generated and will be processed as
9189 usual. If the default position is given then the current position of the
9190 mouse cursor will be used.
15afbcd0 9191 """
54f9ee45 9192 return _core_.Window_PopupMenu(*args, **kwargs)
15afbcd0
RD
9193
9194 def GetHandle(*args, **kwargs):
9195 """
a95a7133 9196 GetHandle(self) -> long
15afbcd0
RD
9197
9198 Returns the platform-specific handle (as a long integer) of the
9199 physical window. Currently on wxMac it returns the handle of the
9200 toplevel parent of the window.
9201 """
54f9ee45 9202 return _core_.Window_GetHandle(*args, **kwargs)
15afbcd0 9203
7e63a440
RD
9204 def AssociateHandle(*args, **kwargs):
9205 """
9206 AssociateHandle(self, long handle)
9207
9208 Associate the window with a new native handle
9209 """
9210 return _core_.Window_AssociateHandle(*args, **kwargs)
9211
9212 def DissociateHandle(*args, **kwargs):
9213 """
9214 DissociateHandle(self)
9215
9216 Dissociate the current native handle from the window
9217 """
9218 return _core_.Window_DissociateHandle(*args, **kwargs)
9219
15afbcd0
RD
9220 def HasScrollbar(*args, **kwargs):
9221 """
a95a7133 9222 HasScrollbar(self, int orient) -> bool
15afbcd0
RD
9223
9224 Does the window have the scrollbar for this orientation?
9225 """
54f9ee45 9226 return _core_.Window_HasScrollbar(*args, **kwargs)
15afbcd0
RD
9227
9228 def SetScrollbar(*args, **kwargs):
9229 """
41e2b43e 9230 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
15afbcd0
RD
9231 bool refresh=True)
9232
9233 Sets the scrollbar properties of a built-in scrollbar.
15afbcd0 9234 """
54f9ee45 9235 return _core_.Window_SetScrollbar(*args, **kwargs)
e811c8ce
RD
9236
9237 def SetScrollPos(*args, **kwargs):
15afbcd0 9238 """
a95a7133 9239 SetScrollPos(self, int orientation, int pos, bool refresh=True)
15afbcd0
RD
9240
9241 Sets the position of one of the built-in scrollbars.
9242 """
54f9ee45 9243 return _core_.Window_SetScrollPos(*args, **kwargs)
e811c8ce
RD
9244
9245 def GetScrollPos(*args, **kwargs):
15afbcd0 9246 """
a95a7133 9247 GetScrollPos(self, int orientation) -> int
15afbcd0
RD
9248
9249 Returns the built-in scrollbar position.
9250 """
54f9ee45 9251 return _core_.Window_GetScrollPos(*args, **kwargs)
e811c8ce
RD
9252
9253 def GetScrollThumb(*args, **kwargs):
15afbcd0 9254 """
a95a7133 9255 GetScrollThumb(self, int orientation) -> int
15afbcd0
RD
9256
9257 Returns the built-in scrollbar thumb size.
9258 """
54f9ee45 9259 return _core_.Window_GetScrollThumb(*args, **kwargs)
e811c8ce
RD
9260
9261 def GetScrollRange(*args, **kwargs):
15afbcd0 9262 """
a95a7133 9263 GetScrollRange(self, int orientation) -> int
15afbcd0
RD
9264
9265 Returns the built-in scrollbar range.
9266 """
54f9ee45 9267 return _core_.Window_GetScrollRange(*args, **kwargs)
e811c8ce
RD
9268
9269 def ScrollWindow(*args, **kwargs):
15afbcd0 9270 """
a95a7133 9271 ScrollWindow(self, int dx, int dy, Rect rect=None)
15afbcd0
RD
9272
9273 Physically scrolls the pixels in the window and move child windows
9274 accordingly. Use this function to optimise your scrolling
9275 implementations, to minimise the area that must be redrawn. Note that
9276 it is rarely required to call this function from a user program.
15afbcd0 9277 """
54f9ee45 9278 return _core_.Window_ScrollWindow(*args, **kwargs)
e811c8ce
RD
9279
9280 def ScrollLines(*args, **kwargs):
15afbcd0 9281 """
a95a7133 9282 ScrollLines(self, int lines) -> bool
15afbcd0
RD
9283
9284 If the platform and window class supports it, scrolls the window by
9285 the given number of lines down, if lines is positive, or up if lines
9286 is negative. Returns True if the window was scrolled, False if it was
9287 already on top/bottom and nothing was done.
9288 """
54f9ee45 9289 return _core_.Window_ScrollLines(*args, **kwargs)
e811c8ce
RD
9290
9291 def ScrollPages(*args, **kwargs):
15afbcd0 9292 """
a95a7133 9293 ScrollPages(self, int pages) -> bool
15afbcd0 9294
41e2b43e 9295 If the platform and window class supports it, scrolls the window by
15afbcd0
RD
9296 the given number of pages down, if pages is positive, or up if pages
9297 is negative. Returns True if the window was scrolled, False if it was
9298 already on top/bottom and nothing was done.
9299 """
54f9ee45 9300 return _core_.Window_ScrollPages(*args, **kwargs)
e811c8ce
RD
9301
9302 def LineUp(*args, **kwargs):
15afbcd0 9303 """
a95a7133 9304 LineUp(self) -> bool
15afbcd0
RD
9305
9306 This is just a wrapper for ScrollLines(-1).
9307 """
54f9ee45 9308 return _core_.Window_LineUp(*args, **kwargs)
e811c8ce
RD
9309
9310 def LineDown(*args, **kwargs):
15afbcd0 9311 """
a95a7133 9312 LineDown(self) -> bool
15afbcd0
RD
9313
9314 This is just a wrapper for ScrollLines(1).
9315 """
54f9ee45 9316 return _core_.Window_LineDown(*args, **kwargs)
e811c8ce
RD
9317
9318 def PageUp(*args, **kwargs):
15afbcd0 9319 """
a95a7133 9320 PageUp(self) -> bool
15afbcd0
RD
9321
9322 This is just a wrapper for ScrollPages(-1).
9323 """
54f9ee45 9324 return _core_.Window_PageUp(*args, **kwargs)
e811c8ce
RD
9325
9326 def PageDown(*args, **kwargs):
15afbcd0 9327 """
a95a7133 9328 PageDown(self) -> bool
15afbcd0
RD
9329
9330 This is just a wrapper for ScrollPages(1).
9331 """
54f9ee45 9332 return _core_.Window_PageDown(*args, **kwargs)
e811c8ce
RD
9333
9334 def SetHelpText(*args, **kwargs):
15afbcd0 9335 """
a95a7133 9336 SetHelpText(self, String text)
15afbcd0
RD
9337
9338 Sets the help text to be used as context-sensitive help for this
9339 window. Note that the text is actually stored by the current
f52cbe90 9340 `wx.HelpProvider` implementation, and not in the window object itself.
15afbcd0 9341 """
54f9ee45 9342 return _core_.Window_SetHelpText(*args, **kwargs)
e811c8ce
RD
9343
9344 def SetHelpTextForId(*args, **kwargs):
15afbcd0 9345 """
a95a7133 9346 SetHelpTextForId(self, String text)
15afbcd0
RD
9347
9348 Associate this help text with all windows with the same id as this
9349 one.
9350 """
54f9ee45 9351 return _core_.Window_SetHelpTextForId(*args, **kwargs)
e811c8ce
RD
9352
9353 def GetHelpText(*args, **kwargs):
15afbcd0 9354 """
a95a7133 9355 GetHelpText(self) -> String
15afbcd0
RD
9356
9357 Gets the help text to be used as context-sensitive help for this
9358 window. Note that the text is actually stored by the current
f52cbe90 9359 `wx.HelpProvider` implementation, and not in the window object itself.
15afbcd0 9360 """
54f9ee45 9361 return _core_.Window_GetHelpText(*args, **kwargs)
e811c8ce
RD
9362
9363 def SetToolTipString(*args, **kwargs):
15afbcd0 9364 """
a95a7133 9365 SetToolTipString(self, String tip)
15afbcd0
RD
9366
9367 Attach a tooltip to the window.
9368 """
54f9ee45 9369 return _core_.Window_SetToolTipString(*args, **kwargs)
e811c8ce
RD
9370
9371 def SetToolTip(*args, **kwargs):
15afbcd0 9372 """
a95a7133 9373 SetToolTip(self, ToolTip tip)
15afbcd0
RD
9374
9375 Attach a tooltip to the window.
9376 """
54f9ee45 9377 return _core_.Window_SetToolTip(*args, **kwargs)
e811c8ce
RD
9378
9379 def GetToolTip(*args, **kwargs):
15afbcd0 9380 """
a95a7133 9381 GetToolTip(self) -> ToolTip
15afbcd0
RD
9382
9383 get the associated tooltip or None if none
9384 """
54f9ee45 9385 return _core_.Window_GetToolTip(*args, **kwargs)
e811c8ce
RD
9386
9387 def SetDropTarget(*args, **kwargs):
15afbcd0 9388 """
a95a7133 9389 SetDropTarget(self, DropTarget dropTarget)
15afbcd0
RD
9390
9391 Associates a drop target with this window. If the window already has
9392 a drop target, it is deleted.
9393 """
54f9ee45 9394 return _core_.Window_SetDropTarget(*args, **kwargs)
e811c8ce
RD
9395
9396 def GetDropTarget(*args, **kwargs):
15afbcd0 9397 """
a95a7133 9398 GetDropTarget(self) -> DropTarget
15afbcd0
RD
9399
9400 Returns the associated drop target, which may be None.
9401 """
54f9ee45 9402 return _core_.Window_GetDropTarget(*args, **kwargs)
e811c8ce 9403
5ba5649b
RD
9404 def DragAcceptFiles(*args, **kwargs):
9405 """
9406 DragAcceptFiles(self, bool accept)
9407
9408 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9409 Only functional on Windows.
9410 """
9411 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9412
e811c8ce 9413 def SetConstraints(*args, **kwargs):
15afbcd0 9414 """
a95a7133 9415 SetConstraints(self, LayoutConstraints constraints)
15afbcd0
RD
9416
9417 Sets the window to have the given layout constraints. If an existing
9418 layout constraints object is already owned by the window, it will be
9419 deleted. Pass None to disassociate and delete the window's current
9420 constraints.
9421
9422 You must call SetAutoLayout to tell a window to use the constraints
9423 automatically in its default EVT_SIZE handler; otherwise, you must
9424 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9425 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9426 effect.
9427 """
54f9ee45 9428 return _core_.Window_SetConstraints(*args, **kwargs)
e811c8ce
RD
9429
9430 def GetConstraints(*args, **kwargs):
15afbcd0 9431 """
a95a7133 9432 GetConstraints(self) -> LayoutConstraints
15afbcd0
RD
9433
9434 Returns a pointer to the window's layout constraints, or None if there
9435 are none.
9436 """
54f9ee45 9437 return _core_.Window_GetConstraints(*args, **kwargs)
e811c8ce
RD
9438
9439 def SetAutoLayout(*args, **kwargs):
15afbcd0 9440 """
a95a7133 9441 SetAutoLayout(self, bool autoLayout)
15afbcd0
RD
9442
9443 Determines whether the Layout function will be called automatically
b1fcee84
RD
9444 when the window is resized. lease note that this only happens for the
9445 windows usually used to contain children, namely `wx.Panel` and
9446 `wx.TopLevelWindow` (and the classes deriving from them).
9447
9448 This method is called implicitly by `SetSizer` but if you use
9449 `SetConstraints` you should call it manually or otherwise the window
9450 layout won't be correctly updated when its size changes.
15afbcd0 9451 """
54f9ee45 9452 return _core_.Window_SetAutoLayout(*args, **kwargs)
e811c8ce
RD
9453
9454 def GetAutoLayout(*args, **kwargs):
15afbcd0 9455 """
a95a7133 9456 GetAutoLayout(self) -> bool
15afbcd0
RD
9457
9458 Returns the current autoLayout setting
9459 """
54f9ee45 9460 return _core_.Window_GetAutoLayout(*args, **kwargs)
e811c8ce
RD
9461
9462 def Layout(*args, **kwargs):
15afbcd0 9463 """
a95a7133 9464 Layout(self) -> bool
15afbcd0
RD
9465
9466 Invokes the constraint-based layout algorithm or the sizer-based
9467 algorithm for this window. See SetAutoLayout: when auto layout is on,
9468 this function gets called automatically by the default EVT_SIZE
9469 handler when the window is resized.
9470 """
54f9ee45 9471 return _core_.Window_Layout(*args, **kwargs)
e811c8ce
RD
9472
9473 def SetSizer(*args, **kwargs):
15afbcd0 9474 """
a95a7133 9475 SetSizer(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
9476
9477 Sets the window to have the given layout sizer. The window will then
9478 own the object, and will take care of its deletion. If an existing
9479 layout sizer object is already owned by the window, it will be deleted
9480 if the deleteOld parameter is true. Note that this function will also
9481 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 9482 non-None, and False otherwise.
15afbcd0 9483 """
54f9ee45 9484 return _core_.Window_SetSizer(*args, **kwargs)
e811c8ce
RD
9485
9486 def SetSizerAndFit(*args, **kwargs):
15afbcd0 9487 """
a95a7133 9488 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
9489
9490 The same as SetSizer, except it also sets the size hints for the
9491 window based on the sizer's minimum size.
9492 """
54f9ee45 9493 return _core_.Window_SetSizerAndFit(*args, **kwargs)
e811c8ce
RD
9494
9495 def GetSizer(*args, **kwargs):
15afbcd0 9496 """
a95a7133 9497 GetSizer(self) -> Sizer
15afbcd0
RD
9498
9499 Return the sizer associated with the window by a previous call to
9500 SetSizer or None if there isn't one.
9501 """
54f9ee45 9502 return _core_.Window_GetSizer(*args, **kwargs)
e811c8ce
RD
9503
9504 def SetContainingSizer(*args, **kwargs):
15afbcd0 9505 """
a95a7133 9506 SetContainingSizer(self, Sizer sizer)
15afbcd0
RD
9507
9508 This normally does not need to be called by application code. It is
9509 called internally when a window is added to a sizer, and is used so
9510 the window can remove itself from the sizer when it is destroyed.
9511 """
54f9ee45 9512 return _core_.Window_SetContainingSizer(*args, **kwargs)
e811c8ce
RD
9513
9514 def GetContainingSizer(*args, **kwargs):
15afbcd0 9515 """
a95a7133 9516 GetContainingSizer(self) -> Sizer
15afbcd0
RD
9517
9518 Return the sizer that this window is a member of, if any, otherwise None.
9519 """
54f9ee45 9520 return _core_.Window_GetContainingSizer(*args, **kwargs)
e811c8ce 9521
a95a7133
RD
9522 def InheritAttributes(*args, **kwargs):
9523 """
9524 InheritAttributes(self)
9525
41e2b43e
RD
9526 This function is (or should be, in case of custom controls) called
9527 during window creation to intelligently set up the window visual
9528 attributes, that is the font and the foreground and background
9529 colours.
9530
9531 By 'intelligently' the following is meant: by default, all windows use
9532 their own default attributes. However if some of the parent's
9533 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 9534 SetOwnFont) and if the corresponding attribute hadn't been
41e2b43e
RD
9535 explicitly set for this window itself, then this window takes the same
9536 value as used by the parent. In addition, if the window overrides
9537 ShouldInheritColours to return false, the colours will not be changed
9538 no matter what and only the font might.
9539
34621cc5 9540 This rather complicated logic is necessary in order to accommodate the
ec9b55ca 9541 different usage scenarios. The most common one is when all default
41e2b43e
RD
9542 attributes are used and in this case, nothing should be inherited as
9543 in modern GUIs different controls use different fonts (and colours)
9544 than their siblings so they can't inherit the same value from the
9545 parent. However it was also deemed desirable to allow to simply change
9546 the attributes of all children at once by just changing the font or
9547 colour of their common parent, hence in this case we do inherit the
9548 parents attributes.
9549
a95a7133 9550 """
54f9ee45 9551 return _core_.Window_InheritAttributes(*args, **kwargs)
a95a7133
RD
9552
9553 def ShouldInheritColours(*args, **kwargs):
9554 """
9555 ShouldInheritColours(self) -> bool
9556
9557 Return true from here to allow the colours of this window to be
41e2b43e
RD
9558 changed by InheritAttributes, returning false forbids inheriting them
9559 from the parent window.
a95a7133 9560
41e2b43e
RD
9561 The base class version returns false, but this method is overridden in
9562 wxControl where it returns true.
a95a7133 9563 """
54f9ee45 9564 return _core_.Window_ShouldInheritColours(*args, **kwargs)
a95a7133 9565
e811c8ce 9566 def PostCreate(self, pre):
15afbcd0
RD
9567 """
9568 Phase 3 of the 2-phase create <wink!>
9569 Call this method after precreating the window with the 2-phase create method.
9570 """
e811c8ce
RD
9571 self.this = pre.this
9572 self.thisown = pre.thisown
9573 pre.thisown = 0
9574 if hasattr(self, '_setOORInfo'):
9575 self._setOORInfo(self)
9576 if hasattr(self, '_setCallbackInfo'):
9577 self._setCallbackInfo(self, self.__class__)
9578
7e08d4ef
RD
9579 def SendSizeEvent(self):
9580 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9581
0085ce49
RD
9582Window_swigregister = _core_.Window_swigregister
9583Window_swigregister(Window)
e811c8ce
RD
9584
9585def PreWindow(*args, **kwargs):
15afbcd0
RD
9586 """
9587 PreWindow() -> Window
9588
9589 Precreate a Window for 2-phase creation.
9590 """
54f9ee45 9591 val = _core_.new_PreWindow(*args, **kwargs)
e811c8ce
RD
9592 return val
9593
0085ce49
RD
9594def Window_NewControlId(*args):
9595 """
15afbcd0
RD
9596 Window_NewControlId() -> int
9597
9598 Generate a control id for the controls which were not given one.
9599 """
0085ce49 9600 return _core_.Window_NewControlId(*args)
e811c8ce
RD
9601
9602def Window_NextControlId(*args, **kwargs):
0085ce49 9603 """
15afbcd0
RD
9604 Window_NextControlId(int winid) -> int
9605
9606 Get the id of the control following the one with the given
41e2b43e 9607 autogenerated) id
15afbcd0 9608 """
0085ce49 9609 return _core_.Window_NextControlId(*args, **kwargs)
e811c8ce
RD
9610
9611def Window_PrevControlId(*args, **kwargs):
0085ce49 9612 """
15afbcd0
RD
9613 Window_PrevControlId(int winid) -> int
9614
9615 Get the id of the control preceding the one with the given
41e2b43e 9616 autogenerated) id
15afbcd0 9617 """
0085ce49 9618 return _core_.Window_PrevControlId(*args, **kwargs)
e811c8ce 9619
0085ce49
RD
9620def Window_FindFocus(*args):
9621 """
15afbcd0
RD
9622 Window_FindFocus() -> Window
9623
9624 Returns the window or control that currently has the keyboard focus,
9625 or None.
9626 """
0085ce49 9627 return _core_.Window_FindFocus(*args)
e811c8ce 9628
0085ce49
RD
9629def Window_GetCapture(*args):
9630 """
15afbcd0
RD
9631 Window_GetCapture() -> Window
9632
9633 Returns the window which currently captures the mouse or None
9634 """
0085ce49 9635 return _core_.Window_GetCapture(*args)
e811c8ce 9636
74a57fcd 9637def Window_GetClassDefaultAttributes(*args, **kwargs):
0085ce49 9638 """
74a57fcd
RD
9639 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
9640
41e2b43e
RD
9641 Get the default attributes for this class. This is useful if you want
9642 to use the same font or colour in your own control as in a standard
9643 control -- which is a much better idea than hard coding specific
db3e571a
RD
9644 colours or fonts which might look completely out of place on the
9645 user's system, especially if it uses themes.
74a57fcd
RD
9646
9647 The variant parameter is only relevant under Mac currently and is
41e2b43e 9648 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
9649 the returned font. See `wx.Window.SetWindowVariant` for more about
9650 this.
74a57fcd 9651 """
0085ce49 9652 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 9653
e811c8ce 9654def DLG_PNT(win, point_or_x, y=None):
15afbcd0
RD
9655 """
9656 Convenience function for converting a Point or (x,y) in
9657 dialog units to pixel units.
9658 """
e811c8ce
RD
9659 if y is None:
9660 return win.ConvertDialogPointToPixels(point_or_x)
9661 else:
fd3f2efe 9662 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
e811c8ce
RD
9663
9664def DLG_SZE(win, size_width, height=None):
15afbcd0
RD
9665 """
9666 Convenience function for converting a Size or (w,h) in
9667 dialog units to pixel units.
9668 """
e811c8ce
RD
9669 if height is None:
9670 return win.ConvertDialogSizeToPixels(size_width)
9671 else:
fd3f2efe 9672 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
e811c8ce
RD
9673
9674
9675def FindWindowById(*args, **kwargs):
0085ce49 9676 """
15afbcd0
RD
9677 FindWindowById(long id, Window parent=None) -> Window
9678
9679 Find the first window in the application with the given id. If parent
9680 is None, the search will start from all top-level frames and dialog
9681 boxes; if non-None, the search will be limited to the given window
9682 hierarchy. The search is recursive in both cases.
9683 """
0085ce49 9684 return _core_.FindWindowById(*args, **kwargs)
e811c8ce
RD
9685
9686def FindWindowByName(*args, **kwargs):
0085ce49 9687 """
15afbcd0
RD
9688 FindWindowByName(String name, Window parent=None) -> Window
9689
9690 Find a window by its name (as given in a window constructor or Create
9691 function call). If parent is None, the search will start from all
9692 top-level frames and dialog boxes; if non-None, the search will be
9693 limited to the given window hierarchy. The search is recursive in both
9694 cases.
9695
9696 If no window with such name is found, wx.FindWindowByLabel is called.
9697 """
0085ce49 9698 return _core_.FindWindowByName(*args, **kwargs)
e811c8ce
RD
9699
9700def FindWindowByLabel(*args, **kwargs):
0085ce49 9701 """
15afbcd0
RD
9702 FindWindowByLabel(String label, Window parent=None) -> Window
9703
9704 Find a window by its label. Depending on the type of window, the label
9705 may be a window title or panel item label. If parent is None, the
9706 search will start from all top-level frames and dialog boxes; if
9707 non-None, the search will be limited to the given window
9708 hierarchy. The search is recursive in both cases.
9709 """
0085ce49 9710 return _core_.FindWindowByLabel(*args, **kwargs)
e811c8ce
RD
9711
9712def Window_FromHWND(*args, **kwargs):
0085ce49
RD
9713 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9714 return _core_.Window_FromHWND(*args, **kwargs)
b6b0383e 9715
0085ce49
RD
9716def GetTopLevelWindows(*args):
9717 """
b6b0383e
RD
9718 GetTopLevelWindows() -> PyObject
9719
9720 Returns a list of the the application's top-level windows, (frames,
9721 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9722 by wxWidgets, and so it is only valid as long as no top-level windows
9723 are closed or new top-level windows are created.
9724
9725 """
0085ce49 9726 return _core_.GetTopLevelWindows(*args)
e811c8ce
RD
9727#---------------------------------------------------------------------------
9728
9729class Validator(EvtHandler):
093d3ff1 9730 """Proxy of C++ Validator class"""
0085ce49
RD
9731 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9732 __repr__ = _swig_repr
9733 def __init__(self, *args, **kwargs):
a95a7133 9734 """__init__(self) -> Validator"""
0085ce49 9735 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d14a1e28 9736 self._setOORInfo(self)
e811c8ce
RD
9737
9738 def Clone(*args, **kwargs):
a95a7133 9739 """Clone(self) -> Validator"""
54f9ee45 9740 return _core_.Validator_Clone(*args, **kwargs)
e811c8ce
RD
9741
9742 def Validate(*args, **kwargs):
a95a7133 9743 """Validate(self, Window parent) -> bool"""
54f9ee45 9744 return _core_.Validator_Validate(*args, **kwargs)
e811c8ce
RD
9745
9746 def TransferToWindow(*args, **kwargs):
a95a7133 9747 """TransferToWindow(self) -> bool"""
54f9ee45 9748 return _core_.Validator_TransferToWindow(*args, **kwargs)
e811c8ce
RD
9749
9750 def TransferFromWindow(*args, **kwargs):
a95a7133 9751 """TransferFromWindow(self) -> bool"""
54f9ee45 9752 return _core_.Validator_TransferFromWindow(*args, **kwargs)
e811c8ce
RD
9753
9754 def GetWindow(*args, **kwargs):
a95a7133 9755 """GetWindow(self) -> Window"""
54f9ee45 9756 return _core_.Validator_GetWindow(*args, **kwargs)
e811c8ce
RD
9757
9758 def SetWindow(*args, **kwargs):
a95a7133 9759 """SetWindow(self, Window window)"""
54f9ee45 9760 return _core_.Validator_SetWindow(*args, **kwargs)
e811c8ce
RD
9761
9762 def IsSilent(*args, **kwargs):
66c033b4 9763 """IsSilent() -> bool"""
54f9ee45 9764 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
9765
9766 IsSilent = staticmethod(IsSilent)
9767 def SetBellOnError(*args, **kwargs):
66c033b4 9768 """SetBellOnError(int doIt=True)"""
54f9ee45 9769 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
9770
9771 SetBellOnError = staticmethod(SetBellOnError)
0085ce49
RD
9772Validator_swigregister = _core_.Validator_swigregister
9773Validator_swigregister(Validator)
e811c8ce 9774
0085ce49
RD
9775def Validator_IsSilent(*args):
9776 """Validator_IsSilent() -> bool"""
9777 return _core_.Validator_IsSilent(*args)
e811c8ce
RD
9778
9779def Validator_SetBellOnError(*args, **kwargs):
0085ce49
RD
9780 """Validator_SetBellOnError(int doIt=True)"""
9781 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
9782
9783class PyValidator(Validator):
093d3ff1 9784 """Proxy of C++ PyValidator class"""
0085ce49
RD
9785 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9786 __repr__ = _swig_repr
9787 def __init__(self, *args, **kwargs):
a95a7133 9788 """__init__(self) -> PyValidator"""
0085ce49 9789 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
e811c8ce
RD
9790
9791 self._setCallbackInfo(self, PyValidator, 1)
9792 self._setOORInfo(self)
9793
9794 def _setCallbackInfo(*args, **kwargs):
a95a7133 9795 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
54f9ee45 9796 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
e811c8ce 9797
0085ce49
RD
9798PyValidator_swigregister = _core_.PyValidator_swigregister
9799PyValidator_swigregister(PyValidator)
e811c8ce
RD
9800
9801#---------------------------------------------------------------------------
9802
9803class Menu(EvtHandler):
093d3ff1 9804 """Proxy of C++ Menu class"""
0085ce49
RD
9805 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9806 __repr__ = _swig_repr
9807 def __init__(self, *args, **kwargs):
a95a7133 9808 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
0085ce49 9809 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
e811c8ce
RD
9810 self._setOORInfo(self)
9811
9812 def Append(*args, **kwargs):
a95a7133 9813 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 9814 return _core_.Menu_Append(*args, **kwargs)
e811c8ce
RD
9815
9816 def AppendSeparator(*args, **kwargs):
a95a7133 9817 """AppendSeparator(self) -> MenuItem"""
54f9ee45 9818 return _core_.Menu_AppendSeparator(*args, **kwargs)
e811c8ce
RD
9819
9820 def AppendCheckItem(*args, **kwargs):
a95a7133 9821 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9822 return _core_.Menu_AppendCheckItem(*args, **kwargs)
e811c8ce
RD
9823
9824 def AppendRadioItem(*args, **kwargs):
a95a7133 9825 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9826 return _core_.Menu_AppendRadioItem(*args, **kwargs)
e811c8ce
RD
9827
9828 def AppendMenu(*args, **kwargs):
a95a7133 9829 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 9830 return _core_.Menu_AppendMenu(*args, **kwargs)
e811c8ce
RD
9831
9832 def AppendItem(*args, **kwargs):
a95a7133 9833 """AppendItem(self, MenuItem item) -> MenuItem"""
54f9ee45 9834 return _core_.Menu_AppendItem(*args, **kwargs)
e811c8ce 9835
e811c8ce 9836 def InsertItem(*args, **kwargs):
a95a7133 9837 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
54f9ee45 9838 return _core_.Menu_InsertItem(*args, **kwargs)
e811c8ce 9839
0085ce49
RD
9840 def PrependItem(*args, **kwargs):
9841 """PrependItem(self, MenuItem item) -> MenuItem"""
9842 return _core_.Menu_PrependItem(*args, **kwargs)
9843
9844 def Break(*args, **kwargs):
9845 """Break(self)"""
9846 return _core_.Menu_Break(*args, **kwargs)
9847
e811c8ce 9848 def Insert(*args, **kwargs):
0df68c9f 9849 """
a95a7133 9850 Insert(self, size_t pos, int id, String text, String help=EmptyString,
a41e16b6 9851 int kind=ITEM_NORMAL) -> MenuItem
0df68c9f 9852 """
54f9ee45 9853 return _core_.Menu_Insert(*args, **kwargs)
e811c8ce
RD
9854
9855 def InsertSeparator(*args, **kwargs):
a95a7133 9856 """InsertSeparator(self, size_t pos) -> MenuItem"""
54f9ee45 9857 return _core_.Menu_InsertSeparator(*args, **kwargs)
e811c8ce
RD
9858
9859 def InsertCheckItem(*args, **kwargs):
a95a7133 9860 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9861 return _core_.Menu_InsertCheckItem(*args, **kwargs)
e811c8ce
RD
9862
9863 def InsertRadioItem(*args, **kwargs):
a95a7133 9864 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9865 return _core_.Menu_InsertRadioItem(*args, **kwargs)
e811c8ce
RD
9866
9867 def InsertMenu(*args, **kwargs):
a95a7133 9868 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 9869 return _core_.Menu_InsertMenu(*args, **kwargs)
e811c8ce 9870
e811c8ce 9871 def Prepend(*args, **kwargs):
a95a7133 9872 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
54f9ee45 9873 return _core_.Menu_Prepend(*args, **kwargs)
e811c8ce
RD
9874
9875 def PrependSeparator(*args, **kwargs):
a95a7133 9876 """PrependSeparator(self) -> MenuItem"""
54f9ee45 9877 return _core_.Menu_PrependSeparator(*args, **kwargs)
e811c8ce
RD
9878
9879 def PrependCheckItem(*args, **kwargs):
a95a7133 9880 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9881 return _core_.Menu_PrependCheckItem(*args, **kwargs)
e811c8ce
RD
9882
9883 def PrependRadioItem(*args, **kwargs):
a95a7133 9884 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 9885 return _core_.Menu_PrependRadioItem(*args, **kwargs)
e811c8ce
RD
9886
9887 def PrependMenu(*args, **kwargs):
a95a7133 9888 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 9889 return _core_.Menu_PrependMenu(*args, **kwargs)
e811c8ce
RD
9890
9891 def Remove(*args, **kwargs):
a95a7133 9892 """Remove(self, int id) -> MenuItem"""
54f9ee45 9893 return _core_.Menu_Remove(*args, **kwargs)
e811c8ce
RD
9894
9895 def RemoveItem(*args, **kwargs):
a95a7133 9896 """RemoveItem(self, MenuItem item) -> MenuItem"""
54f9ee45 9897 return _core_.Menu_RemoveItem(*args, **kwargs)
e811c8ce
RD
9898
9899 def Delete(*args, **kwargs):
a95a7133 9900 """Delete(self, int id) -> bool"""
54f9ee45 9901 return _core_.Menu_Delete(*args, **kwargs)
e811c8ce
RD
9902
9903 def DeleteItem(*args, **kwargs):
a95a7133 9904 """DeleteItem(self, MenuItem item) -> bool"""
54f9ee45 9905 return _core_.Menu_DeleteItem(*args, **kwargs)
e811c8ce
RD
9906
9907 def Destroy(*args, **kwargs):
0df68c9f 9908 """
a95a7133 9909 Destroy(self)
e811c8ce 9910
0df68c9f
RD
9911 Deletes the C++ object this Python object is a proxy for.
9912 """
7e08d4ef
RD
9913 val = _core_.Menu_Destroy(*args, **kwargs)
9914 args[0].thisown = 0
9915 return val
e811c8ce
RD
9916
9917 def DestroyId(*args, **kwargs):
0df68c9f 9918 """
a95a7133 9919 DestroyId(self, int id) -> bool
e811c8ce 9920
0df68c9f
RD
9921 Deletes the C++ object this Python object is a proxy for.
9922 """
7e08d4ef
RD
9923 val = _core_.Menu_DestroyId(*args, **kwargs)
9924 args[0].thisown = 0
9925 return val
e811c8ce
RD
9926
9927 def DestroyItem(*args, **kwargs):
0df68c9f 9928 """
a95a7133 9929 DestroyItem(self, MenuItem item) -> bool
e811c8ce 9930
0df68c9f
RD
9931 Deletes the C++ object this Python object is a proxy for.
9932 """
7e08d4ef
RD
9933 val = _core_.Menu_DestroyItem(*args, **kwargs)
9934 args[0].thisown = 0
9935 return val
e811c8ce
RD
9936
9937 def GetMenuItemCount(*args, **kwargs):
a95a7133 9938 """GetMenuItemCount(self) -> size_t"""
54f9ee45 9939 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
e811c8ce
RD
9940
9941 def GetMenuItems(*args, **kwargs):
a95a7133 9942 """GetMenuItems(self) -> PyObject"""
54f9ee45 9943 return _core_.Menu_GetMenuItems(*args, **kwargs)
e811c8ce
RD
9944
9945 def FindItem(*args, **kwargs):
a95a7133 9946 """FindItem(self, String item) -> int"""
54f9ee45 9947 return _core_.Menu_FindItem(*args, **kwargs)
e811c8ce
RD
9948
9949 def FindItemById(*args, **kwargs):
a95a7133 9950 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 9951 return _core_.Menu_FindItemById(*args, **kwargs)
e811c8ce
RD
9952
9953 def FindItemByPosition(*args, **kwargs):
a95a7133 9954 """FindItemByPosition(self, size_t position) -> MenuItem"""
54f9ee45 9955 return _core_.Menu_FindItemByPosition(*args, **kwargs)
e811c8ce
RD
9956
9957 def Enable(*args, **kwargs):
a95a7133 9958 """Enable(self, int id, bool enable)"""
54f9ee45 9959 return _core_.Menu_Enable(*args, **kwargs)
e811c8ce
RD
9960
9961 def IsEnabled(*args, **kwargs):
a95a7133 9962 """IsEnabled(self, int id) -> bool"""
54f9ee45 9963 return _core_.Menu_IsEnabled(*args, **kwargs)
e811c8ce
RD
9964
9965 def Check(*args, **kwargs):
a95a7133 9966 """Check(self, int id, bool check)"""
54f9ee45 9967 return _core_.Menu_Check(*args, **kwargs)
e811c8ce
RD
9968
9969 def IsChecked(*args, **kwargs):
a95a7133 9970 """IsChecked(self, int id) -> bool"""
54f9ee45 9971 return _core_.Menu_IsChecked(*args, **kwargs)
e811c8ce
RD
9972
9973 def SetLabel(*args, **kwargs):
a95a7133 9974 """SetLabel(self, int id, String label)"""
54f9ee45 9975 return _core_.Menu_SetLabel(*args, **kwargs)
e811c8ce
RD
9976
9977 def GetLabel(*args, **kwargs):
a95a7133 9978 """GetLabel(self, int id) -> String"""
54f9ee45 9979 return _core_.Menu_GetLabel(*args, **kwargs)
e811c8ce
RD
9980
9981 def SetHelpString(*args, **kwargs):
a95a7133 9982 """SetHelpString(self, int id, String helpString)"""
54f9ee45 9983 return _core_.Menu_SetHelpString(*args, **kwargs)
e811c8ce
RD
9984
9985 def GetHelpString(*args, **kwargs):
a95a7133 9986 """GetHelpString(self, int id) -> String"""
54f9ee45 9987 return _core_.Menu_GetHelpString(*args, **kwargs)
e811c8ce
RD
9988
9989 def SetTitle(*args, **kwargs):
a95a7133 9990 """SetTitle(self, String title)"""
54f9ee45 9991 return _core_.Menu_SetTitle(*args, **kwargs)
e811c8ce
RD
9992
9993 def GetTitle(*args, **kwargs):
a95a7133 9994 """GetTitle(self) -> String"""
54f9ee45 9995 return _core_.Menu_GetTitle(*args, **kwargs)
e811c8ce
RD
9996
9997 def SetEventHandler(*args, **kwargs):
a95a7133 9998 """SetEventHandler(self, EvtHandler handler)"""
54f9ee45 9999 return _core_.Menu_SetEventHandler(*args, **kwargs)
e811c8ce
RD
10000
10001 def GetEventHandler(*args, **kwargs):
a95a7133 10002 """GetEventHandler(self) -> EvtHandler"""
54f9ee45 10003 return _core_.Menu_GetEventHandler(*args, **kwargs)
e811c8ce
RD
10004
10005 def SetInvokingWindow(*args, **kwargs):
a95a7133 10006 """SetInvokingWindow(self, Window win)"""
54f9ee45 10007 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
e811c8ce
RD
10008
10009 def GetInvokingWindow(*args, **kwargs):
a95a7133 10010 """GetInvokingWindow(self) -> Window"""
54f9ee45 10011 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
e811c8ce
RD
10012
10013 def GetStyle(*args, **kwargs):
a95a7133 10014 """GetStyle(self) -> long"""
54f9ee45 10015 return _core_.Menu_GetStyle(*args, **kwargs)
e811c8ce
RD
10016
10017 def UpdateUI(*args, **kwargs):
a95a7133 10018 """UpdateUI(self, EvtHandler source=None)"""
54f9ee45 10019 return _core_.Menu_UpdateUI(*args, **kwargs)
e811c8ce
RD
10020
10021 def GetMenuBar(*args, **kwargs):
a95a7133 10022 """GetMenuBar(self) -> MenuBar"""
54f9ee45 10023 return _core_.Menu_GetMenuBar(*args, **kwargs)
e811c8ce
RD
10024
10025 def Attach(*args, **kwargs):
a95a7133 10026 """Attach(self, wxMenuBarBase menubar)"""
54f9ee45 10027 return _core_.Menu_Attach(*args, **kwargs)
e811c8ce
RD
10028
10029 def Detach(*args, **kwargs):
a95a7133 10030 """Detach(self)"""
54f9ee45 10031 return _core_.Menu_Detach(*args, **kwargs)
e811c8ce
RD
10032
10033 def IsAttached(*args, **kwargs):
a95a7133 10034 """IsAttached(self) -> bool"""
54f9ee45 10035 return _core_.Menu_IsAttached(*args, **kwargs)
e811c8ce
RD
10036
10037 def SetParent(*args, **kwargs):
a95a7133 10038 """SetParent(self, Menu parent)"""
54f9ee45 10039 return _core_.Menu_SetParent(*args, **kwargs)
e811c8ce
RD
10040
10041 def GetParent(*args, **kwargs):
a95a7133 10042 """GetParent(self) -> Menu"""
54f9ee45 10043 return _core_.Menu_GetParent(*args, **kwargs)
e811c8ce 10044
0085ce49
RD
10045Menu_swigregister = _core_.Menu_swigregister
10046Menu_swigregister(Menu)
d14a1e28
RD
10047DefaultValidator = cvar.DefaultValidator
10048
10049#---------------------------------------------------------------------------
10050
10051class MenuBar(Window):
093d3ff1 10052 """Proxy of C++ MenuBar class"""
0085ce49
RD
10053 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10054 __repr__ = _swig_repr
10055 def __init__(self, *args, **kwargs):
a95a7133 10056 """__init__(self, long style=0) -> MenuBar"""
0085ce49 10057 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d14a1e28 10058 self._setOORInfo(self)
e811c8ce
RD
10059
10060 def Append(*args, **kwargs):
a95a7133 10061 """Append(self, Menu menu, String title) -> bool"""
54f9ee45 10062 return _core_.MenuBar_Append(*args, **kwargs)
e811c8ce
RD
10063
10064 def Insert(*args, **kwargs):
a95a7133 10065 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
54f9ee45 10066 return _core_.MenuBar_Insert(*args, **kwargs)
e811c8ce
RD
10067
10068 def GetMenuCount(*args, **kwargs):
a95a7133 10069 """GetMenuCount(self) -> size_t"""
54f9ee45 10070 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
e811c8ce
RD
10071
10072 def GetMenu(*args, **kwargs):
a95a7133 10073 """GetMenu(self, size_t pos) -> Menu"""
54f9ee45 10074 return _core_.MenuBar_GetMenu(*args, **kwargs)
e811c8ce
RD
10075
10076 def Replace(*args, **kwargs):
a95a7133 10077 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
54f9ee45 10078 return _core_.MenuBar_Replace(*args, **kwargs)
e811c8ce
RD
10079
10080 def Remove(*args, **kwargs):
a95a7133 10081 """Remove(self, size_t pos) -> Menu"""
54f9ee45 10082 return _core_.MenuBar_Remove(*args, **kwargs)
e811c8ce
RD
10083
10084 def EnableTop(*args, **kwargs):
a95a7133 10085 """EnableTop(self, size_t pos, bool enable)"""
54f9ee45 10086 return _core_.MenuBar_EnableTop(*args, **kwargs)
e811c8ce
RD
10087
10088 def IsEnabledTop(*args, **kwargs):
a95a7133 10089 """IsEnabledTop(self, size_t pos) -> bool"""
54f9ee45 10090 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
e811c8ce
RD
10091
10092 def SetLabelTop(*args, **kwargs):
a95a7133 10093 """SetLabelTop(self, size_t pos, String label)"""
54f9ee45 10094 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
e811c8ce
RD
10095
10096 def GetLabelTop(*args, **kwargs):
a95a7133 10097 """GetLabelTop(self, size_t pos) -> String"""
54f9ee45 10098 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
e811c8ce
RD
10099
10100 def FindMenuItem(*args, **kwargs):
a95a7133 10101 """FindMenuItem(self, String menu, String item) -> int"""
54f9ee45 10102 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
e811c8ce
RD
10103
10104 def FindItemById(*args, **kwargs):
a95a7133 10105 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 10106 return _core_.MenuBar_FindItemById(*args, **kwargs)
e811c8ce
RD
10107
10108 def FindMenu(*args, **kwargs):
a95a7133 10109 """FindMenu(self, String title) -> int"""
54f9ee45 10110 return _core_.MenuBar_FindMenu(*args, **kwargs)
e811c8ce
RD
10111
10112 def Enable(*args, **kwargs):
a95a7133 10113 """Enable(self, int id, bool enable)"""
54f9ee45 10114 return _core_.MenuBar_Enable(*args, **kwargs)
e811c8ce
RD
10115
10116 def Check(*args, **kwargs):
a95a7133 10117 """Check(self, int id, bool check)"""
54f9ee45 10118 return _core_.MenuBar_Check(*args, **kwargs)
e811c8ce
RD
10119
10120 def IsChecked(*args, **kwargs):
a95a7133 10121 """IsChecked(self, int id) -> bool"""
54f9ee45 10122 return _core_.MenuBar_IsChecked(*args, **kwargs)
e811c8ce
RD
10123
10124 def IsEnabled(*args, **kwargs):
a95a7133 10125 """IsEnabled(self, int id) -> bool"""
54f9ee45 10126 return _core_.MenuBar_IsEnabled(*args, **kwargs)
e811c8ce
RD
10127
10128 def SetLabel(*args, **kwargs):
a95a7133 10129 """SetLabel(self, int id, String label)"""
54f9ee45 10130 return _core_.MenuBar_SetLabel(*args, **kwargs)
e811c8ce
RD
10131
10132 def GetLabel(*args, **kwargs):
a95a7133 10133 """GetLabel(self, int id) -> String"""
54f9ee45 10134 return _core_.MenuBar_GetLabel(*args, **kwargs)
e811c8ce
RD
10135
10136 def SetHelpString(*args, **kwargs):
a95a7133 10137 """SetHelpString(self, int id, String helpString)"""
54f9ee45 10138 return _core_.MenuBar_SetHelpString(*args, **kwargs)
e811c8ce
RD
10139
10140 def GetHelpString(*args, **kwargs):
a95a7133 10141 """GetHelpString(self, int id) -> String"""
54f9ee45 10142 return _core_.MenuBar_GetHelpString(*args, **kwargs)
e811c8ce
RD
10143
10144 def GetFrame(*args, **kwargs):
a95a7133 10145 """GetFrame(self) -> wxFrame"""
54f9ee45 10146 return _core_.MenuBar_GetFrame(*args, **kwargs)
e811c8ce
RD
10147
10148 def IsAttached(*args, **kwargs):
a95a7133 10149 """IsAttached(self) -> bool"""
54f9ee45 10150 return _core_.MenuBar_IsAttached(*args, **kwargs)
e811c8ce
RD
10151
10152 def Attach(*args, **kwargs):
a95a7133 10153 """Attach(self, wxFrame frame)"""
54f9ee45 10154 return _core_.MenuBar_Attach(*args, **kwargs)
e811c8ce
RD
10155
10156 def Detach(*args, **kwargs):
a95a7133 10157 """Detach(self)"""
54f9ee45 10158 return _core_.MenuBar_Detach(*args, **kwargs)
e811c8ce 10159
4f433fef
RD
10160 def SetAutoWindowMenu(*args, **kwargs):
10161 """SetAutoWindowMenu(bool enable)"""
10162 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10163
10164 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10165 def GetAutoWindowMenu(*args, **kwargs):
10166 """GetAutoWindowMenu() -> bool"""
10167 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10168
10169 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
0085ce49
RD
10170MenuBar_swigregister = _core_.MenuBar_swigregister
10171MenuBar_swigregister(MenuBar)
d14a1e28 10172
4f433fef 10173def MenuBar_SetAutoWindowMenu(*args, **kwargs):
0085ce49
RD
10174 """MenuBar_SetAutoWindowMenu(bool enable)"""
10175 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 10176
0085ce49
RD
10177def MenuBar_GetAutoWindowMenu(*args):
10178 """MenuBar_GetAutoWindowMenu() -> bool"""
10179 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 10180
d14a1e28
RD
10181#---------------------------------------------------------------------------
10182
10183class MenuItem(Object):
093d3ff1 10184 """Proxy of C++ MenuItem class"""
0085ce49
RD
10185 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10186 __repr__ = _swig_repr
10187 def __init__(self, *args, **kwargs):
0df68c9f 10188 """
a95a7133 10189 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
196addbf
RD
10190 String help=EmptyString, int kind=ITEM_NORMAL,
10191 Menu subMenu=None) -> MenuItem
0df68c9f 10192 """
0085ce49
RD
10193 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10194 __swig_destroy__ = _core_.delete_MenuItem
10195 __del__ = lambda self : None;
e811c8ce 10196 def GetMenu(*args, **kwargs):
a95a7133 10197 """GetMenu(self) -> Menu"""
54f9ee45 10198 return _core_.MenuItem_GetMenu(*args, **kwargs)
e811c8ce
RD
10199
10200 def SetMenu(*args, **kwargs):
a95a7133 10201 """SetMenu(self, Menu menu)"""
54f9ee45 10202 return _core_.MenuItem_SetMenu(*args, **kwargs)
e811c8ce
RD
10203
10204 def SetId(*args, **kwargs):
a95a7133 10205 """SetId(self, int id)"""
54f9ee45 10206 return _core_.MenuItem_SetId(*args, **kwargs)
e811c8ce
RD
10207
10208 def GetId(*args, **kwargs):
a95a7133 10209 """GetId(self) -> int"""
54f9ee45 10210 return _core_.MenuItem_GetId(*args, **kwargs)
e811c8ce
RD
10211
10212 def IsSeparator(*args, **kwargs):
a95a7133 10213 """IsSeparator(self) -> bool"""
54f9ee45 10214 return _core_.MenuItem_IsSeparator(*args, **kwargs)
e811c8ce
RD
10215
10216 def SetText(*args, **kwargs):
a95a7133 10217 """SetText(self, String str)"""
54f9ee45 10218 return _core_.MenuItem_SetText(*args, **kwargs)
e811c8ce
RD
10219
10220 def GetLabel(*args, **kwargs):
a95a7133 10221 """GetLabel(self) -> String"""
54f9ee45 10222 return _core_.MenuItem_GetLabel(*args, **kwargs)
e811c8ce
RD
10223
10224 def GetText(*args, **kwargs):
a95a7133 10225 """GetText(self) -> String"""
54f9ee45 10226 return _core_.MenuItem_GetText(*args, **kwargs)
e811c8ce
RD
10227
10228 def GetLabelFromText(*args, **kwargs):
66c033b4 10229 """GetLabelFromText(String text) -> String"""
54f9ee45 10230 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
e811c8ce
RD
10231
10232 GetLabelFromText = staticmethod(GetLabelFromText)
10233 def GetKind(*args, **kwargs):
a95a7133 10234 """GetKind(self) -> int"""
54f9ee45 10235 return _core_.MenuItem_GetKind(*args, **kwargs)
e811c8ce 10236
a95a7133
RD
10237 def SetKind(*args, **kwargs):
10238 """SetKind(self, int kind)"""
54f9ee45 10239 return _core_.MenuItem_SetKind(*args, **kwargs)
a95a7133 10240
e811c8ce 10241 def SetCheckable(*args, **kwargs):
a95a7133 10242 """SetCheckable(self, bool checkable)"""
54f9ee45 10243 return _core_.MenuItem_SetCheckable(*args, **kwargs)
e811c8ce
RD
10244
10245 def IsCheckable(*args, **kwargs):
a95a7133 10246 """IsCheckable(self) -> bool"""
54f9ee45 10247 return _core_.MenuItem_IsCheckable(*args, **kwargs)
e811c8ce
RD
10248
10249 def IsSubMenu(*args, **kwargs):
a95a7133 10250 """IsSubMenu(self) -> bool"""
54f9ee45 10251 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
e811c8ce
RD
10252
10253 def SetSubMenu(*args, **kwargs):
a95a7133 10254 """SetSubMenu(self, Menu menu)"""
54f9ee45 10255 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
e811c8ce
RD
10256
10257 def GetSubMenu(*args, **kwargs):
a95a7133 10258 """GetSubMenu(self) -> Menu"""
54f9ee45 10259 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
e811c8ce
RD
10260
10261 def Enable(*args, **kwargs):
a95a7133 10262 """Enable(self, bool enable=True)"""
54f9ee45 10263 return _core_.MenuItem_Enable(*args, **kwargs)
e811c8ce
RD
10264
10265 def IsEnabled(*args, **kwargs):
a95a7133 10266 """IsEnabled(self) -> bool"""
54f9ee45 10267 return _core_.MenuItem_IsEnabled(*args, **kwargs)
e811c8ce
RD
10268
10269 def Check(*args, **kwargs):
a95a7133 10270 """Check(self, bool check=True)"""
54f9ee45 10271 return _core_.MenuItem_Check(*args, **kwargs)
e811c8ce
RD
10272
10273 def IsChecked(*args, **kwargs):
a95a7133 10274 """IsChecked(self) -> bool"""
54f9ee45 10275 return _core_.MenuItem_IsChecked(*args, **kwargs)
e811c8ce
RD
10276
10277 def Toggle(*args, **kwargs):
a95a7133 10278 """Toggle(self)"""
54f9ee45 10279 return _core_.MenuItem_Toggle(*args, **kwargs)
e811c8ce
RD
10280
10281 def SetHelp(*args, **kwargs):
a95a7133 10282 """SetHelp(self, String str)"""
54f9ee45 10283 return _core_.MenuItem_SetHelp(*args, **kwargs)
e811c8ce
RD
10284
10285 def GetHelp(*args, **kwargs):
a95a7133 10286 """GetHelp(self) -> String"""
54f9ee45 10287 return _core_.MenuItem_GetHelp(*args, **kwargs)
e811c8ce
RD
10288
10289 def GetAccel(*args, **kwargs):
a95a7133 10290 """GetAccel(self) -> AcceleratorEntry"""
54f9ee45 10291 return _core_.MenuItem_GetAccel(*args, **kwargs)
e811c8ce
RD
10292
10293 def SetAccel(*args, **kwargs):
a95a7133 10294 """SetAccel(self, AcceleratorEntry accel)"""
54f9ee45 10295 return _core_.MenuItem_SetAccel(*args, **kwargs)
e811c8ce 10296
091f5bed
RD
10297 def SetBitmap(*args, **kwargs):
10298 """SetBitmap(self, Bitmap bitmap)"""
10299 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10300
10301 def GetBitmap(*args, **kwargs):
10302 """GetBitmap(self) -> Bitmap"""
10303 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10304
c1280d1e
RD
10305 def SetFont(*args, **kwargs):
10306 """SetFont(self, Font font)"""
10307 return _core_.MenuItem_SetFont(*args, **kwargs)
10308
10309 def GetFont(*args, **kwargs):
10310 """GetFont(self) -> Font"""
10311 return _core_.MenuItem_GetFont(*args, **kwargs)
10312
10313 def SetTextColour(*args, **kwargs):
10314 """SetTextColour(self, Colour colText)"""
10315 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10316
10317 def GetTextColour(*args, **kwargs):
10318 """GetTextColour(self) -> Colour"""
10319 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10320
10321 def SetBackgroundColour(*args, **kwargs):
10322 """SetBackgroundColour(self, Colour colBack)"""
10323 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10324
10325 def GetBackgroundColour(*args, **kwargs):
10326 """GetBackgroundColour(self) -> Colour"""
10327 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10328
10329 def SetBitmaps(*args, **kwargs):
10330 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10331 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10332
10333 def SetDisabledBitmap(*args, **kwargs):
10334 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10335 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10336
10337 def GetDisabledBitmap(*args, **kwargs):
10338 """GetDisabledBitmap(self) -> Bitmap"""
10339 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10340
10341 def SetMarginWidth(*args, **kwargs):
10342 """SetMarginWidth(self, int nWidth)"""
10343 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10344
10345 def GetMarginWidth(*args, **kwargs):
10346 """GetMarginWidth(self) -> int"""
10347 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10348
e811c8ce 10349 def GetDefaultMarginWidth(*args, **kwargs):
66c033b4 10350 """GetDefaultMarginWidth() -> int"""
54f9ee45 10351 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
e811c8ce
RD
10352
10353 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10354 def IsOwnerDrawn(*args, **kwargs):
10355 """IsOwnerDrawn(self) -> bool"""
10356 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10357
10358 def SetOwnerDrawn(*args, **kwargs):
10359 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10360 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10361
10362 def ResetOwnerDrawn(*args, **kwargs):
10363 """ResetOwnerDrawn(self)"""
10364 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10365
0085ce49
RD
10366MenuItem_swigregister = _core_.MenuItem_swigregister
10367MenuItem_swigregister(MenuItem)
d14a1e28 10368
e811c8ce 10369def MenuItem_GetLabelFromText(*args, **kwargs):
0085ce49
RD
10370 """MenuItem_GetLabelFromText(String text) -> String"""
10371 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d14a1e28 10372
0085ce49
RD
10373def MenuItem_GetDefaultMarginWidth(*args):
10374 """MenuItem_GetDefaultMarginWidth() -> int"""
10375 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d14a1e28
RD
10376
10377#---------------------------------------------------------------------------
10378
10379class Control(Window):
15afbcd0
RD
10380 """
10381 This is the base class for a control or 'widget'.
10382
41e2b43e
RD
10383 A control is generally a small window which processes user input
10384 and/or displays one or more item of data.
15afbcd0 10385 """
0085ce49
RD
10386 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10387 __repr__ = _swig_repr
10388 def __init__(self, *args, **kwargs):
0df68c9f 10389 """
248ed943
RD
10390 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10391 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 10392 String name=ControlNameStr) -> Control
15afbcd0 10393
41e2b43e
RD
10394 Create a Control. Normally you should only call this from a subclass'
10395 __init__ as a plain old wx.Control is not very useful.
0df68c9f 10396 """
0085ce49 10397 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d14a1e28 10398 self._setOORInfo(self)
e811c8ce
RD
10399
10400 def Create(*args, **kwargs):
0df68c9f 10401 """
248ed943
RD
10402 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10403 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 10404 String name=ControlNameStr) -> bool
15afbcd0
RD
10405
10406 Do the 2nd phase and create the GUI control.
0df68c9f 10407 """
54f9ee45 10408 return _core_.Control_Create(*args, **kwargs)
e811c8ce
RD
10409
10410 def Command(*args, **kwargs):
15afbcd0 10411 """
a95a7133 10412 Command(self, CommandEvent event)
15afbcd0 10413
41e2b43e
RD
10414 Simulates the effect of the user issuing a command to the item.
10415
10416 :see: `wx.CommandEvent`
10417
15afbcd0 10418 """
54f9ee45 10419 return _core_.Control_Command(*args, **kwargs)
e811c8ce
RD
10420
10421 def GetLabel(*args, **kwargs):
15afbcd0 10422 """
a95a7133 10423 GetLabel(self) -> String
15afbcd0
RD
10424
10425 Return a control's text.
10426 """
54f9ee45 10427 return _core_.Control_GetLabel(*args, **kwargs)
e811c8ce 10428
74a57fcd 10429 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
10430 """
10431 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10432
10433 Get the default attributes for this class. This is useful if you want
10434 to use the same font or colour in your own control as in a standard
10435 control -- which is a much better idea than hard coding specific
10436 colours or fonts which might look completely out of place on the
10437 user's system, especially if it uses themes.
10438
10439 The variant parameter is only relevant under Mac currently and is
10440 ignore under other platforms. Under Mac, it will change the size of
10441 the returned font. See `wx.Window.SetWindowVariant` for more about
10442 this.
10443 """
54f9ee45 10444 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
10445
10446 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
0085ce49
RD
10447Control_swigregister = _core_.Control_swigregister
10448Control_swigregister(Control)
b2dc1044 10449ControlNameStr = cvar.ControlNameStr
d14a1e28
RD
10450
10451def PreControl(*args, **kwargs):
15afbcd0
RD
10452 """
10453 PreControl() -> Control
10454
10455 Precreate a Control control for 2-phase creation
10456 """
54f9ee45 10457 val = _core_.new_PreControl(*args, **kwargs)
d14a1e28
RD
10458 return val
10459
74a57fcd 10460def Control_GetClassDefaultAttributes(*args, **kwargs):
0085ce49 10461 """
110da5b0
RD
10462 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10463
10464 Get the default attributes for this class. This is useful if you want
10465 to use the same font or colour in your own control as in a standard
10466 control -- which is a much better idea than hard coding specific
10467 colours or fonts which might look completely out of place on the
10468 user's system, especially if it uses themes.
10469
10470 The variant parameter is only relevant under Mac currently and is
10471 ignore under other platforms. Under Mac, it will change the size of
10472 the returned font. See `wx.Window.SetWindowVariant` for more about
10473 this.
10474 """
0085ce49 10475 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 10476
d14a1e28
RD
10477#---------------------------------------------------------------------------
10478
10479class ItemContainer(object):
15afbcd0 10480 """
53aa7709
RD
10481 The wx.ItemContainer class defines an interface which is implemented
10482 by all controls which have string subitems, each of which may be
10483 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10484 as `wx.ComboBox` which implements an extended interface deriving from
41e2b43e 10485 this one.
15afbcd0 10486
41e2b43e
RD
10487 It defines the methods for accessing the control's items and although
10488 each of the derived classes implements them differently, they still
10489 all conform to the same interface.
15afbcd0 10490
41e2b43e
RD
10491 The items in a wx.ItemContainer have (non empty) string labels and,
10492 optionally, client data associated with them.
15afbcd0
RD
10493
10494 """
0085ce49
RD
10495 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10496 def __init__(self): raise AttributeError, "No constructor defined"
10497 __repr__ = _swig_repr
e811c8ce 10498 def Append(*args, **kwargs):
15afbcd0 10499 """
a95a7133 10500 Append(self, String item, PyObject clientData=None) -> int
15afbcd0 10501
41e2b43e
RD
10502 Adds the item to the control, associating the given data with the item
10503 if not None. The return value is the index of the newly added item
10504 which may be different from the last one if the control is sorted (e.g.
10505 has wx.LB_SORT or wx.CB_SORT style).
15afbcd0 10506 """
54f9ee45 10507 return _core_.ItemContainer_Append(*args, **kwargs)
e811c8ce
RD
10508
10509 def AppendItems(*args, **kwargs):
15afbcd0 10510 """
f5b96ee1 10511 AppendItems(self, List strings)
15afbcd0 10512
41e2b43e
RD
10513 Apend several items at once to the control. Notice that calling this
10514 method may be much faster than appending the items one by one if you
10515 need to add a lot of items.
15afbcd0 10516 """
54f9ee45 10517 return _core_.ItemContainer_AppendItems(*args, **kwargs)
e811c8ce
RD
10518
10519 def Insert(*args, **kwargs):
15afbcd0 10520 """
a95a7133 10521 Insert(self, String item, int pos, PyObject clientData=None) -> int
15afbcd0 10522
41e2b43e 10523 Insert an item into the control before the item at the ``pos`` index,
15afbcd0
RD
10524 optionally associating some data object with the item.
10525 """
54f9ee45 10526 return _core_.ItemContainer_Insert(*args, **kwargs)
e811c8ce
RD
10527
10528 def Clear(*args, **kwargs):
15afbcd0 10529 """
a95a7133 10530 Clear(self)
15afbcd0
RD
10531
10532 Removes all items from the control.
10533 """
54f9ee45 10534 return _core_.ItemContainer_Clear(*args, **kwargs)
e811c8ce
RD
10535
10536 def Delete(*args, **kwargs):
15afbcd0 10537 """
a95a7133 10538 Delete(self, int n)
15afbcd0 10539
41e2b43e
RD
10540 Deletes the item at the zero-based index 'n' from the control. Note
10541 that it is an error (signalled by a `wx.PyAssertionError` exception if
10542 enabled) to remove an item with the index negative or greater or equal
10543 than the number of items in the control.
15afbcd0 10544 """
54f9ee45 10545 return _core_.ItemContainer_Delete(*args, **kwargs)
e811c8ce 10546
53aa7709
RD
10547 def GetClientData(*args, **kwargs):
10548 """
10549 GetClientData(self, int n) -> PyObject
10550
10551 Returns the client data associated with the given item, (if any.)
10552 """
10553 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10554
10555 def SetClientData(*args, **kwargs):
10556 """
10557 SetClientData(self, int n, PyObject clientData)
10558
10559 Associate the given client data with the item at position n.
10560 """
10561 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10562
e811c8ce 10563 def GetCount(*args, **kwargs):
15afbcd0 10564 """
75219dcb 10565 GetCount(self) -> size_t
15afbcd0
RD
10566
10567 Returns the number of items in the control.
10568 """
54f9ee45 10569 return _core_.ItemContainer_GetCount(*args, **kwargs)
e811c8ce
RD
10570
10571 def IsEmpty(*args, **kwargs):
15afbcd0 10572 """
a95a7133 10573 IsEmpty(self) -> bool
15afbcd0
RD
10574
10575 Returns True if the control is empty or False if it has some items.
10576 """
54f9ee45 10577 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
e811c8ce
RD
10578
10579 def GetString(*args, **kwargs):
15afbcd0 10580 """
a95a7133 10581 GetString(self, int n) -> String
15afbcd0
RD
10582
10583 Returns the label of the item with the given index.
10584 """
54f9ee45 10585 return _core_.ItemContainer_GetString(*args, **kwargs)
e811c8ce
RD
10586
10587 def GetStrings(*args, **kwargs):
a95a7133 10588 """GetStrings(self) -> wxArrayString"""
54f9ee45 10589 return _core_.ItemContainer_GetStrings(*args, **kwargs)
e811c8ce
RD
10590
10591 def SetString(*args, **kwargs):
15afbcd0 10592 """
a95a7133 10593 SetString(self, int n, String s)
15afbcd0
RD
10594
10595 Sets the label for the given item.
10596 """
54f9ee45 10597 return _core_.ItemContainer_SetString(*args, **kwargs)
e811c8ce
RD
10598
10599 def FindString(*args, **kwargs):
15afbcd0 10600 """
a95a7133 10601 FindString(self, String s) -> int
15afbcd0
RD
10602
10603 Finds an item whose label matches the given string. Returns the
41e2b43e
RD
10604 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10605 found.
15afbcd0 10606 """
54f9ee45 10607 return _core_.ItemContainer_FindString(*args, **kwargs)
e811c8ce 10608
53aa7709 10609 def SetSelection(*args, **kwargs):
15afbcd0 10610 """
53aa7709 10611 SetSelection(self, int n)
15afbcd0
RD
10612
10613 Sets the item at index 'n' to be the selected item.
10614 """
53aa7709 10615 return _core_.ItemContainer_SetSelection(*args, **kwargs)
e811c8ce
RD
10616
10617 def GetSelection(*args, **kwargs):
15afbcd0 10618 """
a95a7133 10619 GetSelection(self) -> int
15afbcd0 10620
41e2b43e
RD
10621 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10622 is selected.
15afbcd0 10623 """
54f9ee45 10624 return _core_.ItemContainer_GetSelection(*args, **kwargs)
e811c8ce 10625
53aa7709
RD
10626 def SetStringSelection(*args, **kwargs):
10627 """SetStringSelection(self, String s) -> bool"""
10628 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
10629
e811c8ce 10630 def GetStringSelection(*args, **kwargs):
15afbcd0 10631 """
a95a7133 10632 GetStringSelection(self) -> String
15afbcd0 10633
41e2b43e
RD
10634 Returns the label of the selected item or an empty string if no item
10635 is selected.
15afbcd0 10636 """
54f9ee45 10637 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
e811c8ce 10638
53aa7709 10639 def Select(*args, **kwargs):
15afbcd0 10640 """
53aa7709 10641 Select(self, int n)
15afbcd0 10642
53aa7709
RD
10643 This is the same as `SetSelection` and exists only because it is
10644 slightly more natural for controls which support multiple selection.
15afbcd0 10645 """
53aa7709 10646 return _core_.ItemContainer_Select(*args, **kwargs)
e811c8ce 10647
0085ce49
RD
10648ItemContainer_swigregister = _core_.ItemContainer_swigregister
10649ItemContainer_swigregister(ItemContainer)
d14a1e28
RD
10650
10651#---------------------------------------------------------------------------
10652
10653class ControlWithItems(Control,ItemContainer):
15afbcd0 10654 """
41e2b43e
RD
10655 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10656 wx.Control class, and is used for the base class of various controls
10657 that have items.
15afbcd0 10658 """
0085ce49
RD
10659 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10660 def __init__(self): raise AttributeError, "No constructor defined"
10661 __repr__ = _swig_repr
10662ControlWithItems_swigregister = _core_.ControlWithItems_swigregister
10663ControlWithItems_swigregister(ControlWithItems)
d14a1e28
RD
10664
10665#---------------------------------------------------------------------------
10666
10667class SizerItem(Object):
248ed943
RD
10668 """
10669 The wx.SizerItem class is used to track the position, size and other
10670 attributes of each item managed by a `wx.Sizer`. In normal usage user
10671 code should never need to deal directly with a wx.SizerItem, but
10672 custom classes derived from `wx.PySizer` will probably need to use the
10673 collection of wx.SizerItems held by wx.Sizer when calculating layout.
10674
10675 :see: `wx.Sizer`, `wx.GBSizerItem`
10676 """
0085ce49
RD
10677 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10678 __repr__ = _swig_repr
10679 def __init__(self, *args, **kwargs):
248ed943
RD
10680 """
10681 __init__(self) -> SizerItem
10682
10683 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10684 size will need to be set before this item can be used in a Sizer.
10685
10686 You will probably never need to create a wx.SizerItem directly as they
10687 are created automatically when the sizer's Add, Insert or Prepend
10688 methods are called.
10689
10690 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10691 """
0085ce49
RD
10692 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10693 __swig_destroy__ = _core_.delete_SizerItem
10694 __del__ = lambda self : None;
e811c8ce 10695 def DeleteWindows(*args, **kwargs):
248ed943
RD
10696 """
10697 DeleteWindows(self)
10698
10699 Destroy the window or the windows in a subsizer, depending on the type
10700 of item.
10701 """
54f9ee45 10702 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
e811c8ce
RD
10703
10704 def DetachSizer(*args, **kwargs):
248ed943
RD
10705 """
10706 DetachSizer(self)
10707
10708 Enable deleting the SizerItem without destroying the contained sizer.
10709 """
54f9ee45 10710 return _core_.SizerItem_DetachSizer(*args, **kwargs)
e811c8ce
RD
10711
10712 def GetSize(*args, **kwargs):
248ed943
RD
10713 """
10714 GetSize(self) -> Size
10715
10716 Get the current size of the item, as set in the last Layout.
10717 """
54f9ee45 10718 return _core_.SizerItem_GetSize(*args, **kwargs)
e811c8ce
RD
10719
10720 def CalcMin(*args, **kwargs):
248ed943
RD
10721 """
10722 CalcMin(self) -> Size
10723
10724 Calculates the minimum desired size for the item, including any space
10725 needed by borders.
10726 """
54f9ee45 10727 return _core_.SizerItem_CalcMin(*args, **kwargs)
e811c8ce
RD
10728
10729 def SetDimension(*args, **kwargs):
248ed943
RD
10730 """
10731 SetDimension(self, Point pos, Size size)
10732
10733 Set the position and size of the space allocated for this item by the
10734 sizer, and adjust the position and size of the item (window or
10735 subsizer) to be within that space taking alignment and borders into
10736 account.
10737 """
54f9ee45 10738 return _core_.SizerItem_SetDimension(*args, **kwargs)
e811c8ce
RD
10739
10740 def GetMinSize(*args, **kwargs):
248ed943
RD
10741 """
10742 GetMinSize(self) -> Size
10743
10744 Get the minimum size needed for the item.
10745 """
54f9ee45 10746 return _core_.SizerItem_GetMinSize(*args, **kwargs)
e811c8ce 10747
dfbb5885
RD
10748 def GetMinSizeWithBorder(*args, **kwargs):
10749 """
10750 GetMinSizeWithBorder(self) -> Size
10751
10752 Get the minimum size needed for the item with space for the borders
10753 added, if needed.
10754 """
10755 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
10756
e811c8ce 10757 def SetInitSize(*args, **kwargs):
a95a7133 10758 """SetInitSize(self, int x, int y)"""
54f9ee45 10759 return _core_.SizerItem_SetInitSize(*args, **kwargs)
e811c8ce
RD
10760
10761 def SetRatioWH(*args, **kwargs):
248ed943
RD
10762 """
10763 SetRatioWH(self, int width, int height)
10764
10765 Set the ratio item attribute.
10766 """
54f9ee45 10767 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
e811c8ce
RD
10768
10769 def SetRatioSize(*args, **kwargs):
248ed943
RD
10770 """
10771 SetRatioSize(self, Size size)
10772
10773 Set the ratio item attribute.
10774 """
54f9ee45 10775 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
e811c8ce
RD
10776
10777 def SetRatio(*args, **kwargs):
248ed943
RD
10778 """
10779 SetRatio(self, float ratio)
10780
10781 Set the ratio item attribute.
10782 """
54f9ee45 10783 return _core_.SizerItem_SetRatio(*args, **kwargs)
e811c8ce
RD
10784
10785 def GetRatio(*args, **kwargs):
248ed943
RD
10786 """
10787 GetRatio(self) -> float
10788
10789 Set the ratio item attribute.
10790 """
54f9ee45 10791 return _core_.SizerItem_GetRatio(*args, **kwargs)
e811c8ce 10792
d3b6e4ff
RD
10793 def GetRect(*args, **kwargs):
10794 """
10795 GetRect(self) -> Rect
10796
10797 Returns the rectangle that the sizer item should occupy
10798 """
10799 return _core_.SizerItem_GetRect(*args, **kwargs)
10800
e811c8ce 10801 def IsWindow(*args, **kwargs):
248ed943
RD
10802 """
10803 IsWindow(self) -> bool
10804
10805 Is this sizer item a window?
10806 """
54f9ee45 10807 return _core_.SizerItem_IsWindow(*args, **kwargs)
e811c8ce
RD
10808
10809 def IsSizer(*args, **kwargs):
248ed943
RD
10810 """
10811 IsSizer(self) -> bool
10812
10813 Is this sizer item a subsizer?
10814 """
54f9ee45 10815 return _core_.SizerItem_IsSizer(*args, **kwargs)
e811c8ce
RD
10816
10817 def IsSpacer(*args, **kwargs):
248ed943
RD
10818 """
10819 IsSpacer(self) -> bool
10820
10821 Is this sizer item a spacer?
10822 """
54f9ee45 10823 return _core_.SizerItem_IsSpacer(*args, **kwargs)
e811c8ce
RD
10824
10825 def SetProportion(*args, **kwargs):
248ed943
RD
10826 """
10827 SetProportion(self, int proportion)
10828
10829 Set the proportion value for this item.
10830 """
54f9ee45 10831 return _core_.SizerItem_SetProportion(*args, **kwargs)
e811c8ce
RD
10832
10833 def GetProportion(*args, **kwargs):
248ed943
RD
10834 """
10835 GetProportion(self) -> int
10836
10837 Get the proportion value for this item.
10838 """
54f9ee45 10839 return _core_.SizerItem_GetProportion(*args, **kwargs)
e811c8ce 10840
248ed943
RD
10841 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10842 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
e811c8ce 10843 def SetFlag(*args, **kwargs):
248ed943
RD
10844 """
10845 SetFlag(self, int flag)
10846
10847 Set the flag value for this item.
10848 """
54f9ee45 10849 return _core_.SizerItem_SetFlag(*args, **kwargs)
e811c8ce
RD
10850
10851 def GetFlag(*args, **kwargs):
248ed943
RD
10852 """
10853 GetFlag(self) -> int
10854
10855 Get the flag value for this item.
10856 """
54f9ee45 10857 return _core_.SizerItem_GetFlag(*args, **kwargs)
e811c8ce
RD
10858
10859 def SetBorder(*args, **kwargs):
248ed943
RD
10860 """
10861 SetBorder(self, int border)
10862
10863 Set the border value for this item.
10864 """
54f9ee45 10865 return _core_.SizerItem_SetBorder(*args, **kwargs)
e811c8ce
RD
10866
10867 def GetBorder(*args, **kwargs):
248ed943
RD
10868 """
10869 GetBorder(self) -> int
10870
10871 Get the border value for this item.
10872 """
54f9ee45 10873 return _core_.SizerItem_GetBorder(*args, **kwargs)
e811c8ce
RD
10874
10875 def GetWindow(*args, **kwargs):
248ed943
RD
10876 """
10877 GetWindow(self) -> Window
10878
10879 Get the window (if any) that is managed by this sizer item.
10880 """
54f9ee45 10881 return _core_.SizerItem_GetWindow(*args, **kwargs)
e811c8ce
RD
10882
10883 def SetWindow(*args, **kwargs):
248ed943
RD
10884 """
10885 SetWindow(self, Window window)
10886
10887 Set the window to be managed by this sizer item.
10888 """
54f9ee45 10889 return _core_.SizerItem_SetWindow(*args, **kwargs)
e811c8ce
RD
10890
10891 def GetSizer(*args, **kwargs):
248ed943
RD
10892 """
10893 GetSizer(self) -> Sizer
10894
10895 Get the subsizer (if any) that is managed by this sizer item.
10896 """
54f9ee45 10897 return _core_.SizerItem_GetSizer(*args, **kwargs)
e811c8ce
RD
10898
10899 def SetSizer(*args, **kwargs):
248ed943
RD
10900 """
10901 SetSizer(self, Sizer sizer)
10902
10903 Set the subsizer to be managed by this sizer item.
10904 """
54f9ee45 10905 return _core_.SizerItem_SetSizer(*args, **kwargs)
e811c8ce
RD
10906
10907 def GetSpacer(*args, **kwargs):
248ed943
RD
10908 """
10909 GetSpacer(self) -> Size
10910
10911 Get the size of the spacer managed by this sizer item.
10912 """
54f9ee45 10913 return _core_.SizerItem_GetSpacer(*args, **kwargs)
e811c8ce
RD
10914
10915 def SetSpacer(*args, **kwargs):
248ed943
RD
10916 """
10917 SetSpacer(self, Size size)
10918
10919 Set the size of the spacer to be managed by this sizer item.
10920 """
54f9ee45 10921 return _core_.SizerItem_SetSpacer(*args, **kwargs)
e811c8ce
RD
10922
10923 def Show(*args, **kwargs):
248ed943
RD
10924 """
10925 Show(self, bool show)
10926
10927 Set the show item attribute, which sizers use to determine if the item
10928 is to be made part of the layout or not. If the item is tracking a
10929 window then it is shown or hidden as needed.
10930 """
54f9ee45 10931 return _core_.SizerItem_Show(*args, **kwargs)
e811c8ce
RD
10932
10933 def IsShown(*args, **kwargs):
248ed943
RD
10934 """
10935 IsShown(self) -> bool
10936
10937 Is the item to be shown in the layout?
10938 """
54f9ee45 10939 return _core_.SizerItem_IsShown(*args, **kwargs)
e811c8ce
RD
10940
10941 def GetPosition(*args, **kwargs):
248ed943
RD
10942 """
10943 GetPosition(self) -> Point
10944
10945 Returns the current position of the item, as set in the last Layout.
10946 """
54f9ee45 10947 return _core_.SizerItem_GetPosition(*args, **kwargs)
e811c8ce
RD
10948
10949 def GetUserData(*args, **kwargs):
248ed943
RD
10950 """
10951 GetUserData(self) -> PyObject
10952
10953 Returns the userData associated with this sizer item, or None if there
10954 isn't any.
10955 """
54f9ee45 10956 return _core_.SizerItem_GetUserData(*args, **kwargs)
e811c8ce 10957
091f5bed
RD
10958 def SetUserData(*args, **kwargs):
10959 """
10960 SetUserData(self, PyObject userData)
10961
10962 Associate a Python object with this sizer item.
10963 """
10964 return _core_.SizerItem_SetUserData(*args, **kwargs)
10965
0085ce49
RD
10966SizerItem_swigregister = _core_.SizerItem_swigregister
10967SizerItem_swigregister(SizerItem)
d14a1e28 10968
248ed943 10969def SizerItemWindow(*args, **kwargs):
0df68c9f 10970 """
248ed943
RD
10971 SizerItemWindow(Window window, int proportion, int flag, int border,
10972 PyObject userData=None) -> SizerItem
10973
10974 Constructs a `wx.SizerItem` for tracking a window.
0df68c9f 10975 """
248ed943 10976 val = _core_.new_SizerItemWindow(*args, **kwargs)
d14a1e28
RD
10977 return val
10978
248ed943 10979def SizerItemSpacer(*args, **kwargs):
0df68c9f 10980 """
248ed943
RD
10981 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
10982 PyObject userData=None) -> SizerItem
10983
10984 Constructs a `wx.SizerItem` for tracking a spacer.
0df68c9f 10985 """
248ed943 10986 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d14a1e28
RD
10987 return val
10988
10989def SizerItemSizer(*args, **kwargs):
0df68c9f
RD
10990 """
10991 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
10992 PyObject userData=None) -> SizerItem
10993
10994 Constructs a `wx.SizerItem` for tracking a subsizer
0df68c9f 10995 """
54f9ee45 10996 val = _core_.new_SizerItemSizer(*args, **kwargs)
d14a1e28
RD
10997 return val
10998
10999class Sizer(Object):
248ed943
RD
11000 """
11001 wx.Sizer is the abstract base class used for laying out subwindows in
11002 a window. You cannot use wx.Sizer directly; instead, you will have to
11003 use one of the sizer classes derived from it such as `wx.BoxSizer`,
11004 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
11005 and `wx.GridBagSizer`.
11006
11007 The concept implemented by sizers in wxWidgets is closely related to
11008 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11009 toolkit or the Qt toolkit. It is based upon the idea of the individual
11010 subwindows reporting their minimal required size and their ability to
11011 get stretched if the size of the parent window has changed. This will
11012 most often mean that the programmer does not set the original size of
11013 a dialog in the beginning, rather the dialog will assigned a sizer and
11014 this sizer will be queried about the recommended size. The sizer in
11015 turn will query its children, which can be normal windows or contorls,
11016 empty space or other sizers, so that a hierarchy of sizers can be
11017 constructed. Note that wxSizer does not derive from wxWindow and thus
11018 do not interfere with tab ordering and requires very little resources
11019 compared to a real window on screen.
11020
11021 What makes sizers so well fitted for use in wxWidgets is the fact that
11022 every control reports its own minimal size and the algorithm can
11023 handle differences in font sizes or different window (dialog item)
11024 sizes on different platforms without problems. If for example the
11025 standard font as well as the overall design of Mac widgets requires
11026 more space than on Windows, then the initial size of a dialog using a
11027 sizer will automatically be bigger on Mac than on Windows.
11028 """
0085ce49
RD
11029 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11030 def __init__(self): raise AttributeError, "No constructor defined"
11031 __repr__ = _swig_repr
11032 __swig_destroy__ = _core_.delete_Sizer
11033 __del__ = lambda self : None;
e811c8ce 11034 def _setOORInfo(*args, **kwargs):
a95a7133 11035 """_setOORInfo(self, PyObject _self)"""
54f9ee45 11036 return _core_.Sizer__setOORInfo(*args, **kwargs)
e811c8ce
RD
11037
11038 def Add(*args, **kwargs):
0df68c9f 11039 """
248ed943 11040 Add(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11041 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11042
11043 Appends a child item to the sizer.
0df68c9f 11044 """
54f9ee45 11045 return _core_.Sizer_Add(*args, **kwargs)
e811c8ce
RD
11046
11047 def Insert(*args, **kwargs):
0df68c9f 11048 """
248ed943 11049 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11050 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11051
11052 Inserts a new item into the list of items managed by this sizer before
11053 the item at index *before*. See `Add` for a description of the parameters.
0df68c9f 11054 """
54f9ee45 11055 return _core_.Sizer_Insert(*args, **kwargs)
e811c8ce
RD
11056
11057 def Prepend(*args, **kwargs):
0df68c9f 11058 """
248ed943 11059 Prepend(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11060 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11061
11062 Adds a new item to the begining of the list of sizer items managed by
11063 this sizer. See `Add` for a description of the parameters.
0df68c9f 11064 """
54f9ee45 11065 return _core_.Sizer_Prepend(*args, **kwargs)
e811c8ce
RD
11066
11067 def Remove(*args, **kwargs):
248ed943
RD
11068 """
11069 Remove(self, item) -> bool
11070
11071 Removes an item from the sizer and destroys it. This method does not
11072 cause any layout or resizing to take place, call `Layout` to update
11073 the layout on screen after removing a child from the sizer. The
11074 *item* parameter can be either a window, a sizer, or the zero-based
11075 index of an item to remove. Returns True if the child item was found
11076 and removed.
11077 """
54f9ee45 11078 return _core_.Sizer_Remove(*args, **kwargs)
e811c8ce 11079
1c0f361b 11080 def Detach(*args, **kwargs):
248ed943
RD
11081 """
11082 Detach(self, item) -> bool
11083
11084 Detaches an item from the sizer without destroying it. This method
11085 does not cause any layout or resizing to take place, call `Layout` to
11086 do so. The *item* parameter can be either a window, a sizer, or the
11087 zero-based index of the item to be detached. Returns True if the child item
11088 was found and detached.
11089 """
1c0f361b
RD
11090 return _core_.Sizer_Detach(*args, **kwargs)
11091
d3b6e4ff
RD
11092 def GetItem(*args, **kwargs):
11093 """
11094 GetItem(self, item) -> wx.SizerItem
11095
11096 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11097 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11098 the item to be found.
d3b6e4ff
RD
11099 """
11100 return _core_.Sizer_GetItem(*args, **kwargs)
11101
e811c8ce 11102 def _SetItemMinSize(*args, **kwargs):
a95a7133 11103 """_SetItemMinSize(self, PyObject item, Size size)"""
54f9ee45 11104 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
e811c8ce 11105
248ed943
RD
11106 def SetItemMinSize(self, item, *args):
11107 """
11108 SetItemMinSize(self, item, Size size)
11109
11110 Sets the minimum size that will be allocated for an item in the sizer.
11111 The *item* parameter can be either a window, a sizer, or the
11112 zero-based index of the item. If a window or sizer is given then it
11113 will be searched for recursivly in subsizers if neccessary.
11114 """
11115 if len(args) == 2:
11116 # for backward compatibility accept separate width,height args too
11117 return self._SetItemMinSize(item, args)
11118 else:
11119 return self._SetItemMinSize(item, args[0])
11120
e811c8ce 11121 def AddItem(*args, **kwargs):
248ed943
RD
11122 """
11123 AddItem(self, SizerItem item)
11124
11125 Adds a `wx.SizerItem` to the sizer.
11126 """
54f9ee45 11127 return _core_.Sizer_AddItem(*args, **kwargs)
e811c8ce
RD
11128
11129 def InsertItem(*args, **kwargs):
248ed943
RD
11130 """
11131 InsertItem(self, int index, SizerItem item)
11132
11133 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11134 """
54f9ee45 11135 return _core_.Sizer_InsertItem(*args, **kwargs)
e811c8ce
RD
11136
11137 def PrependItem(*args, **kwargs):
248ed943
RD
11138 """
11139 PrependItem(self, SizerItem item)
11140
11141 Prepends a `wx.SizerItem` to the sizer.
11142 """
54f9ee45 11143 return _core_.Sizer_PrependItem(*args, **kwargs)
e811c8ce 11144
248ed943 11145 def AddMany(self, items):
66c033b4
RD
11146 """
11147 AddMany is a convenience method for adding several items
11148 to a sizer at one time. Simply pass it a list of tuples,
11149 where each tuple consists of the parameters that you
11150 would normally pass to the `Add` method.
11151 """
248ed943
RD
11152 for item in items:
11153 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11154 item = (item, )
11155 self.Add(*item)
d14a1e28 11156
74e96f3d 11157 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
11158 def AddWindow(self, *args, **kw):
11159 """Compatibility alias for `Add`."""
11160 return self.Add(*args, **kw)
11161 def AddSizer(self, *args, **kw):
11162 """Compatibility alias for `Add`."""
11163 return self.Add(*args, **kw)
11164 def AddSpacer(self, *args, **kw):
11165 """Compatibility alias for `Add`."""
11166 return self.Add(*args, **kw)
11167
11168 def PrependWindow(self, *args, **kw):
11169 """Compatibility alias for `Prepend`."""
11170 return self.Prepend(*args, **kw)
11171 def PrependSizer(self, *args, **kw):
11172 """Compatibility alias for `Prepend`."""
11173 return self.Prepend(*args, **kw)
11174 def PrependSpacer(self, *args, **kw):
11175 """Compatibility alias for `Prepend`."""
11176 return self.Prepend(*args, **kw)
11177
11178 def InsertWindow(self, *args, **kw):
11179 """Compatibility alias for `Insert`."""
11180 return self.Insert(*args, **kw)
11181 def InsertSizer(self, *args, **kw):
11182 """Compatibility alias for `Insert`."""
11183 return self.Insert(*args, **kw)
11184 def InsertSpacer(self, *args, **kw):
11185 """Compatibility alias for `Insert`."""
11186 return self.Insert(*args, **kw)
11187
11188 def RemoveWindow(self, *args, **kw):
11189 """Compatibility alias for `Remove`."""
11190 return self.Remove(*args, **kw)
11191 def RemoveSizer(self, *args, **kw):
11192 """Compatibility alias for `Remove`."""
11193 return self.Remove(*args, **kw)
11194 def RemovePos(self, *args, **kw):
11195 """Compatibility alias for `Remove`."""
11196 return self.Remove(*args, **kw)
d14a1e28
RD
11197
11198
e811c8ce 11199 def SetDimension(*args, **kwargs):
248ed943
RD
11200 """
11201 SetDimension(self, int x, int y, int width, int height)
11202
11203 Call this to force the sizer to take the given dimension and thus
11204 force the items owned by the sizer to resize themselves according to
11205 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11206 methods.
11207 """
54f9ee45 11208 return _core_.Sizer_SetDimension(*args, **kwargs)
e811c8ce
RD
11209
11210 def SetMinSize(*args, **kwargs):
248ed943
RD
11211 """
11212 SetMinSize(self, Size size)
11213
11214 Call this to give the sizer a minimal size. Normally, the sizer will
11215 calculate its minimal size based purely on how much space its children
11216 need. After calling this method `GetMinSize` will return either the
11217 minimal size as requested by its children or the minimal size set
11218 here, depending on which is bigger.
11219 """
54f9ee45 11220 return _core_.Sizer_SetMinSize(*args, **kwargs)
e811c8ce
RD
11221
11222 def GetSize(*args, **kwargs):
248ed943
RD
11223 """
11224 GetSize(self) -> Size
11225
11226 Returns the current size of the space managed by the sizer.
11227 """
54f9ee45 11228 return _core_.Sizer_GetSize(*args, **kwargs)
e811c8ce
RD
11229
11230 def GetPosition(*args, **kwargs):
248ed943
RD
11231 """
11232 GetPosition(self) -> Point
11233
11234 Returns the current position of the sizer's managed space.
11235 """
54f9ee45 11236 return _core_.Sizer_GetPosition(*args, **kwargs)
e811c8ce
RD
11237
11238 def GetMinSize(*args, **kwargs):
248ed943
RD
11239 """
11240 GetMinSize(self) -> Size
11241
11242 Returns the minimal size of the sizer. This is either the combined
11243 minimal size of all the children and their borders or the minimal size
11244 set by SetMinSize, depending on which is bigger.
11245 """
54f9ee45 11246 return _core_.Sizer_GetMinSize(*args, **kwargs)
e811c8ce 11247
d14a1e28 11248 def GetSizeTuple(self):
1c0f361b 11249 return self.GetSize().Get()
d14a1e28 11250 def GetPositionTuple(self):
1c0f361b 11251 return self.GetPosition().Get()
d14a1e28 11252 def GetMinSizeTuple(self):
1c0f361b 11253 return self.GetMinSize().Get()
d14a1e28 11254
e811c8ce 11255 def RecalcSizes(*args, **kwargs):
248ed943
RD
11256 """
11257 RecalcSizes(self)
11258
11259 Using the sizes calculated by `CalcMin` reposition and resize all the
11260 items managed by this sizer. You should not need to call this directly as
11261 it is called by `Layout`.
11262 """
54f9ee45 11263 return _core_.Sizer_RecalcSizes(*args, **kwargs)
e811c8ce
RD
11264
11265 def CalcMin(*args, **kwargs):
248ed943
RD
11266 """
11267 CalcMin(self) -> Size
11268
11269 This method is where the sizer will do the actual calculation of its
11270 children's minimal sizes. You should not need to call this directly as
11271 it is called by `Layout`.
11272 """
54f9ee45 11273 return _core_.Sizer_CalcMin(*args, **kwargs)
e811c8ce
RD
11274
11275 def Layout(*args, **kwargs):
248ed943
RD
11276 """
11277 Layout(self)
11278
11279 This method will force the recalculation and layout of the items
11280 controlled by the sizer using the current space allocated to the
11281 sizer. Normally this is called automatically from the owning window's
11282 EVT_SIZE handler, but it is also useful to call it from user code when
11283 one of the items in a sizer change size, or items are added or
11284 removed.
11285 """
54f9ee45 11286 return _core_.Sizer_Layout(*args, **kwargs)
e811c8ce
RD
11287
11288 def Fit(*args, **kwargs):
248ed943
RD
11289 """
11290 Fit(self, Window window) -> Size
11291
11292 Tell the sizer to resize the *window* to match the sizer's minimal
11293 size. This is commonly done in the constructor of the window itself in
11294 order to set its initial size to match the needs of the children as
11295 determined by the sizer. Returns the new size.
11296
11297 For a top level window this is the total window size, not the client size.
11298 """
54f9ee45 11299 return _core_.Sizer_Fit(*args, **kwargs)
e811c8ce
RD
11300
11301 def FitInside(*args, **kwargs):
248ed943
RD
11302 """
11303 FitInside(self, Window window)
11304
11305 Tell the sizer to resize the *virtual size* of the *window* to match the
11306 sizer's minimal size. This will not alter the on screen size of the
11307 window, but may cause the addition/removal/alteration of scrollbars
11308 required to view the virtual area in windows which manage it.
11309
11310 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11311
11312 """
54f9ee45 11313 return _core_.Sizer_FitInside(*args, **kwargs)
e811c8ce
RD
11314
11315 def SetSizeHints(*args, **kwargs):
248ed943
RD
11316 """
11317 SetSizeHints(self, Window window)
11318
11319 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11320 match the sizer's minimal size. This is commonly done in the
11321 constructor of the window itself if the window is resizable (as are
11322 many dialogs under Unix and frames on probably all platforms) in order
11323 to prevent the window from being sized smaller than the minimal size
11324 required by the sizer.
11325 """
54f9ee45 11326 return _core_.Sizer_SetSizeHints(*args, **kwargs)
e811c8ce
RD
11327
11328 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
11329 """
11330 SetVirtualSizeHints(self, Window window)
11331
11332 Tell the sizer to set the minimal size of the window virtual area to
11333 match the sizer's minimal size. For windows with managed scrollbars
11334 this will set them appropriately.
11335
11336 :see: `wx.ScrolledWindow.SetScrollbars`
11337
11338 """
54f9ee45 11339 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
e811c8ce
RD
11340
11341 def Clear(*args, **kwargs):
248ed943
RD
11342 """
11343 Clear(self, bool deleteWindows=False)
11344
11345 Clear all items from the sizer, optionally destroying the window items
11346 as well.
11347 """
54f9ee45 11348 return _core_.Sizer_Clear(*args, **kwargs)
e811c8ce
RD
11349
11350 def DeleteWindows(*args, **kwargs):
248ed943
RD
11351 """
11352 DeleteWindows(self)
11353
11354 Destroy all windows managed by the sizer.
11355 """
54f9ee45 11356 return _core_.Sizer_DeleteWindows(*args, **kwargs)
e811c8ce
RD
11357
11358 def GetChildren(*args, **kwargs):
248ed943 11359 """
51b83b37 11360 GetChildren(self) -> list
248ed943
RD
11361
11362 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11363 """
54f9ee45 11364 return _core_.Sizer_GetChildren(*args, **kwargs)
e811c8ce
RD
11365
11366 def Show(*args, **kwargs):
248ed943 11367 """
ae8162c8 11368 Show(self, item, bool show=True, bool recursive=false) -> bool
e811c8ce 11369
248ed943
RD
11370 Shows or hides an item managed by the sizer. To make a sizer item
11371 disappear or reappear, use Show followed by `Layout`. The *item*
11372 parameter can be either a window, a sizer, or the zero-based index of
7e63a440
RD
11373 the item. Use the recursive parameter to show or hide an item in a
11374 subsizer. Returns True if the item was found.
248ed943
RD
11375 """
11376 return _core_.Sizer_Show(*args, **kwargs)
e811c8ce
RD
11377
11378 def IsShown(*args, **kwargs):
248ed943
RD
11379 """
11380 IsShown(self, item)
11381
b1fcee84 11382 Determines if the item is currently shown. To make a sizer
248ed943
RD
11383 item disappear or reappear, use Show followed by `Layout`. The *item*
11384 parameter can be either a window, a sizer, or the zero-based index of
11385 the item.
11386 """
54f9ee45 11387 return _core_.Sizer_IsShown(*args, **kwargs)
e811c8ce 11388
7e63a440 11389 def Hide(self, item, recursive=False):
248ed943 11390 """
27fb7603 11391 A convenience method for `Show` (item, False, recursive).
248ed943 11392 """
06759a38 11393 return self.Show(item, False, recursive)
248ed943 11394
e811c8ce 11395 def ShowItems(*args, **kwargs):
248ed943
RD
11396 """
11397 ShowItems(self, bool show)
11398
84f85550 11399 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 11400 """
54f9ee45 11401 return _core_.Sizer_ShowItems(*args, **kwargs)
e811c8ce 11402
0085ce49
RD
11403Sizer_swigregister = _core_.Sizer_swigregister
11404Sizer_swigregister(Sizer)
d14a1e28
RD
11405
11406class PySizer(Sizer):
248ed943
RD
11407 """
11408 wx.PySizer is a special version of `wx.Sizer` that has been
11409 instrumented to allow the C++ virtual methods to be overloaded in
11410 Python derived classes. You would derive from this class if you are
11411 wanting to implement a custom sizer in Python code. Simply implement
11412 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11413 For example::
11414
11415 class MySizer(wx.PySizer):
11416 def __init__(self):
11417 wx.PySizer.__init__(self)
11418
11419 def CalcMin(self):
11420 for item in self.GetChildren():
11421 # calculate the total minimum width and height needed
11422 # by all items in the sizer according to this sizer's
11423 # layout algorithm.
11424 ...
11425 return wx.Size(width, height)
11426
11427 def RecalcSizes(self):
11428 # find the space allotted to this sizer
11429 pos = self.GetPosition()
11430 size = self.GetSize()
11431 for item in self.GetChildren():
11432 # Recalculate (if necessary) the position and size of
11433 # each item and then call item.SetDimension to do the
11434 # actual positioning and sizing of the items within the
11435 # space alloted to this sizer.
11436 ...
11437 item.SetDimension(itemPos, itemSize)
11438
11439
11440 When `Layout` is called it first calls `CalcMin` followed by
11441 `RecalcSizes` so you can optimize a bit by saving the results of
e505d15e 11442 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
11443
11444 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11445
11446
11447 """
0085ce49
RD
11448 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11449 __repr__ = _swig_repr
11450 def __init__(self, *args, **kwargs):
248ed943
RD
11451 """
11452 __init__(self) -> PySizer
11453
11454 Creates a wx.PySizer. Must be called from the __init__ in the derived
11455 class.
11456 """
0085ce49 11457 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
d14a1e28 11458 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
e811c8ce
RD
11459
11460 def _setCallbackInfo(*args, **kwargs):
a95a7133 11461 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 11462 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
e811c8ce 11463
0085ce49
RD
11464PySizer_swigregister = _core_.PySizer_swigregister
11465PySizer_swigregister(PySizer)
d14a1e28
RD
11466
11467#---------------------------------------------------------------------------
11468
11469class BoxSizer(Sizer):
248ed943
RD
11470 """
11471 The basic idea behind a box sizer is that windows will most often be
11472 laid out in rather simple basic geometry, typically in a row or a
11473 column or nested hierarchies of either. A wx.BoxSizer will lay out
11474 its items in a simple row or column, depending on the orientation
11475 parameter passed to the constructor.
11476 """
0085ce49
RD
11477 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11478 __repr__ = _swig_repr
11479 def __init__(self, *args, **kwargs):
248ed943
RD
11480 """
11481 __init__(self, int orient=HORIZONTAL) -> BoxSizer
11482
11483 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11484 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11485 sizer.
11486 """
0085ce49 11487 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d14a1e28 11488 self._setOORInfo(self)
e811c8ce
RD
11489
11490 def GetOrientation(*args, **kwargs):
248ed943
RD
11491 """
11492 GetOrientation(self) -> int
11493
11494 Returns the current orientation of the sizer.
11495 """
54f9ee45 11496 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
e811c8ce
RD
11497
11498 def SetOrientation(*args, **kwargs):
248ed943
RD
11499 """
11500 SetOrientation(self, int orient)
e811c8ce 11501
248ed943
RD
11502 Resets the orientation of the sizer.
11503 """
11504 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
e811c8ce 11505
0085ce49
RD
11506BoxSizer_swigregister = _core_.BoxSizer_swigregister
11507BoxSizer_swigregister(BoxSizer)
d14a1e28
RD
11508
11509#---------------------------------------------------------------------------
11510
11511class StaticBoxSizer(BoxSizer):
248ed943
RD
11512 """
11513 wx.StaticBoxSizer derives from and functions identically to the
11514 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11515 manages. Note that this static box must be created separately and
11516 passed to the sizer constructor.
11517 """
0085ce49
RD
11518 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11519 __repr__ = _swig_repr
11520 def __init__(self, *args, **kwargs):
248ed943
RD
11521 """
11522 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
11523
11524 Constructor. It takes an associated static box and the orientation
11525 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11526 ``wx.HORIZONTAL``.
11527 """
0085ce49 11528 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d14a1e28 11529 self._setOORInfo(self)
e811c8ce
RD
11530
11531 def GetStaticBox(*args, **kwargs):
248ed943
RD
11532 """
11533 GetStaticBox(self) -> StaticBox
e811c8ce 11534
248ed943
RD
11535 Returns the static box associated with this sizer.
11536 """
11537 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
e811c8ce 11538
0085ce49
RD
11539StaticBoxSizer_swigregister = _core_.StaticBoxSizer_swigregister
11540StaticBoxSizer_swigregister(StaticBoxSizer)
d14a1e28
RD
11541
11542#---------------------------------------------------------------------------
11543
11544class GridSizer(Sizer):
248ed943
RD
11545 """
11546 A grid sizer is a sizer which lays out its children in a
11547 two-dimensional table with all cells having the same size. In other
11548 words, the width of each cell within the grid is the width of the
11549 widest item added to the sizer and the height of each grid cell is the
11550 height of the tallest item. An optional vertical and/or horizontal
11551 gap between items can also be specified (in pixels.)
11552
11553 Items are placed in the cells of the grid in the order they are added,
11554 in row-major order. In other words, the first row is filled first,
11555 then the second, and so on until all items have been added. (If
11556 neccessary, additional rows will be added as items are added.) If you
11557 need to have greater control over the cells that items are placed in
11558 then use the `wx.GridBagSizer`.
11559
11560 """
0085ce49
RD
11561 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11562 __repr__ = _swig_repr
11563 def __init__(self, *args, **kwargs):
248ed943
RD
11564 """
11565 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
11566
11567 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11568 of columns and rows in the sizer - if either of the parameters is
11569 zero, it will be calculated to from the total number of children in
11570 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11571 define extra space between all children.
11572 """
0085ce49 11573 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d14a1e28 11574 self._setOORInfo(self)
e811c8ce 11575
e811c8ce 11576 def SetCols(*args, **kwargs):
248ed943
RD
11577 """
11578 SetCols(self, int cols)
11579
11580 Sets the number of columns in the sizer.
11581 """
54f9ee45 11582 return _core_.GridSizer_SetCols(*args, **kwargs)
e811c8ce
RD
11583
11584 def SetRows(*args, **kwargs):
248ed943
RD
11585 """
11586 SetRows(self, int rows)
11587
11588 Sets the number of rows in the sizer.
11589 """
54f9ee45 11590 return _core_.GridSizer_SetRows(*args, **kwargs)
e811c8ce
RD
11591
11592 def SetVGap(*args, **kwargs):
248ed943
RD
11593 """
11594 SetVGap(self, int gap)
11595
11596 Sets the vertical gap (in pixels) between the cells in the sizer.
11597 """
54f9ee45 11598 return _core_.GridSizer_SetVGap(*args, **kwargs)
e811c8ce
RD
11599
11600 def SetHGap(*args, **kwargs):
248ed943
RD
11601 """
11602 SetHGap(self, int gap)
11603
11604 Sets the horizontal gap (in pixels) between cells in the sizer
11605 """
54f9ee45 11606 return _core_.GridSizer_SetHGap(*args, **kwargs)
e811c8ce
RD
11607
11608 def GetCols(*args, **kwargs):
248ed943
RD
11609 """
11610 GetCols(self) -> int
11611
11612 Returns the number of columns in the sizer.
11613 """
54f9ee45 11614 return _core_.GridSizer_GetCols(*args, **kwargs)
e811c8ce
RD
11615
11616 def GetRows(*args, **kwargs):
248ed943
RD
11617 """
11618 GetRows(self) -> int
11619
11620 Returns the number of rows in the sizer.
11621 """
54f9ee45 11622 return _core_.GridSizer_GetRows(*args, **kwargs)
e811c8ce
RD
11623
11624 def GetVGap(*args, **kwargs):
248ed943
RD
11625 """
11626 GetVGap(self) -> int
11627
11628 Returns the vertical gap (in pixels) between the cells in the sizer.
11629 """
54f9ee45 11630 return _core_.GridSizer_GetVGap(*args, **kwargs)
e811c8ce
RD
11631
11632 def GetHGap(*args, **kwargs):
248ed943
RD
11633 """
11634 GetHGap(self) -> int
11635
11636 Returns the horizontal gap (in pixels) between cells in the sizer.
11637 """
54f9ee45 11638 return _core_.GridSizer_GetHGap(*args, **kwargs)
e811c8ce 11639
0085ce49
RD
11640 def CalcRowsCols(self):
11641 """
11642 CalcRowsCols() -> (rows, cols)
11643
11644 Calculates how many rows and columns will be in the sizer based
11645 on the current number of items and also the rows, cols specified
11646 in the constructor.
11647 """
11648 nitems = len(self.GetChildren())
11649 rows = self.GetRows()
11650 cols = self.GetCols()
11651 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11652 if cols != 0:
11653 rows = (nitems + cols - 1) / cols
11654 elif rows != 0:
11655 cols = (nitems + rows - 1) / rows
11656 return (rows, cols)
d14a1e28 11657
0085ce49
RD
11658GridSizer_swigregister = _core_.GridSizer_swigregister
11659GridSizer_swigregister(GridSizer)
d14a1e28
RD
11660
11661#---------------------------------------------------------------------------
11662
54f9ee45
RD
11663FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11664FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11665FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
d14a1e28 11666class FlexGridSizer(GridSizer):
248ed943
RD
11667 """
11668 A flex grid sizer is a sizer which lays out its children in a
11669 two-dimensional table with all table cells in one row having the same
11670 height and all cells in one column having the same width, but all
11671 rows or all columns are not necessarily the same height or width as in
11672 the `wx.GridSizer`.
11673
11674 wx.FlexGridSizer can also size items equally in one direction but
11675 unequally ("flexibly") in the other. If the sizer is only flexible
11676 in one direction (this can be changed using `SetFlexibleDirection`), it
11677 needs to be decided how the sizer should grow in the other ("non
11678 flexible") direction in order to fill the available space. The
11679 `SetNonFlexibleGrowMode` method serves this purpose.
11680
11681
11682 """
0085ce49
RD
11683 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11684 __repr__ = _swig_repr
11685 def __init__(self, *args, **kwargs):
248ed943
RD
11686 """
11687 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
11688
11689 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11690 number of columns and rows in the sizer - if either of the parameters
11691 is zero, it will be calculated to from the total number of children in
11692 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11693 define extra space between all children.
11694 """
0085ce49 11695 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d14a1e28 11696 self._setOORInfo(self)
e811c8ce 11697
248ed943
RD
11698 def AddGrowableRow(*args, **kwargs):
11699 """
11700 AddGrowableRow(self, size_t idx, int proportion=0)
e811c8ce 11701
248ed943
RD
11702 Specifies that row *idx* (starting from zero) should be grown if there
11703 is extra space available to the sizer.
e811c8ce 11704
248ed943
RD
11705 The *proportion* parameter has the same meaning as the stretch factor
11706 for the box sizers except that if all proportions are 0, then all
11707 columns are resized equally (instead of not being resized at all).
11708 """
54f9ee45 11709 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
e811c8ce
RD
11710
11711 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
11712 """
11713 RemoveGrowableRow(self, size_t idx)
11714
11715 Specifies that row *idx* is no longer growable.
11716 """
54f9ee45 11717 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
e811c8ce
RD
11718
11719 def AddGrowableCol(*args, **kwargs):
248ed943
RD
11720 """
11721 AddGrowableCol(self, size_t idx, int proportion=0)
11722
11723 Specifies that column *idx* (starting from zero) should be grown if
11724 there is extra space available to the sizer.
11725
11726 The *proportion* parameter has the same meaning as the stretch factor
11727 for the box sizers except that if all proportions are 0, then all
11728 columns are resized equally (instead of not being resized at all).
11729 """
54f9ee45 11730 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
e811c8ce
RD
11731
11732 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
11733 """
11734 RemoveGrowableCol(self, size_t idx)
11735
11736 Specifies that column *idx* is no longer growable.
11737 """
54f9ee45 11738 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
e811c8ce
RD
11739
11740 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
11741 """
11742 SetFlexibleDirection(self, int direction)
11743
11744 Specifies whether the sizer should flexibly resize its columns, rows,
11745 or both. Argument *direction* can be one of the following values. Any
11746 other value is ignored.
11747
11748 ============== =======================================
11749 wx.VERTICAL Rows are flexibly sized.
11750 wx.HORIZONTAL Columns are flexibly sized.
11751 wx.BOTH Both rows and columns are flexibly sized
11752 (this is the default value).
11753 ============== =======================================
11754
11755 Note that this method does not trigger relayout.
11756
11757 """
54f9ee45 11758 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
11759
11760 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
11761 """
11762 GetFlexibleDirection(self) -> int
11763
11764 Returns a value that specifies whether the sizer
11765 flexibly resizes its columns, rows, or both (default).
11766
11767 :see: `SetFlexibleDirection`
11768 """
54f9ee45 11769 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
11770
11771 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
11772 """
11773 SetNonFlexibleGrowMode(self, int mode)
11774
11775 Specifies how the sizer should grow in the non-flexible direction if
11776 there is one (so `SetFlexibleDirection` must have been called
11777 previously). Argument *mode* can be one of the following values:
11778
11779 ========================== =================================================
11780 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11781 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11782 `AddGrowableCol` and `AddGrowableRow`. In this
11783 case equal sizing applies to minimum sizes of
11784 columns or rows (this is the default value).
11785 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11786 the non flexible direction, whether they are
11787 growable or not in the flexbile direction.
11788 ========================== =================================================
11789
11790 Note that this method does not trigger relayout.
11791
11792
11793 """
54f9ee45 11794 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
11795
11796 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
11797 """
11798 GetNonFlexibleGrowMode(self) -> int
11799
11800 Returns the value that specifies how the sizer grows in the
11801 non-flexible direction if there is one.
11802
11803 :see: `SetNonFlexibleGrowMode`
11804 """
54f9ee45 11805 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
11806
11807 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
11808 """
11809 GetRowHeights(self) -> list
11810
11811 Returns a list of integers representing the heights of each of the
11812 rows in the sizer.
11813 """
54f9ee45 11814 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
e811c8ce
RD
11815
11816 def GetColWidths(*args, **kwargs):
fd2dc343
RD
11817 """
11818 GetColWidths(self) -> list
11819
11820 Returns a list of integers representing the widths of each of the
11821 columns in the sizer.
11822 """
54f9ee45 11823 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
e811c8ce 11824
0085ce49
RD
11825FlexGridSizer_swigregister = _core_.FlexGridSizer_swigregister
11826FlexGridSizer_swigregister(FlexGridSizer)
d14a1e28 11827
e505d15e
RD
11828class StdDialogButtonSizer(BoxSizer):
11829 """
11830 A special sizer that knows how to order and position standard buttons
11831 in order to conform to the current platform's standards. You simply
11832 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 11833 buttons using the standard ID's. Then call `Realize` and the sizer
e505d15e
RD
11834 will take care of the rest.
11835
11836 """
0085ce49
RD
11837 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11838 __repr__ = _swig_repr
11839 def __init__(self, *args, **kwargs):
e505d15e 11840 """__init__(self) -> StdDialogButtonSizer"""
0085ce49 11841 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
e505d15e
RD
11842 def AddButton(*args, **kwargs):
11843 """
11844 AddButton(self, wxButton button)
11845
11846 Use this to add the buttons to this sizer. Do not use the `Add`
11847 method in the base class.
11848 """
11849 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
11850
53aa7709 11851 def Realize(*args, **kwargs):
e505d15e 11852 """
53aa7709 11853 Realize(self)
e505d15e
RD
11854
11855 This funciton needs to be called after all the buttons have been added
11856 to the sizer. It will reorder them and position them in a platform
11857 specifc manner.
11858 """
53aa7709 11859 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
11860
11861 def SetAffirmativeButton(*args, **kwargs):
11862 """SetAffirmativeButton(self, wxButton button)"""
11863 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
11864
11865 def SetNegativeButton(*args, **kwargs):
11866 """SetNegativeButton(self, wxButton button)"""
11867 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
11868
11869 def SetCancelButton(*args, **kwargs):
11870 """SetCancelButton(self, wxButton button)"""
11871 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
e505d15e
RD
11872
11873 def GetAffirmativeButton(*args, **kwargs):
11874 """GetAffirmativeButton(self) -> wxButton"""
11875 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
11876
11877 def GetApplyButton(*args, **kwargs):
11878 """GetApplyButton(self) -> wxButton"""
11879 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
11880
11881 def GetNegativeButton(*args, **kwargs):
11882 """GetNegativeButton(self) -> wxButton"""
11883 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
11884
11885 def GetCancelButton(*args, **kwargs):
11886 """GetCancelButton(self) -> wxButton"""
11887 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
11888
11889 def GetHelpButton(*args, **kwargs):
11890 """GetHelpButton(self) -> wxButton"""
11891 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
11892
0085ce49
RD
11893StdDialogButtonSizer_swigregister = _core_.StdDialogButtonSizer_swigregister
11894StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
e505d15e 11895
d14a1e28
RD
11896#---------------------------------------------------------------------------
11897
11898class GBPosition(object):
248ed943
RD
11899 """
11900 This class represents the position of an item in a virtual grid of
11901 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11902 typemaps that will automatically convert from a 2-element sequence of
11903 integers to a wx.GBPosition, so you can use the more pythonic
11904 representation of the position nearly transparently in Python code.
11905 """
0085ce49
RD
11906 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11907 __repr__ = _swig_repr
11908 def __init__(self, *args, **kwargs):
248ed943
RD
11909 """
11910 __init__(self, int row=0, int col=0) -> GBPosition
11911
11912 This class represents the position of an item in a virtual grid of
11913 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11914 typemaps that will automatically convert from a 2-element sequence of
11915 integers to a wx.GBPosition, so you can use the more pythonic
11916 representation of the position nearly transparently in Python code.
11917 """
0085ce49
RD
11918 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11919 __swig_destroy__ = _core_.delete_GBPosition
11920 __del__ = lambda self : None;
e811c8ce 11921 def GetRow(*args, **kwargs):
a95a7133 11922 """GetRow(self) -> int"""
54f9ee45 11923 return _core_.GBPosition_GetRow(*args, **kwargs)
e811c8ce
RD
11924
11925 def GetCol(*args, **kwargs):
a95a7133 11926 """GetCol(self) -> int"""
54f9ee45 11927 return _core_.GBPosition_GetCol(*args, **kwargs)
e811c8ce
RD
11928
11929 def SetRow(*args, **kwargs):
a95a7133 11930 """SetRow(self, int row)"""
54f9ee45 11931 return _core_.GBPosition_SetRow(*args, **kwargs)
e811c8ce
RD
11932
11933 def SetCol(*args, **kwargs):
a95a7133 11934 """SetCol(self, int col)"""
54f9ee45 11935 return _core_.GBPosition_SetCol(*args, **kwargs)
e811c8ce
RD
11936
11937 def __eq__(*args, **kwargs):
a95a7133 11938 """__eq__(self, GBPosition other) -> bool"""
54f9ee45 11939 return _core_.GBPosition___eq__(*args, **kwargs)
e811c8ce
RD
11940
11941 def __ne__(*args, **kwargs):
a95a7133 11942 """__ne__(self, GBPosition other) -> bool"""
54f9ee45 11943 return _core_.GBPosition___ne__(*args, **kwargs)
e811c8ce
RD
11944
11945 def Set(*args, **kwargs):
a95a7133 11946 """Set(self, int row=0, int col=0)"""
54f9ee45 11947 return _core_.GBPosition_Set(*args, **kwargs)
e811c8ce
RD
11948
11949 def Get(*args, **kwargs):
a95a7133 11950 """Get(self) -> PyObject"""
54f9ee45 11951 return _core_.GBPosition_Get(*args, **kwargs)
e811c8ce 11952
41e2b43e 11953 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
11954 def __str__(self): return str(self.Get())
11955 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11956 def __len__(self): return len(self.Get())
11957 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
11958 def __setitem__(self, index, val):
11959 if index == 0: self.SetRow(val)
11960 elif index == 1: self.SetCol(val)
11961 else: raise IndexError
e811c8ce 11962 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
11963 __safe_for_unpickling__ = True
11964 def __reduce__(self): return (wx.GBPosition, self.Get())
d14a1e28
RD
11965
11966 row = property(GetRow, SetRow)
11967 col = property(GetCol, SetCol)
11968
0085ce49
RD
11969GBPosition_swigregister = _core_.GBPosition_swigregister
11970GBPosition_swigregister(GBPosition)
d14a1e28
RD
11971
11972class GBSpan(object):
248ed943
RD
11973 """
11974 This class is used to hold the row and column spanning attributes of
11975 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11976 automatically convert from a 2-element sequence of integers to a
11977 wx.GBSpan, so you can use the more pythonic representation of the span
11978 nearly transparently in Python code.
11979
11980 """
0085ce49
RD
11981 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11982 __repr__ = _swig_repr
11983 def __init__(self, *args, **kwargs):
248ed943
RD
11984 """
11985 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
11986
11987 Construct a new wxGBSpan, optionally setting the rowspan and
11988 colspan. The default is (1,1). (Meaning that the item occupies one
11989 cell in each direction.
11990 """
0085ce49
RD
11991 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
11992 __swig_destroy__ = _core_.delete_GBSpan
11993 __del__ = lambda self : None;
e811c8ce 11994 def GetRowspan(*args, **kwargs):
a95a7133 11995 """GetRowspan(self) -> int"""
54f9ee45 11996 return _core_.GBSpan_GetRowspan(*args, **kwargs)
e811c8ce
RD
11997
11998 def GetColspan(*args, **kwargs):
a95a7133 11999 """GetColspan(self) -> int"""
54f9ee45 12000 return _core_.GBSpan_GetColspan(*args, **kwargs)
e811c8ce
RD
12001
12002 def SetRowspan(*args, **kwargs):
a95a7133 12003 """SetRowspan(self, int rowspan)"""
54f9ee45 12004 return _core_.GBSpan_SetRowspan(*args, **kwargs)
e811c8ce
RD
12005
12006 def SetColspan(*args, **kwargs):
a95a7133 12007 """SetColspan(self, int colspan)"""
54f9ee45 12008 return _core_.GBSpan_SetColspan(*args, **kwargs)
e811c8ce
RD
12009
12010 def __eq__(*args, **kwargs):
a95a7133 12011 """__eq__(self, GBSpan other) -> bool"""
54f9ee45 12012 return _core_.GBSpan___eq__(*args, **kwargs)
e811c8ce
RD
12013
12014 def __ne__(*args, **kwargs):
a95a7133 12015 """__ne__(self, GBSpan other) -> bool"""
54f9ee45 12016 return _core_.GBSpan___ne__(*args, **kwargs)
e811c8ce
RD
12017
12018 def Set(*args, **kwargs):
a95a7133 12019 """Set(self, int rowspan=1, int colspan=1)"""
54f9ee45 12020 return _core_.GBSpan_Set(*args, **kwargs)
e811c8ce
RD
12021
12022 def Get(*args, **kwargs):
a95a7133 12023 """Get(self) -> PyObject"""
54f9ee45 12024 return _core_.GBSpan_Get(*args, **kwargs)
e811c8ce 12025
41e2b43e 12026 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
12027 def __str__(self): return str(self.Get())
12028 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12029 def __len__(self): return len(self.Get())
12030 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
12031 def __setitem__(self, index, val):
12032 if index == 0: self.SetRowspan(val)
12033 elif index == 1: self.SetColspan(val)
12034 else: raise IndexError
e811c8ce 12035 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
12036 __safe_for_unpickling__ = True
12037 def __reduce__(self): return (wx.GBSpan, self.Get())
d14a1e28
RD
12038
12039 rowspan = property(GetRowspan, SetRowspan)
12040 colspan = property(GetColspan, SetColspan)
12041
0085ce49
RD
12042GBSpan_swigregister = _core_.GBSpan_swigregister
12043GBSpan_swigregister(GBSpan)
d14a1e28
RD
12044
12045class GBSizerItem(SizerItem):
248ed943
RD
12046 """
12047 The wx.GBSizerItem class is used to track the additional data about
12048 items in a `wx.GridBagSizer` such as the item's position in the grid
12049 and how many rows or columns it spans.
12050
12051 """
0085ce49
RD
12052 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12053 __repr__ = _swig_repr
12054 def __init__(self, *args, **kwargs):
248ed943
RD
12055 """
12056 __init__(self) -> GBSizerItem
12057
12058 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12059 size will need to be set, as well as a position and span before this
12060 item can be used in a Sizer.
12061
12062 You will probably never need to create a wx.GBSizerItem directly as they
12063 are created automatically when the sizer's Add method is called.
12064 """
0085ce49
RD
12065 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12066 __swig_destroy__ = _core_.delete_GBSizerItem
12067 __del__ = lambda self : None;
e811c8ce 12068 def GetPos(*args, **kwargs):
248ed943
RD
12069 """
12070 GetPos(self) -> GBPosition
12071
12072 Get the grid position of the item
12073 """
54f9ee45 12074 return _core_.GBSizerItem_GetPos(*args, **kwargs)
e811c8ce
RD
12075
12076 def GetPosTuple(self): return self.GetPos().Get()
12077 def GetSpan(*args, **kwargs):
248ed943
RD
12078 """
12079 GetSpan(self) -> GBSpan
12080
12081 Get the row and column spanning of the item
12082 """
54f9ee45 12083 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
e811c8ce
RD
12084
12085 def GetSpanTuple(self): return self.GetSpan().Get()
12086 def SetPos(*args, **kwargs):
248ed943
RD
12087 """
12088 SetPos(self, GBPosition pos) -> bool
12089
12090 If the item is already a member of a sizer then first ensure that
12091 there is no other item that would intersect with this one at the new
12092 position, then set the new position. Returns True if the change is
12093 successful and after the next Layout() the item will be moved.
12094 """
54f9ee45 12095 return _core_.GBSizerItem_SetPos(*args, **kwargs)
e811c8ce
RD
12096
12097 def SetSpan(*args, **kwargs):
248ed943
RD
12098 """
12099 SetSpan(self, GBSpan span) -> bool
12100
12101 If the item is already a member of a sizer then first ensure that
12102 there is no other item that would intersect with this one with its new
12103 spanning size, then set the new spanning. Returns True if the change
12104 is successful and after the next Layout() the item will be resized.
12105
12106 """
54f9ee45 12107 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
e811c8ce 12108
248ed943 12109 def Intersects(*args, **kwargs):
0df68c9f 12110 """
a95a7133 12111 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
12112
12113 Returns True if this item and the other item instersect.
0df68c9f 12114 """
248ed943
RD
12115 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12116
12117 def IntersectsPos(*args, **kwargs):
12118 """
12119 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12120
12121 Returns True if the given pos/span would intersect with this item.
12122 """
12123 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
e811c8ce
RD
12124
12125 def GetEndPos(*args, **kwargs):
248ed943
RD
12126 """
12127 GetEndPos(self) -> GBPosition
12128
12129 Get the row and column of the endpoint of this item.
12130 """
54f9ee45 12131 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
e811c8ce
RD
12132
12133 def GetGBSizer(*args, **kwargs):
248ed943
RD
12134 """
12135 GetGBSizer(self) -> GridBagSizer
12136
12137 Get the sizer this item is a member of.
12138 """
54f9ee45 12139 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
e811c8ce
RD
12140
12141 def SetGBSizer(*args, **kwargs):
248ed943
RD
12142 """
12143 SetGBSizer(self, GridBagSizer sizer)
12144
12145 Set the sizer this item is a member of.
12146 """
54f9ee45 12147 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
e811c8ce 12148
0085ce49
RD
12149GBSizerItem_swigregister = _core_.GBSizerItem_swigregister
12150GBSizerItem_swigregister(GBSizerItem)
d14a1e28
RD
12151DefaultSpan = cvar.DefaultSpan
12152
12153def GBSizerItemWindow(*args, **kwargs):
0df68c9f
RD
12154 """
12155 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12156 int border, PyObject userData=None) -> GBSizerItem
12157
12158 Construct a `wx.GBSizerItem` for a window.
0df68c9f 12159 """
54f9ee45 12160 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d14a1e28
RD
12161 return val
12162
12163def GBSizerItemSizer(*args, **kwargs):
0df68c9f
RD
12164 """
12165 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12166 int border, PyObject userData=None) -> GBSizerItem
12167
12168 Construct a `wx.GBSizerItem` for a sizer
0df68c9f 12169 """
54f9ee45 12170 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d14a1e28
RD
12171 return val
12172
12173def GBSizerItemSpacer(*args, **kwargs):
0df68c9f
RD
12174 """
12175 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
12176 int flag, int border, PyObject userData=None) -> GBSizerItem
12177
12178 Construct a `wx.GBSizerItem` for a spacer.
0df68c9f 12179 """
54f9ee45 12180 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d14a1e28
RD
12181 return val
12182
12183class GridBagSizer(FlexGridSizer):
248ed943
RD
12184 """
12185 A `wx.Sizer` that can lay out items in a virtual grid like a
12186 `wx.FlexGridSizer` but in this case explicit positioning of the items
12187 is allowed using `wx.GBPosition`, and items can optionally span more
12188 than one row and/or column using `wx.GBSpan`. The total size of the
12189 virtual grid is determined by the largest row and column that items are
12190 positioned at, adjusted for spanning.
12191
12192 """
0085ce49
RD
12193 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12194 __repr__ = _swig_repr
12195 def __init__(self, *args, **kwargs):
248ed943
RD
12196 """
12197 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12198
12199 Constructor, with optional parameters to specify the gap between the
12200 rows and columns.
12201 """
0085ce49 12202 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
1823fbb4
RD
12203 self._setOORInfo(self)
12204
e811c8ce 12205 def Add(*args, **kwargs):
0df68c9f 12206 """
248ed943 12207 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
d3b6e4ff 12208 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
12209
12210 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12211 more than one row or column as specified with *span*. The remaining
12212 args behave similarly to `wx.Sizer.Add`.
12213
12214 Returns True if the item was successfully placed at the given cell
12215 position, False if something was already there.
12216
0df68c9f 12217 """
54f9ee45 12218 return _core_.GridBagSizer_Add(*args, **kwargs)
e811c8ce
RD
12219
12220 def AddItem(*args, **kwargs):
248ed943 12221 """
d3b6e4ff 12222 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
12223
12224 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12225 the item was successfully placed at its given cell position, False if
12226 something was already there.
12227 """
54f9ee45 12228 return _core_.GridBagSizer_AddItem(*args, **kwargs)
e811c8ce 12229
84f85550
RD
12230 def GetCellSize(*args, **kwargs):
12231 """
12232 GetCellSize(self, int row, int col) -> Size
12233
12234 Get the size of the specified cell, including hgap and
12235 vgap. Only valid after a Layout.
12236 """
12237 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12238
e811c8ce 12239 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
12240 """
12241 GetEmptyCellSize(self) -> Size
12242
12243 Get the size used for cells in the grid with no item.
12244 """
54f9ee45 12245 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
12246
12247 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
12248 """
12249 SetEmptyCellSize(self, Size sz)
12250
12251 Set the size used for cells in the grid with no item.
12252 """
54f9ee45 12253 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
12254
12255 def GetItemPosition(*args):
0df68c9f 12256 """
248ed943
RD
12257 GetItemPosition(self, item) -> GBPosition
12258
12259 Get the grid position of the specified *item* where *item* is either a
12260 window or subsizer that is a member of this sizer, or a zero-based
12261 index of an item.
0df68c9f 12262 """
54f9ee45 12263 return _core_.GridBagSizer_GetItemPosition(*args)
e811c8ce
RD
12264
12265 def SetItemPosition(*args):
0df68c9f 12266 """
248ed943
RD
12267 SetItemPosition(self, item, GBPosition pos) -> bool
12268
12269 Set the grid position of the specified *item* where *item* is either a
12270 window or subsizer that is a member of this sizer, or a zero-based
12271 index of an item. Returns True on success. If the move is not
12272 allowed (because an item is already there) then False is returned.
12273
0df68c9f 12274 """
54f9ee45 12275 return _core_.GridBagSizer_SetItemPosition(*args)
e811c8ce
RD
12276
12277 def GetItemSpan(*args):
0df68c9f 12278 """
248ed943
RD
12279 GetItemSpan(self, item) -> GBSpan
12280
12281 Get the row/col spanning of the specified *item* where *item* is
12282 either a window or subsizer that is a member of this sizer, or a
12283 zero-based index of an item.
0df68c9f 12284 """
54f9ee45 12285 return _core_.GridBagSizer_GetItemSpan(*args)
e811c8ce
RD
12286
12287 def SetItemSpan(*args):
0df68c9f 12288 """
248ed943
RD
12289 SetItemSpan(self, item, GBSpan span) -> bool
12290
12291 Set the row/col spanning of the specified *item* where *item* is
12292 either a window or subsizer that is a member of this sizer, or a
12293 zero-based index of an item. Returns True on success. If the move is
12294 not allowed (because an item is already there) then False is returned.
0df68c9f 12295 """
54f9ee45 12296 return _core_.GridBagSizer_SetItemSpan(*args)
e811c8ce
RD
12297
12298 def FindItem(*args):
0df68c9f 12299 """
248ed943
RD
12300 FindItem(self, item) -> GBSizerItem
12301
12302 Find the sizer item for the given window or subsizer, returns None if
12303 not found. (non-recursive)
0df68c9f 12304 """
54f9ee45 12305 return _core_.GridBagSizer_FindItem(*args)
e811c8ce
RD
12306
12307 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
12308 """
12309 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12310
12311 Return the sizer item for the given grid cell, or None if there is no
12312 item at that position. (non-recursive)
12313 """
54f9ee45 12314 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
e811c8ce
RD
12315
12316 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
12317 """
12318 FindItemAtPoint(self, Point pt) -> GBSizerItem
12319
12320 Return the sizer item located at the point given in *pt*, or None if
12321 there is no item at that point. The (x,y) coordinates in pt correspond
12322 to the client coordinates of the window using the sizer for
12323 layout. (non-recursive)
12324 """
54f9ee45 12325 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
e811c8ce 12326
248ed943
RD
12327 def CheckForIntersection(*args, **kwargs):
12328 """
12329 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
e811c8ce 12330
248ed943
RD
12331 Look at all items and see if any intersect (or would overlap) the
12332 given *item*. Returns True if so, False if there would be no overlap.
12333 If an *excludeItem* is given then it will not be checked for
12334 intersection, for example it may be the item we are checking the
12335 position of.
e811c8ce 12336
248ed943
RD
12337 """
12338 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
e811c8ce 12339
248ed943 12340 def CheckForIntersectionPos(*args, **kwargs):
0df68c9f 12341 """
248ed943
RD
12342 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12343
12344 Look at all items and see if any intersect (or would overlap) the
12345 given position and span. Returns True if so, False if there would be
12346 no overlap. If an *excludeItem* is given then it will not be checked
12347 for intersection, for example it may be the item we are checking the
12348 position of.
0df68c9f 12349 """
248ed943 12350 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
e811c8ce 12351
0085ce49
RD
12352GridBagSizer_swigregister = _core_.GridBagSizer_swigregister
12353GridBagSizer_swigregister(GridBagSizer)
d14a1e28
RD
12354
12355#---------------------------------------------------------------------------
12356
54f9ee45
RD
12357Left = _core_.Left
12358Top = _core_.Top
12359Right = _core_.Right
12360Bottom = _core_.Bottom
12361Width = _core_.Width
12362Height = _core_.Height
12363Centre = _core_.Centre
12364Center = _core_.Center
12365CentreX = _core_.CentreX
12366CentreY = _core_.CentreY
12367Unconstrained = _core_.Unconstrained
12368AsIs = _core_.AsIs
12369PercentOf = _core_.PercentOf
12370Above = _core_.Above
12371Below = _core_.Below
12372LeftOf = _core_.LeftOf
12373RightOf = _core_.RightOf
12374SameAs = _core_.SameAs
12375Absolute = _core_.Absolute
d14a1e28 12376class IndividualLayoutConstraint(Object):
15afbcd0 12377 """
41e2b43e
RD
12378 Objects of this class are stored in the `wx.LayoutConstraints` class as
12379 one of eight possible constraints that a window can be involved in.
12380 You will never need to create an instance of
12381 wx.IndividualLayoutConstraint, rather you should create a
12382 `wx.LayoutConstraints` instance and use the individual contstraints
15afbcd0 12383 that it contains.
15afbcd0 12384 """
0085ce49
RD
12385 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12386 def __init__(self): raise AttributeError, "No constructor defined"
12387 __repr__ = _swig_repr
e811c8ce 12388 def Set(*args, **kwargs):
41e2b43e
RD
12389 """
12390 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12391
12392 Sets the properties of the constraint. Normally called by one of the
12393 convenience functions such as Above, RightOf, SameAs.
12394 """
54f9ee45 12395 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
e811c8ce
RD
12396
12397 def LeftOf(*args, **kwargs):
15afbcd0 12398 """
a95a7133 12399 LeftOf(self, Window sibling, int marg=0)
15afbcd0 12400
41e2b43e
RD
12401 Constrains this edge to be to the left of the given window, with an
12402 optional margin. Implicitly, this is relative to the left edge of the
12403 other window.
15afbcd0 12404 """
54f9ee45 12405 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
e811c8ce
RD
12406
12407 def RightOf(*args, **kwargs):
15afbcd0 12408 """
a95a7133 12409 RightOf(self, Window sibling, int marg=0)
15afbcd0 12410
41e2b43e
RD
12411 Constrains this edge to be to the right of the given window, with an
12412 optional margin. Implicitly, this is relative to the right edge of the
12413 other window.
15afbcd0 12414 """
54f9ee45 12415 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
e811c8ce
RD
12416
12417 def Above(*args, **kwargs):
15afbcd0 12418 """
a95a7133 12419 Above(self, Window sibling, int marg=0)
15afbcd0 12420
41e2b43e
RD
12421 Constrains this edge to be above the given window, with an optional
12422 margin. Implicitly, this is relative to the top edge of the other
12423 window.
15afbcd0 12424 """
54f9ee45 12425 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
e811c8ce
RD
12426
12427 def Below(*args, **kwargs):
15afbcd0 12428 """
a95a7133 12429 Below(self, Window sibling, int marg=0)
15afbcd0 12430
41e2b43e
RD
12431 Constrains this edge to be below the given window, with an optional
12432 margin. Implicitly, this is relative to the bottom edge of the other
12433 window.
15afbcd0 12434 """
54f9ee45 12435 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
e811c8ce
RD
12436
12437 def SameAs(*args, **kwargs):
15afbcd0 12438 """
a95a7133 12439 SameAs(self, Window otherW, int edge, int marg=0)
15afbcd0 12440
41e2b43e
RD
12441 Constrains this edge or dimension to be to the same as the edge of the
12442 given window, with an optional margin.
15afbcd0 12443 """
54f9ee45 12444 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
e811c8ce
RD
12445
12446 def PercentOf(*args, **kwargs):
15afbcd0 12447 """
a95a7133 12448 PercentOf(self, Window otherW, int wh, int per)
15afbcd0 12449
41e2b43e
RD
12450 Constrains this edge or dimension to be to a percentage of the given
12451 window, with an optional margin.
15afbcd0 12452 """
54f9ee45 12453 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
e811c8ce
RD
12454
12455 def Absolute(*args, **kwargs):
15afbcd0 12456 """
a95a7133 12457 Absolute(self, int val)
15afbcd0 12458
41e2b43e 12459 Constrains this edge or dimension to be the given absolute value.
15afbcd0 12460 """
54f9ee45 12461 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
e811c8ce
RD
12462
12463 def Unconstrained(*args, **kwargs):
15afbcd0 12464 """
a95a7133 12465 Unconstrained(self)
15afbcd0 12466
41e2b43e
RD
12467 Sets this edge or dimension to be unconstrained, that is, dependent on
12468 other edges and dimensions from which this value can be deduced.
15afbcd0 12469 """
54f9ee45 12470 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
e811c8ce
RD
12471
12472 def AsIs(*args, **kwargs):
15afbcd0 12473 """
a95a7133 12474 AsIs(self)
15afbcd0 12475
41e2b43e
RD
12476 Sets this edge or constraint to be whatever the window's value is at
12477 the moment. If either of the width and height constraints are *as is*,
12478 the window will not be resized, but moved instead. This is important
12479 when considering panel items which are intended to have a default
12480 size, such as a button, which may take its size from the size of the
12481 button label.
15afbcd0 12482 """
54f9ee45 12483 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
e811c8ce
RD
12484
12485 def GetOtherWindow(*args, **kwargs):
a95a7133 12486 """GetOtherWindow(self) -> Window"""
54f9ee45 12487 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
e811c8ce
RD
12488
12489 def GetMyEdge(*args, **kwargs):
a95a7133 12490 """GetMyEdge(self) -> int"""
54f9ee45 12491 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
e811c8ce
RD
12492
12493 def SetEdge(*args, **kwargs):
a95a7133 12494 """SetEdge(self, int which)"""
54f9ee45 12495 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
e811c8ce
RD
12496
12497 def SetValue(*args, **kwargs):
a95a7133 12498 """SetValue(self, int v)"""
54f9ee45 12499 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
e811c8ce
RD
12500
12501 def GetMargin(*args, **kwargs):
a95a7133 12502 """GetMargin(self) -> int"""
54f9ee45 12503 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
e811c8ce
RD
12504
12505 def SetMargin(*args, **kwargs):
a95a7133 12506 """SetMargin(self, int m)"""
54f9ee45 12507 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
e811c8ce
RD
12508
12509 def GetValue(*args, **kwargs):
a95a7133 12510 """GetValue(self) -> int"""
54f9ee45 12511 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
e811c8ce
RD
12512
12513 def GetPercent(*args, **kwargs):
a95a7133 12514 """GetPercent(self) -> int"""
54f9ee45 12515 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
e811c8ce
RD
12516
12517 def GetOtherEdge(*args, **kwargs):
a95a7133 12518 """GetOtherEdge(self) -> int"""
54f9ee45 12519 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
e811c8ce
RD
12520
12521 def GetDone(*args, **kwargs):
a95a7133 12522 """GetDone(self) -> bool"""
54f9ee45 12523 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
e811c8ce
RD
12524
12525 def SetDone(*args, **kwargs):
a95a7133 12526 """SetDone(self, bool d)"""
54f9ee45 12527 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
e811c8ce
RD
12528
12529 def GetRelationship(*args, **kwargs):
a95a7133 12530 """GetRelationship(self) -> int"""
54f9ee45 12531 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
e811c8ce
RD
12532
12533 def SetRelationship(*args, **kwargs):
a95a7133 12534 """SetRelationship(self, int r)"""
54f9ee45 12535 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
e811c8ce
RD
12536
12537 def ResetIfWin(*args, **kwargs):
15afbcd0 12538 """
a95a7133 12539 ResetIfWin(self, Window otherW) -> bool
15afbcd0
RD
12540
12541 Reset constraint if it mentions otherWin
12542 """
54f9ee45 12543 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
e811c8ce
RD
12544
12545 def SatisfyConstraint(*args, **kwargs):
15afbcd0 12546 """
a95a7133 12547 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
15afbcd0
RD
12548
12549 Try to satisfy constraint
12550 """
54f9ee45 12551 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
e811c8ce
RD
12552
12553 def GetEdge(*args, **kwargs):
15afbcd0 12554 """
a95a7133 12555 GetEdge(self, int which, Window thisWin, Window other) -> int
15afbcd0
RD
12556
12557 Get the value of this edge or dimension, or if this
12558 is not determinable, -1.
12559 """
54f9ee45 12560 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
e811c8ce 12561
0085ce49
RD
12562IndividualLayoutConstraint_swigregister = _core_.IndividualLayoutConstraint_swigregister
12563IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d14a1e28
RD
12564
12565class LayoutConstraints(Object):
15afbcd0 12566 """
41e2b43e
RD
12567 **Note:** constraints are now deprecated and you should use sizers
12568 instead.
15afbcd0 12569
41e2b43e
RD
12570 Objects of this class can be associated with a window to define its
12571 layout constraints, with respect to siblings or its parent.
15afbcd0
RD
12572
12573 The class consists of the following eight constraints of class
12574 wx.IndividualLayoutConstraint, some or all of which should be accessed
12575 directly to set the appropriate constraints.
12576
12577 * left: represents the left hand edge of the window
12578 * right: represents the right hand edge of the window
12579 * top: represents the top edge of the window
12580 * bottom: represents the bottom edge of the window
12581 * width: represents the width of the window
12582 * height: represents the height of the window
12583 * centreX: represents the horizontal centre point of the window
12584 * centreY: represents the vertical centre point of the window
12585
41e2b43e
RD
12586 Most constraints are initially set to have the relationship
12587 wxUnconstrained, which means that their values should be calculated by
12588 looking at known constraints. The exceptions are width and height,
12589 which are set to wxAsIs to ensure that if the user does not specify a
12590 constraint, the existing width and height will be used, to be
12591 compatible with panel items which often have take a default size. If
12592 the constraint is ``wx.AsIs``, the dimension will not be changed.
12593
12594 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
15afbcd0
RD
12595
12596 """
0085ce49
RD
12597 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12598 __repr__ = _swig_repr
54f9ee45
RD
12599 left = property(_core_.LayoutConstraints_left_get)
12600 top = property(_core_.LayoutConstraints_top_get)
12601 right = property(_core_.LayoutConstraints_right_get)
12602 bottom = property(_core_.LayoutConstraints_bottom_get)
12603 width = property(_core_.LayoutConstraints_width_get)
12604 height = property(_core_.LayoutConstraints_height_get)
12605 centreX = property(_core_.LayoutConstraints_centreX_get)
12606 centreY = property(_core_.LayoutConstraints_centreY_get)
0085ce49 12607 def __init__(self, *args, **kwargs):
a95a7133 12608 """__init__(self) -> LayoutConstraints"""
0085ce49
RD
12609 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12610 __swig_destroy__ = _core_.delete_LayoutConstraints
12611 __del__ = lambda self : None;
e811c8ce 12612 def SatisfyConstraints(*args, **kwargs):
6c3b4aae 12613 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
54f9ee45 12614 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
e811c8ce
RD
12615
12616 def AreSatisfied(*args, **kwargs):
a95a7133 12617 """AreSatisfied(self) -> bool"""
54f9ee45 12618 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
e811c8ce 12619
0085ce49
RD
12620LayoutConstraints_swigregister = _core_.LayoutConstraints_swigregister
12621LayoutConstraints_swigregister(LayoutConstraints)
d14a1e28
RD
12622
12623#----------------------------------------------------------------------------
12624
322913ce 12625# Use Python's bool constants if available, make some if not
d14a1e28
RD
12626try:
12627 True
12628except NameError:
322913ce
RD
12629 __builtins__.True = 1==1
12630 __builtins__.False = 1==0
4f89f6a3
RD
12631 def bool(value): return not not value
12632 __builtins__.bool = bool
d14a1e28 12633
d14a1e28
RD
12634
12635
12636# workarounds for bad wxRTTI names
12637__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12638__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12639__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12640
12641
12642#----------------------------------------------------------------------------
12643# Load version numbers from __version__... Ensure that major and minor
7bc1e663 12644# versions are the same for both wxPython and wxWidgets.
d14a1e28
RD
12645
12646from __version__ import *
12647__version__ = VERSION_STRING
12648
7bc1e663
RD
12649assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12650assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
54f9ee45 12651if RELEASE_VERSION != _core_.RELEASE_VERSION:
d14a1e28 12652 import warnings
7bc1e663 12653 warnings.warn("wxPython/wxWidgets release number mismatch")
d14a1e28
RD
12654
12655#----------------------------------------------------------------------------
12656
70b7a5fe
RD
12657# Set wxPython's default string<-->unicode conversion encoding from
12658# the locale, but only if Python's default hasn't been changed. (We
12659# assume that if the user has customized it already then that is the
12660# encoding we need to use as well.)
12661#
12662# The encoding selected here is used when string or unicode objects
12663# need to be converted in order to pass them to wxWidgets. Please be
12664# aware that the default encoding within the same locale may be
12665# slightly different on different platforms. For example, please see
e505d15e
RD
12666# http://www.alanwood.net/demos/charsetdiffs.html for differences
12667# between the common latin/roman encodings.
396fb509
RD
12668
12669default = _sys.getdefaultencoding()
12670if default == 'ascii':
12671 import locale
12672 import codecs
12673 try:
12674 default = locale.getdefaultlocale()[1]
12675 codecs.lookup(default)
70b7a5fe 12676 except (ValueError, LookupError, TypeError):
396fb509
RD
12677 default = _sys.getdefaultencoding()
12678 del locale
12679 del codecs
5cbf236d
RD
12680if default:
12681 wx.SetDefaultPyEncoding(default)
12682del default
5cbf236d
RD
12683
12684#----------------------------------------------------------------------------
12685
d14a1e28
RD
12686class PyDeadObjectError(AttributeError):
12687 pass
12688
d14a1e28
RD
12689class _wxPyDeadObject(object):
12690 """
12691 Instances of wx objects that are OOR capable will have their __class__
12692 changed to this class when the C++ object is deleted. This should help
12693 prevent crashes due to referencing a bogus C++ pointer.
12694 """
12695 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12696 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12697
3a04f143 12698 def __repr__(self):
d14a1e28
RD
12699 if not hasattr(self, "_name"):
12700 self._name = "[unknown]"
12701 return self.reprStr % self._name
12702
3a04f143 12703 def __getattr__(self, *args):
d14a1e28
RD
12704 if not hasattr(self, "_name"):
12705 self._name = "[unknown]"
3a04f143
RD
12706 raise PyDeadObjectError(self.attrStr % self._name)
12707
12708 def __nonzero__(self):
12709 return 0
12710
12711
12712
12713class PyUnbornObjectError(AttributeError):
12714 pass
12715
12716class _wxPyUnbornObject(object):
12717 """
54f9ee45 12718 Some stock objects are created when the wx._core module is
3a04f143
RD
12719 imported, but their C++ instance is not created until the wx.App
12720 object is created and initialized. These object instances will
12721 temporarily have their __class__ changed to this class so an
12722 exception will be raised if they are used before the C++ instance
12723 is ready.
12724 """
12725
12726 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12727 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12728
12729 def __repr__(self):
12730 #if not hasattr(self, "_name"):
12731 # self._name = "[unknown]"
12732 return self.reprStr #% self._name
12733
12734 def __getattr__(self, *args):
12735 #if not hasattr(self, "_name"):
12736 # self._name = "[unknown]"
12737 raise PyUnbornObjectError(self.attrStr) # % self._name )
d14a1e28
RD
12738
12739 def __nonzero__(self):
12740 return 0
12741
12742
12743#----------------------------------------------------------------------------
d14a1e28
RD
12744
12745def CallAfter(callable, *args, **kw):
12746 """
12747 Call the specified function after the current and pending event
12748 handlers have been completed. This is also good for making GUI
61863841
RD
12749 method calls from non-GUI threads. Any extra positional or
12750 keyword args are passed on to the callable when it is called.
12751
12752 :see: `wx.FutureCall`
d14a1e28
RD
12753 """
12754 app = wx.GetApp()
dfbb5885 12755 assert app is not None, 'No wx.App created yet'
d14a1e28 12756
148275d3
RD
12757 if not hasattr(app, "_CallAfterId"):
12758 app._CallAfterId = wx.NewEventType()
12759 app.Connect(-1, -1, app._CallAfterId,
12760 lambda event: event.callable(*event.args, **event.kw) )
d14a1e28 12761 evt = wx.PyEvent()
148275d3 12762 evt.SetEventType(app._CallAfterId)
d14a1e28
RD
12763 evt.callable = callable
12764 evt.args = args
12765 evt.kw = kw
12766 wx.PostEvent(app, evt)
12767
d14a1e28
RD
12768#----------------------------------------------------------------------------
12769
12770
12771class FutureCall:
12772 """
8ac8dba0 12773 A convenience class for `wx.Timer`, that calls the given callable
d14a1e28
RD
12774 object once after the given amount of milliseconds, passing any
12775 positional or keyword args. The return value of the callable is
61863841 12776 availbale after it has been run with the `GetResult` method.
d14a1e28
RD
12777
12778 If you don't need to get the return value or restart the timer
12779 then there is no need to hold a reference to this object. It will
12780 hold a reference to itself while the timer is running (the timer
12781 has a reference to self.Notify) but the cycle will be broken when
12782 the timer completes, automatically cleaning up the wx.FutureCall
12783 object.
61863841
RD
12784
12785 :see: `wx.CallAfter`
d14a1e28
RD
12786 """
12787 def __init__(self, millis, callable, *args, **kwargs):
12788 self.millis = millis
12789 self.callable = callable
12790 self.SetArgs(*args, **kwargs)
12791 self.runCount = 0
4276dc52 12792 self.running = False
d14a1e28
RD
12793 self.hasRun = False
12794 self.result = None
12795 self.timer = None
12796 self.Start()
12797
12798 def __del__(self):
12799 self.Stop()
12800
12801
12802 def Start(self, millis=None, *args, **kwargs):
12803 """
12804 (Re)start the timer
12805 """
12806 self.hasRun = False
12807 if millis is not None:
12808 self.millis = millis
12809 if args or kwargs:
12810 self.SetArgs(*args, **kwargs)
12811 self.Stop()
12812 self.timer = wx.PyTimer(self.Notify)
12813 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
4276dc52 12814 self.running = True
d14a1e28
RD
12815 Restart = Start
12816
12817
12818 def Stop(self):
12819 """
12820 Stop and destroy the timer.
12821 """
12822 if self.timer is not None:
12823 self.timer.Stop()
12824 self.timer = None
12825
12826
12827 def GetInterval(self):
12828 if self.timer is not None:
12829 return self.timer.GetInterval()
12830 else:
12831 return 0
12832
12833
12834 def IsRunning(self):
12835 return self.timer is not None and self.timer.IsRunning()
12836
12837
12838 def SetArgs(self, *args, **kwargs):
12839 """
12840 (Re)set the args passed to the callable object. This is
12841 useful in conjunction with Restart if you want to schedule a
12842 new call to the same callable object but with different
12843 parameters.
12844 """
12845 self.args = args
12846 self.kwargs = kwargs
12847
12848
12849 def HasRun(self):
12850 return self.hasRun
12851
12852 def GetResult(self):
12853 return self.result
12854
12855 def Notify(self):
12856 """
12857 The timer has expired so call the callable.
12858 """
12859 if self.callable and getattr(self.callable, 'im_self', True):
12860 self.runCount += 1
4276dc52 12861 self.running = False
d14a1e28
RD
12862 self.result = self.callable(*self.args, **self.kwargs)
12863 self.hasRun = True
4276dc52
RD
12864 if not self.running:
12865 # if it wasn't restarted, then cleanup
12866 wx.CallAfter(self.Stop)
d14a1e28
RD
12867
12868
a95a7133
RD
12869
12870#----------------------------------------------------------------------------
12871# Control which items in this module should be documented by epydoc.
12872# We allow only classes and functions, which will help reduce the size
12873# of the docs by filtering out the zillions of constants, EVT objects,
12874# and etc that don't make much sense by themselves, but are instead
12875# documented (or will be) as part of the classes/functions/methods
12876# where they should be used.
12877
66c033b4
RD
12878class __DocFilter:
12879 """
12880 A filter for epydoc that only allows non-Ptr classes and
12881 fucntions, in order to reduce the clutter in the API docs.
12882 """
12883 def __init__(self, globals):
12884 self._globals = globals
12885
12886 def __call__(self, name):
12887 import types
12888 obj = self._globals.get(name, None)
12889 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12890 return False
0085ce49 12891 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
66c033b4
RD
12892 return False
12893 return True
a95a7133 12894
d14a1e28
RD
12895#----------------------------------------------------------------------------
12896#----------------------------------------------------------------------------
12897
12898# Import other modules in this package that should show up in the
12899# "core" wx namespace
54f9ee45
RD
12900from _gdi import *
12901from _windows import *
12902from _controls import *
12903from _misc import *
d14a1e28 12904
3a04f143
RD
12905
12906# Fixup the stock objects since they can't be used yet. (They will be
12907# restored in wx.PyApp.OnInit.)
54f9ee45 12908_core_._wxPyFixStockObjects()
3a04f143 12909
d14a1e28
RD
12910#----------------------------------------------------------------------------
12911#----------------------------------------------------------------------------
12912
12913
32fe5131 12914