]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/gtk/_core.py
mdi fix
[wxWidgets.git] / wxPython / src / gtk / _core.py
CommitLineData
0085ce49 1# This file was created automatically by SWIG 1.3.29.
d14a1e28
RD
2# Don't modify this file, modify the SWIG interface instead.
3
54f9ee45 4import _core_
0085ce49
RD
5import new
6new_instancemethod = new.instancemethod
093d3ff1 7def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
0085ce49 8 if (name == "thisown"): return self.this.own(value)
093d3ff1 9 if (name == "this"):
0085ce49
RD
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
093d3ff1
RD
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
0085ce49 15 if (not static) or hasattr(self,name):
093d3ff1
RD
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
0085ce49 24 if (name == "thisown"): return self.this.own()
093d3ff1
RD
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
0085ce49
RD
29def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
093d3ff1
RD
34import types
35try:
36 _object = types.ObjectType
37 _newclass = 1
38except AttributeError:
39 class _object : pass
40 _newclass = 0
41del types
42
43
44def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
0085ce49
RD
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
093d3ff1
RD
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
d14a1e28
RD
54#// Give a reference to the dictionary of this module to the C++ extension
55#// code.
54f9ee45 56_core_._wxPySetDictionary(vars())
d14a1e28
RD
57
58#// A little trick to make 'wx' be a reference to this module so wx.Names can
59#// be used here.
60import sys as _sys
61wx = _sys.modules[__name__]
62
66c033b4
RD
63
64#----------------------------------------------------------------------------
65
66def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81#----------------------------------------------------------------------------
82
54f9ee45
RD
83NOT_FOUND = _core_.NOT_FOUND
84VSCROLL = _core_.VSCROLL
85HSCROLL = _core_.HSCROLL
86CAPTION = _core_.CAPTION
87DOUBLE_BORDER = _core_.DOUBLE_BORDER
88SUNKEN_BORDER = _core_.SUNKEN_BORDER
89RAISED_BORDER = _core_.RAISED_BORDER
90BORDER = _core_.BORDER
91SIMPLE_BORDER = _core_.SIMPLE_BORDER
92STATIC_BORDER = _core_.STATIC_BORDER
93TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94NO_BORDER = _core_.NO_BORDER
bcd0d7b6 95DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 96DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
54f9ee45
RD
97TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98WANTS_CHARS = _core_.WANTS_CHARS
99POPUP_WINDOW = _core_.POPUP_WINDOW
100CENTER_FRAME = _core_.CENTER_FRAME
101CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
54f9ee45
RD
103CLIP_CHILDREN = _core_.CLIP_CHILDREN
104CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
092f0ed7 105WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
54f9ee45
RD
106ALWAYS_SHOW_SB = _core_.ALWAYS_SHOW_SB
107RETAINED = _core_.RETAINED
108BACKINGSTORE = _core_.BACKINGSTORE
109COLOURED = _core_.COLOURED
110FIXED_LENGTH = _core_.FIXED_LENGTH
111LB_NEEDED_SB = _core_.LB_NEEDED_SB
112LB_ALWAYS_SB = _core_.LB_ALWAYS_SB
113LB_SORT = _core_.LB_SORT
114LB_SINGLE = _core_.LB_SINGLE
115LB_MULTIPLE = _core_.LB_MULTIPLE
116LB_EXTENDED = _core_.LB_EXTENDED
117LB_OWNERDRAW = _core_.LB_OWNERDRAW
118LB_HSCROLL = _core_.LB_HSCROLL
119PROCESS_ENTER = _core_.PROCESS_ENTER
120PASSWORD = _core_.PASSWORD
121CB_SIMPLE = _core_.CB_SIMPLE
122CB_DROPDOWN = _core_.CB_DROPDOWN
123CB_SORT = _core_.CB_SORT
124CB_READONLY = _core_.CB_READONLY
125RA_HORIZONTAL = _core_.RA_HORIZONTAL
126RA_VERTICAL = _core_.RA_VERTICAL
127RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
128RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
fef4c27a 129RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
54f9ee45
RD
130RB_GROUP = _core_.RB_GROUP
131RB_SINGLE = _core_.RB_SINGLE
54f9ee45
RD
132SB_HORIZONTAL = _core_.SB_HORIZONTAL
133SB_VERTICAL = _core_.SB_VERTICAL
fef4c27a 134RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
54f9ee45
RD
135ST_SIZEGRIP = _core_.ST_SIZEGRIP
136ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
e9d6f3a4
RD
137ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
138ST_DOTS_END = _core_.ST_DOTS_END
54f9ee45
RD
139FLOOD_SURFACE = _core_.FLOOD_SURFACE
140FLOOD_BORDER = _core_.FLOOD_BORDER
141ODDEVEN_RULE = _core_.ODDEVEN_RULE
142WINDING_RULE = _core_.WINDING_RULE
143TOOL_TOP = _core_.TOOL_TOP
144TOOL_BOTTOM = _core_.TOOL_BOTTOM
145TOOL_LEFT = _core_.TOOL_LEFT
146TOOL_RIGHT = _core_.TOOL_RIGHT
147OK = _core_.OK
148YES_NO = _core_.YES_NO
149CANCEL = _core_.CANCEL
150YES = _core_.YES
151NO = _core_.NO
152NO_DEFAULT = _core_.NO_DEFAULT
153YES_DEFAULT = _core_.YES_DEFAULT
154ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
155ICON_HAND = _core_.ICON_HAND
156ICON_QUESTION = _core_.ICON_QUESTION
157ICON_INFORMATION = _core_.ICON_INFORMATION
158ICON_STOP = _core_.ICON_STOP
159ICON_ASTERISK = _core_.ICON_ASTERISK
160ICON_MASK = _core_.ICON_MASK
161ICON_WARNING = _core_.ICON_WARNING
162ICON_ERROR = _core_.ICON_ERROR
163FORWARD = _core_.FORWARD
164BACKWARD = _core_.BACKWARD
165RESET = _core_.RESET
166HELP = _core_.HELP
167MORE = _core_.MORE
168SETUP = _core_.SETUP
169SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
170SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
171SIZE_AUTO = _core_.SIZE_AUTO
172SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
173SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
943e8dfd 174SIZE_FORCE = _core_.SIZE_FORCE
54f9ee45
RD
175PORTRAIT = _core_.PORTRAIT
176LANDSCAPE = _core_.LANDSCAPE
177PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
178PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
179PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
180PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
181ID_ANY = _core_.ID_ANY
182ID_SEPARATOR = _core_.ID_SEPARATOR
943e8dfd 183ID_NONE = _core_.ID_NONE
54f9ee45
RD
184ID_LOWEST = _core_.ID_LOWEST
185ID_OPEN = _core_.ID_OPEN
186ID_CLOSE = _core_.ID_CLOSE
187ID_NEW = _core_.ID_NEW
188ID_SAVE = _core_.ID_SAVE
189ID_SAVEAS = _core_.ID_SAVEAS
190ID_REVERT = _core_.ID_REVERT
191ID_EXIT = _core_.ID_EXIT
192ID_UNDO = _core_.ID_UNDO
193ID_REDO = _core_.ID_REDO
194ID_HELP = _core_.ID_HELP
195ID_PRINT = _core_.ID_PRINT
196ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
fc46b7f3 197ID_PAGE_SETUP = _core_.ID_PAGE_SETUP
54f9ee45
RD
198ID_PREVIEW = _core_.ID_PREVIEW
199ID_ABOUT = _core_.ID_ABOUT
200ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
201ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
202ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
203ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
10044bf1
RD
204ID_HELP_INDEX = _core_.ID_HELP_INDEX
205ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
54f9ee45
RD
206ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
207ID_PREFERENCES = _core_.ID_PREFERENCES
97ab0f6a 208ID_EDIT = _core_.ID_EDIT
54f9ee45
RD
209ID_CUT = _core_.ID_CUT
210ID_COPY = _core_.ID_COPY
211ID_PASTE = _core_.ID_PASTE
212ID_CLEAR = _core_.ID_CLEAR
213ID_FIND = _core_.ID_FIND
214ID_DUPLICATE = _core_.ID_DUPLICATE
215ID_SELECTALL = _core_.ID_SELECTALL
216ID_DELETE = _core_.ID_DELETE
217ID_REPLACE = _core_.ID_REPLACE
218ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
219ID_PROPERTIES = _core_.ID_PROPERTIES
220ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
221ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
222ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
223ID_VIEW_LIST = _core_.ID_VIEW_LIST
224ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
225ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
226ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
227ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
97ab0f6a 228ID_FILE = _core_.ID_FILE
54f9ee45
RD
229ID_FILE1 = _core_.ID_FILE1
230ID_FILE2 = _core_.ID_FILE2
231ID_FILE3 = _core_.ID_FILE3
232ID_FILE4 = _core_.ID_FILE4
233ID_FILE5 = _core_.ID_FILE5
234ID_FILE6 = _core_.ID_FILE6
235ID_FILE7 = _core_.ID_FILE7
236ID_FILE8 = _core_.ID_FILE8
237ID_FILE9 = _core_.ID_FILE9
238ID_OK = _core_.ID_OK
239ID_CANCEL = _core_.ID_CANCEL
240ID_APPLY = _core_.ID_APPLY
241ID_YES = _core_.ID_YES
242ID_NO = _core_.ID_NO
243ID_STATIC = _core_.ID_STATIC
244ID_FORWARD = _core_.ID_FORWARD
245ID_BACKWARD = _core_.ID_BACKWARD
246ID_DEFAULT = _core_.ID_DEFAULT
247ID_MORE = _core_.ID_MORE
248ID_SETUP = _core_.ID_SETUP
249ID_RESET = _core_.ID_RESET
250ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
251ID_YESTOALL = _core_.ID_YESTOALL
252ID_NOTOALL = _core_.ID_NOTOALL
253ID_ABORT = _core_.ID_ABORT
254ID_RETRY = _core_.ID_RETRY
255ID_IGNORE = _core_.ID_IGNORE
7bc1e663
RD
256ID_ADD = _core_.ID_ADD
257ID_REMOVE = _core_.ID_REMOVE
258ID_UP = _core_.ID_UP
259ID_DOWN = _core_.ID_DOWN
260ID_HOME = _core_.ID_HOME
261ID_REFRESH = _core_.ID_REFRESH
262ID_STOP = _core_.ID_STOP
263ID_INDEX = _core_.ID_INDEX
264ID_BOLD = _core_.ID_BOLD
265ID_ITALIC = _core_.ID_ITALIC
266ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
267ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
268ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
269ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
270ID_UNDERLINE = _core_.ID_UNDERLINE
271ID_INDENT = _core_.ID_INDENT
272ID_UNINDENT = _core_.ID_UNINDENT
273ID_ZOOM_100 = _core_.ID_ZOOM_100
274ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
275ID_ZOOM_IN = _core_.ID_ZOOM_IN
276ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
277ID_UNDELETE = _core_.ID_UNDELETE
278ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
54f9ee45 279ID_HIGHEST = _core_.ID_HIGHEST
54f9ee45
RD
280MENU_TEAROFF = _core_.MENU_TEAROFF
281MB_DOCKABLE = _core_.MB_DOCKABLE
282NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
283FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
284LI_HORIZONTAL = _core_.LI_HORIZONTAL
285LI_VERTICAL = _core_.LI_VERTICAL
286WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
287WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
288WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
289WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
290WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
291WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
292MM_TEXT = _core_.MM_TEXT
293MM_LOMETRIC = _core_.MM_LOMETRIC
294MM_HIMETRIC = _core_.MM_HIMETRIC
295MM_LOENGLISH = _core_.MM_LOENGLISH
296MM_HIENGLISH = _core_.MM_HIENGLISH
297MM_TWIPS = _core_.MM_TWIPS
298MM_ISOTROPIC = _core_.MM_ISOTROPIC
299MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
300MM_POINTS = _core_.MM_POINTS
301MM_METRIC = _core_.MM_METRIC
302CENTRE = _core_.CENTRE
303CENTER = _core_.CENTER
304HORIZONTAL = _core_.HORIZONTAL
305VERTICAL = _core_.VERTICAL
306BOTH = _core_.BOTH
307LEFT = _core_.LEFT
308RIGHT = _core_.RIGHT
309UP = _core_.UP
310DOWN = _core_.DOWN
311TOP = _core_.TOP
312BOTTOM = _core_.BOTTOM
313NORTH = _core_.NORTH
314SOUTH = _core_.SOUTH
315WEST = _core_.WEST
316EAST = _core_.EAST
317ALL = _core_.ALL
318ALIGN_NOT = _core_.ALIGN_NOT
319ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
320ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
321ALIGN_LEFT = _core_.ALIGN_LEFT
322ALIGN_TOP = _core_.ALIGN_TOP
323ALIGN_RIGHT = _core_.ALIGN_RIGHT
324ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
325ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
326ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
327ALIGN_CENTER = _core_.ALIGN_CENTER
328ALIGN_CENTRE = _core_.ALIGN_CENTRE
329ALIGN_MASK = _core_.ALIGN_MASK
330STRETCH_NOT = _core_.STRETCH_NOT
331SHRINK = _core_.SHRINK
332GROW = _core_.GROW
333EXPAND = _core_.EXPAND
334SHAPED = _core_.SHAPED
335FIXED_MINSIZE = _core_.FIXED_MINSIZE
336TILE = _core_.TILE
337ADJUST_MINSIZE = _core_.ADJUST_MINSIZE
338BORDER_DEFAULT = _core_.BORDER_DEFAULT
339BORDER_NONE = _core_.BORDER_NONE
340BORDER_STATIC = _core_.BORDER_STATIC
341BORDER_SIMPLE = _core_.BORDER_SIMPLE
342BORDER_RAISED = _core_.BORDER_RAISED
343BORDER_SUNKEN = _core_.BORDER_SUNKEN
344BORDER_DOUBLE = _core_.BORDER_DOUBLE
345BORDER_MASK = _core_.BORDER_MASK
7bc1e663
RD
346BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
347BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
348BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
54f9ee45
RD
349DEFAULT = _core_.DEFAULT
350DECORATIVE = _core_.DECORATIVE
351ROMAN = _core_.ROMAN
352SCRIPT = _core_.SCRIPT
353SWISS = _core_.SWISS
354MODERN = _core_.MODERN
355TELETYPE = _core_.TELETYPE
356VARIABLE = _core_.VARIABLE
357FIXED = _core_.FIXED
358NORMAL = _core_.NORMAL
359LIGHT = _core_.LIGHT
360BOLD = _core_.BOLD
361ITALIC = _core_.ITALIC
362SLANT = _core_.SLANT
363SOLID = _core_.SOLID
364DOT = _core_.DOT
365LONG_DASH = _core_.LONG_DASH
366SHORT_DASH = _core_.SHORT_DASH
367DOT_DASH = _core_.DOT_DASH
368USER_DASH = _core_.USER_DASH
369TRANSPARENT = _core_.TRANSPARENT
370STIPPLE = _core_.STIPPLE
d04418a7
RD
371STIPPLE_MASK = _core_.STIPPLE_MASK
372STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
54f9ee45
RD
373BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
374CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
375FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
376CROSS_HATCH = _core_.CROSS_HATCH
377HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
378VERTICAL_HATCH = _core_.VERTICAL_HATCH
379JOIN_BEVEL = _core_.JOIN_BEVEL
380JOIN_MITER = _core_.JOIN_MITER
381JOIN_ROUND = _core_.JOIN_ROUND
382CAP_ROUND = _core_.CAP_ROUND
383CAP_PROJECTING = _core_.CAP_PROJECTING
384CAP_BUTT = _core_.CAP_BUTT
385CLEAR = _core_.CLEAR
386XOR = _core_.XOR
387INVERT = _core_.INVERT
388OR_REVERSE = _core_.OR_REVERSE
389AND_REVERSE = _core_.AND_REVERSE
390COPY = _core_.COPY
391AND = _core_.AND
392AND_INVERT = _core_.AND_INVERT
393NO_OP = _core_.NO_OP
394NOR = _core_.NOR
395EQUIV = _core_.EQUIV
396SRC_INVERT = _core_.SRC_INVERT
397OR_INVERT = _core_.OR_INVERT
398NAND = _core_.NAND
399OR = _core_.OR
400SET = _core_.SET
401WXK_BACK = _core_.WXK_BACK
402WXK_TAB = _core_.WXK_TAB
403WXK_RETURN = _core_.WXK_RETURN
404WXK_ESCAPE = _core_.WXK_ESCAPE
405WXK_SPACE = _core_.WXK_SPACE
406WXK_DELETE = _core_.WXK_DELETE
407WXK_START = _core_.WXK_START
408WXK_LBUTTON = _core_.WXK_LBUTTON
409WXK_RBUTTON = _core_.WXK_RBUTTON
410WXK_CANCEL = _core_.WXK_CANCEL
411WXK_MBUTTON = _core_.WXK_MBUTTON
412WXK_CLEAR = _core_.WXK_CLEAR
413WXK_SHIFT = _core_.WXK_SHIFT
414WXK_ALT = _core_.WXK_ALT
415WXK_CONTROL = _core_.WXK_CONTROL
416WXK_MENU = _core_.WXK_MENU
417WXK_PAUSE = _core_.WXK_PAUSE
418WXK_CAPITAL = _core_.WXK_CAPITAL
419WXK_PRIOR = _core_.WXK_PRIOR
420WXK_NEXT = _core_.WXK_NEXT
421WXK_END = _core_.WXK_END
422WXK_HOME = _core_.WXK_HOME
423WXK_LEFT = _core_.WXK_LEFT
424WXK_UP = _core_.WXK_UP
425WXK_RIGHT = _core_.WXK_RIGHT
426WXK_DOWN = _core_.WXK_DOWN
427WXK_SELECT = _core_.WXK_SELECT
428WXK_PRINT = _core_.WXK_PRINT
429WXK_EXECUTE = _core_.WXK_EXECUTE
430WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
431WXK_INSERT = _core_.WXK_INSERT
432WXK_HELP = _core_.WXK_HELP
433WXK_NUMPAD0 = _core_.WXK_NUMPAD0
434WXK_NUMPAD1 = _core_.WXK_NUMPAD1
435WXK_NUMPAD2 = _core_.WXK_NUMPAD2
436WXK_NUMPAD3 = _core_.WXK_NUMPAD3
437WXK_NUMPAD4 = _core_.WXK_NUMPAD4
438WXK_NUMPAD5 = _core_.WXK_NUMPAD5
439WXK_NUMPAD6 = _core_.WXK_NUMPAD6
440WXK_NUMPAD7 = _core_.WXK_NUMPAD7
441WXK_NUMPAD8 = _core_.WXK_NUMPAD8
442WXK_NUMPAD9 = _core_.WXK_NUMPAD9
443WXK_MULTIPLY = _core_.WXK_MULTIPLY
444WXK_ADD = _core_.WXK_ADD
445WXK_SEPARATOR = _core_.WXK_SEPARATOR
446WXK_SUBTRACT = _core_.WXK_SUBTRACT
447WXK_DECIMAL = _core_.WXK_DECIMAL
448WXK_DIVIDE = _core_.WXK_DIVIDE
449WXK_F1 = _core_.WXK_F1
450WXK_F2 = _core_.WXK_F2
451WXK_F3 = _core_.WXK_F3
452WXK_F4 = _core_.WXK_F4
453WXK_F5 = _core_.WXK_F5
454WXK_F6 = _core_.WXK_F6
455WXK_F7 = _core_.WXK_F7
456WXK_F8 = _core_.WXK_F8
457WXK_F9 = _core_.WXK_F9
458WXK_F10 = _core_.WXK_F10
459WXK_F11 = _core_.WXK_F11
460WXK_F12 = _core_.WXK_F12
461WXK_F13 = _core_.WXK_F13
462WXK_F14 = _core_.WXK_F14
463WXK_F15 = _core_.WXK_F15
464WXK_F16 = _core_.WXK_F16
465WXK_F17 = _core_.WXK_F17
466WXK_F18 = _core_.WXK_F18
467WXK_F19 = _core_.WXK_F19
468WXK_F20 = _core_.WXK_F20
469WXK_F21 = _core_.WXK_F21
470WXK_F22 = _core_.WXK_F22
471WXK_F23 = _core_.WXK_F23
472WXK_F24 = _core_.WXK_F24
473WXK_NUMLOCK = _core_.WXK_NUMLOCK
474WXK_SCROLL = _core_.WXK_SCROLL
475WXK_PAGEUP = _core_.WXK_PAGEUP
476WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
477WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
478WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
479WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
480WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
481WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
482WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
483WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
484WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
485WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
486WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
487WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
488WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
489WXK_NUMPAD_PRIOR = _core_.WXK_NUMPAD_PRIOR
490WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
491WXK_NUMPAD_NEXT = _core_.WXK_NUMPAD_NEXT
492WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
493WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
494WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
495WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
496WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
497WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
498WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
499WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
500WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
501WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
502WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
503WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
504WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
505WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
506WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
88c6b281
RD
507WXK_COMMAND = _core_.WXK_COMMAND
508WXK_SPECIAL1 = _core_.WXK_SPECIAL1
509WXK_SPECIAL2 = _core_.WXK_SPECIAL2
510WXK_SPECIAL3 = _core_.WXK_SPECIAL3
511WXK_SPECIAL4 = _core_.WXK_SPECIAL4
512WXK_SPECIAL5 = _core_.WXK_SPECIAL5
513WXK_SPECIAL6 = _core_.WXK_SPECIAL6
514WXK_SPECIAL7 = _core_.WXK_SPECIAL7
515WXK_SPECIAL8 = _core_.WXK_SPECIAL8
516WXK_SPECIAL9 = _core_.WXK_SPECIAL9
517WXK_SPECIAL10 = _core_.WXK_SPECIAL10
518WXK_SPECIAL11 = _core_.WXK_SPECIAL11
519WXK_SPECIAL12 = _core_.WXK_SPECIAL12
520WXK_SPECIAL13 = _core_.WXK_SPECIAL13
521WXK_SPECIAL14 = _core_.WXK_SPECIAL14
522WXK_SPECIAL15 = _core_.WXK_SPECIAL15
523WXK_SPECIAL16 = _core_.WXK_SPECIAL16
524WXK_SPECIAL17 = _core_.WXK_SPECIAL17
525WXK_SPECIAL18 = _core_.WXK_SPECIAL18
526WXK_SPECIAL19 = _core_.WXK_SPECIAL19
527WXK_SPECIAL20 = _core_.WXK_SPECIAL20
54f9ee45
RD
528PAPER_NONE = _core_.PAPER_NONE
529PAPER_LETTER = _core_.PAPER_LETTER
530PAPER_LEGAL = _core_.PAPER_LEGAL
531PAPER_A4 = _core_.PAPER_A4
532PAPER_CSHEET = _core_.PAPER_CSHEET
533PAPER_DSHEET = _core_.PAPER_DSHEET
534PAPER_ESHEET = _core_.PAPER_ESHEET
535PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
536PAPER_TABLOID = _core_.PAPER_TABLOID
537PAPER_LEDGER = _core_.PAPER_LEDGER
538PAPER_STATEMENT = _core_.PAPER_STATEMENT
539PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
540PAPER_A3 = _core_.PAPER_A3
541PAPER_A4SMALL = _core_.PAPER_A4SMALL
542PAPER_A5 = _core_.PAPER_A5
543PAPER_B4 = _core_.PAPER_B4
544PAPER_B5 = _core_.PAPER_B5
545PAPER_FOLIO = _core_.PAPER_FOLIO
546PAPER_QUARTO = _core_.PAPER_QUARTO
547PAPER_10X14 = _core_.PAPER_10X14
548PAPER_11X17 = _core_.PAPER_11X17
549PAPER_NOTE = _core_.PAPER_NOTE
550PAPER_ENV_9 = _core_.PAPER_ENV_9
551PAPER_ENV_10 = _core_.PAPER_ENV_10
552PAPER_ENV_11 = _core_.PAPER_ENV_11
553PAPER_ENV_12 = _core_.PAPER_ENV_12
554PAPER_ENV_14 = _core_.PAPER_ENV_14
555PAPER_ENV_DL = _core_.PAPER_ENV_DL
556PAPER_ENV_C5 = _core_.PAPER_ENV_C5
557PAPER_ENV_C3 = _core_.PAPER_ENV_C3
558PAPER_ENV_C4 = _core_.PAPER_ENV_C4
559PAPER_ENV_C6 = _core_.PAPER_ENV_C6
560PAPER_ENV_C65 = _core_.PAPER_ENV_C65
561PAPER_ENV_B4 = _core_.PAPER_ENV_B4
562PAPER_ENV_B5 = _core_.PAPER_ENV_B5
563PAPER_ENV_B6 = _core_.PAPER_ENV_B6
564PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
565PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
566PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
567PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
568PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
569PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
570PAPER_ISO_B4 = _core_.PAPER_ISO_B4
571PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
572PAPER_9X11 = _core_.PAPER_9X11
573PAPER_10X11 = _core_.PAPER_10X11
574PAPER_15X11 = _core_.PAPER_15X11
575PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
576PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
577PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
578PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
579PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
580PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
581PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
582PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
583PAPER_A_PLUS = _core_.PAPER_A_PLUS
584PAPER_B_PLUS = _core_.PAPER_B_PLUS
585PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
586PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
587PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
588PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
589PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
590PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
591PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
592PAPER_A2 = _core_.PAPER_A2
593PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
594PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
6c75a4cf
RD
595PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
596PAPER_A6 = _core_.PAPER_A6
597PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
598PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
599PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
600PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
601PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
602PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
603PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
604PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
605PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
606PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
607PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
608PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
609PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
610PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
611PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
612PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
613PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
614PAPER_B6_JIS = _core_.PAPER_B6_JIS
615PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
616PAPER_12X11 = _core_.PAPER_12X11
617PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
618PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
619PAPER_P16K = _core_.PAPER_P16K
620PAPER_P32K = _core_.PAPER_P32K
621PAPER_P32KBIG = _core_.PAPER_P32KBIG
622PAPER_PENV_1 = _core_.PAPER_PENV_1
623PAPER_PENV_2 = _core_.PAPER_PENV_2
624PAPER_PENV_3 = _core_.PAPER_PENV_3
625PAPER_PENV_4 = _core_.PAPER_PENV_4
626PAPER_PENV_5 = _core_.PAPER_PENV_5
627PAPER_PENV_6 = _core_.PAPER_PENV_6
628PAPER_PENV_7 = _core_.PAPER_PENV_7
629PAPER_PENV_8 = _core_.PAPER_PENV_8
630PAPER_PENV_9 = _core_.PAPER_PENV_9
631PAPER_PENV_10 = _core_.PAPER_PENV_10
632PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
633PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
634PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
635PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
636PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
637PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
638PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
639PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
640PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
641PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
642PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
643PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
644PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
54f9ee45
RD
645DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
646DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
647DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
648ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
649ITEM_NORMAL = _core_.ITEM_NORMAL
650ITEM_CHECK = _core_.ITEM_CHECK
651ITEM_RADIO = _core_.ITEM_RADIO
652ITEM_MAX = _core_.ITEM_MAX
653HT_NOWHERE = _core_.HT_NOWHERE
654HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
655HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
656HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
657HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
658HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
659HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
660HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
661HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
662HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
663HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
664HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
665HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
666HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
667HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
668HT_MAX = _core_.HT_MAX
669MOD_NONE = _core_.MOD_NONE
670MOD_ALT = _core_.MOD_ALT
671MOD_CONTROL = _core_.MOD_CONTROL
943e8dfd 672MOD_ALTGR = _core_.MOD_ALTGR
54f9ee45 673MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 674MOD_META = _core_.MOD_META
54f9ee45 675MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
676MOD_CMD = _core_.MOD_CMD
677MOD_ALL = _core_.MOD_ALL
54f9ee45
RD
678UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
679UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
680UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
d14a1e28
RD
681#---------------------------------------------------------------------------
682
683class Object(object):
0df68c9f
RD
684 """
685 The base class for most wx objects, although in wxPython not
686 much functionality is needed nor exposed.
687 """
0085ce49
RD
688 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
689 def __init__(self): raise AttributeError, "No constructor defined"
690 __repr__ = _swig_repr
e811c8ce 691 def GetClassName(*args, **kwargs):
0df68c9f 692 """
a95a7133 693 GetClassName(self) -> String
e811c8ce 694
a95a7133 695 Returns the class name of the C++ class using wxRTTI.
0df68c9f 696 """
54f9ee45 697 return _core_.Object_GetClassName(*args, **kwargs)
e811c8ce
RD
698
699 def Destroy(*args, **kwargs):
0df68c9f 700 """
a95a7133 701 Destroy(self)
e811c8ce 702
0df68c9f
RD
703 Deletes the C++ object this Python object is a proxy for.
704 """
7e08d4ef
RD
705 val = _core_.Object_Destroy(*args, **kwargs)
706 args[0].thisown = 0
707 return val
e811c8ce 708
2131d850 709_core_.Object_swigregister(Object)
54f9ee45 710_wxPySetDictionary = _core_._wxPySetDictionary
54f9ee45 711cvar = _core_.cvar
196addbf 712EmptyString = cvar.EmptyString
d14a1e28
RD
713
714#---------------------------------------------------------------------------
715
54f9ee45
RD
716BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
717BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
718BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
719BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
720BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
721BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
722BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
723BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
724BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
725BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
726BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
727BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
728BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
729BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
730BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
731BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
732BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
733BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
734BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
735BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
736CURSOR_NONE = _core_.CURSOR_NONE
737CURSOR_ARROW = _core_.CURSOR_ARROW
738CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
739CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
740CURSOR_CHAR = _core_.CURSOR_CHAR
741CURSOR_CROSS = _core_.CURSOR_CROSS
742CURSOR_HAND = _core_.CURSOR_HAND
743CURSOR_IBEAM = _core_.CURSOR_IBEAM
744CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
745CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
746CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
747CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
748CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
749CURSOR_PENCIL = _core_.CURSOR_PENCIL
750CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
751CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
752CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
753CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
754CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
755CURSOR_SIZENS = _core_.CURSOR_SIZENS
756CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
757CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
758CURSOR_SIZING = _core_.CURSOR_SIZING
759CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
760CURSOR_WAIT = _core_.CURSOR_WAIT
761CURSOR_WATCH = _core_.CURSOR_WATCH
762CURSOR_BLANK = _core_.CURSOR_BLANK
763CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
764CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
765CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
766CURSOR_MAX = _core_.CURSOR_MAX
d14a1e28
RD
767#---------------------------------------------------------------------------
768
769class Size(object):
0df68c9f 770 """
41e2b43e 771 wx.Size is a useful data structure used to represent the size of
0085ce49
RD
772 something. It simply contains integer width and height
773 properties. In most places in wxPython where a wx.Size is
093d3ff1 774 expected a (width, height) tuple can be used instead.
0df68c9f 775 """
0085ce49
RD
776 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
777 __repr__ = _swig_repr
54f9ee45
RD
778 width = property(_core_.Size_width_get, _core_.Size_width_set)
779 height = property(_core_.Size_height_get, _core_.Size_height_set)
242b7b46 780 x = width; y = height
0085ce49 781 def __init__(self, *args, **kwargs):
0df68c9f 782 """
a95a7133 783 __init__(self, int w=0, int h=0) -> Size
e811c8ce 784
0df68c9f
RD
785 Creates a size object.
786 """
0085ce49
RD
787 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
788 __swig_destroy__ = _core_.delete_Size
789 __del__ = lambda self : None;
e811c8ce 790 def __eq__(*args, **kwargs):
0df68c9f 791 """
e9d6f3a4 792 __eq__(self, PyObject other) -> bool
e811c8ce 793
0df68c9f
RD
794 Test for equality of wx.Size objects.
795 """
54f9ee45 796 return _core_.Size___eq__(*args, **kwargs)
e811c8ce
RD
797
798 def __ne__(*args, **kwargs):
0df68c9f 799 """
e9d6f3a4 800 __ne__(self, PyObject other) -> bool
e811c8ce 801
e9d6f3a4 802 Test for inequality of wx.Size objects.
0df68c9f 803 """
54f9ee45 804 return _core_.Size___ne__(*args, **kwargs)
e811c8ce
RD
805
806 def __add__(*args, **kwargs):
0df68c9f 807 """
a95a7133 808 __add__(self, Size sz) -> Size
e811c8ce 809
0df68c9f
RD
810 Add sz's proprties to this and return the result.
811 """
54f9ee45 812 return _core_.Size___add__(*args, **kwargs)
e811c8ce
RD
813
814 def __sub__(*args, **kwargs):
0df68c9f 815 """
a95a7133 816 __sub__(self, Size sz) -> Size
e811c8ce 817
0df68c9f
RD
818 Subtract sz's properties from this and return the result.
819 """
54f9ee45 820 return _core_.Size___sub__(*args, **kwargs)
e811c8ce
RD
821
822 def IncTo(*args, **kwargs):
0df68c9f 823 """
a95a7133 824 IncTo(self, Size sz)
e811c8ce 825
0df68c9f
RD
826 Increments this object so that both of its dimensions are not less
827 than the corresponding dimensions of the size.
828 """
54f9ee45 829 return _core_.Size_IncTo(*args, **kwargs)
e811c8ce
RD
830
831 def DecTo(*args, **kwargs):
0df68c9f 832 """
a95a7133 833 DecTo(self, Size sz)
e811c8ce 834
0df68c9f
RD
835 Decrements this object so that both of its dimensions are not greater
836 than the corresponding dimensions of the size.
837 """
54f9ee45 838 return _core_.Size_DecTo(*args, **kwargs)
e811c8ce 839
10044bf1
RD
840 def Scale(*args, **kwargs):
841 """
842 Scale(self, float xscale, float yscale)
843
844 Scales the dimensions of this object by the given factors.
845 """
846 return _core_.Size_Scale(*args, **kwargs)
847
e811c8ce 848 def Set(*args, **kwargs):
0df68c9f 849 """
a95a7133 850 Set(self, int w, int h)
e811c8ce 851
0df68c9f
RD
852 Set both width and height.
853 """
54f9ee45 854 return _core_.Size_Set(*args, **kwargs)
e811c8ce
RD
855
856 def SetWidth(*args, **kwargs):
a95a7133 857 """SetWidth(self, int w)"""
54f9ee45 858 return _core_.Size_SetWidth(*args, **kwargs)
e811c8ce
RD
859
860 def SetHeight(*args, **kwargs):
a95a7133 861 """SetHeight(self, int h)"""
54f9ee45 862 return _core_.Size_SetHeight(*args, **kwargs)
e811c8ce
RD
863
864 def GetWidth(*args, **kwargs):
a95a7133 865 """GetWidth(self) -> int"""
54f9ee45 866 return _core_.Size_GetWidth(*args, **kwargs)
e811c8ce
RD
867
868 def GetHeight(*args, **kwargs):
a95a7133 869 """GetHeight(self) -> int"""
54f9ee45 870 return _core_.Size_GetHeight(*args, **kwargs)
e811c8ce 871
74a57fcd
RD
872 def IsFullySpecified(*args, **kwargs):
873 """
a95a7133 874 IsFullySpecified(self) -> bool
74a57fcd
RD
875
876 Returns True if both components of the size are non-default values.
877 """
54f9ee45 878 return _core_.Size_IsFullySpecified(*args, **kwargs)
74a57fcd
RD
879
880 def SetDefaults(*args, **kwargs):
881 """
a95a7133 882 SetDefaults(self, Size size)
74a57fcd 883
41e2b43e
RD
884 Combine this size with the other one replacing the default components
885 of this object (i.e. equal to -1) with those of the other.
74a57fcd 886 """
54f9ee45 887 return _core_.Size_SetDefaults(*args, **kwargs)
74a57fcd 888
e811c8ce 889 def Get(*args, **kwargs):
0df68c9f
RD
890 """
891 Get() -> (width,height)
e811c8ce 892
0df68c9f
RD
893 Returns the width and height properties as a tuple.
894 """
54f9ee45 895 return _core_.Size_Get(*args, **kwargs)
e811c8ce 896
41e2b43e 897 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
898 def __str__(self): return str(self.Get())
899 def __repr__(self): return 'wx.Size'+str(self.Get())
900 def __len__(self): return len(self.Get())
901 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
902 def __setitem__(self, index, val):
903 if index == 0: self.width = val
904 elif index == 1: self.height = val
905 else: raise IndexError
e811c8ce 906 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
907 __safe_for_unpickling__ = True
908 def __reduce__(self): return (wx.Size, self.Get())
d14a1e28 909
2131d850 910_core_.Size_swigregister(Size)
d14a1e28
RD
911
912#---------------------------------------------------------------------------
913
914class RealPoint(object):
0df68c9f 915 """
41e2b43e
RD
916 A data structure for representing a point or position with floating
917 point x and y properties. In wxPython most places that expect a
918 wx.RealPoint can also accept a (x,y) tuple.
0df68c9f 919 """
0085ce49
RD
920 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
921 __repr__ = _swig_repr
54f9ee45
RD
922 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
923 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
0085ce49 924 def __init__(self, *args, **kwargs):
0df68c9f 925 """
a95a7133 926 __init__(self, double x=0.0, double y=0.0) -> RealPoint
e811c8ce 927
0df68c9f
RD
928 Create a wx.RealPoint object
929 """
0085ce49
RD
930 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
931 __swig_destroy__ = _core_.delete_RealPoint
932 __del__ = lambda self : None;
e811c8ce 933 def __eq__(*args, **kwargs):
0df68c9f 934 """
e9d6f3a4 935 __eq__(self, PyObject other) -> bool
e811c8ce 936
0df68c9f
RD
937 Test for equality of wx.RealPoint objects.
938 """
54f9ee45 939 return _core_.RealPoint___eq__(*args, **kwargs)
e811c8ce
RD
940
941 def __ne__(*args, **kwargs):
0df68c9f 942 """
e9d6f3a4 943 __ne__(self, PyObject other) -> bool
e811c8ce 944
0df68c9f
RD
945 Test for inequality of wx.RealPoint objects.
946 """
54f9ee45 947 return _core_.RealPoint___ne__(*args, **kwargs)
e811c8ce
RD
948
949 def __add__(*args, **kwargs):
0df68c9f 950 """
a95a7133 951 __add__(self, RealPoint pt) -> RealPoint
e811c8ce 952
0df68c9f
RD
953 Add pt's proprties to this and return the result.
954 """
54f9ee45 955 return _core_.RealPoint___add__(*args, **kwargs)
e811c8ce
RD
956
957 def __sub__(*args, **kwargs):
0df68c9f 958 """
a95a7133 959 __sub__(self, RealPoint pt) -> RealPoint
e811c8ce 960
0df68c9f
RD
961 Subtract pt's proprties from this and return the result
962 """
54f9ee45 963 return _core_.RealPoint___sub__(*args, **kwargs)
e811c8ce
RD
964
965 def Set(*args, **kwargs):
0df68c9f 966 """
a95a7133 967 Set(self, double x, double y)
e811c8ce 968
0df68c9f
RD
969 Set both the x and y properties
970 """
54f9ee45 971 return _core_.RealPoint_Set(*args, **kwargs)
e811c8ce
RD
972
973 def Get(*args, **kwargs):
0df68c9f
RD
974 """
975 Get() -> (x,y)
e811c8ce 976
0df68c9f
RD
977 Return the x and y properties as a tuple.
978 """
54f9ee45 979 return _core_.RealPoint_Get(*args, **kwargs)
e811c8ce 980
41e2b43e 981 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
982 def __str__(self): return str(self.Get())
983 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
984 def __len__(self): return len(self.Get())
985 def __getitem__(self, index): return self.Get()[index]
d14a1e28 986 def __setitem__(self, index, val):
e811c8ce
RD
987 if index == 0: self.x = val
988 elif index == 1: self.y = val
d14a1e28 989 else: raise IndexError
e811c8ce 990 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
991 __safe_for_unpickling__ = True
992 def __reduce__(self): return (wx.RealPoint, self.Get())
d14a1e28 993
2131d850 994_core_.RealPoint_swigregister(RealPoint)
d14a1e28
RD
995
996#---------------------------------------------------------------------------
997
998class Point(object):
0df68c9f 999 """
41e2b43e
RD
1000 A data structure for representing a point or position with integer x
1001 and y properties. Most places in wxPython that expect a wx.Point can
1002 also accept a (x,y) tuple.
0df68c9f 1003 """
0085ce49
RD
1004 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1005 __repr__ = _swig_repr
54f9ee45
RD
1006 x = property(_core_.Point_x_get, _core_.Point_x_set)
1007 y = property(_core_.Point_y_get, _core_.Point_y_set)
0085ce49 1008 def __init__(self, *args, **kwargs):
0df68c9f 1009 """
a95a7133 1010 __init__(self, int x=0, int y=0) -> Point
e811c8ce 1011
0df68c9f
RD
1012 Create a wx.Point object
1013 """
0085ce49
RD
1014 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1015 __swig_destroy__ = _core_.delete_Point
1016 __del__ = lambda self : None;
e811c8ce 1017 def __eq__(*args, **kwargs):
0df68c9f 1018 """
e9d6f3a4 1019 __eq__(self, PyObject other) -> bool
e811c8ce 1020
0df68c9f
RD
1021 Test for equality of wx.Point objects.
1022 """
54f9ee45 1023 return _core_.Point___eq__(*args, **kwargs)
e811c8ce
RD
1024
1025 def __ne__(*args, **kwargs):
0df68c9f 1026 """
e9d6f3a4 1027 __ne__(self, PyObject other) -> bool
e811c8ce 1028
0df68c9f
RD
1029 Test for inequality of wx.Point objects.
1030 """
54f9ee45 1031 return _core_.Point___ne__(*args, **kwargs)
e811c8ce
RD
1032
1033 def __add__(*args, **kwargs):
0df68c9f 1034 """
a95a7133 1035 __add__(self, Point pt) -> Point
e811c8ce 1036
0df68c9f
RD
1037 Add pt's proprties to this and return the result.
1038 """
54f9ee45 1039 return _core_.Point___add__(*args, **kwargs)
e811c8ce
RD
1040
1041 def __sub__(*args, **kwargs):
0df68c9f 1042 """
a95a7133 1043 __sub__(self, Point pt) -> Point
e811c8ce 1044
0df68c9f
RD
1045 Subtract pt's proprties from this and return the result
1046 """
54f9ee45 1047 return _core_.Point___sub__(*args, **kwargs)
e811c8ce
RD
1048
1049 def __iadd__(*args, **kwargs):
0df68c9f 1050 """
a95a7133 1051 __iadd__(self, Point pt) -> Point
e811c8ce 1052
0df68c9f
RD
1053 Add pt to this object.
1054 """
54f9ee45 1055 return _core_.Point___iadd__(*args, **kwargs)
e811c8ce
RD
1056
1057 def __isub__(*args, **kwargs):
0df68c9f 1058 """
a95a7133 1059 __isub__(self, Point pt) -> Point
e811c8ce 1060
0df68c9f
RD
1061 Subtract pt from this object.
1062 """
54f9ee45 1063 return _core_.Point___isub__(*args, **kwargs)
e811c8ce
RD
1064
1065 def Set(*args, **kwargs):
0df68c9f 1066 """
a95a7133 1067 Set(self, long x, long y)
e811c8ce 1068
0df68c9f
RD
1069 Set both the x and y properties
1070 """
54f9ee45 1071 return _core_.Point_Set(*args, **kwargs)
e811c8ce
RD
1072
1073 def Get(*args, **kwargs):
0df68c9f
RD
1074 """
1075 Get() -> (x,y)
e811c8ce 1076
0df68c9f
RD
1077 Return the x and y properties as a tuple.
1078 """
54f9ee45 1079 return _core_.Point_Get(*args, **kwargs)
e811c8ce 1080
41e2b43e 1081 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1082 def __str__(self): return str(self.Get())
1083 def __repr__(self): return 'wx.Point'+str(self.Get())
1084 def __len__(self): return len(self.Get())
1085 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1086 def __setitem__(self, index, val):
1087 if index == 0: self.x = val
1088 elif index == 1: self.y = val
1089 else: raise IndexError
e811c8ce 1090 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
1091 __safe_for_unpickling__ = True
1092 def __reduce__(self): return (wx.Point, self.Get())
d14a1e28 1093
2131d850 1094_core_.Point_swigregister(Point)
d14a1e28
RD
1095
1096#---------------------------------------------------------------------------
1097
1098class Rect(object):
0df68c9f 1099 """
41e2b43e
RD
1100 A class for representing and manipulating rectangles. It has x, y,
1101 width and height properties. In wxPython most palces that expect a
1102 wx.Rect can also accept a (x,y,width,height) tuple.
0df68c9f 1103 """
0085ce49
RD
1104 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1105 __repr__ = _swig_repr
1106 def __init__(self, *args, **kwargs):
0df68c9f 1107 """
a95a7133 1108 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
e811c8ce 1109
0df68c9f
RD
1110 Create a new Rect object.
1111 """
0085ce49
RD
1112 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1113 __swig_destroy__ = _core_.delete_Rect
1114 __del__ = lambda self : None;
e811c8ce 1115 def GetX(*args, **kwargs):
a95a7133 1116 """GetX(self) -> int"""
54f9ee45 1117 return _core_.Rect_GetX(*args, **kwargs)
e811c8ce
RD
1118
1119 def SetX(*args, **kwargs):
a95a7133 1120 """SetX(self, int x)"""
54f9ee45 1121 return _core_.Rect_SetX(*args, **kwargs)
e811c8ce
RD
1122
1123 def GetY(*args, **kwargs):
a95a7133 1124 """GetY(self) -> int"""
54f9ee45 1125 return _core_.Rect_GetY(*args, **kwargs)
e811c8ce
RD
1126
1127 def SetY(*args, **kwargs):
a95a7133 1128 """SetY(self, int y)"""
54f9ee45 1129 return _core_.Rect_SetY(*args, **kwargs)
e811c8ce
RD
1130
1131 def GetWidth(*args, **kwargs):
a95a7133 1132 """GetWidth(self) -> int"""
54f9ee45 1133 return _core_.Rect_GetWidth(*args, **kwargs)
e811c8ce
RD
1134
1135 def SetWidth(*args, **kwargs):
a95a7133 1136 """SetWidth(self, int w)"""
54f9ee45 1137 return _core_.Rect_SetWidth(*args, **kwargs)
e811c8ce
RD
1138
1139 def GetHeight(*args, **kwargs):
a95a7133 1140 """GetHeight(self) -> int"""
54f9ee45 1141 return _core_.Rect_GetHeight(*args, **kwargs)
e811c8ce
RD
1142
1143 def SetHeight(*args, **kwargs):
a95a7133 1144 """SetHeight(self, int h)"""
54f9ee45 1145 return _core_.Rect_SetHeight(*args, **kwargs)
e811c8ce
RD
1146
1147 def GetPosition(*args, **kwargs):
a95a7133 1148 """GetPosition(self) -> Point"""
54f9ee45 1149 return _core_.Rect_GetPosition(*args, **kwargs)
e811c8ce
RD
1150
1151 def SetPosition(*args, **kwargs):
a95a7133 1152 """SetPosition(self, Point p)"""
54f9ee45 1153 return _core_.Rect_SetPosition(*args, **kwargs)
e811c8ce
RD
1154
1155 def GetSize(*args, **kwargs):
a95a7133 1156 """GetSize(self) -> Size"""
54f9ee45 1157 return _core_.Rect_GetSize(*args, **kwargs)
e811c8ce
RD
1158
1159 def SetSize(*args, **kwargs):
a95a7133 1160 """SetSize(self, Size s)"""
54f9ee45 1161 return _core_.Rect_SetSize(*args, **kwargs)
e811c8ce 1162
aff4cc5c
RD
1163 def IsEmpty(*args, **kwargs):
1164 """IsEmpty(self) -> bool"""
1165 return _core_.Rect_IsEmpty(*args, **kwargs)
1166
c9c7117a 1167 def GetTopLeft(*args, **kwargs):
a95a7133 1168 """GetTopLeft(self) -> Point"""
54f9ee45 1169 return _core_.Rect_GetTopLeft(*args, **kwargs)
c9c7117a
RD
1170
1171 def SetTopLeft(*args, **kwargs):
a95a7133 1172 """SetTopLeft(self, Point p)"""
54f9ee45 1173 return _core_.Rect_SetTopLeft(*args, **kwargs)
c9c7117a
RD
1174
1175 def GetBottomRight(*args, **kwargs):
a95a7133 1176 """GetBottomRight(self) -> Point"""
54f9ee45 1177 return _core_.Rect_GetBottomRight(*args, **kwargs)
c9c7117a
RD
1178
1179 def SetBottomRight(*args, **kwargs):
a95a7133 1180 """SetBottomRight(self, Point p)"""
54f9ee45 1181 return _core_.Rect_SetBottomRight(*args, **kwargs)
c9c7117a 1182
e811c8ce 1183 def GetLeft(*args, **kwargs):
a95a7133 1184 """GetLeft(self) -> int"""
54f9ee45 1185 return _core_.Rect_GetLeft(*args, **kwargs)
e811c8ce
RD
1186
1187 def GetTop(*args, **kwargs):
a95a7133 1188 """GetTop(self) -> int"""
54f9ee45 1189 return _core_.Rect_GetTop(*args, **kwargs)
e811c8ce
RD
1190
1191 def GetBottom(*args, **kwargs):
a95a7133 1192 """GetBottom(self) -> int"""
54f9ee45 1193 return _core_.Rect_GetBottom(*args, **kwargs)
e811c8ce
RD
1194
1195 def GetRight(*args, **kwargs):
a95a7133 1196 """GetRight(self) -> int"""
54f9ee45 1197 return _core_.Rect_GetRight(*args, **kwargs)
e811c8ce
RD
1198
1199 def SetLeft(*args, **kwargs):
a95a7133 1200 """SetLeft(self, int left)"""
54f9ee45 1201 return _core_.Rect_SetLeft(*args, **kwargs)
e811c8ce
RD
1202
1203 def SetRight(*args, **kwargs):
a95a7133 1204 """SetRight(self, int right)"""
54f9ee45 1205 return _core_.Rect_SetRight(*args, **kwargs)
e811c8ce
RD
1206
1207 def SetTop(*args, **kwargs):
a95a7133 1208 """SetTop(self, int top)"""
54f9ee45 1209 return _core_.Rect_SetTop(*args, **kwargs)
e811c8ce
RD
1210
1211 def SetBottom(*args, **kwargs):
a95a7133 1212 """SetBottom(self, int bottom)"""
54f9ee45 1213 return _core_.Rect_SetBottom(*args, **kwargs)
e811c8ce
RD
1214
1215 position = property(GetPosition, SetPosition)
1216 size = property(GetSize, SetSize)
1217 left = property(GetLeft, SetLeft)
1218 right = property(GetRight, SetRight)
1219 top = property(GetTop, SetTop)
1220 bottom = property(GetBottom, SetBottom)
1221
1222 def Inflate(*args, **kwargs):
0df68c9f 1223 """
a95a7133 1224 Inflate(self, int dx, int dy) -> Rect
e811c8ce 1225
8e738329
RD
1226 Increases the size of the rectangle.
1227
1228 The left border is moved farther left and the right border is moved
1229 farther right by ``dx``. The upper border is moved farther up and the
1230 bottom border is moved farther down by ``dy``. (Note the the width and
1231 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1232 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1233 opposite happens: the rectangle size decreases in the respective
1234 direction.
1235
1236 The change is made to the rectangle inplace, if instead you need a
1237 copy that is inflated, preserving the original then make the copy
1238 first::
1239
1240 copy = wx.Rect(*original)
1241 copy.Inflate(10,15)
1242
1243
0df68c9f 1244 """
54f9ee45 1245 return _core_.Rect_Inflate(*args, **kwargs)
e811c8ce
RD
1246
1247 def Deflate(*args, **kwargs):
0df68c9f 1248 """
a95a7133 1249 Deflate(self, int dx, int dy) -> Rect
e811c8ce 1250
8e738329
RD
1251 Decrease the rectangle size. This method is the opposite of `Inflate`
1252 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1253 `Inflate` for a full description.
0df68c9f 1254 """
54f9ee45 1255 return _core_.Rect_Deflate(*args, **kwargs)
e811c8ce
RD
1256
1257 def OffsetXY(*args, **kwargs):
0df68c9f 1258 """
a95a7133 1259 OffsetXY(self, int dx, int dy)
e811c8ce 1260
41e2b43e
RD
1261 Moves the rectangle by the specified offset. If dx is positive, the
1262 rectangle is moved to the right, if dy is positive, it is moved to the
1263 bottom, otherwise it is moved to the left or top respectively.
0df68c9f 1264 """
54f9ee45 1265 return _core_.Rect_OffsetXY(*args, **kwargs)
e811c8ce
RD
1266
1267 def Offset(*args, **kwargs):
0df68c9f 1268 """
a95a7133 1269 Offset(self, Point pt)
e811c8ce 1270
b1fcee84 1271 Same as `OffsetXY` but uses dx,dy from Point
0df68c9f 1272 """
54f9ee45 1273 return _core_.Rect_Offset(*args, **kwargs)
e811c8ce
RD
1274
1275 def Intersect(*args, **kwargs):
0df68c9f 1276 """
a95a7133 1277 Intersect(self, Rect rect) -> Rect
e811c8ce 1278
5cbf236d 1279 Returns the intersectsion of this rectangle and rect.
0df68c9f 1280 """
54f9ee45 1281 return _core_.Rect_Intersect(*args, **kwargs)
e811c8ce 1282
5cbf236d
RD
1283 def Union(*args, **kwargs):
1284 """
1285 Union(self, Rect rect) -> Rect
1286
1287 Returns the union of this rectangle and rect.
1288 """
1289 return _core_.Rect_Union(*args, **kwargs)
1290
e811c8ce 1291 def __add__(*args, **kwargs):
0df68c9f 1292 """
a95a7133 1293 __add__(self, Rect rect) -> Rect
e811c8ce 1294
0df68c9f
RD
1295 Add the properties of rect to this rectangle and return the result.
1296 """
54f9ee45 1297 return _core_.Rect___add__(*args, **kwargs)
e811c8ce
RD
1298
1299 def __iadd__(*args, **kwargs):
0df68c9f 1300 """
a95a7133 1301 __iadd__(self, Rect rect) -> Rect
e811c8ce 1302
0df68c9f
RD
1303 Add the properties of rect to this rectangle, updating this rectangle.
1304 """
54f9ee45 1305 return _core_.Rect___iadd__(*args, **kwargs)
e811c8ce
RD
1306
1307 def __eq__(*args, **kwargs):
0df68c9f 1308 """
e9d6f3a4 1309 __eq__(self, PyObject other) -> bool
e811c8ce 1310
e9d6f3a4 1311 Test for equality of wx.Rect objects.
0df68c9f 1312 """
54f9ee45 1313 return _core_.Rect___eq__(*args, **kwargs)
e811c8ce
RD
1314
1315 def __ne__(*args, **kwargs):
0df68c9f 1316 """
e9d6f3a4 1317 __ne__(self, PyObject other) -> bool
e811c8ce 1318
e9d6f3a4 1319 Test for inequality of wx.Rect objects.
0df68c9f 1320 """
54f9ee45 1321 return _core_.Rect___ne__(*args, **kwargs)
e811c8ce
RD
1322
1323 def InsideXY(*args, **kwargs):
0df68c9f 1324 """
a95a7133 1325 InsideXY(self, int x, int y) -> bool
e811c8ce 1326
0df68c9f
RD
1327 Return True if the point is (not strcitly) inside the rect.
1328 """
54f9ee45 1329 return _core_.Rect_InsideXY(*args, **kwargs)
e811c8ce
RD
1330
1331 def Inside(*args, **kwargs):
0df68c9f 1332 """
a95a7133 1333 Inside(self, Point pt) -> bool
e811c8ce 1334
0df68c9f
RD
1335 Return True if the point is (not strcitly) inside the rect.
1336 """
54f9ee45 1337 return _core_.Rect_Inside(*args, **kwargs)
e811c8ce 1338
fc46b7f3
RD
1339 def InsideRect(*args, **kwargs):
1340 """
1341 InsideRect(self, Rect rect) -> bool
1342
1343 Returns ``True`` if the given rectangle is completely inside this
1344 rectangle or touches its boundary.
1345 """
1346 return _core_.Rect_InsideRect(*args, **kwargs)
1347
e811c8ce 1348 def Intersects(*args, **kwargs):
0df68c9f 1349 """
a95a7133 1350 Intersects(self, Rect rect) -> bool
e811c8ce 1351
0df68c9f
RD
1352 Returns True if the rectangles have a non empty intersection.
1353 """
54f9ee45 1354 return _core_.Rect_Intersects(*args, **kwargs)
e811c8ce 1355
b1fcee84
RD
1356 def CenterIn(*args, **kwargs):
1357 """
1358 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1359
1360 Center this rectangle within the one passed to the method, which is
1361 usually, but not necessarily, the larger one.
1362 """
1363 return _core_.Rect_CenterIn(*args, **kwargs)
1364
1365 CentreIn = CenterIn
54f9ee45
RD
1366 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1367 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1368 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1369 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
e811c8ce 1370 def Set(*args, **kwargs):
0df68c9f 1371 """
a95a7133 1372 Set(self, int x=0, int y=0, int width=0, int height=0)
e811c8ce 1373
0df68c9f
RD
1374 Set all rectangle properties.
1375 """
54f9ee45 1376 return _core_.Rect_Set(*args, **kwargs)
e811c8ce
RD
1377
1378 def Get(*args, **kwargs):
0df68c9f
RD
1379 """
1380 Get() -> (x,y,width,height)
e811c8ce 1381
0df68c9f
RD
1382 Return the rectangle properties as a tuple.
1383 """
54f9ee45 1384 return _core_.Rect_Get(*args, **kwargs)
e811c8ce 1385
41e2b43e 1386 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1387 def __str__(self): return str(self.Get())
1388 def __repr__(self): return 'wx.Rect'+str(self.Get())
1389 def __len__(self): return len(self.Get())
1390 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
1391 def __setitem__(self, index, val):
1392 if index == 0: self.x = val
1393 elif index == 1: self.y = val
1394 elif index == 2: self.width = val
1395 elif index == 3: self.height = val
1396 else: raise IndexError
e811c8ce 1397 def __nonzero__(self): return self.Get() != (0,0,0,0)
74e96f3d
RD
1398 __safe_for_unpickling__ = True
1399 def __reduce__(self): return (wx.Rect, self.Get())
d14a1e28 1400
2131d850 1401_core_.Rect_swigregister(Rect)
d14a1e28
RD
1402
1403def RectPP(*args, **kwargs):
0df68c9f
RD
1404 """
1405 RectPP(Point topLeft, Point bottomRight) -> Rect
e811c8ce 1406
0df68c9f
RD
1407 Create a new Rect object from Points representing two corners.
1408 """
54f9ee45 1409 val = _core_.new_RectPP(*args, **kwargs)
d14a1e28
RD
1410 return val
1411
1412def RectPS(*args, **kwargs):
0df68c9f
RD
1413 """
1414 RectPS(Point pos, Size size) -> Rect
e811c8ce 1415
0df68c9f
RD
1416 Create a new Rect from a position and size.
1417 """
54f9ee45 1418 val = _core_.new_RectPS(*args, **kwargs)
d14a1e28
RD
1419 return val
1420
d3b6e4ff
RD
1421def RectS(*args, **kwargs):
1422 """
1423 RectS(Size size) -> Rect
1424
1425 Create a new Rect from a size only.
1426 """
1427 val = _core_.new_RectS(*args, **kwargs)
d3b6e4ff
RD
1428 return val
1429
d14a1e28 1430
e811c8ce 1431def IntersectRect(*args, **kwargs):
0085ce49 1432 """
0df68c9f 1433 IntersectRect(Rect r1, Rect r2) -> Rect
e811c8ce 1434
0df68c9f
RD
1435 Calculate and return the intersection of r1 and r2.
1436 """
0085ce49 1437 return _core_.IntersectRect(*args, **kwargs)
d14a1e28
RD
1438#---------------------------------------------------------------------------
1439
1440class Point2D(object):
41e2b43e
RD
1441 """
1442 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1443 with floating point values.
1444 """
0085ce49
RD
1445 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1446 __repr__ = _swig_repr
1447 def __init__(self, *args, **kwargs):
0df68c9f 1448 """
a95a7133 1449 __init__(self, double x=0.0, double y=0.0) -> Point2D
e811c8ce 1450
0df68c9f
RD
1451 Create a w.Point2D object.
1452 """
0085ce49 1453 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
e811c8ce 1454 def GetFloor(*args, **kwargs):
fd2dc343
RD
1455 """
1456 GetFloor() -> (x,y)
1457
1458 Convert to integer
1459 """
54f9ee45 1460 return _core_.Point2D_GetFloor(*args, **kwargs)
e811c8ce
RD
1461
1462 def GetRounded(*args, **kwargs):
fd2dc343
RD
1463 """
1464 GetRounded() -> (x,y)
1465
1466 Convert to integer
1467 """
54f9ee45 1468 return _core_.Point2D_GetRounded(*args, **kwargs)
e811c8ce
RD
1469
1470 def GetVectorLength(*args, **kwargs):
a95a7133 1471 """GetVectorLength(self) -> double"""
54f9ee45 1472 return _core_.Point2D_GetVectorLength(*args, **kwargs)
e811c8ce
RD
1473
1474 def GetVectorAngle(*args, **kwargs):
a95a7133 1475 """GetVectorAngle(self) -> double"""
54f9ee45 1476 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
e811c8ce
RD
1477
1478 def SetVectorLength(*args, **kwargs):
a95a7133 1479 """SetVectorLength(self, double length)"""
54f9ee45 1480 return _core_.Point2D_SetVectorLength(*args, **kwargs)
e811c8ce
RD
1481
1482 def SetVectorAngle(*args, **kwargs):
a95a7133 1483 """SetVectorAngle(self, double degrees)"""
54f9ee45 1484 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
e811c8ce 1485
d14a1e28
RD
1486 def SetPolarCoordinates(self, angle, length):
1487 self.SetVectorLength(length)
1488 self.SetVectorAngle(angle)
1489 def Normalize(self):
1490 self.SetVectorLength(1.0)
1491
e811c8ce 1492 def GetDistance(*args, **kwargs):
a95a7133 1493 """GetDistance(self, Point2D pt) -> double"""
54f9ee45 1494 return _core_.Point2D_GetDistance(*args, **kwargs)
e811c8ce
RD
1495
1496 def GetDistanceSquare(*args, **kwargs):
a95a7133 1497 """GetDistanceSquare(self, Point2D pt) -> double"""
54f9ee45 1498 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
e811c8ce
RD
1499
1500 def GetDotProduct(*args, **kwargs):
a95a7133 1501 """GetDotProduct(self, Point2D vec) -> double"""
54f9ee45 1502 return _core_.Point2D_GetDotProduct(*args, **kwargs)
e811c8ce
RD
1503
1504 def GetCrossProduct(*args, **kwargs):
a95a7133 1505 """GetCrossProduct(self, Point2D vec) -> double"""
54f9ee45 1506 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
e811c8ce
RD
1507
1508 def __neg__(*args, **kwargs):
0df68c9f 1509 """
a95a7133 1510 __neg__(self) -> Point2D
e811c8ce 1511
0df68c9f
RD
1512 the reflection of this point
1513 """
54f9ee45 1514 return _core_.Point2D___neg__(*args, **kwargs)
e811c8ce
RD
1515
1516 def __iadd__(*args, **kwargs):
a95a7133 1517 """__iadd__(self, Point2D pt) -> Point2D"""
54f9ee45 1518 return _core_.Point2D___iadd__(*args, **kwargs)
e811c8ce
RD
1519
1520 def __isub__(*args, **kwargs):
a95a7133 1521 """__isub__(self, Point2D pt) -> Point2D"""
54f9ee45 1522 return _core_.Point2D___isub__(*args, **kwargs)
e811c8ce
RD
1523
1524 def __imul__(*args, **kwargs):
a95a7133 1525 """__imul__(self, Point2D pt) -> Point2D"""
54f9ee45 1526 return _core_.Point2D___imul__(*args, **kwargs)
e811c8ce
RD
1527
1528 def __idiv__(*args, **kwargs):
a95a7133 1529 """__idiv__(self, Point2D pt) -> Point2D"""
54f9ee45 1530 return _core_.Point2D___idiv__(*args, **kwargs)
e811c8ce
RD
1531
1532 def __eq__(*args, **kwargs):
0df68c9f 1533 """
e9d6f3a4 1534 __eq__(self, PyObject other) -> bool
e811c8ce 1535
e9d6f3a4 1536 Test for equality of wx.Point2D objects.
0df68c9f 1537 """
54f9ee45 1538 return _core_.Point2D___eq__(*args, **kwargs)
e811c8ce
RD
1539
1540 def __ne__(*args, **kwargs):
0df68c9f 1541 """
e9d6f3a4 1542 __ne__(self, PyObject other) -> bool
e811c8ce 1543
e9d6f3a4 1544 Test for inequality of wx.Point2D objects.
0df68c9f 1545 """
54f9ee45 1546 return _core_.Point2D___ne__(*args, **kwargs)
e811c8ce 1547
54f9ee45
RD
1548 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1549 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
e811c8ce 1550 def Set(*args, **kwargs):
a95a7133 1551 """Set(self, double x=0, double y=0)"""
54f9ee45 1552 return _core_.Point2D_Set(*args, **kwargs)
e811c8ce
RD
1553
1554 def Get(*args, **kwargs):
0df68c9f
RD
1555 """
1556 Get() -> (x,y)
e811c8ce 1557
0df68c9f
RD
1558 Return x and y properties as a tuple.
1559 """
54f9ee45 1560 return _core_.Point2D_Get(*args, **kwargs)
e811c8ce 1561
41e2b43e 1562 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
1563 def __str__(self): return str(self.Get())
1564 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1565 def __len__(self): return len(self.Get())
1566 def __getitem__(self, index): return self.Get()[index]
d14a1e28 1567 def __setitem__(self, index, val):
e811c8ce
RD
1568 if index == 0: self.x = val
1569 elif index == 1: self.y = val
d14a1e28 1570 else: raise IndexError
e811c8ce 1571 def __nonzero__(self): return self.Get() != (0.0, 0.0)
74e96f3d
RD
1572 __safe_for_unpickling__ = True
1573 def __reduce__(self): return (wx.Point2D, self.Get())
d14a1e28 1574
2131d850 1575_core_.Point2D_swigregister(Point2D)
d14a1e28
RD
1576
1577def Point2DCopy(*args, **kwargs):
0df68c9f
RD
1578 """
1579 Point2DCopy(Point2D pt) -> Point2D
e811c8ce 1580
0df68c9f
RD
1581 Create a w.Point2D object.
1582 """
54f9ee45 1583 val = _core_.new_Point2DCopy(*args, **kwargs)
d14a1e28
RD
1584 return val
1585
1586def Point2DFromPoint(*args, **kwargs):
0df68c9f
RD
1587 """
1588 Point2DFromPoint(Point pt) -> Point2D
e811c8ce 1589
0df68c9f
RD
1590 Create a w.Point2D object.
1591 """
54f9ee45 1592 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d14a1e28
RD
1593 return val
1594
1595#---------------------------------------------------------------------------
1596
54f9ee45
RD
1597FromStart = _core_.FromStart
1598FromCurrent = _core_.FromCurrent
1599FromEnd = _core_.FromEnd
d14a1e28 1600class InputStream(object):
093d3ff1 1601 """Proxy of C++ InputStream class"""
0085ce49
RD
1602 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1603 __repr__ = _swig_repr
1604 def __init__(self, *args, **kwargs):
a95a7133 1605 """__init__(self, PyObject p) -> InputStream"""
0085ce49
RD
1606 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1607 __swig_destroy__ = _core_.delete_InputStream
1608 __del__ = lambda self : None;
e811c8ce 1609 def close(*args, **kwargs):
a95a7133 1610 """close(self)"""
54f9ee45 1611 return _core_.InputStream_close(*args, **kwargs)
e811c8ce
RD
1612
1613 def flush(*args, **kwargs):
a95a7133 1614 """flush(self)"""
54f9ee45 1615 return _core_.InputStream_flush(*args, **kwargs)
e811c8ce
RD
1616
1617 def eof(*args, **kwargs):
a95a7133 1618 """eof(self) -> bool"""
54f9ee45 1619 return _core_.InputStream_eof(*args, **kwargs)
e811c8ce
RD
1620
1621 def read(*args, **kwargs):
a95a7133 1622 """read(self, int size=-1) -> PyObject"""
54f9ee45 1623 return _core_.InputStream_read(*args, **kwargs)
e811c8ce
RD
1624
1625 def readline(*args, **kwargs):
a95a7133 1626 """readline(self, int size=-1) -> PyObject"""
54f9ee45 1627 return _core_.InputStream_readline(*args, **kwargs)
e811c8ce
RD
1628
1629 def readlines(*args, **kwargs):
a95a7133 1630 """readlines(self, int sizehint=-1) -> PyObject"""
54f9ee45 1631 return _core_.InputStream_readlines(*args, **kwargs)
e811c8ce
RD
1632
1633 def seek(*args, **kwargs):
a95a7133 1634 """seek(self, int offset, int whence=0)"""
54f9ee45 1635 return _core_.InputStream_seek(*args, **kwargs)
e811c8ce
RD
1636
1637 def tell(*args, **kwargs):
a95a7133 1638 """tell(self) -> int"""
54f9ee45 1639 return _core_.InputStream_tell(*args, **kwargs)
e811c8ce
RD
1640
1641 def Peek(*args, **kwargs):
a95a7133 1642 """Peek(self) -> char"""
54f9ee45 1643 return _core_.InputStream_Peek(*args, **kwargs)
e811c8ce
RD
1644
1645 def GetC(*args, **kwargs):
a95a7133 1646 """GetC(self) -> char"""
54f9ee45 1647 return _core_.InputStream_GetC(*args, **kwargs)
e811c8ce
RD
1648
1649 def LastRead(*args, **kwargs):
a95a7133 1650 """LastRead(self) -> size_t"""
54f9ee45 1651 return _core_.InputStream_LastRead(*args, **kwargs)
e811c8ce
RD
1652
1653 def CanRead(*args, **kwargs):
a95a7133 1654 """CanRead(self) -> bool"""
54f9ee45 1655 return _core_.InputStream_CanRead(*args, **kwargs)
e811c8ce
RD
1656
1657 def Eof(*args, **kwargs):
a95a7133 1658 """Eof(self) -> bool"""
54f9ee45 1659 return _core_.InputStream_Eof(*args, **kwargs)
e811c8ce
RD
1660
1661 def Ungetch(*args, **kwargs):
a95a7133 1662 """Ungetch(self, char c) -> bool"""
54f9ee45 1663 return _core_.InputStream_Ungetch(*args, **kwargs)
e811c8ce
RD
1664
1665 def SeekI(*args, **kwargs):
a95a7133 1666 """SeekI(self, long pos, int mode=FromStart) -> long"""
54f9ee45 1667 return _core_.InputStream_SeekI(*args, **kwargs)
e811c8ce
RD
1668
1669 def TellI(*args, **kwargs):
a95a7133 1670 """TellI(self) -> long"""
54f9ee45 1671 return _core_.InputStream_TellI(*args, **kwargs)
e811c8ce 1672
2131d850 1673_core_.InputStream_swigregister(InputStream)
d14a1e28
RD
1674DefaultPosition = cvar.DefaultPosition
1675DefaultSize = cvar.DefaultSize
1676
1677class OutputStream(object):
093d3ff1 1678 """Proxy of C++ OutputStream class"""
0085ce49
RD
1679 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1680 def __init__(self): raise AttributeError, "No constructor defined"
1681 __repr__ = _swig_repr
e811c8ce 1682 def write(*args, **kwargs):
a95a7133 1683 """write(self, PyObject obj)"""
54f9ee45 1684 return _core_.OutputStream_write(*args, **kwargs)
e811c8ce 1685
0085ce49
RD
1686 def LastWrite(*args, **kwargs):
1687 """LastWrite(self) -> size_t"""
1688 return _core_.OutputStream_LastWrite(*args, **kwargs)
d14a1e28 1689
2131d850 1690_core_.OutputStream_swigregister(OutputStream)
d14a1e28
RD
1691
1692#---------------------------------------------------------------------------
1693
1694class FSFile(Object):
093d3ff1 1695 """Proxy of C++ FSFile class"""
0085ce49
RD
1696 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1697 __repr__ = _swig_repr
1698 def __init__(self, *args, **kwargs):
0df68c9f 1699 """
a95a7133 1700 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
196addbf 1701 DateTime modif) -> FSFile
0df68c9f 1702 """
0085ce49 1703 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
0085ce49
RD
1704 __swig_destroy__ = _core_.delete_FSFile
1705 __del__ = lambda self : None;
e811c8ce 1706 def GetStream(*args, **kwargs):
a95a7133 1707 """GetStream(self) -> InputStream"""
54f9ee45 1708 return _core_.FSFile_GetStream(*args, **kwargs)
e811c8ce 1709
97ab0f6a
RD
1710 def DetachStream(*args, **kwargs):
1711 """DetachStream(self)"""
1712 return _core_.FSFile_DetachStream(*args, **kwargs)
1713
e811c8ce 1714 def GetMimeType(*args, **kwargs):
a95a7133 1715 """GetMimeType(self) -> String"""
54f9ee45 1716 return _core_.FSFile_GetMimeType(*args, **kwargs)
e811c8ce
RD
1717
1718 def GetLocation(*args, **kwargs):
a95a7133 1719 """GetLocation(self) -> String"""
54f9ee45 1720 return _core_.FSFile_GetLocation(*args, **kwargs)
e811c8ce
RD
1721
1722 def GetAnchor(*args, **kwargs):
a95a7133 1723 """GetAnchor(self) -> String"""
54f9ee45 1724 return _core_.FSFile_GetAnchor(*args, **kwargs)
e811c8ce
RD
1725
1726 def GetModificationTime(*args, **kwargs):
a95a7133 1727 """GetModificationTime(self) -> DateTime"""
54f9ee45 1728 return _core_.FSFile_GetModificationTime(*args, **kwargs)
e811c8ce 1729
97ab0f6a
RD
1730 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1731 Location = property(GetLocation,doc="See `GetLocation`")
1732 MimeType = property(GetMimeType,doc="See `GetMimeType`")
1733 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
1734 Stream = property(GetStream,doc="See `GetStream`")
2131d850 1735_core_.FSFile_swigregister(FSFile)
d14a1e28
RD
1736
1737class CPPFileSystemHandler(object):
093d3ff1 1738 """Proxy of C++ CPPFileSystemHandler class"""
0085ce49
RD
1739 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1740 def __init__(self): raise AttributeError, "No constructor defined"
1741 __repr__ = _swig_repr
50f151d7
RD
1742 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
1743 __del__ = lambda self : None;
2131d850 1744_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d14a1e28
RD
1745
1746class FileSystemHandler(CPPFileSystemHandler):
093d3ff1 1747 """Proxy of C++ FileSystemHandler class"""
0085ce49
RD
1748 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1749 __repr__ = _swig_repr
1750 def __init__(self, *args, **kwargs):
a95a7133 1751 """__init__(self) -> FileSystemHandler"""
0085ce49 1752 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
d14a1e28 1753 self._setCallbackInfo(self, FileSystemHandler)
e811c8ce
RD
1754
1755 def _setCallbackInfo(*args, **kwargs):
a95a7133 1756 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 1757 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
1758
1759 def CanOpen(*args, **kwargs):
a95a7133 1760 """CanOpen(self, String location) -> bool"""
54f9ee45 1761 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1762
1763 def OpenFile(*args, **kwargs):
a95a7133 1764 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1765 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1766
1767 def FindFirst(*args, **kwargs):
a95a7133 1768 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1769 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1770
1771 def FindNext(*args, **kwargs):
a95a7133 1772 """FindNext(self) -> String"""
54f9ee45 1773 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
e811c8ce
RD
1774
1775 def GetProtocol(*args, **kwargs):
a95a7133 1776 """GetProtocol(self, String location) -> String"""
54f9ee45 1777 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
e811c8ce
RD
1778
1779 def GetLeftLocation(*args, **kwargs):
a95a7133 1780 """GetLeftLocation(self, String location) -> String"""
54f9ee45 1781 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
e811c8ce
RD
1782
1783 def GetAnchor(*args, **kwargs):
a95a7133 1784 """GetAnchor(self, String location) -> String"""
54f9ee45 1785 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
e811c8ce
RD
1786
1787 def GetRightLocation(*args, **kwargs):
a95a7133 1788 """GetRightLocation(self, String location) -> String"""
54f9ee45 1789 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
e811c8ce
RD
1790
1791 def GetMimeTypeFromExt(*args, **kwargs):
a95a7133 1792 """GetMimeTypeFromExt(self, String location) -> String"""
54f9ee45 1793 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
e811c8ce 1794
97ab0f6a
RD
1795 Anchor = property(GetAnchor,doc="See `GetAnchor`")
1796 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
1797 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
1798 Protocol = property(GetProtocol,doc="See `GetProtocol`")
1799 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
2131d850 1800_core_.FileSystemHandler_swigregister(FileSystemHandler)
d14a1e28
RD
1801
1802class FileSystem(Object):
093d3ff1 1803 """Proxy of C++ FileSystem class"""
0085ce49
RD
1804 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1805 __repr__ = _swig_repr
1806 def __init__(self, *args, **kwargs):
a95a7133 1807 """__init__(self) -> FileSystem"""
0085ce49
RD
1808 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
1809 __swig_destroy__ = _core_.delete_FileSystem
1810 __del__ = lambda self : None;
e811c8ce 1811 def ChangePathTo(*args, **kwargs):
a95a7133 1812 """ChangePathTo(self, String location, bool is_dir=False)"""
54f9ee45 1813 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
e811c8ce
RD
1814
1815 def GetPath(*args, **kwargs):
a95a7133 1816 """GetPath(self) -> String"""
54f9ee45 1817 return _core_.FileSystem_GetPath(*args, **kwargs)
e811c8ce
RD
1818
1819 def OpenFile(*args, **kwargs):
a95a7133 1820 """OpenFile(self, String location) -> FSFile"""
54f9ee45 1821 return _core_.FileSystem_OpenFile(*args, **kwargs)
e811c8ce
RD
1822
1823 def FindFirst(*args, **kwargs):
a95a7133 1824 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1825 return _core_.FileSystem_FindFirst(*args, **kwargs)
e811c8ce
RD
1826
1827 def FindNext(*args, **kwargs):
a95a7133 1828 """FindNext(self) -> String"""
54f9ee45 1829 return _core_.FileSystem_FindNext(*args, **kwargs)
e811c8ce
RD
1830
1831 def AddHandler(*args, **kwargs):
66c033b4 1832 """AddHandler(CPPFileSystemHandler handler)"""
54f9ee45 1833 return _core_.FileSystem_AddHandler(*args, **kwargs)
e811c8ce
RD
1834
1835 AddHandler = staticmethod(AddHandler)
97ab0f6a
RD
1836 def RemoveHandler(*args, **kwargs):
1837 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1838 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1839
1840 RemoveHandler = staticmethod(RemoveHandler)
e811c8ce 1841 def CleanUpHandlers(*args, **kwargs):
66c033b4 1842 """CleanUpHandlers()"""
54f9ee45 1843 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
e811c8ce
RD
1844
1845 CleanUpHandlers = staticmethod(CleanUpHandlers)
1846 def FileNameToURL(*args, **kwargs):
66c033b4 1847 """FileNameToURL(String filename) -> String"""
54f9ee45 1848 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
e811c8ce
RD
1849
1850 FileNameToURL = staticmethod(FileNameToURL)
2ef75293
RD
1851 def URLToFileName(*args, **kwargs):
1852 """URLToFileName(String url) -> String"""
1853 return _core_.FileSystem_URLToFileName(*args, **kwargs)
1854
1855 URLToFileName = staticmethod(URLToFileName)
97ab0f6a 1856 Path = property(GetPath,doc="See `GetPath`")
2131d850 1857_core_.FileSystem_swigregister(FileSystem)
d14a1e28 1858
e811c8ce 1859def FileSystem_AddHandler(*args, **kwargs):
0085ce49
RD
1860 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
1861 return _core_.FileSystem_AddHandler(*args, **kwargs)
d14a1e28 1862
97ab0f6a
RD
1863def FileSystem_RemoveHandler(*args, **kwargs):
1864 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
1865 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
1866
0085ce49
RD
1867def FileSystem_CleanUpHandlers(*args):
1868 """FileSystem_CleanUpHandlers()"""
1869 return _core_.FileSystem_CleanUpHandlers(*args)
d14a1e28 1870
e811c8ce 1871def FileSystem_FileNameToURL(*args, **kwargs):
0085ce49
RD
1872 """FileSystem_FileNameToURL(String filename) -> String"""
1873 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d14a1e28 1874
e811c8ce 1875def FileSystem_URLToFileName(*args, **kwargs):
0085ce49
RD
1876 """FileSystem_URLToFileName(String url) -> String"""
1877 return _core_.FileSystem_URLToFileName(*args, **kwargs)
2ef75293 1878
d14a1e28 1879class InternetFSHandler(CPPFileSystemHandler):
093d3ff1 1880 """Proxy of C++ InternetFSHandler class"""
0085ce49
RD
1881 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1882 __repr__ = _swig_repr
1883 def __init__(self, *args, **kwargs):
a95a7133 1884 """__init__(self) -> InternetFSHandler"""
0085ce49 1885 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
e811c8ce 1886 def CanOpen(*args, **kwargs):
a95a7133 1887 """CanOpen(self, String location) -> bool"""
54f9ee45 1888 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1889
1890 def OpenFile(*args, **kwargs):
a95a7133 1891 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1892 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
e811c8ce 1893
2131d850 1894_core_.InternetFSHandler_swigregister(InternetFSHandler)
d14a1e28
RD
1895
1896class ZipFSHandler(CPPFileSystemHandler):
093d3ff1 1897 """Proxy of C++ ZipFSHandler class"""
0085ce49
RD
1898 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1899 __repr__ = _swig_repr
1900 def __init__(self, *args, **kwargs):
a95a7133 1901 """__init__(self) -> ZipFSHandler"""
0085ce49 1902 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
e811c8ce 1903 def CanOpen(*args, **kwargs):
a95a7133 1904 """CanOpen(self, String location) -> bool"""
54f9ee45 1905 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1906
1907 def OpenFile(*args, **kwargs):
a95a7133 1908 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1909 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1910
1911 def FindFirst(*args, **kwargs):
a95a7133 1912 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1913 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1914
1915 def FindNext(*args, **kwargs):
a95a7133 1916 """FindNext(self) -> String"""
54f9ee45 1917 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
e811c8ce 1918
2131d850 1919_core_.ZipFSHandler_swigregister(ZipFSHandler)
d14a1e28
RD
1920
1921
e811c8ce 1922def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
0085ce49
RD
1923 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
1924 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d14a1e28 1925
e811c8ce 1926def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
0085ce49
RD
1927 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
1928 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d14a1e28 1929
e811c8ce 1930def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
0085ce49
RD
1931 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
1932 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
2ef75293
RD
1933def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
1934 """
1935 Add 'file' to the memory filesystem. The dataItem parameter can
1936 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
1937 arbitrary data. If a bitmap or image is used then the imgType
1938 parameter should specify what kind of image file it should be
1939 written as, wx.BITMAP_TYPE_PNG, etc.
1940 """
1941 if isinstance(dataItem, wx.Image):
1942 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
1943 elif isinstance(dataItem, wx.Bitmap):
1944 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
1945 elif type(dataItem) == str:
1946 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
1947 else:
1948 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d14a1e28
RD
1949
1950class MemoryFSHandler(CPPFileSystemHandler):
093d3ff1 1951 """Proxy of C++ MemoryFSHandler class"""
0085ce49
RD
1952 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1953 __repr__ = _swig_repr
1954 def __init__(self, *args, **kwargs):
a95a7133 1955 """__init__(self) -> MemoryFSHandler"""
0085ce49 1956 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
e811c8ce 1957 def RemoveFile(*args, **kwargs):
66c033b4 1958 """RemoveFile(String filename)"""
54f9ee45 1959 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
e811c8ce
RD
1960
1961 RemoveFile = staticmethod(RemoveFile)
d14a1e28 1962 AddFile = staticmethod(MemoryFSHandler_AddFile)
e811c8ce 1963 def CanOpen(*args, **kwargs):
a95a7133 1964 """CanOpen(self, String location) -> bool"""
54f9ee45 1965 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
e811c8ce
RD
1966
1967 def OpenFile(*args, **kwargs):
a95a7133 1968 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
54f9ee45 1969 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
e811c8ce
RD
1970
1971 def FindFirst(*args, **kwargs):
a95a7133 1972 """FindFirst(self, String spec, int flags=0) -> String"""
54f9ee45 1973 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
e811c8ce
RD
1974
1975 def FindNext(*args, **kwargs):
a95a7133 1976 """FindNext(self) -> String"""
54f9ee45 1977 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
e811c8ce 1978
2131d850 1979_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d14a1e28 1980
e811c8ce 1981def MemoryFSHandler_RemoveFile(*args, **kwargs):
0085ce49
RD
1982 """MemoryFSHandler_RemoveFile(String filename)"""
1983 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d14a1e28 1984
bcd0d7b6
RD
1985IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
1986IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
1987IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
d14a1e28
RD
1988#---------------------------------------------------------------------------
1989
1990class ImageHandler(Object):
27fb7603
RD
1991 """
1992 This is the base class for implementing image file loading/saving, and
1993 image creation from data. It is used within `wx.Image` and is not
1994 normally seen by the application.
1995 """
0085ce49
RD
1996 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1997 def __init__(self): raise AttributeError, "No constructor defined"
1998 __repr__ = _swig_repr
e811c8ce 1999 def GetName(*args, **kwargs):
a95a7133 2000 """GetName(self) -> String"""
54f9ee45 2001 return _core_.ImageHandler_GetName(*args, **kwargs)
e811c8ce
RD
2002
2003 def GetExtension(*args, **kwargs):
a95a7133 2004 """GetExtension(self) -> String"""
54f9ee45 2005 return _core_.ImageHandler_GetExtension(*args, **kwargs)
e811c8ce
RD
2006
2007 def GetType(*args, **kwargs):
a95a7133 2008 """GetType(self) -> long"""
54f9ee45 2009 return _core_.ImageHandler_GetType(*args, **kwargs)
e811c8ce
RD
2010
2011 def GetMimeType(*args, **kwargs):
a95a7133 2012 """GetMimeType(self) -> String"""
54f9ee45 2013 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
e811c8ce
RD
2014
2015 def CanRead(*args, **kwargs):
a95a7133 2016 """CanRead(self, String name) -> bool"""
54f9ee45 2017 return _core_.ImageHandler_CanRead(*args, **kwargs)
e811c8ce 2018
b02396e8
RD
2019 def CanReadStream(*args, **kwargs):
2020 """CanReadStream(self, InputStream stream) -> bool"""
2021 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2022
e811c8ce 2023 def SetName(*args, **kwargs):
a95a7133 2024 """SetName(self, String name)"""
54f9ee45 2025 return _core_.ImageHandler_SetName(*args, **kwargs)
e811c8ce
RD
2026
2027 def SetExtension(*args, **kwargs):
a95a7133 2028 """SetExtension(self, String extension)"""
54f9ee45 2029 return _core_.ImageHandler_SetExtension(*args, **kwargs)
e811c8ce
RD
2030
2031 def SetType(*args, **kwargs):
a95a7133 2032 """SetType(self, long type)"""
54f9ee45 2033 return _core_.ImageHandler_SetType(*args, **kwargs)
e811c8ce
RD
2034
2035 def SetMimeType(*args, **kwargs):
a95a7133 2036 """SetMimeType(self, String mimetype)"""
54f9ee45 2037 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
e811c8ce 2038
97ab0f6a
RD
2039 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2040 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2041 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2042 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2131d850 2043_core_.ImageHandler_swigregister(ImageHandler)
d14a1e28 2044
943e8dfd
RD
2045class PyImageHandler(ImageHandler):
2046 """
2047 This is the base class for implementing image file loading/saving, and
2048 image creation from data, all written in Python. To create a custom
2049 image handler derive a new class from wx.PyImageHandler and provide
2050 the following methods::
2051
2052 def DoCanRead(self, stream) --> bool
2053 '''Check if this handler can read the image on the stream'''
2054
2055 def LoadFile(self, image, stream, verbose, index) --> bool
2056 '''Load image data from the stream and load it into image.'''
2057
2058 def SaveFile(self, image, stream, verbose) --> bool
2059 '''Save the iamge data in image to the stream using
2060 this handler's image file format.'''
2061
2062 def GetImageCount(self, stream) --> int
2063 '''If this image format can hold more than one image,
2064 how many does the image on the stream have?'''
2065
2066 To activate your handler create an instance of it and pass it to
2067 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2068 `SetExtension` from your constructor.
2069
2070 """
0085ce49
RD
2071 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2072 __repr__ = _swig_repr
2073 def __init__(self, *args, **kwargs):
943e8dfd
RD
2074 """
2075 __init__(self) -> PyImageHandler
2076
2077 This is the base class for implementing image file loading/saving, and
2078 image creation from data, all written in Python. To create a custom
2079 image handler derive a new class from wx.PyImageHandler and provide
2080 the following methods::
2081
2082 def DoCanRead(self, stream) --> bool
2083 '''Check if this handler can read the image on the stream'''
2084
2085 def LoadFile(self, image, stream, verbose, index) --> bool
2086 '''Load image data from the stream and load it into image.'''
2087
2088 def SaveFile(self, image, stream, verbose) --> bool
2089 '''Save the iamge data in image to the stream using
2090 this handler's image file format.'''
2091
2092 def GetImageCount(self, stream) --> int
2093 '''If this image format can hold more than one image,
2094 how many does the image on the stream have?'''
2095
2096 To activate your handler create an instance of it and pass it to
2097 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2098 `SetExtension` from your constructor.
2099
2100 """
0085ce49 2101 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
RD
2102 self._SetSelf(self)
2103
2104 def _SetSelf(*args, **kwargs):
2105 """_SetSelf(self, PyObject self)"""
2106 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2107
2131d850 2108_core_.PyImageHandler_swigregister(PyImageHandler)
943e8dfd 2109
d14a1e28 2110class ImageHistogram(object):
093d3ff1 2111 """Proxy of C++ ImageHistogram class"""
0085ce49
RD
2112 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2113 __repr__ = _swig_repr
2114 def __init__(self, *args, **kwargs):
a95a7133 2115 """__init__(self) -> ImageHistogram"""
0085ce49 2116 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
e811c8ce 2117 def MakeKey(*args, **kwargs):
0df68c9f 2118 """
7a27cf7c 2119 MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2120
0df68c9f
RD
2121 Get the key in the histogram for the given RGB values
2122 """
54f9ee45 2123 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
e811c8ce
RD
2124
2125 MakeKey = staticmethod(MakeKey)
2126 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2127 """
2128 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2129
2130 Find first colour that is not used in the image and has higher RGB
2131 values than startR, startG, startB. Returns a tuple consisting of a
2132 success flag and rgb values.
2133 """
54f9ee45 2134 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2135
f1cbd8fa
RD
2136 def GetCount(*args, **kwargs):
2137 """
2138 GetCount(self, unsigned long key) -> unsigned long
2139
2140 Returns the pixel count for the given key. Use `MakeKey` to create a
2141 key value from a RGB tripple.
2142 """
2143 return _core_.ImageHistogram_GetCount(*args, **kwargs)
2144
2145 def GetCountRGB(*args, **kwargs):
2146 """
7a27cf7c 2147 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2148
2149 Returns the pixel count for the given RGB values.
2150 """
2151 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
2152
2153 def GetCountColour(*args, **kwargs):
2154 """
2155 GetCountColour(self, Colour colour) -> unsigned long
2156
2157 Returns the pixel count for the given `wx.Colour` value.
2158 """
2159 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
2160
2131d850 2161_core_.ImageHistogram_swigregister(ImageHistogram)
d14a1e28 2162
e811c8ce 2163def ImageHistogram_MakeKey(*args, **kwargs):
0085ce49 2164 """
7a27cf7c 2165 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
e811c8ce 2166
0df68c9f
RD
2167 Get the key in the histogram for the given RGB values
2168 """
0085ce49 2169 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d14a1e28 2170
943e8dfd
RD
2171class Image_RGBValue(object):
2172 """
2173 An object that contains values for red, green and blue which represent
2174 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2175 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2176 color space.
2177 """
0085ce49
RD
2178 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2179 __repr__ = _swig_repr
2180 def __init__(self, *args, **kwargs):
943e8dfd
RD
2181 """
2182 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2183
2184 Constructor.
2185 """
0085ce49 2186 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
2187 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2188 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2189 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2190_core_.Image_RGBValue_swigregister(Image_RGBValue)
943e8dfd
RD
2191
2192class Image_HSVValue(object):
2193 """
2194 An object that contains values for hue, saturation and value which
2195 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2196 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2197 color space.
2198 """
0085ce49
RD
2199 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2200 __repr__ = _swig_repr
2201 def __init__(self, *args, **kwargs):
943e8dfd
RD
2202 """
2203 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2204
2205 Constructor.
2206 """
0085ce49 2207 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
2208 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2209 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2210 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2211_core_.Image_HSVValue_swigregister(Image_HSVValue)
943e8dfd 2212
d14a1e28 2213class Image(Object):
7a27cf7c
RD
2214 """
2215 A platform-independent image class. An image can be created from
2216 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2217 variety of formats. Functions are available to set and get image
2218 bits, so it can be used for basic image manipulation.
2219
2220 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2221 platform-specific `wx.Bitmap` object must be created from it using the
2222 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2223 device context, using `wx.DC.DrawBitmap`.
2224
2225 One colour value of the image may be used as a mask colour which will
2226 lead to the automatic creation of a `wx.Mask` object associated to the
2227 bitmap object.
2228
2229 wx.Image supports alpha channel data, that is in addition to a byte
2230 for the red, green and blue colour components for each pixel it also
2231 stores a byte representing the pixel opacity. An alpha value of 0
2232 corresponds to a transparent pixel (null opacity) while a value of 255
2233 means that the pixel is 100% opaque.
2234
2235 Unlike RGB data, not all images have an alpha channel and before using
2236 `GetAlpha` you should check if this image contains an alpha channel
2237 with `HasAlpha`. Note that currently only images loaded from PNG files
2238 with transparency information will have an alpha channel.
2239 """
0085ce49
RD
2240 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2241 __repr__ = _swig_repr
2242 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2243 """
2244 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2245
2246 Loads an image from a file.
2247 """
0085ce49
RD
2248 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2249 __swig_destroy__ = _core_.delete_Image
2250 __del__ = lambda self : None;
e811c8ce 2251 def Create(*args, **kwargs):
7a27cf7c
RD
2252 """
2253 Create(self, int width, int height, bool clear=True)
2254
2255 Creates a fresh image. If clear is ``True``, the new image will be
2256 initialized to black. Otherwise, the image data will be uninitialized.
2257 """
54f9ee45 2258 return _core_.Image_Create(*args, **kwargs)
e811c8ce
RD
2259
2260 def Destroy(*args, **kwargs):
0df68c9f 2261 """
a95a7133 2262 Destroy(self)
e811c8ce 2263
7a27cf7c 2264 Destroys the image data.
0df68c9f 2265 """
7e08d4ef
RD
2266 val = _core_.Image_Destroy(*args, **kwargs)
2267 args[0].thisown = 0
2268 return val
e811c8ce
RD
2269
2270 def Scale(*args, **kwargs):
7a27cf7c
RD
2271 """
2272 Scale(self, int width, int height) -> Image
2273
2274 Returns a scaled version of the image. This is also useful for scaling
2275 bitmaps in general as the only other way to scale bitmaps is to blit a
2276 `wx.MemoryDC` into another `wx.MemoryDC`.
2277 """
54f9ee45 2278 return _core_.Image_Scale(*args, **kwargs)
e811c8ce
RD
2279
2280 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2281 """
2282 ShrinkBy(self, int xFactor, int yFactor) -> Image
2283
2284 Return a version of the image scaled smaller by the given factors.
2285 """
54f9ee45 2286 return _core_.Image_ShrinkBy(*args, **kwargs)
e811c8ce
RD
2287
2288 def Rescale(*args, **kwargs):
7a27cf7c
RD
2289 """
2290 Rescale(self, int width, int height) -> Image
2291
2292 Changes the size of the image in-place by scaling it: after a call to
2293 this function, the image will have the given width and height.
2294
2295 Returns the (modified) image itself.
2296 """
54f9ee45 2297 return _core_.Image_Rescale(*args, **kwargs)
e811c8ce 2298
aff4cc5c 2299 def Resize(*args, **kwargs):
7a27cf7c
RD
2300 """
2301 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2302
2303 Changes the size of the image in-place without scaling it, by adding
2304 either a border with the given colour or cropping as necessary. The
2305 image is pasted into a new image with the given size and background
2306 colour at the position pos relative to the upper left of the new
2307 image. If red = green = blue = -1 then use either the current mask
2308 colour if set or find, use, and set a suitable mask colour for any
2309 newly exposed areas.
2310
2311 Returns the (modified) image itself.
2312 """
aff4cc5c
RD
2313 return _core_.Image_Resize(*args, **kwargs)
2314
e811c8ce 2315 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2316 """
2317 SetRGB(self, int x, int y, byte r, byte g, byte b)
2318
2319 Sets the pixel at the given coordinate. This routine performs
2320 bounds-checks for the coordinate so it can be considered a safe way to
2321 manipulate the data, but in some cases this might be too slow so that
2322 the data will have to be set directly. In that case you will have to
2323 get access to the image data using the `GetData` method.
2324 """
54f9ee45 2325 return _core_.Image_SetRGB(*args, **kwargs)
e811c8ce 2326
aff4cc5c 2327 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2328 """
2329 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2330
2331 Sets the colour of the pixels within the given rectangle. This routine
2332 performs bounds-checks for the rectangle so it can be considered a
2333 safe way to manipulate the data.
2334 """
aff4cc5c
RD
2335 return _core_.Image_SetRGBRect(*args, **kwargs)
2336
e811c8ce 2337 def GetRed(*args, **kwargs):
7a27cf7c
RD
2338 """
2339 GetRed(self, int x, int y) -> byte
2340
2341 Returns the red intensity at the given coordinate.
2342 """
54f9ee45 2343 return _core_.Image_GetRed(*args, **kwargs)
e811c8ce
RD
2344
2345 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2346 """
2347 GetGreen(self, int x, int y) -> byte
2348
2349 Returns the green intensity at the given coordinate.
2350 """
54f9ee45 2351 return _core_.Image_GetGreen(*args, **kwargs)
e811c8ce
RD
2352
2353 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2354 """
2355 GetBlue(self, int x, int y) -> byte
2356
2357 Returns the blue intensity at the given coordinate.
2358 """
54f9ee45 2359 return _core_.Image_GetBlue(*args, **kwargs)
e811c8ce
RD
2360
2361 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2362 """
2363 SetAlpha(self, int x, int y, byte alpha)
2364
2365 Sets the alpha value for the given pixel. This function should only be
2366 called if the image has alpha channel data, use `HasAlpha` to check
2367 for this.
2368 """
54f9ee45 2369 return _core_.Image_SetAlpha(*args, **kwargs)
e811c8ce
RD
2370
2371 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2372 """
2373 GetAlpha(self, int x, int y) -> byte
2374
2375 Returns the alpha value for the given pixel. This function may only be
2376 called for the images with alpha channel, use `HasAlpha` to check for
2377 this.
2378
2379 The returned value is the *opacity* of the image, i.e. the value of 0
2380 corresponds to the fully transparent pixels while the value of 255 to
2381 the fully opaque pixels.
2382 """
54f9ee45 2383 return _core_.Image_GetAlpha(*args, **kwargs)
e811c8ce
RD
2384
2385 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2386 """
2387 HasAlpha(self) -> bool
2388
2389 Returns true if this image has alpha channel, false otherwise.
2390 """
54f9ee45 2391 return _core_.Image_HasAlpha(*args, **kwargs)
e811c8ce 2392
68350608
RD
2393 def InitAlpha(*args, **kwargs):
2394 """
2395 InitAlpha(self)
2396
2397 Initializes the image alpha channel data. It is an error to call it if
2398 the image already has alpha data. If it doesn't, alpha data will be by
2399 default initialized to all pixels being fully opaque. But if the image
2400 has a a mask colour, all mask pixels will be completely transparent.
2401 """
2402 return _core_.Image_InitAlpha(*args, **kwargs)
2403
bcd0d7b6
RD
2404 def IsTransparent(*args, **kwargs):
2405 """
7a27cf7c 2406 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
bcd0d7b6 2407
7a27cf7c
RD
2408 Returns ``True`` if this pixel is masked or has an alpha value less
2409 than the spcified threshold.
bcd0d7b6
RD
2410 """
2411 return _core_.Image_IsTransparent(*args, **kwargs)
2412
e811c8ce 2413 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2414 """
2415 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2416
2417 Find first colour that is not used in the image and has higher RGB
2418 values than startR, startG, startB. Returns a tuple consisting of a
2419 success flag and rgb values.
2420 """
54f9ee45 2421 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
e811c8ce 2422
4cf4100f
RD
2423 def ConvertAlphaToMask(*args, **kwargs):
2424 """
bcd0d7b6 2425 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2426
7a27cf7c
RD
2427 If the image has alpha channel, this method converts it to mask. All
2428 pixels with alpha value less than ``threshold`` are replaced with the
2429 mask colour and the alpha channel is removed. The mask colour is
2430 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2431
2432 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2433 nothing.
2434 """
2435 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
2436
8fb0e70a
RD
2437 def ConvertColourToAlpha(*args, **kwargs):
2438 """
7a27cf7c 2439 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2440
2441 This method converts an image where the original alpha information is
2442 only available as a shades of a colour (actually shades of grey)
2443 typically when you draw anti-aliased text into a bitmap. The DC
2444 drawing routines draw grey values on the black background although
2445 they actually mean to draw white with differnt alpha values. This
2446 method reverses it, assuming a black (!) background and white text.
2447 The method will then fill up the whole image with the colour given.
2448 """
2449 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
2450
e811c8ce 2451 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2452 """
2453 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2454
2455 Sets the image's mask so that the pixels that have RGB value of
2456 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2457 by first finding an unused colour in the image, setting this colour as
2458 the mask colour and then using this colour to draw all pixels in the
2459 image who corresponding pixel in mask has given RGB value.
2460
2461 Returns ``False`` if ``mask`` does not have same dimensions as the
2462 image or if there is no unused colour left. Returns ``True`` if the
2463 mask was successfully applied.
2464
2465 Note that this method involves computing the histogram, which is
2466 computationally intensive operation.
2467 """
54f9ee45 2468 return _core_.Image_SetMaskFromImage(*args, **kwargs)
e811c8ce
RD
2469
2470 def CanRead(*args, **kwargs):
7a27cf7c
RD
2471 """
2472 CanRead(String filename) -> bool
2473
2474 Returns True if the image handlers can read this file.
2475 """
54f9ee45 2476 return _core_.Image_CanRead(*args, **kwargs)
e811c8ce
RD
2477
2478 CanRead = staticmethod(CanRead)
2479 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2480 """
2481 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2482
2483 If the image file contains more than one image and the image handler
2484 is capable of retrieving these individually, this function will return
2485 the number of available images.
2486 """
54f9ee45 2487 return _core_.Image_GetImageCount(*args, **kwargs)
e811c8ce
RD
2488
2489 GetImageCount = staticmethod(GetImageCount)
2490 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2491 """
2492 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2493
2494 Loads an image from a file. If no handler type is provided, the
2495 library will try to autodetect the format.
2496 """
54f9ee45 2497 return _core_.Image_LoadFile(*args, **kwargs)
e811c8ce
RD
2498
2499 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2500 """
2501 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2502
2503 Loads an image from a file, specifying the image type with a MIME type
2504 string.
2505 """
54f9ee45 2506 return _core_.Image_LoadMimeFile(*args, **kwargs)
e811c8ce
RD
2507
2508 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2509 """
2510 SaveFile(self, String name, int type) -> bool
2511
2512 Saves an image in the named file.
2513 """
54f9ee45 2514 return _core_.Image_SaveFile(*args, **kwargs)
e811c8ce
RD
2515
2516 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2517 """
2518 SaveMimeFile(self, String name, String mimetype) -> bool
2519
2520 Saves an image in the named file.
2521 """
54f9ee45 2522 return _core_.Image_SaveMimeFile(*args, **kwargs)
e811c8ce
RD
2523
2524 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2525 """
2526 CanReadStream(InputStream stream) -> bool
2527
2528 Returns True if the image handlers can read an image file from the
2529 data currently on the input stream, or a readable Python file-like
2530 object.
2531 """
54f9ee45 2532 return _core_.Image_CanReadStream(*args, **kwargs)
e811c8ce
RD
2533
2534 CanReadStream = staticmethod(CanReadStream)
2535 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2536 """
2537 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2538
2539 Loads an image from an input stream or a readable Python file-like
2540 object. If no handler type is provided, the library will try to
2541 autodetect the format.
2542 """
54f9ee45 2543 return _core_.Image_LoadStream(*args, **kwargs)
e811c8ce
RD
2544
2545 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2546 """
2547 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2548
2549 Loads an image from an input stream or a readable Python file-like
2550 object, using a MIME type string to specify the image file format.
2551 """
54f9ee45 2552 return _core_.Image_LoadMimeStream(*args, **kwargs)
e811c8ce
RD
2553
2554 def Ok(*args, **kwargs):
7a27cf7c
RD
2555 """
2556 Ok(self) -> bool
2557
2558 Returns true if image data is present.
2559 """
54f9ee45 2560 return _core_.Image_Ok(*args, **kwargs)
e811c8ce
RD
2561
2562 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2563 """
2564 GetWidth(self) -> int
2565
2566 Gets the width of the image in pixels.
2567 """
54f9ee45 2568 return _core_.Image_GetWidth(*args, **kwargs)
e811c8ce
RD
2569
2570 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2571 """
2572 GetHeight(self) -> int
2573
2574 Gets the height of the image in pixels.
2575 """
54f9ee45 2576 return _core_.Image_GetHeight(*args, **kwargs)
e811c8ce 2577
b2df227b 2578 def GetSize(*args, **kwargs):
7a27cf7c
RD
2579 """
2580 GetSize(self) -> Size
2581
2582 Returns the size of the image in pixels.
2583 """
54f9ee45 2584 return _core_.Image_GetSize(*args, **kwargs)
b2df227b 2585
e811c8ce 2586 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2587 """
2588 GetSubImage(self, Rect rect) -> Image
2589
2590 Returns a sub image of the current one as long as the rect belongs
2591 entirely to the image.
2592 """
54f9ee45 2593 return _core_.Image_GetSubImage(*args, **kwargs)
e811c8ce 2594
aff4cc5c 2595 def Size(*args, **kwargs):
7a27cf7c
RD
2596 """
2597 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2598
2599 Returns a resized version of this image without scaling it by adding
2600 either a border with the given colour or cropping as necessary. The
2601 image is pasted into a new image with the given size and background
2602 colour at the position ``pos`` relative to the upper left of the new
2603 image. If red = green = blue = -1 then use either the current mask
2604 colour if set or find, use, and set a suitable mask colour for any
2605 newly exposed areas.
2606 """
aff4cc5c
RD
2607 return _core_.Image_Size(*args, **kwargs)
2608
e811c8ce 2609 def Copy(*args, **kwargs):
7a27cf7c
RD
2610 """
2611 Copy(self) -> Image
2612
2613 Returns an identical copy of the image.
2614 """
54f9ee45 2615 return _core_.Image_Copy(*args, **kwargs)
e811c8ce
RD
2616
2617 def Paste(*args, **kwargs):
7a27cf7c
RD
2618 """
2619 Paste(self, Image image, int x, int y)
2620
2621 Pastes ``image`` into this instance and takes care of the mask colour
2622 and any out of bounds problems.
2623 """
54f9ee45 2624 return _core_.Image_Paste(*args, **kwargs)
e811c8ce
RD
2625
2626 def GetData(*args, **kwargs):
61d07ac7
RD
2627 """
2628 GetData(self) -> PyObject
2629
2630 Returns a string containing a copy of the RGB bytes of the image.
2631 """
54f9ee45 2632 return _core_.Image_GetData(*args, **kwargs)
e811c8ce
RD
2633
2634 def SetData(*args, **kwargs):
61d07ac7
RD
2635 """
2636 SetData(self, buffer data)
2637
2638 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
2639 either a string or a buffer object holding the data and the length of
2640 the data must be width*height*3.
2641 """
54f9ee45 2642 return _core_.Image_SetData(*args, **kwargs)
e811c8ce
RD
2643
2644 def GetDataBuffer(*args, **kwargs):
61d07ac7
RD
2645 """
2646 GetDataBuffer(self) -> PyObject
2647
2648 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
2649 image data buffer inside the wx.Image. You need to ensure that you do
2650 not use this buffer object after the image has been destroyed.
61d07ac7 2651 """
54f9ee45 2652 return _core_.Image_GetDataBuffer(*args, **kwargs)
e811c8ce
RD
2653
2654 def SetDataBuffer(*args, **kwargs):
61d07ac7
RD
2655 """
2656 SetDataBuffer(self, buffer data)
2657
2658 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
2659 object. This can save making an extra copy of the data but you must
2660 ensure that the buffer object lives longer than the wx.Image does.
61d07ac7 2661 """
54f9ee45 2662 return _core_.Image_SetDataBuffer(*args, **kwargs)
e811c8ce
RD
2663
2664 def GetAlphaData(*args, **kwargs):
61d07ac7
RD
2665 """
2666 GetAlphaData(self) -> PyObject
2667
2668 Returns a string containing a copy of the alpha bytes of the image.
2669 """
54f9ee45 2670 return _core_.Image_GetAlphaData(*args, **kwargs)
e811c8ce
RD
2671
2672 def SetAlphaData(*args, **kwargs):
61d07ac7
RD
2673 """
2674 SetAlphaData(self, buffer alpha)
2675
2676 Resets the Image's alpha data from a buffer of bytes. Accepts either
2677 a string or a buffer object holding the data and the length of the
2678 data must be width*height.
2679 """
54f9ee45 2680 return _core_.Image_SetAlphaData(*args, **kwargs)
e811c8ce
RD
2681
2682 def GetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
2683 """
2684 GetAlphaBuffer(self) -> PyObject
2685
2686 Returns a writable Python buffer object that is pointing at the Alpha
2687 data buffer inside the wx.Image. You need to ensure that you do not
2688 use this buffer object after the image has been destroyed.
2689 """
54f9ee45 2690 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2691
2692 def SetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
2693 """
2694 SetAlphaBuffer(self, buffer alpha)
2695
2696 Sets the internal image alpha pointer to point at a Python buffer
2697 object. This can save making an extra copy of the data but you must
2698 ensure that the buffer object lives as long as the wx.Image does.
2699 """
54f9ee45 2700 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
e811c8ce
RD
2701
2702 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
2703 """
2704 SetMaskColour(self, byte r, byte g, byte b)
2705
2706 Sets the mask colour for this image (and tells the image to use the
2707 mask).
2708 """
54f9ee45 2709 return _core_.Image_SetMaskColour(*args, **kwargs)
e811c8ce 2710
aff4cc5c
RD
2711 def GetOrFindMaskColour(*args, **kwargs):
2712 """
2713 GetOrFindMaskColour() -> (r,g,b)
2714
2715 Get the current mask colour or find a suitable colour.
2716 """
2717 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
2718
e811c8ce 2719 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
2720 """
2721 GetMaskRed(self) -> byte
2722
2723 Gets the red component of the mask colour.
2724 """
54f9ee45 2725 return _core_.Image_GetMaskRed(*args, **kwargs)
e811c8ce
RD
2726
2727 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
2728 """
2729 GetMaskGreen(self) -> byte
2730
2731 Gets the green component of the mask colour.
2732 """
54f9ee45 2733 return _core_.Image_GetMaskGreen(*args, **kwargs)
e811c8ce
RD
2734
2735 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
2736 """
2737 GetMaskBlue(self) -> byte
2738
2739 Gets the blue component of the mask colour.
2740 """
54f9ee45 2741 return _core_.Image_GetMaskBlue(*args, **kwargs)
e811c8ce
RD
2742
2743 def SetMask(*args, **kwargs):
7a27cf7c
RD
2744 """
2745 SetMask(self, bool mask=True)
2746
2747 Specifies whether there is a mask or not. The area of the mask is
2748 determined by the current mask colour.
2749 """
54f9ee45 2750 return _core_.Image_SetMask(*args, **kwargs)
e811c8ce
RD
2751
2752 def HasMask(*args, **kwargs):
7a27cf7c
RD
2753 """
2754 HasMask(self) -> bool
2755
2756 Returns ``True`` if there is a mask active, ``False`` otherwise.
2757 """
54f9ee45 2758 return _core_.Image_HasMask(*args, **kwargs)
e811c8ce
RD
2759
2760 def Rotate(*args, **kwargs):
0df68c9f 2761 """
a95a7133 2762 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
0df68c9f 2763 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
2764
2765 Rotates the image about the given point, by ``angle`` radians. Passing
2766 ``True`` to ``interpolating`` results in better image quality, but is
2767 slower. If the image has a mask, then the mask colour is used for the
2768 uncovered pixels in the rotated image background. Otherwise, black
2769 will be used as the fill colour.
2770
2771 Returns the rotated image, leaving this image intact.
0df68c9f 2772 """
54f9ee45 2773 return _core_.Image_Rotate(*args, **kwargs)
e811c8ce
RD
2774
2775 def Rotate90(*args, **kwargs):
7a27cf7c
RD
2776 """
2777 Rotate90(self, bool clockwise=True) -> Image
2778
2779 Returns a copy of the image rotated 90 degrees in the direction
2780 indicated by ``clockwise``.
2781 """
54f9ee45 2782 return _core_.Image_Rotate90(*args, **kwargs)
e811c8ce
RD
2783
2784 def Mirror(*args, **kwargs):
7a27cf7c
RD
2785 """
2786 Mirror(self, bool horizontally=True) -> Image
2787
2788 Returns a mirrored copy of the image. The parameter ``horizontally``
2789 indicates the orientation.
2790 """
54f9ee45 2791 return _core_.Image_Mirror(*args, **kwargs)
e811c8ce
RD
2792
2793 def Replace(*args, **kwargs):
0df68c9f 2794 """
7a27cf7c
RD
2795 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
2796
2797 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
2798 ``(r2,g2,b2)``.
0df68c9f 2799 """
54f9ee45 2800 return _core_.Image_Replace(*args, **kwargs)
e811c8ce 2801
32fe5131
RD
2802 def ConvertToGreyscale(*args, **kwargs):
2803 """
2804 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
2805
2806 Convert to greyscale image. Uses the luminance component (Y) of the
2807 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
2808 defaults to ITU-T BT.601
2809 """
2810 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
2811
e811c8ce 2812 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
2813 """
2814 ConvertToMono(self, byte r, byte g, byte b) -> Image
2815
2816 Returns monochromatic version of the image. The returned image has
2817 white colour where the original has ``(r,g,b)`` colour and black
2818 colour everywhere else.
2819 """
54f9ee45 2820 return _core_.Image_ConvertToMono(*args, **kwargs)
e811c8ce
RD
2821
2822 def SetOption(*args, **kwargs):
7a27cf7c
RD
2823 """
2824 SetOption(self, String name, String value)
2825
2826 Sets an image handler defined option. For example, when saving as a
2827 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
2828 number between 0 and 100 (0 is terrible, 100 is very good).
2829 """
54f9ee45 2830 return _core_.Image_SetOption(*args, **kwargs)
e811c8ce
RD
2831
2832 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
2833 """
2834 SetOptionInt(self, String name, int value)
2835
2836 Sets an image option as an integer.
2837 """
54f9ee45 2838 return _core_.Image_SetOptionInt(*args, **kwargs)
e811c8ce
RD
2839
2840 def GetOption(*args, **kwargs):
7a27cf7c
RD
2841 """
2842 GetOption(self, String name) -> String
2843
2844 Gets the value of an image handler option.
2845 """
54f9ee45 2846 return _core_.Image_GetOption(*args, **kwargs)
e811c8ce
RD
2847
2848 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
2849 """
2850 GetOptionInt(self, String name) -> int
2851
2852 Gets the value of an image handler option as an integer. If the given
2853 option is not present, the function returns 0.
2854 """
54f9ee45 2855 return _core_.Image_GetOptionInt(*args, **kwargs)
e811c8ce
RD
2856
2857 def HasOption(*args, **kwargs):
7a27cf7c
RD
2858 """
2859 HasOption(self, String name) -> bool
2860
2861 Returns true if the given option is present.
2862 """
54f9ee45 2863 return _core_.Image_HasOption(*args, **kwargs)
e811c8ce
RD
2864
2865 def CountColours(*args, **kwargs):
a95a7133 2866 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
54f9ee45 2867 return _core_.Image_CountColours(*args, **kwargs)
e811c8ce
RD
2868
2869 def ComputeHistogram(*args, **kwargs):
a95a7133 2870 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
54f9ee45 2871 return _core_.Image_ComputeHistogram(*args, **kwargs)
e811c8ce
RD
2872
2873 def AddHandler(*args, **kwargs):
66c033b4 2874 """AddHandler(ImageHandler handler)"""
54f9ee45 2875 return _core_.Image_AddHandler(*args, **kwargs)
e811c8ce
RD
2876
2877 AddHandler = staticmethod(AddHandler)
2878 def InsertHandler(*args, **kwargs):
66c033b4 2879 """InsertHandler(ImageHandler handler)"""
54f9ee45 2880 return _core_.Image_InsertHandler(*args, **kwargs)
e811c8ce
RD
2881
2882 InsertHandler = staticmethod(InsertHandler)
2883 def RemoveHandler(*args, **kwargs):
66c033b4 2884 """RemoveHandler(String name) -> bool"""
54f9ee45 2885 return _core_.Image_RemoveHandler(*args, **kwargs)
e811c8ce
RD
2886
2887 RemoveHandler = staticmethod(RemoveHandler)
0085ce49
RD
2888 def GetHandlers(*args, **kwargs):
2889 """GetHandlers() -> PyObject"""
2890 return _core_.Image_GetHandlers(*args, **kwargs)
2891
2892 GetHandlers = staticmethod(GetHandlers)
e811c8ce 2893 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
2894 """
2895 GetImageExtWildcard() -> String
2896
2897 Iterates all registered wxImageHandler objects, and returns a string
2898 containing file extension masks suitable for passing to file open/save
2899 dialog boxes.
2900 """
54f9ee45 2901 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
e811c8ce
RD
2902
2903 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
2904 def ConvertToBitmap(*args, **kwargs):
1fbf26be 2905 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
54f9ee45 2906 return _core_.Image_ConvertToBitmap(*args, **kwargs)
e811c8ce
RD
2907
2908 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 2909 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
54f9ee45 2910 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
e811c8ce 2911
943e8dfd
RD
2912 def RotateHue(*args, **kwargs):
2913 """
2914 RotateHue(self, double angle)
2915
2916 Rotates the hue of each pixel of the image. Hue is a double in the
2917 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
2918 """
2919 return _core_.Image_RotateHue(*args, **kwargs)
2920
2921 def RGBtoHSV(*args, **kwargs):
2922 """
2923 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
2924
2925 Converts a color in RGB color space to HSV color space.
2926 """
2927 return _core_.Image_RGBtoHSV(*args, **kwargs)
2928
2929 RGBtoHSV = staticmethod(RGBtoHSV)
2930 def HSVtoRGB(*args, **kwargs):
2931 """
2932 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
2933
2934 Converts a color in HSV color space to RGB color space.
2935 """
2936 return _core_.Image_HSVtoRGB(*args, **kwargs)
2937
2938 HSVtoRGB = staticmethod(HSVtoRGB)
e811c8ce 2939 def __nonzero__(self): return self.Ok()
97ab0f6a
RD
2940 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
2941 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
2942 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
2943 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
2944 Height = property(GetHeight,doc="See `GetHeight`")
2945 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
2946 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
2947 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
2948 Size = property(GetSize,doc="See `GetSize`")
2949 Width = property(GetWidth,doc="See `GetWidth`")
2131d850 2950_core_.Image_swigregister(Image)
d14a1e28
RD
2951
2952def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
2953 """
2954 ImageFromMime(String name, String mimetype, int index=-1) -> Image
2955
2956 Loads an image from a file, using a MIME type string (such as
2957 'image/jpeg') to specify image type.
2958 """
54f9ee45 2959 val = _core_.new_ImageFromMime(*args, **kwargs)
d14a1e28
RD
2960 return val
2961
2962def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
2963 """
2964 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2965
2966 Loads an image from an input stream, or any readable Python file-like
2967 object.
2968 """
54f9ee45 2969 val = _core_.new_ImageFromStream(*args, **kwargs)
d14a1e28
RD
2970 return val
2971
2972def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
2973 """
2974 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
2975
2976 Loads an image from an input stream, or any readable Python file-like
2977 object, specifying the image format with a MIME type string.
2978 """
54f9ee45 2979 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d14a1e28
RD
2980 return val
2981
66c033b4 2982def EmptyImage(*args, **kwargs):
61d07ac7
RD
2983 """
2984 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
2985
2986 Construct an empty image of a given size, optionally setting all
2987 pixels to black.
2988 """
66c033b4 2989 val = _core_.new_EmptyImage(*args, **kwargs)
d14a1e28
RD
2990 return val
2991
2992def ImageFromBitmap(*args, **kwargs):
61d07ac7
RD
2993 """
2994 ImageFromBitmap(Bitmap bitmap) -> Image
2995
2996 Construct an Image from a `wx.Bitmap`.
2997 """
54f9ee45 2998 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d14a1e28
RD
2999 return val
3000
3001def ImageFromData(*args, **kwargs):
61d07ac7
RD
3002 """
3003 ImageFromData(int width, int height, buffer data) -> Image
3004
3005 Construct an Image from a buffer of RGB bytes. Accepts either a
3006 string or a buffer object holding the data and the length of the data
3007 must be width*height*3.
3008 """
54f9ee45 3009 val = _core_.new_ImageFromData(*args, **kwargs)
d14a1e28
RD
3010 return val
3011
1823fbb4 3012def ImageFromDataWithAlpha(*args, **kwargs):
61d07ac7
RD
3013 """
3014 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
3015
3016 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3017 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
3018 length of the data must be width*height*3 bytes, and the length of the
3019 alpha data must be width*height bytes.
61d07ac7 3020 """
1823fbb4 3021 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
1823fbb4
RD
3022 return val
3023
e811c8ce 3024def Image_CanRead(*args, **kwargs):
0085ce49 3025 """
7a27cf7c
RD
3026 Image_CanRead(String filename) -> bool
3027
3028 Returns True if the image handlers can read this file.
3029 """
0085ce49 3030 return _core_.Image_CanRead(*args, **kwargs)
d14a1e28 3031
e811c8ce 3032def Image_GetImageCount(*args, **kwargs):
0085ce49 3033 """
7a27cf7c
RD
3034 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3035
3036 If the image file contains more than one image and the image handler
3037 is capable of retrieving these individually, this function will return
3038 the number of available images.
3039 """
0085ce49 3040 return _core_.Image_GetImageCount(*args, **kwargs)
d14a1e28 3041
e811c8ce 3042def Image_CanReadStream(*args, **kwargs):
0085ce49 3043 """
7a27cf7c
RD
3044 Image_CanReadStream(InputStream stream) -> bool
3045
3046 Returns True if the image handlers can read an image file from the
3047 data currently on the input stream, or a readable Python file-like
3048 object.
3049 """
0085ce49 3050 return _core_.Image_CanReadStream(*args, **kwargs)
d14a1e28 3051
e811c8ce 3052def Image_AddHandler(*args, **kwargs):
0085ce49
RD
3053 """Image_AddHandler(ImageHandler handler)"""
3054 return _core_.Image_AddHandler(*args, **kwargs)
d14a1e28 3055
e811c8ce 3056def Image_InsertHandler(*args, **kwargs):
0085ce49
RD
3057 """Image_InsertHandler(ImageHandler handler)"""
3058 return _core_.Image_InsertHandler(*args, **kwargs)
d14a1e28 3059
e811c8ce 3060def Image_RemoveHandler(*args, **kwargs):
0085ce49
RD
3061 """Image_RemoveHandler(String name) -> bool"""
3062 return _core_.Image_RemoveHandler(*args, **kwargs)
d14a1e28 3063
0085ce49
RD
3064def Image_GetHandlers(*args):
3065 """Image_GetHandlers() -> PyObject"""
3066 return _core_.Image_GetHandlers(*args)
3067
3068def Image_GetImageExtWildcard(*args):
3069 """
7a27cf7c
RD
3070 Image_GetImageExtWildcard() -> String
3071
3072 Iterates all registered wxImageHandler objects, and returns a string
3073 containing file extension masks suitable for passing to file open/save
3074 dialog boxes.
3075 """
0085ce49 3076 return _core_.Image_GetImageExtWildcard(*args)
d14a1e28 3077
943e8dfd 3078def Image_RGBtoHSV(*args, **kwargs):
0085ce49 3079 """
943e8dfd
RD
3080 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3081
3082 Converts a color in RGB color space to HSV color space.
3083 """
0085ce49 3084 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3085
3086def Image_HSVtoRGB(*args, **kwargs):
0085ce49 3087 """
943e8dfd
RD
3088 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3089
3090 Converts a color in HSV color space to RGB color space.
3091 """
0085ce49 3092 return _core_.Image_HSVtoRGB(*args, **kwargs)
943e8dfd 3093
fc46b7f3
RD
3094
3095def _ImageFromBuffer(*args, **kwargs):
3096 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3097 return _core_._ImageFromBuffer(*args, **kwargs)
3098def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3099 """
3100 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
eec1c382
RD
3101 parameter must be a Python object that implements the buffer interface,
3102 such as a string, array, etc. The dataBuffer object is expected to
3103 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3104 object can optionally be supplied for the image's alpha channel data, and
3105 it is expected to be width*height bytes long.
fc46b7f3
RD
3106
3107 The wx.Image will be created with its data and alpha pointers initialized
3108 to the memory address pointed to by the buffer objects, thus saving the
3109 time needed to copy the image data from the buffer object to the wx.Image.
3110 While this has advantages, it also has the shoot-yourself-in-the-foot
3111 risks associated with sharing a C pointer between two objects.
3112
3113 To help alleviate the risk a reference to the data and alpha buffer
3114 objects are kept with the wx.Image, so that they won't get deleted until
3115 after the wx.Image is deleted. However please be aware that it is not
3116 guaranteed that an object won't move its memory buffer to a new location
3117 when it needs to resize its contents. If that happens then the wx.Image
3118 will end up referring to an invalid memory location and could cause the
3119 application to crash. Therefore care should be taken to not manipulate
3120 the objects used for the data and alpha buffers in a way that would cause
3121 them to change size.
3122 """
fc46b7f3
RD
3123 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3124 image._buffer = dataBuffer
3125 image._alpha = alphaBuffer
3126 return image
3127
5e4ca4a8
RD
3128def InitAllImageHandlers():
3129 """
3130 The former functionality of InitAllImageHanders is now done internal to
3131 the _core_ extension module and so this function has become a simple NOP.
3132 """
3133 pass
d14a1e28 3134
54f9ee45
RD
3135IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3136IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
b9d6a5f3
RD
3137PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3138PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3139PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
54f9ee45
RD
3140BMP_24BPP = _core_.BMP_24BPP
3141BMP_8BPP = _core_.BMP_8BPP
3142BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3143BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3144BMP_8BPP_RED = _core_.BMP_8BPP_RED
3145BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3146BMP_4BPP = _core_.BMP_4BPP
3147BMP_1BPP = _core_.BMP_1BPP
3148BMP_1BPP_BW = _core_.BMP_1BPP_BW
d14a1e28 3149class BMPHandler(ImageHandler):
27fb7603 3150 """A `wx.ImageHandler` for \*.bmp bitmap files."""
0085ce49
RD
3151 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3152 __repr__ = _swig_repr
3153 def __init__(self, *args, **kwargs):
27fb7603
RD
3154 """
3155 __init__(self) -> BMPHandler
3156
3157 A `wx.ImageHandler` for \*.bmp bitmap files.
3158 """
0085ce49 3159 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3160_core_.BMPHandler_swigregister(BMPHandler)
d14a1e28 3161NullImage = cvar.NullImage
0c243d93 3162IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d14a1e28
RD
3163IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3164IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3165IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3166IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
0c243d93
RD
3167IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3168IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d14a1e28 3169IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3170IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
0c243d93
RD
3171IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3172IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3173IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3174IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
b9d6a5f3
RD
3175IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3176IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d14a1e28
RD
3177
3178class ICOHandler(BMPHandler):
27fb7603 3179 """A `wx.ImageHandler` for \*.ico icon files."""
0085ce49
RD
3180 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3181 __repr__ = _swig_repr
3182 def __init__(self, *args, **kwargs):
27fb7603
RD
3183 """
3184 __init__(self) -> ICOHandler
3185
3186 A `wx.ImageHandler` for \*.ico icon files.
3187 """
0085ce49 3188 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3189_core_.ICOHandler_swigregister(ICOHandler)
d14a1e28
RD
3190
3191class CURHandler(ICOHandler):
27fb7603 3192 """A `wx.ImageHandler` for \*.cur cursor files."""
0085ce49
RD
3193 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3194 __repr__ = _swig_repr
3195 def __init__(self, *args, **kwargs):
27fb7603
RD
3196 """
3197 __init__(self) -> CURHandler
3198
3199 A `wx.ImageHandler` for \*.cur cursor files.
3200 """
0085ce49 3201 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3202_core_.CURHandler_swigregister(CURHandler)
d14a1e28
RD
3203
3204class ANIHandler(CURHandler):
27fb7603 3205 """A `wx.ImageHandler` for \*.ani animated cursor files."""
0085ce49
RD
3206 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3207 __repr__ = _swig_repr
3208 def __init__(self, *args, **kwargs):
27fb7603
RD
3209 """
3210 __init__(self) -> ANIHandler
3211
3212 A `wx.ImageHandler` for \*.ani animated cursor files.
3213 """
0085ce49 3214 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3215_core_.ANIHandler_swigregister(ANIHandler)
d14a1e28
RD
3216
3217class PNGHandler(ImageHandler):
27fb7603 3218 """A `wx.ImageHandler` for PNG image files."""
0085ce49
RD
3219 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3220 __repr__ = _swig_repr
3221 def __init__(self, *args, **kwargs):
27fb7603
RD
3222 """
3223 __init__(self) -> PNGHandler
3224
3225 A `wx.ImageHandler` for PNG image files.
3226 """
0085ce49 3227 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3228_core_.PNGHandler_swigregister(PNGHandler)
d14a1e28
RD
3229
3230class GIFHandler(ImageHandler):
27fb7603 3231 """A `wx.ImageHandler` for GIF image files."""
0085ce49
RD
3232 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3233 __repr__ = _swig_repr
3234 def __init__(self, *args, **kwargs):
27fb7603
RD
3235 """
3236 __init__(self) -> GIFHandler
3237
3238 A `wx.ImageHandler` for GIF image files.
3239 """
0085ce49 3240 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3241_core_.GIFHandler_swigregister(GIFHandler)
d14a1e28
RD
3242
3243class PCXHandler(ImageHandler):
27fb7603 3244 """A `wx.ImageHandler` for PCX imager files."""
0085ce49
RD
3245 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3246 __repr__ = _swig_repr
3247 def __init__(self, *args, **kwargs):
27fb7603
RD
3248 """
3249 __init__(self) -> PCXHandler
3250
3251 A `wx.ImageHandler` for PCX imager files.
3252 """
0085ce49 3253 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3254_core_.PCXHandler_swigregister(PCXHandler)
d14a1e28
RD
3255
3256class JPEGHandler(ImageHandler):
27fb7603 3257 """A `wx.ImageHandler` for JPEG/JPG image files."""
0085ce49
RD
3258 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3259 __repr__ = _swig_repr
3260 def __init__(self, *args, **kwargs):
27fb7603
RD
3261 """
3262 __init__(self) -> JPEGHandler
3263
3264 A `wx.ImageHandler` for JPEG/JPG image files.
3265 """
0085ce49 3266 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3267_core_.JPEGHandler_swigregister(JPEGHandler)
d14a1e28
RD
3268
3269class PNMHandler(ImageHandler):
27fb7603 3270 """A `wx.ImageHandler` for PNM image files."""
0085ce49
RD
3271 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3272 __repr__ = _swig_repr
3273 def __init__(self, *args, **kwargs):
27fb7603
RD
3274 """
3275 __init__(self) -> PNMHandler
3276
3277 A `wx.ImageHandler` for PNM image files.
3278 """
0085ce49 3279 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3280_core_.PNMHandler_swigregister(PNMHandler)
d14a1e28
RD
3281
3282class XPMHandler(ImageHandler):
27fb7603 3283 """A `wx.ImageHandler` for XPM image."""
0085ce49
RD
3284 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3285 __repr__ = _swig_repr
3286 def __init__(self, *args, **kwargs):
27fb7603
RD
3287 """
3288 __init__(self) -> XPMHandler
3289
3290 A `wx.ImageHandler` for XPM image.
3291 """
0085ce49 3292 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3293_core_.XPMHandler_swigregister(XPMHandler)
d14a1e28
RD
3294
3295class TIFFHandler(ImageHandler):
27fb7603 3296 """A `wx.ImageHandler` for TIFF image files."""
0085ce49
RD
3297 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3298 __repr__ = _swig_repr
3299 def __init__(self, *args, **kwargs):
27fb7603
RD
3300 """
3301 __init__(self) -> TIFFHandler
3302
3303 A `wx.ImageHandler` for TIFF image files.
3304 """
0085ce49 3305 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3306_core_.TIFFHandler_swigregister(TIFFHandler)
d14a1e28 3307
c0de73ae
RD
3308QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3309QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3310class Quantize(object):
3311 """Performs quantization, or colour reduction, on a wxImage."""
0085ce49
RD
3312 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3313 def __init__(self): raise AttributeError, "No constructor defined"
3314 __repr__ = _swig_repr
c0de73ae
RD
3315 def Quantize(*args, **kwargs):
3316 """
3317 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3318
3319 Reduce the colours in the source image and put the result into the
3320 destination image, setting the palette in the destination if
3321 needed. Both images may be the same, to overwrite the source image.
3322 """
3323 return _core_.Quantize_Quantize(*args, **kwargs)
3324
3325 Quantize = staticmethod(Quantize)
2131d850 3326_core_.Quantize_swigregister(Quantize)
c0de73ae
RD
3327
3328def Quantize_Quantize(*args, **kwargs):
0085ce49 3329 """
c0de73ae
RD
3330 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
3331
3332 Reduce the colours in the source image and put the result into the
3333 destination image, setting the palette in the destination if
3334 needed. Both images may be the same, to overwrite the source image.
3335 """
0085ce49 3336 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3337
d14a1e28
RD
3338#---------------------------------------------------------------------------
3339
3340class EvtHandler(Object):
093d3ff1 3341 """Proxy of C++ EvtHandler class"""
0085ce49
RD
3342 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3343 __repr__ = _swig_repr
3344 def __init__(self, *args, **kwargs):
a95a7133 3345 """__init__(self) -> EvtHandler"""
0085ce49 3346 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
e811c8ce 3347 def GetNextHandler(*args, **kwargs):
a95a7133 3348 """GetNextHandler(self) -> EvtHandler"""
54f9ee45 3349 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
e811c8ce
RD
3350
3351 def GetPreviousHandler(*args, **kwargs):
a95a7133 3352 """GetPreviousHandler(self) -> EvtHandler"""
54f9ee45 3353 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3354
3355 def SetNextHandler(*args, **kwargs):
a95a7133 3356 """SetNextHandler(self, EvtHandler handler)"""
54f9ee45 3357 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
e811c8ce
RD
3358
3359 def SetPreviousHandler(*args, **kwargs):
a95a7133 3360 """SetPreviousHandler(self, EvtHandler handler)"""
54f9ee45 3361 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
e811c8ce
RD
3362
3363 def GetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3364 """GetEvtHandlerEnabled(self) -> bool"""
54f9ee45 3365 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3366
3367 def SetEvtHandlerEnabled(*args, **kwargs):
a95a7133 3368 """SetEvtHandlerEnabled(self, bool enabled)"""
54f9ee45 3369 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
e811c8ce
RD
3370
3371 def ProcessEvent(*args, **kwargs):
a95a7133 3372 """ProcessEvent(self, Event event) -> bool"""
54f9ee45 3373 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
e811c8ce
RD
3374
3375 def AddPendingEvent(*args, **kwargs):
a95a7133 3376 """AddPendingEvent(self, Event event)"""
54f9ee45 3377 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
e811c8ce
RD
3378
3379 def ProcessPendingEvents(*args, **kwargs):
a95a7133 3380 """ProcessPendingEvents(self)"""
54f9ee45 3381 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
3382
3383 def Connect(*args, **kwargs):
a95a7133 3384 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
54f9ee45 3385 return _core_.EvtHandler_Connect(*args, **kwargs)
e811c8ce
RD
3386
3387 def Disconnect(*args, **kwargs):
2131d850 3388 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
54f9ee45 3389 return _core_.EvtHandler_Disconnect(*args, **kwargs)
e811c8ce
RD
3390
3391 def _setOORInfo(*args, **kwargs):
689b42ee 3392 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef
RD
3393 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
3394 args[0].thisown = 0
3395 return val
e811c8ce 3396
d14a1e28
RD
3397 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3398 """
3399 Bind an event to an event handler.
3400
db3e571a
RD
3401 :param event: One of the EVT_* objects that specifies the
3402 type of event to bind,
d14a1e28 3403
db3e571a
RD
3404 :param handler: A callable object to be invoked when the
3405 event is delivered to self. Pass None to
3406 disconnect an event handler.
d14a1e28 3407
db3e571a
RD
3408 :param source: Sometimes the event originates from a
3409 different window than self, but you still
3410 want to catch it in self. (For example, a
3411 button event delivered to a frame.) By
3412 passing the source of the event, the event
3413 handling system is able to differentiate
3414 between the same event type from different
3415 controls.
d14a1e28 3416
db3e571a
RD
3417 :param id: Used to spcify the event source by ID instead
3418 of instance.
3419
3420 :param id2: Used when it is desirable to bind a handler
3421 to a range of IDs, such as with EVT_MENU_RANGE.
d14a1e28
RD
3422 """
3423 if source is not None:
3424 id = source.GetId()
3425 event.Bind(self, id, id2, handler)
3426
66c033b4
RD
3427 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3428 """
3429 Disconencts the event handler binding for event from self.
3430 Returns True if successful.
3431 """
3432 if source is not None:
3433 id = source.GetId()
3434 return event.Unbind(self, id, id2)
d14a1e28 3435
97ab0f6a
RD
3436 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3437 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3438 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
2131d850 3439_core_.EvtHandler_swigregister(EvtHandler)
d14a1e28
RD
3440
3441#---------------------------------------------------------------------------
3442
3443class PyEventBinder(object):
3444 """
3445 Instances of this class are used to bind specific events to event
3446 handlers.
3447 """
3448 def __init__(self, evtType, expectedIDs=0):
3449 if expectedIDs not in [0, 1, 2]:
3450 raise ValueError, "Invalid number of expectedIDs"
3451 self.expectedIDs = expectedIDs
3452
3453 if type(evtType) == list or type(evtType) == tuple:
3454 self.evtType = evtType
3455 else:
3456 self.evtType = [evtType]
3457
3458
3459 def Bind(self, target, id1, id2, function):
3460 """Bind this set of event types to target."""
3461 for et in self.evtType:
3462 target.Connect(id1, id2, et, function)
3463
66c033b4
RD
3464
3465 def Unbind(self, target, id1, id2):
3466 """Remove an event binding."""
3467 success = 0
3468 for et in self.evtType:
3469 success += target.Disconnect(id1, id2, et)
3470 return success != 0
3471
d14a1e28
RD
3472
3473 def __call__(self, *args):
3474 """
3475 For backwards compatibility with the old EVT_* functions.
3476 Should be called with either (window, func), (window, ID,
3477 func) or (window, ID1, ID2, func) parameters depending on the
3478 type of the event.
3479 """
3480 assert len(args) == 2 + self.expectedIDs
3481 id1 = wx.ID_ANY
3482 id2 = wx.ID_ANY
3483 target = args[0]
3484 if self.expectedIDs == 0:
3485 func = args[1]
3486 elif self.expectedIDs == 1:
3487 id1 = args[1]
3488 func = args[2]
3489 elif self.expectedIDs == 2:
3490 id1 = args[1]
3491 id2 = args[2]
3492 func = args[3]
3493 else:
3494 raise ValueError, "Unexpected number of IDs"
3495
3496 self.Bind(target, id1, id2, func)
3497
3498
3499# These two are square pegs that don't fit the PyEventBinder hole...
3500def EVT_COMMAND(win, id, cmd, func):
3501 win.Connect(id, -1, cmd, func)
3502def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3503 win.Connect(id1, id2, cmd, func)
3504
3505
3506#---------------------------------------------------------------------------
3507
3508#---------------------------------------------------------------------------
3509
54f9ee45
RD
3510EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3511EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
d14a1e28 3512
0085ce49 3513def NewEventType(*args):
2131d850 3514 """NewEventType() -> EventType"""
0085ce49 3515 return _core_.NewEventType(*args)
54f9ee45
RD
3516wxEVT_NULL = _core_.wxEVT_NULL
3517wxEVT_FIRST = _core_.wxEVT_FIRST
3518wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3519wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3520wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3521wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3522wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3523wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3524wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3525wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3526wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3527wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3528wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3529wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3530wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3531wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3532wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3533wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3534wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3535wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3536wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3537wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3538wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3539wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3540wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3541wxEVT_MOTION = _core_.wxEVT_MOTION
3542wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3543wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3544wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3545wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3546wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3547wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3548wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3549wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3550wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3551wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3552wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3553wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3554wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3555wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3556wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3557wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3558wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3559wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3560wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3561wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3562wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3563wxEVT_CHAR = _core_.wxEVT_CHAR
3564wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3565wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3566wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3567wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3568wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3569wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3570wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3571wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3572wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3573wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3574wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3575wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3576wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3577wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3578wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3579wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
54f9ee45
RD
3580wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3581wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3582wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3583wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3584wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3585wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3586wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3587wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3588wxEVT_SIZE = _core_.wxEVT_SIZE
3589wxEVT_MOVE = _core_.wxEVT_MOVE
3590wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3591wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3592wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3593wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
54f9ee45
RD
3594wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3595wxEVT_CREATE = _core_.wxEVT_CREATE
3596wxEVT_DESTROY = _core_.wxEVT_DESTROY
3597wxEVT_SHOW = _core_.wxEVT_SHOW
3598wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3599wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3600wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
34e0a3bb 3601wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
54f9ee45
RD
3602wxEVT_PAINT = _core_.wxEVT_PAINT
3603wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3604wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3605wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3606wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3607wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3608wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3609wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3610wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3611wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3612wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
3613wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
3614wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
3615wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
3616wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
3617wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
3618wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
3619wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
3620wxEVT_IDLE = _core_.wxEVT_IDLE
3621wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
3622wxEVT_SIZING = _core_.wxEVT_SIZING
3623wxEVT_MOVING = _core_.wxEVT_MOVING
88c6b281 3624wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
3625wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
3626wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
3627wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
54f9ee45
RD
3628wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
3629wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
3630wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
3631wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
3632wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
3633wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
3634wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d14a1e28
RD
3635#
3636# Create some event binders
3637EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
3638EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
3639EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
3640EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
3641EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
3642EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3643EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3644EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
3645EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
3646EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
3647EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
3648EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
3649EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 3650EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d14a1e28
RD
3651EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
3652EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
3653EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
3654EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
3655EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
3656EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
3657EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
3658EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
3659EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
3660EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 3661EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d14a1e28
RD
3662EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
3663EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
3664EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
3665EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
3666EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
3667EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
3668EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
3669EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
3670EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
3671EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
3672EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
3673EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
3674EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
3675EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
3676EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
3677EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
34e0a3bb 3678EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
d14a1e28
RD
3679
3680EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
3681EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
3682EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
3683EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
3684EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
3685EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
3686EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
3687EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
3688EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
3689EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
3690EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
3691EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
3692EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
3693
3694EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
3695 wxEVT_LEFT_UP,
3696 wxEVT_MIDDLE_DOWN,
3697 wxEVT_MIDDLE_UP,
3698 wxEVT_RIGHT_DOWN,
3699 wxEVT_RIGHT_UP,
3700 wxEVT_MOTION,
3701 wxEVT_LEFT_DCLICK,
3702 wxEVT_MIDDLE_DCLICK,
3703 wxEVT_RIGHT_DCLICK,
3704 wxEVT_ENTER_WINDOW,
3705 wxEVT_LEAVE_WINDOW,
3706 wxEVT_MOUSEWHEEL
3707 ])
3708
3709
3710# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 3711EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d14a1e28
RD
3712 wxEVT_SCROLLWIN_BOTTOM,
3713 wxEVT_SCROLLWIN_LINEUP,
3714 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 3715 wxEVT_SCROLLWIN_PAGEUP,
d14a1e28
RD
3716 wxEVT_SCROLLWIN_PAGEDOWN,
3717 wxEVT_SCROLLWIN_THUMBTRACK,
3718 wxEVT_SCROLLWIN_THUMBRELEASE,
3719 ])
3720
3721EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
3722EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
3723EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
3724EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
3725EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
3726EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
3727EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
3728EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
3729
27fb7603 3730# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
3731EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3732 wxEVT_SCROLL_BOTTOM,
3733 wxEVT_SCROLL_LINEUP,
3734 wxEVT_SCROLL_LINEDOWN,
3735 wxEVT_SCROLL_PAGEUP,
3736 wxEVT_SCROLL_PAGEDOWN,
3737 wxEVT_SCROLL_THUMBTRACK,
3738 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3739 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
3740 ])
3741
3742EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
3743EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
3744EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
3745EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
3746EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
3747EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
3748EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
3749EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
3750EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
3751EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 3752
27fb7603 3753# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
3754EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
3755 wxEVT_SCROLL_BOTTOM,
3756 wxEVT_SCROLL_LINEUP,
3757 wxEVT_SCROLL_LINEDOWN,
3758 wxEVT_SCROLL_PAGEUP,
3759 wxEVT_SCROLL_PAGEDOWN,
3760 wxEVT_SCROLL_THUMBTRACK,
d14a1e28 3761 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 3762 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
3763 ], 1)
3764
3765EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
3766EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
3767EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
3768EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
3769EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
3770EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
3771EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
3772EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
3773EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
3774EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d14a1e28 3775
d14a1e28
RD
3776EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
3777EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
3778EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
3779EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
3780EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
3781EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
3782EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
3783EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
3784EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
3785EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
3786
3787EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
3788EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
3789EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
3790EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
3791EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
3792EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
3793EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
3794EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
3795EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
3796
3797
3798EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
3799EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
3800EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
3801EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
3802EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
3803EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
3804EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
3805
3806EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
3807
3808EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
3809EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
3810
3811EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
3812
2131d850
RD
3813EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
3814EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
3815EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d14a1e28
RD
3816
3817
3818#---------------------------------------------------------------------------
3819
3820class Event(Object):
27fb7603
RD
3821 """
3822 An event is a structure holding information about an event passed to a
3823 callback or member function. wx.Event is an abstract base class for
3824 other event classes
3825 """
0085ce49
RD
3826 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3827 def __init__(self): raise AttributeError, "No constructor defined"
3828 __repr__ = _swig_repr
3829 __swig_destroy__ = _core_.delete_Event
3830 __del__ = lambda self : None;
e811c8ce 3831 def SetEventType(*args, **kwargs):
27fb7603 3832 """
2131d850 3833 SetEventType(self, EventType typ)
27fb7603
RD
3834
3835 Sets the specific type of the event.
3836 """
54f9ee45 3837 return _core_.Event_SetEventType(*args, **kwargs)
e811c8ce
RD
3838
3839 def GetEventType(*args, **kwargs):
27fb7603 3840 """
2131d850 3841 GetEventType(self) -> EventType
27fb7603
RD
3842
3843 Returns the identifier of the given event type, such as
3844 ``wxEVT_COMMAND_BUTTON_CLICKED``.
3845 """
54f9ee45 3846 return _core_.Event_GetEventType(*args, **kwargs)
e811c8ce
RD
3847
3848 def GetEventObject(*args, **kwargs):
27fb7603
RD
3849 """
3850 GetEventObject(self) -> Object
3851
3852 Returns the object (usually a window) associated with the event, if
3853 any.
3854 """
54f9ee45 3855 return _core_.Event_GetEventObject(*args, **kwargs)
e811c8ce
RD
3856
3857 def SetEventObject(*args, **kwargs):
27fb7603
RD
3858 """
3859 SetEventObject(self, Object obj)
3860
3861 Sets the originating object, or in other words, obj is normally the
3862 object that is sending the event.
3863 """
54f9ee45 3864 return _core_.Event_SetEventObject(*args, **kwargs)
e811c8ce
RD
3865
3866 def GetTimestamp(*args, **kwargs):
a95a7133 3867 """GetTimestamp(self) -> long"""
54f9ee45 3868 return _core_.Event_GetTimestamp(*args, **kwargs)
e811c8ce
RD
3869
3870 def SetTimestamp(*args, **kwargs):
a95a7133 3871 """SetTimestamp(self, long ts=0)"""
54f9ee45 3872 return _core_.Event_SetTimestamp(*args, **kwargs)
e811c8ce
RD
3873
3874 def GetId(*args, **kwargs):
27fb7603
RD
3875 """
3876 GetId(self) -> int
3877
3878 Returns the identifier associated with this event, such as a button
3879 command id.
3880 """
54f9ee45 3881 return _core_.Event_GetId(*args, **kwargs)
e811c8ce
RD
3882
3883 def SetId(*args, **kwargs):
27fb7603
RD
3884 """
3885 SetId(self, int Id)
3886
3887 Set's the ID for the event. This is usually the ID of the window that
3888 is sending the event, but it can also be a command id from a menu
3889 item, etc.
3890 """
54f9ee45 3891 return _core_.Event_SetId(*args, **kwargs)
e811c8ce
RD
3892
3893 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
3894 """
3895 IsCommandEvent(self) -> bool
3896
3897 Returns true if the event is or is derived from `wx.CommandEvent` else
3898 it returns false. Note: Exists only for optimization purposes.
3899 """
54f9ee45 3900 return _core_.Event_IsCommandEvent(*args, **kwargs)
e811c8ce
RD
3901
3902 def Skip(*args, **kwargs):
51b83b37
RD
3903 """
3904 Skip(self, bool skip=True)
3905
3906 Called by an event handler, it controls whether additional event
3907 handlers bound to this event will be called after the current event
3908 handler returns. Skip(false) (the default setting) will prevent
3909 additional event handlers from being called and control will be
3910 returned to the sender of the event immediately after the current
3911 handler has finished. Skip(True) will cause the event processing
3912 system to continue searching for a handler function for this event.
3913
3914 """
54f9ee45 3915 return _core_.Event_Skip(*args, **kwargs)
e811c8ce
RD
3916
3917 def GetSkipped(*args, **kwargs):
27fb7603
RD
3918 """
3919 GetSkipped(self) -> bool
3920
3921 Returns true if the event handler should be skipped, false otherwise.
3922 :see: `Skip`
3923 """
54f9ee45 3924 return _core_.Event_GetSkipped(*args, **kwargs)
e811c8ce
RD
3925
3926 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
3927 """
3928 ShouldPropagate(self) -> bool
3929
3930 Test if this event should be propagated to the parent window or not,
3931 i.e. if the propagation level is currently greater than 0.
3932 """
54f9ee45 3933 return _core_.Event_ShouldPropagate(*args, **kwargs)
e811c8ce
RD
3934
3935 def StopPropagation(*args, **kwargs):
27fb7603
RD
3936 """
3937 StopPropagation(self) -> int
3938
3939 Stop the event from propagating to its parent window. Returns the old
3940 propagation level value which may be later passed to
3941 `ResumePropagation` to allow propagating the event again.
3942 """
54f9ee45 3943 return _core_.Event_StopPropagation(*args, **kwargs)
e811c8ce
RD
3944
3945 def ResumePropagation(*args, **kwargs):
27fb7603
RD
3946 """
3947 ResumePropagation(self, int propagationLevel)
3948
3949 Resume the event propagation by restoring the propagation level. (For
3950 example, you can use the value returned by an earlier call to
3951 `StopPropagation`.)
3952
3953 """
54f9ee45 3954 return _core_.Event_ResumePropagation(*args, **kwargs)
e811c8ce
RD
3955
3956 def Clone(*args, **kwargs):
a95a7133 3957 """Clone(self) -> Event"""
54f9ee45 3958 return _core_.Event_Clone(*args, **kwargs)
e811c8ce 3959
97ab0f6a
RD
3960 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
3961 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
3962 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
3963 Skipped = property(GetSkipped,doc="See `GetSkipped`")
3964 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
2131d850 3965_core_.Event_swigregister(Event)
d14a1e28
RD
3966
3967#---------------------------------------------------------------------------
3968
3969class PropagationDisabler(object):
27fb7603
RD
3970 """
3971 Helper class to temporarily change an event not to propagate. Simply
3972 create an instance of this class and then whe it is destroyed the
3973 propogation of the event will be restored.
3974 """
0085ce49
RD
3975 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3976 __repr__ = _swig_repr
3977 def __init__(self, *args, **kwargs):
27fb7603
RD
3978 """
3979 __init__(self, Event event) -> PropagationDisabler
3980
3981 Helper class to temporarily change an event not to propagate. Simply
3982 create an instance of this class and then whe it is destroyed the
3983 propogation of the event will be restored.
3984 """
0085ce49
RD
3985 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
3986 __swig_destroy__ = _core_.delete_PropagationDisabler
3987 __del__ = lambda self : None;
2131d850 3988_core_.PropagationDisabler_swigregister(PropagationDisabler)
d14a1e28
RD
3989
3990class PropagateOnce(object):
27fb7603
RD
3991 """
3992 A helper class that will temporarily lower propagation level of an
3993 event. Simply create an instance of this class and then whe it is
3994 destroyed the propogation of the event will be restored.
3995 """
0085ce49
RD
3996 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3997 __repr__ = _swig_repr
3998 def __init__(self, *args, **kwargs):
27fb7603
RD
3999 """
4000 __init__(self, Event event) -> PropagateOnce
4001
4002 A helper class that will temporarily lower propagation level of an
4003 event. Simply create an instance of this class and then whe it is
4004 destroyed the propogation of the event will be restored.
4005 """
0085ce49
RD
4006 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4007 __swig_destroy__ = _core_.delete_PropagateOnce
4008 __del__ = lambda self : None;
2131d850 4009_core_.PropagateOnce_swigregister(PropagateOnce)
d14a1e28
RD
4010
4011#---------------------------------------------------------------------------
4012
4013class CommandEvent(Event):
27fb7603
RD
4014 """
4015 This event class contains information about command events, which
4016 originate from a variety of simple controls, as well as menus and
4017 toolbars.
4018 """
0085ce49
RD
4019 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4020 __repr__ = _swig_repr
4021 def __init__(self, *args, **kwargs):
27fb7603 4022 """
2131d850 4023 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
4024
4025 This event class contains information about command events, which
4026 originate from a variety of simple controls, as well as menus and
4027 toolbars.
4028 """
0085ce49 4029 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
e811c8ce 4030 def GetSelection(*args, **kwargs):
27fb7603
RD
4031 """
4032 GetSelection(self) -> int
4033
4034 Returns item index for a listbox or choice selection event (not valid
4035 for a deselection).
4036 """
54f9ee45 4037 return _core_.CommandEvent_GetSelection(*args, **kwargs)
e811c8ce
RD
4038
4039 def SetString(*args, **kwargs):
a95a7133 4040 """SetString(self, String s)"""
54f9ee45 4041 return _core_.CommandEvent_SetString(*args, **kwargs)
e811c8ce
RD
4042
4043 def GetString(*args, **kwargs):
27fb7603
RD
4044 """
4045 GetString(self) -> String
4046
4047 Returns item string for a listbox or choice selection event (not valid
4048 for a deselection).
4049 """
54f9ee45 4050 return _core_.CommandEvent_GetString(*args, **kwargs)
e811c8ce
RD
4051
4052 def IsChecked(*args, **kwargs):
27fb7603
RD
4053 """
4054 IsChecked(self) -> bool
4055
4056 This method can be used with checkbox and menu events: for the
4057 checkboxes, the method returns true for a selection event and false
4058 for a deselection one. For the menu events, this method indicates if
4059 the menu item just has become checked or unchecked (and thus only
4060 makes sense for checkable menu items).
4061 """
54f9ee45 4062 return _core_.CommandEvent_IsChecked(*args, **kwargs)
e811c8ce 4063
242b7b46 4064 Checked = IsChecked
e811c8ce 4065 def IsSelection(*args, **kwargs):
27fb7603
RD
4066 """
4067 IsSelection(self) -> bool
4068
4069 For a listbox or similar event, returns true if it is a selection,
4070 false if it is a deselection.
4071 """
54f9ee45 4072 return _core_.CommandEvent_IsSelection(*args, **kwargs)
e811c8ce
RD
4073
4074 def SetExtraLong(*args, **kwargs):
a95a7133 4075 """SetExtraLong(self, long extraLong)"""
54f9ee45 4076 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
e811c8ce
RD
4077
4078 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4079 """
4080 GetExtraLong(self) -> long
4081
5ba5649b
RD
4082 Returns extra information dependant on the event objects type. If the
4083 event comes from a listbox selection, it is a boolean determining
4084 whether the event was a selection (true) or a deselection (false). A
4085 listbox deselection only occurs for multiple-selection boxes, and in
4086 this case the index and string values are indeterminate and the
4087 listbox must be examined by the application.
27fb7603 4088 """
54f9ee45 4089 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
e811c8ce
RD
4090
4091 def SetInt(*args, **kwargs):
a95a7133 4092 """SetInt(self, int i)"""
54f9ee45 4093 return _core_.CommandEvent_SetInt(*args, **kwargs)
e811c8ce
RD
4094
4095 def GetInt(*args, **kwargs):
27fb7603 4096 """
01f6b6d3 4097 GetInt(self) -> int
27fb7603 4098
5ba5649b
RD
4099 Returns the integer identifier corresponding to a listbox, choice or
4100 radiobox selection (only if the event was a selection, not a
4101 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4102 """
54f9ee45 4103 return _core_.CommandEvent_GetInt(*args, **kwargs)
e811c8ce 4104
0085ce49
RD
4105 def GetClientData(*args, **kwargs):
4106 """
4107 GetClientData(self) -> PyObject
4108
4109 Returns the client data object for a listbox or choice selection event, (if any.)
4110 """
4111 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4112
4113 def SetClientData(*args, **kwargs):
4114 """
4115 SetClientData(self, PyObject clientData)
4116
4117 Associate the given client data with the item at position n.
4118 """
4119 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4120
4121 GetClientObject = GetClientData
4122 SetClientObject = SetClientData
4123
e811c8ce 4124 def Clone(*args, **kwargs):
a95a7133 4125 """Clone(self) -> Event"""
54f9ee45 4126 return _core_.CommandEvent_Clone(*args, **kwargs)
e811c8ce 4127
2bf58437
RD
4128 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4129 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4130 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4131 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4132 Selection = property(GetSelection,doc="See `GetSelection`")
4133 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
2131d850 4134_core_.CommandEvent_swigregister(CommandEvent)
d14a1e28
RD
4135
4136#---------------------------------------------------------------------------
4137
4138class NotifyEvent(CommandEvent):
27fb7603
RD
4139 """
4140 An instance of this class (or one of its derived classes) is sent from
4141 a control when the control's state is being changed and the control
4142 allows that change to be prevented from happening. The event handler
4143 can call `Veto` or `Allow` to tell the control what to do.
4144 """
0085ce49
RD
4145 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4146 __repr__ = _swig_repr
4147 def __init__(self, *args, **kwargs):
27fb7603 4148 """
2131d850 4149 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4150
4151 An instance of this class (or one of its derived classes) is sent from
4152 a control when the control's state is being changed and the control
4153 allows that change to be prevented from happening. The event handler
4154 can call `Veto` or `Allow` to tell the control what to do.
4155 """
0085ce49 4156 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
e811c8ce 4157 def Veto(*args, **kwargs):
27fb7603
RD
4158 """
4159 Veto(self)
4160
4161 Prevents the change announced by this event from happening.
4162
4163 It is in general a good idea to notify the user about the reasons for
4164 vetoing the change because otherwise the applications behaviour (which
4165 just refuses to do what the user wants) might be quite surprising.
4166 """
54f9ee45 4167 return _core_.NotifyEvent_Veto(*args, **kwargs)
e811c8ce
RD
4168
4169 def Allow(*args, **kwargs):
27fb7603
RD
4170 """
4171 Allow(self)
4172
4173 This is the opposite of `Veto`: it explicitly allows the event to be
4174 processed. For most events it is not necessary to call this method as
4175 the events are allowed anyhow but some are forbidden by default (this
4176 will be mentioned in the corresponding event description).
4177 """
54f9ee45 4178 return _core_.NotifyEvent_Allow(*args, **kwargs)
e811c8ce
RD
4179
4180 def IsAllowed(*args, **kwargs):
27fb7603
RD
4181 """
4182 IsAllowed(self) -> bool
4183
4184 Returns true if the change is allowed (`Veto` hasn't been called) or
4185 false otherwise (if it was).
4186 """
54f9ee45 4187 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
e811c8ce 4188
2131d850 4189_core_.NotifyEvent_swigregister(NotifyEvent)
d14a1e28
RD
4190
4191#---------------------------------------------------------------------------
4192
4193class ScrollEvent(CommandEvent):
27fb7603
RD
4194 """
4195 A scroll event holds information about events sent from stand-alone
4196 scrollbars and sliders. Note that scrolled windows do not send
4197 instnaces of this event class, but send the `wx.ScrollWinEvent`
4198 instead.
4199 """
0085ce49
RD
4200 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4201 __repr__ = _swig_repr
4202 def __init__(self, *args, **kwargs):
0df68c9f 4203 """
2131d850 4204 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
0df68c9f
RD
4205 int orient=0) -> ScrollEvent
4206 """
0085ce49 4207 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
e811c8ce 4208 def GetOrientation(*args, **kwargs):
27fb7603
RD
4209 """
4210 GetOrientation(self) -> int
4211
4212 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4213 the scrollbar.
4214 """
54f9ee45 4215 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4216
4217 def GetPosition(*args, **kwargs):
27fb7603
RD
4218 """
4219 GetPosition(self) -> int
4220
4221 Returns the position of the scrollbar.
4222 """
54f9ee45 4223 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4224
4225 def SetOrientation(*args, **kwargs):
a95a7133 4226 """SetOrientation(self, int orient)"""
54f9ee45 4227 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4228
4229 def SetPosition(*args, **kwargs):
a95a7133 4230 """SetPosition(self, int pos)"""
54f9ee45 4231 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
e811c8ce 4232
2131d850 4233_core_.ScrollEvent_swigregister(ScrollEvent)
d14a1e28
RD
4234
4235#---------------------------------------------------------------------------
4236
4237class ScrollWinEvent(Event):
27fb7603
RD
4238 """
4239 A wx.ScrollWinEvent holds information about scrolling and is sent from
4240 scrolling windows.
4241 """
0085ce49
RD
4242 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4243 __repr__ = _swig_repr
4244 def __init__(self, *args, **kwargs):
27fb7603 4245 """
2131d850 4246 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4247
4248 A wx.ScrollWinEvent holds information about scrolling and is sent from
4249 scrolling windows.
4250 """
0085ce49 4251 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
e811c8ce 4252 def GetOrientation(*args, **kwargs):
27fb7603
RD
4253 """
4254 GetOrientation(self) -> int
4255
4256 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4257 the scrollbar.
4258 """
54f9ee45 4259 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
e811c8ce
RD
4260
4261 def GetPosition(*args, **kwargs):
27fb7603
RD
4262 """
4263 GetPosition(self) -> int
4264
4265 Returns the position of the scrollbar for the thumb track and release
4266 events. Note that this field can't be used for the other events, you
4267 need to query the window itself for the current position in that case.
4268 """
54f9ee45 4269 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4270
4271 def SetOrientation(*args, **kwargs):
a95a7133 4272 """SetOrientation(self, int orient)"""
54f9ee45 4273 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
e811c8ce
RD
4274
4275 def SetPosition(*args, **kwargs):
a95a7133 4276 """SetPosition(self, int pos)"""
54f9ee45 4277 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
e811c8ce 4278
2131d850 4279_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d14a1e28
RD
4280
4281#---------------------------------------------------------------------------
4282
54f9ee45
RD
4283MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4284MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4285MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4286MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4287MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
d14a1e28 4288class MouseEvent(Event):
27fb7603
RD
4289 """
4290 This event class contains information about the events generated by
4291 the mouse: they include mouse buttons press and release events and
4292 mouse move events.
4293
4294 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4295 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4296 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4297 a middle button so a portable application should avoid relying on the
4298 events from it.
4299
4300 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4301 the former returns true when the event corresponds to the left mouse
4302 button click while the latter returns true if the left mouse button is
4303 currently being pressed. For example, when the user is dragging the
4304 mouse you can use `LeftIsDown` to test whether the left mouse button
4305 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4306 `LeftIsDown` will also return true in wxWidgets whatever the
4307 underlying GUI behaviour is (which is platform-dependent). The same
4308 applies, of course, to other mouse buttons as well.
4309 """
0085ce49
RD
4310 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4311 __repr__ = _swig_repr
4312 def __init__(self, *args, **kwargs):
27fb7603 4313 """
2131d850 4314 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4315
4316 Constructs a wx.MouseEvent. Valid event types are:
4317
4318 * wxEVT_ENTER_WINDOW
4319 * wxEVT_LEAVE_WINDOW
4320 * wxEVT_LEFT_DOWN
4321 * wxEVT_LEFT_UP
4322 * wxEVT_LEFT_DCLICK
4323 * wxEVT_MIDDLE_DOWN
4324 * wxEVT_MIDDLE_UP
4325 * wxEVT_MIDDLE_DCLICK
4326 * wxEVT_RIGHT_DOWN
4327 * wxEVT_RIGHT_UP
4328 * wxEVT_RIGHT_DCLICK
4329 * wxEVT_MOTION
4330 * wxEVT_MOUSEWHEEL
4331 """
0085ce49 4332 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
e811c8ce 4333 def IsButton(*args, **kwargs):
27fb7603
RD
4334 """
4335 IsButton(self) -> bool
4336
4337 Returns true if the event was a mouse button event (not necessarily a
4338 button down event - that may be tested using `ButtonDown`).
4339 """
54f9ee45 4340 return _core_.MouseEvent_IsButton(*args, **kwargs)
e811c8ce
RD
4341
4342 def ButtonDown(*args, **kwargs):
27fb7603
RD
4343 """
4344 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4345
5ba5649b
RD
4346 If the argument is omitted, this returns true if the event was any
4347 mouse button down event. Otherwise the argument specifies which
4348 button-down event shold be checked for (see `Button` for the possible
4349 values).
27fb7603 4350 """
54f9ee45 4351 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
e811c8ce
RD
4352
4353 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4354 """
4355 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4356
4357 If the argument is omitted, this returns true if the event was any
4358 mouse double click event. Otherwise the argument specifies which
4359 double click event to check for (see `Button` for the possible
4360 values).
4361 """
54f9ee45 4362 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
e811c8ce
RD
4363
4364 def ButtonUp(*args, **kwargs):
27fb7603
RD
4365 """
4366 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4367
4368 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4369 mouse button up event. Otherwise the argument specifies which button
4370 up event to check for (see `Button` for the possible values).
27fb7603 4371 """
54f9ee45 4372 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
e811c8ce
RD
4373
4374 def Button(*args, **kwargs):
27fb7603
RD
4375 """
4376 Button(self, int button) -> bool
4377
4378 Returns true if the identified mouse button is changing state. Valid
4379 values of button are:
4380
4381 ==================== =====================================
4382 wx.MOUSE_BTN_LEFT check if left button was pressed
4383 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4384 wx.MOUSE_BTN_RIGHT check if right button was pressed
4385 wx.MOUSE_BTN_ANY check if any button was pressed
4386 ==================== =====================================
4387
4388 """
54f9ee45 4389 return _core_.MouseEvent_Button(*args, **kwargs)
e811c8ce
RD
4390
4391 def ButtonIsDown(*args, **kwargs):
a95a7133 4392 """ButtonIsDown(self, int but) -> bool"""
54f9ee45 4393 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
e811c8ce
RD
4394
4395 def GetButton(*args, **kwargs):
27fb7603
RD
4396 """
4397 GetButton(self) -> int
4398
4399 Returns the mouse button which generated this event or
4400 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4401 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4402 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4403 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4404 right buttons respectively.
4405 """
54f9ee45 4406 return _core_.MouseEvent_GetButton(*args, **kwargs)
e811c8ce
RD
4407
4408 def ControlDown(*args, **kwargs):
27fb7603
RD
4409 """
4410 ControlDown(self) -> bool
4411
4412 Returns true if the control key was down at the time of the event.
4413 """
54f9ee45 4414 return _core_.MouseEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
4415
4416 def MetaDown(*args, **kwargs):
27fb7603
RD
4417 """
4418 MetaDown(self) -> bool
4419
4420 Returns true if the Meta key was down at the time of the event.
4421 """
54f9ee45 4422 return _core_.MouseEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
4423
4424 def AltDown(*args, **kwargs):
27fb7603
RD
4425 """
4426 AltDown(self) -> bool
4427
4428 Returns true if the Alt key was down at the time of the event.
4429 """
54f9ee45 4430 return _core_.MouseEvent_AltDown(*args, **kwargs)
e811c8ce
RD
4431
4432 def ShiftDown(*args, **kwargs):
27fb7603
RD
4433 """
4434 ShiftDown(self) -> bool
4435
4436 Returns true if the Shift key was down at the time of the event.
4437 """
54f9ee45 4438 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
e811c8ce 4439
412d302d
RD
4440 def CmdDown(*args, **kwargs):
4441 """
4442 CmdDown(self) -> bool
4443
4444 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4445 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4446 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4447 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4448 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4449 purpose. So for non-Mac platforms this is the same as `ControlDown`
4450 and Macs this is the same as `MetaDown`.
4451 """
4452 return _core_.MouseEvent_CmdDown(*args, **kwargs)
4453
e811c8ce 4454 def LeftDown(*args, **kwargs):
27fb7603
RD
4455 """
4456 LeftDown(self) -> bool
4457
4458 Returns true if the left mouse button state changed to down.
4459 """
54f9ee45 4460 return _core_.MouseEvent_LeftDown(*args, **kwargs)
e811c8ce
RD
4461
4462 def MiddleDown(*args, **kwargs):
27fb7603
RD
4463 """
4464 MiddleDown(self) -> bool
4465
4466 Returns true if the middle mouse button state changed to down.
4467 """
54f9ee45 4468 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
e811c8ce
RD
4469
4470 def RightDown(*args, **kwargs):
27fb7603
RD
4471 """
4472 RightDown(self) -> bool
4473
4474 Returns true if the right mouse button state changed to down.
4475 """
54f9ee45 4476 return _core_.MouseEvent_RightDown(*args, **kwargs)
e811c8ce
RD
4477
4478 def LeftUp(*args, **kwargs):
27fb7603
RD
4479 """
4480 LeftUp(self) -> bool
4481
4482 Returns true if the left mouse button state changed to up.
4483 """
54f9ee45 4484 return _core_.MouseEvent_LeftUp(*args, **kwargs)
e811c8ce
RD
4485
4486 def MiddleUp(*args, **kwargs):
27fb7603
RD
4487 """
4488 MiddleUp(self) -> bool
4489
4490 Returns true if the middle mouse button state changed to up.
4491 """
54f9ee45 4492 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
e811c8ce
RD
4493
4494 def RightUp(*args, **kwargs):
27fb7603
RD
4495 """
4496 RightUp(self) -> bool
4497
4498 Returns true if the right mouse button state changed to up.
4499 """
54f9ee45 4500 return _core_.MouseEvent_RightUp(*args, **kwargs)
e811c8ce
RD
4501
4502 def LeftDClick(*args, **kwargs):
27fb7603
RD
4503 """
4504 LeftDClick(self) -> bool
4505
4506 Returns true if the event was a left button double click.
4507 """
54f9ee45 4508 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
e811c8ce
RD
4509
4510 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4511 """
4512 MiddleDClick(self) -> bool
4513
4514 Returns true if the event was a middle button double click.
4515 """
54f9ee45 4516 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
e811c8ce
RD
4517
4518 def RightDClick(*args, **kwargs):
27fb7603
RD
4519 """
4520 RightDClick(self) -> bool
4521
4522 Returns true if the event was a right button double click.
4523 """
54f9ee45 4524 return _core_.MouseEvent_RightDClick(*args, **kwargs)
e811c8ce
RD
4525
4526 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4527 """
4528 LeftIsDown(self) -> bool
4529
4530 Returns true if the left mouse button is currently down, independent
4531 of the current event type.
4532
4533 Please notice that it is not the same as LeftDown which returns true
4534 if the left mouse button was just pressed. Rather, it describes the
4535 state of the mouse button before the event happened.
4536
4537 This event is usually used in the mouse event handlers which process
4538 "move mouse" messages to determine whether the user is (still)
4539 dragging the mouse.
4540 """
54f9ee45 4541 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
e811c8ce
RD
4542
4543 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4544 """
4545 MiddleIsDown(self) -> bool
4546
4547 Returns true if the middle mouse button is currently down, independent
4548 of the current event type.
4549 """
54f9ee45 4550 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
e811c8ce
RD
4551
4552 def RightIsDown(*args, **kwargs):
27fb7603
RD
4553 """
4554 RightIsDown(self) -> bool
4555
4556 Returns true if the right mouse button is currently down, independent
4557 of the current event type.
4558 """
54f9ee45 4559 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
e811c8ce
RD
4560
4561 def Dragging(*args, **kwargs):
27fb7603
RD
4562 """
4563 Dragging(self) -> bool
4564
4565 Returns true if this was a dragging event (motion while a button is
4566 depressed).
4567 """
54f9ee45 4568 return _core_.MouseEvent_Dragging(*args, **kwargs)
e811c8ce
RD
4569
4570 def Moving(*args, **kwargs):
27fb7603
RD
4571 """
4572 Moving(self) -> bool
4573
4574 Returns true if this was a motion event and no mouse buttons were
4575 pressed. If any mouse button is held pressed, then this method returns
4576 false and Dragging returns true.
4577 """
54f9ee45 4578 return _core_.MouseEvent_Moving(*args, **kwargs)
e811c8ce
RD
4579
4580 def Entering(*args, **kwargs):
27fb7603
RD
4581 """
4582 Entering(self) -> bool
4583
4584 Returns true if the mouse was entering the window.
4585 """
54f9ee45 4586 return _core_.MouseEvent_Entering(*args, **kwargs)
e811c8ce
RD
4587
4588 def Leaving(*args, **kwargs):
27fb7603
RD
4589 """
4590 Leaving(self) -> bool
4591
4592 Returns true if the mouse was leaving the window.
4593 """
54f9ee45 4594 return _core_.MouseEvent_Leaving(*args, **kwargs)
e811c8ce
RD
4595
4596 def GetPosition(*args, **kwargs):
0df68c9f 4597 """
a95a7133 4598 GetPosition(self) -> Point
e811c8ce 4599
27fb7603
RD
4600 Returns the pixel position of the mouse in window coordinates when the
4601 event happened.
0df68c9f 4602 """
54f9ee45 4603 return _core_.MouseEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4604
4605 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
4606 """
4607 GetPositionTuple() -> (x,y)
e811c8ce 4608
27fb7603
RD
4609 Returns the pixel position of the mouse in window coordinates when the
4610 event happened.
0df68c9f 4611 """
54f9ee45 4612 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
4613
4614 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
4615 """
4616 GetLogicalPosition(self, DC dc) -> Point
4617
4618 Returns the logical mouse position in pixels (i.e. translated
4619 according to the translation set for the DC, which usually indicates
4620 that the window has been scrolled).
4621 """
54f9ee45 4622 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
e811c8ce
RD
4623
4624 def GetX(*args, **kwargs):
27fb7603
RD
4625 """
4626 GetX(self) -> int
4627
4628 Returns X coordinate of the physical mouse event position.
4629 """
54f9ee45 4630 return _core_.MouseEvent_GetX(*args, **kwargs)
e811c8ce
RD
4631
4632 def GetY(*args, **kwargs):
27fb7603
RD
4633 """
4634 GetY(self) -> int
4635
4636 Returns Y coordinate of the physical mouse event position.
4637 """
54f9ee45 4638 return _core_.MouseEvent_GetY(*args, **kwargs)
e811c8ce
RD
4639
4640 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
4641 """
4642 GetWheelRotation(self) -> int
4643
4644 Get wheel rotation, positive or negative indicates direction of
4645 rotation. Current devices all send an event when rotation is equal to
4646 +/-WheelDelta, but this allows for finer resolution devices to be
4647 created in the future. Because of this you shouldn't assume that one
4648 event is equal to 1 line or whatever, but you should be able to either
4649 do partial line scrolling or wait until +/-WheelDelta rotation values
4650 have been accumulated before scrolling.
4651 """
54f9ee45 4652 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
e811c8ce
RD
4653
4654 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
4655 """
4656 GetWheelDelta(self) -> int
4657
4658 Get wheel delta, normally 120. This is the threshold for action to be
4659 taken, and one such action (for example, scrolling one increment)
4660 should occur for each delta.
4661 """
54f9ee45 4662 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
e811c8ce
RD
4663
4664 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
4665 """
4666 GetLinesPerAction(self) -> int
4667
4668 Returns the configured number of lines (or whatever) to be scrolled
4669 per wheel action. Defaults to three.
4670 """
54f9ee45 4671 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
e811c8ce
RD
4672
4673 def IsPageScroll(*args, **kwargs):
27fb7603
RD
4674 """
4675 IsPageScroll(self) -> bool
4676
4677 Returns true if the system has been setup to do page scrolling with
4678 the mouse wheel instead of line scrolling.
4679 """
54f9ee45
RD
4680 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
4681
4682 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
4683 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
4684 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
4685 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
4686 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
4687 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
4688 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
4689 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
4690 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
4691 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
4692 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
4693 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
57332a5a
RD
4694 Button = property(GetButton,doc="See `GetButton`")
4695 LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`")
4696 LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`")
4697 Position = property(GetPosition,doc="See `GetPosition`")
4698 WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`")
4699 WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`")
4700 X = property(GetX,doc="See `GetX`")
4701 Y = property(GetY,doc="See `GetY`")
2131d850 4702_core_.MouseEvent_swigregister(MouseEvent)
d14a1e28
RD
4703
4704#---------------------------------------------------------------------------
4705
4706class SetCursorEvent(Event):
5ba5649b
RD
4707 """
4708 A SetCursorEvent is generated when the mouse cursor is about to be set
4709 as a result of mouse motion. This event gives the application the
4710 chance to perform specific mouse cursor processing based on the
4711 current position of the mouse within the window. Use the `SetCursor`
4712 method to specify the cursor you want to be displayed.
4713 """
0085ce49
RD
4714 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4715 __repr__ = _swig_repr
4716 def __init__(self, *args, **kwargs):
5ba5649b
RD
4717 """
4718 __init__(self, int x=0, int y=0) -> SetCursorEvent
4719
4720 Construct a new `wx.SetCursorEvent`.
4721 """
0085ce49 4722 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
e811c8ce 4723 def GetX(*args, **kwargs):
5ba5649b
RD
4724 """
4725 GetX(self) -> int
4726
4727 Returns the X coordinate of the mouse in client coordinates.
4728 """
54f9ee45 4729 return _core_.SetCursorEvent_GetX(*args, **kwargs)
e811c8ce
RD
4730
4731 def GetY(*args, **kwargs):
5ba5649b
RD
4732 """
4733 GetY(self) -> int
4734
4735 Returns the Y coordinate of the mouse in client coordinates.
4736 """
54f9ee45 4737 return _core_.SetCursorEvent_GetY(*args, **kwargs)
e811c8ce
RD
4738
4739 def SetCursor(*args, **kwargs):
5ba5649b
RD
4740 """
4741 SetCursor(self, Cursor cursor)
4742
4743 Sets the cursor associated with this event.
4744 """
54f9ee45 4745 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
e811c8ce
RD
4746
4747 def GetCursor(*args, **kwargs):
5ba5649b
RD
4748 """
4749 GetCursor(self) -> Cursor
4750
4751 Returns a reference to the cursor specified by this event.
4752 """
54f9ee45 4753 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
e811c8ce
RD
4754
4755 def HasCursor(*args, **kwargs):
5ba5649b
RD
4756 """
4757 HasCursor(self) -> bool
4758
4759 Returns true if the cursor specified by this event is a valid cursor.
4760 """
54f9ee45 4761 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
e811c8ce 4762
2131d850 4763_core_.SetCursorEvent_swigregister(SetCursorEvent)
d14a1e28
RD
4764
4765#---------------------------------------------------------------------------
4766
4767class KeyEvent(Event):
5ba5649b
RD
4768 """
4769 This event class contains information about keypress and character
4770 events. These events are only sent to the widget that currently has
4771 the keyboard focus.
4772
4773 Notice that there are three different kinds of keyboard events in
4774 wxWidgets: key down and up events and char events. The difference
4775 between the first two is clear - the first corresponds to a key press
4776 and the second to a key release - otherwise they are identical. Just
4777 note that if the key is maintained in a pressed state you will
4778 typically get a lot of (automatically generated) down events but only
4779 one up so it is wrong to assume that there is one up event
4780 corresponding to each down one.
4781
4782 Both key events provide untranslated key codes while the char event
4783 carries the translated one. The untranslated code for alphanumeric
4784 keys is always an upper case value. For the other keys it is one of
4785 WXK_XXX values from the keycodes table. The translated key is, in
4786 general, the character the user expects to appear as the result of the
4787 key combination when typing the text into a text entry zone, for
4788 example.
4789
4790 A few examples to clarify this (all assume that CAPS LOCK is unpressed
4791 and the standard US keyboard): when the 'A' key is pressed, the key
4792 down event key code is equal to ASCII A == 65. But the char event key
4793 code is ASCII a == 97. On the other hand, if you press both SHIFT and
4794 'A' keys simultaneously , the key code in key down event will still be
4795 just 'A' while the char event key code parameter will now be 'A' as
4796 well.
4797
4798 Although in this simple case it is clear that the correct key code
4799 could be found in the key down event handler by checking the value
4800 returned by `ShiftDown`, in general you should use EVT_CHAR for this
4801 as for non alphanumeric keys or non-US keyboard layouts the
4802 translation is keyboard-layout dependent and can only be done properly
4803 by the system itself.
4804
4805 Another kind of translation is done when the control key is pressed:
4806 for example, for CTRL-A key press the key down event still carries the
4807 same key code 'A' as usual but the char event will have key code of 1,
4808 the ASCII value of this key combination.
4809
4810 You may discover how the other keys on your system behave
4811 interactively by running the KeyEvents sample in the wxPython demo and
4812 pressing some keys while the blue box at the top has the keyboard
4813 focus.
4814
4815 **Note**: If a key down event is caught and the event handler does not
4816 call event.Skip() then the coresponding char event will not
4817 happen. This is by design and enables the programs that handle both
4818 types of events to be a bit simpler.
4819
4820 **Note for Windows programmers**: The key and char events in wxWidgets
4821 are similar to but slightly different from Windows WM_KEYDOWN and
4822 WM_CHAR events. In particular, Alt-x combination will generate a char
4823 event in wxWidgets (unless it is used as an accelerator).
4824
4825 **Tip**: be sure to call event.Skip() for events that you don't
4826 process in key event function, otherwise menu shortcuts may cease to
4827 work under Windows.
4828
4829 """
0085ce49
RD
4830 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4831 __repr__ = _swig_repr
4832 def __init__(self, *args, **kwargs):
5ba5649b 4833 """
2131d850 4834 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
4835
4836 Construct a new `wx.KeyEvent`. Valid event types are:
4837 *
4838 """
0085ce49 4839 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
4840 def GetModifiers(*args, **kwargs):
4841 """
4842 GetModifiers(self) -> int
4843
4844 Returns a bitmask of the current modifier settings. Can be used to
4845 check if the key event has exactly the given modifiers without having
4846 to explicitly check that the other modifiers are not down. For
4847 example::
4848
4849 if event.GetModifers() == wx.MOD_CONTROL:
4850 DoSomething()
4851
4852 """
4853 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
4854
e811c8ce 4855 def ControlDown(*args, **kwargs):
5ba5649b
RD
4856 """
4857 ControlDown(self) -> bool
4858
4859 Returns ``True`` if the Control key was down at the time of the event.
4860 """
54f9ee45 4861 return _core_.KeyEvent_ControlDown(*args, **kwargs)
e811c8ce
RD
4862
4863 def MetaDown(*args, **kwargs):
5ba5649b
RD
4864 """
4865 MetaDown(self) -> bool
4866
4867 Returns ``True`` if the Meta key was down at the time of the event.
4868 """
54f9ee45 4869 return _core_.KeyEvent_MetaDown(*args, **kwargs)
e811c8ce
RD
4870
4871 def AltDown(*args, **kwargs):
5ba5649b
RD
4872 """
4873 AltDown(self) -> bool
4874
4875 Returns ``True`` if the Alt key was down at the time of the event.
4876 """
54f9ee45 4877 return _core_.KeyEvent_AltDown(*args, **kwargs)
e811c8ce
RD
4878
4879 def ShiftDown(*args, **kwargs):
5ba5649b
RD
4880 """
4881 ShiftDown(self) -> bool
4882
4883 Returns ``True`` if the Shift key was down at the time of the event.
4884 """
54f9ee45 4885 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
e811c8ce 4886
412d302d
RD
4887 def CmdDown(*args, **kwargs):
4888 """
4889 CmdDown(self) -> bool
4890
4891 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4892 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4893 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
4894 because Cmd key is used for the same thing under Mac as Ctrl
4895 elsewhere. The Ctrl still exists, it's just not used for this
4896 purpose. So for non-Mac platforms this is the same as `ControlDown`
4897 and Macs this is the same as `MetaDown`.
4898 """
4899 return _core_.KeyEvent_CmdDown(*args, **kwargs)
4900
e811c8ce 4901 def HasModifiers(*args, **kwargs):
5ba5649b
RD
4902 """
4903 HasModifiers(self) -> bool
4904
4905 Returns true if either CTRL or ALT keys was down at the time of the
4906 key event. Note that this function does not take into account neither
4907 SHIFT nor META key states (the reason for ignoring the latter is that
4908 it is common for NUMLOCK key to be configured as META under X but the
4909 key presses even while NUMLOCK is on should be still processed
4910 normally).
4911 """
54f9ee45 4912 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
e811c8ce
RD
4913
4914 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
4915 """
4916 GetKeyCode(self) -> int
4917
4918 Returns the virtual key code. ASCII events return normal ASCII values,
4919 while non-ASCII events return values such as WXK_LEFT for the left
4920 cursor key. See `wx.KeyEvent` for a full list of the virtual key
4921 codes.
4922
4923 Note that in Unicode build, the returned value is meaningful only if
4924 the user entered a character that can be represented in current
4925 locale's default charset. You can obtain the corresponding Unicode
4926 character using `GetUnicodeKey`.
4927 """
54f9ee45 4928 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
e811c8ce 4929
19272049 4930 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
4931 """
4932 GetUnicodeKey(self) -> int
4933
4934 Returns the Unicode character corresponding to this key event. This
4935 function is only meaningfule in a Unicode build of wxPython.
4936 """
19272049 4937 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
e811c8ce 4938
19272049 4939 GetUniChar = GetUnicodeKey
b850e7f3
RD
4940 def SetUnicodeKey(*args, **kwargs):
4941 """
4942 SetUnicodeKey(self, int uniChar)
4943
4944 Set the Unicode value of the key event, but only if this is a Unicode
4945 build of wxPython.
4946 """
4947 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
4948
e811c8ce 4949 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
4950 """
4951 GetRawKeyCode(self) -> unsigned int
4952
4953 Returns the raw key code for this event. This is a platform-dependent
4954 scan code which should only be used in advanced
4955 applications. Currently the raw key codes are not supported by all
4956 ports.
4957 """
54f9ee45 4958 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
e811c8ce
RD
4959
4960 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
4961 """
4962 GetRawKeyFlags(self) -> unsigned int
4963
4964 Returns the low level key flags for this event. The flags are
4965 platform-dependent and should only be used in advanced applications.
4966 Currently the raw key flags are not supported by all ports.
4967 """
54f9ee45 4968 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
e811c8ce
RD
4969
4970 def GetPosition(*args, **kwargs):
0df68c9f 4971 """
a95a7133 4972 GetPosition(self) -> Point
e811c8ce 4973
5ba5649b 4974 Find the position of the event, if applicable.
0df68c9f 4975 """
54f9ee45 4976 return _core_.KeyEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
4977
4978 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
4979 """
4980 GetPositionTuple() -> (x,y)
e811c8ce 4981
5ba5649b 4982 Find the position of the event, if applicable.
0df68c9f 4983 """
54f9ee45 4984 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
e811c8ce
RD
4985
4986 def GetX(*args, **kwargs):
5ba5649b
RD
4987 """
4988 GetX(self) -> int
4989
4990 Returns the X position (in client coordinates) of the event, if
4991 applicable.
4992 """
54f9ee45 4993 return _core_.KeyEvent_GetX(*args, **kwargs)
e811c8ce
RD
4994
4995 def GetY(*args, **kwargs):
5ba5649b
RD
4996 """
4997 GetY(self) -> int
4998
4999 Returns the Y position (in client coordinates) of the event, if
5000 applicable.
5001 """
54f9ee45
RD
5002 return _core_.KeyEvent_GetY(*args, **kwargs)
5003
5004 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5005 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5006 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5007 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5008 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5009 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5010 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5011 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5012 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5013 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
97ab0f6a
RD
5014 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5015 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5016 Position = property(GetPosition,doc="See `GetPosition`")
5017 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5018 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5019 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5020 X = property(GetX,doc="See `GetX`")
5021 Y = property(GetY,doc="See `GetY`")
2131d850 5022_core_.KeyEvent_swigregister(KeyEvent)
d14a1e28
RD
5023
5024#---------------------------------------------------------------------------
5025
5026class SizeEvent(Event):
5ba5649b
RD
5027 """
5028 A size event holds information about size change events. The EVT_SIZE
5029 handler function will be called when the window it is bound to has
5030 been resized.
5031
5032 Note that the size passed is of the whole window: call
5033 `wx.Window.GetClientSize` for the area which may be used by the
5034 application.
5035
5036 When a window is resized, usually only a small part of the window is
5037 damaged and and that area is all that is in the update region for the
5038 next paint event. However, if your drawing depends on the size of the
5039 window, you may need to clear the DC explicitly and repaint the whole
5040 window. In which case, you may need to call `wx.Window.Refresh` to
5041 invalidate the entire window.
5042
5043 """
0085ce49
RD
5044 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5045 __repr__ = _swig_repr
5046 def __init__(self, *args, **kwargs):
5ba5649b
RD
5047 """
5048 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5049
5050 Construct a new ``wx.SizeEvent``.
5051 """
0085ce49 5052 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
e811c8ce 5053 def GetSize(*args, **kwargs):
5ba5649b
RD
5054 """
5055 GetSize(self) -> Size
5056
5057 Returns the entire size of the window generating the size change
5058 event.
5059 """
54f9ee45 5060 return _core_.SizeEvent_GetSize(*args, **kwargs)
e811c8ce
RD
5061
5062 def GetRect(*args, **kwargs):
a95a7133 5063 """GetRect(self) -> Rect"""
54f9ee45 5064 return _core_.SizeEvent_GetRect(*args, **kwargs)
e811c8ce
RD
5065
5066 def SetRect(*args, **kwargs):
a95a7133 5067 """SetRect(self, Rect rect)"""
54f9ee45 5068 return _core_.SizeEvent_SetRect(*args, **kwargs)
e811c8ce
RD
5069
5070 def SetSize(*args, **kwargs):
a95a7133 5071 """SetSize(self, Size size)"""
54f9ee45 5072 return _core_.SizeEvent_SetSize(*args, **kwargs)
e811c8ce 5073
54f9ee45
RD
5074 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5075 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
2131d850 5076_core_.SizeEvent_swigregister(SizeEvent)
d14a1e28
RD
5077
5078#---------------------------------------------------------------------------
5079
5080class MoveEvent(Event):
5ba5649b
RD
5081 """
5082 This event object is sent for EVT_MOVE event bindings when a window is
5083 moved to a new position.
5084 """
0085ce49
RD
5085 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5086 __repr__ = _swig_repr
5087 def __init__(self, *args, **kwargs):
5ba5649b
RD
5088 """
5089 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5090
5091 Constructor.
5092 """
0085ce49 5093 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
e811c8ce 5094 def GetPosition(*args, **kwargs):
5ba5649b
RD
5095 """
5096 GetPosition(self) -> Point
5097
5098 Returns the position of the window generating the move change event.
5099 """
54f9ee45 5100 return _core_.MoveEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5101
5102 def GetRect(*args, **kwargs):
a95a7133 5103 """GetRect(self) -> Rect"""
54f9ee45 5104 return _core_.MoveEvent_GetRect(*args, **kwargs)
e811c8ce
RD
5105
5106 def SetRect(*args, **kwargs):
a95a7133 5107 """SetRect(self, Rect rect)"""
54f9ee45 5108 return _core_.MoveEvent_SetRect(*args, **kwargs)
e811c8ce
RD
5109
5110 def SetPosition(*args, **kwargs):
a95a7133 5111 """SetPosition(self, Point pos)"""
54f9ee45 5112 return _core_.MoveEvent_SetPosition(*args, **kwargs)
e811c8ce 5113
7557b9b5
RD
5114 m_pos = property(GetPosition, SetPosition)
5115 m_rect = property(GetRect, SetRect)
5116
57332a5a
RD
5117 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
5118 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
2131d850 5119_core_.MoveEvent_swigregister(MoveEvent)
d14a1e28
RD
5120
5121#---------------------------------------------------------------------------
5122
5123class PaintEvent(Event):
5ba5649b
RD
5124 """
5125 A paint event is sent when a window's contents needs to be repainted.
5126 Note that in an EVT_PAINT handler the application must *always* create
5127 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5128 Windows assumes that the window has not been painted yet and will send
5129 the event again, causing endless refreshes.
5130
5131 You can optimize painting by retrieving the rectangles that have been
5132 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5133 and only repainting these rectangles. The rectangles are in terms of
5134 the client area, and are unscrolled, so you will need to do some
5135 calculations using the current view position to obtain logical,
5136 scrolled units.
5137
5138 """
0085ce49
RD
5139 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5140 __repr__ = _swig_repr
5141 def __init__(self, *args, **kwargs):
a95a7133 5142 """__init__(self, int Id=0) -> PaintEvent"""
0085ce49 5143 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5144_core_.PaintEvent_swigregister(PaintEvent)
d14a1e28
RD
5145
5146class NcPaintEvent(Event):
093d3ff1 5147 """Proxy of C++ NcPaintEvent class"""
0085ce49
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):
a95a7133 5151 """__init__(self, int winid=0) -> NcPaintEvent"""
0085ce49 5152 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5153_core_.NcPaintEvent_swigregister(NcPaintEvent)
d14a1e28
RD
5154
5155#---------------------------------------------------------------------------
5156
5157class EraseEvent(Event):
5ba5649b
RD
5158 """
5159 An erase event is sent whenever the background of a window needs to be
5160 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5161 binder. On some platforms, such as GTK+, this event is simulated
5162 (simply generated just before the paint event) and may cause flicker.
5163
5164 To paint a custom background use the `GetDC` method and use the returned
5165 device context if it is not ``None``, otherwise create a temporary
5166 `wx.ClientDC` and draw on that.
5167
5168 """
0085ce49
RD
5169 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5170 __repr__ = _swig_repr
5171 def __init__(self, *args, **kwargs):
5ba5649b
RD
5172 """
5173 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5174
5175 Constructor
5176 """
0085ce49 5177 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
e811c8ce 5178 def GetDC(*args, **kwargs):
5ba5649b
RD
5179 """
5180 GetDC(self) -> DC
5181
5182 Returns the device context the event handler should draw upon. If
5183 ``None`` is returned then create a temporary `wx.ClientDC` and use
5184 that instead.
5185 """
54f9ee45 5186 return _core_.EraseEvent_GetDC(*args, **kwargs)
e811c8ce 5187
97ab0f6a 5188 DC = property(GetDC,doc="See `GetDC`")
2131d850 5189_core_.EraseEvent_swigregister(EraseEvent)
d14a1e28
RD
5190
5191#---------------------------------------------------------------------------
5192
5193class FocusEvent(Event):
5ba5649b
RD
5194 """
5195 A focus event is sent when a window's focus changes. The window losing
5196 focus receives an EVT_KILL_FOCUS event while the window gaining it
5197 gets an EVT_SET_FOCUS event.
5198
5199 Notice that the set focus event happens both when the user gives focus
5200 to the window (whether using the mouse or keyboard) and when it is
5201 done from the program itself using `wx.Window.SetFocus`.
5202
5203 """
0085ce49
RD
5204 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5205 __repr__ = _swig_repr
5206 def __init__(self, *args, **kwargs):
5ba5649b 5207 """
2131d850 5208 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5209
5210 Constructor
5211 """
0085ce49 5212 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
e811c8ce 5213 def GetWindow(*args, **kwargs):
5ba5649b
RD
5214 """
5215 GetWindow(self) -> Window
5216
5217 Returns the other window associated with this event, that is the
5218 window which had the focus before for the EVT_SET_FOCUS event and the
5219 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5220
5221 Warning: the window returned may be None!
5222 """
54f9ee45 5223 return _core_.FocusEvent_GetWindow(*args, **kwargs)
e811c8ce
RD
5224
5225 def SetWindow(*args, **kwargs):
a95a7133 5226 """SetWindow(self, Window win)"""
54f9ee45 5227 return _core_.FocusEvent_SetWindow(*args, **kwargs)
e811c8ce 5228
97ab0f6a 5229 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 5230_core_.FocusEvent_swigregister(FocusEvent)
d14a1e28
RD
5231
5232#---------------------------------------------------------------------------
5233
5234class ChildFocusEvent(CommandEvent):
5ba5649b
RD
5235 """
5236 wx.ChildFocusEvent notifies the parent that a child has received the
5237 focus. Unlike `wx.FocusEvent` it is propagated up the window
5238 heirarchy.
5239 """
0085ce49
RD
5240 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5241 __repr__ = _swig_repr
5242 def __init__(self, *args, **kwargs):
5ba5649b
RD
5243 """
5244 __init__(self, Window win=None) -> ChildFocusEvent
5245
5246 Constructor
5247 """
0085ce49 5248 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
e811c8ce 5249 def GetWindow(*args, **kwargs):
5ba5649b
RD
5250 """
5251 GetWindow(self) -> Window
5252
5253 The window which has just received the focus.
5254 """
54f9ee45 5255 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
e811c8ce 5256
2bf58437 5257 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 5258_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d14a1e28
RD
5259
5260#---------------------------------------------------------------------------
5261
5262class ActivateEvent(Event):
5ba5649b
RD
5263 """
5264 An activate event is sent when a top-level window or the entire
5265 application is being activated or deactivated.
5266
5267 A top-level window (a dialog or frame) receives an activate event when
5268 is being activated or deactivated. This is indicated visually by the
5269 title bar changing colour, and a subwindow gaining the keyboard focus.
5270 An application is activated or deactivated when one of its frames
5271 becomes activated, or a frame becomes inactivate resulting in all
5272 application frames being inactive.
5273
5274 Please note that usually you should call event.Skip() in your handlers
5275 for these events so the default handlers will still be called, as not
5276 doing so can result in strange effects.
5277
5278 """
0085ce49
RD
5279 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5280 __repr__ = _swig_repr
5281 def __init__(self, *args, **kwargs):
5ba5649b 5282 """
2131d850 5283 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5284
5285 Constructor
5286 """
0085ce49 5287 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
e811c8ce 5288 def GetActive(*args, **kwargs):
5ba5649b
RD
5289 """
5290 GetActive(self) -> bool
5291
5292 Returns true if the application or window is being activated, false
5293 otherwise.
5294 """
54f9ee45 5295 return _core_.ActivateEvent_GetActive(*args, **kwargs)
e811c8ce 5296
2bf58437 5297 Active = property(GetActive,doc="See `GetActive`")
2131d850 5298_core_.ActivateEvent_swigregister(ActivateEvent)
d14a1e28
RD
5299
5300#---------------------------------------------------------------------------
5301
5302class InitDialogEvent(Event):
5ba5649b
RD
5303 """
5304 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5305 any window when `wx.Window.InitDialog` is called. Handlers for this
5306 event can transfer data to the window, or anything else that should be
5307 done before the user begins editing the form. The default handler
5308 calls `wx.Window.TransferDataToWindow`.
5309 """
0085ce49
RD
5310 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5311 __repr__ = _swig_repr
5312 def __init__(self, *args, **kwargs):
5ba5649b
RD
5313 """
5314 __init__(self, int Id=0) -> InitDialogEvent
5315
5316 Constructor
5317 """
0085ce49 5318 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5319_core_.InitDialogEvent_swigregister(InitDialogEvent)
d14a1e28
RD
5320
5321#---------------------------------------------------------------------------
5322
5323class MenuEvent(Event):
5ba5649b
RD
5324 """
5325 This class is used for a variety of menu-related events. Note that
5326 these do not include menu command events, which are handled by sending
5327 `wx.CommandEvent` objects.
5328
5329 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5330 text in the first field of the status bar.
5331 """
0085ce49
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 5335 """
2131d850 5336 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5337
5338 Constructor
5339 """
0085ce49 5340 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
e811c8ce 5341 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5342 """
5343 GetMenuId(self) -> int
5344
5345 Returns the menu identifier associated with the event. This method
5346 should be only used with the HIGHLIGHT events.
5347 """
54f9ee45 5348 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
e811c8ce
RD
5349
5350 def IsPopup(*args, **kwargs):
5ba5649b
RD
5351 """
5352 IsPopup(self) -> bool
5353
5354 Returns ``True`` if the menu which is being opened or closed is a
5355 popup menu, ``False`` if it is a normal one. This method should only
5356 be used with the OPEN and CLOSE events.
5357 """
54f9ee45 5358 return _core_.MenuEvent_IsPopup(*args, **kwargs)
e811c8ce
RD
5359
5360 def GetMenu(*args, **kwargs):
5ba5649b
RD
5361 """
5362 GetMenu(self) -> Menu
5363
5364 Returns the menu which is being opened or closed. This method should
5365 only be used with the OPEN and CLOSE events.
5366 """
54f9ee45 5367 return _core_.MenuEvent_GetMenu(*args, **kwargs)
e811c8ce 5368
57332a5a
RD
5369 Menu = property(GetMenu,doc="See `GetMenu`")
5370 MenuId = property(GetMenuId,doc="See `GetMenuId`")
2131d850 5371_core_.MenuEvent_swigregister(MenuEvent)
d14a1e28
RD
5372
5373#---------------------------------------------------------------------------
5374
5375class CloseEvent(Event):
5ba5649b
RD
5376 """
5377 This event class contains information about window and session close
5378 events.
5379
5380 The handler function for EVT_CLOSE is called when the user has tried
5381 to close a a frame or dialog box using the window manager controls or
5382 the system menu. It can also be invoked by the application itself
5383 programmatically, for example by calling the `wx.Window.Close`
5384 function.
5385
5386 You should check whether the application is forcing the deletion of
5387 the window using `CanVeto`. If it returns ``False``, you must destroy
5388 the window using `wx.Window.Destroy`. If the return value is ``True``,
5389 it is up to you whether you respond by destroying the window or not.
5390 For example you may wish to display a message dialog prompting to save
5391 files or to cancel the close.
5392
5393 If you don't destroy the window, you should call `Veto` to let the
5394 calling code know that you did not destroy the window. This allows the
5395 `wx.Window.Close` function to return ``True`` or ``False`` depending
5396 on whether the close instruction was honored or not.
5397 """
0085ce49
RD
5398 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5399 __repr__ = _swig_repr
5400 def __init__(self, *args, **kwargs):
5ba5649b 5401 """
2131d850 5402 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5403
5404 Constructor.
5405 """
0085ce49 5406 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
e811c8ce 5407 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5408 """
5409 SetLoggingOff(self, bool logOff)
5410
5411 Sets the 'logging off' flag.
5412 """
54f9ee45 5413 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
e811c8ce
RD
5414
5415 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5416 """
5417 GetLoggingOff(self) -> bool
5418
6c75a4cf
RD
5419 Returns ``True`` if the user is logging off or ``False`` if the
5420 system is shutting down. This method can only be called for end
5421 session and query end session events, it doesn't make sense for close
5422 window event.
5ba5649b 5423 """
54f9ee45 5424 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
e811c8ce
RD
5425
5426 def Veto(*args, **kwargs):
5ba5649b
RD
5427 """
5428 Veto(self, bool veto=True)
5429
5430 Call this from your event handler to veto a system shutdown or to
5431 signal to the calling application that a window close did not happen.
5432
5433 You can only veto a shutdown or close if `CanVeto` returns true.
5434 """
54f9ee45 5435 return _core_.CloseEvent_Veto(*args, **kwargs)
e811c8ce 5436
5ba5649b
RD
5437 def GetVeto(*args, **kwargs):
5438 """GetVeto(self) -> bool"""
5439 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5440
e811c8ce 5441 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5442 """
5443 SetCanVeto(self, bool canVeto)
5444
5445 Sets the 'can veto' flag.
5446 """
54f9ee45 5447 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
e811c8ce
RD
5448
5449 def CanVeto(*args, **kwargs):
5ba5649b
RD
5450 """
5451 CanVeto(self) -> bool
e811c8ce 5452
5ba5649b
RD
5453 Returns true if you can veto a system shutdown or a window close
5454 event. Vetoing a window close event is not possible if the calling
5455 code wishes to force the application to exit, and so this function
5456 must be called to check this.
5457 """
5458 return _core_.CloseEvent_CanVeto(*args, **kwargs)
e811c8ce 5459
2bf58437 5460 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
2131d850 5461_core_.CloseEvent_swigregister(CloseEvent)
d14a1e28
RD
5462
5463#---------------------------------------------------------------------------
5464
5465class ShowEvent(Event):
5ba5649b 5466 """An EVT_SHOW event is sent when a window is shown or hidden."""
0085ce49
RD
5467 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5468 __repr__ = _swig_repr
5469 def __init__(self, *args, **kwargs):
5ba5649b
RD
5470 """
5471 __init__(self, int winid=0, bool show=False) -> ShowEvent
5472
5473 An EVT_SHOW event is sent when a window is shown or hidden.
5474 """
0085ce49 5475 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
e811c8ce 5476 def SetShow(*args, **kwargs):
a95a7133 5477 """SetShow(self, bool show)"""
54f9ee45 5478 return _core_.ShowEvent_SetShow(*args, **kwargs)
e811c8ce
RD
5479
5480 def GetShow(*args, **kwargs):
a95a7133 5481 """GetShow(self) -> bool"""
54f9ee45 5482 return _core_.ShowEvent_GetShow(*args, **kwargs)
e811c8ce 5483
2131d850 5484_core_.ShowEvent_swigregister(ShowEvent)
d14a1e28
RD
5485
5486#---------------------------------------------------------------------------
5487
5488class IconizeEvent(Event):
5ba5649b
RD
5489 """
5490 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5491 restored.
5492 """
0085ce49
RD
5493 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5494 __repr__ = _swig_repr
5495 def __init__(self, *args, **kwargs):
5ba5649b
RD
5496 """
5497 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5498
5499 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5500 restored.
5501 """
0085ce49 5502 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
e811c8ce 5503 def Iconized(*args, **kwargs):
5ba5649b
RD
5504 """
5505 Iconized(self) -> bool
5506
5507 Returns ``True`` if the frame has been iconized, ``False`` if it has
5508 been restored.
5509 """
54f9ee45 5510 return _core_.IconizeEvent_Iconized(*args, **kwargs)
e811c8ce 5511
2131d850 5512_core_.IconizeEvent_swigregister(IconizeEvent)
d14a1e28
RD
5513
5514#---------------------------------------------------------------------------
5515
5516class MaximizeEvent(Event):
5ba5649b 5517 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
0085ce49
RD
5518 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5519 __repr__ = _swig_repr
5520 def __init__(self, *args, **kwargs):
5ba5649b
RD
5521 """
5522 __init__(self, int id=0) -> MaximizeEvent
5523
5524 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5525 """
0085ce49 5526 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5527_core_.MaximizeEvent_swigregister(MaximizeEvent)
d14a1e28
RD
5528
5529#---------------------------------------------------------------------------
5530
5531class DropFilesEvent(Event):
5ba5649b
RD
5532 """
5533 This class is used for drop files events, that is, when files have
5534 been dropped onto the window. This functionality is only available
5535 under Windows. The window must have previously been enabled for
5536 dropping by calling `wx.Window.DragAcceptFiles`.
5537
5538 Important note: this is a separate implementation to the more general
5539 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5540 implementation uses the older, Windows message-based approach of
5541 dropping files.
5542
5543 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5544 events.
5545
5546 """
0085ce49
RD
5547 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5548 def __init__(self): raise AttributeError, "No constructor defined"
5549 __repr__ = _swig_repr
e811c8ce 5550 def GetPosition(*args, **kwargs):
5ba5649b
RD
5551 """
5552 GetPosition(self) -> Point
5553
5554 Returns the position at which the files were dropped.
5555 """
54f9ee45 5556 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
5557
5558 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5559 """
5560 GetNumberOfFiles(self) -> int
5561
5562 Returns the number of files dropped.
5563 """
54f9ee45 5564 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
e811c8ce
RD
5565
5566 def GetFiles(*args, **kwargs):
5ba5649b
RD
5567 """
5568 GetFiles(self) -> PyObject
5569
5570 Returns a list of the filenames that were dropped.
5571 """
54f9ee45 5572 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
e811c8ce 5573
2bf58437
RD
5574 Files = property(GetFiles,doc="See `GetFiles`")
5575 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
5576 Position = property(GetPosition,doc="See `GetPosition`")
2131d850 5577_core_.DropFilesEvent_swigregister(DropFilesEvent)
d14a1e28
RD
5578
5579#---------------------------------------------------------------------------
5580
54f9ee45
RD
5581UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5582UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
d14a1e28 5583class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5584 """
5585 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5586 wxWidgets to give an application the chance to update various user
5587 interface elements.
5588
5589 Without update UI events, an application has to work hard to
5590 check/uncheck, enable/disable, and set the text for elements such as
5591 menu items and toolbar buttons. The code for doing this has to be
5592 mixed up with the code that is invoked when an action is invoked for a
5593 menu item or button.
5594
5595 With update UI events, you define an event handler to look at the
5596 state of the application and change UI elements accordingly. wxWidgets
5597 will call your handler functions in idle time, so you don't have to
5598 worry where to call this code. In addition to being a clearer and more
5599 declarative method, it also means you don't have to worry whether
5600 you're updating a toolbar or menubar identifier. The same handler can
5601 update a menu item and toolbar button, if the ID values are the same.
5602
5603 Instead of directly manipulating the menu or button, you call
5604 functions in the event object, such as `Check`. wxWidgets will
5605 determine whether such a call has been made, and which UI element to
5606 update.
5607
5608 These events will work for popup menus as well as menubars. Just
5609 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
5610 any UI events for the window that owns the menu.
5611
5612 If you find that the overhead of UI update processing is affecting
5613 your application, you can do one or both of the following:
5614
5615 1. Call `wx.UpdateUIEvent.SetMode` with a value of
5616 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
5617 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
5618 receive update events. No other windows will receive update
5619 events.
5620
5621 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
5622 value to set the delay between updates. You may need to call
5623 `wx.Window.UpdateWindowUI` at critical points, for example when
5624 a dialog is about to be shown, in case the user sees a slight
5625 delay before windows are updated.
5626
5627 Note that although events are sent in idle time, defining a EVT_IDLE
5628 handler for a window does not affect this because the events are sent
5629 from an internal idle handler.
5630
5631 wxWidgets tries to optimize update events on some platforms. On
5632 Windows and GTK+, events for menubar items are only sent when the menu
5633 is about to be shown, and not in idle time.
5634
5635 """
0085ce49
RD
5636 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5637 __repr__ = _swig_repr
5638 def __init__(self, *args, **kwargs):
5ba5649b
RD
5639 """
5640 __init__(self, int commandId=0) -> UpdateUIEvent
5641
5642 Constructor
5643 """
0085ce49 5644 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
e811c8ce 5645 def GetChecked(*args, **kwargs):
5ba5649b
RD
5646 """
5647 GetChecked(self) -> bool
5648
5649 Returns ``True`` if the UI element should be checked.
5650 """
54f9ee45 5651 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
e811c8ce
RD
5652
5653 def GetEnabled(*args, **kwargs):
5ba5649b
RD
5654 """
5655 GetEnabled(self) -> bool
5656
5657 Returns ``True`` if the UI element should be enabled.
5658 """
54f9ee45 5659 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
e811c8ce 5660
b1fcee84
RD
5661 def GetShown(*args, **kwargs):
5662 """
5663 GetShown(self) -> bool
5664
5665 Returns ``True`` if the UI element should be shown.
5666 """
5667 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
5668
e811c8ce 5669 def GetText(*args, **kwargs):
5ba5649b
RD
5670 """
5671 GetText(self) -> String
5672
5673 Returns the text that should be set for the UI element.
5674 """
54f9ee45 5675 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
e811c8ce
RD
5676
5677 def GetSetText(*args, **kwargs):
5ba5649b
RD
5678 """
5679 GetSetText(self) -> bool
5680
5681 Returns ``True`` if the application has called `SetText`. For
5682 wxWidgets internal use only.
5683 """
54f9ee45 5684 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
e811c8ce
RD
5685
5686 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
5687 """
5688 GetSetChecked(self) -> bool
5689
5690 Returns ``True`` if the application has called `Check`. For wxWidgets
5691 internal use only.
5692 """
54f9ee45 5693 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
e811c8ce
RD
5694
5695 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
5696 """
5697 GetSetEnabled(self) -> bool
5698
5699 Returns ``True`` if the application has called `Enable`. For wxWidgets
5700 internal use only.
5701 """
54f9ee45 5702 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
e811c8ce 5703
b1fcee84
RD
5704 def GetSetShown(*args, **kwargs):
5705 """
5706 GetSetShown(self) -> bool
5707
5708 Returns ``True`` if the application has called `Show`. For wxWidgets
5709 internal use only.
5710 """
5711 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
5712
e811c8ce 5713 def Check(*args, **kwargs):
5ba5649b
RD
5714 """
5715 Check(self, bool check)
5716
5717 Check or uncheck the UI element.
5718 """
54f9ee45 5719 return _core_.UpdateUIEvent_Check(*args, **kwargs)
e811c8ce
RD
5720
5721 def Enable(*args, **kwargs):
5ba5649b
RD
5722 """
5723 Enable(self, bool enable)
5724
5725 Enable or disable the UI element.
5726 """
54f9ee45 5727 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
e811c8ce 5728
b1fcee84
RD
5729 def Show(*args, **kwargs):
5730 """
5731 Show(self, bool show)
5732
5733 Show or hide the UI element.
5734 """
5735 return _core_.UpdateUIEvent_Show(*args, **kwargs)
5736
e811c8ce 5737 def SetText(*args, **kwargs):
5ba5649b
RD
5738 """
5739 SetText(self, String text)
5740
5741 Sets the text for this UI element.
5742 """
54f9ee45 5743 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
e811c8ce
RD
5744
5745 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5746 """
5747 SetUpdateInterval(long updateInterval)
5748
5749 Sets the interval between updates in milliseconds. Set to -1 to
5750 disable updates, or to 0 to update as frequently as possible. The
5751 default is 0.
5752
5753 Use this to reduce the overhead of UI update events if your
5754 application has a lot of windows. If you set the value to -1 or
5755 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5756 at appropriate points in your application, such as when a dialog is
5757 about to be shown.
5758 """
54f9ee45 5759 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
e811c8ce
RD
5760
5761 SetUpdateInterval = staticmethod(SetUpdateInterval)
5762 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
5763 """
5764 GetUpdateInterval() -> long
5765
5766 Returns the current interval between updates in milliseconds. -1
5767 disables updates, 0 updates as frequently as possible.
5768 """
54f9ee45 5769 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
e811c8ce
RD
5770
5771 GetUpdateInterval = staticmethod(GetUpdateInterval)
5772 def CanUpdate(*args, **kwargs):
5ba5649b
RD
5773 """
5774 CanUpdate(Window win) -> bool
5775
5776 Returns ``True`` if it is appropriate to update (send UI update events
5777 to) this window.
5778
5779 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5780 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5781 events were last sent in idle time, and the update interval, to
5782 determine whether events should be sent to this window now. By default
5783 this will always return true because the update mode is initially
5784 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5785 events will be sent as often as possible. You can reduce the frequency
5786 that events are sent by changing the mode and/or setting an update
5787 interval.
5788
5789 """
54f9ee45 5790 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
e811c8ce
RD
5791
5792 CanUpdate = staticmethod(CanUpdate)
5793 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
5794 """
5795 ResetUpdateTime()
5796
5797 Used internally to reset the last-updated time to the current time. It
5798 is assumed that update events are normally sent in idle time, so this
5799 is called at the end of idle processing.
5800 """
54f9ee45 5801 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
e811c8ce
RD
5802
5803 ResetUpdateTime = staticmethod(ResetUpdateTime)
5804 def SetMode(*args, **kwargs):
5ba5649b
RD
5805 """
5806 SetMode(int mode)
5807
5808 Specify how wxWidgets will send update events: to all windows, or only
5809 to those which specify that they will process the events.
5810
5811 The mode may be one of the following values:
5812
5813 ============================= ==========================================
5814 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5815 is the default setting.
5816 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5817 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5818 style set.
5819 ============================= ==========================================
5820
5821 """
54f9ee45 5822 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
e811c8ce
RD
5823
5824 SetMode = staticmethod(SetMode)
5825 def GetMode(*args, **kwargs):
5ba5649b
RD
5826 """
5827 GetMode() -> int
5828
5829 Returns a value specifying how wxWidgets will send update events: to
5830 all windows, or only to those which specify that they will process the
5831 events.
5832 """
54f9ee45 5833 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
e811c8ce
RD
5834
5835 GetMode = staticmethod(GetMode)
2131d850 5836_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d14a1e28 5837
e811c8ce 5838def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
0085ce49 5839 """
5ba5649b
RD
5840 UpdateUIEvent_SetUpdateInterval(long updateInterval)
5841
5842 Sets the interval between updates in milliseconds. Set to -1 to
5843 disable updates, or to 0 to update as frequently as possible. The
5844 default is 0.
5845
5846 Use this to reduce the overhead of UI update events if your
5847 application has a lot of windows. If you set the value to -1 or
5848 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
5849 at appropriate points in your application, such as when a dialog is
5850 about to be shown.
5851 """
0085ce49 5852 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d14a1e28 5853
0085ce49
RD
5854def UpdateUIEvent_GetUpdateInterval(*args):
5855 """
5ba5649b
RD
5856 UpdateUIEvent_GetUpdateInterval() -> long
5857
5858 Returns the current interval between updates in milliseconds. -1
5859 disables updates, 0 updates as frequently as possible.
5860 """
0085ce49 5861 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d14a1e28 5862
e811c8ce 5863def UpdateUIEvent_CanUpdate(*args, **kwargs):
0085ce49 5864 """
5ba5649b
RD
5865 UpdateUIEvent_CanUpdate(Window win) -> bool
5866
5867 Returns ``True`` if it is appropriate to update (send UI update events
5868 to) this window.
5869
5870 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
5871 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
5872 events were last sent in idle time, and the update interval, to
5873 determine whether events should be sent to this window now. By default
5874 this will always return true because the update mode is initially
5875 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
5876 events will be sent as often as possible. You can reduce the frequency
5877 that events are sent by changing the mode and/or setting an update
5878 interval.
5879
5880 """
0085ce49 5881 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d14a1e28 5882
0085ce49
RD
5883def UpdateUIEvent_ResetUpdateTime(*args):
5884 """
5ba5649b
RD
5885 UpdateUIEvent_ResetUpdateTime()
5886
5887 Used internally to reset the last-updated time to the current time. It
5888 is assumed that update events are normally sent in idle time, so this
5889 is called at the end of idle processing.
5890 """
0085ce49 5891 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d14a1e28 5892
e811c8ce 5893def UpdateUIEvent_SetMode(*args, **kwargs):
0085ce49 5894 """
5ba5649b
RD
5895 UpdateUIEvent_SetMode(int mode)
5896
5897 Specify how wxWidgets will send update events: to all windows, or only
5898 to those which specify that they will process the events.
5899
5900 The mode may be one of the following values:
5901
5902 ============================= ==========================================
5903 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
5904 is the default setting.
5905 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
5906 have the wx.WS_EX_PROCESS_UI_UPDATES extra
5907 style set.
5908 ============================= ==========================================
5909
5910 """
0085ce49 5911 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d14a1e28 5912
0085ce49
RD
5913def UpdateUIEvent_GetMode(*args):
5914 """
5ba5649b
RD
5915 UpdateUIEvent_GetMode() -> int
5916
5917 Returns a value specifying how wxWidgets will send update events: to
5918 all windows, or only to those which specify that they will process the
5919 events.
5920 """
0085ce49 5921 return _core_.UpdateUIEvent_GetMode(*args)
d14a1e28
RD
5922
5923#---------------------------------------------------------------------------
5924
5925class SysColourChangedEvent(Event):
5ba5649b
RD
5926 """
5927 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
5928 when the user changes the colour settings using the control
5929 panel. This is only applicable under Windows.
5930
5931 The default event handler for this event propagates the event to child
5932 windows, since Windows only sends the events to top-level windows. If
5933 intercepting this event for a top-level window, remember to call
5934 `Skip` so the the base class handler will still be executed, or to
5935 pass the event on to the window's children explicitly.
5936
5937 """
0085ce49
RD
5938 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5939 __repr__ = _swig_repr
5940 def __init__(self, *args, **kwargs):
5ba5649b
RD
5941 """
5942 __init__(self) -> SysColourChangedEvent
5943
5944 Constructor
5945 """
0085ce49 5946 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 5947_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d14a1e28
RD
5948
5949#---------------------------------------------------------------------------
5950
5951class MouseCaptureChangedEvent(Event):
5ba5649b
RD
5952 """
5953 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
5954 a window that loses its mouse capture. This is called even if
5955 `wx.Window.ReleaseMouse` was called by the application code. Handling
5956 this event allows an application to cater for unexpected capture
5957 releases which might otherwise confuse mouse handling code.
5958
5959 This event is implemented under Windows only.
5960 """
0085ce49
RD
5961 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5962 __repr__ = _swig_repr
5963 def __init__(self, *args, **kwargs):
5ba5649b
RD
5964 """
5965 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
5966
5967 Constructor
5968 """
0085ce49 5969 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
e811c8ce 5970 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
5971 """
5972 GetCapturedWindow(self) -> Window
5973
5974 Returns the window that gained the capture, or ``None`` if it was a
5975 non-wxWidgets window.
5976 """
54f9ee45 5977 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
e811c8ce 5978
57332a5a 5979 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
2131d850 5980_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d14a1e28
RD
5981
5982#---------------------------------------------------------------------------
5983
34e0a3bb
RD
5984class MouseCaptureLostEvent(Event):
5985 """
5986 A mouse capture lost event is sent to a window that obtained mouse
5987 capture, which was subsequently loss due to "external" event, for
5988 example when a dialog box is shown or if another application captures
5989 the mouse.
5990
5991 If this happens, this event is sent to all windows that are on the
5992 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
5993 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
5994 if the capture changes because of a call to CaptureMouse or
5995 ReleaseMouse.
5996
5997 This event is currently emitted under Windows only.
5998
5999 """
6000 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6001 __repr__ = _swig_repr
6002 def __init__(self, *args, **kwargs):
6003 """
6004 __init__(self, int winid=0) -> MouseCaptureLostEvent
6005
6006 A mouse capture lost event is sent to a window that obtained mouse
6007 capture, which was subsequently loss due to "external" event, for
6008 example when a dialog box is shown or if another application captures
6009 the mouse.
6010
6011 If this happens, this event is sent to all windows that are on the
6012 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6013 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6014 if the capture changes because of a call to CaptureMouse or
6015 ReleaseMouse.
6016
6017 This event is currently emitted under Windows only.
6018
6019 """
6020 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6021_core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6022
6023#---------------------------------------------------------------------------
6024
d14a1e28 6025class DisplayChangedEvent(Event):
5ba5649b
RD
6026 """
6027 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6028 resolution has changed.
6029
6030 This event is implemented under Windows only.
6031 """
0085ce49
RD
6032 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6033 __repr__ = _swig_repr
6034 def __init__(self, *args, **kwargs):
a95a7133 6035 """__init__(self) -> DisplayChangedEvent"""
0085ce49 6036 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 6037_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d14a1e28
RD
6038
6039#---------------------------------------------------------------------------
6040
6041class PaletteChangedEvent(Event):
5ba5649b
RD
6042 """
6043 An EVT_PALETTE_CHANGED event is sent when the system palette has
6044 changed, thereby giving each window a chance to redo their own to
6045 match.
6046
6047 This event is implemented under Windows only.
6048 """
0085ce49
RD
6049 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6050 __repr__ = _swig_repr
6051 def __init__(self, *args, **kwargs):
5ba5649b
RD
6052 """
6053 __init__(self, int id=0) -> PaletteChangedEvent
6054
6055 An EVT_PALETTE_CHANGED event is sent when the system palette has
6056 changed, thereby giving each window a chance to redo their own to
6057 match.
6058
6059 This event is implemented under Windows only.
6060 """
0085ce49 6061 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
e811c8ce 6062 def SetChangedWindow(*args, **kwargs):
a95a7133 6063 """SetChangedWindow(self, Window win)"""
54f9ee45 6064 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
e811c8ce
RD
6065
6066 def GetChangedWindow(*args, **kwargs):
a95a7133 6067 """GetChangedWindow(self) -> Window"""
54f9ee45 6068 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
e811c8ce 6069
2131d850 6070_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d14a1e28
RD
6071
6072#---------------------------------------------------------------------------
6073
6074class QueryNewPaletteEvent(Event):
5ba5649b
RD
6075 """
6076 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6077 focus and should re-do its palette.
6078
6079 This event is implemented under Windows only.
6080 """
0085ce49
RD
6081 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6082 __repr__ = _swig_repr
6083 def __init__(self, *args, **kwargs):
5ba5649b
RD
6084 """
6085 __init__(self, int winid=0) -> QueryNewPaletteEvent
6086
6087 Constructor.
6088 """
0085ce49 6089 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
e811c8ce 6090 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6091 """
6092 SetPaletteRealized(self, bool realized)
6093
6094 App should set this if it changes the palette.
6095 """
54f9ee45 6096 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
e811c8ce
RD
6097
6098 def GetPaletteRealized(*args, **kwargs):
a95a7133 6099 """GetPaletteRealized(self) -> bool"""
54f9ee45 6100 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
e811c8ce 6101
2131d850 6102_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d14a1e28
RD
6103
6104#---------------------------------------------------------------------------
6105
6106class NavigationKeyEvent(Event):
5ba5649b
RD
6107 """
6108 EVT_NAVIGATION_KEY events are used to control moving the focus between
6109 widgets, otherwise known as tab-traversal. You woudl normally not
6110 catch navigation events in applications as there are already
6111 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6112 it useful to send navigation events in certain situations to change
6113 the focus in certain ways, although it's probably easier to just call
6114 `wx.Window.Navigate`.
6115 """
0085ce49
RD
6116 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6117 __repr__ = _swig_repr
6118 def __init__(self, *args, **kwargs):
a95a7133 6119 """__init__(self) -> NavigationKeyEvent"""
0085ce49 6120 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
e811c8ce 6121 def GetDirection(*args, **kwargs):
5ba5649b
RD
6122 """
6123 GetDirection(self) -> bool
6124
6125 Returns ``True`` if the direction is forward, ``False`` otherwise.
6126 """
54f9ee45 6127 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
e811c8ce
RD
6128
6129 def SetDirection(*args, **kwargs):
5ba5649b
RD
6130 """
6131 SetDirection(self, bool forward)
6132
6133 Specify the direction that the navigation should take. Usually the
6134 difference between using Tab and Shift-Tab.
6135 """
54f9ee45 6136 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
e811c8ce
RD
6137
6138 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6139 """
6140 IsWindowChange(self) -> bool
6141
6142 Returns ``True`` if window change is allowed.
6143 """
54f9ee45 6144 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
e811c8ce
RD
6145
6146 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6147 """
6148 SetWindowChange(self, bool ischange)
6149
6150 Specify if the navigation should be able to change parent windows.
6151 For example, changing notebook pages, etc. This is usually implemented
6152 by using Control-Tab.
6153 """
54f9ee45 6154 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
e811c8ce 6155
68350608 6156 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6157 """
6158 IsFromTab(self) -> bool
6159
6160 Returns ``True`` if the navigation event is originated from the Tab
6161 key.
6162 """
68350608
RD
6163 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
6164
6165 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6166 """
6167 SetFromTab(self, bool bIs)
6168
6169 Set to true under MSW if the event was generated using the tab key.
6170 This is required for proper navogation over radio buttons.
6171 """
68350608
RD
6172 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
6173
908b74cd 6174 def SetFlags(*args, **kwargs):
5ba5649b
RD
6175 """
6176 SetFlags(self, long flags)
6177
6178 Set the navigation flags to a combination of the following:
6179
6180 * wx.NavigationKeyEvent.IsBackward
6181 * wx.NavigationKeyEvent.IsForward
6182 * wx.NavigationKeyEvent.WinChange
6183 * wx.NavigationKeyEvent.FromTab
6184
6185 """
908b74cd
RD
6186 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
6187
e811c8ce 6188 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6189 """
6190 GetCurrentFocus(self) -> Window
6191
6192 Returns the child window which currenty has the focus. May be
6193 ``None``.
6194 """
54f9ee45 6195 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
e811c8ce
RD
6196
6197 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6198 """
6199 SetCurrentFocus(self, Window win)
6200
6201 Set the window that has the focus.
6202 """
54f9ee45 6203 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
e811c8ce 6204
b0f7404b 6205 IsBackward = _core_.NavigationKeyEvent_IsBackward
908b74cd
RD
6206 IsForward = _core_.NavigationKeyEvent_IsForward
6207 WinChange = _core_.NavigationKeyEvent_WinChange
68350608 6208 FromTab = _core_.NavigationKeyEvent_FromTab
57332a5a
RD
6209 CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`")
6210 Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`")
2131d850 6211_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d14a1e28
RD
6212
6213#---------------------------------------------------------------------------
6214
6215class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6216 """
6217 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6218 underlying GUI object) exists.
6219 """
0085ce49
RD
6220 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6221 __repr__ = _swig_repr
6222 def __init__(self, *args, **kwargs):
5ba5649b
RD
6223 """
6224 __init__(self, Window win=None) -> WindowCreateEvent
6225
6226 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6227 underlying GUI object) exists.
6228 """
0085ce49 6229 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
e811c8ce 6230 def GetWindow(*args, **kwargs):
5ba5649b
RD
6231 """
6232 GetWindow(self) -> Window
6233
6234 Returns the window that this event refers to.
6235 """
54f9ee45 6236 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
e811c8ce 6237
2131d850 6238_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d14a1e28
RD
6239
6240class WindowDestroyEvent(CommandEvent):
5ba5649b 6241 """
943e8dfd
RD
6242 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6243 when the GUI window is destroyed.
6244
6245 When a class derived from `wx.Window` is destroyed its destructor will
6246 have already run by the time this event is sent. Therefore this event
6247 will not usually be received at all by the window itself. Since it is
6248 received after the destructor has run, an object should not try to
6249 handle its own wx.WindowDestroyEvent, but it can be used to get
6250 notification of the destruction of another window.
5ba5649b 6251 """
0085ce49
RD
6252 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6253 __repr__ = _swig_repr
6254 def __init__(self, *args, **kwargs):
5ba5649b
RD
6255 """
6256 __init__(self, Window win=None) -> WindowDestroyEvent
6257
943e8dfd
RD
6258 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6259 when the GUI window is destroyed.
6260
6261 When a class derived from `wx.Window` is destroyed its destructor will
6262 have already run by the time this event is sent. Therefore this event
6263 will not usually be received at all by the window itself. Since it is
6264 received after the destructor has run, an object should not try to
6265 handle its own wx.WindowDestroyEvent, but it can be used to get
6266 notification of the destruction of another window.
5ba5649b 6267 """
0085ce49 6268 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
e811c8ce 6269 def GetWindow(*args, **kwargs):
5ba5649b
RD
6270 """
6271 GetWindow(self) -> Window
6272
6273 Returns the window that this event refers to.
6274 """
54f9ee45 6275 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
e811c8ce 6276
2131d850 6277_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d14a1e28
RD
6278
6279#---------------------------------------------------------------------------
6280
6281class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6282 """
6283 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6284 give the application a chance to show a context (popup) menu.
6285 """
0085ce49
RD
6286 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6287 __repr__ = _swig_repr
6288 def __init__(self, *args, **kwargs):
5ba5649b 6289 """
2131d850 6290 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6291
6292 Constructor.
6293 """
0085ce49 6294 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
e811c8ce 6295 def GetPosition(*args, **kwargs):
5ba5649b
RD
6296 """
6297 GetPosition(self) -> Point
6298
6299 Returns the position (in screen coordinants) at which the menu should
6300 be shown.
6301 """
54f9ee45 6302 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
e811c8ce
RD
6303
6304 def SetPosition(*args, **kwargs):
5ba5649b
RD
6305 """
6306 SetPosition(self, Point pos)
6307
6308 Sets the position at which the menu should be shown.
6309 """
54f9ee45 6310 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
e811c8ce 6311
2bf58437 6312 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 6313_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d14a1e28
RD
6314
6315#---------------------------------------------------------------------------
6316
54f9ee45
RD
6317IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6318IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
d14a1e28 6319class IdleEvent(Event):
5ba5649b
RD
6320 """
6321 This class is used for EVT_IDLE events, which are generated and sent
6322 when the application *becomes* idle. In other words, the when the
6323 event queue becomes empty then idle events are sent to all windows (by
6324 default) and as long as none of them call `RequestMore` then there are
6325 no more idle events until after the system event queue has some normal
6326 events and then becomes empty again.
6327
6328 By default, idle events are sent to all windows. If this is causing a
6329 significant overhead in your application, you can call
6330 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6331 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6332 which should receive idle events. Then idle events will only be sent
6333 to those windows and not to any others.
6334 """
0085ce49
RD
6335 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6336 __repr__ = _swig_repr
6337 def __init__(self, *args, **kwargs):
5ba5649b
RD
6338 """
6339 __init__(self) -> IdleEvent
6340
6341 Constructor
6342 """
0085ce49 6343 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
e811c8ce 6344 def RequestMore(*args, **kwargs):
5ba5649b
RD
6345 """
6346 RequestMore(self, bool needMore=True)
6347
6348 Tells wxWidgets that more processing is required. This function can be
6349 called by an EVT_IDLE handler for a window to indicate that the
6350 application should forward the EVT_IDLE event once more to the
6351 application windows. If no window calls this function during its
6352 EVT_IDLE handler, then the application will remain in a passive event
6353 loop until a new event is posted to the application by the windowing
6354 system.
6355 """
54f9ee45 6356 return _core_.IdleEvent_RequestMore(*args, **kwargs)
e811c8ce
RD
6357
6358 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6359 """
6360 MoreRequested(self) -> bool
6361
6362 Returns ``True`` if the OnIdle function processing this event
6363 requested more processing time.
6364 """
54f9ee45 6365 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
e811c8ce
RD
6366
6367 def SetMode(*args, **kwargs):
5ba5649b
RD
6368 """
6369 SetMode(int mode)
6370
6371 Static method for specifying how wxWidgets will send idle events: to
6372 all windows, or only to those which specify that they will process the
6373 events.
6374
6375 The mode can be one of the following values:
6376
6377 ========================= ========================================
6378 wx.IDLE_PROCESS_ALL Send idle events to all windows
6379 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6380 the wx.WS_EX_PROCESS_IDLE extra style
6381 flag set.
6382 ========================= ========================================
6383
6384 """
54f9ee45 6385 return _core_.IdleEvent_SetMode(*args, **kwargs)
e811c8ce
RD
6386
6387 SetMode = staticmethod(SetMode)
6388 def GetMode(*args, **kwargs):
5ba5649b
RD
6389 """
6390 GetMode() -> int
6391
6392 Static method returning a value specifying how wxWidgets will send
6393 idle events: to all windows, or only to those which specify that they
6394 will process the events.
6395 """
54f9ee45 6396 return _core_.IdleEvent_GetMode(*args, **kwargs)
e811c8ce
RD
6397
6398 GetMode = staticmethod(GetMode)
6399 def CanSend(*args, **kwargs):
5ba5649b
RD
6400 """
6401 CanSend(Window win) -> bool
6402
6403 Returns ``True`` if it is appropriate to send idle events to this
6404 window.
6405
6406 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6407 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6408 events should be sent to this window now. By default this will always
6409 return ``True`` because the update mode is initially
6410 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6411 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6412 """
54f9ee45 6413 return _core_.IdleEvent_CanSend(*args, **kwargs)
e811c8ce
RD
6414
6415 CanSend = staticmethod(CanSend)
2131d850 6416_core_.IdleEvent_swigregister(IdleEvent)
d14a1e28 6417
e811c8ce 6418def IdleEvent_SetMode(*args, **kwargs):
0085ce49 6419 """
5ba5649b
RD
6420 IdleEvent_SetMode(int mode)
6421
6422 Static method for specifying how wxWidgets will send idle events: to
6423 all windows, or only to those which specify that they will process the
6424 events.
6425
6426 The mode can be one of the following values:
6427
6428 ========================= ========================================
6429 wx.IDLE_PROCESS_ALL Send idle events to all windows
6430 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6431 the wx.WS_EX_PROCESS_IDLE extra style
6432 flag set.
6433 ========================= ========================================
6434
6435 """
0085ce49 6436 return _core_.IdleEvent_SetMode(*args, **kwargs)
d14a1e28 6437
0085ce49
RD
6438def IdleEvent_GetMode(*args):
6439 """
5ba5649b
RD
6440 IdleEvent_GetMode() -> int
6441
6442 Static method returning a value specifying how wxWidgets will send
6443 idle events: to all windows, or only to those which specify that they
6444 will process the events.
6445 """
0085ce49 6446 return _core_.IdleEvent_GetMode(*args)
d14a1e28 6447
e811c8ce 6448def IdleEvent_CanSend(*args, **kwargs):
0085ce49 6449 """
5ba5649b
RD
6450 IdleEvent_CanSend(Window win) -> bool
6451
6452 Returns ``True`` if it is appropriate to send idle events to this
6453 window.
6454
6455 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6456 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6457 events should be sent to this window now. By default this will always
6458 return ``True`` because the update mode is initially
6459 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6460 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6461 """
0085ce49 6462 return _core_.IdleEvent_CanSend(*args, **kwargs)
d14a1e28
RD
6463
6464#---------------------------------------------------------------------------
6465
2131d850
RD
6466class ClipboardTextEvent(CommandEvent):
6467 """
6468 A Clipboard Text event is sent when a window intercepts a text
6469 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6470 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6471 popup menu command, etc. NOTE : under windows these events are *NOT*
6472 generated automatically for a Rich Edit text control.
6473 """
6474 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6475 __repr__ = _swig_repr
6476 def __init__(self, *args, **kwargs):
6477 """
6478 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6479
6480 A Clipboard Text event is sent when a window intercepts a text
6481 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6482 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6483 popup menu command, etc. NOTE : under windows these events are *NOT*
6484 generated automatically for a Rich Edit text control.
6485 """
6486 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6487_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6488
6489#---------------------------------------------------------------------------
6490
d14a1e28 6491class PyEvent(Event):
5ba5649b
RD
6492 """
6493 wx.PyEvent can be used as a base class for implementing custom event
6494 types in Python. You should derived from this class instead of
6495 `wx.Event` because this class is Python-aware and is able to transport
6496 its Python bits safely through the wxWidgets event system and have
6497 them still be there when the event handler is invoked.
6498
6499 :see: `wx.PyCommandEvent`
6500
6501 """
0085ce49
RD
6502 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6503 __repr__ = _swig_repr
6504 def __init__(self, *args, **kwargs):
2131d850 6505 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
0085ce49 6506 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6507 self._SetSelf(self)
e811c8ce 6508
0085ce49
RD
6509 __swig_destroy__ = _core_.delete_PyEvent
6510 __del__ = lambda self : None;
5ba5649b
RD
6511 def _SetSelf(*args, **kwargs):
6512 """_SetSelf(self, PyObject self)"""
6513 return _core_.PyEvent__SetSelf(*args, **kwargs)
e811c8ce 6514
5ba5649b
RD
6515 def _GetSelf(*args, **kwargs):
6516 """_GetSelf(self) -> PyObject"""
6517 return _core_.PyEvent__GetSelf(*args, **kwargs)
e811c8ce 6518
2131d850 6519_core_.PyEvent_swigregister(PyEvent)
d14a1e28
RD
6520
6521class PyCommandEvent(CommandEvent):
5ba5649b
RD
6522 """
6523 wx.PyCommandEvent can be used as a base class for implementing custom
6524 event types in Python, where the event shoudl travel up to parent
6525 windows looking for a handler. You should derived from this class
6526 instead of `wx.CommandEvent` because this class is Python-aware and is
6527 able to transport its Python bits safely through the wxWidgets event
6528 system and have them still be there when the event handler is invoked.
6529
6530 :see: `wx.PyEvent`
6531
6532 """
0085ce49
RD
6533 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6534 __repr__ = _swig_repr
6535 def __init__(self, *args, **kwargs):
2131d850 6536 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
0085ce49 6537 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6538 self._SetSelf(self)
e811c8ce 6539
0085ce49
RD
6540 __swig_destroy__ = _core_.delete_PyCommandEvent
6541 __del__ = lambda self : None;
5ba5649b
RD
6542 def _SetSelf(*args, **kwargs):
6543 """_SetSelf(self, PyObject self)"""
6544 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
e811c8ce 6545
5ba5649b
RD
6546 def _GetSelf(*args, **kwargs):
6547 """_GetSelf(self) -> PyObject"""
6548 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
e811c8ce 6549
2131d850 6550_core_.PyCommandEvent_swigregister(PyCommandEvent)
d14a1e28 6551
53aa7709 6552class DateEvent(CommandEvent):
5ba5649b
RD
6553 """
6554 This event class holds information about a date change event and is
6555 used together with `wx.DatePickerCtrl`. It also serves as a base class
6556 for `wx.calendar.CalendarEvent`. Bind these event types with
6557 EVT_DATE_CHANGED.
6558 """
0085ce49
RD
6559 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6560 __repr__ = _swig_repr
6561 def __init__(self, *args, **kwargs):
2131d850 6562 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
0085ce49 6563 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6564 def GetDate(*args, **kwargs):
5ba5649b
RD
6565 """
6566 GetDate(self) -> DateTime
6567
6568 Returns the date.
6569 """
53aa7709
RD
6570 return _core_.DateEvent_GetDate(*args, **kwargs)
6571
6572 def SetDate(*args, **kwargs):
5ba5649b
RD
6573 """
6574 SetDate(self, DateTime date)
6575
6576 Sets the date carried by the event, normally only used by the library
6577 internally.
6578 """
53aa7709
RD
6579 return _core_.DateEvent_SetDate(*args, **kwargs)
6580
2bf58437 6581 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
2131d850 6582_core_.DateEvent_swigregister(DateEvent)
53aa7709
RD
6583
6584wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
6585EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
6586
d14a1e28
RD
6587#---------------------------------------------------------------------------
6588
54f9ee45
RD
6589PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
6590PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
6591PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
6592PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
6593PRINT_WINDOWS = _core_.PRINT_WINDOWS
6594PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
d14a1e28 6595class PyApp(EvtHandler):
66c033b4
RD
6596 """
6597 The ``wx.PyApp`` class is an *implementation detail*, please use the
6598 `wx.App` class (or some other derived class) instead.
6599 """
0085ce49
RD
6600 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6601 __repr__ = _swig_repr
6602 def __init__(self, *args, **kwargs):
98e665d3 6603 """
a95a7133 6604 __init__(self) -> PyApp
98e665d3
RD
6605
6606 Create a new application object, starting the bootstrap process.
6607 """
0085ce49 6608 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
70b7a5fe
RD
6609 self._setCallbackInfo(self, PyApp, False)
6610 self._setOORInfo(self, False)
e811c8ce 6611
0085ce49
RD
6612 __swig_destroy__ = _core_.delete_PyApp
6613 __del__ = lambda self : None;
e811c8ce 6614 def _setCallbackInfo(*args, **kwargs):
70b7a5fe 6615 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)"""
54f9ee45 6616 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
e811c8ce
RD
6617
6618 def GetAppName(*args, **kwargs):
0df68c9f 6619 """
a95a7133 6620 GetAppName(self) -> String
6c3b4aae 6621
0df68c9f
RD
6622 Get the application name.
6623 """
54f9ee45 6624 return _core_.PyApp_GetAppName(*args, **kwargs)
e811c8ce
RD
6625
6626 def SetAppName(*args, **kwargs):
0df68c9f 6627 """
a95a7133 6628 SetAppName(self, String name)
6c3b4aae 6629
66c033b4
RD
6630 Set the application name. This value may be used automatically by
6631 `wx.Config` and such.
0df68c9f 6632 """
54f9ee45 6633 return _core_.PyApp_SetAppName(*args, **kwargs)
e811c8ce
RD
6634
6635 def GetClassName(*args, **kwargs):
0df68c9f 6636 """
a95a7133 6637 GetClassName(self) -> String
e811c8ce 6638
0df68c9f
RD
6639 Get the application's class name.
6640 """
54f9ee45 6641 return _core_.PyApp_GetClassName(*args, **kwargs)
e811c8ce
RD
6642
6643 def SetClassName(*args, **kwargs):
0df68c9f 6644 """
a95a7133 6645 SetClassName(self, String name)
6c3b4aae 6646
66c033b4
RD
6647 Set the application's class name. This value may be used for
6648 X-resources if applicable for the platform
0df68c9f 6649 """
54f9ee45 6650 return _core_.PyApp_SetClassName(*args, **kwargs)
e811c8ce
RD
6651
6652 def GetVendorName(*args, **kwargs):
0df68c9f 6653 """
a95a7133 6654 GetVendorName(self) -> String
6c3b4aae 6655
0df68c9f
RD
6656 Get the application's vendor name.
6657 """
54f9ee45 6658 return _core_.PyApp_GetVendorName(*args, **kwargs)
e811c8ce
RD
6659
6660 def SetVendorName(*args, **kwargs):
0df68c9f 6661 """
a95a7133 6662 SetVendorName(self, String name)
6c3b4aae 6663
66c033b4
RD
6664 Set the application's vendor name. This value may be used
6665 automatically by `wx.Config` and such.
0df68c9f 6666 """
54f9ee45 6667 return _core_.PyApp_SetVendorName(*args, **kwargs)
e811c8ce
RD
6668
6669 def GetTraits(*args, **kwargs):
0df68c9f 6670 """
a95a7133 6671 GetTraits(self) -> wxAppTraits
6c3b4aae 6672
66c033b4
RD
6673 Return (and create if necessary) the app traits object to which we
6674 delegate for everything which either should be configurable by the
6675 user (then he can change the default behaviour simply by overriding
6676 CreateTraits() and returning his own traits object) or which is
6677 GUI/console dependent as then wx.AppTraits allows us to abstract the
6678 differences behind the common facade.
6679
6680 :todo: Add support for overriding CreateAppTraits in wxPython.
0df68c9f 6681 """
54f9ee45 6682 return _core_.PyApp_GetTraits(*args, **kwargs)
e811c8ce
RD
6683
6684 def ProcessPendingEvents(*args, **kwargs):
0df68c9f 6685 """
a95a7133 6686 ProcessPendingEvents(self)
6c3b4aae 6687
66c033b4
RD
6688 Process all events in the Pending Events list -- it is necessary to
6689 call this function to process posted events. This normally happens
6690 during each event loop iteration.
0df68c9f 6691 """
54f9ee45 6692 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
e811c8ce
RD
6693
6694 def Yield(*args, **kwargs):
0df68c9f 6695 """
a95a7133 6696 Yield(self, bool onlyIfNeeded=False) -> bool
6c3b4aae 6697
66c033b4
RD
6698 Process all currently pending events right now, instead of waiting
6699 until return to the event loop. It is an error to call ``Yield``
6700 recursively unless the value of ``onlyIfNeeded`` is True.
6c3b4aae 6701
66c033b4 6702 :warning: This function is dangerous as it can lead to unexpected
41e2b43e
RD
6703 reentrancies (i.e. when called from an event handler it may
6704 result in calling the same event handler again), use with
6705 extreme care or, better, don't use at all!
0df68c9f 6706
66c033b4 6707 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
41e2b43e 6708
0df68c9f 6709 """
54f9ee45 6710 return _core_.PyApp_Yield(*args, **kwargs)
e811c8ce
RD
6711
6712 def WakeUpIdle(*args, **kwargs):
0df68c9f 6713 """
a95a7133 6714 WakeUpIdle(self)
6c3b4aae 6715
66c033b4
RD
6716 Make sure that idle events are sent again.
6717 :see: `wx.WakeUpIdle`
0df68c9f 6718 """
54f9ee45 6719 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
e811c8ce 6720
1fc3b23a
RD
6721 def IsMainLoopRunning(*args, **kwargs):
6722 """
6723 IsMainLoopRunning() -> bool
6724
6725 Returns True if we're running the main loop, i.e. if the events can
6726 currently be dispatched.
6727 """
6728 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
6729
6730 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
e811c8ce 6731 def MainLoop(*args, **kwargs):
0df68c9f 6732 """
a95a7133 6733 MainLoop(self) -> int
6c3b4aae 6734
66c033b4
RD
6735 Execute the main GUI loop, the function doesn't normally return until
6736 all top level windows have been closed and destroyed.
0df68c9f 6737 """
54f9ee45 6738 return _core_.PyApp_MainLoop(*args, **kwargs)
e811c8ce
RD
6739
6740 def Exit(*args, **kwargs):
0df68c9f 6741 """
a95a7133 6742 Exit(self)
6c3b4aae 6743
0df68c9f 6744 Exit the main loop thus terminating the application.
66c033b4 6745 :see: `wx.Exit`
0df68c9f 6746 """
54f9ee45 6747 return _core_.PyApp_Exit(*args, **kwargs)
e811c8ce 6748
97ab0f6a
RD
6749 def GetLayoutDirection(*args, **kwargs):
6750 """
6751 GetLayoutDirection(self) -> wxLayoutDirection
6752
6753 Return the layout direction for the current locale.
6754 """
6755 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
6756
e811c8ce 6757 def ExitMainLoop(*args, **kwargs):
0df68c9f 6758 """
a95a7133 6759 ExitMainLoop(self)
6c3b4aae 6760
66c033b4
RD
6761 Exit the main GUI loop during the next iteration of the main
6762 loop, (i.e. it does not stop the program immediately!)
0df68c9f 6763 """
54f9ee45 6764 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
e811c8ce
RD
6765
6766 def Pending(*args, **kwargs):
0df68c9f 6767 """
a95a7133 6768 Pending(self) -> bool
6c3b4aae 6769
0df68c9f
RD
6770 Returns True if there are unprocessed events in the event queue.
6771 """
54f9ee45 6772 return _core_.PyApp_Pending(*args, **kwargs)
e811c8ce
RD
6773
6774 def Dispatch(*args, **kwargs):
0df68c9f 6775 """
a95a7133 6776 Dispatch(self) -> bool
6c3b4aae 6777
0df68c9f
RD
6778 Process the first event in the event queue (blocks until an event
6779 appears if there are none currently)
6780 """
54f9ee45 6781 return _core_.PyApp_Dispatch(*args, **kwargs)
e811c8ce
RD
6782
6783 def ProcessIdle(*args, **kwargs):
0df68c9f 6784 """
a95a7133 6785 ProcessIdle(self) -> bool
6c3b4aae 6786
66c033b4
RD
6787 Called from the MainLoop when the application becomes idle (there are
6788 no pending events) and sends a `wx.IdleEvent` to all interested
6789 parties. Returns True if more idle events are needed, False if not.
0df68c9f 6790 """
54f9ee45 6791 return _core_.PyApp_ProcessIdle(*args, **kwargs)
e811c8ce
RD
6792
6793 def SendIdleEvents(*args, **kwargs):
0df68c9f 6794 """
a95a7133 6795 SendIdleEvents(self, Window win, IdleEvent event) -> bool
e811c8ce 6796
66c033b4
RD
6797 Send idle event to window and all subwindows. Returns True if more
6798 idle time is requested.
0df68c9f 6799 """
54f9ee45 6800 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
e811c8ce
RD
6801
6802 def IsActive(*args, **kwargs):
0df68c9f 6803 """
a95a7133 6804 IsActive(self) -> bool
6c3b4aae 6805
0df68c9f
RD
6806 Return True if our app has focus.
6807 """
54f9ee45 6808 return _core_.PyApp_IsActive(*args, **kwargs)
e811c8ce
RD
6809
6810 def SetTopWindow(*args, **kwargs):
0df68c9f 6811 """
a95a7133 6812 SetTopWindow(self, Window win)
6c3b4aae 6813
66c033b4 6814 Set the *main* top level window
0df68c9f 6815 """
54f9ee45 6816 return _core_.PyApp_SetTopWindow(*args, **kwargs)
e811c8ce
RD
6817
6818 def GetTopWindow(*args, **kwargs):
0df68c9f 6819 """
a95a7133 6820 GetTopWindow(self) -> Window
6c3b4aae 6821
66c033b4
RD
6822 Return the *main* top level window (if it hadn't been set previously
6823 with SetTopWindow(), will return just some top level window and, if
6824 there not any, will return None)
0df68c9f 6825 """
54f9ee45 6826 return _core_.PyApp_GetTopWindow(*args, **kwargs)
e811c8ce
RD
6827
6828 def SetExitOnFrameDelete(*args, **kwargs):
0df68c9f 6829 """
a95a7133 6830 SetExitOnFrameDelete(self, bool flag)
0df68c9f 6831
66c033b4
RD
6832 Control the exit behaviour: by default, the program will exit the main
6833 loop (and so, usually, terminate) when the last top-level program
6834 window is deleted. Beware that if you disable this behaviour (with
6835 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
6836 explicitly from somewhere.
0df68c9f 6837 """
54f9ee45 6838 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
6839
6840 def GetExitOnFrameDelete(*args, **kwargs):
0df68c9f 6841 """
a95a7133 6842 GetExitOnFrameDelete(self) -> bool
6c3b4aae 6843
0df68c9f
RD
6844 Get the current exit behaviour setting.
6845 """
54f9ee45 6846 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
e811c8ce
RD
6847
6848 def SetUseBestVisual(*args, **kwargs):
0df68c9f 6849 """
a95a7133 6850 SetUseBestVisual(self, bool flag)
6c3b4aae 6851
66c033b4
RD
6852 Set whether the app should try to use the best available visual on
6853 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
0df68c9f 6854 """
54f9ee45 6855 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
e811c8ce
RD
6856
6857 def GetUseBestVisual(*args, **kwargs):
0df68c9f 6858 """
a95a7133 6859 GetUseBestVisual(self) -> bool
6c3b4aae 6860
0df68c9f
RD
6861 Get current UseBestVisual setting.
6862 """
54f9ee45 6863 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
e811c8ce
RD
6864
6865 def SetPrintMode(*args, **kwargs):
a95a7133 6866 """SetPrintMode(self, int mode)"""
54f9ee45 6867 return _core_.PyApp_SetPrintMode(*args, **kwargs)
e811c8ce
RD
6868
6869 def GetPrintMode(*args, **kwargs):
a95a7133 6870 """GetPrintMode(self) -> int"""
54f9ee45 6871 return _core_.PyApp_GetPrintMode(*args, **kwargs)
e811c8ce 6872
e811c8ce 6873 def SetAssertMode(*args, **kwargs):
0df68c9f 6874 """
a95a7133 6875 SetAssertMode(self, int mode)
6c3b4aae 6876
41e2b43e 6877 Set the OnAssert behaviour for debug and hybrid builds.
0df68c9f 6878 """
54f9ee45 6879 return _core_.PyApp_SetAssertMode(*args, **kwargs)
e811c8ce 6880
6c3b4aae 6881 def GetAssertMode(*args, **kwargs):
0df68c9f 6882 """
a95a7133 6883 GetAssertMode(self) -> int
6c3b4aae 6884
0df68c9f
RD
6885 Get the current OnAssert behaviour setting.
6886 """
54f9ee45 6887 return _core_.PyApp_GetAssertMode(*args, **kwargs)
6c3b4aae 6888
e811c8ce 6889 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 6890 """GetMacSupportPCMenuShortcuts() -> bool"""
54f9ee45 6891 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
6892
6893 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
6894 def GetMacAboutMenuItemId(*args, **kwargs):
66c033b4 6895 """GetMacAboutMenuItemId() -> long"""
54f9ee45 6896 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
6897
6898 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
6899 def GetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 6900 """GetMacPreferencesMenuItemId() -> long"""
54f9ee45 6901 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
6902
6903 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
6904 def GetMacExitMenuItemId(*args, **kwargs):
66c033b4 6905 """GetMacExitMenuItemId() -> long"""
54f9ee45 6906 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
6907
6908 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
6909 def GetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 6910 """GetMacHelpMenuTitleName() -> String"""
54f9ee45 6911 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
6912
6913 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
6914 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
66c033b4 6915 """SetMacSupportPCMenuShortcuts(bool val)"""
54f9ee45 6916 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
e811c8ce
RD
6917
6918 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
6919 def SetMacAboutMenuItemId(*args, **kwargs):
66c033b4 6920 """SetMacAboutMenuItemId(long val)"""
54f9ee45 6921 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
e811c8ce
RD
6922
6923 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
6924 def SetMacPreferencesMenuItemId(*args, **kwargs):
66c033b4 6925 """SetMacPreferencesMenuItemId(long val)"""
54f9ee45 6926 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
e811c8ce
RD
6927
6928 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
6929 def SetMacExitMenuItemId(*args, **kwargs):
66c033b4 6930 """SetMacExitMenuItemId(long val)"""
54f9ee45 6931 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
e811c8ce
RD
6932
6933 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
6934 def SetMacHelpMenuTitleName(*args, **kwargs):
66c033b4 6935 """SetMacHelpMenuTitleName(String val)"""
54f9ee45 6936 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
e811c8ce
RD
6937
6938 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
6939 def _BootstrapApp(*args, **kwargs):
0df68c9f 6940 """
a95a7133 6941 _BootstrapApp(self)
6c3b4aae 6942
0df68c9f
RD
6943 For internal use only
6944 """
54f9ee45 6945 return _core_.PyApp__BootstrapApp(*args, **kwargs)
e811c8ce
RD
6946
6947 def GetComCtl32Version(*args, **kwargs):
0df68c9f 6948 """
66c033b4 6949 GetComCtl32Version() -> int
6c3b4aae 6950
66c033b4
RD
6951 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
6952 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 6953 """
54f9ee45 6954 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
e811c8ce
RD
6955
6956 GetComCtl32Version = staticmethod(GetComCtl32Version)
fc46b7f3
RD
6957 def DisplayAvailable(*args, **kwargs):
6958 """
6959 DisplayAvailable() -> bool
6960
6961 Tests if it is possible to create a GUI in the current environment.
6962 This will mean different things on the different platforms.
6963
6964 * On X Windows systems this function will return ``False`` if it is
6965 not able to open a connection to the X display, which can happen
6966 if $DISPLAY is not set, or is not set correctly.
6967
6968 * On Mac OS X a ``False`` return value will mean that wx is not
6969 able to access the window manager, which can happen if logged in
6970 remotely or if running from the normal version of python instead
6971 of the framework version, (i.e., pythonw.)
6972
6973 * On MS Windows...
6974
6975 """
6976 return _core_.PyApp_DisplayAvailable(*args, **kwargs)
6977
6978 DisplayAvailable = staticmethod(DisplayAvailable)
2131d850 6979_core_.PyApp_swigregister(PyApp)
d14a1e28 6980
0085ce49
RD
6981def PyApp_IsMainLoopRunning(*args):
6982 """
1fc3b23a
RD
6983 PyApp_IsMainLoopRunning() -> bool
6984
6985 Returns True if we're running the main loop, i.e. if the events can
6986 currently be dispatched.
6987 """
0085ce49 6988 return _core_.PyApp_IsMainLoopRunning(*args)
1fc3b23a 6989
0085ce49
RD
6990def PyApp_GetMacSupportPCMenuShortcuts(*args):
6991 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
6992 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d14a1e28 6993
0085ce49
RD
6994def PyApp_GetMacAboutMenuItemId(*args):
6995 """PyApp_GetMacAboutMenuItemId() -> long"""
6996 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d14a1e28 6997
0085ce49
RD
6998def PyApp_GetMacPreferencesMenuItemId(*args):
6999 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7000 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d14a1e28 7001
0085ce49
RD
7002def PyApp_GetMacExitMenuItemId(*args):
7003 """PyApp_GetMacExitMenuItemId() -> long"""
7004 return _core_.PyApp_GetMacExitMenuItemId(*args)
d14a1e28 7005
0085ce49
RD
7006def PyApp_GetMacHelpMenuTitleName(*args):
7007 """PyApp_GetMacHelpMenuTitleName() -> String"""
7008 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d14a1e28 7009
e811c8ce 7010def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
0085ce49
RD
7011 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7012 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d14a1e28 7013
e811c8ce 7014def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
0085ce49
RD
7015 """PyApp_SetMacAboutMenuItemId(long val)"""
7016 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d14a1e28 7017
e811c8ce 7018def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
0085ce49
RD
7019 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7020 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d14a1e28 7021
e811c8ce 7022def PyApp_SetMacExitMenuItemId(*args, **kwargs):
0085ce49
RD
7023 """PyApp_SetMacExitMenuItemId(long val)"""
7024 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d14a1e28 7025
e811c8ce 7026def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
0085ce49
RD
7027 """PyApp_SetMacHelpMenuTitleName(String val)"""
7028 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d14a1e28 7029
0085ce49
RD
7030def PyApp_GetComCtl32Version(*args):
7031 """
0df68c9f 7032 PyApp_GetComCtl32Version() -> int
6c3b4aae 7033
66c033b4
RD
7034 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7035 it wasn't found at all. Raises an exception on non-Windows platforms.
0df68c9f 7036 """
0085ce49 7037 return _core_.PyApp_GetComCtl32Version(*args)
d14a1e28 7038
fc46b7f3
RD
7039def PyApp_DisplayAvailable(*args):
7040 """
7041 PyApp_DisplayAvailable() -> bool
7042
7043 Tests if it is possible to create a GUI in the current environment.
7044 This will mean different things on the different platforms.
7045
7046 * On X Windows systems this function will return ``False`` if it is
7047 not able to open a connection to the X display, which can happen
7048 if $DISPLAY is not set, or is not set correctly.
7049
7050 * On Mac OS X a ``False`` return value will mean that wx is not
7051 able to access the window manager, which can happen if logged in
7052 remotely or if running from the normal version of python instead
7053 of the framework version, (i.e., pythonw.)
7054
7055 * On MS Windows...
7056
7057 """
7058 return _core_.PyApp_DisplayAvailable(*args)
7059
d14a1e28
RD
7060#---------------------------------------------------------------------------
7061
7062
0085ce49
RD
7063def Exit(*args):
7064 """
0df68c9f 7065 Exit()
6c3b4aae 7066
0df68c9f
RD
7067 Force an exit of the application. Convenience for wx.GetApp().Exit()
7068 """
0085ce49 7069 return _core_.Exit(*args)
d14a1e28 7070
0085ce49
RD
7071def Yield(*args):
7072 """
0df68c9f 7073 Yield() -> bool
6c3b4aae 7074
0df68c9f
RD
7075 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7076 """
0085ce49 7077 return _core_.Yield(*args)
d14a1e28 7078
0085ce49
RD
7079def YieldIfNeeded(*args):
7080 """
0df68c9f 7081 YieldIfNeeded() -> bool
6c3b4aae 7082
0df68c9f
RD
7083 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7084 """
0085ce49 7085 return _core_.YieldIfNeeded(*args)
d14a1e28 7086
e811c8ce 7087def SafeYield(*args, **kwargs):
0085ce49 7088 """
0df68c9f 7089 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
6c3b4aae 7090
66c033b4
RD
7091 This function is similar to `wx.Yield`, except that it disables the
7092 user input to all program windows before calling `wx.Yield` and
7093 re-enables it again afterwards. If ``win`` is not None, this window
7094 will remain enabled, allowing the implementation of some limited user
7095 interaction.
6c3b4aae 7096
66c033b4 7097 :Returns: the result of the call to `wx.Yield`.
0df68c9f 7098 """
0085ce49 7099 return _core_.SafeYield(*args, **kwargs)
d14a1e28 7100
0085ce49
RD
7101def WakeUpIdle(*args):
7102 """
0df68c9f 7103 WakeUpIdle()
6c3b4aae 7104
66c033b4
RD
7105 Cause the message queue to become empty again, so idle events will be
7106 sent.
0df68c9f 7107 """
0085ce49 7108 return _core_.WakeUpIdle(*args)
d14a1e28 7109
e811c8ce 7110def PostEvent(*args, **kwargs):
0085ce49 7111 """
0df68c9f 7112 PostEvent(EvtHandler dest, Event event)
6c3b4aae 7113
66c033b4
RD
7114 Send an event to a window or other wx.EvtHandler to be processed
7115 later.
0df68c9f 7116 """
0085ce49 7117 return _core_.PostEvent(*args, **kwargs)
d14a1e28 7118
0085ce49
RD
7119def App_CleanUp(*args):
7120 """
0df68c9f 7121 App_CleanUp()
6c3b4aae 7122
41e2b43e 7123 For internal use only, it is used to cleanup after wxWidgets when
66c033b4 7124 Python shuts down.
0df68c9f 7125 """
0085ce49 7126 return _core_.App_CleanUp(*args)
d14a1e28 7127
0085ce49
RD
7128def GetApp(*args):
7129 """
0df68c9f 7130 GetApp() -> PyApp
6c3b4aae 7131
196addbf 7132 Return a reference to the current wx.App object.
0df68c9f 7133 """
0085ce49 7134 return _core_.GetApp(*args)
5cbf236d
RD
7135
7136def SetDefaultPyEncoding(*args, **kwargs):
0085ce49 7137 """
5cbf236d
RD
7138 SetDefaultPyEncoding(string encoding)
7139
7140 Sets the encoding that wxPython will use when it needs to convert a
7141 Python string or unicode object to or from a wxString.
e505d15e
RD
7142
7143 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7144 but please be aware that the default encoding within the same locale
7145 may be slightly different on different platforms. For example, please
7146 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7147 between the common latin/roman encodings.
5cbf236d 7148 """
0085ce49 7149 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 7150
0085ce49
RD
7151def GetDefaultPyEncoding(*args):
7152 """
5cbf236d
RD
7153 GetDefaultPyEncoding() -> string
7154
7155 Gets the current encoding that wxPython will use when it needs to
7156 convert a Python string or unicode object to or from a wxString.
7157 """
0085ce49 7158 return _core_.GetDefaultPyEncoding(*args)
d14a1e28
RD
7159#----------------------------------------------------------------------
7160
7161class PyOnDemandOutputWindow:
6c3b4aae
RD
7162 """
7163 A class that can be used for redirecting Python's stdout and
7164 stderr streams. It will do nothing until something is wrriten to
7165 the stream at which point it will create a Frame with a text area
7166 and write the text there.
7167 """
d14a1e28
RD
7168 def __init__(self, title = "wxPython: stdout/stderr"):
7169 self.frame = None
7170 self.title = title
412d302d
RD
7171 self.pos = wx.DefaultPosition
7172 self.size = (450, 300)
d14a1e28
RD
7173 self.parent = None
7174
7175 def SetParent(self, parent):
6c3b4aae 7176 """Set the window to be used as the popup Frame's parent."""
d14a1e28
RD
7177 self.parent = parent
7178
6c3b4aae
RD
7179
7180 def CreateOutputWindow(self, st):
412d302d
RD
7181 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7182 style=wx.DEFAULT_FRAME_STYLE)
196addbf 7183 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7184 style=wx.TE_MULTILINE|wx.TE_READONLY)
d1e20054 7185 self.text.AppendText(st)
6c3b4aae 7186 self.frame.Show(True)
2131d850 7187 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
6c3b4aae 7188
d14a1e28 7189
7409c0c6
RD
7190 def OnCloseWindow(self, event):
7191 if self.frame is not None:
7192 self.frame.Destroy()
7193 self.frame = None
7194 self.text = None
7195
7196
d14a1e28 7197 # These methods provide the file-like output behaviour.
6c3b4aae
RD
7198 def write(self, text):
7199 """
7200 Create the output window if needed and write the string to it.
7201 If not called in the context of the gui thread then uses
7202 CallAfter to do the work there.
7203 """
7204 if self.frame is None:
7205 if not wx.Thread_IsMain():
7206 wx.CallAfter(self.CreateOutputWindow, text)
7207 else:
7208 self.CreateOutputWindow(text)
7209 else:
7210 if not wx.Thread_IsMain():
7211 wx.CallAfter(self.text.AppendText, text)
7212 else:
7213 self.text.AppendText(text)
7214
d14a1e28
RD
7215
7216 def close(self):
6c3b4aae
RD
7217 if self.frame is not None:
7218 wx.CallAfter(self.frame.Close)
7219
d14a1e28 7220
19272049
RD
7221 def flush(self):
7222 pass
7223
7224
d14a1e28
RD
7225
7226#----------------------------------------------------------------------
d14a1e28
RD
7227
7228_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
fc46b7f3 7229
d14a1e28 7230class App(wx.PyApp):
6c3b4aae 7231 """
66c033b4
RD
7232 The ``wx.App`` class represents the application and is used to:
7233
7234 * bootstrap the wxPython system and initialize the underlying
7235 gui toolkit
7236 * set and get application-wide properties
7237 * implement the windowing system main message or event loop,
7238 and to dispatch events to window instances
7239 * etc.
7240
7241 Every application must have a ``wx.App`` instance, and all
7242 creation of UI objects should be delayed until after the
03e37cd5
RD
7243 ``wx.App`` object has been created in order to ensure that the gui
7244 platform and wxWidgets have been fully initialized.
66c033b4
RD
7245
7246 Normally you would derive from this class and implement an
7247 ``OnInit`` method that creates a frame and then calls
7248 ``self.SetTopWindow(frame)``.
7249
03e37cd5 7250 :see: `wx.PySimpleApp` for a simpler app class that can be used
1c0f361b 7251 directly.
6c3b4aae 7252 """
66c033b4 7253
d14a1e28
RD
7254 outputWindowClass = PyOnDemandOutputWindow
7255
03e37cd5
RD
7256 def __init__(self, redirect=_defRedirect, filename=None,
7257 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7258 """
7259 Construct a ``wx.App`` object.
7260
03e37cd5
RD
7261 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7262 redirected? Defaults to True on Windows and Mac, False
7263 otherwise. If `filename` is None then output will be
7264 redirected to a window that pops up as needed. (You can
7265 control what kind of window is created for the output by
7266 resetting the class variable ``outputWindowClass`` to a
7267 class of your choosing.)
66c033b4 7268
03e37cd5
RD
7269 :param filename: The name of a file to redirect output to, if
7270 redirect is True.
66c033b4
RD
7271
7272 :param useBestVisual: Should the app try to use the best
03e37cd5
RD
7273 available visual provided by the system (only relevant on
7274 systems that have more than one visual.) This parameter
7275 must be used instead of calling `SetUseBestVisual` later
7276 on because it must be set before the underlying GUI
7277 toolkit is initialized.
7278
7279 :param clearSigInt: Should SIGINT be cleared? This allows the
7280 app to terminate upon a Ctrl-C in the console like other
7281 GUI apps will.
66c033b4
RD
7282
7283 :note: You should override OnInit to do applicaition
7284 initialization to ensure that the system, toolkit and
7285 wxWidgets are fully initialized.
7286 """
fc46b7f3 7287
d14a1e28
RD
7288 wx.PyApp.__init__(self)
7289
fc46b7f3
RD
7290 # make sure we can create a GUI
7291 if not self.DisplayAvailable():
7292
7293 if wx.Platform == "__WXMAC__":
7294 msg = """This program needs access to the screen.
7295Please run with 'pythonw', not 'python', and only when you are logged
7296in on the main display of your Mac."""
7297
7298 elif wx.Platform == "__WXGTK__":
7299 msg ="Unable to access the X Display, is $DISPLAY set properly?"
d14a1e28 7300
fc46b7f3
RD
7301 else:
7302 msg = "Unable to create GUI"
7303 # TODO: more description is needed for wxMSW...
7304
7305 raise SystemExit(msg)
7306
d14a1e28
RD
7307 # This has to be done before OnInit
7308 self.SetUseBestVisual(useBestVisual)
7309
7310 # Set the default handler for SIGINT. This fixes a problem
7311 # where if Ctrl-C is pressed in the console that started this
7312 # app then it will not appear to do anything, (not even send
7313 # KeyboardInterrupt???) but will later segfault on exit. By
7314 # setting the default handler then the app will exit, as
7315 # expected (depending on platform.)
03e37cd5
RD
7316 if clearSigInt:
7317 try:
7318 import signal
7319 signal.signal(signal.SIGINT, signal.SIG_DFL)
7320 except:
7321 pass
d14a1e28
RD
7322
7323 # Save and redirect the stdio to a window?
7324 self.stdioWin = None
7325 self.saveStdio = (_sys.stdout, _sys.stderr)
7326 if redirect:
7327 self.RedirectStdio(filename)
7328
8fb0e70a
RD
7329 # Use Python's install prefix as the default
7330 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7331
d14a1e28
RD
7332 # This finishes the initialization of wxWindows and then calls
7333 # the OnInit that should be present in the derived class
7334 self._BootstrapApp()
7335
7336
01f6b6d3
RD
7337 def OnPreInit(self):
7338 """
7339 Things that must be done after _BootstrapApp has done its
7340 thing, but would be nice if they were already done by the time
7341 that OnInit is called.
7342 """
7343 wx.StockGDI._initStockObjects()
7344
7345
02b455f2
RD
7346 def __del__(self, destroy=wx.PyApp.__del__):
7347 self.RestoreStdio() # Just in case the MainLoop was overridden
7348 destroy(self)
d14a1e28 7349
70b7a5fe
RD
7350 def Destroy(self):
7351 wx.PyApp.Destroy(self)
7352 self.thisown = 0
d14a1e28
RD
7353
7354 def SetTopWindow(self, frame):
1e0c8722 7355 """Set the \"main\" top level window"""
d14a1e28
RD
7356 if self.stdioWin:
7357 self.stdioWin.SetParent(frame)
7358 wx.PyApp.SetTopWindow(self, frame)
7359
7360
7361 def MainLoop(self):
1e0c8722 7362 """Execute the main GUI event loop"""
d14a1e28
RD
7363 wx.PyApp.MainLoop(self)
7364 self.RestoreStdio()
7365
7366
7409c0c6 7367 def RedirectStdio(self, filename=None):
1e0c8722 7368 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
d14a1e28
RD
7369 if filename:
7370 _sys.stdout = _sys.stderr = open(filename, 'a')
7371 else:
7372 self.stdioWin = self.outputWindowClass()
7373 _sys.stdout = _sys.stderr = self.stdioWin
7374
7375
7376 def RestoreStdio(self):
02b455f2
RD
7377 try:
7378 _sys.stdout, _sys.stderr = self.saveStdio
7379 except:
7380 pass
d14a1e28
RD
7381
7382
412d302d
RD
7383 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7384 """
7385 Set the title, position and/or size of the output window if
f5b96ee1
RD
7386 the stdio has been redirected. This should be called before
7387 any output would cause the output window to be created.
412d302d
RD
7388 """
7389 if self.stdioWin:
7390 if title is not None:
7391 self.stdioWin.title = title
7392 if pos is not None:
7393 self.stdioWin.pos = pos
7394 if size is not None:
7395 self.stdioWin.size = size
7396
7397
7398
d14a1e28 7399
66c033b4 7400# change from wx.PyApp_XX to wx.App_XX
54f9ee45
RD
7401App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7402App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7403App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7404App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7405App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7406App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7407App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7408App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7409App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7410App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7411App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
d14a1e28
RD
7412
7413#----------------------------------------------------------------------------
7414
7415class PySimpleApp(wx.App):
6c3b4aae
RD
7416 """
7417 A simple application class. You can just create one of these and
7418 then then make your top level windows later, and not have to worry
66c033b4
RD
7419 about OnInit. For example::
7420
7421 app = wx.PySimpleApp()
7422 frame = wx.Frame(None, title='Hello World')
7423 frame.Show()
7424 app.MainLoop()
7425
7426 :see: `wx.App`
7427 """
6c3b4aae 7428
03e37cd5
RD
7429 def __init__(self, redirect=False, filename=None,
7430 useBestVisual=False, clearSigInt=True):
66c033b4
RD
7431 """
7432 :see: `wx.App.__init__`
7433 """
03e37cd5 7434 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
6c3b4aae 7435
d14a1e28 7436 def OnInit(self):
d14a1e28
RD
7437 return True
7438
7439
66c033b4 7440
6c3b4aae 7441# Is anybody using this one?
d14a1e28
RD
7442class PyWidgetTester(wx.App):
7443 def __init__(self, size = (250, 100)):
7444 self.size = size
7445 wx.App.__init__(self, 0)
7446
7447 def OnInit(self):
196addbf 7448 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
d14a1e28
RD
7449 self.SetTopWindow(self.frame)
7450 return True
7451
66c033b4
RD
7452 def SetWidget(self, widgetClass, *args, **kwargs):
7453 w = widgetClass(self.frame, *args, **kwargs)
d14a1e28
RD
7454 self.frame.Show(True)
7455
7456#----------------------------------------------------------------------------
7457# DO NOT hold any other references to this object. This is how we
66c033b4 7458# know when to cleanup system resources that wxWidgets is holding. When
d14a1e28 7459# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
66c033b4 7460# goes to zero and it calls the wx.App_CleanUp function.
d14a1e28
RD
7461
7462class __wxPyCleanup:
7463 def __init__(self):
54f9ee45 7464 self.cleanup = _core_.App_CleanUp
d14a1e28
RD
7465 def __del__(self):
7466 self.cleanup()
7467
7468_sys.__wxPythonCleanup = __wxPyCleanup()
7469
7470## # another possible solution, but it gets called too early...
66c033b4
RD
7471## import atexit
7472## atexit.register(_core_.wxApp_CleanUp)
d14a1e28
RD
7473
7474
7475#----------------------------------------------------------------------------
7476
7477#---------------------------------------------------------------------------
2ef75293
RD
7478
7479class EventLoop(object):
093d3ff1 7480 """Proxy of C++ EventLoop class"""
0085ce49
RD
7481 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7482 __repr__ = _swig_repr
7483 def __init__(self, *args, **kwargs):
2ef75293 7484 """__init__(self) -> EventLoop"""
0085ce49
RD
7485 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7486 __swig_destroy__ = _core_.delete_EventLoop
7487 __del__ = lambda self : None;
2ef75293
RD
7488 def Run(*args, **kwargs):
7489 """Run(self) -> int"""
7490 return _core_.EventLoop_Run(*args, **kwargs)
7491
7492 def Exit(*args, **kwargs):
7493 """Exit(self, int rc=0)"""
7494 return _core_.EventLoop_Exit(*args, **kwargs)
7495
7496 def Pending(*args, **kwargs):
7497 """Pending(self) -> bool"""
7498 return _core_.EventLoop_Pending(*args, **kwargs)
7499
7500 def Dispatch(*args, **kwargs):
7501 """Dispatch(self) -> bool"""
7502 return _core_.EventLoop_Dispatch(*args, **kwargs)
7503
7504 def IsRunning(*args, **kwargs):
7505 """IsRunning(self) -> bool"""
7506 return _core_.EventLoop_IsRunning(*args, **kwargs)
7507
7508 def GetActive(*args, **kwargs):
7509 """GetActive() -> EventLoop"""
7510 return _core_.EventLoop_GetActive(*args, **kwargs)
7511
7512 GetActive = staticmethod(GetActive)
7513 def SetActive(*args, **kwargs):
7514 """SetActive(EventLoop loop)"""
7515 return _core_.EventLoop_SetActive(*args, **kwargs)
7516
7517 SetActive = staticmethod(SetActive)
2131d850 7518_core_.EventLoop_swigregister(EventLoop)
2ef75293 7519
0085ce49
RD
7520def EventLoop_GetActive(*args):
7521 """EventLoop_GetActive() -> EventLoop"""
7522 return _core_.EventLoop_GetActive(*args)
2ef75293
RD
7523
7524def EventLoop_SetActive(*args, **kwargs):
0085ce49
RD
7525 """EventLoop_SetActive(EventLoop loop)"""
7526 return _core_.EventLoop_SetActive(*args, **kwargs)
2ef75293 7527
091f5bed
RD
7528class EventLoopActivator(object):
7529 """Proxy of C++ EventLoopActivator class"""
0085ce49
RD
7530 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7531 __repr__ = _swig_repr
7532 def __init__(self, *args, **kwargs):
091f5bed 7533 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
0085ce49
RD
7534 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7535 __swig_destroy__ = _core_.delete_EventLoopActivator
7536 __del__ = lambda self : None;
2131d850 7537_core_.EventLoopActivator_swigregister(EventLoopActivator)
091f5bed 7538
2ef75293 7539#---------------------------------------------------------------------------
d14a1e28 7540
eec1c382
RD
7541ACCEL_ALT = _core_.ACCEL_ALT
7542ACCEL_CTRL = _core_.ACCEL_CTRL
7543ACCEL_SHIFT = _core_.ACCEL_SHIFT
7544ACCEL_NORMAL = _core_.ACCEL_NORMAL
7545ACCEL_CMD = _core_.ACCEL_CMD
1e0c8722 7546class AcceleratorEntry(object):
66c033b4
RD
7547 """
7548 A class used to define items in an `wx.AcceleratorTable`. wxPython
7549 programs can choose to use wx.AcceleratorEntry objects, but using a
7550 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
41e2b43e 7551 as well. See `__init__` for of the tuple values.
66c033b4
RD
7552
7553 :see: `wx.AcceleratorTable`
7554 """
0085ce49
RD
7555 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7556 __repr__ = _swig_repr
7557 def __init__(self, *args, **kwargs):
66c033b4
RD
7558 """
7559 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
7560
7561 Construct a wx.AcceleratorEntry.
66c033b4 7562 """
0085ce49
RD
7563 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
7564 __swig_destroy__ = _core_.delete_AcceleratorEntry
7565 __del__ = lambda self : None;
1e0c8722 7566 def Set(*args, **kwargs):
66c033b4
RD
7567 """
7568 Set(self, int flags, int keyCode, int cmd)
1e0c8722 7569
66c033b4
RD
7570 (Re)set the attributes of a wx.AcceleratorEntry.
7571 :see `__init__`
7572 """
7573 return _core_.AcceleratorEntry_Set(*args, **kwargs)
1e0c8722 7574
97ab0f6a
RD
7575 def Create(*args, **kwargs):
7576 """
7577 Create(String str) -> AcceleratorEntry
7578
7579 Create accelerator corresponding to the specified string, or None if
7580 it coulnd't be parsed.
7581 """
7582 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7583
7584 Create = staticmethod(Create)
1e0c8722 7585 def GetFlags(*args, **kwargs):
66c033b4
RD
7586 """
7587 GetFlags(self) -> int
7588
7589 Get the AcceleratorEntry's flags.
7590 """
54f9ee45 7591 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
1e0c8722
RD
7592
7593 def GetKeyCode(*args, **kwargs):
66c033b4
RD
7594 """
7595 GetKeyCode(self) -> int
7596
7597 Get the AcceleratorEntry's keycode.
7598 """
54f9ee45 7599 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
1e0c8722
RD
7600
7601 def GetCommand(*args, **kwargs):
66c033b4
RD
7602 """
7603 GetCommand(self) -> int
7604
7605 Get the AcceleratorEntry's command ID.
7606 """
54f9ee45 7607 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
1e0c8722 7608
97ab0f6a
RD
7609 def IsOk(*args, **kwargs):
7610 """IsOk(self) -> bool"""
7611 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
7612
7613 def ToString(*args, **kwargs):
7614 """
7615 ToString(self) -> String
7616
7617 Returns a string representation for the this accelerator. The string
7618 is formatted using the <flags>-<keycode> format where <flags> maybe a
7619 hyphen-separed list of "shift|alt|ctrl"
7620
7621 """
7622 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
7623
7624 def FromString(*args, **kwargs):
7625 """
7626 FromString(self, String str) -> bool
7627
7628 Returns true if the given string correctly initialized this object.
7629 """
7630 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
7631
2bf58437
RD
7632 Command = property(GetCommand,doc="See `GetCommand`")
7633 Flags = property(GetFlags,doc="See `GetFlags`")
7634 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
2131d850 7635_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
1e0c8722 7636
97ab0f6a
RD
7637def AcceleratorEntry_Create(*args, **kwargs):
7638 """
7639 AcceleratorEntry_Create(String str) -> AcceleratorEntry
7640
7641 Create accelerator corresponding to the specified string, or None if
7642 it coulnd't be parsed.
7643 """
7644 return _core_.AcceleratorEntry_Create(*args, **kwargs)
7645
1e0c8722 7646class AcceleratorTable(Object):
66c033b4
RD
7647 """
7648 An accelerator table allows the application to specify a table of
7649 keyboard shortcuts for menus or other commands. On Windows, menu or
7650 button commands are supported; on GTK, only menu commands are
7651 supported.
66c033b4 7652 """
0085ce49
RD
7653 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7654 __repr__ = _swig_repr
7655 def __init__(self, *args, **kwargs):
0df68c9f
RD
7656 """
7657 __init__(entries) -> AcceleratorTable
1e0c8722 7658
66c033b4
RD
7659 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
7660 items or or of 3-tuples (flags, keyCode, cmdID)
7661
7662 :see: `wx.AcceleratorEntry`
0df68c9f 7663 """
0085ce49
RD
7664 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
7665 __swig_destroy__ = _core_.delete_AcceleratorTable
7666 __del__ = lambda self : None;
1e0c8722 7667 def Ok(*args, **kwargs):
a95a7133 7668 """Ok(self) -> bool"""
54f9ee45 7669 return _core_.AcceleratorTable_Ok(*args, **kwargs)
1e0c8722 7670
2131d850 7671_core_.AcceleratorTable_swigregister(AcceleratorTable)
1e0c8722
RD
7672
7673
7674def GetAccelFromString(*args, **kwargs):
0085ce49
RD
7675 """GetAccelFromString(String label) -> AcceleratorEntry"""
7676 return _core_.GetAccelFromString(*args, **kwargs)
1e0c8722
RD
7677#---------------------------------------------------------------------------
7678
74a57fcd
RD
7679class VisualAttributes(object):
7680 """struct containing all the visual attributes of a control"""
0085ce49
RD
7681 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7682 __repr__ = _swig_repr
7683 def __init__(self, *args, **kwargs):
74a57fcd 7684 """
a95a7133 7685 __init__(self) -> VisualAttributes
74a57fcd
RD
7686
7687 struct containing all the visual attributes of a control
7688 """
0085ce49
RD
7689 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
7690 __swig_destroy__ = _core_.delete_VisualAttributes
7691 __del__ = lambda self : None;
54f9ee45
RD
7692 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
7693 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
7694 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 7695_core_.VisualAttributes_swigregister(VisualAttributes)
74a57fcd
RD
7696NullAcceleratorTable = cvar.NullAcceleratorTable
7697PanelNameStr = cvar.PanelNameStr
7698
54f9ee45
RD
7699WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
7700WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
7701WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
7702WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
7703WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
d14a1e28 7704class Window(EvtHandler):
15afbcd0
RD
7705 """
7706 wx.Window is the base class for all windows and represents any visible
7707 object on the screen. All controls, top level windows and so on are
7708 wx.Windows. Sizers and device contexts are not however, as they don't
7709 appear on screen themselves.
7710
7711 """
0085ce49
RD
7712 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7713 __repr__ = _swig_repr
7714 def __init__(self, *args, **kwargs):
0df68c9f 7715 """
a95a7133 7716 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 7717 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
15afbcd0
RD
7718
7719 Construct and show a generic Window.
0df68c9f 7720 """
0085ce49 7721 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d14a1e28 7722 self._setOORInfo(self)
d14a1e28 7723
e811c8ce 7724 def Create(*args, **kwargs):
0df68c9f 7725 """
a95a7133 7726 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
74a57fcd 7727 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
15afbcd0
RD
7728
7729 Create the GUI part of the Window for 2-phase creation mode.
0df68c9f 7730 """
54f9ee45 7731 return _core_.Window_Create(*args, **kwargs)
d14a1e28 7732
e811c8ce 7733 def Close(*args, **kwargs):
15afbcd0 7734 """
a95a7133 7735 Close(self, bool force=False) -> bool
15afbcd0
RD
7736
7737 This function simply generates a EVT_CLOSE event whose handler usually
7738 tries to close the window. It doesn't close the window itself,
7739 however. If force is False (the default) then the window's close
7740 handler will be allowed to veto the destruction of the window.
15afbcd0 7741 """
54f9ee45 7742 return _core_.Window_Close(*args, **kwargs)
d14a1e28 7743
e811c8ce 7744 def Destroy(*args, **kwargs):
0df68c9f 7745 """
a95a7133 7746 Destroy(self) -> bool
d14a1e28 7747
15afbcd0
RD
7748 Destroys the window safely. Frames and dialogs are not destroyed
7749 immediately when this function is called -- they are added to a list
7750 of windows to be deleted on idle time, when all the window's events
7751 have been processed. This prevents problems with events being sent to
7752 non-existent windows.
7753
7754 Returns True if the window has either been successfully deleted, or it
7755 has been added to the list of windows pending real deletion.
0df68c9f 7756 """
7e08d4ef
RD
7757 val = _core_.Window_Destroy(*args, **kwargs)
7758 args[0].thisown = 0
7759 return val
d14a1e28 7760
e811c8ce 7761 def DestroyChildren(*args, **kwargs):
15afbcd0 7762 """
a95a7133 7763 DestroyChildren(self) -> bool
15afbcd0 7764
41e2b43e
RD
7765 Destroys all children of a window. Called automatically by the
7766 destructor.
15afbcd0 7767 """
54f9ee45 7768 return _core_.Window_DestroyChildren(*args, **kwargs)
d14a1e28 7769
e811c8ce 7770 def IsBeingDeleted(*args, **kwargs):
15afbcd0 7771 """
a95a7133 7772 IsBeingDeleted(self) -> bool
15afbcd0
RD
7773
7774 Is the window in the process of being deleted?
7775 """
54f9ee45 7776 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d14a1e28 7777
e811c8ce 7778 def SetLabel(*args, **kwargs):
15afbcd0 7779 """
a95a7133 7780 SetLabel(self, String label)
15afbcd0
RD
7781
7782 Set the text which the window shows in its label if applicable.
7783 """
54f9ee45 7784 return _core_.Window_SetLabel(*args, **kwargs)
d14a1e28 7785
e811c8ce 7786 def GetLabel(*args, **kwargs):
15afbcd0 7787 """
a95a7133 7788 GetLabel(self) -> String
15afbcd0 7789
41e2b43e
RD
7790 Generic way of getting a label from any window, for identification
7791 purposes. The interpretation of this function differs from class to
7792 class. For frames and dialogs, the value returned is the title. For
7793 buttons or static text controls, it is the button text. This function
7794 can be useful for meta-programs such as testing tools or special-needs
7795 access programs)which need to identify windows by name.
15afbcd0 7796 """
54f9ee45 7797 return _core_.Window_GetLabel(*args, **kwargs)
d14a1e28 7798
e811c8ce 7799 def SetName(*args, **kwargs):
15afbcd0 7800 """
a95a7133 7801 SetName(self, String name)
15afbcd0 7802
41e2b43e
RD
7803 Sets the window's name. The window name is used for ressource setting
7804 in X, it is not the same as the window title/label
15afbcd0 7805 """
54f9ee45 7806 return _core_.Window_SetName(*args, **kwargs)
d14a1e28 7807
e811c8ce 7808 def GetName(*args, **kwargs):
15afbcd0 7809 """
a95a7133 7810 GetName(self) -> String
15afbcd0 7811
41e2b43e
RD
7812 Returns the windows name. This name is not guaranteed to be unique;
7813 it is up to the programmer to supply an appropriate name in the window
7814 constructor or via wx.Window.SetName.
15afbcd0 7815 """
54f9ee45 7816 return _core_.Window_GetName(*args, **kwargs)
d14a1e28 7817
4276dc52
RD
7818 def SetWindowVariant(*args, **kwargs):
7819 """
a95a7133 7820 SetWindowVariant(self, int variant)
4276dc52 7821
41e2b43e
RD
7822 Sets the variant of the window/font size to use for this window, if
7823 the platform supports variants, for example, wxMac.
4276dc52 7824 """
54f9ee45 7825 return _core_.Window_SetWindowVariant(*args, **kwargs)
4276dc52
RD
7826
7827 def GetWindowVariant(*args, **kwargs):
a95a7133 7828 """GetWindowVariant(self) -> int"""
54f9ee45 7829 return _core_.Window_GetWindowVariant(*args, **kwargs)
4276dc52 7830
e811c8ce 7831 def SetId(*args, **kwargs):
15afbcd0 7832 """
a95a7133 7833 SetId(self, int winid)
15afbcd0
RD
7834
7835 Sets the identifier of the window. Each window has an integer
7836 identifier. If the application has not provided one, an identifier
7837 will be generated. Normally, the identifier should be provided on
7838 creation and should not be modified subsequently.
7839 """
54f9ee45 7840 return _core_.Window_SetId(*args, **kwargs)
d14a1e28 7841
e811c8ce 7842 def GetId(*args, **kwargs):
15afbcd0 7843 """
a95a7133 7844 GetId(self) -> int
15afbcd0
RD
7845
7846 Returns the identifier of the window. Each window has an integer
7847 identifier. If the application has not provided one (or the default Id
7848 -1 is used) then an unique identifier with a negative value will be
7849 generated.
7850 """
54f9ee45 7851 return _core_.Window_GetId(*args, **kwargs)
d14a1e28 7852
e811c8ce 7853 def NewControlId(*args, **kwargs):
15afbcd0 7854 """
66c033b4 7855 NewControlId() -> int
15afbcd0
RD
7856
7857 Generate a control id for the controls which were not given one.
7858 """
54f9ee45 7859 return _core_.Window_NewControlId(*args, **kwargs)
d14a1e28 7860
e811c8ce
RD
7861 NewControlId = staticmethod(NewControlId)
7862 def NextControlId(*args, **kwargs):
15afbcd0 7863 """
66c033b4 7864 NextControlId(int winid) -> int
15afbcd0
RD
7865
7866 Get the id of the control following the one with the given
41e2b43e 7867 autogenerated) id
15afbcd0 7868 """
54f9ee45 7869 return _core_.Window_NextControlId(*args, **kwargs)
d14a1e28 7870
e811c8ce
RD
7871 NextControlId = staticmethod(NextControlId)
7872 def PrevControlId(*args, **kwargs):
15afbcd0 7873 """
66c033b4 7874 PrevControlId(int winid) -> int
15afbcd0
RD
7875
7876 Get the id of the control preceding the one with the given
41e2b43e 7877 autogenerated) id
15afbcd0 7878 """
54f9ee45 7879 return _core_.Window_PrevControlId(*args, **kwargs)
d14a1e28 7880
e811c8ce 7881 PrevControlId = staticmethod(PrevControlId)
97ab0f6a
RD
7882 def GetLayoutDirection(*args, **kwargs):
7883 """
7884 GetLayoutDirection(self) -> wxLayoutDirection
7885
7886 Get the layout direction (LTR or RTL) for this window. Returns
7887 ``wx.Layout_Default`` if layout direction is not supported.
7888 """
7889 return _core_.Window_GetLayoutDirection(*args, **kwargs)
7890
7891 def SetLayoutDirection(*args, **kwargs):
7892 """
7893 SetLayoutDirection(self, wxLayoutDirection dir)
7894
7895 Set the layout direction (LTR or RTL) for this window.
7896 """
7897 return _core_.Window_SetLayoutDirection(*args, **kwargs)
7898
7899 def AdjustForLayoutDirection(*args, **kwargs):
7900 """
7901 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
7902
7903 Mirror coordinates for RTL layout if this window uses it and if the
7904 mirroring is not done automatically like Win32.
7905 """
7906 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
7907
e811c8ce 7908 def SetSize(*args, **kwargs):
15afbcd0 7909 """
a95a7133 7910 SetSize(self, Size size)
15afbcd0
RD
7911
7912 Sets the size of the window in pixels.
7913 """
54f9ee45 7914 return _core_.Window_SetSize(*args, **kwargs)
d14a1e28 7915
e811c8ce 7916 def SetDimensions(*args, **kwargs):
15afbcd0 7917 """
a95a7133 7918 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
7919
7920 Sets the position and size of the window in pixels. The sizeFlags
7921 parameter indicates the interpretation of the other params if they are
e505d15e
RD
7922 equal to -1.
7923
7924 ======================== ======================================
7925 wx.SIZE_AUTO A -1 indicates that a class-specific
7926 default should be used.
7927 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
7928 -1 values are supplied.
7929 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
7930 interpreted as real dimensions, not
7931 default values.
7932 ======================== ======================================
7933
15afbcd0 7934 """
54f9ee45 7935 return _core_.Window_SetDimensions(*args, **kwargs)
d14a1e28 7936
e811c8ce 7937 def SetRect(*args, **kwargs):
15afbcd0 7938 """
a95a7133 7939 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
15afbcd0
RD
7940
7941 Sets the position and size of the window in pixels using a wx.Rect.
7942 """
54f9ee45 7943 return _core_.Window_SetRect(*args, **kwargs)
d14a1e28 7944
e811c8ce 7945 def SetSizeWH(*args, **kwargs):
15afbcd0 7946 """
a95a7133 7947 SetSizeWH(self, int width, int height)
15afbcd0
RD
7948
7949 Sets the size of the window in pixels.
7950 """
54f9ee45 7951 return _core_.Window_SetSizeWH(*args, **kwargs)
d14a1e28 7952
e811c8ce 7953 def Move(*args, **kwargs):
15afbcd0 7954 """
a95a7133 7955 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
7956
7957 Moves the window to the given position.
7958 """
54f9ee45 7959 return _core_.Window_Move(*args, **kwargs)
d14a1e28 7960
e811c8ce
RD
7961 SetPosition = Move
7962 def MoveXY(*args, **kwargs):
15afbcd0 7963 """
a95a7133 7964 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
15afbcd0
RD
7965
7966 Moves the window to the given position.
7967 """
54f9ee45 7968 return _core_.Window_MoveXY(*args, **kwargs)
e811c8ce 7969
f8167d6e
RD
7970 def SetBestFittingSize(*args, **kwargs):
7971 """
7972 SetBestFittingSize(self, Size size=DefaultSize)
7973
7974 A 'Smart' SetSize that will fill in default size components with the
7975 window's *best size* values. Also set's the minsize for use with sizers.
7976 """
7977 return _core_.Window_SetBestFittingSize(*args, **kwargs)
7978
e811c8ce 7979 def Raise(*args, **kwargs):
15afbcd0 7980 """
a95a7133 7981 Raise(self)
15afbcd0 7982
943e8dfd
RD
7983 Raises the window to the top of the window hierarchy. In current
7984 version of wxWidgets this works both for manage and child windows.
15afbcd0 7985 """
54f9ee45 7986 return _core_.Window_Raise(*args, **kwargs)
e811c8ce
RD
7987
7988 def Lower(*args, **kwargs):
15afbcd0 7989 """
a95a7133 7990 Lower(self)
15afbcd0 7991
943e8dfd
RD
7992 Lowers the window to the bottom of the window hierarchy. In current
7993 version of wxWidgets this works both for manage and child windows.
15afbcd0 7994 """
54f9ee45 7995 return _core_.Window_Lower(*args, **kwargs)
e811c8ce
RD
7996
7997 def SetClientSize(*args, **kwargs):
15afbcd0 7998 """
a95a7133 7999 SetClientSize(self, Size size)
15afbcd0
RD
8000
8001 This sets the size of the window client area in pixels. Using this
8002 function to size a window tends to be more device-independent than
8003 wx.Window.SetSize, since the application need not worry about what
8004 dimensions the border or title bar have when trying to fit the window
8005 around panel items, for example.
8006 """
54f9ee45 8007 return _core_.Window_SetClientSize(*args, **kwargs)
e811c8ce
RD
8008
8009 def SetClientSizeWH(*args, **kwargs):
15afbcd0 8010 """
a95a7133 8011 SetClientSizeWH(self, int width, int height)
15afbcd0
RD
8012
8013 This sets the size of the window client area in pixels. Using this
8014 function to size a window tends to be more device-independent than
8015 wx.Window.SetSize, since the application need not worry about what
8016 dimensions the border or title bar have when trying to fit the window
8017 around panel items, for example.
8018 """
54f9ee45 8019 return _core_.Window_SetClientSizeWH(*args, **kwargs)
e811c8ce
RD
8020
8021 def SetClientRect(*args, **kwargs):
15afbcd0 8022 """
a95a7133 8023 SetClientRect(self, Rect rect)
15afbcd0
RD
8024
8025 This sets the size of the window client area in pixels. Using this
8026 function to size a window tends to be more device-independent than
8027 wx.Window.SetSize, since the application need not worry about what
8028 dimensions the border or title bar have when trying to fit the window
8029 around panel items, for example.
8030 """
54f9ee45 8031 return _core_.Window_SetClientRect(*args, **kwargs)
e811c8ce
RD
8032
8033 def GetPosition(*args, **kwargs):
0df68c9f 8034 """
a95a7133 8035 GetPosition(self) -> Point
e811c8ce 8036
75219dcb
RD
8037 Get the window's position. Notice that the position is in client
8038 coordinates for child windows and screen coordinates for the top level
8039 ones, use `GetScreenPosition` if you need screen coordinates for all
8040 kinds of windows.
0df68c9f 8041 """
54f9ee45 8042 return _core_.Window_GetPosition(*args, **kwargs)
e811c8ce
RD
8043
8044 def GetPositionTuple(*args, **kwargs):
0df68c9f
RD
8045 """
8046 GetPositionTuple() -> (x,y)
e811c8ce 8047
75219dcb
RD
8048 Get the window's position. Notice that the position is in client
8049 coordinates for child windows and screen coordinates for the top level
8050 ones, use `GetScreenPosition` if you need screen coordinates for all
8051 kinds of windows.
0df68c9f 8052 """
54f9ee45 8053 return _core_.Window_GetPositionTuple(*args, **kwargs)
e811c8ce 8054
75219dcb
RD
8055 def GetScreenPosition(*args, **kwargs):
8056 """
8057 GetScreenPosition(self) -> Point
8058
8059 Get the position of the window in screen coordinantes.
8060 """
8061 return _core_.Window_GetScreenPosition(*args, **kwargs)
8062
8063 def GetScreenPositionTuple(*args, **kwargs):
8064 """
8065 GetScreenPositionTuple() -> (x,y)
8066
8067 Get the position of the window in screen coordinantes.
8068 """
8069 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8070
8071 def GetScreenRect(*args, **kwargs):
8072 """
8073 GetScreenRect(self) -> Rect
8074
8075 Returns the size and position of the window in screen coordinantes as
8076 a `wx.Rect` object.
8077 """
8078 return _core_.Window_GetScreenRect(*args, **kwargs)
8079
e811c8ce 8080 def GetSize(*args, **kwargs):
0df68c9f 8081 """
a95a7133 8082 GetSize(self) -> Size
e811c8ce 8083
0df68c9f
RD
8084 Get the window size.
8085 """
54f9ee45 8086 return _core_.Window_GetSize(*args, **kwargs)
e811c8ce
RD
8087
8088 def GetSizeTuple(*args, **kwargs):
0df68c9f
RD
8089 """
8090 GetSizeTuple() -> (width, height)
e811c8ce 8091
0df68c9f
RD
8092 Get the window size.
8093 """
54f9ee45 8094 return _core_.Window_GetSizeTuple(*args, **kwargs)
e811c8ce
RD
8095
8096 def GetRect(*args, **kwargs):
15afbcd0 8097 """
a95a7133 8098 GetRect(self) -> Rect
15afbcd0 8099
75219dcb 8100 Returns the size and position of the window as a `wx.Rect` object.
15afbcd0 8101 """
54f9ee45 8102 return _core_.Window_GetRect(*args, **kwargs)
e811c8ce
RD
8103
8104 def GetClientSize(*args, **kwargs):
0df68c9f 8105 """
a95a7133 8106 GetClientSize(self) -> Size
e811c8ce 8107
15afbcd0
RD
8108 This gets the size of the window's 'client area' in pixels. The client
8109 area is the area which may be drawn on by the programmer, excluding
8110 title bar, border, scrollbars, etc.
0df68c9f 8111 """
54f9ee45 8112 return _core_.Window_GetClientSize(*args, **kwargs)
e811c8ce
RD
8113
8114 def GetClientSizeTuple(*args, **kwargs):
0df68c9f
RD
8115 """
8116 GetClientSizeTuple() -> (width, height)
e811c8ce 8117
15afbcd0
RD
8118 This gets the size of the window's 'client area' in pixels. The client
8119 area is the area which may be drawn on by the programmer, excluding
8120 title bar, border, scrollbars, etc.
0df68c9f 8121 """
54f9ee45 8122 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
e811c8ce
RD
8123
8124 def GetClientAreaOrigin(*args, **kwargs):
15afbcd0 8125 """
a95a7133 8126 GetClientAreaOrigin(self) -> Point
15afbcd0
RD
8127
8128 Get the origin of the client area of the window relative to the
8129 window's top left corner (the client area may be shifted because of
8130 the borders, scrollbars, other decorations...)
8131 """
54f9ee45 8132 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
e811c8ce
RD
8133
8134 def GetClientRect(*args, **kwargs):
15afbcd0 8135 """
a95a7133 8136 GetClientRect(self) -> Rect
15afbcd0 8137
61863841 8138 Get the client area position and size as a `wx.Rect` object.
15afbcd0 8139 """
54f9ee45 8140 return _core_.Window_GetClientRect(*args, **kwargs)
e811c8ce
RD
8141
8142 def GetBestSize(*args, **kwargs):
0df68c9f 8143 """
a95a7133 8144 GetBestSize(self) -> Size
e811c8ce 8145
248ed943 8146 This function returns the best acceptable minimal size for the
41e2b43e
RD
8147 window, if applicable. For example, for a static text control, it will
8148 be the minimal size such that the control label is not truncated. For
8149 windows containing subwindows (suzh aswx.Panel), the size returned by
8150 this function will be the same as the size the window would have had
8151 after calling Fit.
0df68c9f 8152 """
54f9ee45 8153 return _core_.Window_GetBestSize(*args, **kwargs)
e811c8ce
RD
8154
8155 def GetBestSizeTuple(*args, **kwargs):
0df68c9f
RD
8156 """
8157 GetBestSizeTuple() -> (width, height)
e811c8ce 8158
248ed943 8159 This function returns the best acceptable minimal size for the
41e2b43e
RD
8160 window, if applicable. For example, for a static text control, it will
8161 be the minimal size such that the control label is not truncated. For
8162 windows containing subwindows (suzh aswx.Panel), the size returned by
8163 this function will be the same as the size the window would have had
8164 after calling Fit.
0df68c9f 8165 """
54f9ee45 8166 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
e811c8ce 8167
dfbb5885
RD
8168 def InvalidateBestSize(*args, **kwargs):
8169 """
8170 InvalidateBestSize(self)
8171
8172 Reset the cached best size value so it will be recalculated the next
8173 time it is needed.
8174 """
8175 return _core_.Window_InvalidateBestSize(*args, **kwargs)
8176
e2813725
RD
8177 def CacheBestSize(*args, **kwargs):
8178 """
8179 CacheBestSize(self, Size size)
8180
8181 Cache the best size so it doesn't need to be calculated again, (at least until
8182 some properties of the window change.)
8183 """
8184 return _core_.Window_CacheBestSize(*args, **kwargs)
8185
dfbb5885
RD
8186 def GetBestFittingSize(*args, **kwargs):
8187 """
8188 GetBestFittingSize(self) -> Size
8189
8190 This function will merge the window's best size into the window's
8191 minimum size, giving priority to the min size components, and returns
8192 the results.
8193
8194 """
8195 return _core_.Window_GetBestFittingSize(*args, **kwargs)
8196
e811c8ce 8197 def GetAdjustedBestSize(*args, **kwargs):
15afbcd0 8198 """
a95a7133 8199 GetAdjustedBestSize(self) -> Size
15afbcd0
RD
8200
8201 This method is similar to GetBestSize, except in one
8202 thing. GetBestSize should return the minimum untruncated size of the
8203 window, while this method will return the largest of BestSize and any
8204 user specified minimum size. ie. it is the minimum size the window
8205 should currently be drawn at, not the minimal size it can possibly
8206 tolerate.
8207 """
54f9ee45 8208 return _core_.Window_GetAdjustedBestSize(*args, **kwargs)
e811c8ce
RD
8209
8210 def Center(*args, **kwargs):
15afbcd0 8211 """
a95a7133 8212 Center(self, int direction=BOTH)
15afbcd0
RD
8213
8214 Centers the window. The parameter specifies the direction for
8215 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8216 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8217 on the entire screen and not on its parent window. If it is a
8218 top-level window and has no parent then it will always be centered
8219 relative to the screen.
8220 """
54f9ee45 8221 return _core_.Window_Center(*args, **kwargs)
e811c8ce
RD
8222
8223 Centre = Center
e811c8ce 8224 def CenterOnParent(*args, **kwargs):
15afbcd0 8225 """
a95a7133 8226 CenterOnParent(self, int dir=BOTH)
15afbcd0
RD
8227
8228 Center with respect to the the parent window
8229 """
54f9ee45 8230 return _core_.Window_CenterOnParent(*args, **kwargs)
e811c8ce
RD
8231
8232 CentreOnParent = CenterOnParent
8233 def Fit(*args, **kwargs):
15afbcd0 8234 """
a95a7133 8235 Fit(self)
15afbcd0
RD
8236
8237 Sizes the window so that it fits around its subwindows. This function
8238 won't do anything if there are no subwindows and will only really work
8239 correctly if sizers are used for the subwindows layout. Also, if the
8240 window has exactly one subwindow it is better (faster and the result
8241 is more precise as Fit adds some margin to account for fuzziness of
8242 its calculations) to call window.SetClientSize(child.GetSize())
8243 instead of calling Fit.
8244 """
54f9ee45 8245 return _core_.Window_Fit(*args, **kwargs)
e811c8ce
RD
8246
8247 def FitInside(*args, **kwargs):
15afbcd0 8248 """
a95a7133 8249 FitInside(self)
15afbcd0
RD
8250
8251 Similar to Fit, but sizes the interior (virtual) size of a
8252 window. Mainly useful with scrolled windows to reset scrollbars after
8253 sizing changes that do not trigger a size event, and/or scrolled
8254 windows without an interior sizer. This function similarly won't do
8255 anything if there are no subwindows.
8256 """
54f9ee45 8257 return _core_.Window_FitInside(*args, **kwargs)
e811c8ce 8258
f16ab95d 8259 def SetSizeHints(*args, **kwargs):
0df68c9f 8260 """
a95a7133 8261 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
0df68c9f 8262 int incH=-1)
15afbcd0
RD
8263
8264 Allows specification of minimum and maximum window sizes, and window
8265 size increments. If a pair of values is not set (or set to -1), the
8266 default values will be used. If this function is called, the user
908b74cd
RD
8267 will not be able to size the window outside the given bounds (if it is
8268 a top-level window.) Sizers will also inspect the minimum window size
8269 and will use that value if set when calculating layout.
8270
8271 The resizing increments are only significant under Motif or Xt.
0df68c9f 8272 """
f16ab95d 8273 return _core_.Window_SetSizeHints(*args, **kwargs)
e811c8ce 8274
f16ab95d
RD
8275 def SetSizeHintsSz(*args, **kwargs):
8276 """
8277 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
8278
8279 Allows specification of minimum and maximum window sizes, and window
8280 size increments. If a pair of values is not set (or set to -1), the
8281 default values will be used. If this function is called, the user
8282 will not be able to size the window outside the given bounds (if it is
8283 a top-level window.) Sizers will also inspect the minimum window size
8284 and will use that value if set when calculating layout.
8285
8286 The resizing increments are only significant under Motif or Xt.
8287 """
8288 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
8289
8290 def SetVirtualSizeHints(*args, **kwargs):
15afbcd0 8291 """
908b74cd 8292 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
15afbcd0
RD
8293
8294 Allows specification of minimum and maximum virtual window sizes. If a
8295 pair of values is not set (or set to -1), the default values will be
8296 used. If this function is called, the user will not be able to size
8297 the virtual area of the window outside the given bounds.
8298 """
f16ab95d
RD
8299 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
8300
8301 def SetVirtualSizeHintsSz(*args, **kwargs):
8302 """
8303 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
8304
8305 Allows specification of minimum and maximum virtual window sizes. If a
8306 pair of values is not set (or set to -1), the default values will be
8307 used. If this function is called, the user will not be able to size
8308 the virtual area of the window outside the given bounds.
8309 """
8310 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
e811c8ce 8311
908b74cd
RD
8312 def GetMaxSize(*args, **kwargs):
8313 """GetMaxSize(self) -> Size"""
8314 return _core_.Window_GetMaxSize(*args, **kwargs)
8315
8316 def GetMinSize(*args, **kwargs):
8317 """GetMinSize(self) -> Size"""
8318 return _core_.Window_GetMinSize(*args, **kwargs)
8319
8320 def SetMinSize(*args, **kwargs):
8321 """
8322 SetMinSize(self, Size minSize)
8323
8324 A more convenient method than `SetSizeHints` for setting just the
8325 min size.
8326 """
8327 return _core_.Window_SetMinSize(*args, **kwargs)
8328
8329 def SetMaxSize(*args, **kwargs):
8330 """
8331 SetMaxSize(self, Size maxSize)
8332
8333 A more convenient method than `SetSizeHints` for setting just the
8334 max size.
8335 """
8336 return _core_.Window_SetMaxSize(*args, **kwargs)
8337
e811c8ce 8338 def GetMinWidth(*args, **kwargs):
a95a7133 8339 """GetMinWidth(self) -> int"""
54f9ee45 8340 return _core_.Window_GetMinWidth(*args, **kwargs)
e811c8ce
RD
8341
8342 def GetMinHeight(*args, **kwargs):
a95a7133 8343 """GetMinHeight(self) -> int"""
54f9ee45 8344 return _core_.Window_GetMinHeight(*args, **kwargs)
e811c8ce
RD
8345
8346 def GetMaxWidth(*args, **kwargs):
a95a7133 8347 """GetMaxWidth(self) -> int"""
54f9ee45 8348 return _core_.Window_GetMaxWidth(*args, **kwargs)
e811c8ce
RD
8349
8350 def GetMaxHeight(*args, **kwargs):
a95a7133 8351 """GetMaxHeight(self) -> int"""
54f9ee45 8352 return _core_.Window_GetMaxHeight(*args, **kwargs)
e811c8ce 8353
e811c8ce 8354 def SetVirtualSize(*args, **kwargs):
0df68c9f 8355 """
a95a7133 8356 SetVirtualSize(self, Size size)
e811c8ce 8357
15afbcd0
RD
8358 Set the the virtual size of a window in pixels. For most windows this
8359 is just the client area of the window, but for some like scrolled
8360 windows it is more or less independent of the screen window size.
0df68c9f 8361 """
54f9ee45 8362 return _core_.Window_SetVirtualSize(*args, **kwargs)
e811c8ce
RD
8363
8364 def SetVirtualSizeWH(*args, **kwargs):
0df68c9f 8365 """
a95a7133 8366 SetVirtualSizeWH(self, int w, int h)
e811c8ce 8367
15afbcd0
RD
8368 Set the the virtual size of a window in pixels. For most windows this
8369 is just the client area of the window, but for some like scrolled
8370 windows it is more or less independent of the screen window size.
0df68c9f 8371 """
54f9ee45 8372 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
e811c8ce
RD
8373
8374 def GetVirtualSize(*args, **kwargs):
0df68c9f 8375 """
a95a7133 8376 GetVirtualSize(self) -> Size
e811c8ce 8377
15afbcd0
RD
8378 Get the the virtual size of the window in pixels. For most windows
8379 this is just the client area of the window, but for some like scrolled
8380 windows it is more or less independent of the screen window size.
0df68c9f 8381 """
54f9ee45 8382 return _core_.Window_GetVirtualSize(*args, **kwargs)
e811c8ce
RD
8383
8384 def GetVirtualSizeTuple(*args, **kwargs):
0df68c9f
RD
8385 """
8386 GetVirtualSizeTuple() -> (width, height)
e811c8ce 8387
15afbcd0
RD
8388 Get the the virtual size of the window in pixels. For most windows
8389 this is just the client area of the window, but for some like scrolled
8390 windows it is more or less independent of the screen window size.
0df68c9f 8391 """
54f9ee45 8392 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
e811c8ce
RD
8393
8394 def GetBestVirtualSize(*args, **kwargs):
15afbcd0 8395 """
a95a7133 8396 GetBestVirtualSize(self) -> Size
15afbcd0
RD
8397
8398 Return the largest of ClientSize and BestSize (as determined by a
8399 sizer, interior children, or other means)
8400 """
54f9ee45 8401 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
e811c8ce
RD
8402
8403 def Show(*args, **kwargs):
15afbcd0 8404 """
a95a7133 8405 Show(self, bool show=True) -> bool
15afbcd0
RD
8406
8407 Shows or hides the window. You may need to call Raise for a top level
8408 window if you want to bring it to top, although this is not needed if
8409 Show is called immediately after the frame creation. Returns True if
8410 the window has been shown or hidden or False if nothing was done
8411 because it already was in the requested state.
8412 """
54f9ee45 8413 return _core_.Window_Show(*args, **kwargs)
e811c8ce
RD
8414
8415 def Hide(*args, **kwargs):
15afbcd0 8416 """
a95a7133 8417 Hide(self) -> bool
15afbcd0
RD
8418
8419 Equivalent to calling Show(False).
8420 """
54f9ee45 8421 return _core_.Window_Hide(*args, **kwargs)
e811c8ce
RD
8422
8423 def Enable(*args, **kwargs):
15afbcd0 8424 """
a95a7133 8425 Enable(self, bool enable=True) -> bool
15afbcd0
RD
8426
8427 Enable or disable the window for user input. Note that when a parent
8428 window is disabled, all of its children are disabled as well and they
8429 are reenabled again when the parent is. Returns true if the window
8430 has been enabled or disabled, false if nothing was done, i.e. if the
8431 window had already been in the specified state.
8432 """
54f9ee45 8433 return _core_.Window_Enable(*args, **kwargs)
e811c8ce
RD
8434
8435 def Disable(*args, **kwargs):
15afbcd0 8436 """
a95a7133 8437 Disable(self) -> bool
15afbcd0
RD
8438
8439 Disables the window, same as Enable(false).
8440 """
54f9ee45 8441 return _core_.Window_Disable(*args, **kwargs)
e811c8ce
RD
8442
8443 def IsShown(*args, **kwargs):
15afbcd0 8444 """
a95a7133 8445 IsShown(self) -> bool
15afbcd0
RD
8446
8447 Returns true if the window is shown, false if it has been hidden.
8448 """
54f9ee45 8449 return _core_.Window_IsShown(*args, **kwargs)
e811c8ce
RD
8450
8451 def IsEnabled(*args, **kwargs):
15afbcd0 8452 """
a95a7133 8453 IsEnabled(self) -> bool
15afbcd0
RD
8454
8455 Returns true if the window is enabled for input, false otherwise.
8456 """
54f9ee45 8457 return _core_.Window_IsEnabled(*args, **kwargs)
e811c8ce
RD
8458
8459 def SetWindowStyleFlag(*args, **kwargs):
15afbcd0 8460 """
a95a7133 8461 SetWindowStyleFlag(self, long style)
15afbcd0 8462
41e2b43e
RD
8463 Sets the style of the window. Please note that some styles cannot be
8464 changed after the window creation and that Refresh() might need to be
8465 called after changing the others for the change to take place
8466 immediately.
15afbcd0 8467 """
54f9ee45 8468 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
e811c8ce
RD
8469
8470 def GetWindowStyleFlag(*args, **kwargs):
15afbcd0 8471 """
a95a7133 8472 GetWindowStyleFlag(self) -> long
e811c8ce 8473
15afbcd0
RD
8474 Gets the window style that was passed to the constructor or Create
8475 method.
8476 """
54f9ee45 8477 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
e811c8ce 8478
15afbcd0 8479 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
e811c8ce 8480 def HasFlag(*args, **kwargs):
15afbcd0 8481 """
a95a7133 8482 HasFlag(self, int flag) -> bool
15afbcd0
RD
8483
8484 Test if the given style is set for this window.
8485 """
54f9ee45 8486 return _core_.Window_HasFlag(*args, **kwargs)
e811c8ce
RD
8487
8488 def IsRetained(*args, **kwargs):
15afbcd0 8489 """
a95a7133 8490 IsRetained(self) -> bool
15afbcd0
RD
8491
8492 Returns true if the window is retained, false otherwise. Retained
8493 windows are only available on X platforms.
8494 """
54f9ee45 8495 return _core_.Window_IsRetained(*args, **kwargs)
e811c8ce
RD
8496
8497 def SetExtraStyle(*args, **kwargs):
15afbcd0 8498 """
a95a7133 8499 SetExtraStyle(self, long exStyle)
15afbcd0
RD
8500
8501 Sets the extra style bits for the window. Extra styles are the less
8502 often used style bits which can't be set with the constructor or with
8503 SetWindowStyleFlag()
8504 """
54f9ee45 8505 return _core_.Window_SetExtraStyle(*args, **kwargs)
e811c8ce
RD
8506
8507 def GetExtraStyle(*args, **kwargs):
15afbcd0 8508 """
a95a7133 8509 GetExtraStyle(self) -> long
15afbcd0
RD
8510
8511 Returns the extra style bits for the window.
8512 """
54f9ee45 8513 return _core_.Window_GetExtraStyle(*args, **kwargs)
e811c8ce
RD
8514
8515 def MakeModal(*args, **kwargs):
15afbcd0 8516 """
a95a7133 8517 MakeModal(self, bool modal=True)
15afbcd0
RD
8518
8519 Disables all other windows in the application so that the user can
8520 only interact with this window. Passing False will reverse this
8521 effect.
8522 """
54f9ee45 8523 return _core_.Window_MakeModal(*args, **kwargs)
e811c8ce
RD
8524
8525 def SetThemeEnabled(*args, **kwargs):
15afbcd0 8526 """
a95a7133 8527 SetThemeEnabled(self, bool enableTheme)
15afbcd0
RD
8528
8529 This function tells a window if it should use the system's "theme"
8530 code to draw the windows' background instead if its own background
8531 drawing code. This will only have an effect on platforms that support
8532 the notion of themes in user defined windows. One such platform is
8533 GTK+ where windows can have (very colourful) backgrounds defined by a
8534 user's selected theme.
8535
8536 Dialogs, notebook pages and the status bar have this flag set to true
8537 by default so that the default look and feel is simulated best.
8538 """
54f9ee45 8539 return _core_.Window_SetThemeEnabled(*args, **kwargs)
e811c8ce
RD
8540
8541 def GetThemeEnabled(*args, **kwargs):
15afbcd0 8542 """
a95a7133 8543 GetThemeEnabled(self) -> bool
e811c8ce 8544
15afbcd0
RD
8545 Return the themeEnabled flag.
8546 """
54f9ee45 8547 return _core_.Window_GetThemeEnabled(*args, **kwargs)
e811c8ce
RD
8548
8549 def SetFocus(*args, **kwargs):
15afbcd0 8550 """
a95a7133 8551 SetFocus(self)
15afbcd0
RD
8552
8553 Set's the focus to this window, allowing it to receive keyboard input.
8554 """
54f9ee45 8555 return _core_.Window_SetFocus(*args, **kwargs)
e811c8ce
RD
8556
8557 def SetFocusFromKbd(*args, **kwargs):
15afbcd0 8558 """
a95a7133 8559 SetFocusFromKbd(self)
15afbcd0
RD
8560
8561 Set focus to this window as the result of a keyboard action. Normally
8562 only called internally.
8563 """
54f9ee45 8564 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
e811c8ce
RD
8565
8566 def FindFocus(*args, **kwargs):
15afbcd0 8567 """
66c033b4 8568 FindFocus() -> Window
15afbcd0
RD
8569
8570 Returns the window or control that currently has the keyboard focus,
8571 or None.
8572 """
54f9ee45 8573 return _core_.Window_FindFocus(*args, **kwargs)
e811c8ce
RD
8574
8575 FindFocus = staticmethod(FindFocus)
8576 def AcceptsFocus(*args, **kwargs):
15afbcd0 8577 """
a95a7133 8578 AcceptsFocus(self) -> bool
15afbcd0
RD
8579
8580 Can this window have focus?
8581 """
54f9ee45 8582 return _core_.Window_AcceptsFocus(*args, **kwargs)
e811c8ce
RD
8583
8584 def AcceptsFocusFromKeyboard(*args, **kwargs):
15afbcd0 8585 """
a95a7133 8586 AcceptsFocusFromKeyboard(self) -> bool
15afbcd0
RD
8587
8588 Can this window be given focus by keyboard navigation? if not, the
8589 only way to give it focus (provided it accepts it at all) is to click
8590 it.
8591 """
54f9ee45 8592 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
e811c8ce 8593
908b74cd
RD
8594 def Navigate(*args, **kwargs):
8595 """
8596 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
8597
fd2dc343
RD
8598 Does keyboard navigation from this window to another, by sending a
8599 `wx.NavigationKeyEvent`.
908b74cd
RD
8600 """
8601 return _core_.Window_Navigate(*args, **kwargs)
8602
7f98d120
RD
8603 def MoveAfterInTabOrder(*args, **kwargs):
8604 """
8605 MoveAfterInTabOrder(self, Window win)
8606
8607 Moves this window in the tab navigation order after the specified
8608 sibling window. This means that when the user presses the TAB key on
8609 that other window, the focus switches to this window.
8610
8611 The default tab order is the same as creation order. This function
8612 and `MoveBeforeInTabOrder` allow to change it after creating all the
8613 windows.
8614
8615 """
8616 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
8617
8618 def MoveBeforeInTabOrder(*args, **kwargs):
8619 """
8620 MoveBeforeInTabOrder(self, Window win)
8621
8622 Same as `MoveAfterInTabOrder` except that it inserts this window just
8623 before win instead of putting it right after it.
8624 """
8625 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
8626
e811c8ce 8627 def GetChildren(*args, **kwargs):
15afbcd0 8628 """
a95a7133 8629 GetChildren(self) -> PyObject
15afbcd0
RD
8630
8631 Returns a list of the window's children. NOTE: Currently this is a
8632 copy of the child window list maintained by the window, so the return
8633 value of this function is only valid as long as the window's children
8634 do not change.
8635 """
54f9ee45 8636 return _core_.Window_GetChildren(*args, **kwargs)
e811c8ce
RD
8637
8638 def GetParent(*args, **kwargs):
15afbcd0 8639 """
a95a7133 8640 GetParent(self) -> Window
15afbcd0
RD
8641
8642 Returns the parent window of this window, or None if there isn't one.
8643 """
54f9ee45 8644 return _core_.Window_GetParent(*args, **kwargs)
e811c8ce
RD
8645
8646 def GetGrandParent(*args, **kwargs):
15afbcd0 8647 """
a95a7133 8648 GetGrandParent(self) -> Window
15afbcd0 8649
41e2b43e
RD
8650 Returns the parent of the parent of this window, or None if there
8651 isn't one.
15afbcd0 8652 """
54f9ee45 8653 return _core_.Window_GetGrandParent(*args, **kwargs)
e811c8ce
RD
8654
8655 def IsTopLevel(*args, **kwargs):
15afbcd0 8656 """
a95a7133 8657 IsTopLevel(self) -> bool
15afbcd0
RD
8658
8659 Returns true if the given window is a top-level one. Currently all
8660 frames and dialogs are always considered to be top-level windows (even
8661 if they have a parent window).
8662 """
54f9ee45 8663 return _core_.Window_IsTopLevel(*args, **kwargs)
e811c8ce
RD
8664
8665 def Reparent(*args, **kwargs):
15afbcd0 8666 """
a95a7133 8667 Reparent(self, Window newParent) -> bool
15afbcd0
RD
8668
8669 Reparents the window, i.e the window will be removed from its current
8670 parent window (e.g. a non-standard toolbar in a wxFrame) and then
8671 re-inserted into another. Available on Windows and GTK. Returns True
8672 if the parent was changed, False otherwise (error or newParent ==
8673 oldParent)
8674 """
54f9ee45 8675 return _core_.Window_Reparent(*args, **kwargs)
e811c8ce
RD
8676
8677 def AddChild(*args, **kwargs):
15afbcd0 8678 """
a95a7133 8679 AddChild(self, Window child)
15afbcd0
RD
8680
8681 Adds a child window. This is called automatically by window creation
8682 functions so should not be required by the application programmer.
8683 """
54f9ee45 8684 return _core_.Window_AddChild(*args, **kwargs)
e811c8ce
RD
8685
8686 def RemoveChild(*args, **kwargs):
15afbcd0 8687 """
a95a7133 8688 RemoveChild(self, Window child)
15afbcd0
RD
8689
8690 Removes a child window. This is called automatically by window
8691 deletion functions so should not be required by the application
8692 programmer.
8693 """
54f9ee45 8694 return _core_.Window_RemoveChild(*args, **kwargs)
e811c8ce 8695
704eda0c
RD
8696 def SetDoubleBuffered(*args, **kwargs):
8697 """
8698 SetDoubleBuffered(self, bool on)
8699
8700 Currently wxGTK2 only.
8701 """
8702 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
8703
e811c8ce 8704 def FindWindowById(*args, **kwargs):
15afbcd0 8705 """
a95a7133 8706 FindWindowById(self, long winid) -> Window
15afbcd0
RD
8707
8708 Find a chld of this window by window ID
8709 """
54f9ee45 8710 return _core_.Window_FindWindowById(*args, **kwargs)
e811c8ce
RD
8711
8712 def FindWindowByName(*args, **kwargs):
15afbcd0 8713 """
a95a7133 8714 FindWindowByName(self, String name) -> Window
15afbcd0
RD
8715
8716 Find a child of this window by name
8717 """
54f9ee45 8718 return _core_.Window_FindWindowByName(*args, **kwargs)
e811c8ce
RD
8719
8720 def GetEventHandler(*args, **kwargs):
15afbcd0 8721 """
a95a7133 8722 GetEventHandler(self) -> EvtHandler
15afbcd0
RD
8723
8724 Returns the event handler for this window. By default, the window is
8725 its own event handler.
8726 """
54f9ee45 8727 return _core_.Window_GetEventHandler(*args, **kwargs)
e811c8ce
RD
8728
8729 def SetEventHandler(*args, **kwargs):
15afbcd0 8730 """
a95a7133 8731 SetEventHandler(self, EvtHandler handler)
15afbcd0
RD
8732
8733 Sets the event handler for this window. An event handler is an object
8734 that is capable of processing the events sent to a window. By default,
8735 the window is its own event handler, but an application may wish to
8736 substitute another, for example to allow central implementation of
8737 event-handling for a variety of different window classes.
8738
41e2b43e 8739 It is usually better to use `wx.Window.PushEventHandler` since this sets
15afbcd0
RD
8740 up a chain of event handlers, where an event not handled by one event
8741 handler is handed to the next one in the chain.
8742 """
54f9ee45 8743 return _core_.Window_SetEventHandler(*args, **kwargs)
e811c8ce
RD
8744
8745 def PushEventHandler(*args, **kwargs):
15afbcd0 8746 """
a95a7133 8747 PushEventHandler(self, EvtHandler handler)
15afbcd0
RD
8748
8749 Pushes this event handler onto the event handler stack for the window.
8750 An event handler is an object that is capable of processing the events
8751 sent to a window. By default, the window is its own event handler, but
8752 an application may wish to substitute another, for example to allow
8753 central implementation of event-handling for a variety of different
8754 window classes.
8755
8756 wx.Window.PushEventHandler allows an application to set up a chain of
8757 event handlers, where an event not handled by one event handler is
41e2b43e 8758 handed to the next one in the chain. Use `wx.Window.PopEventHandler` to
15afbcd0
RD
8759 remove the event handler.
8760 """
54f9ee45 8761 return _core_.Window_PushEventHandler(*args, **kwargs)
e811c8ce
RD
8762
8763 def PopEventHandler(*args, **kwargs):
15afbcd0 8764 """
a95a7133 8765 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
15afbcd0
RD
8766
8767 Removes and returns the top-most event handler on the event handler
8768 stack. If deleteHandler is True then the wx.EvtHandler object will be
8769 destroyed after it is popped.
8770 """
54f9ee45 8771 return _core_.Window_PopEventHandler(*args, **kwargs)
e811c8ce
RD
8772
8773 def RemoveEventHandler(*args, **kwargs):
15afbcd0 8774 """
a95a7133 8775 RemoveEventHandler(self, EvtHandler handler) -> bool
15afbcd0 8776
41e2b43e
RD
8777 Find the given handler in the event handler chain and remove (but not
8778 delete) it from the event handler chain, return True if it was found
8779 and False otherwise (this also results in an assert failure so this
8780 function should only be called when the handler is supposed to be
8781 there.)
15afbcd0 8782 """
54f9ee45 8783 return _core_.Window_RemoveEventHandler(*args, **kwargs)
e811c8ce
RD
8784
8785 def SetValidator(*args, **kwargs):
15afbcd0 8786 """
a95a7133 8787 SetValidator(self, Validator validator)
15afbcd0
RD
8788
8789 Deletes the current validator (if any) and sets the window validator,
8790 having called wx.Validator.Clone to create a new validator of this
8791 type.
8792 """
54f9ee45 8793 return _core_.Window_SetValidator(*args, **kwargs)
e811c8ce
RD
8794
8795 def GetValidator(*args, **kwargs):
15afbcd0 8796 """
a95a7133 8797 GetValidator(self) -> Validator
15afbcd0
RD
8798
8799 Returns a pointer to the current validator for the window, or None if
8800 there is none.
8801 """
54f9ee45 8802 return _core_.Window_GetValidator(*args, **kwargs)
e811c8ce 8803
74a57fcd
RD
8804 def Validate(*args, **kwargs):
8805 """
a95a7133 8806 Validate(self) -> bool
74a57fcd
RD
8807
8808 Validates the current values of the child controls using their
41e2b43e
RD
8809 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8810 style flag set, the method will also call Validate() of all child
8811 windows. Returns false if any of the validations failed.
74a57fcd 8812 """
54f9ee45 8813 return _core_.Window_Validate(*args, **kwargs)
74a57fcd
RD
8814
8815 def TransferDataToWindow(*args, **kwargs):
8816 """
a95a7133 8817 TransferDataToWindow(self) -> bool
74a57fcd 8818
41e2b43e
RD
8819 Transfers values to child controls from data areas specified by their
8820 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
8821 style flag set, the method will also call TransferDataToWindow() of
8822 all child windows.
74a57fcd 8823 """
54f9ee45 8824 return _core_.Window_TransferDataToWindow(*args, **kwargs)
74a57fcd
RD
8825
8826 def TransferDataFromWindow(*args, **kwargs):
8827 """
a95a7133 8828 TransferDataFromWindow(self) -> bool
74a57fcd 8829
41e2b43e
RD
8830 Transfers values from child controls to data areas specified by their
8831 validators. Returns false if a transfer failed. If the window has
8832 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
8833 also call TransferDataFromWindow() of all child windows.
74a57fcd 8834 """
54f9ee45 8835 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
74a57fcd
RD
8836
8837 def InitDialog(*args, **kwargs):
8838 """
a95a7133 8839 InitDialog(self)
74a57fcd 8840
41e2b43e
RD
8841 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
8842 to the dialog via validators.
74a57fcd 8843 """
54f9ee45 8844 return _core_.Window_InitDialog(*args, **kwargs)
74a57fcd 8845
e811c8ce 8846 def SetAcceleratorTable(*args, **kwargs):
15afbcd0 8847 """
a95a7133 8848 SetAcceleratorTable(self, AcceleratorTable accel)
15afbcd0
RD
8849
8850 Sets the accelerator table for this window.
8851 """
54f9ee45 8852 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
8853
8854 def GetAcceleratorTable(*args, **kwargs):
15afbcd0 8855 """
a95a7133 8856 GetAcceleratorTable(self) -> AcceleratorTable
15afbcd0
RD
8857
8858 Gets the accelerator table for this window.
8859 """
54f9ee45 8860 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
e811c8ce
RD
8861
8862 def RegisterHotKey(*args, **kwargs):
15afbcd0 8863 """
a95a7133 8864 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
15afbcd0
RD
8865
8866 Registers a system wide hotkey. Every time the user presses the hotkey
8867 registered here, this window will receive a hotkey event. It will
8868 receive the event even if the application is in the background and
8869 does not have the input focus because the user is working with some
8870 other application. To bind an event handler function to this hotkey
8871 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
8872 hotkey was registered successfully.
8873 """
54f9ee45 8874 return _core_.Window_RegisterHotKey(*args, **kwargs)
e811c8ce
RD
8875
8876 def UnregisterHotKey(*args, **kwargs):
15afbcd0 8877 """
a95a7133 8878 UnregisterHotKey(self, int hotkeyId) -> bool
15afbcd0
RD
8879
8880 Unregisters a system wide hotkey.
8881 """
54f9ee45 8882 return _core_.Window_UnregisterHotKey(*args, **kwargs)
e811c8ce
RD
8883
8884 def ConvertDialogPointToPixels(*args, **kwargs):
15afbcd0 8885 """
a95a7133 8886 ConvertDialogPointToPixels(self, Point pt) -> Point
15afbcd0
RD
8887
8888 Converts a point or size from dialog units to pixels. Dialog units
8889 are used for maintaining a dialog's proportions even if the font
8890 changes. For the x dimension, the dialog units are multiplied by the
8891 average character width and then divided by 4. For the y dimension,
8892 the dialog units are multiplied by the average character height and
8893 then divided by 8.
8894 """
54f9ee45 8895 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
e811c8ce
RD
8896
8897 def ConvertDialogSizeToPixels(*args, **kwargs):
15afbcd0 8898 """
a95a7133 8899 ConvertDialogSizeToPixels(self, Size sz) -> Size
15afbcd0
RD
8900
8901 Converts a point or size from dialog units to pixels. Dialog units
8902 are used for maintaining a dialog's proportions even if the font
8903 changes. For the x dimension, the dialog units are multiplied by the
8904 average character width and then divided by 4. For the y dimension,
8905 the dialog units are multiplied by the average character height and
8906 then divided by 8.
8907 """
54f9ee45 8908 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
e811c8ce
RD
8909
8910 def DLG_PNT(*args, **kwargs):
15afbcd0 8911 """
a95a7133 8912 DLG_PNT(self, Point pt) -> Point
15afbcd0
RD
8913
8914 Converts a point or size from dialog units to pixels. Dialog units
8915 are used for maintaining a dialog's proportions even if the font
8916 changes. For the x dimension, the dialog units are multiplied by the
8917 average character width and then divided by 4. For the y dimension,
8918 the dialog units are multiplied by the average character height and
8919 then divided by 8.
8920 """
54f9ee45 8921 return _core_.Window_DLG_PNT(*args, **kwargs)
e811c8ce
RD
8922
8923 def DLG_SZE(*args, **kwargs):
15afbcd0 8924 """
a95a7133 8925 DLG_SZE(self, Size sz) -> Size
15afbcd0
RD
8926
8927 Converts a point or size from dialog units to pixels. Dialog units
8928 are used for maintaining a dialog's proportions even if the font
8929 changes. For the x dimension, the dialog units are multiplied by the
8930 average character width and then divided by 4. For the y dimension,
8931 the dialog units are multiplied by the average character height and
8932 then divided by 8.
8933 """
54f9ee45 8934 return _core_.Window_DLG_SZE(*args, **kwargs)
e811c8ce
RD
8935
8936 def ConvertPixelPointToDialog(*args, **kwargs):
a95a7133 8937 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
54f9ee45 8938 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
e811c8ce
RD
8939
8940 def ConvertPixelSizeToDialog(*args, **kwargs):
a95a7133 8941 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
54f9ee45 8942 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
e811c8ce
RD
8943
8944 def WarpPointer(*args, **kwargs):
15afbcd0 8945 """
a95a7133 8946 WarpPointer(self, int x, int y)
15afbcd0
RD
8947
8948 Moves the pointer to the given position on the window.
8949
8950 NOTE: This function is not supported under Mac because Apple Human
8951 Interface Guidelines forbid moving the mouse cursor programmatically.
8952 """
54f9ee45 8953 return _core_.Window_WarpPointer(*args, **kwargs)
e811c8ce
RD
8954
8955 def CaptureMouse(*args, **kwargs):
15afbcd0 8956 """
a95a7133 8957 CaptureMouse(self)
15afbcd0
RD
8958
8959 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
8960 release the capture.
8961
8962 Note that wxWindows maintains the stack of windows having captured the
8963 mouse and when the mouse is released the capture returns to the window
8964 which had had captured it previously and it is only really released if
8965 there were no previous window. In particular, this means that you must
34e0a3bb
RD
8966 release the mouse as many times as you capture it, unless the window
8967 receives the `wx.MouseCaptureLostEvent` event.
8968
8969 Any application which captures the mouse in the beginning of some
8970 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
8971 operation when it receives the event. The event handler must not
8972 recapture mouse.
15afbcd0 8973 """
54f9ee45 8974 return _core_.Window_CaptureMouse(*args, **kwargs)
e811c8ce
RD
8975
8976 def ReleaseMouse(*args, **kwargs):
15afbcd0 8977 """
a95a7133 8978 ReleaseMouse(self)
15afbcd0
RD
8979
8980 Releases mouse input captured with wx.Window.CaptureMouse.
8981 """
54f9ee45 8982 return _core_.Window_ReleaseMouse(*args, **kwargs)
e811c8ce
RD
8983
8984 def GetCapture(*args, **kwargs):
15afbcd0 8985 """
66c033b4 8986 GetCapture() -> Window
15afbcd0
RD
8987
8988 Returns the window which currently captures the mouse or None
8989 """
54f9ee45 8990 return _core_.Window_GetCapture(*args, **kwargs)
e811c8ce
RD
8991
8992 GetCapture = staticmethod(GetCapture)
8993 def HasCapture(*args, **kwargs):
15afbcd0 8994 """
a95a7133 8995 HasCapture(self) -> bool
15afbcd0
RD
8996
8997 Returns true if this window has the current mouse capture.
8998 """
54f9ee45 8999 return _core_.Window_HasCapture(*args, **kwargs)
e811c8ce
RD
9000
9001 def Refresh(*args, **kwargs):
15afbcd0 9002 """
a95a7133 9003 Refresh(self, bool eraseBackground=True, Rect rect=None)
15afbcd0
RD
9004
9005 Mark the specified rectangle (or the whole window) as "dirty" so it
9006 will be repainted. Causes an EVT_PAINT event to be generated and sent
9007 to the window.
9008 """
54f9ee45 9009 return _core_.Window_Refresh(*args, **kwargs)
e811c8ce
RD
9010
9011 def RefreshRect(*args, **kwargs):
15afbcd0 9012 """
fef4c27a 9013 RefreshRect(self, Rect rect, bool eraseBackground=True)
15afbcd0
RD
9014
9015 Redraws the contents of the given rectangle: the area inside it will
9016 be repainted. This is the same as Refresh but has a nicer syntax.
9017 """
54f9ee45 9018 return _core_.Window_RefreshRect(*args, **kwargs)
e811c8ce
RD
9019
9020 def Update(*args, **kwargs):
15afbcd0 9021 """
a95a7133 9022 Update(self)
15afbcd0
RD
9023
9024 Calling this method immediately repaints the invalidated area of the
9025 window instead of waiting for the EVT_PAINT event to happen, (normally
9026 this would usually only happen when the flow of control returns to the
9027 event loop.) Notice that this function doesn't refresh the window and
9028 does nothing if the window has been already repainted. Use Refresh
9029 first if you want to immediately redraw the window (or some portion of
9030 it) unconditionally.
9031 """
54f9ee45 9032 return _core_.Window_Update(*args, **kwargs)
e811c8ce
RD
9033
9034 def ClearBackground(*args, **kwargs):
15afbcd0 9035 """
a95a7133 9036 ClearBackground(self)
15afbcd0
RD
9037
9038 Clears the window by filling it with the current background
9039 colour. Does not cause an erase background event to be generated.
9040 """
54f9ee45 9041 return _core_.Window_ClearBackground(*args, **kwargs)
e811c8ce
RD
9042
9043 def Freeze(*args, **kwargs):
15afbcd0 9044 """
a95a7133 9045 Freeze(self)
15afbcd0 9046
41e2b43e
RD
9047 Freezes the window or, in other words, prevents any updates from
9048 taking place on screen, the window is not redrawn at all. Thaw must be
9049 called to reenable window redrawing. Calls to Freeze/Thaw may be
9050 nested, with the actual Thaw being delayed until all the nesting has
9051 been undone.
15afbcd0
RD
9052
9053 This method is useful for visual appearance optimization (for example,
9054 it is a good idea to use it before inserting large amount of text into
9055 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9056 for all controls so it is mostly just a hint to wxWindows and not a
9057 mandatory directive.
9058 """
54f9ee45 9059 return _core_.Window_Freeze(*args, **kwargs)
e811c8ce
RD
9060
9061 def Thaw(*args, **kwargs):
15afbcd0 9062 """
a95a7133 9063 Thaw(self)
15afbcd0 9064
4276dc52 9065 Reenables window updating after a previous call to Freeze. Calls to
41e2b43e
RD
9066 Freeze/Thaw may be nested, so Thaw must be called the same number of
9067 times that Freeze was before the window will be updated.
15afbcd0 9068 """
54f9ee45 9069 return _core_.Window_Thaw(*args, **kwargs)
e811c8ce
RD
9070
9071 def PrepareDC(*args, **kwargs):
15afbcd0 9072 """
a95a7133 9073 PrepareDC(self, DC dc)
15afbcd0
RD
9074
9075 Call this function to prepare the device context for drawing a
9076 scrolled image. It sets the device origin according to the current
9077 scroll position.
9078 """
54f9ee45 9079 return _core_.Window_PrepareDC(*args, **kwargs)
e811c8ce
RD
9080
9081 def GetUpdateRegion(*args, **kwargs):
15afbcd0 9082 """
a95a7133 9083 GetUpdateRegion(self) -> Region
15afbcd0
RD
9084
9085 Returns the region specifying which parts of the window have been
9086 damaged. Should only be called within an EVT_PAINT handler.
9087 """
54f9ee45 9088 return _core_.Window_GetUpdateRegion(*args, **kwargs)
e811c8ce
RD
9089
9090 def GetUpdateClientRect(*args, **kwargs):
15afbcd0 9091 """
a95a7133 9092 GetUpdateClientRect(self) -> Rect
15afbcd0
RD
9093
9094 Get the update rectangle region bounding box in client coords.
9095 """
54f9ee45 9096 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
e811c8ce
RD
9097
9098 def IsExposed(*args, **kwargs):
15afbcd0 9099 """
a95a7133 9100 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
15afbcd0
RD
9101
9102 Returns true if the given point or rectangle area has been exposed
9103 since the last repaint. Call this in an paint event handler to
9104 optimize redrawing by only redrawing those areas, which have been
9105 exposed.
9106 """
54f9ee45 9107 return _core_.Window_IsExposed(*args, **kwargs)
e811c8ce
RD
9108
9109 def IsExposedPoint(*args, **kwargs):
15afbcd0 9110 """
a95a7133 9111 IsExposedPoint(self, Point pt) -> bool
15afbcd0
RD
9112
9113 Returns true if the given point or rectangle area has been exposed
9114 since the last repaint. Call this in an paint event handler to
9115 optimize redrawing by only redrawing those areas, which have been
9116 exposed.
9117 """
54f9ee45 9118 return _core_.Window_IsExposedPoint(*args, **kwargs)
e811c8ce 9119
4276dc52 9120 def IsExposedRect(*args, **kwargs):
15afbcd0 9121 """
a95a7133 9122 IsExposedRect(self, Rect rect) -> bool
15afbcd0
RD
9123
9124 Returns true if the given point or rectangle area has been exposed
9125 since the last repaint. Call this in an paint event handler to
9126 optimize redrawing by only redrawing those areas, which have been
9127 exposed.
9128 """
54f9ee45 9129 return _core_.Window_IsExposedRect(*args, **kwargs)
e811c8ce 9130
74a57fcd
RD
9131 def GetDefaultAttributes(*args, **kwargs):
9132 """
a95a7133 9133 GetDefaultAttributes(self) -> VisualAttributes
74a57fcd 9134
41e2b43e
RD
9135 Get the default attributes for an instance of this class. This is
9136 useful if you want to use the same font or colour in your own control
9137 as in a standard control -- which is a much better idea than hard
9138 coding specific colours or fonts which might look completely out of
db3e571a 9139 place on the user's system, especially if it uses themes.
74a57fcd 9140 """
54f9ee45 9141 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
74a57fcd
RD
9142
9143 def GetClassDefaultAttributes(*args, **kwargs):
9144 """
66c033b4 9145 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
74a57fcd 9146
41e2b43e
RD
9147 Get the default attributes for this class. This is useful if you want
9148 to use the same font or colour in your own control as in a standard
9149 control -- which is a much better idea than hard coding specific
db3e571a
RD
9150 colours or fonts which might look completely out of place on the
9151 user's system, especially if it uses themes.
74a57fcd
RD
9152
9153 The variant parameter is only relevant under Mac currently and is
41e2b43e 9154 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
9155 the returned font. See `wx.Window.SetWindowVariant` for more about
9156 this.
74a57fcd 9157 """
54f9ee45 9158 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
9159
9160 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
e811c8ce 9161 def SetBackgroundColour(*args, **kwargs):
15afbcd0 9162 """
a95a7133 9163 SetBackgroundColour(self, Colour colour) -> bool
15afbcd0
RD
9164
9165 Sets the background colour of the window. Returns True if the colour
9166 was changed. The background colour is usually painted by the default
9167 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9168 automatically under GTK. Using `wx.NullColour` will reset the window
9169 to the default background colour.
15afbcd0 9170
db3e571a 9171 Note that setting the background colour may not cause an immediate
f8167d6e 9172 refresh, so you may wish to call `ClearBackground` or `Refresh` after
15afbcd0
RD
9173 calling this function.
9174
f8167d6e
RD
9175 Using this function will disable attempts to use themes for this
9176 window, if the system supports them. Use with care since usually the
9177 themes represent the appearance chosen by the user to be used for all
9178 applications on the system.
15afbcd0 9179 """
54f9ee45 9180 return _core_.Window_SetBackgroundColour(*args, **kwargs)
e811c8ce 9181
412d302d
RD
9182 def SetOwnBackgroundColour(*args, **kwargs):
9183 """SetOwnBackgroundColour(self, Colour colour)"""
9184 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
b2df227b 9185
e811c8ce 9186 def SetForegroundColour(*args, **kwargs):
15afbcd0 9187 """
a95a7133 9188 SetForegroundColour(self, Colour colour) -> bool
15afbcd0
RD
9189
9190 Sets the foreground colour of the window. Returns True is the colour
9191 was changed. The interpretation of foreground colour is dependent on
9192 the window class; it may be the text colour or other colour, or it may
9193 not be used at all.
9194 """
54f9ee45 9195 return _core_.Window_SetForegroundColour(*args, **kwargs)
e811c8ce 9196
fa47d7a7
VS
9197 def SetOwnForegroundColour(*args, **kwargs):
9198 """SetOwnForegroundColour(self, Colour colour)"""
9199 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
b2df227b 9200
e811c8ce 9201 def GetBackgroundColour(*args, **kwargs):
15afbcd0 9202 """
a95a7133 9203 GetBackgroundColour(self) -> Colour
15afbcd0
RD
9204
9205 Returns the background colour of the window.
9206 """
54f9ee45 9207 return _core_.Window_GetBackgroundColour(*args, **kwargs)
e811c8ce
RD
9208
9209 def GetForegroundColour(*args, **kwargs):
15afbcd0 9210 """
a95a7133 9211 GetForegroundColour(self) -> Colour
15afbcd0
RD
9212
9213 Returns the foreground colour of the window. The interpretation of
9214 foreground colour is dependent on the window class; it may be the text
9215 colour or other colour, or it may not be used at all.
9216 """
54f9ee45 9217 return _core_.Window_GetForegroundColour(*args, **kwargs)
e811c8ce 9218
562ecc31
RD
9219 def InheritsBackgroundColour(*args, **kwargs):
9220 """InheritsBackgroundColour(self) -> bool"""
9221 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
9222
9223 def UseBgCol(*args, **kwargs):
9224 """UseBgCol(self) -> bool"""
9225 return _core_.Window_UseBgCol(*args, **kwargs)
9226
7bc1e663
RD
9227 def SetBackgroundStyle(*args, **kwargs):
9228 """
9229 SetBackgroundStyle(self, int style) -> bool
9230
9231 Returns the background style of the window. The background style
9232 indicates how the background of the window is drawn.
9233
9234 ====================== ========================================
9235 wx.BG_STYLE_SYSTEM The background colour or pattern should
9236 be determined by the system
9237 wx.BG_STYLE_COLOUR The background should be a solid colour
9238 wx.BG_STYLE_CUSTOM The background will be implemented by the
9239 application.
9240 ====================== ========================================
9241
9242 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9243 a custom background, such as a tiled bitmap. Currently the style has
9244 no effect on other platforms.
9245
9246 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9247 """
9248 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
9249
9250 def GetBackgroundStyle(*args, **kwargs):
9251 """
9252 GetBackgroundStyle(self) -> int
9253
9254 Returns the background style of the window.
9255
9256 :see: `SetBackgroundStyle`
9257 """
9258 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
9259
51b83b37
RD
9260 def HasTransparentBackground(*args, **kwargs):
9261 """
9262 HasTransparentBackground(self) -> bool
9263
9264 Returns True if this window's background is transparent (as, for
9265 example, for `wx.StaticText`) and should show the parent window's
9266 background.
9267
9268 This method is mostly used internally by the library itself and you
9269 normally shouldn't have to call it. You may, however, have to override
9270 it in your custom control classes to ensure that background is painted
9271 correctly.
9272 """
9273 return _core_.Window_HasTransparentBackground(*args, **kwargs)
9274
e811c8ce 9275 def SetCursor(*args, **kwargs):
15afbcd0 9276 """
a95a7133 9277 SetCursor(self, Cursor cursor) -> bool
15afbcd0
RD
9278
9279 Sets the window's cursor. Notice that the window cursor also sets it
9280 for the children of the window implicitly.
9281
9282 The cursor may be wx.NullCursor in which case the window cursor will
9283 be reset back to default.
9284 """
54f9ee45 9285 return _core_.Window_SetCursor(*args, **kwargs)
e811c8ce
RD
9286
9287 def GetCursor(*args, **kwargs):
15afbcd0 9288 """
a95a7133 9289 GetCursor(self) -> Cursor
15afbcd0
RD
9290
9291 Return the cursor associated with this window.
9292 """
54f9ee45 9293 return _core_.Window_GetCursor(*args, **kwargs)
e811c8ce
RD
9294
9295 def SetFont(*args, **kwargs):
15afbcd0 9296 """
a95a7133 9297 SetFont(self, Font font) -> bool
15afbcd0
RD
9298
9299 Sets the font for this window.
9300 """
54f9ee45 9301 return _core_.Window_SetFont(*args, **kwargs)
e811c8ce 9302
fa47d7a7
VS
9303 def SetOwnFont(*args, **kwargs):
9304 """SetOwnFont(self, Font font)"""
9305 return _core_.Window_SetOwnFont(*args, **kwargs)
b2df227b 9306
e811c8ce 9307 def GetFont(*args, **kwargs):
15afbcd0 9308 """
a95a7133 9309 GetFont(self) -> Font
15afbcd0 9310
4276dc52 9311 Returns the default font used for this window.
15afbcd0 9312 """
54f9ee45 9313 return _core_.Window_GetFont(*args, **kwargs)
e811c8ce
RD
9314
9315 def SetCaret(*args, **kwargs):
15afbcd0 9316 """
a95a7133 9317 SetCaret(self, Caret caret)
15afbcd0
RD
9318
9319 Sets the caret associated with the window.
9320 """
54f9ee45 9321 return _core_.Window_SetCaret(*args, **kwargs)
e811c8ce
RD
9322
9323 def GetCaret(*args, **kwargs):
15afbcd0 9324 """
a95a7133 9325 GetCaret(self) -> Caret
15afbcd0
RD
9326
9327 Returns the caret associated with the window.
9328 """
54f9ee45 9329 return _core_.Window_GetCaret(*args, **kwargs)
e811c8ce
RD
9330
9331 def GetCharHeight(*args, **kwargs):
15afbcd0 9332 """
a95a7133 9333 GetCharHeight(self) -> int
15afbcd0
RD
9334
9335 Get the (average) character size for the current font.
9336 """
54f9ee45 9337 return _core_.Window_GetCharHeight(*args, **kwargs)
e811c8ce
RD
9338
9339 def GetCharWidth(*args, **kwargs):
15afbcd0 9340 """
a95a7133 9341 GetCharWidth(self) -> int
15afbcd0
RD
9342
9343 Get the (average) character size for the current font.
9344 """
54f9ee45 9345 return _core_.Window_GetCharWidth(*args, **kwargs)
e811c8ce
RD
9346
9347 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9348 """
9349 GetTextExtent(String string) -> (width, height)
9350
9351 Get the width and height of the text using the current font.
9352 """
54f9ee45 9353 return _core_.Window_GetTextExtent(*args, **kwargs)
e811c8ce
RD
9354
9355 def GetFullTextExtent(*args, **kwargs):
0df68c9f 9356 """
196addbf 9357 GetFullTextExtent(String string, Font font=None) ->
0df68c9f 9358 (width, height, descent, externalLeading)
e811c8ce 9359
15afbcd0
RD
9360 Get the width, height, decent and leading of the text using the
9361 current or specified font.
0df68c9f 9362 """
54f9ee45 9363 return _core_.Window_GetFullTextExtent(*args, **kwargs)
e811c8ce
RD
9364
9365 def ClientToScreenXY(*args, **kwargs):
15afbcd0
RD
9366 """
9367 ClientToScreenXY(int x, int y) -> (x,y)
9368
9369 Converts to screen coordinates from coordinates relative to this window.
9370 """
54f9ee45 9371 return _core_.Window_ClientToScreenXY(*args, **kwargs)
e811c8ce
RD
9372
9373 def ScreenToClientXY(*args, **kwargs):
15afbcd0
RD
9374 """
9375 ScreenToClientXY(int x, int y) -> (x,y)
9376
9377 Converts from screen to client window coordinates.
9378 """
54f9ee45 9379 return _core_.Window_ScreenToClientXY(*args, **kwargs)
e811c8ce
RD
9380
9381 def ClientToScreen(*args, **kwargs):
15afbcd0 9382 """
a95a7133 9383 ClientToScreen(self, Point pt) -> Point
15afbcd0
RD
9384
9385 Converts to screen coordinates from coordinates relative to this window.
9386 """
54f9ee45 9387 return _core_.Window_ClientToScreen(*args, **kwargs)
e811c8ce
RD
9388
9389 def ScreenToClient(*args, **kwargs):
15afbcd0 9390 """
a95a7133 9391 ScreenToClient(self, Point pt) -> Point
15afbcd0
RD
9392
9393 Converts from screen to client window coordinates.
9394 """
54f9ee45 9395 return _core_.Window_ScreenToClient(*args, **kwargs)
e811c8ce
RD
9396
9397 def HitTestXY(*args, **kwargs):
15afbcd0 9398 """
a95a7133 9399 HitTestXY(self, int x, int y) -> int
15afbcd0
RD
9400
9401 Test where the given (in client coords) point lies
9402 """
54f9ee45 9403 return _core_.Window_HitTestXY(*args, **kwargs)
e811c8ce
RD
9404
9405 def HitTest(*args, **kwargs):
15afbcd0 9406 """
a95a7133 9407 HitTest(self, Point pt) -> int
15afbcd0
RD
9408
9409 Test where the given (in client coords) point lies
9410 """
54f9ee45 9411 return _core_.Window_HitTest(*args, **kwargs)
e811c8ce 9412
15afbcd0
RD
9413 def GetBorder(*args):
9414 """
a95a7133
RD
9415 GetBorder(self, long flags) -> int
9416 GetBorder(self) -> int
e811c8ce 9417
15afbcd0
RD
9418 Get border for the flags of this window
9419 """
54f9ee45 9420 return _core_.Window_GetBorder(*args)
e811c8ce
RD
9421
9422 def UpdateWindowUI(*args, **kwargs):
15afbcd0 9423 """
a95a7133 9424 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
15afbcd0
RD
9425
9426 This function sends EVT_UPDATE_UI events to the window. The particular
9427 implementation depends on the window; for example a wx.ToolBar will
9428 send an update UI event for each toolbar button, and a wx.Frame will
9429 send an update UI event for each menubar menu item. You can call this
9430 function from your application to ensure that your UI is up-to-date at
9431 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9432 concerned). This may be necessary if you have called
5ba5649b 9433 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
15afbcd0
RD
9434 limit the overhead that wxWindows incurs by sending update UI events
9435 in idle time.
15afbcd0 9436 """
54f9ee45 9437 return _core_.Window_UpdateWindowUI(*args, **kwargs)
e811c8ce
RD
9438
9439 def PopupMenuXY(*args, **kwargs):
15afbcd0 9440 """
b0503257 9441 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
15afbcd0 9442
b0503257
RD
9443 Pops up the given menu at the specified coordinates, relative to this window,
9444 and returns control when the user has dismissed the menu. If a menu item is
9445 selected, the corresponding menu event is generated and will be processed as
9446 usual. If the default position is given then the current position of the
9447 mouse cursor will be used.
15afbcd0 9448 """
54f9ee45 9449 return _core_.Window_PopupMenuXY(*args, **kwargs)
e811c8ce 9450
15afbcd0
RD
9451 def PopupMenu(*args, **kwargs):
9452 """
b0503257 9453 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
15afbcd0 9454
b0503257
RD
9455 Pops up the given menu at the specified coordinates, relative to this window,
9456 and returns control when the user has dismissed the menu. If a menu item is
9457 selected, the corresponding menu event is generated and will be processed as
9458 usual. If the default position is given then the current position of the
9459 mouse cursor will be used.
15afbcd0 9460 """
54f9ee45 9461 return _core_.Window_PopupMenu(*args, **kwargs)
15afbcd0 9462
10044bf1
RD
9463 def HasMultiplePages(*args, **kwargs):
9464 """HasMultiplePages(self) -> bool"""
9465 return _core_.Window_HasMultiplePages(*args, **kwargs)
9466
15afbcd0
RD
9467 def GetHandle(*args, **kwargs):
9468 """
a95a7133 9469 GetHandle(self) -> long
15afbcd0
RD
9470
9471 Returns the platform-specific handle (as a long integer) of the
9472 physical window. Currently on wxMac it returns the handle of the
9473 toplevel parent of the window.
9474 """
54f9ee45 9475 return _core_.Window_GetHandle(*args, **kwargs)
15afbcd0 9476
7e63a440
RD
9477 def AssociateHandle(*args, **kwargs):
9478 """
9479 AssociateHandle(self, long handle)
9480
9481 Associate the window with a new native handle
9482 """
9483 return _core_.Window_AssociateHandle(*args, **kwargs)
9484
9485 def DissociateHandle(*args, **kwargs):
9486 """
9487 DissociateHandle(self)
9488
9489 Dissociate the current native handle from the window
9490 """
9491 return _core_.Window_DissociateHandle(*args, **kwargs)
9492
15afbcd0
RD
9493 def HasScrollbar(*args, **kwargs):
9494 """
a95a7133 9495 HasScrollbar(self, int orient) -> bool
15afbcd0
RD
9496
9497 Does the window have the scrollbar for this orientation?
9498 """
54f9ee45 9499 return _core_.Window_HasScrollbar(*args, **kwargs)
15afbcd0
RD
9500
9501 def SetScrollbar(*args, **kwargs):
9502 """
41e2b43e 9503 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
15afbcd0
RD
9504 bool refresh=True)
9505
9506 Sets the scrollbar properties of a built-in scrollbar.
15afbcd0 9507 """
54f9ee45 9508 return _core_.Window_SetScrollbar(*args, **kwargs)
e811c8ce
RD
9509
9510 def SetScrollPos(*args, **kwargs):
15afbcd0 9511 """
a95a7133 9512 SetScrollPos(self, int orientation, int pos, bool refresh=True)
15afbcd0
RD
9513
9514 Sets the position of one of the built-in scrollbars.
9515 """
54f9ee45 9516 return _core_.Window_SetScrollPos(*args, **kwargs)
e811c8ce
RD
9517
9518 def GetScrollPos(*args, **kwargs):
15afbcd0 9519 """
a95a7133 9520 GetScrollPos(self, int orientation) -> int
15afbcd0
RD
9521
9522 Returns the built-in scrollbar position.
9523 """
54f9ee45 9524 return _core_.Window_GetScrollPos(*args, **kwargs)
e811c8ce
RD
9525
9526 def GetScrollThumb(*args, **kwargs):
15afbcd0 9527 """
a95a7133 9528 GetScrollThumb(self, int orientation) -> int
15afbcd0
RD
9529
9530 Returns the built-in scrollbar thumb size.
9531 """
54f9ee45 9532 return _core_.Window_GetScrollThumb(*args, **kwargs)
e811c8ce
RD
9533
9534 def GetScrollRange(*args, **kwargs):
15afbcd0 9535 """
a95a7133 9536 GetScrollRange(self, int orientation) -> int
15afbcd0
RD
9537
9538 Returns the built-in scrollbar range.
9539 """
54f9ee45 9540 return _core_.Window_GetScrollRange(*args, **kwargs)
e811c8ce
RD
9541
9542 def ScrollWindow(*args, **kwargs):
15afbcd0 9543 """
a95a7133 9544 ScrollWindow(self, int dx, int dy, Rect rect=None)
15afbcd0
RD
9545
9546 Physically scrolls the pixels in the window and move child windows
9547 accordingly. Use this function to optimise your scrolling
9548 implementations, to minimise the area that must be redrawn. Note that
9549 it is rarely required to call this function from a user program.
15afbcd0 9550 """
54f9ee45 9551 return _core_.Window_ScrollWindow(*args, **kwargs)
e811c8ce
RD
9552
9553 def ScrollLines(*args, **kwargs):
15afbcd0 9554 """
a95a7133 9555 ScrollLines(self, int lines) -> bool
15afbcd0
RD
9556
9557 If the platform and window class supports it, scrolls the window by
9558 the given number of lines down, if lines is positive, or up if lines
9559 is negative. Returns True if the window was scrolled, False if it was
9560 already on top/bottom and nothing was done.
9561 """
54f9ee45 9562 return _core_.Window_ScrollLines(*args, **kwargs)
e811c8ce
RD
9563
9564 def ScrollPages(*args, **kwargs):
15afbcd0 9565 """
a95a7133 9566 ScrollPages(self, int pages) -> bool
15afbcd0 9567
41e2b43e 9568 If the platform and window class supports it, scrolls the window by
15afbcd0
RD
9569 the given number of pages down, if pages is positive, or up if pages
9570 is negative. Returns True if the window was scrolled, False if it was
9571 already on top/bottom and nothing was done.
9572 """
54f9ee45 9573 return _core_.Window_ScrollPages(*args, **kwargs)
e811c8ce
RD
9574
9575 def LineUp(*args, **kwargs):
15afbcd0 9576 """
a95a7133 9577 LineUp(self) -> bool
15afbcd0
RD
9578
9579 This is just a wrapper for ScrollLines(-1).
9580 """
54f9ee45 9581 return _core_.Window_LineUp(*args, **kwargs)
e811c8ce
RD
9582
9583 def LineDown(*args, **kwargs):
15afbcd0 9584 """
a95a7133 9585 LineDown(self) -> bool
15afbcd0
RD
9586
9587 This is just a wrapper for ScrollLines(1).
9588 """
54f9ee45 9589 return _core_.Window_LineDown(*args, **kwargs)
e811c8ce
RD
9590
9591 def PageUp(*args, **kwargs):
15afbcd0 9592 """
a95a7133 9593 PageUp(self) -> bool
15afbcd0
RD
9594
9595 This is just a wrapper for ScrollPages(-1).
9596 """
54f9ee45 9597 return _core_.Window_PageUp(*args, **kwargs)
e811c8ce
RD
9598
9599 def PageDown(*args, **kwargs):
15afbcd0 9600 """
a95a7133 9601 PageDown(self) -> bool
15afbcd0
RD
9602
9603 This is just a wrapper for ScrollPages(1).
9604 """
54f9ee45 9605 return _core_.Window_PageDown(*args, **kwargs)
e811c8ce
RD
9606
9607 def SetHelpText(*args, **kwargs):
15afbcd0 9608 """
a95a7133 9609 SetHelpText(self, String text)
15afbcd0
RD
9610
9611 Sets the help text to be used as context-sensitive help for this
9612 window. Note that the text is actually stored by the current
f52cbe90 9613 `wx.HelpProvider` implementation, and not in the window object itself.
15afbcd0 9614 """
54f9ee45 9615 return _core_.Window_SetHelpText(*args, **kwargs)
e811c8ce
RD
9616
9617 def SetHelpTextForId(*args, **kwargs):
15afbcd0 9618 """
a95a7133 9619 SetHelpTextForId(self, String text)
15afbcd0
RD
9620
9621 Associate this help text with all windows with the same id as this
9622 one.
9623 """
54f9ee45 9624 return _core_.Window_SetHelpTextForId(*args, **kwargs)
e811c8ce 9625
b850e7f3
RD
9626 def GetHelpTextAtPoint(*args, **kwargs):
9627 """
9628 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
9629
9630 Get the help string associated with the given position in this window.
9631
9632 Notice that pt may be invalid if event origin is keyboard or unknown
9633 and this method should return the global window help text then
9634
9635 """
9636 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
9637
e811c8ce 9638 def GetHelpText(*args, **kwargs):
15afbcd0 9639 """
a95a7133 9640 GetHelpText(self) -> String
15afbcd0
RD
9641
9642 Gets the help text to be used as context-sensitive help for this
9643 window. Note that the text is actually stored by the current
f52cbe90 9644 `wx.HelpProvider` implementation, and not in the window object itself.
15afbcd0 9645 """
54f9ee45 9646 return _core_.Window_GetHelpText(*args, **kwargs)
e811c8ce
RD
9647
9648 def SetToolTipString(*args, **kwargs):
15afbcd0 9649 """
a95a7133 9650 SetToolTipString(self, String tip)
15afbcd0
RD
9651
9652 Attach a tooltip to the window.
9653 """
54f9ee45 9654 return _core_.Window_SetToolTipString(*args, **kwargs)
e811c8ce
RD
9655
9656 def SetToolTip(*args, **kwargs):
15afbcd0 9657 """
a95a7133 9658 SetToolTip(self, ToolTip tip)
15afbcd0
RD
9659
9660 Attach a tooltip to the window.
9661 """
54f9ee45 9662 return _core_.Window_SetToolTip(*args, **kwargs)
e811c8ce
RD
9663
9664 def GetToolTip(*args, **kwargs):
15afbcd0 9665 """
a95a7133 9666 GetToolTip(self) -> ToolTip
15afbcd0
RD
9667
9668 get the associated tooltip or None if none
9669 """
54f9ee45 9670 return _core_.Window_GetToolTip(*args, **kwargs)
e811c8ce
RD
9671
9672 def SetDropTarget(*args, **kwargs):
15afbcd0 9673 """
a95a7133 9674 SetDropTarget(self, DropTarget dropTarget)
15afbcd0
RD
9675
9676 Associates a drop target with this window. If the window already has
9677 a drop target, it is deleted.
9678 """
54f9ee45 9679 return _core_.Window_SetDropTarget(*args, **kwargs)
e811c8ce
RD
9680
9681 def GetDropTarget(*args, **kwargs):
15afbcd0 9682 """
a95a7133 9683 GetDropTarget(self) -> DropTarget
15afbcd0
RD
9684
9685 Returns the associated drop target, which may be None.
9686 """
54f9ee45 9687 return _core_.Window_GetDropTarget(*args, **kwargs)
e811c8ce 9688
5ba5649b
RD
9689 def DragAcceptFiles(*args, **kwargs):
9690 """
9691 DragAcceptFiles(self, bool accept)
9692
9693 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
9694 Only functional on Windows.
9695 """
9696 return _core_.Window_DragAcceptFiles(*args, **kwargs)
9697
e811c8ce 9698 def SetConstraints(*args, **kwargs):
15afbcd0 9699 """
a95a7133 9700 SetConstraints(self, LayoutConstraints constraints)
15afbcd0
RD
9701
9702 Sets the window to have the given layout constraints. If an existing
9703 layout constraints object is already owned by the window, it will be
9704 deleted. Pass None to disassociate and delete the window's current
9705 constraints.
9706
9707 You must call SetAutoLayout to tell a window to use the constraints
9708 automatically in its default EVT_SIZE handler; otherwise, you must
9709 handle EVT_SIZE yourself and call Layout() explicitly. When setting
9710 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
9711 effect.
9712 """
54f9ee45 9713 return _core_.Window_SetConstraints(*args, **kwargs)
e811c8ce
RD
9714
9715 def GetConstraints(*args, **kwargs):
15afbcd0 9716 """
a95a7133 9717 GetConstraints(self) -> LayoutConstraints
15afbcd0
RD
9718
9719 Returns a pointer to the window's layout constraints, or None if there
9720 are none.
9721 """
54f9ee45 9722 return _core_.Window_GetConstraints(*args, **kwargs)
e811c8ce
RD
9723
9724 def SetAutoLayout(*args, **kwargs):
15afbcd0 9725 """
a95a7133 9726 SetAutoLayout(self, bool autoLayout)
15afbcd0
RD
9727
9728 Determines whether the Layout function will be called automatically
b1fcee84
RD
9729 when the window is resized. lease note that this only happens for the
9730 windows usually used to contain children, namely `wx.Panel` and
9731 `wx.TopLevelWindow` (and the classes deriving from them).
9732
9733 This method is called implicitly by `SetSizer` but if you use
9734 `SetConstraints` you should call it manually or otherwise the window
9735 layout won't be correctly updated when its size changes.
15afbcd0 9736 """
54f9ee45 9737 return _core_.Window_SetAutoLayout(*args, **kwargs)
e811c8ce
RD
9738
9739 def GetAutoLayout(*args, **kwargs):
15afbcd0 9740 """
a95a7133 9741 GetAutoLayout(self) -> bool
15afbcd0
RD
9742
9743 Returns the current autoLayout setting
9744 """
54f9ee45 9745 return _core_.Window_GetAutoLayout(*args, **kwargs)
e811c8ce
RD
9746
9747 def Layout(*args, **kwargs):
15afbcd0 9748 """
a95a7133 9749 Layout(self) -> bool
15afbcd0
RD
9750
9751 Invokes the constraint-based layout algorithm or the sizer-based
9752 algorithm for this window. See SetAutoLayout: when auto layout is on,
9753 this function gets called automatically by the default EVT_SIZE
9754 handler when the window is resized.
9755 """
54f9ee45 9756 return _core_.Window_Layout(*args, **kwargs)
e811c8ce
RD
9757
9758 def SetSizer(*args, **kwargs):
15afbcd0 9759 """
a95a7133 9760 SetSizer(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
9761
9762 Sets the window to have the given layout sizer. The window will then
9763 own the object, and will take care of its deletion. If an existing
9764 layout sizer object is already owned by the window, it will be deleted
9765 if the deleteOld parameter is true. Note that this function will also
9766 call SetAutoLayout implicitly with a True parameter if the sizer is
ae8162c8 9767 non-None, and False otherwise.
15afbcd0 9768 """
54f9ee45 9769 return _core_.Window_SetSizer(*args, **kwargs)
e811c8ce
RD
9770
9771 def SetSizerAndFit(*args, **kwargs):
15afbcd0 9772 """
a95a7133 9773 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
15afbcd0
RD
9774
9775 The same as SetSizer, except it also sets the size hints for the
9776 window based on the sizer's minimum size.
9777 """
54f9ee45 9778 return _core_.Window_SetSizerAndFit(*args, **kwargs)
e811c8ce
RD
9779
9780 def GetSizer(*args, **kwargs):
15afbcd0 9781 """
a95a7133 9782 GetSizer(self) -> Sizer
15afbcd0
RD
9783
9784 Return the sizer associated with the window by a previous call to
9785 SetSizer or None if there isn't one.
9786 """
54f9ee45 9787 return _core_.Window_GetSizer(*args, **kwargs)
e811c8ce
RD
9788
9789 def SetContainingSizer(*args, **kwargs):
15afbcd0 9790 """
a95a7133 9791 SetContainingSizer(self, Sizer sizer)
15afbcd0
RD
9792
9793 This normally does not need to be called by application code. It is
9794 called internally when a window is added to a sizer, and is used so
9795 the window can remove itself from the sizer when it is destroyed.
9796 """
54f9ee45 9797 return _core_.Window_SetContainingSizer(*args, **kwargs)
e811c8ce
RD
9798
9799 def GetContainingSizer(*args, **kwargs):
15afbcd0 9800 """
a95a7133 9801 GetContainingSizer(self) -> Sizer
15afbcd0
RD
9802
9803 Return the sizer that this window is a member of, if any, otherwise None.
9804 """
54f9ee45 9805 return _core_.Window_GetContainingSizer(*args, **kwargs)
e811c8ce 9806
a95a7133
RD
9807 def InheritAttributes(*args, **kwargs):
9808 """
9809 InheritAttributes(self)
9810
41e2b43e
RD
9811 This function is (or should be, in case of custom controls) called
9812 during window creation to intelligently set up the window visual
9813 attributes, that is the font and the foreground and background
9814 colours.
9815
9816 By 'intelligently' the following is meant: by default, all windows use
9817 their own default attributes. However if some of the parent's
9818 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 9819 SetOwnFont) and if the corresponding attribute hadn't been
41e2b43e
RD
9820 explicitly set for this window itself, then this window takes the same
9821 value as used by the parent. In addition, if the window overrides
9822 ShouldInheritColours to return false, the colours will not be changed
9823 no matter what and only the font might.
9824
34621cc5 9825 This rather complicated logic is necessary in order to accommodate the
ec9b55ca 9826 different usage scenarios. The most common one is when all default
41e2b43e
RD
9827 attributes are used and in this case, nothing should be inherited as
9828 in modern GUIs different controls use different fonts (and colours)
9829 than their siblings so they can't inherit the same value from the
9830 parent. However it was also deemed desirable to allow to simply change
9831 the attributes of all children at once by just changing the font or
9832 colour of their common parent, hence in this case we do inherit the
9833 parents attributes.
9834
a95a7133 9835 """
54f9ee45 9836 return _core_.Window_InheritAttributes(*args, **kwargs)
a95a7133
RD
9837
9838 def ShouldInheritColours(*args, **kwargs):
9839 """
9840 ShouldInheritColours(self) -> bool
9841
9842 Return true from here to allow the colours of this window to be
41e2b43e
RD
9843 changed by InheritAttributes, returning false forbids inheriting them
9844 from the parent window.
a95a7133 9845
41e2b43e
RD
9846 The base class version returns false, but this method is overridden in
9847 wxControl where it returns true.
a95a7133 9848 """
54f9ee45 9849 return _core_.Window_ShouldInheritColours(*args, **kwargs)
a95a7133 9850
fc46b7f3
RD
9851 def CanSetTransparent(*args, **kwargs):
9852 """
9853 CanSetTransparent(self) -> bool
9854
9855 Returns ``True`` if the platform supports setting the transparency for
9856 this window. Note that this method will err on the side of caution,
9857 so it is possible that this will return ``False`` when it is in fact
9858 possible to set the transparency.
9859
9860 NOTE: On X-windows systems the X server must have the composite
9861 extension loaded, and there must be a composite manager program (such
9862 as xcompmgr) running.
9863 """
9864 return _core_.Window_CanSetTransparent(*args, **kwargs)
9865
9866 def SetTransparent(*args, **kwargs):
9867 """
9868 SetTransparent(self, byte alpha) -> bool
9869
9870 Attempt to set the transparency of this window to the ``alpha`` value,
9871 returns True on success. The ``alpha`` value is an integer in the
9872 range of 0 to 255, where 0 is fully transparent and 255 is fully
9873 opaque.
9874 """
9875 return _core_.Window_SetTransparent(*args, **kwargs)
9876
e811c8ce 9877 def PostCreate(self, pre):
15afbcd0
RD
9878 """
9879 Phase 3 of the 2-phase create <wink!>
9880 Call this method after precreating the window with the 2-phase create method.
9881 """
e811c8ce
RD
9882 self.this = pre.this
9883 self.thisown = pre.thisown
9884 pre.thisown = 0
9885 if hasattr(self, '_setOORInfo'):
9886 self._setOORInfo(self)
9887 if hasattr(self, '_setCallbackInfo'):
9888 self._setCallbackInfo(self, self.__class__)
9889
7e08d4ef 9890 def SendSizeEvent(self):
453fb36b 9891 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
7e08d4ef 9892
2bf58437
RD
9893 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
9894 AdjustedBestSize = property(GetAdjustedBestSize,doc="See `GetAdjustedBestSize`")
9895 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
9896 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
9897 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
9898 BestFittingSize = property(GetBestFittingSize,SetBestFittingSize,doc="See `GetBestFittingSize` and `SetBestFittingSize`")
9899 BestSize = property(GetBestSize,doc="See `GetBestSize`")
9900 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
9901 Border = property(GetBorder,doc="See `GetBorder`")
9902 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
9903 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
9904 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
9905 Children = property(GetChildren,doc="See `GetChildren`")
9906 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
9907 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
9908 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
9909 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
9910 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
9911 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
9912 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
9913 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
9914 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
9915 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
9916 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
9917 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
2bf58437
RD
9918 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
9919 Handle = property(GetHandle,doc="See `GetHandle`")
9920 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
2bf58437
RD
9921 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
9922 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
9923 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
9924 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
9925 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
9926 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
9927 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
9928 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
9929 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
9930 Parent = property(GetParent,doc="See `GetParent`")
9931 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
9932 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
9933 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
9934 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
2bf58437
RD
9935 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
9936 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
2bf58437
RD
9937 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
9938 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
9939 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
9940 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
9941 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
9942 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
9943 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
9944 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
9945 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
97ab0f6a
RD
9946 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
9947 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
9948 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
2131d850 9949_core_.Window_swigregister(Window)
e811c8ce
RD
9950
9951def PreWindow(*args, **kwargs):
15afbcd0
RD
9952 """
9953 PreWindow() -> Window
9954
9955 Precreate a Window for 2-phase creation.
9956 """
54f9ee45 9957 val = _core_.new_PreWindow(*args, **kwargs)
e811c8ce
RD
9958 return val
9959
0085ce49
RD
9960def Window_NewControlId(*args):
9961 """
15afbcd0
RD
9962 Window_NewControlId() -> int
9963
9964 Generate a control id for the controls which were not given one.
9965 """
0085ce49 9966 return _core_.Window_NewControlId(*args)
e811c8ce
RD
9967
9968def Window_NextControlId(*args, **kwargs):
0085ce49 9969 """
15afbcd0
RD
9970 Window_NextControlId(int winid) -> int
9971
9972 Get the id of the control following the one with the given
41e2b43e 9973 autogenerated) id
15afbcd0 9974 """
0085ce49 9975 return _core_.Window_NextControlId(*args, **kwargs)
e811c8ce
RD
9976
9977def Window_PrevControlId(*args, **kwargs):
0085ce49 9978 """
15afbcd0
RD
9979 Window_PrevControlId(int winid) -> int
9980
9981 Get the id of the control preceding the one with the given
41e2b43e 9982 autogenerated) id
15afbcd0 9983 """
0085ce49 9984 return _core_.Window_PrevControlId(*args, **kwargs)
e811c8ce 9985
0085ce49
RD
9986def Window_FindFocus(*args):
9987 """
15afbcd0
RD
9988 Window_FindFocus() -> Window
9989
9990 Returns the window or control that currently has the keyboard focus,
9991 or None.
9992 """
0085ce49 9993 return _core_.Window_FindFocus(*args)
e811c8ce 9994
0085ce49
RD
9995def Window_GetCapture(*args):
9996 """
15afbcd0
RD
9997 Window_GetCapture() -> Window
9998
9999 Returns the window which currently captures the mouse or None
10000 """
0085ce49 10001 return _core_.Window_GetCapture(*args)
e811c8ce 10002
74a57fcd 10003def Window_GetClassDefaultAttributes(*args, **kwargs):
0085ce49 10004 """
74a57fcd
RD
10005 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10006
41e2b43e
RD
10007 Get the default attributes for this class. This is useful if you want
10008 to use the same font or colour in your own control as in a standard
10009 control -- which is a much better idea than hard coding specific
db3e571a
RD
10010 colours or fonts which might look completely out of place on the
10011 user's system, especially if it uses themes.
74a57fcd
RD
10012
10013 The variant parameter is only relevant under Mac currently and is
41e2b43e 10014 ignore under other platforms. Under Mac, it will change the size of
db3e571a
RD
10015 the returned font. See `wx.Window.SetWindowVariant` for more about
10016 this.
74a57fcd 10017 """
0085ce49 10018 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 10019
e811c8ce 10020def DLG_PNT(win, point_or_x, y=None):
15afbcd0
RD
10021 """
10022 Convenience function for converting a Point or (x,y) in
10023 dialog units to pixel units.
10024 """
e811c8ce
RD
10025 if y is None:
10026 return win.ConvertDialogPointToPixels(point_or_x)
10027 else:
fd3f2efe 10028 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
e811c8ce
RD
10029
10030def DLG_SZE(win, size_width, height=None):
15afbcd0
RD
10031 """
10032 Convenience function for converting a Size or (w,h) in
10033 dialog units to pixel units.
10034 """
e811c8ce
RD
10035 if height is None:
10036 return win.ConvertDialogSizeToPixels(size_width)
10037 else:
fd3f2efe 10038 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
e811c8ce
RD
10039
10040
10041def FindWindowById(*args, **kwargs):
0085ce49 10042 """
15afbcd0
RD
10043 FindWindowById(long id, Window parent=None) -> Window
10044
10045 Find the first window in the application with the given id. If parent
10046 is None, the search will start from all top-level frames and dialog
10047 boxes; if non-None, the search will be limited to the given window
10048 hierarchy. The search is recursive in both cases.
10049 """
0085ce49 10050 return _core_.FindWindowById(*args, **kwargs)
e811c8ce
RD
10051
10052def FindWindowByName(*args, **kwargs):
0085ce49 10053 """
15afbcd0
RD
10054 FindWindowByName(String name, Window parent=None) -> Window
10055
10056 Find a window by its name (as given in a window constructor or Create
10057 function call). If parent is None, the search will start from all
10058 top-level frames and dialog boxes; if non-None, the search will be
10059 limited to the given window hierarchy. The search is recursive in both
10060 cases.
10061
10062 If no window with such name is found, wx.FindWindowByLabel is called.
10063 """
0085ce49 10064 return _core_.FindWindowByName(*args, **kwargs)
e811c8ce
RD
10065
10066def FindWindowByLabel(*args, **kwargs):
0085ce49 10067 """
15afbcd0
RD
10068 FindWindowByLabel(String label, Window parent=None) -> Window
10069
10070 Find a window by its label. Depending on the type of window, the label
10071 may be a window title or panel item label. If parent is None, the
10072 search will start from all top-level frames and dialog boxes; if
10073 non-None, the search will be limited to the given window
10074 hierarchy. The search is recursive in both cases.
10075 """
0085ce49 10076 return _core_.FindWindowByLabel(*args, **kwargs)
e811c8ce
RD
10077
10078def Window_FromHWND(*args, **kwargs):
0085ce49
RD
10079 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10080 return _core_.Window_FromHWND(*args, **kwargs)
b6b0383e 10081
0085ce49
RD
10082def GetTopLevelWindows(*args):
10083 """
b6b0383e
RD
10084 GetTopLevelWindows() -> PyObject
10085
10086 Returns a list of the the application's top-level windows, (frames,
10087 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10088 by wxWidgets, and so it is only valid as long as no top-level windows
10089 are closed or new top-level windows are created.
10090
10091 """
0085ce49 10092 return _core_.GetTopLevelWindows(*args)
e811c8ce
RD
10093#---------------------------------------------------------------------------
10094
10095class Validator(EvtHandler):
093d3ff1 10096 """Proxy of C++ Validator class"""
0085ce49
RD
10097 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10098 __repr__ = _swig_repr
10099 def __init__(self, *args, **kwargs):
a95a7133 10100 """__init__(self) -> Validator"""
0085ce49 10101 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d14a1e28 10102 self._setOORInfo(self)
e811c8ce
RD
10103
10104 def Clone(*args, **kwargs):
a95a7133 10105 """Clone(self) -> Validator"""
54f9ee45 10106 return _core_.Validator_Clone(*args, **kwargs)
e811c8ce
RD
10107
10108 def Validate(*args, **kwargs):
a95a7133 10109 """Validate(self, Window parent) -> bool"""
54f9ee45 10110 return _core_.Validator_Validate(*args, **kwargs)
e811c8ce
RD
10111
10112 def TransferToWindow(*args, **kwargs):
a95a7133 10113 """TransferToWindow(self) -> bool"""
54f9ee45 10114 return _core_.Validator_TransferToWindow(*args, **kwargs)
e811c8ce
RD
10115
10116 def TransferFromWindow(*args, **kwargs):
a95a7133 10117 """TransferFromWindow(self) -> bool"""
54f9ee45 10118 return _core_.Validator_TransferFromWindow(*args, **kwargs)
e811c8ce
RD
10119
10120 def GetWindow(*args, **kwargs):
a95a7133 10121 """GetWindow(self) -> Window"""
54f9ee45 10122 return _core_.Validator_GetWindow(*args, **kwargs)
e811c8ce
RD
10123
10124 def SetWindow(*args, **kwargs):
a95a7133 10125 """SetWindow(self, Window window)"""
54f9ee45 10126 return _core_.Validator_SetWindow(*args, **kwargs)
e811c8ce
RD
10127
10128 def IsSilent(*args, **kwargs):
66c033b4 10129 """IsSilent() -> bool"""
54f9ee45 10130 return _core_.Validator_IsSilent(*args, **kwargs)
e811c8ce
RD
10131
10132 IsSilent = staticmethod(IsSilent)
10133 def SetBellOnError(*args, **kwargs):
66c033b4 10134 """SetBellOnError(int doIt=True)"""
54f9ee45 10135 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
10136
10137 SetBellOnError = staticmethod(SetBellOnError)
2131d850 10138_core_.Validator_swigregister(Validator)
e811c8ce 10139
0085ce49
RD
10140def Validator_IsSilent(*args):
10141 """Validator_IsSilent() -> bool"""
10142 return _core_.Validator_IsSilent(*args)
e811c8ce
RD
10143
10144def Validator_SetBellOnError(*args, **kwargs):
0085ce49
RD
10145 """Validator_SetBellOnError(int doIt=True)"""
10146 return _core_.Validator_SetBellOnError(*args, **kwargs)
e811c8ce
RD
10147
10148class PyValidator(Validator):
093d3ff1 10149 """Proxy of C++ PyValidator class"""
0085ce49
RD
10150 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10151 __repr__ = _swig_repr
10152 def __init__(self, *args, **kwargs):
a95a7133 10153 """__init__(self) -> PyValidator"""
0085ce49 10154 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
e811c8ce
RD
10155
10156 self._setCallbackInfo(self, PyValidator, 1)
10157 self._setOORInfo(self)
10158
10159 def _setCallbackInfo(*args, **kwargs):
a95a7133 10160 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=True)"""
54f9ee45 10161 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
e811c8ce 10162
2131d850 10163_core_.PyValidator_swigregister(PyValidator)
e811c8ce
RD
10164
10165#---------------------------------------------------------------------------
10166
10167class Menu(EvtHandler):
093d3ff1 10168 """Proxy of C++ Menu class"""
0085ce49
RD
10169 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10170 __repr__ = _swig_repr
10171 def __init__(self, *args, **kwargs):
a95a7133 10172 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
0085ce49 10173 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
e811c8ce
RD
10174 self._setOORInfo(self)
10175
10176 def Append(*args, **kwargs):
97ab0f6a
RD
10177 """
10178 Append(self, int id, String text=EmptyString, String help=EmptyString,
10179 int kind=ITEM_NORMAL) -> MenuItem
10180 """
54f9ee45 10181 return _core_.Menu_Append(*args, **kwargs)
e811c8ce
RD
10182
10183 def AppendSeparator(*args, **kwargs):
a95a7133 10184 """AppendSeparator(self) -> MenuItem"""
54f9ee45 10185 return _core_.Menu_AppendSeparator(*args, **kwargs)
e811c8ce
RD
10186
10187 def AppendCheckItem(*args, **kwargs):
a95a7133 10188 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10189 return _core_.Menu_AppendCheckItem(*args, **kwargs)
e811c8ce
RD
10190
10191 def AppendRadioItem(*args, **kwargs):
a95a7133 10192 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10193 return _core_.Menu_AppendRadioItem(*args, **kwargs)
e811c8ce
RD
10194
10195 def AppendMenu(*args, **kwargs):
a95a7133 10196 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10197 return _core_.Menu_AppendMenu(*args, **kwargs)
e811c8ce 10198
50efceee
RD
10199 def AppendSubMenu(*args, **kwargs):
10200 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10201 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10202
e811c8ce 10203 def AppendItem(*args, **kwargs):
a95a7133 10204 """AppendItem(self, MenuItem item) -> MenuItem"""
54f9ee45 10205 return _core_.Menu_AppendItem(*args, **kwargs)
e811c8ce 10206
e811c8ce 10207 def InsertItem(*args, **kwargs):
a95a7133 10208 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
54f9ee45 10209 return _core_.Menu_InsertItem(*args, **kwargs)
e811c8ce 10210
0085ce49
RD
10211 def PrependItem(*args, **kwargs):
10212 """PrependItem(self, MenuItem item) -> MenuItem"""
10213 return _core_.Menu_PrependItem(*args, **kwargs)
10214
10215 def Break(*args, **kwargs):
10216 """Break(self)"""
10217 return _core_.Menu_Break(*args, **kwargs)
10218
e811c8ce 10219 def Insert(*args, **kwargs):
0df68c9f 10220 """
97ab0f6a 10221 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
a41e16b6 10222 int kind=ITEM_NORMAL) -> MenuItem
0df68c9f 10223 """
54f9ee45 10224 return _core_.Menu_Insert(*args, **kwargs)
e811c8ce
RD
10225
10226 def InsertSeparator(*args, **kwargs):
a95a7133 10227 """InsertSeparator(self, size_t pos) -> MenuItem"""
54f9ee45 10228 return _core_.Menu_InsertSeparator(*args, **kwargs)
e811c8ce
RD
10229
10230 def InsertCheckItem(*args, **kwargs):
a95a7133 10231 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10232 return _core_.Menu_InsertCheckItem(*args, **kwargs)
e811c8ce
RD
10233
10234 def InsertRadioItem(*args, **kwargs):
a95a7133 10235 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10236 return _core_.Menu_InsertRadioItem(*args, **kwargs)
e811c8ce
RD
10237
10238 def InsertMenu(*args, **kwargs):
a95a7133 10239 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10240 return _core_.Menu_InsertMenu(*args, **kwargs)
e811c8ce 10241
e811c8ce 10242 def Prepend(*args, **kwargs):
97ab0f6a
RD
10243 """
10244 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10245 int kind=ITEM_NORMAL) -> MenuItem
10246 """
54f9ee45 10247 return _core_.Menu_Prepend(*args, **kwargs)
e811c8ce
RD
10248
10249 def PrependSeparator(*args, **kwargs):
a95a7133 10250 """PrependSeparator(self) -> MenuItem"""
54f9ee45 10251 return _core_.Menu_PrependSeparator(*args, **kwargs)
e811c8ce
RD
10252
10253 def PrependCheckItem(*args, **kwargs):
a95a7133 10254 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10255 return _core_.Menu_PrependCheckItem(*args, **kwargs)
e811c8ce
RD
10256
10257 def PrependRadioItem(*args, **kwargs):
a95a7133 10258 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
54f9ee45 10259 return _core_.Menu_PrependRadioItem(*args, **kwargs)
e811c8ce
RD
10260
10261 def PrependMenu(*args, **kwargs):
a95a7133 10262 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
54f9ee45 10263 return _core_.Menu_PrependMenu(*args, **kwargs)
e811c8ce
RD
10264
10265 def Remove(*args, **kwargs):
a95a7133 10266 """Remove(self, int id) -> MenuItem"""
54f9ee45 10267 return _core_.Menu_Remove(*args, **kwargs)
e811c8ce
RD
10268
10269 def RemoveItem(*args, **kwargs):
a95a7133 10270 """RemoveItem(self, MenuItem item) -> MenuItem"""
54f9ee45 10271 return _core_.Menu_RemoveItem(*args, **kwargs)
e811c8ce
RD
10272
10273 def Delete(*args, **kwargs):
a95a7133 10274 """Delete(self, int id) -> bool"""
54f9ee45 10275 return _core_.Menu_Delete(*args, **kwargs)
e811c8ce
RD
10276
10277 def DeleteItem(*args, **kwargs):
a95a7133 10278 """DeleteItem(self, MenuItem item) -> bool"""
54f9ee45 10279 return _core_.Menu_DeleteItem(*args, **kwargs)
e811c8ce
RD
10280
10281 def Destroy(*args, **kwargs):
0df68c9f 10282 """
a95a7133 10283 Destroy(self)
e811c8ce 10284
0df68c9f
RD
10285 Deletes the C++ object this Python object is a proxy for.
10286 """
7e08d4ef
RD
10287 val = _core_.Menu_Destroy(*args, **kwargs)
10288 args[0].thisown = 0
10289 return val
e811c8ce
RD
10290
10291 def DestroyId(*args, **kwargs):
0df68c9f 10292 """
a95a7133 10293 DestroyId(self, int id) -> bool
e811c8ce 10294
0df68c9f
RD
10295 Deletes the C++ object this Python object is a proxy for.
10296 """
7e08d4ef
RD
10297 val = _core_.Menu_DestroyId(*args, **kwargs)
10298 args[0].thisown = 0
10299 return val
e811c8ce
RD
10300
10301 def DestroyItem(*args, **kwargs):
0df68c9f 10302 """
a95a7133 10303 DestroyItem(self, MenuItem item) -> bool
e811c8ce 10304
0df68c9f
RD
10305 Deletes the C++ object this Python object is a proxy for.
10306 """
7e08d4ef
RD
10307 val = _core_.Menu_DestroyItem(*args, **kwargs)
10308 args[0].thisown = 0
10309 return val
e811c8ce
RD
10310
10311 def GetMenuItemCount(*args, **kwargs):
a95a7133 10312 """GetMenuItemCount(self) -> size_t"""
54f9ee45 10313 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
e811c8ce
RD
10314
10315 def GetMenuItems(*args, **kwargs):
a95a7133 10316 """GetMenuItems(self) -> PyObject"""
54f9ee45 10317 return _core_.Menu_GetMenuItems(*args, **kwargs)
e811c8ce
RD
10318
10319 def FindItem(*args, **kwargs):
a95a7133 10320 """FindItem(self, String item) -> int"""
54f9ee45 10321 return _core_.Menu_FindItem(*args, **kwargs)
e811c8ce
RD
10322
10323 def FindItemById(*args, **kwargs):
a95a7133 10324 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 10325 return _core_.Menu_FindItemById(*args, **kwargs)
e811c8ce
RD
10326
10327 def FindItemByPosition(*args, **kwargs):
a95a7133 10328 """FindItemByPosition(self, size_t position) -> MenuItem"""
54f9ee45 10329 return _core_.Menu_FindItemByPosition(*args, **kwargs)
e811c8ce
RD
10330
10331 def Enable(*args, **kwargs):
a95a7133 10332 """Enable(self, int id, bool enable)"""
54f9ee45 10333 return _core_.Menu_Enable(*args, **kwargs)
e811c8ce
RD
10334
10335 def IsEnabled(*args, **kwargs):
a95a7133 10336 """IsEnabled(self, int id) -> bool"""
54f9ee45 10337 return _core_.Menu_IsEnabled(*args, **kwargs)
e811c8ce
RD
10338
10339 def Check(*args, **kwargs):
a95a7133 10340 """Check(self, int id, bool check)"""
54f9ee45 10341 return _core_.Menu_Check(*args, **kwargs)
e811c8ce
RD
10342
10343 def IsChecked(*args, **kwargs):
a95a7133 10344 """IsChecked(self, int id) -> bool"""
54f9ee45 10345 return _core_.Menu_IsChecked(*args, **kwargs)
e811c8ce
RD
10346
10347 def SetLabel(*args, **kwargs):
a95a7133 10348 """SetLabel(self, int id, String label)"""
54f9ee45 10349 return _core_.Menu_SetLabel(*args, **kwargs)
e811c8ce
RD
10350
10351 def GetLabel(*args, **kwargs):
a95a7133 10352 """GetLabel(self, int id) -> String"""
54f9ee45 10353 return _core_.Menu_GetLabel(*args, **kwargs)
e811c8ce
RD
10354
10355 def SetHelpString(*args, **kwargs):
a95a7133 10356 """SetHelpString(self, int id, String helpString)"""
54f9ee45 10357 return _core_.Menu_SetHelpString(*args, **kwargs)
e811c8ce
RD
10358
10359 def GetHelpString(*args, **kwargs):
a95a7133 10360 """GetHelpString(self, int id) -> String"""
54f9ee45 10361 return _core_.Menu_GetHelpString(*args, **kwargs)
e811c8ce
RD
10362
10363 def SetTitle(*args, **kwargs):
a95a7133 10364 """SetTitle(self, String title)"""
54f9ee45 10365 return _core_.Menu_SetTitle(*args, **kwargs)
e811c8ce
RD
10366
10367 def GetTitle(*args, **kwargs):
a95a7133 10368 """GetTitle(self) -> String"""
54f9ee45 10369 return _core_.Menu_GetTitle(*args, **kwargs)
e811c8ce
RD
10370
10371 def SetEventHandler(*args, **kwargs):
a95a7133 10372 """SetEventHandler(self, EvtHandler handler)"""
54f9ee45 10373 return _core_.Menu_SetEventHandler(*args, **kwargs)
e811c8ce
RD
10374
10375 def GetEventHandler(*args, **kwargs):
a95a7133 10376 """GetEventHandler(self) -> EvtHandler"""
54f9ee45 10377 return _core_.Menu_GetEventHandler(*args, **kwargs)
e811c8ce
RD
10378
10379 def SetInvokingWindow(*args, **kwargs):
a95a7133 10380 """SetInvokingWindow(self, Window win)"""
54f9ee45 10381 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
e811c8ce
RD
10382
10383 def GetInvokingWindow(*args, **kwargs):
a95a7133 10384 """GetInvokingWindow(self) -> Window"""
54f9ee45 10385 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
e811c8ce
RD
10386
10387 def GetStyle(*args, **kwargs):
a95a7133 10388 """GetStyle(self) -> long"""
54f9ee45 10389 return _core_.Menu_GetStyle(*args, **kwargs)
e811c8ce
RD
10390
10391 def UpdateUI(*args, **kwargs):
a95a7133 10392 """UpdateUI(self, EvtHandler source=None)"""
54f9ee45 10393 return _core_.Menu_UpdateUI(*args, **kwargs)
e811c8ce
RD
10394
10395 def GetMenuBar(*args, **kwargs):
a95a7133 10396 """GetMenuBar(self) -> MenuBar"""
54f9ee45 10397 return _core_.Menu_GetMenuBar(*args, **kwargs)
e811c8ce
RD
10398
10399 def Attach(*args, **kwargs):
a95a7133 10400 """Attach(self, wxMenuBarBase menubar)"""
54f9ee45 10401 return _core_.Menu_Attach(*args, **kwargs)
e811c8ce
RD
10402
10403 def Detach(*args, **kwargs):
a95a7133 10404 """Detach(self)"""
54f9ee45 10405 return _core_.Menu_Detach(*args, **kwargs)
e811c8ce
RD
10406
10407 def IsAttached(*args, **kwargs):
a95a7133 10408 """IsAttached(self) -> bool"""
54f9ee45 10409 return _core_.Menu_IsAttached(*args, **kwargs)
e811c8ce
RD
10410
10411 def SetParent(*args, **kwargs):
a95a7133 10412 """SetParent(self, Menu parent)"""
54f9ee45 10413 return _core_.Menu_SetParent(*args, **kwargs)
e811c8ce
RD
10414
10415 def GetParent(*args, **kwargs):
a95a7133 10416 """GetParent(self) -> Menu"""
54f9ee45 10417 return _core_.Menu_GetParent(*args, **kwargs)
e811c8ce 10418
57332a5a
RD
10419 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10420 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
10421 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
10422 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
10423 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
10424 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
10425 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
10426 Style = property(GetStyle,doc="See `GetStyle`")
10427 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
2131d850 10428_core_.Menu_swigregister(Menu)
d14a1e28
RD
10429DefaultValidator = cvar.DefaultValidator
10430
10431#---------------------------------------------------------------------------
10432
10433class MenuBar(Window):
093d3ff1 10434 """Proxy of C++ MenuBar class"""
0085ce49
RD
10435 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10436 __repr__ = _swig_repr
10437 def __init__(self, *args, **kwargs):
a95a7133 10438 """__init__(self, long style=0) -> MenuBar"""
0085ce49 10439 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d14a1e28 10440 self._setOORInfo(self)
e811c8ce
RD
10441
10442 def Append(*args, **kwargs):
a95a7133 10443 """Append(self, Menu menu, String title) -> bool"""
54f9ee45 10444 return _core_.MenuBar_Append(*args, **kwargs)
e811c8ce
RD
10445
10446 def Insert(*args, **kwargs):
a95a7133 10447 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
54f9ee45 10448 return _core_.MenuBar_Insert(*args, **kwargs)
e811c8ce
RD
10449
10450 def GetMenuCount(*args, **kwargs):
a95a7133 10451 """GetMenuCount(self) -> size_t"""
54f9ee45 10452 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
e811c8ce
RD
10453
10454 def GetMenu(*args, **kwargs):
a95a7133 10455 """GetMenu(self, size_t pos) -> Menu"""
54f9ee45 10456 return _core_.MenuBar_GetMenu(*args, **kwargs)
e811c8ce
RD
10457
10458 def Replace(*args, **kwargs):
a95a7133 10459 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
54f9ee45 10460 return _core_.MenuBar_Replace(*args, **kwargs)
e811c8ce
RD
10461
10462 def Remove(*args, **kwargs):
a95a7133 10463 """Remove(self, size_t pos) -> Menu"""
54f9ee45 10464 return _core_.MenuBar_Remove(*args, **kwargs)
e811c8ce
RD
10465
10466 def EnableTop(*args, **kwargs):
a95a7133 10467 """EnableTop(self, size_t pos, bool enable)"""
54f9ee45 10468 return _core_.MenuBar_EnableTop(*args, **kwargs)
e811c8ce
RD
10469
10470 def IsEnabledTop(*args, **kwargs):
a95a7133 10471 """IsEnabledTop(self, size_t pos) -> bool"""
54f9ee45 10472 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
e811c8ce
RD
10473
10474 def SetLabelTop(*args, **kwargs):
a95a7133 10475 """SetLabelTop(self, size_t pos, String label)"""
54f9ee45 10476 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
e811c8ce
RD
10477
10478 def GetLabelTop(*args, **kwargs):
a95a7133 10479 """GetLabelTop(self, size_t pos) -> String"""
54f9ee45 10480 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
e811c8ce
RD
10481
10482 def FindMenuItem(*args, **kwargs):
a95a7133 10483 """FindMenuItem(self, String menu, String item) -> int"""
54f9ee45 10484 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
e811c8ce
RD
10485
10486 def FindItemById(*args, **kwargs):
a95a7133 10487 """FindItemById(self, int id) -> MenuItem"""
54f9ee45 10488 return _core_.MenuBar_FindItemById(*args, **kwargs)
e811c8ce
RD
10489
10490 def FindMenu(*args, **kwargs):
a95a7133 10491 """FindMenu(self, String title) -> int"""
54f9ee45 10492 return _core_.MenuBar_FindMenu(*args, **kwargs)
e811c8ce
RD
10493
10494 def Enable(*args, **kwargs):
a95a7133 10495 """Enable(self, int id, bool enable)"""
54f9ee45 10496 return _core_.MenuBar_Enable(*args, **kwargs)
e811c8ce
RD
10497
10498 def Check(*args, **kwargs):
a95a7133 10499 """Check(self, int id, bool check)"""
54f9ee45 10500 return _core_.MenuBar_Check(*args, **kwargs)
e811c8ce
RD
10501
10502 def IsChecked(*args, **kwargs):
a95a7133 10503 """IsChecked(self, int id) -> bool"""
54f9ee45 10504 return _core_.MenuBar_IsChecked(*args, **kwargs)
e811c8ce
RD
10505
10506 def IsEnabled(*args, **kwargs):
a95a7133 10507 """IsEnabled(self, int id) -> bool"""
54f9ee45 10508 return _core_.MenuBar_IsEnabled(*args, **kwargs)
e811c8ce
RD
10509
10510 def SetLabel(*args, **kwargs):
a95a7133 10511 """SetLabel(self, int id, String label)"""
54f9ee45 10512 return _core_.MenuBar_SetLabel(*args, **kwargs)
e811c8ce
RD
10513
10514 def GetLabel(*args, **kwargs):
a95a7133 10515 """GetLabel(self, int id) -> String"""
54f9ee45 10516 return _core_.MenuBar_GetLabel(*args, **kwargs)
e811c8ce
RD
10517
10518 def SetHelpString(*args, **kwargs):
a95a7133 10519 """SetHelpString(self, int id, String helpString)"""
54f9ee45 10520 return _core_.MenuBar_SetHelpString(*args, **kwargs)
e811c8ce
RD
10521
10522 def GetHelpString(*args, **kwargs):
a95a7133 10523 """GetHelpString(self, int id) -> String"""
54f9ee45 10524 return _core_.MenuBar_GetHelpString(*args, **kwargs)
e811c8ce
RD
10525
10526 def GetFrame(*args, **kwargs):
a95a7133 10527 """GetFrame(self) -> wxFrame"""
54f9ee45 10528 return _core_.MenuBar_GetFrame(*args, **kwargs)
e811c8ce
RD
10529
10530 def IsAttached(*args, **kwargs):
a95a7133 10531 """IsAttached(self) -> bool"""
54f9ee45 10532 return _core_.MenuBar_IsAttached(*args, **kwargs)
e811c8ce
RD
10533
10534 def Attach(*args, **kwargs):
a95a7133 10535 """Attach(self, wxFrame frame)"""
54f9ee45 10536 return _core_.MenuBar_Attach(*args, **kwargs)
e811c8ce
RD
10537
10538 def Detach(*args, **kwargs):
a95a7133 10539 """Detach(self)"""
54f9ee45 10540 return _core_.MenuBar_Detach(*args, **kwargs)
e811c8ce 10541
587d0f36
RD
10542 def UpdateMenus(*args, **kwargs):
10543 """UpdateMenus(self)"""
10544 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
10545
4f433fef
RD
10546 def SetAutoWindowMenu(*args, **kwargs):
10547 """SetAutoWindowMenu(bool enable)"""
10548 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
10549
10550 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
10551 def GetAutoWindowMenu(*args, **kwargs):
10552 """GetAutoWindowMenu() -> bool"""
10553 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
10554
10555 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
97ab0f6a
RD
10556 def GetMenus(self):
10557 """Return a list of (menu, label) items for the menus in the MenuBar. """
10558 return [(self.GetMenu(i), self.GetLabelTop(i))
10559 for i in range(self.GetMenuCount())]
10560
10561 def SetMenus(self, items):
10562 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
10563 for i in range(self.GetMenuCount()-1, -1, -1):
10564 self.Remove(i)
10565 for m, l in items:
10566 self.Append(m, l)
10567
57332a5a
RD
10568 Frame = property(GetFrame,doc="See `GetFrame`")
10569 Menu = property(GetMenu,doc="See `GetMenu`")
10570 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
10571 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
2131d850 10572_core_.MenuBar_swigregister(MenuBar)
d14a1e28 10573
4f433fef 10574def MenuBar_SetAutoWindowMenu(*args, **kwargs):
0085ce49
RD
10575 """MenuBar_SetAutoWindowMenu(bool enable)"""
10576 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 10577
0085ce49
RD
10578def MenuBar_GetAutoWindowMenu(*args):
10579 """MenuBar_GetAutoWindowMenu() -> bool"""
10580 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 10581
d14a1e28
RD
10582#---------------------------------------------------------------------------
10583
10584class MenuItem(Object):
093d3ff1 10585 """Proxy of C++ MenuItem class"""
0085ce49
RD
10586 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10587 __repr__ = _swig_repr
10588 def __init__(self, *args, **kwargs):
0df68c9f 10589 """
a95a7133 10590 __init__(self, Menu parentMenu=None, int id=ID_ANY, String text=EmptyString,
196addbf
RD
10591 String help=EmptyString, int kind=ITEM_NORMAL,
10592 Menu subMenu=None) -> MenuItem
0df68c9f 10593 """
0085ce49
RD
10594 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
10595 __swig_destroy__ = _core_.delete_MenuItem
10596 __del__ = lambda self : None;
e811c8ce 10597 def GetMenu(*args, **kwargs):
a95a7133 10598 """GetMenu(self) -> Menu"""
54f9ee45 10599 return _core_.MenuItem_GetMenu(*args, **kwargs)
e811c8ce
RD
10600
10601 def SetMenu(*args, **kwargs):
a95a7133 10602 """SetMenu(self, Menu menu)"""
54f9ee45 10603 return _core_.MenuItem_SetMenu(*args, **kwargs)
e811c8ce
RD
10604
10605 def SetId(*args, **kwargs):
a95a7133 10606 """SetId(self, int id)"""
54f9ee45 10607 return _core_.MenuItem_SetId(*args, **kwargs)
e811c8ce
RD
10608
10609 def GetId(*args, **kwargs):
a95a7133 10610 """GetId(self) -> int"""
54f9ee45 10611 return _core_.MenuItem_GetId(*args, **kwargs)
e811c8ce
RD
10612
10613 def IsSeparator(*args, **kwargs):
a95a7133 10614 """IsSeparator(self) -> bool"""
54f9ee45 10615 return _core_.MenuItem_IsSeparator(*args, **kwargs)
e811c8ce
RD
10616
10617 def SetText(*args, **kwargs):
a95a7133 10618 """SetText(self, String str)"""
54f9ee45 10619 return _core_.MenuItem_SetText(*args, **kwargs)
e811c8ce
RD
10620
10621 def GetLabel(*args, **kwargs):
a95a7133 10622 """GetLabel(self) -> String"""
54f9ee45 10623 return _core_.MenuItem_GetLabel(*args, **kwargs)
e811c8ce
RD
10624
10625 def GetText(*args, **kwargs):
a95a7133 10626 """GetText(self) -> String"""
54f9ee45 10627 return _core_.MenuItem_GetText(*args, **kwargs)
e811c8ce
RD
10628
10629 def GetLabelFromText(*args, **kwargs):
66c033b4 10630 """GetLabelFromText(String text) -> String"""
54f9ee45 10631 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
e811c8ce
RD
10632
10633 GetLabelFromText = staticmethod(GetLabelFromText)
10634 def GetKind(*args, **kwargs):
a95a7133 10635 """GetKind(self) -> int"""
54f9ee45 10636 return _core_.MenuItem_GetKind(*args, **kwargs)
e811c8ce 10637
a95a7133
RD
10638 def SetKind(*args, **kwargs):
10639 """SetKind(self, int kind)"""
54f9ee45 10640 return _core_.MenuItem_SetKind(*args, **kwargs)
a95a7133 10641
e811c8ce 10642 def SetCheckable(*args, **kwargs):
a95a7133 10643 """SetCheckable(self, bool checkable)"""
54f9ee45 10644 return _core_.MenuItem_SetCheckable(*args, **kwargs)
e811c8ce
RD
10645
10646 def IsCheckable(*args, **kwargs):
a95a7133 10647 """IsCheckable(self) -> bool"""
54f9ee45 10648 return _core_.MenuItem_IsCheckable(*args, **kwargs)
e811c8ce
RD
10649
10650 def IsSubMenu(*args, **kwargs):
a95a7133 10651 """IsSubMenu(self) -> bool"""
54f9ee45 10652 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
e811c8ce
RD
10653
10654 def SetSubMenu(*args, **kwargs):
a95a7133 10655 """SetSubMenu(self, Menu menu)"""
54f9ee45 10656 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
e811c8ce
RD
10657
10658 def GetSubMenu(*args, **kwargs):
a95a7133 10659 """GetSubMenu(self) -> Menu"""
54f9ee45 10660 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
e811c8ce
RD
10661
10662 def Enable(*args, **kwargs):
a95a7133 10663 """Enable(self, bool enable=True)"""
54f9ee45 10664 return _core_.MenuItem_Enable(*args, **kwargs)
e811c8ce
RD
10665
10666 def IsEnabled(*args, **kwargs):
a95a7133 10667 """IsEnabled(self) -> bool"""
54f9ee45 10668 return _core_.MenuItem_IsEnabled(*args, **kwargs)
e811c8ce
RD
10669
10670 def Check(*args, **kwargs):
a95a7133 10671 """Check(self, bool check=True)"""
54f9ee45 10672 return _core_.MenuItem_Check(*args, **kwargs)
e811c8ce
RD
10673
10674 def IsChecked(*args, **kwargs):
a95a7133 10675 """IsChecked(self) -> bool"""
54f9ee45 10676 return _core_.MenuItem_IsChecked(*args, **kwargs)
e811c8ce
RD
10677
10678 def Toggle(*args, **kwargs):
a95a7133 10679 """Toggle(self)"""
54f9ee45 10680 return _core_.MenuItem_Toggle(*args, **kwargs)
e811c8ce
RD
10681
10682 def SetHelp(*args, **kwargs):
a95a7133 10683 """SetHelp(self, String str)"""
54f9ee45 10684 return _core_.MenuItem_SetHelp(*args, **kwargs)
e811c8ce
RD
10685
10686 def GetHelp(*args, **kwargs):
a95a7133 10687 """GetHelp(self) -> String"""
54f9ee45 10688 return _core_.MenuItem_GetHelp(*args, **kwargs)
e811c8ce
RD
10689
10690 def GetAccel(*args, **kwargs):
a95a7133 10691 """GetAccel(self) -> AcceleratorEntry"""
54f9ee45 10692 return _core_.MenuItem_GetAccel(*args, **kwargs)
e811c8ce
RD
10693
10694 def SetAccel(*args, **kwargs):
a95a7133 10695 """SetAccel(self, AcceleratorEntry accel)"""
54f9ee45 10696 return _core_.MenuItem_SetAccel(*args, **kwargs)
e811c8ce 10697
091f5bed
RD
10698 def SetBitmap(*args, **kwargs):
10699 """SetBitmap(self, Bitmap bitmap)"""
10700 return _core_.MenuItem_SetBitmap(*args, **kwargs)
10701
10702 def GetBitmap(*args, **kwargs):
10703 """GetBitmap(self) -> Bitmap"""
10704 return _core_.MenuItem_GetBitmap(*args, **kwargs)
10705
c1280d1e
RD
10706 def SetFont(*args, **kwargs):
10707 """SetFont(self, Font font)"""
10708 return _core_.MenuItem_SetFont(*args, **kwargs)
10709
10710 def GetFont(*args, **kwargs):
10711 """GetFont(self) -> Font"""
10712 return _core_.MenuItem_GetFont(*args, **kwargs)
10713
10714 def SetTextColour(*args, **kwargs):
10715 """SetTextColour(self, Colour colText)"""
10716 return _core_.MenuItem_SetTextColour(*args, **kwargs)
10717
10718 def GetTextColour(*args, **kwargs):
10719 """GetTextColour(self) -> Colour"""
10720 return _core_.MenuItem_GetTextColour(*args, **kwargs)
10721
10722 def SetBackgroundColour(*args, **kwargs):
10723 """SetBackgroundColour(self, Colour colBack)"""
10724 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
10725
10726 def GetBackgroundColour(*args, **kwargs):
10727 """GetBackgroundColour(self) -> Colour"""
10728 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
10729
10730 def SetBitmaps(*args, **kwargs):
10731 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
10732 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
10733
10734 def SetDisabledBitmap(*args, **kwargs):
10735 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
10736 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
10737
10738 def GetDisabledBitmap(*args, **kwargs):
10739 """GetDisabledBitmap(self) -> Bitmap"""
10740 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
10741
10742 def SetMarginWidth(*args, **kwargs):
10743 """SetMarginWidth(self, int nWidth)"""
10744 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
10745
10746 def GetMarginWidth(*args, **kwargs):
10747 """GetMarginWidth(self) -> int"""
10748 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
10749
e811c8ce 10750 def GetDefaultMarginWidth(*args, **kwargs):
66c033b4 10751 """GetDefaultMarginWidth() -> int"""
54f9ee45 10752 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
e811c8ce
RD
10753
10754 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
10755 def IsOwnerDrawn(*args, **kwargs):
10756 """IsOwnerDrawn(self) -> bool"""
10757 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
10758
10759 def SetOwnerDrawn(*args, **kwargs):
10760 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
10761 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
10762
10763 def ResetOwnerDrawn(*args, **kwargs):
10764 """ResetOwnerDrawn(self)"""
10765 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
10766
57332a5a
RD
10767 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
10768 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10769 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
10770 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
10771 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10772 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
10773 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10774 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
10775 Label = property(GetLabel,doc="See `GetLabel`")
10776 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
10777 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
10778 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
10779 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
10780 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
2131d850 10781_core_.MenuItem_swigregister(MenuItem)
d14a1e28 10782
e811c8ce 10783def MenuItem_GetLabelFromText(*args, **kwargs):
0085ce49
RD
10784 """MenuItem_GetLabelFromText(String text) -> String"""
10785 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d14a1e28 10786
0085ce49
RD
10787def MenuItem_GetDefaultMarginWidth(*args):
10788 """MenuItem_GetDefaultMarginWidth() -> int"""
10789 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d14a1e28
RD
10790
10791#---------------------------------------------------------------------------
10792
10793class Control(Window):
15afbcd0
RD
10794 """
10795 This is the base class for a control or 'widget'.
10796
41e2b43e
RD
10797 A control is generally a small window which processes user input
10798 and/or displays one or more item of data.
15afbcd0 10799 """
0085ce49
RD
10800 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10801 __repr__ = _swig_repr
10802 def __init__(self, *args, **kwargs):
0df68c9f 10803 """
248ed943
RD
10804 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
10805 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 10806 String name=ControlNameStr) -> Control
15afbcd0 10807
41e2b43e
RD
10808 Create a Control. Normally you should only call this from a subclass'
10809 __init__ as a plain old wx.Control is not very useful.
0df68c9f 10810 """
0085ce49 10811 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d14a1e28 10812 self._setOORInfo(self)
e811c8ce
RD
10813
10814 def Create(*args, **kwargs):
0df68c9f 10815 """
248ed943
RD
10816 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
10817 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
b2dc1044 10818 String name=ControlNameStr) -> bool
15afbcd0
RD
10819
10820 Do the 2nd phase and create the GUI control.
0df68c9f 10821 """
54f9ee45 10822 return _core_.Control_Create(*args, **kwargs)
e811c8ce 10823
10044bf1
RD
10824 def GetAlignment(*args, **kwargs):
10825 """
10826 GetAlignment(self) -> int
10827
10828 Get the control alignment (left/right/centre, top/bottom/centre)
10829 """
10830 return _core_.Control_GetAlignment(*args, **kwargs)
10831
34e0a3bb 10832 def GetLabelText(*args, **kwargs):
10044bf1 10833 """
10044bf1
RD
10834 GetLabelText(self) -> String
10835
10836 Get just the text of the label, without mnemonic characters ('&')
10837 """
34e0a3bb 10838 return _core_.Control_GetLabelText(*args, **kwargs)
10044bf1 10839
e811c8ce 10840 def Command(*args, **kwargs):
15afbcd0 10841 """
a95a7133 10842 Command(self, CommandEvent event)
15afbcd0 10843
41e2b43e
RD
10844 Simulates the effect of the user issuing a command to the item.
10845
10846 :see: `wx.CommandEvent`
10847
15afbcd0 10848 """
54f9ee45 10849 return _core_.Control_Command(*args, **kwargs)
e811c8ce
RD
10850
10851 def GetLabel(*args, **kwargs):
15afbcd0 10852 """
a95a7133 10853 GetLabel(self) -> String
15afbcd0
RD
10854
10855 Return a control's text.
10856 """
54f9ee45 10857 return _core_.Control_GetLabel(*args, **kwargs)
e811c8ce 10858
74a57fcd 10859 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0
RD
10860 """
10861 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10862
10863 Get the default attributes for this class. This is useful if you want
10864 to use the same font or colour in your own control as in a standard
10865 control -- which is a much better idea than hard coding specific
10866 colours or fonts which might look completely out of place on the
10867 user's system, especially if it uses themes.
10868
10869 The variant parameter is only relevant under Mac currently and is
10870 ignore under other platforms. Under Mac, it will change the size of
10871 the returned font. See `wx.Window.SetWindowVariant` for more about
10872 this.
10873 """
54f9ee45 10874 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd
RD
10875
10876 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2bf58437
RD
10877 Alignment = property(GetAlignment,doc="See `GetAlignment`")
10878 Label = property(GetLabel,doc="See `GetLabel`")
10879 LabelText = property(GetLabelText,doc="See `GetLabelText`")
2131d850 10880_core_.Control_swigregister(Control)
b2dc1044 10881ControlNameStr = cvar.ControlNameStr
d14a1e28
RD
10882
10883def PreControl(*args, **kwargs):
15afbcd0
RD
10884 """
10885 PreControl() -> Control
10886
10887 Precreate a Control control for 2-phase creation
10888 """
54f9ee45 10889 val = _core_.new_PreControl(*args, **kwargs)
d14a1e28
RD
10890 return val
10891
74a57fcd 10892def Control_GetClassDefaultAttributes(*args, **kwargs):
0085ce49 10893 """
110da5b0
RD
10894 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
10895
10896 Get the default attributes for this class. This is useful if you want
10897 to use the same font or colour in your own control as in a standard
10898 control -- which is a much better idea than hard coding specific
10899 colours or fonts which might look completely out of place on the
10900 user's system, especially if it uses themes.
10901
10902 The variant parameter is only relevant under Mac currently and is
10903 ignore under other platforms. Under Mac, it will change the size of
10904 the returned font. See `wx.Window.SetWindowVariant` for more about
10905 this.
10906 """
0085ce49 10907 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
74a57fcd 10908
d14a1e28
RD
10909#---------------------------------------------------------------------------
10910
10911class ItemContainer(object):
15afbcd0 10912 """
53aa7709
RD
10913 The wx.ItemContainer class defines an interface which is implemented
10914 by all controls which have string subitems, each of which may be
10915 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
10916 as `wx.ComboBox` which implements an extended interface deriving from
41e2b43e 10917 this one.
15afbcd0 10918
41e2b43e
RD
10919 It defines the methods for accessing the control's items and although
10920 each of the derived classes implements them differently, they still
10921 all conform to the same interface.
15afbcd0 10922
41e2b43e
RD
10923 The items in a wx.ItemContainer have (non empty) string labels and,
10924 optionally, client data associated with them.
15afbcd0
RD
10925
10926 """
0085ce49
RD
10927 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10928 def __init__(self): raise AttributeError, "No constructor defined"
10929 __repr__ = _swig_repr
e811c8ce 10930 def Append(*args, **kwargs):
15afbcd0 10931 """
a95a7133 10932 Append(self, String item, PyObject clientData=None) -> int
15afbcd0 10933
41e2b43e
RD
10934 Adds the item to the control, associating the given data with the item
10935 if not None. The return value is the index of the newly added item
10936 which may be different from the last one if the control is sorted (e.g.
10937 has wx.LB_SORT or wx.CB_SORT style).
15afbcd0 10938 """
54f9ee45 10939 return _core_.ItemContainer_Append(*args, **kwargs)
e811c8ce
RD
10940
10941 def AppendItems(*args, **kwargs):
15afbcd0 10942 """
f5b96ee1 10943 AppendItems(self, List strings)
15afbcd0 10944
41e2b43e
RD
10945 Apend several items at once to the control. Notice that calling this
10946 method may be much faster than appending the items one by one if you
10947 need to add a lot of items.
15afbcd0 10948 """
54f9ee45 10949 return _core_.ItemContainer_AppendItems(*args, **kwargs)
e811c8ce
RD
10950
10951 def Insert(*args, **kwargs):
15afbcd0 10952 """
50f151d7 10953 Insert(self, String item, unsigned int pos, PyObject clientData=None) -> int
15afbcd0 10954
41e2b43e 10955 Insert an item into the control before the item at the ``pos`` index,
15afbcd0
RD
10956 optionally associating some data object with the item.
10957 """
54f9ee45 10958 return _core_.ItemContainer_Insert(*args, **kwargs)
e811c8ce
RD
10959
10960 def Clear(*args, **kwargs):
15afbcd0 10961 """
a95a7133 10962 Clear(self)
15afbcd0
RD
10963
10964 Removes all items from the control.
10965 """
54f9ee45 10966 return _core_.ItemContainer_Clear(*args, **kwargs)
e811c8ce
RD
10967
10968 def Delete(*args, **kwargs):
15afbcd0 10969 """
50f151d7 10970 Delete(self, unsigned int n)
15afbcd0 10971
41e2b43e
RD
10972 Deletes the item at the zero-based index 'n' from the control. Note
10973 that it is an error (signalled by a `wx.PyAssertionError` exception if
10974 enabled) to remove an item with the index negative or greater or equal
10975 than the number of items in the control.
15afbcd0 10976 """
54f9ee45 10977 return _core_.ItemContainer_Delete(*args, **kwargs)
e811c8ce 10978
53aa7709
RD
10979 def GetClientData(*args, **kwargs):
10980 """
50f151d7 10981 GetClientData(self, unsigned int n) -> PyObject
53aa7709
RD
10982
10983 Returns the client data associated with the given item, (if any.)
10984 """
10985 return _core_.ItemContainer_GetClientData(*args, **kwargs)
10986
10987 def SetClientData(*args, **kwargs):
10988 """
50f151d7 10989 SetClientData(self, unsigned int n, PyObject clientData)
53aa7709
RD
10990
10991 Associate the given client data with the item at position n.
10992 """
10993 return _core_.ItemContainer_SetClientData(*args, **kwargs)
10994
e811c8ce 10995 def GetCount(*args, **kwargs):
15afbcd0 10996 """
50f151d7 10997 GetCount(self) -> unsigned int
15afbcd0
RD
10998
10999 Returns the number of items in the control.
11000 """
54f9ee45 11001 return _core_.ItemContainer_GetCount(*args, **kwargs)
e811c8ce
RD
11002
11003 def IsEmpty(*args, **kwargs):
15afbcd0 11004 """
a95a7133 11005 IsEmpty(self) -> bool
15afbcd0
RD
11006
11007 Returns True if the control is empty or False if it has some items.
11008 """
54f9ee45 11009 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
e811c8ce
RD
11010
11011 def GetString(*args, **kwargs):
15afbcd0 11012 """
50f151d7 11013 GetString(self, unsigned int n) -> String
15afbcd0
RD
11014
11015 Returns the label of the item with the given index.
11016 """
54f9ee45 11017 return _core_.ItemContainer_GetString(*args, **kwargs)
e811c8ce
RD
11018
11019 def GetStrings(*args, **kwargs):
a95a7133 11020 """GetStrings(self) -> wxArrayString"""
54f9ee45 11021 return _core_.ItemContainer_GetStrings(*args, **kwargs)
e811c8ce
RD
11022
11023 def SetString(*args, **kwargs):
15afbcd0 11024 """
50f151d7 11025 SetString(self, unsigned int n, String s)
15afbcd0
RD
11026
11027 Sets the label for the given item.
11028 """
54f9ee45 11029 return _core_.ItemContainer_SetString(*args, **kwargs)
e811c8ce
RD
11030
11031 def FindString(*args, **kwargs):
15afbcd0 11032 """
a95a7133 11033 FindString(self, String s) -> int
15afbcd0
RD
11034
11035 Finds an item whose label matches the given string. Returns the
41e2b43e
RD
11036 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11037 found.
15afbcd0 11038 """
54f9ee45 11039 return _core_.ItemContainer_FindString(*args, **kwargs)
e811c8ce 11040
53aa7709 11041 def SetSelection(*args, **kwargs):
15afbcd0 11042 """
53aa7709 11043 SetSelection(self, int n)
15afbcd0
RD
11044
11045 Sets the item at index 'n' to be the selected item.
11046 """
53aa7709 11047 return _core_.ItemContainer_SetSelection(*args, **kwargs)
e811c8ce
RD
11048
11049 def GetSelection(*args, **kwargs):
15afbcd0 11050 """
a95a7133 11051 GetSelection(self) -> int
15afbcd0 11052
41e2b43e
RD
11053 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11054 is selected.
15afbcd0 11055 """
54f9ee45 11056 return _core_.ItemContainer_GetSelection(*args, **kwargs)
e811c8ce 11057
53aa7709
RD
11058 def SetStringSelection(*args, **kwargs):
11059 """SetStringSelection(self, String s) -> bool"""
11060 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
11061
e811c8ce 11062 def GetStringSelection(*args, **kwargs):
15afbcd0 11063 """
a95a7133 11064 GetStringSelection(self) -> String
15afbcd0 11065
41e2b43e
RD
11066 Returns the label of the selected item or an empty string if no item
11067 is selected.
15afbcd0 11068 """
54f9ee45 11069 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
e811c8ce 11070
53aa7709 11071 def Select(*args, **kwargs):
15afbcd0 11072 """
53aa7709 11073 Select(self, int n)
15afbcd0 11074
53aa7709
RD
11075 This is the same as `SetSelection` and exists only because it is
11076 slightly more natural for controls which support multiple selection.
15afbcd0 11077 """
53aa7709 11078 return _core_.ItemContainer_Select(*args, **kwargs)
e811c8ce 11079
97ab0f6a
RD
11080 def GetItems(self):
11081 """Return a list of the strings in the control"""
11082 return [self.GetString(i) for i in xrange(self.GetCount())]
11083
11084 def SetItems(self, items):
11085 """Clear and set the strings in the control from a list"""
11086 self.Clear()
11087 for i in items:
11088 self.Append(i)
11089
11090 Count = property(GetCount,doc="See `GetCount`")
11091 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11092 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11093 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11094 Strings = property(GetStrings,doc="See `GetStrings`")
2131d850 11095_core_.ItemContainer_swigregister(ItemContainer)
d14a1e28
RD
11096
11097#---------------------------------------------------------------------------
11098
11099class ControlWithItems(Control,ItemContainer):
15afbcd0 11100 """
41e2b43e
RD
11101 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11102 wx.Control class, and is used for the base class of various controls
11103 that have items.
15afbcd0 11104 """
0085ce49
RD
11105 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11106 def __init__(self): raise AttributeError, "No constructor defined"
11107 __repr__ = _swig_repr
2131d850 11108_core_.ControlWithItems_swigregister(ControlWithItems)
d14a1e28
RD
11109
11110#---------------------------------------------------------------------------
11111
11112class SizerItem(Object):
248ed943
RD
11113 """
11114 The wx.SizerItem class is used to track the position, size and other
01f6b6d3
RD
11115 attributes of each item managed by a `wx.Sizer`. It is not usually
11116 necessary to use this class because the sizer elements can also be
11117 identified by their positions or window or sizer references but
11118 sometimes it may be more convenient to use wx.SizerItem directly.
11119 Also, custom classes derived from `wx.PySizer` will probably need to
11120 use the collection of wx.SizerItems held by wx.Sizer when calculating
11121 layout.
248ed943
RD
11122
11123 :see: `wx.Sizer`, `wx.GBSizerItem`
11124 """
0085ce49
RD
11125 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11126 __repr__ = _swig_repr
11127 def __init__(self, *args, **kwargs):
248ed943
RD
11128 """
11129 __init__(self) -> SizerItem
11130
11131 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11132 size will need to be set before this item can be used in a Sizer.
11133
11134 You will probably never need to create a wx.SizerItem directly as they
11135 are created automatically when the sizer's Add, Insert or Prepend
11136 methods are called.
11137
11138 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11139 """
0085ce49
RD
11140 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11141 __swig_destroy__ = _core_.delete_SizerItem
11142 __del__ = lambda self : None;
e811c8ce 11143 def DeleteWindows(*args, **kwargs):
248ed943
RD
11144 """
11145 DeleteWindows(self)
11146
11147 Destroy the window or the windows in a subsizer, depending on the type
11148 of item.
11149 """
54f9ee45 11150 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
e811c8ce
RD
11151
11152 def DetachSizer(*args, **kwargs):
248ed943
RD
11153 """
11154 DetachSizer(self)
11155
11156 Enable deleting the SizerItem without destroying the contained sizer.
11157 """
54f9ee45 11158 return _core_.SizerItem_DetachSizer(*args, **kwargs)
e811c8ce
RD
11159
11160 def GetSize(*args, **kwargs):
248ed943
RD
11161 """
11162 GetSize(self) -> Size
11163
11164 Get the current size of the item, as set in the last Layout.
11165 """
54f9ee45 11166 return _core_.SizerItem_GetSize(*args, **kwargs)
e811c8ce
RD
11167
11168 def CalcMin(*args, **kwargs):
248ed943
RD
11169 """
11170 CalcMin(self) -> Size
11171
11172 Calculates the minimum desired size for the item, including any space
11173 needed by borders.
11174 """
54f9ee45 11175 return _core_.SizerItem_CalcMin(*args, **kwargs)
e811c8ce
RD
11176
11177 def SetDimension(*args, **kwargs):
248ed943
RD
11178 """
11179 SetDimension(self, Point pos, Size size)
11180
11181 Set the position and size of the space allocated for this item by the
11182 sizer, and adjust the position and size of the item (window or
11183 subsizer) to be within that space taking alignment and borders into
11184 account.
11185 """
54f9ee45 11186 return _core_.SizerItem_SetDimension(*args, **kwargs)
e811c8ce
RD
11187
11188 def GetMinSize(*args, **kwargs):
248ed943
RD
11189 """
11190 GetMinSize(self) -> Size
11191
11192 Get the minimum size needed for the item.
11193 """
54f9ee45 11194 return _core_.SizerItem_GetMinSize(*args, **kwargs)
e811c8ce 11195
dfbb5885
RD
11196 def GetMinSizeWithBorder(*args, **kwargs):
11197 """
11198 GetMinSizeWithBorder(self) -> Size
11199
11200 Get the minimum size needed for the item with space for the borders
11201 added, if needed.
11202 """
11203 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
11204
e811c8ce 11205 def SetInitSize(*args, **kwargs):
a95a7133 11206 """SetInitSize(self, int x, int y)"""
54f9ee45 11207 return _core_.SizerItem_SetInitSize(*args, **kwargs)
e811c8ce
RD
11208
11209 def SetRatioWH(*args, **kwargs):
248ed943
RD
11210 """
11211 SetRatioWH(self, int width, int height)
11212
11213 Set the ratio item attribute.
11214 """
54f9ee45 11215 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
e811c8ce
RD
11216
11217 def SetRatioSize(*args, **kwargs):
248ed943
RD
11218 """
11219 SetRatioSize(self, Size size)
11220
11221 Set the ratio item attribute.
11222 """
54f9ee45 11223 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
e811c8ce
RD
11224
11225 def SetRatio(*args, **kwargs):
248ed943
RD
11226 """
11227 SetRatio(self, float ratio)
11228
11229 Set the ratio item attribute.
11230 """
54f9ee45 11231 return _core_.SizerItem_SetRatio(*args, **kwargs)
e811c8ce
RD
11232
11233 def GetRatio(*args, **kwargs):
248ed943
RD
11234 """
11235 GetRatio(self) -> float
11236
11237 Set the ratio item attribute.
11238 """
54f9ee45 11239 return _core_.SizerItem_GetRatio(*args, **kwargs)
e811c8ce 11240
d3b6e4ff
RD
11241 def GetRect(*args, **kwargs):
11242 """
11243 GetRect(self) -> Rect
11244
11245 Returns the rectangle that the sizer item should occupy
11246 """
11247 return _core_.SizerItem_GetRect(*args, **kwargs)
11248
e811c8ce 11249 def IsWindow(*args, **kwargs):
248ed943
RD
11250 """
11251 IsWindow(self) -> bool
11252
11253 Is this sizer item a window?
11254 """
54f9ee45 11255 return _core_.SizerItem_IsWindow(*args, **kwargs)
e811c8ce
RD
11256
11257 def IsSizer(*args, **kwargs):
248ed943
RD
11258 """
11259 IsSizer(self) -> bool
11260
11261 Is this sizer item a subsizer?
11262 """
54f9ee45 11263 return _core_.SizerItem_IsSizer(*args, **kwargs)
e811c8ce
RD
11264
11265 def IsSpacer(*args, **kwargs):
248ed943
RD
11266 """
11267 IsSpacer(self) -> bool
11268
11269 Is this sizer item a spacer?
11270 """
54f9ee45 11271 return _core_.SizerItem_IsSpacer(*args, **kwargs)
e811c8ce
RD
11272
11273 def SetProportion(*args, **kwargs):
248ed943
RD
11274 """
11275 SetProportion(self, int proportion)
11276
11277 Set the proportion value for this item.
11278 """
54f9ee45 11279 return _core_.SizerItem_SetProportion(*args, **kwargs)
e811c8ce
RD
11280
11281 def GetProportion(*args, **kwargs):
248ed943
RD
11282 """
11283 GetProportion(self) -> int
11284
11285 Get the proportion value for this item.
11286 """
54f9ee45 11287 return _core_.SizerItem_GetProportion(*args, **kwargs)
e811c8ce 11288
248ed943
RD
11289 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
11290 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
e811c8ce 11291 def SetFlag(*args, **kwargs):
248ed943
RD
11292 """
11293 SetFlag(self, int flag)
11294
11295 Set the flag value for this item.
11296 """
54f9ee45 11297 return _core_.SizerItem_SetFlag(*args, **kwargs)
e811c8ce
RD
11298
11299 def GetFlag(*args, **kwargs):
248ed943
RD
11300 """
11301 GetFlag(self) -> int
11302
11303 Get the flag value for this item.
11304 """
54f9ee45 11305 return _core_.SizerItem_GetFlag(*args, **kwargs)
e811c8ce
RD
11306
11307 def SetBorder(*args, **kwargs):
248ed943
RD
11308 """
11309 SetBorder(self, int border)
11310
11311 Set the border value for this item.
11312 """
54f9ee45 11313 return _core_.SizerItem_SetBorder(*args, **kwargs)
e811c8ce
RD
11314
11315 def GetBorder(*args, **kwargs):
248ed943
RD
11316 """
11317 GetBorder(self) -> int
11318
11319 Get the border value for this item.
11320 """
54f9ee45 11321 return _core_.SizerItem_GetBorder(*args, **kwargs)
e811c8ce
RD
11322
11323 def GetWindow(*args, **kwargs):
248ed943
RD
11324 """
11325 GetWindow(self) -> Window
11326
11327 Get the window (if any) that is managed by this sizer item.
11328 """
54f9ee45 11329 return _core_.SizerItem_GetWindow(*args, **kwargs)
e811c8ce
RD
11330
11331 def SetWindow(*args, **kwargs):
248ed943
RD
11332 """
11333 SetWindow(self, Window window)
11334
11335 Set the window to be managed by this sizer item.
11336 """
54f9ee45 11337 return _core_.SizerItem_SetWindow(*args, **kwargs)
e811c8ce
RD
11338
11339 def GetSizer(*args, **kwargs):
248ed943
RD
11340 """
11341 GetSizer(self) -> Sizer
11342
11343 Get the subsizer (if any) that is managed by this sizer item.
11344 """
54f9ee45 11345 return _core_.SizerItem_GetSizer(*args, **kwargs)
e811c8ce
RD
11346
11347 def SetSizer(*args, **kwargs):
248ed943
RD
11348 """
11349 SetSizer(self, Sizer sizer)
11350
11351 Set the subsizer to be managed by this sizer item.
11352 """
54f9ee45 11353 return _core_.SizerItem_SetSizer(*args, **kwargs)
e811c8ce
RD
11354
11355 def GetSpacer(*args, **kwargs):
248ed943
RD
11356 """
11357 GetSpacer(self) -> Size
11358
11359 Get the size of the spacer managed by this sizer item.
11360 """
54f9ee45 11361 return _core_.SizerItem_GetSpacer(*args, **kwargs)
e811c8ce
RD
11362
11363 def SetSpacer(*args, **kwargs):
248ed943
RD
11364 """
11365 SetSpacer(self, Size size)
11366
11367 Set the size of the spacer to be managed by this sizer item.
11368 """
54f9ee45 11369 return _core_.SizerItem_SetSpacer(*args, **kwargs)
e811c8ce
RD
11370
11371 def Show(*args, **kwargs):
248ed943
RD
11372 """
11373 Show(self, bool show)
11374
11375 Set the show item attribute, which sizers use to determine if the item
11376 is to be made part of the layout or not. If the item is tracking a
11377 window then it is shown or hidden as needed.
11378 """
54f9ee45 11379 return _core_.SizerItem_Show(*args, **kwargs)
e811c8ce
RD
11380
11381 def IsShown(*args, **kwargs):
248ed943
RD
11382 """
11383 IsShown(self) -> bool
11384
11385 Is the item to be shown in the layout?
11386 """
54f9ee45 11387 return _core_.SizerItem_IsShown(*args, **kwargs)
e811c8ce
RD
11388
11389 def GetPosition(*args, **kwargs):
248ed943
RD
11390 """
11391 GetPosition(self) -> Point
11392
11393 Returns the current position of the item, as set in the last Layout.
11394 """
54f9ee45 11395 return _core_.SizerItem_GetPosition(*args, **kwargs)
e811c8ce
RD
11396
11397 def GetUserData(*args, **kwargs):
248ed943
RD
11398 """
11399 GetUserData(self) -> PyObject
11400
11401 Returns the userData associated with this sizer item, or None if there
11402 isn't any.
11403 """
54f9ee45 11404 return _core_.SizerItem_GetUserData(*args, **kwargs)
e811c8ce 11405
091f5bed
RD
11406 def SetUserData(*args, **kwargs):
11407 """
11408 SetUserData(self, PyObject userData)
11409
11410 Associate a Python object with this sizer item.
11411 """
11412 return _core_.SizerItem_SetUserData(*args, **kwargs)
11413
2131d850 11414_core_.SizerItem_swigregister(SizerItem)
d14a1e28 11415
248ed943 11416def SizerItemWindow(*args, **kwargs):
0df68c9f 11417 """
248ed943
RD
11418 SizerItemWindow(Window window, int proportion, int flag, int border,
11419 PyObject userData=None) -> SizerItem
11420
11421 Constructs a `wx.SizerItem` for tracking a window.
0df68c9f 11422 """
248ed943 11423 val = _core_.new_SizerItemWindow(*args, **kwargs)
d14a1e28
RD
11424 return val
11425
248ed943 11426def SizerItemSpacer(*args, **kwargs):
0df68c9f 11427 """
248ed943
RD
11428 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
11429 PyObject userData=None) -> SizerItem
11430
11431 Constructs a `wx.SizerItem` for tracking a spacer.
0df68c9f 11432 """
248ed943 11433 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d14a1e28
RD
11434 return val
11435
11436def SizerItemSizer(*args, **kwargs):
0df68c9f
RD
11437 """
11438 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
248ed943
RD
11439 PyObject userData=None) -> SizerItem
11440
11441 Constructs a `wx.SizerItem` for tracking a subsizer
0df68c9f 11442 """
54f9ee45 11443 val = _core_.new_SizerItemSizer(*args, **kwargs)
d14a1e28
RD
11444 return val
11445
11446class Sizer(Object):
248ed943
RD
11447 """
11448 wx.Sizer is the abstract base class used for laying out subwindows in
11449 a window. You cannot use wx.Sizer directly; instead, you will have to
11450 use one of the sizer classes derived from it such as `wx.BoxSizer`,
1d5ee749
RD
11451 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
11452 `wx.GridBagSizer`.
248ed943
RD
11453
11454 The concept implemented by sizers in wxWidgets is closely related to
11455 layout tools in other GUI toolkits, such as Java's AWT, the GTK
11456 toolkit or the Qt toolkit. It is based upon the idea of the individual
11457 subwindows reporting their minimal required size and their ability to
11458 get stretched if the size of the parent window has changed. This will
11459 most often mean that the programmer does not set the original size of
11460 a dialog in the beginning, rather the dialog will assigned a sizer and
11461 this sizer will be queried about the recommended size. The sizer in
11462 turn will query its children, which can be normal windows or contorls,
11463 empty space or other sizers, so that a hierarchy of sizers can be
11464 constructed. Note that wxSizer does not derive from wxWindow and thus
11465 do not interfere with tab ordering and requires very little resources
11466 compared to a real window on screen.
11467
11468 What makes sizers so well fitted for use in wxWidgets is the fact that
11469 every control reports its own minimal size and the algorithm can
11470 handle differences in font sizes or different window (dialog item)
11471 sizes on different platforms without problems. If for example the
11472 standard font as well as the overall design of Mac widgets requires
11473 more space than on Windows, then the initial size of a dialog using a
11474 sizer will automatically be bigger on Mac than on Windows.
11475 """
0085ce49
RD
11476 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11477 def __init__(self): raise AttributeError, "No constructor defined"
11478 __repr__ = _swig_repr
11479 __swig_destroy__ = _core_.delete_Sizer
11480 __del__ = lambda self : None;
e811c8ce 11481 def _setOORInfo(*args, **kwargs):
a95a7133 11482 """_setOORInfo(self, PyObject _self)"""
54f9ee45 11483 return _core_.Sizer__setOORInfo(*args, **kwargs)
e811c8ce
RD
11484
11485 def Add(*args, **kwargs):
0df68c9f 11486 """
248ed943 11487 Add(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11488 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11489
11490 Appends a child item to the sizer.
0df68c9f 11491 """
54f9ee45 11492 return _core_.Sizer_Add(*args, **kwargs)
e811c8ce
RD
11493
11494 def Insert(*args, **kwargs):
0df68c9f 11495 """
248ed943 11496 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11497 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11498
11499 Inserts a new item into the list of items managed by this sizer before
11500 the item at index *before*. See `Add` for a description of the parameters.
0df68c9f 11501 """
54f9ee45 11502 return _core_.Sizer_Insert(*args, **kwargs)
e811c8ce
RD
11503
11504 def Prepend(*args, **kwargs):
0df68c9f 11505 """
248ed943 11506 Prepend(self, item, int proportion=0, int flag=0, int border=0,
d3b6e4ff 11507 PyObject userData=None) -> wx.SizerItem
248ed943
RD
11508
11509 Adds a new item to the begining of the list of sizer items managed by
11510 this sizer. See `Add` for a description of the parameters.
0df68c9f 11511 """
54f9ee45 11512 return _core_.Sizer_Prepend(*args, **kwargs)
e811c8ce
RD
11513
11514 def Remove(*args, **kwargs):
248ed943
RD
11515 """
11516 Remove(self, item) -> bool
11517
11518 Removes an item from the sizer and destroys it. This method does not
11519 cause any layout or resizing to take place, call `Layout` to update
11520 the layout on screen after removing a child from the sizer. The
11521 *item* parameter can be either a window, a sizer, or the zero-based
11522 index of an item to remove. Returns True if the child item was found
11523 and removed.
11524 """
54f9ee45 11525 return _core_.Sizer_Remove(*args, **kwargs)
e811c8ce 11526
1c0f361b 11527 def Detach(*args, **kwargs):
248ed943
RD
11528 """
11529 Detach(self, item) -> bool
11530
11531 Detaches an item from the sizer without destroying it. This method
11532 does not cause any layout or resizing to take place, call `Layout` to
11533 do so. The *item* parameter can be either a window, a sizer, or the
11534 zero-based index of the item to be detached. Returns True if the child item
11535 was found and detached.
11536 """
1c0f361b
RD
11537 return _core_.Sizer_Detach(*args, **kwargs)
11538
d3b6e4ff
RD
11539 def GetItem(*args, **kwargs):
11540 """
11541 GetItem(self, item) -> wx.SizerItem
11542
11543 Returns the `wx.SizerItem` which holds the *item* given. The *item*
11544 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 11545 the item to be found.
d3b6e4ff
RD
11546 """
11547 return _core_.Sizer_GetItem(*args, **kwargs)
11548
e811c8ce 11549 def _SetItemMinSize(*args, **kwargs):
a95a7133 11550 """_SetItemMinSize(self, PyObject item, Size size)"""
54f9ee45 11551 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
e811c8ce 11552
97ab0f6a
RD
11553 def _ReplaceWin(*args, **kwargs):
11554 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
11555 return _core_.Sizer__ReplaceWin(*args, **kwargs)
11556
11557 def _ReplaceSizer(*args, **kwargs):
11558 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
11559 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
11560
11561 def _ReplaceItem(*args, **kwargs):
11562 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
11563 return _core_.Sizer__ReplaceItem(*args, **kwargs)
11564
11565 def Replace(self, olditem, item, recursive=False):
11566 """
11567 Detaches the given ``olditem`` from the sizer and replaces it with
11568 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
11569 detached child is destroyed only if it is not a window, (because
11570 windows are owned by their parent, not the sizer.) The
11571 ``recursive`` parameter can be used to search for the given
11572 element recursivly in subsizers.
11573
11574 This method does not cause any layout or resizing to take place,
11575 call `Layout` to do so.
11576
11577 Returns ``True`` if the child item was found and removed.
11578 """
11579 if isinstance(olditem, wx.Window):
11580 return self._ReplaceWin(olditem, item, recursive)
11581 elif isinstnace(olditem, wx.Sizer):
11582 return self._ReplaceSizer(olditem, item, recursive)
11583 elif isinstnace(olditem, int):
11584 return self._ReplaceItem(olditem, item)
11585 else:
11586 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
11587
11588 def SetContainingWindow(*args, **kwargs):
11589 """
11590 SetContainingWindow(self, Window window)
11591
11592 Set (or unset) the window this sizer is used in.
11593 """
11594 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
11595
11596 def GetContainingWindow(*args, **kwargs):
11597 """
11598 GetContainingWindow(self) -> Window
11599
11600 Get the window this sizer is used in.
11601 """
11602 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
11603
248ed943
RD
11604 def SetItemMinSize(self, item, *args):
11605 """
11606 SetItemMinSize(self, item, Size size)
11607
11608 Sets the minimum size that will be allocated for an item in the sizer.
11609 The *item* parameter can be either a window, a sizer, or the
11610 zero-based index of the item. If a window or sizer is given then it
11611 will be searched for recursivly in subsizers if neccessary.
11612 """
11613 if len(args) == 2:
11614 # for backward compatibility accept separate width,height args too
11615 return self._SetItemMinSize(item, args)
11616 else:
11617 return self._SetItemMinSize(item, args[0])
11618
e811c8ce 11619 def AddItem(*args, **kwargs):
248ed943
RD
11620 """
11621 AddItem(self, SizerItem item)
11622
11623 Adds a `wx.SizerItem` to the sizer.
11624 """
54f9ee45 11625 return _core_.Sizer_AddItem(*args, **kwargs)
e811c8ce
RD
11626
11627 def InsertItem(*args, **kwargs):
248ed943
RD
11628 """
11629 InsertItem(self, int index, SizerItem item)
11630
11631 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
11632 """
54f9ee45 11633 return _core_.Sizer_InsertItem(*args, **kwargs)
e811c8ce
RD
11634
11635 def PrependItem(*args, **kwargs):
248ed943
RD
11636 """
11637 PrependItem(self, SizerItem item)
11638
11639 Prepends a `wx.SizerItem` to the sizer.
11640 """
54f9ee45 11641 return _core_.Sizer_PrependItem(*args, **kwargs)
e811c8ce 11642
248ed943 11643 def AddMany(self, items):
66c033b4
RD
11644 """
11645 AddMany is a convenience method for adding several items
11646 to a sizer at one time. Simply pass it a list of tuples,
11647 where each tuple consists of the parameters that you
11648 would normally pass to the `Add` method.
11649 """
248ed943
RD
11650 for item in items:
11651 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
11652 item = (item, )
11653 self.Add(*item)
d14a1e28 11654
ae5bc7f3
RD
11655 def AddSpacer(self, *args, **kw):
11656 """AddSpacer(int size) --> SizerItem
11657
11658 Add a spacer that is (size,size) pixels.
11659 """
11660 if args and type(args[0]) == int:
11661 return self.Add( (args[0],args[0] ), 0)
11662 else: # otherwise stay compatible with old AddSpacer
11663 return self.Add(*args, **kw)
11664 def PrependSpacer(self, *args, **kw):
11665 """PrependSpacer(int size) --> SizerItem
11666
11667 Prepend a spacer that is (size, size) pixels."""
11668 if args and type(args[0]) == int:
11669 return self.Prepend( (args[0],args[0] ), 0)
11670 else: # otherwise stay compatible with old PrependSpacer
11671 return self.Prepend(*args, **kw)
11672 def InsertSpacer(self, index, *args, **kw):
11673 """InsertSpacer(int index, int size) --> SizerItem
11674
11675 Insert a spacer at position index that is (size, size) pixels."""
11676 if args and type(args[0]) == int:
11677 return self.Insert( index, (args[0],args[0] ), 0)
11678 else: # otherwise stay compatible with old InsertSpacer
11679 return self.Insert(index, *args, **kw)
11680
11681
11682 def AddStretchSpacer(self, prop=1):
11683 """AddStretchSpacer(int prop=1) --> SizerItem
11684
11685 Add a stretchable spacer."""
11686 return self.Add((0,0), prop)
11687 def PrependStretchSpacer(self, prop=1):
11688 """PrependStretchSpacer(int prop=1) --> SizerItem
11689
11690 Prepend a stretchable spacer."""
11691 return self.Prepend((0,0), prop)
11692 def InsertStretchSpacer(self, index, prop=1):
11693 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
11694
11695 Insert a stretchable spacer."""
11696 return self.Insert(index, (0,0), prop)
11697
11698
74e96f3d 11699 # for backwards compatibility only, please do not use in new code
b9d6a5f3
RD
11700 def AddWindow(self, *args, **kw):
11701 """Compatibility alias for `Add`."""
11702 return self.Add(*args, **kw)
11703 def AddSizer(self, *args, **kw):
11704 """Compatibility alias for `Add`."""
11705 return self.Add(*args, **kw)
b9d6a5f3
RD
11706
11707 def PrependWindow(self, *args, **kw):
11708 """Compatibility alias for `Prepend`."""
11709 return self.Prepend(*args, **kw)
11710 def PrependSizer(self, *args, **kw):
11711 """Compatibility alias for `Prepend`."""
11712 return self.Prepend(*args, **kw)
b9d6a5f3
RD
11713
11714 def InsertWindow(self, *args, **kw):
11715 """Compatibility alias for `Insert`."""
11716 return self.Insert(*args, **kw)
11717 def InsertSizer(self, *args, **kw):
11718 """Compatibility alias for `Insert`."""
b9d6a5f3
RD
11719 return self.Insert(*args, **kw)
11720
11721 def RemoveWindow(self, *args, **kw):
11722 """Compatibility alias for `Remove`."""
11723 return self.Remove(*args, **kw)
11724 def RemoveSizer(self, *args, **kw):
11725 """Compatibility alias for `Remove`."""
11726 return self.Remove(*args, **kw)
11727 def RemovePos(self, *args, **kw):
11728 """Compatibility alias for `Remove`."""
11729 return self.Remove(*args, **kw)
d14a1e28
RD
11730
11731
e811c8ce 11732 def SetDimension(*args, **kwargs):
248ed943
RD
11733 """
11734 SetDimension(self, int x, int y, int width, int height)
11735
11736 Call this to force the sizer to take the given dimension and thus
11737 force the items owned by the sizer to resize themselves according to
11738 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
11739 methods.
11740 """
54f9ee45 11741 return _core_.Sizer_SetDimension(*args, **kwargs)
e811c8ce
RD
11742
11743 def SetMinSize(*args, **kwargs):
248ed943
RD
11744 """
11745 SetMinSize(self, Size size)
11746
11747 Call this to give the sizer a minimal size. Normally, the sizer will
11748 calculate its minimal size based purely on how much space its children
11749 need. After calling this method `GetMinSize` will return either the
11750 minimal size as requested by its children or the minimal size set
11751 here, depending on which is bigger.
11752 """
54f9ee45 11753 return _core_.Sizer_SetMinSize(*args, **kwargs)
e811c8ce
RD
11754
11755 def GetSize(*args, **kwargs):
248ed943
RD
11756 """
11757 GetSize(self) -> Size
11758
11759 Returns the current size of the space managed by the sizer.
11760 """
54f9ee45 11761 return _core_.Sizer_GetSize(*args, **kwargs)
e811c8ce
RD
11762
11763 def GetPosition(*args, **kwargs):
248ed943
RD
11764 """
11765 GetPosition(self) -> Point
11766
11767 Returns the current position of the sizer's managed space.
11768 """
54f9ee45 11769 return _core_.Sizer_GetPosition(*args, **kwargs)
e811c8ce
RD
11770
11771 def GetMinSize(*args, **kwargs):
248ed943
RD
11772 """
11773 GetMinSize(self) -> Size
11774
11775 Returns the minimal size of the sizer. This is either the combined
11776 minimal size of all the children and their borders or the minimal size
11777 set by SetMinSize, depending on which is bigger.
11778 """
54f9ee45 11779 return _core_.Sizer_GetMinSize(*args, **kwargs)
e811c8ce 11780
d14a1e28 11781 def GetSizeTuple(self):
1c0f361b 11782 return self.GetSize().Get()
d14a1e28 11783 def GetPositionTuple(self):
1c0f361b 11784 return self.GetPosition().Get()
d14a1e28 11785 def GetMinSizeTuple(self):
1c0f361b 11786 return self.GetMinSize().Get()
d14a1e28 11787
e811c8ce 11788 def RecalcSizes(*args, **kwargs):
248ed943
RD
11789 """
11790 RecalcSizes(self)
11791
11792 Using the sizes calculated by `CalcMin` reposition and resize all the
11793 items managed by this sizer. You should not need to call this directly as
11794 it is called by `Layout`.
11795 """
54f9ee45 11796 return _core_.Sizer_RecalcSizes(*args, **kwargs)
e811c8ce
RD
11797
11798 def CalcMin(*args, **kwargs):
248ed943
RD
11799 """
11800 CalcMin(self) -> Size
11801
11802 This method is where the sizer will do the actual calculation of its
11803 children's minimal sizes. You should not need to call this directly as
11804 it is called by `Layout`.
11805 """
54f9ee45 11806 return _core_.Sizer_CalcMin(*args, **kwargs)
e811c8ce
RD
11807
11808 def Layout(*args, **kwargs):
248ed943
RD
11809 """
11810 Layout(self)
11811
11812 This method will force the recalculation and layout of the items
11813 controlled by the sizer using the current space allocated to the
11814 sizer. Normally this is called automatically from the owning window's
11815 EVT_SIZE handler, but it is also useful to call it from user code when
11816 one of the items in a sizer change size, or items are added or
11817 removed.
11818 """
54f9ee45 11819 return _core_.Sizer_Layout(*args, **kwargs)
e811c8ce
RD
11820
11821 def Fit(*args, **kwargs):
248ed943
RD
11822 """
11823 Fit(self, Window window) -> Size
11824
11825 Tell the sizer to resize the *window* to match the sizer's minimal
11826 size. This is commonly done in the constructor of the window itself in
11827 order to set its initial size to match the needs of the children as
11828 determined by the sizer. Returns the new size.
11829
11830 For a top level window this is the total window size, not the client size.
11831 """
54f9ee45 11832 return _core_.Sizer_Fit(*args, **kwargs)
e811c8ce
RD
11833
11834 def FitInside(*args, **kwargs):
248ed943
RD
11835 """
11836 FitInside(self, Window window)
11837
11838 Tell the sizer to resize the *virtual size* of the *window* to match the
11839 sizer's minimal size. This will not alter the on screen size of the
11840 window, but may cause the addition/removal/alteration of scrollbars
11841 required to view the virtual area in windows which manage it.
11842
11843 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
11844
11845 """
54f9ee45 11846 return _core_.Sizer_FitInside(*args, **kwargs)
e811c8ce
RD
11847
11848 def SetSizeHints(*args, **kwargs):
248ed943
RD
11849 """
11850 SetSizeHints(self, Window window)
11851
11852 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
11853 match the sizer's minimal size. This is commonly done in the
11854 constructor of the window itself if the window is resizable (as are
11855 many dialogs under Unix and frames on probably all platforms) in order
11856 to prevent the window from being sized smaller than the minimal size
11857 required by the sizer.
11858 """
54f9ee45 11859 return _core_.Sizer_SetSizeHints(*args, **kwargs)
e811c8ce
RD
11860
11861 def SetVirtualSizeHints(*args, **kwargs):
248ed943
RD
11862 """
11863 SetVirtualSizeHints(self, Window window)
11864
11865 Tell the sizer to set the minimal size of the window virtual area to
11866 match the sizer's minimal size. For windows with managed scrollbars
11867 this will set them appropriately.
11868
11869 :see: `wx.ScrolledWindow.SetScrollbars`
11870
11871 """
54f9ee45 11872 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
e811c8ce
RD
11873
11874 def Clear(*args, **kwargs):
248ed943
RD
11875 """
11876 Clear(self, bool deleteWindows=False)
11877
11878 Clear all items from the sizer, optionally destroying the window items
11879 as well.
11880 """
54f9ee45 11881 return _core_.Sizer_Clear(*args, **kwargs)
e811c8ce
RD
11882
11883 def DeleteWindows(*args, **kwargs):
248ed943
RD
11884 """
11885 DeleteWindows(self)
11886
11887 Destroy all windows managed by the sizer.
11888 """
54f9ee45 11889 return _core_.Sizer_DeleteWindows(*args, **kwargs)
e811c8ce
RD
11890
11891 def GetChildren(*args, **kwargs):
248ed943 11892 """
51b83b37 11893 GetChildren(self) -> list
248ed943
RD
11894
11895 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
11896 """
54f9ee45 11897 return _core_.Sizer_GetChildren(*args, **kwargs)
e811c8ce
RD
11898
11899 def Show(*args, **kwargs):
248ed943 11900 """
ae8162c8 11901 Show(self, item, bool show=True, bool recursive=false) -> bool
e811c8ce 11902
248ed943
RD
11903 Shows or hides an item managed by the sizer. To make a sizer item
11904 disappear or reappear, use Show followed by `Layout`. The *item*
11905 parameter can be either a window, a sizer, or the zero-based index of
7e63a440
RD
11906 the item. Use the recursive parameter to show or hide an item in a
11907 subsizer. Returns True if the item was found.
248ed943
RD
11908 """
11909 return _core_.Sizer_Show(*args, **kwargs)
e811c8ce
RD
11910
11911 def IsShown(*args, **kwargs):
248ed943
RD
11912 """
11913 IsShown(self, item)
11914
b1fcee84 11915 Determines if the item is currently shown. To make a sizer
248ed943
RD
11916 item disappear or reappear, use Show followed by `Layout`. The *item*
11917 parameter can be either a window, a sizer, or the zero-based index of
11918 the item.
11919 """
54f9ee45 11920 return _core_.Sizer_IsShown(*args, **kwargs)
e811c8ce 11921
7e63a440 11922 def Hide(self, item, recursive=False):
248ed943 11923 """
27fb7603 11924 A convenience method for `Show` (item, False, recursive).
248ed943 11925 """
06759a38 11926 return self.Show(item, False, recursive)
248ed943 11927
e811c8ce 11928 def ShowItems(*args, **kwargs):
248ed943
RD
11929 """
11930 ShowItems(self, bool show)
11931
84f85550 11932 Recursively call `wx.SizerItem.Show` on all sizer items.
248ed943 11933 """
54f9ee45 11934 return _core_.Sizer_ShowItems(*args, **kwargs)
e811c8ce 11935
2131d850 11936_core_.Sizer_swigregister(Sizer)
d14a1e28
RD
11937
11938class PySizer(Sizer):
248ed943
RD
11939 """
11940 wx.PySizer is a special version of `wx.Sizer` that has been
11941 instrumented to allow the C++ virtual methods to be overloaded in
11942 Python derived classes. You would derive from this class if you are
11943 wanting to implement a custom sizer in Python code. Simply implement
11944 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
11945 For example::
11946
11947 class MySizer(wx.PySizer):
11948 def __init__(self):
11949 wx.PySizer.__init__(self)
11950
11951 def CalcMin(self):
11952 for item in self.GetChildren():
11953 # calculate the total minimum width and height needed
11954 # by all items in the sizer according to this sizer's
11955 # layout algorithm.
11956 ...
11957 return wx.Size(width, height)
11958
11959 def RecalcSizes(self):
11960 # find the space allotted to this sizer
11961 pos = self.GetPosition()
11962 size = self.GetSize()
11963 for item in self.GetChildren():
11964 # Recalculate (if necessary) the position and size of
11965 # each item and then call item.SetDimension to do the
11966 # actual positioning and sizing of the items within the
11967 # space alloted to this sizer.
11968 ...
11969 item.SetDimension(itemPos, itemSize)
11970
11971
11972 When `Layout` is called it first calls `CalcMin` followed by
11973 `RecalcSizes` so you can optimize a bit by saving the results of
e505d15e 11974 `CalcMin` and reusing them in `RecalcSizes`.
248ed943
RD
11975
11976 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
11977
11978
11979 """
0085ce49
RD
11980 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11981 __repr__ = _swig_repr
11982 def __init__(self, *args, **kwargs):
248ed943
RD
11983 """
11984 __init__(self) -> PySizer
11985
11986 Creates a wx.PySizer. Must be called from the __init__ in the derived
11987 class.
11988 """
0085ce49 11989 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
d14a1e28 11990 self._setCallbackInfo(self, PySizer);self._setOORInfo(self)
e811c8ce
RD
11991
11992 def _setCallbackInfo(*args, **kwargs):
a95a7133 11993 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
54f9ee45 11994 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
e811c8ce 11995
2131d850 11996_core_.PySizer_swigregister(PySizer)
d14a1e28
RD
11997
11998#---------------------------------------------------------------------------
11999
12000class BoxSizer(Sizer):
248ed943
RD
12001 """
12002 The basic idea behind a box sizer is that windows will most often be
12003 laid out in rather simple basic geometry, typically in a row or a
12004 column or nested hierarchies of either. A wx.BoxSizer will lay out
12005 its items in a simple row or column, depending on the orientation
12006 parameter passed to the constructor.
12007 """
0085ce49
RD
12008 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12009 __repr__ = _swig_repr
12010 def __init__(self, *args, **kwargs):
248ed943
RD
12011 """
12012 __init__(self, int orient=HORIZONTAL) -> BoxSizer
12013
12014 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12015 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12016 sizer.
12017 """
0085ce49 12018 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d14a1e28 12019 self._setOORInfo(self)
e811c8ce
RD
12020
12021 def GetOrientation(*args, **kwargs):
248ed943
RD
12022 """
12023 GetOrientation(self) -> int
12024
12025 Returns the current orientation of the sizer.
12026 """
54f9ee45 12027 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
e811c8ce
RD
12028
12029 def SetOrientation(*args, **kwargs):
248ed943
RD
12030 """
12031 SetOrientation(self, int orient)
e811c8ce 12032
248ed943
RD
12033 Resets the orientation of the sizer.
12034 """
12035 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
e811c8ce 12036
2bf58437 12037 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
2131d850 12038_core_.BoxSizer_swigregister(BoxSizer)
d14a1e28
RD
12039
12040#---------------------------------------------------------------------------
12041
12042class StaticBoxSizer(BoxSizer):
248ed943
RD
12043 """
12044 wx.StaticBoxSizer derives from and functions identically to the
12045 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12046 manages. Note that this static box must be created separately and
12047 passed to the sizer constructor.
12048 """
0085ce49
RD
12049 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12050 __repr__ = _swig_repr
12051 def __init__(self, *args, **kwargs):
248ed943
RD
12052 """
12053 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
12054
12055 Constructor. It takes an associated static box and the orientation
12056 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12057 ``wx.HORIZONTAL``.
12058 """
0085ce49 12059 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d14a1e28 12060 self._setOORInfo(self)
e811c8ce
RD
12061
12062 def GetStaticBox(*args, **kwargs):
248ed943
RD
12063 """
12064 GetStaticBox(self) -> StaticBox
e811c8ce 12065
248ed943
RD
12066 Returns the static box associated with this sizer.
12067 """
12068 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
e811c8ce 12069
2131d850 12070_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d14a1e28
RD
12071
12072#---------------------------------------------------------------------------
12073
12074class GridSizer(Sizer):
248ed943
RD
12075 """
12076 A grid sizer is a sizer which lays out its children in a
12077 two-dimensional table with all cells having the same size. In other
12078 words, the width of each cell within the grid is the width of the
12079 widest item added to the sizer and the height of each grid cell is the
12080 height of the tallest item. An optional vertical and/or horizontal
12081 gap between items can also be specified (in pixels.)
12082
12083 Items are placed in the cells of the grid in the order they are added,
12084 in row-major order. In other words, the first row is filled first,
12085 then the second, and so on until all items have been added. (If
12086 neccessary, additional rows will be added as items are added.) If you
12087 need to have greater control over the cells that items are placed in
12088 then use the `wx.GridBagSizer`.
12089
12090 """
0085ce49
RD
12091 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12092 __repr__ = _swig_repr
12093 def __init__(self, *args, **kwargs):
248ed943
RD
12094 """
12095 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
12096
12097 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12098 of columns and rows in the sizer - if either of the parameters is
12099 zero, it will be calculated to from the total number of children in
12100 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12101 define extra space between all children.
12102 """
0085ce49 12103 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d14a1e28 12104 self._setOORInfo(self)
e811c8ce 12105
e811c8ce 12106 def SetCols(*args, **kwargs):
248ed943
RD
12107 """
12108 SetCols(self, int cols)
12109
12110 Sets the number of columns in the sizer.
12111 """
54f9ee45 12112 return _core_.GridSizer_SetCols(*args, **kwargs)
e811c8ce
RD
12113
12114 def SetRows(*args, **kwargs):
248ed943
RD
12115 """
12116 SetRows(self, int rows)
12117
12118 Sets the number of rows in the sizer.
12119 """
54f9ee45 12120 return _core_.GridSizer_SetRows(*args, **kwargs)
e811c8ce
RD
12121
12122 def SetVGap(*args, **kwargs):
248ed943
RD
12123 """
12124 SetVGap(self, int gap)
12125
12126 Sets the vertical gap (in pixels) between the cells in the sizer.
12127 """
54f9ee45 12128 return _core_.GridSizer_SetVGap(*args, **kwargs)
e811c8ce
RD
12129
12130 def SetHGap(*args, **kwargs):
248ed943
RD
12131 """
12132 SetHGap(self, int gap)
12133
12134 Sets the horizontal gap (in pixels) between cells in the sizer
12135 """
54f9ee45 12136 return _core_.GridSizer_SetHGap(*args, **kwargs)
e811c8ce
RD
12137
12138 def GetCols(*args, **kwargs):
248ed943
RD
12139 """
12140 GetCols(self) -> int
12141
12142 Returns the number of columns in the sizer.
12143 """
54f9ee45 12144 return _core_.GridSizer_GetCols(*args, **kwargs)
e811c8ce
RD
12145
12146 def GetRows(*args, **kwargs):
248ed943
RD
12147 """
12148 GetRows(self) -> int
12149
12150 Returns the number of rows in the sizer.
12151 """
54f9ee45 12152 return _core_.GridSizer_GetRows(*args, **kwargs)
e811c8ce
RD
12153
12154 def GetVGap(*args, **kwargs):
248ed943
RD
12155 """
12156 GetVGap(self) -> int
12157
12158 Returns the vertical gap (in pixels) between the cells in the sizer.
12159 """
54f9ee45 12160 return _core_.GridSizer_GetVGap(*args, **kwargs)
e811c8ce
RD
12161
12162 def GetHGap(*args, **kwargs):
248ed943
RD
12163 """
12164 GetHGap(self) -> int
12165
12166 Returns the horizontal gap (in pixels) between cells in the sizer.
12167 """
54f9ee45 12168 return _core_.GridSizer_GetHGap(*args, **kwargs)
e811c8ce 12169
0085ce49
RD
12170 def CalcRowsCols(self):
12171 """
12172 CalcRowsCols() -> (rows, cols)
12173
12174 Calculates how many rows and columns will be in the sizer based
12175 on the current number of items and also the rows, cols specified
12176 in the constructor.
12177 """
12178 nitems = len(self.GetChildren())
12179 rows = self.GetRows()
12180 cols = self.GetCols()
12181 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
12182 if cols != 0:
12183 rows = (nitems + cols - 1) / cols
12184 elif rows != 0:
12185 cols = (nitems + rows - 1) / rows
12186 return (rows, cols)
d14a1e28 12187
97ab0f6a
RD
12188 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
12189 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
12190 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
12191 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
2131d850 12192_core_.GridSizer_swigregister(GridSizer)
d14a1e28
RD
12193
12194#---------------------------------------------------------------------------
12195
54f9ee45
RD
12196FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12197FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12198FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
d14a1e28 12199class FlexGridSizer(GridSizer):
248ed943
RD
12200 """
12201 A flex grid sizer is a sizer which lays out its children in a
12202 two-dimensional table with all table cells in one row having the same
12203 height and all cells in one column having the same width, but all
12204 rows or all columns are not necessarily the same height or width as in
12205 the `wx.GridSizer`.
12206
12207 wx.FlexGridSizer can also size items equally in one direction but
12208 unequally ("flexibly") in the other. If the sizer is only flexible
12209 in one direction (this can be changed using `SetFlexibleDirection`), it
12210 needs to be decided how the sizer should grow in the other ("non
12211 flexible") direction in order to fill the available space. The
12212 `SetNonFlexibleGrowMode` method serves this purpose.
12213
12214
12215 """
0085ce49
RD
12216 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12217 __repr__ = _swig_repr
12218 def __init__(self, *args, **kwargs):
248ed943
RD
12219 """
12220 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
12221
12222 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
12223 number of columns and rows in the sizer - if either of the parameters
12224 is zero, it will be calculated to from the total number of children in
12225 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12226 define extra space between all children.
12227 """
0085ce49 12228 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d14a1e28 12229 self._setOORInfo(self)
e811c8ce 12230
248ed943
RD
12231 def AddGrowableRow(*args, **kwargs):
12232 """
12233 AddGrowableRow(self, size_t idx, int proportion=0)
e811c8ce 12234
248ed943
RD
12235 Specifies that row *idx* (starting from zero) should be grown if there
12236 is extra space available to the sizer.
e811c8ce 12237
248ed943
RD
12238 The *proportion* parameter has the same meaning as the stretch factor
12239 for the box sizers except that if all proportions are 0, then all
12240 columns are resized equally (instead of not being resized at all).
12241 """
54f9ee45 12242 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
e811c8ce
RD
12243
12244 def RemoveGrowableRow(*args, **kwargs):
248ed943
RD
12245 """
12246 RemoveGrowableRow(self, size_t idx)
12247
12248 Specifies that row *idx* is no longer growable.
12249 """
54f9ee45 12250 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
e811c8ce
RD
12251
12252 def AddGrowableCol(*args, **kwargs):
248ed943
RD
12253 """
12254 AddGrowableCol(self, size_t idx, int proportion=0)
12255
12256 Specifies that column *idx* (starting from zero) should be grown if
12257 there is extra space available to the sizer.
12258
12259 The *proportion* parameter has the same meaning as the stretch factor
12260 for the box sizers except that if all proportions are 0, then all
12261 columns are resized equally (instead of not being resized at all).
12262 """
54f9ee45 12263 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
e811c8ce
RD
12264
12265 def RemoveGrowableCol(*args, **kwargs):
248ed943
RD
12266 """
12267 RemoveGrowableCol(self, size_t idx)
12268
12269 Specifies that column *idx* is no longer growable.
12270 """
54f9ee45 12271 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
e811c8ce
RD
12272
12273 def SetFlexibleDirection(*args, **kwargs):
248ed943
RD
12274 """
12275 SetFlexibleDirection(self, int direction)
12276
12277 Specifies whether the sizer should flexibly resize its columns, rows,
12278 or both. Argument *direction* can be one of the following values. Any
12279 other value is ignored.
12280
12281 ============== =======================================
12282 wx.VERTICAL Rows are flexibly sized.
12283 wx.HORIZONTAL Columns are flexibly sized.
12284 wx.BOTH Both rows and columns are flexibly sized
12285 (this is the default value).
12286 ============== =======================================
12287
12288 Note that this method does not trigger relayout.
12289
12290 """
54f9ee45 12291 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
12292
12293 def GetFlexibleDirection(*args, **kwargs):
248ed943
RD
12294 """
12295 GetFlexibleDirection(self) -> int
12296
12297 Returns a value that specifies whether the sizer
12298 flexibly resizes its columns, rows, or both (default).
12299
12300 :see: `SetFlexibleDirection`
12301 """
54f9ee45 12302 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
e811c8ce
RD
12303
12304 def SetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
12305 """
12306 SetNonFlexibleGrowMode(self, int mode)
12307
12308 Specifies how the sizer should grow in the non-flexible direction if
12309 there is one (so `SetFlexibleDirection` must have been called
12310 previously). Argument *mode* can be one of the following values:
12311
12312 ========================== =================================================
12313 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
12314 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
12315 `AddGrowableCol` and `AddGrowableRow`. In this
12316 case equal sizing applies to minimum sizes of
12317 columns or rows (this is the default value).
12318 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
12319 the non flexible direction, whether they are
12320 growable or not in the flexbile direction.
12321 ========================== =================================================
12322
12323 Note that this method does not trigger relayout.
248ed943 12324 """
54f9ee45 12325 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
12326
12327 def GetNonFlexibleGrowMode(*args, **kwargs):
248ed943
RD
12328 """
12329 GetNonFlexibleGrowMode(self) -> int
12330
12331 Returns the value that specifies how the sizer grows in the
12332 non-flexible direction if there is one.
12333
12334 :see: `SetNonFlexibleGrowMode`
12335 """
54f9ee45 12336 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
e811c8ce
RD
12337
12338 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
12339 """
12340 GetRowHeights(self) -> list
12341
12342 Returns a list of integers representing the heights of each of the
12343 rows in the sizer.
12344 """
54f9ee45 12345 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
e811c8ce
RD
12346
12347 def GetColWidths(*args, **kwargs):
fd2dc343
RD
12348 """
12349 GetColWidths(self) -> list
12350
12351 Returns a list of integers representing the widths of each of the
12352 columns in the sizer.
12353 """
54f9ee45 12354 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
e811c8ce 12355
97ab0f6a
RD
12356 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
12357 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
12358 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
12359 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
2131d850 12360_core_.FlexGridSizer_swigregister(FlexGridSizer)
d14a1e28 12361
e505d15e
RD
12362class StdDialogButtonSizer(BoxSizer):
12363 """
12364 A special sizer that knows how to order and position standard buttons
12365 in order to conform to the current platform's standards. You simply
12366 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 12367 buttons using the standard ID's. Then call `Realize` and the sizer
e505d15e
RD
12368 will take care of the rest.
12369
12370 """
0085ce49
RD
12371 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12372 __repr__ = _swig_repr
12373 def __init__(self, *args, **kwargs):
e505d15e 12374 """__init__(self) -> StdDialogButtonSizer"""
0085ce49 12375 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
e505d15e
RD
12376 def AddButton(*args, **kwargs):
12377 """
12378 AddButton(self, wxButton button)
12379
12380 Use this to add the buttons to this sizer. Do not use the `Add`
12381 method in the base class.
12382 """
12383 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
12384
53aa7709 12385 def Realize(*args, **kwargs):
e505d15e 12386 """
53aa7709 12387 Realize(self)
e505d15e
RD
12388
12389 This funciton needs to be called after all the buttons have been added
12390 to the sizer. It will reorder them and position them in a platform
12391 specifc manner.
12392 """
53aa7709 12393 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
12394
12395 def SetAffirmativeButton(*args, **kwargs):
12396 """SetAffirmativeButton(self, wxButton button)"""
12397 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
12398
12399 def SetNegativeButton(*args, **kwargs):
12400 """SetNegativeButton(self, wxButton button)"""
12401 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
12402
12403 def SetCancelButton(*args, **kwargs):
12404 """SetCancelButton(self, wxButton button)"""
12405 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
e505d15e
RD
12406
12407 def GetAffirmativeButton(*args, **kwargs):
12408 """GetAffirmativeButton(self) -> wxButton"""
12409 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
12410
12411 def GetApplyButton(*args, **kwargs):
12412 """GetApplyButton(self) -> wxButton"""
12413 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
12414
12415 def GetNegativeButton(*args, **kwargs):
12416 """GetNegativeButton(self) -> wxButton"""
12417 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
12418
12419 def GetCancelButton(*args, **kwargs):
12420 """GetCancelButton(self) -> wxButton"""
12421 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
12422
12423 def GetHelpButton(*args, **kwargs):
12424 """GetHelpButton(self) -> wxButton"""
12425 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
12426
2131d850 12427_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
e505d15e 12428
d14a1e28
RD
12429#---------------------------------------------------------------------------
12430
12431class GBPosition(object):
248ed943
RD
12432 """
12433 This class represents the position of an item in a virtual grid of
12434 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12435 typemaps that will automatically convert from a 2-element sequence of
12436 integers to a wx.GBPosition, so you can use the more pythonic
12437 representation of the position nearly transparently in Python code.
12438 """
0085ce49
RD
12439 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12440 __repr__ = _swig_repr
12441 def __init__(self, *args, **kwargs):
248ed943
RD
12442 """
12443 __init__(self, int row=0, int col=0) -> GBPosition
12444
12445 This class represents the position of an item in a virtual grid of
12446 rows and columns managed by a `wx.GridBagSizer`. wxPython has
12447 typemaps that will automatically convert from a 2-element sequence of
12448 integers to a wx.GBPosition, so you can use the more pythonic
12449 representation of the position nearly transparently in Python code.
12450 """
0085ce49
RD
12451 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
12452 __swig_destroy__ = _core_.delete_GBPosition
12453 __del__ = lambda self : None;
e811c8ce 12454 def GetRow(*args, **kwargs):
a95a7133 12455 """GetRow(self) -> int"""
54f9ee45 12456 return _core_.GBPosition_GetRow(*args, **kwargs)
e811c8ce
RD
12457
12458 def GetCol(*args, **kwargs):
a95a7133 12459 """GetCol(self) -> int"""
54f9ee45 12460 return _core_.GBPosition_GetCol(*args, **kwargs)
e811c8ce
RD
12461
12462 def SetRow(*args, **kwargs):
a95a7133 12463 """SetRow(self, int row)"""
54f9ee45 12464 return _core_.GBPosition_SetRow(*args, **kwargs)
e811c8ce
RD
12465
12466 def SetCol(*args, **kwargs):
a95a7133 12467 """SetCol(self, int col)"""
54f9ee45 12468 return _core_.GBPosition_SetCol(*args, **kwargs)
e811c8ce
RD
12469
12470 def __eq__(*args, **kwargs):
e9d6f3a4
RD
12471 """
12472 __eq__(self, PyObject other) -> bool
12473
12474 Compare GBPosition for equality.
12475 """
54f9ee45 12476 return _core_.GBPosition___eq__(*args, **kwargs)
e811c8ce
RD
12477
12478 def __ne__(*args, **kwargs):
e9d6f3a4
RD
12479 """
12480 __ne__(self, PyObject other) -> bool
12481
12482 Compare GBPosition for inequality.
12483 """
54f9ee45 12484 return _core_.GBPosition___ne__(*args, **kwargs)
e811c8ce
RD
12485
12486 def Set(*args, **kwargs):
a95a7133 12487 """Set(self, int row=0, int col=0)"""
54f9ee45 12488 return _core_.GBPosition_Set(*args, **kwargs)
e811c8ce
RD
12489
12490 def Get(*args, **kwargs):
a95a7133 12491 """Get(self) -> PyObject"""
54f9ee45 12492 return _core_.GBPosition_Get(*args, **kwargs)
e811c8ce 12493
41e2b43e 12494 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
12495 def __str__(self): return str(self.Get())
12496 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
12497 def __len__(self): return len(self.Get())
12498 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
12499 def __setitem__(self, index, val):
12500 if index == 0: self.SetRow(val)
12501 elif index == 1: self.SetCol(val)
12502 else: raise IndexError
e811c8ce 12503 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
12504 __safe_for_unpickling__ = True
12505 def __reduce__(self): return (wx.GBPosition, self.Get())
d14a1e28
RD
12506
12507 row = property(GetRow, SetRow)
12508 col = property(GetCol, SetCol)
12509
2131d850 12510_core_.GBPosition_swigregister(GBPosition)
d14a1e28
RD
12511
12512class GBSpan(object):
248ed943
RD
12513 """
12514 This class is used to hold the row and column spanning attributes of
12515 items in a `wx.GridBagSizer`. wxPython has typemaps that will
12516 automatically convert from a 2-element sequence of integers to a
12517 wx.GBSpan, so you can use the more pythonic representation of the span
12518 nearly transparently in Python code.
12519
12520 """
0085ce49
RD
12521 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12522 __repr__ = _swig_repr
12523 def __init__(self, *args, **kwargs):
248ed943
RD
12524 """
12525 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
12526
12527 Construct a new wxGBSpan, optionally setting the rowspan and
12528 colspan. The default is (1,1). (Meaning that the item occupies one
12529 cell in each direction.
12530 """
0085ce49
RD
12531 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
12532 __swig_destroy__ = _core_.delete_GBSpan
12533 __del__ = lambda self : None;
e811c8ce 12534 def GetRowspan(*args, **kwargs):
a95a7133 12535 """GetRowspan(self) -> int"""
54f9ee45 12536 return _core_.GBSpan_GetRowspan(*args, **kwargs)
e811c8ce
RD
12537
12538 def GetColspan(*args, **kwargs):
a95a7133 12539 """GetColspan(self) -> int"""
54f9ee45 12540 return _core_.GBSpan_GetColspan(*args, **kwargs)
e811c8ce
RD
12541
12542 def SetRowspan(*args, **kwargs):
a95a7133 12543 """SetRowspan(self, int rowspan)"""
54f9ee45 12544 return _core_.GBSpan_SetRowspan(*args, **kwargs)
e811c8ce
RD
12545
12546 def SetColspan(*args, **kwargs):
a95a7133 12547 """SetColspan(self, int colspan)"""
54f9ee45 12548 return _core_.GBSpan_SetColspan(*args, **kwargs)
e811c8ce
RD
12549
12550 def __eq__(*args, **kwargs):
e9d6f3a4
RD
12551 """
12552 __eq__(self, PyObject other) -> bool
12553
12554 Compare wxGBSpan for equality.
12555 """
54f9ee45 12556 return _core_.GBSpan___eq__(*args, **kwargs)
e811c8ce
RD
12557
12558 def __ne__(*args, **kwargs):
e9d6f3a4
RD
12559 """
12560 __ne__(self, PyObject other) -> bool
12561
12562 Compare GBSpan for inequality.
12563 """
54f9ee45 12564 return _core_.GBSpan___ne__(*args, **kwargs)
e811c8ce
RD
12565
12566 def Set(*args, **kwargs):
a95a7133 12567 """Set(self, int rowspan=1, int colspan=1)"""
54f9ee45 12568 return _core_.GBSpan_Set(*args, **kwargs)
e811c8ce
RD
12569
12570 def Get(*args, **kwargs):
a95a7133 12571 """Get(self) -> PyObject"""
54f9ee45 12572 return _core_.GBSpan_Get(*args, **kwargs)
e811c8ce 12573
41e2b43e 12574 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
e811c8ce
RD
12575 def __str__(self): return str(self.Get())
12576 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
12577 def __len__(self): return len(self.Get())
12578 def __getitem__(self, index): return self.Get()[index]
d14a1e28
RD
12579 def __setitem__(self, index, val):
12580 if index == 0: self.SetRowspan(val)
12581 elif index == 1: self.SetColspan(val)
12582 else: raise IndexError
e811c8ce 12583 def __nonzero__(self): return self.Get() != (0,0)
74e96f3d
RD
12584 __safe_for_unpickling__ = True
12585 def __reduce__(self): return (wx.GBSpan, self.Get())
d14a1e28
RD
12586
12587 rowspan = property(GetRowspan, SetRowspan)
12588 colspan = property(GetColspan, SetColspan)
12589
2131d850 12590_core_.GBSpan_swigregister(GBSpan)
d14a1e28
RD
12591
12592class GBSizerItem(SizerItem):
248ed943
RD
12593 """
12594 The wx.GBSizerItem class is used to track the additional data about
12595 items in a `wx.GridBagSizer` such as the item's position in the grid
12596 and how many rows or columns it spans.
12597
12598 """
0085ce49
RD
12599 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12600 __repr__ = _swig_repr
12601 def __init__(self, *args, **kwargs):
248ed943
RD
12602 """
12603 __init__(self) -> GBSizerItem
12604
12605 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
12606 size will need to be set, as well as a position and span before this
12607 item can be used in a Sizer.
12608
12609 You will probably never need to create a wx.GBSizerItem directly as they
12610 are created automatically when the sizer's Add method is called.
12611 """
0085ce49
RD
12612 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
12613 __swig_destroy__ = _core_.delete_GBSizerItem
12614 __del__ = lambda self : None;
e811c8ce 12615 def GetPos(*args, **kwargs):
248ed943
RD
12616 """
12617 GetPos(self) -> GBPosition
12618
12619 Get the grid position of the item
12620 """
54f9ee45 12621 return _core_.GBSizerItem_GetPos(*args, **kwargs)
e811c8ce
RD
12622
12623 def GetPosTuple(self): return self.GetPos().Get()
12624 def GetSpan(*args, **kwargs):
248ed943
RD
12625 """
12626 GetSpan(self) -> GBSpan
12627
12628 Get the row and column spanning of the item
12629 """
54f9ee45 12630 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
e811c8ce
RD
12631
12632 def GetSpanTuple(self): return self.GetSpan().Get()
12633 def SetPos(*args, **kwargs):
248ed943
RD
12634 """
12635 SetPos(self, GBPosition pos) -> bool
12636
12637 If the item is already a member of a sizer then first ensure that
12638 there is no other item that would intersect with this one at the new
12639 position, then set the new position. Returns True if the change is
12640 successful and after the next Layout() the item will be moved.
12641 """
54f9ee45 12642 return _core_.GBSizerItem_SetPos(*args, **kwargs)
e811c8ce
RD
12643
12644 def SetSpan(*args, **kwargs):
248ed943
RD
12645 """
12646 SetSpan(self, GBSpan span) -> bool
12647
12648 If the item is already a member of a sizer then first ensure that
12649 there is no other item that would intersect with this one with its new
12650 spanning size, then set the new spanning. Returns True if the change
12651 is successful and after the next Layout() the item will be resized.
12652
12653 """
54f9ee45 12654 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
e811c8ce 12655
248ed943 12656 def Intersects(*args, **kwargs):
0df68c9f 12657 """
a95a7133 12658 Intersects(self, GBSizerItem other) -> bool
248ed943
RD
12659
12660 Returns True if this item and the other item instersect.
0df68c9f 12661 """
248ed943
RD
12662 return _core_.GBSizerItem_Intersects(*args, **kwargs)
12663
12664 def IntersectsPos(*args, **kwargs):
12665 """
12666 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
12667
12668 Returns True if the given pos/span would intersect with this item.
12669 """
12670 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
e811c8ce
RD
12671
12672 def GetEndPos(*args, **kwargs):
248ed943
RD
12673 """
12674 GetEndPos(self) -> GBPosition
12675
12676 Get the row and column of the endpoint of this item.
12677 """
54f9ee45 12678 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
e811c8ce
RD
12679
12680 def GetGBSizer(*args, **kwargs):
248ed943
RD
12681 """
12682 GetGBSizer(self) -> GridBagSizer
12683
12684 Get the sizer this item is a member of.
12685 """
54f9ee45 12686 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
e811c8ce
RD
12687
12688 def SetGBSizer(*args, **kwargs):
248ed943
RD
12689 """
12690 SetGBSizer(self, GridBagSizer sizer)
12691
12692 Set the sizer this item is a member of.
12693 """
54f9ee45 12694 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
e811c8ce 12695
97ab0f6a
RD
12696 EndPos = property(GetEndPos,doc="See `GetEndPos`")
12697 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
12698 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
12699 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
2131d850 12700_core_.GBSizerItem_swigregister(GBSizerItem)
d14a1e28
RD
12701DefaultSpan = cvar.DefaultSpan
12702
12703def GBSizerItemWindow(*args, **kwargs):
0df68c9f
RD
12704 """
12705 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12706 int border, PyObject userData=None) -> GBSizerItem
12707
12708 Construct a `wx.GBSizerItem` for a window.
0df68c9f 12709 """
54f9ee45 12710 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d14a1e28
RD
12711 return val
12712
12713def GBSizerItemSizer(*args, **kwargs):
0df68c9f
RD
12714 """
12715 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
248ed943
RD
12716 int border, PyObject userData=None) -> GBSizerItem
12717
12718 Construct a `wx.GBSizerItem` for a sizer
0df68c9f 12719 """
54f9ee45 12720 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d14a1e28
RD
12721 return val
12722
12723def GBSizerItemSpacer(*args, **kwargs):
0df68c9f
RD
12724 """
12725 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
248ed943
RD
12726 int flag, int border, PyObject userData=None) -> GBSizerItem
12727
12728 Construct a `wx.GBSizerItem` for a spacer.
0df68c9f 12729 """
54f9ee45 12730 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d14a1e28
RD
12731 return val
12732
12733class GridBagSizer(FlexGridSizer):
248ed943
RD
12734 """
12735 A `wx.Sizer` that can lay out items in a virtual grid like a
12736 `wx.FlexGridSizer` but in this case explicit positioning of the items
12737 is allowed using `wx.GBPosition`, and items can optionally span more
12738 than one row and/or column using `wx.GBSpan`. The total size of the
12739 virtual grid is determined by the largest row and column that items are
12740 positioned at, adjusted for spanning.
12741
12742 """
0085ce49
RD
12743 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12744 __repr__ = _swig_repr
12745 def __init__(self, *args, **kwargs):
248ed943
RD
12746 """
12747 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
12748
12749 Constructor, with optional parameters to specify the gap between the
12750 rows and columns.
12751 """
0085ce49 12752 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
1823fbb4
RD
12753 self._setOORInfo(self)
12754
e811c8ce 12755 def Add(*args, **kwargs):
0df68c9f 12756 """
248ed943 12757 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
d3b6e4ff 12758 int border=0, userData=None) -> wx.GBSizerItem
248ed943
RD
12759
12760 Adds an item to the sizer at the grid cell *pos*, optionally spanning
12761 more than one row or column as specified with *span*. The remaining
12762 args behave similarly to `wx.Sizer.Add`.
12763
12764 Returns True if the item was successfully placed at the given cell
12765 position, False if something was already there.
12766
0df68c9f 12767 """
54f9ee45 12768 return _core_.GridBagSizer_Add(*args, **kwargs)
e811c8ce
RD
12769
12770 def AddItem(*args, **kwargs):
248ed943 12771 """
d3b6e4ff 12772 Add(self, GBSizerItem item) -> wx.GBSizerItem
248ed943
RD
12773
12774 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
12775 the item was successfully placed at its given cell position, False if
12776 something was already there.
12777 """
54f9ee45 12778 return _core_.GridBagSizer_AddItem(*args, **kwargs)
e811c8ce 12779
84f85550
RD
12780 def GetCellSize(*args, **kwargs):
12781 """
12782 GetCellSize(self, int row, int col) -> Size
12783
12784 Get the size of the specified cell, including hgap and
12785 vgap. Only valid after a Layout.
12786 """
12787 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
12788
e811c8ce 12789 def GetEmptyCellSize(*args, **kwargs):
248ed943
RD
12790 """
12791 GetEmptyCellSize(self) -> Size
12792
12793 Get the size used for cells in the grid with no item.
12794 """
54f9ee45 12795 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
12796
12797 def SetEmptyCellSize(*args, **kwargs):
248ed943
RD
12798 """
12799 SetEmptyCellSize(self, Size sz)
12800
12801 Set the size used for cells in the grid with no item.
12802 """
54f9ee45 12803 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
e811c8ce
RD
12804
12805 def GetItemPosition(*args):
0df68c9f 12806 """
248ed943
RD
12807 GetItemPosition(self, item) -> GBPosition
12808
12809 Get the grid position of the specified *item* where *item* is either a
12810 window or subsizer that is a member of this sizer, or a zero-based
12811 index of an item.
0df68c9f 12812 """
54f9ee45 12813 return _core_.GridBagSizer_GetItemPosition(*args)
e811c8ce
RD
12814
12815 def SetItemPosition(*args):
0df68c9f 12816 """
248ed943
RD
12817 SetItemPosition(self, item, GBPosition pos) -> bool
12818
12819 Set the grid position of the specified *item* where *item* is either a
12820 window or subsizer that is a member of this sizer, or a zero-based
12821 index of an item. Returns True on success. If the move is not
12822 allowed (because an item is already there) then False is returned.
12823
0df68c9f 12824 """
54f9ee45 12825 return _core_.GridBagSizer_SetItemPosition(*args)
e811c8ce
RD
12826
12827 def GetItemSpan(*args):
0df68c9f 12828 """
248ed943
RD
12829 GetItemSpan(self, item) -> GBSpan
12830
12831 Get the row/col spanning of the specified *item* where *item* is
12832 either a window or subsizer that is a member of this sizer, or a
12833 zero-based index of an item.
0df68c9f 12834 """
54f9ee45 12835 return _core_.GridBagSizer_GetItemSpan(*args)
e811c8ce
RD
12836
12837 def SetItemSpan(*args):
0df68c9f 12838 """
248ed943
RD
12839 SetItemSpan(self, item, GBSpan span) -> bool
12840
12841 Set the row/col spanning of the specified *item* where *item* is
12842 either a window or subsizer that is a member of this sizer, or a
12843 zero-based index of an item. Returns True on success. If the move is
12844 not allowed (because an item is already there) then False is returned.
0df68c9f 12845 """
54f9ee45 12846 return _core_.GridBagSizer_SetItemSpan(*args)
e811c8ce
RD
12847
12848 def FindItem(*args):
0df68c9f 12849 """
248ed943
RD
12850 FindItem(self, item) -> GBSizerItem
12851
12852 Find the sizer item for the given window or subsizer, returns None if
12853 not found. (non-recursive)
0df68c9f 12854 """
54f9ee45 12855 return _core_.GridBagSizer_FindItem(*args)
e811c8ce
RD
12856
12857 def FindItemAtPosition(*args, **kwargs):
248ed943
RD
12858 """
12859 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
12860
12861 Return the sizer item for the given grid cell, or None if there is no
12862 item at that position. (non-recursive)
12863 """
54f9ee45 12864 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
e811c8ce
RD
12865
12866 def FindItemAtPoint(*args, **kwargs):
248ed943
RD
12867 """
12868 FindItemAtPoint(self, Point pt) -> GBSizerItem
12869
12870 Return the sizer item located at the point given in *pt*, or None if
12871 there is no item at that point. The (x,y) coordinates in pt correspond
12872 to the client coordinates of the window using the sizer for
12873 layout. (non-recursive)
12874 """
54f9ee45 12875 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
e811c8ce 12876
248ed943
RD
12877 def CheckForIntersection(*args, **kwargs):
12878 """
12879 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
e811c8ce 12880
248ed943
RD
12881 Look at all items and see if any intersect (or would overlap) the
12882 given *item*. Returns True if so, False if there would be no overlap.
12883 If an *excludeItem* is given then it will not be checked for
12884 intersection, for example it may be the item we are checking the
12885 position of.
e811c8ce 12886
248ed943
RD
12887 """
12888 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
e811c8ce 12889
248ed943 12890 def CheckForIntersectionPos(*args, **kwargs):
0df68c9f 12891 """
248ed943
RD
12892 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
12893
12894 Look at all items and see if any intersect (or would overlap) the
12895 given position and span. Returns True if so, False if there would be
12896 no overlap. If an *excludeItem* is given then it will not be checked
12897 for intersection, for example it may be the item we are checking the
12898 position of.
0df68c9f 12899 """
248ed943 12900 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
e811c8ce 12901
2131d850 12902_core_.GridBagSizer_swigregister(GridBagSizer)
d14a1e28
RD
12903
12904#---------------------------------------------------------------------------
12905
54f9ee45
RD
12906Left = _core_.Left
12907Top = _core_.Top
12908Right = _core_.Right
12909Bottom = _core_.Bottom
12910Width = _core_.Width
12911Height = _core_.Height
12912Centre = _core_.Centre
12913Center = _core_.Center
12914CentreX = _core_.CentreX
12915CentreY = _core_.CentreY
12916Unconstrained = _core_.Unconstrained
12917AsIs = _core_.AsIs
12918PercentOf = _core_.PercentOf
12919Above = _core_.Above
12920Below = _core_.Below
12921LeftOf = _core_.LeftOf
12922RightOf = _core_.RightOf
12923SameAs = _core_.SameAs
12924Absolute = _core_.Absolute
d14a1e28 12925class IndividualLayoutConstraint(Object):
15afbcd0 12926 """
41e2b43e
RD
12927 Objects of this class are stored in the `wx.LayoutConstraints` class as
12928 one of eight possible constraints that a window can be involved in.
12929 You will never need to create an instance of
12930 wx.IndividualLayoutConstraint, rather you should create a
12931 `wx.LayoutConstraints` instance and use the individual contstraints
15afbcd0 12932 that it contains.
15afbcd0 12933 """
0085ce49
RD
12934 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12935 def __init__(self): raise AttributeError, "No constructor defined"
12936 __repr__ = _swig_repr
e811c8ce 12937 def Set(*args, **kwargs):
41e2b43e
RD
12938 """
12939 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
12940
12941 Sets the properties of the constraint. Normally called by one of the
12942 convenience functions such as Above, RightOf, SameAs.
12943 """
54f9ee45 12944 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
e811c8ce
RD
12945
12946 def LeftOf(*args, **kwargs):
15afbcd0 12947 """
a95a7133 12948 LeftOf(self, Window sibling, int marg=0)
15afbcd0 12949
41e2b43e
RD
12950 Constrains this edge to be to the left of the given window, with an
12951 optional margin. Implicitly, this is relative to the left edge of the
12952 other window.
15afbcd0 12953 """
54f9ee45 12954 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
e811c8ce
RD
12955
12956 def RightOf(*args, **kwargs):
15afbcd0 12957 """
a95a7133 12958 RightOf(self, Window sibling, int marg=0)
15afbcd0 12959
41e2b43e
RD
12960 Constrains this edge to be to the right of the given window, with an
12961 optional margin. Implicitly, this is relative to the right edge of the
12962 other window.
15afbcd0 12963 """
54f9ee45 12964 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
e811c8ce
RD
12965
12966 def Above(*args, **kwargs):
15afbcd0 12967 """
a95a7133 12968 Above(self, Window sibling, int marg=0)
15afbcd0 12969
41e2b43e
RD
12970 Constrains this edge to be above the given window, with an optional
12971 margin. Implicitly, this is relative to the top edge of the other
12972 window.
15afbcd0 12973 """
54f9ee45 12974 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
e811c8ce
RD
12975
12976 def Below(*args, **kwargs):
15afbcd0 12977 """
a95a7133 12978 Below(self, Window sibling, int marg=0)
15afbcd0 12979
41e2b43e
RD
12980 Constrains this edge to be below the given window, with an optional
12981 margin. Implicitly, this is relative to the bottom edge of the other
12982 window.
15afbcd0 12983 """
54f9ee45 12984 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
e811c8ce
RD
12985
12986 def SameAs(*args, **kwargs):
15afbcd0 12987 """
a95a7133 12988 SameAs(self, Window otherW, int edge, int marg=0)
15afbcd0 12989
41e2b43e
RD
12990 Constrains this edge or dimension to be to the same as the edge of the
12991 given window, with an optional margin.
15afbcd0 12992 """
54f9ee45 12993 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
e811c8ce
RD
12994
12995 def PercentOf(*args, **kwargs):
15afbcd0 12996 """
a95a7133 12997 PercentOf(self, Window otherW, int wh, int per)
15afbcd0 12998
41e2b43e
RD
12999 Constrains this edge or dimension to be to a percentage of the given
13000 window, with an optional margin.
15afbcd0 13001 """
54f9ee45 13002 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
e811c8ce
RD
13003
13004 def Absolute(*args, **kwargs):
15afbcd0 13005 """
a95a7133 13006 Absolute(self, int val)
15afbcd0 13007
41e2b43e 13008 Constrains this edge or dimension to be the given absolute value.
15afbcd0 13009 """
54f9ee45 13010 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
e811c8ce
RD
13011
13012 def Unconstrained(*args, **kwargs):
15afbcd0 13013 """
a95a7133 13014 Unconstrained(self)
15afbcd0 13015
41e2b43e
RD
13016 Sets this edge or dimension to be unconstrained, that is, dependent on
13017 other edges and dimensions from which this value can be deduced.
15afbcd0 13018 """
54f9ee45 13019 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
e811c8ce
RD
13020
13021 def AsIs(*args, **kwargs):
15afbcd0 13022 """
a95a7133 13023 AsIs(self)
15afbcd0 13024
41e2b43e
RD
13025 Sets this edge or constraint to be whatever the window's value is at
13026 the moment. If either of the width and height constraints are *as is*,
13027 the window will not be resized, but moved instead. This is important
13028 when considering panel items which are intended to have a default
13029 size, such as a button, which may take its size from the size of the
13030 button label.
15afbcd0 13031 """
54f9ee45 13032 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
e811c8ce
RD
13033
13034 def GetOtherWindow(*args, **kwargs):
a95a7133 13035 """GetOtherWindow(self) -> Window"""
54f9ee45 13036 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
e811c8ce
RD
13037
13038 def GetMyEdge(*args, **kwargs):
a95a7133 13039 """GetMyEdge(self) -> int"""
54f9ee45 13040 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
e811c8ce
RD
13041
13042 def SetEdge(*args, **kwargs):
a95a7133 13043 """SetEdge(self, int which)"""
54f9ee45 13044 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
e811c8ce
RD
13045
13046 def SetValue(*args, **kwargs):
a95a7133 13047 """SetValue(self, int v)"""
54f9ee45 13048 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
e811c8ce
RD
13049
13050 def GetMargin(*args, **kwargs):
a95a7133 13051 """GetMargin(self) -> int"""
54f9ee45 13052 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
e811c8ce
RD
13053
13054 def SetMargin(*args, **kwargs):
a95a7133 13055 """SetMargin(self, int m)"""
54f9ee45 13056 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
e811c8ce
RD
13057
13058 def GetValue(*args, **kwargs):
a95a7133 13059 """GetValue(self) -> int"""
54f9ee45 13060 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
e811c8ce
RD
13061
13062 def GetPercent(*args, **kwargs):
a95a7133 13063 """GetPercent(self) -> int"""
54f9ee45 13064 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
e811c8ce
RD
13065
13066 def GetOtherEdge(*args, **kwargs):
a95a7133 13067 """GetOtherEdge(self) -> int"""
54f9ee45 13068 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
e811c8ce
RD
13069
13070 def GetDone(*args, **kwargs):
a95a7133 13071 """GetDone(self) -> bool"""
54f9ee45 13072 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
e811c8ce
RD
13073
13074 def SetDone(*args, **kwargs):
a95a7133 13075 """SetDone(self, bool d)"""
54f9ee45 13076 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
e811c8ce
RD
13077
13078 def GetRelationship(*args, **kwargs):
a95a7133 13079 """GetRelationship(self) -> int"""
54f9ee45 13080 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
e811c8ce
RD
13081
13082 def SetRelationship(*args, **kwargs):
a95a7133 13083 """SetRelationship(self, int r)"""
54f9ee45 13084 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
e811c8ce
RD
13085
13086 def ResetIfWin(*args, **kwargs):
15afbcd0 13087 """
a95a7133 13088 ResetIfWin(self, Window otherW) -> bool
15afbcd0
RD
13089
13090 Reset constraint if it mentions otherWin
13091 """
54f9ee45 13092 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
e811c8ce
RD
13093
13094 def SatisfyConstraint(*args, **kwargs):
15afbcd0 13095 """
a95a7133 13096 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
15afbcd0
RD
13097
13098 Try to satisfy constraint
13099 """
54f9ee45 13100 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
e811c8ce
RD
13101
13102 def GetEdge(*args, **kwargs):
15afbcd0 13103 """
a95a7133 13104 GetEdge(self, int which, Window thisWin, Window other) -> int
15afbcd0
RD
13105
13106 Get the value of this edge or dimension, or if this
13107 is not determinable, -1.
13108 """
54f9ee45 13109 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
e811c8ce 13110
97ab0f6a
RD
13111 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
13112 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
13113 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
13114 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
13115 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
13116 Percent = property(GetPercent,doc="See `GetPercent`")
13117 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
13118 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
2131d850 13119_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d14a1e28
RD
13120
13121class LayoutConstraints(Object):
15afbcd0 13122 """
41e2b43e
RD
13123 **Note:** constraints are now deprecated and you should use sizers
13124 instead.
15afbcd0 13125
41e2b43e
RD
13126 Objects of this class can be associated with a window to define its
13127 layout constraints, with respect to siblings or its parent.
15afbcd0
RD
13128
13129 The class consists of the following eight constraints of class
13130 wx.IndividualLayoutConstraint, some or all of which should be accessed
13131 directly to set the appropriate constraints.
13132
13133 * left: represents the left hand edge of the window
13134 * right: represents the right hand edge of the window
13135 * top: represents the top edge of the window
13136 * bottom: represents the bottom edge of the window
13137 * width: represents the width of the window
13138 * height: represents the height of the window
13139 * centreX: represents the horizontal centre point of the window
13140 * centreY: represents the vertical centre point of the window
13141
41e2b43e
RD
13142 Most constraints are initially set to have the relationship
13143 wxUnconstrained, which means that their values should be calculated by
13144 looking at known constraints. The exceptions are width and height,
13145 which are set to wxAsIs to ensure that if the user does not specify a
13146 constraint, the existing width and height will be used, to be
13147 compatible with panel items which often have take a default size. If
13148 the constraint is ``wx.AsIs``, the dimension will not be changed.
13149
13150 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
15afbcd0
RD
13151
13152 """
0085ce49
RD
13153 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13154 __repr__ = _swig_repr
54f9ee45
RD
13155 left = property(_core_.LayoutConstraints_left_get)
13156 top = property(_core_.LayoutConstraints_top_get)
13157 right = property(_core_.LayoutConstraints_right_get)
13158 bottom = property(_core_.LayoutConstraints_bottom_get)
13159 width = property(_core_.LayoutConstraints_width_get)
13160 height = property(_core_.LayoutConstraints_height_get)
13161 centreX = property(_core_.LayoutConstraints_centreX_get)
13162 centreY = property(_core_.LayoutConstraints_centreY_get)
0085ce49 13163 def __init__(self, *args, **kwargs):
a95a7133 13164 """__init__(self) -> LayoutConstraints"""
0085ce49
RD
13165 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
13166 __swig_destroy__ = _core_.delete_LayoutConstraints
13167 __del__ = lambda self : None;
e811c8ce 13168 def SatisfyConstraints(*args, **kwargs):
6c3b4aae 13169 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
54f9ee45 13170 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
e811c8ce
RD
13171
13172 def AreSatisfied(*args, **kwargs):
a95a7133 13173 """AreSatisfied(self) -> bool"""
54f9ee45 13174 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
e811c8ce 13175
2131d850 13176_core_.LayoutConstraints_swigregister(LayoutConstraints)
d14a1e28
RD
13177
13178#----------------------------------------------------------------------------
13179
322913ce 13180# Use Python's bool constants if available, make some if not
d14a1e28
RD
13181try:
13182 True
13183except NameError:
322913ce
RD
13184 __builtins__.True = 1==1
13185 __builtins__.False = 1==0
4f89f6a3
RD
13186 def bool(value): return not not value
13187 __builtins__.bool = bool
d14a1e28 13188
d14a1e28
RD
13189
13190
13191# workarounds for bad wxRTTI names
13192__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
13193__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
13194__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
13195
13196
13197#----------------------------------------------------------------------------
13198# Load version numbers from __version__... Ensure that major and minor
7bc1e663 13199# versions are the same for both wxPython and wxWidgets.
d14a1e28
RD
13200
13201from __version__ import *
13202__version__ = VERSION_STRING
13203
7bc1e663
RD
13204assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
13205assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
54f9ee45 13206if RELEASE_VERSION != _core_.RELEASE_VERSION:
d14a1e28 13207 import warnings
7bc1e663 13208 warnings.warn("wxPython/wxWidgets release number mismatch")
d14a1e28
RD
13209
13210#----------------------------------------------------------------------------
13211
70b7a5fe
RD
13212# Set wxPython's default string<-->unicode conversion encoding from
13213# the locale, but only if Python's default hasn't been changed. (We
13214# assume that if the user has customized it already then that is the
13215# encoding we need to use as well.)
13216#
13217# The encoding selected here is used when string or unicode objects
13218# need to be converted in order to pass them to wxWidgets. Please be
13219# aware that the default encoding within the same locale may be
13220# slightly different on different platforms. For example, please see
e505d15e
RD
13221# http://www.alanwood.net/demos/charsetdiffs.html for differences
13222# between the common latin/roman encodings.
396fb509
RD
13223
13224default = _sys.getdefaultencoding()
13225if default == 'ascii':
13226 import locale
13227 import codecs
13228 try:
13229 default = locale.getdefaultlocale()[1]
13230 codecs.lookup(default)
70b7a5fe 13231 except (ValueError, LookupError, TypeError):
396fb509
RD
13232 default = _sys.getdefaultencoding()
13233 del locale
13234 del codecs
5cbf236d
RD
13235if default:
13236 wx.SetDefaultPyEncoding(default)
13237del default
5cbf236d
RD
13238
13239#----------------------------------------------------------------------------
13240
d14a1e28
RD
13241class PyDeadObjectError(AttributeError):
13242 pass
13243
d14a1e28
RD
13244class _wxPyDeadObject(object):
13245 """
13246 Instances of wx objects that are OOR capable will have their __class__
13247 changed to this class when the C++ object is deleted. This should help
13248 prevent crashes due to referencing a bogus C++ pointer.
13249 """
13250 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
13251 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
13252
3a04f143 13253 def __repr__(self):
d14a1e28
RD
13254 if not hasattr(self, "_name"):
13255 self._name = "[unknown]"
13256 return self.reprStr % self._name
13257
3a04f143 13258 def __getattr__(self, *args):
d14a1e28
RD
13259 if not hasattr(self, "_name"):
13260 self._name = "[unknown]"
3a04f143
RD
13261 raise PyDeadObjectError(self.attrStr % self._name)
13262
13263 def __nonzero__(self):
13264 return 0
13265
13266
13267
13268class PyUnbornObjectError(AttributeError):
13269 pass
13270
13271class _wxPyUnbornObject(object):
13272 """
54f9ee45 13273 Some stock objects are created when the wx._core module is
3a04f143
RD
13274 imported, but their C++ instance is not created until the wx.App
13275 object is created and initialized. These object instances will
13276 temporarily have their __class__ changed to this class so an
13277 exception will be raised if they are used before the C++ instance
13278 is ready.
13279 """
13280
13281 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
13282 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
13283
13284 def __repr__(self):
13285 #if not hasattr(self, "_name"):
13286 # self._name = "[unknown]"
13287 return self.reprStr #% self._name
13288
13289 def __getattr__(self, *args):
13290 #if not hasattr(self, "_name"):
13291 # self._name = "[unknown]"
13292 raise PyUnbornObjectError(self.attrStr) # % self._name )
d14a1e28
RD
13293
13294 def __nonzero__(self):
13295 return 0
13296
13297
13298#----------------------------------------------------------------------------
d14a1e28
RD
13299
13300def CallAfter(callable, *args, **kw):
13301 """
13302 Call the specified function after the current and pending event
13303 handlers have been completed. This is also good for making GUI
61863841
RD
13304 method calls from non-GUI threads. Any extra positional or
13305 keyword args are passed on to the callable when it is called.
13306
13307 :see: `wx.FutureCall`
d14a1e28
RD
13308 """
13309 app = wx.GetApp()
dfbb5885 13310 assert app is not None, 'No wx.App created yet'
d14a1e28 13311
148275d3
RD
13312 if not hasattr(app, "_CallAfterId"):
13313 app._CallAfterId = wx.NewEventType()
13314 app.Connect(-1, -1, app._CallAfterId,
13315 lambda event: event.callable(*event.args, **event.kw) )
d14a1e28 13316 evt = wx.PyEvent()
148275d3 13317 evt.SetEventType(app._CallAfterId)
d14a1e28
RD
13318 evt.callable = callable
13319 evt.args = args
13320 evt.kw = kw
13321 wx.PostEvent(app, evt)
13322
d14a1e28
RD
13323#----------------------------------------------------------------------------
13324
13325
13326class FutureCall:
13327 """
8ac8dba0 13328 A convenience class for `wx.Timer`, that calls the given callable
d14a1e28
RD
13329 object once after the given amount of milliseconds, passing any
13330 positional or keyword args. The return value of the callable is
61863841 13331 availbale after it has been run with the `GetResult` method.
d14a1e28
RD
13332
13333 If you don't need to get the return value or restart the timer
13334 then there is no need to hold a reference to this object. It will
13335 hold a reference to itself while the timer is running (the timer
13336 has a reference to self.Notify) but the cycle will be broken when
13337 the timer completes, automatically cleaning up the wx.FutureCall
13338 object.
61863841
RD
13339
13340 :see: `wx.CallAfter`
d14a1e28
RD
13341 """
13342 def __init__(self, millis, callable, *args, **kwargs):
13343 self.millis = millis
13344 self.callable = callable
13345 self.SetArgs(*args, **kwargs)
13346 self.runCount = 0
4276dc52 13347 self.running = False
d14a1e28
RD
13348 self.hasRun = False
13349 self.result = None
13350 self.timer = None
13351 self.Start()
13352
13353 def __del__(self):
13354 self.Stop()
13355
13356
13357 def Start(self, millis=None, *args, **kwargs):
13358 """
13359 (Re)start the timer
13360 """
13361 self.hasRun = False
13362 if millis is not None:
13363 self.millis = millis
13364 if args or kwargs:
13365 self.SetArgs(*args, **kwargs)
13366 self.Stop()
13367 self.timer = wx.PyTimer(self.Notify)
13368 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
4276dc52 13369 self.running = True
d14a1e28
RD
13370 Restart = Start
13371
13372
13373 def Stop(self):
13374 """
13375 Stop and destroy the timer.
13376 """
13377 if self.timer is not None:
13378 self.timer.Stop()
13379 self.timer = None
13380
13381
13382 def GetInterval(self):
13383 if self.timer is not None:
13384 return self.timer.GetInterval()
13385 else:
13386 return 0
13387
13388
13389 def IsRunning(self):
13390 return self.timer is not None and self.timer.IsRunning()
13391
13392
13393 def SetArgs(self, *args, **kwargs):
13394 """
13395 (Re)set the args passed to the callable object. This is
13396 useful in conjunction with Restart if you want to schedule a
13397 new call to the same callable object but with different
13398 parameters.
13399 """
13400 self.args = args
13401 self.kwargs = kwargs
13402
13403
13404 def HasRun(self):
13405 return self.hasRun
13406
13407 def GetResult(self):
13408 return self.result
13409
13410 def Notify(self):
13411 """
13412 The timer has expired so call the callable.
13413 """
13414 if self.callable and getattr(self.callable, 'im_self', True):
13415 self.runCount += 1
4276dc52 13416 self.running = False
d14a1e28
RD
13417 self.result = self.callable(*self.args, **self.kwargs)
13418 self.hasRun = True
4276dc52
RD
13419 if not self.running:
13420 # if it wasn't restarted, then cleanup
13421 wx.CallAfter(self.Stop)
d14a1e28 13422
97ab0f6a
RD
13423 Interval = property(GetInterval)
13424 Result = property(GetResult)
d14a1e28 13425
a95a7133
RD
13426
13427#----------------------------------------------------------------------------
13428# Control which items in this module should be documented by epydoc.
13429# We allow only classes and functions, which will help reduce the size
13430# of the docs by filtering out the zillions of constants, EVT objects,
13431# and etc that don't make much sense by themselves, but are instead
13432# documented (or will be) as part of the classes/functions/methods
13433# where they should be used.
13434
66c033b4
RD
13435class __DocFilter:
13436 """
13437 A filter for epydoc that only allows non-Ptr classes and
34e0a3bb 13438 functions, in order to reduce the clutter in the API docs.
66c033b4
RD
13439 """
13440 def __init__(self, globals):
13441 self._globals = globals
13442
13443 def __call__(self, name):
13444 import types
13445 obj = self._globals.get(name, None)
34e0a3bb
RD
13446
13447 # only document classes and function
66c033b4
RD
13448 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
13449 return False
34e0a3bb
RD
13450
13451 # skip other things that are private or will be documented as part of somethign else
0085ce49 13452 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
66c033b4 13453 return False
34e0a3bb
RD
13454
13455 # skip functions that are duplicates of static functions in a class
13456 if name.find('_') != -1:
13457 cls = self._globals.get(name.split('_')[0], None)
13458 methname = name.split('_')[1]
13459 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
13460 return False
13461
66c033b4 13462 return True
a95a7133 13463
d14a1e28
RD
13464#----------------------------------------------------------------------------
13465#----------------------------------------------------------------------------
13466
13467# Import other modules in this package that should show up in the
13468# "core" wx namespace
54f9ee45
RD
13469from _gdi import *
13470from _windows import *
13471from _controls import *
13472from _misc import *
d14a1e28
RD
13473
13474#----------------------------------------------------------------------------
13475#----------------------------------------------------------------------------
13476
13477
32fe5131 13478