]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/mac/_core.py
Source markup fixes.
[wxWidgets.git] / wxPython / src / mac / _core.py
CommitLineData
1bd55598 1# This file was created automatically by SWIG 1.3.29.
d55e5bfc
RD
2# Don't modify this file, modify the SWIG interface instead.
3
5b5c9bc7 4import _core_
1bd55598
RD
5import new
6new_instancemethod = new.instancemethod
36ed4f51 7def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
1bd55598 8 if (name == "thisown"): return self.this.own(value)
36ed4f51 9 if (name == "this"):
1bd55598
RD
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
36ed4f51
RD
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
1bd55598 15 if (not static) or hasattr(self,name):
36ed4f51
RD
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
1bd55598 24 if (name == "thisown"): return self.this.own()
36ed4f51
RD
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
1bd55598
RD
29def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
36ed4f51
RD
34import types
35try:
36 _object = types.ObjectType
37 _newclass = 1
38except AttributeError:
39 class _object : pass
40 _newclass = 0
41del types
42
43
44def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
1bd55598
RD
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
36ed4f51
RD
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
d55e5bfc
RD
54#// Give a reference to the dictionary of this module to the C++ extension
55#// code.
56_core_._wxPySetDictionary(vars())
57
58#// A little trick to make 'wx' be a reference to this module so wx.Names can
59#// be used here.
60import sys as _sys
61wx = _sys.modules[__name__]
62
d6c14a4c
RD
63
64#----------------------------------------------------------------------------
65
66def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81#----------------------------------------------------------------------------
82
5b5c9bc7
RD
83NOT_FOUND = _core_.NOT_FOUND
84VSCROLL = _core_.VSCROLL
85HSCROLL = _core_.HSCROLL
86CAPTION = _core_.CAPTION
87DOUBLE_BORDER = _core_.DOUBLE_BORDER
88SUNKEN_BORDER = _core_.SUNKEN_BORDER
89RAISED_BORDER = _core_.RAISED_BORDER
90BORDER = _core_.BORDER
91SIMPLE_BORDER = _core_.SIMPLE_BORDER
92STATIC_BORDER = _core_.STATIC_BORDER
93TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94NO_BORDER = _core_.NO_BORDER
95DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 96DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
5b5c9bc7
RD
97TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98WANTS_CHARS = _core_.WANTS_CHARS
99POPUP_WINDOW = _core_.POPUP_WINDOW
100CENTER_FRAME = _core_.CENTER_FRAME
101CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
103CLIP_CHILDREN = _core_.CLIP_CHILDREN
104CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
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
128RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
129RB_GROUP = _core_.RB_GROUP
130RB_SINGLE = _core_.RB_SINGLE
131SB_HORIZONTAL = _core_.SB_HORIZONTAL
132SB_VERTICAL = _core_.SB_VERTICAL
133RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
134ST_SIZEGRIP = _core_.ST_SIZEGRIP
135ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
e9d6f3a4
RD
136ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
137ST_DOTS_END = _core_.ST_DOTS_END
5b5c9bc7
RD
138FLOOD_SURFACE = _core_.FLOOD_SURFACE
139FLOOD_BORDER = _core_.FLOOD_BORDER
140ODDEVEN_RULE = _core_.ODDEVEN_RULE
141WINDING_RULE = _core_.WINDING_RULE
142TOOL_TOP = _core_.TOOL_TOP
143TOOL_BOTTOM = _core_.TOOL_BOTTOM
144TOOL_LEFT = _core_.TOOL_LEFT
145TOOL_RIGHT = _core_.TOOL_RIGHT
146OK = _core_.OK
147YES_NO = _core_.YES_NO
148CANCEL = _core_.CANCEL
149YES = _core_.YES
150NO = _core_.NO
151NO_DEFAULT = _core_.NO_DEFAULT
152YES_DEFAULT = _core_.YES_DEFAULT
153ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
154ICON_HAND = _core_.ICON_HAND
155ICON_QUESTION = _core_.ICON_QUESTION
156ICON_INFORMATION = _core_.ICON_INFORMATION
157ICON_STOP = _core_.ICON_STOP
158ICON_ASTERISK = _core_.ICON_ASTERISK
159ICON_MASK = _core_.ICON_MASK
160ICON_WARNING = _core_.ICON_WARNING
161ICON_ERROR = _core_.ICON_ERROR
162FORWARD = _core_.FORWARD
163BACKWARD = _core_.BACKWARD
164RESET = _core_.RESET
165HELP = _core_.HELP
166MORE = _core_.MORE
167SETUP = _core_.SETUP
168SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
169SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
170SIZE_AUTO = _core_.SIZE_AUTO
171SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
172SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
943e8dfd 173SIZE_FORCE = _core_.SIZE_FORCE
5b5c9bc7
RD
174PORTRAIT = _core_.PORTRAIT
175LANDSCAPE = _core_.LANDSCAPE
176PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
177PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
178PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
179PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
180ID_ANY = _core_.ID_ANY
181ID_SEPARATOR = _core_.ID_SEPARATOR
943e8dfd 182ID_NONE = _core_.ID_NONE
5b5c9bc7
RD
183ID_LOWEST = _core_.ID_LOWEST
184ID_OPEN = _core_.ID_OPEN
185ID_CLOSE = _core_.ID_CLOSE
186ID_NEW = _core_.ID_NEW
187ID_SAVE = _core_.ID_SAVE
188ID_SAVEAS = _core_.ID_SAVEAS
189ID_REVERT = _core_.ID_REVERT
190ID_EXIT = _core_.ID_EXIT
191ID_UNDO = _core_.ID_UNDO
192ID_REDO = _core_.ID_REDO
193ID_HELP = _core_.ID_HELP
194ID_PRINT = _core_.ID_PRINT
195ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
196ID_PREVIEW = _core_.ID_PREVIEW
197ID_ABOUT = _core_.ID_ABOUT
198ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
199ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
200ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
201ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
202ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
203ID_PREFERENCES = _core_.ID_PREFERENCES
204ID_CUT = _core_.ID_CUT
205ID_COPY = _core_.ID_COPY
206ID_PASTE = _core_.ID_PASTE
207ID_CLEAR = _core_.ID_CLEAR
208ID_FIND = _core_.ID_FIND
209ID_DUPLICATE = _core_.ID_DUPLICATE
210ID_SELECTALL = _core_.ID_SELECTALL
211ID_DELETE = _core_.ID_DELETE
212ID_REPLACE = _core_.ID_REPLACE
213ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
214ID_PROPERTIES = _core_.ID_PROPERTIES
215ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
216ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
217ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
218ID_VIEW_LIST = _core_.ID_VIEW_LIST
219ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
220ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
221ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
222ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
223ID_FILE1 = _core_.ID_FILE1
224ID_FILE2 = _core_.ID_FILE2
225ID_FILE3 = _core_.ID_FILE3
226ID_FILE4 = _core_.ID_FILE4
227ID_FILE5 = _core_.ID_FILE5
228ID_FILE6 = _core_.ID_FILE6
229ID_FILE7 = _core_.ID_FILE7
230ID_FILE8 = _core_.ID_FILE8
231ID_FILE9 = _core_.ID_FILE9
232ID_OK = _core_.ID_OK
233ID_CANCEL = _core_.ID_CANCEL
234ID_APPLY = _core_.ID_APPLY
235ID_YES = _core_.ID_YES
236ID_NO = _core_.ID_NO
237ID_STATIC = _core_.ID_STATIC
238ID_FORWARD = _core_.ID_FORWARD
239ID_BACKWARD = _core_.ID_BACKWARD
240ID_DEFAULT = _core_.ID_DEFAULT
241ID_MORE = _core_.ID_MORE
242ID_SETUP = _core_.ID_SETUP
243ID_RESET = _core_.ID_RESET
244ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
245ID_YESTOALL = _core_.ID_YESTOALL
246ID_NOTOALL = _core_.ID_NOTOALL
247ID_ABORT = _core_.ID_ABORT
248ID_RETRY = _core_.ID_RETRY
249ID_IGNORE = _core_.ID_IGNORE
250ID_ADD = _core_.ID_ADD
251ID_REMOVE = _core_.ID_REMOVE
252ID_UP = _core_.ID_UP
253ID_DOWN = _core_.ID_DOWN
254ID_HOME = _core_.ID_HOME
255ID_REFRESH = _core_.ID_REFRESH
256ID_STOP = _core_.ID_STOP
257ID_INDEX = _core_.ID_INDEX
258ID_BOLD = _core_.ID_BOLD
259ID_ITALIC = _core_.ID_ITALIC
260ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
261ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
262ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
263ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
264ID_UNDERLINE = _core_.ID_UNDERLINE
265ID_INDENT = _core_.ID_INDENT
266ID_UNINDENT = _core_.ID_UNINDENT
267ID_ZOOM_100 = _core_.ID_ZOOM_100
268ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
269ID_ZOOM_IN = _core_.ID_ZOOM_IN
270ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
271ID_UNDELETE = _core_.ID_UNDELETE
272ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
273ID_HIGHEST = _core_.ID_HIGHEST
274OPEN = _core_.OPEN
275SAVE = _core_.SAVE
276HIDE_READONLY = _core_.HIDE_READONLY
277OVERWRITE_PROMPT = _core_.OVERWRITE_PROMPT
278FILE_MUST_EXIST = _core_.FILE_MUST_EXIST
279MULTIPLE = _core_.MULTIPLE
280CHANGE_DIR = _core_.CHANGE_DIR
281ACCEL_ALT = _core_.ACCEL_ALT
282ACCEL_CTRL = _core_.ACCEL_CTRL
283ACCEL_SHIFT = _core_.ACCEL_SHIFT
284ACCEL_NORMAL = _core_.ACCEL_NORMAL
285PD_AUTO_HIDE = _core_.PD_AUTO_HIDE
286PD_APP_MODAL = _core_.PD_APP_MODAL
287PD_CAN_ABORT = _core_.PD_CAN_ABORT
288PD_ELAPSED_TIME = _core_.PD_ELAPSED_TIME
289PD_ESTIMATED_TIME = _core_.PD_ESTIMATED_TIME
290PD_REMAINING_TIME = _core_.PD_REMAINING_TIME
291PD_SMOOTH = _core_.PD_SMOOTH
292PD_CAN_SKIP = _core_.PD_CAN_SKIP
293DD_NEW_DIR_BUTTON = _core_.DD_NEW_DIR_BUTTON
294DD_DEFAULT_STYLE = _core_.DD_DEFAULT_STYLE
2131d850 295DD_CHANGE_DIR = _core_.DD_CHANGE_DIR
5b5c9bc7
RD
296MENU_TEAROFF = _core_.MENU_TEAROFF
297MB_DOCKABLE = _core_.MB_DOCKABLE
298NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
299FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
300LI_HORIZONTAL = _core_.LI_HORIZONTAL
301LI_VERTICAL = _core_.LI_VERTICAL
302WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
303WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
304WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
305WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
306WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
307WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
308MM_TEXT = _core_.MM_TEXT
309MM_LOMETRIC = _core_.MM_LOMETRIC
310MM_HIMETRIC = _core_.MM_HIMETRIC
311MM_LOENGLISH = _core_.MM_LOENGLISH
312MM_HIENGLISH = _core_.MM_HIENGLISH
313MM_TWIPS = _core_.MM_TWIPS
314MM_ISOTROPIC = _core_.MM_ISOTROPIC
315MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
316MM_POINTS = _core_.MM_POINTS
317MM_METRIC = _core_.MM_METRIC
318CENTRE = _core_.CENTRE
319CENTER = _core_.CENTER
320HORIZONTAL = _core_.HORIZONTAL
321VERTICAL = _core_.VERTICAL
322BOTH = _core_.BOTH
323LEFT = _core_.LEFT
324RIGHT = _core_.RIGHT
325UP = _core_.UP
326DOWN = _core_.DOWN
327TOP = _core_.TOP
328BOTTOM = _core_.BOTTOM
329NORTH = _core_.NORTH
330SOUTH = _core_.SOUTH
331WEST = _core_.WEST
332EAST = _core_.EAST
333ALL = _core_.ALL
334ALIGN_NOT = _core_.ALIGN_NOT
335ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
336ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
337ALIGN_LEFT = _core_.ALIGN_LEFT
338ALIGN_TOP = _core_.ALIGN_TOP
339ALIGN_RIGHT = _core_.ALIGN_RIGHT
340ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
341ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
342ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
343ALIGN_CENTER = _core_.ALIGN_CENTER
344ALIGN_CENTRE = _core_.ALIGN_CENTRE
345ALIGN_MASK = _core_.ALIGN_MASK
346STRETCH_NOT = _core_.STRETCH_NOT
347SHRINK = _core_.SHRINK
348GROW = _core_.GROW
349EXPAND = _core_.EXPAND
350SHAPED = _core_.SHAPED
351FIXED_MINSIZE = _core_.FIXED_MINSIZE
352TILE = _core_.TILE
353ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
354BORDER_DEFAULT = _core_.BORDER_DEFAULT
355BORDER_NONE = _core_.BORDER_NONE
356BORDER_STATIC = _core_.BORDER_STATIC
357BORDER_SIMPLE = _core_.BORDER_SIMPLE
358BORDER_RAISED = _core_.BORDER_RAISED
359BORDER_SUNKEN = _core_.BORDER_SUNKEN
360BORDER_DOUBLE = _core_.BORDER_DOUBLE
361BORDER_MASK = _core_.BORDER_MASK
362BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
363BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
364BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
365DEFAULT = _core_.DEFAULT
366DECORATIVE = _core_.DECORATIVE
367ROMAN = _core_.ROMAN
368SCRIPT = _core_.SCRIPT
369SWISS = _core_.SWISS
370MODERN = _core_.MODERN
371TELETYPE = _core_.TELETYPE
372VARIABLE = _core_.VARIABLE
373FIXED = _core_.FIXED
374NORMAL = _core_.NORMAL
375LIGHT = _core_.LIGHT
376BOLD = _core_.BOLD
377ITALIC = _core_.ITALIC
378SLANT = _core_.SLANT
379SOLID = _core_.SOLID
380DOT = _core_.DOT
381LONG_DASH = _core_.LONG_DASH
382SHORT_DASH = _core_.SHORT_DASH
383DOT_DASH = _core_.DOT_DASH
384USER_DASH = _core_.USER_DASH
385TRANSPARENT = _core_.TRANSPARENT
386STIPPLE = _core_.STIPPLE
d04418a7
RD
387STIPPLE_MASK = _core_.STIPPLE_MASK
388STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
5b5c9bc7
RD
389BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
390CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
391FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
392CROSS_HATCH = _core_.CROSS_HATCH
393HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
394VERTICAL_HATCH = _core_.VERTICAL_HATCH
395JOIN_BEVEL = _core_.JOIN_BEVEL
396JOIN_MITER = _core_.JOIN_MITER
397JOIN_ROUND = _core_.JOIN_ROUND
398CAP_ROUND = _core_.CAP_ROUND
399CAP_PROJECTING = _core_.CAP_PROJECTING
400CAP_BUTT = _core_.CAP_BUTT
401CLEAR = _core_.CLEAR
402XOR = _core_.XOR
403INVERT = _core_.INVERT
404OR_REVERSE = _core_.OR_REVERSE
405AND_REVERSE = _core_.AND_REVERSE
406COPY = _core_.COPY
407AND = _core_.AND
408AND_INVERT = _core_.AND_INVERT
409NO_OP = _core_.NO_OP
410NOR = _core_.NOR
411EQUIV = _core_.EQUIV
412SRC_INVERT = _core_.SRC_INVERT
413OR_INVERT = _core_.OR_INVERT
414NAND = _core_.NAND
415OR = _core_.OR
416SET = _core_.SET
417WXK_BACK = _core_.WXK_BACK
418WXK_TAB = _core_.WXK_TAB
419WXK_RETURN = _core_.WXK_RETURN
420WXK_ESCAPE = _core_.WXK_ESCAPE
421WXK_SPACE = _core_.WXK_SPACE
422WXK_DELETE = _core_.WXK_DELETE
423WXK_START = _core_.WXK_START
424WXK_LBUTTON = _core_.WXK_LBUTTON
425WXK_RBUTTON = _core_.WXK_RBUTTON
426WXK_CANCEL = _core_.WXK_CANCEL
427WXK_MBUTTON = _core_.WXK_MBUTTON
428WXK_CLEAR = _core_.WXK_CLEAR
429WXK_SHIFT = _core_.WXK_SHIFT
430WXK_ALT = _core_.WXK_ALT
431WXK_CONTROL = _core_.WXK_CONTROL
432WXK_MENU = _core_.WXK_MENU
433WXK_PAUSE = _core_.WXK_PAUSE
434WXK_CAPITAL = _core_.WXK_CAPITAL
435WXK_PRIOR = _core_.WXK_PRIOR
436WXK_NEXT = _core_.WXK_NEXT
437WXK_END = _core_.WXK_END
438WXK_HOME = _core_.WXK_HOME
439WXK_LEFT = _core_.WXK_LEFT
440WXK_UP = _core_.WXK_UP
441WXK_RIGHT = _core_.WXK_RIGHT
442WXK_DOWN = _core_.WXK_DOWN
443WXK_SELECT = _core_.WXK_SELECT
444WXK_PRINT = _core_.WXK_PRINT
445WXK_EXECUTE = _core_.WXK_EXECUTE
446WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
447WXK_INSERT = _core_.WXK_INSERT
448WXK_HELP = _core_.WXK_HELP
449WXK_NUMPAD0 = _core_.WXK_NUMPAD0
450WXK_NUMPAD1 = _core_.WXK_NUMPAD1
451WXK_NUMPAD2 = _core_.WXK_NUMPAD2
452WXK_NUMPAD3 = _core_.WXK_NUMPAD3
453WXK_NUMPAD4 = _core_.WXK_NUMPAD4
454WXK_NUMPAD5 = _core_.WXK_NUMPAD5
455WXK_NUMPAD6 = _core_.WXK_NUMPAD6
456WXK_NUMPAD7 = _core_.WXK_NUMPAD7
457WXK_NUMPAD8 = _core_.WXK_NUMPAD8
458WXK_NUMPAD9 = _core_.WXK_NUMPAD9
459WXK_MULTIPLY = _core_.WXK_MULTIPLY
460WXK_ADD = _core_.WXK_ADD
461WXK_SEPARATOR = _core_.WXK_SEPARATOR
462WXK_SUBTRACT = _core_.WXK_SUBTRACT
463WXK_DECIMAL = _core_.WXK_DECIMAL
464WXK_DIVIDE = _core_.WXK_DIVIDE
465WXK_F1 = _core_.WXK_F1
466WXK_F2 = _core_.WXK_F2
467WXK_F3 = _core_.WXK_F3
468WXK_F4 = _core_.WXK_F4
469WXK_F5 = _core_.WXK_F5
470WXK_F6 = _core_.WXK_F6
471WXK_F7 = _core_.WXK_F7
472WXK_F8 = _core_.WXK_F8
473WXK_F9 = _core_.WXK_F9
474WXK_F10 = _core_.WXK_F10
475WXK_F11 = _core_.WXK_F11
476WXK_F12 = _core_.WXK_F12
477WXK_F13 = _core_.WXK_F13
478WXK_F14 = _core_.WXK_F14
479WXK_F15 = _core_.WXK_F15
480WXK_F16 = _core_.WXK_F16
481WXK_F17 = _core_.WXK_F17
482WXK_F18 = _core_.WXK_F18
483WXK_F19 = _core_.WXK_F19
484WXK_F20 = _core_.WXK_F20
485WXK_F21 = _core_.WXK_F21
486WXK_F22 = _core_.WXK_F22
487WXK_F23 = _core_.WXK_F23
488WXK_F24 = _core_.WXK_F24
489WXK_NUMLOCK = _core_.WXK_NUMLOCK
490WXK_SCROLL = _core_.WXK_SCROLL
491WXK_PAGEUP = _core_.WXK_PAGEUP
492WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
493WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
494WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
495WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
496WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
497WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
498WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
499WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
500WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
501WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
502WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
503WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
504WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
505WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
506WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
507WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
508WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
509WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
510WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
511WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
512WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
513WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
514WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
515WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
516WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
517WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
518WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
519WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
520WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
521WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
522WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
523WXK_COMMAND = _core_.WXK_COMMAND
524WXK_SPECIAL1 = _core_.WXK_SPECIAL1
525WXK_SPECIAL2 = _core_.WXK_SPECIAL2
526WXK_SPECIAL3 = _core_.WXK_SPECIAL3
527WXK_SPECIAL4 = _core_.WXK_SPECIAL4
528WXK_SPECIAL5 = _core_.WXK_SPECIAL5
529WXK_SPECIAL6 = _core_.WXK_SPECIAL6
530WXK_SPECIAL7 = _core_.WXK_SPECIAL7
531WXK_SPECIAL8 = _core_.WXK_SPECIAL8
532WXK_SPECIAL9 = _core_.WXK_SPECIAL9
533WXK_SPECIAL10 = _core_.WXK_SPECIAL10
534WXK_SPECIAL11 = _core_.WXK_SPECIAL11
535WXK_SPECIAL12 = _core_.WXK_SPECIAL12
536WXK_SPECIAL13 = _core_.WXK_SPECIAL13
537WXK_SPECIAL14 = _core_.WXK_SPECIAL14
538WXK_SPECIAL15 = _core_.WXK_SPECIAL15
539WXK_SPECIAL16 = _core_.WXK_SPECIAL16
540WXK_SPECIAL17 = _core_.WXK_SPECIAL17
541WXK_SPECIAL18 = _core_.WXK_SPECIAL18
542WXK_SPECIAL19 = _core_.WXK_SPECIAL19
543WXK_SPECIAL20 = _core_.WXK_SPECIAL20
544PAPER_NONE = _core_.PAPER_NONE
545PAPER_LETTER = _core_.PAPER_LETTER
546PAPER_LEGAL = _core_.PAPER_LEGAL
547PAPER_A4 = _core_.PAPER_A4
548PAPER_CSHEET = _core_.PAPER_CSHEET
549PAPER_DSHEET = _core_.PAPER_DSHEET
550PAPER_ESHEET = _core_.PAPER_ESHEET
551PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
552PAPER_TABLOID = _core_.PAPER_TABLOID
553PAPER_LEDGER = _core_.PAPER_LEDGER
554PAPER_STATEMENT = _core_.PAPER_STATEMENT
555PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
556PAPER_A3 = _core_.PAPER_A3
557PAPER_A4SMALL = _core_.PAPER_A4SMALL
558PAPER_A5 = _core_.PAPER_A5
559PAPER_B4 = _core_.PAPER_B4
560PAPER_B5 = _core_.PAPER_B5
561PAPER_FOLIO = _core_.PAPER_FOLIO
562PAPER_QUARTO = _core_.PAPER_QUARTO
563PAPER_10X14 = _core_.PAPER_10X14
564PAPER_11X17 = _core_.PAPER_11X17
565PAPER_NOTE = _core_.PAPER_NOTE
566PAPER_ENV_9 = _core_.PAPER_ENV_9
567PAPER_ENV_10 = _core_.PAPER_ENV_10
568PAPER_ENV_11 = _core_.PAPER_ENV_11
569PAPER_ENV_12 = _core_.PAPER_ENV_12
570PAPER_ENV_14 = _core_.PAPER_ENV_14
571PAPER_ENV_DL = _core_.PAPER_ENV_DL
572PAPER_ENV_C5 = _core_.PAPER_ENV_C5
573PAPER_ENV_C3 = _core_.PAPER_ENV_C3
574PAPER_ENV_C4 = _core_.PAPER_ENV_C4
575PAPER_ENV_C6 = _core_.PAPER_ENV_C6
576PAPER_ENV_C65 = _core_.PAPER_ENV_C65
577PAPER_ENV_B4 = _core_.PAPER_ENV_B4
578PAPER_ENV_B5 = _core_.PAPER_ENV_B5
579PAPER_ENV_B6 = _core_.PAPER_ENV_B6
580PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
581PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
582PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
583PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
584PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
585PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
586PAPER_ISO_B4 = _core_.PAPER_ISO_B4
587PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
588PAPER_9X11 = _core_.PAPER_9X11
589PAPER_10X11 = _core_.PAPER_10X11
590PAPER_15X11 = _core_.PAPER_15X11
591PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
592PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
593PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
594PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
595PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
596PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
597PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
598PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
599PAPER_A_PLUS = _core_.PAPER_A_PLUS
600PAPER_B_PLUS = _core_.PAPER_B_PLUS
601PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
602PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
603PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
604PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
605PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
606PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
607PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
608PAPER_A2 = _core_.PAPER_A2
609PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
610PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
034e3677
RD
611PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
612PAPER_A6 = _core_.PAPER_A6
613PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
614PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
615PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
616PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
617PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
618PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
619PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
620PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
621PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
622PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
623PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
624PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
625PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
626PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
627PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
628PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
629PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
630PAPER_B6_JIS = _core_.PAPER_B6_JIS
631PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
632PAPER_12X11 = _core_.PAPER_12X11
633PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
634PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
635PAPER_P16K = _core_.PAPER_P16K
636PAPER_P32K = _core_.PAPER_P32K
637PAPER_P32KBIG = _core_.PAPER_P32KBIG
638PAPER_PENV_1 = _core_.PAPER_PENV_1
639PAPER_PENV_2 = _core_.PAPER_PENV_2
640PAPER_PENV_3 = _core_.PAPER_PENV_3
641PAPER_PENV_4 = _core_.PAPER_PENV_4
642PAPER_PENV_5 = _core_.PAPER_PENV_5
643PAPER_PENV_6 = _core_.PAPER_PENV_6
644PAPER_PENV_7 = _core_.PAPER_PENV_7
645PAPER_PENV_8 = _core_.PAPER_PENV_8
646PAPER_PENV_9 = _core_.PAPER_PENV_9
647PAPER_PENV_10 = _core_.PAPER_PENV_10
648PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
649PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
650PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
651PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
652PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
653PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
654PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
655PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
656PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
657PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
658PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
659PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
660PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
5b5c9bc7
RD
661DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
662DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
663DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
664ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
665ITEM_NORMAL = _core_.ITEM_NORMAL
666ITEM_CHECK = _core_.ITEM_CHECK
667ITEM_RADIO = _core_.ITEM_RADIO
668ITEM_MAX = _core_.ITEM_MAX
669HT_NOWHERE = _core_.HT_NOWHERE
670HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
671HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
672HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
673HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
674HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
675HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
676HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
677HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
678HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
679HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
680HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
681HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
682HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
683HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
684HT_MAX = _core_.HT_MAX
685MOD_NONE = _core_.MOD_NONE
686MOD_ALT = _core_.MOD_ALT
687MOD_CONTROL = _core_.MOD_CONTROL
943e8dfd 688MOD_ALTGR = _core_.MOD_ALTGR
5b5c9bc7 689MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 690MOD_META = _core_.MOD_META
5b5c9bc7 691MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
692MOD_CMD = _core_.MOD_CMD
693MOD_ALL = _core_.MOD_ALL
5b5c9bc7
RD
694UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
695UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
696UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d55e5bfc
RD
697#---------------------------------------------------------------------------
698
5b5c9bc7 699class Object(object):
d55e5bfc
RD
700 """
701 The base class for most wx objects, although in wxPython not
702 much functionality is needed nor exposed.
703 """
1bd55598
RD
704 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
705 def __init__(self): raise AttributeError, "No constructor defined"
706 __repr__ = _swig_repr
d55e5bfc
RD
707 def GetClassName(*args, **kwargs):
708 """
5b5c9bc7 709 GetClassName(self) -> String
d55e5bfc
RD
710
711 Returns the class name of the C++ class using wxRTTI.
712 """
5b5c9bc7 713 return _core_.Object_GetClassName(*args, **kwargs)
d55e5bfc
RD
714
715 def Destroy(*args, **kwargs):
716 """
717 Destroy(self)
718
719 Deletes the C++ object this Python object is a proxy for.
720 """
7e08d4ef
RD
721 val = _core_.Object_Destroy(*args, **kwargs)
722 args[0].thisown = 0
723 return val
d55e5bfc 724
2131d850 725_core_.Object_swigregister(Object)
5b5c9bc7 726_wxPySetDictionary = _core_._wxPySetDictionary
5b5c9bc7 727cvar = _core_.cvar
d55e5bfc
RD
728EmptyString = cvar.EmptyString
729
730#---------------------------------------------------------------------------
731
5b5c9bc7
RD
732BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
733BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
734BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
735BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
736BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
737BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
738BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
739BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
740BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
741BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
742BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
743BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
744BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
745BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
746BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
747BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
748BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
749BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
750BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
751BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
752CURSOR_NONE = _core_.CURSOR_NONE
753CURSOR_ARROW = _core_.CURSOR_ARROW
754CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
755CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
756CURSOR_CHAR = _core_.CURSOR_CHAR
757CURSOR_CROSS = _core_.CURSOR_CROSS
758CURSOR_HAND = _core_.CURSOR_HAND
759CURSOR_IBEAM = _core_.CURSOR_IBEAM
760CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
761CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
762CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
763CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
764CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
765CURSOR_PENCIL = _core_.CURSOR_PENCIL
766CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
767CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
768CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
769CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
770CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
771CURSOR_SIZENS = _core_.CURSOR_SIZENS
772CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
773CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
774CURSOR_SIZING = _core_.CURSOR_SIZING
775CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
776CURSOR_WAIT = _core_.CURSOR_WAIT
777CURSOR_WATCH = _core_.CURSOR_WATCH
778CURSOR_BLANK = _core_.CURSOR_BLANK
779CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
780CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
781CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
782CURSOR_MAX = _core_.CURSOR_MAX
d55e5bfc
RD
783#---------------------------------------------------------------------------
784
5b5c9bc7 785class Size(object):
d55e5bfc 786 """
15817c7e 787 wx.Size is a useful data structure used to represent the size of
1bd55598
RD
788 something. It simply contains integer width and height
789 properties. In most places in wxPython where a wx.Size is
36ed4f51 790 expected a (width, height) tuple can be used instead.
d55e5bfc 791 """
1bd55598
RD
792 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
793 __repr__ = _swig_repr
5b5c9bc7
RD
794 width = property(_core_.Size_width_get, _core_.Size_width_set)
795 height = property(_core_.Size_height_get, _core_.Size_height_set)
d55e5bfc 796 x = width; y = height
1bd55598 797 def __init__(self, *args, **kwargs):
d55e5bfc 798 """
5b5c9bc7 799 __init__(self, int w=0, int h=0) -> Size
d55e5bfc
RD
800
801 Creates a size object.
802 """
1bd55598
RD
803 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
804 __swig_destroy__ = _core_.delete_Size
805 __del__ = lambda self : None;
d55e5bfc
RD
806 def __eq__(*args, **kwargs):
807 """
e9d6f3a4 808 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
809
810 Test for equality of wx.Size objects.
811 """
5b5c9bc7 812 return _core_.Size___eq__(*args, **kwargs)
d55e5bfc
RD
813
814 def __ne__(*args, **kwargs):
815 """
e9d6f3a4 816 __ne__(self, PyObject other) -> bool
d55e5bfc 817
e9d6f3a4 818 Test for inequality of wx.Size objects.
d55e5bfc 819 """
5b5c9bc7 820 return _core_.Size___ne__(*args, **kwargs)
d55e5bfc
RD
821
822 def __add__(*args, **kwargs):
823 """
5b5c9bc7 824 __add__(self, Size sz) -> Size
d55e5bfc
RD
825
826 Add sz's proprties to this and return the result.
827 """
5b5c9bc7 828 return _core_.Size___add__(*args, **kwargs)
d55e5bfc
RD
829
830 def __sub__(*args, **kwargs):
831 """
5b5c9bc7 832 __sub__(self, Size sz) -> Size
d55e5bfc
RD
833
834 Subtract sz's properties from this and return the result.
835 """
5b5c9bc7 836 return _core_.Size___sub__(*args, **kwargs)
d55e5bfc
RD
837
838 def IncTo(*args, **kwargs):
839 """
5b5c9bc7 840 IncTo(self, Size sz)
d55e5bfc
RD
841
842 Increments this object so that both of its dimensions are not less
843 than the corresponding dimensions of the size.
844 """
5b5c9bc7 845 return _core_.Size_IncTo(*args, **kwargs)
d55e5bfc
RD
846
847 def DecTo(*args, **kwargs):
848 """
5b5c9bc7 849 DecTo(self, Size sz)
d55e5bfc
RD
850
851 Decrements this object so that both of its dimensions are not greater
852 than the corresponding dimensions of the size.
853 """
5b5c9bc7 854 return _core_.Size_DecTo(*args, **kwargs)
d55e5bfc
RD
855
856 def Set(*args, **kwargs):
857 """
858 Set(self, int w, int h)
859
860 Set both width and height.
861 """
5b5c9bc7 862 return _core_.Size_Set(*args, **kwargs)
d55e5bfc
RD
863
864 def SetWidth(*args, **kwargs):
865 """SetWidth(self, int w)"""
5b5c9bc7 866 return _core_.Size_SetWidth(*args, **kwargs)
d55e5bfc
RD
867
868 def SetHeight(*args, **kwargs):
869 """SetHeight(self, int h)"""
5b5c9bc7 870 return _core_.Size_SetHeight(*args, **kwargs)
d55e5bfc
RD
871
872 def GetWidth(*args, **kwargs):
873 """GetWidth(self) -> int"""
5b5c9bc7 874 return _core_.Size_GetWidth(*args, **kwargs)
d55e5bfc
RD
875
876 def GetHeight(*args, **kwargs):
877 """GetHeight(self) -> int"""
5b5c9bc7 878 return _core_.Size_GetHeight(*args, **kwargs)
d55e5bfc
RD
879
880 def IsFullySpecified(*args, **kwargs):
881 """
882 IsFullySpecified(self) -> bool
883
884 Returns True if both components of the size are non-default values.
885 """
5b5c9bc7 886 return _core_.Size_IsFullySpecified(*args, **kwargs)
d55e5bfc
RD
887
888 def SetDefaults(*args, **kwargs):
889 """
5b5c9bc7 890 SetDefaults(self, Size size)
d55e5bfc 891
15817c7e
RD
892 Combine this size with the other one replacing the default components
893 of this object (i.e. equal to -1) with those of the other.
d55e5bfc 894 """
5b5c9bc7 895 return _core_.Size_SetDefaults(*args, **kwargs)
d55e5bfc
RD
896
897 def Get(*args, **kwargs):
898 """
899 Get() -> (width,height)
900
901 Returns the width and height properties as a tuple.
902 """
5b5c9bc7 903 return _core_.Size_Get(*args, **kwargs)
d55e5bfc 904
15817c7e 905 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
906 def __str__(self): return str(self.Get())
907 def __repr__(self): return 'wx.Size'+str(self.Get())
908 def __len__(self): return len(self.Get())
909 def __getitem__(self, index): return self.Get()[index]
910 def __setitem__(self, index, val):
911 if index == 0: self.width = val
912 elif index == 1: self.height = val
913 else: raise IndexError
914 def __nonzero__(self): return self.Get() != (0,0)
915 __safe_for_unpickling__ = True
916 def __reduce__(self): return (wx.Size, self.Get())
917
2131d850 918_core_.Size_swigregister(Size)
d55e5bfc
RD
919
920#---------------------------------------------------------------------------
921
5b5c9bc7 922class RealPoint(object):
d55e5bfc 923 """
15817c7e
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.
d55e5bfc 927 """
1bd55598
RD
928 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
929 __repr__ = _swig_repr
5b5c9bc7
RD
930 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
931 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
1bd55598 932 def __init__(self, *args, **kwargs):
d55e5bfc 933 """
5b5c9bc7 934 __init__(self, double x=0.0, double y=0.0) -> RealPoint
d55e5bfc
RD
935
936 Create a wx.RealPoint object
937 """
1bd55598
RD
938 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
939 __swig_destroy__ = _core_.delete_RealPoint
940 __del__ = lambda self : None;
d55e5bfc
RD
941 def __eq__(*args, **kwargs):
942 """
e9d6f3a4 943 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
944
945 Test for equality of wx.RealPoint objects.
946 """
5b5c9bc7 947 return _core_.RealPoint___eq__(*args, **kwargs)
d55e5bfc
RD
948
949 def __ne__(*args, **kwargs):
950 """
e9d6f3a4 951 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
952
953 Test for inequality of wx.RealPoint objects.
954 """
5b5c9bc7 955 return _core_.RealPoint___ne__(*args, **kwargs)
d55e5bfc
RD
956
957 def __add__(*args, **kwargs):
958 """
5b5c9bc7 959 __add__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
960
961 Add pt's proprties to this and return the result.
962 """
5b5c9bc7 963 return _core_.RealPoint___add__(*args, **kwargs)
d55e5bfc
RD
964
965 def __sub__(*args, **kwargs):
966 """
5b5c9bc7 967 __sub__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
968
969 Subtract pt's proprties from this and return the result
970 """
5b5c9bc7 971 return _core_.RealPoint___sub__(*args, **kwargs)
d55e5bfc
RD
972
973 def Set(*args, **kwargs):
974 """
975 Set(self, double x, double y)
976
977 Set both the x and y properties
978 """
5b5c9bc7 979 return _core_.RealPoint_Set(*args, **kwargs)
d55e5bfc
RD
980
981 def Get(*args, **kwargs):
982 """
983 Get() -> (x,y)
984
985 Return the x and y properties as a tuple.
986 """
5b5c9bc7 987 return _core_.RealPoint_Get(*args, **kwargs)
d55e5bfc 988
15817c7e 989 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
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]
994 def __setitem__(self, index, val):
995 if index == 0: self.x = val
996 elif index == 1: self.y = val
997 else: raise IndexError
998 def __nonzero__(self): return self.Get() != (0.0, 0.0)
999 __safe_for_unpickling__ = True
1000 def __reduce__(self): return (wx.RealPoint, self.Get())
1001
2131d850 1002_core_.RealPoint_swigregister(RealPoint)
d55e5bfc
RD
1003
1004#---------------------------------------------------------------------------
1005
5b5c9bc7 1006class Point(object):
d55e5bfc 1007 """
15817c7e
RD
1008 A data structure for representing a point or position with integer x
1009 and y properties. Most places in wxPython that expect a wx.Point can
1010 also accept a (x,y) tuple.
d55e5bfc 1011 """
1bd55598
RD
1012 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1013 __repr__ = _swig_repr
5b5c9bc7
RD
1014 x = property(_core_.Point_x_get, _core_.Point_x_set)
1015 y = property(_core_.Point_y_get, _core_.Point_y_set)
1bd55598 1016 def __init__(self, *args, **kwargs):
d55e5bfc 1017 """
5b5c9bc7 1018 __init__(self, int x=0, int y=0) -> Point
d55e5bfc
RD
1019
1020 Create a wx.Point object
1021 """
1bd55598
RD
1022 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1023 __swig_destroy__ = _core_.delete_Point
1024 __del__ = lambda self : None;
d55e5bfc
RD
1025 def __eq__(*args, **kwargs):
1026 """
e9d6f3a4 1027 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
1028
1029 Test for equality of wx.Point objects.
1030 """
5b5c9bc7 1031 return _core_.Point___eq__(*args, **kwargs)
d55e5bfc
RD
1032
1033 def __ne__(*args, **kwargs):
1034 """
e9d6f3a4 1035 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
1036
1037 Test for inequality of wx.Point objects.
1038 """
5b5c9bc7 1039 return _core_.Point___ne__(*args, **kwargs)
d55e5bfc
RD
1040
1041 def __add__(*args, **kwargs):
1042 """
5b5c9bc7 1043 __add__(self, Point pt) -> Point
d55e5bfc
RD
1044
1045 Add pt's proprties to this and return the result.
1046 """
5b5c9bc7 1047 return _core_.Point___add__(*args, **kwargs)
d55e5bfc
RD
1048
1049 def __sub__(*args, **kwargs):
1050 """
5b5c9bc7 1051 __sub__(self, Point pt) -> Point
d55e5bfc
RD
1052
1053 Subtract pt's proprties from this and return the result
1054 """
5b5c9bc7 1055 return _core_.Point___sub__(*args, **kwargs)
d55e5bfc
RD
1056
1057 def __iadd__(*args, **kwargs):
1058 """
5b5c9bc7 1059 __iadd__(self, Point pt) -> Point
d55e5bfc
RD
1060
1061 Add pt to this object.
1062 """
5b5c9bc7 1063 return _core_.Point___iadd__(*args, **kwargs)
d55e5bfc
RD
1064
1065 def __isub__(*args, **kwargs):
1066 """
5b5c9bc7 1067 __isub__(self, Point pt) -> Point
d55e5bfc
RD
1068
1069 Subtract pt from this object.
1070 """
5b5c9bc7 1071 return _core_.Point___isub__(*args, **kwargs)
d55e5bfc
RD
1072
1073 def Set(*args, **kwargs):
1074 """
1075 Set(self, long x, long y)
1076
1077 Set both the x and y properties
1078 """
5b5c9bc7 1079 return _core_.Point_Set(*args, **kwargs)
d55e5bfc
RD
1080
1081 def Get(*args, **kwargs):
1082 """
1083 Get() -> (x,y)
1084
1085 Return the x and y properties as a tuple.
1086 """
5b5c9bc7 1087 return _core_.Point_Get(*args, **kwargs)
d55e5bfc 1088
15817c7e 1089 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1090 def __str__(self): return str(self.Get())
1091 def __repr__(self): return 'wx.Point'+str(self.Get())
1092 def __len__(self): return len(self.Get())
1093 def __getitem__(self, index): return self.Get()[index]
1094 def __setitem__(self, index, val):
1095 if index == 0: self.x = val
1096 elif index == 1: self.y = val
1097 else: raise IndexError
1098 def __nonzero__(self): return self.Get() != (0,0)
1099 __safe_for_unpickling__ = True
1100 def __reduce__(self): return (wx.Point, self.Get())
1101
2131d850 1102_core_.Point_swigregister(Point)
d55e5bfc
RD
1103
1104#---------------------------------------------------------------------------
1105
5b5c9bc7 1106class Rect(object):
d55e5bfc 1107 """
15817c7e
RD
1108 A class for representing and manipulating rectangles. It has x, y,
1109 width and height properties. In wxPython most palces that expect a
1110 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc 1111 """
1bd55598
RD
1112 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1113 __repr__ = _swig_repr
1114 def __init__(self, *args, **kwargs):
d55e5bfc 1115 """
5b5c9bc7 1116 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
d55e5bfc
RD
1117
1118 Create a new Rect object.
1119 """
1bd55598
RD
1120 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1121 __swig_destroy__ = _core_.delete_Rect
1122 __del__ = lambda self : None;
d55e5bfc
RD
1123 def GetX(*args, **kwargs):
1124 """GetX(self) -> int"""
5b5c9bc7 1125 return _core_.Rect_GetX(*args, **kwargs)
d55e5bfc
RD
1126
1127 def SetX(*args, **kwargs):
1128 """SetX(self, int x)"""
5b5c9bc7 1129 return _core_.Rect_SetX(*args, **kwargs)
d55e5bfc
RD
1130
1131 def GetY(*args, **kwargs):
1132 """GetY(self) -> int"""
5b5c9bc7 1133 return _core_.Rect_GetY(*args, **kwargs)
d55e5bfc
RD
1134
1135 def SetY(*args, **kwargs):
1136 """SetY(self, int y)"""
5b5c9bc7 1137 return _core_.Rect_SetY(*args, **kwargs)
d55e5bfc
RD
1138
1139 def GetWidth(*args, **kwargs):
1140 """GetWidth(self) -> int"""
5b5c9bc7 1141 return _core_.Rect_GetWidth(*args, **kwargs)
d55e5bfc
RD
1142
1143 def SetWidth(*args, **kwargs):
1144 """SetWidth(self, int w)"""
5b5c9bc7 1145 return _core_.Rect_SetWidth(*args, **kwargs)
d55e5bfc
RD
1146
1147 def GetHeight(*args, **kwargs):
1148 """GetHeight(self) -> int"""
5b5c9bc7 1149 return _core_.Rect_GetHeight(*args, **kwargs)
d55e5bfc
RD
1150
1151 def SetHeight(*args, **kwargs):
1152 """SetHeight(self, int h)"""
5b5c9bc7 1153 return _core_.Rect_SetHeight(*args, **kwargs)
d55e5bfc
RD
1154
1155 def GetPosition(*args, **kwargs):
5b5c9bc7
RD
1156 """GetPosition(self) -> Point"""
1157 return _core_.Rect_GetPosition(*args, **kwargs)
d55e5bfc
RD
1158
1159 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
1160 """SetPosition(self, Point p)"""
1161 return _core_.Rect_SetPosition(*args, **kwargs)
d55e5bfc
RD
1162
1163 def GetSize(*args, **kwargs):
5b5c9bc7
RD
1164 """GetSize(self) -> Size"""
1165 return _core_.Rect_GetSize(*args, **kwargs)
d55e5bfc
RD
1166
1167 def SetSize(*args, **kwargs):
5b5c9bc7
RD
1168 """SetSize(self, Size s)"""
1169 return _core_.Rect_SetSize(*args, **kwargs)
d55e5bfc 1170
aff4cc5c
RD
1171 def IsEmpty(*args, **kwargs):
1172 """IsEmpty(self) -> bool"""
5b5c9bc7 1173 return _core_.Rect_IsEmpty(*args, **kwargs)
aff4cc5c 1174
d55e5bfc 1175 def GetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1176 """GetTopLeft(self) -> Point"""
1177 return _core_.Rect_GetTopLeft(*args, **kwargs)
d55e5bfc
RD
1178
1179 def SetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1180 """SetTopLeft(self, Point p)"""
1181 return _core_.Rect_SetTopLeft(*args, **kwargs)
d55e5bfc
RD
1182
1183 def GetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1184 """GetBottomRight(self) -> Point"""
1185 return _core_.Rect_GetBottomRight(*args, **kwargs)
d55e5bfc
RD
1186
1187 def SetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1188 """SetBottomRight(self, Point p)"""
1189 return _core_.Rect_SetBottomRight(*args, **kwargs)
d55e5bfc
RD
1190
1191 def GetLeft(*args, **kwargs):
1192 """GetLeft(self) -> int"""
5b5c9bc7 1193 return _core_.Rect_GetLeft(*args, **kwargs)
d55e5bfc
RD
1194
1195 def GetTop(*args, **kwargs):
1196 """GetTop(self) -> int"""
5b5c9bc7 1197 return _core_.Rect_GetTop(*args, **kwargs)
d55e5bfc
RD
1198
1199 def GetBottom(*args, **kwargs):
1200 """GetBottom(self) -> int"""
5b5c9bc7 1201 return _core_.Rect_GetBottom(*args, **kwargs)
d55e5bfc
RD
1202
1203 def GetRight(*args, **kwargs):
1204 """GetRight(self) -> int"""
5b5c9bc7 1205 return _core_.Rect_GetRight(*args, **kwargs)
d55e5bfc
RD
1206
1207 def SetLeft(*args, **kwargs):
1208 """SetLeft(self, int left)"""
5b5c9bc7 1209 return _core_.Rect_SetLeft(*args, **kwargs)
d55e5bfc
RD
1210
1211 def SetRight(*args, **kwargs):
1212 """SetRight(self, int right)"""
5b5c9bc7 1213 return _core_.Rect_SetRight(*args, **kwargs)
d55e5bfc
RD
1214
1215 def SetTop(*args, **kwargs):
1216 """SetTop(self, int top)"""
5b5c9bc7 1217 return _core_.Rect_SetTop(*args, **kwargs)
d55e5bfc
RD
1218
1219 def SetBottom(*args, **kwargs):
1220 """SetBottom(self, int bottom)"""
5b5c9bc7 1221 return _core_.Rect_SetBottom(*args, **kwargs)
d55e5bfc
RD
1222
1223 position = property(GetPosition, SetPosition)
1224 size = property(GetSize, SetSize)
1225 left = property(GetLeft, SetLeft)
1226 right = property(GetRight, SetRight)
1227 top = property(GetTop, SetTop)
1228 bottom = property(GetBottom, SetBottom)
1229
1230 def Inflate(*args, **kwargs):
1231 """
5b5c9bc7 1232 Inflate(self, int dx, int dy) -> Rect
d55e5bfc 1233
091fdbfa
RD
1234 Increases the size of the rectangle.
1235
1236 The left border is moved farther left and the right border is moved
1237 farther right by ``dx``. The upper border is moved farther up and the
1238 bottom border is moved farther down by ``dy``. (Note the the width and
1239 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1240 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1241 opposite happens: the rectangle size decreases in the respective
1242 direction.
1243
1244 The change is made to the rectangle inplace, if instead you need a
1245 copy that is inflated, preserving the original then make the copy
1246 first::
1247
1248 copy = wx.Rect(*original)
1249 copy.Inflate(10,15)
1250
1251
d55e5bfc 1252 """
5b5c9bc7 1253 return _core_.Rect_Inflate(*args, **kwargs)
d55e5bfc
RD
1254
1255 def Deflate(*args, **kwargs):
1256 """
5b5c9bc7 1257 Deflate(self, int dx, int dy) -> Rect
d55e5bfc 1258
091fdbfa
RD
1259 Decrease the rectangle size. This method is the opposite of `Inflate`
1260 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1261 `Inflate` for a full description.
d55e5bfc 1262 """
5b5c9bc7 1263 return _core_.Rect_Deflate(*args, **kwargs)
d55e5bfc
RD
1264
1265 def OffsetXY(*args, **kwargs):
1266 """
1267 OffsetXY(self, int dx, int dy)
1268
15817c7e
RD
1269 Moves the rectangle by the specified offset. If dx is positive, the
1270 rectangle is moved to the right, if dy is positive, it is moved to the
1271 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc 1272 """
5b5c9bc7 1273 return _core_.Rect_OffsetXY(*args, **kwargs)
d55e5bfc
RD
1274
1275 def Offset(*args, **kwargs):
1276 """
5b5c9bc7 1277 Offset(self, Point pt)
d55e5bfc 1278
b1fcee84 1279 Same as `OffsetXY` but uses dx,dy from Point
d55e5bfc 1280 """
5b5c9bc7 1281 return _core_.Rect_Offset(*args, **kwargs)
d55e5bfc
RD
1282
1283 def Intersect(*args, **kwargs):
1284 """
5b5c9bc7 1285 Intersect(self, Rect rect) -> Rect
d55e5bfc 1286
5cbf236d 1287 Returns the intersectsion of this rectangle and rect.
d55e5bfc 1288 """
5b5c9bc7 1289 return _core_.Rect_Intersect(*args, **kwargs)
d55e5bfc 1290
5cbf236d
RD
1291 def Union(*args, **kwargs):
1292 """
5b5c9bc7 1293 Union(self, Rect rect) -> Rect
5cbf236d
RD
1294
1295 Returns the union of this rectangle and rect.
1296 """
5b5c9bc7 1297 return _core_.Rect_Union(*args, **kwargs)
5cbf236d 1298
d55e5bfc
RD
1299 def __add__(*args, **kwargs):
1300 """
5b5c9bc7 1301 __add__(self, Rect rect) -> Rect
d55e5bfc
RD
1302
1303 Add the properties of rect to this rectangle and return the result.
1304 """
5b5c9bc7 1305 return _core_.Rect___add__(*args, **kwargs)
d55e5bfc
RD
1306
1307 def __iadd__(*args, **kwargs):
1308 """
5b5c9bc7 1309 __iadd__(self, Rect rect) -> Rect
d55e5bfc
RD
1310
1311 Add the properties of rect to this rectangle, updating this rectangle.
1312 """
5b5c9bc7 1313 return _core_.Rect___iadd__(*args, **kwargs)
d55e5bfc
RD
1314
1315 def __eq__(*args, **kwargs):
1316 """
e9d6f3a4 1317 __eq__(self, PyObject other) -> bool
d55e5bfc 1318
e9d6f3a4 1319 Test for equality of wx.Rect objects.
d55e5bfc 1320 """
5b5c9bc7 1321 return _core_.Rect___eq__(*args, **kwargs)
d55e5bfc
RD
1322
1323 def __ne__(*args, **kwargs):
1324 """
e9d6f3a4 1325 __ne__(self, PyObject other) -> bool
d55e5bfc 1326
e9d6f3a4 1327 Test for inequality of wx.Rect objects.
d55e5bfc 1328 """
5b5c9bc7 1329 return _core_.Rect___ne__(*args, **kwargs)
d55e5bfc
RD
1330
1331 def InsideXY(*args, **kwargs):
1332 """
1333 InsideXY(self, int x, int y) -> bool
1334
1335 Return True if the point is (not strcitly) inside the rect.
1336 """
5b5c9bc7 1337 return _core_.Rect_InsideXY(*args, **kwargs)
d55e5bfc
RD
1338
1339 def Inside(*args, **kwargs):
1340 """
5b5c9bc7 1341 Inside(self, Point pt) -> bool
d55e5bfc
RD
1342
1343 Return True if the point is (not strcitly) inside the rect.
1344 """
5b5c9bc7 1345 return _core_.Rect_Inside(*args, **kwargs)
d55e5bfc
RD
1346
1347 def Intersects(*args, **kwargs):
1348 """
5b5c9bc7 1349 Intersects(self, Rect rect) -> bool
d55e5bfc
RD
1350
1351 Returns True if the rectangles have a non empty intersection.
1352 """
5b5c9bc7 1353 return _core_.Rect_Intersects(*args, **kwargs)
d55e5bfc 1354
b1fcee84
RD
1355 def CenterIn(*args, **kwargs):
1356 """
1357 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1358
1359 Center this rectangle within the one passed to the method, which is
1360 usually, but not necessarily, the larger one.
1361 """
1362 return _core_.Rect_CenterIn(*args, **kwargs)
1363
1364 CentreIn = CenterIn
5b5c9bc7
RD
1365 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1366 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1367 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1368 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
d55e5bfc
RD
1369 def Set(*args, **kwargs):
1370 """
1371 Set(self, int x=0, int y=0, int width=0, int height=0)
1372
1373 Set all rectangle properties.
1374 """
5b5c9bc7 1375 return _core_.Rect_Set(*args, **kwargs)
d55e5bfc
RD
1376
1377 def Get(*args, **kwargs):
1378 """
1379 Get() -> (x,y,width,height)
1380
1381 Return the rectangle properties as a tuple.
1382 """
5b5c9bc7 1383 return _core_.Rect_Get(*args, **kwargs)
d55e5bfc 1384
15817c7e 1385 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1386 def __str__(self): return str(self.Get())
1387 def __repr__(self): return 'wx.Rect'+str(self.Get())
1388 def __len__(self): return len(self.Get())
1389 def __getitem__(self, index): return self.Get()[index]
1390 def __setitem__(self, index, val):
1391 if index == 0: self.x = val
1392 elif index == 1: self.y = val
1393 elif index == 2: self.width = val
1394 elif index == 3: self.height = val
1395 else: raise IndexError
1396 def __nonzero__(self): return self.Get() != (0,0,0,0)
1397 __safe_for_unpickling__ = True
1398 def __reduce__(self): return (wx.Rect, self.Get())
1399
2131d850 1400_core_.Rect_swigregister(Rect)
d55e5bfc
RD
1401
1402def RectPP(*args, **kwargs):
1403 """
5b5c9bc7 1404 RectPP(Point topLeft, Point bottomRight) -> Rect
d55e5bfc
RD
1405
1406 Create a new Rect object from Points representing two corners.
1407 """
5b5c9bc7 1408 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1409 return val
1410
1411def RectPS(*args, **kwargs):
1412 """
5b5c9bc7 1413 RectPS(Point pos, Size size) -> Rect
d55e5bfc
RD
1414
1415 Create a new Rect from a position and size.
1416 """
5b5c9bc7 1417 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1418 return val
1419
070c48b4
RD
1420def RectS(*args, **kwargs):
1421 """
5b5c9bc7 1422 RectS(Size size) -> Rect
070c48b4
RD
1423
1424 Create a new Rect from a size only.
1425 """
5b5c9bc7 1426 val = _core_.new_RectS(*args, **kwargs)
070c48b4
RD
1427 return val
1428
d55e5bfc 1429
5b5c9bc7 1430def IntersectRect(*args, **kwargs):
1bd55598 1431 """
d55e5bfc
RD
1432 IntersectRect(Rect r1, Rect r2) -> Rect
1433
1434 Calculate and return the intersection of r1 and r2.
1435 """
1bd55598 1436 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1437#---------------------------------------------------------------------------
1438
5b5c9bc7 1439class Point2D(object):
15817c7e
RD
1440 """
1441 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1442 with floating point values.
1443 """
1bd55598
RD
1444 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1445 __repr__ = _swig_repr
1446 def __init__(self, *args, **kwargs):
d55e5bfc 1447 """
5b5c9bc7 1448 __init__(self, double x=0.0, double y=0.0) -> Point2D
d55e5bfc
RD
1449
1450 Create a w.Point2D object.
1451 """
1bd55598 1452 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
d55e5bfc 1453 def GetFloor(*args, **kwargs):
fd2dc343
RD
1454 """
1455 GetFloor() -> (x,y)
1456
1457 Convert to integer
1458 """
5b5c9bc7 1459 return _core_.Point2D_GetFloor(*args, **kwargs)
d55e5bfc
RD
1460
1461 def GetRounded(*args, **kwargs):
fd2dc343
RD
1462 """
1463 GetRounded() -> (x,y)
1464
1465 Convert to integer
1466 """
5b5c9bc7 1467 return _core_.Point2D_GetRounded(*args, **kwargs)
d55e5bfc
RD
1468
1469 def GetVectorLength(*args, **kwargs):
1470 """GetVectorLength(self) -> double"""
5b5c9bc7 1471 return _core_.Point2D_GetVectorLength(*args, **kwargs)
d55e5bfc
RD
1472
1473 def GetVectorAngle(*args, **kwargs):
1474 """GetVectorAngle(self) -> double"""
5b5c9bc7 1475 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1476
1477 def SetVectorLength(*args, **kwargs):
1478 """SetVectorLength(self, double length)"""
5b5c9bc7 1479 return _core_.Point2D_SetVectorLength(*args, **kwargs)
d55e5bfc
RD
1480
1481 def SetVectorAngle(*args, **kwargs):
1482 """SetVectorAngle(self, double degrees)"""
5b5c9bc7 1483 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1484
1485 def SetPolarCoordinates(self, angle, length):
1486 self.SetVectorLength(length)
1487 self.SetVectorAngle(angle)
1488 def Normalize(self):
1489 self.SetVectorLength(1.0)
1490
1491 def GetDistance(*args, **kwargs):
5b5c9bc7
RD
1492 """GetDistance(self, Point2D pt) -> double"""
1493 return _core_.Point2D_GetDistance(*args, **kwargs)
d55e5bfc
RD
1494
1495 def GetDistanceSquare(*args, **kwargs):
5b5c9bc7
RD
1496 """GetDistanceSquare(self, Point2D pt) -> double"""
1497 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
d55e5bfc
RD
1498
1499 def GetDotProduct(*args, **kwargs):
5b5c9bc7
RD
1500 """GetDotProduct(self, Point2D vec) -> double"""
1501 return _core_.Point2D_GetDotProduct(*args, **kwargs)
d55e5bfc
RD
1502
1503 def GetCrossProduct(*args, **kwargs):
5b5c9bc7
RD
1504 """GetCrossProduct(self, Point2D vec) -> double"""
1505 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
d55e5bfc
RD
1506
1507 def __neg__(*args, **kwargs):
1508 """
5b5c9bc7 1509 __neg__(self) -> Point2D
d55e5bfc
RD
1510
1511 the reflection of this point
1512 """
5b5c9bc7 1513 return _core_.Point2D___neg__(*args, **kwargs)
d55e5bfc
RD
1514
1515 def __iadd__(*args, **kwargs):
5b5c9bc7
RD
1516 """__iadd__(self, Point2D pt) -> Point2D"""
1517 return _core_.Point2D___iadd__(*args, **kwargs)
d55e5bfc
RD
1518
1519 def __isub__(*args, **kwargs):
5b5c9bc7
RD
1520 """__isub__(self, Point2D pt) -> Point2D"""
1521 return _core_.Point2D___isub__(*args, **kwargs)
d55e5bfc
RD
1522
1523 def __imul__(*args, **kwargs):
5b5c9bc7
RD
1524 """__imul__(self, Point2D pt) -> Point2D"""
1525 return _core_.Point2D___imul__(*args, **kwargs)
d55e5bfc
RD
1526
1527 def __idiv__(*args, **kwargs):
5b5c9bc7
RD
1528 """__idiv__(self, Point2D pt) -> Point2D"""
1529 return _core_.Point2D___idiv__(*args, **kwargs)
d55e5bfc
RD
1530
1531 def __eq__(*args, **kwargs):
1532 """
e9d6f3a4 1533 __eq__(self, PyObject other) -> bool
d55e5bfc 1534
e9d6f3a4 1535 Test for equality of wx.Point2D objects.
d55e5bfc 1536 """
5b5c9bc7 1537 return _core_.Point2D___eq__(*args, **kwargs)
d55e5bfc
RD
1538
1539 def __ne__(*args, **kwargs):
1540 """
e9d6f3a4 1541 __ne__(self, PyObject other) -> bool
d55e5bfc 1542
e9d6f3a4 1543 Test for inequality of wx.Point2D objects.
d55e5bfc 1544 """
5b5c9bc7 1545 return _core_.Point2D___ne__(*args, **kwargs)
d55e5bfc 1546
5b5c9bc7
RD
1547 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1548 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
d55e5bfc
RD
1549 def Set(*args, **kwargs):
1550 """Set(self, double x=0, double y=0)"""
5b5c9bc7 1551 return _core_.Point2D_Set(*args, **kwargs)
d55e5bfc
RD
1552
1553 def Get(*args, **kwargs):
1554 """
1555 Get() -> (x,y)
1556
1557 Return x and y properties as a tuple.
1558 """
5b5c9bc7 1559 return _core_.Point2D_Get(*args, **kwargs)
d55e5bfc 1560
15817c7e 1561 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1562 def __str__(self): return str(self.Get())
1563 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1564 def __len__(self): return len(self.Get())
1565 def __getitem__(self, index): return self.Get()[index]
1566 def __setitem__(self, index, val):
1567 if index == 0: self.x = val
1568 elif index == 1: self.y = val
1569 else: raise IndexError
1570 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1571 __safe_for_unpickling__ = True
1572 def __reduce__(self): return (wx.Point2D, self.Get())
1573
2131d850 1574_core_.Point2D_swigregister(Point2D)
d55e5bfc
RD
1575
1576def Point2DCopy(*args, **kwargs):
1577 """
5b5c9bc7 1578 Point2DCopy(Point2D pt) -> Point2D
d55e5bfc
RD
1579
1580 Create a w.Point2D object.
1581 """
5b5c9bc7 1582 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1583 return val
1584
1585def Point2DFromPoint(*args, **kwargs):
1586 """
5b5c9bc7 1587 Point2DFromPoint(Point pt) -> Point2D
d55e5bfc
RD
1588
1589 Create a w.Point2D object.
1590 """
5b5c9bc7 1591 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d55e5bfc
RD
1592 return val
1593
1594#---------------------------------------------------------------------------
1595
5b5c9bc7
RD
1596FromStart = _core_.FromStart
1597FromCurrent = _core_.FromCurrent
1598FromEnd = _core_.FromEnd
d55e5bfc 1599class InputStream(object):
36ed4f51 1600 """Proxy of C++ InputStream class"""
1bd55598
RD
1601 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1602 __repr__ = _swig_repr
1603 def __init__(self, *args, **kwargs):
d55e5bfc 1604 """__init__(self, PyObject p) -> InputStream"""
1bd55598
RD
1605 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1606 __swig_destroy__ = _core_.delete_InputStream
1607 __del__ = lambda self : None;
d55e5bfc
RD
1608 def close(*args, **kwargs):
1609 """close(self)"""
5b5c9bc7 1610 return _core_.InputStream_close(*args, **kwargs)
d55e5bfc
RD
1611
1612 def flush(*args, **kwargs):
1613 """flush(self)"""
5b5c9bc7 1614 return _core_.InputStream_flush(*args, **kwargs)
d55e5bfc
RD
1615
1616 def eof(*args, **kwargs):
1617 """eof(self) -> bool"""
5b5c9bc7 1618 return _core_.InputStream_eof(*args, **kwargs)
d55e5bfc
RD
1619
1620 def read(*args, **kwargs):
1621 """read(self, int size=-1) -> PyObject"""
5b5c9bc7 1622 return _core_.InputStream_read(*args, **kwargs)
d55e5bfc
RD
1623
1624 def readline(*args, **kwargs):
1625 """readline(self, int size=-1) -> PyObject"""
5b5c9bc7 1626 return _core_.InputStream_readline(*args, **kwargs)
d55e5bfc
RD
1627
1628 def readlines(*args, **kwargs):
1629 """readlines(self, int sizehint=-1) -> PyObject"""
5b5c9bc7 1630 return _core_.InputStream_readlines(*args, **kwargs)
d55e5bfc
RD
1631
1632 def seek(*args, **kwargs):
1633 """seek(self, int offset, int whence=0)"""
5b5c9bc7 1634 return _core_.InputStream_seek(*args, **kwargs)
d55e5bfc
RD
1635
1636 def tell(*args, **kwargs):
1637 """tell(self) -> int"""
5b5c9bc7 1638 return _core_.InputStream_tell(*args, **kwargs)
d55e5bfc
RD
1639
1640 def Peek(*args, **kwargs):
1641 """Peek(self) -> char"""
5b5c9bc7 1642 return _core_.InputStream_Peek(*args, **kwargs)
d55e5bfc
RD
1643
1644 def GetC(*args, **kwargs):
1645 """GetC(self) -> char"""
5b5c9bc7 1646 return _core_.InputStream_GetC(*args, **kwargs)
d55e5bfc
RD
1647
1648 def LastRead(*args, **kwargs):
1649 """LastRead(self) -> size_t"""
5b5c9bc7 1650 return _core_.InputStream_LastRead(*args, **kwargs)
d55e5bfc
RD
1651
1652 def CanRead(*args, **kwargs):
1653 """CanRead(self) -> bool"""
5b5c9bc7 1654 return _core_.InputStream_CanRead(*args, **kwargs)
d55e5bfc
RD
1655
1656 def Eof(*args, **kwargs):
1657 """Eof(self) -> bool"""
5b5c9bc7 1658 return _core_.InputStream_Eof(*args, **kwargs)
d55e5bfc
RD
1659
1660 def Ungetch(*args, **kwargs):
1661 """Ungetch(self, char c) -> bool"""
5b5c9bc7 1662 return _core_.InputStream_Ungetch(*args, **kwargs)
d55e5bfc
RD
1663
1664 def SeekI(*args, **kwargs):
5b5c9bc7
RD
1665 """SeekI(self, long pos, int mode=FromStart) -> long"""
1666 return _core_.InputStream_SeekI(*args, **kwargs)
d55e5bfc
RD
1667
1668 def TellI(*args, **kwargs):
1669 """TellI(self) -> long"""
5b5c9bc7 1670 return _core_.InputStream_TellI(*args, **kwargs)
d55e5bfc 1671
2131d850 1672_core_.InputStream_swigregister(InputStream)
5b5c9bc7
RD
1673DefaultPosition = cvar.DefaultPosition
1674DefaultSize = cvar.DefaultSize
d55e5bfc 1675
5b5c9bc7
RD
1676class OutputStream(object):
1677 """Proxy of C++ OutputStream class"""
1bd55598
RD
1678 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1679 def __init__(self): raise AttributeError, "No constructor defined"
1680 __repr__ = _swig_repr
d55e5bfc
RD
1681 def write(*args, **kwargs):
1682 """write(self, PyObject obj)"""
5b5c9bc7 1683 return _core_.OutputStream_write(*args, **kwargs)
d55e5bfc 1684
1bd55598
RD
1685 def LastWrite(*args, **kwargs):
1686 """LastWrite(self) -> size_t"""
1687 return _core_.OutputStream_LastWrite(*args, **kwargs)
d55e5bfc 1688
2131d850 1689_core_.OutputStream_swigregister(OutputStream)
d55e5bfc
RD
1690
1691#---------------------------------------------------------------------------
1692
5b5c9bc7
RD
1693class FSFile(Object):
1694 """Proxy of C++ FSFile class"""
1bd55598
RD
1695 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1696 __repr__ = _swig_repr
1697 def __init__(self, *args, **kwargs):
d55e5bfc 1698 """
5b5c9bc7
RD
1699 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
1700 DateTime modif) -> FSFile
d55e5bfc 1701 """
1bd55598 1702 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
e2950dbb 1703 self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem
4cf4100f 1704
1bd55598
RD
1705 __swig_destroy__ = _core_.delete_FSFile
1706 __del__ = lambda self : None;
d55e5bfc 1707 def GetStream(*args, **kwargs):
5b5c9bc7
RD
1708 """GetStream(self) -> InputStream"""
1709 return _core_.FSFile_GetStream(*args, **kwargs)
d55e5bfc
RD
1710
1711 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
1712 """GetMimeType(self) -> String"""
1713 return _core_.FSFile_GetMimeType(*args, **kwargs)
d55e5bfc
RD
1714
1715 def GetLocation(*args, **kwargs):
5b5c9bc7
RD
1716 """GetLocation(self) -> String"""
1717 return _core_.FSFile_GetLocation(*args, **kwargs)
d55e5bfc
RD
1718
1719 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1720 """GetAnchor(self) -> String"""
1721 return _core_.FSFile_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1722
1723 def GetModificationTime(*args, **kwargs):
5b5c9bc7
RD
1724 """GetModificationTime(self) -> DateTime"""
1725 return _core_.FSFile_GetModificationTime(*args, **kwargs)
d55e5bfc 1726
2131d850 1727_core_.FSFile_swigregister(FSFile)
d55e5bfc
RD
1728
1729class CPPFileSystemHandler(object):
36ed4f51 1730 """Proxy of C++ CPPFileSystemHandler class"""
1bd55598
RD
1731 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1732 def __init__(self): raise AttributeError, "No constructor defined"
1733 __repr__ = _swig_repr
50f151d7
RD
1734 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1735 __del__ = lambda self : None;
2131d850 1736_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d55e5bfc
RD
1737
1738class FileSystemHandler(CPPFileSystemHandler):
36ed4f51 1739 """Proxy of C++ FileSystemHandler class"""
1bd55598
RD
1740 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1741 __repr__ = _swig_repr
1742 def __init__(self, *args, **kwargs):
d55e5bfc 1743 """__init__(self) -> FileSystemHandler"""
1bd55598 1744 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
d55e5bfc
RD
1745 self._setCallbackInfo(self, FileSystemHandler)
1746
1747 def _setCallbackInfo(*args, **kwargs):
1748 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 1749 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
1750
1751 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1752 """CanOpen(self, String location) -> bool"""
1753 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1754
1755 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1756 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1757 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1758
1759 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1760 """FindFirst(self, String spec, int flags=0) -> String"""
1761 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1762
1763 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1764 """FindNext(self) -> String"""
1765 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
1766
1767 def GetProtocol(*args, **kwargs):
5b5c9bc7
RD
1768 """GetProtocol(self, String location) -> String"""
1769 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
d55e5bfc
RD
1770
1771 def GetLeftLocation(*args, **kwargs):
5b5c9bc7
RD
1772 """GetLeftLocation(self, String location) -> String"""
1773 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
d55e5bfc
RD
1774
1775 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
1776 """GetAnchor(self, String location) -> String"""
1777 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
d55e5bfc
RD
1778
1779 def GetRightLocation(*args, **kwargs):
5b5c9bc7
RD
1780 """GetRightLocation(self, String location) -> String"""
1781 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
d55e5bfc
RD
1782
1783 def GetMimeTypeFromExt(*args, **kwargs):
5b5c9bc7
RD
1784 """GetMimeTypeFromExt(self, String location) -> String"""
1785 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
d55e5bfc 1786
2131d850 1787_core_.FileSystemHandler_swigregister(FileSystemHandler)
d55e5bfc 1788
5b5c9bc7
RD
1789class FileSystem(Object):
1790 """Proxy of C++ FileSystem class"""
1bd55598
RD
1791 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1792 __repr__ = _swig_repr
1793 def __init__(self, *args, **kwargs):
5b5c9bc7 1794 """__init__(self) -> FileSystem"""
1bd55598
RD
1795 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1796 __swig_destroy__ = _core_.delete_FileSystem
1797 __del__ = lambda self : None;
d55e5bfc 1798 def ChangePathTo(*args, **kwargs):
5b5c9bc7
RD
1799 """ChangePathTo(self, String location, bool is_dir=False)"""
1800 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
d55e5bfc
RD
1801
1802 def GetPath(*args, **kwargs):
5b5c9bc7
RD
1803 """GetPath(self) -> String"""
1804 return _core_.FileSystem_GetPath(*args, **kwargs)
d55e5bfc
RD
1805
1806 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1807 """OpenFile(self, String location) -> FSFile"""
1808 return _core_.FileSystem_OpenFile(*args, **kwargs)
d55e5bfc
RD
1809
1810 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1811 """FindFirst(self, String spec, int flags=0) -> String"""
1812 return _core_.FileSystem_FindFirst(*args, **kwargs)
d55e5bfc
RD
1813
1814 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1815 """FindNext(self) -> String"""
1816 return _core_.FileSystem_FindNext(*args, **kwargs)
d55e5bfc
RD
1817
1818 def AddHandler(*args, **kwargs):
d6c14a4c 1819 """AddHandler(CPPFileSystemHandler handler)"""
5b5c9bc7 1820 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc
RD
1821
1822 AddHandler = staticmethod(AddHandler)
1823 def CleanUpHandlers(*args, **kwargs):
d6c14a4c 1824 """CleanUpHandlers()"""
5b5c9bc7 1825 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc
RD
1826
1827 CleanUpHandlers = staticmethod(CleanUpHandlers)
1828 def FileNameToURL(*args, **kwargs):
5b5c9bc7
RD
1829 """FileNameToURL(String filename) -> String"""
1830 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc
RD
1831
1832 FileNameToURL = staticmethod(FileNameToURL)
b411df4a 1833 def URLToFileName(*args, **kwargs):
5b5c9bc7
RD
1834 """URLToFileName(String url) -> String"""
1835 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a
RD
1836
1837 URLToFileName = staticmethod(URLToFileName)
2131d850 1838_core_.FileSystem_swigregister(FileSystem)
d55e5bfc 1839
5b5c9bc7 1840def FileSystem_AddHandler(*args, **kwargs):
1bd55598
RD
1841 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1842 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 1843
1bd55598
RD
1844def FileSystem_CleanUpHandlers(*args):
1845 """FileSystem_CleanUpHandlers()"""
1846 return _core_.FileSystem_CleanUpHandlers(*args)
d55e5bfc 1847
5b5c9bc7 1848def FileSystem_FileNameToURL(*args, **kwargs):
1bd55598
RD
1849 """FileSystem_FileNameToURL(String filename) -> String"""
1850 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 1851
5b5c9bc7 1852def FileSystem_URLToFileName(*args, **kwargs):
1bd55598
RD
1853 """FileSystem_URLToFileName(String url) -> String"""
1854 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a 1855
5b5c9bc7
RD
1856class InternetFSHandler(CPPFileSystemHandler):
1857 """Proxy of C++ InternetFSHandler class"""
1bd55598
RD
1858 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1859 __repr__ = _swig_repr
1860 def __init__(self, *args, **kwargs):
5b5c9bc7 1861 """__init__(self) -> InternetFSHandler"""
1bd55598 1862 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
d55e5bfc 1863 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1864 """CanOpen(self, String location) -> bool"""
1865 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1866
1867 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1868 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1869 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
d55e5bfc 1870
2131d850 1871_core_.InternetFSHandler_swigregister(InternetFSHandler)
d55e5bfc 1872
5b5c9bc7
RD
1873class ZipFSHandler(CPPFileSystemHandler):
1874 """Proxy of C++ ZipFSHandler class"""
1bd55598
RD
1875 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1876 __repr__ = _swig_repr
1877 def __init__(self, *args, **kwargs):
5b5c9bc7 1878 """__init__(self) -> ZipFSHandler"""
1bd55598 1879 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
d55e5bfc 1880 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1881 """CanOpen(self, String location) -> bool"""
1882 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1883
1884 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1885 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1886 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1887
1888 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1889 """FindFirst(self, String spec, int flags=0) -> String"""
1890 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1891
1892 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1893 """FindNext(self) -> String"""
1894 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
d55e5bfc 1895
2131d850 1896_core_.ZipFSHandler_swigregister(ZipFSHandler)
d55e5bfc
RD
1897
1898
1899def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1bd55598
RD
1900 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1901 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d55e5bfc
RD
1902
1903def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1bd55598
RD
1904 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1905 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d55e5bfc
RD
1906
1907def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1bd55598
RD
1908 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1909 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
b411df4a
RD
1910def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1911 """
1912 Add 'file' to the memory filesystem. The dataItem parameter can
1913 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1914 arbitrary data. If a bitmap or image is used then the imgType
1915 parameter should specify what kind of image file it should be
1916 written as, wx.BITMAP_TYPE_PNG, etc.
1917 """
1918 if isinstance(dataItem, wx.Image):
1919 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1920 elif isinstance(dataItem, wx.Bitmap):
1921 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1922 elif type(dataItem) == str:
1923 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1924 else:
1925 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc 1926
5b5c9bc7
RD
1927class MemoryFSHandler(CPPFileSystemHandler):
1928 """Proxy of C++ MemoryFSHandler class"""
1bd55598
RD
1929 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1930 __repr__ = _swig_repr
1931 def __init__(self, *args, **kwargs):
5b5c9bc7 1932 """__init__(self) -> MemoryFSHandler"""
1bd55598 1933 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
d55e5bfc 1934 def RemoveFile(*args, **kwargs):
5b5c9bc7
RD
1935 """RemoveFile(String filename)"""
1936 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc
RD
1937
1938 RemoveFile = staticmethod(RemoveFile)
1939 AddFile = staticmethod(MemoryFSHandler_AddFile)
1940 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
1941 """CanOpen(self, String location) -> bool"""
1942 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
1943
1944 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
1945 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
1946 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
1947
1948 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
1949 """FindFirst(self, String spec, int flags=0) -> String"""
1950 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
1951
1952 def FindNext(*args, **kwargs):
5b5c9bc7
RD
1953 """FindNext(self) -> String"""
1954 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
d55e5bfc 1955
2131d850 1956_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d55e5bfc 1957
5b5c9bc7 1958def MemoryFSHandler_RemoveFile(*args, **kwargs):
1bd55598
RD
1959 """MemoryFSHandler_RemoveFile(String filename)"""
1960 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 1961
5b5c9bc7
RD
1962IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1963IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1964IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d55e5bfc
RD
1965#---------------------------------------------------------------------------
1966
5b5c9bc7 1967class ImageHandler(Object):
27fb7603
RD
1968 """
1969 This is the base class for implementing image file loading/saving, and
1970 image creation from data. It is used within `wx.Image` and is not
1971 normally seen by the application.
1972 """
1bd55598
RD
1973 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1974 def __init__(self): raise AttributeError, "No constructor defined"
1975 __repr__ = _swig_repr
d55e5bfc 1976 def GetName(*args, **kwargs):
5b5c9bc7
RD
1977 """GetName(self) -> String"""
1978 return _core_.ImageHandler_GetName(*args, **kwargs)
d55e5bfc
RD
1979
1980 def GetExtension(*args, **kwargs):
5b5c9bc7
RD
1981 """GetExtension(self) -> String"""
1982 return _core_.ImageHandler_GetExtension(*args, **kwargs)
d55e5bfc
RD
1983
1984 def GetType(*args, **kwargs):
1985 """GetType(self) -> long"""
5b5c9bc7 1986 return _core_.ImageHandler_GetType(*args, **kwargs)
d55e5bfc
RD
1987
1988 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
1989 """GetMimeType(self) -> String"""
1990 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
d55e5bfc
RD
1991
1992 def CanRead(*args, **kwargs):
5b5c9bc7
RD
1993 """CanRead(self, String name) -> bool"""
1994 return _core_.ImageHandler_CanRead(*args, **kwargs)
d55e5bfc
RD
1995
1996 def SetName(*args, **kwargs):
5b5c9bc7
RD
1997 """SetName(self, String name)"""
1998 return _core_.ImageHandler_SetName(*args, **kwargs)
d55e5bfc
RD
1999
2000 def SetExtension(*args, **kwargs):
5b5c9bc7
RD
2001 """SetExtension(self, String extension)"""
2002 return _core_.ImageHandler_SetExtension(*args, **kwargs)
d55e5bfc
RD
2003
2004 def SetType(*args, **kwargs):
2005 """SetType(self, long type)"""
5b5c9bc7 2006 return _core_.ImageHandler_SetType(*args, **kwargs)
d55e5bfc
RD
2007
2008 def SetMimeType(*args, **kwargs):
5b5c9bc7
RD
2009 """SetMimeType(self, String mimetype)"""
2010 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
d55e5bfc 2011
2131d850 2012_core_.ImageHandler_swigregister(ImageHandler)
d55e5bfc 2013
943e8dfd
RD
2014class PyImageHandler(ImageHandler):
2015 """
2016 This is the base class for implementing image file loading/saving, and
2017 image creation from data, all written in Python. To create a custom
2018 image handler derive a new class from wx.PyImageHandler and provide
2019 the following methods::
2020
2021 def DoCanRead(self, stream) --> bool
2022 '''Check if this handler can read the image on the stream'''
2023
2024 def LoadFile(self, image, stream, verbose, index) --> bool
2025 '''Load image data from the stream and load it into image.'''
2026
2027 def SaveFile(self, image, stream, verbose) --> bool
2028 '''Save the iamge data in image to the stream using
2029 this handler's image file format.'''
2030
2031 def GetImageCount(self, stream) --> int
2032 '''If this image format can hold more than one image,
2033 how many does the image on the stream have?'''
2034
2035 To activate your handler create an instance of it and pass it to
2036 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2037 `SetExtension` from your constructor.
2038
2039 """
1bd55598
RD
2040 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2041 __repr__ = _swig_repr
2042 def __init__(self, *args, **kwargs):
943e8dfd
RD
2043 """
2044 __init__(self) -> PyImageHandler
2045
2046 This is the base class for implementing image file loading/saving, and
2047 image creation from data, all written in Python. To create a custom
2048 image handler derive a new class from wx.PyImageHandler and provide
2049 the following methods::
2050
2051 def DoCanRead(self, stream) --> bool
2052 '''Check if this handler can read the image on the stream'''
2053
2054 def LoadFile(self, image, stream, verbose, index) --> bool
2055 '''Load image data from the stream and load it into image.'''
2056
2057 def SaveFile(self, image, stream, verbose) --> bool
2058 '''Save the iamge data in image to the stream using
2059 this handler's image file format.'''
2060
2061 def GetImageCount(self, stream) --> int
2062 '''If this image format can hold more than one image,
2063 how many does the image on the stream have?'''
2064
2065 To activate your handler create an instance of it and pass it to
2066 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2067 `SetExtension` from your constructor.
2068
2069 """
1bd55598 2070 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
RD
2071 self._SetSelf(self)
2072
2073 def _SetSelf(*args, **kwargs):
2074 """_SetSelf(self, PyObject self)"""
2075 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2076
2131d850 2077_core_.PyImageHandler_swigregister(PyImageHandler)
943e8dfd 2078
5b5c9bc7
RD
2079class ImageHistogram(object):
2080 """Proxy of C++ ImageHistogram class"""
1bd55598
RD
2081 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2082 __repr__ = _swig_repr
2083 def __init__(self, *args, **kwargs):
5b5c9bc7 2084 """__init__(self) -> ImageHistogram"""
1bd55598 2085 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
d55e5bfc
RD
2086 def MakeKey(*args, **kwargs):
2087 """
7a27cf7c 2088 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2089
2090 Get the key in the histogram for the given RGB values
2091 """
5b5c9bc7 2092 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc
RD
2093
2094 MakeKey = staticmethod(MakeKey)
2095 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2096 """
2097 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2098
2099 Find first colour that is not used in the image and has higher RGB
2100 values than startR, startG, startB. Returns a tuple consisting of a
2101 success flag and rgb values.
2102 """
5b5c9bc7 2103 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2104
f1cbd8fa
RD
2105 def GetCount(*args, **kwargs):
2106 """
2107 GetCount(self, unsigned long key) -> unsigned long
2108
2109 Returns the pixel count for the given key. Use `MakeKey` to create a
2110 key value from a RGB tripple.
2111 """
5b5c9bc7 2112 return _core_.ImageHistogram_GetCount(*args, **kwargs)
f1cbd8fa
RD
2113
2114 def GetCountRGB(*args, **kwargs):
2115 """
7a27cf7c 2116 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2117
2118 Returns the pixel count for the given RGB values.
2119 """
5b5c9bc7 2120 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
f1cbd8fa
RD
2121
2122 def GetCountColour(*args, **kwargs):
2123 """
5b5c9bc7 2124 GetCountColour(self, Colour colour) -> unsigned long
f1cbd8fa
RD
2125
2126 Returns the pixel count for the given `wx.Colour` value.
2127 """
5b5c9bc7 2128 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
f1cbd8fa 2129
2131d850 2130_core_.ImageHistogram_swigregister(ImageHistogram)
d55e5bfc 2131
5b5c9bc7 2132def ImageHistogram_MakeKey(*args, **kwargs):
1bd55598 2133 """
7a27cf7c 2134 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2135
2136 Get the key in the histogram for the given RGB values
2137 """
1bd55598 2138 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2139
943e8dfd
RD
2140class Image_RGBValue(object):
2141 """
2142 An object that contains values for red, green and blue which represent
2143 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2144 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2145 color space.
2146 """
1bd55598
RD
2147 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2148 __repr__ = _swig_repr
2149 def __init__(self, *args, **kwargs):
943e8dfd
RD
2150 """
2151 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2152
2153 Constructor.
2154 """
1bd55598 2155 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
2156 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2157 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2158 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2159_core_.Image_RGBValue_swigregister(Image_RGBValue)
943e8dfd
RD
2160
2161class Image_HSVValue(object):
2162 """
2163 An object that contains values for hue, saturation and value which
2164 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2165 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2166 color space.
2167 """
1bd55598
RD
2168 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2169 __repr__ = _swig_repr
2170 def __init__(self, *args, **kwargs):
943e8dfd
RD
2171 """
2172 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2173
2174 Constructor.
2175 """
1bd55598 2176 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
2177 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2178 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2179 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2180_core_.Image_HSVValue_swigregister(Image_HSVValue)
943e8dfd 2181
5b5c9bc7 2182class Image(Object):
7a27cf7c
RD
2183 """
2184 A platform-independent image class. An image can be created from
2185 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2186 variety of formats. Functions are available to set and get image
2187 bits, so it can be used for basic image manipulation.
2188
2189 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2190 platform-specific `wx.Bitmap` object must be created from it using the
2191 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2192 device context, using `wx.DC.DrawBitmap`.
2193
2194 One colour value of the image may be used as a mask colour which will
2195 lead to the automatic creation of a `wx.Mask` object associated to the
2196 bitmap object.
2197
2198 wx.Image supports alpha channel data, that is in addition to a byte
2199 for the red, green and blue colour components for each pixel it also
2200 stores a byte representing the pixel opacity. An alpha value of 0
2201 corresponds to a transparent pixel (null opacity) while a value of 255
2202 means that the pixel is 100% opaque.
2203
2204 Unlike RGB data, not all images have an alpha channel and before using
2205 `GetAlpha` you should check if this image contains an alpha channel
2206 with `HasAlpha`. Note that currently only images loaded from PNG files
2207 with transparency information will have an alpha channel.
2208 """
1bd55598
RD
2209 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2210 __repr__ = _swig_repr
2211 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2212 """
2213 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2214
2215 Loads an image from a file.
2216 """
1bd55598
RD
2217 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2218 __swig_destroy__ = _core_.delete_Image
2219 __del__ = lambda self : None;
d55e5bfc 2220 def Create(*args, **kwargs):
7a27cf7c
RD
2221 """
2222 Create(self, int width, int height, bool clear=True)
2223
2224 Creates a fresh image. If clear is ``True``, the new image will be
2225 initialized to black. Otherwise, the image data will be uninitialized.
2226 """
5b5c9bc7 2227 return _core_.Image_Create(*args, **kwargs)
d55e5bfc
RD
2228
2229 def Destroy(*args, **kwargs):
2230 """
2231 Destroy(self)
2232
7a27cf7c 2233 Destroys the image data.
d55e5bfc 2234 """
7e08d4ef
RD
2235 val = _core_.Image_Destroy(*args, **kwargs)
2236 args[0].thisown = 0
2237 return val
d55e5bfc
RD
2238
2239 def Scale(*args, **kwargs):
7a27cf7c
RD
2240 """
2241 Scale(self, int width, int height) -> Image
2242
2243 Returns a scaled version of the image. This is also useful for scaling
2244 bitmaps in general as the only other way to scale bitmaps is to blit a
2245 `wx.MemoryDC` into another `wx.MemoryDC`.
2246 """
5b5c9bc7 2247 return _core_.Image_Scale(*args, **kwargs)
d55e5bfc
RD
2248
2249 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2250 """
2251 ShrinkBy(self, int xFactor, int yFactor) -> Image
2252
2253 Return a version of the image scaled smaller by the given factors.
2254 """
5b5c9bc7 2255 return _core_.Image_ShrinkBy(*args, **kwargs)
d55e5bfc
RD
2256
2257 def Rescale(*args, **kwargs):
7a27cf7c
RD
2258 """
2259 Rescale(self, int width, int height) -> Image
2260
2261 Changes the size of the image in-place by scaling it: after a call to
2262 this function, the image will have the given width and height.
2263
2264 Returns the (modified) image itself.
2265 """
5b5c9bc7 2266 return _core_.Image_Rescale(*args, **kwargs)
d55e5bfc 2267
aff4cc5c 2268 def Resize(*args, **kwargs):
7a27cf7c
RD
2269 """
2270 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2271
2272 Changes the size of the image in-place without scaling it, by adding
2273 either a border with the given colour or cropping as necessary. The
2274 image is pasted into a new image with the given size and background
2275 colour at the position pos relative to the upper left of the new
2276 image. If red = green = blue = -1 then use either the current mask
2277 colour if set or find, use, and set a suitable mask colour for any
2278 newly exposed areas.
2279
2280 Returns the (modified) image itself.
2281 """
5b5c9bc7 2282 return _core_.Image_Resize(*args, **kwargs)
aff4cc5c 2283
d55e5bfc 2284 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2285 """
2286 SetRGB(self, int x, int y, byte r, byte g, byte b)
2287
2288 Sets the pixel at the given coordinate. This routine performs
2289 bounds-checks for the coordinate so it can be considered a safe way to
2290 manipulate the data, but in some cases this might be too slow so that
2291 the data will have to be set directly. In that case you will have to
2292 get access to the image data using the `GetData` method.
2293 """
5b5c9bc7 2294 return _core_.Image_SetRGB(*args, **kwargs)
d55e5bfc 2295
aff4cc5c 2296 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2297 """
2298 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2299
2300 Sets the colour of the pixels within the given rectangle. This routine
2301 performs bounds-checks for the rectangle so it can be considered a
2302 safe way to manipulate the data.
2303 """
5b5c9bc7 2304 return _core_.Image_SetRGBRect(*args, **kwargs)
aff4cc5c 2305
d55e5bfc 2306 def GetRed(*args, **kwargs):
7a27cf7c
RD
2307 """
2308 GetRed(self, int x, int y) -> byte
2309
2310 Returns the red intensity at the given coordinate.
2311 """
5b5c9bc7 2312 return _core_.Image_GetRed(*args, **kwargs)
d55e5bfc
RD
2313
2314 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2315 """
2316 GetGreen(self, int x, int y) -> byte
2317
2318 Returns the green intensity at the given coordinate.
2319 """
5b5c9bc7 2320 return _core_.Image_GetGreen(*args, **kwargs)
d55e5bfc
RD
2321
2322 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2323 """
2324 GetBlue(self, int x, int y) -> byte
2325
2326 Returns the blue intensity at the given coordinate.
2327 """
5b5c9bc7 2328 return _core_.Image_GetBlue(*args, **kwargs)
d55e5bfc
RD
2329
2330 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2331 """
2332 SetAlpha(self, int x, int y, byte alpha)
2333
2334 Sets the alpha value for the given pixel. This function should only be
2335 called if the image has alpha channel data, use `HasAlpha` to check
2336 for this.
2337 """
5b5c9bc7 2338 return _core_.Image_SetAlpha(*args, **kwargs)
d55e5bfc
RD
2339
2340 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2341 """
2342 GetAlpha(self, int x, int y) -> byte
2343
2344 Returns the alpha value for the given pixel. This function may only be
2345 called for the images with alpha channel, use `HasAlpha` to check for
2346 this.
2347
2348 The returned value is the *opacity* of the image, i.e. the value of 0
2349 corresponds to the fully transparent pixels while the value of 255 to
2350 the fully opaque pixels.
2351 """
5b5c9bc7 2352 return _core_.Image_GetAlpha(*args, **kwargs)
d55e5bfc
RD
2353
2354 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2355 """
2356 HasAlpha(self) -> bool
2357
2358 Returns true if this image has alpha channel, false otherwise.
2359 """
5b5c9bc7 2360 return _core_.Image_HasAlpha(*args, **kwargs)
d55e5bfc 2361
68350608
RD
2362 def InitAlpha(*args, **kwargs):
2363 """
2364 InitAlpha(self)
2365
2366 Initializes the image alpha channel data. It is an error to call it if
2367 the image already has alpha data. If it doesn't, alpha data will be by
2368 default initialized to all pixels being fully opaque. But if the image
2369 has a a mask colour, all mask pixels will be completely transparent.
2370 """
5b5c9bc7
RD
2371 return _core_.Image_InitAlpha(*args, **kwargs)
2372
2373 def IsTransparent(*args, **kwargs):
2374 """
7a27cf7c 2375 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
5b5c9bc7 2376
7a27cf7c
RD
2377 Returns ``True`` if this pixel is masked or has an alpha value less
2378 than the spcified threshold.
5b5c9bc7
RD
2379 """
2380 return _core_.Image_IsTransparent(*args, **kwargs)
68350608 2381
d55e5bfc 2382 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2383 """
2384 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2385
2386 Find first colour that is not used in the image and has higher RGB
2387 values than startR, startG, startB. Returns a tuple consisting of a
2388 success flag and rgb values.
2389 """
5b5c9bc7 2390 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2391
4cf4100f
RD
2392 def ConvertAlphaToMask(*args, **kwargs):
2393 """
5b5c9bc7 2394 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2395
7a27cf7c
RD
2396 If the image has alpha channel, this method converts it to mask. All
2397 pixels with alpha value less than ``threshold`` are replaced with the
2398 mask colour and the alpha channel is removed. The mask colour is
2399 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2400
2401 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2402 nothing.
2403 """
5b5c9bc7 2404 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
4cf4100f 2405
8fb0e70a
RD
2406 def ConvertColourToAlpha(*args, **kwargs):
2407 """
7a27cf7c 2408 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2409
2410 This method converts an image where the original alpha information is
2411 only available as a shades of a colour (actually shades of grey)
2412 typically when you draw anti-aliased text into a bitmap. The DC
2413 drawing routines draw grey values on the black background although
2414 they actually mean to draw white with differnt alpha values. This
2415 method reverses it, assuming a black (!) background and white text.
2416 The method will then fill up the whole image with the colour given.
2417 """
5b5c9bc7 2418 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
8fb0e70a 2419
d55e5bfc 2420 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2421 """
2422 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2423
2424 Sets the image's mask so that the pixels that have RGB value of
2425 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2426 by first finding an unused colour in the image, setting this colour as
2427 the mask colour and then using this colour to draw all pixels in the
2428 image who corresponding pixel in mask has given RGB value.
2429
2430 Returns ``False`` if ``mask`` does not have same dimensions as the
2431 image or if there is no unused colour left. Returns ``True`` if the
2432 mask was successfully applied.
2433
2434 Note that this method involves computing the histogram, which is
2435 computationally intensive operation.
2436 """
5b5c9bc7 2437 return _core_.Image_SetMaskFromImage(*args, **kwargs)
d55e5bfc
RD
2438
2439 def CanRead(*args, **kwargs):
7a27cf7c
RD
2440 """
2441 CanRead(String filename) -> bool
2442
2443 Returns True if the image handlers can read this file.
2444 """
5b5c9bc7 2445 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
RD
2446
2447 CanRead = staticmethod(CanRead)
2448 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2449 """
2450 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2451
2452 If the image file contains more than one image and the image handler
2453 is capable of retrieving these individually, this function will return
2454 the number of available images.
2455 """
5b5c9bc7 2456 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
RD
2457
2458 GetImageCount = staticmethod(GetImageCount)
2459 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2460 """
2461 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2462
2463 Loads an image from a file. If no handler type is provided, the
2464 library will try to autodetect the format.
2465 """
5b5c9bc7 2466 return _core_.Image_LoadFile(*args, **kwargs)
d55e5bfc
RD
2467
2468 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2469 """
2470 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2471
2472 Loads an image from a file, specifying the image type with a MIME type
2473 string.
2474 """
5b5c9bc7 2475 return _core_.Image_LoadMimeFile(*args, **kwargs)
d55e5bfc
RD
2476
2477 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2478 """
2479 SaveFile(self, String name, int type) -> bool
2480
2481 Saves an image in the named file.
2482 """
5b5c9bc7 2483 return _core_.Image_SaveFile(*args, **kwargs)
d55e5bfc
RD
2484
2485 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2486 """
2487 SaveMimeFile(self, String name, String mimetype) -> bool
2488
2489 Saves an image in the named file.
2490 """
5b5c9bc7 2491 return _core_.Image_SaveMimeFile(*args, **kwargs)
d55e5bfc
RD
2492
2493 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2494 """
2495 CanReadStream(InputStream stream) -> bool
2496
2497 Returns True if the image handlers can read an image file from the
2498 data currently on the input stream, or a readable Python file-like
2499 object.
2500 """
5b5c9bc7 2501 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
RD
2502
2503 CanReadStream = staticmethod(CanReadStream)
2504 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2505 """
2506 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2507
2508 Loads an image from an input stream or a readable Python file-like
2509 object. If no handler type is provided, the library will try to
2510 autodetect the format.
2511 """
5b5c9bc7 2512 return _core_.Image_LoadStream(*args, **kwargs)
d55e5bfc
RD
2513
2514 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2515 """
2516 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2517
2518 Loads an image from an input stream or a readable Python file-like
2519 object, using a MIME type string to specify the image file format.
2520 """
5b5c9bc7 2521 return _core_.Image_LoadMimeStream(*args, **kwargs)
d55e5bfc
RD
2522
2523 def Ok(*args, **kwargs):
7a27cf7c
RD
2524 """
2525 Ok(self) -> bool
2526
2527 Returns true if image data is present.
2528 """
5b5c9bc7 2529 return _core_.Image_Ok(*args, **kwargs)
d55e5bfc
RD
2530
2531 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2532 """
2533 GetWidth(self) -> int
2534
2535 Gets the width of the image in pixels.
2536 """
5b5c9bc7 2537 return _core_.Image_GetWidth(*args, **kwargs)
d55e5bfc
RD
2538
2539 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2540 """
2541 GetHeight(self) -> int
2542
2543 Gets the height of the image in pixels.
2544 """
5b5c9bc7 2545 return _core_.Image_GetHeight(*args, **kwargs)
d55e5bfc
RD
2546
2547 def GetSize(*args, **kwargs):
7a27cf7c
RD
2548 """
2549 GetSize(self) -> Size
2550
2551 Returns the size of the image in pixels.
2552 """
5b5c9bc7 2553 return _core_.Image_GetSize(*args, **kwargs)
d55e5bfc
RD
2554
2555 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2556 """
2557 GetSubImage(self, Rect rect) -> Image
2558
2559 Returns a sub image of the current one as long as the rect belongs
2560 entirely to the image.
2561 """
5b5c9bc7 2562 return _core_.Image_GetSubImage(*args, **kwargs)
d55e5bfc 2563
aff4cc5c 2564 def Size(*args, **kwargs):
7a27cf7c
RD
2565 """
2566 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2567
2568 Returns a resized version of this image without scaling it by adding
2569 either a border with the given colour or cropping as necessary. The
2570 image is pasted into a new image with the given size and background
2571 colour at the position ``pos`` relative to the upper left of the new
2572 image. If red = green = blue = -1 then use either the current mask
2573 colour if set or find, use, and set a suitable mask colour for any
2574 newly exposed areas.
2575 """
5b5c9bc7 2576 return _core_.Image_Size(*args, **kwargs)
aff4cc5c 2577
d55e5bfc 2578 def Copy(*args, **kwargs):
7a27cf7c
RD
2579 """
2580 Copy(self) -> Image
2581
2582 Returns an identical copy of the image.
2583 """
5b5c9bc7 2584 return _core_.Image_Copy(*args, **kwargs)
d55e5bfc
RD
2585
2586 def Paste(*args, **kwargs):
7a27cf7c
RD
2587 """
2588 Paste(self, Image image, int x, int y)
2589
2590 Pastes ``image`` into this instance and takes care of the mask colour
2591 and any out of bounds problems.
2592 """
5b5c9bc7 2593 return _core_.Image_Paste(*args, **kwargs)
d55e5bfc
RD
2594
2595 def GetData(*args, **kwargs):
bb2ef2cc
RD
2596 """
2597 GetData(self) -> PyObject
2598
2599 Returns a string containing a copy of the RGB bytes of the image.
2600 """
5b5c9bc7 2601 return _core_.Image_GetData(*args, **kwargs)
d55e5bfc
RD
2602
2603 def SetData(*args, **kwargs):
bb2ef2cc
RD
2604 """
2605 SetData(self, buffer data)
2606
2607 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2608 either a string or a buffer object holding the data and the length of
2609 the data must be width*height*3.
2610 """
5b5c9bc7 2611 return _core_.Image_SetData(*args, **kwargs)
d55e5bfc
RD
2612
2613 def GetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2614 """
2615 GetDataBuffer(self) -> PyObject
2616
2617 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2618 image data buffer inside the wx.Image. You need to ensure that you do
2619 not use this buffer object after the image has been destroyed.
bb2ef2cc 2620 """
5b5c9bc7 2621 return _core_.Image_GetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2622
2623 def SetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
2624 """
2625 SetDataBuffer(self, buffer data)
2626
2627 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2628 object. This can save making an extra copy of the data but you must
2629 ensure that the buffer object lives longer than the wx.Image does.
bb2ef2cc 2630 """
5b5c9bc7 2631 return _core_.Image_SetDataBuffer(*args, **kwargs)
d55e5bfc
RD
2632
2633 def GetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2634 """
2635 GetAlphaData(self) -> PyObject
2636
2637 Returns a string containing a copy of the alpha bytes of the image.
2638 """
5b5c9bc7 2639 return _core_.Image_GetAlphaData(*args, **kwargs)
d55e5bfc
RD
2640
2641 def SetAlphaData(*args, **kwargs):
bb2ef2cc
RD
2642 """
2643 SetAlphaData(self, buffer alpha)
2644
2645 Resets the Image's alpha data from a buffer of bytes. Accepts either
2646 a string or a buffer object holding the data and the length of the
2647 data must be width*height.
2648 """
5b5c9bc7 2649 return _core_.Image_SetAlphaData(*args, **kwargs)
d55e5bfc
RD
2650
2651 def GetAlphaBuffer(*args, **kwargs):
2652 """GetAlphaBuffer(self) -> PyObject"""
5b5c9bc7 2653 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2654
2655 def SetAlphaBuffer(*args, **kwargs):
bb2ef2cc 2656 """SetAlphaBuffer(self, buffer alpha)"""
5b5c9bc7 2657 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
2658
2659 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2660 """
2661 SetMaskColour(self, byte r, byte g, byte b)
2662
2663 Sets the mask colour for this image (and tells the image to use the
2664 mask).
2665 """
5b5c9bc7 2666 return _core_.Image_SetMaskColour(*args, **kwargs)
d55e5bfc 2667
aff4cc5c
RD
2668 def GetOrFindMaskColour(*args, **kwargs):
2669 """
2670 GetOrFindMaskColour() -> (r,g,b)
2671
2672 Get the current mask colour or find a suitable colour.
2673 """
5b5c9bc7 2674 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
aff4cc5c 2675
d55e5bfc 2676 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2677 """
2678 GetMaskRed(self) -> byte
2679
2680 Gets the red component of the mask colour.
2681 """
5b5c9bc7 2682 return _core_.Image_GetMaskRed(*args, **kwargs)
d55e5bfc
RD
2683
2684 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2685 """
2686 GetMaskGreen(self) -> byte
2687
2688 Gets the green component of the mask colour.
2689 """
5b5c9bc7 2690 return _core_.Image_GetMaskGreen(*args, **kwargs)
d55e5bfc
RD
2691
2692 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2693 """
2694 GetMaskBlue(self) -> byte
2695
2696 Gets the blue component of the mask colour.
2697 """
5b5c9bc7 2698 return _core_.Image_GetMaskBlue(*args, **kwargs)
d55e5bfc
RD
2699
2700 def SetMask(*args, **kwargs):
7a27cf7c
RD
2701 """
2702 SetMask(self, bool mask=True)
2703
2704 Specifies whether there is a mask or not. The area of the mask is
2705 determined by the current mask colour.
2706 """
5b5c9bc7 2707 return _core_.Image_SetMask(*args, **kwargs)
d55e5bfc
RD
2708
2709 def HasMask(*args, **kwargs):
7a27cf7c
RD
2710 """
2711 HasMask(self) -> bool
2712
2713 Returns ``True`` if there is a mask active, ``False`` otherwise.
2714 """
5b5c9bc7 2715 return _core_.Image_HasMask(*args, **kwargs)
d55e5bfc
RD
2716
2717 def Rotate(*args, **kwargs):
2718 """
5b5c9bc7
RD
2719 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
2720 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2721
2722 Rotates the image about the given point, by ``angle`` radians. Passing
2723 ``True`` to ``interpolating`` results in better image quality, but is
2724 slower. If the image has a mask, then the mask colour is used for the
2725 uncovered pixels in the rotated image background. Otherwise, black
2726 will be used as the fill colour.
2727
2728 Returns the rotated image, leaving this image intact.
d55e5bfc 2729 """
5b5c9bc7 2730 return _core_.Image_Rotate(*args, **kwargs)
d55e5bfc
RD
2731
2732 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2733 """
2734 Rotate90(self, bool clockwise=True) -> Image
2735
2736 Returns a copy of the image rotated 90 degrees in the direction
2737 indicated by ``clockwise``.
2738 """
5b5c9bc7 2739 return _core_.Image_Rotate90(*args, **kwargs)
d55e5bfc
RD
2740
2741 def Mirror(*args, **kwargs):
7a27cf7c
RD
2742 """
2743 Mirror(self, bool horizontally=True) -> Image
2744
2745 Returns a mirrored copy of the image. The parameter ``horizontally``
2746 indicates the orientation.
2747 """
5b5c9bc7 2748 return _core_.Image_Mirror(*args, **kwargs)
d55e5bfc
RD
2749
2750 def Replace(*args, **kwargs):
2751 """
7a27cf7c
RD
2752 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2753
2754 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2755 ``(r2,g2,b2)``.
d55e5bfc 2756 """
5b5c9bc7 2757 return _core_.Image_Replace(*args, **kwargs)
d55e5bfc 2758
32fe5131
RD
2759 def ConvertToGreyscale(*args, **kwargs):
2760 """
2761 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2762
2763 Convert to greyscale image. Uses the luminance component (Y) of the
2764 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2765 defaults to ITU-T BT.601
2766 """
2767 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2768
d55e5bfc 2769 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2770 """
2771 ConvertToMono(self, byte r, byte g, byte b) -> Image
2772
2773 Returns monochromatic version of the image. The returned image has
2774 white colour where the original has ``(r,g,b)`` colour and black
2775 colour everywhere else.
2776 """
5b5c9bc7 2777 return _core_.Image_ConvertToMono(*args, **kwargs)
d55e5bfc
RD
2778
2779 def SetOption(*args, **kwargs):
7a27cf7c
RD
2780 """
2781 SetOption(self, String name, String value)
2782
2783 Sets an image handler defined option. For example, when saving as a
2784 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2785 number between 0 and 100 (0 is terrible, 100 is very good).
2786 """
5b5c9bc7 2787 return _core_.Image_SetOption(*args, **kwargs)
d55e5bfc
RD
2788
2789 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2790 """
2791 SetOptionInt(self, String name, int value)
2792
2793 Sets an image option as an integer.
2794 """
5b5c9bc7 2795 return _core_.Image_SetOptionInt(*args, **kwargs)
d55e5bfc
RD
2796
2797 def GetOption(*args, **kwargs):
7a27cf7c
RD
2798 """
2799 GetOption(self, String name) -> String
2800
2801 Gets the value of an image handler option.
2802 """
5b5c9bc7 2803 return _core_.Image_GetOption(*args, **kwargs)
d55e5bfc
RD
2804
2805 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2806 """
2807 GetOptionInt(self, String name) -> int
2808
2809 Gets the value of an image handler option as an integer. If the given
2810 option is not present, the function returns 0.
2811 """
5b5c9bc7 2812 return _core_.Image_GetOptionInt(*args, **kwargs)
d55e5bfc
RD
2813
2814 def HasOption(*args, **kwargs):
7a27cf7c
RD
2815 """
2816 HasOption(self, String name) -> bool
2817
2818 Returns true if the given option is present.
2819 """
5b5c9bc7 2820 return _core_.Image_HasOption(*args, **kwargs)
d55e5bfc
RD
2821
2822 def CountColours(*args, **kwargs):
2823 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
5b5c9bc7 2824 return _core_.Image_CountColours(*args, **kwargs)
d55e5bfc
RD
2825
2826 def ComputeHistogram(*args, **kwargs):
5b5c9bc7
RD
2827 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
2828 return _core_.Image_ComputeHistogram(*args, **kwargs)
d55e5bfc
RD
2829
2830 def AddHandler(*args, **kwargs):
5b5c9bc7
RD
2831 """AddHandler(ImageHandler handler)"""
2832 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
2833
2834 AddHandler = staticmethod(AddHandler)
2835 def InsertHandler(*args, **kwargs):
5b5c9bc7
RD
2836 """InsertHandler(ImageHandler handler)"""
2837 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
2838
2839 InsertHandler = staticmethod(InsertHandler)
2840 def RemoveHandler(*args, **kwargs):
5b5c9bc7
RD
2841 """RemoveHandler(String name) -> bool"""
2842 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc
RD
2843
2844 RemoveHandler = staticmethod(RemoveHandler)
1bd55598
RD
2845 def GetHandlers(*args, **kwargs):
2846 """GetHandlers() -> PyObject"""
2847 return _core_.Image_GetHandlers(*args, **kwargs)
2848
2849 GetHandlers = staticmethod(GetHandlers)
d55e5bfc 2850 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2851 """
2852 GetImageExtWildcard() -> String
2853
2854 Iterates all registered wxImageHandler objects, and returns a string
2855 containing file extension masks suitable for passing to file open/save
2856 dialog boxes.
2857 """
5b5c9bc7 2858 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc
RD
2859
2860 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2861 def ConvertToBitmap(*args, **kwargs):
5b5c9bc7
RD
2862 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
2863 return _core_.Image_ConvertToBitmap(*args, **kwargs)
d55e5bfc
RD
2864
2865 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 2866 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
5b5c9bc7 2867 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
d55e5bfc 2868
943e8dfd
RD
2869 def RotateHue(*args, **kwargs):
2870 """
2871 RotateHue(self, double angle)
2872
2873 Rotates the hue of each pixel of the image. Hue is a double in the
2874 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2875 """
2876 return _core_.Image_RotateHue(*args, **kwargs)
2877
2878 def RGBtoHSV(*args, **kwargs):
2879 """
2880 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2881
2882 Converts a color in RGB color space to HSV color space.
2883 """
2884 return _core_.Image_RGBtoHSV(*args, **kwargs)
2885
2886 RGBtoHSV = staticmethod(RGBtoHSV)
2887 def HSVtoRGB(*args, **kwargs):
2888 """
2889 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2890
2891 Converts a color in HSV color space to RGB color space.
2892 """
2893 return _core_.Image_HSVtoRGB(*args, **kwargs)
2894
2895 HSVtoRGB = staticmethod(HSVtoRGB)
d55e5bfc 2896 def __nonzero__(self): return self.Ok()
2131d850 2897_core_.Image_swigregister(Image)
d55e5bfc
RD
2898
2899def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
2900 """
2901 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2902
2903 Loads an image from a file, using a MIME type string (such as
2904 'image/jpeg') to specify image type.
2905 """
5b5c9bc7 2906 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
2907 return val
2908
2909def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
2910 """
2911 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2912
2913 Loads an image from an input stream, or any readable Python file-like
2914 object.
2915 """
5b5c9bc7 2916 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
2917 return val
2918
2919def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
2920 """
2921 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2922
2923 Loads an image from an input stream, or any readable Python file-like
2924 object, specifying the image format with a MIME type string.
2925 """
5b5c9bc7 2926 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
2927 return val
2928
d6c14a4c 2929def EmptyImage(*args, **kwargs):
bb2ef2cc 2930 """
5b5c9bc7 2931 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
bb2ef2cc
RD
2932
2933 Construct an empty image of a given size, optionally setting all
2934 pixels to black.
2935 """
5b5c9bc7 2936 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
2937 return val
2938
2939def ImageFromBitmap(*args, **kwargs):
bb2ef2cc 2940 """
5b5c9bc7 2941 ImageFromBitmap(Bitmap bitmap) -> Image
bb2ef2cc
RD
2942
2943 Construct an Image from a `wx.Bitmap`.
2944 """
5b5c9bc7 2945 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
2946 return val
2947
2948def ImageFromData(*args, **kwargs):
bb2ef2cc 2949 """
5b5c9bc7 2950 ImageFromData(int width, int height, buffer data) -> Image
bb2ef2cc
RD
2951
2952 Construct an Image from a buffer of RGB bytes. Accepts either a
2953 string or a buffer object holding the data and the length of the data
2954 must be width*height*3.
2955 """
5b5c9bc7 2956 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
2957 return val
2958
03e46024 2959def ImageFromDataWithAlpha(*args, **kwargs):
bb2ef2cc 2960 """
5b5c9bc7 2961 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
bb2ef2cc
RD
2962
2963 Construct an Image from a buffer of RGB bytes with an Alpha channel.
2964 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
2965 length of the data must be width*height*3 bytes, and the length of the
2966 alpha data must be width*height bytes.
bb2ef2cc 2967 """
5b5c9bc7 2968 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
03e46024
RD
2969 return val
2970
5b5c9bc7 2971def Image_CanRead(*args, **kwargs):
1bd55598 2972 """
7a27cf7c
RD
2973 Image_CanRead(String filename) -> bool
2974
2975 Returns True if the image handlers can read this file.
2976 """
1bd55598 2977 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc 2978
5b5c9bc7 2979def Image_GetImageCount(*args, **kwargs):
1bd55598 2980 """
7a27cf7c
RD
2981 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2982
2983 If the image file contains more than one image and the image handler
2984 is capable of retrieving these individually, this function will return
2985 the number of available images.
2986 """
1bd55598 2987 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc 2988
5b5c9bc7 2989def Image_CanReadStream(*args, **kwargs):
1bd55598 2990 """
7a27cf7c
RD
2991 Image_CanReadStream(InputStream stream) -> bool
2992
2993 Returns True if the image handlers can read an image file from the
2994 data currently on the input stream, or a readable Python file-like
2995 object.
2996 """
1bd55598 2997 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc 2998
5b5c9bc7 2999def Image_AddHandler(*args, **kwargs):
1bd55598
RD
3000 """Image_AddHandler(ImageHandler handler)"""
3001 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc 3002
5b5c9bc7 3003def Image_InsertHandler(*args, **kwargs):
1bd55598
RD
3004 """Image_InsertHandler(ImageHandler handler)"""
3005 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc 3006
5b5c9bc7 3007def Image_RemoveHandler(*args, **kwargs):
1bd55598
RD
3008 """Image_RemoveHandler(String name) -> bool"""
3009 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 3010
1bd55598
RD
3011def Image_GetHandlers(*args):
3012 """Image_GetHandlers() -> PyObject"""
3013 return _core_.Image_GetHandlers(*args)
3014
3015def Image_GetImageExtWildcard(*args):
3016 """
7a27cf7c
RD
3017 Image_GetImageExtWildcard() -> String
3018
3019 Iterates all registered wxImageHandler objects, and returns a string
3020 containing file extension masks suitable for passing to file open/save
3021 dialog boxes.
3022 """
1bd55598 3023 return _core_.Image_GetImageExtWildcard(*args)
d55e5bfc 3024
943e8dfd 3025def Image_RGBtoHSV(*args, **kwargs):
1bd55598 3026 """
943e8dfd
RD
3027 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3028
3029 Converts a color in RGB color space to HSV color space.
3030 """
1bd55598 3031 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3032
3033def Image_HSVtoRGB(*args, **kwargs):
1bd55598 3034 """
943e8dfd
RD
3035 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3036
3037 Converts a color in HSV color space to RGB color space.
3038 """
1bd55598 3039 return _core_.Image_HSVtoRGB(*args, **kwargs)
943e8dfd 3040
68e533f8
RD
3041def InitAllImageHandlers():
3042 """
3043 The former functionality of InitAllImageHanders is now done internal to
3044 the _core_ extension module and so this function has become a simple NOP.
3045 """
3046 pass
d55e5bfc 3047
5b5c9bc7
RD
3048IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3049IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3050PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3051PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3052PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3053BMP_24BPP = _core_.BMP_24BPP
3054BMP_8BPP = _core_.BMP_8BPP
3055BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3056BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3057BMP_8BPP_RED = _core_.BMP_8BPP_RED
3058BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3059BMP_4BPP = _core_.BMP_4BPP
3060BMP_1BPP = _core_.BMP_1BPP
3061BMP_1BPP_BW = _core_.BMP_1BPP_BW
3062class BMPHandler(ImageHandler):
27fb7603 3063 """A `wx.ImageHandler` for \*.bmp bitmap files."""
1bd55598
RD
3064 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3065 __repr__ = _swig_repr
3066 def __init__(self, *args, **kwargs):
27fb7603
RD
3067 """
3068 __init__(self) -> BMPHandler
3069
3070 A `wx.ImageHandler` for \*.bmp bitmap files.
3071 """
1bd55598 3072 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3073_core_.BMPHandler_swigregister(BMPHandler)
5b5c9bc7 3074NullImage = cvar.NullImage
68350608 3075IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3076IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3077IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3078IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3079IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3080IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3081IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3082IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3083IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3084IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3085IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3086IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3087IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
7fbf8399
RD
3088IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3089IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc 3090
5b5c9bc7 3091class ICOHandler(BMPHandler):
27fb7603 3092 """A `wx.ImageHandler` for \*.ico icon files."""
1bd55598
RD
3093 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3094 __repr__ = _swig_repr
3095 def __init__(self, *args, **kwargs):
27fb7603
RD
3096 """
3097 __init__(self) -> ICOHandler
3098
3099 A `wx.ImageHandler` for \*.ico icon files.
3100 """
1bd55598 3101 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3102_core_.ICOHandler_swigregister(ICOHandler)
d55e5bfc 3103
5b5c9bc7 3104class CURHandler(ICOHandler):
27fb7603 3105 """A `wx.ImageHandler` for \*.cur cursor files."""
1bd55598
RD
3106 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3107 __repr__ = _swig_repr
3108 def __init__(self, *args, **kwargs):
27fb7603
RD
3109 """
3110 __init__(self) -> CURHandler
3111
3112 A `wx.ImageHandler` for \*.cur cursor files.
3113 """
1bd55598 3114 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3115_core_.CURHandler_swigregister(CURHandler)
d55e5bfc 3116
5b5c9bc7 3117class ANIHandler(CURHandler):
27fb7603 3118 """A `wx.ImageHandler` for \*.ani animated cursor files."""
1bd55598
RD
3119 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3120 __repr__ = _swig_repr
3121 def __init__(self, *args, **kwargs):
27fb7603
RD
3122 """
3123 __init__(self) -> ANIHandler
3124
3125 A `wx.ImageHandler` for \*.ani animated cursor files.
3126 """
1bd55598 3127 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3128_core_.ANIHandler_swigregister(ANIHandler)
d55e5bfc 3129
5b5c9bc7 3130class PNGHandler(ImageHandler):
27fb7603 3131 """A `wx.ImageHandler` for PNG image files."""
1bd55598
RD
3132 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3133 __repr__ = _swig_repr
3134 def __init__(self, *args, **kwargs):
27fb7603
RD
3135 """
3136 __init__(self) -> PNGHandler
3137
3138 A `wx.ImageHandler` for PNG image files.
3139 """
1bd55598 3140 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3141_core_.PNGHandler_swigregister(PNGHandler)
d55e5bfc 3142
5b5c9bc7 3143class GIFHandler(ImageHandler):
27fb7603 3144 """A `wx.ImageHandler` for GIF image files."""
1bd55598
RD
3145 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3146 __repr__ = _swig_repr
3147 def __init__(self, *args, **kwargs):
27fb7603
RD
3148 """
3149 __init__(self) -> GIFHandler
3150
3151 A `wx.ImageHandler` for GIF image files.
3152 """
1bd55598 3153 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3154_core_.GIFHandler_swigregister(GIFHandler)
d55e5bfc 3155
5b5c9bc7 3156class PCXHandler(ImageHandler):
27fb7603 3157 """A `wx.ImageHandler` for PCX imager files."""
1bd55598
RD
3158 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3159 __repr__ = _swig_repr
3160 def __init__(self, *args, **kwargs):
27fb7603
RD
3161 """
3162 __init__(self) -> PCXHandler
3163
3164 A `wx.ImageHandler` for PCX imager files.
3165 """
1bd55598 3166 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3167_core_.PCXHandler_swigregister(PCXHandler)
d55e5bfc 3168
5b5c9bc7 3169class JPEGHandler(ImageHandler):
27fb7603 3170 """A `wx.ImageHandler` for JPEG/JPG image files."""
1bd55598
RD
3171 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3172 __repr__ = _swig_repr
3173 def __init__(self, *args, **kwargs):
27fb7603
RD
3174 """
3175 __init__(self) -> JPEGHandler
3176
3177 A `wx.ImageHandler` for JPEG/JPG image files.
3178 """
1bd55598 3179 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3180_core_.JPEGHandler_swigregister(JPEGHandler)
d55e5bfc 3181
5b5c9bc7 3182class PNMHandler(ImageHandler):
27fb7603 3183 """A `wx.ImageHandler` for PNM image files."""
1bd55598
RD
3184 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3185 __repr__ = _swig_repr
3186 def __init__(self, *args, **kwargs):
27fb7603
RD
3187 """
3188 __init__(self) -> PNMHandler
3189
3190 A `wx.ImageHandler` for PNM image files.
3191 """
1bd55598 3192 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3193_core_.PNMHandler_swigregister(PNMHandler)
d55e5bfc 3194
5b5c9bc7 3195class XPMHandler(ImageHandler):
27fb7603 3196 """A `wx.ImageHandler` for XPM image."""
1bd55598
RD
3197 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3198 __repr__ = _swig_repr
3199 def __init__(self, *args, **kwargs):
27fb7603
RD
3200 """
3201 __init__(self) -> XPMHandler
3202
3203 A `wx.ImageHandler` for XPM image.
3204 """
1bd55598 3205 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3206_core_.XPMHandler_swigregister(XPMHandler)
d55e5bfc 3207
5b5c9bc7 3208class TIFFHandler(ImageHandler):
27fb7603 3209 """A `wx.ImageHandler` for TIFF image files."""
1bd55598
RD
3210 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3211 __repr__ = _swig_repr
3212 def __init__(self, *args, **kwargs):
27fb7603
RD
3213 """
3214 __init__(self) -> TIFFHandler
3215
3216 A `wx.ImageHandler` for TIFF image files.
3217 """
1bd55598 3218 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3219_core_.TIFFHandler_swigregister(TIFFHandler)
d55e5bfc 3220
5b5c9bc7
RD
3221QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3222QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3223class Quantize(object):
c0de73ae 3224 """Performs quantization, or colour reduction, on a wxImage."""
1bd55598
RD
3225 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3226 def __init__(self): raise AttributeError, "No constructor defined"
3227 __repr__ = _swig_repr
c0de73ae
RD
3228 def Quantize(*args, **kwargs):
3229 """
5b5c9bc7 3230 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3231
3232 Reduce the colours in the source image and put the result into the
3233 destination image, setting the palette in the destination if
3234 needed. Both images may be the same, to overwrite the source image.
3235 """
5b5c9bc7 3236 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae
RD
3237
3238 Quantize = staticmethod(Quantize)
2131d850 3239_core_.Quantize_swigregister(Quantize)
c0de73ae 3240
5b5c9bc7 3241def Quantize_Quantize(*args, **kwargs):
1bd55598 3242 """
5b5c9bc7 3243 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3244
3245 Reduce the colours in the source image and put the result into the
3246 destination image, setting the palette in the destination if
3247 needed. Both images may be the same, to overwrite the source image.
3248 """
1bd55598 3249 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3250
d55e5bfc
RD
3251#---------------------------------------------------------------------------
3252
5b5c9bc7
RD
3253class EvtHandler(Object):
3254 """Proxy of C++ EvtHandler class"""
1bd55598
RD
3255 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3256 __repr__ = _swig_repr
3257 def __init__(self, *args, **kwargs):
5b5c9bc7 3258 """__init__(self) -> EvtHandler"""
1bd55598 3259 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d55e5bfc 3260 def GetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3261 """GetNextHandler(self) -> EvtHandler"""
3262 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
d55e5bfc
RD
3263
3264 def GetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3265 """GetPreviousHandler(self) -> EvtHandler"""
3266 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3267
3268 def SetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3269 """SetNextHandler(self, EvtHandler handler)"""
3270 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
d55e5bfc
RD
3271
3272 def SetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3273 """SetPreviousHandler(self, EvtHandler handler)"""
3274 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3275
3276 def GetEvtHandlerEnabled(*args, **kwargs):
3277 """GetEvtHandlerEnabled(self) -> bool"""
5b5c9bc7 3278 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3279
3280 def SetEvtHandlerEnabled(*args, **kwargs):
3281 """SetEvtHandlerEnabled(self, bool enabled)"""
5b5c9bc7 3282 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3283
3284 def ProcessEvent(*args, **kwargs):
5b5c9bc7
RD
3285 """ProcessEvent(self, Event event) -> bool"""
3286 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
d55e5bfc
RD
3287
3288 def AddPendingEvent(*args, **kwargs):
5b5c9bc7
RD
3289 """AddPendingEvent(self, Event event)"""
3290 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
d55e5bfc
RD
3291
3292 def ProcessPendingEvents(*args, **kwargs):
3293 """ProcessPendingEvents(self)"""
5b5c9bc7 3294 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
3295
3296 def Connect(*args, **kwargs):
3297 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
5b5c9bc7 3298 return _core_.EvtHandler_Connect(*args, **kwargs)
d55e5bfc
RD
3299
3300 def Disconnect(*args, **kwargs):
2131d850 3301 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
5b5c9bc7 3302 return _core_.EvtHandler_Disconnect(*args, **kwargs)
d55e5bfc
RD
3303
3304 def _setOORInfo(*args, **kwargs):
36ed4f51 3305 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3306 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3307 args[0].thisown = 0
3308 return val
d55e5bfc
RD
3309
3310 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3311 """
3312 Bind an event to an event handler.
3313
a5ee0656
RD
3314 :param event: One of the EVT_* objects that specifies the
3315 type of event to bind,
d55e5bfc 3316
a5ee0656
RD
3317 :param handler: A callable object to be invoked when the
3318 event is delivered to self. Pass None to
3319 disconnect an event handler.
d55e5bfc 3320
a5ee0656
RD
3321 :param source: Sometimes the event originates from a
3322 different window than self, but you still
3323 want to catch it in self. (For example, a
3324 button event delivered to a frame.) By
3325 passing the source of the event, the event
3326 handling system is able to differentiate
3327 between the same event type from different
3328 controls.
d55e5bfc 3329
a5ee0656
RD
3330 :param id: Used to spcify the event source by ID instead
3331 of instance.
3332
3333 :param id2: Used when it is desirable to bind a handler
3334 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3335 """
3336 if source is not None:
3337 id = source.GetId()
3338 event.Bind(self, id, id2, handler)
3339
d6c14a4c
RD
3340 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3341 """
3342 Disconencts the event handler binding for event from self.
3343 Returns True if successful.
3344 """
3345 if source is not None:
3346 id = source.GetId()
3347 return event.Unbind(self, id, id2)
d55e5bfc 3348
2131d850 3349_core_.EvtHandler_swigregister(EvtHandler)
d55e5bfc
RD
3350
3351#---------------------------------------------------------------------------
3352
3353class PyEventBinder(object):
3354 """
3355 Instances of this class are used to bind specific events to event
3356 handlers.
3357 """
3358 def __init__(self, evtType, expectedIDs=0):
3359 if expectedIDs not in [0, 1, 2]:
3360 raise ValueError, "Invalid number of expectedIDs"
3361 self.expectedIDs = expectedIDs
3362
3363 if type(evtType) == list or type(evtType) == tuple:
3364 self.evtType = evtType
3365 else:
3366 self.evtType = [evtType]
3367
3368
3369 def Bind(self, target, id1, id2, function):
3370 """Bind this set of event types to target."""
3371 for et in self.evtType:
3372 target.Connect(id1, id2, et, function)
3373
d6c14a4c
RD
3374
3375 def Unbind(self, target, id1, id2):
3376 """Remove an event binding."""
3377 success = 0
3378 for et in self.evtType:
3379 success += target.Disconnect(id1, id2, et)
3380 return success != 0
3381
d55e5bfc
RD
3382
3383 def __call__(self, *args):
3384 """
3385 For backwards compatibility with the old EVT_* functions.
3386 Should be called with either (window, func), (window, ID,
3387 func) or (window, ID1, ID2, func) parameters depending on the
3388 type of the event.
3389 """
3390 assert len(args) == 2 + self.expectedIDs
3391 id1 = wx.ID_ANY
3392 id2 = wx.ID_ANY
3393 target = args[0]
3394 if self.expectedIDs == 0:
3395 func = args[1]
3396 elif self.expectedIDs == 1:
3397 id1 = args[1]
3398 func = args[2]
3399 elif self.expectedIDs == 2:
3400 id1 = args[1]
3401 id2 = args[2]
3402 func = args[3]
3403 else:
3404 raise ValueError, "Unexpected number of IDs"
3405
3406 self.Bind(target, id1, id2, func)
3407
3408
3409# These two are square pegs that don't fit the PyEventBinder hole...
3410def EVT_COMMAND(win, id, cmd, func):
3411 win.Connect(id, -1, cmd, func)
3412def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3413 win.Connect(id1, id2, cmd, func)
3414
3415
3416#---------------------------------------------------------------------------
3417
3418#---------------------------------------------------------------------------
3419
5b5c9bc7
RD
3420EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3421EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3422
1bd55598 3423def NewEventType(*args):
2131d850 3424 """NewEventType() -> EventType"""
1bd55598 3425 return _core_.NewEventType(*args)
5b5c9bc7
RD
3426wxEVT_NULL = _core_.wxEVT_NULL
3427wxEVT_FIRST = _core_.wxEVT_FIRST
3428wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3429wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3430wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3431wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3432wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3433wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3434wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3435wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3436wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3437wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3438wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3439wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3440wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3441wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3442wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3443wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3444wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3445wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3446wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3447wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3448wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3449wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3450wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3451wxEVT_MOTION = _core_.wxEVT_MOTION
3452wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3453wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3454wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3455wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3456wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3457wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3458wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3459wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3460wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3461wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3462wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3463wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3464wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3465wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3466wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3467wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3468wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3469wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3470wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3471wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3472wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3473wxEVT_CHAR = _core_.wxEVT_CHAR
3474wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3475wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3476wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3477wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3478wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3479wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3480wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3481wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3482wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3483wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3484wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3485wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3486wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3487wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3488wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3489wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
5b5c9bc7
RD
3490wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3491wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3492wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3493wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3494wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3495wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3496wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3497wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3498wxEVT_SIZE = _core_.wxEVT_SIZE
3499wxEVT_MOVE = _core_.wxEVT_MOVE
3500wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3501wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3502wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3503wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
3504wxEVT_POWER = _core_.wxEVT_POWER
3505wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3506wxEVT_CREATE = _core_.wxEVT_CREATE
3507wxEVT_DESTROY = _core_.wxEVT_DESTROY
3508wxEVT_SHOW = _core_.wxEVT_SHOW
3509wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3510wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3511wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
3512wxEVT_PAINT = _core_.wxEVT_PAINT
3513wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3514wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3515wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3516wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3517wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3518wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3519wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3520wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3521wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3522wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3523wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3524wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3525wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3526wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3527wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3528wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3529wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3530wxEVT_IDLE = _core_.wxEVT_IDLE
3531wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3532wxEVT_SIZING = _core_.wxEVT_SIZING
3533wxEVT_MOVING = _core_.wxEVT_MOVING
3534wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
3535wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3536wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3537wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
5b5c9bc7
RD
3538wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3539wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3540wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3541wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3542wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3543wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3544wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d55e5bfc
RD
3545#
3546# Create some event binders
3547EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3548EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3549EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3550EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3551EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3552EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3553EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3554EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3555EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3556EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3557EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3558EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3559EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
3560EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
3561EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3562EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3563EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3564EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3565EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3566EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3567EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3568EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3569EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3570EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
88c6b281 3571EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
3572EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3573EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3574EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3575EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3576EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3577EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3578EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3579EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3580EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3581EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3582EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3583EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3584EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3585EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3586EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3587EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
3588
3589EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3590EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3591EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3592EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3593EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3594EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3595EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3596EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3597EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3598EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3599EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3600EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3601EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3602
3603EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3604 wxEVT_LEFT_UP,
3605 wxEVT_MIDDLE_DOWN,
3606 wxEVT_MIDDLE_UP,
3607 wxEVT_RIGHT_DOWN,
3608 wxEVT_RIGHT_UP,
3609 wxEVT_MOTION,
3610 wxEVT_LEFT_DCLICK,
3611 wxEVT_MIDDLE_DCLICK,
3612 wxEVT_RIGHT_DCLICK,
3613 wxEVT_ENTER_WINDOW,
3614 wxEVT_LEAVE_WINDOW,
3615 wxEVT_MOUSEWHEEL
3616 ])
3617
3618
3619# Scrolling from wxWindow (sent to wxScrolledWindow)
3620EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
3621 wxEVT_SCROLLWIN_BOTTOM,
3622 wxEVT_SCROLLWIN_LINEUP,
3623 wxEVT_SCROLLWIN_LINEDOWN,
3624 wxEVT_SCROLLWIN_PAGEUP,
3625 wxEVT_SCROLLWIN_PAGEDOWN,
3626 wxEVT_SCROLLWIN_THUMBTRACK,
3627 wxEVT_SCROLLWIN_THUMBRELEASE,
3628 ])
3629
3630EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3631EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3632EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3633EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3634EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3635EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3636EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3637EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3638
27fb7603 3639# Scrolling from wx.Slider and wx.ScrollBar
d55e5bfc
RD
3640EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3641 wxEVT_SCROLL_BOTTOM,
3642 wxEVT_SCROLL_LINEUP,
3643 wxEVT_SCROLL_LINEDOWN,
3644 wxEVT_SCROLL_PAGEUP,
3645 wxEVT_SCROLL_PAGEDOWN,
3646 wxEVT_SCROLL_THUMBTRACK,
3647 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3648 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3649 ])
3650
3651EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3652EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3653EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3654EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3655EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3656EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3657EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3658EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3659EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3660EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
3661
27fb7603 3662# Scrolling from wx.Slider and wx.ScrollBar, with an id
d55e5bfc
RD
3663EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3664 wxEVT_SCROLL_BOTTOM,
3665 wxEVT_SCROLL_LINEUP,
3666 wxEVT_SCROLL_LINEDOWN,
3667 wxEVT_SCROLL_PAGEUP,
3668 wxEVT_SCROLL_PAGEDOWN,
3669 wxEVT_SCROLL_THUMBTRACK,
3670 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3671 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
3672 ], 1)
3673
3674EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3675EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3676EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3677EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3678EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3679EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3680EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3681EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3682EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3683EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
3684
3685EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3686EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3687EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3688EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3689EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3690EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3691EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3692EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3693EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3694EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3695
3696EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3697EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3698EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3699EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3700EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3701EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3702EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3703EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3704EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3705
3706
3707EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3708EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3709EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3710EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3711EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3712EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3713EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3714
3715EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3716
3717EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3718EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3719
3720EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3721
2131d850
RD
3722EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3723EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3724EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d55e5bfc
RD
3725
3726
3727#---------------------------------------------------------------------------
3728
5b5c9bc7 3729class Event(Object):
27fb7603
RD
3730 """
3731 An event is a structure holding information about an event passed to a
3732 callback or member function. wx.Event is an abstract base class for
3733 other event classes
3734 """
1bd55598
RD
3735 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3736 def __init__(self): raise AttributeError, "No constructor defined"
3737 __repr__ = _swig_repr
3738 __swig_destroy__ = _core_.delete_Event
3739 __del__ = lambda self : None;
d55e5bfc 3740 def SetEventType(*args, **kwargs):
27fb7603 3741 """
2131d850 3742 SetEventType(self, EventType typ)
27fb7603
RD
3743
3744 Sets the specific type of the event.
3745 """
5b5c9bc7 3746 return _core_.Event_SetEventType(*args, **kwargs)
d55e5bfc
RD
3747
3748 def GetEventType(*args, **kwargs):
27fb7603 3749 """
2131d850 3750 GetEventType(self) -> EventType
27fb7603
RD
3751
3752 Returns the identifier of the given event type, such as
3753 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3754 """
5b5c9bc7 3755 return _core_.Event_GetEventType(*args, **kwargs)
d55e5bfc
RD
3756
3757 def GetEventObject(*args, **kwargs):
27fb7603
RD
3758 """
3759 GetEventObject(self) -> Object
3760
3761 Returns the object (usually a window) associated with the event, if
3762 any.
3763 """
5b5c9bc7 3764 return _core_.Event_GetEventObject(*args, **kwargs)
d55e5bfc
RD
3765
3766 def SetEventObject(*args, **kwargs):
27fb7603
RD
3767 """
3768 SetEventObject(self, Object obj)
3769
3770 Sets the originating object, or in other words, obj is normally the
3771 object that is sending the event.
3772 """
5b5c9bc7 3773 return _core_.Event_SetEventObject(*args, **kwargs)
d55e5bfc
RD
3774
3775 def GetTimestamp(*args, **kwargs):
3776 """GetTimestamp(self) -> long"""
5b5c9bc7 3777 return _core_.Event_GetTimestamp(*args, **kwargs)
d55e5bfc
RD
3778
3779 def SetTimestamp(*args, **kwargs):
3780 """SetTimestamp(self, long ts=0)"""
5b5c9bc7 3781 return _core_.Event_SetTimestamp(*args, **kwargs)
d55e5bfc
RD
3782
3783 def GetId(*args, **kwargs):
27fb7603
RD
3784 """
3785 GetId(self) -> int
3786
3787 Returns the identifier associated with this event, such as a button
3788 command id.
3789 """
5b5c9bc7 3790 return _core_.Event_GetId(*args, **kwargs)
d55e5bfc
RD
3791
3792 def SetId(*args, **kwargs):
27fb7603
RD
3793 """
3794 SetId(self, int Id)
3795
3796 Set's the ID for the event. This is usually the ID of the window that
3797 is sending the event, but it can also be a command id from a menu
3798 item, etc.
3799 """
5b5c9bc7 3800 return _core_.Event_SetId(*args, **kwargs)
d55e5bfc
RD
3801
3802 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
3803 """
3804 IsCommandEvent(self) -> bool
3805
3806 Returns true if the event is or is derived from `wx.CommandEvent` else
3807 it returns false. Note: Exists only for optimization purposes.
3808 """
5b5c9bc7 3809 return _core_.Event_IsCommandEvent(*args, **kwargs)
d55e5bfc
RD
3810
3811 def Skip(*args, **kwargs):
51b83b37
RD
3812 """
3813 Skip(self, bool skip=True)
3814
3815 Called by an event handler, it controls whether additional event
3816 handlers bound to this event will be called after the current event
3817 handler returns. Skip(false) (the default setting) will prevent
3818 additional event handlers from being called and control will be
3819 returned to the sender of the event immediately after the current
3820 handler has finished. Skip(True) will cause the event processing
3821 system to continue searching for a handler function for this event.
3822
3823 """
5b5c9bc7 3824 return _core_.Event_Skip(*args, **kwargs)
d55e5bfc
RD
3825
3826 def GetSkipped(*args, **kwargs):
27fb7603
RD
3827 """
3828 GetSkipped(self) -> bool
3829
3830 Returns true if the event handler should be skipped, false otherwise.
3831 :see: `Skip`
3832 """
5b5c9bc7 3833 return _core_.Event_GetSkipped(*args, **kwargs)
d55e5bfc
RD
3834
3835 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
3836 """
3837 ShouldPropagate(self) -> bool
3838
3839 Test if this event should be propagated to the parent window or not,
3840 i.e. if the propagation level is currently greater than 0.
3841 """
5b5c9bc7 3842 return _core_.Event_ShouldPropagate(*args, **kwargs)
d55e5bfc
RD
3843
3844 def StopPropagation(*args, **kwargs):
27fb7603
RD
3845 """
3846 StopPropagation(self) -> int
3847
3848 Stop the event from propagating to its parent window. Returns the old
3849 propagation level value which may be later passed to
3850 `ResumePropagation` to allow propagating the event again.
3851 """
5b5c9bc7 3852 return _core_.Event_StopPropagation(*args, **kwargs)
d55e5bfc
RD
3853
3854 def ResumePropagation(*args, **kwargs):
27fb7603
RD
3855 """
3856 ResumePropagation(self, int propagationLevel)
3857
3858 Resume the event propagation by restoring the propagation level. (For
3859 example, you can use the value returned by an earlier call to
3860 `StopPropagation`.)
3861
3862 """
5b5c9bc7 3863 return _core_.Event_ResumePropagation(*args, **kwargs)
d55e5bfc
RD
3864
3865 def Clone(*args, **kwargs):
5b5c9bc7
RD
3866 """Clone(self) -> Event"""
3867 return _core_.Event_Clone(*args, **kwargs)
d55e5bfc 3868
2131d850 3869_core_.Event_swigregister(Event)
d55e5bfc
RD
3870
3871#---------------------------------------------------------------------------
3872
5b5c9bc7 3873class PropagationDisabler(object):
27fb7603
RD
3874 """
3875 Helper class to temporarily change an event not to propagate. Simply
3876 create an instance of this class and then whe it is destroyed the
3877 propogation of the event will be restored.
3878 """
1bd55598
RD
3879 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3880 __repr__ = _swig_repr
3881 def __init__(self, *args, **kwargs):
27fb7603
RD
3882 """
3883 __init__(self, Event event) -> PropagationDisabler
3884
3885 Helper class to temporarily change an event not to propagate. Simply
3886 create an instance of this class and then whe it is destroyed the
3887 propogation of the event will be restored.
3888 """
1bd55598
RD
3889 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3890 __swig_destroy__ = _core_.delete_PropagationDisabler
3891 __del__ = lambda self : None;
2131d850 3892_core_.PropagationDisabler_swigregister(PropagationDisabler)
d55e5bfc 3893
5b5c9bc7 3894class PropagateOnce(object):
27fb7603
RD
3895 """
3896 A helper class that will temporarily lower propagation level of an
3897 event. Simply create an instance of this class and then whe it is
3898 destroyed the propogation of the event will be restored.
3899 """
1bd55598
RD
3900 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3901 __repr__ = _swig_repr
3902 def __init__(self, *args, **kwargs):
27fb7603
RD
3903 """
3904 __init__(self, Event event) -> PropagateOnce
3905
3906 A helper class that will temporarily lower propagation level of an
3907 event. Simply create an instance of this class and then whe it is
3908 destroyed the propogation of the event will be restored.
3909 """
1bd55598
RD
3910 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
3911 __swig_destroy__ = _core_.delete_PropagateOnce
3912 __del__ = lambda self : None;
2131d850 3913_core_.PropagateOnce_swigregister(PropagateOnce)
d55e5bfc
RD
3914
3915#---------------------------------------------------------------------------
3916
5b5c9bc7 3917class CommandEvent(Event):
27fb7603
RD
3918 """
3919 This event class contains information about command events, which
3920 originate from a variety of simple controls, as well as menus and
3921 toolbars.
3922 """
1bd55598
RD
3923 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3924 __repr__ = _swig_repr
3925 def __init__(self, *args, **kwargs):
27fb7603 3926 """
2131d850 3927 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
3928
3929 This event class contains information about command events, which
3930 originate from a variety of simple controls, as well as menus and
3931 toolbars.
3932 """
1bd55598 3933 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
d55e5bfc 3934 def GetSelection(*args, **kwargs):
27fb7603
RD
3935 """
3936 GetSelection(self) -> int
3937
3938 Returns item index for a listbox or choice selection event (not valid
3939 for a deselection).
3940 """
5b5c9bc7 3941 return _core_.CommandEvent_GetSelection(*args, **kwargs)
d55e5bfc
RD
3942
3943 def SetString(*args, **kwargs):
5b5c9bc7
RD
3944 """SetString(self, String s)"""
3945 return _core_.CommandEvent_SetString(*args, **kwargs)
d55e5bfc
RD
3946
3947 def GetString(*args, **kwargs):
27fb7603
RD
3948 """
3949 GetString(self) -> String
3950
3951 Returns item string for a listbox or choice selection event (not valid
3952 for a deselection).
3953 """
5b5c9bc7 3954 return _core_.CommandEvent_GetString(*args, **kwargs)
d55e5bfc
RD
3955
3956 def IsChecked(*args, **kwargs):
27fb7603
RD
3957 """
3958 IsChecked(self) -> bool
3959
3960 This method can be used with checkbox and menu events: for the
3961 checkboxes, the method returns true for a selection event and false
3962 for a deselection one. For the menu events, this method indicates if
3963 the menu item just has become checked or unchecked (and thus only
3964 makes sense for checkable menu items).
3965 """
5b5c9bc7 3966 return _core_.CommandEvent_IsChecked(*args, **kwargs)
d55e5bfc
RD
3967
3968 Checked = IsChecked
3969 def IsSelection(*args, **kwargs):
27fb7603
RD
3970 """
3971 IsSelection(self) -> bool
3972
3973 For a listbox or similar event, returns true if it is a selection,
3974 false if it is a deselection.
3975 """
5b5c9bc7 3976 return _core_.CommandEvent_IsSelection(*args, **kwargs)
d55e5bfc
RD
3977
3978 def SetExtraLong(*args, **kwargs):
3979 """SetExtraLong(self, long extraLong)"""
5b5c9bc7 3980 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
d55e5bfc
RD
3981
3982 def GetExtraLong(*args, **kwargs):
27fb7603
RD
3983 """
3984 GetExtraLong(self) -> long
3985
5ba5649b
RD
3986 Returns extra information dependant on the event objects type. If the
3987 event comes from a listbox selection, it is a boolean determining
3988 whether the event was a selection (true) or a deselection (false). A
3989 listbox deselection only occurs for multiple-selection boxes, and in
3990 this case the index and string values are indeterminate and the
3991 listbox must be examined by the application.
27fb7603 3992 """
5b5c9bc7 3993 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
d55e5bfc
RD
3994
3995 def SetInt(*args, **kwargs):
3996 """SetInt(self, int i)"""
5b5c9bc7 3997 return _core_.CommandEvent_SetInt(*args, **kwargs)
d55e5bfc
RD
3998
3999 def GetInt(*args, **kwargs):
27fb7603 4000 """
2131d850 4001 GetInt(self) -> int
27fb7603 4002
5ba5649b
RD
4003 Returns the integer identifier corresponding to a listbox, choice or
4004 radiobox selection (only if the event was a selection, not a
4005 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4006 """
5b5c9bc7 4007 return _core_.CommandEvent_GetInt(*args, **kwargs)
d55e5bfc 4008
1bd55598
RD
4009 def GetClientData(*args, **kwargs):
4010 """
4011 GetClientData(self) -> PyObject
4012
4013 Returns the client data object for a listbox or choice selection event, (if any.)
4014 """
4015 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4016
4017 def SetClientData(*args, **kwargs):
4018 """
4019 SetClientData(self, PyObject clientData)
4020
4021 Associate the given client data with the item at position n.
4022 """
4023 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4024
4025 GetClientObject = GetClientData
4026 SetClientObject = SetClientData
4027
d55e5bfc 4028 def Clone(*args, **kwargs):
5b5c9bc7
RD
4029 """Clone(self) -> Event"""
4030 return _core_.CommandEvent_Clone(*args, **kwargs)
d55e5bfc 4031
2131d850 4032_core_.CommandEvent_swigregister(CommandEvent)
d55e5bfc
RD
4033
4034#---------------------------------------------------------------------------
4035
5b5c9bc7 4036class NotifyEvent(CommandEvent):
27fb7603
RD
4037 """
4038 An instance of this class (or one of its derived classes) is sent from
4039 a control when the control's state is being changed and the control
4040 allows that change to be prevented from happening. The event handler
4041 can call `Veto` or `Allow` to tell the control what to do.
4042 """
1bd55598
RD
4043 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4044 __repr__ = _swig_repr
4045 def __init__(self, *args, **kwargs):
27fb7603 4046 """
2131d850 4047 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4048
4049 An instance of this class (or one of its derived classes) is sent from
4050 a control when the control's state is being changed and the control
4051 allows that change to be prevented from happening. The event handler
4052 can call `Veto` or `Allow` to tell the control what to do.
4053 """
1bd55598 4054 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
d55e5bfc 4055 def Veto(*args, **kwargs):
27fb7603
RD
4056 """
4057 Veto(self)
4058
4059 Prevents the change announced by this event from happening.
4060
4061 It is in general a good idea to notify the user about the reasons for
4062 vetoing the change because otherwise the applications behaviour (which
4063 just refuses to do what the user wants) might be quite surprising.
4064 """
5b5c9bc7 4065 return _core_.NotifyEvent_Veto(*args, **kwargs)
d55e5bfc
RD
4066
4067 def Allow(*args, **kwargs):
27fb7603
RD
4068 """
4069 Allow(self)
4070
4071 This is the opposite of `Veto`: it explicitly allows the event to be
4072 processed. For most events it is not necessary to call this method as
4073 the events are allowed anyhow but some are forbidden by default (this
4074 will be mentioned in the corresponding event description).
4075 """
5b5c9bc7 4076 return _core_.NotifyEvent_Allow(*args, **kwargs)
d55e5bfc
RD
4077
4078 def IsAllowed(*args, **kwargs):
27fb7603
RD
4079 """
4080 IsAllowed(self) -> bool
4081
4082 Returns true if the change is allowed (`Veto` hasn't been called) or
4083 false otherwise (if it was).
4084 """
5b5c9bc7 4085 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
d55e5bfc 4086
2131d850 4087_core_.NotifyEvent_swigregister(NotifyEvent)
d55e5bfc
RD
4088
4089#---------------------------------------------------------------------------
4090
5b5c9bc7 4091class ScrollEvent(CommandEvent):
27fb7603
RD
4092 """
4093 A scroll event holds information about events sent from stand-alone
4094 scrollbars and sliders. Note that scrolled windows do not send
4095 instnaces of this event class, but send the `wx.ScrollWinEvent`
4096 instead.
4097 """
1bd55598
RD
4098 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4099 __repr__ = _swig_repr
4100 def __init__(self, *args, **kwargs):
d55e5bfc 4101 """
2131d850 4102 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
5b5c9bc7 4103 int orient=0) -> ScrollEvent
d55e5bfc 4104 """
1bd55598 4105 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
d55e5bfc 4106 def GetOrientation(*args, **kwargs):
27fb7603
RD
4107 """
4108 GetOrientation(self) -> int
4109
4110 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4111 the scrollbar.
4112 """
5b5c9bc7 4113 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4114
4115 def GetPosition(*args, **kwargs):
27fb7603
RD
4116 """
4117 GetPosition(self) -> int
4118
4119 Returns the position of the scrollbar.
4120 """
5b5c9bc7 4121 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4122
4123 def SetOrientation(*args, **kwargs):
4124 """SetOrientation(self, int orient)"""
5b5c9bc7 4125 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4126
4127 def SetPosition(*args, **kwargs):
4128 """SetPosition(self, int pos)"""
5b5c9bc7 4129 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
d55e5bfc 4130
2131d850 4131_core_.ScrollEvent_swigregister(ScrollEvent)
d55e5bfc
RD
4132
4133#---------------------------------------------------------------------------
4134
5b5c9bc7 4135class ScrollWinEvent(Event):
27fb7603
RD
4136 """
4137 A wx.ScrollWinEvent holds information about scrolling and is sent from
4138 scrolling windows.
4139 """
1bd55598
RD
4140 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4141 __repr__ = _swig_repr
4142 def __init__(self, *args, **kwargs):
27fb7603 4143 """
2131d850 4144 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4145
4146 A wx.ScrollWinEvent holds information about scrolling and is sent from
4147 scrolling windows.
4148 """
1bd55598 4149 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
d55e5bfc 4150 def GetOrientation(*args, **kwargs):
27fb7603
RD
4151 """
4152 GetOrientation(self) -> int
4153
4154 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4155 the scrollbar.
4156 """
5b5c9bc7 4157 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4158
4159 def GetPosition(*args, **kwargs):
27fb7603
RD
4160 """
4161 GetPosition(self) -> int
4162
4163 Returns the position of the scrollbar for the thumb track and release
4164 events. Note that this field can't be used for the other events, you
4165 need to query the window itself for the current position in that case.
4166 """
5b5c9bc7 4167 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4168
4169 def SetOrientation(*args, **kwargs):
4170 """SetOrientation(self, int orient)"""
5b5c9bc7 4171 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4172
4173 def SetPosition(*args, **kwargs):
4174 """SetPosition(self, int pos)"""
5b5c9bc7 4175 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
d55e5bfc 4176
2131d850 4177_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d55e5bfc
RD
4178
4179#---------------------------------------------------------------------------
4180
5b5c9bc7
RD
4181MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4182MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4183MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4184MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4185MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4186class MouseEvent(Event):
27fb7603
RD
4187 """
4188 This event class contains information about the events generated by
4189 the mouse: they include mouse buttons press and release events and
4190 mouse move events.
4191
4192 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4193 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4194 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4195 a middle button so a portable application should avoid relying on the
4196 events from it.
4197
4198 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4199 the former returns true when the event corresponds to the left mouse
4200 button click while the latter returns true if the left mouse button is
4201 currently being pressed. For example, when the user is dragging the
4202 mouse you can use `LeftIsDown` to test whether the left mouse button
4203 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4204 `LeftIsDown` will also return true in wxWidgets whatever the
4205 underlying GUI behaviour is (which is platform-dependent). The same
4206 applies, of course, to other mouse buttons as well.
4207 """
1bd55598
RD
4208 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4209 __repr__ = _swig_repr
4210 def __init__(self, *args, **kwargs):
27fb7603 4211 """
2131d850 4212 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4213
4214 Constructs a wx.MouseEvent. Valid event types are:
4215
4216 * wxEVT_ENTER_WINDOW
4217 * wxEVT_LEAVE_WINDOW
4218 * wxEVT_LEFT_DOWN
4219 * wxEVT_LEFT_UP
4220 * wxEVT_LEFT_DCLICK
4221 * wxEVT_MIDDLE_DOWN
4222 * wxEVT_MIDDLE_UP
4223 * wxEVT_MIDDLE_DCLICK
4224 * wxEVT_RIGHT_DOWN
4225 * wxEVT_RIGHT_UP
4226 * wxEVT_RIGHT_DCLICK
4227 * wxEVT_MOTION
4228 * wxEVT_MOUSEWHEEL
4229 """
1bd55598 4230 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
d55e5bfc 4231 def IsButton(*args, **kwargs):
27fb7603
RD
4232 """
4233 IsButton(self) -> bool
4234
4235 Returns true if the event was a mouse button event (not necessarily a
4236 button down event - that may be tested using `ButtonDown`).
4237 """
5b5c9bc7 4238 return _core_.MouseEvent_IsButton(*args, **kwargs)
d55e5bfc
RD
4239
4240 def ButtonDown(*args, **kwargs):
27fb7603
RD
4241 """
4242 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4243
5ba5649b
RD
4244 If the argument is omitted, this returns true if the event was any
4245 mouse button down event. Otherwise the argument specifies which
4246 button-down event shold be checked for (see `Button` for the possible
4247 values).
27fb7603 4248 """
5b5c9bc7 4249 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
d55e5bfc
RD
4250
4251 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4252 """
4253 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4254
4255 If the argument is omitted, this returns true if the event was any
4256 mouse double click event. Otherwise the argument specifies which
4257 double click event to check for (see `Button` for the possible
4258 values).
4259 """
5b5c9bc7 4260 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
d55e5bfc
RD
4261
4262 def ButtonUp(*args, **kwargs):
27fb7603
RD
4263 """
4264 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4265
4266 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4267 mouse button up event. Otherwise the argument specifies which button
4268 up event to check for (see `Button` for the possible values).
27fb7603 4269 """
5b5c9bc7 4270 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
d55e5bfc
RD
4271
4272 def Button(*args, **kwargs):
27fb7603
RD
4273 """
4274 Button(self, int button) -> bool
4275
4276 Returns true if the identified mouse button is changing state. Valid
4277 values of button are:
4278
4279 ==================== =====================================
4280 wx.MOUSE_BTN_LEFT check if left button was pressed
4281 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4282 wx.MOUSE_BTN_RIGHT check if right button was pressed
4283 wx.MOUSE_BTN_ANY check if any button was pressed
4284 ==================== =====================================
4285
4286 """
5b5c9bc7 4287 return _core_.MouseEvent_Button(*args, **kwargs)
d55e5bfc
RD
4288
4289 def ButtonIsDown(*args, **kwargs):
4290 """ButtonIsDown(self, int but) -> bool"""
5b5c9bc7 4291 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
d55e5bfc
RD
4292
4293 def GetButton(*args, **kwargs):
27fb7603
RD
4294 """
4295 GetButton(self) -> int
4296
4297 Returns the mouse button which generated this event or
4298 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4299 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4300 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4301 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4302 right buttons respectively.
4303 """
5b5c9bc7 4304 return _core_.MouseEvent_GetButton(*args, **kwargs)
d55e5bfc
RD
4305
4306 def ControlDown(*args, **kwargs):
27fb7603
RD
4307 """
4308 ControlDown(self) -> bool
4309
4310 Returns true if the control key was down at the time of the event.
4311 """
5b5c9bc7 4312 return _core_.MouseEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4313
4314 def MetaDown(*args, **kwargs):
27fb7603
RD
4315 """
4316 MetaDown(self) -> bool
4317
4318 Returns true if the Meta key was down at the time of the event.
4319 """
5b5c9bc7 4320 return _core_.MouseEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4321
4322 def AltDown(*args, **kwargs):
27fb7603
RD
4323 """
4324 AltDown(self) -> bool
4325
4326 Returns true if the Alt key was down at the time of the event.
4327 """
5b5c9bc7 4328 return _core_.MouseEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4329
4330 def ShiftDown(*args, **kwargs):
27fb7603
RD
4331 """
4332 ShiftDown(self) -> bool
4333
4334 Returns true if the Shift key was down at the time of the event.
4335 """
5b5c9bc7 4336 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4337
412d302d
RD
4338 def CmdDown(*args, **kwargs):
4339 """
4340 CmdDown(self) -> bool
4341
4342 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4343 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4344 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4345 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4346 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4347 purpose. So for non-Mac platforms this is the same as `ControlDown`
4348 and Macs this is the same as `MetaDown`.
4349 """
5b5c9bc7 4350 return _core_.MouseEvent_CmdDown(*args, **kwargs)
412d302d 4351
d55e5bfc 4352 def LeftDown(*args, **kwargs):
27fb7603
RD
4353 """
4354 LeftDown(self) -> bool
4355
4356 Returns true if the left mouse button state changed to down.
4357 """
5b5c9bc7 4358 return _core_.MouseEvent_LeftDown(*args, **kwargs)
d55e5bfc
RD
4359
4360 def MiddleDown(*args, **kwargs):
27fb7603
RD
4361 """
4362 MiddleDown(self) -> bool
4363
4364 Returns true if the middle mouse button state changed to down.
4365 """
5b5c9bc7 4366 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
d55e5bfc
RD
4367
4368 def RightDown(*args, **kwargs):
27fb7603
RD
4369 """
4370 RightDown(self) -> bool
4371
4372 Returns true if the right mouse button state changed to down.
4373 """
5b5c9bc7 4374 return _core_.MouseEvent_RightDown(*args, **kwargs)
d55e5bfc
RD
4375
4376 def LeftUp(*args, **kwargs):
27fb7603
RD
4377 """
4378 LeftUp(self) -> bool
4379
4380 Returns true if the left mouse button state changed to up.
4381 """
5b5c9bc7 4382 return _core_.MouseEvent_LeftUp(*args, **kwargs)
d55e5bfc
RD
4383
4384 def MiddleUp(*args, **kwargs):
27fb7603
RD
4385 """
4386 MiddleUp(self) -> bool
4387
4388 Returns true if the middle mouse button state changed to up.
4389 """
5b5c9bc7 4390 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
d55e5bfc
RD
4391
4392 def RightUp(*args, **kwargs):
27fb7603
RD
4393 """
4394 RightUp(self) -> bool
4395
4396 Returns true if the right mouse button state changed to up.
4397 """
5b5c9bc7 4398 return _core_.MouseEvent_RightUp(*args, **kwargs)
d55e5bfc
RD
4399
4400 def LeftDClick(*args, **kwargs):
27fb7603
RD
4401 """
4402 LeftDClick(self) -> bool
4403
4404 Returns true if the event was a left button double click.
4405 """
5b5c9bc7 4406 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
d55e5bfc
RD
4407
4408 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4409 """
4410 MiddleDClick(self) -> bool
4411
4412 Returns true if the event was a middle button double click.
4413 """
5b5c9bc7 4414 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
d55e5bfc
RD
4415
4416 def RightDClick(*args, **kwargs):
27fb7603
RD
4417 """
4418 RightDClick(self) -> bool
4419
4420 Returns true if the event was a right button double click.
4421 """
5b5c9bc7 4422 return _core_.MouseEvent_RightDClick(*args, **kwargs)
d55e5bfc
RD
4423
4424 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4425 """
4426 LeftIsDown(self) -> bool
4427
4428 Returns true if the left mouse button is currently down, independent
4429 of the current event type.
4430
4431 Please notice that it is not the same as LeftDown which returns true
4432 if the left mouse button was just pressed. Rather, it describes the
4433 state of the mouse button before the event happened.
4434
4435 This event is usually used in the mouse event handlers which process
4436 "move mouse" messages to determine whether the user is (still)
4437 dragging the mouse.
4438 """
5b5c9bc7 4439 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
d55e5bfc
RD
4440
4441 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4442 """
4443 MiddleIsDown(self) -> bool
4444
4445 Returns true if the middle mouse button is currently down, independent
4446 of the current event type.
4447 """
5b5c9bc7 4448 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
d55e5bfc
RD
4449
4450 def RightIsDown(*args, **kwargs):
27fb7603
RD
4451 """
4452 RightIsDown(self) -> bool
4453
4454 Returns true if the right mouse button is currently down, independent
4455 of the current event type.
4456 """
5b5c9bc7 4457 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
d55e5bfc
RD
4458
4459 def Dragging(*args, **kwargs):
27fb7603
RD
4460 """
4461 Dragging(self) -> bool
4462
4463 Returns true if this was a dragging event (motion while a button is
4464 depressed).
4465 """
5b5c9bc7 4466 return _core_.MouseEvent_Dragging(*args, **kwargs)
d55e5bfc
RD
4467
4468 def Moving(*args, **kwargs):
27fb7603
RD
4469 """
4470 Moving(self) -> bool
4471
4472 Returns true if this was a motion event and no mouse buttons were
4473 pressed. If any mouse button is held pressed, then this method returns
4474 false and Dragging returns true.
4475 """
5b5c9bc7 4476 return _core_.MouseEvent_Moving(*args, **kwargs)
d55e5bfc
RD
4477
4478 def Entering(*args, **kwargs):
27fb7603
RD
4479 """
4480 Entering(self) -> bool
4481
4482 Returns true if the mouse was entering the window.
4483 """
5b5c9bc7 4484 return _core_.MouseEvent_Entering(*args, **kwargs)
d55e5bfc
RD
4485
4486 def Leaving(*args, **kwargs):
27fb7603
RD
4487 """
4488 Leaving(self) -> bool
4489
4490 Returns true if the mouse was leaving the window.
4491 """
5b5c9bc7 4492 return _core_.MouseEvent_Leaving(*args, **kwargs)
d55e5bfc
RD
4493
4494 def GetPosition(*args, **kwargs):
4495 """
5b5c9bc7 4496 GetPosition(self) -> Point
d55e5bfc 4497
27fb7603
RD
4498 Returns the pixel position of the mouse in window coordinates when the
4499 event happened.
d55e5bfc 4500 """
5b5c9bc7 4501 return _core_.MouseEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4502
4503 def GetPositionTuple(*args, **kwargs):
4504 """
4505 GetPositionTuple() -> (x,y)
4506
27fb7603
RD
4507 Returns the pixel position of the mouse in window coordinates when the
4508 event happened.
d55e5bfc 4509 """
5b5c9bc7 4510 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4511
4512 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4513 """
4514 GetLogicalPosition(self, DC dc) -> Point
4515
4516 Returns the logical mouse position in pixels (i.e. translated
4517 according to the translation set for the DC, which usually indicates
4518 that the window has been scrolled).
4519 """
5b5c9bc7 4520 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
d55e5bfc
RD
4521
4522 def GetX(*args, **kwargs):
27fb7603
RD
4523 """
4524 GetX(self) -> int
4525
4526 Returns X coordinate of the physical mouse event position.
4527 """
5b5c9bc7 4528 return _core_.MouseEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4529
4530 def GetY(*args, **kwargs):
27fb7603
RD
4531 """
4532 GetY(self) -> int
4533
4534 Returns Y coordinate of the physical mouse event position.
4535 """
5b5c9bc7 4536 return _core_.MouseEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4537
4538 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4539 """
4540 GetWheelRotation(self) -> int
4541
4542 Get wheel rotation, positive or negative indicates direction of
4543 rotation. Current devices all send an event when rotation is equal to
4544 +/-WheelDelta, but this allows for finer resolution devices to be
4545 created in the future. Because of this you shouldn't assume that one
4546 event is equal to 1 line or whatever, but you should be able to either
4547 do partial line scrolling or wait until +/-WheelDelta rotation values
4548 have been accumulated before scrolling.
4549 """
5b5c9bc7 4550 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
d55e5bfc
RD
4551
4552 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4553 """
4554 GetWheelDelta(self) -> int
4555
4556 Get wheel delta, normally 120. This is the threshold for action to be
4557 taken, and one such action (for example, scrolling one increment)
4558 should occur for each delta.
4559 """
5b5c9bc7 4560 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
d55e5bfc
RD
4561
4562 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4563 """
4564 GetLinesPerAction(self) -> int
4565
4566 Returns the configured number of lines (or whatever) to be scrolled
4567 per wheel action. Defaults to three.
4568 """
5b5c9bc7 4569 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
d55e5bfc
RD
4570
4571 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4572 """
4573 IsPageScroll(self) -> bool
4574
4575 Returns true if the system has been setup to do page scrolling with
4576 the mouse wheel instead of line scrolling.
4577 """
5b5c9bc7
RD
4578 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4579
4580 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4581 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4582 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4583 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4584 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4585 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4586 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4587 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4588 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4589 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4590 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4591 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
2131d850 4592_core_.MouseEvent_swigregister(MouseEvent)
d55e5bfc
RD
4593
4594#---------------------------------------------------------------------------
4595
5b5c9bc7 4596class SetCursorEvent(Event):
5ba5649b
RD
4597 """
4598 A SetCursorEvent is generated when the mouse cursor is about to be set
4599 as a result of mouse motion. This event gives the application the
4600 chance to perform specific mouse cursor processing based on the
4601 current position of the mouse within the window. Use the `SetCursor`
4602 method to specify the cursor you want to be displayed.
4603 """
1bd55598
RD
4604 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4605 __repr__ = _swig_repr
4606 def __init__(self, *args, **kwargs):
5ba5649b
RD
4607 """
4608 __init__(self, int x=0, int y=0) -> SetCursorEvent
4609
4610 Construct a new `wx.SetCursorEvent`.
4611 """
1bd55598 4612 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
d55e5bfc 4613 def GetX(*args, **kwargs):
5ba5649b
RD
4614 """
4615 GetX(self) -> int
4616
4617 Returns the X coordinate of the mouse in client coordinates.
4618 """
5b5c9bc7 4619 return _core_.SetCursorEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4620
4621 def GetY(*args, **kwargs):
5ba5649b
RD
4622 """
4623 GetY(self) -> int
4624
4625 Returns the Y coordinate of the mouse in client coordinates.
4626 """
5b5c9bc7 4627 return _core_.SetCursorEvent_GetY(*args, **kwargs)
d55e5bfc
RD
4628
4629 def SetCursor(*args, **kwargs):
5ba5649b
RD
4630 """
4631 SetCursor(self, Cursor cursor)
4632
4633 Sets the cursor associated with this event.
4634 """
5b5c9bc7 4635 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
d55e5bfc
RD
4636
4637 def GetCursor(*args, **kwargs):
5ba5649b
RD
4638 """
4639 GetCursor(self) -> Cursor
4640
4641 Returns a reference to the cursor specified by this event.
4642 """
5b5c9bc7 4643 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
d55e5bfc
RD
4644
4645 def HasCursor(*args, **kwargs):
5ba5649b
RD
4646 """
4647 HasCursor(self) -> bool
4648
4649 Returns true if the cursor specified by this event is a valid cursor.
4650 """
5b5c9bc7 4651 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
d55e5bfc 4652
2131d850 4653_core_.SetCursorEvent_swigregister(SetCursorEvent)
d55e5bfc
RD
4654
4655#---------------------------------------------------------------------------
4656
5b5c9bc7 4657class KeyEvent(Event):
5ba5649b
RD
4658 """
4659 This event class contains information about keypress and character
4660 events. These events are only sent to the widget that currently has
4661 the keyboard focus.
4662
4663 Notice that there are three different kinds of keyboard events in
4664 wxWidgets: key down and up events and char events. The difference
4665 between the first two is clear - the first corresponds to a key press
4666 and the second to a key release - otherwise they are identical. Just
4667 note that if the key is maintained in a pressed state you will
4668 typically get a lot of (automatically generated) down events but only
4669 one up so it is wrong to assume that there is one up event
4670 corresponding to each down one.
4671
4672 Both key events provide untranslated key codes while the char event
4673 carries the translated one. The untranslated code for alphanumeric
4674 keys is always an upper case value. For the other keys it is one of
4675 WXK_XXX values from the keycodes table. The translated key is, in
4676 general, the character the user expects to appear as the result of the
4677 key combination when typing the text into a text entry zone, for
4678 example.
4679
4680 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4681 and the standard US keyboard): when the 'A' key is pressed, the key
4682 down event key code is equal to ASCII A == 65. But the char event key
4683 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4684 'A' keys simultaneously , the key code in key down event will still be
4685 just 'A' while the char event key code parameter will now be 'A' as
4686 well.
4687
4688 Although in this simple case it is clear that the correct key code
4689 could be found in the key down event handler by checking the value
4690 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4691 as for non alphanumeric keys or non-US keyboard layouts the
4692 translation is keyboard-layout dependent and can only be done properly
4693 by the system itself.
4694
4695 Another kind of translation is done when the control key is pressed:
4696 for example, for CTRL-A key press the key down event still carries the
4697 same key code 'A' as usual but the char event will have key code of 1,
4698 the ASCII value of this key combination.
4699
4700 You may discover how the other keys on your system behave
4701 interactively by running the KeyEvents sample in the wxPython demo and
4702 pressing some keys while the blue box at the top has the keyboard
4703 focus.
4704
4705 **Note**: If a key down event is caught and the event handler does not
4706 call event.Skip() then the coresponding char event will not
4707 happen. This is by design and enables the programs that handle both
4708 types of events to be a bit simpler.
4709
4710 **Note for Windows programmers**: The key and char events in wxWidgets
4711 are similar to but slightly different from Windows WM_KEYDOWN and
4712 WM_CHAR events. In particular, Alt-x combination will generate a char
4713 event in wxWidgets (unless it is used as an accelerator).
4714
4715 **Tip**: be sure to call event.Skip() for events that you don't
4716 process in key event function, otherwise menu shortcuts may cease to
4717 work under Windows.
4718
4719 """
1bd55598
RD
4720 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4721 __repr__ = _swig_repr
4722 def __init__(self, *args, **kwargs):
5ba5649b 4723 """
2131d850 4724 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
4725
4726 Construct a new `wx.KeyEvent`. Valid event types are:
4727 *
4728 """
1bd55598 4729 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
4730 def GetModifiers(*args, **kwargs):
4731 """
4732 GetModifiers(self) -> int
4733
4734 Returns a bitmask of the current modifier settings. Can be used to
4735 check if the key event has exactly the given modifiers without having
4736 to explicitly check that the other modifiers are not down. For
4737 example::
4738
4739 if event.GetModifers() == wx.MOD_CONTROL:
4740 DoSomething()
4741
4742 """
4743 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4744
d55e5bfc 4745 def ControlDown(*args, **kwargs):
5ba5649b
RD
4746 """
4747 ControlDown(self) -> bool
4748
4749 Returns ``True`` if the Control key was down at the time of the event.
4750 """
5b5c9bc7 4751 return _core_.KeyEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4752
4753 def MetaDown(*args, **kwargs):
5ba5649b
RD
4754 """
4755 MetaDown(self) -> bool
4756
4757 Returns ``True`` if the Meta key was down at the time of the event.
4758 """
5b5c9bc7 4759 return _core_.KeyEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4760
4761 def AltDown(*args, **kwargs):
5ba5649b
RD
4762 """
4763 AltDown(self) -> bool
4764
4765 Returns ``True`` if the Alt key was down at the time of the event.
4766 """
5b5c9bc7 4767 return _core_.KeyEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4768
4769 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4770 """
4771 ShiftDown(self) -> bool
4772
4773 Returns ``True`` if the Shift key was down at the time of the event.
4774 """
5b5c9bc7 4775 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4776
412d302d
RD
4777 def CmdDown(*args, **kwargs):
4778 """
4779 CmdDown(self) -> bool
4780
4781 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4782 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4783 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
4784 because Cmd key is used for the same thing under Mac as Ctrl
4785 elsewhere. The Ctrl still exists, it's just not used for this
4786 purpose. So for non-Mac platforms this is the same as `ControlDown`
4787 and Macs this is the same as `MetaDown`.
4788 """
5b5c9bc7 4789 return _core_.KeyEvent_CmdDown(*args, **kwargs)
412d302d 4790
d55e5bfc 4791 def HasModifiers(*args, **kwargs):
5ba5649b
RD
4792 """
4793 HasModifiers(self) -> bool
4794
4795 Returns true if either CTRL or ALT keys was down at the time of the
4796 key event. Note that this function does not take into account neither
4797 SHIFT nor META key states (the reason for ignoring the latter is that
4798 it is common for NUMLOCK key to be configured as META under X but the
4799 key presses even while NUMLOCK is on should be still processed
4800 normally).
4801 """
5b5c9bc7 4802 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
d55e5bfc
RD
4803
4804 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
4805 """
4806 GetKeyCode(self) -> int
4807
4808 Returns the virtual key code. ASCII events return normal ASCII values,
4809 while non-ASCII events return values such as WXK_LEFT for the left
4810 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4811 codes.
4812
4813 Note that in Unicode build, the returned value is meaningful only if
4814 the user entered a character that can be represented in current
4815 locale's default charset. You can obtain the corresponding Unicode
4816 character using `GetUnicodeKey`.
4817 """
5b5c9bc7 4818 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
4819
4820 KeyCode = GetKeyCode
bb4524c4 4821 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
4822 """
4823 GetUnicodeKey(self) -> int
4824
4825 Returns the Unicode character corresponding to this key event. This
4826 function is only meaningfule in a Unicode build of wxPython.
4827 """
5b5c9bc7 4828 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 4829
bb4524c4 4830 GetUniChar = GetUnicodeKey
d55e5bfc 4831 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
4832 """
4833 GetRawKeyCode(self) -> unsigned int
4834
4835 Returns the raw key code for this event. This is a platform-dependent
4836 scan code which should only be used in advanced
4837 applications. Currently the raw key codes are not supported by all
4838 ports.
4839 """
5b5c9bc7 4840 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
d55e5bfc
RD
4841
4842 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
4843 """
4844 GetRawKeyFlags(self) -> unsigned int
4845
4846 Returns the low level key flags for this event. The flags are
4847 platform-dependent and should only be used in advanced applications.
4848 Currently the raw key flags are not supported by all ports.
4849 """
5b5c9bc7 4850 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
d55e5bfc
RD
4851
4852 def GetPosition(*args, **kwargs):
4853 """
5b5c9bc7 4854 GetPosition(self) -> Point
d55e5bfc 4855
5ba5649b 4856 Find the position of the event, if applicable.
d55e5bfc 4857 """
5b5c9bc7 4858 return _core_.KeyEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4859
4860 def GetPositionTuple(*args, **kwargs):
4861 """
4862 GetPositionTuple() -> (x,y)
4863
5ba5649b 4864 Find the position of the event, if applicable.
d55e5bfc 4865 """
5b5c9bc7 4866 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
4867
4868 def GetX(*args, **kwargs):
5ba5649b
RD
4869 """
4870 GetX(self) -> int
4871
4872 Returns the X position (in client coordinates) of the event, if
4873 applicable.
4874 """
5b5c9bc7 4875 return _core_.KeyEvent_GetX(*args, **kwargs)
d55e5bfc
RD
4876
4877 def GetY(*args, **kwargs):
5ba5649b
RD
4878 """
4879 GetY(self) -> int
4880
4881 Returns the Y position (in client coordinates) of the event, if
4882 applicable.
4883 """
5b5c9bc7
RD
4884 return _core_.KeyEvent_GetY(*args, **kwargs)
4885
4886 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
4887 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
4888 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
4889 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
4890 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
4891 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
4892 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
4893 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
4894 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
4895 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
2131d850 4896_core_.KeyEvent_swigregister(KeyEvent)
d55e5bfc
RD
4897
4898#---------------------------------------------------------------------------
4899
5b5c9bc7 4900class SizeEvent(Event):
5ba5649b
RD
4901 """
4902 A size event holds information about size change events. The EVT_SIZE
4903 handler function will be called when the window it is bound to has
4904 been resized.
4905
4906 Note that the size passed is of the whole window: call
4907 `wx.Window.GetClientSize` for the area which may be used by the
4908 application.
4909
4910 When a window is resized, usually only a small part of the window is
4911 damaged and and that area is all that is in the update region for the
4912 next paint event. However, if your drawing depends on the size of the
4913 window, you may need to clear the DC explicitly and repaint the whole
4914 window. In which case, you may need to call `wx.Window.Refresh` to
4915 invalidate the entire window.
4916
4917 """
1bd55598
RD
4918 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4919 __repr__ = _swig_repr
4920 def __init__(self, *args, **kwargs):
5ba5649b
RD
4921 """
4922 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
4923
4924 Construct a new ``wx.SizeEvent``.
4925 """
1bd55598 4926 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
d55e5bfc 4927 def GetSize(*args, **kwargs):
5ba5649b
RD
4928 """
4929 GetSize(self) -> Size
4930
4931 Returns the entire size of the window generating the size change
4932 event.
4933 """
5b5c9bc7 4934 return _core_.SizeEvent_GetSize(*args, **kwargs)
d55e5bfc
RD
4935
4936 def GetRect(*args, **kwargs):
5b5c9bc7
RD
4937 """GetRect(self) -> Rect"""
4938 return _core_.SizeEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
4939
4940 def SetRect(*args, **kwargs):
5b5c9bc7
RD
4941 """SetRect(self, Rect rect)"""
4942 return _core_.SizeEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
4943
4944 def SetSize(*args, **kwargs):
5b5c9bc7
RD
4945 """SetSize(self, Size size)"""
4946 return _core_.SizeEvent_SetSize(*args, **kwargs)
d55e5bfc 4947
5b5c9bc7
RD
4948 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
4949 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
2131d850 4950_core_.SizeEvent_swigregister(SizeEvent)
d55e5bfc
RD
4951
4952#---------------------------------------------------------------------------
4953
5b5c9bc7 4954class MoveEvent(Event):
5ba5649b
RD
4955 """
4956 This event object is sent for EVT_MOVE event bindings when a window is
4957 moved to a new position.
4958 """
1bd55598
RD
4959 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4960 __repr__ = _swig_repr
4961 def __init__(self, *args, **kwargs):
5ba5649b
RD
4962 """
4963 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
4964
4965 Constructor.
4966 """
1bd55598 4967 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
d55e5bfc 4968 def GetPosition(*args, **kwargs):
5ba5649b
RD
4969 """
4970 GetPosition(self) -> Point
4971
4972 Returns the position of the window generating the move change event.
4973 """
5b5c9bc7 4974 return _core_.MoveEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4975
4976 def GetRect(*args, **kwargs):
5b5c9bc7
RD
4977 """GetRect(self) -> Rect"""
4978 return _core_.MoveEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
4979
4980 def SetRect(*args, **kwargs):
5b5c9bc7
RD
4981 """SetRect(self, Rect rect)"""
4982 return _core_.MoveEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
4983
4984 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
4985 """SetPosition(self, Point pos)"""
4986 return _core_.MoveEvent_SetPosition(*args, **kwargs)
d55e5bfc 4987
fef4c27a
RD
4988 m_pos = property(GetPosition, SetPosition)
4989 m_rect = property(GetRect, SetRect)
4990
2131d850 4991_core_.MoveEvent_swigregister(MoveEvent)
d55e5bfc
RD
4992
4993#---------------------------------------------------------------------------
4994
5b5c9bc7 4995class PaintEvent(Event):
5ba5649b
RD
4996 """
4997 A paint event is sent when a window's contents needs to be repainted.
4998 Note that in an EVT_PAINT handler the application must *always* create
4999 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5000 Windows assumes that the window has not been painted yet and will send
5001 the event again, causing endless refreshes.
5002
5003 You can optimize painting by retrieving the rectangles that have been
5004 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5005 and only repainting these rectangles. The rectangles are in terms of
5006 the client area, and are unscrolled, so you will need to do some
5007 calculations using the current view position to obtain logical,
5008 scrolled units.
5009
5010 """
1bd55598
RD
5011 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5012 __repr__ = _swig_repr
5013 def __init__(self, *args, **kwargs):
5b5c9bc7 5014 """__init__(self, int Id=0) -> PaintEvent"""
1bd55598 5015 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5016_core_.PaintEvent_swigregister(PaintEvent)
d55e5bfc 5017
5b5c9bc7
RD
5018class NcPaintEvent(Event):
5019 """Proxy of C++ NcPaintEvent class"""
1bd55598
RD
5020 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5021 __repr__ = _swig_repr
5022 def __init__(self, *args, **kwargs):
5b5c9bc7 5023 """__init__(self, int winid=0) -> NcPaintEvent"""
1bd55598 5024 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5025_core_.NcPaintEvent_swigregister(NcPaintEvent)
d55e5bfc
RD
5026
5027#---------------------------------------------------------------------------
5028
5b5c9bc7 5029class EraseEvent(Event):
5ba5649b
RD
5030 """
5031 An erase event is sent whenever the background of a window needs to be
5032 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5033 binder. On some platforms, such as GTK+, this event is simulated
5034 (simply generated just before the paint event) and may cause flicker.
5035
5036 To paint a custom background use the `GetDC` method and use the returned
5037 device context if it is not ``None``, otherwise create a temporary
5038 `wx.ClientDC` and draw on that.
5039
5040 """
1bd55598
RD
5041 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5042 __repr__ = _swig_repr
5043 def __init__(self, *args, **kwargs):
5ba5649b
RD
5044 """
5045 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5046
5047 Constructor
5048 """
1bd55598 5049 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
d55e5bfc 5050 def GetDC(*args, **kwargs):
5ba5649b
RD
5051 """
5052 GetDC(self) -> DC
5053
5054 Returns the device context the event handler should draw upon. If
5055 ``None`` is returned then create a temporary `wx.ClientDC` and use
5056 that instead.
5057 """
5b5c9bc7 5058 return _core_.EraseEvent_GetDC(*args, **kwargs)
d55e5bfc 5059
2131d850 5060_core_.EraseEvent_swigregister(EraseEvent)
d55e5bfc
RD
5061
5062#---------------------------------------------------------------------------
5063
5b5c9bc7 5064class FocusEvent(Event):
5ba5649b
RD
5065 """
5066 A focus event is sent when a window's focus changes. The window losing
5067 focus receives an EVT_KILL_FOCUS event while the window gaining it
5068 gets an EVT_SET_FOCUS event.
5069
5070 Notice that the set focus event happens both when the user gives focus
5071 to the window (whether using the mouse or keyboard) and when it is
5072 done from the program itself using `wx.Window.SetFocus`.
5073
5074 """
1bd55598
RD
5075 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5076 __repr__ = _swig_repr
5077 def __init__(self, *args, **kwargs):
5ba5649b 5078 """
2131d850 5079 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5080
5081 Constructor
5082 """
1bd55598 5083 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
d55e5bfc 5084 def GetWindow(*args, **kwargs):
5ba5649b
RD
5085 """
5086 GetWindow(self) -> Window
5087
5088 Returns the other window associated with this event, that is the
5089 window which had the focus before for the EVT_SET_FOCUS event and the
5090 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5091
5092 Warning: the window returned may be None!
5093 """
5b5c9bc7 5094 return _core_.FocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
5095
5096 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
5097 """SetWindow(self, Window win)"""
5098 return _core_.FocusEvent_SetWindow(*args, **kwargs)
d55e5bfc 5099
2131d850 5100_core_.FocusEvent_swigregister(FocusEvent)
d55e5bfc
RD
5101
5102#---------------------------------------------------------------------------
5103
5b5c9bc7 5104class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5105 """
5106 wx.ChildFocusEvent notifies the parent that a child has received the
5107 focus. Unlike `wx.FocusEvent` it is propagated up the window
5108 heirarchy.
5109 """
1bd55598
RD
5110 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5111 __repr__ = _swig_repr
5112 def __init__(self, *args, **kwargs):
5ba5649b
RD
5113 """
5114 __init__(self, Window win=None) -> ChildFocusEvent
5115
5116 Constructor
5117 """
1bd55598 5118 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
d55e5bfc 5119 def GetWindow(*args, **kwargs):
5ba5649b
RD
5120 """
5121 GetWindow(self) -> Window
5122
5123 The window which has just received the focus.
5124 """
5b5c9bc7 5125 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
d55e5bfc 5126
2131d850 5127_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d55e5bfc
RD
5128
5129#---------------------------------------------------------------------------
5130
5b5c9bc7 5131class ActivateEvent(Event):
5ba5649b
RD
5132 """
5133 An activate event is sent when a top-level window or the entire
5134 application is being activated or deactivated.
5135
5136 A top-level window (a dialog or frame) receives an activate event when
5137 is being activated or deactivated. This is indicated visually by the
5138 title bar changing colour, and a subwindow gaining the keyboard focus.
5139 An application is activated or deactivated when one of its frames
5140 becomes activated, or a frame becomes inactivate resulting in all
5141 application frames being inactive.
5142
5143 Please note that usually you should call event.Skip() in your handlers
5144 for these events so the default handlers will still be called, as not
5145 doing so can result in strange effects.
5146
5147 """
1bd55598
RD
5148 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5149 __repr__ = _swig_repr
5150 def __init__(self, *args, **kwargs):
5ba5649b 5151 """
2131d850 5152 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5153
5154 Constructor
5155 """
1bd55598 5156 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
d55e5bfc 5157 def GetActive(*args, **kwargs):
5ba5649b
RD
5158 """
5159 GetActive(self) -> bool
5160
5161 Returns true if the application or window is being activated, false
5162 otherwise.
5163 """
5b5c9bc7 5164 return _core_.ActivateEvent_GetActive(*args, **kwargs)
d55e5bfc 5165
2131d850 5166_core_.ActivateEvent_swigregister(ActivateEvent)
d55e5bfc
RD
5167
5168#---------------------------------------------------------------------------
5169
5b5c9bc7 5170class InitDialogEvent(Event):
5ba5649b
RD
5171 """
5172 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5173 any window when `wx.Window.InitDialog` is called. Handlers for this
5174 event can transfer data to the window, or anything else that should be
5175 done before the user begins editing the form. The default handler
5176 calls `wx.Window.TransferDataToWindow`.
5177 """
1bd55598
RD
5178 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5179 __repr__ = _swig_repr
5180 def __init__(self, *args, **kwargs):
5ba5649b
RD
5181 """
5182 __init__(self, int Id=0) -> InitDialogEvent
5183
5184 Constructor
5185 """
1bd55598 5186 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5187_core_.InitDialogEvent_swigregister(InitDialogEvent)
d55e5bfc
RD
5188
5189#---------------------------------------------------------------------------
5190
5b5c9bc7 5191class MenuEvent(Event):
5ba5649b
RD
5192 """
5193 This class is used for a variety of menu-related events. Note that
5194 these do not include menu command events, which are handled by sending
5195 `wx.CommandEvent` objects.
5196
5197 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5198 text in the first field of the status bar.
5199 """
1bd55598
RD
5200 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5201 __repr__ = _swig_repr
5202 def __init__(self, *args, **kwargs):
5ba5649b 5203 """
2131d850 5204 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5205
5206 Constructor
5207 """
1bd55598 5208 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
d55e5bfc 5209 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5210 """
5211 GetMenuId(self) -> int
5212
5213 Returns the menu identifier associated with the event. This method
5214 should be only used with the HIGHLIGHT events.
5215 """
5b5c9bc7 5216 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
d55e5bfc
RD
5217
5218 def IsPopup(*args, **kwargs):
5ba5649b
RD
5219 """
5220 IsPopup(self) -> bool
5221
5222 Returns ``True`` if the menu which is being opened or closed is a
5223 popup menu, ``False`` if it is a normal one. This method should only
5224 be used with the OPEN and CLOSE events.
5225 """
5b5c9bc7 5226 return _core_.MenuEvent_IsPopup(*args, **kwargs)
d55e5bfc
RD
5227
5228 def GetMenu(*args, **kwargs):
5ba5649b
RD
5229 """
5230 GetMenu(self) -> Menu
5231
5232 Returns the menu which is being opened or closed. This method should
5233 only be used with the OPEN and CLOSE events.
5234 """
5b5c9bc7 5235 return _core_.MenuEvent_GetMenu(*args, **kwargs)
d55e5bfc 5236
2131d850 5237_core_.MenuEvent_swigregister(MenuEvent)
d55e5bfc
RD
5238
5239#---------------------------------------------------------------------------
5240
5b5c9bc7 5241class CloseEvent(Event):
5ba5649b
RD
5242 """
5243 This event class contains information about window and session close
5244 events.
5245
5246 The handler function for EVT_CLOSE is called when the user has tried
5247 to close a a frame or dialog box using the window manager controls or
5248 the system menu. It can also be invoked by the application itself
5249 programmatically, for example by calling the `wx.Window.Close`
5250 function.
5251
5252 You should check whether the application is forcing the deletion of
5253 the window using `CanVeto`. If it returns ``False``, you must destroy
5254 the window using `wx.Window.Destroy`. If the return value is ``True``,
5255 it is up to you whether you respond by destroying the window or not.
5256 For example you may wish to display a message dialog prompting to save
5257 files or to cancel the close.
5258
5259 If you don't destroy the window, you should call `Veto` to let the
5260 calling code know that you did not destroy the window. This allows the
5261 `wx.Window.Close` function to return ``True`` or ``False`` depending
5262 on whether the close instruction was honored or not.
5263 """
1bd55598
RD
5264 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5265 __repr__ = _swig_repr
5266 def __init__(self, *args, **kwargs):
5ba5649b 5267 """
2131d850 5268 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5269
5270 Constructor.
5271 """
1bd55598 5272 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
d55e5bfc 5273 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5274 """
5275 SetLoggingOff(self, bool logOff)
5276
5277 Sets the 'logging off' flag.
5278 """
5b5c9bc7 5279 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5280
5281 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5282 """
5283 GetLoggingOff(self) -> bool
5284
034e3677
RD
5285 Returns ``True`` if the user is logging off or ``False`` if the
5286 system is shutting down. This method can only be called for end
5287 session and query end session events, it doesn't make sense for close
5288 window event.
5ba5649b 5289 """
5b5c9bc7 5290 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5291
5292 def Veto(*args, **kwargs):
5ba5649b
RD
5293 """
5294 Veto(self, bool veto=True)
5295
5296 Call this from your event handler to veto a system shutdown or to
5297 signal to the calling application that a window close did not happen.
5298
5299 You can only veto a shutdown or close if `CanVeto` returns true.
5300 """
5b5c9bc7 5301 return _core_.CloseEvent_Veto(*args, **kwargs)
d55e5bfc 5302
5ba5649b
RD
5303 def GetVeto(*args, **kwargs):
5304 """GetVeto(self) -> bool"""
5305 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5306
d55e5bfc 5307 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5308 """
5309 SetCanVeto(self, bool canVeto)
5310
5311 Sets the 'can veto' flag.
5312 """
5b5c9bc7 5313 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
d55e5bfc
RD
5314
5315 def CanVeto(*args, **kwargs):
5ba5649b
RD
5316 """
5317 CanVeto(self) -> bool
d55e5bfc 5318
5ba5649b
RD
5319 Returns true if you can veto a system shutdown or a window close
5320 event. Vetoing a window close event is not possible if the calling
5321 code wishes to force the application to exit, and so this function
5322 must be called to check this.
5323 """
5324 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc 5325
2131d850 5326_core_.CloseEvent_swigregister(CloseEvent)
d55e5bfc
RD
5327
5328#---------------------------------------------------------------------------
5329
5b5c9bc7 5330class ShowEvent(Event):
5ba5649b 5331 """An EVT_SHOW event is sent when a window is shown or hidden."""
1bd55598
RD
5332 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5333 __repr__ = _swig_repr
5334 def __init__(self, *args, **kwargs):
5ba5649b
RD
5335 """
5336 __init__(self, int winid=0, bool show=False) -> ShowEvent
5337
5338 An EVT_SHOW event is sent when a window is shown or hidden.
5339 """
1bd55598 5340 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
d55e5bfc
RD
5341 def SetShow(*args, **kwargs):
5342 """SetShow(self, bool show)"""
5b5c9bc7 5343 return _core_.ShowEvent_SetShow(*args, **kwargs)
d55e5bfc
RD
5344
5345 def GetShow(*args, **kwargs):
5346 """GetShow(self) -> bool"""
5b5c9bc7 5347 return _core_.ShowEvent_GetShow(*args, **kwargs)
d55e5bfc 5348
2131d850 5349_core_.ShowEvent_swigregister(ShowEvent)
d55e5bfc
RD
5350
5351#---------------------------------------------------------------------------
5352
5b5c9bc7 5353class IconizeEvent(Event):
5ba5649b
RD
5354 """
5355 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5356 restored.
5357 """
1bd55598
RD
5358 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5359 __repr__ = _swig_repr
5360 def __init__(self, *args, **kwargs):
5ba5649b
RD
5361 """
5362 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5363
5364 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5365 restored.
5366 """
1bd55598 5367 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
d55e5bfc 5368 def Iconized(*args, **kwargs):
5ba5649b
RD
5369 """
5370 Iconized(self) -> bool
5371
5372 Returns ``True`` if the frame has been iconized, ``False`` if it has
5373 been restored.
5374 """
5b5c9bc7 5375 return _core_.IconizeEvent_Iconized(*args, **kwargs)
d55e5bfc 5376
2131d850 5377_core_.IconizeEvent_swigregister(IconizeEvent)
d55e5bfc
RD
5378
5379#---------------------------------------------------------------------------
5380
5b5c9bc7 5381class MaximizeEvent(Event):
5ba5649b 5382 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
1bd55598
RD
5383 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5384 __repr__ = _swig_repr
5385 def __init__(self, *args, **kwargs):
5ba5649b
RD
5386 """
5387 __init__(self, int id=0) -> MaximizeEvent
5388
5389 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5390 """
1bd55598 5391 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5392_core_.MaximizeEvent_swigregister(MaximizeEvent)
d55e5bfc
RD
5393
5394#---------------------------------------------------------------------------
5395
5b5c9bc7 5396class DropFilesEvent(Event):
5ba5649b
RD
5397 """
5398 This class is used for drop files events, that is, when files have
5399 been dropped onto the window. This functionality is only available
5400 under Windows. The window must have previously been enabled for
5401 dropping by calling `wx.Window.DragAcceptFiles`.
5402
5403 Important note: this is a separate implementation to the more general
5404 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5405 implementation uses the older, Windows message-based approach of
5406 dropping files.
5407
5408 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5409 events.
5410
5411 """
1bd55598
RD
5412 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5413 def __init__(self): raise AttributeError, "No constructor defined"
5414 __repr__ = _swig_repr
d55e5bfc 5415 def GetPosition(*args, **kwargs):
5ba5649b
RD
5416 """
5417 GetPosition(self) -> Point
5418
5419 Returns the position at which the files were dropped.
5420 """
5b5c9bc7 5421 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5422
5423 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5424 """
5425 GetNumberOfFiles(self) -> int
5426
5427 Returns the number of files dropped.
5428 """
5b5c9bc7 5429 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
d55e5bfc
RD
5430
5431 def GetFiles(*args, **kwargs):
5ba5649b
RD
5432 """
5433 GetFiles(self) -> PyObject
5434
5435 Returns a list of the filenames that were dropped.
5436 """
5b5c9bc7 5437 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
d55e5bfc 5438
2131d850 5439_core_.DropFilesEvent_swigregister(DropFilesEvent)
d55e5bfc
RD
5440
5441#---------------------------------------------------------------------------
5442
5b5c9bc7
RD
5443UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5444UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5445class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5446 """
5447 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5448 wxWidgets to give an application the chance to update various user
5449 interface elements.
5450
5451 Without update UI events, an application has to work hard to
5452 check/uncheck, enable/disable, and set the text for elements such as
5453 menu items and toolbar buttons. The code for doing this has to be
5454 mixed up with the code that is invoked when an action is invoked for a
5455 menu item or button.
5456
5457 With update UI events, you define an event handler to look at the
5458 state of the application and change UI elements accordingly. wxWidgets
5459 will call your handler functions in idle time, so you don't have to
5460 worry where to call this code. In addition to being a clearer and more
5461 declarative method, it also means you don't have to worry whether
5462 you're updating a toolbar or menubar identifier. The same handler can
5463 update a menu item and toolbar button, if the ID values are the same.
5464
5465 Instead of directly manipulating the menu or button, you call
5466 functions in the event object, such as `Check`. wxWidgets will
5467 determine whether such a call has been made, and which UI element to
5468 update.
5469
5470 These events will work for popup menus as well as menubars. Just
5471 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5472 any UI events for the window that owns the menu.
5473
5474 If you find that the overhead of UI update processing is affecting
5475 your application, you can do one or both of the following:
5476
5477 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5478 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5479 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5480 receive update events. No other windows will receive update
5481 events.
5482
5483 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5484 value to set the delay between updates. You may need to call
5485 `wx.Window.UpdateWindowUI` at critical points, for example when
5486 a dialog is about to be shown, in case the user sees a slight
5487 delay before windows are updated.
5488
5489 Note that although events are sent in idle time, defining a EVT_IDLE
5490 handler for a window does not affect this because the events are sent
5491 from an internal idle handler.
5492
5493 wxWidgets tries to optimize update events on some platforms. On
5494 Windows and GTK+, events for menubar items are only sent when the menu
5495 is about to be shown, and not in idle time.
5496
5497 """
1bd55598
RD
5498 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5499 __repr__ = _swig_repr
5500 def __init__(self, *args, **kwargs):
5ba5649b
RD
5501 """
5502 __init__(self, int commandId=0) -> UpdateUIEvent
5503
5504 Constructor
5505 """
1bd55598 5506 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
d55e5bfc 5507 def GetChecked(*args, **kwargs):
5ba5649b
RD
5508 """
5509 GetChecked(self) -> bool
5510
5511 Returns ``True`` if the UI element should be checked.
5512 """
5b5c9bc7 5513 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
d55e5bfc
RD
5514
5515 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5516 """
5517 GetEnabled(self) -> bool
5518
5519 Returns ``True`` if the UI element should be enabled.
5520 """
5b5c9bc7 5521 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
d55e5bfc 5522
b1fcee84
RD
5523 def GetShown(*args, **kwargs):
5524 """
5525 GetShown(self) -> bool
5526
5527 Returns ``True`` if the UI element should be shown.
5528 """
5529 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5530
d55e5bfc 5531 def GetText(*args, **kwargs):
5ba5649b
RD
5532 """
5533 GetText(self) -> String
5534
5535 Returns the text that should be set for the UI element.
5536 """
5b5c9bc7 5537 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
d55e5bfc
RD
5538
5539 def GetSetText(*args, **kwargs):
5ba5649b
RD
5540 """
5541 GetSetText(self) -> bool
5542
5543 Returns ``True`` if the application has called `SetText`. For
5544 wxWidgets internal use only.
5545 """
5b5c9bc7 5546 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
d55e5bfc
RD
5547
5548 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5549 """
5550 GetSetChecked(self) -> bool
5551
5552 Returns ``True`` if the application has called `Check`. For wxWidgets
5553 internal use only.
5554 """
5b5c9bc7 5555 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
d55e5bfc
RD
5556
5557 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5558 """
5559 GetSetEnabled(self) -> bool
5560
5561 Returns ``True`` if the application has called `Enable`. For wxWidgets
5562 internal use only.
5563 """
5b5c9bc7 5564 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
d55e5bfc 5565
b1fcee84
RD
5566 def GetSetShown(*args, **kwargs):
5567 """
5568 GetSetShown(self) -> bool
5569
5570 Returns ``True`` if the application has called `Show`. For wxWidgets
5571 internal use only.
5572 """
5573 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5574
d55e5bfc 5575 def Check(*args, **kwargs):
5ba5649b
RD
5576 """
5577 Check(self, bool check)
5578
5579 Check or uncheck the UI element.
5580 """
5b5c9bc7 5581 return _core_.UpdateUIEvent_Check(*args, **kwargs)
d55e5bfc
RD
5582
5583 def Enable(*args, **kwargs):
5ba5649b
RD
5584 """
5585 Enable(self, bool enable)
5586
5587 Enable or disable the UI element.
5588 """
5b5c9bc7 5589 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
d55e5bfc 5590
b1fcee84
RD
5591 def Show(*args, **kwargs):
5592 """
5593 Show(self, bool show)
5594
5595 Show or hide the UI element.
5596 """
5597 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5598
d55e5bfc 5599 def SetText(*args, **kwargs):
5ba5649b
RD
5600 """
5601 SetText(self, String text)
5602
5603 Sets the text for this UI element.
5604 """
5b5c9bc7 5605 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
d55e5bfc
RD
5606
5607 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5608 """
5609 SetUpdateInterval(long updateInterval)
5610
5611 Sets the interval between updates in milliseconds. Set to -1 to
5612 disable updates, or to 0 to update as frequently as possible. The
5613 default is 0.
5614
5615 Use this to reduce the overhead of UI update events if your
5616 application has a lot of windows. If you set the value to -1 or
5617 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5618 at appropriate points in your application, such as when a dialog is
5619 about to be shown.
5620 """
5b5c9bc7 5621 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5622
5623 SetUpdateInterval = staticmethod(SetUpdateInterval)
5624 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5625 """
5626 GetUpdateInterval() -> long
5627
5628 Returns the current interval between updates in milliseconds. -1
5629 disables updates, 0 updates as frequently as possible.
5630 """
5b5c9bc7 5631 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
5632
5633 GetUpdateInterval = staticmethod(GetUpdateInterval)
5634 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5635 """
5636 CanUpdate(Window win) -> bool
5637
5638 Returns ``True`` if it is appropriate to update (send UI update events
5639 to) this window.
5640
5641 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5642 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5643 events were last sent in idle time, and the update interval, to
5644 determine whether events should be sent to this window now. By default
5645 this will always return true because the update mode is initially
5646 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5647 events will be sent as often as possible. You can reduce the frequency
5648 that events are sent by changing the mode and/or setting an update
5649 interval.
5650
5651 """
5b5c9bc7 5652 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc
RD
5653
5654 CanUpdate = staticmethod(CanUpdate)
5655 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5656 """
5657 ResetUpdateTime()
5658
5659 Used internally to reset the last-updated time to the current time. It
5660 is assumed that update events are normally sent in idle time, so this
5661 is called at the end of idle processing.
5662 """
5b5c9bc7 5663 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc
RD
5664
5665 ResetUpdateTime = staticmethod(ResetUpdateTime)
5666 def SetMode(*args, **kwargs):
5ba5649b
RD
5667 """
5668 SetMode(int mode)
5669
5670 Specify how wxWidgets will send update events: to all windows, or only
5671 to those which specify that they will process the events.
5672
5673 The mode may be one of the following values:
5674
5675 ============================= ==========================================
5676 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5677 is the default setting.
5678 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5679 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5680 style set.
5681 ============================= ==========================================
5682
5683 """
5b5c9bc7 5684 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
5685
5686 SetMode = staticmethod(SetMode)
5687 def GetMode(*args, **kwargs):
5ba5649b
RD
5688 """
5689 GetMode() -> int
5690
5691 Returns a value specifying how wxWidgets will send update events: to
5692 all windows, or only to those which specify that they will process the
5693 events.
5694 """
5b5c9bc7 5695 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
5696
5697 GetMode = staticmethod(GetMode)
2131d850 5698_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d55e5bfc 5699
5b5c9bc7 5700def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
1bd55598 5701 """
5ba5649b
RD
5702 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5703
5704 Sets the interval between updates in milliseconds. Set to -1 to
5705 disable updates, or to 0 to update as frequently as possible. The
5706 default is 0.
5707
5708 Use this to reduce the overhead of UI update events if your
5709 application has a lot of windows. If you set the value to -1 or
5710 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5711 at appropriate points in your application, such as when a dialog is
5712 about to be shown.
5713 """
1bd55598 5714 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 5715
1bd55598
RD
5716def UpdateUIEvent_GetUpdateInterval(*args):
5717 """
5ba5649b
RD
5718 UpdateUIEvent_GetUpdateInterval() -> long
5719
5720 Returns the current interval between updates in milliseconds. -1
5721 disables updates, 0 updates as frequently as possible.
5722 """
1bd55598 5723 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d55e5bfc 5724
5b5c9bc7 5725def UpdateUIEvent_CanUpdate(*args, **kwargs):
1bd55598 5726 """
5ba5649b
RD
5727 UpdateUIEvent_CanUpdate(Window win) -> bool
5728
5729 Returns ``True`` if it is appropriate to update (send UI update events
5730 to) this window.
5731
5732 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5733 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5734 events were last sent in idle time, and the update interval, to
5735 determine whether events should be sent to this window now. By default
5736 this will always return true because the update mode is initially
5737 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5738 events will be sent as often as possible. You can reduce the frequency
5739 that events are sent by changing the mode and/or setting an update
5740 interval.
5741
5742 """
1bd55598 5743 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 5744
1bd55598
RD
5745def UpdateUIEvent_ResetUpdateTime(*args):
5746 """
5ba5649b
RD
5747 UpdateUIEvent_ResetUpdateTime()
5748
5749 Used internally to reset the last-updated time to the current time. It
5750 is assumed that update events are normally sent in idle time, so this
5751 is called at the end of idle processing.
5752 """
1bd55598 5753 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d55e5bfc 5754
5b5c9bc7 5755def UpdateUIEvent_SetMode(*args, **kwargs):
1bd55598 5756 """
5ba5649b
RD
5757 UpdateUIEvent_SetMode(int mode)
5758
5759 Specify how wxWidgets will send update events: to all windows, or only
5760 to those which specify that they will process the events.
5761
5762 The mode may be one of the following values:
5763
5764 ============================= ==========================================
5765 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5766 is the default setting.
5767 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5768 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5769 style set.
5770 ============================= ==========================================
5771
5772 """
1bd55598 5773 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 5774
1bd55598
RD
5775def UpdateUIEvent_GetMode(*args):
5776 """
5ba5649b
RD
5777 UpdateUIEvent_GetMode() -> int
5778
5779 Returns a value specifying how wxWidgets will send update events: to
5780 all windows, or only to those which specify that they will process the
5781 events.
5782 """
1bd55598 5783 return _core_.UpdateUIEvent_GetMode(*args)
d55e5bfc
RD
5784
5785#---------------------------------------------------------------------------
5786
5b5c9bc7 5787class SysColourChangedEvent(Event):
5ba5649b
RD
5788 """
5789 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5790 when the user changes the colour settings using the control
5791 panel. This is only applicable under Windows.
5792
5793 The default event handler for this event propagates the event to child
5794 windows, since Windows only sends the events to top-level windows. If
5795 intercepting this event for a top-level window, remember to call
5796 `Skip` so the the base class handler will still be executed, or to
5797 pass the event on to the window's children explicitly.
5798
5799 """
1bd55598
RD
5800 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5801 __repr__ = _swig_repr
5802 def __init__(self, *args, **kwargs):
5ba5649b
RD
5803 """
5804 __init__(self) -> SysColourChangedEvent
5805
5806 Constructor
5807 """
1bd55598 5808 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 5809_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d55e5bfc
RD
5810
5811#---------------------------------------------------------------------------
5812
5b5c9bc7 5813class MouseCaptureChangedEvent(Event):
5ba5649b
RD
5814 """
5815 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5816 a window that loses its mouse capture. This is called even if
5817 `wx.Window.ReleaseMouse` was called by the application code. Handling
5818 this event allows an application to cater for unexpected capture
5819 releases which might otherwise confuse mouse handling code.
5820
5821 This event is implemented under Windows only.
5822 """
1bd55598
RD
5823 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5824 __repr__ = _swig_repr
5825 def __init__(self, *args, **kwargs):
5ba5649b
RD
5826 """
5827 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5828
5829 Constructor
5830 """
1bd55598 5831 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
d55e5bfc 5832 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
5833 """
5834 GetCapturedWindow(self) -> Window
5835
5836 Returns the window that gained the capture, or ``None`` if it was a
5837 non-wxWidgets window.
5838 """
5b5c9bc7 5839 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
d55e5bfc 5840
2131d850 5841_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d55e5bfc
RD
5842
5843#---------------------------------------------------------------------------
5844
5b5c9bc7 5845class DisplayChangedEvent(Event):
5ba5649b
RD
5846 """
5847 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
5848 resolution has changed.
5849
5850 This event is implemented under Windows only.
5851 """
1bd55598
RD
5852 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5853 __repr__ = _swig_repr
5854 def __init__(self, *args, **kwargs):
5b5c9bc7 5855 """__init__(self) -> DisplayChangedEvent"""
1bd55598 5856 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 5857_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d55e5bfc
RD
5858
5859#---------------------------------------------------------------------------
5860
5b5c9bc7 5861class PaletteChangedEvent(Event):
5ba5649b
RD
5862 """
5863 An EVT_PALETTE_CHANGED event is sent when the system palette has
5864 changed, thereby giving each window a chance to redo their own to
5865 match.
5866
5867 This event is implemented under Windows only.
5868 """
1bd55598
RD
5869 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5870 __repr__ = _swig_repr
5871 def __init__(self, *args, **kwargs):
5ba5649b
RD
5872 """
5873 __init__(self, int id=0) -> PaletteChangedEvent
5874
5875 An EVT_PALETTE_CHANGED event is sent when the system palette has
5876 changed, thereby giving each window a chance to redo their own to
5877 match.
5878
5879 This event is implemented under Windows only.
5880 """
1bd55598 5881 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
d55e5bfc 5882 def SetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
5883 """SetChangedWindow(self, Window win)"""
5884 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
d55e5bfc
RD
5885
5886 def GetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
5887 """GetChangedWindow(self) -> Window"""
5888 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
d55e5bfc 5889
2131d850 5890_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d55e5bfc
RD
5891
5892#---------------------------------------------------------------------------
5893
5b5c9bc7 5894class QueryNewPaletteEvent(Event):
5ba5649b
RD
5895 """
5896 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
5897 focus and should re-do its palette.
5898
5899 This event is implemented under Windows only.
5900 """
1bd55598
RD
5901 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5902 __repr__ = _swig_repr
5903 def __init__(self, *args, **kwargs):
5ba5649b
RD
5904 """
5905 __init__(self, int winid=0) -> QueryNewPaletteEvent
5906
5907 Constructor.
5908 """
1bd55598 5909 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
d55e5bfc 5910 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
5911 """
5912 SetPaletteRealized(self, bool realized)
5913
5914 App should set this if it changes the palette.
5915 """
5b5c9bc7 5916 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
5917
5918 def GetPaletteRealized(*args, **kwargs):
5919 """GetPaletteRealized(self) -> bool"""
5b5c9bc7 5920 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
d55e5bfc 5921
2131d850 5922_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d55e5bfc
RD
5923
5924#---------------------------------------------------------------------------
5925
5b5c9bc7 5926class NavigationKeyEvent(Event):
5ba5649b
RD
5927 """
5928 EVT_NAVIGATION_KEY events are used to control moving the focus between
5929 widgets, otherwise known as tab-traversal. You woudl normally not
5930 catch navigation events in applications as there are already
5931 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
5932 it useful to send navigation events in certain situations to change
5933 the focus in certain ways, although it's probably easier to just call
5934 `wx.Window.Navigate`.
5935 """
1bd55598
RD
5936 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5937 __repr__ = _swig_repr
5938 def __init__(self, *args, **kwargs):
5b5c9bc7 5939 """__init__(self) -> NavigationKeyEvent"""
1bd55598 5940 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
d55e5bfc 5941 def GetDirection(*args, **kwargs):
5ba5649b
RD
5942 """
5943 GetDirection(self) -> bool
5944
5945 Returns ``True`` if the direction is forward, ``False`` otherwise.
5946 """
5b5c9bc7 5947 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
d55e5bfc
RD
5948
5949 def SetDirection(*args, **kwargs):
5ba5649b
RD
5950 """
5951 SetDirection(self, bool forward)
5952
5953 Specify the direction that the navigation should take. Usually the
5954 difference between using Tab and Shift-Tab.
5955 """
5b5c9bc7 5956 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
d55e5bfc
RD
5957
5958 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
5959 """
5960 IsWindowChange(self) -> bool
5961
5962 Returns ``True`` if window change is allowed.
5963 """
5b5c9bc7 5964 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
d55e5bfc
RD
5965
5966 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
5967 """
5968 SetWindowChange(self, bool ischange)
5969
5970 Specify if the navigation should be able to change parent windows.
5971 For example, changing notebook pages, etc. This is usually implemented
5972 by using Control-Tab.
5973 """
5b5c9bc7 5974 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
d55e5bfc 5975
68350608 5976 def IsFromTab(*args, **kwargs):
5ba5649b
RD
5977 """
5978 IsFromTab(self) -> bool
5979
5980 Returns ``True`` if the navigation event is originated from the Tab
5981 key.
5982 """
5b5c9bc7 5983 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
68350608
RD
5984
5985 def SetFromTab(*args, **kwargs):
5ba5649b
RD
5986 """
5987 SetFromTab(self, bool bIs)
5988
5989 Set to true under MSW if the event was generated using the tab key.
5990 This is required for proper navogation over radio buttons.
5991 """
5b5c9bc7 5992 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
68350608 5993
908b74cd 5994 def SetFlags(*args, **kwargs):
5ba5649b
RD
5995 """
5996 SetFlags(self, long flags)
5997
5998 Set the navigation flags to a combination of the following:
5999
6000 * wx.NavigationKeyEvent.IsBackward
6001 * wx.NavigationKeyEvent.IsForward
6002 * wx.NavigationKeyEvent.WinChange
6003 * wx.NavigationKeyEvent.FromTab
6004
6005 """
5b5c9bc7 6006 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
908b74cd 6007
d55e5bfc 6008 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6009 """
6010 GetCurrentFocus(self) -> Window
6011
6012 Returns the child window which currenty has the focus. May be
6013 ``None``.
6014 """
5b5c9bc7 6015 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
d55e5bfc
RD
6016
6017 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6018 """
6019 SetCurrentFocus(self, Window win)
6020
6021 Set the window that has the focus.
6022 """
5b5c9bc7 6023 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
d55e5bfc 6024
5b5c9bc7
RD
6025 IsBackward = _core_.NavigationKeyEvent_IsBackward
6026 IsForward = _core_.NavigationKeyEvent_IsForward
6027 WinChange = _core_.NavigationKeyEvent_WinChange
6028 FromTab = _core_.NavigationKeyEvent_FromTab
2131d850 6029_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d55e5bfc
RD
6030
6031#---------------------------------------------------------------------------
6032
5b5c9bc7 6033class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6034 """
6035 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6036 underlying GUI object) exists.
6037 """
1bd55598
RD
6038 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6039 __repr__ = _swig_repr
6040 def __init__(self, *args, **kwargs):
5ba5649b
RD
6041 """
6042 __init__(self, Window win=None) -> WindowCreateEvent
6043
6044 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6045 underlying GUI object) exists.
6046 """
1bd55598 6047 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
d55e5bfc 6048 def GetWindow(*args, **kwargs):
5ba5649b
RD
6049 """
6050 GetWindow(self) -> Window
6051
6052 Returns the window that this event refers to.
6053 """
5b5c9bc7 6054 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
d55e5bfc 6055
2131d850 6056_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d55e5bfc 6057
5b5c9bc7 6058class WindowDestroyEvent(CommandEvent):
5ba5649b 6059 """
943e8dfd
RD
6060 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6061 when the GUI window is destroyed.
6062
6063 When a class derived from `wx.Window` is destroyed its destructor will
6064 have already run by the time this event is sent. Therefore this event
6065 will not usually be received at all by the window itself. Since it is
6066 received after the destructor has run, an object should not try to
6067 handle its own wx.WindowDestroyEvent, but it can be used to get
6068 notification of the destruction of another window.
5ba5649b 6069 """
1bd55598
RD
6070 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6071 __repr__ = _swig_repr
6072 def __init__(self, *args, **kwargs):
5ba5649b
RD
6073 """
6074 __init__(self, Window win=None) -> WindowDestroyEvent
6075
943e8dfd
RD
6076 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6077 when the GUI window is destroyed.
6078
6079 When a class derived from `wx.Window` is destroyed its destructor will
6080 have already run by the time this event is sent. Therefore this event
6081 will not usually be received at all by the window itself. Since it is
6082 received after the destructor has run, an object should not try to
6083 handle its own wx.WindowDestroyEvent, but it can be used to get
6084 notification of the destruction of another window.
5ba5649b 6085 """
1bd55598 6086 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
d55e5bfc 6087 def GetWindow(*args, **kwargs):
5ba5649b
RD
6088 """
6089 GetWindow(self) -> Window
6090
6091 Returns the window that this event refers to.
6092 """
5b5c9bc7 6093 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
d55e5bfc 6094
2131d850 6095_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d55e5bfc
RD
6096
6097#---------------------------------------------------------------------------
6098
5b5c9bc7 6099class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6100 """
6101 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6102 give the application a chance to show a context (popup) menu.
6103 """
1bd55598
RD
6104 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6105 __repr__ = _swig_repr
6106 def __init__(self, *args, **kwargs):
5ba5649b 6107 """
2131d850 6108 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6109
6110 Constructor.
6111 """
1bd55598 6112 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
d55e5bfc 6113 def GetPosition(*args, **kwargs):
5ba5649b
RD
6114 """
6115 GetPosition(self) -> Point
6116
6117 Returns the position (in screen coordinants) at which the menu should
6118 be shown.
6119 """
5b5c9bc7 6120 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
6121
6122 def SetPosition(*args, **kwargs):
5ba5649b
RD
6123 """
6124 SetPosition(self, Point pos)
6125
6126 Sets the position at which the menu should be shown.
6127 """
5b5c9bc7 6128 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
d55e5bfc 6129
2131d850 6130_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d55e5bfc
RD
6131
6132#---------------------------------------------------------------------------
6133
5b5c9bc7
RD
6134IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6135IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6136class IdleEvent(Event):
5ba5649b
RD
6137 """
6138 This class is used for EVT_IDLE events, which are generated and sent
6139 when the application *becomes* idle. In other words, the when the
6140 event queue becomes empty then idle events are sent to all windows (by
6141 default) and as long as none of them call `RequestMore` then there are
6142 no more idle events until after the system event queue has some normal
6143 events and then becomes empty again.
6144
6145 By default, idle events are sent to all windows. If this is causing a
6146 significant overhead in your application, you can call
6147 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6148 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6149 which should receive idle events. Then idle events will only be sent
6150 to those windows and not to any others.
6151 """
1bd55598
RD
6152 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6153 __repr__ = _swig_repr
6154 def __init__(self, *args, **kwargs):
5ba5649b
RD
6155 """
6156 __init__(self) -> IdleEvent
6157
6158 Constructor
6159 """
1bd55598 6160 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
d55e5bfc 6161 def RequestMore(*args, **kwargs):
5ba5649b
RD
6162 """
6163 RequestMore(self, bool needMore=True)
6164
6165 Tells wxWidgets that more processing is required. This function can be
6166 called by an EVT_IDLE handler for a window to indicate that the
6167 application should forward the EVT_IDLE event once more to the
6168 application windows. If no window calls this function during its
6169 EVT_IDLE handler, then the application will remain in a passive event
6170 loop until a new event is posted to the application by the windowing
6171 system.
6172 """
5b5c9bc7 6173 return _core_.IdleEvent_RequestMore(*args, **kwargs)
d55e5bfc
RD
6174
6175 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6176 """
6177 MoreRequested(self) -> bool
6178
6179 Returns ``True`` if the OnIdle function processing this event
6180 requested more processing time.
6181 """
5b5c9bc7 6182 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
d55e5bfc
RD
6183
6184 def SetMode(*args, **kwargs):
5ba5649b
RD
6185 """
6186 SetMode(int mode)
6187
6188 Static method for specifying how wxWidgets will send idle events: to
6189 all windows, or only to those which specify that they will process the
6190 events.
6191
6192 The mode can be one of the following values:
6193
6194 ========================= ========================================
6195 wx.IDLE_PROCESS_ALL Send idle events to all windows
6196 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6197 the wx.WS_EX_PROCESS_IDLE extra style
6198 flag set.
6199 ========================= ========================================
6200
6201 """
5b5c9bc7 6202 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
6203
6204 SetMode = staticmethod(SetMode)
6205 def GetMode(*args, **kwargs):
5ba5649b
RD
6206 """
6207 GetMode() -> int
6208
6209 Static method returning a value specifying how wxWidgets will send
6210 idle events: to all windows, or only to those which specify that they
6211 will process the events.
6212 """
5b5c9bc7 6213 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6214
6215 GetMode = staticmethod(GetMode)
6216 def CanSend(*args, **kwargs):
5ba5649b
RD
6217 """
6218 CanSend(Window win) -> bool
6219
6220 Returns ``True`` if it is appropriate to send idle events to this
6221 window.
6222
6223 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6224 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6225 events should be sent to this window now. By default this will always
6226 return ``True`` because the update mode is initially
6227 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6228 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6229 """
5b5c9bc7 6230 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6231
6232 CanSend = staticmethod(CanSend)
2131d850 6233_core_.IdleEvent_swigregister(IdleEvent)
d55e5bfc 6234
5b5c9bc7 6235def IdleEvent_SetMode(*args, **kwargs):
1bd55598 6236 """
5ba5649b
RD
6237 IdleEvent_SetMode(int mode)
6238
6239 Static method for specifying how wxWidgets will send idle events: to
6240 all windows, or only to those which specify that they will process the
6241 events.
6242
6243 The mode can be one of the following values:
6244
6245 ========================= ========================================
6246 wx.IDLE_PROCESS_ALL Send idle events to all windows
6247 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6248 the wx.WS_EX_PROCESS_IDLE extra style
6249 flag set.
6250 ========================= ========================================
6251
6252 """
1bd55598 6253 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6254
1bd55598
RD
6255def IdleEvent_GetMode(*args):
6256 """
5ba5649b
RD
6257 IdleEvent_GetMode() -> int
6258
6259 Static method returning a value specifying how wxWidgets will send
6260 idle events: to all windows, or only to those which specify that they
6261 will process the events.
6262 """
1bd55598 6263 return _core_.IdleEvent_GetMode(*args)
d55e5bfc 6264
5b5c9bc7 6265def IdleEvent_CanSend(*args, **kwargs):
1bd55598 6266 """
5ba5649b
RD
6267 IdleEvent_CanSend(Window win) -> bool
6268
6269 Returns ``True`` if it is appropriate to send idle events to this
6270 window.
6271
6272 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6273 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6274 events should be sent to this window now. By default this will always
6275 return ``True`` because the update mode is initially
6276 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6277 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6278 """
1bd55598 6279 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6280
6281#---------------------------------------------------------------------------
6282
2131d850
RD
6283class ClipboardTextEvent(CommandEvent):
6284 """
6285 A Clipboard Text event is sent when a window intercepts a text
6286 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6287 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6288 popup menu command, etc. NOTE : under windows these events are *NOT*
6289 generated automatically for a Rich Edit text control.
6290 """
6291 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6292 __repr__ = _swig_repr
6293 def __init__(self, *args, **kwargs):
6294 """
6295 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6296
6297 A Clipboard Text event is sent when a window intercepts a text
6298 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6299 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6300 popup menu command, etc. NOTE : under windows these events are *NOT*
6301 generated automatically for a Rich Edit text control.
6302 """
6303 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6304_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6305
6306#---------------------------------------------------------------------------
6307
5b5c9bc7 6308class PyEvent(Event):
5ba5649b
RD
6309 """
6310 wx.PyEvent can be used as a base class for implementing custom event
6311 types in Python. You should derived from this class instead of
6312 `wx.Event` because this class is Python-aware and is able to transport
6313 its Python bits safely through the wxWidgets event system and have
6314 them still be there when the event handler is invoked.
6315
6316 :see: `wx.PyCommandEvent`
6317
6318 """
1bd55598
RD
6319 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6320 __repr__ = _swig_repr
6321 def __init__(self, *args, **kwargs):
2131d850 6322 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
1bd55598 6323 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6324 self._SetSelf(self)
d55e5bfc 6325
1bd55598
RD
6326 __swig_destroy__ = _core_.delete_PyEvent
6327 __del__ = lambda self : None;
5ba5649b
RD
6328 def _SetSelf(*args, **kwargs):
6329 """_SetSelf(self, PyObject self)"""
6330 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6331
5ba5649b
RD
6332 def _GetSelf(*args, **kwargs):
6333 """_GetSelf(self) -> PyObject"""
6334 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc 6335
2131d850 6336_core_.PyEvent_swigregister(PyEvent)
d55e5bfc 6337
5b5c9bc7 6338class PyCommandEvent(CommandEvent):
5ba5649b
RD
6339 """
6340 wx.PyCommandEvent can be used as a base class for implementing custom
6341 event types in Python, where the event shoudl travel up to parent
6342 windows looking for a handler. You should derived from this class
6343 instead of `wx.CommandEvent` because this class is Python-aware and is
6344 able to transport its Python bits safely through the wxWidgets event
6345 system and have them still be there when the event handler is invoked.
6346
6347 :see: `wx.PyEvent`
6348
6349 """
1bd55598
RD
6350 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6351 __repr__ = _swig_repr
6352 def __init__(self, *args, **kwargs):
2131d850 6353 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
1bd55598 6354 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6355 self._SetSelf(self)
d55e5bfc 6356
1bd55598
RD
6357 __swig_destroy__ = _core_.delete_PyCommandEvent
6358 __del__ = lambda self : None;
5ba5649b
RD
6359 def _SetSelf(*args, **kwargs):
6360 """_SetSelf(self, PyObject self)"""
6361 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6362
5ba5649b
RD
6363 def _GetSelf(*args, **kwargs):
6364 """_GetSelf(self) -> PyObject"""
6365 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc 6366
2131d850 6367_core_.PyCommandEvent_swigregister(PyCommandEvent)
d55e5bfc 6368
5b5c9bc7 6369class DateEvent(CommandEvent):
5ba5649b
RD
6370 """
6371 This event class holds information about a date change event and is
6372 used together with `wx.DatePickerCtrl`. It also serves as a base class
6373 for `wx.calendar.CalendarEvent`. Bind these event types with
6374 EVT_DATE_CHANGED.
6375 """
1bd55598
RD
6376 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6377 __repr__ = _swig_repr
6378 def __init__(self, *args, **kwargs):
2131d850 6379 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
1bd55598 6380 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6381 def GetDate(*args, **kwargs):
5ba5649b
RD
6382 """
6383 GetDate(self) -> DateTime
6384
6385 Returns the date.
6386 """
5b5c9bc7 6387 return _core_.DateEvent_GetDate(*args, **kwargs)
53aa7709
RD
6388
6389 def SetDate(*args, **kwargs):
5ba5649b
RD
6390 """
6391 SetDate(self, DateTime date)
6392
6393 Sets the date carried by the event, normally only used by the library
6394 internally.
6395 """
5b5c9bc7 6396 return _core_.DateEvent_SetDate(*args, **kwargs)
53aa7709 6397
2131d850 6398_core_.DateEvent_swigregister(DateEvent)
53aa7709 6399
5b5c9bc7 6400wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
53aa7709
RD
6401EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6402
d55e5bfc
RD
6403#---------------------------------------------------------------------------
6404
5b5c9bc7
RD
6405PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6406PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6407PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6408PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6409PRINT_WINDOWS = _core_.PRINT_WINDOWS
6410PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
6411class PyApp(EvtHandler):
d6c14a4c
RD
6412 """
6413 The ``wx.PyApp`` class is an *implementation detail*, please use the
6414 `wx.App` class (or some other derived class) instead.
6415 """
1bd55598
RD
6416 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6417 __repr__ = _swig_repr
6418 def __init__(self, *args, **kwargs):
d55e5bfc 6419 """
5b5c9bc7 6420 __init__(self) -> PyApp
d55e5bfc
RD
6421
6422 Create a new application object, starting the bootstrap process.
6423 """
1bd55598 6424 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
7993762b
RD
6425 self._setCallbackInfo(self, PyApp, False)
6426 self._setOORInfo(self, False)
d55e5bfc 6427
1bd55598
RD
6428 __swig_destroy__ = _core_.delete_PyApp
6429 __del__ = lambda self : None;
d55e5bfc 6430 def _setCallbackInfo(*args, **kwargs):
7993762b 6431 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
5b5c9bc7 6432 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
6433
6434 def GetAppName(*args, **kwargs):
6435 """
5b5c9bc7 6436 GetAppName(self) -> String
d55e5bfc
RD
6437
6438 Get the application name.
6439 """
5b5c9bc7 6440 return _core_.PyApp_GetAppName(*args, **kwargs)
d55e5bfc
RD
6441
6442 def SetAppName(*args, **kwargs):
6443 """
5b5c9bc7 6444 SetAppName(self, String name)
d55e5bfc 6445
d6c14a4c
RD
6446 Set the application name. This value may be used automatically by
6447 `wx.Config` and such.
d55e5bfc 6448 """
5b5c9bc7 6449 return _core_.PyApp_SetAppName(*args, **kwargs)
d55e5bfc
RD
6450
6451 def GetClassName(*args, **kwargs):
6452 """
5b5c9bc7 6453 GetClassName(self) -> String
d55e5bfc
RD
6454
6455 Get the application's class name.
6456 """
5b5c9bc7 6457 return _core_.PyApp_GetClassName(*args, **kwargs)
d55e5bfc
RD
6458
6459 def SetClassName(*args, **kwargs):
6460 """
5b5c9bc7 6461 SetClassName(self, String name)
d55e5bfc 6462
d6c14a4c
RD
6463 Set the application's class name. This value may be used for
6464 X-resources if applicable for the platform
d55e5bfc 6465 """
5b5c9bc7 6466 return _core_.PyApp_SetClassName(*args, **kwargs)
d55e5bfc
RD
6467
6468 def GetVendorName(*args, **kwargs):
6469 """
5b5c9bc7 6470 GetVendorName(self) -> String
d55e5bfc
RD
6471
6472 Get the application's vendor name.
6473 """
5b5c9bc7 6474 return _core_.PyApp_GetVendorName(*args, **kwargs)
d55e5bfc
RD
6475
6476 def SetVendorName(*args, **kwargs):
6477 """
5b5c9bc7 6478 SetVendorName(self, String name)
d55e5bfc 6479
d6c14a4c
RD
6480 Set the application's vendor name. This value may be used
6481 automatically by `wx.Config` and such.
d55e5bfc 6482 """
5b5c9bc7 6483 return _core_.PyApp_SetVendorName(*args, **kwargs)
d55e5bfc
RD
6484
6485 def GetTraits(*args, **kwargs):
6486 """
6487 GetTraits(self) -> wxAppTraits
6488
d6c14a4c
RD
6489 Return (and create if necessary) the app traits object to which we
6490 delegate for everything which either should be configurable by the
6491 user (then he can change the default behaviour simply by overriding
6492 CreateTraits() and returning his own traits object) or which is
6493 GUI/console dependent as then wx.AppTraits allows us to abstract the
6494 differences behind the common facade.
6495
6496 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc 6497 """
5b5c9bc7 6498 return _core_.PyApp_GetTraits(*args, **kwargs)
d55e5bfc
RD
6499
6500 def ProcessPendingEvents(*args, **kwargs):
6501 """
6502 ProcessPendingEvents(self)
6503
d6c14a4c
RD
6504 Process all events in the Pending Events list -- it is necessary to
6505 call this function to process posted events. This normally happens
6506 during each event loop iteration.
d55e5bfc 6507 """
5b5c9bc7 6508 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
6509
6510 def Yield(*args, **kwargs):
6511 """
6512 Yield(self, bool onlyIfNeeded=False) -> bool
6513
d6c14a4c
RD
6514 Process all currently pending events right now, instead of waiting
6515 until return to the event loop. It is an error to call ``Yield``
6516 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 6517
d6c14a4c 6518 :warning: This function is dangerous as it can lead to unexpected
15817c7e
RD
6519 reentrancies (i.e. when called from an event handler it may
6520 result in calling the same event handler again), use with
6521 extreme care or, better, don't use at all!
d55e5bfc 6522
d6c14a4c 6523 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
15817c7e 6524
d55e5bfc 6525 """
5b5c9bc7 6526 return _core_.PyApp_Yield(*args, **kwargs)
d55e5bfc
RD
6527
6528 def WakeUpIdle(*args, **kwargs):
6529 """
6530 WakeUpIdle(self)
6531
d6c14a4c
RD
6532 Make sure that idle events are sent again.
6533 :see: `wx.WakeUpIdle`
d55e5bfc 6534 """
5b5c9bc7 6535 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
d55e5bfc 6536
84f85550
RD
6537 def IsMainLoopRunning(*args, **kwargs):
6538 """
6539 IsMainLoopRunning() -> bool
6540
6541 Returns True if we're running the main loop, i.e. if the events can
6542 currently be dispatched.
6543 """
5b5c9bc7 6544 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550
RD
6545
6546 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
6547 def MainLoop(*args, **kwargs):
6548 """
6549 MainLoop(self) -> int
6550
d6c14a4c
RD
6551 Execute the main GUI loop, the function doesn't normally return until
6552 all top level windows have been closed and destroyed.
d55e5bfc 6553 """
5b5c9bc7 6554 return _core_.PyApp_MainLoop(*args, **kwargs)
d55e5bfc
RD
6555
6556 def Exit(*args, **kwargs):
6557 """
6558 Exit(self)
6559
6560 Exit the main loop thus terminating the application.
d6c14a4c 6561 :see: `wx.Exit`
d55e5bfc 6562 """
5b5c9bc7 6563 return _core_.PyApp_Exit(*args, **kwargs)
d55e5bfc
RD
6564
6565 def ExitMainLoop(*args, **kwargs):
6566 """
6567 ExitMainLoop(self)
6568
d6c14a4c
RD
6569 Exit the main GUI loop during the next iteration of the main
6570 loop, (i.e. it does not stop the program immediately!)
d55e5bfc 6571 """
5b5c9bc7 6572 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
d55e5bfc
RD
6573
6574 def Pending(*args, **kwargs):
6575 """
6576 Pending(self) -> bool
6577
6578 Returns True if there are unprocessed events in the event queue.
6579 """
5b5c9bc7 6580 return _core_.PyApp_Pending(*args, **kwargs)
d55e5bfc
RD
6581
6582 def Dispatch(*args, **kwargs):
6583 """
6584 Dispatch(self) -> bool
6585
6586 Process the first event in the event queue (blocks until an event
6587 appears if there are none currently)
6588 """
5b5c9bc7 6589 return _core_.PyApp_Dispatch(*args, **kwargs)
d55e5bfc
RD
6590
6591 def ProcessIdle(*args, **kwargs):
6592 """
6593 ProcessIdle(self) -> bool
6594
d6c14a4c
RD
6595 Called from the MainLoop when the application becomes idle (there are
6596 no pending events) and sends a `wx.IdleEvent` to all interested
6597 parties. Returns True if more idle events are needed, False if not.
d55e5bfc 6598 """
5b5c9bc7 6599 return _core_.PyApp_ProcessIdle(*args, **kwargs)
d55e5bfc
RD
6600
6601 def SendIdleEvents(*args, **kwargs):
6602 """
5b5c9bc7 6603 SendIdleEvents(self, Window win, IdleEvent event) -> bool
d55e5bfc 6604
d6c14a4c
RD
6605 Send idle event to window and all subwindows. Returns True if more
6606 idle time is requested.
d55e5bfc 6607 """
5b5c9bc7 6608 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
d55e5bfc
RD
6609
6610 def IsActive(*args, **kwargs):
6611 """
6612 IsActive(self) -> bool
6613
6614 Return True if our app has focus.
6615 """
5b5c9bc7 6616 return _core_.PyApp_IsActive(*args, **kwargs)
d55e5bfc
RD
6617
6618 def SetTopWindow(*args, **kwargs):
6619 """
5b5c9bc7 6620 SetTopWindow(self, Window win)
d55e5bfc 6621
d6c14a4c 6622 Set the *main* top level window
d55e5bfc 6623 """
5b5c9bc7 6624 return _core_.PyApp_SetTopWindow(*args, **kwargs)
d55e5bfc
RD
6625
6626 def GetTopWindow(*args, **kwargs):
6627 """
5b5c9bc7 6628 GetTopWindow(self) -> Window
d55e5bfc 6629
d6c14a4c
RD
6630 Return the *main* top level window (if it hadn't been set previously
6631 with SetTopWindow(), will return just some top level window and, if
6632 there not any, will return None)
d55e5bfc 6633 """
5b5c9bc7 6634 return _core_.PyApp_GetTopWindow(*args, **kwargs)
d55e5bfc
RD
6635
6636 def SetExitOnFrameDelete(*args, **kwargs):
6637 """
6638 SetExitOnFrameDelete(self, bool flag)
6639
d6c14a4c
RD
6640 Control the exit behaviour: by default, the program will exit the main
6641 loop (and so, usually, terminate) when the last top-level program
6642 window is deleted. Beware that if you disable this behaviour (with
6643 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6644 explicitly from somewhere.
d55e5bfc 6645 """
5b5c9bc7 6646 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6647
6648 def GetExitOnFrameDelete(*args, **kwargs):
6649 """
6650 GetExitOnFrameDelete(self) -> bool
6651
6652 Get the current exit behaviour setting.
6653 """
5b5c9bc7 6654 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
6655
6656 def SetUseBestVisual(*args, **kwargs):
6657 """
6658 SetUseBestVisual(self, bool flag)
6659
d6c14a4c
RD
6660 Set whether the app should try to use the best available visual on
6661 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc 6662 """
5b5c9bc7 6663 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
6664
6665 def GetUseBestVisual(*args, **kwargs):
6666 """
6667 GetUseBestVisual(self) -> bool
6668
6669 Get current UseBestVisual setting.
6670 """
5b5c9bc7 6671 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
6672
6673 def SetPrintMode(*args, **kwargs):
6674 """SetPrintMode(self, int mode)"""
5b5c9bc7 6675 return _core_.PyApp_SetPrintMode(*args, **kwargs)
d55e5bfc
RD
6676
6677 def GetPrintMode(*args, **kwargs):
6678 """GetPrintMode(self) -> int"""
5b5c9bc7 6679 return _core_.PyApp_GetPrintMode(*args, **kwargs)
d55e5bfc
RD
6680
6681 def SetAssertMode(*args, **kwargs):
6682 """
6683 SetAssertMode(self, int mode)
6684
15817c7e 6685 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc 6686 """
5b5c9bc7 6687 return _core_.PyApp_SetAssertMode(*args, **kwargs)
d55e5bfc
RD
6688
6689 def GetAssertMode(*args, **kwargs):
6690 """
6691 GetAssertMode(self) -> int
6692
6693 Get the current OnAssert behaviour setting.
6694 """
5b5c9bc7 6695 return _core_.PyApp_GetAssertMode(*args, **kwargs)
d55e5bfc
RD
6696
6697 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 6698 """GetMacSupportPCMenuShortcuts() -> bool"""
5b5c9bc7 6699 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
6700
6701 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6702 def GetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 6703 """GetMacAboutMenuItemId() -> long"""
5b5c9bc7 6704 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
6705
6706 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6707 def GetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 6708 """GetMacPreferencesMenuItemId() -> long"""
5b5c9bc7 6709 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
6710
6711 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6712 def GetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 6713 """GetMacExitMenuItemId() -> long"""
5b5c9bc7 6714 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
6715
6716 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6717 def GetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
6718 """GetMacHelpMenuTitleName() -> String"""
6719 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
6720
6721 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6722 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 6723 """SetMacSupportPCMenuShortcuts(bool val)"""
5b5c9bc7 6724 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
6725
6726 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6727 def SetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 6728 """SetMacAboutMenuItemId(long val)"""
5b5c9bc7 6729 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
6730
6731 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6732 def SetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 6733 """SetMacPreferencesMenuItemId(long val)"""
5b5c9bc7 6734 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
6735
6736 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6737 def SetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 6738 """SetMacExitMenuItemId(long val)"""
5b5c9bc7 6739 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
6740
6741 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6742 def SetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
6743 """SetMacHelpMenuTitleName(String val)"""
6744 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
6745
6746 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6747 def _BootstrapApp(*args, **kwargs):
6748 """
6749 _BootstrapApp(self)
6750
6751 For internal use only
6752 """
5b5c9bc7 6753 return _core_.PyApp__BootstrapApp(*args, **kwargs)
d55e5bfc
RD
6754
6755 def GetComCtl32Version(*args, **kwargs):
6756 """
d6c14a4c 6757 GetComCtl32Version() -> int
d55e5bfc 6758
d6c14a4c
RD
6759 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6760 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 6761 """
5b5c9bc7 6762 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
6763
6764 GetComCtl32Version = staticmethod(GetComCtl32Version)
2131d850 6765_core_.PyApp_swigregister(PyApp)
d55e5bfc 6766
1bd55598
RD
6767def PyApp_IsMainLoopRunning(*args):
6768 """
5b5c9bc7 6769 PyApp_IsMainLoopRunning() -> bool
84f85550
RD
6770
6771 Returns True if we're running the main loop, i.e. if the events can
6772 currently be dispatched.
6773 """
1bd55598 6774 return _core_.PyApp_IsMainLoopRunning(*args)
84f85550 6775
1bd55598
RD
6776def PyApp_GetMacSupportPCMenuShortcuts(*args):
6777 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6778 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d55e5bfc 6779
1bd55598
RD
6780def PyApp_GetMacAboutMenuItemId(*args):
6781 """PyApp_GetMacAboutMenuItemId() -> long"""
6782 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d55e5bfc 6783
1bd55598
RD
6784def PyApp_GetMacPreferencesMenuItemId(*args):
6785 """PyApp_GetMacPreferencesMenuItemId() -> long"""
6786 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d55e5bfc 6787
1bd55598
RD
6788def PyApp_GetMacExitMenuItemId(*args):
6789 """PyApp_GetMacExitMenuItemId() -> long"""
6790 return _core_.PyApp_GetMacExitMenuItemId(*args)
d55e5bfc 6791
1bd55598
RD
6792def PyApp_GetMacHelpMenuTitleName(*args):
6793 """PyApp_GetMacHelpMenuTitleName() -> String"""
6794 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d55e5bfc 6795
5b5c9bc7 6796def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
1bd55598
RD
6797 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
6798 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 6799
5b5c9bc7 6800def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
1bd55598
RD
6801 """PyApp_SetMacAboutMenuItemId(long val)"""
6802 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 6803
5b5c9bc7 6804def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
1bd55598
RD
6805 """PyApp_SetMacPreferencesMenuItemId(long val)"""
6806 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 6807
5b5c9bc7 6808def PyApp_SetMacExitMenuItemId(*args, **kwargs):
1bd55598
RD
6809 """PyApp_SetMacExitMenuItemId(long val)"""
6810 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 6811
5b5c9bc7 6812def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
1bd55598
RD
6813 """PyApp_SetMacHelpMenuTitleName(String val)"""
6814 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 6815
1bd55598
RD
6816def PyApp_GetComCtl32Version(*args):
6817 """
5b5c9bc7 6818 PyApp_GetComCtl32Version() -> int
d55e5bfc 6819
d6c14a4c
RD
6820 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6821 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 6822 """
1bd55598 6823 return _core_.PyApp_GetComCtl32Version(*args)
d55e5bfc
RD
6824
6825#---------------------------------------------------------------------------
6826
6827
1bd55598
RD
6828def Exit(*args):
6829 """
5b5c9bc7 6830 Exit()
d55e5bfc
RD
6831
6832 Force an exit of the application. Convenience for wx.GetApp().Exit()
6833 """
1bd55598 6834 return _core_.Exit(*args)
d55e5bfc 6835
1bd55598
RD
6836def Yield(*args):
6837 """
5b5c9bc7 6838 Yield() -> bool
d55e5bfc
RD
6839
6840 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
6841 """
1bd55598 6842 return _core_.Yield(*args)
d55e5bfc 6843
1bd55598
RD
6844def YieldIfNeeded(*args):
6845 """
5b5c9bc7 6846 YieldIfNeeded() -> bool
d55e5bfc
RD
6847
6848 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
6849 """
1bd55598 6850 return _core_.YieldIfNeeded(*args)
d55e5bfc 6851
5b5c9bc7 6852def SafeYield(*args, **kwargs):
1bd55598 6853 """
5b5c9bc7 6854 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
d55e5bfc 6855
d6c14a4c
RD
6856 This function is similar to `wx.Yield`, except that it disables the
6857 user input to all program windows before calling `wx.Yield` and
6858 re-enables it again afterwards. If ``win`` is not None, this window
6859 will remain enabled, allowing the implementation of some limited user
6860 interaction.
d55e5bfc 6861
d6c14a4c 6862 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 6863 """
1bd55598 6864 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 6865
1bd55598
RD
6866def WakeUpIdle(*args):
6867 """
5b5c9bc7 6868 WakeUpIdle()
d55e5bfc 6869
d6c14a4c
RD
6870 Cause the message queue to become empty again, so idle events will be
6871 sent.
d55e5bfc 6872 """
1bd55598 6873 return _core_.WakeUpIdle(*args)
d55e5bfc 6874
5b5c9bc7 6875def PostEvent(*args, **kwargs):
1bd55598 6876 """
5b5c9bc7 6877 PostEvent(EvtHandler dest, Event event)
d55e5bfc 6878
d6c14a4c
RD
6879 Send an event to a window or other wx.EvtHandler to be processed
6880 later.
d55e5bfc 6881 """
1bd55598 6882 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 6883
1bd55598
RD
6884def App_CleanUp(*args):
6885 """
5b5c9bc7 6886 App_CleanUp()
d55e5bfc 6887
15817c7e 6888 For internal use only, it is used to cleanup after wxWidgets when
d6c14a4c 6889 Python shuts down.
d55e5bfc 6890 """
1bd55598 6891 return _core_.App_CleanUp(*args)
d55e5bfc 6892
1bd55598
RD
6893def GetApp(*args):
6894 """
5b5c9bc7 6895 GetApp() -> PyApp
d55e5bfc
RD
6896
6897 Return a reference to the current wx.App object.
6898 """
1bd55598 6899 return _core_.GetApp(*args)
5cbf236d 6900
5b5c9bc7 6901def SetDefaultPyEncoding(*args, **kwargs):
1bd55598 6902 """
5cbf236d
RD
6903 SetDefaultPyEncoding(string encoding)
6904
6905 Sets the encoding that wxPython will use when it needs to convert a
6906 Python string or unicode object to or from a wxString.
62d32a5f
RD
6907
6908 The default encoding is the value of ``locale.getdefaultlocale()[1]``
6909 but please be aware that the default encoding within the same locale
6910 may be slightly different on different platforms. For example, please
6911 see http://www.alanwood.net/demos/charsetdiffs.html for differences
6912 between the common latin/roman encodings.
5cbf236d 6913 """
1bd55598 6914 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 6915
1bd55598
RD
6916def GetDefaultPyEncoding(*args):
6917 """
5cbf236d
RD
6918 GetDefaultPyEncoding() -> string
6919
6920 Gets the current encoding that wxPython will use when it needs to
6921 convert a Python string or unicode object to or from a wxString.
6922 """
1bd55598 6923 return _core_.GetDefaultPyEncoding(*args)
d55e5bfc
RD
6924#----------------------------------------------------------------------
6925
6926class PyOnDemandOutputWindow:
6927 """
6928 A class that can be used for redirecting Python's stdout and
6929 stderr streams. It will do nothing until something is wrriten to
6930 the stream at which point it will create a Frame with a text area
6931 and write the text there.
6932 """
6933 def __init__(self, title = "wxPython: stdout/stderr"):
6934 self.frame = None
6935 self.title = title
412d302d
RD
6936 self.pos = wx.DefaultPosition
6937 self.size = (450, 300)
d55e5bfc
RD
6938 self.parent = None
6939
6940 def SetParent(self, parent):
6941 """Set the window to be used as the popup Frame's parent."""
6942 self.parent = parent
6943
6944
6945 def CreateOutputWindow(self, st):
412d302d
RD
6946 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
6947 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 6948 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 6949 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 6950 self.text.AppendText(st)
d55e5bfc 6951 self.frame.Show(True)
2131d850 6952 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
d55e5bfc
RD
6953
6954
6955 def OnCloseWindow(self, event):
6956 if self.frame is not None:
6957 self.frame.Destroy()
6958 self.frame = None
6959 self.text = None
6960
6961
6962 # These methods provide the file-like output behaviour.
6963 def write(self, text):
6964 """
6965 Create the output window if needed and write the string to it.
6966 If not called in the context of the gui thread then uses
6967 CallAfter to do the work there.
6968 """
6969 if self.frame is None:
6970 if not wx.Thread_IsMain():
6971 wx.CallAfter(self.CreateOutputWindow, text)
6972 else:
6973 self.CreateOutputWindow(text)
6974 else:
6975 if not wx.Thread_IsMain():
6976 wx.CallAfter(self.text.AppendText, text)
6977 else:
6978 self.text.AppendText(text)
6979
6980
6981 def close(self):
6982 if self.frame is not None:
6983 wx.CallAfter(self.frame.Close)
6984
6985
bb4524c4
RD
6986 def flush(self):
6987 pass
6988
6989
d55e5bfc
RD
6990
6991#----------------------------------------------------------------------
6992
6993_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
6994
6995class App(wx.PyApp):
6996 """
d6c14a4c
RD
6997 The ``wx.App`` class represents the application and is used to:
6998
6999 * bootstrap the wxPython system and initialize the underlying
7000 gui toolkit
7001 * set and get application-wide properties
7002 * implement the windowing system main message or event loop,
7003 and to dispatch events to window instances
7004 * etc.
7005
7006 Every application must have a ``wx.App`` instance, and all
7007 creation of UI objects should be delayed until after the
7008 ``wx.App`` object has been created in order to ensure that the gui
7009 platform and wxWidgets have been fully initialized.
7010
7011 Normally you would derive from this class and implement an
7012 ``OnInit`` method that creates a frame and then calls
7013 ``self.SetTopWindow(frame)``.
7014
7015 :see: `wx.PySimpleApp` for a simpler app class that can be used
15817c7e 7016 directly.
d55e5bfc 7017 """
d6c14a4c 7018
d55e5bfc
RD
7019 outputWindowClass = PyOnDemandOutputWindow
7020
d6c14a4c
RD
7021 def __init__(self, redirect=_defRedirect, filename=None,
7022 useBestVisual=False, clearSigInt=True):
7023 """
7024 Construct a ``wx.App`` object.
7025
7026 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7027 redirected? Defaults to True on Windows and Mac, False
7028 otherwise. If `filename` is None then output will be
7029 redirected to a window that pops up as needed. (You can
7030 control what kind of window is created for the output by
7031 resetting the class variable ``outputWindowClass`` to a
7032 class of your choosing.)
7033
7034 :param filename: The name of a file to redirect output to, if
7035 redirect is True.
7036
7037 :param useBestVisual: Should the app try to use the best
7038 available visual provided by the system (only relevant on
7039 systems that have more than one visual.) This parameter
7040 must be used instead of calling `SetUseBestVisual` later
7041 on because it must be set before the underlying GUI
7042 toolkit is initialized.
7043
7044 :param clearSigInt: Should SIGINT be cleared? This allows the
7045 app to terminate upon a Ctrl-C in the console like other
7046 GUI apps will.
7047
7048 :note: You should override OnInit to do applicaition
7049 initialization to ensure that the system, toolkit and
7050 wxWidgets are fully initialized.
7051 """
d55e5bfc
RD
7052 wx.PyApp.__init__(self)
7053
7054 if wx.Platform == "__WXMAC__":
7055 try:
7056 import MacOS
7057 if not MacOS.WMAvailable():
7058 print """\
7059This program needs access to the screen. Please run with 'pythonw',
7060not 'python', and only when you are logged in on the main display of
7061your Mac."""
7062 _sys.exit(1)
0346c964
RD
7063 except SystemExit:
7064 raise
d55e5bfc
RD
7065 except:
7066 pass
7067
7068 # This has to be done before OnInit
7069 self.SetUseBestVisual(useBestVisual)
7070
7071 # Set the default handler for SIGINT. This fixes a problem
7072 # where if Ctrl-C is pressed in the console that started this
7073 # app then it will not appear to do anything, (not even send
7074 # KeyboardInterrupt???) but will later segfault on exit. By
7075 # setting the default handler then the app will exit, as
7076 # expected (depending on platform.)
d6c14a4c
RD
7077 if clearSigInt:
7078 try:
7079 import signal
7080 signal.signal(signal.SIGINT, signal.SIG_DFL)
7081 except:
7082 pass
d55e5bfc
RD
7083
7084 # Save and redirect the stdio to a window?
7085 self.stdioWin = None
7086 self.saveStdio = (_sys.stdout, _sys.stderr)
7087 if redirect:
7088 self.RedirectStdio(filename)
7089
8fb0e70a
RD
7090 # Use Python's install prefix as the default
7091 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7092
d55e5bfc
RD
7093 # This finishes the initialization of wxWindows and then calls
7094 # the OnInit that should be present in the derived class
7095 self._BootstrapApp()
7096
7097
2131d850
RD
7098 def OnPreInit(self):
7099 """
7100 Things that must be done after _BootstrapApp has done its
7101 thing, but would be nice if they were already done by the time
7102 that OnInit is called.
7103 """
7104 wx.StockGDI._initStockObjects()
7105
7106
66af7a75
RD
7107 def __del__(self, destroy=wx.PyApp.__del__):
7108 self.RestoreStdio() # Just in case the MainLoop was overridden
7109 destroy(self)
d55e5bfc 7110
7993762b
RD
7111 def Destroy(self):
7112 wx.PyApp.Destroy(self)
7113 self.thisown = 0
d55e5bfc
RD
7114
7115 def SetTopWindow(self, frame):
7116 """Set the \"main\" top level window"""
7117 if self.stdioWin:
7118 self.stdioWin.SetParent(frame)
7119 wx.PyApp.SetTopWindow(self, frame)
7120
7121
7122 def MainLoop(self):
7123 """Execute the main GUI event loop"""
7124 wx.PyApp.MainLoop(self)
7125 self.RestoreStdio()
7126
7127
7128 def RedirectStdio(self, filename=None):
7129 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7130 if filename:
7131 _sys.stdout = _sys.stderr = open(filename, 'a')
7132 else:
7133 self.stdioWin = self.outputWindowClass()
7134 _sys.stdout = _sys.stderr = self.stdioWin
7135
7136
7137 def RestoreStdio(self):
66af7a75
RD
7138 try:
7139 _sys.stdout, _sys.stderr = self.saveStdio
7140 except:
7141 pass
d55e5bfc
RD
7142
7143
412d302d
RD
7144 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7145 """
7146 Set the title, position and/or size of the output window if
f5b96ee1
RD
7147 the stdio has been redirected. This should be called before
7148 any output would cause the output window to be created.
412d302d
RD
7149 """
7150 if self.stdioWin:
7151 if title is not None:
7152 self.stdioWin.title = title
7153 if pos is not None:
7154 self.stdioWin.pos = pos
7155 if size is not None:
7156 self.stdioWin.size = size
7157
7158
7159
d55e5bfc 7160
d6c14a4c 7161# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7162App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7163App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7164App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7165App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7166App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7167App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7168App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7169App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7170App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7171App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7172App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7173
7174#----------------------------------------------------------------------------
7175
7176class PySimpleApp(wx.App):
7177 """
7178 A simple application class. You can just create one of these and
7179 then then make your top level windows later, and not have to worry
d6c14a4c 7180 about OnInit. For example::
d55e5bfc 7181
d6c14a4c
RD
7182 app = wx.PySimpleApp()
7183 frame = wx.Frame(None, title='Hello World')
7184 frame.Show()
7185 app.MainLoop()
7186
7187 :see: `wx.App`
7188 """
7189
7190 def __init__(self, redirect=False, filename=None,
7191 useBestVisual=False, clearSigInt=True):
7192 """
7193 :see: `wx.App.__init__`
7194 """
7195 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7196
7197 def OnInit(self):
d55e5bfc
RD
7198 return True
7199
7200
d6c14a4c 7201
d55e5bfc
RD
7202# Is anybody using this one?
7203class PyWidgetTester(wx.App):
7204 def __init__(self, size = (250, 100)):
7205 self.size = size
7206 wx.App.__init__(self, 0)
7207
7208 def OnInit(self):
7209 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7210 self.SetTopWindow(self.frame)
7211 return True
7212
d6c14a4c
RD
7213 def SetWidget(self, widgetClass, *args, **kwargs):
7214 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7215 self.frame.Show(True)
7216
7217#----------------------------------------------------------------------------
7218# DO NOT hold any other references to this object. This is how we
d6c14a4c 7219# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7220# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
d6c14a4c 7221# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7222
7223class __wxPyCleanup:
7224 def __init__(self):
7225 self.cleanup = _core_.App_CleanUp
7226 def __del__(self):
7227 self.cleanup()
7228
7229_sys.__wxPythonCleanup = __wxPyCleanup()
7230
7231## # another possible solution, but it gets called too early...
d6c14a4c
RD
7232## import atexit
7233## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7234
7235
7236#----------------------------------------------------------------------------
7237
7238#---------------------------------------------------------------------------
7239
5b5c9bc7
RD
7240class EventLoop(object):
7241 """Proxy of C++ EventLoop class"""
1bd55598
RD
7242 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7243 __repr__ = _swig_repr
7244 def __init__(self, *args, **kwargs):
5b5c9bc7 7245 """__init__(self) -> EventLoop"""
1bd55598
RD
7246 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7247 __swig_destroy__ = _core_.delete_EventLoop
7248 __del__ = lambda self : None;
b411df4a
RD
7249 def Run(*args, **kwargs):
7250 """Run(self) -> int"""
5b5c9bc7 7251 return _core_.EventLoop_Run(*args, **kwargs)
b411df4a
RD
7252
7253 def Exit(*args, **kwargs):
7254 """Exit(self, int rc=0)"""
5b5c9bc7 7255 return _core_.EventLoop_Exit(*args, **kwargs)
b411df4a
RD
7256
7257 def Pending(*args, **kwargs):
7258 """Pending(self) -> bool"""
5b5c9bc7 7259 return _core_.EventLoop_Pending(*args, **kwargs)
b411df4a
RD
7260
7261 def Dispatch(*args, **kwargs):
7262 """Dispatch(self) -> bool"""
5b5c9bc7 7263 return _core_.EventLoop_Dispatch(*args, **kwargs)
b411df4a
RD
7264
7265 def IsRunning(*args, **kwargs):
7266 """IsRunning(self) -> bool"""
5b5c9bc7 7267 return _core_.EventLoop_IsRunning(*args, **kwargs)
b411df4a
RD
7268
7269 def GetActive(*args, **kwargs):
5b5c9bc7
RD
7270 """GetActive() -> EventLoop"""
7271 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a
RD
7272
7273 GetActive = staticmethod(GetActive)
7274 def SetActive(*args, **kwargs):
5b5c9bc7
RD
7275 """SetActive(EventLoop loop)"""
7276 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a
RD
7277
7278 SetActive = staticmethod(SetActive)
2131d850 7279_core_.EventLoop_swigregister(EventLoop)
b411df4a 7280
1bd55598
RD
7281def EventLoop_GetActive(*args):
7282 """EventLoop_GetActive() -> EventLoop"""
7283 return _core_.EventLoop_GetActive(*args)
b411df4a 7284
5b5c9bc7 7285def EventLoop_SetActive(*args, **kwargs):
1bd55598
RD
7286 """EventLoop_SetActive(EventLoop loop)"""
7287 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a 7288
32fe5131
RD
7289class EventLoopActivator(object):
7290 """Proxy of C++ EventLoopActivator class"""
1bd55598
RD
7291 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7292 __repr__ = _swig_repr
7293 def __init__(self, *args, **kwargs):
32fe5131 7294 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
1bd55598
RD
7295 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7296 __swig_destroy__ = _core_.delete_EventLoopActivator
7297 __del__ = lambda self : None;
2131d850 7298_core_.EventLoopActivator_swigregister(EventLoopActivator)
32fe5131 7299
b411df4a
RD
7300#---------------------------------------------------------------------------
7301
5b5c9bc7 7302class AcceleratorEntry(object):
d6c14a4c
RD
7303 """
7304 A class used to define items in an `wx.AcceleratorTable`. wxPython
7305 programs can choose to use wx.AcceleratorEntry objects, but using a
7306 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
15817c7e 7307 as well. See `__init__` for of the tuple values.
d6c14a4c
RD
7308
7309 :see: `wx.AcceleratorTable`
7310 """
1bd55598
RD
7311 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7312 __repr__ = _swig_repr
7313 def __init__(self, *args, **kwargs):
d6c14a4c 7314 """
5b5c9bc7 7315 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
d6c14a4c
RD
7316
7317 Construct a wx.AcceleratorEntry.
d6c14a4c 7318 """
1bd55598
RD
7319 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7320 __swig_destroy__ = _core_.delete_AcceleratorEntry
7321 __del__ = lambda self : None;
d55e5bfc 7322 def Set(*args, **kwargs):
d6c14a4c
RD
7323 """
7324 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 7325
d6c14a4c
RD
7326 (Re)set the attributes of a wx.AcceleratorEntry.
7327 :see `__init__`
7328 """
5b5c9bc7 7329 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc
RD
7330
7331 def GetFlags(*args, **kwargs):
d6c14a4c
RD
7332 """
7333 GetFlags(self) -> int
7334
7335 Get the AcceleratorEntry's flags.
7336 """
5b5c9bc7 7337 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
d55e5bfc
RD
7338
7339 def GetKeyCode(*args, **kwargs):
d6c14a4c
RD
7340 """
7341 GetKeyCode(self) -> int
7342
7343 Get the AcceleratorEntry's keycode.
7344 """
5b5c9bc7 7345 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
7346
7347 def GetCommand(*args, **kwargs):
d6c14a4c
RD
7348 """
7349 GetCommand(self) -> int
7350
7351 Get the AcceleratorEntry's command ID.
7352 """
5b5c9bc7 7353 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
d55e5bfc 7354
2131d850 7355_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
d55e5bfc 7356
5b5c9bc7 7357class AcceleratorTable(Object):
d6c14a4c
RD
7358 """
7359 An accelerator table allows the application to specify a table of
7360 keyboard shortcuts for menus or other commands. On Windows, menu or
7361 button commands are supported; on GTK, only menu commands are
7362 supported.
d6c14a4c 7363 """
1bd55598
RD
7364 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7365 __repr__ = _swig_repr
7366 def __init__(self, *args, **kwargs):
d55e5bfc
RD
7367 """
7368 __init__(entries) -> AcceleratorTable
7369
d6c14a4c
RD
7370 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7371 items or or of 3-tuples (flags, keyCode, cmdID)
7372
7373 :see: `wx.AcceleratorEntry`
d55e5bfc 7374 """
1bd55598
RD
7375 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7376 __swig_destroy__ = _core_.delete_AcceleratorTable
7377 __del__ = lambda self : None;
d55e5bfc
RD
7378 def Ok(*args, **kwargs):
7379 """Ok(self) -> bool"""
5b5c9bc7 7380 return _core_.AcceleratorTable_Ok(*args, **kwargs)
d55e5bfc 7381
2131d850 7382_core_.AcceleratorTable_swigregister(AcceleratorTable)
d55e5bfc
RD
7383
7384
5b5c9bc7 7385def GetAccelFromString(*args, **kwargs):
1bd55598
RD
7386 """GetAccelFromString(String label) -> AcceleratorEntry"""
7387 return _core_.GetAccelFromString(*args, **kwargs)
d55e5bfc
RD
7388#---------------------------------------------------------------------------
7389
5b5c9bc7 7390class VisualAttributes(object):
d55e5bfc 7391 """struct containing all the visual attributes of a control"""
1bd55598
RD
7392 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7393 __repr__ = _swig_repr
7394 def __init__(self, *args, **kwargs):
d55e5bfc 7395 """
5b5c9bc7 7396 __init__(self) -> VisualAttributes
d55e5bfc
RD
7397
7398 struct containing all the visual attributes of a control
7399 """
1bd55598
RD
7400 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7401 __swig_destroy__ = _core_.delete_VisualAttributes
7402 __del__ = lambda self : None;
5b5c9bc7
RD
7403 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7404 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7405 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 7406_core_.VisualAttributes_swigregister(VisualAttributes)
5b5c9bc7 7407NullAcceleratorTable = cvar.NullAcceleratorTable
d55e5bfc
RD
7408PanelNameStr = cvar.PanelNameStr
7409
5b5c9bc7
RD
7410WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7411WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7412WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7413WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7414WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
7415class Window(EvtHandler):
d55e5bfc
RD
7416 """
7417 wx.Window is the base class for all windows and represents any visible
7418 object on the screen. All controls, top level windows and so on are
7419 wx.Windows. Sizers and device contexts are not however, as they don't
7420 appear on screen themselves.
7421
7422 """
1bd55598
RD
7423 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7424 __repr__ = _swig_repr
7425 def __init__(self, *args, **kwargs):
d55e5bfc 7426 """
5b5c9bc7
RD
7427 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
7428 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
d55e5bfc
RD
7429
7430 Construct and show a generic Window.
7431 """
1bd55598 7432 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d55e5bfc
RD
7433 self._setOORInfo(self)
7434
7435 def Create(*args, **kwargs):
7436 """
5b5c9bc7
RD
7437 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
7438 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
d55e5bfc
RD
7439
7440 Create the GUI part of the Window for 2-phase creation mode.
7441 """
5b5c9bc7 7442 return _core_.Window_Create(*args, **kwargs)
d55e5bfc
RD
7443
7444 def Close(*args, **kwargs):
7445 """
7446 Close(self, bool force=False) -> bool
7447
7448 This function simply generates a EVT_CLOSE event whose handler usually
7449 tries to close the window. It doesn't close the window itself,
7450 however. If force is False (the default) then the window's close
7451 handler will be allowed to veto the destruction of the window.
d55e5bfc 7452 """
5b5c9bc7 7453 return _core_.Window_Close(*args, **kwargs)
d55e5bfc
RD
7454
7455 def Destroy(*args, **kwargs):
7456 """
7457 Destroy(self) -> bool
7458
7459 Destroys the window safely. Frames and dialogs are not destroyed
7460 immediately when this function is called -- they are added to a list
7461 of windows to be deleted on idle time, when all the window's events
7462 have been processed. This prevents problems with events being sent to
7463 non-existent windows.
7464
7465 Returns True if the window has either been successfully deleted, or it
7466 has been added to the list of windows pending real deletion.
7467 """
7e08d4ef
RD
7468 val = _core_.Window_Destroy(*args, **kwargs)
7469 args[0].thisown = 0
7470 return val
d55e5bfc
RD
7471
7472 def DestroyChildren(*args, **kwargs):
7473 """
7474 DestroyChildren(self) -> bool
7475
15817c7e
RD
7476 Destroys all children of a window. Called automatically by the
7477 destructor.
d55e5bfc 7478 """
5b5c9bc7 7479 return _core_.Window_DestroyChildren(*args, **kwargs)
d55e5bfc
RD
7480
7481 def IsBeingDeleted(*args, **kwargs):
7482 """
7483 IsBeingDeleted(self) -> bool
7484
7485 Is the window in the process of being deleted?
7486 """
5b5c9bc7 7487 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d55e5bfc 7488
d55e5bfc
RD
7489 def SetLabel(*args, **kwargs):
7490 """
5b5c9bc7 7491 SetLabel(self, String label)
d55e5bfc
RD
7492
7493 Set the text which the window shows in its label if applicable.
7494 """
5b5c9bc7 7495 return _core_.Window_SetLabel(*args, **kwargs)
d55e5bfc
RD
7496
7497 def GetLabel(*args, **kwargs):
7498 """
5b5c9bc7 7499 GetLabel(self) -> String
d55e5bfc 7500
15817c7e
RD
7501 Generic way of getting a label from any window, for identification
7502 purposes. The interpretation of this function differs from class to
7503 class. For frames and dialogs, the value returned is the title. For
7504 buttons or static text controls, it is the button text. This function
7505 can be useful for meta-programs such as testing tools or special-needs
7506 access programs)which need to identify windows by name.
d55e5bfc 7507 """
5b5c9bc7 7508 return _core_.Window_GetLabel(*args, **kwargs)
d55e5bfc
RD
7509
7510 def SetName(*args, **kwargs):
7511 """
5b5c9bc7 7512 SetName(self, String name)
d55e5bfc 7513
15817c7e
RD
7514 Sets the window's name. The window name is used for ressource setting
7515 in X, it is not the same as the window title/label
d55e5bfc 7516 """
5b5c9bc7 7517 return _core_.Window_SetName(*args, **kwargs)
d55e5bfc
RD
7518
7519 def GetName(*args, **kwargs):
7520 """
5b5c9bc7 7521 GetName(self) -> String
d55e5bfc 7522
15817c7e
RD
7523 Returns the windows name. This name is not guaranteed to be unique;
7524 it is up to the programmer to supply an appropriate name in the window
7525 constructor or via wx.Window.SetName.
d55e5bfc 7526 """
5b5c9bc7 7527 return _core_.Window_GetName(*args, **kwargs)
d55e5bfc
RD
7528
7529 def SetWindowVariant(*args, **kwargs):
7530 """
7531 SetWindowVariant(self, int variant)
7532
15817c7e
RD
7533 Sets the variant of the window/font size to use for this window, if
7534 the platform supports variants, for example, wxMac.
d55e5bfc 7535 """
5b5c9bc7 7536 return _core_.Window_SetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7537
7538 def GetWindowVariant(*args, **kwargs):
7539 """GetWindowVariant(self) -> int"""
5b5c9bc7 7540 return _core_.Window_GetWindowVariant(*args, **kwargs)
d55e5bfc
RD
7541
7542 def SetId(*args, **kwargs):
7543 """
7544 SetId(self, int winid)
7545
7546 Sets the identifier of the window. Each window has an integer
7547 identifier. If the application has not provided one, an identifier
7548 will be generated. Normally, the identifier should be provided on
7549 creation and should not be modified subsequently.
7550 """
5b5c9bc7 7551 return _core_.Window_SetId(*args, **kwargs)
d55e5bfc
RD
7552
7553 def GetId(*args, **kwargs):
7554 """
7555 GetId(self) -> int
7556
7557 Returns the identifier of the window. Each window has an integer
7558 identifier. If the application has not provided one (or the default Id
7559 -1 is used) then an unique identifier with a negative value will be
7560 generated.
7561 """
5b5c9bc7 7562 return _core_.Window_GetId(*args, **kwargs)
d55e5bfc
RD
7563
7564 def NewControlId(*args, **kwargs):
7565 """
d6c14a4c 7566 NewControlId() -> int
d55e5bfc
RD
7567
7568 Generate a control id for the controls which were not given one.
7569 """
5b5c9bc7 7570 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc
RD
7571
7572 NewControlId = staticmethod(NewControlId)
7573 def NextControlId(*args, **kwargs):
7574 """
d6c14a4c 7575 NextControlId(int winid) -> int
d55e5bfc
RD
7576
7577 Get the id of the control following the one with the given
15817c7e 7578 autogenerated) id
d55e5bfc 7579 """
5b5c9bc7 7580 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
7581
7582 NextControlId = staticmethod(NextControlId)
7583 def PrevControlId(*args, **kwargs):
7584 """
d6c14a4c 7585 PrevControlId(int winid) -> int
d55e5bfc
RD
7586
7587 Get the id of the control preceding the one with the given
15817c7e 7588 autogenerated) id
d55e5bfc 7589 """
5b5c9bc7 7590 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc
RD
7591
7592 PrevControlId = staticmethod(PrevControlId)
7593 def SetSize(*args, **kwargs):
7594 """
5b5c9bc7 7595 SetSize(self, Size size)
d55e5bfc
RD
7596
7597 Sets the size of the window in pixels.
7598 """
5b5c9bc7 7599 return _core_.Window_SetSize(*args, **kwargs)
d55e5bfc
RD
7600
7601 def SetDimensions(*args, **kwargs):
7602 """
5b5c9bc7 7603 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
7604
7605 Sets the position and size of the window in pixels. The sizeFlags
7606 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
7607 equal to -1.
7608
7609 ======================== ======================================
7610 wx.SIZE_AUTO A -1 indicates that a class-specific
7611 default should be used.
7612 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7613 -1 values are supplied.
7614 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7615 interpreted as real dimensions, not
7616 default values.
7617 ======================== ======================================
7618
d55e5bfc 7619 """
5b5c9bc7 7620 return _core_.Window_SetDimensions(*args, **kwargs)
d55e5bfc
RD
7621
7622 def SetRect(*args, **kwargs):
7623 """
5b5c9bc7 7624 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
7625
7626 Sets the position and size of the window in pixels using a wx.Rect.
7627 """
5b5c9bc7 7628 return _core_.Window_SetRect(*args, **kwargs)
d55e5bfc
RD
7629
7630 def SetSizeWH(*args, **kwargs):
7631 """
7632 SetSizeWH(self, int width, int height)
7633
7634 Sets the size of the window in pixels.
7635 """
5b5c9bc7 7636 return _core_.Window_SetSizeWH(*args, **kwargs)
d55e5bfc
RD
7637
7638 def Move(*args, **kwargs):
7639 """
5b5c9bc7 7640 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
7641
7642 Moves the window to the given position.
7643 """
5b5c9bc7 7644 return _core_.Window_Move(*args, **kwargs)
d55e5bfc
RD
7645
7646 SetPosition = Move
7647 def MoveXY(*args, **kwargs):
7648 """
5b5c9bc7 7649 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
7650
7651 Moves the window to the given position.
7652 """
5b5c9bc7 7653 return _core_.Window_MoveXY(*args, **kwargs)
d55e5bfc 7654
f8167d6e
RD
7655 def SetBestFittingSize(*args, **kwargs):
7656 """
5b5c9bc7 7657 SetBestFittingSize(self, Size size=DefaultSize)
f8167d6e
RD
7658
7659 A 'Smart' SetSize that will fill in default size components with the
7660 window's *best size* values. Also set's the minsize for use with sizers.
7661 """
5b5c9bc7 7662 return _core_.Window_SetBestFittingSize(*args, **kwargs)
f8167d6e 7663
d55e5bfc
RD
7664 def Raise(*args, **kwargs):
7665 """
7666 Raise(self)
7667
943e8dfd
RD
7668 Raises the window to the top of the window hierarchy. In current
7669 version of wxWidgets this works both for manage and child windows.
d55e5bfc 7670 """
5b5c9bc7 7671 return _core_.Window_Raise(*args, **kwargs)
d55e5bfc
RD
7672
7673 def Lower(*args, **kwargs):
7674 """
7675 Lower(self)
7676
943e8dfd
RD
7677 Lowers the window to the bottom of the window hierarchy. In current
7678 version of wxWidgets this works both for manage and child windows.
d55e5bfc 7679 """
5b5c9bc7 7680 return _core_.Window_Lower(*args, **kwargs)
d55e5bfc
RD
7681
7682 def SetClientSize(*args, **kwargs):
7683 """
5b5c9bc7 7684 SetClientSize(self, Size size)
d55e5bfc
RD
7685
7686 This sets the size of the window client area in pixels. Using this
7687 function to size a window tends to be more device-independent than
7688 wx.Window.SetSize, since the application need not worry about what
7689 dimensions the border or title bar have when trying to fit the window
7690 around panel items, for example.
7691 """
5b5c9bc7 7692 return _core_.Window_SetClientSize(*args, **kwargs)
d55e5bfc
RD
7693
7694 def SetClientSizeWH(*args, **kwargs):
7695 """
7696 SetClientSizeWH(self, int width, int height)
7697
7698 This sets the size of the window client area in pixels. Using this
7699 function to size a window tends to be more device-independent than
7700 wx.Window.SetSize, since the application need not worry about what
7701 dimensions the border or title bar have when trying to fit the window
7702 around panel items, for example.
7703 """
5b5c9bc7 7704 return _core_.Window_SetClientSizeWH(*args, **kwargs)
d55e5bfc
RD
7705
7706 def SetClientRect(*args, **kwargs):
7707 """
5b5c9bc7 7708 SetClientRect(self, Rect rect)
d55e5bfc
RD
7709
7710 This sets the size of the window client area in pixels. Using this
7711 function to size a window tends to be more device-independent than
7712 wx.Window.SetSize, since the application need not worry about what
7713 dimensions the border or title bar have when trying to fit the window
7714 around panel items, for example.
7715 """
5b5c9bc7 7716 return _core_.Window_SetClientRect(*args, **kwargs)
d55e5bfc
RD
7717
7718 def GetPosition(*args, **kwargs):
7719 """
5b5c9bc7 7720 GetPosition(self) -> Point
d55e5bfc 7721
1c71765a
RD
7722 Get the window's position. Notice that the position is in client
7723 coordinates for child windows and screen coordinates for the top level
7724 ones, use `GetScreenPosition` if you need screen coordinates for all
7725 kinds of windows.
d55e5bfc 7726 """
5b5c9bc7 7727 return _core_.Window_GetPosition(*args, **kwargs)
d55e5bfc
RD
7728
7729 def GetPositionTuple(*args, **kwargs):
7730 """
7731 GetPositionTuple() -> (x,y)
7732
1c71765a
RD
7733 Get the window's position. Notice that the position is in client
7734 coordinates for child windows and screen coordinates for the top level
7735 ones, use `GetScreenPosition` if you need screen coordinates for all
7736 kinds of windows.
d55e5bfc 7737 """
5b5c9bc7 7738 return _core_.Window_GetPositionTuple(*args, **kwargs)
d55e5bfc 7739
1c71765a
RD
7740 def GetScreenPosition(*args, **kwargs):
7741 """
7742 GetScreenPosition(self) -> Point
7743
7744 Get the position of the window in screen coordinantes.
7745 """
7746 return _core_.Window_GetScreenPosition(*args, **kwargs)
7747
7748 def GetScreenPositionTuple(*args, **kwargs):
7749 """
7750 GetScreenPositionTuple() -> (x,y)
7751
7752 Get the position of the window in screen coordinantes.
7753 """
7754 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
7755
7756 def GetScreenRect(*args, **kwargs):
7757 """
7758 GetScreenRect(self) -> Rect
7759
7760 Returns the size and position of the window in screen coordinantes as
7761 a `wx.Rect` object.
7762 """
7763 return _core_.Window_GetScreenRect(*args, **kwargs)
7764
d55e5bfc
RD
7765 def GetSize(*args, **kwargs):
7766 """
5b5c9bc7 7767 GetSize(self) -> Size
d55e5bfc
RD
7768
7769 Get the window size.
7770 """
5b5c9bc7 7771 return _core_.Window_GetSize(*args, **kwargs)
d55e5bfc
RD
7772
7773 def GetSizeTuple(*args, **kwargs):
7774 """
7775 GetSizeTuple() -> (width, height)
7776
7777 Get the window size.
7778 """
5b5c9bc7 7779 return _core_.Window_GetSizeTuple(*args, **kwargs)
d55e5bfc
RD
7780
7781 def GetRect(*args, **kwargs):
7782 """
5b5c9bc7 7783 GetRect(self) -> Rect
d55e5bfc 7784
1c71765a 7785 Returns the size and position of the window as a `wx.Rect` object.
d55e5bfc 7786 """
5b5c9bc7 7787 return _core_.Window_GetRect(*args, **kwargs)
d55e5bfc
RD
7788
7789 def GetClientSize(*args, **kwargs):
7790 """
5b5c9bc7 7791 GetClientSize(self) -> Size
d55e5bfc
RD
7792
7793 This gets the size of the window's 'client area' in pixels. The client
7794 area is the area which may be drawn on by the programmer, excluding
7795 title bar, border, scrollbars, etc.
7796 """
5b5c9bc7 7797 return _core_.Window_GetClientSize(*args, **kwargs)
d55e5bfc
RD
7798
7799 def GetClientSizeTuple(*args, **kwargs):
7800 """
7801 GetClientSizeTuple() -> (width, height)
7802
7803 This gets the size of the window's 'client area' in pixels. The client
7804 area is the area which may be drawn on by the programmer, excluding
7805 title bar, border, scrollbars, etc.
7806 """
5b5c9bc7 7807 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
d55e5bfc
RD
7808
7809 def GetClientAreaOrigin(*args, **kwargs):
7810 """
5b5c9bc7 7811 GetClientAreaOrigin(self) -> Point
d55e5bfc
RD
7812
7813 Get the origin of the client area of the window relative to the
7814 window's top left corner (the client area may be shifted because of
7815 the borders, scrollbars, other decorations...)
7816 """
5b5c9bc7 7817 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
d55e5bfc
RD
7818
7819 def GetClientRect(*args, **kwargs):
7820 """
5b5c9bc7 7821 GetClientRect(self) -> Rect
d55e5bfc 7822
0439c23b 7823 Get the client area position and size as a `wx.Rect` object.
d55e5bfc 7824 """
5b5c9bc7 7825 return _core_.Window_GetClientRect(*args, **kwargs)
d55e5bfc
RD
7826
7827 def GetBestSize(*args, **kwargs):
7828 """
5b5c9bc7 7829 GetBestSize(self) -> Size
d55e5bfc 7830
bfddbb17 7831 This function returns the best acceptable minimal size for the
15817c7e
RD
7832 window, if applicable. For example, for a static text control, it will
7833 be the minimal size such that the control label is not truncated. For
7834 windows containing subwindows (suzh aswx.Panel), the size returned by
7835 this function will be the same as the size the window would have had
7836 after calling Fit.
d55e5bfc 7837 """
5b5c9bc7 7838 return _core_.Window_GetBestSize(*args, **kwargs)
d55e5bfc
RD
7839
7840 def GetBestSizeTuple(*args, **kwargs):
7841 """
7842 GetBestSizeTuple() -> (width, height)
7843
bfddbb17 7844 This function returns the best acceptable minimal size for the
15817c7e
RD
7845 window, if applicable. For example, for a static text control, it will
7846 be the minimal size such that the control label is not truncated. For
7847 windows containing subwindows (suzh aswx.Panel), the size returned by
7848 this function will be the same as the size the window would have had
7849 after calling Fit.
d55e5bfc 7850 """
5b5c9bc7 7851 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
d55e5bfc 7852
a001823c
RD
7853 def InvalidateBestSize(*args, **kwargs):
7854 """
7855 InvalidateBestSize(self)
7856
7857 Reset the cached best size value so it will be recalculated the next
7858 time it is needed.
7859 """
5b5c9bc7 7860 return _core_.Window_InvalidateBestSize(*args, **kwargs)
a001823c 7861
e2813725
RD
7862 def CacheBestSize(*args, **kwargs):
7863 """
7864 CacheBestSize(self, Size size)
7865
7866 Cache the best size so it doesn't need to be calculated again, (at least until
7867 some properties of the window change.)
7868 """
7869 return _core_.Window_CacheBestSize(*args, **kwargs)
7870
a001823c
RD
7871 def GetBestFittingSize(*args, **kwargs):
7872 """
5b5c9bc7 7873 GetBestFittingSize(self) -> Size
a001823c
RD
7874
7875 This function will merge the window's best size into the window's
7876 minimum size, giving priority to the min size components, and returns
7877 the results.
7878
7879 """
5b5c9bc7 7880 return _core_.Window_GetBestFittingSize(*args, **kwargs)
a001823c 7881
d55e5bfc
RD
7882 def GetAdjustedBestSize(*args, **kwargs):
7883 """
5b5c9bc7 7884 GetAdjustedBestSize(self) -> Size
d55e5bfc
RD
7885
7886 This method is similar to GetBestSize, except in one
7887 thing. GetBestSize should return the minimum untruncated size of the
7888 window, while this method will return the largest of BestSize and any
7889 user specified minimum size. ie. it is the minimum size the window
7890 should currently be drawn at, not the minimal size it can possibly
7891 tolerate.
7892 """
5b5c9bc7 7893 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
d55e5bfc
RD
7894
7895 def Center(*args, **kwargs):
7896 """
5b5c9bc7 7897 Center(self, int direction=BOTH)
d55e5bfc
RD
7898
7899 Centers the window. The parameter specifies the direction for
7900 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
7901 also include wx.CENTER_ON_SCREEN flag if you want to center the window
7902 on the entire screen and not on its parent window. If it is a
7903 top-level window and has no parent then it will always be centered
7904 relative to the screen.
7905 """
5b5c9bc7 7906 return _core_.Window_Center(*args, **kwargs)
d55e5bfc
RD
7907
7908 Centre = Center
d55e5bfc
RD
7909 def CenterOnParent(*args, **kwargs):
7910 """
5b5c9bc7 7911 CenterOnParent(self, int dir=BOTH)
d55e5bfc
RD
7912
7913 Center with respect to the the parent window
7914 """
5b5c9bc7 7915 return _core_.Window_CenterOnParent(*args, **kwargs)
d55e5bfc
RD
7916
7917 CentreOnParent = CenterOnParent
7918 def Fit(*args, **kwargs):
7919 """
7920 Fit(self)
7921
7922 Sizes the window so that it fits around its subwindows. This function
7923 won't do anything if there are no subwindows and will only really work
7924 correctly if sizers are used for the subwindows layout. Also, if the
7925 window has exactly one subwindow it is better (faster and the result
7926 is more precise as Fit adds some margin to account for fuzziness of
7927 its calculations) to call window.SetClientSize(child.GetSize())
7928 instead of calling Fit.
7929 """
5b5c9bc7 7930 return _core_.Window_Fit(*args, **kwargs)
d55e5bfc
RD
7931
7932 def FitInside(*args, **kwargs):
7933 """
7934 FitInside(self)
7935
7936 Similar to Fit, but sizes the interior (virtual) size of a
7937 window. Mainly useful with scrolled windows to reset scrollbars after
7938 sizing changes that do not trigger a size event, and/or scrolled
7939 windows without an interior sizer. This function similarly won't do
7940 anything if there are no subwindows.
7941 """
5b5c9bc7 7942 return _core_.Window_FitInside(*args, **kwargs)
d55e5bfc 7943
03837c5c 7944 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
7945 """
7946 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
7947 int incH=-1)
d55e5bfc
RD
7948
7949 Allows specification of minimum and maximum window sizes, and window
7950 size increments. If a pair of values is not set (or set to -1), the
7951 default values will be used. If this function is called, the user
908b74cd
RD
7952 will not be able to size the window outside the given bounds (if it is
7953 a top-level window.) Sizers will also inspect the minimum window size
7954 and will use that value if set when calculating layout.
7955
7956 The resizing increments are only significant under Motif or Xt.
d55e5bfc 7957 """
5b5c9bc7 7958 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 7959
03837c5c
RD
7960 def SetSizeHintsSz(*args, **kwargs):
7961 """
5b5c9bc7 7962 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
03837c5c
RD
7963
7964 Allows specification of minimum and maximum window sizes, and window
7965 size increments. If a pair of values is not set (or set to -1), the
7966 default values will be used. If this function is called, the user
7967 will not be able to size the window outside the given bounds (if it is
7968 a top-level window.) Sizers will also inspect the minimum window size
7969 and will use that value if set when calculating layout.
7970
7971 The resizing increments are only significant under Motif or Xt.
7972 """
5b5c9bc7 7973 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
03837c5c
RD
7974
7975 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 7976 """
908b74cd 7977 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
7978
7979 Allows specification of minimum and maximum virtual window sizes. If a
7980 pair of values is not set (or set to -1), the default values will be
7981 used. If this function is called, the user will not be able to size
7982 the virtual area of the window outside the given bounds.
7983 """
5b5c9bc7 7984 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
03837c5c
RD
7985
7986 def SetVirtualSizeHintsSz(*args, **kwargs):
7987 """
5b5c9bc7 7988 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
03837c5c
RD
7989
7990 Allows specification of minimum and maximum virtual window sizes. If a
7991 pair of values is not set (or set to -1), the default values will be
7992 used. If this function is called, the user will not be able to size
7993 the virtual area of the window outside the given bounds.
7994 """
5b5c9bc7 7995 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 7996
908b74cd 7997 def GetMaxSize(*args, **kwargs):
5b5c9bc7
RD
7998 """GetMaxSize(self) -> Size"""
7999 return _core_.Window_GetMaxSize(*args, **kwargs)
908b74cd
RD
8000
8001 def GetMinSize(*args, **kwargs):
5b5c9bc7
RD
8002 """GetMinSize(self) -> Size"""
8003 return _core_.Window_GetMinSize(*args, **kwargs)
908b74cd
RD
8004
8005 def SetMinSize(*args, **kwargs):
8006 """
5b5c9bc7 8007 SetMinSize(self, Size minSize)
908b74cd
RD
8008
8009 A more convenient method than `SetSizeHints` for setting just the
8010 min size.
8011 """
5b5c9bc7 8012 return _core_.Window_SetMinSize(*args, **kwargs)
908b74cd
RD
8013
8014 def SetMaxSize(*args, **kwargs):
8015 """
5b5c9bc7 8016 SetMaxSize(self, Size maxSize)
908b74cd
RD
8017
8018 A more convenient method than `SetSizeHints` for setting just the
8019 max size.
8020 """
5b5c9bc7 8021 return _core_.Window_SetMaxSize(*args, **kwargs)
908b74cd 8022
d55e5bfc
RD
8023 def GetMinWidth(*args, **kwargs):
8024 """GetMinWidth(self) -> int"""
5b5c9bc7 8025 return _core_.Window_GetMinWidth(*args, **kwargs)
d55e5bfc
RD
8026
8027 def GetMinHeight(*args, **kwargs):
8028 """GetMinHeight(self) -> int"""
5b5c9bc7 8029 return _core_.Window_GetMinHeight(*args, **kwargs)
d55e5bfc
RD
8030
8031 def GetMaxWidth(*args, **kwargs):
8032 """GetMaxWidth(self) -> int"""
5b5c9bc7 8033 return _core_.Window_GetMaxWidth(*args, **kwargs)
d55e5bfc
RD
8034
8035 def GetMaxHeight(*args, **kwargs):
8036 """GetMaxHeight(self) -> int"""
5b5c9bc7 8037 return _core_.Window_GetMaxHeight(*args, **kwargs)
d55e5bfc 8038
d55e5bfc
RD
8039 def SetVirtualSize(*args, **kwargs):
8040 """
5b5c9bc7 8041 SetVirtualSize(self, Size size)
d55e5bfc
RD
8042
8043 Set the the virtual size of a window in pixels. For most windows this
8044 is just the client area of the window, but for some like scrolled
8045 windows it is more or less independent of the screen window size.
8046 """
5b5c9bc7 8047 return _core_.Window_SetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8048
8049 def SetVirtualSizeWH(*args, **kwargs):
8050 """
8051 SetVirtualSizeWH(self, int w, int h)
8052
8053 Set the the virtual size of a window in pixels. For most windows this
8054 is just the client area of the window, but for some like scrolled
8055 windows it is more or less independent of the screen window size.
8056 """
5b5c9bc7 8057 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
d55e5bfc
RD
8058
8059 def GetVirtualSize(*args, **kwargs):
8060 """
5b5c9bc7 8061 GetVirtualSize(self) -> Size
d55e5bfc
RD
8062
8063 Get the the virtual size of the window in pixels. For most windows
8064 this is just the client area of the window, but for some like scrolled
8065 windows it is more or less independent of the screen window size.
8066 """
5b5c9bc7 8067 return _core_.Window_GetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8068
8069 def GetVirtualSizeTuple(*args, **kwargs):
8070 """
8071 GetVirtualSizeTuple() -> (width, height)
8072
8073 Get the the virtual size of the window in pixels. For most windows
8074 this is just the client area of the window, but for some like scrolled
8075 windows it is more or less independent of the screen window size.
8076 """
5b5c9bc7 8077 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
d55e5bfc
RD
8078
8079 def GetBestVirtualSize(*args, **kwargs):
8080 """
5b5c9bc7 8081 GetBestVirtualSize(self) -> Size
d55e5bfc
RD
8082
8083 Return the largest of ClientSize and BestSize (as determined by a
8084 sizer, interior children, or other means)
8085 """
5b5c9bc7 8086 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
d55e5bfc
RD
8087
8088 def Show(*args, **kwargs):
8089 """
8090 Show(self, bool show=True) -> bool
8091
8092 Shows or hides the window. You may need to call Raise for a top level
8093 window if you want to bring it to top, although this is not needed if
8094 Show is called immediately after the frame creation. Returns True if
8095 the window has been shown or hidden or False if nothing was done
8096 because it already was in the requested state.
8097 """
5b5c9bc7 8098 return _core_.Window_Show(*args, **kwargs)
d55e5bfc
RD
8099
8100 def Hide(*args, **kwargs):
8101 """
8102 Hide(self) -> bool
8103
8104 Equivalent to calling Show(False).
8105 """
5b5c9bc7 8106 return _core_.Window_Hide(*args, **kwargs)
d55e5bfc
RD
8107
8108 def Enable(*args, **kwargs):
8109 """
8110 Enable(self, bool enable=True) -> bool
8111
8112 Enable or disable the window for user input. Note that when a parent
8113 window is disabled, all of its children are disabled as well and they
8114 are reenabled again when the parent is. Returns true if the window
8115 has been enabled or disabled, false if nothing was done, i.e. if the
8116 window had already been in the specified state.
8117 """
5b5c9bc7 8118 return _core_.Window_Enable(*args, **kwargs)
d55e5bfc
RD
8119
8120 def Disable(*args, **kwargs):
8121 """
8122 Disable(self) -> bool
8123
8124 Disables the window, same as Enable(false).
8125 """
5b5c9bc7 8126 return _core_.Window_Disable(*args, **kwargs)
d55e5bfc
RD
8127
8128 def IsShown(*args, **kwargs):
8129 """
8130 IsShown(self) -> bool
8131
8132 Returns true if the window is shown, false if it has been hidden.
8133 """
5b5c9bc7 8134 return _core_.Window_IsShown(*args, **kwargs)
d55e5bfc
RD
8135
8136 def IsEnabled(*args, **kwargs):
8137 """
8138 IsEnabled(self) -> bool
8139
8140 Returns true if the window is enabled for input, false otherwise.
8141 """
5b5c9bc7 8142 return _core_.Window_IsEnabled(*args, **kwargs)
d55e5bfc
RD
8143
8144 def SetWindowStyleFlag(*args, **kwargs):
8145 """
8146 SetWindowStyleFlag(self, long style)
8147
15817c7e
RD
8148 Sets the style of the window. Please note that some styles cannot be
8149 changed after the window creation and that Refresh() might need to be
8150 called after changing the others for the change to take place
8151 immediately.
d55e5bfc 8152 """
5b5c9bc7 8153 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8154
8155 def GetWindowStyleFlag(*args, **kwargs):
8156 """
8157 GetWindowStyleFlag(self) -> long
8158
8159 Gets the window style that was passed to the constructor or Create
8160 method.
8161 """
5b5c9bc7 8162 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8163
8164 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8165 def HasFlag(*args, **kwargs):
8166 """
8167 HasFlag(self, int flag) -> bool
8168
8169 Test if the given style is set for this window.
8170 """
5b5c9bc7 8171 return _core_.Window_HasFlag(*args, **kwargs)
d55e5bfc
RD
8172
8173 def IsRetained(*args, **kwargs):
8174 """
8175 IsRetained(self) -> bool
8176
8177 Returns true if the window is retained, false otherwise. Retained
8178 windows are only available on X platforms.
8179 """
5b5c9bc7 8180 return _core_.Window_IsRetained(*args, **kwargs)
d55e5bfc
RD
8181
8182 def SetExtraStyle(*args, **kwargs):
8183 """
8184 SetExtraStyle(self, long exStyle)
8185
8186 Sets the extra style bits for the window. Extra styles are the less
8187 often used style bits which can't be set with the constructor or with
8188 SetWindowStyleFlag()
8189 """
5b5c9bc7 8190 return _core_.Window_SetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8191
8192 def GetExtraStyle(*args, **kwargs):
8193 """
8194 GetExtraStyle(self) -> long
8195
8196 Returns the extra style bits for the window.
8197 """
5b5c9bc7 8198 return _core_.Window_GetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8199
8200 def MakeModal(*args, **kwargs):
8201 """
8202 MakeModal(self, bool modal=True)
8203
8204 Disables all other windows in the application so that the user can
8205 only interact with this window. Passing False will reverse this
8206 effect.
8207 """
5b5c9bc7 8208 return _core_.Window_MakeModal(*args, **kwargs)
d55e5bfc
RD
8209
8210 def SetThemeEnabled(*args, **kwargs):
8211 """
8212 SetThemeEnabled(self, bool enableTheme)
8213
8214 This function tells a window if it should use the system's "theme"
8215 code to draw the windows' background instead if its own background
8216 drawing code. This will only have an effect on platforms that support
8217 the notion of themes in user defined windows. One such platform is
8218 GTK+ where windows can have (very colourful) backgrounds defined by a
8219 user's selected theme.
8220
8221 Dialogs, notebook pages and the status bar have this flag set to true
8222 by default so that the default look and feel is simulated best.
8223 """
5b5c9bc7 8224 return _core_.Window_SetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8225
8226 def GetThemeEnabled(*args, **kwargs):
8227 """
8228 GetThemeEnabled(self) -> bool
8229
8230 Return the themeEnabled flag.
8231 """
5b5c9bc7 8232 return _core_.Window_GetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
8233
8234 def SetFocus(*args, **kwargs):
8235 """
8236 SetFocus(self)
8237
8238 Set's the focus to this window, allowing it to receive keyboard input.
8239 """
5b5c9bc7 8240 return _core_.Window_SetFocus(*args, **kwargs)
d55e5bfc
RD
8241
8242 def SetFocusFromKbd(*args, **kwargs):
8243 """
8244 SetFocusFromKbd(self)
8245
8246 Set focus to this window as the result of a keyboard action. Normally
8247 only called internally.
8248 """
5b5c9bc7 8249 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
d55e5bfc
RD
8250
8251 def FindFocus(*args, **kwargs):
8252 """
5b5c9bc7 8253 FindFocus() -> Window
d55e5bfc
RD
8254
8255 Returns the window or control that currently has the keyboard focus,
8256 or None.
8257 """
5b5c9bc7 8258 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc
RD
8259
8260 FindFocus = staticmethod(FindFocus)
8261 def AcceptsFocus(*args, **kwargs):
8262 """
8263 AcceptsFocus(self) -> bool
8264
8265 Can this window have focus?
8266 """
5b5c9bc7 8267 return _core_.Window_AcceptsFocus(*args, **kwargs)
d55e5bfc
RD
8268
8269 def AcceptsFocusFromKeyboard(*args, **kwargs):
8270 """
8271 AcceptsFocusFromKeyboard(self) -> bool
8272
8273 Can this window be given focus by keyboard navigation? if not, the
8274 only way to give it focus (provided it accepts it at all) is to click
8275 it.
8276 """
5b5c9bc7 8277 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
d55e5bfc
RD
8278
8279 def GetDefaultItem(*args, **kwargs):
8280 """
5b5c9bc7 8281 GetDefaultItem(self) -> Window
d55e5bfc
RD
8282
8283 Get the default child of this parent, i.e. the one which is activated
8284 by pressing <Enter> such as the OK button on a wx.Dialog.
8285 """
5b5c9bc7 8286 return _core_.Window_GetDefaultItem(*args, **kwargs)
d55e5bfc
RD
8287
8288 def SetDefaultItem(*args, **kwargs):
8289 """
5b5c9bc7 8290 SetDefaultItem(self, Window child) -> Window
d55e5bfc
RD
8291
8292 Set this child as default, return the old default.
8293 """
5b5c9bc7 8294 return _core_.Window_SetDefaultItem(*args, **kwargs)
d55e5bfc
RD
8295
8296 def SetTmpDefaultItem(*args, **kwargs):
8297 """
5b5c9bc7 8298 SetTmpDefaultItem(self, Window win)
d55e5bfc
RD
8299
8300 Set this child as temporary default
8301 """
5b5c9bc7 8302 return _core_.Window_SetTmpDefaultItem(*args, **kwargs)
d55e5bfc 8303
908b74cd
RD
8304 def Navigate(*args, **kwargs):
8305 """
8306 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8307
fd2dc343
RD
8308 Does keyboard navigation from this window to another, by sending a
8309 `wx.NavigationKeyEvent`.
908b74cd 8310 """
5b5c9bc7 8311 return _core_.Window_Navigate(*args, **kwargs)
908b74cd 8312
bf26d883
RD
8313 def MoveAfterInTabOrder(*args, **kwargs):
8314 """
5b5c9bc7 8315 MoveAfterInTabOrder(self, Window win)
bf26d883
RD
8316
8317 Moves this window in the tab navigation order after the specified
8318 sibling window. This means that when the user presses the TAB key on
8319 that other window, the focus switches to this window.
8320
8321 The default tab order is the same as creation order. This function
8322 and `MoveBeforeInTabOrder` allow to change it after creating all the
8323 windows.
8324
8325 """
5b5c9bc7 8326 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
bf26d883
RD
8327
8328 def MoveBeforeInTabOrder(*args, **kwargs):
8329 """
5b5c9bc7 8330 MoveBeforeInTabOrder(self, Window win)
bf26d883
RD
8331
8332 Same as `MoveAfterInTabOrder` except that it inserts this window just
8333 before win instead of putting it right after it.
8334 """
5b5c9bc7 8335 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
bf26d883 8336
d55e5bfc
RD
8337 def GetChildren(*args, **kwargs):
8338 """
8339 GetChildren(self) -> PyObject
8340
8341 Returns a list of the window's children. NOTE: Currently this is a
8342 copy of the child window list maintained by the window, so the return
8343 value of this function is only valid as long as the window's children
8344 do not change.
8345 """
5b5c9bc7 8346 return _core_.Window_GetChildren(*args, **kwargs)
d55e5bfc
RD
8347
8348 def GetParent(*args, **kwargs):
8349 """
5b5c9bc7 8350 GetParent(self) -> Window
d55e5bfc
RD
8351
8352 Returns the parent window of this window, or None if there isn't one.
8353 """
5b5c9bc7 8354 return _core_.Window_GetParent(*args, **kwargs)
d55e5bfc
RD
8355
8356 def GetGrandParent(*args, **kwargs):
8357 """
5b5c9bc7 8358 GetGrandParent(self) -> Window
d55e5bfc 8359
15817c7e
RD
8360 Returns the parent of the parent of this window, or None if there
8361 isn't one.
d55e5bfc 8362 """
5b5c9bc7 8363 return _core_.Window_GetGrandParent(*args, **kwargs)
d55e5bfc
RD
8364
8365 def IsTopLevel(*args, **kwargs):
8366 """
8367 IsTopLevel(self) -> bool
8368
8369 Returns true if the given window is a top-level one. Currently all
8370 frames and dialogs are always considered to be top-level windows (even
8371 if they have a parent window).
8372 """
5b5c9bc7 8373 return _core_.Window_IsTopLevel(*args, **kwargs)
d55e5bfc
RD
8374
8375 def Reparent(*args, **kwargs):
8376 """
5b5c9bc7 8377 Reparent(self, Window newParent) -> bool
d55e5bfc
RD
8378
8379 Reparents the window, i.e the window will be removed from its current
8380 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8381 re-inserted into another. Available on Windows and GTK. Returns True
8382 if the parent was changed, False otherwise (error or newParent ==
8383 oldParent)
8384 """
5b5c9bc7 8385 return _core_.Window_Reparent(*args, **kwargs)
d55e5bfc
RD
8386
8387 def AddChild(*args, **kwargs):
8388 """
5b5c9bc7 8389 AddChild(self, Window child)
d55e5bfc
RD
8390
8391 Adds a child window. This is called automatically by window creation
8392 functions so should not be required by the application programmer.
8393 """
5b5c9bc7 8394 return _core_.Window_AddChild(*args, **kwargs)
d55e5bfc
RD
8395
8396 def RemoveChild(*args, **kwargs):
8397 """
5b5c9bc7 8398 RemoveChild(self, Window child)
d55e5bfc
RD
8399
8400 Removes a child window. This is called automatically by window
8401 deletion functions so should not be required by the application
8402 programmer.
8403 """
5b5c9bc7 8404 return _core_.Window_RemoveChild(*args, **kwargs)
d55e5bfc
RD
8405
8406 def FindWindowById(*args, **kwargs):
8407 """
5b5c9bc7 8408 FindWindowById(self, long winid) -> Window
d55e5bfc
RD
8409
8410 Find a chld of this window by window ID
8411 """
5b5c9bc7 8412 return _core_.Window_FindWindowById(*args, **kwargs)
d55e5bfc
RD
8413
8414 def FindWindowByName(*args, **kwargs):
8415 """
5b5c9bc7 8416 FindWindowByName(self, String name) -> Window
d55e5bfc
RD
8417
8418 Find a child of this window by name
8419 """
5b5c9bc7 8420 return _core_.Window_FindWindowByName(*args, **kwargs)
d55e5bfc
RD
8421
8422 def GetEventHandler(*args, **kwargs):
8423 """
5b5c9bc7 8424 GetEventHandler(self) -> EvtHandler
d55e5bfc
RD
8425
8426 Returns the event handler for this window. By default, the window is
8427 its own event handler.
8428 """
5b5c9bc7 8429 return _core_.Window_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
8430
8431 def SetEventHandler(*args, **kwargs):
8432 """
5b5c9bc7 8433 SetEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8434
8435 Sets the event handler for this window. An event handler is an object
8436 that is capable of processing the events sent to a window. By default,
8437 the window is its own event handler, but an application may wish to
8438 substitute another, for example to allow central implementation of
8439 event-handling for a variety of different window classes.
8440
15817c7e 8441 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc
RD
8442 up a chain of event handlers, where an event not handled by one event
8443 handler is handed to the next one in the chain.
8444 """
5b5c9bc7 8445 return _core_.Window_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
8446
8447 def PushEventHandler(*args, **kwargs):
8448 """
5b5c9bc7 8449 PushEventHandler(self, EvtHandler handler)
d55e5bfc
RD
8450
8451 Pushes this event handler onto the event handler stack for the window.
8452 An event handler is an object that is capable of processing the events
8453 sent to a window. By default, the window is its own event handler, but
8454 an application may wish to substitute another, for example to allow
8455 central implementation of event-handling for a variety of different
8456 window classes.
8457
8458 wx.Window.PushEventHandler allows an application to set up a chain of
8459 event handlers, where an event not handled by one event handler is
15817c7e 8460 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
d55e5bfc
RD
8461 remove the event handler.
8462 """
5b5c9bc7 8463 return _core_.Window_PushEventHandler(*args, **kwargs)
d55e5bfc
RD
8464
8465 def PopEventHandler(*args, **kwargs):
8466 """
5b5c9bc7 8467 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
d55e5bfc
RD
8468
8469 Removes and returns the top-most event handler on the event handler
8470 stack. If deleteHandler is True then the wx.EvtHandler object will be
8471 destroyed after it is popped.
8472 """
5b5c9bc7 8473 return _core_.Window_PopEventHandler(*args, **kwargs)
d55e5bfc
RD
8474
8475 def RemoveEventHandler(*args, **kwargs):
8476 """
5b5c9bc7 8477 RemoveEventHandler(self, EvtHandler handler) -> bool
d55e5bfc 8478
15817c7e
RD
8479 Find the given handler in the event handler chain and remove (but not
8480 delete) it from the event handler chain, return True if it was found
8481 and False otherwise (this also results in an assert failure so this
8482 function should only be called when the handler is supposed to be
8483 there.)
d55e5bfc 8484 """
5b5c9bc7 8485 return _core_.Window_RemoveEventHandler(*args, **kwargs)
d55e5bfc
RD
8486
8487 def SetValidator(*args, **kwargs):
8488 """
5b5c9bc7 8489 SetValidator(self, Validator validator)
d55e5bfc
RD
8490
8491 Deletes the current validator (if any) and sets the window validator,
8492 having called wx.Validator.Clone to create a new validator of this
8493 type.
8494 """
5b5c9bc7 8495 return _core_.Window_SetValidator(*args, **kwargs)
d55e5bfc
RD
8496
8497 def GetValidator(*args, **kwargs):
8498 """
5b5c9bc7 8499 GetValidator(self) -> Validator
d55e5bfc
RD
8500
8501 Returns a pointer to the current validator for the window, or None if
8502 there is none.
8503 """
5b5c9bc7 8504 return _core_.Window_GetValidator(*args, **kwargs)
d55e5bfc
RD
8505
8506 def Validate(*args, **kwargs):
8507 """
8508 Validate(self) -> bool
8509
8510 Validates the current values of the child controls using their
15817c7e
RD
8511 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8512 style flag set, the method will also call Validate() of all child
8513 windows. Returns false if any of the validations failed.
d55e5bfc 8514 """
5b5c9bc7 8515 return _core_.Window_Validate(*args, **kwargs)
d55e5bfc
RD
8516
8517 def TransferDataToWindow(*args, **kwargs):
8518 """
8519 TransferDataToWindow(self) -> bool
8520
15817c7e
RD
8521 Transfers values to child controls from data areas specified by their
8522 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8523 style flag set, the method will also call TransferDataToWindow() of
8524 all child windows.
d55e5bfc 8525 """
5b5c9bc7 8526 return _core_.Window_TransferDataToWindow(*args, **kwargs)
d55e5bfc
RD
8527
8528 def TransferDataFromWindow(*args, **kwargs):
8529 """
8530 TransferDataFromWindow(self) -> bool
8531
15817c7e
RD
8532 Transfers values from child controls to data areas specified by their
8533 validators. Returns false if a transfer failed. If the window has
8534 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8535 also call TransferDataFromWindow() of all child windows.
d55e5bfc 8536 """
5b5c9bc7 8537 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
d55e5bfc
RD
8538
8539 def InitDialog(*args, **kwargs):
8540 """
8541 InitDialog(self)
8542
15817c7e
RD
8543 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8544 to the dialog via validators.
d55e5bfc 8545 """
5b5c9bc7 8546 return _core_.Window_InitDialog(*args, **kwargs)
d55e5bfc
RD
8547
8548 def SetAcceleratorTable(*args, **kwargs):
8549 """
5b5c9bc7 8550 SetAcceleratorTable(self, AcceleratorTable accel)
d55e5bfc
RD
8551
8552 Sets the accelerator table for this window.
8553 """
5b5c9bc7 8554 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
8555
8556 def GetAcceleratorTable(*args, **kwargs):
8557 """
5b5c9bc7 8558 GetAcceleratorTable(self) -> AcceleratorTable
d55e5bfc
RD
8559
8560 Gets the accelerator table for this window.
8561 """
5b5c9bc7 8562 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
8563
8564 def RegisterHotKey(*args, **kwargs):
8565 """
8566 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
8567
8568 Registers a system wide hotkey. Every time the user presses the hotkey
8569 registered here, this window will receive a hotkey event. It will
8570 receive the event even if the application is in the background and
8571 does not have the input focus because the user is working with some
8572 other application. To bind an event handler function to this hotkey
8573 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8574 hotkey was registered successfully.
8575 """
5b5c9bc7 8576 return _core_.Window_RegisterHotKey(*args, **kwargs)
d55e5bfc
RD
8577
8578 def UnregisterHotKey(*args, **kwargs):
8579 """
8580 UnregisterHotKey(self, int hotkeyId) -> bool
8581
8582 Unregisters a system wide hotkey.
8583 """
5b5c9bc7 8584 return _core_.Window_UnregisterHotKey(*args, **kwargs)
d55e5bfc
RD
8585
8586 def ConvertDialogPointToPixels(*args, **kwargs):
8587 """
5b5c9bc7 8588 ConvertDialogPointToPixels(self, Point pt) -> Point
d55e5bfc
RD
8589
8590 Converts a point or size from dialog units to pixels. Dialog units
8591 are used for maintaining a dialog's proportions even if the font
8592 changes. For the x dimension, the dialog units are multiplied by the
8593 average character width and then divided by 4. For the y dimension,
8594 the dialog units are multiplied by the average character height and
8595 then divided by 8.
8596 """
5b5c9bc7 8597 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
d55e5bfc
RD
8598
8599 def ConvertDialogSizeToPixels(*args, **kwargs):
8600 """
5b5c9bc7 8601 ConvertDialogSizeToPixels(self, Size sz) -> Size
d55e5bfc
RD
8602
8603 Converts a point or size from dialog units to pixels. Dialog units
8604 are used for maintaining a dialog's proportions even if the font
8605 changes. For the x dimension, the dialog units are multiplied by the
8606 average character width and then divided by 4. For the y dimension,
8607 the dialog units are multiplied by the average character height and
8608 then divided by 8.
8609 """
5b5c9bc7 8610 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
d55e5bfc
RD
8611
8612 def DLG_PNT(*args, **kwargs):
8613 """
5b5c9bc7 8614 DLG_PNT(self, Point pt) -> Point
d55e5bfc
RD
8615
8616 Converts a point or size from dialog units to pixels. Dialog units
8617 are used for maintaining a dialog's proportions even if the font
8618 changes. For the x dimension, the dialog units are multiplied by the
8619 average character width and then divided by 4. For the y dimension,
8620 the dialog units are multiplied by the average character height and
8621 then divided by 8.
8622 """
5b5c9bc7 8623 return _core_.Window_DLG_PNT(*args, **kwargs)
d55e5bfc
RD
8624
8625 def DLG_SZE(*args, **kwargs):
8626 """
5b5c9bc7 8627 DLG_SZE(self, Size sz) -> Size
d55e5bfc
RD
8628
8629 Converts a point or size from dialog units to pixels. Dialog units
8630 are used for maintaining a dialog's proportions even if the font
8631 changes. For the x dimension, the dialog units are multiplied by the
8632 average character width and then divided by 4. For the y dimension,
8633 the dialog units are multiplied by the average character height and
8634 then divided by 8.
8635 """
5b5c9bc7 8636 return _core_.Window_DLG_SZE(*args, **kwargs)
d55e5bfc
RD
8637
8638 def ConvertPixelPointToDialog(*args, **kwargs):
5b5c9bc7
RD
8639 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
8640 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
d55e5bfc
RD
8641
8642 def ConvertPixelSizeToDialog(*args, **kwargs):
5b5c9bc7
RD
8643 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
8644 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
d55e5bfc
RD
8645
8646 def WarpPointer(*args, **kwargs):
8647 """
8648 WarpPointer(self, int x, int y)
8649
8650 Moves the pointer to the given position on the window.
8651
8652 NOTE: This function is not supported under Mac because Apple Human
8653 Interface Guidelines forbid moving the mouse cursor programmatically.
8654 """
5b5c9bc7 8655 return _core_.Window_WarpPointer(*args, **kwargs)
d55e5bfc
RD
8656
8657 def CaptureMouse(*args, **kwargs):
8658 """
8659 CaptureMouse(self)
8660
8661 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8662 release the capture.
8663
8664 Note that wxWindows maintains the stack of windows having captured the
8665 mouse and when the mouse is released the capture returns to the window
8666 which had had captured it previously and it is only really released if
8667 there were no previous window. In particular, this means that you must
8668 release the mouse as many times as you capture it.
8669 """
5b5c9bc7 8670 return _core_.Window_CaptureMouse(*args, **kwargs)
d55e5bfc
RD
8671
8672 def ReleaseMouse(*args, **kwargs):
8673 """
8674 ReleaseMouse(self)
8675
8676 Releases mouse input captured with wx.Window.CaptureMouse.
8677 """
5b5c9bc7 8678 return _core_.Window_ReleaseMouse(*args, **kwargs)
d55e5bfc
RD
8679
8680 def GetCapture(*args, **kwargs):
8681 """
5b5c9bc7 8682 GetCapture() -> Window
d55e5bfc
RD
8683
8684 Returns the window which currently captures the mouse or None
8685 """
5b5c9bc7 8686 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc
RD
8687
8688 GetCapture = staticmethod(GetCapture)
8689 def HasCapture(*args, **kwargs):
8690 """
8691 HasCapture(self) -> bool
8692
8693 Returns true if this window has the current mouse capture.
8694 """
5b5c9bc7 8695 return _core_.Window_HasCapture(*args, **kwargs)
d55e5bfc
RD
8696
8697 def Refresh(*args, **kwargs):
8698 """
5b5c9bc7 8699 Refresh(self, bool eraseBackground=True, Rect rect=None)
d55e5bfc
RD
8700
8701 Mark the specified rectangle (or the whole window) as "dirty" so it
8702 will be repainted. Causes an EVT_PAINT event to be generated and sent
8703 to the window.
8704 """
5b5c9bc7 8705 return _core_.Window_Refresh(*args, **kwargs)
d55e5bfc
RD
8706
8707 def RefreshRect(*args, **kwargs):
8708 """
5b5c9bc7 8709 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
8710
8711 Redraws the contents of the given rectangle: the area inside it will
8712 be repainted. This is the same as Refresh but has a nicer syntax.
8713 """
5b5c9bc7 8714 return _core_.Window_RefreshRect(*args, **kwargs)
d55e5bfc
RD
8715
8716 def Update(*args, **kwargs):
8717 """
8718 Update(self)
8719
8720 Calling this method immediately repaints the invalidated area of the
8721 window instead of waiting for the EVT_PAINT event to happen, (normally
8722 this would usually only happen when the flow of control returns to the
8723 event loop.) Notice that this function doesn't refresh the window and
8724 does nothing if the window has been already repainted. Use Refresh
8725 first if you want to immediately redraw the window (or some portion of
8726 it) unconditionally.
8727 """
5b5c9bc7 8728 return _core_.Window_Update(*args, **kwargs)
d55e5bfc
RD
8729
8730 def ClearBackground(*args, **kwargs):
8731 """
8732 ClearBackground(self)
8733
8734 Clears the window by filling it with the current background
8735 colour. Does not cause an erase background event to be generated.
8736 """
5b5c9bc7 8737 return _core_.Window_ClearBackground(*args, **kwargs)
d55e5bfc
RD
8738
8739 def Freeze(*args, **kwargs):
8740 """
8741 Freeze(self)
8742
15817c7e
RD
8743 Freezes the window or, in other words, prevents any updates from
8744 taking place on screen, the window is not redrawn at all. Thaw must be
8745 called to reenable window redrawing. Calls to Freeze/Thaw may be
8746 nested, with the actual Thaw being delayed until all the nesting has
8747 been undone.
d55e5bfc
RD
8748
8749 This method is useful for visual appearance optimization (for example,
8750 it is a good idea to use it before inserting large amount of text into
8751 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
8752 for all controls so it is mostly just a hint to wxWindows and not a
8753 mandatory directive.
8754 """
5b5c9bc7 8755 return _core_.Window_Freeze(*args, **kwargs)
d55e5bfc
RD
8756
8757 def Thaw(*args, **kwargs):
8758 """
8759 Thaw(self)
8760
8761 Reenables window updating after a previous call to Freeze. Calls to
15817c7e
RD
8762 Freeze/Thaw may be nested, so Thaw must be called the same number of
8763 times that Freeze was before the window will be updated.
d55e5bfc 8764 """
5b5c9bc7 8765 return _core_.Window_Thaw(*args, **kwargs)
d55e5bfc
RD
8766
8767 def PrepareDC(*args, **kwargs):
8768 """
5b5c9bc7 8769 PrepareDC(self, DC dc)
d55e5bfc
RD
8770
8771 Call this function to prepare the device context for drawing a
8772 scrolled image. It sets the device origin according to the current
8773 scroll position.
8774 """
5b5c9bc7 8775 return _core_.Window_PrepareDC(*args, **kwargs)
d55e5bfc
RD
8776
8777 def GetUpdateRegion(*args, **kwargs):
8778 """
5b5c9bc7 8779 GetUpdateRegion(self) -> Region
d55e5bfc
RD
8780
8781 Returns the region specifying which parts of the window have been
8782 damaged. Should only be called within an EVT_PAINT handler.
8783 """
5b5c9bc7 8784 return _core_.Window_GetUpdateRegion(*args, **kwargs)
d55e5bfc
RD
8785
8786 def GetUpdateClientRect(*args, **kwargs):
8787 """
5b5c9bc7 8788 GetUpdateClientRect(self) -> Rect
d55e5bfc
RD
8789
8790 Get the update rectangle region bounding box in client coords.
8791 """
5b5c9bc7 8792 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
d55e5bfc
RD
8793
8794 def IsExposed(*args, **kwargs):
8795 """
8796 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
8797
8798 Returns true if the given point or rectangle area has been exposed
8799 since the last repaint. Call this in an paint event handler to
8800 optimize redrawing by only redrawing those areas, which have been
8801 exposed.
8802 """
5b5c9bc7 8803 return _core_.Window_IsExposed(*args, **kwargs)
d55e5bfc
RD
8804
8805 def IsExposedPoint(*args, **kwargs):
8806 """
5b5c9bc7 8807 IsExposedPoint(self, Point pt) -> bool
d55e5bfc
RD
8808
8809 Returns true if the given point or rectangle area has been exposed
8810 since the last repaint. Call this in an paint event handler to
8811 optimize redrawing by only redrawing those areas, which have been
8812 exposed.
8813 """
5b5c9bc7 8814 return _core_.Window_IsExposedPoint(*args, **kwargs)
d55e5bfc
RD
8815
8816 def IsExposedRect(*args, **kwargs):
8817 """
5b5c9bc7 8818 IsExposedRect(self, Rect rect) -> bool
d55e5bfc
RD
8819
8820 Returns true if the given point or rectangle area has been exposed
8821 since the last repaint. Call this in an paint event handler to
8822 optimize redrawing by only redrawing those areas, which have been
8823 exposed.
8824 """
5b5c9bc7 8825 return _core_.Window_IsExposedRect(*args, **kwargs)
d55e5bfc
RD
8826
8827 def GetDefaultAttributes(*args, **kwargs):
8828 """
5b5c9bc7 8829 GetDefaultAttributes(self) -> VisualAttributes
d55e5bfc 8830
15817c7e
RD
8831 Get the default attributes for an instance of this class. This is
8832 useful if you want to use the same font or colour in your own control
8833 as in a standard control -- which is a much better idea than hard
8834 coding specific colours or fonts which might look completely out of
a5ee0656 8835 place on the user's system, especially if it uses themes.
d55e5bfc 8836 """
5b5c9bc7 8837 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
8838
8839 def GetClassDefaultAttributes(*args, **kwargs):
8840 """
5b5c9bc7 8841 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 8842
15817c7e
RD
8843 Get the default attributes for this class. This is useful if you want
8844 to use the same font or colour in your own control as in a standard
8845 control -- which is a much better idea than hard coding specific
a5ee0656
RD
8846 colours or fonts which might look completely out of place on the
8847 user's system, especially if it uses themes.
d55e5bfc
RD
8848
8849 The variant parameter is only relevant under Mac currently and is
15817c7e 8850 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
8851 the returned font. See `wx.Window.SetWindowVariant` for more about
8852 this.
d55e5bfc 8853 """
5b5c9bc7 8854 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
8855
8856 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
8857 def SetBackgroundColour(*args, **kwargs):
8858 """
5b5c9bc7 8859 SetBackgroundColour(self, Colour colour) -> bool
d55e5bfc
RD
8860
8861 Sets the background colour of the window. Returns True if the colour
8862 was changed. The background colour is usually painted by the default
8863 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
8864 automatically under GTK. Using `wx.NullColour` will reset the window
8865 to the default background colour.
d55e5bfc 8866
a5ee0656 8867 Note that setting the background colour may not cause an immediate
f8167d6e 8868 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
8869 calling this function.
8870
f8167d6e
RD
8871 Using this function will disable attempts to use themes for this
8872 window, if the system supports them. Use with care since usually the
8873 themes represent the appearance chosen by the user to be used for all
8874 applications on the system.
d55e5bfc 8875 """
5b5c9bc7 8876 return _core_.Window_SetBackgroundColour(*args, **kwargs)
d55e5bfc 8877
412d302d 8878 def SetOwnBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
8879 """SetOwnBackgroundColour(self, Colour colour)"""
8880 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
8881
8882 def SetForegroundColour(*args, **kwargs):
8883 """
5b5c9bc7 8884 SetForegroundColour(self, Colour colour) -> bool
d55e5bfc
RD
8885
8886 Sets the foreground colour of the window. Returns True is the colour
8887 was changed. The interpretation of foreground colour is dependent on
8888 the window class; it may be the text colour or other colour, or it may
8889 not be used at all.
8890 """
5b5c9bc7 8891 return _core_.Window_SetForegroundColour(*args, **kwargs)
d55e5bfc 8892
fa47d7a7 8893 def SetOwnForegroundColour(*args, **kwargs):
5b5c9bc7
RD
8894 """SetOwnForegroundColour(self, Colour colour)"""
8895 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
8896
8897 def GetBackgroundColour(*args, **kwargs):
8898 """
5b5c9bc7 8899 GetBackgroundColour(self) -> Colour
d55e5bfc
RD
8900
8901 Returns the background colour of the window.
8902 """
5b5c9bc7 8903 return _core_.Window_GetBackgroundColour(*args, **kwargs)
d55e5bfc
RD
8904
8905 def GetForegroundColour(*args, **kwargs):
8906 """
5b5c9bc7 8907 GetForegroundColour(self) -> Colour
d55e5bfc
RD
8908
8909 Returns the foreground colour of the window. The interpretation of
8910 foreground colour is dependent on the window class; it may be the text
8911 colour or other colour, or it may not be used at all.
8912 """
5b5c9bc7 8913 return _core_.Window_GetForegroundColour(*args, **kwargs)
d55e5bfc 8914
dcb8fc74
RD
8915 def InheritsBackgroundColour(*args, **kwargs):
8916 """InheritsBackgroundColour(self) -> bool"""
5b5c9bc7 8917 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
dcb8fc74
RD
8918
8919 def UseBgCol(*args, **kwargs):
8920 """UseBgCol(self) -> bool"""
5b5c9bc7 8921 return _core_.Window_UseBgCol(*args, **kwargs)
dcb8fc74 8922
0f63ec68
RD
8923 def SetBackgroundStyle(*args, **kwargs):
8924 """
8925 SetBackgroundStyle(self, int style) -> bool
8926
8927 Returns the background style of the window. The background style
8928 indicates how the background of the window is drawn.
8929
8930 ====================== ========================================
8931 wx.BG_STYLE_SYSTEM The background colour or pattern should
8932 be determined by the system
8933 wx.BG_STYLE_COLOUR The background should be a solid colour
8934 wx.BG_STYLE_CUSTOM The background will be implemented by the
8935 application.
8936 ====================== ========================================
8937
8938 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
8939 a custom background, such as a tiled bitmap. Currently the style has
8940 no effect on other platforms.
8941
8942 :see: `GetBackgroundStyle`, `SetBackgroundColour`
8943 """
5b5c9bc7 8944 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
0f63ec68
RD
8945
8946 def GetBackgroundStyle(*args, **kwargs):
8947 """
8948 GetBackgroundStyle(self) -> int
8949
8950 Returns the background style of the window.
8951
8952 :see: `SetBackgroundStyle`
8953 """
5b5c9bc7 8954 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
0f63ec68 8955
51b83b37
RD
8956 def HasTransparentBackground(*args, **kwargs):
8957 """
8958 HasTransparentBackground(self) -> bool
8959
8960 Returns True if this window's background is transparent (as, for
8961 example, for `wx.StaticText`) and should show the parent window's
8962 background.
8963
8964 This method is mostly used internally by the library itself and you
8965 normally shouldn't have to call it. You may, however, have to override
8966 it in your custom control classes to ensure that background is painted
8967 correctly.
8968 """
5b5c9bc7 8969 return _core_.Window_HasTransparentBackground(*args, **kwargs)
51b83b37 8970
d55e5bfc
RD
8971 def SetCursor(*args, **kwargs):
8972 """
5b5c9bc7 8973 SetCursor(self, Cursor cursor) -> bool
d55e5bfc
RD
8974
8975 Sets the window's cursor. Notice that the window cursor also sets it
8976 for the children of the window implicitly.
8977
8978 The cursor may be wx.NullCursor in which case the window cursor will
8979 be reset back to default.
8980 """
5b5c9bc7 8981 return _core_.Window_SetCursor(*args, **kwargs)
d55e5bfc
RD
8982
8983 def GetCursor(*args, **kwargs):
8984 """
5b5c9bc7 8985 GetCursor(self) -> Cursor
d55e5bfc
RD
8986
8987 Return the cursor associated with this window.
8988 """
5b5c9bc7 8989 return _core_.Window_GetCursor(*args, **kwargs)
d55e5bfc
RD
8990
8991 def SetFont(*args, **kwargs):
8992 """
5b5c9bc7 8993 SetFont(self, Font font) -> bool
d55e5bfc
RD
8994
8995 Sets the font for this window.
8996 """
5b5c9bc7 8997 return _core_.Window_SetFont(*args, **kwargs)
d55e5bfc 8998
fa47d7a7 8999 def SetOwnFont(*args, **kwargs):
5b5c9bc7
RD
9000 """SetOwnFont(self, Font font)"""
9001 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9002
9003 def GetFont(*args, **kwargs):
9004 """
5b5c9bc7 9005 GetFont(self) -> Font
d55e5bfc
RD
9006
9007 Returns the default font used for this window.
9008 """
5b5c9bc7 9009 return _core_.Window_GetFont(*args, **kwargs)
d55e5bfc
RD
9010
9011 def SetCaret(*args, **kwargs):
9012 """
5b5c9bc7 9013 SetCaret(self, Caret caret)
d55e5bfc
RD
9014
9015 Sets the caret associated with the window.
9016 """
5b5c9bc7 9017 return _core_.Window_SetCaret(*args, **kwargs)
d55e5bfc
RD
9018
9019 def GetCaret(*args, **kwargs):
9020 """
5b5c9bc7 9021 GetCaret(self) -> Caret
d55e5bfc
RD
9022
9023 Returns the caret associated with the window.
9024 """
5b5c9bc7 9025 return _core_.Window_GetCaret(*args, **kwargs)
d55e5bfc
RD
9026
9027 def GetCharHeight(*args, **kwargs):
9028 """
9029 GetCharHeight(self) -> int
9030
9031 Get the (average) character size for the current font.
9032 """
5b5c9bc7 9033 return _core_.Window_GetCharHeight(*args, **kwargs)
d55e5bfc
RD
9034
9035 def GetCharWidth(*args, **kwargs):
9036 """
9037 GetCharWidth(self) -> int
9038
9039 Get the (average) character size for the current font.
9040 """
5b5c9bc7 9041 return _core_.Window_GetCharWidth(*args, **kwargs)
d55e5bfc
RD
9042
9043 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9044 """
9045 GetTextExtent(String string) -> (width, height)
9046
9047 Get the width and height of the text using the current font.
9048 """
5b5c9bc7 9049 return _core_.Window_GetTextExtent(*args, **kwargs)
d55e5bfc
RD
9050
9051 def GetFullTextExtent(*args, **kwargs):
9052 """
9053 GetFullTextExtent(String string, Font font=None) ->
9054 (width, height, descent, externalLeading)
9055
9056 Get the width, height, decent and leading of the text using the
9057 current or specified font.
9058 """
5b5c9bc7 9059 return _core_.Window_GetFullTextExtent(*args, **kwargs)
d55e5bfc
RD
9060
9061 def ClientToScreenXY(*args, **kwargs):
9062 """
9063 ClientToScreenXY(int x, int y) -> (x,y)
9064
9065 Converts to screen coordinates from coordinates relative to this window.
9066 """
5b5c9bc7 9067 return _core_.Window_ClientToScreenXY(*args, **kwargs)
d55e5bfc
RD
9068
9069 def ScreenToClientXY(*args, **kwargs):
9070 """
9071 ScreenToClientXY(int x, int y) -> (x,y)
9072
9073 Converts from screen to client window coordinates.
9074 """
5b5c9bc7 9075 return _core_.Window_ScreenToClientXY(*args, **kwargs)
d55e5bfc
RD
9076
9077 def ClientToScreen(*args, **kwargs):
9078 """
5b5c9bc7 9079 ClientToScreen(self, Point pt) -> Point
d55e5bfc
RD
9080
9081 Converts to screen coordinates from coordinates relative to this window.
9082 """
5b5c9bc7 9083 return _core_.Window_ClientToScreen(*args, **kwargs)
d55e5bfc
RD
9084
9085 def ScreenToClient(*args, **kwargs):
9086 """
5b5c9bc7 9087 ScreenToClient(self, Point pt) -> Point
d55e5bfc
RD
9088
9089 Converts from screen to client window coordinates.
9090 """
5b5c9bc7 9091 return _core_.Window_ScreenToClient(*args, **kwargs)
d55e5bfc
RD
9092
9093 def HitTestXY(*args, **kwargs):
9094 """
9095 HitTestXY(self, int x, int y) -> int
9096
9097 Test where the given (in client coords) point lies
9098 """
5b5c9bc7 9099 return _core_.Window_HitTestXY(*args, **kwargs)
d55e5bfc
RD
9100
9101 def HitTest(*args, **kwargs):
9102 """
5b5c9bc7 9103 HitTest(self, Point pt) -> int
d55e5bfc
RD
9104
9105 Test where the given (in client coords) point lies
9106 """
5b5c9bc7 9107 return _core_.Window_HitTest(*args, **kwargs)
d55e5bfc
RD
9108
9109 def GetBorder(*args):
9110 """
9111 GetBorder(self, long flags) -> int
9112 GetBorder(self) -> int
9113
9114 Get border for the flags of this window
9115 """
5b5c9bc7 9116 return _core_.Window_GetBorder(*args)
d55e5bfc
RD
9117
9118 def UpdateWindowUI(*args, **kwargs):
9119 """
5b5c9bc7 9120 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
d55e5bfc
RD
9121
9122 This function sends EVT_UPDATE_UI events to the window. The particular
9123 implementation depends on the window; for example a wx.ToolBar will
9124 send an update UI event for each toolbar button, and a wx.Frame will
9125 send an update UI event for each menubar menu item. You can call this
9126 function from your application to ensure that your UI is up-to-date at
9127 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9128 concerned). This may be necessary if you have called
5ba5649b 9129 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9130 limit the overhead that wxWindows incurs by sending update UI events
9131 in idle time.
d55e5bfc 9132 """
5b5c9bc7 9133 return _core_.Window_UpdateWindowUI(*args, **kwargs)
d55e5bfc
RD
9134
9135 def PopupMenuXY(*args, **kwargs):
9136 """
5b5c9bc7 9137 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9138
b0503257
RD
9139 Pops up the given menu at the specified coordinates, relative to this window,
9140 and returns control when the user has dismissed the menu. If a menu item is
9141 selected, the corresponding menu event is generated and will be processed as
9142 usual. If the default position is given then the current position of the
9143 mouse cursor will be used.
d55e5bfc 9144 """
5b5c9bc7 9145 return _core_.Window_PopupMenuXY(*args, **kwargs)
d55e5bfc
RD
9146
9147 def PopupMenu(*args, **kwargs):
9148 """
5b5c9bc7 9149 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 9150
b0503257
RD
9151 Pops up the given menu at the specified coordinates, relative to this window,
9152 and returns control when the user has dismissed the menu. If a menu item is
9153 selected, the corresponding menu event is generated and will be processed as
9154 usual. If the default position is given then the current position of the
9155 mouse cursor will be used.
d55e5bfc 9156 """
5b5c9bc7 9157 return _core_.Window_PopupMenu(*args, **kwargs)
d55e5bfc
RD
9158
9159 def GetHandle(*args, **kwargs):
9160 """
9161 GetHandle(self) -> long
9162
9163 Returns the platform-specific handle (as a long integer) of the
9164 physical window. Currently on wxMac it returns the handle of the
9165 toplevel parent of the window.
9166 """
5b5c9bc7 9167 return _core_.Window_GetHandle(*args, **kwargs)
d55e5bfc 9168
629e65c2
RD
9169 def AssociateHandle(*args, **kwargs):
9170 """
9171 AssociateHandle(self, long handle)
9172
9173 Associate the window with a new native handle
9174 """
5b5c9bc7 9175 return _core_.Window_AssociateHandle(*args, **kwargs)
629e65c2
RD
9176
9177 def DissociateHandle(*args, **kwargs):
9178 """
9179 DissociateHandle(self)
9180
9181 Dissociate the current native handle from the window
9182 """
5b5c9bc7 9183 return _core_.Window_DissociateHandle(*args, **kwargs)
629e65c2 9184
d55e5bfc
RD
9185 def HasScrollbar(*args, **kwargs):
9186 """
9187 HasScrollbar(self, int orient) -> bool
9188
9189 Does the window have the scrollbar for this orientation?
9190 """
5b5c9bc7 9191 return _core_.Window_HasScrollbar(*args, **kwargs)
d55e5bfc
RD
9192
9193 def SetScrollbar(*args, **kwargs):
9194 """
15817c7e 9195 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
9196 bool refresh=True)
9197
9198 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc 9199 """
5b5c9bc7 9200 return _core_.Window_SetScrollbar(*args, **kwargs)
d55e5bfc
RD
9201
9202 def SetScrollPos(*args, **kwargs):
9203 """
9204 SetScrollPos(self, int orientation, int pos, bool refresh=True)
9205
9206 Sets the position of one of the built-in scrollbars.
9207 """
5b5c9bc7 9208 return _core_.Window_SetScrollPos(*args, **kwargs)
d55e5bfc
RD
9209
9210 def GetScrollPos(*args, **kwargs):
9211 """
9212 GetScrollPos(self, int orientation) -> int
9213
9214 Returns the built-in scrollbar position.
9215 """
5b5c9bc7 9216 return _core_.Window_GetScrollPos(*args, **kwargs)
d55e5bfc
RD
9217
9218 def GetScrollThumb(*args, **kwargs):
9219 """
9220 GetScrollThumb(self, int orientation) -> int
9221
9222 Returns the built-in scrollbar thumb size.
9223 """
5b5c9bc7 9224 return _core_.Window_GetScrollThumb(*args, **kwargs)
d55e5bfc
RD
9225
9226 def GetScrollRange(*args, **kwargs):
9227 """
9228 GetScrollRange(self, int orientation) -> int
9229
9230 Returns the built-in scrollbar range.
9231 """
5b5c9bc7 9232 return _core_.Window_GetScrollRange(*args, **kwargs)
d55e5bfc
RD
9233
9234 def ScrollWindow(*args, **kwargs):
9235 """
5b5c9bc7 9236 ScrollWindow(self, int dx, int dy, Rect rect=None)
d55e5bfc
RD
9237
9238 Physically scrolls the pixels in the window and move child windows
9239 accordingly. Use this function to optimise your scrolling
9240 implementations, to minimise the area that must be redrawn. Note that
9241 it is rarely required to call this function from a user program.
d55e5bfc 9242 """
5b5c9bc7 9243 return _core_.Window_ScrollWindow(*args, **kwargs)
d55e5bfc
RD
9244
9245 def ScrollLines(*args, **kwargs):
9246 """
9247 ScrollLines(self, int lines) -> bool
9248
9249 If the platform and window class supports it, scrolls the window by
9250 the given number of lines down, if lines is positive, or up if lines
9251 is negative. Returns True if the window was scrolled, False if it was
9252 already on top/bottom and nothing was done.
9253 """
5b5c9bc7 9254 return _core_.Window_ScrollLines(*args, **kwargs)
d55e5bfc
RD
9255
9256 def ScrollPages(*args, **kwargs):
9257 """
9258 ScrollPages(self, int pages) -> bool
9259
15817c7e 9260 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
9261 the given number of pages down, if pages is positive, or up if pages
9262 is negative. Returns True if the window was scrolled, False if it was
9263 already on top/bottom and nothing was done.
9264 """
5b5c9bc7 9265 return _core_.Window_ScrollPages(*args, **kwargs)
d55e5bfc
RD
9266
9267 def LineUp(*args, **kwargs):
9268 """
9269 LineUp(self) -> bool
9270
9271 This is just a wrapper for ScrollLines(-1).
9272 """
5b5c9bc7 9273 return _core_.Window_LineUp(*args, **kwargs)
d55e5bfc
RD
9274
9275 def LineDown(*args, **kwargs):
9276 """
9277 LineDown(self) -> bool
9278
9279 This is just a wrapper for ScrollLines(1).
9280 """
5b5c9bc7 9281 return _core_.Window_LineDown(*args, **kwargs)
d55e5bfc
RD
9282
9283 def PageUp(*args, **kwargs):
9284 """
9285 PageUp(self) -> bool
9286
9287 This is just a wrapper for ScrollPages(-1).
9288 """
5b5c9bc7 9289 return _core_.Window_PageUp(*args, **kwargs)
d55e5bfc
RD
9290
9291 def PageDown(*args, **kwargs):
9292 """
9293 PageDown(self) -> bool
9294
9295 This is just a wrapper for ScrollPages(1).
9296 """
5b5c9bc7 9297 return _core_.Window_PageDown(*args, **kwargs)
d55e5bfc
RD
9298
9299 def SetHelpText(*args, **kwargs):
9300 """
5b5c9bc7 9301 SetHelpText(self, String text)
d55e5bfc
RD
9302
9303 Sets the help text to be used as context-sensitive help for this
9304 window. Note that the text is actually stored by the current
f52cbe90 9305 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 9306 """
5b5c9bc7 9307 return _core_.Window_SetHelpText(*args, **kwargs)
d55e5bfc
RD
9308
9309 def SetHelpTextForId(*args, **kwargs):
9310 """
5b5c9bc7 9311 SetHelpTextForId(self, String text)
d55e5bfc
RD
9312
9313 Associate this help text with all windows with the same id as this
9314 one.
9315 """
5b5c9bc7 9316 return _core_.Window_SetHelpTextForId(*args, **kwargs)
d55e5bfc
RD
9317
9318 def GetHelpText(*args, **kwargs):
9319 """
5b5c9bc7 9320 GetHelpText(self) -> String
d55e5bfc
RD
9321
9322 Gets the help text to be used as context-sensitive help for this
9323 window. Note that the text is actually stored by the current
f52cbe90 9324 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 9325 """
5b5c9bc7 9326 return _core_.Window_GetHelpText(*args, **kwargs)
d55e5bfc
RD
9327
9328 def SetToolTipString(*args, **kwargs):
9329 """
5b5c9bc7 9330 SetToolTipString(self, String tip)
d55e5bfc
RD
9331
9332 Attach a tooltip to the window.
9333 """
5b5c9bc7 9334 return _core_.Window_SetToolTipString(*args, **kwargs)
d55e5bfc
RD
9335
9336 def SetToolTip(*args, **kwargs):
9337 """
5b5c9bc7 9338 SetToolTip(self, ToolTip tip)
d55e5bfc
RD
9339
9340 Attach a tooltip to the window.
9341 """
5b5c9bc7 9342 return _core_.Window_SetToolTip(*args, **kwargs)
d55e5bfc
RD
9343
9344 def GetToolTip(*args, **kwargs):
9345 """
5b5c9bc7 9346 GetToolTip(self) -> ToolTip
d55e5bfc
RD
9347
9348 get the associated tooltip or None if none
9349 """
5b5c9bc7 9350 return _core_.Window_GetToolTip(*args, **kwargs)
d55e5bfc
RD
9351
9352 def SetDropTarget(*args, **kwargs):
9353 """
5b5c9bc7 9354 SetDropTarget(self, DropTarget dropTarget)
d55e5bfc
RD
9355
9356 Associates a drop target with this window. If the window already has
9357 a drop target, it is deleted.
9358 """
5b5c9bc7 9359 return _core_.Window_SetDropTarget(*args, **kwargs)
d55e5bfc
RD
9360
9361 def GetDropTarget(*args, **kwargs):
9362 """
5b5c9bc7 9363 GetDropTarget(self) -> DropTarget
d55e5bfc
RD
9364
9365 Returns the associated drop target, which may be None.
9366 """
5b5c9bc7 9367 return _core_.Window_GetDropTarget(*args, **kwargs)
d55e5bfc 9368
5ba5649b
RD
9369 def DragAcceptFiles(*args, **kwargs):
9370 """
9371 DragAcceptFiles(self, bool accept)
9372
9373 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9374 Only functional on Windows.
9375 """
9376 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9377
d55e5bfc
RD
9378 def SetConstraints(*args, **kwargs):
9379 """
5b5c9bc7 9380 SetConstraints(self, LayoutConstraints constraints)
d55e5bfc
RD
9381
9382 Sets the window to have the given layout constraints. If an existing
9383 layout constraints object is already owned by the window, it will be
9384 deleted. Pass None to disassociate and delete the window's current
9385 constraints.
9386
9387 You must call SetAutoLayout to tell a window to use the constraints
9388 automatically in its default EVT_SIZE handler; otherwise, you must
9389 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9390 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9391 effect.
9392 """
5b5c9bc7 9393 return _core_.Window_SetConstraints(*args, **kwargs)
d55e5bfc
RD
9394
9395 def GetConstraints(*args, **kwargs):
9396 """
5b5c9bc7 9397 GetConstraints(self) -> LayoutConstraints
d55e5bfc
RD
9398
9399 Returns a pointer to the window's layout constraints, or None if there
9400 are none.
9401 """
5b5c9bc7 9402 return _core_.Window_GetConstraints(*args, **kwargs)
d55e5bfc
RD
9403
9404 def SetAutoLayout(*args, **kwargs):
9405 """
9406 SetAutoLayout(self, bool autoLayout)
9407
9408 Determines whether the Layout function will be called automatically
b1fcee84
RD
9409 when the window is resized. lease note that this only happens for the
9410 windows usually used to contain children, namely `wx.Panel` and
9411 `wx.TopLevelWindow` (and the classes deriving from them).
9412
9413 This method is called implicitly by `SetSizer` but if you use
9414 `SetConstraints` you should call it manually or otherwise the window
9415 layout won't be correctly updated when its size changes.
d55e5bfc 9416 """
5b5c9bc7 9417 return _core_.Window_SetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9418
9419 def GetAutoLayout(*args, **kwargs):
9420 """
9421 GetAutoLayout(self) -> bool
9422
9423 Returns the current autoLayout setting
9424 """
5b5c9bc7 9425 return _core_.Window_GetAutoLayout(*args, **kwargs)
d55e5bfc
RD
9426
9427 def Layout(*args, **kwargs):
9428 """
9429 Layout(self) -> bool
9430
9431 Invokes the constraint-based layout algorithm or the sizer-based
9432 algorithm for this window. See SetAutoLayout: when auto layout is on,
9433 this function gets called automatically by the default EVT_SIZE
9434 handler when the window is resized.
9435 """
5b5c9bc7 9436 return _core_.Window_Layout(*args, **kwargs)
d55e5bfc
RD
9437
9438 def SetSizer(*args, **kwargs):
9439 """
5b5c9bc7 9440 SetSizer(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9441
9442 Sets the window to have the given layout sizer. The window will then
9443 own the object, and will take care of its deletion. If an existing
9444 layout sizer object is already owned by the window, it will be deleted
9445 if the deleteOld parameter is true. Note that this function will also
9446 call SetAutoLayout implicitly with a True parameter if the sizer is
b411df4a 9447 non-None, and False otherwise.
d55e5bfc 9448 """
5b5c9bc7 9449 return _core_.Window_SetSizer(*args, **kwargs)
d55e5bfc
RD
9450
9451 def SetSizerAndFit(*args, **kwargs):
9452 """
5b5c9bc7 9453 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
9454
9455 The same as SetSizer, except it also sets the size hints for the
9456 window based on the sizer's minimum size.
9457 """
5b5c9bc7 9458 return _core_.Window_SetSizerAndFit(*args, **kwargs)
d55e5bfc
RD
9459
9460 def GetSizer(*args, **kwargs):
9461 """
5b5c9bc7 9462 GetSizer(self) -> Sizer
d55e5bfc
RD
9463
9464 Return the sizer associated with the window by a previous call to
9465 SetSizer or None if there isn't one.
9466 """
5b5c9bc7 9467 return _core_.Window_GetSizer(*args, **kwargs)
d55e5bfc
RD
9468
9469 def SetContainingSizer(*args, **kwargs):
9470 """
5b5c9bc7 9471 SetContainingSizer(self, Sizer sizer)
d55e5bfc
RD
9472
9473 This normally does not need to be called by application code. It is
9474 called internally when a window is added to a sizer, and is used so
9475 the window can remove itself from the sizer when it is destroyed.
9476 """
5b5c9bc7 9477 return _core_.Window_SetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9478
9479 def GetContainingSizer(*args, **kwargs):
9480 """
5b5c9bc7 9481 GetContainingSizer(self) -> Sizer
d55e5bfc
RD
9482
9483 Return the sizer that this window is a member of, if any, otherwise None.
9484 """
5b5c9bc7 9485 return _core_.Window_GetContainingSizer(*args, **kwargs)
d55e5bfc
RD
9486
9487 def InheritAttributes(*args, **kwargs):
9488 """
9489 InheritAttributes(self)
9490
15817c7e
RD
9491 This function is (or should be, in case of custom controls) called
9492 during window creation to intelligently set up the window visual
9493 attributes, that is the font and the foreground and background
9494 colours.
9495
9496 By 'intelligently' the following is meant: by default, all windows use
9497 their own default attributes. However if some of the parent's
9498 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 9499 SetOwnFont) and if the corresponding attribute hadn't been
15817c7e
RD
9500 explicitly set for this window itself, then this window takes the same
9501 value as used by the parent. In addition, if the window overrides
9502 ShouldInheritColours to return false, the colours will not be changed
9503 no matter what and only the font might.
9504
a7bb0a9d
RD
9505 This rather complicated logic is necessary in order to accommodate the
9506 different usage scenarios. The most common one is when all default
15817c7e
RD
9507 attributes are used and in this case, nothing should be inherited as
9508 in modern GUIs different controls use different fonts (and colours)
9509 than their siblings so they can't inherit the same value from the
9510 parent. However it was also deemed desirable to allow to simply change
9511 the attributes of all children at once by just changing the font or
9512 colour of their common parent, hence in this case we do inherit the
9513 parents attributes.
9514
d55e5bfc 9515 """
5b5c9bc7 9516 return _core_.Window_InheritAttributes(*args, **kwargs)
d55e5bfc
RD
9517
9518 def ShouldInheritColours(*args, **kwargs):
9519 """
9520 ShouldInheritColours(self) -> bool
9521
9522 Return true from here to allow the colours of this window to be
15817c7e
RD
9523 changed by InheritAttributes, returning false forbids inheriting them
9524 from the parent window.
d55e5bfc 9525
15817c7e
RD
9526 The base class version returns false, but this method is overridden in
9527 wxControl where it returns true.
d55e5bfc 9528 """
5b5c9bc7 9529 return _core_.Window_ShouldInheritColours(*args, **kwargs)
d55e5bfc
RD
9530
9531 def PostCreate(self, pre):
9532 """
9533 Phase 3 of the 2-phase create <wink!>
9534 Call this method after precreating the window with the 2-phase create method.
9535 """
9536 self.this = pre.this
9537 self.thisown = pre.thisown
9538 pre.thisown = 0
9539 if hasattr(self, '_setOORInfo'):
9540 self._setOORInfo(self)
9541 if hasattr(self, '_setCallbackInfo'):
9542 self._setCallbackInfo(self, self.__class__)
9543
7e08d4ef
RD
9544 def SendSizeEvent(self):
9545 self.GetEventhandler().ProcessEvent(wx.SizeEvent((-1,-1)))
9546
2131d850 9547_core_.Window_swigregister(Window)
d55e5bfc
RD
9548
9549def PreWindow(*args, **kwargs):
9550 """
5b5c9bc7 9551 PreWindow() -> Window
d55e5bfc
RD
9552
9553 Precreate a Window for 2-phase creation.
9554 """
5b5c9bc7 9555 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
9556 return val
9557
1bd55598
RD
9558def Window_NewControlId(*args):
9559 """
5b5c9bc7 9560 Window_NewControlId() -> int
d55e5bfc
RD
9561
9562 Generate a control id for the controls which were not given one.
9563 """
1bd55598 9564 return _core_.Window_NewControlId(*args)
d55e5bfc 9565
5b5c9bc7 9566def Window_NextControlId(*args, **kwargs):
1bd55598 9567 """
5b5c9bc7 9568 Window_NextControlId(int winid) -> int
d55e5bfc
RD
9569
9570 Get the id of the control following the one with the given
15817c7e 9571 autogenerated) id
d55e5bfc 9572 """
1bd55598 9573 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc 9574
5b5c9bc7 9575def Window_PrevControlId(*args, **kwargs):
1bd55598 9576 """
5b5c9bc7 9577 Window_PrevControlId(int winid) -> int
d55e5bfc
RD
9578
9579 Get the id of the control preceding the one with the given
15817c7e 9580 autogenerated) id
d55e5bfc 9581 """
1bd55598 9582 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 9583
1bd55598
RD
9584def Window_FindFocus(*args):
9585 """
5b5c9bc7 9586 Window_FindFocus() -> Window
d55e5bfc
RD
9587
9588 Returns the window or control that currently has the keyboard focus,
9589 or None.
9590 """
1bd55598 9591 return _core_.Window_FindFocus(*args)
d55e5bfc 9592
1bd55598
RD
9593def Window_GetCapture(*args):
9594 """
5b5c9bc7 9595 Window_GetCapture() -> Window
d55e5bfc
RD
9596
9597 Returns the window which currently captures the mouse or None
9598 """
1bd55598 9599 return _core_.Window_GetCapture(*args)
d55e5bfc 9600
5b5c9bc7 9601def Window_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 9602 """
5b5c9bc7 9603 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9604
15817c7e
RD
9605 Get the default attributes for this class. This is useful if you want
9606 to use the same font or colour in your own control as in a standard
9607 control -- which is a much better idea than hard coding specific
a5ee0656
RD
9608 colours or fonts which might look completely out of place on the
9609 user's system, especially if it uses themes.
d55e5bfc
RD
9610
9611 The variant parameter is only relevant under Mac currently and is
15817c7e 9612 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
9613 the returned font. See `wx.Window.SetWindowVariant` for more about
9614 this.
d55e5bfc 9615 """
1bd55598 9616 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9617
9618def DLG_PNT(win, point_or_x, y=None):
9619 """
9620 Convenience function for converting a Point or (x,y) in
9621 dialog units to pixel units.
9622 """
9623 if y is None:
9624 return win.ConvertDialogPointToPixels(point_or_x)
9625 else:
9626 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
9627
9628def DLG_SZE(win, size_width, height=None):
9629 """
9630 Convenience function for converting a Size or (w,h) in
9631 dialog units to pixel units.
9632 """
9633 if height is None:
9634 return win.ConvertDialogSizeToPixels(size_width)
9635 else:
9636 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
9637
9638
5b5c9bc7 9639def FindWindowById(*args, **kwargs):
1bd55598 9640 """
5b5c9bc7 9641 FindWindowById(long id, Window parent=None) -> Window
d55e5bfc
RD
9642
9643 Find the first window in the application with the given id. If parent
9644 is None, the search will start from all top-level frames and dialog
9645 boxes; if non-None, the search will be limited to the given window
9646 hierarchy. The search is recursive in both cases.
9647 """
1bd55598 9648 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc 9649
5b5c9bc7 9650def FindWindowByName(*args, **kwargs):
1bd55598 9651 """
5b5c9bc7 9652 FindWindowByName(String name, Window parent=None) -> Window
d55e5bfc
RD
9653
9654 Find a window by its name (as given in a window constructor or Create
9655 function call). If parent is None, the search will start from all
9656 top-level frames and dialog boxes; if non-None, the search will be
9657 limited to the given window hierarchy. The search is recursive in both
9658 cases.
9659
9660 If no window with such name is found, wx.FindWindowByLabel is called.
9661 """
1bd55598 9662 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc 9663
5b5c9bc7 9664def FindWindowByLabel(*args, **kwargs):
1bd55598 9665 """
5b5c9bc7 9666 FindWindowByLabel(String label, Window parent=None) -> Window
d55e5bfc
RD
9667
9668 Find a window by its label. Depending on the type of window, the label
9669 may be a window title or panel item label. If parent is None, the
9670 search will start from all top-level frames and dialog boxes; if
9671 non-None, the search will be limited to the given window
9672 hierarchy. The search is recursive in both cases.
9673 """
1bd55598 9674 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc 9675
5b5c9bc7 9676def Window_FromHWND(*args, **kwargs):
1bd55598
RD
9677 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
9678 return _core_.Window_FromHWND(*args, **kwargs)
3215336e 9679
1bd55598
RD
9680def GetTopLevelWindows(*args):
9681 """
3215336e
RD
9682 GetTopLevelWindows() -> PyObject
9683
9684 Returns a list of the the application's top-level windows, (frames,
9685 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
9686 by wxWidgets, and so it is only valid as long as no top-level windows
9687 are closed or new top-level windows are created.
9688
9689 """
1bd55598 9690 return _core_.GetTopLevelWindows(*args)
d55e5bfc
RD
9691#---------------------------------------------------------------------------
9692
5b5c9bc7
RD
9693class Validator(EvtHandler):
9694 """Proxy of C++ Validator class"""
1bd55598
RD
9695 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9696 __repr__ = _swig_repr
9697 def __init__(self, *args, **kwargs):
5b5c9bc7 9698 """__init__(self) -> Validator"""
1bd55598 9699 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d55e5bfc
RD
9700 self._setOORInfo(self)
9701
9702 def Clone(*args, **kwargs):
5b5c9bc7
RD
9703 """Clone(self) -> Validator"""
9704 return _core_.Validator_Clone(*args, **kwargs)
d55e5bfc
RD
9705
9706 def Validate(*args, **kwargs):
5b5c9bc7
RD
9707 """Validate(self, Window parent) -> bool"""
9708 return _core_.Validator_Validate(*args, **kwargs)
d55e5bfc
RD
9709
9710 def TransferToWindow(*args, **kwargs):
9711 """TransferToWindow(self) -> bool"""
5b5c9bc7 9712 return _core_.Validator_TransferToWindow(*args, **kwargs)
d55e5bfc
RD
9713
9714 def TransferFromWindow(*args, **kwargs):
9715 """TransferFromWindow(self) -> bool"""
5b5c9bc7 9716 return _core_.Validator_TransferFromWindow(*args, **kwargs)
d55e5bfc
RD
9717
9718 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
9719 """GetWindow(self) -> Window"""
9720 return _core_.Validator_GetWindow(*args, **kwargs)
d55e5bfc
RD
9721
9722 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
9723 """SetWindow(self, Window window)"""
9724 return _core_.Validator_SetWindow(*args, **kwargs)
d55e5bfc
RD
9725
9726 def IsSilent(*args, **kwargs):
d6c14a4c 9727 """IsSilent() -> bool"""
5b5c9bc7 9728 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc
RD
9729
9730 IsSilent = staticmethod(IsSilent)
9731 def SetBellOnError(*args, **kwargs):
d6c14a4c 9732 """SetBellOnError(int doIt=True)"""
5b5c9bc7 9733 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
9734
9735 SetBellOnError = staticmethod(SetBellOnError)
2131d850 9736_core_.Validator_swigregister(Validator)
d55e5bfc 9737
1bd55598
RD
9738def Validator_IsSilent(*args):
9739 """Validator_IsSilent() -> bool"""
9740 return _core_.Validator_IsSilent(*args)
d55e5bfc 9741
5b5c9bc7 9742def Validator_SetBellOnError(*args, **kwargs):
1bd55598
RD
9743 """Validator_SetBellOnError(int doIt=True)"""
9744 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc 9745
5b5c9bc7
RD
9746class PyValidator(Validator):
9747 """Proxy of C++ PyValidator class"""
1bd55598
RD
9748 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9749 __repr__ = _swig_repr
9750 def __init__(self, *args, **kwargs):
5b5c9bc7 9751 """__init__(self) -> PyValidator"""
1bd55598 9752 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
d55e5bfc
RD
9753
9754 self._setCallbackInfo(self, PyValidator, 1)
9755 self._setOORInfo(self)
9756
9757 def _setCallbackInfo(*args, **kwargs):
9758 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
5b5c9bc7 9759 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
d55e5bfc 9760
2131d850 9761_core_.PyValidator_swigregister(PyValidator)
d55e5bfc
RD
9762
9763#---------------------------------------------------------------------------
9764
5b5c9bc7
RD
9765class Menu(EvtHandler):
9766 """Proxy of C++ Menu class"""
1bd55598
RD
9767 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
9768 __repr__ = _swig_repr
9769 def __init__(self, *args, **kwargs):
5b5c9bc7 9770 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
1bd55598 9771 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
d55e5bfc
RD
9772 self._setOORInfo(self)
9773
9774 def Append(*args, **kwargs):
5b5c9bc7
RD
9775 """Append(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9776 return _core_.Menu_Append(*args, **kwargs)
d55e5bfc
RD
9777
9778 def AppendSeparator(*args, **kwargs):
5b5c9bc7
RD
9779 """AppendSeparator(self) -> MenuItem"""
9780 return _core_.Menu_AppendSeparator(*args, **kwargs)
d55e5bfc
RD
9781
9782 def AppendCheckItem(*args, **kwargs):
5b5c9bc7
RD
9783 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9784 return _core_.Menu_AppendCheckItem(*args, **kwargs)
d55e5bfc
RD
9785
9786 def AppendRadioItem(*args, **kwargs):
5b5c9bc7
RD
9787 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9788 return _core_.Menu_AppendRadioItem(*args, **kwargs)
d55e5bfc
RD
9789
9790 def AppendMenu(*args, **kwargs):
5b5c9bc7
RD
9791 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9792 return _core_.Menu_AppendMenu(*args, **kwargs)
d55e5bfc 9793
da91cb0f
RD
9794 def AppendSubMenu(*args, **kwargs):
9795 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
9796 return _core_.Menu_AppendSubMenu(*args, **kwargs)
9797
d55e5bfc 9798 def AppendItem(*args, **kwargs):
5b5c9bc7
RD
9799 """AppendItem(self, MenuItem item) -> MenuItem"""
9800 return _core_.Menu_AppendItem(*args, **kwargs)
d55e5bfc 9801
d55e5bfc 9802 def InsertItem(*args, **kwargs):
5b5c9bc7
RD
9803 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
9804 return _core_.Menu_InsertItem(*args, **kwargs)
d55e5bfc 9805
1bd55598
RD
9806 def PrependItem(*args, **kwargs):
9807 """PrependItem(self, MenuItem item) -> MenuItem"""
9808 return _core_.Menu_PrependItem(*args, **kwargs)
9809
9810 def Break(*args, **kwargs):
9811 """Break(self)"""
9812 return _core_.Menu_Break(*args, **kwargs)
9813
d55e5bfc
RD
9814 def Insert(*args, **kwargs):
9815 """
5b5c9bc7
RD
9816 Insert(self, size_t pos, int id, String text, String help=EmptyString,
9817 int kind=ITEM_NORMAL) -> MenuItem
d55e5bfc 9818 """
5b5c9bc7 9819 return _core_.Menu_Insert(*args, **kwargs)
d55e5bfc
RD
9820
9821 def InsertSeparator(*args, **kwargs):
5b5c9bc7
RD
9822 """InsertSeparator(self, size_t pos) -> MenuItem"""
9823 return _core_.Menu_InsertSeparator(*args, **kwargs)
d55e5bfc
RD
9824
9825 def InsertCheckItem(*args, **kwargs):
5b5c9bc7
RD
9826 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9827 return _core_.Menu_InsertCheckItem(*args, **kwargs)
d55e5bfc
RD
9828
9829 def InsertRadioItem(*args, **kwargs):
5b5c9bc7
RD
9830 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
9831 return _core_.Menu_InsertRadioItem(*args, **kwargs)
d55e5bfc
RD
9832
9833 def InsertMenu(*args, **kwargs):
5b5c9bc7
RD
9834 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9835 return _core_.Menu_InsertMenu(*args, **kwargs)
d55e5bfc 9836
d55e5bfc 9837 def Prepend(*args, **kwargs):
5b5c9bc7
RD
9838 """Prepend(self, int id, String text, String help=EmptyString, int kind=ITEM_NORMAL) -> MenuItem"""
9839 return _core_.Menu_Prepend(*args, **kwargs)
d55e5bfc
RD
9840
9841 def PrependSeparator(*args, **kwargs):
5b5c9bc7
RD
9842 """PrependSeparator(self) -> MenuItem"""
9843 return _core_.Menu_PrependSeparator(*args, **kwargs)
d55e5bfc
RD
9844
9845 def PrependCheckItem(*args, **kwargs):
5b5c9bc7
RD
9846 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9847 return _core_.Menu_PrependCheckItem(*args, **kwargs)
d55e5bfc
RD
9848
9849 def PrependRadioItem(*args, **kwargs):
5b5c9bc7
RD
9850 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
9851 return _core_.Menu_PrependRadioItem(*args, **kwargs)
d55e5bfc
RD
9852
9853 def PrependMenu(*args, **kwargs):
5b5c9bc7
RD
9854 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
9855 return _core_.Menu_PrependMenu(*args, **kwargs)
d55e5bfc
RD
9856
9857 def Remove(*args, **kwargs):
5b5c9bc7
RD
9858 """Remove(self, int id) -> MenuItem"""
9859 return _core_.Menu_Remove(*args, **kwargs)
d55e5bfc
RD
9860
9861 def RemoveItem(*args, **kwargs):
5b5c9bc7
RD
9862 """RemoveItem(self, MenuItem item) -> MenuItem"""
9863 return _core_.Menu_RemoveItem(*args, **kwargs)
d55e5bfc
RD
9864
9865 def Delete(*args, **kwargs):
9866 """Delete(self, int id) -> bool"""
5b5c9bc7 9867 return _core_.Menu_Delete(*args, **kwargs)
d55e5bfc
RD
9868
9869 def DeleteItem(*args, **kwargs):
5b5c9bc7
RD
9870 """DeleteItem(self, MenuItem item) -> bool"""
9871 return _core_.Menu_DeleteItem(*args, **kwargs)
d55e5bfc
RD
9872
9873 def Destroy(*args, **kwargs):
9874 """
9875 Destroy(self)
9876
9877 Deletes the C++ object this Python object is a proxy for.
9878 """
7e08d4ef
RD
9879 val = _core_.Menu_Destroy(*args, **kwargs)
9880 args[0].thisown = 0
9881 return val
d55e5bfc
RD
9882
9883 def DestroyId(*args, **kwargs):
9884 """
9885 DestroyId(self, int id) -> bool
9886
9887 Deletes the C++ object this Python object is a proxy for.
9888 """
7e08d4ef
RD
9889 val = _core_.Menu_DestroyId(*args, **kwargs)
9890 args[0].thisown = 0
9891 return val
d55e5bfc
RD
9892
9893 def DestroyItem(*args, **kwargs):
9894 """
5b5c9bc7 9895 DestroyItem(self, MenuItem item) -> bool
d55e5bfc
RD
9896
9897 Deletes the C++ object this Python object is a proxy for.
9898 """
7e08d4ef
RD
9899 val = _core_.Menu_DestroyItem(*args, **kwargs)
9900 args[0].thisown = 0
9901 return val
d55e5bfc
RD
9902
9903 def GetMenuItemCount(*args, **kwargs):
9904 """GetMenuItemCount(self) -> size_t"""
5b5c9bc7 9905 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
d55e5bfc
RD
9906
9907 def GetMenuItems(*args, **kwargs):
9908 """GetMenuItems(self) -> PyObject"""
5b5c9bc7 9909 return _core_.Menu_GetMenuItems(*args, **kwargs)
d55e5bfc
RD
9910
9911 def FindItem(*args, **kwargs):
5b5c9bc7
RD
9912 """FindItem(self, String item) -> int"""
9913 return _core_.Menu_FindItem(*args, **kwargs)
d55e5bfc
RD
9914
9915 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
9916 """FindItemById(self, int id) -> MenuItem"""
9917 return _core_.Menu_FindItemById(*args, **kwargs)
d55e5bfc
RD
9918
9919 def FindItemByPosition(*args, **kwargs):
5b5c9bc7
RD
9920 """FindItemByPosition(self, size_t position) -> MenuItem"""
9921 return _core_.Menu_FindItemByPosition(*args, **kwargs)
d55e5bfc
RD
9922
9923 def Enable(*args, **kwargs):
9924 """Enable(self, int id, bool enable)"""
5b5c9bc7 9925 return _core_.Menu_Enable(*args, **kwargs)
d55e5bfc
RD
9926
9927 def IsEnabled(*args, **kwargs):
9928 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 9929 return _core_.Menu_IsEnabled(*args, **kwargs)
d55e5bfc
RD
9930
9931 def Check(*args, **kwargs):
9932 """Check(self, int id, bool check)"""
5b5c9bc7 9933 return _core_.Menu_Check(*args, **kwargs)
d55e5bfc
RD
9934
9935 def IsChecked(*args, **kwargs):
9936 """IsChecked(self, int id) -> bool"""
5b5c9bc7 9937 return _core_.Menu_IsChecked(*args, **kwargs)
d55e5bfc
RD
9938
9939 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
9940 """SetLabel(self, int id, String label)"""
9941 return _core_.Menu_SetLabel(*args, **kwargs)
d55e5bfc
RD
9942
9943 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
9944 """GetLabel(self, int id) -> String"""
9945 return _core_.Menu_GetLabel(*args, **kwargs)
d55e5bfc
RD
9946
9947 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
9948 """SetHelpString(self, int id, String helpString)"""
9949 return _core_.Menu_SetHelpString(*args, **kwargs)
d55e5bfc
RD
9950
9951 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
9952 """GetHelpString(self, int id) -> String"""
9953 return _core_.Menu_GetHelpString(*args, **kwargs)
d55e5bfc
RD
9954
9955 def SetTitle(*args, **kwargs):
5b5c9bc7
RD
9956 """SetTitle(self, String title)"""
9957 return _core_.Menu_SetTitle(*args, **kwargs)
d55e5bfc
RD
9958
9959 def GetTitle(*args, **kwargs):
5b5c9bc7
RD
9960 """GetTitle(self) -> String"""
9961 return _core_.Menu_GetTitle(*args, **kwargs)
d55e5bfc
RD
9962
9963 def SetEventHandler(*args, **kwargs):
5b5c9bc7
RD
9964 """SetEventHandler(self, EvtHandler handler)"""
9965 return _core_.Menu_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
9966
9967 def GetEventHandler(*args, **kwargs):
5b5c9bc7
RD
9968 """GetEventHandler(self) -> EvtHandler"""
9969 return _core_.Menu_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
9970
9971 def SetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
9972 """SetInvokingWindow(self, Window win)"""
9973 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
9974
9975 def GetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
9976 """GetInvokingWindow(self) -> Window"""
9977 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
9978
9979 def GetStyle(*args, **kwargs):
9980 """GetStyle(self) -> long"""
5b5c9bc7 9981 return _core_.Menu_GetStyle(*args, **kwargs)
d55e5bfc
RD
9982
9983 def UpdateUI(*args, **kwargs):
5b5c9bc7
RD
9984 """UpdateUI(self, EvtHandler source=None)"""
9985 return _core_.Menu_UpdateUI(*args, **kwargs)
d55e5bfc
RD
9986
9987 def GetMenuBar(*args, **kwargs):
5b5c9bc7
RD
9988 """GetMenuBar(self) -> MenuBar"""
9989 return _core_.Menu_GetMenuBar(*args, **kwargs)
d55e5bfc
RD
9990
9991 def Attach(*args, **kwargs):
9992 """Attach(self, wxMenuBarBase menubar)"""
5b5c9bc7 9993 return _core_.Menu_Attach(*args, **kwargs)
d55e5bfc
RD
9994
9995 def Detach(*args, **kwargs):
9996 """Detach(self)"""
5b5c9bc7 9997 return _core_.Menu_Detach(*args, **kwargs)
d55e5bfc
RD
9998
9999 def IsAttached(*args, **kwargs):
10000 """IsAttached(self) -> bool"""
5b5c9bc7 10001 return _core_.Menu_IsAttached(*args, **kwargs)
d55e5bfc
RD
10002
10003 def SetParent(*args, **kwargs):
5b5c9bc7
RD
10004 """SetParent(self, Menu parent)"""
10005 return _core_.Menu_SetParent(*args, **kwargs)
d55e5bfc
RD
10006
10007 def GetParent(*args, **kwargs):
5b5c9bc7
RD
10008 """GetParent(self) -> Menu"""
10009 return _core_.Menu_GetParent(*args, **kwargs)
d55e5bfc 10010
2131d850 10011_core_.Menu_swigregister(Menu)
5b5c9bc7 10012DefaultValidator = cvar.DefaultValidator
d55e5bfc
RD
10013
10014#---------------------------------------------------------------------------
10015
5b5c9bc7
RD
10016class MenuBar(Window):
10017 """Proxy of C++ MenuBar class"""
1bd55598
RD
10018 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10019 __repr__ = _swig_repr
10020 def __init__(self, *args, **kwargs):
5b5c9bc7 10021 """__init__(self, long style=0) -> MenuBar"""
1bd55598 10022 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d55e5bfc
RD
10023 self._setOORInfo(self)
10024
10025 def Append(*args, **kwargs):
5b5c9bc7
RD
10026 """Append(self, Menu menu, String title) -> bool"""
10027 return _core_.MenuBar_Append(*args, **kwargs)
d55e5bfc
RD
10028
10029 def Insert(*args, **kwargs):
5b5c9bc7
RD
10030 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10031 return _core_.MenuBar_Insert(*args, **kwargs)
d55e5bfc
RD
10032
10033 def GetMenuCount(*args, **kwargs):
10034 """GetMenuCount(self) -> size_t"""
5b5c9bc7 10035 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
d55e5bfc
RD
10036
10037 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10038 """GetMenu(self, size_t pos) -> Menu"""
10039 return _core_.MenuBar_GetMenu(*args, **kwargs)
d55e5bfc
RD
10040
10041 def Replace(*args, **kwargs):
5b5c9bc7
RD
10042 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
10043 return _core_.MenuBar_Replace(*args, **kwargs)
d55e5bfc
RD
10044
10045 def Remove(*args, **kwargs):
5b5c9bc7
RD
10046 """Remove(self, size_t pos) -> Menu"""
10047 return _core_.MenuBar_Remove(*args, **kwargs)
d55e5bfc
RD
10048
10049 def EnableTop(*args, **kwargs):
10050 """EnableTop(self, size_t pos, bool enable)"""
5b5c9bc7 10051 return _core_.MenuBar_EnableTop(*args, **kwargs)
d55e5bfc
RD
10052
10053 def IsEnabledTop(*args, **kwargs):
10054 """IsEnabledTop(self, size_t pos) -> bool"""
5b5c9bc7 10055 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
d55e5bfc
RD
10056
10057 def SetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10058 """SetLabelTop(self, size_t pos, String label)"""
10059 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
d55e5bfc
RD
10060
10061 def GetLabelTop(*args, **kwargs):
5b5c9bc7
RD
10062 """GetLabelTop(self, size_t pos) -> String"""
10063 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
d55e5bfc
RD
10064
10065 def FindMenuItem(*args, **kwargs):
5b5c9bc7
RD
10066 """FindMenuItem(self, String menu, String item) -> int"""
10067 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
d55e5bfc
RD
10068
10069 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10070 """FindItemById(self, int id) -> MenuItem"""
10071 return _core_.MenuBar_FindItemById(*args, **kwargs)
d55e5bfc
RD
10072
10073 def FindMenu(*args, **kwargs):
5b5c9bc7
RD
10074 """FindMenu(self, String title) -> int"""
10075 return _core_.MenuBar_FindMenu(*args, **kwargs)
d55e5bfc
RD
10076
10077 def Enable(*args, **kwargs):
10078 """Enable(self, int id, bool enable)"""
5b5c9bc7 10079 return _core_.MenuBar_Enable(*args, **kwargs)
d55e5bfc
RD
10080
10081 def Check(*args, **kwargs):
10082 """Check(self, int id, bool check)"""
5b5c9bc7 10083 return _core_.MenuBar_Check(*args, **kwargs)
d55e5bfc
RD
10084
10085 def IsChecked(*args, **kwargs):
10086 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10087 return _core_.MenuBar_IsChecked(*args, **kwargs)
d55e5bfc
RD
10088
10089 def IsEnabled(*args, **kwargs):
10090 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10091 return _core_.MenuBar_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10092
10093 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10094 """SetLabel(self, int id, String label)"""
10095 return _core_.MenuBar_SetLabel(*args, **kwargs)
d55e5bfc
RD
10096
10097 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10098 """GetLabel(self, int id) -> String"""
10099 return _core_.MenuBar_GetLabel(*args, **kwargs)
d55e5bfc
RD
10100
10101 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10102 """SetHelpString(self, int id, String helpString)"""
10103 return _core_.MenuBar_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10104
10105 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10106 """GetHelpString(self, int id) -> String"""
10107 return _core_.MenuBar_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10108
10109 def GetFrame(*args, **kwargs):
10110 """GetFrame(self) -> wxFrame"""
5b5c9bc7 10111 return _core_.MenuBar_GetFrame(*args, **kwargs)
d55e5bfc
RD
10112
10113 def IsAttached(*args, **kwargs):
10114 """IsAttached(self) -> bool"""
5b5c9bc7 10115 return _core_.MenuBar_IsAttached(*args, **kwargs)
d55e5bfc
RD
10116
10117 def Attach(*args, **kwargs):
10118 """Attach(self, wxFrame frame)"""
5b5c9bc7 10119 return _core_.MenuBar_Attach(*args, **kwargs)
d55e5bfc
RD
10120
10121 def Detach(*args, **kwargs):
10122 """Detach(self)"""
5b5c9bc7 10123 return _core_.MenuBar_Detach(*args, **kwargs)
d55e5bfc 10124
4f433fef
RD
10125 def SetAutoWindowMenu(*args, **kwargs):
10126 """SetAutoWindowMenu(bool enable)"""
10127 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10128
10129 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10130 def GetAutoWindowMenu(*args, **kwargs):
10131 """GetAutoWindowMenu() -> bool"""
10132 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10133
10134 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
2131d850 10135_core_.MenuBar_swigregister(MenuBar)
d55e5bfc 10136
4f433fef 10137def MenuBar_SetAutoWindowMenu(*args, **kwargs):
1bd55598
RD
10138 """MenuBar_SetAutoWindowMenu(bool enable)"""
10139 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 10140
1bd55598
RD
10141def MenuBar_GetAutoWindowMenu(*args):
10142 """MenuBar_GetAutoWindowMenu() -> bool"""
10143 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 10144
d55e5bfc
RD
10145#---------------------------------------------------------------------------
10146
5b5c9bc7
RD
10147class MenuItem(Object):
10148 """Proxy of C++ MenuItem class"""
1bd55598
RD
10149 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10150 __repr__ = _swig_repr
10151 def __init__(self, *args, **kwargs):
d55e5bfc 10152 """
5b5c9bc7
RD
10153 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
10154 String help=EmptyString, int kind=ITEM_NORMAL,
10155 Menu subMenu=None) -> MenuItem
d55e5bfc 10156 """
1bd55598
RD
10157 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10158 __swig_destroy__ = _core_.delete_MenuItem
10159 __del__ = lambda self : None;
d55e5bfc 10160 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
10161 """GetMenu(self) -> Menu"""
10162 return _core_.MenuItem_GetMenu(*args, **kwargs)
d55e5bfc
RD
10163
10164 def SetMenu(*args, **kwargs):
5b5c9bc7
RD
10165 """SetMenu(self, Menu menu)"""
10166 return _core_.MenuItem_SetMenu(*args, **kwargs)
d55e5bfc
RD
10167
10168 def SetId(*args, **kwargs):
10169 """SetId(self, int id)"""
5b5c9bc7 10170 return _core_.MenuItem_SetId(*args, **kwargs)
d55e5bfc
RD
10171
10172 def GetId(*args, **kwargs):
10173 """GetId(self) -> int"""
5b5c9bc7 10174 return _core_.MenuItem_GetId(*args, **kwargs)
d55e5bfc
RD
10175
10176 def IsSeparator(*args, **kwargs):
10177 """IsSeparator(self) -> bool"""
5b5c9bc7 10178 return _core_.MenuItem_IsSeparator(*args, **kwargs)
d55e5bfc
RD
10179
10180 def SetText(*args, **kwargs):
5b5c9bc7
RD
10181 """SetText(self, String str)"""
10182 return _core_.MenuItem_SetText(*args, **kwargs)
d55e5bfc
RD
10183
10184 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10185 """GetLabel(self) -> String"""
10186 return _core_.MenuItem_GetLabel(*args, **kwargs)
d55e5bfc
RD
10187
10188 def GetText(*args, **kwargs):
5b5c9bc7
RD
10189 """GetText(self) -> String"""
10190 return _core_.MenuItem_GetText(*args, **kwargs)
d55e5bfc
RD
10191
10192 def GetLabelFromText(*args, **kwargs):
5b5c9bc7
RD
10193 """GetLabelFromText(String text) -> String"""
10194 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc
RD
10195
10196 GetLabelFromText = staticmethod(GetLabelFromText)
10197 def GetKind(*args, **kwargs):
10198 """GetKind(self) -> int"""
5b5c9bc7 10199 return _core_.MenuItem_GetKind(*args, **kwargs)
d55e5bfc
RD
10200
10201 def SetKind(*args, **kwargs):
10202 """SetKind(self, int kind)"""
5b5c9bc7 10203 return _core_.MenuItem_SetKind(*args, **kwargs)
d55e5bfc
RD
10204
10205 def SetCheckable(*args, **kwargs):
10206 """SetCheckable(self, bool checkable)"""
5b5c9bc7 10207 return _core_.MenuItem_SetCheckable(*args, **kwargs)
d55e5bfc
RD
10208
10209 def IsCheckable(*args, **kwargs):
10210 """IsCheckable(self) -> bool"""
5b5c9bc7 10211 return _core_.MenuItem_IsCheckable(*args, **kwargs)
d55e5bfc
RD
10212
10213 def IsSubMenu(*args, **kwargs):
10214 """IsSubMenu(self) -> bool"""
5b5c9bc7 10215 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
d55e5bfc
RD
10216
10217 def SetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10218 """SetSubMenu(self, Menu menu)"""
10219 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
d55e5bfc
RD
10220
10221 def GetSubMenu(*args, **kwargs):
5b5c9bc7
RD
10222 """GetSubMenu(self) -> Menu"""
10223 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
d55e5bfc
RD
10224
10225 def Enable(*args, **kwargs):
10226 """Enable(self, bool enable=True)"""
5b5c9bc7 10227 return _core_.MenuItem_Enable(*args, **kwargs)
d55e5bfc
RD
10228
10229 def IsEnabled(*args, **kwargs):
10230 """IsEnabled(self) -> bool"""
5b5c9bc7 10231 return _core_.MenuItem_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10232
10233 def Check(*args, **kwargs):
10234 """Check(self, bool check=True)"""
5b5c9bc7 10235 return _core_.MenuItem_Check(*args, **kwargs)
d55e5bfc
RD
10236
10237 def IsChecked(*args, **kwargs):
10238 """IsChecked(self) -> bool"""
5b5c9bc7 10239 return _core_.MenuItem_IsChecked(*args, **kwargs)
d55e5bfc
RD
10240
10241 def Toggle(*args, **kwargs):
10242 """Toggle(self)"""
5b5c9bc7 10243 return _core_.MenuItem_Toggle(*args, **kwargs)
d55e5bfc
RD
10244
10245 def SetHelp(*args, **kwargs):
5b5c9bc7
RD
10246 """SetHelp(self, String str)"""
10247 return _core_.MenuItem_SetHelp(*args, **kwargs)
d55e5bfc
RD
10248
10249 def GetHelp(*args, **kwargs):
5b5c9bc7
RD
10250 """GetHelp(self) -> String"""
10251 return _core_.MenuItem_GetHelp(*args, **kwargs)
d55e5bfc
RD
10252
10253 def GetAccel(*args, **kwargs):
5b5c9bc7
RD
10254 """GetAccel(self) -> AcceleratorEntry"""
10255 return _core_.MenuItem_GetAccel(*args, **kwargs)
d55e5bfc
RD
10256
10257 def SetAccel(*args, **kwargs):
5b5c9bc7
RD
10258 """SetAccel(self, AcceleratorEntry accel)"""
10259 return _core_.MenuItem_SetAccel(*args, **kwargs)
d55e5bfc 10260
32fe5131
RD
10261 def SetBitmap(*args, **kwargs):
10262 """SetBitmap(self, Bitmap bitmap)"""
10263 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10264
10265 def GetBitmap(*args, **kwargs):
10266 """GetBitmap(self) -> Bitmap"""
10267 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10268
c1280d1e 10269 def SetFont(*args, **kwargs):
5b5c9bc7
RD
10270 """SetFont(self, Font font)"""
10271 return _core_.MenuItem_SetFont(*args, **kwargs)
c1280d1e
RD
10272
10273 def GetFont(*args, **kwargs):
5b5c9bc7
RD
10274 """GetFont(self) -> Font"""
10275 return _core_.MenuItem_GetFont(*args, **kwargs)
c1280d1e
RD
10276
10277 def SetTextColour(*args, **kwargs):
5b5c9bc7
RD
10278 """SetTextColour(self, Colour colText)"""
10279 return _core_.MenuItem_SetTextColour(*args, **kwargs)
c1280d1e
RD
10280
10281 def GetTextColour(*args, **kwargs):
5b5c9bc7
RD
10282 """GetTextColour(self) -> Colour"""
10283 return _core_.MenuItem_GetTextColour(*args, **kwargs)
c1280d1e
RD
10284
10285 def SetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10286 """SetBackgroundColour(self, Colour colBack)"""
10287 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10288
10289 def GetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
10290 """GetBackgroundColour(self) -> Colour"""
10291 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
c1280d1e
RD
10292
10293 def SetBitmaps(*args, **kwargs):
5b5c9bc7
RD
10294 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10295 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
c1280d1e
RD
10296
10297 def SetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10298 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10299 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10300
10301 def GetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
10302 """GetDisabledBitmap(self) -> Bitmap"""
10303 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
10304
10305 def SetMarginWidth(*args, **kwargs):
10306 """SetMarginWidth(self, int nWidth)"""
5b5c9bc7 10307 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
c1280d1e
RD
10308
10309 def GetMarginWidth(*args, **kwargs):
10310 """GetMarginWidth(self) -> int"""
5b5c9bc7 10311 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
c1280d1e 10312
d55e5bfc 10313 def GetDefaultMarginWidth(*args, **kwargs):
d6c14a4c 10314 """GetDefaultMarginWidth() -> int"""
5b5c9bc7 10315 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
10316
10317 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10318 def IsOwnerDrawn(*args, **kwargs):
10319 """IsOwnerDrawn(self) -> bool"""
5b5c9bc7 10320 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10321
10322 def SetOwnerDrawn(*args, **kwargs):
10323 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
5b5c9bc7 10324 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
c1280d1e
RD
10325
10326 def ResetOwnerDrawn(*args, **kwargs):
10327 """ResetOwnerDrawn(self)"""
5b5c9bc7 10328 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
c1280d1e 10329
2131d850 10330_core_.MenuItem_swigregister(MenuItem)
d55e5bfc 10331
5b5c9bc7 10332def MenuItem_GetLabelFromText(*args, **kwargs):
1bd55598
RD
10333 """MenuItem_GetLabelFromText(String text) -> String"""
10334 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 10335
1bd55598
RD
10336def MenuItem_GetDefaultMarginWidth(*args):
10337 """MenuItem_GetDefaultMarginWidth() -> int"""
10338 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d55e5bfc
RD
10339
10340#---------------------------------------------------------------------------
10341
5b5c9bc7 10342class Control(Window):
d55e5bfc
RD
10343 """
10344 This is the base class for a control or 'widget'.
10345
15817c7e
RD
10346 A control is generally a small window which processes user input
10347 and/or displays one or more item of data.
d55e5bfc 10348 """
1bd55598
RD
10349 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10350 __repr__ = _swig_repr
10351 def __init__(self, *args, **kwargs):
d55e5bfc 10352 """
5b5c9bc7
RD
10353 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10354 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10355 String name=ControlNameStr) -> Control
d55e5bfc 10356
15817c7e
RD
10357 Create a Control. Normally you should only call this from a subclass'
10358 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 10359 """
1bd55598 10360 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d55e5bfc
RD
10361 self._setOORInfo(self)
10362
10363 def Create(*args, **kwargs):
10364 """
5b5c9bc7
RD
10365 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10366 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
10367 String name=ControlNameStr) -> bool
d55e5bfc
RD
10368
10369 Do the 2nd phase and create the GUI control.
10370 """
5b5c9bc7 10371 return _core_.Control_Create(*args, **kwargs)
d55e5bfc
RD
10372
10373 def Command(*args, **kwargs):
10374 """
5b5c9bc7 10375 Command(self, CommandEvent event)
d55e5bfc 10376
15817c7e
RD
10377 Simulates the effect of the user issuing a command to the item.
10378
10379 :see: `wx.CommandEvent`
10380
d55e5bfc 10381 """
5b5c9bc7 10382 return _core_.Control_Command(*args, **kwargs)
d55e5bfc
RD
10383
10384 def GetLabel(*args, **kwargs):
10385 """
5b5c9bc7 10386 GetLabel(self) -> String
d55e5bfc
RD
10387
10388 Return a control's text.
10389 """
5b5c9bc7 10390 return _core_.Control_GetLabel(*args, **kwargs)
d55e5bfc 10391
d55e5bfc 10392 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0 10393 """
5b5c9bc7 10394 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
10395
10396 Get the default attributes for this class. This is useful if you want
10397 to use the same font or colour in your own control as in a standard
10398 control -- which is a much better idea than hard coding specific
10399 colours or fonts which might look completely out of place on the
10400 user's system, especially if it uses themes.
10401
10402 The variant parameter is only relevant under Mac currently and is
10403 ignore under other platforms. Under Mac, it will change the size of
10404 the returned font. See `wx.Window.SetWindowVariant` for more about
10405 this.
10406 """
5b5c9bc7 10407 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10408
10409 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2131d850 10410_core_.Control_swigregister(Control)
d55e5bfc
RD
10411ControlNameStr = cvar.ControlNameStr
10412
10413def PreControl(*args, **kwargs):
10414 """
5b5c9bc7 10415 PreControl() -> Control
d55e5bfc
RD
10416
10417 Precreate a Control control for 2-phase creation
10418 """
5b5c9bc7 10419 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
10420 return val
10421
5b5c9bc7 10422def Control_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 10423 """
5b5c9bc7 10424 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
10425
10426 Get the default attributes for this class. This is useful if you want
10427 to use the same font or colour in your own control as in a standard
10428 control -- which is a much better idea than hard coding specific
10429 colours or fonts which might look completely out of place on the
10430 user's system, especially if it uses themes.
10431
10432 The variant parameter is only relevant under Mac currently and is
10433 ignore under other platforms. Under Mac, it will change the size of
10434 the returned font. See `wx.Window.SetWindowVariant` for more about
10435 this.
10436 """
1bd55598 10437 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10438
10439#---------------------------------------------------------------------------
10440
5b5c9bc7 10441class ItemContainer(object):
d55e5bfc 10442 """
53aa7709
RD
10443 The wx.ItemContainer class defines an interface which is implemented
10444 by all controls which have string subitems, each of which may be
10445 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10446 as `wx.ComboBox` which implements an extended interface deriving from
15817c7e 10447 this one.
d55e5bfc 10448
15817c7e
RD
10449 It defines the methods for accessing the control's items and although
10450 each of the derived classes implements them differently, they still
10451 all conform to the same interface.
d55e5bfc 10452
15817c7e
RD
10453 The items in a wx.ItemContainer have (non empty) string labels and,
10454 optionally, client data associated with them.
d55e5bfc
RD
10455
10456 """
1bd55598
RD
10457 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10458 def __init__(self): raise AttributeError, "No constructor defined"
10459 __repr__ = _swig_repr
d55e5bfc
RD
10460 def Append(*args, **kwargs):
10461 """
5b5c9bc7 10462 Append(self, String item, PyObject clientData=None) -> int
d55e5bfc 10463
15817c7e
RD
10464 Adds the item to the control, associating the given data with the item
10465 if not None. The return value is the index of the newly added item
10466 which may be different from the last one if the control is sorted (e.g.
10467 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc 10468 """
5b5c9bc7 10469 return _core_.ItemContainer_Append(*args, **kwargs)
d55e5bfc
RD
10470
10471 def AppendItems(*args, **kwargs):
10472 """
f5b96ee1 10473 AppendItems(self, List strings)
d55e5bfc 10474
15817c7e
RD
10475 Apend several items at once to the control. Notice that calling this
10476 method may be much faster than appending the items one by one if you
10477 need to add a lot of items.
d55e5bfc 10478 """
5b5c9bc7 10479 return _core_.ItemContainer_AppendItems(*args, **kwargs)
d55e5bfc
RD
10480
10481 def Insert(*args, **kwargs):
10482 """
50f151d7 10483 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
d55e5bfc 10484
15817c7e 10485 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
10486 optionally associating some data object with the item.
10487 """
5b5c9bc7 10488 return _core_.ItemContainer_Insert(*args, **kwargs)
d55e5bfc
RD
10489
10490 def Clear(*args, **kwargs):
10491 """
10492 Clear(self)
10493
10494 Removes all items from the control.
10495 """
5b5c9bc7 10496 return _core_.ItemContainer_Clear(*args, **kwargs)
d55e5bfc
RD
10497
10498 def Delete(*args, **kwargs):
10499 """
50f151d7 10500 Delete(self, unsigned int n)
d55e5bfc 10501
15817c7e
RD
10502 Deletes the item at the zero-based index 'n' from the control. Note
10503 that it is an error (signalled by a `wx.PyAssertionError` exception if
10504 enabled) to remove an item with the index negative or greater or equal
10505 than the number of items in the control.
d55e5bfc 10506 """
5b5c9bc7 10507 return _core_.ItemContainer_Delete(*args, **kwargs)
d55e5bfc 10508
53aa7709
RD
10509 def GetClientData(*args, **kwargs):
10510 """
50f151d7 10511 GetClientData(self, unsigned int n) -> PyObject
53aa7709
RD
10512
10513 Returns the client data associated with the given item, (if any.)
10514 """
5b5c9bc7 10515 return _core_.ItemContainer_GetClientData(*args, **kwargs)
53aa7709
RD
10516
10517 def SetClientData(*args, **kwargs):
10518 """
50f151d7 10519 SetClientData(self, unsigned int n, PyObject clientData)
53aa7709
RD
10520
10521 Associate the given client data with the item at position n.
10522 """
5b5c9bc7 10523 return _core_.ItemContainer_SetClientData(*args, **kwargs)
53aa7709 10524
d55e5bfc
RD
10525 def GetCount(*args, **kwargs):
10526 """
50f151d7 10527 GetCount(self) -> unsigned int
d55e5bfc
RD
10528
10529 Returns the number of items in the control.
10530 """
5b5c9bc7 10531 return _core_.ItemContainer_GetCount(*args, **kwargs)
d55e5bfc
RD
10532
10533 def IsEmpty(*args, **kwargs):
10534 """
10535 IsEmpty(self) -> bool
10536
10537 Returns True if the control is empty or False if it has some items.
10538 """
5b5c9bc7 10539 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
d55e5bfc
RD
10540
10541 def GetString(*args, **kwargs):
10542 """
50f151d7 10543 GetString(self, unsigned int n) -> String
d55e5bfc
RD
10544
10545 Returns the label of the item with the given index.
10546 """
5b5c9bc7 10547 return _core_.ItemContainer_GetString(*args, **kwargs)
d55e5bfc
RD
10548
10549 def GetStrings(*args, **kwargs):
10550 """GetStrings(self) -> wxArrayString"""
5b5c9bc7 10551 return _core_.ItemContainer_GetStrings(*args, **kwargs)
d55e5bfc
RD
10552
10553 def SetString(*args, **kwargs):
10554 """
50f151d7 10555 SetString(self, unsigned int n, String s)
d55e5bfc
RD
10556
10557 Sets the label for the given item.
10558 """
5b5c9bc7 10559 return _core_.ItemContainer_SetString(*args, **kwargs)
d55e5bfc
RD
10560
10561 def FindString(*args, **kwargs):
10562 """
5b5c9bc7 10563 FindString(self, String s) -> int
d55e5bfc
RD
10564
10565 Finds an item whose label matches the given string. Returns the
15817c7e
RD
10566 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
10567 found.
d55e5bfc 10568 """
5b5c9bc7 10569 return _core_.ItemContainer_FindString(*args, **kwargs)
d55e5bfc 10570
53aa7709 10571 def SetSelection(*args, **kwargs):
d55e5bfc 10572 """
53aa7709 10573 SetSelection(self, int n)
d55e5bfc
RD
10574
10575 Sets the item at index 'n' to be the selected item.
10576 """
5b5c9bc7 10577 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 10578
d55e5bfc
RD
10579 def GetSelection(*args, **kwargs):
10580 """
10581 GetSelection(self) -> int
10582
15817c7e
RD
10583 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
10584 is selected.
d55e5bfc 10585 """
5b5c9bc7 10586 return _core_.ItemContainer_GetSelection(*args, **kwargs)
d55e5bfc 10587
53aa7709 10588 def SetStringSelection(*args, **kwargs):
5b5c9bc7
RD
10589 """SetStringSelection(self, String s) -> bool"""
10590 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
53aa7709 10591
d55e5bfc
RD
10592 def GetStringSelection(*args, **kwargs):
10593 """
5b5c9bc7 10594 GetStringSelection(self) -> String
d55e5bfc 10595
15817c7e
RD
10596 Returns the label of the selected item or an empty string if no item
10597 is selected.
d55e5bfc 10598 """
5b5c9bc7 10599 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
d55e5bfc 10600
53aa7709 10601 def Select(*args, **kwargs):
d55e5bfc 10602 """
53aa7709 10603 Select(self, int n)
d55e5bfc 10604
53aa7709
RD
10605 This is the same as `SetSelection` and exists only because it is
10606 slightly more natural for controls which support multiple selection.
d55e5bfc 10607 """
5b5c9bc7 10608 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc 10609
2131d850 10610_core_.ItemContainer_swigregister(ItemContainer)
d55e5bfc
RD
10611
10612#---------------------------------------------------------------------------
10613
5b5c9bc7 10614class ControlWithItems(Control,ItemContainer):
d55e5bfc 10615 """
15817c7e
RD
10616 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
10617 wx.Control class, and is used for the base class of various controls
10618 that have items.
d55e5bfc 10619 """
1bd55598
RD
10620 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10621 def __init__(self): raise AttributeError, "No constructor defined"
10622 __repr__ = _swig_repr
2131d850 10623_core_.ControlWithItems_swigregister(ControlWithItems)
d55e5bfc
RD
10624
10625#---------------------------------------------------------------------------
10626
5b5c9bc7 10627class SizerItem(Object):
bfddbb17
RD
10628 """
10629 The wx.SizerItem class is used to track the position, size and other
2131d850
RD
10630 attributes of each item managed by a `wx.Sizer`. It is not usually
10631 necessary to use this class because the sizer elements can also be
10632 identified by their positions or window or sizer references but
10633 sometimes it may be more convenient to use wx.SizerItem directly.
10634 Also, custom classes derived from `wx.PySizer` will probably need to
10635 use the collection of wx.SizerItems held by wx.Sizer when calculating
10636 layout.
bfddbb17
RD
10637
10638 :see: `wx.Sizer`, `wx.GBSizerItem`
10639 """
1bd55598
RD
10640 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10641 __repr__ = _swig_repr
10642 def __init__(self, *args, **kwargs):
bfddbb17 10643 """
5b5c9bc7 10644 __init__(self) -> SizerItem
bfddbb17
RD
10645
10646 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
10647 size will need to be set before this item can be used in a Sizer.
10648
10649 You will probably never need to create a wx.SizerItem directly as they
10650 are created automatically when the sizer's Add, Insert or Prepend
10651 methods are called.
10652
10653 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
10654 """
1bd55598
RD
10655 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
10656 __swig_destroy__ = _core_.delete_SizerItem
10657 __del__ = lambda self : None;
d55e5bfc 10658 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
10659 """
10660 DeleteWindows(self)
10661
10662 Destroy the window or the windows in a subsizer, depending on the type
10663 of item.
10664 """
5b5c9bc7 10665 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
10666
10667 def DetachSizer(*args, **kwargs):
bfddbb17
RD
10668 """
10669 DetachSizer(self)
10670
10671 Enable deleting the SizerItem without destroying the contained sizer.
10672 """
5b5c9bc7 10673 return _core_.SizerItem_DetachSizer(*args, **kwargs)
d55e5bfc
RD
10674
10675 def GetSize(*args, **kwargs):
bfddbb17 10676 """
5b5c9bc7 10677 GetSize(self) -> Size
bfddbb17
RD
10678
10679 Get the current size of the item, as set in the last Layout.
10680 """
5b5c9bc7 10681 return _core_.SizerItem_GetSize(*args, **kwargs)
d55e5bfc
RD
10682
10683 def CalcMin(*args, **kwargs):
bfddbb17 10684 """
5b5c9bc7 10685 CalcMin(self) -> Size
bfddbb17
RD
10686
10687 Calculates the minimum desired size for the item, including any space
10688 needed by borders.
10689 """
5b5c9bc7 10690 return _core_.SizerItem_CalcMin(*args, **kwargs)
d55e5bfc
RD
10691
10692 def SetDimension(*args, **kwargs):
bfddbb17 10693 """
5b5c9bc7 10694 SetDimension(self, Point pos, Size size)
bfddbb17
RD
10695
10696 Set the position and size of the space allocated for this item by the
10697 sizer, and adjust the position and size of the item (window or
10698 subsizer) to be within that space taking alignment and borders into
10699 account.
10700 """
5b5c9bc7 10701 return _core_.SizerItem_SetDimension(*args, **kwargs)
d55e5bfc
RD
10702
10703 def GetMinSize(*args, **kwargs):
bfddbb17 10704 """
5b5c9bc7 10705 GetMinSize(self) -> Size
bfddbb17
RD
10706
10707 Get the minimum size needed for the item.
10708 """
5b5c9bc7 10709 return _core_.SizerItem_GetMinSize(*args, **kwargs)
d55e5bfc 10710
a001823c
RD
10711 def GetMinSizeWithBorder(*args, **kwargs):
10712 """
5b5c9bc7 10713 GetMinSizeWithBorder(self) -> Size
a001823c
RD
10714
10715 Get the minimum size needed for the item with space for the borders
10716 added, if needed.
10717 """
5b5c9bc7 10718 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
a001823c 10719
d55e5bfc
RD
10720 def SetInitSize(*args, **kwargs):
10721 """SetInitSize(self, int x, int y)"""
5b5c9bc7 10722 return _core_.SizerItem_SetInitSize(*args, **kwargs)
d55e5bfc
RD
10723
10724 def SetRatioWH(*args, **kwargs):
bfddbb17
RD
10725 """
10726 SetRatioWH(self, int width, int height)
10727
10728 Set the ratio item attribute.
10729 """
5b5c9bc7 10730 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
d55e5bfc
RD
10731
10732 def SetRatioSize(*args, **kwargs):
bfddbb17 10733 """
5b5c9bc7 10734 SetRatioSize(self, Size size)
bfddbb17
RD
10735
10736 Set the ratio item attribute.
10737 """
5b5c9bc7 10738 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
d55e5bfc
RD
10739
10740 def SetRatio(*args, **kwargs):
bfddbb17
RD
10741 """
10742 SetRatio(self, float ratio)
10743
10744 Set the ratio item attribute.
10745 """
5b5c9bc7 10746 return _core_.SizerItem_SetRatio(*args, **kwargs)
d55e5bfc
RD
10747
10748 def GetRatio(*args, **kwargs):
bfddbb17
RD
10749 """
10750 GetRatio(self) -> float
10751
10752 Set the ratio item attribute.
10753 """
5b5c9bc7 10754 return _core_.SizerItem_GetRatio(*args, **kwargs)
d55e5bfc 10755
070c48b4
RD
10756 def GetRect(*args, **kwargs):
10757 """
5b5c9bc7 10758 GetRect(self) -> Rect
070c48b4
RD
10759
10760 Returns the rectangle that the sizer item should occupy
10761 """
5b5c9bc7 10762 return _core_.SizerItem_GetRect(*args, **kwargs)
070c48b4 10763
d55e5bfc 10764 def IsWindow(*args, **kwargs):
bfddbb17
RD
10765 """
10766 IsWindow(self) -> bool
10767
10768 Is this sizer item a window?
10769 """
5b5c9bc7 10770 return _core_.SizerItem_IsWindow(*args, **kwargs)
d55e5bfc
RD
10771
10772 def IsSizer(*args, **kwargs):
bfddbb17
RD
10773 """
10774 IsSizer(self) -> bool
10775
10776 Is this sizer item a subsizer?
10777 """
5b5c9bc7 10778 return _core_.SizerItem_IsSizer(*args, **kwargs)
d55e5bfc
RD
10779
10780 def IsSpacer(*args, **kwargs):
bfddbb17
RD
10781 """
10782 IsSpacer(self) -> bool
10783
10784 Is this sizer item a spacer?
10785 """
5b5c9bc7 10786 return _core_.SizerItem_IsSpacer(*args, **kwargs)
d55e5bfc
RD
10787
10788 def SetProportion(*args, **kwargs):
bfddbb17
RD
10789 """
10790 SetProportion(self, int proportion)
10791
10792 Set the proportion value for this item.
10793 """
5b5c9bc7 10794 return _core_.SizerItem_SetProportion(*args, **kwargs)
d55e5bfc
RD
10795
10796 def GetProportion(*args, **kwargs):
bfddbb17
RD
10797 """
10798 GetProportion(self) -> int
10799
10800 Get the proportion value for this item.
10801 """
5b5c9bc7 10802 return _core_.SizerItem_GetProportion(*args, **kwargs)
d55e5bfc 10803
bfddbb17
RD
10804 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
10805 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 10806 def SetFlag(*args, **kwargs):
bfddbb17
RD
10807 """
10808 SetFlag(self, int flag)
10809
10810 Set the flag value for this item.
10811 """
5b5c9bc7 10812 return _core_.SizerItem_SetFlag(*args, **kwargs)
d55e5bfc
RD
10813
10814 def GetFlag(*args, **kwargs):
bfddbb17
RD
10815 """
10816 GetFlag(self) -> int
10817
10818 Get the flag value for this item.
10819 """
5b5c9bc7 10820 return _core_.SizerItem_GetFlag(*args, **kwargs)
d55e5bfc
RD
10821
10822 def SetBorder(*args, **kwargs):
bfddbb17
RD
10823 """
10824 SetBorder(self, int border)
10825
10826 Set the border value for this item.
10827 """
5b5c9bc7 10828 return _core_.SizerItem_SetBorder(*args, **kwargs)
d55e5bfc
RD
10829
10830 def GetBorder(*args, **kwargs):
bfddbb17
RD
10831 """
10832 GetBorder(self) -> int
10833
10834 Get the border value for this item.
10835 """
5b5c9bc7 10836 return _core_.SizerItem_GetBorder(*args, **kwargs)
d55e5bfc
RD
10837
10838 def GetWindow(*args, **kwargs):
bfddbb17 10839 """
5b5c9bc7 10840 GetWindow(self) -> Window
bfddbb17
RD
10841
10842 Get the window (if any) that is managed by this sizer item.
10843 """
5b5c9bc7 10844 return _core_.SizerItem_GetWindow(*args, **kwargs)
d55e5bfc
RD
10845
10846 def SetWindow(*args, **kwargs):
bfddbb17 10847 """
5b5c9bc7 10848 SetWindow(self, Window window)
bfddbb17
RD
10849
10850 Set the window to be managed by this sizer item.
10851 """
5b5c9bc7 10852 return _core_.SizerItem_SetWindow(*args, **kwargs)
d55e5bfc
RD
10853
10854 def GetSizer(*args, **kwargs):
bfddbb17 10855 """
5b5c9bc7 10856 GetSizer(self) -> Sizer
bfddbb17
RD
10857
10858 Get the subsizer (if any) that is managed by this sizer item.
10859 """
5b5c9bc7 10860 return _core_.SizerItem_GetSizer(*args, **kwargs)
d55e5bfc
RD
10861
10862 def SetSizer(*args, **kwargs):
bfddbb17 10863 """
5b5c9bc7 10864 SetSizer(self, Sizer sizer)
bfddbb17
RD
10865
10866 Set the subsizer to be managed by this sizer item.
10867 """
5b5c9bc7 10868 return _core_.SizerItem_SetSizer(*args, **kwargs)
d55e5bfc
RD
10869
10870 def GetSpacer(*args, **kwargs):
bfddbb17 10871 """
5b5c9bc7 10872 GetSpacer(self) -> Size
bfddbb17
RD
10873
10874 Get the size of the spacer managed by this sizer item.
10875 """
5b5c9bc7 10876 return _core_.SizerItem_GetSpacer(*args, **kwargs)
d55e5bfc
RD
10877
10878 def SetSpacer(*args, **kwargs):
bfddbb17 10879 """
5b5c9bc7 10880 SetSpacer(self, Size size)
bfddbb17
RD
10881
10882 Set the size of the spacer to be managed by this sizer item.
10883 """
5b5c9bc7 10884 return _core_.SizerItem_SetSpacer(*args, **kwargs)
d55e5bfc
RD
10885
10886 def Show(*args, **kwargs):
bfddbb17
RD
10887 """
10888 Show(self, bool show)
10889
10890 Set the show item attribute, which sizers use to determine if the item
10891 is to be made part of the layout or not. If the item is tracking a
10892 window then it is shown or hidden as needed.
10893 """
5b5c9bc7 10894 return _core_.SizerItem_Show(*args, **kwargs)
d55e5bfc
RD
10895
10896 def IsShown(*args, **kwargs):
bfddbb17
RD
10897 """
10898 IsShown(self) -> bool
10899
10900 Is the item to be shown in the layout?
10901 """
5b5c9bc7 10902 return _core_.SizerItem_IsShown(*args, **kwargs)
d55e5bfc
RD
10903
10904 def GetPosition(*args, **kwargs):
bfddbb17 10905 """
5b5c9bc7 10906 GetPosition(self) -> Point
bfddbb17
RD
10907
10908 Returns the current position of the item, as set in the last Layout.
10909 """
5b5c9bc7 10910 return _core_.SizerItem_GetPosition(*args, **kwargs)
d55e5bfc
RD
10911
10912 def GetUserData(*args, **kwargs):
bfddbb17
RD
10913 """
10914 GetUserData(self) -> PyObject
10915
10916 Returns the userData associated with this sizer item, or None if there
10917 isn't any.
10918 """
5b5c9bc7 10919 return _core_.SizerItem_GetUserData(*args, **kwargs)
d55e5bfc 10920
32fe5131
RD
10921 def SetUserData(*args, **kwargs):
10922 """
10923 SetUserData(self, PyObject userData)
10924
10925 Associate a Python object with this sizer item.
10926 """
10927 return _core_.SizerItem_SetUserData(*args, **kwargs)
10928
2131d850 10929_core_.SizerItem_swigregister(SizerItem)
d55e5bfc 10930
bfddbb17 10931def SizerItemWindow(*args, **kwargs):
d55e5bfc 10932 """
5b5c9bc7
RD
10933 SizerItemWindow(Window window, int proportion, int flag, int border,
10934 PyObject userData=None) -> SizerItem
bfddbb17
RD
10935
10936 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 10937 """
5b5c9bc7 10938 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
10939 return val
10940
bfddbb17 10941def SizerItemSpacer(*args, **kwargs):
d55e5bfc 10942 """
bfddbb17 10943 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
5b5c9bc7 10944 PyObject userData=None) -> SizerItem
bfddbb17
RD
10945
10946 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 10947 """
5b5c9bc7 10948 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
10949 return val
10950
10951def SizerItemSizer(*args, **kwargs):
10952 """
5b5c9bc7
RD
10953 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
10954 PyObject userData=None) -> SizerItem
bfddbb17
RD
10955
10956 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc 10957 """
5b5c9bc7 10958 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
10959 return val
10960
5b5c9bc7 10961class Sizer(Object):
bfddbb17
RD
10962 """
10963 wx.Sizer is the abstract base class used for laying out subwindows in
10964 a window. You cannot use wx.Sizer directly; instead, you will have to
10965 use one of the sizer classes derived from it such as `wx.BoxSizer`,
10966 `wx.StaticBoxSizer`, `wx.NotebookSizer`, `wx.GridSizer`, `wx.FlexGridSizer`
10967 and `wx.GridBagSizer`.
10968
10969 The concept implemented by sizers in wxWidgets is closely related to
10970 layout tools in other GUI toolkits, such as Java's AWT, the GTK
10971 toolkit or the Qt toolkit. It is based upon the idea of the individual
10972 subwindows reporting their minimal required size and their ability to
10973 get stretched if the size of the parent window has changed. This will
10974 most often mean that the programmer does not set the original size of
10975 a dialog in the beginning, rather the dialog will assigned a sizer and
10976 this sizer will be queried about the recommended size. The sizer in
10977 turn will query its children, which can be normal windows or contorls,
10978 empty space or other sizers, so that a hierarchy of sizers can be
10979 constructed. Note that wxSizer does not derive from wxWindow and thus
10980 do not interfere with tab ordering and requires very little resources
10981 compared to a real window on screen.
10982
10983 What makes sizers so well fitted for use in wxWidgets is the fact that
10984 every control reports its own minimal size and the algorithm can
10985 handle differences in font sizes or different window (dialog item)
10986 sizes on different platforms without problems. If for example the
10987 standard font as well as the overall design of Mac widgets requires
10988 more space than on Windows, then the initial size of a dialog using a
10989 sizer will automatically be bigger on Mac than on Windows.
10990 """
1bd55598
RD
10991 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10992 def __init__(self): raise AttributeError, "No constructor defined"
10993 __repr__ = _swig_repr
10994 __swig_destroy__ = _core_.delete_Sizer
10995 __del__ = lambda self : None;
d55e5bfc
RD
10996 def _setOORInfo(*args, **kwargs):
10997 """_setOORInfo(self, PyObject _self)"""
5b5c9bc7 10998 return _core_.Sizer__setOORInfo(*args, **kwargs)
d55e5bfc
RD
10999
11000 def Add(*args, **kwargs):
11001 """
bfddbb17 11002 Add(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11003 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11004
11005 Appends a child item to the sizer.
d55e5bfc 11006 """
5b5c9bc7 11007 return _core_.Sizer_Add(*args, **kwargs)
d55e5bfc
RD
11008
11009 def Insert(*args, **kwargs):
11010 """
bfddbb17 11011 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
070c48b4 11012 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11013
11014 Inserts a new item into the list of items managed by this sizer before
11015 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc 11016 """
5b5c9bc7 11017 return _core_.Sizer_Insert(*args, **kwargs)
d55e5bfc
RD
11018
11019 def Prepend(*args, **kwargs):
11020 """
bfddbb17 11021 Prepend(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 11022 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
11023
11024 Adds a new item to the begining of the list of sizer items managed by
11025 this sizer. See `Add` for a description of the parameters.
d55e5bfc 11026 """
5b5c9bc7 11027 return _core_.Sizer_Prepend(*args, **kwargs)
d55e5bfc
RD
11028
11029 def Remove(*args, **kwargs):
bfddbb17
RD
11030 """
11031 Remove(self, item) -> bool
11032
11033 Removes an item from the sizer and destroys it. This method does not
11034 cause any layout or resizing to take place, call `Layout` to update
11035 the layout on screen after removing a child from the sizer. The
11036 *item* parameter can be either a window, a sizer, or the zero-based
11037 index of an item to remove. Returns True if the child item was found
11038 and removed.
11039 """
5b5c9bc7 11040 return _core_.Sizer_Remove(*args, **kwargs)
d55e5bfc 11041
1a6bba1e 11042 def Detach(*args, **kwargs):
bfddbb17
RD
11043 """
11044 Detach(self, item) -> bool
11045
11046 Detaches an item from the sizer without destroying it. This method
11047 does not cause any layout or resizing to take place, call `Layout` to
11048 do so. The *item* parameter can be either a window, a sizer, or the
11049 zero-based index of the item to be detached. Returns True if the child item
11050 was found and detached.
11051 """
5b5c9bc7 11052 return _core_.Sizer_Detach(*args, **kwargs)
1a6bba1e 11053
070c48b4
RD
11054 def GetItem(*args, **kwargs):
11055 """
11056 GetItem(self, item) -> wx.SizerItem
11057
11058 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11059 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11060 the item to be found.
070c48b4 11061 """
5b5c9bc7 11062 return _core_.Sizer_GetItem(*args, **kwargs)
070c48b4 11063
d55e5bfc 11064 def _SetItemMinSize(*args, **kwargs):
5b5c9bc7
RD
11065 """_SetItemMinSize(self, PyObject item, Size size)"""
11066 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
d55e5bfc 11067
bfddbb17
RD
11068 def SetItemMinSize(self, item, *args):
11069 """
11070 SetItemMinSize(self, item, Size size)
11071
11072 Sets the minimum size that will be allocated for an item in the sizer.
11073 The *item* parameter can be either a window, a sizer, or the
11074 zero-based index of the item. If a window or sizer is given then it
11075 will be searched for recursivly in subsizers if neccessary.
11076 """
11077 if len(args) == 2:
11078 # for backward compatibility accept separate width,height args too
11079 return self._SetItemMinSize(item, args)
11080 else:
11081 return self._SetItemMinSize(item, args[0])
11082
d55e5bfc 11083 def AddItem(*args, **kwargs):
bfddbb17
RD
11084 """
11085 AddItem(self, SizerItem item)
11086
11087 Adds a `wx.SizerItem` to the sizer.
11088 """
5b5c9bc7 11089 return _core_.Sizer_AddItem(*args, **kwargs)
d55e5bfc
RD
11090
11091 def InsertItem(*args, **kwargs):
bfddbb17
RD
11092 """
11093 InsertItem(self, int index, SizerItem item)
11094
11095 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11096 """
5b5c9bc7 11097 return _core_.Sizer_InsertItem(*args, **kwargs)
d55e5bfc
RD
11098
11099 def PrependItem(*args, **kwargs):
bfddbb17
RD
11100 """
11101 PrependItem(self, SizerItem item)
11102
11103 Prepends a `wx.SizerItem` to the sizer.
11104 """
5b5c9bc7 11105 return _core_.Sizer_PrependItem(*args, **kwargs)
d55e5bfc 11106
bfddbb17 11107 def AddMany(self, items):
d6c14a4c
RD
11108 """
11109 AddMany is a convenience method for adding several items
11110 to a sizer at one time. Simply pass it a list of tuples,
11111 where each tuple consists of the parameters that you
11112 would normally pass to the `Add` method.
11113 """
bfddbb17
RD
11114 for item in items:
11115 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11116 item = (item, )
11117 self.Add(*item)
d55e5bfc
RD
11118
11119 # for backwards compatibility only, please do not use in new code
7fbf8399
RD
11120 def AddWindow(self, *args, **kw):
11121 """Compatibility alias for `Add`."""
11122 return self.Add(*args, **kw)
11123 def AddSizer(self, *args, **kw):
11124 """Compatibility alias for `Add`."""
11125 return self.Add(*args, **kw)
11126 def AddSpacer(self, *args, **kw):
11127 """Compatibility alias for `Add`."""
11128 return self.Add(*args, **kw)
11129
11130 def PrependWindow(self, *args, **kw):
11131 """Compatibility alias for `Prepend`."""
11132 return self.Prepend(*args, **kw)
11133 def PrependSizer(self, *args, **kw):
11134 """Compatibility alias for `Prepend`."""
11135 return self.Prepend(*args, **kw)
11136 def PrependSpacer(self, *args, **kw):
11137 """Compatibility alias for `Prepend`."""
11138 return self.Prepend(*args, **kw)
11139
11140 def InsertWindow(self, *args, **kw):
11141 """Compatibility alias for `Insert`."""
11142 return self.Insert(*args, **kw)
11143 def InsertSizer(self, *args, **kw):
11144 """Compatibility alias for `Insert`."""
11145 return self.Insert(*args, **kw)
11146 def InsertSpacer(self, *args, **kw):
11147 """Compatibility alias for `Insert`."""
11148 return self.Insert(*args, **kw)
11149
11150 def RemoveWindow(self, *args, **kw):
11151 """Compatibility alias for `Remove`."""
11152 return self.Remove(*args, **kw)
11153 def RemoveSizer(self, *args, **kw):
11154 """Compatibility alias for `Remove`."""
11155 return self.Remove(*args, **kw)
11156 def RemovePos(self, *args, **kw):
11157 """Compatibility alias for `Remove`."""
11158 return self.Remove(*args, **kw)
d55e5bfc
RD
11159
11160
d55e5bfc 11161 def SetDimension(*args, **kwargs):
bfddbb17
RD
11162 """
11163 SetDimension(self, int x, int y, int width, int height)
11164
11165 Call this to force the sizer to take the given dimension and thus
11166 force the items owned by the sizer to resize themselves according to
11167 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11168 methods.
11169 """
5b5c9bc7 11170 return _core_.Sizer_SetDimension(*args, **kwargs)
d55e5bfc
RD
11171
11172 def SetMinSize(*args, **kwargs):
bfddbb17 11173 """
5b5c9bc7 11174 SetMinSize(self, Size size)
bfddbb17
RD
11175
11176 Call this to give the sizer a minimal size. Normally, the sizer will
11177 calculate its minimal size based purely on how much space its children
11178 need. After calling this method `GetMinSize` will return either the
11179 minimal size as requested by its children or the minimal size set
11180 here, depending on which is bigger.
11181 """
5b5c9bc7 11182 return _core_.Sizer_SetMinSize(*args, **kwargs)
d55e5bfc
RD
11183
11184 def GetSize(*args, **kwargs):
bfddbb17 11185 """
5b5c9bc7 11186 GetSize(self) -> Size
bfddbb17
RD
11187
11188 Returns the current size of the space managed by the sizer.
11189 """
5b5c9bc7 11190 return _core_.Sizer_GetSize(*args, **kwargs)
d55e5bfc
RD
11191
11192 def GetPosition(*args, **kwargs):
bfddbb17 11193 """
5b5c9bc7 11194 GetPosition(self) -> Point
bfddbb17
RD
11195
11196 Returns the current position of the sizer's managed space.
11197 """
5b5c9bc7 11198 return _core_.Sizer_GetPosition(*args, **kwargs)
d55e5bfc
RD
11199
11200 def GetMinSize(*args, **kwargs):
bfddbb17 11201 """
5b5c9bc7 11202 GetMinSize(self) -> Size
bfddbb17
RD
11203
11204 Returns the minimal size of the sizer. This is either the combined
11205 minimal size of all the children and their borders or the minimal size
11206 set by SetMinSize, depending on which is bigger.
11207 """
5b5c9bc7 11208 return _core_.Sizer_GetMinSize(*args, **kwargs)
d55e5bfc
RD
11209
11210 def GetSizeTuple(self):
1a6bba1e 11211 return self.GetSize().Get()
d55e5bfc 11212 def GetPositionTuple(self):
1a6bba1e 11213 return self.GetPosition().Get()
d55e5bfc 11214 def GetMinSizeTuple(self):
1a6bba1e 11215 return self.GetMinSize().Get()
d55e5bfc
RD
11216
11217 def RecalcSizes(*args, **kwargs):
bfddbb17
RD
11218 """
11219 RecalcSizes(self)
11220
11221 Using the sizes calculated by `CalcMin` reposition and resize all the
11222 items managed by this sizer. You should not need to call this directly as
11223 it is called by `Layout`.
11224 """
5b5c9bc7 11225 return _core_.Sizer_RecalcSizes(*args, **kwargs)
d55e5bfc
RD
11226
11227 def CalcMin(*args, **kwargs):
bfddbb17 11228 """
5b5c9bc7 11229 CalcMin(self) -> Size
bfddbb17
RD
11230
11231 This method is where the sizer will do the actual calculation of its
11232 children's minimal sizes. You should not need to call this directly as
11233 it is called by `Layout`.
11234 """
5b5c9bc7 11235 return _core_.Sizer_CalcMin(*args, **kwargs)
d55e5bfc
RD
11236
11237 def Layout(*args, **kwargs):
bfddbb17
RD
11238 """
11239 Layout(self)
11240
11241 This method will force the recalculation and layout of the items
11242 controlled by the sizer using the current space allocated to the
11243 sizer. Normally this is called automatically from the owning window's
11244 EVT_SIZE handler, but it is also useful to call it from user code when
11245 one of the items in a sizer change size, or items are added or
11246 removed.
11247 """
5b5c9bc7 11248 return _core_.Sizer_Layout(*args, **kwargs)
d55e5bfc
RD
11249
11250 def Fit(*args, **kwargs):
bfddbb17 11251 """
5b5c9bc7 11252 Fit(self, Window window) -> Size
bfddbb17
RD
11253
11254 Tell the sizer to resize the *window* to match the sizer's minimal
11255 size. This is commonly done in the constructor of the window itself in
11256 order to set its initial size to match the needs of the children as
11257 determined by the sizer. Returns the new size.
11258
11259 For a top level window this is the total window size, not the client size.
11260 """
5b5c9bc7 11261 return _core_.Sizer_Fit(*args, **kwargs)
d55e5bfc
RD
11262
11263 def FitInside(*args, **kwargs):
bfddbb17 11264 """
5b5c9bc7 11265 FitInside(self, Window window)
bfddbb17
RD
11266
11267 Tell the sizer to resize the *virtual size* of the *window* to match the
11268 sizer's minimal size. This will not alter the on screen size of the
11269 window, but may cause the addition/removal/alteration of scrollbars
11270 required to view the virtual area in windows which manage it.
11271
11272 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11273
11274 """
5b5c9bc7 11275 return _core_.Sizer_FitInside(*args, **kwargs)
d55e5bfc
RD
11276
11277 def SetSizeHints(*args, **kwargs):
bfddbb17 11278 """
5b5c9bc7 11279 SetSizeHints(self, Window window)
bfddbb17
RD
11280
11281 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11282 match the sizer's minimal size. This is commonly done in the
11283 constructor of the window itself if the window is resizable (as are
11284 many dialogs under Unix and frames on probably all platforms) in order
11285 to prevent the window from being sized smaller than the minimal size
11286 required by the sizer.
11287 """
5b5c9bc7 11288 return _core_.Sizer_SetSizeHints(*args, **kwargs)
d55e5bfc
RD
11289
11290 def SetVirtualSizeHints(*args, **kwargs):
bfddbb17 11291 """
5b5c9bc7 11292 SetVirtualSizeHints(self, Window window)
bfddbb17
RD
11293
11294 Tell the sizer to set the minimal size of the window virtual area to
11295 match the sizer's minimal size. For windows with managed scrollbars
11296 this will set them appropriately.
11297
11298 :see: `wx.ScrolledWindow.SetScrollbars`
11299
11300 """
5b5c9bc7 11301 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
d55e5bfc
RD
11302
11303 def Clear(*args, **kwargs):
bfddbb17
RD
11304 """
11305 Clear(self, bool deleteWindows=False)
11306
11307 Clear all items from the sizer, optionally destroying the window items
11308 as well.
11309 """
5b5c9bc7 11310 return _core_.Sizer_Clear(*args, **kwargs)
d55e5bfc
RD
11311
11312 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
11313 """
11314 DeleteWindows(self)
11315
11316 Destroy all windows managed by the sizer.
11317 """
5b5c9bc7 11318 return _core_.Sizer_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
11319
11320 def GetChildren(*args, **kwargs):
bfddbb17 11321 """
51b83b37 11322 GetChildren(self) -> list
bfddbb17
RD
11323
11324 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11325 """
5b5c9bc7 11326 return _core_.Sizer_GetChildren(*args, **kwargs)
d55e5bfc
RD
11327
11328 def Show(*args, **kwargs):
bfddbb17 11329 """
b411df4a 11330 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 11331
bfddbb17
RD
11332 Shows or hides an item managed by the sizer. To make a sizer item
11333 disappear or reappear, use Show followed by `Layout`. The *item*
11334 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
11335 the item. Use the recursive parameter to show or hide an item in a
11336 subsizer. Returns True if the item was found.
bfddbb17 11337 """
5b5c9bc7 11338 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
11339
11340 def IsShown(*args, **kwargs):
bfddbb17
RD
11341 """
11342 IsShown(self, item)
11343
b1fcee84 11344 Determines if the item is currently shown. To make a sizer
bfddbb17
RD
11345 item disappear or reappear, use Show followed by `Layout`. The *item*
11346 parameter can be either a window, a sizer, or the zero-based index of
11347 the item.
11348 """
5b5c9bc7 11349 return _core_.Sizer_IsShown(*args, **kwargs)
d55e5bfc 11350
629e65c2 11351 def Hide(self, item, recursive=False):
bfddbb17 11352 """
27fb7603 11353 A convenience method for `Show` (item, False, recursive).
bfddbb17 11354 """
06759a38 11355 return self.Show(item, False, recursive)
bfddbb17 11356
d55e5bfc 11357 def ShowItems(*args, **kwargs):
bfddbb17
RD
11358 """
11359 ShowItems(self, bool show)
11360
84f85550 11361 Recursively call `wx.SizerItem.Show` on all sizer items.
bfddbb17 11362 """
5b5c9bc7 11363 return _core_.Sizer_ShowItems(*args, **kwargs)
d55e5bfc 11364
2131d850 11365_core_.Sizer_swigregister(Sizer)
d55e5bfc 11366
5b5c9bc7 11367class PySizer(Sizer):
bfddbb17
RD
11368 """
11369 wx.PySizer is a special version of `wx.Sizer` that has been
11370 instrumented to allow the C++ virtual methods to be overloaded in
11371 Python derived classes. You would derive from this class if you are
11372 wanting to implement a custom sizer in Python code. Simply implement
11373 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11374 For example::
11375
11376 class MySizer(wx.PySizer):
11377 def __init__(self):
11378 wx.PySizer.__init__(self)
11379
11380 def CalcMin(self):
11381 for item in self.GetChildren():
11382 # calculate the total minimum width and height needed
11383 # by all items in the sizer according to this sizer's
11384 # layout algorithm.
11385 ...
11386 return wx.Size(width, height)
11387
11388 def RecalcSizes(self):
11389 # find the space allotted to this sizer
11390 pos = self.GetPosition()
11391 size = self.GetSize()
11392 for item in self.GetChildren():
11393 # Recalculate (if necessary) the position and size of
11394 # each item and then call item.SetDimension to do the
11395 # actual positioning and sizing of the items within the
11396 # space alloted to this sizer.
11397 ...
11398 item.SetDimension(itemPos, itemSize)
11399
11400
11401 When `Layout` is called it first calls `CalcMin` followed by
11402 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 11403 `CalcMin` and reusing them in `RecalcSizes`.
bfddbb17
RD
11404
11405 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11406
11407
11408 """
1bd55598
RD
11409 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11410 __repr__ = _swig_repr
11411 def __init__(self, *args, **kwargs):
bfddbb17 11412 """
5b5c9bc7 11413 __init__(self) -> PySizer
bfddbb17
RD
11414
11415 Creates a wx.PySizer. Must be called from the __init__ in the derived
11416 class.
11417 """
1bd55598 11418 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
d55e5bfc
RD
11419 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
11420
11421 def _setCallbackInfo(*args, **kwargs):
11422 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 11423 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
d55e5bfc 11424
2131d850 11425_core_.PySizer_swigregister(PySizer)
d55e5bfc
RD
11426
11427#---------------------------------------------------------------------------
11428
5b5c9bc7 11429class BoxSizer(Sizer):
bfddbb17
RD
11430 """
11431 The basic idea behind a box sizer is that windows will most often be
11432 laid out in rather simple basic geometry, typically in a row or a
11433 column or nested hierarchies of either. A wx.BoxSizer will lay out
11434 its items in a simple row or column, depending on the orientation
11435 parameter passed to the constructor.
11436 """
1bd55598
RD
11437 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11438 __repr__ = _swig_repr
11439 def __init__(self, *args, **kwargs):
bfddbb17 11440 """
5b5c9bc7 11441 __init__(self, int orient=HORIZONTAL) -> BoxSizer
bfddbb17
RD
11442
11443 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
11444 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
11445 sizer.
11446 """
1bd55598 11447 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d55e5bfc
RD
11448 self._setOORInfo(self)
11449
11450 def GetOrientation(*args, **kwargs):
bfddbb17
RD
11451 """
11452 GetOrientation(self) -> int
11453
11454 Returns the current orientation of the sizer.
11455 """
5b5c9bc7 11456 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
d55e5bfc
RD
11457
11458 def SetOrientation(*args, **kwargs):
bfddbb17
RD
11459 """
11460 SetOrientation(self, int orient)
d55e5bfc 11461
bfddbb17
RD
11462 Resets the orientation of the sizer.
11463 """
5b5c9bc7 11464 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc 11465
2131d850 11466_core_.BoxSizer_swigregister(BoxSizer)
d55e5bfc
RD
11467
11468#---------------------------------------------------------------------------
11469
5b5c9bc7 11470class StaticBoxSizer(BoxSizer):
bfddbb17
RD
11471 """
11472 wx.StaticBoxSizer derives from and functions identically to the
11473 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
11474 manages. Note that this static box must be created separately and
11475 passed to the sizer constructor.
11476 """
1bd55598
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):
bfddbb17 11480 """
5b5c9bc7 11481 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
bfddbb17
RD
11482
11483 Constructor. It takes an associated static box and the orientation
11484 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
11485 ``wx.HORIZONTAL``.
11486 """
1bd55598 11487 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d55e5bfc
RD
11488 self._setOORInfo(self)
11489
11490 def GetStaticBox(*args, **kwargs):
bfddbb17 11491 """
5b5c9bc7 11492 GetStaticBox(self) -> StaticBox
d55e5bfc 11493
bfddbb17
RD
11494 Returns the static box associated with this sizer.
11495 """
5b5c9bc7 11496 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc 11497
2131d850 11498_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d55e5bfc
RD
11499
11500#---------------------------------------------------------------------------
11501
5b5c9bc7 11502class GridSizer(Sizer):
bfddbb17
RD
11503 """
11504 A grid sizer is a sizer which lays out its children in a
11505 two-dimensional table with all cells having the same size. In other
11506 words, the width of each cell within the grid is the width of the
11507 widest item added to the sizer and the height of each grid cell is the
11508 height of the tallest item. An optional vertical and/or horizontal
11509 gap between items can also be specified (in pixels.)
11510
11511 Items are placed in the cells of the grid in the order they are added,
11512 in row-major order. In other words, the first row is filled first,
11513 then the second, and so on until all items have been added. (If
11514 neccessary, additional rows will be added as items are added.) If you
11515 need to have greater control over the cells that items are placed in
11516 then use the `wx.GridBagSizer`.
11517
11518 """
1bd55598
RD
11519 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11520 __repr__ = _swig_repr
11521 def __init__(self, *args, **kwargs):
bfddbb17 11522 """
5b5c9bc7 11523 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
bfddbb17
RD
11524
11525 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
11526 of columns and rows in the sizer - if either of the parameters is
11527 zero, it will be calculated to from the total number of children in
11528 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11529 define extra space between all children.
11530 """
1bd55598 11531 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d55e5bfc
RD
11532 self._setOORInfo(self)
11533
d55e5bfc 11534 def SetCols(*args, **kwargs):
bfddbb17
RD
11535 """
11536 SetCols(self, int cols)
11537
11538 Sets the number of columns in the sizer.
11539 """
5b5c9bc7 11540 return _core_.GridSizer_SetCols(*args, **kwargs)
d55e5bfc
RD
11541
11542 def SetRows(*args, **kwargs):
bfddbb17
RD
11543 """
11544 SetRows(self, int rows)
11545
11546 Sets the number of rows in the sizer.
11547 """
5b5c9bc7 11548 return _core_.GridSizer_SetRows(*args, **kwargs)
d55e5bfc
RD
11549
11550 def SetVGap(*args, **kwargs):
bfddbb17
RD
11551 """
11552 SetVGap(self, int gap)
11553
11554 Sets the vertical gap (in pixels) between the cells in the sizer.
11555 """
5b5c9bc7 11556 return _core_.GridSizer_SetVGap(*args, **kwargs)
d55e5bfc
RD
11557
11558 def SetHGap(*args, **kwargs):
bfddbb17
RD
11559 """
11560 SetHGap(self, int gap)
11561
11562 Sets the horizontal gap (in pixels) between cells in the sizer
11563 """
5b5c9bc7 11564 return _core_.GridSizer_SetHGap(*args, **kwargs)
d55e5bfc
RD
11565
11566 def GetCols(*args, **kwargs):
bfddbb17
RD
11567 """
11568 GetCols(self) -> int
11569
11570 Returns the number of columns in the sizer.
11571 """
5b5c9bc7 11572 return _core_.GridSizer_GetCols(*args, **kwargs)
d55e5bfc
RD
11573
11574 def GetRows(*args, **kwargs):
bfddbb17
RD
11575 """
11576 GetRows(self) -> int
11577
11578 Returns the number of rows in the sizer.
11579 """
5b5c9bc7 11580 return _core_.GridSizer_GetRows(*args, **kwargs)
d55e5bfc
RD
11581
11582 def GetVGap(*args, **kwargs):
bfddbb17
RD
11583 """
11584 GetVGap(self) -> int
11585
11586 Returns the vertical gap (in pixels) between the cells in the sizer.
11587 """
5b5c9bc7 11588 return _core_.GridSizer_GetVGap(*args, **kwargs)
d55e5bfc
RD
11589
11590 def GetHGap(*args, **kwargs):
bfddbb17
RD
11591 """
11592 GetHGap(self) -> int
11593
11594 Returns the horizontal gap (in pixels) between cells in the sizer.
11595 """
5b5c9bc7 11596 return _core_.GridSizer_GetHGap(*args, **kwargs)
d55e5bfc 11597
1bd55598
RD
11598 def CalcRowsCols(self):
11599 """
11600 CalcRowsCols() -> (rows, cols)
11601
11602 Calculates how many rows and columns will be in the sizer based
11603 on the current number of items and also the rows, cols specified
11604 in the constructor.
11605 """
11606 nitems = len(self.GetChildren())
11607 rows = self.GetRows()
11608 cols = self.GetCols()
11609 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
11610 if cols != 0:
11611 rows = (nitems + cols - 1) / cols
11612 elif rows != 0:
11613 cols = (nitems + rows - 1) / rows
11614 return (rows, cols)
d55e5bfc 11615
2131d850 11616_core_.GridSizer_swigregister(GridSizer)
d55e5bfc
RD
11617
11618#---------------------------------------------------------------------------
11619
5b5c9bc7
RD
11620FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
11621FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
11622FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
11623class FlexGridSizer(GridSizer):
bfddbb17
RD
11624 """
11625 A flex grid sizer is a sizer which lays out its children in a
11626 two-dimensional table with all table cells in one row having the same
11627 height and all cells in one column having the same width, but all
11628 rows or all columns are not necessarily the same height or width as in
11629 the `wx.GridSizer`.
11630
11631 wx.FlexGridSizer can also size items equally in one direction but
11632 unequally ("flexibly") in the other. If the sizer is only flexible
11633 in one direction (this can be changed using `SetFlexibleDirection`), it
11634 needs to be decided how the sizer should grow in the other ("non
11635 flexible") direction in order to fill the available space. The
11636 `SetNonFlexibleGrowMode` method serves this purpose.
11637
11638
11639 """
1bd55598
RD
11640 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11641 __repr__ = _swig_repr
11642 def __init__(self, *args, **kwargs):
bfddbb17 11643 """
5b5c9bc7 11644 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
bfddbb17
RD
11645
11646 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
11647 number of columns and rows in the sizer - if either of the parameters
11648 is zero, it will be calculated to from the total number of children in
11649 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
11650 define extra space between all children.
11651 """
1bd55598 11652 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d55e5bfc
RD
11653 self._setOORInfo(self)
11654
bfddbb17
RD
11655 def AddGrowableRow(*args, **kwargs):
11656 """
11657 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 11658
bfddbb17
RD
11659 Specifies that row *idx* (starting from zero) should be grown if there
11660 is extra space available to the sizer.
d55e5bfc 11661
bfddbb17
RD
11662 The *proportion* parameter has the same meaning as the stretch factor
11663 for the box sizers except that if all proportions are 0, then all
11664 columns are resized equally (instead of not being resized at all).
11665 """
5b5c9bc7 11666 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
d55e5bfc
RD
11667
11668 def RemoveGrowableRow(*args, **kwargs):
bfddbb17
RD
11669 """
11670 RemoveGrowableRow(self, size_t idx)
11671
11672 Specifies that row *idx* is no longer growable.
11673 """
5b5c9bc7 11674 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
d55e5bfc
RD
11675
11676 def AddGrowableCol(*args, **kwargs):
bfddbb17
RD
11677 """
11678 AddGrowableCol(self, size_t idx, int proportion=0)
11679
11680 Specifies that column *idx* (starting from zero) should be grown if
11681 there is extra space available to the sizer.
11682
11683 The *proportion* parameter has the same meaning as the stretch factor
11684 for the box sizers except that if all proportions are 0, then all
11685 columns are resized equally (instead of not being resized at all).
11686 """
5b5c9bc7 11687 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
d55e5bfc
RD
11688
11689 def RemoveGrowableCol(*args, **kwargs):
bfddbb17
RD
11690 """
11691 RemoveGrowableCol(self, size_t idx)
11692
11693 Specifies that column *idx* is no longer growable.
11694 """
5b5c9bc7 11695 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
d55e5bfc
RD
11696
11697 def SetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
11698 """
11699 SetFlexibleDirection(self, int direction)
11700
11701 Specifies whether the sizer should flexibly resize its columns, rows,
11702 or both. Argument *direction* can be one of the following values. Any
11703 other value is ignored.
11704
11705 ============== =======================================
11706 wx.VERTICAL Rows are flexibly sized.
11707 wx.HORIZONTAL Columns are flexibly sized.
11708 wx.BOTH Both rows and columns are flexibly sized
11709 (this is the default value).
11710 ============== =======================================
11711
11712 Note that this method does not trigger relayout.
11713
11714 """
5b5c9bc7 11715 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
11716
11717 def GetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
11718 """
11719 GetFlexibleDirection(self) -> int
11720
11721 Returns a value that specifies whether the sizer
11722 flexibly resizes its columns, rows, or both (default).
11723
11724 :see: `SetFlexibleDirection`
11725 """
5b5c9bc7 11726 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
11727
11728 def SetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
11729 """
11730 SetNonFlexibleGrowMode(self, int mode)
11731
11732 Specifies how the sizer should grow in the non-flexible direction if
11733 there is one (so `SetFlexibleDirection` must have been called
11734 previously). Argument *mode* can be one of the following values:
11735
11736 ========================== =================================================
11737 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
11738 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
11739 `AddGrowableCol` and `AddGrowableRow`. In this
11740 case equal sizing applies to minimum sizes of
11741 columns or rows (this is the default value).
11742 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
11743 the non flexible direction, whether they are
11744 growable or not in the flexbile direction.
11745 ========================== =================================================
11746
11747 Note that this method does not trigger relayout.
11748
11749
11750 """
5b5c9bc7 11751 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
11752
11753 def GetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
11754 """
11755 GetNonFlexibleGrowMode(self) -> int
11756
11757 Returns the value that specifies how the sizer grows in the
11758 non-flexible direction if there is one.
11759
11760 :see: `SetNonFlexibleGrowMode`
11761 """
5b5c9bc7 11762 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
11763
11764 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
11765 """
11766 GetRowHeights(self) -> list
11767
11768 Returns a list of integers representing the heights of each of the
11769 rows in the sizer.
11770 """
5b5c9bc7 11771 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
d55e5bfc
RD
11772
11773 def GetColWidths(*args, **kwargs):
fd2dc343
RD
11774 """
11775 GetColWidths(self) -> list
11776
11777 Returns a list of integers representing the widths of each of the
11778 columns in the sizer.
11779 """
5b5c9bc7 11780 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
d55e5bfc 11781
2131d850 11782_core_.FlexGridSizer_swigregister(FlexGridSizer)
d55e5bfc 11783
5b5c9bc7 11784class StdDialogButtonSizer(BoxSizer):
62d32a5f
RD
11785 """
11786 A special sizer that knows how to order and position standard buttons
11787 in order to conform to the current platform's standards. You simply
11788 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 11789 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
11790 will take care of the rest.
11791
11792 """
1bd55598
RD
11793 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11794 __repr__ = _swig_repr
11795 def __init__(self, *args, **kwargs):
5b5c9bc7 11796 """__init__(self) -> StdDialogButtonSizer"""
1bd55598 11797 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
62d32a5f
RD
11798 def AddButton(*args, **kwargs):
11799 """
11800 AddButton(self, wxButton button)
11801
11802 Use this to add the buttons to this sizer. Do not use the `Add`
11803 method in the base class.
11804 """
5b5c9bc7 11805 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
62d32a5f 11806
53aa7709 11807 def Realize(*args, **kwargs):
62d32a5f 11808 """
53aa7709 11809 Realize(self)
62d32a5f
RD
11810
11811 This funciton needs to be called after all the buttons have been added
11812 to the sizer. It will reorder them and position them in a platform
11813 specifc manner.
11814 """
5b5c9bc7 11815 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
11816
11817 def SetAffirmativeButton(*args, **kwargs):
11818 """SetAffirmativeButton(self, wxButton button)"""
5b5c9bc7 11819 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
51b83b37
RD
11820
11821 def SetNegativeButton(*args, **kwargs):
11822 """SetNegativeButton(self, wxButton button)"""
5b5c9bc7 11823 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
51b83b37
RD
11824
11825 def SetCancelButton(*args, **kwargs):
11826 """SetCancelButton(self, wxButton button)"""
5b5c9bc7 11827 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
11828
11829 def GetAffirmativeButton(*args, **kwargs):
11830 """GetAffirmativeButton(self) -> wxButton"""
5b5c9bc7 11831 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
62d32a5f
RD
11832
11833 def GetApplyButton(*args, **kwargs):
11834 """GetApplyButton(self) -> wxButton"""
5b5c9bc7 11835 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
62d32a5f
RD
11836
11837 def GetNegativeButton(*args, **kwargs):
11838 """GetNegativeButton(self) -> wxButton"""
5b5c9bc7 11839 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
62d32a5f
RD
11840
11841 def GetCancelButton(*args, **kwargs):
11842 """GetCancelButton(self) -> wxButton"""
5b5c9bc7 11843 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
62d32a5f
RD
11844
11845 def GetHelpButton(*args, **kwargs):
11846 """GetHelpButton(self) -> wxButton"""
5b5c9bc7 11847 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
62d32a5f 11848
2131d850 11849_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
62d32a5f 11850
d55e5bfc
RD
11851#---------------------------------------------------------------------------
11852
5b5c9bc7 11853class GBPosition(object):
bfddbb17
RD
11854 """
11855 This class represents the position of an item in a virtual grid of
11856 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11857 typemaps that will automatically convert from a 2-element sequence of
11858 integers to a wx.GBPosition, so you can use the more pythonic
11859 representation of the position nearly transparently in Python code.
11860 """
1bd55598
RD
11861 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11862 __repr__ = _swig_repr
11863 def __init__(self, *args, **kwargs):
bfddbb17 11864 """
5b5c9bc7 11865 __init__(self, int row=0, int col=0) -> GBPosition
bfddbb17
RD
11866
11867 This class represents the position of an item in a virtual grid of
11868 rows and columns managed by a `wx.GridBagSizer`. wxPython has
11869 typemaps that will automatically convert from a 2-element sequence of
11870 integers to a wx.GBPosition, so you can use the more pythonic
11871 representation of the position nearly transparently in Python code.
11872 """
1bd55598
RD
11873 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
11874 __swig_destroy__ = _core_.delete_GBPosition
11875 __del__ = lambda self : None;
d55e5bfc
RD
11876 def GetRow(*args, **kwargs):
11877 """GetRow(self) -> int"""
5b5c9bc7 11878 return _core_.GBPosition_GetRow(*args, **kwargs)
d55e5bfc
RD
11879
11880 def GetCol(*args, **kwargs):
11881 """GetCol(self) -> int"""
5b5c9bc7 11882 return _core_.GBPosition_GetCol(*args, **kwargs)
d55e5bfc
RD
11883
11884 def SetRow(*args, **kwargs):
11885 """SetRow(self, int row)"""
5b5c9bc7 11886 return _core_.GBPosition_SetRow(*args, **kwargs)
d55e5bfc
RD
11887
11888 def SetCol(*args, **kwargs):
11889 """SetCol(self, int col)"""
5b5c9bc7 11890 return _core_.GBPosition_SetCol(*args, **kwargs)
d55e5bfc
RD
11891
11892 def __eq__(*args, **kwargs):
e9d6f3a4
RD
11893 """
11894 __eq__(self, PyObject other) -> bool
11895
11896 Compare GBPosition for equality.
11897 """
5b5c9bc7 11898 return _core_.GBPosition___eq__(*args, **kwargs)
d55e5bfc
RD
11899
11900 def __ne__(*args, **kwargs):
e9d6f3a4
RD
11901 """
11902 __ne__(self, PyObject other) -> bool
11903
11904 Compare GBPosition for inequality.
11905 """
5b5c9bc7 11906 return _core_.GBPosition___ne__(*args, **kwargs)
d55e5bfc
RD
11907
11908 def Set(*args, **kwargs):
11909 """Set(self, int row=0, int col=0)"""
5b5c9bc7 11910 return _core_.GBPosition_Set(*args, **kwargs)
d55e5bfc
RD
11911
11912 def Get(*args, **kwargs):
11913 """Get(self) -> PyObject"""
5b5c9bc7 11914 return _core_.GBPosition_Get(*args, **kwargs)
d55e5bfc 11915
15817c7e 11916 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
11917 def __str__(self): return str(self.Get())
11918 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
11919 def __len__(self): return len(self.Get())
11920 def __getitem__(self, index): return self.Get()[index]
11921 def __setitem__(self, index, val):
11922 if index == 0: self.SetRow(val)
11923 elif index == 1: self.SetCol(val)
11924 else: raise IndexError
11925 def __nonzero__(self): return self.Get() != (0,0)
11926 __safe_for_unpickling__ = True
11927 def __reduce__(self): return (wx.GBPosition, self.Get())
11928
11929 row = property(GetRow, SetRow)
11930 col = property(GetCol, SetCol)
11931
2131d850 11932_core_.GBPosition_swigregister(GBPosition)
d55e5bfc 11933
5b5c9bc7 11934class GBSpan(object):
bfddbb17
RD
11935 """
11936 This class is used to hold the row and column spanning attributes of
11937 items in a `wx.GridBagSizer`. wxPython has typemaps that will
11938 automatically convert from a 2-element sequence of integers to a
11939 wx.GBSpan, so you can use the more pythonic representation of the span
11940 nearly transparently in Python code.
11941
11942 """
1bd55598
RD
11943 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11944 __repr__ = _swig_repr
11945 def __init__(self, *args, **kwargs):
bfddbb17 11946 """
5b5c9bc7 11947 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
bfddbb17
RD
11948
11949 Construct a new wxGBSpan, optionally setting the rowspan and
11950 colspan. The default is (1,1). (Meaning that the item occupies one
11951 cell in each direction.
11952 """
1bd55598
RD
11953 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
11954 __swig_destroy__ = _core_.delete_GBSpan
11955 __del__ = lambda self : None;
d55e5bfc
RD
11956 def GetRowspan(*args, **kwargs):
11957 """GetRowspan(self) -> int"""
5b5c9bc7 11958 return _core_.GBSpan_GetRowspan(*args, **kwargs)
d55e5bfc
RD
11959
11960 def GetColspan(*args, **kwargs):
11961 """GetColspan(self) -> int"""
5b5c9bc7 11962 return _core_.GBSpan_GetColspan(*args, **kwargs)
d55e5bfc
RD
11963
11964 def SetRowspan(*args, **kwargs):
11965 """SetRowspan(self, int rowspan)"""
5b5c9bc7 11966 return _core_.GBSpan_SetRowspan(*args, **kwargs)
d55e5bfc
RD
11967
11968 def SetColspan(*args, **kwargs):
11969 """SetColspan(self, int colspan)"""
5b5c9bc7 11970 return _core_.GBSpan_SetColspan(*args, **kwargs)
d55e5bfc
RD
11971
11972 def __eq__(*args, **kwargs):
e9d6f3a4
RD
11973 """
11974 __eq__(self, PyObject other) -> bool
11975
11976 Compare wxGBSpan for equality.
11977 """
5b5c9bc7 11978 return _core_.GBSpan___eq__(*args, **kwargs)
d55e5bfc
RD
11979
11980 def __ne__(*args, **kwargs):
e9d6f3a4
RD
11981 """
11982 __ne__(self, PyObject other) -> bool
11983
11984 Compare GBSpan for inequality.
11985 """
5b5c9bc7 11986 return _core_.GBSpan___ne__(*args, **kwargs)
d55e5bfc
RD
11987
11988 def Set(*args, **kwargs):
11989 """Set(self, int rowspan=1, int colspan=1)"""
5b5c9bc7 11990 return _core_.GBSpan_Set(*args, **kwargs)
d55e5bfc
RD
11991
11992 def Get(*args, **kwargs):
11993 """Get(self) -> PyObject"""
5b5c9bc7 11994 return _core_.GBSpan_Get(*args, **kwargs)
d55e5bfc 11995
15817c7e 11996 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
11997 def __str__(self): return str(self.Get())
11998 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
11999 def __len__(self): return len(self.Get())
12000 def __getitem__(self, index): return self.Get()[index]
12001 def __setitem__(self, index, val):
12002 if index == 0: self.SetRowspan(val)
12003 elif index == 1: self.SetColspan(val)
12004 else: raise IndexError
12005 def __nonzero__(self): return self.Get() != (0,0)
12006 __safe_for_unpickling__ = True
12007 def __reduce__(self): return (wx.GBSpan, self.Get())
12008
12009 rowspan = property(GetRowspan, SetRowspan)
12010 colspan = property(GetColspan, SetColspan)
12011
2131d850 12012_core_.GBSpan_swigregister(GBSpan)
d55e5bfc 12013
5b5c9bc7 12014class GBSizerItem(SizerItem):
bfddbb17
RD
12015 """
12016 The wx.GBSizerItem class is used to track the additional data about
12017 items in a `wx.GridBagSizer` such as the item's position in the grid
12018 and how many rows or columns it spans.
12019
12020 """
1bd55598
RD
12021 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12022 __repr__ = _swig_repr
12023 def __init__(self, *args, **kwargs):
bfddbb17 12024 """
5b5c9bc7 12025 __init__(self) -> GBSizerItem
bfddbb17
RD
12026
12027 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12028 size will need to be set, as well as a position and span before this
12029 item can be used in a Sizer.
12030
12031 You will probably never need to create a wx.GBSizerItem directly as they
12032 are created automatically when the sizer's Add method is called.
12033 """
1bd55598
RD
12034 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12035 __swig_destroy__ = _core_.delete_GBSizerItem
12036 __del__ = lambda self : None;
d55e5bfc 12037 def GetPos(*args, **kwargs):
bfddbb17 12038 """
5b5c9bc7 12039 GetPos(self) -> GBPosition
bfddbb17
RD
12040
12041 Get the grid position of the item
12042 """
5b5c9bc7 12043 return _core_.GBSizerItem_GetPos(*args, **kwargs)
d55e5bfc
RD
12044
12045 def GetPosTuple(self): return self.GetPos().Get()
12046 def GetSpan(*args, **kwargs):
bfddbb17 12047 """
5b5c9bc7 12048 GetSpan(self) -> GBSpan
bfddbb17
RD
12049
12050 Get the row and column spanning of the item
12051 """
5b5c9bc7 12052 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
d55e5bfc
RD
12053
12054 def GetSpanTuple(self): return self.GetSpan().Get()
12055 def SetPos(*args, **kwargs):
bfddbb17 12056 """
5b5c9bc7 12057 SetPos(self, GBPosition pos) -> bool
bfddbb17
RD
12058
12059 If the item is already a member of a sizer then first ensure that
12060 there is no other item that would intersect with this one at the new
12061 position, then set the new position. Returns True if the change is
12062 successful and after the next Layout() the item will be moved.
12063 """
5b5c9bc7 12064 return _core_.GBSizerItem_SetPos(*args, **kwargs)
d55e5bfc
RD
12065
12066 def SetSpan(*args, **kwargs):
bfddbb17 12067 """
5b5c9bc7 12068 SetSpan(self, GBSpan span) -> bool
bfddbb17
RD
12069
12070 If the item is already a member of a sizer then first ensure that
12071 there is no other item that would intersect with this one with its new
12072 spanning size, then set the new spanning. Returns True if the change
12073 is successful and after the next Layout() the item will be resized.
12074
12075 """
5b5c9bc7 12076 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
d55e5bfc 12077
bfddbb17 12078 def Intersects(*args, **kwargs):
d55e5bfc 12079 """
5b5c9bc7 12080 Intersects(self, GBSizerItem other) -> bool
bfddbb17
RD
12081
12082 Returns True if this item and the other item instersect.
d55e5bfc 12083 """
5b5c9bc7 12084 return _core_.GBSizerItem_Intersects(*args, **kwargs)
bfddbb17
RD
12085
12086 def IntersectsPos(*args, **kwargs):
12087 """
5b5c9bc7 12088 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
bfddbb17
RD
12089
12090 Returns True if the given pos/span would intersect with this item.
12091 """
5b5c9bc7 12092 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
12093
12094 def GetEndPos(*args, **kwargs):
bfddbb17 12095 """
5b5c9bc7 12096 GetEndPos(self) -> GBPosition
bfddbb17
RD
12097
12098 Get the row and column of the endpoint of this item.
12099 """
5b5c9bc7 12100 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
d55e5bfc
RD
12101
12102 def GetGBSizer(*args, **kwargs):
bfddbb17 12103 """
5b5c9bc7 12104 GetGBSizer(self) -> GridBagSizer
bfddbb17
RD
12105
12106 Get the sizer this item is a member of.
12107 """
5b5c9bc7 12108 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
d55e5bfc
RD
12109
12110 def SetGBSizer(*args, **kwargs):
bfddbb17 12111 """
5b5c9bc7 12112 SetGBSizer(self, GridBagSizer sizer)
bfddbb17
RD
12113
12114 Set the sizer this item is a member of.
12115 """
5b5c9bc7 12116 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
d55e5bfc 12117
2131d850 12118_core_.GBSizerItem_swigregister(GBSizerItem)
5b5c9bc7 12119DefaultSpan = cvar.DefaultSpan
d55e5bfc
RD
12120
12121def GBSizerItemWindow(*args, **kwargs):
12122 """
5b5c9bc7
RD
12123 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
12124 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12125
12126 Construct a `wx.GBSizerItem` for a window.
d55e5bfc 12127 """
5b5c9bc7 12128 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12129 return val
12130
12131def GBSizerItemSizer(*args, **kwargs):
12132 """
5b5c9bc7
RD
12133 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
12134 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12135
12136 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc 12137 """
5b5c9bc7 12138 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12139 return val
12140
12141def GBSizerItemSpacer(*args, **kwargs):
12142 """
5b5c9bc7
RD
12143 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
12144 int flag, int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
12145
12146 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc 12147 """
5b5c9bc7 12148 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12149 return val
12150
5b5c9bc7 12151class GridBagSizer(FlexGridSizer):
bfddbb17
RD
12152 """
12153 A `wx.Sizer` that can lay out items in a virtual grid like a
12154 `wx.FlexGridSizer` but in this case explicit positioning of the items
12155 is allowed using `wx.GBPosition`, and items can optionally span more
12156 than one row and/or column using `wx.GBSpan`. The total size of the
12157 virtual grid is determined by the largest row and column that items are
12158 positioned at, adjusted for spanning.
12159
12160 """
1bd55598
RD
12161 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12162 __repr__ = _swig_repr
12163 def __init__(self, *args, **kwargs):
bfddbb17 12164 """
5b5c9bc7 12165 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
bfddbb17
RD
12166
12167 Constructor, with optional parameters to specify the gap between the
12168 rows and columns.
12169 """
1bd55598 12170 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
03e46024
RD
12171 self._setOORInfo(self)
12172
d55e5bfc
RD
12173 def Add(*args, **kwargs):
12174 """
bfddbb17 12175 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
070c48b4 12176 int border=0, userData=None) -> wx.GBSizerItem
bfddbb17
RD
12177
12178 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12179 more than one row or column as specified with *span*. The remaining
12180 args behave similarly to `wx.Sizer.Add`.
12181
12182 Returns True if the item was successfully placed at the given cell
12183 position, False if something was already there.
12184
d55e5bfc 12185 """
5b5c9bc7 12186 return _core_.GridBagSizer_Add(*args, **kwargs)
d55e5bfc
RD
12187
12188 def AddItem(*args, **kwargs):
bfddbb17 12189 """
070c48b4 12190 Add(self, GBSizerItem item) -> wx.GBSizerItem
bfddbb17
RD
12191
12192 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12193 the item was successfully placed at its given cell position, False if
12194 something was already there.
12195 """
5b5c9bc7 12196 return _core_.GridBagSizer_AddItem(*args, **kwargs)
d55e5bfc 12197
84f85550
RD
12198 def GetCellSize(*args, **kwargs):
12199 """
5b5c9bc7 12200 GetCellSize(self, int row, int col) -> Size
84f85550
RD
12201
12202 Get the size of the specified cell, including hgap and
12203 vgap. Only valid after a Layout.
12204 """
5b5c9bc7 12205 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
84f85550 12206
d55e5bfc 12207 def GetEmptyCellSize(*args, **kwargs):
bfddbb17 12208 """
5b5c9bc7 12209 GetEmptyCellSize(self) -> Size
bfddbb17
RD
12210
12211 Get the size used for cells in the grid with no item.
12212 """
5b5c9bc7 12213 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12214
12215 def SetEmptyCellSize(*args, **kwargs):
bfddbb17 12216 """
5b5c9bc7 12217 SetEmptyCellSize(self, Size sz)
bfddbb17
RD
12218
12219 Set the size used for cells in the grid with no item.
12220 """
5b5c9bc7 12221 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
12222
12223 def GetItemPosition(*args):
12224 """
bfddbb17
RD
12225 GetItemPosition(self, item) -> GBPosition
12226
12227 Get the grid position of the specified *item* where *item* is either a
12228 window or subsizer that is a member of this sizer, or a zero-based
12229 index of an item.
d55e5bfc 12230 """
5b5c9bc7 12231 return _core_.GridBagSizer_GetItemPosition(*args)
d55e5bfc
RD
12232
12233 def SetItemPosition(*args):
12234 """
bfddbb17
RD
12235 SetItemPosition(self, item, GBPosition pos) -> bool
12236
12237 Set the grid position of the specified *item* where *item* is either a
12238 window or subsizer that is a member of this sizer, or a zero-based
12239 index of an item. Returns True on success. If the move is not
12240 allowed (because an item is already there) then False is returned.
12241
d55e5bfc 12242 """
5b5c9bc7 12243 return _core_.GridBagSizer_SetItemPosition(*args)
d55e5bfc
RD
12244
12245 def GetItemSpan(*args):
12246 """
bfddbb17
RD
12247 GetItemSpan(self, item) -> GBSpan
12248
12249 Get the row/col spanning of the specified *item* where *item* is
12250 either a window or subsizer that is a member of this sizer, or a
12251 zero-based index of an item.
d55e5bfc 12252 """
5b5c9bc7 12253 return _core_.GridBagSizer_GetItemSpan(*args)
d55e5bfc
RD
12254
12255 def SetItemSpan(*args):
12256 """
bfddbb17
RD
12257 SetItemSpan(self, item, GBSpan span) -> bool
12258
12259 Set the row/col spanning of the specified *item* where *item* is
12260 either a window or subsizer that is a member of this sizer, or a
12261 zero-based index of an item. Returns True on success. If the move is
12262 not allowed (because an item is already there) then False is returned.
d55e5bfc 12263 """
5b5c9bc7 12264 return _core_.GridBagSizer_SetItemSpan(*args)
d55e5bfc
RD
12265
12266 def FindItem(*args):
12267 """
bfddbb17
RD
12268 FindItem(self, item) -> GBSizerItem
12269
12270 Find the sizer item for the given window or subsizer, returns None if
12271 not found. (non-recursive)
d55e5bfc 12272 """
5b5c9bc7 12273 return _core_.GridBagSizer_FindItem(*args)
d55e5bfc
RD
12274
12275 def FindItemAtPosition(*args, **kwargs):
bfddbb17 12276 """
5b5c9bc7 12277 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
bfddbb17
RD
12278
12279 Return the sizer item for the given grid cell, or None if there is no
12280 item at that position. (non-recursive)
12281 """
5b5c9bc7 12282 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
d55e5bfc
RD
12283
12284 def FindItemAtPoint(*args, **kwargs):
bfddbb17 12285 """
5b5c9bc7 12286 FindItemAtPoint(self, Point pt) -> GBSizerItem
bfddbb17
RD
12287
12288 Return the sizer item located at the point given in *pt*, or None if
12289 there is no item at that point. The (x,y) coordinates in pt correspond
12290 to the client coordinates of the window using the sizer for
12291 layout. (non-recursive)
12292 """
5b5c9bc7 12293 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
d55e5bfc 12294
bfddbb17
RD
12295 def CheckForIntersection(*args, **kwargs):
12296 """
5b5c9bc7 12297 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 12298
bfddbb17
RD
12299 Look at all items and see if any intersect (or would overlap) the
12300 given *item*. Returns True if so, False if there would be no overlap.
12301 If an *excludeItem* is given then it will not be checked for
12302 intersection, for example it may be the item we are checking the
12303 position of.
d55e5bfc 12304
bfddbb17 12305 """
5b5c9bc7 12306 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 12307
bfddbb17 12308 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 12309 """
5b5c9bc7 12310 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
bfddbb17
RD
12311
12312 Look at all items and see if any intersect (or would overlap) the
12313 given position and span. Returns True if so, False if there would be
12314 no overlap. If an *excludeItem* is given then it will not be checked
12315 for intersection, for example it may be the item we are checking the
12316 position of.
d55e5bfc 12317 """
5b5c9bc7 12318 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc 12319
2131d850 12320_core_.GridBagSizer_swigregister(GridBagSizer)
d55e5bfc
RD
12321
12322#---------------------------------------------------------------------------
12323
5b5c9bc7
RD
12324Left = _core_.Left
12325Top = _core_.Top
12326Right = _core_.Right
12327Bottom = _core_.Bottom
12328Width = _core_.Width
12329Height = _core_.Height
12330Centre = _core_.Centre
12331Center = _core_.Center
12332CentreX = _core_.CentreX
12333CentreY = _core_.CentreY
12334Unconstrained = _core_.Unconstrained
12335AsIs = _core_.AsIs
12336PercentOf = _core_.PercentOf
12337Above = _core_.Above
12338Below = _core_.Below
12339LeftOf = _core_.LeftOf
12340RightOf = _core_.RightOf
12341SameAs = _core_.SameAs
12342Absolute = _core_.Absolute
12343class IndividualLayoutConstraint(Object):
d55e5bfc 12344 """
15817c7e
RD
12345 Objects of this class are stored in the `wx.LayoutConstraints` class as
12346 one of eight possible constraints that a window can be involved in.
12347 You will never need to create an instance of
12348 wx.IndividualLayoutConstraint, rather you should create a
12349 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 12350 that it contains.
d55e5bfc 12351 """
1bd55598
RD
12352 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12353 def __init__(self): raise AttributeError, "No constructor defined"
12354 __repr__ = _swig_repr
d55e5bfc 12355 def Set(*args, **kwargs):
15817c7e 12356 """
5b5c9bc7 12357 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
15817c7e
RD
12358
12359 Sets the properties of the constraint. Normally called by one of the
12360 convenience functions such as Above, RightOf, SameAs.
12361 """
5b5c9bc7 12362 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
d55e5bfc
RD
12363
12364 def LeftOf(*args, **kwargs):
12365 """
5b5c9bc7 12366 LeftOf(self, Window sibling, int marg=0)
d55e5bfc 12367
15817c7e
RD
12368 Constrains this edge to be to the left of the given window, with an
12369 optional margin. Implicitly, this is relative to the left edge of the
12370 other window.
d55e5bfc 12371 """
5b5c9bc7 12372 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
d55e5bfc
RD
12373
12374 def RightOf(*args, **kwargs):
12375 """
5b5c9bc7 12376 RightOf(self, Window sibling, int marg=0)
d55e5bfc 12377
15817c7e
RD
12378 Constrains this edge to be to the right of the given window, with an
12379 optional margin. Implicitly, this is relative to the right edge of the
12380 other window.
d55e5bfc 12381 """
5b5c9bc7 12382 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
d55e5bfc
RD
12383
12384 def Above(*args, **kwargs):
12385 """
5b5c9bc7 12386 Above(self, Window sibling, int marg=0)
d55e5bfc 12387
15817c7e
RD
12388 Constrains this edge to be above the given window, with an optional
12389 margin. Implicitly, this is relative to the top edge of the other
12390 window.
d55e5bfc 12391 """
5b5c9bc7 12392 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
d55e5bfc
RD
12393
12394 def Below(*args, **kwargs):
12395 """
5b5c9bc7 12396 Below(self, Window sibling, int marg=0)
d55e5bfc 12397
15817c7e
RD
12398 Constrains this edge to be below the given window, with an optional
12399 margin. Implicitly, this is relative to the bottom edge of the other
12400 window.
d55e5bfc 12401 """
5b5c9bc7 12402 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
d55e5bfc
RD
12403
12404 def SameAs(*args, **kwargs):
12405 """
5b5c9bc7 12406 SameAs(self, Window otherW, int edge, int marg=0)
d55e5bfc 12407
15817c7e
RD
12408 Constrains this edge or dimension to be to the same as the edge of the
12409 given window, with an optional margin.
d55e5bfc 12410 """
5b5c9bc7 12411 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
d55e5bfc
RD
12412
12413 def PercentOf(*args, **kwargs):
12414 """
5b5c9bc7 12415 PercentOf(self, Window otherW, int wh, int per)
d55e5bfc 12416
15817c7e
RD
12417 Constrains this edge or dimension to be to a percentage of the given
12418 window, with an optional margin.
d55e5bfc 12419 """
5b5c9bc7 12420 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
d55e5bfc
RD
12421
12422 def Absolute(*args, **kwargs):
12423 """
12424 Absolute(self, int val)
12425
15817c7e 12426 Constrains this edge or dimension to be the given absolute value.
d55e5bfc 12427 """
5b5c9bc7 12428 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
d55e5bfc
RD
12429
12430 def Unconstrained(*args, **kwargs):
12431 """
12432 Unconstrained(self)
12433
15817c7e
RD
12434 Sets this edge or dimension to be unconstrained, that is, dependent on
12435 other edges and dimensions from which this value can be deduced.
d55e5bfc 12436 """
5b5c9bc7 12437 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
d55e5bfc
RD
12438
12439 def AsIs(*args, **kwargs):
12440 """
12441 AsIs(self)
12442
15817c7e
RD
12443 Sets this edge or constraint to be whatever the window's value is at
12444 the moment. If either of the width and height constraints are *as is*,
12445 the window will not be resized, but moved instead. This is important
12446 when considering panel items which are intended to have a default
12447 size, such as a button, which may take its size from the size of the
12448 button label.
d55e5bfc 12449 """
5b5c9bc7 12450 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
d55e5bfc
RD
12451
12452 def GetOtherWindow(*args, **kwargs):
5b5c9bc7
RD
12453 """GetOtherWindow(self) -> Window"""
12454 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
d55e5bfc
RD
12455
12456 def GetMyEdge(*args, **kwargs):
12457 """GetMyEdge(self) -> int"""
5b5c9bc7 12458 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
d55e5bfc
RD
12459
12460 def SetEdge(*args, **kwargs):
12461 """SetEdge(self, int which)"""
5b5c9bc7 12462 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
d55e5bfc
RD
12463
12464 def SetValue(*args, **kwargs):
12465 """SetValue(self, int v)"""
5b5c9bc7 12466 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
d55e5bfc
RD
12467
12468 def GetMargin(*args, **kwargs):
12469 """GetMargin(self) -> int"""
5b5c9bc7 12470 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
d55e5bfc
RD
12471
12472 def SetMargin(*args, **kwargs):
12473 """SetMargin(self, int m)"""
5b5c9bc7 12474 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
d55e5bfc
RD
12475
12476 def GetValue(*args, **kwargs):
12477 """GetValue(self) -> int"""
5b5c9bc7 12478 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
d55e5bfc
RD
12479
12480 def GetPercent(*args, **kwargs):
12481 """GetPercent(self) -> int"""
5b5c9bc7 12482 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
d55e5bfc
RD
12483
12484 def GetOtherEdge(*args, **kwargs):
12485 """GetOtherEdge(self) -> int"""
5b5c9bc7 12486 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
d55e5bfc
RD
12487
12488 def GetDone(*args, **kwargs):
12489 """GetDone(self) -> bool"""
5b5c9bc7 12490 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
d55e5bfc
RD
12491
12492 def SetDone(*args, **kwargs):
12493 """SetDone(self, bool d)"""
5b5c9bc7 12494 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
d55e5bfc
RD
12495
12496 def GetRelationship(*args, **kwargs):
12497 """GetRelationship(self) -> int"""
5b5c9bc7 12498 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
d55e5bfc
RD
12499
12500 def SetRelationship(*args, **kwargs):
12501 """SetRelationship(self, int r)"""
5b5c9bc7 12502 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
d55e5bfc
RD
12503
12504 def ResetIfWin(*args, **kwargs):
12505 """
5b5c9bc7 12506 ResetIfWin(self, Window otherW) -> bool
d55e5bfc
RD
12507
12508 Reset constraint if it mentions otherWin
12509 """
5b5c9bc7 12510 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
d55e5bfc
RD
12511
12512 def SatisfyConstraint(*args, **kwargs):
12513 """
5b5c9bc7 12514 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
d55e5bfc
RD
12515
12516 Try to satisfy constraint
12517 """
5b5c9bc7 12518 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
d55e5bfc
RD
12519
12520 def GetEdge(*args, **kwargs):
12521 """
5b5c9bc7 12522 GetEdge(self, int which, Window thisWin, Window other) -> int
d55e5bfc
RD
12523
12524 Get the value of this edge or dimension, or if this
12525 is not determinable, -1.
12526 """
5b5c9bc7 12527 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
d55e5bfc 12528
2131d850 12529_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d55e5bfc 12530
5b5c9bc7 12531class LayoutConstraints(Object):
d55e5bfc 12532 """
15817c7e
RD
12533 **Note:** constraints are now deprecated and you should use sizers
12534 instead.
d55e5bfc 12535
15817c7e
RD
12536 Objects of this class can be associated with a window to define its
12537 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
12538
12539 The class consists of the following eight constraints of class
12540 wx.IndividualLayoutConstraint, some or all of which should be accessed
12541 directly to set the appropriate constraints.
12542
12543 * left: represents the left hand edge of the window
12544 * right: represents the right hand edge of the window
12545 * top: represents the top edge of the window
12546 * bottom: represents the bottom edge of the window
12547 * width: represents the width of the window
12548 * height: represents the height of the window
12549 * centreX: represents the horizontal centre point of the window
12550 * centreY: represents the vertical centre point of the window
12551
15817c7e
RD
12552 Most constraints are initially set to have the relationship
12553 wxUnconstrained, which means that their values should be calculated by
12554 looking at known constraints. The exceptions are width and height,
12555 which are set to wxAsIs to ensure that if the user does not specify a
12556 constraint, the existing width and height will be used, to be
12557 compatible with panel items which often have take a default size. If
12558 the constraint is ``wx.AsIs``, the dimension will not be changed.
12559
12560 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
12561
12562 """
1bd55598
RD
12563 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12564 __repr__ = _swig_repr
5b5c9bc7
RD
12565 left = property(_core_.LayoutConstraints_left_get)
12566 top = property(_core_.LayoutConstraints_top_get)
12567 right = property(_core_.LayoutConstraints_right_get)
12568 bottom = property(_core_.LayoutConstraints_bottom_get)
12569 width = property(_core_.LayoutConstraints_width_get)
12570 height = property(_core_.LayoutConstraints_height_get)
12571 centreX = property(_core_.LayoutConstraints_centreX_get)
12572 centreY = property(_core_.LayoutConstraints_centreY_get)
1bd55598 12573 def __init__(self, *args, **kwargs):
5b5c9bc7 12574 """__init__(self) -> LayoutConstraints"""
1bd55598
RD
12575 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
12576 __swig_destroy__ = _core_.delete_LayoutConstraints
12577 __del__ = lambda self : None;
d55e5bfc
RD
12578 def SatisfyConstraints(*args, **kwargs):
12579 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
5b5c9bc7 12580 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
d55e5bfc
RD
12581
12582 def AreSatisfied(*args, **kwargs):
12583 """AreSatisfied(self) -> bool"""
5b5c9bc7 12584 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
d55e5bfc 12585
2131d850 12586_core_.LayoutConstraints_swigregister(LayoutConstraints)
d55e5bfc
RD
12587
12588#----------------------------------------------------------------------------
12589
12590# Use Python's bool constants if available, make some if not
12591try:
12592 True
12593except NameError:
12594 __builtins__.True = 1==1
12595 __builtins__.False = 1==0
12596 def bool(value): return not not value
12597 __builtins__.bool = bool
12598
12599
12600
12601# workarounds for bad wxRTTI names
12602__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
12603__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
12604__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
12605
12606
12607#----------------------------------------------------------------------------
12608# Load version numbers from __version__... Ensure that major and minor
0f63ec68 12609# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
12610
12611from __version__ import *
12612__version__ = VERSION_STRING
12613
0f63ec68
RD
12614assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
12615assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
12616if RELEASE_VERSION != _core_.RELEASE_VERSION:
12617 import warnings
0f63ec68 12618 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc
RD
12619
12620#----------------------------------------------------------------------------
12621
7993762b
RD
12622# Set wxPython's default string<-->unicode conversion encoding from
12623# the locale, but only if Python's default hasn't been changed. (We
12624# assume that if the user has customized it already then that is the
12625# encoding we need to use as well.)
12626#
12627# The encoding selected here is used when string or unicode objects
12628# need to be converted in order to pass them to wxWidgets. Please be
12629# aware that the default encoding within the same locale may be
12630# slightly different on different platforms. For example, please see
62d32a5f
RD
12631# http://www.alanwood.net/demos/charsetdiffs.html for differences
12632# between the common latin/roman encodings.
3837a853
RD
12633
12634default = _sys.getdefaultencoding()
12635if default == 'ascii':
12636 import locale
12637 import codecs
12638 try:
12639 default = locale.getdefaultlocale()[1]
12640 codecs.lookup(default)
7993762b 12641 except (ValueError, LookupError, TypeError):
3837a853
RD
12642 default = _sys.getdefaultencoding()
12643 del locale
12644 del codecs
5cbf236d
RD
12645if default:
12646 wx.SetDefaultPyEncoding(default)
12647del default
5cbf236d
RD
12648
12649#----------------------------------------------------------------------------
12650
d55e5bfc
RD
12651class PyDeadObjectError(AttributeError):
12652 pass
12653
12654class _wxPyDeadObject(object):
12655 """
12656 Instances of wx objects that are OOR capable will have their __class__
12657 changed to this class when the C++ object is deleted. This should help
12658 prevent crashes due to referencing a bogus C++ pointer.
12659 """
12660 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
12661 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
12662
12663 def __repr__(self):
12664 if not hasattr(self, "_name"):
12665 self._name = "[unknown]"
12666 return self.reprStr % self._name
12667
12668 def __getattr__(self, *args):
12669 if not hasattr(self, "_name"):
12670 self._name = "[unknown]"
12671 raise PyDeadObjectError(self.attrStr % self._name)
12672
12673 def __nonzero__(self):
12674 return 0
12675
12676
12677
12678class PyUnbornObjectError(AttributeError):
12679 pass
12680
12681class _wxPyUnbornObject(object):
12682 """
12683 Some stock objects are created when the wx._core module is
12684 imported, but their C++ instance is not created until the wx.App
12685 object is created and initialized. These object instances will
12686 temporarily have their __class__ changed to this class so an
12687 exception will be raised if they are used before the C++ instance
12688 is ready.
12689 """
12690
12691 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
12692 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
12693
12694 def __repr__(self):
12695 #if not hasattr(self, "_name"):
12696 # self._name = "[unknown]"
12697 return self.reprStr #% self._name
12698
12699 def __getattr__(self, *args):
12700 #if not hasattr(self, "_name"):
12701 # self._name = "[unknown]"
12702 raise PyUnbornObjectError(self.attrStr) # % self._name )
12703
12704 def __nonzero__(self):
12705 return 0
12706
12707
12708#----------------------------------------------------------------------------
d55e5bfc
RD
12709
12710def CallAfter(callable, *args, **kw):
12711 """
12712 Call the specified function after the current and pending event
12713 handlers have been completed. This is also good for making GUI
0439c23b
RD
12714 method calls from non-GUI threads. Any extra positional or
12715 keyword args are passed on to the callable when it is called.
12716
12717 :see: `wx.FutureCall`
d55e5bfc
RD
12718 """
12719 app = wx.GetApp()
a001823c 12720 assert app is not None, 'No wx.App created yet'
d55e5bfc 12721
891bb194
RD
12722 if not hasattr(app, "_CallAfterId"):
12723 app._CallAfterId = wx.NewEventType()
12724 app.Connect(-1, -1, app._CallAfterId,
12725 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 12726 evt = wx.PyEvent()
891bb194 12727 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
12728 evt.callable = callable
12729 evt.args = args
12730 evt.kw = kw
12731 wx.PostEvent(app, evt)
12732
d55e5bfc
RD
12733#----------------------------------------------------------------------------
12734
12735
12736class FutureCall:
12737 """
6e0de3df 12738 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
12739 object once after the given amount of milliseconds, passing any
12740 positional or keyword args. The return value of the callable is
0439c23b 12741 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
12742
12743 If you don't need to get the return value or restart the timer
12744 then there is no need to hold a reference to this object. It will
12745 hold a reference to itself while the timer is running (the timer
12746 has a reference to self.Notify) but the cycle will be broken when
12747 the timer completes, automatically cleaning up the wx.FutureCall
12748 object.
0439c23b
RD
12749
12750 :see: `wx.CallAfter`
d55e5bfc
RD
12751 """
12752 def __init__(self, millis, callable, *args, **kwargs):
12753 self.millis = millis
12754 self.callable = callable
12755 self.SetArgs(*args, **kwargs)
12756 self.runCount = 0
12757 self.running = False
12758 self.hasRun = False
12759 self.result = None
12760 self.timer = None
12761 self.Start()
12762
12763 def __del__(self):
12764 self.Stop()
12765
12766
12767 def Start(self, millis=None, *args, **kwargs):
12768 """
12769 (Re)start the timer
12770 """
12771 self.hasRun = False
12772 if millis is not None:
12773 self.millis = millis
12774 if args or kwargs:
12775 self.SetArgs(*args, **kwargs)
12776 self.Stop()
12777 self.timer = wx.PyTimer(self.Notify)
12778 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
12779 self.running = True
12780 Restart = Start
12781
12782
12783 def Stop(self):
12784 """
12785 Stop and destroy the timer.
12786 """
12787 if self.timer is not None:
12788 self.timer.Stop()
12789 self.timer = None
12790
12791
12792 def GetInterval(self):
12793 if self.timer is not None:
12794 return self.timer.GetInterval()
12795 else:
12796 return 0
12797
12798
12799 def IsRunning(self):
12800 return self.timer is not None and self.timer.IsRunning()
12801
12802
12803 def SetArgs(self, *args, **kwargs):
12804 """
12805 (Re)set the args passed to the callable object. This is
12806 useful in conjunction with Restart if you want to schedule a
12807 new call to the same callable object but with different
12808 parameters.
12809 """
12810 self.args = args
12811 self.kwargs = kwargs
12812
12813
12814 def HasRun(self):
12815 return self.hasRun
12816
12817 def GetResult(self):
12818 return self.result
12819
12820 def Notify(self):
12821 """
12822 The timer has expired so call the callable.
12823 """
12824 if self.callable and getattr(self.callable, 'im_self', True):
12825 self.runCount += 1
12826 self.running = False
12827 self.result = self.callable(*self.args, **self.kwargs)
12828 self.hasRun = True
12829 if not self.running:
12830 # if it wasn't restarted, then cleanup
12831 wx.CallAfter(self.Stop)
12832
12833
12834
12835#----------------------------------------------------------------------------
12836# Control which items in this module should be documented by epydoc.
12837# We allow only classes and functions, which will help reduce the size
12838# of the docs by filtering out the zillions of constants, EVT objects,
12839# and etc that don't make much sense by themselves, but are instead
12840# documented (or will be) as part of the classes/functions/methods
12841# where they should be used.
12842
d6c14a4c
RD
12843class __DocFilter:
12844 """
12845 A filter for epydoc that only allows non-Ptr classes and
12846 fucntions, in order to reduce the clutter in the API docs.
12847 """
12848 def __init__(self, globals):
12849 self._globals = globals
12850
12851 def __call__(self, name):
12852 import types
12853 obj = self._globals.get(name, None)
12854 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
12855 return False
1bd55598 12856 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
d6c14a4c
RD
12857 return False
12858 return True
d55e5bfc
RD
12859
12860#----------------------------------------------------------------------------
12861#----------------------------------------------------------------------------
12862
12863# Import other modules in this package that should show up in the
12864# "core" wx namespace
12865from _gdi import *
12866from _windows import *
12867from _controls import *
12868from _misc import *
12869
d55e5bfc
RD
12870#----------------------------------------------------------------------------
12871#----------------------------------------------------------------------------
12872
12873
32fe5131 12874