]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/mac/_core.py
Elippsis and markup support for wxStaticText
[wxWidgets.git] / wxPython / src / mac / _core.py
CommitLineData
1bd55598 1# This file was created automatically by SWIG 1.3.29.
d55e5bfc
RD
2# Don't modify this file, modify the SWIG interface instead.
3
5b5c9bc7 4import _core_
1bd55598
RD
5import new
6new_instancemethod = new.instancemethod
36ed4f51 7def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
1bd55598 8 if (name == "thisown"): return self.this.own(value)
36ed4f51 9 if (name == "this"):
1bd55598
RD
10 if type(value).__name__ == 'PySwigObject':
11 self.__dict__[name] = value
36ed4f51
RD
12 return
13 method = class_type.__swig_setmethods__.get(name,None)
14 if method: return method(self,value)
1bd55598 15 if (not static) or hasattr(self,name):
36ed4f51
RD
16 self.__dict__[name] = value
17 else:
18 raise AttributeError("You cannot add attributes to %s" % self)
19
20def _swig_setattr(self,class_type,name,value):
21 return _swig_setattr_nondynamic(self,class_type,name,value,0)
22
23def _swig_getattr(self,class_type,name):
1bd55598 24 if (name == "thisown"): return self.this.own()
36ed4f51
RD
25 method = class_type.__swig_getmethods__.get(name,None)
26 if method: return method(self)
27 raise AttributeError,name
28
1bd55598
RD
29def _swig_repr(self):
30 try: strthis = "proxy of " + self.this.__repr__()
31 except: strthis = ""
32 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
33
36ed4f51
RD
34import types
35try:
36 _object = types.ObjectType
37 _newclass = 1
38except AttributeError:
39 class _object : pass
40 _newclass = 0
41del types
42
43
44def _swig_setattr_nondynamic_method(set):
45 def set_attr(self,name,value):
1bd55598
RD
46 if (name == "thisown"): return self.this.own(value)
47 if hasattr(self,name) or (name == "this"):
36ed4f51
RD
48 set(self,name,value)
49 else:
50 raise AttributeError("You cannot add attributes to %s" % self)
51 return set_attr
52
53
d55e5bfc
RD
54#// Give a reference to the dictionary of this module to the C++ extension
55#// code.
56_core_._wxPySetDictionary(vars())
57
58#// A little trick to make 'wx' be a reference to this module so wx.Names can
59#// be used here.
60import sys as _sys
61wx = _sys.modules[__name__]
62
d6c14a4c
RD
63
64#----------------------------------------------------------------------------
65
66def _deprecated(callable, msg=None):
67 """
68 Create a wrapper function that will raise a DeprecationWarning
69 before calling the callable.
70 """
71 if msg is None:
72 msg = "%s is deprecated" % callable
73 def deprecatedWrapper(*args, **kwargs):
74 import warnings
75 warnings.warn(msg, DeprecationWarning, stacklevel=2)
76 return callable(*args, **kwargs)
77 deprecatedWrapper.__doc__ = msg
78 return deprecatedWrapper
79
80
81#----------------------------------------------------------------------------
82
5b5c9bc7
RD
83NOT_FOUND = _core_.NOT_FOUND
84VSCROLL = _core_.VSCROLL
85HSCROLL = _core_.HSCROLL
86CAPTION = _core_.CAPTION
87DOUBLE_BORDER = _core_.DOUBLE_BORDER
88SUNKEN_BORDER = _core_.SUNKEN_BORDER
89RAISED_BORDER = _core_.RAISED_BORDER
90BORDER = _core_.BORDER
91SIMPLE_BORDER = _core_.SIMPLE_BORDER
92STATIC_BORDER = _core_.STATIC_BORDER
93TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
94NO_BORDER = _core_.NO_BORDER
95DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
6d88e192 96DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
5b5c9bc7
RD
97TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
98WANTS_CHARS = _core_.WANTS_CHARS
99POPUP_WINDOW = _core_.POPUP_WINDOW
100CENTER_FRAME = _core_.CENTER_FRAME
101CENTRE_ON_SCREEN = _core_.CENTRE_ON_SCREEN
102CENTER_ON_SCREEN = _core_.CENTER_ON_SCREEN
103CLIP_CHILDREN = _core_.CLIP_CHILDREN
104CLIP_SIBLINGS = _core_.CLIP_SIBLINGS
092f0ed7 105WINDOW_STYLE_MASK = _core_.WINDOW_STYLE_MASK
5b5c9bc7
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
5b5c9bc7
RD
119CB_SIMPLE = _core_.CB_SIMPLE
120CB_DROPDOWN = _core_.CB_DROPDOWN
121CB_SORT = _core_.CB_SORT
122CB_READONLY = _core_.CB_READONLY
123RA_HORIZONTAL = _core_.RA_HORIZONTAL
124RA_VERTICAL = _core_.RA_VERTICAL
125RA_SPECIFY_ROWS = _core_.RA_SPECIFY_ROWS
126RA_SPECIFY_COLS = _core_.RA_SPECIFY_COLS
127RA_USE_CHECKBOX = _core_.RA_USE_CHECKBOX
128RB_GROUP = _core_.RB_GROUP
129RB_SINGLE = _core_.RB_SINGLE
130SB_HORIZONTAL = _core_.SB_HORIZONTAL
131SB_VERTICAL = _core_.SB_VERTICAL
132RB_USE_CHECKBOX = _core_.RB_USE_CHECKBOX
133ST_SIZEGRIP = _core_.ST_SIZEGRIP
134ST_NO_AUTORESIZE = _core_.ST_NO_AUTORESIZE
e9d6f3a4
RD
135ST_DOTS_MIDDLE = _core_.ST_DOTS_MIDDLE
136ST_DOTS_END = _core_.ST_DOTS_END
5b5c9bc7
RD
137FLOOD_SURFACE = _core_.FLOOD_SURFACE
138FLOOD_BORDER = _core_.FLOOD_BORDER
139ODDEVEN_RULE = _core_.ODDEVEN_RULE
140WINDING_RULE = _core_.WINDING_RULE
141TOOL_TOP = _core_.TOOL_TOP
142TOOL_BOTTOM = _core_.TOOL_BOTTOM
143TOOL_LEFT = _core_.TOOL_LEFT
144TOOL_RIGHT = _core_.TOOL_RIGHT
145OK = _core_.OK
146YES_NO = _core_.YES_NO
147CANCEL = _core_.CANCEL
148YES = _core_.YES
149NO = _core_.NO
150NO_DEFAULT = _core_.NO_DEFAULT
151YES_DEFAULT = _core_.YES_DEFAULT
152ICON_EXCLAMATION = _core_.ICON_EXCLAMATION
153ICON_HAND = _core_.ICON_HAND
154ICON_QUESTION = _core_.ICON_QUESTION
155ICON_INFORMATION = _core_.ICON_INFORMATION
156ICON_STOP = _core_.ICON_STOP
157ICON_ASTERISK = _core_.ICON_ASTERISK
158ICON_MASK = _core_.ICON_MASK
159ICON_WARNING = _core_.ICON_WARNING
160ICON_ERROR = _core_.ICON_ERROR
161FORWARD = _core_.FORWARD
162BACKWARD = _core_.BACKWARD
163RESET = _core_.RESET
164HELP = _core_.HELP
165MORE = _core_.MORE
166SETUP = _core_.SETUP
167SIZE_AUTO_WIDTH = _core_.SIZE_AUTO_WIDTH
168SIZE_AUTO_HEIGHT = _core_.SIZE_AUTO_HEIGHT
169SIZE_AUTO = _core_.SIZE_AUTO
170SIZE_USE_EXISTING = _core_.SIZE_USE_EXISTING
171SIZE_ALLOW_MINUS_ONE = _core_.SIZE_ALLOW_MINUS_ONE
943e8dfd 172SIZE_FORCE = _core_.SIZE_FORCE
5b5c9bc7
RD
173PORTRAIT = _core_.PORTRAIT
174LANDSCAPE = _core_.LANDSCAPE
175PRINT_QUALITY_HIGH = _core_.PRINT_QUALITY_HIGH
176PRINT_QUALITY_MEDIUM = _core_.PRINT_QUALITY_MEDIUM
177PRINT_QUALITY_LOW = _core_.PRINT_QUALITY_LOW
178PRINT_QUALITY_DRAFT = _core_.PRINT_QUALITY_DRAFT
179ID_ANY = _core_.ID_ANY
180ID_SEPARATOR = _core_.ID_SEPARATOR
943e8dfd 181ID_NONE = _core_.ID_NONE
5b5c9bc7
RD
182ID_LOWEST = _core_.ID_LOWEST
183ID_OPEN = _core_.ID_OPEN
184ID_CLOSE = _core_.ID_CLOSE
185ID_NEW = _core_.ID_NEW
186ID_SAVE = _core_.ID_SAVE
187ID_SAVEAS = _core_.ID_SAVEAS
188ID_REVERT = _core_.ID_REVERT
189ID_EXIT = _core_.ID_EXIT
190ID_UNDO = _core_.ID_UNDO
191ID_REDO = _core_.ID_REDO
192ID_HELP = _core_.ID_HELP
193ID_PRINT = _core_.ID_PRINT
194ID_PRINT_SETUP = _core_.ID_PRINT_SETUP
fc46b7f3 195ID_PAGE_SETUP = _core_.ID_PAGE_SETUP
5b5c9bc7
RD
196ID_PREVIEW = _core_.ID_PREVIEW
197ID_ABOUT = _core_.ID_ABOUT
198ID_HELP_CONTENTS = _core_.ID_HELP_CONTENTS
199ID_HELP_COMMANDS = _core_.ID_HELP_COMMANDS
200ID_HELP_PROCEDURES = _core_.ID_HELP_PROCEDURES
201ID_HELP_CONTEXT = _core_.ID_HELP_CONTEXT
1eeb270e
RD
202ID_HELP_INDEX = _core_.ID_HELP_INDEX
203ID_HELP_SEARCH = _core_.ID_HELP_SEARCH
5b5c9bc7
RD
204ID_CLOSE_ALL = _core_.ID_CLOSE_ALL
205ID_PREFERENCES = _core_.ID_PREFERENCES
ac5d357a 206ID_EDIT = _core_.ID_EDIT
5b5c9bc7
RD
207ID_CUT = _core_.ID_CUT
208ID_COPY = _core_.ID_COPY
209ID_PASTE = _core_.ID_PASTE
210ID_CLEAR = _core_.ID_CLEAR
211ID_FIND = _core_.ID_FIND
212ID_DUPLICATE = _core_.ID_DUPLICATE
213ID_SELECTALL = _core_.ID_SELECTALL
214ID_DELETE = _core_.ID_DELETE
215ID_REPLACE = _core_.ID_REPLACE
216ID_REPLACE_ALL = _core_.ID_REPLACE_ALL
217ID_PROPERTIES = _core_.ID_PROPERTIES
218ID_VIEW_DETAILS = _core_.ID_VIEW_DETAILS
219ID_VIEW_LARGEICONS = _core_.ID_VIEW_LARGEICONS
220ID_VIEW_SMALLICONS = _core_.ID_VIEW_SMALLICONS
221ID_VIEW_LIST = _core_.ID_VIEW_LIST
222ID_VIEW_SORTDATE = _core_.ID_VIEW_SORTDATE
223ID_VIEW_SORTNAME = _core_.ID_VIEW_SORTNAME
224ID_VIEW_SORTSIZE = _core_.ID_VIEW_SORTSIZE
225ID_VIEW_SORTTYPE = _core_.ID_VIEW_SORTTYPE
ac5d357a 226ID_FILE = _core_.ID_FILE
5b5c9bc7
RD
227ID_FILE1 = _core_.ID_FILE1
228ID_FILE2 = _core_.ID_FILE2
229ID_FILE3 = _core_.ID_FILE3
230ID_FILE4 = _core_.ID_FILE4
231ID_FILE5 = _core_.ID_FILE5
232ID_FILE6 = _core_.ID_FILE6
233ID_FILE7 = _core_.ID_FILE7
234ID_FILE8 = _core_.ID_FILE8
235ID_FILE9 = _core_.ID_FILE9
236ID_OK = _core_.ID_OK
237ID_CANCEL = _core_.ID_CANCEL
238ID_APPLY = _core_.ID_APPLY
239ID_YES = _core_.ID_YES
240ID_NO = _core_.ID_NO
241ID_STATIC = _core_.ID_STATIC
242ID_FORWARD = _core_.ID_FORWARD
243ID_BACKWARD = _core_.ID_BACKWARD
244ID_DEFAULT = _core_.ID_DEFAULT
245ID_MORE = _core_.ID_MORE
246ID_SETUP = _core_.ID_SETUP
247ID_RESET = _core_.ID_RESET
248ID_CONTEXT_HELP = _core_.ID_CONTEXT_HELP
249ID_YESTOALL = _core_.ID_YESTOALL
250ID_NOTOALL = _core_.ID_NOTOALL
251ID_ABORT = _core_.ID_ABORT
252ID_RETRY = _core_.ID_RETRY
253ID_IGNORE = _core_.ID_IGNORE
254ID_ADD = _core_.ID_ADD
255ID_REMOVE = _core_.ID_REMOVE
256ID_UP = _core_.ID_UP
257ID_DOWN = _core_.ID_DOWN
258ID_HOME = _core_.ID_HOME
259ID_REFRESH = _core_.ID_REFRESH
260ID_STOP = _core_.ID_STOP
261ID_INDEX = _core_.ID_INDEX
262ID_BOLD = _core_.ID_BOLD
263ID_ITALIC = _core_.ID_ITALIC
264ID_JUSTIFY_CENTER = _core_.ID_JUSTIFY_CENTER
265ID_JUSTIFY_FILL = _core_.ID_JUSTIFY_FILL
266ID_JUSTIFY_RIGHT = _core_.ID_JUSTIFY_RIGHT
267ID_JUSTIFY_LEFT = _core_.ID_JUSTIFY_LEFT
268ID_UNDERLINE = _core_.ID_UNDERLINE
269ID_INDENT = _core_.ID_INDENT
270ID_UNINDENT = _core_.ID_UNINDENT
271ID_ZOOM_100 = _core_.ID_ZOOM_100
272ID_ZOOM_FIT = _core_.ID_ZOOM_FIT
273ID_ZOOM_IN = _core_.ID_ZOOM_IN
274ID_ZOOM_OUT = _core_.ID_ZOOM_OUT
275ID_UNDELETE = _core_.ID_UNDELETE
276ID_REVERT_TO_SAVED = _core_.ID_REVERT_TO_SAVED
277ID_HIGHEST = _core_.ID_HIGHEST
5b5c9bc7
RD
278MENU_TEAROFF = _core_.MENU_TEAROFF
279MB_DOCKABLE = _core_.MB_DOCKABLE
280NO_FULL_REPAINT_ON_RESIZE = _core_.NO_FULL_REPAINT_ON_RESIZE
281FULL_REPAINT_ON_RESIZE = _core_.FULL_REPAINT_ON_RESIZE
282LI_HORIZONTAL = _core_.LI_HORIZONTAL
283LI_VERTICAL = _core_.LI_VERTICAL
284WS_EX_VALIDATE_RECURSIVELY = _core_.WS_EX_VALIDATE_RECURSIVELY
285WS_EX_BLOCK_EVENTS = _core_.WS_EX_BLOCK_EVENTS
286WS_EX_TRANSIENT = _core_.WS_EX_TRANSIENT
287WS_EX_THEMED_BACKGROUND = _core_.WS_EX_THEMED_BACKGROUND
288WS_EX_PROCESS_IDLE = _core_.WS_EX_PROCESS_IDLE
289WS_EX_PROCESS_UI_UPDATES = _core_.WS_EX_PROCESS_UI_UPDATES
290MM_TEXT = _core_.MM_TEXT
291MM_LOMETRIC = _core_.MM_LOMETRIC
292MM_HIMETRIC = _core_.MM_HIMETRIC
293MM_LOENGLISH = _core_.MM_LOENGLISH
294MM_HIENGLISH = _core_.MM_HIENGLISH
295MM_TWIPS = _core_.MM_TWIPS
296MM_ISOTROPIC = _core_.MM_ISOTROPIC
297MM_ANISOTROPIC = _core_.MM_ANISOTROPIC
298MM_POINTS = _core_.MM_POINTS
299MM_METRIC = _core_.MM_METRIC
300CENTRE = _core_.CENTRE
301CENTER = _core_.CENTER
302HORIZONTAL = _core_.HORIZONTAL
303VERTICAL = _core_.VERTICAL
304BOTH = _core_.BOTH
305LEFT = _core_.LEFT
306RIGHT = _core_.RIGHT
307UP = _core_.UP
308DOWN = _core_.DOWN
309TOP = _core_.TOP
310BOTTOM = _core_.BOTTOM
311NORTH = _core_.NORTH
312SOUTH = _core_.SOUTH
313WEST = _core_.WEST
314EAST = _core_.EAST
315ALL = _core_.ALL
316ALIGN_NOT = _core_.ALIGN_NOT
317ALIGN_CENTER_HORIZONTAL = _core_.ALIGN_CENTER_HORIZONTAL
318ALIGN_CENTRE_HORIZONTAL = _core_.ALIGN_CENTRE_HORIZONTAL
319ALIGN_LEFT = _core_.ALIGN_LEFT
320ALIGN_TOP = _core_.ALIGN_TOP
321ALIGN_RIGHT = _core_.ALIGN_RIGHT
322ALIGN_BOTTOM = _core_.ALIGN_BOTTOM
323ALIGN_CENTER_VERTICAL = _core_.ALIGN_CENTER_VERTICAL
324ALIGN_CENTRE_VERTICAL = _core_.ALIGN_CENTRE_VERTICAL
325ALIGN_CENTER = _core_.ALIGN_CENTER
326ALIGN_CENTRE = _core_.ALIGN_CENTRE
327ALIGN_MASK = _core_.ALIGN_MASK
328STRETCH_NOT = _core_.STRETCH_NOT
329SHRINK = _core_.SHRINK
330GROW = _core_.GROW
331EXPAND = _core_.EXPAND
332SHAPED = _core_.SHAPED
333FIXED_MINSIZE = _core_.FIXED_MINSIZE
334TILE = _core_.TILE
cbfc9df6 335ADJUST_MINSIZE = 0
5b5c9bc7
RD
336BORDER_DEFAULT = _core_.BORDER_DEFAULT
337BORDER_NONE = _core_.BORDER_NONE
338BORDER_STATIC = _core_.BORDER_STATIC
339BORDER_SIMPLE = _core_.BORDER_SIMPLE
340BORDER_RAISED = _core_.BORDER_RAISED
341BORDER_SUNKEN = _core_.BORDER_SUNKEN
342BORDER_DOUBLE = _core_.BORDER_DOUBLE
343BORDER_MASK = _core_.BORDER_MASK
344BG_STYLE_SYSTEM = _core_.BG_STYLE_SYSTEM
345BG_STYLE_COLOUR = _core_.BG_STYLE_COLOUR
346BG_STYLE_CUSTOM = _core_.BG_STYLE_CUSTOM
347DEFAULT = _core_.DEFAULT
348DECORATIVE = _core_.DECORATIVE
349ROMAN = _core_.ROMAN
350SCRIPT = _core_.SCRIPT
351SWISS = _core_.SWISS
352MODERN = _core_.MODERN
353TELETYPE = _core_.TELETYPE
354VARIABLE = _core_.VARIABLE
355FIXED = _core_.FIXED
356NORMAL = _core_.NORMAL
357LIGHT = _core_.LIGHT
358BOLD = _core_.BOLD
359ITALIC = _core_.ITALIC
360SLANT = _core_.SLANT
361SOLID = _core_.SOLID
362DOT = _core_.DOT
363LONG_DASH = _core_.LONG_DASH
364SHORT_DASH = _core_.SHORT_DASH
365DOT_DASH = _core_.DOT_DASH
366USER_DASH = _core_.USER_DASH
367TRANSPARENT = _core_.TRANSPARENT
368STIPPLE = _core_.STIPPLE
d04418a7
RD
369STIPPLE_MASK = _core_.STIPPLE_MASK
370STIPPLE_MASK_OPAQUE = _core_.STIPPLE_MASK_OPAQUE
5b5c9bc7
RD
371BDIAGONAL_HATCH = _core_.BDIAGONAL_HATCH
372CROSSDIAG_HATCH = _core_.CROSSDIAG_HATCH
373FDIAGONAL_HATCH = _core_.FDIAGONAL_HATCH
374CROSS_HATCH = _core_.CROSS_HATCH
375HORIZONTAL_HATCH = _core_.HORIZONTAL_HATCH
376VERTICAL_HATCH = _core_.VERTICAL_HATCH
377JOIN_BEVEL = _core_.JOIN_BEVEL
378JOIN_MITER = _core_.JOIN_MITER
379JOIN_ROUND = _core_.JOIN_ROUND
380CAP_ROUND = _core_.CAP_ROUND
381CAP_PROJECTING = _core_.CAP_PROJECTING
382CAP_BUTT = _core_.CAP_BUTT
383CLEAR = _core_.CLEAR
384XOR = _core_.XOR
385INVERT = _core_.INVERT
386OR_REVERSE = _core_.OR_REVERSE
387AND_REVERSE = _core_.AND_REVERSE
388COPY = _core_.COPY
389AND = _core_.AND
390AND_INVERT = _core_.AND_INVERT
391NO_OP = _core_.NO_OP
392NOR = _core_.NOR
393EQUIV = _core_.EQUIV
394SRC_INVERT = _core_.SRC_INVERT
395OR_INVERT = _core_.OR_INVERT
396NAND = _core_.NAND
397OR = _core_.OR
398SET = _core_.SET
399WXK_BACK = _core_.WXK_BACK
400WXK_TAB = _core_.WXK_TAB
401WXK_RETURN = _core_.WXK_RETURN
402WXK_ESCAPE = _core_.WXK_ESCAPE
403WXK_SPACE = _core_.WXK_SPACE
404WXK_DELETE = _core_.WXK_DELETE
405WXK_START = _core_.WXK_START
406WXK_LBUTTON = _core_.WXK_LBUTTON
407WXK_RBUTTON = _core_.WXK_RBUTTON
408WXK_CANCEL = _core_.WXK_CANCEL
409WXK_MBUTTON = _core_.WXK_MBUTTON
410WXK_CLEAR = _core_.WXK_CLEAR
411WXK_SHIFT = _core_.WXK_SHIFT
412WXK_ALT = _core_.WXK_ALT
413WXK_CONTROL = _core_.WXK_CONTROL
414WXK_MENU = _core_.WXK_MENU
415WXK_PAUSE = _core_.WXK_PAUSE
416WXK_CAPITAL = _core_.WXK_CAPITAL
5b5c9bc7
RD
417WXK_END = _core_.WXK_END
418WXK_HOME = _core_.WXK_HOME
419WXK_LEFT = _core_.WXK_LEFT
420WXK_UP = _core_.WXK_UP
421WXK_RIGHT = _core_.WXK_RIGHT
422WXK_DOWN = _core_.WXK_DOWN
423WXK_SELECT = _core_.WXK_SELECT
424WXK_PRINT = _core_.WXK_PRINT
425WXK_EXECUTE = _core_.WXK_EXECUTE
426WXK_SNAPSHOT = _core_.WXK_SNAPSHOT
427WXK_INSERT = _core_.WXK_INSERT
428WXK_HELP = _core_.WXK_HELP
429WXK_NUMPAD0 = _core_.WXK_NUMPAD0
430WXK_NUMPAD1 = _core_.WXK_NUMPAD1
431WXK_NUMPAD2 = _core_.WXK_NUMPAD2
432WXK_NUMPAD3 = _core_.WXK_NUMPAD3
433WXK_NUMPAD4 = _core_.WXK_NUMPAD4
434WXK_NUMPAD5 = _core_.WXK_NUMPAD5
435WXK_NUMPAD6 = _core_.WXK_NUMPAD6
436WXK_NUMPAD7 = _core_.WXK_NUMPAD7
437WXK_NUMPAD8 = _core_.WXK_NUMPAD8
438WXK_NUMPAD9 = _core_.WXK_NUMPAD9
439WXK_MULTIPLY = _core_.WXK_MULTIPLY
440WXK_ADD = _core_.WXK_ADD
441WXK_SEPARATOR = _core_.WXK_SEPARATOR
442WXK_SUBTRACT = _core_.WXK_SUBTRACT
443WXK_DECIMAL = _core_.WXK_DECIMAL
444WXK_DIVIDE = _core_.WXK_DIVIDE
445WXK_F1 = _core_.WXK_F1
446WXK_F2 = _core_.WXK_F2
447WXK_F3 = _core_.WXK_F3
448WXK_F4 = _core_.WXK_F4
449WXK_F5 = _core_.WXK_F5
450WXK_F6 = _core_.WXK_F6
451WXK_F7 = _core_.WXK_F7
452WXK_F8 = _core_.WXK_F8
453WXK_F9 = _core_.WXK_F9
454WXK_F10 = _core_.WXK_F10
455WXK_F11 = _core_.WXK_F11
456WXK_F12 = _core_.WXK_F12
457WXK_F13 = _core_.WXK_F13
458WXK_F14 = _core_.WXK_F14
459WXK_F15 = _core_.WXK_F15
460WXK_F16 = _core_.WXK_F16
461WXK_F17 = _core_.WXK_F17
462WXK_F18 = _core_.WXK_F18
463WXK_F19 = _core_.WXK_F19
464WXK_F20 = _core_.WXK_F20
465WXK_F21 = _core_.WXK_F21
466WXK_F22 = _core_.WXK_F22
467WXK_F23 = _core_.WXK_F23
468WXK_F24 = _core_.WXK_F24
469WXK_NUMLOCK = _core_.WXK_NUMLOCK
470WXK_SCROLL = _core_.WXK_SCROLL
471WXK_PAGEUP = _core_.WXK_PAGEUP
472WXK_PAGEDOWN = _core_.WXK_PAGEDOWN
473WXK_NUMPAD_SPACE = _core_.WXK_NUMPAD_SPACE
474WXK_NUMPAD_TAB = _core_.WXK_NUMPAD_TAB
475WXK_NUMPAD_ENTER = _core_.WXK_NUMPAD_ENTER
476WXK_NUMPAD_F1 = _core_.WXK_NUMPAD_F1
477WXK_NUMPAD_F2 = _core_.WXK_NUMPAD_F2
478WXK_NUMPAD_F3 = _core_.WXK_NUMPAD_F3
479WXK_NUMPAD_F4 = _core_.WXK_NUMPAD_F4
480WXK_NUMPAD_HOME = _core_.WXK_NUMPAD_HOME
481WXK_NUMPAD_LEFT = _core_.WXK_NUMPAD_LEFT
482WXK_NUMPAD_UP = _core_.WXK_NUMPAD_UP
483WXK_NUMPAD_RIGHT = _core_.WXK_NUMPAD_RIGHT
484WXK_NUMPAD_DOWN = _core_.WXK_NUMPAD_DOWN
5b5c9bc7 485WXK_NUMPAD_PAGEUP = _core_.WXK_NUMPAD_PAGEUP
5b5c9bc7
RD
486WXK_NUMPAD_PAGEDOWN = _core_.WXK_NUMPAD_PAGEDOWN
487WXK_NUMPAD_END = _core_.WXK_NUMPAD_END
488WXK_NUMPAD_BEGIN = _core_.WXK_NUMPAD_BEGIN
489WXK_NUMPAD_INSERT = _core_.WXK_NUMPAD_INSERT
490WXK_NUMPAD_DELETE = _core_.WXK_NUMPAD_DELETE
491WXK_NUMPAD_EQUAL = _core_.WXK_NUMPAD_EQUAL
492WXK_NUMPAD_MULTIPLY = _core_.WXK_NUMPAD_MULTIPLY
493WXK_NUMPAD_ADD = _core_.WXK_NUMPAD_ADD
494WXK_NUMPAD_SEPARATOR = _core_.WXK_NUMPAD_SEPARATOR
495WXK_NUMPAD_SUBTRACT = _core_.WXK_NUMPAD_SUBTRACT
496WXK_NUMPAD_DECIMAL = _core_.WXK_NUMPAD_DECIMAL
497WXK_NUMPAD_DIVIDE = _core_.WXK_NUMPAD_DIVIDE
498WXK_WINDOWS_LEFT = _core_.WXK_WINDOWS_LEFT
499WXK_WINDOWS_RIGHT = _core_.WXK_WINDOWS_RIGHT
500WXK_WINDOWS_MENU = _core_.WXK_WINDOWS_MENU
501WXK_COMMAND = _core_.WXK_COMMAND
502WXK_SPECIAL1 = _core_.WXK_SPECIAL1
503WXK_SPECIAL2 = _core_.WXK_SPECIAL2
504WXK_SPECIAL3 = _core_.WXK_SPECIAL3
505WXK_SPECIAL4 = _core_.WXK_SPECIAL4
506WXK_SPECIAL5 = _core_.WXK_SPECIAL5
507WXK_SPECIAL6 = _core_.WXK_SPECIAL6
508WXK_SPECIAL7 = _core_.WXK_SPECIAL7
509WXK_SPECIAL8 = _core_.WXK_SPECIAL8
510WXK_SPECIAL9 = _core_.WXK_SPECIAL9
511WXK_SPECIAL10 = _core_.WXK_SPECIAL10
512WXK_SPECIAL11 = _core_.WXK_SPECIAL11
513WXK_SPECIAL12 = _core_.WXK_SPECIAL12
514WXK_SPECIAL13 = _core_.WXK_SPECIAL13
515WXK_SPECIAL14 = _core_.WXK_SPECIAL14
516WXK_SPECIAL15 = _core_.WXK_SPECIAL15
517WXK_SPECIAL16 = _core_.WXK_SPECIAL16
518WXK_SPECIAL17 = _core_.WXK_SPECIAL17
519WXK_SPECIAL18 = _core_.WXK_SPECIAL18
520WXK_SPECIAL19 = _core_.WXK_SPECIAL19
521WXK_SPECIAL20 = _core_.WXK_SPECIAL20
cbfc9df6
RD
522WXK_PRIOR = WXK_PAGEUP
523WXK_NEXT = WXK_PAGEDOWN
524WXK_NUMPAD_PRIOR = WXK_NUMPAD_PAGEUP
525WXK_NUMPAD_NEXT = WXK_NUMPAD_PAGEDOWN
526
5b5c9bc7
RD
527PAPER_NONE = _core_.PAPER_NONE
528PAPER_LETTER = _core_.PAPER_LETTER
529PAPER_LEGAL = _core_.PAPER_LEGAL
530PAPER_A4 = _core_.PAPER_A4
531PAPER_CSHEET = _core_.PAPER_CSHEET
532PAPER_DSHEET = _core_.PAPER_DSHEET
533PAPER_ESHEET = _core_.PAPER_ESHEET
534PAPER_LETTERSMALL = _core_.PAPER_LETTERSMALL
535PAPER_TABLOID = _core_.PAPER_TABLOID
536PAPER_LEDGER = _core_.PAPER_LEDGER
537PAPER_STATEMENT = _core_.PAPER_STATEMENT
538PAPER_EXECUTIVE = _core_.PAPER_EXECUTIVE
539PAPER_A3 = _core_.PAPER_A3
540PAPER_A4SMALL = _core_.PAPER_A4SMALL
541PAPER_A5 = _core_.PAPER_A5
542PAPER_B4 = _core_.PAPER_B4
543PAPER_B5 = _core_.PAPER_B5
544PAPER_FOLIO = _core_.PAPER_FOLIO
545PAPER_QUARTO = _core_.PAPER_QUARTO
546PAPER_10X14 = _core_.PAPER_10X14
547PAPER_11X17 = _core_.PAPER_11X17
548PAPER_NOTE = _core_.PAPER_NOTE
549PAPER_ENV_9 = _core_.PAPER_ENV_9
550PAPER_ENV_10 = _core_.PAPER_ENV_10
551PAPER_ENV_11 = _core_.PAPER_ENV_11
552PAPER_ENV_12 = _core_.PAPER_ENV_12
553PAPER_ENV_14 = _core_.PAPER_ENV_14
554PAPER_ENV_DL = _core_.PAPER_ENV_DL
555PAPER_ENV_C5 = _core_.PAPER_ENV_C5
556PAPER_ENV_C3 = _core_.PAPER_ENV_C3
557PAPER_ENV_C4 = _core_.PAPER_ENV_C4
558PAPER_ENV_C6 = _core_.PAPER_ENV_C6
559PAPER_ENV_C65 = _core_.PAPER_ENV_C65
560PAPER_ENV_B4 = _core_.PAPER_ENV_B4
561PAPER_ENV_B5 = _core_.PAPER_ENV_B5
562PAPER_ENV_B6 = _core_.PAPER_ENV_B6
563PAPER_ENV_ITALY = _core_.PAPER_ENV_ITALY
564PAPER_ENV_MONARCH = _core_.PAPER_ENV_MONARCH
565PAPER_ENV_PERSONAL = _core_.PAPER_ENV_PERSONAL
566PAPER_FANFOLD_US = _core_.PAPER_FANFOLD_US
567PAPER_FANFOLD_STD_GERMAN = _core_.PAPER_FANFOLD_STD_GERMAN
568PAPER_FANFOLD_LGL_GERMAN = _core_.PAPER_FANFOLD_LGL_GERMAN
569PAPER_ISO_B4 = _core_.PAPER_ISO_B4
570PAPER_JAPANESE_POSTCARD = _core_.PAPER_JAPANESE_POSTCARD
571PAPER_9X11 = _core_.PAPER_9X11
572PAPER_10X11 = _core_.PAPER_10X11
573PAPER_15X11 = _core_.PAPER_15X11
574PAPER_ENV_INVITE = _core_.PAPER_ENV_INVITE
575PAPER_LETTER_EXTRA = _core_.PAPER_LETTER_EXTRA
576PAPER_LEGAL_EXTRA = _core_.PAPER_LEGAL_EXTRA
577PAPER_TABLOID_EXTRA = _core_.PAPER_TABLOID_EXTRA
578PAPER_A4_EXTRA = _core_.PAPER_A4_EXTRA
579PAPER_LETTER_TRANSVERSE = _core_.PAPER_LETTER_TRANSVERSE
580PAPER_A4_TRANSVERSE = _core_.PAPER_A4_TRANSVERSE
581PAPER_LETTER_EXTRA_TRANSVERSE = _core_.PAPER_LETTER_EXTRA_TRANSVERSE
582PAPER_A_PLUS = _core_.PAPER_A_PLUS
583PAPER_B_PLUS = _core_.PAPER_B_PLUS
584PAPER_LETTER_PLUS = _core_.PAPER_LETTER_PLUS
585PAPER_A4_PLUS = _core_.PAPER_A4_PLUS
586PAPER_A5_TRANSVERSE = _core_.PAPER_A5_TRANSVERSE
587PAPER_B5_TRANSVERSE = _core_.PAPER_B5_TRANSVERSE
588PAPER_A3_EXTRA = _core_.PAPER_A3_EXTRA
589PAPER_A5_EXTRA = _core_.PAPER_A5_EXTRA
590PAPER_B5_EXTRA = _core_.PAPER_B5_EXTRA
591PAPER_A2 = _core_.PAPER_A2
592PAPER_A3_TRANSVERSE = _core_.PAPER_A3_TRANSVERSE
593PAPER_A3_EXTRA_TRANSVERSE = _core_.PAPER_A3_EXTRA_TRANSVERSE
034e3677
RD
594PAPER_DBL_JAPANESE_POSTCARD = _core_.PAPER_DBL_JAPANESE_POSTCARD
595PAPER_A6 = _core_.PAPER_A6
596PAPER_JENV_KAKU2 = _core_.PAPER_JENV_KAKU2
597PAPER_JENV_KAKU3 = _core_.PAPER_JENV_KAKU3
598PAPER_JENV_CHOU3 = _core_.PAPER_JENV_CHOU3
599PAPER_JENV_CHOU4 = _core_.PAPER_JENV_CHOU4
600PAPER_LETTER_ROTATED = _core_.PAPER_LETTER_ROTATED
601PAPER_A3_ROTATED = _core_.PAPER_A3_ROTATED
602PAPER_A4_ROTATED = _core_.PAPER_A4_ROTATED
603PAPER_A5_ROTATED = _core_.PAPER_A5_ROTATED
604PAPER_B4_JIS_ROTATED = _core_.PAPER_B4_JIS_ROTATED
605PAPER_B5_JIS_ROTATED = _core_.PAPER_B5_JIS_ROTATED
606PAPER_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_JAPANESE_POSTCARD_ROTATED
607PAPER_DBL_JAPANESE_POSTCARD_ROTATED = _core_.PAPER_DBL_JAPANESE_POSTCARD_ROTATED
608PAPER_A6_ROTATED = _core_.PAPER_A6_ROTATED
609PAPER_JENV_KAKU2_ROTATED = _core_.PAPER_JENV_KAKU2_ROTATED
610PAPER_JENV_KAKU3_ROTATED = _core_.PAPER_JENV_KAKU3_ROTATED
611PAPER_JENV_CHOU3_ROTATED = _core_.PAPER_JENV_CHOU3_ROTATED
612PAPER_JENV_CHOU4_ROTATED = _core_.PAPER_JENV_CHOU4_ROTATED
613PAPER_B6_JIS = _core_.PAPER_B6_JIS
614PAPER_B6_JIS_ROTATED = _core_.PAPER_B6_JIS_ROTATED
615PAPER_12X11 = _core_.PAPER_12X11
616PAPER_JENV_YOU4 = _core_.PAPER_JENV_YOU4
617PAPER_JENV_YOU4_ROTATED = _core_.PAPER_JENV_YOU4_ROTATED
618PAPER_P16K = _core_.PAPER_P16K
619PAPER_P32K = _core_.PAPER_P32K
620PAPER_P32KBIG = _core_.PAPER_P32KBIG
621PAPER_PENV_1 = _core_.PAPER_PENV_1
622PAPER_PENV_2 = _core_.PAPER_PENV_2
623PAPER_PENV_3 = _core_.PAPER_PENV_3
624PAPER_PENV_4 = _core_.PAPER_PENV_4
625PAPER_PENV_5 = _core_.PAPER_PENV_5
626PAPER_PENV_6 = _core_.PAPER_PENV_6
627PAPER_PENV_7 = _core_.PAPER_PENV_7
628PAPER_PENV_8 = _core_.PAPER_PENV_8
629PAPER_PENV_9 = _core_.PAPER_PENV_9
630PAPER_PENV_10 = _core_.PAPER_PENV_10
631PAPER_P16K_ROTATED = _core_.PAPER_P16K_ROTATED
632PAPER_P32K_ROTATED = _core_.PAPER_P32K_ROTATED
633PAPER_P32KBIG_ROTATED = _core_.PAPER_P32KBIG_ROTATED
634PAPER_PENV_1_ROTATED = _core_.PAPER_PENV_1_ROTATED
635PAPER_PENV_2_ROTATED = _core_.PAPER_PENV_2_ROTATED
636PAPER_PENV_3_ROTATED = _core_.PAPER_PENV_3_ROTATED
637PAPER_PENV_4_ROTATED = _core_.PAPER_PENV_4_ROTATED
638PAPER_PENV_5_ROTATED = _core_.PAPER_PENV_5_ROTATED
639PAPER_PENV_6_ROTATED = _core_.PAPER_PENV_6_ROTATED
640PAPER_PENV_7_ROTATED = _core_.PAPER_PENV_7_ROTATED
641PAPER_PENV_8_ROTATED = _core_.PAPER_PENV_8_ROTATED
642PAPER_PENV_9_ROTATED = _core_.PAPER_PENV_9_ROTATED
643PAPER_PENV_10_ROTATED = _core_.PAPER_PENV_10_ROTATED
5b5c9bc7
RD
644DUPLEX_SIMPLEX = _core_.DUPLEX_SIMPLEX
645DUPLEX_HORIZONTAL = _core_.DUPLEX_HORIZONTAL
646DUPLEX_VERTICAL = _core_.DUPLEX_VERTICAL
647ITEM_SEPARATOR = _core_.ITEM_SEPARATOR
648ITEM_NORMAL = _core_.ITEM_NORMAL
649ITEM_CHECK = _core_.ITEM_CHECK
650ITEM_RADIO = _core_.ITEM_RADIO
651ITEM_MAX = _core_.ITEM_MAX
652HT_NOWHERE = _core_.HT_NOWHERE
653HT_SCROLLBAR_FIRST = _core_.HT_SCROLLBAR_FIRST
654HT_SCROLLBAR_ARROW_LINE_1 = _core_.HT_SCROLLBAR_ARROW_LINE_1
655HT_SCROLLBAR_ARROW_LINE_2 = _core_.HT_SCROLLBAR_ARROW_LINE_2
656HT_SCROLLBAR_ARROW_PAGE_1 = _core_.HT_SCROLLBAR_ARROW_PAGE_1
657HT_SCROLLBAR_ARROW_PAGE_2 = _core_.HT_SCROLLBAR_ARROW_PAGE_2
658HT_SCROLLBAR_THUMB = _core_.HT_SCROLLBAR_THUMB
659HT_SCROLLBAR_BAR_1 = _core_.HT_SCROLLBAR_BAR_1
660HT_SCROLLBAR_BAR_2 = _core_.HT_SCROLLBAR_BAR_2
661HT_SCROLLBAR_LAST = _core_.HT_SCROLLBAR_LAST
662HT_WINDOW_OUTSIDE = _core_.HT_WINDOW_OUTSIDE
663HT_WINDOW_INSIDE = _core_.HT_WINDOW_INSIDE
664HT_WINDOW_VERT_SCROLLBAR = _core_.HT_WINDOW_VERT_SCROLLBAR
665HT_WINDOW_HORZ_SCROLLBAR = _core_.HT_WINDOW_HORZ_SCROLLBAR
666HT_WINDOW_CORNER = _core_.HT_WINDOW_CORNER
667HT_MAX = _core_.HT_MAX
668MOD_NONE = _core_.MOD_NONE
669MOD_ALT = _core_.MOD_ALT
670MOD_CONTROL = _core_.MOD_CONTROL
943e8dfd 671MOD_ALTGR = _core_.MOD_ALTGR
5b5c9bc7 672MOD_SHIFT = _core_.MOD_SHIFT
943e8dfd 673MOD_META = _core_.MOD_META
5b5c9bc7 674MOD_WIN = _core_.MOD_WIN
943e8dfd
RD
675MOD_CMD = _core_.MOD_CMD
676MOD_ALL = _core_.MOD_ALL
5b5c9bc7
RD
677UPDATE_UI_NONE = _core_.UPDATE_UI_NONE
678UPDATE_UI_RECURSE = _core_.UPDATE_UI_RECURSE
679UPDATE_UI_FROMIDLE = _core_.UPDATE_UI_FROMIDLE
994453b8
RD
680Layout_Default = _core_.Layout_Default
681Layout_LeftToRight = _core_.Layout_LeftToRight
682Layout_RightToLeft = _core_.Layout_RightToLeft
d55e5bfc
RD
683#---------------------------------------------------------------------------
684
5b5c9bc7 685class Object(object):
d55e5bfc
RD
686 """
687 The base class for most wx objects, although in wxPython not
688 much functionality is needed nor exposed.
689 """
1bd55598
RD
690 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
691 def __init__(self): raise AttributeError, "No constructor defined"
692 __repr__ = _swig_repr
d55e5bfc
RD
693 def GetClassName(*args, **kwargs):
694 """
5b5c9bc7 695 GetClassName(self) -> String
d55e5bfc
RD
696
697 Returns the class name of the C++ class using wxRTTI.
698 """
5b5c9bc7 699 return _core_.Object_GetClassName(*args, **kwargs)
d55e5bfc
RD
700
701 def Destroy(*args, **kwargs):
702 """
703 Destroy(self)
704
705 Deletes the C++ object this Python object is a proxy for.
706 """
b39fe951
RD
707 args[0].this.own(False)
708 return _core_.Object_Destroy(*args, **kwargs)
d55e5bfc 709
8f514ab4
RD
710 def IsSameAs(*args, **kwargs):
711 """
712 IsSameAs(self, Object p) -> bool
713
714 For wx.Objects that use C++ reference counting internally, this method
715 can be used to determine if two objects are referencing the same data
716 object.
717 """
718 return _core_.Object_IsSameAs(*args, **kwargs)
719
33d6fd3b 720 ClassName = property(GetClassName,doc="See `GetClassName`")
2131d850 721_core_.Object_swigregister(Object)
5b5c9bc7 722_wxPySetDictionary = _core_._wxPySetDictionary
5b5c9bc7 723cvar = _core_.cvar
d55e5bfc
RD
724EmptyString = cvar.EmptyString
725
726#---------------------------------------------------------------------------
727
5b5c9bc7
RD
728BITMAP_TYPE_INVALID = _core_.BITMAP_TYPE_INVALID
729BITMAP_TYPE_BMP = _core_.BITMAP_TYPE_BMP
730BITMAP_TYPE_ICO = _core_.BITMAP_TYPE_ICO
731BITMAP_TYPE_CUR = _core_.BITMAP_TYPE_CUR
732BITMAP_TYPE_XBM = _core_.BITMAP_TYPE_XBM
733BITMAP_TYPE_XBM_DATA = _core_.BITMAP_TYPE_XBM_DATA
734BITMAP_TYPE_XPM = _core_.BITMAP_TYPE_XPM
735BITMAP_TYPE_XPM_DATA = _core_.BITMAP_TYPE_XPM_DATA
736BITMAP_TYPE_TIF = _core_.BITMAP_TYPE_TIF
737BITMAP_TYPE_GIF = _core_.BITMAP_TYPE_GIF
738BITMAP_TYPE_PNG = _core_.BITMAP_TYPE_PNG
739BITMAP_TYPE_JPEG = _core_.BITMAP_TYPE_JPEG
740BITMAP_TYPE_PNM = _core_.BITMAP_TYPE_PNM
741BITMAP_TYPE_PCX = _core_.BITMAP_TYPE_PCX
742BITMAP_TYPE_PICT = _core_.BITMAP_TYPE_PICT
743BITMAP_TYPE_ICON = _core_.BITMAP_TYPE_ICON
744BITMAP_TYPE_ANI = _core_.BITMAP_TYPE_ANI
745BITMAP_TYPE_IFF = _core_.BITMAP_TYPE_IFF
8f514ab4 746BITMAP_TYPE_TGA = _core_.BITMAP_TYPE_TGA
5b5c9bc7
RD
747BITMAP_TYPE_MACCURSOR = _core_.BITMAP_TYPE_MACCURSOR
748BITMAP_TYPE_ANY = _core_.BITMAP_TYPE_ANY
749CURSOR_NONE = _core_.CURSOR_NONE
750CURSOR_ARROW = _core_.CURSOR_ARROW
751CURSOR_RIGHT_ARROW = _core_.CURSOR_RIGHT_ARROW
752CURSOR_BULLSEYE = _core_.CURSOR_BULLSEYE
753CURSOR_CHAR = _core_.CURSOR_CHAR
754CURSOR_CROSS = _core_.CURSOR_CROSS
755CURSOR_HAND = _core_.CURSOR_HAND
756CURSOR_IBEAM = _core_.CURSOR_IBEAM
757CURSOR_LEFT_BUTTON = _core_.CURSOR_LEFT_BUTTON
758CURSOR_MAGNIFIER = _core_.CURSOR_MAGNIFIER
759CURSOR_MIDDLE_BUTTON = _core_.CURSOR_MIDDLE_BUTTON
760CURSOR_NO_ENTRY = _core_.CURSOR_NO_ENTRY
761CURSOR_PAINT_BRUSH = _core_.CURSOR_PAINT_BRUSH
762CURSOR_PENCIL = _core_.CURSOR_PENCIL
763CURSOR_POINT_LEFT = _core_.CURSOR_POINT_LEFT
764CURSOR_POINT_RIGHT = _core_.CURSOR_POINT_RIGHT
765CURSOR_QUESTION_ARROW = _core_.CURSOR_QUESTION_ARROW
766CURSOR_RIGHT_BUTTON = _core_.CURSOR_RIGHT_BUTTON
767CURSOR_SIZENESW = _core_.CURSOR_SIZENESW
768CURSOR_SIZENS = _core_.CURSOR_SIZENS
769CURSOR_SIZENWSE = _core_.CURSOR_SIZENWSE
770CURSOR_SIZEWE = _core_.CURSOR_SIZEWE
771CURSOR_SIZING = _core_.CURSOR_SIZING
772CURSOR_SPRAYCAN = _core_.CURSOR_SPRAYCAN
773CURSOR_WAIT = _core_.CURSOR_WAIT
774CURSOR_WATCH = _core_.CURSOR_WATCH
775CURSOR_BLANK = _core_.CURSOR_BLANK
776CURSOR_DEFAULT = _core_.CURSOR_DEFAULT
777CURSOR_COPY_ARROW = _core_.CURSOR_COPY_ARROW
778CURSOR_ARROWWAIT = _core_.CURSOR_ARROWWAIT
779CURSOR_MAX = _core_.CURSOR_MAX
d55e5bfc
RD
780#---------------------------------------------------------------------------
781
5b5c9bc7 782class Size(object):
d55e5bfc 783 """
15817c7e 784 wx.Size is a useful data structure used to represent the size of
1bd55598
RD
785 something. It simply contains integer width and height
786 properties. In most places in wxPython where a wx.Size is
36ed4f51 787 expected a (width, height) tuple can be used instead.
d55e5bfc 788 """
1bd55598
RD
789 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
790 __repr__ = _swig_repr
5b5c9bc7
RD
791 width = property(_core_.Size_width_get, _core_.Size_width_set)
792 height = property(_core_.Size_height_get, _core_.Size_height_set)
d55e5bfc 793 x = width; y = height
1bd55598 794 def __init__(self, *args, **kwargs):
d55e5bfc 795 """
5b5c9bc7 796 __init__(self, int w=0, int h=0) -> Size
d55e5bfc
RD
797
798 Creates a size object.
799 """
1bd55598
RD
800 _core_.Size_swiginit(self,_core_.new_Size(*args, **kwargs))
801 __swig_destroy__ = _core_.delete_Size
802 __del__ = lambda self : None;
d55e5bfc
RD
803 def __eq__(*args, **kwargs):
804 """
e9d6f3a4 805 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
806
807 Test for equality of wx.Size objects.
808 """
5b5c9bc7 809 return _core_.Size___eq__(*args, **kwargs)
d55e5bfc
RD
810
811 def __ne__(*args, **kwargs):
812 """
e9d6f3a4 813 __ne__(self, PyObject other) -> bool
d55e5bfc 814
e9d6f3a4 815 Test for inequality of wx.Size objects.
d55e5bfc 816 """
5b5c9bc7 817 return _core_.Size___ne__(*args, **kwargs)
d55e5bfc
RD
818
819 def __add__(*args, **kwargs):
820 """
5b5c9bc7 821 __add__(self, Size sz) -> Size
d55e5bfc
RD
822
823 Add sz's proprties to this and return the result.
824 """
5b5c9bc7 825 return _core_.Size___add__(*args, **kwargs)
d55e5bfc
RD
826
827 def __sub__(*args, **kwargs):
828 """
5b5c9bc7 829 __sub__(self, Size sz) -> Size
d55e5bfc
RD
830
831 Subtract sz's properties from this and return the result.
832 """
5b5c9bc7 833 return _core_.Size___sub__(*args, **kwargs)
d55e5bfc
RD
834
835 def IncTo(*args, **kwargs):
836 """
5b5c9bc7 837 IncTo(self, Size sz)
d55e5bfc
RD
838
839 Increments this object so that both of its dimensions are not less
840 than the corresponding dimensions of the size.
841 """
5b5c9bc7 842 return _core_.Size_IncTo(*args, **kwargs)
d55e5bfc
RD
843
844 def DecTo(*args, **kwargs):
845 """
5b5c9bc7 846 DecTo(self, Size sz)
d55e5bfc
RD
847
848 Decrements this object so that both of its dimensions are not greater
849 than the corresponding dimensions of the size.
850 """
5b5c9bc7 851 return _core_.Size_DecTo(*args, **kwargs)
d55e5bfc 852
f5263701
RD
853 def IncBy(*args, **kwargs):
854 """IncBy(self, int dx, int dy)"""
855 return _core_.Size_IncBy(*args, **kwargs)
856
857 def DecBy(*args, **kwargs):
858 """DecBy(self, int dx, int dy)"""
859 return _core_.Size_DecBy(*args, **kwargs)
860
1eeb270e
RD
861 def Scale(*args, **kwargs):
862 """
863 Scale(self, float xscale, float yscale)
864
865 Scales the dimensions of this object by the given factors.
866 """
867 return _core_.Size_Scale(*args, **kwargs)
868
d55e5bfc
RD
869 def Set(*args, **kwargs):
870 """
871 Set(self, int w, int h)
872
873 Set both width and height.
874 """
5b5c9bc7 875 return _core_.Size_Set(*args, **kwargs)
d55e5bfc
RD
876
877 def SetWidth(*args, **kwargs):
878 """SetWidth(self, int w)"""
5b5c9bc7 879 return _core_.Size_SetWidth(*args, **kwargs)
d55e5bfc
RD
880
881 def SetHeight(*args, **kwargs):
882 """SetHeight(self, int h)"""
5b5c9bc7 883 return _core_.Size_SetHeight(*args, **kwargs)
d55e5bfc
RD
884
885 def GetWidth(*args, **kwargs):
886 """GetWidth(self) -> int"""
5b5c9bc7 887 return _core_.Size_GetWidth(*args, **kwargs)
d55e5bfc
RD
888
889 def GetHeight(*args, **kwargs):
890 """GetHeight(self) -> int"""
5b5c9bc7 891 return _core_.Size_GetHeight(*args, **kwargs)
d55e5bfc
RD
892
893 def IsFullySpecified(*args, **kwargs):
894 """
895 IsFullySpecified(self) -> bool
896
897 Returns True if both components of the size are non-default values.
898 """
5b5c9bc7 899 return _core_.Size_IsFullySpecified(*args, **kwargs)
d55e5bfc
RD
900
901 def SetDefaults(*args, **kwargs):
902 """
5b5c9bc7 903 SetDefaults(self, Size size)
d55e5bfc 904
15817c7e
RD
905 Combine this size with the other one replacing the default components
906 of this object (i.e. equal to -1) with those of the other.
d55e5bfc 907 """
5b5c9bc7 908 return _core_.Size_SetDefaults(*args, **kwargs)
d55e5bfc
RD
909
910 def Get(*args, **kwargs):
911 """
912 Get() -> (width,height)
913
914 Returns the width and height properties as a tuple.
915 """
5b5c9bc7 916 return _core_.Size_Get(*args, **kwargs)
d55e5bfc 917
15817c7e 918 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
919 def __str__(self): return str(self.Get())
920 def __repr__(self): return 'wx.Size'+str(self.Get())
921 def __len__(self): return len(self.Get())
922 def __getitem__(self, index): return self.Get()[index]
923 def __setitem__(self, index, val):
924 if index == 0: self.width = val
925 elif index == 1: self.height = val
926 else: raise IndexError
927 def __nonzero__(self): return self.Get() != (0,0)
928 __safe_for_unpickling__ = True
929 def __reduce__(self): return (wx.Size, self.Get())
930
2131d850 931_core_.Size_swigregister(Size)
d55e5bfc
RD
932
933#---------------------------------------------------------------------------
934
5b5c9bc7 935class RealPoint(object):
d55e5bfc 936 """
15817c7e
RD
937 A data structure for representing a point or position with floating
938 point x and y properties. In wxPython most places that expect a
939 wx.RealPoint can also accept a (x,y) tuple.
d55e5bfc 940 """
1bd55598
RD
941 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
942 __repr__ = _swig_repr
5b5c9bc7
RD
943 x = property(_core_.RealPoint_x_get, _core_.RealPoint_x_set)
944 y = property(_core_.RealPoint_y_get, _core_.RealPoint_y_set)
1bd55598 945 def __init__(self, *args, **kwargs):
d55e5bfc 946 """
5b5c9bc7 947 __init__(self, double x=0.0, double y=0.0) -> RealPoint
d55e5bfc
RD
948
949 Create a wx.RealPoint object
950 """
1bd55598
RD
951 _core_.RealPoint_swiginit(self,_core_.new_RealPoint(*args, **kwargs))
952 __swig_destroy__ = _core_.delete_RealPoint
953 __del__ = lambda self : None;
d55e5bfc
RD
954 def __eq__(*args, **kwargs):
955 """
e9d6f3a4 956 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
957
958 Test for equality of wx.RealPoint objects.
959 """
5b5c9bc7 960 return _core_.RealPoint___eq__(*args, **kwargs)
d55e5bfc
RD
961
962 def __ne__(*args, **kwargs):
963 """
e9d6f3a4 964 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
965
966 Test for inequality of wx.RealPoint objects.
967 """
5b5c9bc7 968 return _core_.RealPoint___ne__(*args, **kwargs)
d55e5bfc
RD
969
970 def __add__(*args, **kwargs):
971 """
5b5c9bc7 972 __add__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
973
974 Add pt's proprties to this and return the result.
975 """
5b5c9bc7 976 return _core_.RealPoint___add__(*args, **kwargs)
d55e5bfc
RD
977
978 def __sub__(*args, **kwargs):
979 """
5b5c9bc7 980 __sub__(self, RealPoint pt) -> RealPoint
d55e5bfc
RD
981
982 Subtract pt's proprties from this and return the result
983 """
5b5c9bc7 984 return _core_.RealPoint___sub__(*args, **kwargs)
d55e5bfc
RD
985
986 def Set(*args, **kwargs):
987 """
988 Set(self, double x, double y)
989
990 Set both the x and y properties
991 """
5b5c9bc7 992 return _core_.RealPoint_Set(*args, **kwargs)
d55e5bfc
RD
993
994 def Get(*args, **kwargs):
995 """
996 Get() -> (x,y)
997
998 Return the x and y properties as a tuple.
999 """
5b5c9bc7 1000 return _core_.RealPoint_Get(*args, **kwargs)
d55e5bfc 1001
15817c7e 1002 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1003 def __str__(self): return str(self.Get())
1004 def __repr__(self): return 'wx.RealPoint'+str(self.Get())
1005 def __len__(self): return len(self.Get())
1006 def __getitem__(self, index): return self.Get()[index]
1007 def __setitem__(self, index, val):
1008 if index == 0: self.x = val
1009 elif index == 1: self.y = val
1010 else: raise IndexError
1011 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1012 __safe_for_unpickling__ = True
1013 def __reduce__(self): return (wx.RealPoint, self.Get())
1014
2131d850 1015_core_.RealPoint_swigregister(RealPoint)
d55e5bfc
RD
1016
1017#---------------------------------------------------------------------------
1018
5b5c9bc7 1019class Point(object):
d55e5bfc 1020 """
15817c7e
RD
1021 A data structure for representing a point or position with integer x
1022 and y properties. Most places in wxPython that expect a wx.Point can
1023 also accept a (x,y) tuple.
d55e5bfc 1024 """
1bd55598
RD
1025 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1026 __repr__ = _swig_repr
5b5c9bc7
RD
1027 x = property(_core_.Point_x_get, _core_.Point_x_set)
1028 y = property(_core_.Point_y_get, _core_.Point_y_set)
1bd55598 1029 def __init__(self, *args, **kwargs):
d55e5bfc 1030 """
5b5c9bc7 1031 __init__(self, int x=0, int y=0) -> Point
d55e5bfc
RD
1032
1033 Create a wx.Point object
1034 """
1bd55598
RD
1035 _core_.Point_swiginit(self,_core_.new_Point(*args, **kwargs))
1036 __swig_destroy__ = _core_.delete_Point
1037 __del__ = lambda self : None;
d55e5bfc
RD
1038 def __eq__(*args, **kwargs):
1039 """
e9d6f3a4 1040 __eq__(self, PyObject other) -> bool
d55e5bfc
RD
1041
1042 Test for equality of wx.Point objects.
1043 """
5b5c9bc7 1044 return _core_.Point___eq__(*args, **kwargs)
d55e5bfc
RD
1045
1046 def __ne__(*args, **kwargs):
1047 """
e9d6f3a4 1048 __ne__(self, PyObject other) -> bool
d55e5bfc
RD
1049
1050 Test for inequality of wx.Point objects.
1051 """
5b5c9bc7 1052 return _core_.Point___ne__(*args, **kwargs)
d55e5bfc
RD
1053
1054 def __add__(*args, **kwargs):
1055 """
5b5c9bc7 1056 __add__(self, Point pt) -> Point
d55e5bfc
RD
1057
1058 Add pt's proprties to this and return the result.
1059 """
5b5c9bc7 1060 return _core_.Point___add__(*args, **kwargs)
d55e5bfc
RD
1061
1062 def __sub__(*args, **kwargs):
1063 """
5b5c9bc7 1064 __sub__(self, Point pt) -> Point
d55e5bfc
RD
1065
1066 Subtract pt's proprties from this and return the result
1067 """
5b5c9bc7 1068 return _core_.Point___sub__(*args, **kwargs)
d55e5bfc
RD
1069
1070 def __iadd__(*args, **kwargs):
1071 """
5b5c9bc7 1072 __iadd__(self, Point pt) -> Point
d55e5bfc
RD
1073
1074 Add pt to this object.
1075 """
5b5c9bc7 1076 return _core_.Point___iadd__(*args, **kwargs)
d55e5bfc
RD
1077
1078 def __isub__(*args, **kwargs):
1079 """
5b5c9bc7 1080 __isub__(self, Point pt) -> Point
d55e5bfc
RD
1081
1082 Subtract pt from this object.
1083 """
5b5c9bc7 1084 return _core_.Point___isub__(*args, **kwargs)
d55e5bfc
RD
1085
1086 def Set(*args, **kwargs):
1087 """
1088 Set(self, long x, long y)
1089
1090 Set both the x and y properties
1091 """
5b5c9bc7 1092 return _core_.Point_Set(*args, **kwargs)
d55e5bfc
RD
1093
1094 def Get(*args, **kwargs):
1095 """
1096 Get() -> (x,y)
1097
1098 Return the x and y properties as a tuple.
1099 """
5b5c9bc7 1100 return _core_.Point_Get(*args, **kwargs)
d55e5bfc 1101
15817c7e 1102 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1103 def __str__(self): return str(self.Get())
1104 def __repr__(self): return 'wx.Point'+str(self.Get())
1105 def __len__(self): return len(self.Get())
1106 def __getitem__(self, index): return self.Get()[index]
1107 def __setitem__(self, index, val):
1108 if index == 0: self.x = val
1109 elif index == 1: self.y = val
1110 else: raise IndexError
1111 def __nonzero__(self): return self.Get() != (0,0)
1112 __safe_for_unpickling__ = True
1113 def __reduce__(self): return (wx.Point, self.Get())
1114
2131d850 1115_core_.Point_swigregister(Point)
d55e5bfc
RD
1116
1117#---------------------------------------------------------------------------
1118
5b5c9bc7 1119class Rect(object):
d55e5bfc 1120 """
15817c7e
RD
1121 A class for representing and manipulating rectangles. It has x, y,
1122 width and height properties. In wxPython most palces that expect a
1123 wx.Rect can also accept a (x,y,width,height) tuple.
d55e5bfc 1124 """
1bd55598
RD
1125 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1126 __repr__ = _swig_repr
1127 def __init__(self, *args, **kwargs):
d55e5bfc 1128 """
5b5c9bc7 1129 __init__(self, int x=0, int y=0, int width=0, int height=0) -> Rect
d55e5bfc
RD
1130
1131 Create a new Rect object.
1132 """
1bd55598
RD
1133 _core_.Rect_swiginit(self,_core_.new_Rect(*args, **kwargs))
1134 __swig_destroy__ = _core_.delete_Rect
1135 __del__ = lambda self : None;
d55e5bfc
RD
1136 def GetX(*args, **kwargs):
1137 """GetX(self) -> int"""
5b5c9bc7 1138 return _core_.Rect_GetX(*args, **kwargs)
d55e5bfc
RD
1139
1140 def SetX(*args, **kwargs):
1141 """SetX(self, int x)"""
5b5c9bc7 1142 return _core_.Rect_SetX(*args, **kwargs)
d55e5bfc
RD
1143
1144 def GetY(*args, **kwargs):
1145 """GetY(self) -> int"""
5b5c9bc7 1146 return _core_.Rect_GetY(*args, **kwargs)
d55e5bfc
RD
1147
1148 def SetY(*args, **kwargs):
1149 """SetY(self, int y)"""
5b5c9bc7 1150 return _core_.Rect_SetY(*args, **kwargs)
d55e5bfc
RD
1151
1152 def GetWidth(*args, **kwargs):
1153 """GetWidth(self) -> int"""
5b5c9bc7 1154 return _core_.Rect_GetWidth(*args, **kwargs)
d55e5bfc
RD
1155
1156 def SetWidth(*args, **kwargs):
1157 """SetWidth(self, int w)"""
5b5c9bc7 1158 return _core_.Rect_SetWidth(*args, **kwargs)
d55e5bfc
RD
1159
1160 def GetHeight(*args, **kwargs):
1161 """GetHeight(self) -> int"""
5b5c9bc7 1162 return _core_.Rect_GetHeight(*args, **kwargs)
d55e5bfc
RD
1163
1164 def SetHeight(*args, **kwargs):
1165 """SetHeight(self, int h)"""
5b5c9bc7 1166 return _core_.Rect_SetHeight(*args, **kwargs)
d55e5bfc
RD
1167
1168 def GetPosition(*args, **kwargs):
5b5c9bc7
RD
1169 """GetPosition(self) -> Point"""
1170 return _core_.Rect_GetPosition(*args, **kwargs)
d55e5bfc
RD
1171
1172 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
1173 """SetPosition(self, Point p)"""
1174 return _core_.Rect_SetPosition(*args, **kwargs)
d55e5bfc
RD
1175
1176 def GetSize(*args, **kwargs):
5b5c9bc7
RD
1177 """GetSize(self) -> Size"""
1178 return _core_.Rect_GetSize(*args, **kwargs)
d55e5bfc
RD
1179
1180 def SetSize(*args, **kwargs):
5b5c9bc7
RD
1181 """SetSize(self, Size s)"""
1182 return _core_.Rect_SetSize(*args, **kwargs)
d55e5bfc 1183
aff4cc5c
RD
1184 def IsEmpty(*args, **kwargs):
1185 """IsEmpty(self) -> bool"""
5b5c9bc7 1186 return _core_.Rect_IsEmpty(*args, **kwargs)
aff4cc5c 1187
d55e5bfc 1188 def GetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1189 """GetTopLeft(self) -> Point"""
1190 return _core_.Rect_GetTopLeft(*args, **kwargs)
d55e5bfc
RD
1191
1192 def SetTopLeft(*args, **kwargs):
5b5c9bc7
RD
1193 """SetTopLeft(self, Point p)"""
1194 return _core_.Rect_SetTopLeft(*args, **kwargs)
d55e5bfc
RD
1195
1196 def GetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1197 """GetBottomRight(self) -> Point"""
1198 return _core_.Rect_GetBottomRight(*args, **kwargs)
d55e5bfc
RD
1199
1200 def SetBottomRight(*args, **kwargs):
5b5c9bc7
RD
1201 """SetBottomRight(self, Point p)"""
1202 return _core_.Rect_SetBottomRight(*args, **kwargs)
d55e5bfc 1203
5acb46e0
RD
1204 def GetTopRight(*args, **kwargs):
1205 """GetTopRight(self) -> Point"""
1206 return _core_.Rect_GetTopRight(*args, **kwargs)
1207
1208 def SetTopRight(*args, **kwargs):
1209 """SetTopRight(self, Point p)"""
1210 return _core_.Rect_SetTopRight(*args, **kwargs)
1211
1212 def GetBottomLeft(*args, **kwargs):
1213 """GetBottomLeft(self) -> Point"""
1214 return _core_.Rect_GetBottomLeft(*args, **kwargs)
1215
1216 def SetBottomLeft(*args, **kwargs):
1217 """SetBottomLeft(self, Point p)"""
1218 return _core_.Rect_SetBottomLeft(*args, **kwargs)
1219
d55e5bfc
RD
1220 def GetLeft(*args, **kwargs):
1221 """GetLeft(self) -> int"""
5b5c9bc7 1222 return _core_.Rect_GetLeft(*args, **kwargs)
d55e5bfc
RD
1223
1224 def GetTop(*args, **kwargs):
1225 """GetTop(self) -> int"""
5b5c9bc7 1226 return _core_.Rect_GetTop(*args, **kwargs)
d55e5bfc
RD
1227
1228 def GetBottom(*args, **kwargs):
1229 """GetBottom(self) -> int"""
5b5c9bc7 1230 return _core_.Rect_GetBottom(*args, **kwargs)
d55e5bfc
RD
1231
1232 def GetRight(*args, **kwargs):
1233 """GetRight(self) -> int"""
5b5c9bc7 1234 return _core_.Rect_GetRight(*args, **kwargs)
d55e5bfc
RD
1235
1236 def SetLeft(*args, **kwargs):
1237 """SetLeft(self, int left)"""
5b5c9bc7 1238 return _core_.Rect_SetLeft(*args, **kwargs)
d55e5bfc
RD
1239
1240 def SetRight(*args, **kwargs):
1241 """SetRight(self, int right)"""
5b5c9bc7 1242 return _core_.Rect_SetRight(*args, **kwargs)
d55e5bfc
RD
1243
1244 def SetTop(*args, **kwargs):
1245 """SetTop(self, int top)"""
5b5c9bc7 1246 return _core_.Rect_SetTop(*args, **kwargs)
d55e5bfc
RD
1247
1248 def SetBottom(*args, **kwargs):
1249 """SetBottom(self, int bottom)"""
5b5c9bc7 1250 return _core_.Rect_SetBottom(*args, **kwargs)
d55e5bfc
RD
1251
1252 position = property(GetPosition, SetPosition)
1253 size = property(GetSize, SetSize)
1254 left = property(GetLeft, SetLeft)
1255 right = property(GetRight, SetRight)
1256 top = property(GetTop, SetTop)
1257 bottom = property(GetBottom, SetBottom)
1258
1259 def Inflate(*args, **kwargs):
1260 """
5b5c9bc7 1261 Inflate(self, int dx, int dy) -> Rect
d55e5bfc 1262
091fdbfa
RD
1263 Increases the size of the rectangle.
1264
1265 The left border is moved farther left and the right border is moved
1266 farther right by ``dx``. The upper border is moved farther up and the
1267 bottom border is moved farther down by ``dy``. (Note the the width and
1268 height of the rectangle thus change by ``2*dx`` and ``2*dy``,
1269 respectively.) If one or both of ``dx`` and ``dy`` are negative, the
1270 opposite happens: the rectangle size decreases in the respective
1271 direction.
1272
1273 The change is made to the rectangle inplace, if instead you need a
1274 copy that is inflated, preserving the original then make the copy
1275 first::
1276
1277 copy = wx.Rect(*original)
1278 copy.Inflate(10,15)
1279
1280
d55e5bfc 1281 """
5b5c9bc7 1282 return _core_.Rect_Inflate(*args, **kwargs)
d55e5bfc
RD
1283
1284 def Deflate(*args, **kwargs):
1285 """
5b5c9bc7 1286 Deflate(self, int dx, int dy) -> Rect
d55e5bfc 1287
091fdbfa
RD
1288 Decrease the rectangle size. This method is the opposite of `Inflate`
1289 in that Deflate(a,b) is equivalent to Inflate(-a,-b). Please refer to
1290 `Inflate` for a full description.
d55e5bfc 1291 """
5b5c9bc7 1292 return _core_.Rect_Deflate(*args, **kwargs)
d55e5bfc
RD
1293
1294 def OffsetXY(*args, **kwargs):
1295 """
1296 OffsetXY(self, int dx, int dy)
1297
15817c7e
RD
1298 Moves the rectangle by the specified offset. If dx is positive, the
1299 rectangle is moved to the right, if dy is positive, it is moved to the
1300 bottom, otherwise it is moved to the left or top respectively.
d55e5bfc 1301 """
5b5c9bc7 1302 return _core_.Rect_OffsetXY(*args, **kwargs)
d55e5bfc
RD
1303
1304 def Offset(*args, **kwargs):
1305 """
5b5c9bc7 1306 Offset(self, Point pt)
d55e5bfc 1307
b1fcee84 1308 Same as `OffsetXY` but uses dx,dy from Point
d55e5bfc 1309 """
5b5c9bc7 1310 return _core_.Rect_Offset(*args, **kwargs)
d55e5bfc
RD
1311
1312 def Intersect(*args, **kwargs):
1313 """
5b5c9bc7 1314 Intersect(self, Rect rect) -> Rect
d55e5bfc 1315
5cbf236d 1316 Returns the intersectsion of this rectangle and rect.
d55e5bfc 1317 """
5b5c9bc7 1318 return _core_.Rect_Intersect(*args, **kwargs)
d55e5bfc 1319
5cbf236d
RD
1320 def Union(*args, **kwargs):
1321 """
5b5c9bc7 1322 Union(self, Rect rect) -> Rect
5cbf236d
RD
1323
1324 Returns the union of this rectangle and rect.
1325 """
5b5c9bc7 1326 return _core_.Rect_Union(*args, **kwargs)
5cbf236d 1327
d55e5bfc
RD
1328 def __add__(*args, **kwargs):
1329 """
5b5c9bc7 1330 __add__(self, Rect rect) -> Rect
d55e5bfc
RD
1331
1332 Add the properties of rect to this rectangle and return the result.
1333 """
5b5c9bc7 1334 return _core_.Rect___add__(*args, **kwargs)
d55e5bfc
RD
1335
1336 def __iadd__(*args, **kwargs):
1337 """
5b5c9bc7 1338 __iadd__(self, Rect rect) -> Rect
d55e5bfc
RD
1339
1340 Add the properties of rect to this rectangle, updating this rectangle.
1341 """
5b5c9bc7 1342 return _core_.Rect___iadd__(*args, **kwargs)
d55e5bfc
RD
1343
1344 def __eq__(*args, **kwargs):
1345 """
e9d6f3a4 1346 __eq__(self, PyObject other) -> bool
d55e5bfc 1347
e9d6f3a4 1348 Test for equality of wx.Rect objects.
d55e5bfc 1349 """
5b5c9bc7 1350 return _core_.Rect___eq__(*args, **kwargs)
d55e5bfc
RD
1351
1352 def __ne__(*args, **kwargs):
1353 """
e9d6f3a4 1354 __ne__(self, PyObject other) -> bool
d55e5bfc 1355
e9d6f3a4 1356 Test for inequality of wx.Rect objects.
d55e5bfc 1357 """
5b5c9bc7 1358 return _core_.Rect___ne__(*args, **kwargs)
d55e5bfc 1359
33d6fd3b 1360 def ContainsXY(*args, **kwargs):
d55e5bfc 1361 """
33d6fd3b 1362 ContainsXY(self, int x, int y) -> bool
d55e5bfc 1363
33d6fd3b 1364 Return True if the point is inside the rect.
d55e5bfc 1365 """
33d6fd3b 1366 return _core_.Rect_ContainsXY(*args, **kwargs)
d55e5bfc 1367
33d6fd3b 1368 def Contains(*args, **kwargs):
d55e5bfc 1369 """
33d6fd3b 1370 Contains(self, Point pt) -> bool
d55e5bfc 1371
33d6fd3b 1372 Return True if the point is inside the rect.
d55e5bfc 1373 """
33d6fd3b 1374 return _core_.Rect_Contains(*args, **kwargs)
d55e5bfc 1375
33d6fd3b 1376 def ContainsRect(*args, **kwargs):
fc46b7f3 1377 """
33d6fd3b 1378 ContainsRect(self, Rect rect) -> bool
fc46b7f3
RD
1379
1380 Returns ``True`` if the given rectangle is completely inside this
1381 rectangle or touches its boundary.
1382 """
33d6fd3b
RD
1383 return _core_.Rect_ContainsRect(*args, **kwargs)
1384
72ef6efb
RD
1385 #Inside = wx._deprecated(Contains, "Use `Contains` instead.")
1386 #InsideXY = wx._deprecated(ContainsXY, "Use `ContainsXY` instead.")
1387 #InsideRect = wx._deprecated(ContainsRect, "Use `ContainsRect` instead.")
1388 Inside = Contains
1389 InsideXY = ContainsXY
1390 InsideRect = ContainsRect
fc46b7f3 1391
d55e5bfc
RD
1392 def Intersects(*args, **kwargs):
1393 """
5b5c9bc7 1394 Intersects(self, Rect rect) -> bool
d55e5bfc
RD
1395
1396 Returns True if the rectangles have a non empty intersection.
1397 """
5b5c9bc7 1398 return _core_.Rect_Intersects(*args, **kwargs)
d55e5bfc 1399
b1fcee84
RD
1400 def CenterIn(*args, **kwargs):
1401 """
1402 CenterIn(self, Rect r, int dir=BOTH) -> Rect
1403
1404 Center this rectangle within the one passed to the method, which is
1405 usually, but not necessarily, the larger one.
1406 """
1407 return _core_.Rect_CenterIn(*args, **kwargs)
1408
1409 CentreIn = CenterIn
5b5c9bc7
RD
1410 x = property(_core_.Rect_x_get, _core_.Rect_x_set)
1411 y = property(_core_.Rect_y_get, _core_.Rect_y_set)
1412 width = property(_core_.Rect_width_get, _core_.Rect_width_set)
1413 height = property(_core_.Rect_height_get, _core_.Rect_height_set)
d55e5bfc
RD
1414 def Set(*args, **kwargs):
1415 """
1416 Set(self, int x=0, int y=0, int width=0, int height=0)
1417
1418 Set all rectangle properties.
1419 """
5b5c9bc7 1420 return _core_.Rect_Set(*args, **kwargs)
d55e5bfc
RD
1421
1422 def Get(*args, **kwargs):
1423 """
1424 Get() -> (x,y,width,height)
1425
1426 Return the rectangle properties as a tuple.
1427 """
5b5c9bc7 1428 return _core_.Rect_Get(*args, **kwargs)
d55e5bfc 1429
15817c7e 1430 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1431 def __str__(self): return str(self.Get())
1432 def __repr__(self): return 'wx.Rect'+str(self.Get())
1433 def __len__(self): return len(self.Get())
1434 def __getitem__(self, index): return self.Get()[index]
1435 def __setitem__(self, index, val):
1436 if index == 0: self.x = val
1437 elif index == 1: self.y = val
1438 elif index == 2: self.width = val
1439 elif index == 3: self.height = val
1440 else: raise IndexError
1441 def __nonzero__(self): return self.Get() != (0,0,0,0)
1442 __safe_for_unpickling__ = True
1443 def __reduce__(self): return (wx.Rect, self.Get())
1444
33d6fd3b
RD
1445 Bottom = property(GetBottom,SetBottom,doc="See `GetBottom` and `SetBottom`")
1446 BottomRight = property(GetBottomRight,SetBottomRight,doc="See `GetBottomRight` and `SetBottomRight`")
5acb46e0 1447 BottomLeft = property(GetBottomLeft,SetBottomLeft,doc="See `GetBottomLeft` and `SetBottomLeft`")
33d6fd3b
RD
1448 Height = property(GetHeight,SetHeight,doc="See `GetHeight` and `SetHeight`")
1449 Left = property(GetLeft,SetLeft,doc="See `GetLeft` and `SetLeft`")
1450 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
1451 Right = property(GetRight,SetRight,doc="See `GetRight` and `SetRight`")
1452 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
1453 Top = property(GetTop,SetTop,doc="See `GetTop` and `SetTop`")
1454 TopLeft = property(GetTopLeft,SetTopLeft,doc="See `GetTopLeft` and `SetTopLeft`")
5acb46e0 1455 TopRight = property(GetTopRight,SetTopRight,doc="See `GetTopRight` and `SetTopRight`")
33d6fd3b
RD
1456 Width = property(GetWidth,SetWidth,doc="See `GetWidth` and `SetWidth`")
1457 X = property(GetX,SetX,doc="See `GetX` and `SetX`")
1458 Y = property(GetY,SetY,doc="See `GetY` and `SetY`")
1459 Empty = property(IsEmpty,doc="See `IsEmpty`")
2131d850 1460_core_.Rect_swigregister(Rect)
d55e5bfc
RD
1461
1462def RectPP(*args, **kwargs):
1463 """
5b5c9bc7 1464 RectPP(Point topLeft, Point bottomRight) -> Rect
d55e5bfc
RD
1465
1466 Create a new Rect object from Points representing two corners.
1467 """
5b5c9bc7 1468 val = _core_.new_RectPP(*args, **kwargs)
d55e5bfc
RD
1469 return val
1470
1471def RectPS(*args, **kwargs):
1472 """
5b5c9bc7 1473 RectPS(Point pos, Size size) -> Rect
d55e5bfc
RD
1474
1475 Create a new Rect from a position and size.
1476 """
5b5c9bc7 1477 val = _core_.new_RectPS(*args, **kwargs)
d55e5bfc
RD
1478 return val
1479
070c48b4
RD
1480def RectS(*args, **kwargs):
1481 """
5b5c9bc7 1482 RectS(Size size) -> Rect
070c48b4
RD
1483
1484 Create a new Rect from a size only.
1485 """
5b5c9bc7 1486 val = _core_.new_RectS(*args, **kwargs)
070c48b4
RD
1487 return val
1488
d55e5bfc 1489
5b5c9bc7 1490def IntersectRect(*args, **kwargs):
1bd55598 1491 """
d55e5bfc
RD
1492 IntersectRect(Rect r1, Rect r2) -> Rect
1493
1494 Calculate and return the intersection of r1 and r2.
1495 """
1bd55598 1496 return _core_.IntersectRect(*args, **kwargs)
d55e5bfc
RD
1497#---------------------------------------------------------------------------
1498
5b5c9bc7 1499class Point2D(object):
15817c7e
RD
1500 """
1501 wx.Point2Ds represent a point or a vector in a 2d coordinate system
1502 with floating point values.
1503 """
1bd55598
RD
1504 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1505 __repr__ = _swig_repr
1506 def __init__(self, *args, **kwargs):
d55e5bfc 1507 """
5b5c9bc7 1508 __init__(self, double x=0.0, double y=0.0) -> Point2D
d55e5bfc
RD
1509
1510 Create a w.Point2D object.
1511 """
1bd55598 1512 _core_.Point2D_swiginit(self,_core_.new_Point2D(*args, **kwargs))
b39fe951
RD
1513 __swig_destroy__ = _core_.delete_Point2D
1514 __del__ = lambda self : None;
d55e5bfc 1515 def GetFloor(*args, **kwargs):
fd2dc343
RD
1516 """
1517 GetFloor() -> (x,y)
1518
1519 Convert to integer
1520 """
5b5c9bc7 1521 return _core_.Point2D_GetFloor(*args, **kwargs)
d55e5bfc
RD
1522
1523 def GetRounded(*args, **kwargs):
fd2dc343
RD
1524 """
1525 GetRounded() -> (x,y)
1526
1527 Convert to integer
1528 """
5b5c9bc7 1529 return _core_.Point2D_GetRounded(*args, **kwargs)
d55e5bfc
RD
1530
1531 def GetVectorLength(*args, **kwargs):
1532 """GetVectorLength(self) -> double"""
5b5c9bc7 1533 return _core_.Point2D_GetVectorLength(*args, **kwargs)
d55e5bfc
RD
1534
1535 def GetVectorAngle(*args, **kwargs):
1536 """GetVectorAngle(self) -> double"""
5b5c9bc7 1537 return _core_.Point2D_GetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1538
1539 def SetVectorLength(*args, **kwargs):
1540 """SetVectorLength(self, double length)"""
5b5c9bc7 1541 return _core_.Point2D_SetVectorLength(*args, **kwargs)
d55e5bfc
RD
1542
1543 def SetVectorAngle(*args, **kwargs):
1544 """SetVectorAngle(self, double degrees)"""
5b5c9bc7 1545 return _core_.Point2D_SetVectorAngle(*args, **kwargs)
d55e5bfc
RD
1546
1547 def SetPolarCoordinates(self, angle, length):
1548 self.SetVectorLength(length)
1549 self.SetVectorAngle(angle)
1550 def Normalize(self):
1551 self.SetVectorLength(1.0)
1552
1553 def GetDistance(*args, **kwargs):
5b5c9bc7
RD
1554 """GetDistance(self, Point2D pt) -> double"""
1555 return _core_.Point2D_GetDistance(*args, **kwargs)
d55e5bfc
RD
1556
1557 def GetDistanceSquare(*args, **kwargs):
5b5c9bc7
RD
1558 """GetDistanceSquare(self, Point2D pt) -> double"""
1559 return _core_.Point2D_GetDistanceSquare(*args, **kwargs)
d55e5bfc
RD
1560
1561 def GetDotProduct(*args, **kwargs):
5b5c9bc7
RD
1562 """GetDotProduct(self, Point2D vec) -> double"""
1563 return _core_.Point2D_GetDotProduct(*args, **kwargs)
d55e5bfc
RD
1564
1565 def GetCrossProduct(*args, **kwargs):
5b5c9bc7
RD
1566 """GetCrossProduct(self, Point2D vec) -> double"""
1567 return _core_.Point2D_GetCrossProduct(*args, **kwargs)
d55e5bfc
RD
1568
1569 def __neg__(*args, **kwargs):
1570 """
5b5c9bc7 1571 __neg__(self) -> Point2D
d55e5bfc
RD
1572
1573 the reflection of this point
1574 """
5b5c9bc7 1575 return _core_.Point2D___neg__(*args, **kwargs)
d55e5bfc
RD
1576
1577 def __iadd__(*args, **kwargs):
5b5c9bc7
RD
1578 """__iadd__(self, Point2D pt) -> Point2D"""
1579 return _core_.Point2D___iadd__(*args, **kwargs)
d55e5bfc
RD
1580
1581 def __isub__(*args, **kwargs):
5b5c9bc7
RD
1582 """__isub__(self, Point2D pt) -> Point2D"""
1583 return _core_.Point2D___isub__(*args, **kwargs)
d55e5bfc
RD
1584
1585 def __imul__(*args, **kwargs):
5b5c9bc7
RD
1586 """__imul__(self, Point2D pt) -> Point2D"""
1587 return _core_.Point2D___imul__(*args, **kwargs)
d55e5bfc
RD
1588
1589 def __idiv__(*args, **kwargs):
5b5c9bc7
RD
1590 """__idiv__(self, Point2D pt) -> Point2D"""
1591 return _core_.Point2D___idiv__(*args, **kwargs)
d55e5bfc
RD
1592
1593 def __eq__(*args, **kwargs):
1594 """
e9d6f3a4 1595 __eq__(self, PyObject other) -> bool
d55e5bfc 1596
e9d6f3a4 1597 Test for equality of wx.Point2D objects.
d55e5bfc 1598 """
5b5c9bc7 1599 return _core_.Point2D___eq__(*args, **kwargs)
d55e5bfc
RD
1600
1601 def __ne__(*args, **kwargs):
1602 """
e9d6f3a4 1603 __ne__(self, PyObject other) -> bool
d55e5bfc 1604
e9d6f3a4 1605 Test for inequality of wx.Point2D objects.
d55e5bfc 1606 """
5b5c9bc7 1607 return _core_.Point2D___ne__(*args, **kwargs)
d55e5bfc 1608
5b5c9bc7
RD
1609 x = property(_core_.Point2D_x_get, _core_.Point2D_x_set)
1610 y = property(_core_.Point2D_y_get, _core_.Point2D_y_set)
d55e5bfc
RD
1611 def Set(*args, **kwargs):
1612 """Set(self, double x=0, double y=0)"""
5b5c9bc7 1613 return _core_.Point2D_Set(*args, **kwargs)
d55e5bfc
RD
1614
1615 def Get(*args, **kwargs):
1616 """
1617 Get() -> (x,y)
1618
1619 Return x and y properties as a tuple.
1620 """
5b5c9bc7 1621 return _core_.Point2D_Get(*args, **kwargs)
d55e5bfc 1622
15817c7e 1623 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
1624 def __str__(self): return str(self.Get())
1625 def __repr__(self): return 'wx.Point2D'+str(self.Get())
1626 def __len__(self): return len(self.Get())
1627 def __getitem__(self, index): return self.Get()[index]
1628 def __setitem__(self, index, val):
1629 if index == 0: self.x = val
1630 elif index == 1: self.y = val
1631 else: raise IndexError
1632 def __nonzero__(self): return self.Get() != (0.0, 0.0)
1633 __safe_for_unpickling__ = True
1634 def __reduce__(self): return (wx.Point2D, self.Get())
1635
33d6fd3b
RD
1636 Floor = property(GetFloor,doc="See `GetFloor`")
1637 Rounded = property(GetRounded,doc="See `GetRounded`")
1638 VectorAngle = property(GetVectorAngle,SetVectorAngle,doc="See `GetVectorAngle` and `SetVectorAngle`")
1639 VectorLength = property(GetVectorLength,SetVectorLength,doc="See `GetVectorLength` and `SetVectorLength`")
2131d850 1640_core_.Point2D_swigregister(Point2D)
d55e5bfc
RD
1641
1642def Point2DCopy(*args, **kwargs):
1643 """
5b5c9bc7 1644 Point2DCopy(Point2D pt) -> Point2D
d55e5bfc
RD
1645
1646 Create a w.Point2D object.
1647 """
5b5c9bc7 1648 val = _core_.new_Point2DCopy(*args, **kwargs)
d55e5bfc
RD
1649 return val
1650
1651def Point2DFromPoint(*args, **kwargs):
1652 """
5b5c9bc7 1653 Point2DFromPoint(Point pt) -> Point2D
d55e5bfc
RD
1654
1655 Create a w.Point2D object.
1656 """
5b5c9bc7 1657 val = _core_.new_Point2DFromPoint(*args, **kwargs)
d55e5bfc
RD
1658 return val
1659
1660#---------------------------------------------------------------------------
1661
70d7cb34
RD
1662Inside = _core_.Inside
1663OutLeft = _core_.OutLeft
1664OutRight = _core_.OutRight
1665OutTop = _core_.OutTop
1666OutBottom = _core_.OutBottom
1667class Rect2D(object):
1668 """
1669 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1670 with floating point component values.
1671 """
1672 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1673 __repr__ = _swig_repr
1674 def __init__(self, *args, **kwargs):
1675 """
1676 __init__(self, wxDouble x=0.0, wxDouble y=0.0, wxDouble w=0.0, wxDouble h=0.0) -> Rect2D
1677
1678 wx.Rect2D is a rectangle, with position and size, in a 2D coordinate system
1679 with floating point component values.
1680 """
1681 _core_.Rect2D_swiginit(self,_core_.new_Rect2D(*args, **kwargs))
1682 __swig_destroy__ = _core_.delete_Rect2D
1683 __del__ = lambda self : None;
1684 def GetPosition(*args, **kwargs):
1685 """GetPosition(self) -> Point2D"""
1686 return _core_.Rect2D_GetPosition(*args, **kwargs)
1687
1688 def GetSize(*args, **kwargs):
1689 """GetSize(self) -> Size"""
1690 return _core_.Rect2D_GetSize(*args, **kwargs)
1691
1692 def GetLeft(*args, **kwargs):
1693 """GetLeft(self) -> wxDouble"""
1694 return _core_.Rect2D_GetLeft(*args, **kwargs)
1695
1696 def SetLeft(*args, **kwargs):
1697 """SetLeft(self, wxDouble n)"""
1698 return _core_.Rect2D_SetLeft(*args, **kwargs)
1699
1700 def MoveLeftTo(*args, **kwargs):
1701 """MoveLeftTo(self, wxDouble n)"""
1702 return _core_.Rect2D_MoveLeftTo(*args, **kwargs)
1703
1704 def GetTop(*args, **kwargs):
1705 """GetTop(self) -> wxDouble"""
1706 return _core_.Rect2D_GetTop(*args, **kwargs)
1707
1708 def SetTop(*args, **kwargs):
1709 """SetTop(self, wxDouble n)"""
1710 return _core_.Rect2D_SetTop(*args, **kwargs)
1711
1712 def MoveTopTo(*args, **kwargs):
1713 """MoveTopTo(self, wxDouble n)"""
1714 return _core_.Rect2D_MoveTopTo(*args, **kwargs)
1715
1716 def GetBottom(*args, **kwargs):
1717 """GetBottom(self) -> wxDouble"""
1718 return _core_.Rect2D_GetBottom(*args, **kwargs)
1719
1720 def SetBottom(*args, **kwargs):
1721 """SetBottom(self, wxDouble n)"""
1722 return _core_.Rect2D_SetBottom(*args, **kwargs)
1723
1724 def MoveBottomTo(*args, **kwargs):
1725 """MoveBottomTo(self, wxDouble n)"""
1726 return _core_.Rect2D_MoveBottomTo(*args, **kwargs)
1727
1728 def GetRight(*args, **kwargs):
1729 """GetRight(self) -> wxDouble"""
1730 return _core_.Rect2D_GetRight(*args, **kwargs)
1731
1732 def SetRight(*args, **kwargs):
1733 """SetRight(self, wxDouble n)"""
1734 return _core_.Rect2D_SetRight(*args, **kwargs)
1735
1736 def MoveRightTo(*args, **kwargs):
1737 """MoveRightTo(self, wxDouble n)"""
1738 return _core_.Rect2D_MoveRightTo(*args, **kwargs)
1739
1740 def GetLeftTop(*args, **kwargs):
1741 """GetLeftTop(self) -> Point2D"""
1742 return _core_.Rect2D_GetLeftTop(*args, **kwargs)
1743
1744 def SetLeftTop(*args, **kwargs):
1745 """SetLeftTop(self, Point2D pt)"""
1746 return _core_.Rect2D_SetLeftTop(*args, **kwargs)
1747
1748 def MoveLeftTopTo(*args, **kwargs):
1749 """MoveLeftTopTo(self, Point2D pt)"""
1750 return _core_.Rect2D_MoveLeftTopTo(*args, **kwargs)
1751
1752 def GetLeftBottom(*args, **kwargs):
1753 """GetLeftBottom(self) -> Point2D"""
1754 return _core_.Rect2D_GetLeftBottom(*args, **kwargs)
1755
1756 def SetLeftBottom(*args, **kwargs):
1757 """SetLeftBottom(self, Point2D pt)"""
1758 return _core_.Rect2D_SetLeftBottom(*args, **kwargs)
1759
1760 def MoveLeftBottomTo(*args, **kwargs):
1761 """MoveLeftBottomTo(self, Point2D pt)"""
1762 return _core_.Rect2D_MoveLeftBottomTo(*args, **kwargs)
1763
1764 def GetRightTop(*args, **kwargs):
1765 """GetRightTop(self) -> Point2D"""
1766 return _core_.Rect2D_GetRightTop(*args, **kwargs)
1767
1768 def SetRightTop(*args, **kwargs):
1769 """SetRightTop(self, Point2D pt)"""
1770 return _core_.Rect2D_SetRightTop(*args, **kwargs)
1771
1772 def MoveRightTopTo(*args, **kwargs):
1773 """MoveRightTopTo(self, Point2D pt)"""
1774 return _core_.Rect2D_MoveRightTopTo(*args, **kwargs)
1775
1776 def GetRightBottom(*args, **kwargs):
1777 """GetRightBottom(self) -> Point2D"""
1778 return _core_.Rect2D_GetRightBottom(*args, **kwargs)
1779
1780 def SetRightBottom(*args, **kwargs):
1781 """SetRightBottom(self, Point2D pt)"""
1782 return _core_.Rect2D_SetRightBottom(*args, **kwargs)
1783
1784 def MoveRightBottomTo(*args, **kwargs):
1785 """MoveRightBottomTo(self, Point2D pt)"""
1786 return _core_.Rect2D_MoveRightBottomTo(*args, **kwargs)
1787
1788 def GetCentre(*args, **kwargs):
1789 """GetCentre(self) -> Point2D"""
1790 return _core_.Rect2D_GetCentre(*args, **kwargs)
1791
1792 def SetCentre(*args, **kwargs):
1793 """SetCentre(self, Point2D pt)"""
1794 return _core_.Rect2D_SetCentre(*args, **kwargs)
1795
1796 def MoveCentreTo(*args, **kwargs):
1797 """MoveCentreTo(self, Point2D pt)"""
1798 return _core_.Rect2D_MoveCentreTo(*args, **kwargs)
1799
1800 def GetOutcode(*args, **kwargs):
1801 """GetOutcode(self, Point2D pt) -> int"""
1802 return _core_.Rect2D_GetOutcode(*args, **kwargs)
1803
1804 def Contains(*args, **kwargs):
1805 """Contains(self, Point2D pt) -> bool"""
1806 return _core_.Rect2D_Contains(*args, **kwargs)
1807
1808 def ContainsRect(*args, **kwargs):
1809 """ContainsRect(self, Rect2D rect) -> bool"""
1810 return _core_.Rect2D_ContainsRect(*args, **kwargs)
1811
1812 def IsEmpty(*args, **kwargs):
1813 """IsEmpty(self) -> bool"""
1814 return _core_.Rect2D_IsEmpty(*args, **kwargs)
1815
1816 def HaveEqualSize(*args, **kwargs):
1817 """HaveEqualSize(self, Rect2D rect) -> bool"""
1818 return _core_.Rect2D_HaveEqualSize(*args, **kwargs)
1819
1820 def Inset(*args):
1821 """
1822 Inset(self, wxDouble x, wxDouble y)
1823 Inset(self, wxDouble left, wxDouble top, wxDouble right, wxDouble bottom)
1824 """
1825 return _core_.Rect2D_Inset(*args)
1826
1827 def Offset(*args, **kwargs):
1828 """Offset(self, Point2D pt)"""
1829 return _core_.Rect2D_Offset(*args, **kwargs)
1830
1831 def ConstrainTo(*args, **kwargs):
1832 """ConstrainTo(self, Rect2D rect)"""
1833 return _core_.Rect2D_ConstrainTo(*args, **kwargs)
1834
1835 def Interpolate(*args, **kwargs):
1836 """Interpolate(self, int widthfactor, int heightfactor) -> Point2D"""
1837 return _core_.Rect2D_Interpolate(*args, **kwargs)
1838
1839 def Intersect(*args, **kwargs):
1840 """Intersect(self, Rect2D otherRect)"""
1841 return _core_.Rect2D_Intersect(*args, **kwargs)
1842
1843 def CreateIntersection(*args, **kwargs):
1844 """CreateIntersection(self, Rect2D otherRect) -> Rect2D"""
1845 return _core_.Rect2D_CreateIntersection(*args, **kwargs)
1846
1847 def Intersects(*args, **kwargs):
1848 """Intersects(self, Rect2D rect) -> bool"""
1849 return _core_.Rect2D_Intersects(*args, **kwargs)
1850
1851 def Union(*args, **kwargs):
1852 """Union(self, Rect2D otherRect)"""
1853 return _core_.Rect2D_Union(*args, **kwargs)
1854
1855 def CreateUnion(*args, **kwargs):
1856 """CreateUnion(self, Rect2D otherRect) -> Rect2D"""
1857 return _core_.Rect2D_CreateUnion(*args, **kwargs)
1858
1859 def Scale(*args):
1860 """
1861 Scale(self, wxDouble f)
1862 Scale(self, int num, int denum)
1863 """
1864 return _core_.Rect2D_Scale(*args)
1865
1866 def __eq__(*args, **kwargs):
1867 """
1868 __eq__(self, PyObject other) -> bool
1869
1870 Test for equality of wx.Rect2D objects.
1871 """
1872 return _core_.Rect2D___eq__(*args, **kwargs)
1873
1874 def __ne__(*args, **kwargs):
1875 """
1876 __ne__(self, PyObject other) -> bool
1877
1878 Test for inequality of wx.Rect2D objects.
1879 """
1880 return _core_.Rect2D___ne__(*args, **kwargs)
1881
1882 x = property(_core_.Rect2D_x_get, _core_.Rect2D_x_set)
1883 y = property(_core_.Rect2D_y_get, _core_.Rect2D_y_set)
1884 width = property(_core_.Rect2D_width_get, _core_.Rect2D_width_set)
1885 height = property(_core_.Rect2D_height_get, _core_.Rect2D_height_set)
1886 def Set(*args, **kwargs):
1887 """Set(self, wxDouble x=0, wxDouble y=0, wxDouble width=0, wxDouble height=0)"""
1888 return _core_.Rect2D_Set(*args, **kwargs)
1889
1890 def Get(*args, **kwargs):
1891 """
1892 Get() -> (x,y, width, height)
1893
1894 Return x, y, width and height y properties as a tuple.
1895 """
1896 return _core_.Rect2D_Get(*args, **kwargs)
1897
1898 def __str__(self): return str(self.Get())
1899 def __repr__(self): return 'wx.Rect2D'+str(self.Get())
1900 def __len__(self): return len(self.Get())
1901 def __getitem__(self, index): return self.Get()[index]
1902 def __setitem__(self, index, val):
1903 if index == 0: self.x = val
1904 elif index == 1: self.y = val
1905 elif index == 2: self.width = val
1906 elif index == 3: self.height = val
1907 else: raise IndexError
1908 def __nonzero__(self): return self.Get() != (0.0, 0.0, 0.0, 0.0)
1909 __safe_for_unpickling__ = True
1910 def __reduce__(self): return (wx.Rect2D, self.Get())
1911
1912_core_.Rect2D_swigregister(Rect2D)
1913
1914#---------------------------------------------------------------------------
1915
5b5c9bc7
RD
1916FromStart = _core_.FromStart
1917FromCurrent = _core_.FromCurrent
1918FromEnd = _core_.FromEnd
d55e5bfc 1919class InputStream(object):
36ed4f51 1920 """Proxy of C++ InputStream class"""
1bd55598
RD
1921 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1922 __repr__ = _swig_repr
1923 def __init__(self, *args, **kwargs):
d55e5bfc 1924 """__init__(self, PyObject p) -> InputStream"""
1bd55598
RD
1925 _core_.InputStream_swiginit(self,_core_.new_InputStream(*args, **kwargs))
1926 __swig_destroy__ = _core_.delete_InputStream
1927 __del__ = lambda self : None;
d55e5bfc
RD
1928 def close(*args, **kwargs):
1929 """close(self)"""
5b5c9bc7 1930 return _core_.InputStream_close(*args, **kwargs)
d55e5bfc
RD
1931
1932 def flush(*args, **kwargs):
1933 """flush(self)"""
5b5c9bc7 1934 return _core_.InputStream_flush(*args, **kwargs)
d55e5bfc
RD
1935
1936 def eof(*args, **kwargs):
1937 """eof(self) -> bool"""
5b5c9bc7 1938 return _core_.InputStream_eof(*args, **kwargs)
d55e5bfc
RD
1939
1940 def read(*args, **kwargs):
1941 """read(self, int size=-1) -> PyObject"""
5b5c9bc7 1942 return _core_.InputStream_read(*args, **kwargs)
d55e5bfc
RD
1943
1944 def readline(*args, **kwargs):
1945 """readline(self, int size=-1) -> PyObject"""
5b5c9bc7 1946 return _core_.InputStream_readline(*args, **kwargs)
d55e5bfc
RD
1947
1948 def readlines(*args, **kwargs):
1949 """readlines(self, int sizehint=-1) -> PyObject"""
5b5c9bc7 1950 return _core_.InputStream_readlines(*args, **kwargs)
d55e5bfc
RD
1951
1952 def seek(*args, **kwargs):
1953 """seek(self, int offset, int whence=0)"""
5b5c9bc7 1954 return _core_.InputStream_seek(*args, **kwargs)
d55e5bfc
RD
1955
1956 def tell(*args, **kwargs):
1957 """tell(self) -> int"""
5b5c9bc7 1958 return _core_.InputStream_tell(*args, **kwargs)
d55e5bfc
RD
1959
1960 def Peek(*args, **kwargs):
1961 """Peek(self) -> char"""
5b5c9bc7 1962 return _core_.InputStream_Peek(*args, **kwargs)
d55e5bfc
RD
1963
1964 def GetC(*args, **kwargs):
1965 """GetC(self) -> char"""
5b5c9bc7 1966 return _core_.InputStream_GetC(*args, **kwargs)
d55e5bfc
RD
1967
1968 def LastRead(*args, **kwargs):
1969 """LastRead(self) -> size_t"""
5b5c9bc7 1970 return _core_.InputStream_LastRead(*args, **kwargs)
d55e5bfc
RD
1971
1972 def CanRead(*args, **kwargs):
1973 """CanRead(self) -> bool"""
5b5c9bc7 1974 return _core_.InputStream_CanRead(*args, **kwargs)
d55e5bfc
RD
1975
1976 def Eof(*args, **kwargs):
1977 """Eof(self) -> bool"""
5b5c9bc7 1978 return _core_.InputStream_Eof(*args, **kwargs)
d55e5bfc
RD
1979
1980 def Ungetch(*args, **kwargs):
1981 """Ungetch(self, char c) -> bool"""
5b5c9bc7 1982 return _core_.InputStream_Ungetch(*args, **kwargs)
d55e5bfc
RD
1983
1984 def SeekI(*args, **kwargs):
5b5c9bc7
RD
1985 """SeekI(self, long pos, int mode=FromStart) -> long"""
1986 return _core_.InputStream_SeekI(*args, **kwargs)
d55e5bfc
RD
1987
1988 def TellI(*args, **kwargs):
1989 """TellI(self) -> long"""
5b5c9bc7 1990 return _core_.InputStream_TellI(*args, **kwargs)
d55e5bfc 1991
2131d850 1992_core_.InputStream_swigregister(InputStream)
5b5c9bc7
RD
1993DefaultPosition = cvar.DefaultPosition
1994DefaultSize = cvar.DefaultSize
d55e5bfc 1995
5b5c9bc7
RD
1996class OutputStream(object):
1997 """Proxy of C++ OutputStream class"""
1bd55598
RD
1998 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
1999 def __init__(self): raise AttributeError, "No constructor defined"
2000 __repr__ = _swig_repr
d55e5bfc
RD
2001 def write(*args, **kwargs):
2002 """write(self, PyObject obj)"""
5b5c9bc7 2003 return _core_.OutputStream_write(*args, **kwargs)
d55e5bfc 2004
1bd55598
RD
2005 def LastWrite(*args, **kwargs):
2006 """LastWrite(self) -> size_t"""
2007 return _core_.OutputStream_LastWrite(*args, **kwargs)
d55e5bfc 2008
2131d850 2009_core_.OutputStream_swigregister(OutputStream)
d55e5bfc
RD
2010
2011#---------------------------------------------------------------------------
2012
5b5c9bc7
RD
2013class FSFile(Object):
2014 """Proxy of C++ FSFile class"""
1bd55598
RD
2015 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2016 __repr__ = _swig_repr
2017 def __init__(self, *args, **kwargs):
d55e5bfc 2018 """
5b5c9bc7
RD
2019 __init__(self, InputStream stream, String loc, String mimetype, String anchor,
2020 DateTime modif) -> FSFile
d55e5bfc 2021 """
1bd55598 2022 _core_.FSFile_swiginit(self,_core_.new_FSFile(*args, **kwargs))
1bd55598
RD
2023 __swig_destroy__ = _core_.delete_FSFile
2024 __del__ = lambda self : None;
d55e5bfc 2025 def GetStream(*args, **kwargs):
5b5c9bc7
RD
2026 """GetStream(self) -> InputStream"""
2027 return _core_.FSFile_GetStream(*args, **kwargs)
d55e5bfc 2028
ac5d357a
RD
2029 def DetachStream(*args, **kwargs):
2030 """DetachStream(self)"""
2031 return _core_.FSFile_DetachStream(*args, **kwargs)
2032
d55e5bfc 2033 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
2034 """GetMimeType(self) -> String"""
2035 return _core_.FSFile_GetMimeType(*args, **kwargs)
d55e5bfc
RD
2036
2037 def GetLocation(*args, **kwargs):
5b5c9bc7
RD
2038 """GetLocation(self) -> String"""
2039 return _core_.FSFile_GetLocation(*args, **kwargs)
d55e5bfc
RD
2040
2041 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
2042 """GetAnchor(self) -> String"""
2043 return _core_.FSFile_GetAnchor(*args, **kwargs)
d55e5bfc
RD
2044
2045 def GetModificationTime(*args, **kwargs):
5b5c9bc7
RD
2046 """GetModificationTime(self) -> DateTime"""
2047 return _core_.FSFile_GetModificationTime(*args, **kwargs)
d55e5bfc 2048
ac5d357a
RD
2049 Anchor = property(GetAnchor,doc="See `GetAnchor`")
2050 Location = property(GetLocation,doc="See `GetLocation`")
2051 MimeType = property(GetMimeType,doc="See `GetMimeType`")
2052 ModificationTime = property(GetModificationTime,doc="See `GetModificationTime`")
2053 Stream = property(GetStream,doc="See `GetStream`")
2131d850 2054_core_.FSFile_swigregister(FSFile)
d55e5bfc
RD
2055
2056class CPPFileSystemHandler(object):
36ed4f51 2057 """Proxy of C++ CPPFileSystemHandler class"""
1bd55598
RD
2058 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2059 def __init__(self): raise AttributeError, "No constructor defined"
2060 __repr__ = _swig_repr
50f151d7
RD
2061 __swig_destroy__ = _core_.delete_CPPFileSystemHandler
2062 __del__ = lambda self : None;
2131d850 2063_core_.CPPFileSystemHandler_swigregister(CPPFileSystemHandler)
d55e5bfc
RD
2064
2065class FileSystemHandler(CPPFileSystemHandler):
36ed4f51 2066 """Proxy of C++ FileSystemHandler class"""
1bd55598
RD
2067 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2068 __repr__ = _swig_repr
2069 def __init__(self, *args, **kwargs):
d55e5bfc 2070 """__init__(self) -> FileSystemHandler"""
1bd55598 2071 _core_.FileSystemHandler_swiginit(self,_core_.new_FileSystemHandler(*args, **kwargs))
c25f90f6 2072 FileSystemHandler._setCallbackInfo(self, self, FileSystemHandler)
d55e5bfc
RD
2073
2074 def _setCallbackInfo(*args, **kwargs):
2075 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 2076 return _core_.FileSystemHandler__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
2077
2078 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2079 """CanOpen(self, String location) -> bool"""
2080 return _core_.FileSystemHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2081
2082 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2083 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2084 return _core_.FileSystemHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
2085
2086 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2087 """FindFirst(self, String spec, int flags=0) -> String"""
2088 return _core_.FileSystemHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
2089
2090 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2091 """FindNext(self) -> String"""
2092 return _core_.FileSystemHandler_FindNext(*args, **kwargs)
d55e5bfc
RD
2093
2094 def GetProtocol(*args, **kwargs):
5b5c9bc7
RD
2095 """GetProtocol(self, String location) -> String"""
2096 return _core_.FileSystemHandler_GetProtocol(*args, **kwargs)
d55e5bfc
RD
2097
2098 def GetLeftLocation(*args, **kwargs):
5b5c9bc7
RD
2099 """GetLeftLocation(self, String location) -> String"""
2100 return _core_.FileSystemHandler_GetLeftLocation(*args, **kwargs)
d55e5bfc
RD
2101
2102 def GetAnchor(*args, **kwargs):
5b5c9bc7
RD
2103 """GetAnchor(self, String location) -> String"""
2104 return _core_.FileSystemHandler_GetAnchor(*args, **kwargs)
d55e5bfc
RD
2105
2106 def GetRightLocation(*args, **kwargs):
5b5c9bc7
RD
2107 """GetRightLocation(self, String location) -> String"""
2108 return _core_.FileSystemHandler_GetRightLocation(*args, **kwargs)
d55e5bfc
RD
2109
2110 def GetMimeTypeFromExt(*args, **kwargs):
5b5c9bc7
RD
2111 """GetMimeTypeFromExt(self, String location) -> String"""
2112 return _core_.FileSystemHandler_GetMimeTypeFromExt(*args, **kwargs)
d55e5bfc 2113
ac5d357a
RD
2114 Anchor = property(GetAnchor,doc="See `GetAnchor`")
2115 LeftLocation = property(GetLeftLocation,doc="See `GetLeftLocation`")
2116 MimeTypeFromExt = property(GetMimeTypeFromExt,doc="See `GetMimeTypeFromExt`")
2117 Protocol = property(GetProtocol,doc="See `GetProtocol`")
2118 RightLocation = property(GetRightLocation,doc="See `GetRightLocation`")
2131d850 2119_core_.FileSystemHandler_swigregister(FileSystemHandler)
d55e5bfc 2120
5b5c9bc7
RD
2121class FileSystem(Object):
2122 """Proxy of C++ FileSystem class"""
1bd55598
RD
2123 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2124 __repr__ = _swig_repr
2125 def __init__(self, *args, **kwargs):
5b5c9bc7 2126 """__init__(self) -> FileSystem"""
1bd55598
RD
2127 _core_.FileSystem_swiginit(self,_core_.new_FileSystem(*args, **kwargs))
2128 __swig_destroy__ = _core_.delete_FileSystem
2129 __del__ = lambda self : None;
d55e5bfc 2130 def ChangePathTo(*args, **kwargs):
5b5c9bc7
RD
2131 """ChangePathTo(self, String location, bool is_dir=False)"""
2132 return _core_.FileSystem_ChangePathTo(*args, **kwargs)
d55e5bfc
RD
2133
2134 def GetPath(*args, **kwargs):
5b5c9bc7
RD
2135 """GetPath(self) -> String"""
2136 return _core_.FileSystem_GetPath(*args, **kwargs)
d55e5bfc
RD
2137
2138 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2139 """OpenFile(self, String location) -> FSFile"""
2140 return _core_.FileSystem_OpenFile(*args, **kwargs)
d55e5bfc
RD
2141
2142 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2143 """FindFirst(self, String spec, int flags=0) -> String"""
2144 return _core_.FileSystem_FindFirst(*args, **kwargs)
d55e5bfc
RD
2145
2146 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2147 """FindNext(self) -> String"""
2148 return _core_.FileSystem_FindNext(*args, **kwargs)
d55e5bfc
RD
2149
2150 def AddHandler(*args, **kwargs):
d6c14a4c 2151 """AddHandler(CPPFileSystemHandler handler)"""
5b5c9bc7 2152 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc
RD
2153
2154 AddHandler = staticmethod(AddHandler)
ac5d357a
RD
2155 def RemoveHandler(*args, **kwargs):
2156 """RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2157 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
2158
2159 RemoveHandler = staticmethod(RemoveHandler)
d55e5bfc 2160 def CleanUpHandlers(*args, **kwargs):
d6c14a4c 2161 """CleanUpHandlers()"""
5b5c9bc7 2162 return _core_.FileSystem_CleanUpHandlers(*args, **kwargs)
d55e5bfc
RD
2163
2164 CleanUpHandlers = staticmethod(CleanUpHandlers)
2165 def FileNameToURL(*args, **kwargs):
5b5c9bc7
RD
2166 """FileNameToURL(String filename) -> String"""
2167 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc
RD
2168
2169 FileNameToURL = staticmethod(FileNameToURL)
b411df4a 2170 def URLToFileName(*args, **kwargs):
5b5c9bc7
RD
2171 """URLToFileName(String url) -> String"""
2172 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a
RD
2173
2174 URLToFileName = staticmethod(URLToFileName)
ac5d357a 2175 Path = property(GetPath,doc="See `GetPath`")
2131d850 2176_core_.FileSystem_swigregister(FileSystem)
d55e5bfc 2177
5b5c9bc7 2178def FileSystem_AddHandler(*args, **kwargs):
1bd55598
RD
2179 """FileSystem_AddHandler(CPPFileSystemHandler handler)"""
2180 return _core_.FileSystem_AddHandler(*args, **kwargs)
d55e5bfc 2181
ac5d357a
RD
2182def FileSystem_RemoveHandler(*args, **kwargs):
2183 """FileSystem_RemoveHandler(CPPFileSystemHandler handler) -> CPPFileSystemHandler"""
2184 return _core_.FileSystem_RemoveHandler(*args, **kwargs)
2185
1bd55598
RD
2186def FileSystem_CleanUpHandlers(*args):
2187 """FileSystem_CleanUpHandlers()"""
2188 return _core_.FileSystem_CleanUpHandlers(*args)
d55e5bfc 2189
5b5c9bc7 2190def FileSystem_FileNameToURL(*args, **kwargs):
1bd55598
RD
2191 """FileSystem_FileNameToURL(String filename) -> String"""
2192 return _core_.FileSystem_FileNameToURL(*args, **kwargs)
d55e5bfc 2193
5b5c9bc7 2194def FileSystem_URLToFileName(*args, **kwargs):
1bd55598
RD
2195 """FileSystem_URLToFileName(String url) -> String"""
2196 return _core_.FileSystem_URLToFileName(*args, **kwargs)
b411df4a 2197
5b5c9bc7
RD
2198class InternetFSHandler(CPPFileSystemHandler):
2199 """Proxy of C++ InternetFSHandler class"""
1bd55598
RD
2200 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2201 __repr__ = _swig_repr
2202 def __init__(self, *args, **kwargs):
5b5c9bc7 2203 """__init__(self) -> InternetFSHandler"""
1bd55598 2204 _core_.InternetFSHandler_swiginit(self,_core_.new_InternetFSHandler(*args, **kwargs))
d55e5bfc 2205 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2206 """CanOpen(self, String location) -> bool"""
2207 return _core_.InternetFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2208
2209 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2210 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2211 return _core_.InternetFSHandler_OpenFile(*args, **kwargs)
d55e5bfc 2212
2131d850 2213_core_.InternetFSHandler_swigregister(InternetFSHandler)
d55e5bfc 2214
5b5c9bc7
RD
2215class ZipFSHandler(CPPFileSystemHandler):
2216 """Proxy of C++ ZipFSHandler class"""
1bd55598
RD
2217 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2218 __repr__ = _swig_repr
2219 def __init__(self, *args, **kwargs):
5b5c9bc7 2220 """__init__(self) -> ZipFSHandler"""
1bd55598 2221 _core_.ZipFSHandler_swiginit(self,_core_.new_ZipFSHandler(*args, **kwargs))
d55e5bfc 2222 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2223 """CanOpen(self, String location) -> bool"""
2224 return _core_.ZipFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2225
2226 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2227 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2228 return _core_.ZipFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
2229
2230 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2231 """FindFirst(self, String spec, int flags=0) -> String"""
2232 return _core_.ZipFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
2233
2234 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2235 """FindNext(self) -> String"""
2236 return _core_.ZipFSHandler_FindNext(*args, **kwargs)
d55e5bfc 2237
2131d850 2238_core_.ZipFSHandler_swigregister(ZipFSHandler)
d55e5bfc
RD
2239
2240
2241def __wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs):
1bd55598
RD
2242 """__wxMemoryFSHandler_AddFile_wxImage(String filename, Image image, long type)"""
2243 return _core_.__wxMemoryFSHandler_AddFile_wxImage(*args, **kwargs)
d55e5bfc
RD
2244
2245def __wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs):
1bd55598
RD
2246 """__wxMemoryFSHandler_AddFile_wxBitmap(String filename, Bitmap bitmap, long type)"""
2247 return _core_.__wxMemoryFSHandler_AddFile_wxBitmap(*args, **kwargs)
d55e5bfc
RD
2248
2249def __wxMemoryFSHandler_AddFile_Data(*args, **kwargs):
1bd55598
RD
2250 """__wxMemoryFSHandler_AddFile_Data(String filename, PyObject data)"""
2251 return _core_.__wxMemoryFSHandler_AddFile_Data(*args, **kwargs)
b411df4a
RD
2252def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
2253 """
2254 Add 'file' to the memory filesystem. The dataItem parameter can
2255 either be a `wx.Bitmap`, `wx.Image` or a string that can contain
2256 arbitrary data. If a bitmap or image is used then the imgType
2257 parameter should specify what kind of image file it should be
2258 written as, wx.BITMAP_TYPE_PNG, etc.
2259 """
2260 if isinstance(dataItem, wx.Image):
2261 __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
2262 elif isinstance(dataItem, wx.Bitmap):
2263 __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
2264 elif type(dataItem) == str:
2265 __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
2266 else:
2267 raise TypeError, 'wx.Image, wx.Bitmap or string expected'
d55e5bfc 2268
5b5c9bc7
RD
2269class MemoryFSHandler(CPPFileSystemHandler):
2270 """Proxy of C++ MemoryFSHandler class"""
1bd55598
RD
2271 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2272 __repr__ = _swig_repr
2273 def __init__(self, *args, **kwargs):
5b5c9bc7 2274 """__init__(self) -> MemoryFSHandler"""
1bd55598 2275 _core_.MemoryFSHandler_swiginit(self,_core_.new_MemoryFSHandler(*args, **kwargs))
d55e5bfc 2276 def RemoveFile(*args, **kwargs):
5b5c9bc7
RD
2277 """RemoveFile(String filename)"""
2278 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc
RD
2279
2280 RemoveFile = staticmethod(RemoveFile)
2281 AddFile = staticmethod(MemoryFSHandler_AddFile)
2282 def CanOpen(*args, **kwargs):
5b5c9bc7
RD
2283 """CanOpen(self, String location) -> bool"""
2284 return _core_.MemoryFSHandler_CanOpen(*args, **kwargs)
d55e5bfc
RD
2285
2286 def OpenFile(*args, **kwargs):
5b5c9bc7
RD
2287 """OpenFile(self, FileSystem fs, String location) -> FSFile"""
2288 return _core_.MemoryFSHandler_OpenFile(*args, **kwargs)
d55e5bfc
RD
2289
2290 def FindFirst(*args, **kwargs):
5b5c9bc7
RD
2291 """FindFirst(self, String spec, int flags=0) -> String"""
2292 return _core_.MemoryFSHandler_FindFirst(*args, **kwargs)
d55e5bfc
RD
2293
2294 def FindNext(*args, **kwargs):
5b5c9bc7
RD
2295 """FindNext(self) -> String"""
2296 return _core_.MemoryFSHandler_FindNext(*args, **kwargs)
d55e5bfc 2297
2131d850 2298_core_.MemoryFSHandler_swigregister(MemoryFSHandler)
d55e5bfc 2299
5b5c9bc7 2300def MemoryFSHandler_RemoveFile(*args, **kwargs):
1bd55598
RD
2301 """MemoryFSHandler_RemoveFile(String filename)"""
2302 return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
d55e5bfc 2303
5b5c9bc7
RD
2304IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
2305IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
2306IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
f5263701
RD
2307IMAGE_QUALITY_NORMAL = _core_.IMAGE_QUALITY_NORMAL
2308IMAGE_QUALITY_HIGH = _core_.IMAGE_QUALITY_HIGH
d55e5bfc
RD
2309#---------------------------------------------------------------------------
2310
5b5c9bc7 2311class ImageHandler(Object):
27fb7603
RD
2312 """
2313 This is the base class for implementing image file loading/saving, and
2314 image creation from data. It is used within `wx.Image` and is not
2315 normally seen by the application.
2316 """
1bd55598
RD
2317 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2318 def __init__(self): raise AttributeError, "No constructor defined"
2319 __repr__ = _swig_repr
d55e5bfc 2320 def GetName(*args, **kwargs):
5b5c9bc7
RD
2321 """GetName(self) -> String"""
2322 return _core_.ImageHandler_GetName(*args, **kwargs)
d55e5bfc
RD
2323
2324 def GetExtension(*args, **kwargs):
5b5c9bc7
RD
2325 """GetExtension(self) -> String"""
2326 return _core_.ImageHandler_GetExtension(*args, **kwargs)
d55e5bfc
RD
2327
2328 def GetType(*args, **kwargs):
2329 """GetType(self) -> long"""
5b5c9bc7 2330 return _core_.ImageHandler_GetType(*args, **kwargs)
d55e5bfc
RD
2331
2332 def GetMimeType(*args, **kwargs):
5b5c9bc7
RD
2333 """GetMimeType(self) -> String"""
2334 return _core_.ImageHandler_GetMimeType(*args, **kwargs)
d55e5bfc
RD
2335
2336 def CanRead(*args, **kwargs):
5b5c9bc7
RD
2337 """CanRead(self, String name) -> bool"""
2338 return _core_.ImageHandler_CanRead(*args, **kwargs)
d55e5bfc 2339
b02396e8
RD
2340 def CanReadStream(*args, **kwargs):
2341 """CanReadStream(self, InputStream stream) -> bool"""
2342 return _core_.ImageHandler_CanReadStream(*args, **kwargs)
2343
d55e5bfc 2344 def SetName(*args, **kwargs):
5b5c9bc7
RD
2345 """SetName(self, String name)"""
2346 return _core_.ImageHandler_SetName(*args, **kwargs)
d55e5bfc
RD
2347
2348 def SetExtension(*args, **kwargs):
5b5c9bc7
RD
2349 """SetExtension(self, String extension)"""
2350 return _core_.ImageHandler_SetExtension(*args, **kwargs)
d55e5bfc
RD
2351
2352 def SetType(*args, **kwargs):
2353 """SetType(self, long type)"""
5b5c9bc7 2354 return _core_.ImageHandler_SetType(*args, **kwargs)
d55e5bfc
RD
2355
2356 def SetMimeType(*args, **kwargs):
5b5c9bc7
RD
2357 """SetMimeType(self, String mimetype)"""
2358 return _core_.ImageHandler_SetMimeType(*args, **kwargs)
d55e5bfc 2359
ac5d357a
RD
2360 Extension = property(GetExtension,SetExtension,doc="See `GetExtension` and `SetExtension`")
2361 MimeType = property(GetMimeType,SetMimeType,doc="See `GetMimeType` and `SetMimeType`")
2362 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
2363 Type = property(GetType,SetType,doc="See `GetType` and `SetType`")
2131d850 2364_core_.ImageHandler_swigregister(ImageHandler)
d55e5bfc 2365
943e8dfd
RD
2366class PyImageHandler(ImageHandler):
2367 """
2368 This is the base class for implementing image file loading/saving, and
2369 image creation from data, all written in Python. To create a custom
2370 image handler derive a new class from wx.PyImageHandler and provide
2371 the following methods::
2372
2373 def DoCanRead(self, stream) --> bool
2374 '''Check if this handler can read the image on the stream'''
2375
2376 def LoadFile(self, image, stream, verbose, index) --> bool
2377 '''Load image data from the stream and load it into image.'''
2378
2379 def SaveFile(self, image, stream, verbose) --> bool
2380 '''Save the iamge data in image to the stream using
2381 this handler's image file format.'''
2382
2383 def GetImageCount(self, stream) --> int
2384 '''If this image format can hold more than one image,
2385 how many does the image on the stream have?'''
2386
2387 To activate your handler create an instance of it and pass it to
2388 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2389 `SetExtension` from your constructor.
2390
2391 """
1bd55598
RD
2392 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2393 __repr__ = _swig_repr
2394 def __init__(self, *args, **kwargs):
943e8dfd
RD
2395 """
2396 __init__(self) -> PyImageHandler
2397
2398 This is the base class for implementing image file loading/saving, and
2399 image creation from data, all written in Python. To create a custom
2400 image handler derive a new class from wx.PyImageHandler and provide
2401 the following methods::
2402
2403 def DoCanRead(self, stream) --> bool
2404 '''Check if this handler can read the image on the stream'''
2405
2406 def LoadFile(self, image, stream, verbose, index) --> bool
2407 '''Load image data from the stream and load it into image.'''
2408
2409 def SaveFile(self, image, stream, verbose) --> bool
2410 '''Save the iamge data in image to the stream using
2411 this handler's image file format.'''
2412
2413 def GetImageCount(self, stream) --> int
2414 '''If this image format can hold more than one image,
2415 how many does the image on the stream have?'''
2416
2417 To activate your handler create an instance of it and pass it to
2418 `wx.Image_AddHandler`. Be sure to call `SetName`, `SetType`, and
2419 `SetExtension` from your constructor.
2420
2421 """
1bd55598 2422 _core_.PyImageHandler_swiginit(self,_core_.new_PyImageHandler(*args, **kwargs))
943e8dfd
RD
2423 self._SetSelf(self)
2424
2425 def _SetSelf(*args, **kwargs):
2426 """_SetSelf(self, PyObject self)"""
2427 return _core_.PyImageHandler__SetSelf(*args, **kwargs)
2428
2131d850 2429_core_.PyImageHandler_swigregister(PyImageHandler)
943e8dfd 2430
5b5c9bc7
RD
2431class ImageHistogram(object):
2432 """Proxy of C++ ImageHistogram class"""
1bd55598
RD
2433 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2434 __repr__ = _swig_repr
2435 def __init__(self, *args, **kwargs):
5b5c9bc7 2436 """__init__(self) -> ImageHistogram"""
1bd55598 2437 _core_.ImageHistogram_swiginit(self,_core_.new_ImageHistogram(*args, **kwargs))
d55e5bfc
RD
2438 def MakeKey(*args, **kwargs):
2439 """
7a27cf7c 2440 MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2441
2442 Get the key in the histogram for the given RGB values
2443 """
5b5c9bc7 2444 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc
RD
2445
2446 MakeKey = staticmethod(MakeKey)
2447 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2448 """
2449 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2450
2451 Find first colour that is not used in the image and has higher RGB
2452 values than startR, startG, startB. Returns a tuple consisting of a
2453 success flag and rgb values.
2454 """
5b5c9bc7 2455 return _core_.ImageHistogram_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2456
f1cbd8fa
RD
2457 def GetCount(*args, **kwargs):
2458 """
2459 GetCount(self, unsigned long key) -> unsigned long
2460
2461 Returns the pixel count for the given key. Use `MakeKey` to create a
2462 key value from a RGB tripple.
2463 """
5b5c9bc7 2464 return _core_.ImageHistogram_GetCount(*args, **kwargs)
f1cbd8fa
RD
2465
2466 def GetCountRGB(*args, **kwargs):
2467 """
7a27cf7c 2468 GetCountRGB(self, byte r, byte g, byte b) -> unsigned long
f1cbd8fa
RD
2469
2470 Returns the pixel count for the given RGB values.
2471 """
5b5c9bc7 2472 return _core_.ImageHistogram_GetCountRGB(*args, **kwargs)
f1cbd8fa
RD
2473
2474 def GetCountColour(*args, **kwargs):
2475 """
5b5c9bc7 2476 GetCountColour(self, Colour colour) -> unsigned long
f1cbd8fa
RD
2477
2478 Returns the pixel count for the given `wx.Colour` value.
2479 """
5b5c9bc7 2480 return _core_.ImageHistogram_GetCountColour(*args, **kwargs)
f1cbd8fa 2481
2131d850 2482_core_.ImageHistogram_swigregister(ImageHistogram)
d55e5bfc 2483
5b5c9bc7 2484def ImageHistogram_MakeKey(*args, **kwargs):
1bd55598 2485 """
7a27cf7c 2486 ImageHistogram_MakeKey(byte r, byte g, byte b) -> unsigned long
d55e5bfc
RD
2487
2488 Get the key in the histogram for the given RGB values
2489 """
1bd55598 2490 return _core_.ImageHistogram_MakeKey(*args, **kwargs)
d55e5bfc 2491
943e8dfd
RD
2492class Image_RGBValue(object):
2493 """
2494 An object that contains values for red, green and blue which represent
2495 the value of a color. It is used by `wx.Image.HSVtoRGB` and
2496 `wx.Image.RGBtoHSV`, which converts between HSV color space and RGB
2497 color space.
2498 """
1bd55598
RD
2499 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2500 __repr__ = _swig_repr
2501 def __init__(self, *args, **kwargs):
943e8dfd
RD
2502 """
2503 __init__(self, byte r=0, byte g=0, byte b=0) -> Image_RGBValue
2504
2505 Constructor.
2506 """
1bd55598 2507 _core_.Image_RGBValue_swiginit(self,_core_.new_Image_RGBValue(*args, **kwargs))
943e8dfd
RD
2508 red = property(_core_.Image_RGBValue_red_get, _core_.Image_RGBValue_red_set)
2509 green = property(_core_.Image_RGBValue_green_get, _core_.Image_RGBValue_green_set)
2510 blue = property(_core_.Image_RGBValue_blue_get, _core_.Image_RGBValue_blue_set)
2131d850 2511_core_.Image_RGBValue_swigregister(Image_RGBValue)
943e8dfd
RD
2512
2513class Image_HSVValue(object):
2514 """
2515 An object that contains values for hue, saturation and value which
2516 represent the value of a color. It is used by `wx.Image.HSVtoRGB` and
2517 `wx.Image.RGBtoHSV`, which +converts between HSV color space and RGB
2518 color space.
2519 """
1bd55598
RD
2520 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2521 __repr__ = _swig_repr
2522 def __init__(self, *args, **kwargs):
943e8dfd
RD
2523 """
2524 __init__(self, double h=0.0, double s=0.0, double v=0.0) -> Image_HSVValue
2525
2526 Constructor.
2527 """
1bd55598 2528 _core_.Image_HSVValue_swiginit(self,_core_.new_Image_HSVValue(*args, **kwargs))
943e8dfd
RD
2529 hue = property(_core_.Image_HSVValue_hue_get, _core_.Image_HSVValue_hue_set)
2530 saturation = property(_core_.Image_HSVValue_saturation_get, _core_.Image_HSVValue_saturation_set)
2531 value = property(_core_.Image_HSVValue_value_get, _core_.Image_HSVValue_value_set)
2131d850 2532_core_.Image_HSVValue_swigregister(Image_HSVValue)
943e8dfd 2533
5b5c9bc7 2534class Image(Object):
7a27cf7c
RD
2535 """
2536 A platform-independent image class. An image can be created from
2537 data, or using `wx.Bitmap.ConvertToImage`, or loaded from a file in a
2538 variety of formats. Functions are available to set and get image
2539 bits, so it can be used for basic image manipulation.
2540
2541 A wx.Image cannot be drawn directly to a `wx.DC`. Instead, a
2542 platform-specific `wx.Bitmap` object must be created from it using the
2543 `wx.BitmapFromImage` constructor. This bitmap can then be drawn in a
2544 device context, using `wx.DC.DrawBitmap`.
2545
2546 One colour value of the image may be used as a mask colour which will
2547 lead to the automatic creation of a `wx.Mask` object associated to the
2548 bitmap object.
2549
2550 wx.Image supports alpha channel data, that is in addition to a byte
2551 for the red, green and blue colour components for each pixel it also
2552 stores a byte representing the pixel opacity. An alpha value of 0
2553 corresponds to a transparent pixel (null opacity) while a value of 255
2554 means that the pixel is 100% opaque.
2555
2556 Unlike RGB data, not all images have an alpha channel and before using
2557 `GetAlpha` you should check if this image contains an alpha channel
2558 with `HasAlpha`. Note that currently only images loaded from PNG files
2559 with transparency information will have an alpha channel.
2560 """
1bd55598
RD
2561 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
2562 __repr__ = _swig_repr
2563 def __init__(self, *args, **kwargs):
7a27cf7c
RD
2564 """
2565 __init__(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
2566
2567 Loads an image from a file.
2568 """
1bd55598
RD
2569 _core_.Image_swiginit(self,_core_.new_Image(*args, **kwargs))
2570 __swig_destroy__ = _core_.delete_Image
2571 __del__ = lambda self : None;
d55e5bfc 2572 def Create(*args, **kwargs):
7a27cf7c
RD
2573 """
2574 Create(self, int width, int height, bool clear=True)
2575
2576 Creates a fresh image. If clear is ``True``, the new image will be
2577 initialized to black. Otherwise, the image data will be uninitialized.
2578 """
5b5c9bc7 2579 return _core_.Image_Create(*args, **kwargs)
d55e5bfc
RD
2580
2581 def Destroy(*args, **kwargs):
2582 """
2583 Destroy(self)
2584
7a27cf7c 2585 Destroys the image data.
d55e5bfc 2586 """
b39fe951
RD
2587 args[0].this.own(False)
2588 return _core_.Image_Destroy(*args, **kwargs)
d55e5bfc
RD
2589
2590 def Scale(*args, **kwargs):
7a27cf7c 2591 """
f5263701 2592 Scale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
7a27cf7c
RD
2593
2594 Returns a scaled version of the image. This is also useful for scaling
2595 bitmaps in general as the only other way to scale bitmaps is to blit a
f5263701
RD
2596 `wx.MemoryDC` into another `wx.MemoryDC`. The ``quality`` parameter
2597 specifies what method to use for resampling the image. It can be
2598 either wx.IMAGE_QUALITY_NORMAL, which uses the normal default scaling
2599 method of pixel replication, or wx.IMAGE_QUALITY_HIGH which uses
2600 bicubic and box averaging resampling methods for upsampling and
2601 downsampling respectively.
7a27cf7c 2602 """
5b5c9bc7 2603 return _core_.Image_Scale(*args, **kwargs)
d55e5bfc 2604
f5263701
RD
2605 def ResampleBox(*args, **kwargs):
2606 """ResampleBox(self, int width, int height) -> Image"""
2607 return _core_.Image_ResampleBox(*args, **kwargs)
2608
2609 def ResampleBicubic(*args, **kwargs):
2610 """ResampleBicubic(self, int width, int height) -> Image"""
2611 return _core_.Image_ResampleBicubic(*args, **kwargs)
2612
2613 def Blur(*args, **kwargs):
2614 """
2615 Blur(self, int radius) -> Image
2616
2617 Blurs the image in both horizontal and vertical directions by the
2618 specified pixel ``radius``. This should not be used when using a
2619 single mask colour for transparency.
2620 """
2621 return _core_.Image_Blur(*args, **kwargs)
2622
2623 def BlurHorizontal(*args, **kwargs):
2624 """
2625 BlurHorizontal(self, int radius) -> Image
2626
2627 Blurs the image in the horizontal direction only. This should not be
2628 used when using a single mask colour for transparency.
2629
2630 """
2631 return _core_.Image_BlurHorizontal(*args, **kwargs)
2632
2633 def BlurVertical(*args, **kwargs):
2634 """
2635 BlurVertical(self, int radius) -> Image
2636
2637 Blurs the image in the vertical direction only. This should not be
2638 used when using a single mask colour for transparency.
2639 """
2640 return _core_.Image_BlurVertical(*args, **kwargs)
2641
d55e5bfc 2642 def ShrinkBy(*args, **kwargs):
7a27cf7c
RD
2643 """
2644 ShrinkBy(self, int xFactor, int yFactor) -> Image
2645
2646 Return a version of the image scaled smaller by the given factors.
2647 """
5b5c9bc7 2648 return _core_.Image_ShrinkBy(*args, **kwargs)
d55e5bfc
RD
2649
2650 def Rescale(*args, **kwargs):
7a27cf7c 2651 """
f5263701 2652 Rescale(self, int width, int height, int quality=IMAGE_QUALITY_NORMAL) -> Image
7a27cf7c
RD
2653
2654 Changes the size of the image in-place by scaling it: after a call to
2655 this function, the image will have the given width and height.
2656
2657 Returns the (modified) image itself.
2658 """
5b5c9bc7 2659 return _core_.Image_Rescale(*args, **kwargs)
d55e5bfc 2660
aff4cc5c 2661 def Resize(*args, **kwargs):
7a27cf7c
RD
2662 """
2663 Resize(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2664
2665 Changes the size of the image in-place without scaling it, by adding
2666 either a border with the given colour or cropping as necessary. The
2667 image is pasted into a new image with the given size and background
2668 colour at the position pos relative to the upper left of the new
2669 image. If red = green = blue = -1 then use either the current mask
2670 colour if set or find, use, and set a suitable mask colour for any
2671 newly exposed areas.
2672
2673 Returns the (modified) image itself.
2674 """
5b5c9bc7 2675 return _core_.Image_Resize(*args, **kwargs)
aff4cc5c 2676
d55e5bfc 2677 def SetRGB(*args, **kwargs):
7a27cf7c
RD
2678 """
2679 SetRGB(self, int x, int y, byte r, byte g, byte b)
2680
2681 Sets the pixel at the given coordinate. This routine performs
2682 bounds-checks for the coordinate so it can be considered a safe way to
2683 manipulate the data, but in some cases this might be too slow so that
2684 the data will have to be set directly. In that case you will have to
2685 get access to the image data using the `GetData` method.
2686 """
5b5c9bc7 2687 return _core_.Image_SetRGB(*args, **kwargs)
d55e5bfc 2688
aff4cc5c 2689 def SetRGBRect(*args, **kwargs):
7a27cf7c
RD
2690 """
2691 SetRGBRect(self, Rect rect, byte r, byte g, byte b)
2692
2693 Sets the colour of the pixels within the given rectangle. This routine
2694 performs bounds-checks for the rectangle so it can be considered a
2695 safe way to manipulate the data.
2696 """
5b5c9bc7 2697 return _core_.Image_SetRGBRect(*args, **kwargs)
aff4cc5c 2698
d55e5bfc 2699 def GetRed(*args, **kwargs):
7a27cf7c
RD
2700 """
2701 GetRed(self, int x, int y) -> byte
2702
2703 Returns the red intensity at the given coordinate.
2704 """
5b5c9bc7 2705 return _core_.Image_GetRed(*args, **kwargs)
d55e5bfc
RD
2706
2707 def GetGreen(*args, **kwargs):
7a27cf7c
RD
2708 """
2709 GetGreen(self, int x, int y) -> byte
2710
2711 Returns the green intensity at the given coordinate.
2712 """
5b5c9bc7 2713 return _core_.Image_GetGreen(*args, **kwargs)
d55e5bfc
RD
2714
2715 def GetBlue(*args, **kwargs):
7a27cf7c
RD
2716 """
2717 GetBlue(self, int x, int y) -> byte
2718
2719 Returns the blue intensity at the given coordinate.
2720 """
5b5c9bc7 2721 return _core_.Image_GetBlue(*args, **kwargs)
d55e5bfc
RD
2722
2723 def SetAlpha(*args, **kwargs):
7a27cf7c
RD
2724 """
2725 SetAlpha(self, int x, int y, byte alpha)
2726
2727 Sets the alpha value for the given pixel. This function should only be
2728 called if the image has alpha channel data, use `HasAlpha` to check
2729 for this.
2730 """
5b5c9bc7 2731 return _core_.Image_SetAlpha(*args, **kwargs)
d55e5bfc
RD
2732
2733 def GetAlpha(*args, **kwargs):
7a27cf7c
RD
2734 """
2735 GetAlpha(self, int x, int y) -> byte
2736
2737 Returns the alpha value for the given pixel. This function may only be
2738 called for the images with alpha channel, use `HasAlpha` to check for
2739 this.
2740
2741 The returned value is the *opacity* of the image, i.e. the value of 0
2742 corresponds to the fully transparent pixels while the value of 255 to
2743 the fully opaque pixels.
2744 """
5b5c9bc7 2745 return _core_.Image_GetAlpha(*args, **kwargs)
d55e5bfc
RD
2746
2747 def HasAlpha(*args, **kwargs):
7a27cf7c
RD
2748 """
2749 HasAlpha(self) -> bool
2750
2751 Returns true if this image has alpha channel, false otherwise.
2752 """
5b5c9bc7 2753 return _core_.Image_HasAlpha(*args, **kwargs)
d55e5bfc 2754
68350608
RD
2755 def InitAlpha(*args, **kwargs):
2756 """
2757 InitAlpha(self)
2758
2759 Initializes the image alpha channel data. It is an error to call it if
2760 the image already has alpha data. If it doesn't, alpha data will be by
2761 default initialized to all pixels being fully opaque. But if the image
2762 has a a mask colour, all mask pixels will be completely transparent.
2763 """
5b5c9bc7
RD
2764 return _core_.Image_InitAlpha(*args, **kwargs)
2765
2766 def IsTransparent(*args, **kwargs):
2767 """
7a27cf7c 2768 IsTransparent(self, int x, int y, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
5b5c9bc7 2769
7a27cf7c
RD
2770 Returns ``True`` if this pixel is masked or has an alpha value less
2771 than the spcified threshold.
5b5c9bc7
RD
2772 """
2773 return _core_.Image_IsTransparent(*args, **kwargs)
68350608 2774
d55e5bfc 2775 def FindFirstUnusedColour(*args, **kwargs):
fd2dc343
RD
2776 """
2777 FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
2778
2779 Find first colour that is not used in the image and has higher RGB
2780 values than startR, startG, startB. Returns a tuple consisting of a
2781 success flag and rgb values.
2782 """
5b5c9bc7 2783 return _core_.Image_FindFirstUnusedColour(*args, **kwargs)
d55e5bfc 2784
4cf4100f
RD
2785 def ConvertAlphaToMask(*args, **kwargs):
2786 """
5b5c9bc7 2787 ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
4cf4100f 2788
7a27cf7c
RD
2789 If the image has alpha channel, this method converts it to mask. All
2790 pixels with alpha value less than ``threshold`` are replaced with the
2791 mask colour and the alpha channel is removed. The mask colour is
2792 chosen automatically using `FindFirstUnusedColour`.
4cf4100f
RD
2793
2794 If the image image doesn't have alpha channel, ConvertAlphaToMask does
2795 nothing.
2796 """
5b5c9bc7 2797 return _core_.Image_ConvertAlphaToMask(*args, **kwargs)
4cf4100f 2798
8fb0e70a
RD
2799 def ConvertColourToAlpha(*args, **kwargs):
2800 """
7a27cf7c 2801 ConvertColourToAlpha(self, byte r, byte g, byte b) -> bool
8fb0e70a
RD
2802
2803 This method converts an image where the original alpha information is
2804 only available as a shades of a colour (actually shades of grey)
2805 typically when you draw anti-aliased text into a bitmap. The DC
2806 drawing routines draw grey values on the black background although
2807 they actually mean to draw white with differnt alpha values. This
2808 method reverses it, assuming a black (!) background and white text.
2809 The method will then fill up the whole image with the colour given.
2810 """
5b5c9bc7 2811 return _core_.Image_ConvertColourToAlpha(*args, **kwargs)
8fb0e70a 2812
d55e5bfc 2813 def SetMaskFromImage(*args, **kwargs):
7a27cf7c
RD
2814 """
2815 SetMaskFromImage(self, Image mask, byte mr, byte mg, byte mb) -> bool
2816
2817 Sets the image's mask so that the pixels that have RGB value of
2818 ``(mr,mg,mb)`` in ``mask`` will be masked in this image. This is done
2819 by first finding an unused colour in the image, setting this colour as
2820 the mask colour and then using this colour to draw all pixels in the
2821 image who corresponding pixel in mask has given RGB value.
2822
2823 Returns ``False`` if ``mask`` does not have same dimensions as the
2824 image or if there is no unused colour left. Returns ``True`` if the
2825 mask was successfully applied.
2826
2827 Note that this method involves computing the histogram, which is
2828 computationally intensive operation.
2829 """
5b5c9bc7 2830 return _core_.Image_SetMaskFromImage(*args, **kwargs)
d55e5bfc
RD
2831
2832 def CanRead(*args, **kwargs):
7a27cf7c
RD
2833 """
2834 CanRead(String filename) -> bool
2835
2836 Returns True if the image handlers can read this file.
2837 """
5b5c9bc7 2838 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc
RD
2839
2840 CanRead = staticmethod(CanRead)
2841 def GetImageCount(*args, **kwargs):
7a27cf7c
RD
2842 """
2843 GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
2844
2845 If the image file contains more than one image and the image handler
2846 is capable of retrieving these individually, this function will return
2847 the number of available images.
2848 """
5b5c9bc7 2849 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc
RD
2850
2851 GetImageCount = staticmethod(GetImageCount)
2852 def LoadFile(*args, **kwargs):
7a27cf7c
RD
2853 """
2854 LoadFile(self, String name, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2855
2856 Loads an image from a file. If no handler type is provided, the
2857 library will try to autodetect the format.
2858 """
5b5c9bc7 2859 return _core_.Image_LoadFile(*args, **kwargs)
d55e5bfc
RD
2860
2861 def LoadMimeFile(*args, **kwargs):
7a27cf7c
RD
2862 """
2863 LoadMimeFile(self, String name, String mimetype, int index=-1) -> bool
2864
2865 Loads an image from a file, specifying the image type with a MIME type
2866 string.
2867 """
5b5c9bc7 2868 return _core_.Image_LoadMimeFile(*args, **kwargs)
d55e5bfc
RD
2869
2870 def SaveFile(*args, **kwargs):
7a27cf7c
RD
2871 """
2872 SaveFile(self, String name, int type) -> bool
2873
2874 Saves an image in the named file.
2875 """
5b5c9bc7 2876 return _core_.Image_SaveFile(*args, **kwargs)
d55e5bfc
RD
2877
2878 def SaveMimeFile(*args, **kwargs):
7a27cf7c
RD
2879 """
2880 SaveMimeFile(self, String name, String mimetype) -> bool
2881
2882 Saves an image in the named file.
2883 """
5b5c9bc7 2884 return _core_.Image_SaveMimeFile(*args, **kwargs)
d55e5bfc
RD
2885
2886 def CanReadStream(*args, **kwargs):
7a27cf7c
RD
2887 """
2888 CanReadStream(InputStream stream) -> bool
2889
2890 Returns True if the image handlers can read an image file from the
2891 data currently on the input stream, or a readable Python file-like
2892 object.
2893 """
5b5c9bc7 2894 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc
RD
2895
2896 CanReadStream = staticmethod(CanReadStream)
2897 def LoadStream(*args, **kwargs):
7a27cf7c
RD
2898 """
2899 LoadStream(self, InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> bool
2900
2901 Loads an image from an input stream or a readable Python file-like
2902 object. If no handler type is provided, the library will try to
2903 autodetect the format.
2904 """
5b5c9bc7 2905 return _core_.Image_LoadStream(*args, **kwargs)
d55e5bfc
RD
2906
2907 def LoadMimeStream(*args, **kwargs):
7a27cf7c
RD
2908 """
2909 LoadMimeStream(self, InputStream stream, String mimetype, int index=-1) -> bool
2910
2911 Loads an image from an input stream or a readable Python file-like
2912 object, using a MIME type string to specify the image file format.
2913 """
5b5c9bc7 2914 return _core_.Image_LoadMimeStream(*args, **kwargs)
d55e5bfc 2915
b39fe951 2916 def IsOk(*args, **kwargs):
7a27cf7c 2917 """
b39fe951 2918 IsOk(self) -> bool
7a27cf7c
RD
2919
2920 Returns true if image data is present.
2921 """
b39fe951 2922 return _core_.Image_IsOk(*args, **kwargs)
d55e5bfc 2923
b39fe951 2924 Ok = IsOk
d55e5bfc 2925 def GetWidth(*args, **kwargs):
7a27cf7c
RD
2926 """
2927 GetWidth(self) -> int
2928
2929 Gets the width of the image in pixels.
2930 """
5b5c9bc7 2931 return _core_.Image_GetWidth(*args, **kwargs)
d55e5bfc
RD
2932
2933 def GetHeight(*args, **kwargs):
7a27cf7c
RD
2934 """
2935 GetHeight(self) -> int
2936
2937 Gets the height of the image in pixels.
2938 """
5b5c9bc7 2939 return _core_.Image_GetHeight(*args, **kwargs)
d55e5bfc
RD
2940
2941 def GetSize(*args, **kwargs):
7a27cf7c
RD
2942 """
2943 GetSize(self) -> Size
2944
2945 Returns the size of the image in pixels.
2946 """
5b5c9bc7 2947 return _core_.Image_GetSize(*args, **kwargs)
d55e5bfc
RD
2948
2949 def GetSubImage(*args, **kwargs):
7a27cf7c
RD
2950 """
2951 GetSubImage(self, Rect rect) -> Image
2952
2953 Returns a sub image of the current one as long as the rect belongs
2954 entirely to the image.
2955 """
5b5c9bc7 2956 return _core_.Image_GetSubImage(*args, **kwargs)
d55e5bfc 2957
aff4cc5c 2958 def Size(*args, **kwargs):
7a27cf7c
RD
2959 """
2960 Size(self, Size size, Point pos, int r=-1, int g=-1, int b=-1) -> Image
2961
2962 Returns a resized version of this image without scaling it by adding
2963 either a border with the given colour or cropping as necessary. The
2964 image is pasted into a new image with the given size and background
2965 colour at the position ``pos`` relative to the upper left of the new
2966 image. If red = green = blue = -1 then use either the current mask
2967 colour if set or find, use, and set a suitable mask colour for any
2968 newly exposed areas.
2969 """
5b5c9bc7 2970 return _core_.Image_Size(*args, **kwargs)
aff4cc5c 2971
d55e5bfc 2972 def Copy(*args, **kwargs):
7a27cf7c
RD
2973 """
2974 Copy(self) -> Image
2975
2976 Returns an identical copy of the image.
2977 """
5b5c9bc7 2978 return _core_.Image_Copy(*args, **kwargs)
d55e5bfc
RD
2979
2980 def Paste(*args, **kwargs):
7a27cf7c
RD
2981 """
2982 Paste(self, Image image, int x, int y)
2983
2984 Pastes ``image`` into this instance and takes care of the mask colour
2985 and any out of bounds problems.
2986 """
5b5c9bc7 2987 return _core_.Image_Paste(*args, **kwargs)
d55e5bfc
RD
2988
2989 def GetData(*args, **kwargs):
bb2ef2cc
RD
2990 """
2991 GetData(self) -> PyObject
2992
2993 Returns a string containing a copy of the RGB bytes of the image.
2994 """
5b5c9bc7 2995 return _core_.Image_GetData(*args, **kwargs)
d55e5bfc
RD
2996
2997 def SetData(*args, **kwargs):
bb2ef2cc
RD
2998 """
2999 SetData(self, buffer data)
3000
3001 Resets the Image's RGB data from a buffer of RGB bytes. Accepts
3002 either a string or a buffer object holding the data and the length of
3003 the data must be width*height*3.
3004 """
5b5c9bc7 3005 return _core_.Image_SetData(*args, **kwargs)
d55e5bfc
RD
3006
3007 def GetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
3008 """
3009 GetDataBuffer(self) -> PyObject
3010
3011 Returns a writable Python buffer object that is pointing at the RGB
7a27cf7c
RD
3012 image data buffer inside the wx.Image. You need to ensure that you do
3013 not use this buffer object after the image has been destroyed.
bb2ef2cc 3014 """
5b5c9bc7 3015 return _core_.Image_GetDataBuffer(*args, **kwargs)
d55e5bfc
RD
3016
3017 def SetDataBuffer(*args, **kwargs):
bb2ef2cc
RD
3018 """
3019 SetDataBuffer(self, buffer data)
3020
3021 Sets the internal image data pointer to point at a Python buffer
7a27cf7c
RD
3022 object. This can save making an extra copy of the data but you must
3023 ensure that the buffer object lives longer than the wx.Image does.
bb2ef2cc 3024 """
5b5c9bc7 3025 return _core_.Image_SetDataBuffer(*args, **kwargs)
d55e5bfc
RD
3026
3027 def GetAlphaData(*args, **kwargs):
bb2ef2cc
RD
3028 """
3029 GetAlphaData(self) -> PyObject
3030
3031 Returns a string containing a copy of the alpha bytes of the image.
3032 """
5b5c9bc7 3033 return _core_.Image_GetAlphaData(*args, **kwargs)
d55e5bfc
RD
3034
3035 def SetAlphaData(*args, **kwargs):
bb2ef2cc
RD
3036 """
3037 SetAlphaData(self, buffer alpha)
3038
3039 Resets the Image's alpha data from a buffer of bytes. Accepts either
3040 a string or a buffer object holding the data and the length of the
3041 data must be width*height.
3042 """
5b5c9bc7 3043 return _core_.Image_SetAlphaData(*args, **kwargs)
d55e5bfc
RD
3044
3045 def GetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
3046 """
3047 GetAlphaBuffer(self) -> PyObject
3048
3049 Returns a writable Python buffer object that is pointing at the Alpha
3050 data buffer inside the wx.Image. You need to ensure that you do not
3051 use this buffer object after the image has been destroyed.
3052 """
5b5c9bc7 3053 return _core_.Image_GetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
3054
3055 def SetAlphaBuffer(*args, **kwargs):
fc46b7f3
RD
3056 """
3057 SetAlphaBuffer(self, buffer alpha)
3058
3059 Sets the internal image alpha pointer to point at a Python buffer
3060 object. This can save making an extra copy of the data but you must
3061 ensure that the buffer object lives as long as the wx.Image does.
3062 """
5b5c9bc7 3063 return _core_.Image_SetAlphaBuffer(*args, **kwargs)
d55e5bfc
RD
3064
3065 def SetMaskColour(*args, **kwargs):
7a27cf7c
RD
3066 """
3067 SetMaskColour(self, byte r, byte g, byte b)
3068
3069 Sets the mask colour for this image (and tells the image to use the
3070 mask).
3071 """
5b5c9bc7 3072 return _core_.Image_SetMaskColour(*args, **kwargs)
d55e5bfc 3073
aff4cc5c
RD
3074 def GetOrFindMaskColour(*args, **kwargs):
3075 """
3076 GetOrFindMaskColour() -> (r,g,b)
3077
3078 Get the current mask colour or find a suitable colour.
3079 """
5b5c9bc7 3080 return _core_.Image_GetOrFindMaskColour(*args, **kwargs)
aff4cc5c 3081
d55e5bfc 3082 def GetMaskRed(*args, **kwargs):
7a27cf7c
RD
3083 """
3084 GetMaskRed(self) -> byte
3085
3086 Gets the red component of the mask colour.
3087 """
5b5c9bc7 3088 return _core_.Image_GetMaskRed(*args, **kwargs)
d55e5bfc
RD
3089
3090 def GetMaskGreen(*args, **kwargs):
7a27cf7c
RD
3091 """
3092 GetMaskGreen(self) -> byte
3093
3094 Gets the green component of the mask colour.
3095 """
5b5c9bc7 3096 return _core_.Image_GetMaskGreen(*args, **kwargs)
d55e5bfc
RD
3097
3098 def GetMaskBlue(*args, **kwargs):
7a27cf7c
RD
3099 """
3100 GetMaskBlue(self) -> byte
3101
3102 Gets the blue component of the mask colour.
3103 """
5b5c9bc7 3104 return _core_.Image_GetMaskBlue(*args, **kwargs)
d55e5bfc
RD
3105
3106 def SetMask(*args, **kwargs):
7a27cf7c
RD
3107 """
3108 SetMask(self, bool mask=True)
3109
3110 Specifies whether there is a mask or not. The area of the mask is
3111 determined by the current mask colour.
3112 """
5b5c9bc7 3113 return _core_.Image_SetMask(*args, **kwargs)
d55e5bfc
RD
3114
3115 def HasMask(*args, **kwargs):
7a27cf7c
RD
3116 """
3117 HasMask(self) -> bool
3118
3119 Returns ``True`` if there is a mask active, ``False`` otherwise.
3120 """
5b5c9bc7 3121 return _core_.Image_HasMask(*args, **kwargs)
d55e5bfc
RD
3122
3123 def Rotate(*args, **kwargs):
3124 """
5b5c9bc7
RD
3125 Rotate(self, double angle, Point centre_of_rotation, bool interpolating=True,
3126 Point offset_after_rotation=None) -> Image
7a27cf7c
RD
3127
3128 Rotates the image about the given point, by ``angle`` radians. Passing
3129 ``True`` to ``interpolating`` results in better image quality, but is
3130 slower. If the image has a mask, then the mask colour is used for the
3131 uncovered pixels in the rotated image background. Otherwise, black
3132 will be used as the fill colour.
3133
3134 Returns the rotated image, leaving this image intact.
d55e5bfc 3135 """
5b5c9bc7 3136 return _core_.Image_Rotate(*args, **kwargs)
d55e5bfc
RD
3137
3138 def Rotate90(*args, **kwargs):
7a27cf7c
RD
3139 """
3140 Rotate90(self, bool clockwise=True) -> Image
3141
3142 Returns a copy of the image rotated 90 degrees in the direction
3143 indicated by ``clockwise``.
3144 """
5b5c9bc7 3145 return _core_.Image_Rotate90(*args, **kwargs)
d55e5bfc
RD
3146
3147 def Mirror(*args, **kwargs):
7a27cf7c
RD
3148 """
3149 Mirror(self, bool horizontally=True) -> Image
3150
3151 Returns a mirrored copy of the image. The parameter ``horizontally``
3152 indicates the orientation.
3153 """
5b5c9bc7 3154 return _core_.Image_Mirror(*args, **kwargs)
d55e5bfc
RD
3155
3156 def Replace(*args, **kwargs):
3157 """
7a27cf7c
RD
3158 Replace(self, byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
3159
3160 Replaces the colour specified by ``(r1,g1,b1)`` by the colour
3161 ``(r2,g2,b2)``.
d55e5bfc 3162 """
5b5c9bc7 3163 return _core_.Image_Replace(*args, **kwargs)
d55e5bfc 3164
32fe5131
RD
3165 def ConvertToGreyscale(*args, **kwargs):
3166 """
3167 ConvertToGreyscale(self, double lr=0.299, double lg=0.587, double lb=0.114) -> Image
3168
3169 Convert to greyscale image. Uses the luminance component (Y) of the
3170 image. The luma value (YUV) is calculated using (R * lr) + (G * lg) + (B * lb),
3171 defaults to ITU-T BT.601
3172 """
3173 return _core_.Image_ConvertToGreyscale(*args, **kwargs)
3174
d55e5bfc 3175 def ConvertToMono(*args, **kwargs):
7a27cf7c
RD
3176 """
3177 ConvertToMono(self, byte r, byte g, byte b) -> Image
3178
3179 Returns monochromatic version of the image. The returned image has
3180 white colour where the original has ``(r,g,b)`` colour and black
3181 colour everywhere else.
3182 """
5b5c9bc7 3183 return _core_.Image_ConvertToMono(*args, **kwargs)
d55e5bfc
RD
3184
3185 def SetOption(*args, **kwargs):
7a27cf7c
RD
3186 """
3187 SetOption(self, String name, String value)
3188
3189 Sets an image handler defined option. For example, when saving as a
3190 JPEG file, the option ``wx.IMAGE_OPTION_QUALITY`` is used, which is a
3191 number between 0 and 100 (0 is terrible, 100 is very good).
3192 """
5b5c9bc7 3193 return _core_.Image_SetOption(*args, **kwargs)
d55e5bfc
RD
3194
3195 def SetOptionInt(*args, **kwargs):
7a27cf7c
RD
3196 """
3197 SetOptionInt(self, String name, int value)
3198
3199 Sets an image option as an integer.
3200 """
5b5c9bc7 3201 return _core_.Image_SetOptionInt(*args, **kwargs)
d55e5bfc
RD
3202
3203 def GetOption(*args, **kwargs):
7a27cf7c
RD
3204 """
3205 GetOption(self, String name) -> String
3206
3207 Gets the value of an image handler option.
3208 """
5b5c9bc7 3209 return _core_.Image_GetOption(*args, **kwargs)
d55e5bfc
RD
3210
3211 def GetOptionInt(*args, **kwargs):
7a27cf7c
RD
3212 """
3213 GetOptionInt(self, String name) -> int
3214
3215 Gets the value of an image handler option as an integer. If the given
3216 option is not present, the function returns 0.
3217 """
5b5c9bc7 3218 return _core_.Image_GetOptionInt(*args, **kwargs)
d55e5bfc
RD
3219
3220 def HasOption(*args, **kwargs):
7a27cf7c
RD
3221 """
3222 HasOption(self, String name) -> bool
3223
3224 Returns true if the given option is present.
3225 """
5b5c9bc7 3226 return _core_.Image_HasOption(*args, **kwargs)
d55e5bfc
RD
3227
3228 def CountColours(*args, **kwargs):
3229 """CountColours(self, unsigned long stopafter=(unsigned long) -1) -> unsigned long"""
5b5c9bc7 3230 return _core_.Image_CountColours(*args, **kwargs)
d55e5bfc
RD
3231
3232 def ComputeHistogram(*args, **kwargs):
5b5c9bc7
RD
3233 """ComputeHistogram(self, ImageHistogram h) -> unsigned long"""
3234 return _core_.Image_ComputeHistogram(*args, **kwargs)
d55e5bfc
RD
3235
3236 def AddHandler(*args, **kwargs):
5b5c9bc7
RD
3237 """AddHandler(ImageHandler handler)"""
3238 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc
RD
3239
3240 AddHandler = staticmethod(AddHandler)
3241 def InsertHandler(*args, **kwargs):
5b5c9bc7
RD
3242 """InsertHandler(ImageHandler handler)"""
3243 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc
RD
3244
3245 InsertHandler = staticmethod(InsertHandler)
3246 def RemoveHandler(*args, **kwargs):
5b5c9bc7
RD
3247 """RemoveHandler(String name) -> bool"""
3248 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc
RD
3249
3250 RemoveHandler = staticmethod(RemoveHandler)
1bd55598
RD
3251 def GetHandlers(*args, **kwargs):
3252 """GetHandlers() -> PyObject"""
3253 return _core_.Image_GetHandlers(*args, **kwargs)
3254
3255 GetHandlers = staticmethod(GetHandlers)
d55e5bfc 3256 def GetImageExtWildcard(*args, **kwargs):
7a27cf7c
RD
3257 """
3258 GetImageExtWildcard() -> String
3259
3260 Iterates all registered wxImageHandler objects, and returns a string
3261 containing file extension masks suitable for passing to file open/save
3262 dialog boxes.
3263 """
5b5c9bc7 3264 return _core_.Image_GetImageExtWildcard(*args, **kwargs)
d55e5bfc
RD
3265
3266 GetImageExtWildcard = staticmethod(GetImageExtWildcard)
3267 def ConvertToBitmap(*args, **kwargs):
5b5c9bc7
RD
3268 """ConvertToBitmap(self, int depth=-1) -> Bitmap"""
3269 return _core_.Image_ConvertToBitmap(*args, **kwargs)
d55e5bfc
RD
3270
3271 def ConvertToMonoBitmap(*args, **kwargs):
7a27cf7c 3272 """ConvertToMonoBitmap(self, byte red, byte green, byte blue) -> Bitmap"""
5b5c9bc7 3273 return _core_.Image_ConvertToMonoBitmap(*args, **kwargs)
d55e5bfc 3274
943e8dfd
RD
3275 def RotateHue(*args, **kwargs):
3276 """
3277 RotateHue(self, double angle)
3278
3279 Rotates the hue of each pixel of the image. Hue is a double in the
3280 range -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees
3281 """
3282 return _core_.Image_RotateHue(*args, **kwargs)
3283
3284 def RGBtoHSV(*args, **kwargs):
3285 """
3286 RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3287
3288 Converts a color in RGB color space to HSV color space.
3289 """
3290 return _core_.Image_RGBtoHSV(*args, **kwargs)
3291
3292 RGBtoHSV = staticmethod(RGBtoHSV)
3293 def HSVtoRGB(*args, **kwargs):
3294 """
3295 HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3296
3297 Converts a color in HSV color space to RGB color space.
3298 """
3299 return _core_.Image_HSVtoRGB(*args, **kwargs)
3300
3301 HSVtoRGB = staticmethod(HSVtoRGB)
b39fe951 3302 def __nonzero__(self): return self.IsOk()
ac5d357a
RD
3303 AlphaBuffer = property(GetAlphaBuffer,SetAlphaBuffer,doc="See `GetAlphaBuffer` and `SetAlphaBuffer`")
3304 AlphaData = property(GetAlphaData,SetAlphaData,doc="See `GetAlphaData` and `SetAlphaData`")
3305 Data = property(GetData,SetData,doc="See `GetData` and `SetData`")
3306 DataBuffer = property(GetDataBuffer,SetDataBuffer,doc="See `GetDataBuffer` and `SetDataBuffer`")
3307 Height = property(GetHeight,doc="See `GetHeight`")
3308 MaskBlue = property(GetMaskBlue,doc="See `GetMaskBlue`")
3309 MaskGreen = property(GetMaskGreen,doc="See `GetMaskGreen`")
3310 MaskRed = property(GetMaskRed,doc="See `GetMaskRed`")
ac5d357a 3311 Width = property(GetWidth,doc="See `GetWidth`")
2131d850 3312_core_.Image_swigregister(Image)
d55e5bfc
RD
3313
3314def ImageFromMime(*args, **kwargs):
7a27cf7c
RD
3315 """
3316 ImageFromMime(String name, String mimetype, int index=-1) -> Image
3317
3318 Loads an image from a file, using a MIME type string (such as
3319 'image/jpeg') to specify image type.
3320 """
5b5c9bc7 3321 val = _core_.new_ImageFromMime(*args, **kwargs)
d55e5bfc
RD
3322 return val
3323
3324def ImageFromStream(*args, **kwargs):
7a27cf7c
RD
3325 """
3326 ImageFromStream(InputStream stream, long type=BITMAP_TYPE_ANY, int index=-1) -> Image
3327
3328 Loads an image from an input stream, or any readable Python file-like
3329 object.
3330 """
5b5c9bc7 3331 val = _core_.new_ImageFromStream(*args, **kwargs)
d55e5bfc
RD
3332 return val
3333
3334def ImageFromStreamMime(*args, **kwargs):
7a27cf7c
RD
3335 """
3336 ImageFromStreamMime(InputStream stream, String mimetype, int index=-1) -> Image
3337
3338 Loads an image from an input stream, or any readable Python file-like
3339 object, specifying the image format with a MIME type string.
3340 """
5b5c9bc7 3341 val = _core_.new_ImageFromStreamMime(*args, **kwargs)
d55e5bfc
RD
3342 return val
3343
d6c14a4c 3344def EmptyImage(*args, **kwargs):
bb2ef2cc 3345 """
5b5c9bc7 3346 EmptyImage(int width=0, int height=0, bool clear=True) -> Image
bb2ef2cc
RD
3347
3348 Construct an empty image of a given size, optionally setting all
3349 pixels to black.
3350 """
5b5c9bc7 3351 val = _core_.new_EmptyImage(*args, **kwargs)
d55e5bfc
RD
3352 return val
3353
3354def ImageFromBitmap(*args, **kwargs):
bb2ef2cc 3355 """
5b5c9bc7 3356 ImageFromBitmap(Bitmap bitmap) -> Image
bb2ef2cc
RD
3357
3358 Construct an Image from a `wx.Bitmap`.
3359 """
5b5c9bc7 3360 val = _core_.new_ImageFromBitmap(*args, **kwargs)
d55e5bfc
RD
3361 return val
3362
3363def ImageFromData(*args, **kwargs):
bb2ef2cc 3364 """
5b5c9bc7 3365 ImageFromData(int width, int height, buffer data) -> Image
bb2ef2cc
RD
3366
3367 Construct an Image from a buffer of RGB bytes. Accepts either a
3368 string or a buffer object holding the data and the length of the data
3369 must be width*height*3.
3370 """
5b5c9bc7 3371 val = _core_.new_ImageFromData(*args, **kwargs)
d55e5bfc
RD
3372 return val
3373
03e46024 3374def ImageFromDataWithAlpha(*args, **kwargs):
bb2ef2cc 3375 """
5b5c9bc7 3376 ImageFromDataWithAlpha(int width, int height, buffer data, buffer alpha) -> Image
bb2ef2cc
RD
3377
3378 Construct an Image from a buffer of RGB bytes with an Alpha channel.
3379 Accepts either a string or a buffer object holding the data and the
7a27cf7c
RD
3380 length of the data must be width*height*3 bytes, and the length of the
3381 alpha data must be width*height bytes.
bb2ef2cc 3382 """
5b5c9bc7 3383 val = _core_.new_ImageFromDataWithAlpha(*args, **kwargs)
03e46024
RD
3384 return val
3385
5b5c9bc7 3386def Image_CanRead(*args, **kwargs):
1bd55598 3387 """
7a27cf7c
RD
3388 Image_CanRead(String filename) -> bool
3389
3390 Returns True if the image handlers can read this file.
3391 """
1bd55598 3392 return _core_.Image_CanRead(*args, **kwargs)
d55e5bfc 3393
5b5c9bc7 3394def Image_GetImageCount(*args, **kwargs):
1bd55598 3395 """
7a27cf7c
RD
3396 Image_GetImageCount(String filename, long type=BITMAP_TYPE_ANY) -> int
3397
3398 If the image file contains more than one image and the image handler
3399 is capable of retrieving these individually, this function will return
3400 the number of available images.
3401 """
1bd55598 3402 return _core_.Image_GetImageCount(*args, **kwargs)
d55e5bfc 3403
5b5c9bc7 3404def Image_CanReadStream(*args, **kwargs):
1bd55598 3405 """
7a27cf7c
RD
3406 Image_CanReadStream(InputStream stream) -> bool
3407
3408 Returns True if the image handlers can read an image file from the
3409 data currently on the input stream, or a readable Python file-like
3410 object.
3411 """
1bd55598 3412 return _core_.Image_CanReadStream(*args, **kwargs)
d55e5bfc 3413
5b5c9bc7 3414def Image_AddHandler(*args, **kwargs):
1bd55598
RD
3415 """Image_AddHandler(ImageHandler handler)"""
3416 return _core_.Image_AddHandler(*args, **kwargs)
d55e5bfc 3417
5b5c9bc7 3418def Image_InsertHandler(*args, **kwargs):
1bd55598
RD
3419 """Image_InsertHandler(ImageHandler handler)"""
3420 return _core_.Image_InsertHandler(*args, **kwargs)
d55e5bfc 3421
5b5c9bc7 3422def Image_RemoveHandler(*args, **kwargs):
1bd55598
RD
3423 """Image_RemoveHandler(String name) -> bool"""
3424 return _core_.Image_RemoveHandler(*args, **kwargs)
d55e5bfc 3425
1bd55598
RD
3426def Image_GetHandlers(*args):
3427 """Image_GetHandlers() -> PyObject"""
3428 return _core_.Image_GetHandlers(*args)
3429
3430def Image_GetImageExtWildcard(*args):
3431 """
7a27cf7c
RD
3432 Image_GetImageExtWildcard() -> String
3433
3434 Iterates all registered wxImageHandler objects, and returns a string
3435 containing file extension masks suitable for passing to file open/save
3436 dialog boxes.
3437 """
1bd55598 3438 return _core_.Image_GetImageExtWildcard(*args)
d55e5bfc 3439
943e8dfd 3440def Image_RGBtoHSV(*args, **kwargs):
1bd55598 3441 """
943e8dfd
RD
3442 Image_RGBtoHSV(Image_RGBValue rgb) -> Image_HSVValue
3443
3444 Converts a color in RGB color space to HSV color space.
3445 """
1bd55598 3446 return _core_.Image_RGBtoHSV(*args, **kwargs)
943e8dfd
RD
3447
3448def Image_HSVtoRGB(*args, **kwargs):
1bd55598 3449 """
943e8dfd
RD
3450 Image_HSVtoRGB(Image_HSVValue hsv) -> Image_RGBValue
3451
3452 Converts a color in HSV color space to RGB color space.
3453 """
1bd55598 3454 return _core_.Image_HSVtoRGB(*args, **kwargs)
943e8dfd 3455
fc46b7f3
RD
3456
3457def _ImageFromBuffer(*args, **kwargs):
3458 """_ImageFromBuffer(int width, int height, buffer data, buffer alpha=None) -> Image"""
3459 return _core_._ImageFromBuffer(*args, **kwargs)
3460def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
3461 """
3462 Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
eec1c382
RD
3463 parameter must be a Python object that implements the buffer interface,
3464 such as a string, array, etc. The dataBuffer object is expected to
3465 contain a series of RGB bytes and be width*height*3 bytes long. A buffer
3466 object can optionally be supplied for the image's alpha channel data, and
3467 it is expected to be width*height bytes long.
fc46b7f3
RD
3468
3469 The wx.Image will be created with its data and alpha pointers initialized
3470 to the memory address pointed to by the buffer objects, thus saving the
3471 time needed to copy the image data from the buffer object to the wx.Image.
3472 While this has advantages, it also has the shoot-yourself-in-the-foot
3473 risks associated with sharing a C pointer between two objects.
3474
3475 To help alleviate the risk a reference to the data and alpha buffer
3476 objects are kept with the wx.Image, so that they won't get deleted until
3477 after the wx.Image is deleted. However please be aware that it is not
3478 guaranteed that an object won't move its memory buffer to a new location
3479 when it needs to resize its contents. If that happens then the wx.Image
3480 will end up referring to an invalid memory location and could cause the
3481 application to crash. Therefore care should be taken to not manipulate
3482 the objects used for the data and alpha buffers in a way that would cause
3483 them to change size.
3484 """
fc46b7f3
RD
3485 image = _core_._ImageFromBuffer(width, height, dataBuffer, alphaBuffer)
3486 image._buffer = dataBuffer
3487 image._alpha = alphaBuffer
3488 return image
3489
68e533f8
RD
3490def InitAllImageHandlers():
3491 """
3492 The former functionality of InitAllImageHanders is now done internal to
3493 the _core_ extension module and so this function has become a simple NOP.
3494 """
3495 pass
d55e5bfc 3496
5b5c9bc7
RD
3497IMAGE_RESOLUTION_INCHES = _core_.IMAGE_RESOLUTION_INCHES
3498IMAGE_RESOLUTION_CM = _core_.IMAGE_RESOLUTION_CM
3499PNG_TYPE_COLOUR = _core_.PNG_TYPE_COLOUR
3500PNG_TYPE_GREY = _core_.PNG_TYPE_GREY
3501PNG_TYPE_GREY_RED = _core_.PNG_TYPE_GREY_RED
3502BMP_24BPP = _core_.BMP_24BPP
3503BMP_8BPP = _core_.BMP_8BPP
3504BMP_8BPP_GREY = _core_.BMP_8BPP_GREY
3505BMP_8BPP_GRAY = _core_.BMP_8BPP_GRAY
3506BMP_8BPP_RED = _core_.BMP_8BPP_RED
3507BMP_8BPP_PALETTE = _core_.BMP_8BPP_PALETTE
3508BMP_4BPP = _core_.BMP_4BPP
3509BMP_1BPP = _core_.BMP_1BPP
3510BMP_1BPP_BW = _core_.BMP_1BPP_BW
3511class BMPHandler(ImageHandler):
27fb7603 3512 """A `wx.ImageHandler` for \*.bmp bitmap files."""
1bd55598
RD
3513 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3514 __repr__ = _swig_repr
3515 def __init__(self, *args, **kwargs):
27fb7603
RD
3516 """
3517 __init__(self) -> BMPHandler
3518
3519 A `wx.ImageHandler` for \*.bmp bitmap files.
3520 """
1bd55598 3521 _core_.BMPHandler_swiginit(self,_core_.new_BMPHandler(*args, **kwargs))
2131d850 3522_core_.BMPHandler_swigregister(BMPHandler)
5b5c9bc7 3523NullImage = cvar.NullImage
68350608 3524IMAGE_OPTION_FILENAME = cvar.IMAGE_OPTION_FILENAME
d55e5bfc
RD
3525IMAGE_OPTION_BMP_FORMAT = cvar.IMAGE_OPTION_BMP_FORMAT
3526IMAGE_OPTION_CUR_HOTSPOT_X = cvar.IMAGE_OPTION_CUR_HOTSPOT_X
3527IMAGE_OPTION_CUR_HOTSPOT_Y = cvar.IMAGE_OPTION_CUR_HOTSPOT_Y
3528IMAGE_OPTION_RESOLUTION = cvar.IMAGE_OPTION_RESOLUTION
68350608
RD
3529IMAGE_OPTION_RESOLUTIONX = cvar.IMAGE_OPTION_RESOLUTIONX
3530IMAGE_OPTION_RESOLUTIONY = cvar.IMAGE_OPTION_RESOLUTIONY
d55e5bfc 3531IMAGE_OPTION_RESOLUTIONUNIT = cvar.IMAGE_OPTION_RESOLUTIONUNIT
24d7cbea 3532IMAGE_OPTION_QUALITY = cvar.IMAGE_OPTION_QUALITY
68350608
RD
3533IMAGE_OPTION_BITSPERSAMPLE = cvar.IMAGE_OPTION_BITSPERSAMPLE
3534IMAGE_OPTION_SAMPLESPERPIXEL = cvar.IMAGE_OPTION_SAMPLESPERPIXEL
3535IMAGE_OPTION_COMPRESSION = cvar.IMAGE_OPTION_COMPRESSION
3536IMAGE_OPTION_IMAGEDESCRIPTOR = cvar.IMAGE_OPTION_IMAGEDESCRIPTOR
7fbf8399
RD
3537IMAGE_OPTION_PNG_FORMAT = cvar.IMAGE_OPTION_PNG_FORMAT
3538IMAGE_OPTION_PNG_BITDEPTH = cvar.IMAGE_OPTION_PNG_BITDEPTH
d55e5bfc 3539
5b5c9bc7 3540class ICOHandler(BMPHandler):
27fb7603 3541 """A `wx.ImageHandler` for \*.ico icon files."""
1bd55598
RD
3542 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3543 __repr__ = _swig_repr
3544 def __init__(self, *args, **kwargs):
27fb7603
RD
3545 """
3546 __init__(self) -> ICOHandler
3547
3548 A `wx.ImageHandler` for \*.ico icon files.
3549 """
1bd55598 3550 _core_.ICOHandler_swiginit(self,_core_.new_ICOHandler(*args, **kwargs))
2131d850 3551_core_.ICOHandler_swigregister(ICOHandler)
d55e5bfc 3552
5b5c9bc7 3553class CURHandler(ICOHandler):
27fb7603 3554 """A `wx.ImageHandler` for \*.cur cursor files."""
1bd55598
RD
3555 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3556 __repr__ = _swig_repr
3557 def __init__(self, *args, **kwargs):
27fb7603
RD
3558 """
3559 __init__(self) -> CURHandler
3560
3561 A `wx.ImageHandler` for \*.cur cursor files.
3562 """
1bd55598 3563 _core_.CURHandler_swiginit(self,_core_.new_CURHandler(*args, **kwargs))
2131d850 3564_core_.CURHandler_swigregister(CURHandler)
d55e5bfc 3565
5b5c9bc7 3566class ANIHandler(CURHandler):
27fb7603 3567 """A `wx.ImageHandler` for \*.ani animated cursor files."""
1bd55598
RD
3568 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3569 __repr__ = _swig_repr
3570 def __init__(self, *args, **kwargs):
27fb7603
RD
3571 """
3572 __init__(self) -> ANIHandler
3573
3574 A `wx.ImageHandler` for \*.ani animated cursor files.
3575 """
1bd55598 3576 _core_.ANIHandler_swiginit(self,_core_.new_ANIHandler(*args, **kwargs))
2131d850 3577_core_.ANIHandler_swigregister(ANIHandler)
d55e5bfc 3578
5b5c9bc7 3579class PNGHandler(ImageHandler):
27fb7603 3580 """A `wx.ImageHandler` for PNG image files."""
1bd55598
RD
3581 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3582 __repr__ = _swig_repr
3583 def __init__(self, *args, **kwargs):
27fb7603
RD
3584 """
3585 __init__(self) -> PNGHandler
3586
3587 A `wx.ImageHandler` for PNG image files.
3588 """
1bd55598 3589 _core_.PNGHandler_swiginit(self,_core_.new_PNGHandler(*args, **kwargs))
2131d850 3590_core_.PNGHandler_swigregister(PNGHandler)
d55e5bfc 3591
5b5c9bc7 3592class GIFHandler(ImageHandler):
27fb7603 3593 """A `wx.ImageHandler` for GIF image files."""
1bd55598
RD
3594 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3595 __repr__ = _swig_repr
3596 def __init__(self, *args, **kwargs):
27fb7603
RD
3597 """
3598 __init__(self) -> GIFHandler
3599
3600 A `wx.ImageHandler` for GIF image files.
3601 """
1bd55598 3602 _core_.GIFHandler_swiginit(self,_core_.new_GIFHandler(*args, **kwargs))
2131d850 3603_core_.GIFHandler_swigregister(GIFHandler)
d55e5bfc 3604
5b5c9bc7 3605class PCXHandler(ImageHandler):
27fb7603 3606 """A `wx.ImageHandler` for PCX imager files."""
1bd55598
RD
3607 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3608 __repr__ = _swig_repr
3609 def __init__(self, *args, **kwargs):
27fb7603
RD
3610 """
3611 __init__(self) -> PCXHandler
3612
3613 A `wx.ImageHandler` for PCX imager files.
3614 """
1bd55598 3615 _core_.PCXHandler_swiginit(self,_core_.new_PCXHandler(*args, **kwargs))
2131d850 3616_core_.PCXHandler_swigregister(PCXHandler)
d55e5bfc 3617
5b5c9bc7 3618class JPEGHandler(ImageHandler):
27fb7603 3619 """A `wx.ImageHandler` for JPEG/JPG image files."""
1bd55598
RD
3620 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3621 __repr__ = _swig_repr
3622 def __init__(self, *args, **kwargs):
27fb7603
RD
3623 """
3624 __init__(self) -> JPEGHandler
3625
3626 A `wx.ImageHandler` for JPEG/JPG image files.
3627 """
1bd55598 3628 _core_.JPEGHandler_swiginit(self,_core_.new_JPEGHandler(*args, **kwargs))
2131d850 3629_core_.JPEGHandler_swigregister(JPEGHandler)
d55e5bfc 3630
5b5c9bc7 3631class PNMHandler(ImageHandler):
27fb7603 3632 """A `wx.ImageHandler` for PNM image files."""
1bd55598
RD
3633 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3634 __repr__ = _swig_repr
3635 def __init__(self, *args, **kwargs):
27fb7603
RD
3636 """
3637 __init__(self) -> PNMHandler
3638
3639 A `wx.ImageHandler` for PNM image files.
3640 """
1bd55598 3641 _core_.PNMHandler_swiginit(self,_core_.new_PNMHandler(*args, **kwargs))
2131d850 3642_core_.PNMHandler_swigregister(PNMHandler)
d55e5bfc 3643
5b5c9bc7 3644class XPMHandler(ImageHandler):
27fb7603 3645 """A `wx.ImageHandler` for XPM image."""
1bd55598
RD
3646 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3647 __repr__ = _swig_repr
3648 def __init__(self, *args, **kwargs):
27fb7603
RD
3649 """
3650 __init__(self) -> XPMHandler
3651
3652 A `wx.ImageHandler` for XPM image.
3653 """
1bd55598 3654 _core_.XPMHandler_swiginit(self,_core_.new_XPMHandler(*args, **kwargs))
2131d850 3655_core_.XPMHandler_swigregister(XPMHandler)
d55e5bfc 3656
5b5c9bc7 3657class TIFFHandler(ImageHandler):
27fb7603 3658 """A `wx.ImageHandler` for TIFF image files."""
1bd55598
RD
3659 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3660 __repr__ = _swig_repr
3661 def __init__(self, *args, **kwargs):
27fb7603
RD
3662 """
3663 __init__(self) -> TIFFHandler
3664
3665 A `wx.ImageHandler` for TIFF image files.
3666 """
1bd55598 3667 _core_.TIFFHandler_swiginit(self,_core_.new_TIFFHandler(*args, **kwargs))
2131d850 3668_core_.TIFFHandler_swigregister(TIFFHandler)
d55e5bfc 3669
580080c5
RD
3670class TGAHandler(ImageHandler):
3671 """A `wx.ImageHandler` for TGA image files."""
3672 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3673 __repr__ = _swig_repr
3674 def __init__(self, *args, **kwargs):
3675 """
3676 __init__(self) -> TGAHandler
3677
3678 A `wx.ImageHandler` for TGA image files.
3679 """
3680 _core_.TGAHandler_swiginit(self,_core_.new_TGAHandler(*args, **kwargs))
3681_core_.TGAHandler_swigregister(TGAHandler)
3682
5b5c9bc7
RD
3683QUANTIZE_INCLUDE_WINDOWS_COLOURS = _core_.QUANTIZE_INCLUDE_WINDOWS_COLOURS
3684QUANTIZE_FILL_DESTINATION_IMAGE = _core_.QUANTIZE_FILL_DESTINATION_IMAGE
3685class Quantize(object):
c0de73ae 3686 """Performs quantization, or colour reduction, on a wxImage."""
1bd55598
RD
3687 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3688 def __init__(self): raise AttributeError, "No constructor defined"
3689 __repr__ = _swig_repr
c0de73ae
RD
3690 def Quantize(*args, **kwargs):
3691 """
5b5c9bc7 3692 Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3693
3694 Reduce the colours in the source image and put the result into the
3695 destination image, setting the palette in the destination if
3696 needed. Both images may be the same, to overwrite the source image.
3697 """
5b5c9bc7 3698 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae
RD
3699
3700 Quantize = staticmethod(Quantize)
2131d850 3701_core_.Quantize_swigregister(Quantize)
c0de73ae 3702
5b5c9bc7 3703def Quantize_Quantize(*args, **kwargs):
1bd55598 3704 """
5b5c9bc7 3705 Quantize_Quantize(Image src, Image dest, int desiredNoColours=236, int flags=wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE) -> bool
c0de73ae
RD
3706
3707 Reduce the colours in the source image and put the result into the
3708 destination image, setting the palette in the destination if
3709 needed. Both images may be the same, to overwrite the source image.
3710 """
1bd55598 3711 return _core_.Quantize_Quantize(*args, **kwargs)
c0de73ae 3712
d55e5bfc
RD
3713#---------------------------------------------------------------------------
3714
5b5c9bc7
RD
3715class EvtHandler(Object):
3716 """Proxy of C++ EvtHandler class"""
1bd55598
RD
3717 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
3718 __repr__ = _swig_repr
3719 def __init__(self, *args, **kwargs):
5b5c9bc7 3720 """__init__(self) -> EvtHandler"""
1bd55598 3721 _core_.EvtHandler_swiginit(self,_core_.new_EvtHandler(*args, **kwargs))
d49bdf34
RD
3722 self._setOORInfo(self)
3723
d55e5bfc 3724 def GetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3725 """GetNextHandler(self) -> EvtHandler"""
3726 return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
d55e5bfc
RD
3727
3728 def GetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3729 """GetPreviousHandler(self) -> EvtHandler"""
3730 return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3731
3732 def SetNextHandler(*args, **kwargs):
5b5c9bc7
RD
3733 """SetNextHandler(self, EvtHandler handler)"""
3734 return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
d55e5bfc
RD
3735
3736 def SetPreviousHandler(*args, **kwargs):
5b5c9bc7
RD
3737 """SetPreviousHandler(self, EvtHandler handler)"""
3738 return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
d55e5bfc
RD
3739
3740 def GetEvtHandlerEnabled(*args, **kwargs):
3741 """GetEvtHandlerEnabled(self) -> bool"""
5b5c9bc7 3742 return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3743
3744 def SetEvtHandlerEnabled(*args, **kwargs):
3745 """SetEvtHandlerEnabled(self, bool enabled)"""
5b5c9bc7 3746 return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
d55e5bfc
RD
3747
3748 def ProcessEvent(*args, **kwargs):
5b5c9bc7
RD
3749 """ProcessEvent(self, Event event) -> bool"""
3750 return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
d55e5bfc
RD
3751
3752 def AddPendingEvent(*args, **kwargs):
5b5c9bc7
RD
3753 """AddPendingEvent(self, Event event)"""
3754 return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
d55e5bfc
RD
3755
3756 def ProcessPendingEvents(*args, **kwargs):
3757 """ProcessPendingEvents(self)"""
5b5c9bc7 3758 return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
3759
3760 def Connect(*args, **kwargs):
3761 """Connect(self, int id, int lastId, int eventType, PyObject func)"""
5b5c9bc7 3762 return _core_.EvtHandler_Connect(*args, **kwargs)
d55e5bfc
RD
3763
3764 def Disconnect(*args, **kwargs):
2131d850 3765 """Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL) -> bool"""
5b5c9bc7 3766 return _core_.EvtHandler_Disconnect(*args, **kwargs)
d55e5bfc
RD
3767
3768 def _setOORInfo(*args, **kwargs):
36ed4f51 3769 """_setOORInfo(self, PyObject _self, bool incref=True)"""
7e08d4ef 3770 val = _core_.EvtHandler__setOORInfo(*args, **kwargs)
15665b47 3771 args[0].this.own(False)
7e08d4ef 3772 return val
d55e5bfc
RD
3773
3774 def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3775 """
3776 Bind an event to an event handler.
3777
a5ee0656
RD
3778 :param event: One of the EVT_* objects that specifies the
3779 type of event to bind,
d55e5bfc 3780
a5ee0656
RD
3781 :param handler: A callable object to be invoked when the
3782 event is delivered to self. Pass None to
3783 disconnect an event handler.
d55e5bfc 3784
a5ee0656
RD
3785 :param source: Sometimes the event originates from a
3786 different window than self, but you still
3787 want to catch it in self. (For example, a
3788 button event delivered to a frame.) By
3789 passing the source of the event, the event
3790 handling system is able to differentiate
3791 between the same event type from different
3792 controls.
d55e5bfc 3793
a5ee0656
RD
3794 :param id: Used to spcify the event source by ID instead
3795 of instance.
3796
3797 :param id2: Used when it is desirable to bind a handler
3798 to a range of IDs, such as with EVT_MENU_RANGE.
d55e5bfc
RD
3799 """
3800 if source is not None:
3801 id = source.GetId()
3802 event.Bind(self, id, id2, handler)
3803
d6c14a4c
RD
3804 def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY):
3805 """
3806 Disconencts the event handler binding for event from self.
3807 Returns True if successful.
3808 """
3809 if source is not None:
3810 id = source.GetId()
3811 return event.Unbind(self, id, id2)
d55e5bfc 3812
ac5d357a
RD
3813 EvtHandlerEnabled = property(GetEvtHandlerEnabled,SetEvtHandlerEnabled,doc="See `GetEvtHandlerEnabled` and `SetEvtHandlerEnabled`")
3814 NextHandler = property(GetNextHandler,SetNextHandler,doc="See `GetNextHandler` and `SetNextHandler`")
3815 PreviousHandler = property(GetPreviousHandler,SetPreviousHandler,doc="See `GetPreviousHandler` and `SetPreviousHandler`")
2131d850 3816_core_.EvtHandler_swigregister(EvtHandler)
d55e5bfc
RD
3817
3818#---------------------------------------------------------------------------
3819
3820class PyEventBinder(object):
3821 """
3822 Instances of this class are used to bind specific events to event
3823 handlers.
3824 """
3825 def __init__(self, evtType, expectedIDs=0):
3826 if expectedIDs not in [0, 1, 2]:
3827 raise ValueError, "Invalid number of expectedIDs"
3828 self.expectedIDs = expectedIDs
3829
3830 if type(evtType) == list or type(evtType) == tuple:
3831 self.evtType = evtType
3832 else:
3833 self.evtType = [evtType]
3834
3835
3836 def Bind(self, target, id1, id2, function):
3837 """Bind this set of event types to target."""
3838 for et in self.evtType:
3839 target.Connect(id1, id2, et, function)
3840
d6c14a4c
RD
3841
3842 def Unbind(self, target, id1, id2):
3843 """Remove an event binding."""
3844 success = 0
3845 for et in self.evtType:
3846 success += target.Disconnect(id1, id2, et)
3847 return success != 0
3848
b08d67c2
RD
3849 def _getEvtType(self):
3850 """
3851 Make it easy to get to the default wxEventType typeID for this
3852 event binder.
3853 """
3854 return self.evtType[0]
3855
3856 typeId = property(_getEvtType)
3857
d55e5bfc
RD
3858
3859 def __call__(self, *args):
3860 """
3861 For backwards compatibility with the old EVT_* functions.
3862 Should be called with either (window, func), (window, ID,
3863 func) or (window, ID1, ID2, func) parameters depending on the
3864 type of the event.
3865 """
3866 assert len(args) == 2 + self.expectedIDs
3867 id1 = wx.ID_ANY
3868 id2 = wx.ID_ANY
3869 target = args[0]
3870 if self.expectedIDs == 0:
3871 func = args[1]
3872 elif self.expectedIDs == 1:
3873 id1 = args[1]
3874 func = args[2]
3875 elif self.expectedIDs == 2:
3876 id1 = args[1]
3877 id2 = args[2]
3878 func = args[3]
3879 else:
3880 raise ValueError, "Unexpected number of IDs"
3881
3882 self.Bind(target, id1, id2, func)
3883
3884
3885# These two are square pegs that don't fit the PyEventBinder hole...
3886def EVT_COMMAND(win, id, cmd, func):
3887 win.Connect(id, -1, cmd, func)
3888def EVT_COMMAND_RANGE(win, id1, id2, cmd, func):
3889 win.Connect(id1, id2, cmd, func)
3890
3891
3892#---------------------------------------------------------------------------
3893
3894#---------------------------------------------------------------------------
3895
5b5c9bc7
RD
3896EVENT_PROPAGATE_NONE = _core_.EVENT_PROPAGATE_NONE
3897EVENT_PROPAGATE_MAX = _core_.EVENT_PROPAGATE_MAX
3898
1bd55598 3899def NewEventType(*args):
2131d850 3900 """NewEventType() -> EventType"""
1bd55598 3901 return _core_.NewEventType(*args)
4976f996 3902wxEVT_ANY = _core_.wxEVT_ANY
5b5c9bc7
RD
3903wxEVT_NULL = _core_.wxEVT_NULL
3904wxEVT_FIRST = _core_.wxEVT_FIRST
3905wxEVT_USER_FIRST = _core_.wxEVT_USER_FIRST
3906wxEVT_COMMAND_BUTTON_CLICKED = _core_.wxEVT_COMMAND_BUTTON_CLICKED
3907wxEVT_COMMAND_CHECKBOX_CLICKED = _core_.wxEVT_COMMAND_CHECKBOX_CLICKED
3908wxEVT_COMMAND_CHOICE_SELECTED = _core_.wxEVT_COMMAND_CHOICE_SELECTED
3909wxEVT_COMMAND_LISTBOX_SELECTED = _core_.wxEVT_COMMAND_LISTBOX_SELECTED
3910wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = _core_.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
3911wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = _core_.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
3912wxEVT_COMMAND_MENU_SELECTED = _core_.wxEVT_COMMAND_MENU_SELECTED
3913wxEVT_COMMAND_TOOL_CLICKED = _core_.wxEVT_COMMAND_TOOL_CLICKED
3914wxEVT_COMMAND_SLIDER_UPDATED = _core_.wxEVT_COMMAND_SLIDER_UPDATED
3915wxEVT_COMMAND_RADIOBOX_SELECTED = _core_.wxEVT_COMMAND_RADIOBOX_SELECTED
3916wxEVT_COMMAND_RADIOBUTTON_SELECTED = _core_.wxEVT_COMMAND_RADIOBUTTON_SELECTED
3917wxEVT_COMMAND_SCROLLBAR_UPDATED = _core_.wxEVT_COMMAND_SCROLLBAR_UPDATED
3918wxEVT_COMMAND_VLBOX_SELECTED = _core_.wxEVT_COMMAND_VLBOX_SELECTED
3919wxEVT_COMMAND_COMBOBOX_SELECTED = _core_.wxEVT_COMMAND_COMBOBOX_SELECTED
3920wxEVT_COMMAND_TOOL_RCLICKED = _core_.wxEVT_COMMAND_TOOL_RCLICKED
3921wxEVT_COMMAND_TOOL_ENTER = _core_.wxEVT_COMMAND_TOOL_ENTER
3922wxEVT_LEFT_DOWN = _core_.wxEVT_LEFT_DOWN
3923wxEVT_LEFT_UP = _core_.wxEVT_LEFT_UP
3924wxEVT_MIDDLE_DOWN = _core_.wxEVT_MIDDLE_DOWN
3925wxEVT_MIDDLE_UP = _core_.wxEVT_MIDDLE_UP
3926wxEVT_RIGHT_DOWN = _core_.wxEVT_RIGHT_DOWN
3927wxEVT_RIGHT_UP = _core_.wxEVT_RIGHT_UP
3928wxEVT_MOTION = _core_.wxEVT_MOTION
3929wxEVT_ENTER_WINDOW = _core_.wxEVT_ENTER_WINDOW
3930wxEVT_LEAVE_WINDOW = _core_.wxEVT_LEAVE_WINDOW
3931wxEVT_LEFT_DCLICK = _core_.wxEVT_LEFT_DCLICK
3932wxEVT_MIDDLE_DCLICK = _core_.wxEVT_MIDDLE_DCLICK
3933wxEVT_RIGHT_DCLICK = _core_.wxEVT_RIGHT_DCLICK
3934wxEVT_SET_FOCUS = _core_.wxEVT_SET_FOCUS
3935wxEVT_KILL_FOCUS = _core_.wxEVT_KILL_FOCUS
3936wxEVT_CHILD_FOCUS = _core_.wxEVT_CHILD_FOCUS
3937wxEVT_MOUSEWHEEL = _core_.wxEVT_MOUSEWHEEL
3938wxEVT_NC_LEFT_DOWN = _core_.wxEVT_NC_LEFT_DOWN
3939wxEVT_NC_LEFT_UP = _core_.wxEVT_NC_LEFT_UP
3940wxEVT_NC_MIDDLE_DOWN = _core_.wxEVT_NC_MIDDLE_DOWN
3941wxEVT_NC_MIDDLE_UP = _core_.wxEVT_NC_MIDDLE_UP
3942wxEVT_NC_RIGHT_DOWN = _core_.wxEVT_NC_RIGHT_DOWN
3943wxEVT_NC_RIGHT_UP = _core_.wxEVT_NC_RIGHT_UP
3944wxEVT_NC_MOTION = _core_.wxEVT_NC_MOTION
3945wxEVT_NC_ENTER_WINDOW = _core_.wxEVT_NC_ENTER_WINDOW
3946wxEVT_NC_LEAVE_WINDOW = _core_.wxEVT_NC_LEAVE_WINDOW
3947wxEVT_NC_LEFT_DCLICK = _core_.wxEVT_NC_LEFT_DCLICK
3948wxEVT_NC_MIDDLE_DCLICK = _core_.wxEVT_NC_MIDDLE_DCLICK
3949wxEVT_NC_RIGHT_DCLICK = _core_.wxEVT_NC_RIGHT_DCLICK
3950wxEVT_CHAR = _core_.wxEVT_CHAR
3951wxEVT_CHAR_HOOK = _core_.wxEVT_CHAR_HOOK
3952wxEVT_NAVIGATION_KEY = _core_.wxEVT_NAVIGATION_KEY
3953wxEVT_KEY_DOWN = _core_.wxEVT_KEY_DOWN
3954wxEVT_KEY_UP = _core_.wxEVT_KEY_UP
3955wxEVT_HOTKEY = _core_.wxEVT_HOTKEY
3956wxEVT_SET_CURSOR = _core_.wxEVT_SET_CURSOR
3957wxEVT_SCROLL_TOP = _core_.wxEVT_SCROLL_TOP
3958wxEVT_SCROLL_BOTTOM = _core_.wxEVT_SCROLL_BOTTOM
3959wxEVT_SCROLL_LINEUP = _core_.wxEVT_SCROLL_LINEUP
3960wxEVT_SCROLL_LINEDOWN = _core_.wxEVT_SCROLL_LINEDOWN
3961wxEVT_SCROLL_PAGEUP = _core_.wxEVT_SCROLL_PAGEUP
3962wxEVT_SCROLL_PAGEDOWN = _core_.wxEVT_SCROLL_PAGEDOWN
3963wxEVT_SCROLL_THUMBTRACK = _core_.wxEVT_SCROLL_THUMBTRACK
3964wxEVT_SCROLL_THUMBRELEASE = _core_.wxEVT_SCROLL_THUMBRELEASE
4f433fef
RD
3965wxEVT_SCROLL_CHANGED = _core_.wxEVT_SCROLL_CHANGED
3966wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED
5b5c9bc7
RD
3967wxEVT_SCROLLWIN_TOP = _core_.wxEVT_SCROLLWIN_TOP
3968wxEVT_SCROLLWIN_BOTTOM = _core_.wxEVT_SCROLLWIN_BOTTOM
3969wxEVT_SCROLLWIN_LINEUP = _core_.wxEVT_SCROLLWIN_LINEUP
3970wxEVT_SCROLLWIN_LINEDOWN = _core_.wxEVT_SCROLLWIN_LINEDOWN
3971wxEVT_SCROLLWIN_PAGEUP = _core_.wxEVT_SCROLLWIN_PAGEUP
3972wxEVT_SCROLLWIN_PAGEDOWN = _core_.wxEVT_SCROLLWIN_PAGEDOWN
3973wxEVT_SCROLLWIN_THUMBTRACK = _core_.wxEVT_SCROLLWIN_THUMBTRACK
3974wxEVT_SCROLLWIN_THUMBRELEASE = _core_.wxEVT_SCROLLWIN_THUMBRELEASE
3975wxEVT_SIZE = _core_.wxEVT_SIZE
3976wxEVT_MOVE = _core_.wxEVT_MOVE
3977wxEVT_CLOSE_WINDOW = _core_.wxEVT_CLOSE_WINDOW
3978wxEVT_END_SESSION = _core_.wxEVT_END_SESSION
3979wxEVT_QUERY_END_SESSION = _core_.wxEVT_QUERY_END_SESSION
3980wxEVT_ACTIVATE_APP = _core_.wxEVT_ACTIVATE_APP
5b5c9bc7
RD
3981wxEVT_ACTIVATE = _core_.wxEVT_ACTIVATE
3982wxEVT_CREATE = _core_.wxEVT_CREATE
3983wxEVT_DESTROY = _core_.wxEVT_DESTROY
3984wxEVT_SHOW = _core_.wxEVT_SHOW
3985wxEVT_ICONIZE = _core_.wxEVT_ICONIZE
3986wxEVT_MAXIMIZE = _core_.wxEVT_MAXIMIZE
3987wxEVT_MOUSE_CAPTURE_CHANGED = _core_.wxEVT_MOUSE_CAPTURE_CHANGED
34e0a3bb 3988wxEVT_MOUSE_CAPTURE_LOST = _core_.wxEVT_MOUSE_CAPTURE_LOST
5b5c9bc7
RD
3989wxEVT_PAINT = _core_.wxEVT_PAINT
3990wxEVT_ERASE_BACKGROUND = _core_.wxEVT_ERASE_BACKGROUND
3991wxEVT_NC_PAINT = _core_.wxEVT_NC_PAINT
3992wxEVT_PAINT_ICON = _core_.wxEVT_PAINT_ICON
3993wxEVT_MENU_OPEN = _core_.wxEVT_MENU_OPEN
3994wxEVT_MENU_CLOSE = _core_.wxEVT_MENU_CLOSE
3995wxEVT_MENU_HIGHLIGHT = _core_.wxEVT_MENU_HIGHLIGHT
3996wxEVT_CONTEXT_MENU = _core_.wxEVT_CONTEXT_MENU
3997wxEVT_SYS_COLOUR_CHANGED = _core_.wxEVT_SYS_COLOUR_CHANGED
3998wxEVT_DISPLAY_CHANGED = _core_.wxEVT_DISPLAY_CHANGED
3999wxEVT_SETTING_CHANGED = _core_.wxEVT_SETTING_CHANGED
4000wxEVT_QUERY_NEW_PALETTE = _core_.wxEVT_QUERY_NEW_PALETTE
4001wxEVT_PALETTE_CHANGED = _core_.wxEVT_PALETTE_CHANGED
4002wxEVT_DROP_FILES = _core_.wxEVT_DROP_FILES
4003wxEVT_DRAW_ITEM = _core_.wxEVT_DRAW_ITEM
4004wxEVT_MEASURE_ITEM = _core_.wxEVT_MEASURE_ITEM
4005wxEVT_COMPARE_ITEM = _core_.wxEVT_COMPARE_ITEM
4006wxEVT_INIT_DIALOG = _core_.wxEVT_INIT_DIALOG
4007wxEVT_IDLE = _core_.wxEVT_IDLE
4008wxEVT_UPDATE_UI = _core_.wxEVT_UPDATE_UI
4009wxEVT_SIZING = _core_.wxEVT_SIZING
4010wxEVT_MOVING = _core_.wxEVT_MOVING
4011wxEVT_HIBERNATE = _core_.wxEVT_HIBERNATE
2131d850
RD
4012wxEVT_COMMAND_TEXT_COPY = _core_.wxEVT_COMMAND_TEXT_COPY
4013wxEVT_COMMAND_TEXT_CUT = _core_.wxEVT_COMMAND_TEXT_CUT
4014wxEVT_COMMAND_TEXT_PASTE = _core_.wxEVT_COMMAND_TEXT_PASTE
5b5c9bc7
RD
4015wxEVT_COMMAND_LEFT_CLICK = _core_.wxEVT_COMMAND_LEFT_CLICK
4016wxEVT_COMMAND_LEFT_DCLICK = _core_.wxEVT_COMMAND_LEFT_DCLICK
4017wxEVT_COMMAND_RIGHT_CLICK = _core_.wxEVT_COMMAND_RIGHT_CLICK
4018wxEVT_COMMAND_RIGHT_DCLICK = _core_.wxEVT_COMMAND_RIGHT_DCLICK
4019wxEVT_COMMAND_SET_FOCUS = _core_.wxEVT_COMMAND_SET_FOCUS
4020wxEVT_COMMAND_KILL_FOCUS = _core_.wxEVT_COMMAND_KILL_FOCUS
4021wxEVT_COMMAND_ENTER = _core_.wxEVT_COMMAND_ENTER
d55e5bfc
RD
4022#
4023# Create some event binders
4024EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
4025EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
4026EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
4027EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
4028EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
4029EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
4030EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
4031EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
4032EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
4033EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
4034EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
4035EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
4036EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
704eda0c 4037EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d55e5bfc
RD
4038EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
4039EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
4040EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
4041EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
4042EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
4043EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
4044EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
4045EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
4046EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
4047EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
704eda0c 4048EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d55e5bfc
RD
4049EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
4050EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
4051EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
4052EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
4053EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
4054EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
4055EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
4056EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
4057EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
4058EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
4059EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
4060EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
4061EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
4062EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
4063EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
4064EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
34e0a3bb 4065EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
d55e5bfc
RD
4066
4067EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
4068EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
4069EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
4070EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
4071EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
4072EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
4073EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
4074EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
4075EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
4076EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
4077EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
4078EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
4079EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
4080
4081EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
4082 wxEVT_LEFT_UP,
4083 wxEVT_MIDDLE_DOWN,
4084 wxEVT_MIDDLE_UP,
4085 wxEVT_RIGHT_DOWN,
4086 wxEVT_RIGHT_UP,
4087 wxEVT_MOTION,
4088 wxEVT_LEFT_DCLICK,
4089 wxEVT_MIDDLE_DCLICK,
4090 wxEVT_RIGHT_DCLICK,
4091 wxEVT_ENTER_WINDOW,
4092 wxEVT_LEAVE_WINDOW,
4093 wxEVT_MOUSEWHEEL
4094 ])
4095
4096
4097# Scrolling from wxWindow (sent to wxScrolledWindow)
704eda0c 4098EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d55e5bfc
RD
4099 wxEVT_SCROLLWIN_BOTTOM,
4100 wxEVT_SCROLLWIN_LINEUP,
4101 wxEVT_SCROLLWIN_LINEDOWN,
704eda0c 4102 wxEVT_SCROLLWIN_PAGEUP,
d55e5bfc
RD
4103 wxEVT_SCROLLWIN_PAGEDOWN,
4104 wxEVT_SCROLLWIN_THUMBTRACK,
4105 wxEVT_SCROLLWIN_THUMBRELEASE,
4106 ])
4107
4108EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
4109EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
4110EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
4111EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
4112EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
4113EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
4114EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
4115EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
4116
27fb7603 4117# Scrolling from wx.Slider and wx.ScrollBar
704eda0c
RD
4118EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
4119 wxEVT_SCROLL_BOTTOM,
4120 wxEVT_SCROLL_LINEUP,
4121 wxEVT_SCROLL_LINEDOWN,
4122 wxEVT_SCROLL_PAGEUP,
4123 wxEVT_SCROLL_PAGEDOWN,
4124 wxEVT_SCROLL_THUMBTRACK,
4125 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 4126 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
4127 ])
4128
4129EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
4130EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
4131EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
4132EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
4133EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
4134EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
4135EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
4136EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
4f433fef
RD
4137EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
4138EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
704eda0c 4139
27fb7603 4140# Scrolling from wx.Slider and wx.ScrollBar, with an id
704eda0c
RD
4141EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
4142 wxEVT_SCROLL_BOTTOM,
4143 wxEVT_SCROLL_LINEUP,
4144 wxEVT_SCROLL_LINEDOWN,
4145 wxEVT_SCROLL_PAGEUP,
4146 wxEVT_SCROLL_PAGEDOWN,
4147 wxEVT_SCROLL_THUMBTRACK,
d55e5bfc 4148 wxEVT_SCROLL_THUMBRELEASE,
4f433fef 4149 wxEVT_SCROLL_CHANGED,
d55e5bfc
RD
4150 ], 1)
4151
4152EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
4153EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
4154EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
4155EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
4156EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
4157EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
4158EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
4159EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
4f433fef
RD
4160EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
4161EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d55e5bfc
RD
4162
4163EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
4164EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
4165EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
4166EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
4167EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
4168EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
4169EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
4170EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
4171EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
4172EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
4173
4174EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
4175EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
4176EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
4177EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
4178EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
4179EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
4180EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
4181EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
4182EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
4183
4184
4185EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
4186EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
4187EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
4188EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
4189EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
4190EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
4191EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
4192
4193EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
4194
4195EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
4196EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
4197
4198EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
4199
2131d850
RD
4200EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
4201EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
4202EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d55e5bfc
RD
4203
4204
4205#---------------------------------------------------------------------------
4206
5b5c9bc7 4207class Event(Object):
27fb7603
RD
4208 """
4209 An event is a structure holding information about an event passed to a
4210 callback or member function. wx.Event is an abstract base class for
4211 other event classes
4212 """
1bd55598
RD
4213 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4214 def __init__(self): raise AttributeError, "No constructor defined"
4215 __repr__ = _swig_repr
4216 __swig_destroy__ = _core_.delete_Event
4217 __del__ = lambda self : None;
d55e5bfc 4218 def SetEventType(*args, **kwargs):
27fb7603 4219 """
2131d850 4220 SetEventType(self, EventType typ)
27fb7603
RD
4221
4222 Sets the specific type of the event.
4223 """
5b5c9bc7 4224 return _core_.Event_SetEventType(*args, **kwargs)
d55e5bfc
RD
4225
4226 def GetEventType(*args, **kwargs):
27fb7603 4227 """
2131d850 4228 GetEventType(self) -> EventType
27fb7603
RD
4229
4230 Returns the identifier of the given event type, such as
4231 ``wxEVT_COMMAND_BUTTON_CLICKED``.
4232 """
5b5c9bc7 4233 return _core_.Event_GetEventType(*args, **kwargs)
d55e5bfc
RD
4234
4235 def GetEventObject(*args, **kwargs):
27fb7603
RD
4236 """
4237 GetEventObject(self) -> Object
4238
4239 Returns the object (usually a window) associated with the event, if
4240 any.
4241 """
5b5c9bc7 4242 return _core_.Event_GetEventObject(*args, **kwargs)
d55e5bfc
RD
4243
4244 def SetEventObject(*args, **kwargs):
27fb7603
RD
4245 """
4246 SetEventObject(self, Object obj)
4247
4248 Sets the originating object, or in other words, obj is normally the
4249 object that is sending the event.
4250 """
5b5c9bc7 4251 return _core_.Event_SetEventObject(*args, **kwargs)
d55e5bfc
RD
4252
4253 def GetTimestamp(*args, **kwargs):
4254 """GetTimestamp(self) -> long"""
5b5c9bc7 4255 return _core_.Event_GetTimestamp(*args, **kwargs)
d55e5bfc
RD
4256
4257 def SetTimestamp(*args, **kwargs):
4258 """SetTimestamp(self, long ts=0)"""
5b5c9bc7 4259 return _core_.Event_SetTimestamp(*args, **kwargs)
d55e5bfc
RD
4260
4261 def GetId(*args, **kwargs):
27fb7603
RD
4262 """
4263 GetId(self) -> int
4264
4265 Returns the identifier associated with this event, such as a button
4266 command id.
4267 """
5b5c9bc7 4268 return _core_.Event_GetId(*args, **kwargs)
d55e5bfc
RD
4269
4270 def SetId(*args, **kwargs):
27fb7603
RD
4271 """
4272 SetId(self, int Id)
4273
4274 Set's the ID for the event. This is usually the ID of the window that
4275 is sending the event, but it can also be a command id from a menu
4276 item, etc.
4277 """
5b5c9bc7 4278 return _core_.Event_SetId(*args, **kwargs)
d55e5bfc
RD
4279
4280 def IsCommandEvent(*args, **kwargs):
27fb7603
RD
4281 """
4282 IsCommandEvent(self) -> bool
4283
4284 Returns true if the event is or is derived from `wx.CommandEvent` else
4285 it returns false. Note: Exists only for optimization purposes.
4286 """
5b5c9bc7 4287 return _core_.Event_IsCommandEvent(*args, **kwargs)
d55e5bfc
RD
4288
4289 def Skip(*args, **kwargs):
51b83b37
RD
4290 """
4291 Skip(self, bool skip=True)
4292
6b449b19
RD
4293 This method can be used inside an event handler to control whether
4294 further event handlers bound to this event will be called after the
4295 current one returns. Without Skip() (or equivalently if Skip(False) is
4296 used), the event will not be processed any more. If Skip(True) is
4297 called, the event processing system continues searching for a further
4298 handler function for this event, even though it has been processed
4299 already in the current handler.
51b83b37 4300 """
5b5c9bc7 4301 return _core_.Event_Skip(*args, **kwargs)
d55e5bfc
RD
4302
4303 def GetSkipped(*args, **kwargs):
27fb7603
RD
4304 """
4305 GetSkipped(self) -> bool
4306
4307 Returns true if the event handler should be skipped, false otherwise.
4308 :see: `Skip`
4309 """
5b5c9bc7 4310 return _core_.Event_GetSkipped(*args, **kwargs)
d55e5bfc
RD
4311
4312 def ShouldPropagate(*args, **kwargs):
27fb7603
RD
4313 """
4314 ShouldPropagate(self) -> bool
4315
4316 Test if this event should be propagated to the parent window or not,
4317 i.e. if the propagation level is currently greater than 0.
4318 """
5b5c9bc7 4319 return _core_.Event_ShouldPropagate(*args, **kwargs)
d55e5bfc
RD
4320
4321 def StopPropagation(*args, **kwargs):
27fb7603
RD
4322 """
4323 StopPropagation(self) -> int
4324
4325 Stop the event from propagating to its parent window. Returns the old
4326 propagation level value which may be later passed to
4327 `ResumePropagation` to allow propagating the event again.
4328 """
5b5c9bc7 4329 return _core_.Event_StopPropagation(*args, **kwargs)
d55e5bfc
RD
4330
4331 def ResumePropagation(*args, **kwargs):
27fb7603
RD
4332 """
4333 ResumePropagation(self, int propagationLevel)
4334
4335 Resume the event propagation by restoring the propagation level. (For
4336 example, you can use the value returned by an earlier call to
4337 `StopPropagation`.)
4338
4339 """
5b5c9bc7 4340 return _core_.Event_ResumePropagation(*args, **kwargs)
d55e5bfc
RD
4341
4342 def Clone(*args, **kwargs):
5b5c9bc7
RD
4343 """Clone(self) -> Event"""
4344 return _core_.Event_Clone(*args, **kwargs)
d55e5bfc 4345
ac5d357a
RD
4346 EventObject = property(GetEventObject,SetEventObject,doc="See `GetEventObject` and `SetEventObject`")
4347 EventType = property(GetEventType,SetEventType,doc="See `GetEventType` and `SetEventType`")
4348 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
4349 Skipped = property(GetSkipped,doc="See `GetSkipped`")
4350 Timestamp = property(GetTimestamp,SetTimestamp,doc="See `GetTimestamp` and `SetTimestamp`")
2131d850 4351_core_.Event_swigregister(Event)
d55e5bfc
RD
4352
4353#---------------------------------------------------------------------------
4354
5b5c9bc7 4355class PropagationDisabler(object):
27fb7603
RD
4356 """
4357 Helper class to temporarily change an event not to propagate. Simply
4358 create an instance of this class and then whe it is destroyed the
4359 propogation of the event will be restored.
4360 """
1bd55598
RD
4361 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4362 __repr__ = _swig_repr
4363 def __init__(self, *args, **kwargs):
27fb7603
RD
4364 """
4365 __init__(self, Event event) -> PropagationDisabler
4366
4367 Helper class to temporarily change an event not to propagate. Simply
4368 create an instance of this class and then whe it is destroyed the
4369 propogation of the event will be restored.
4370 """
1bd55598
RD
4371 _core_.PropagationDisabler_swiginit(self,_core_.new_PropagationDisabler(*args, **kwargs))
4372 __swig_destroy__ = _core_.delete_PropagationDisabler
4373 __del__ = lambda self : None;
2131d850 4374_core_.PropagationDisabler_swigregister(PropagationDisabler)
d55e5bfc 4375
5b5c9bc7 4376class PropagateOnce(object):
27fb7603
RD
4377 """
4378 A helper class that will temporarily lower propagation level of an
4379 event. Simply create an instance of this class and then whe it is
4380 destroyed the propogation of the event will be restored.
4381 """
1bd55598
RD
4382 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4383 __repr__ = _swig_repr
4384 def __init__(self, *args, **kwargs):
27fb7603
RD
4385 """
4386 __init__(self, Event event) -> PropagateOnce
4387
4388 A helper class that will temporarily lower propagation level of an
4389 event. Simply create an instance of this class and then whe it is
4390 destroyed the propogation of the event will be restored.
4391 """
1bd55598
RD
4392 _core_.PropagateOnce_swiginit(self,_core_.new_PropagateOnce(*args, **kwargs))
4393 __swig_destroy__ = _core_.delete_PropagateOnce
4394 __del__ = lambda self : None;
2131d850 4395_core_.PropagateOnce_swigregister(PropagateOnce)
d55e5bfc
RD
4396
4397#---------------------------------------------------------------------------
4398
5b5c9bc7 4399class CommandEvent(Event):
27fb7603
RD
4400 """
4401 This event class contains information about command events, which
4402 originate from a variety of simple controls, as well as menus and
4403 toolbars.
4404 """
1bd55598
RD
4405 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4406 __repr__ = _swig_repr
4407 def __init__(self, *args, **kwargs):
27fb7603 4408 """
2131d850 4409 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> CommandEvent
27fb7603
RD
4410
4411 This event class contains information about command events, which
4412 originate from a variety of simple controls, as well as menus and
4413 toolbars.
4414 """
1bd55598 4415 _core_.CommandEvent_swiginit(self,_core_.new_CommandEvent(*args, **kwargs))
d55e5bfc 4416 def GetSelection(*args, **kwargs):
27fb7603
RD
4417 """
4418 GetSelection(self) -> int
4419
4420 Returns item index for a listbox or choice selection event (not valid
4421 for a deselection).
4422 """
5b5c9bc7 4423 return _core_.CommandEvent_GetSelection(*args, **kwargs)
d55e5bfc
RD
4424
4425 def SetString(*args, **kwargs):
5b5c9bc7
RD
4426 """SetString(self, String s)"""
4427 return _core_.CommandEvent_SetString(*args, **kwargs)
d55e5bfc
RD
4428
4429 def GetString(*args, **kwargs):
27fb7603
RD
4430 """
4431 GetString(self) -> String
4432
4433 Returns item string for a listbox or choice selection event (not valid
4434 for a deselection).
4435 """
5b5c9bc7 4436 return _core_.CommandEvent_GetString(*args, **kwargs)
d55e5bfc
RD
4437
4438 def IsChecked(*args, **kwargs):
27fb7603
RD
4439 """
4440 IsChecked(self) -> bool
4441
4442 This method can be used with checkbox and menu events: for the
4443 checkboxes, the method returns true for a selection event and false
4444 for a deselection one. For the menu events, this method indicates if
4445 the menu item just has become checked or unchecked (and thus only
4446 makes sense for checkable menu items).
4447 """
5b5c9bc7 4448 return _core_.CommandEvent_IsChecked(*args, **kwargs)
d55e5bfc
RD
4449
4450 Checked = IsChecked
4451 def IsSelection(*args, **kwargs):
27fb7603
RD
4452 """
4453 IsSelection(self) -> bool
4454
4455 For a listbox or similar event, returns true if it is a selection,
4456 false if it is a deselection.
4457 """
5b5c9bc7 4458 return _core_.CommandEvent_IsSelection(*args, **kwargs)
d55e5bfc
RD
4459
4460 def SetExtraLong(*args, **kwargs):
4461 """SetExtraLong(self, long extraLong)"""
5b5c9bc7 4462 return _core_.CommandEvent_SetExtraLong(*args, **kwargs)
d55e5bfc
RD
4463
4464 def GetExtraLong(*args, **kwargs):
27fb7603
RD
4465 """
4466 GetExtraLong(self) -> long
4467
5ba5649b
RD
4468 Returns extra information dependant on the event objects type. If the
4469 event comes from a listbox selection, it is a boolean determining
4470 whether the event was a selection (true) or a deselection (false). A
4471 listbox deselection only occurs for multiple-selection boxes, and in
4472 this case the index and string values are indeterminate and the
4473 listbox must be examined by the application.
27fb7603 4474 """
5b5c9bc7 4475 return _core_.CommandEvent_GetExtraLong(*args, **kwargs)
d55e5bfc
RD
4476
4477 def SetInt(*args, **kwargs):
4478 """SetInt(self, int i)"""
5b5c9bc7 4479 return _core_.CommandEvent_SetInt(*args, **kwargs)
d55e5bfc
RD
4480
4481 def GetInt(*args, **kwargs):
27fb7603 4482 """
2131d850 4483 GetInt(self) -> int
27fb7603 4484
5ba5649b
RD
4485 Returns the integer identifier corresponding to a listbox, choice or
4486 radiobox selection (only if the event was a selection, not a
4487 deselection), or a boolean value representing the value of a checkbox.
27fb7603 4488 """
5b5c9bc7 4489 return _core_.CommandEvent_GetInt(*args, **kwargs)
d55e5bfc 4490
1bd55598
RD
4491 def GetClientData(*args, **kwargs):
4492 """
4493 GetClientData(self) -> PyObject
4494
4495 Returns the client data object for a listbox or choice selection event, (if any.)
4496 """
4497 return _core_.CommandEvent_GetClientData(*args, **kwargs)
4498
4499 def SetClientData(*args, **kwargs):
4500 """
4501 SetClientData(self, PyObject clientData)
4502
4503 Associate the given client data with the item at position n.
4504 """
4505 return _core_.CommandEvent_SetClientData(*args, **kwargs)
4506
4507 GetClientObject = GetClientData
4508 SetClientObject = SetClientData
4509
d55e5bfc 4510 def Clone(*args, **kwargs):
5b5c9bc7
RD
4511 """Clone(self) -> Event"""
4512 return _core_.CommandEvent_Clone(*args, **kwargs)
d55e5bfc 4513
2bf58437
RD
4514 ClientData = property(GetClientData,SetClientData,doc="See `GetClientData` and `SetClientData`")
4515 ClientObject = property(GetClientObject,SetClientObject,doc="See `GetClientObject` and `SetClientObject`")
4516 ExtraLong = property(GetExtraLong,SetExtraLong,doc="See `GetExtraLong` and `SetExtraLong`")
4517 Int = property(GetInt,SetInt,doc="See `GetInt` and `SetInt`")
4518 Selection = property(GetSelection,doc="See `GetSelection`")
4519 String = property(GetString,SetString,doc="See `GetString` and `SetString`")
2131d850 4520_core_.CommandEvent_swigregister(CommandEvent)
d55e5bfc
RD
4521
4522#---------------------------------------------------------------------------
4523
5b5c9bc7 4524class NotifyEvent(CommandEvent):
27fb7603
RD
4525 """
4526 An instance of this class (or one of its derived classes) is sent from
4527 a control when the control's state is being changed and the control
4528 allows that change to be prevented from happening. The event handler
4529 can call `Veto` or `Allow` to tell the control what to do.
4530 """
1bd55598
RD
4531 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4532 __repr__ = _swig_repr
4533 def __init__(self, *args, **kwargs):
27fb7603 4534 """
2131d850 4535 __init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> NotifyEvent
27fb7603
RD
4536
4537 An instance of this class (or one of its derived classes) is sent from
4538 a control when the control's state is being changed and the control
4539 allows that change to be prevented from happening. The event handler
4540 can call `Veto` or `Allow` to tell the control what to do.
4541 """
1bd55598 4542 _core_.NotifyEvent_swiginit(self,_core_.new_NotifyEvent(*args, **kwargs))
d55e5bfc 4543 def Veto(*args, **kwargs):
27fb7603
RD
4544 """
4545 Veto(self)
4546
4547 Prevents the change announced by this event from happening.
4548
4549 It is in general a good idea to notify the user about the reasons for
4550 vetoing the change because otherwise the applications behaviour (which
4551 just refuses to do what the user wants) might be quite surprising.
4552 """
5b5c9bc7 4553 return _core_.NotifyEvent_Veto(*args, **kwargs)
d55e5bfc
RD
4554
4555 def Allow(*args, **kwargs):
27fb7603
RD
4556 """
4557 Allow(self)
4558
4559 This is the opposite of `Veto`: it explicitly allows the event to be
4560 processed. For most events it is not necessary to call this method as
4561 the events are allowed anyhow but some are forbidden by default (this
4562 will be mentioned in the corresponding event description).
4563 """
5b5c9bc7 4564 return _core_.NotifyEvent_Allow(*args, **kwargs)
d55e5bfc
RD
4565
4566 def IsAllowed(*args, **kwargs):
27fb7603
RD
4567 """
4568 IsAllowed(self) -> bool
4569
4570 Returns true if the change is allowed (`Veto` hasn't been called) or
4571 false otherwise (if it was).
4572 """
5b5c9bc7 4573 return _core_.NotifyEvent_IsAllowed(*args, **kwargs)
d55e5bfc 4574
2131d850 4575_core_.NotifyEvent_swigregister(NotifyEvent)
d55e5bfc
RD
4576
4577#---------------------------------------------------------------------------
4578
5b5c9bc7 4579class ScrollEvent(CommandEvent):
27fb7603
RD
4580 """
4581 A scroll event holds information about events sent from stand-alone
4582 scrollbars and sliders. Note that scrolled windows do not send
cbfc9df6 4583 instances of this event class, but send the `wx.ScrollWinEvent`
27fb7603
RD
4584 instead.
4585 """
1bd55598
RD
4586 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4587 __repr__ = _swig_repr
4588 def __init__(self, *args, **kwargs):
d55e5bfc 4589 """
2131d850 4590 __init__(self, EventType commandType=wxEVT_NULL, int winid=0, int pos=0,
5b5c9bc7 4591 int orient=0) -> ScrollEvent
d55e5bfc 4592 """
1bd55598 4593 _core_.ScrollEvent_swiginit(self,_core_.new_ScrollEvent(*args, **kwargs))
d55e5bfc 4594 def GetOrientation(*args, **kwargs):
27fb7603
RD
4595 """
4596 GetOrientation(self) -> int
4597
4598 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4599 the scrollbar.
4600 """
5b5c9bc7 4601 return _core_.ScrollEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4602
4603 def GetPosition(*args, **kwargs):
27fb7603
RD
4604 """
4605 GetPosition(self) -> int
4606
4607 Returns the position of the scrollbar.
4608 """
5b5c9bc7 4609 return _core_.ScrollEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4610
4611 def SetOrientation(*args, **kwargs):
4612 """SetOrientation(self, int orient)"""
5b5c9bc7 4613 return _core_.ScrollEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4614
4615 def SetPosition(*args, **kwargs):
4616 """SetPosition(self, int pos)"""
5b5c9bc7 4617 return _core_.ScrollEvent_SetPosition(*args, **kwargs)
d55e5bfc 4618
33d6fd3b
RD
4619 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4620 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4621_core_.ScrollEvent_swigregister(ScrollEvent)
d55e5bfc
RD
4622
4623#---------------------------------------------------------------------------
4624
5b5c9bc7 4625class ScrollWinEvent(Event):
27fb7603
RD
4626 """
4627 A wx.ScrollWinEvent holds information about scrolling and is sent from
4628 scrolling windows.
4629 """
1bd55598
RD
4630 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4631 __repr__ = _swig_repr
4632 def __init__(self, *args, **kwargs):
27fb7603 4633 """
2131d850 4634 __init__(self, EventType commandType=wxEVT_NULL, int pos=0, int orient=0) -> ScrollWinEvent
27fb7603
RD
4635
4636 A wx.ScrollWinEvent holds information about scrolling and is sent from
4637 scrolling windows.
4638 """
1bd55598 4639 _core_.ScrollWinEvent_swiginit(self,_core_.new_ScrollWinEvent(*args, **kwargs))
d55e5bfc 4640 def GetOrientation(*args, **kwargs):
27fb7603
RD
4641 """
4642 GetOrientation(self) -> int
4643
4644 Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
4645 the scrollbar.
4646 """
5b5c9bc7 4647 return _core_.ScrollWinEvent_GetOrientation(*args, **kwargs)
d55e5bfc
RD
4648
4649 def GetPosition(*args, **kwargs):
27fb7603
RD
4650 """
4651 GetPosition(self) -> int
4652
4653 Returns the position of the scrollbar for the thumb track and release
4654 events. Note that this field can't be used for the other events, you
4655 need to query the window itself for the current position in that case.
4656 """
5b5c9bc7 4657 return _core_.ScrollWinEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4658
4659 def SetOrientation(*args, **kwargs):
4660 """SetOrientation(self, int orient)"""
5b5c9bc7 4661 return _core_.ScrollWinEvent_SetOrientation(*args, **kwargs)
d55e5bfc
RD
4662
4663 def SetPosition(*args, **kwargs):
4664 """SetPosition(self, int pos)"""
5b5c9bc7 4665 return _core_.ScrollWinEvent_SetPosition(*args, **kwargs)
d55e5bfc 4666
33d6fd3b
RD
4667 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
4668 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 4669_core_.ScrollWinEvent_swigregister(ScrollWinEvent)
d55e5bfc
RD
4670
4671#---------------------------------------------------------------------------
4672
5b5c9bc7
RD
4673MOUSE_BTN_ANY = _core_.MOUSE_BTN_ANY
4674MOUSE_BTN_NONE = _core_.MOUSE_BTN_NONE
4675MOUSE_BTN_LEFT = _core_.MOUSE_BTN_LEFT
4676MOUSE_BTN_MIDDLE = _core_.MOUSE_BTN_MIDDLE
4677MOUSE_BTN_RIGHT = _core_.MOUSE_BTN_RIGHT
4678class MouseEvent(Event):
27fb7603
RD
4679 """
4680 This event class contains information about the events generated by
4681 the mouse: they include mouse buttons press and release events and
4682 mouse move events.
4683
4684 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
4685 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
4686 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
4687 a middle button so a portable application should avoid relying on the
4688 events from it.
4689
4690 Note the difference between methods like `LeftDown` and `LeftIsDown`:
4691 the former returns true when the event corresponds to the left mouse
4692 button click while the latter returns true if the left mouse button is
4693 currently being pressed. For example, when the user is dragging the
4694 mouse you can use `LeftIsDown` to test whether the left mouse button
4695 is (still) depressed. Also, by convention, if `LeftDown` returns true,
4696 `LeftIsDown` will also return true in wxWidgets whatever the
4697 underlying GUI behaviour is (which is platform-dependent). The same
4698 applies, of course, to other mouse buttons as well.
4699 """
1bd55598
RD
4700 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
4701 __repr__ = _swig_repr
4702 def __init__(self, *args, **kwargs):
27fb7603 4703 """
2131d850 4704 __init__(self, EventType mouseType=wxEVT_NULL) -> MouseEvent
27fb7603
RD
4705
4706 Constructs a wx.MouseEvent. Valid event types are:
4707
4708 * wxEVT_ENTER_WINDOW
4709 * wxEVT_LEAVE_WINDOW
4710 * wxEVT_LEFT_DOWN
4711 * wxEVT_LEFT_UP
4712 * wxEVT_LEFT_DCLICK
4713 * wxEVT_MIDDLE_DOWN
4714 * wxEVT_MIDDLE_UP
4715 * wxEVT_MIDDLE_DCLICK
4716 * wxEVT_RIGHT_DOWN
4717 * wxEVT_RIGHT_UP
4718 * wxEVT_RIGHT_DCLICK
4719 * wxEVT_MOTION
4720 * wxEVT_MOUSEWHEEL
4721 """
1bd55598 4722 _core_.MouseEvent_swiginit(self,_core_.new_MouseEvent(*args, **kwargs))
d55e5bfc 4723 def IsButton(*args, **kwargs):
27fb7603
RD
4724 """
4725 IsButton(self) -> bool
4726
4727 Returns true if the event was a mouse button event (not necessarily a
4728 button down event - that may be tested using `ButtonDown`).
4729 """
5b5c9bc7 4730 return _core_.MouseEvent_IsButton(*args, **kwargs)
d55e5bfc
RD
4731
4732 def ButtonDown(*args, **kwargs):
27fb7603
RD
4733 """
4734 ButtonDown(self, int but=MOUSE_BTN_ANY) -> bool
4735
5ba5649b
RD
4736 If the argument is omitted, this returns true if the event was any
4737 mouse button down event. Otherwise the argument specifies which
4738 button-down event shold be checked for (see `Button` for the possible
4739 values).
27fb7603 4740 """
5b5c9bc7 4741 return _core_.MouseEvent_ButtonDown(*args, **kwargs)
d55e5bfc
RD
4742
4743 def ButtonDClick(*args, **kwargs):
27fb7603
RD
4744 """
4745 ButtonDClick(self, int but=MOUSE_BTN_ANY) -> bool
4746
4747 If the argument is omitted, this returns true if the event was any
4748 mouse double click event. Otherwise the argument specifies which
4749 double click event to check for (see `Button` for the possible
4750 values).
4751 """
5b5c9bc7 4752 return _core_.MouseEvent_ButtonDClick(*args, **kwargs)
d55e5bfc
RD
4753
4754 def ButtonUp(*args, **kwargs):
27fb7603
RD
4755 """
4756 ButtonUp(self, int but=MOUSE_BTN_ANY) -> bool
4757
4758 If the argument is omitted, this returns true if the event was any
5ba5649b
RD
4759 mouse button up event. Otherwise the argument specifies which button
4760 up event to check for (see `Button` for the possible values).
27fb7603 4761 """
5b5c9bc7 4762 return _core_.MouseEvent_ButtonUp(*args, **kwargs)
d55e5bfc
RD
4763
4764 def Button(*args, **kwargs):
27fb7603
RD
4765 """
4766 Button(self, int button) -> bool
4767
4768 Returns true if the identified mouse button is changing state. Valid
4769 values of button are:
4770
4771 ==================== =====================================
4772 wx.MOUSE_BTN_LEFT check if left button was pressed
4773 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
4774 wx.MOUSE_BTN_RIGHT check if right button was pressed
4775 wx.MOUSE_BTN_ANY check if any button was pressed
4776 ==================== =====================================
4777
4778 """
5b5c9bc7 4779 return _core_.MouseEvent_Button(*args, **kwargs)
d55e5bfc
RD
4780
4781 def ButtonIsDown(*args, **kwargs):
4782 """ButtonIsDown(self, int but) -> bool"""
5b5c9bc7 4783 return _core_.MouseEvent_ButtonIsDown(*args, **kwargs)
d55e5bfc
RD
4784
4785 def GetButton(*args, **kwargs):
27fb7603
RD
4786 """
4787 GetButton(self) -> int
4788
4789 Returns the mouse button which generated this event or
4790 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
4791 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
4792 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
4793 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
4794 right buttons respectively.
4795 """
5b5c9bc7 4796 return _core_.MouseEvent_GetButton(*args, **kwargs)
d55e5bfc
RD
4797
4798 def ControlDown(*args, **kwargs):
27fb7603
RD
4799 """
4800 ControlDown(self) -> bool
4801
4802 Returns true if the control key was down at the time of the event.
4803 """
5b5c9bc7 4804 return _core_.MouseEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
4805
4806 def MetaDown(*args, **kwargs):
27fb7603
RD
4807 """
4808 MetaDown(self) -> bool
4809
4810 Returns true if the Meta key was down at the time of the event.
4811 """
5b5c9bc7 4812 return _core_.MouseEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
4813
4814 def AltDown(*args, **kwargs):
27fb7603
RD
4815 """
4816 AltDown(self) -> bool
4817
4818 Returns true if the Alt key was down at the time of the event.
4819 """
5b5c9bc7 4820 return _core_.MouseEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
4821
4822 def ShiftDown(*args, **kwargs):
27fb7603
RD
4823 """
4824 ShiftDown(self) -> bool
4825
4826 Returns true if the Shift key was down at the time of the event.
4827 """
5b5c9bc7 4828 return _core_.MouseEvent_ShiftDown(*args, **kwargs)
d55e5bfc 4829
412d302d
RD
4830 def CmdDown(*args, **kwargs):
4831 """
4832 CmdDown(self) -> bool
4833
4834 "Cmd" is a pseudo key which is the same as Control for PC and Unix
4835 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 4836 Macs. It often makes sense to use it instead of, say, `ControlDown`
412d302d 4837 because Cmd key is used for the same thing under Mac as Ctrl
27fb7603 4838 elsewhere. The Ctrl key still exists, it's just not used for this
412d302d
RD
4839 purpose. So for non-Mac platforms this is the same as `ControlDown`
4840 and Macs this is the same as `MetaDown`.
4841 """
5b5c9bc7 4842 return _core_.MouseEvent_CmdDown(*args, **kwargs)
412d302d 4843
d55e5bfc 4844 def LeftDown(*args, **kwargs):
27fb7603
RD
4845 """
4846 LeftDown(self) -> bool
4847
4848 Returns true if the left mouse button state changed to down.
4849 """
5b5c9bc7 4850 return _core_.MouseEvent_LeftDown(*args, **kwargs)
d55e5bfc
RD
4851
4852 def MiddleDown(*args, **kwargs):
27fb7603
RD
4853 """
4854 MiddleDown(self) -> bool
4855
4856 Returns true if the middle mouse button state changed to down.
4857 """
5b5c9bc7 4858 return _core_.MouseEvent_MiddleDown(*args, **kwargs)
d55e5bfc
RD
4859
4860 def RightDown(*args, **kwargs):
27fb7603
RD
4861 """
4862 RightDown(self) -> bool
4863
4864 Returns true if the right mouse button state changed to down.
4865 """
5b5c9bc7 4866 return _core_.MouseEvent_RightDown(*args, **kwargs)
d55e5bfc
RD
4867
4868 def LeftUp(*args, **kwargs):
27fb7603
RD
4869 """
4870 LeftUp(self) -> bool
4871
4872 Returns true if the left mouse button state changed to up.
4873 """
5b5c9bc7 4874 return _core_.MouseEvent_LeftUp(*args, **kwargs)
d55e5bfc
RD
4875
4876 def MiddleUp(*args, **kwargs):
27fb7603
RD
4877 """
4878 MiddleUp(self) -> bool
4879
4880 Returns true if the middle mouse button state changed to up.
4881 """
5b5c9bc7 4882 return _core_.MouseEvent_MiddleUp(*args, **kwargs)
d55e5bfc
RD
4883
4884 def RightUp(*args, **kwargs):
27fb7603
RD
4885 """
4886 RightUp(self) -> bool
4887
4888 Returns true if the right mouse button state changed to up.
4889 """
5b5c9bc7 4890 return _core_.MouseEvent_RightUp(*args, **kwargs)
d55e5bfc
RD
4891
4892 def LeftDClick(*args, **kwargs):
27fb7603
RD
4893 """
4894 LeftDClick(self) -> bool
4895
4896 Returns true if the event was a left button double click.
4897 """
5b5c9bc7 4898 return _core_.MouseEvent_LeftDClick(*args, **kwargs)
d55e5bfc
RD
4899
4900 def MiddleDClick(*args, **kwargs):
27fb7603
RD
4901 """
4902 MiddleDClick(self) -> bool
4903
4904 Returns true if the event was a middle button double click.
4905 """
5b5c9bc7 4906 return _core_.MouseEvent_MiddleDClick(*args, **kwargs)
d55e5bfc
RD
4907
4908 def RightDClick(*args, **kwargs):
27fb7603
RD
4909 """
4910 RightDClick(self) -> bool
4911
4912 Returns true if the event was a right button double click.
4913 """
5b5c9bc7 4914 return _core_.MouseEvent_RightDClick(*args, **kwargs)
d55e5bfc
RD
4915
4916 def LeftIsDown(*args, **kwargs):
27fb7603
RD
4917 """
4918 LeftIsDown(self) -> bool
4919
4920 Returns true if the left mouse button is currently down, independent
4921 of the current event type.
4922
4923 Please notice that it is not the same as LeftDown which returns true
4924 if the left mouse button was just pressed. Rather, it describes the
4925 state of the mouse button before the event happened.
4926
4927 This event is usually used in the mouse event handlers which process
4928 "move mouse" messages to determine whether the user is (still)
4929 dragging the mouse.
4930 """
5b5c9bc7 4931 return _core_.MouseEvent_LeftIsDown(*args, **kwargs)
d55e5bfc
RD
4932
4933 def MiddleIsDown(*args, **kwargs):
27fb7603
RD
4934 """
4935 MiddleIsDown(self) -> bool
4936
4937 Returns true if the middle mouse button is currently down, independent
4938 of the current event type.
4939 """
5b5c9bc7 4940 return _core_.MouseEvent_MiddleIsDown(*args, **kwargs)
d55e5bfc
RD
4941
4942 def RightIsDown(*args, **kwargs):
27fb7603
RD
4943 """
4944 RightIsDown(self) -> bool
4945
4946 Returns true if the right mouse button is currently down, independent
4947 of the current event type.
4948 """
5b5c9bc7 4949 return _core_.MouseEvent_RightIsDown(*args, **kwargs)
d55e5bfc
RD
4950
4951 def Dragging(*args, **kwargs):
27fb7603
RD
4952 """
4953 Dragging(self) -> bool
4954
4955 Returns true if this was a dragging event (motion while a button is
4956 depressed).
4957 """
5b5c9bc7 4958 return _core_.MouseEvent_Dragging(*args, **kwargs)
d55e5bfc
RD
4959
4960 def Moving(*args, **kwargs):
27fb7603
RD
4961 """
4962 Moving(self) -> bool
4963
4964 Returns true if this was a motion event and no mouse buttons were
4965 pressed. If any mouse button is held pressed, then this method returns
4966 false and Dragging returns true.
4967 """
5b5c9bc7 4968 return _core_.MouseEvent_Moving(*args, **kwargs)
d55e5bfc
RD
4969
4970 def Entering(*args, **kwargs):
27fb7603
RD
4971 """
4972 Entering(self) -> bool
4973
4974 Returns true if the mouse was entering the window.
4975 """
5b5c9bc7 4976 return _core_.MouseEvent_Entering(*args, **kwargs)
d55e5bfc
RD
4977
4978 def Leaving(*args, **kwargs):
27fb7603
RD
4979 """
4980 Leaving(self) -> bool
4981
4982 Returns true if the mouse was leaving the window.
4983 """
5b5c9bc7 4984 return _core_.MouseEvent_Leaving(*args, **kwargs)
d55e5bfc
RD
4985
4986 def GetPosition(*args, **kwargs):
4987 """
5b5c9bc7 4988 GetPosition(self) -> Point
d55e5bfc 4989
27fb7603
RD
4990 Returns the pixel position of the mouse in window coordinates when the
4991 event happened.
d55e5bfc 4992 """
5b5c9bc7 4993 return _core_.MouseEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
4994
4995 def GetPositionTuple(*args, **kwargs):
4996 """
4997 GetPositionTuple() -> (x,y)
4998
27fb7603
RD
4999 Returns the pixel position of the mouse in window coordinates when the
5000 event happened.
d55e5bfc 5001 """
5b5c9bc7 5002 return _core_.MouseEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
5003
5004 def GetLogicalPosition(*args, **kwargs):
27fb7603
RD
5005 """
5006 GetLogicalPosition(self, DC dc) -> Point
5007
5008 Returns the logical mouse position in pixels (i.e. translated
5009 according to the translation set for the DC, which usually indicates
5010 that the window has been scrolled).
5011 """
5b5c9bc7 5012 return _core_.MouseEvent_GetLogicalPosition(*args, **kwargs)
d55e5bfc
RD
5013
5014 def GetX(*args, **kwargs):
27fb7603
RD
5015 """
5016 GetX(self) -> int
5017
5018 Returns X coordinate of the physical mouse event position.
5019 """
5b5c9bc7 5020 return _core_.MouseEvent_GetX(*args, **kwargs)
d55e5bfc
RD
5021
5022 def GetY(*args, **kwargs):
27fb7603
RD
5023 """
5024 GetY(self) -> int
5025
5026 Returns Y coordinate of the physical mouse event position.
5027 """
5b5c9bc7 5028 return _core_.MouseEvent_GetY(*args, **kwargs)
d55e5bfc
RD
5029
5030 def GetWheelRotation(*args, **kwargs):
27fb7603
RD
5031 """
5032 GetWheelRotation(self) -> int
5033
5034 Get wheel rotation, positive or negative indicates direction of
5035 rotation. Current devices all send an event when rotation is equal to
5036 +/-WheelDelta, but this allows for finer resolution devices to be
5037 created in the future. Because of this you shouldn't assume that one
5038 event is equal to 1 line or whatever, but you should be able to either
5039 do partial line scrolling or wait until +/-WheelDelta rotation values
5040 have been accumulated before scrolling.
5041 """
5b5c9bc7 5042 return _core_.MouseEvent_GetWheelRotation(*args, **kwargs)
d55e5bfc
RD
5043
5044 def GetWheelDelta(*args, **kwargs):
27fb7603
RD
5045 """
5046 GetWheelDelta(self) -> int
5047
5048 Get wheel delta, normally 120. This is the threshold for action to be
5049 taken, and one such action (for example, scrolling one increment)
5050 should occur for each delta.
5051 """
5b5c9bc7 5052 return _core_.MouseEvent_GetWheelDelta(*args, **kwargs)
d55e5bfc 5053
4976f996
RD
5054 def GetWheelAxis(*args, **kwargs):
5055 """
5056 GetWheelAxis(self) -> int
5057
5058 Gets the axis the wheel operation concerns, 0 being the y axis as on
5059 most mouse wheels, 1 is the x axis for things like MightyMouse scrolls
5060 or horizontal trackpad scrolling.
5061 """
5062 return _core_.MouseEvent_GetWheelAxis(*args, **kwargs)
5063
d55e5bfc 5064 def GetLinesPerAction(*args, **kwargs):
27fb7603
RD
5065 """
5066 GetLinesPerAction(self) -> int
5067
5068 Returns the configured number of lines (or whatever) to be scrolled
5069 per wheel action. Defaults to three.
5070 """
5b5c9bc7 5071 return _core_.MouseEvent_GetLinesPerAction(*args, **kwargs)
d55e5bfc
RD
5072
5073 def IsPageScroll(*args, **kwargs):
27fb7603
RD
5074 """
5075 IsPageScroll(self) -> bool
5076
5077 Returns true if the system has been setup to do page scrolling with
5078 the mouse wheel instead of line scrolling.
5079 """
5b5c9bc7
RD
5080 return _core_.MouseEvent_IsPageScroll(*args, **kwargs)
5081
5082 m_x = property(_core_.MouseEvent_m_x_get, _core_.MouseEvent_m_x_set)
5083 m_y = property(_core_.MouseEvent_m_y_get, _core_.MouseEvent_m_y_set)
5084 m_leftDown = property(_core_.MouseEvent_m_leftDown_get, _core_.MouseEvent_m_leftDown_set)
5085 m_middleDown = property(_core_.MouseEvent_m_middleDown_get, _core_.MouseEvent_m_middleDown_set)
5086 m_rightDown = property(_core_.MouseEvent_m_rightDown_get, _core_.MouseEvent_m_rightDown_set)
5087 m_controlDown = property(_core_.MouseEvent_m_controlDown_get, _core_.MouseEvent_m_controlDown_set)
5088 m_shiftDown = property(_core_.MouseEvent_m_shiftDown_get, _core_.MouseEvent_m_shiftDown_set)
5089 m_altDown = property(_core_.MouseEvent_m_altDown_get, _core_.MouseEvent_m_altDown_set)
5090 m_metaDown = property(_core_.MouseEvent_m_metaDown_get, _core_.MouseEvent_m_metaDown_set)
5091 m_wheelRotation = property(_core_.MouseEvent_m_wheelRotation_get, _core_.MouseEvent_m_wheelRotation_set)
5092 m_wheelDelta = property(_core_.MouseEvent_m_wheelDelta_get, _core_.MouseEvent_m_wheelDelta_set)
5093 m_linesPerAction = property(_core_.MouseEvent_m_linesPerAction_get, _core_.MouseEvent_m_linesPerAction_set)
57332a5a
RD
5094 Button = property(GetButton,doc="See `GetButton`")
5095 LinesPerAction = property(GetLinesPerAction,doc="See `GetLinesPerAction`")
5096 LogicalPosition = property(GetLogicalPosition,doc="See `GetLogicalPosition`")
5097 Position = property(GetPosition,doc="See `GetPosition`")
5098 WheelDelta = property(GetWheelDelta,doc="See `GetWheelDelta`")
5099 WheelRotation = property(GetWheelRotation,doc="See `GetWheelRotation`")
5100 X = property(GetX,doc="See `GetX`")
5101 Y = property(GetY,doc="See `GetY`")
2131d850 5102_core_.MouseEvent_swigregister(MouseEvent)
d55e5bfc
RD
5103
5104#---------------------------------------------------------------------------
5105
5b5c9bc7 5106class SetCursorEvent(Event):
5ba5649b
RD
5107 """
5108 A SetCursorEvent is generated when the mouse cursor is about to be set
5109 as a result of mouse motion. This event gives the application the
5110 chance to perform specific mouse cursor processing based on the
5111 current position of the mouse within the window. Use the `SetCursor`
5112 method to specify the cursor you want to be displayed.
5113 """
1bd55598
RD
5114 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5115 __repr__ = _swig_repr
5116 def __init__(self, *args, **kwargs):
5ba5649b
RD
5117 """
5118 __init__(self, int x=0, int y=0) -> SetCursorEvent
5119
5120 Construct a new `wx.SetCursorEvent`.
5121 """
1bd55598 5122 _core_.SetCursorEvent_swiginit(self,_core_.new_SetCursorEvent(*args, **kwargs))
d55e5bfc 5123 def GetX(*args, **kwargs):
5ba5649b
RD
5124 """
5125 GetX(self) -> int
5126
5127 Returns the X coordinate of the mouse in client coordinates.
5128 """
5b5c9bc7 5129 return _core_.SetCursorEvent_GetX(*args, **kwargs)
d55e5bfc
RD
5130
5131 def GetY(*args, **kwargs):
5ba5649b
RD
5132 """
5133 GetY(self) -> int
5134
5135 Returns the Y coordinate of the mouse in client coordinates.
5136 """
5b5c9bc7 5137 return _core_.SetCursorEvent_GetY(*args, **kwargs)
d55e5bfc
RD
5138
5139 def SetCursor(*args, **kwargs):
5ba5649b
RD
5140 """
5141 SetCursor(self, Cursor cursor)
5142
5143 Sets the cursor associated with this event.
5144 """
5b5c9bc7 5145 return _core_.SetCursorEvent_SetCursor(*args, **kwargs)
d55e5bfc
RD
5146
5147 def GetCursor(*args, **kwargs):
5ba5649b
RD
5148 """
5149 GetCursor(self) -> Cursor
5150
5151 Returns a reference to the cursor specified by this event.
5152 """
5b5c9bc7 5153 return _core_.SetCursorEvent_GetCursor(*args, **kwargs)
d55e5bfc
RD
5154
5155 def HasCursor(*args, **kwargs):
5ba5649b
RD
5156 """
5157 HasCursor(self) -> bool
5158
5159 Returns true if the cursor specified by this event is a valid cursor.
5160 """
5b5c9bc7 5161 return _core_.SetCursorEvent_HasCursor(*args, **kwargs)
d55e5bfc 5162
33d6fd3b
RD
5163 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
5164 X = property(GetX,doc="See `GetX`")
5165 Y = property(GetY,doc="See `GetY`")
2131d850 5166_core_.SetCursorEvent_swigregister(SetCursorEvent)
d55e5bfc
RD
5167
5168#---------------------------------------------------------------------------
5169
5b5c9bc7 5170class KeyEvent(Event):
5ba5649b
RD
5171 """
5172 This event class contains information about keypress and character
5173 events. These events are only sent to the widget that currently has
5174 the keyboard focus.
5175
5176 Notice that there are three different kinds of keyboard events in
5177 wxWidgets: key down and up events and char events. The difference
5178 between the first two is clear - the first corresponds to a key press
5179 and the second to a key release - otherwise they are identical. Just
5180 note that if the key is maintained in a pressed state you will
5181 typically get a lot of (automatically generated) down events but only
5182 one up so it is wrong to assume that there is one up event
5183 corresponding to each down one.
5184
5185 Both key events provide untranslated key codes while the char event
5186 carries the translated one. The untranslated code for alphanumeric
5187 keys is always an upper case value. For the other keys it is one of
5188 WXK_XXX values from the keycodes table. The translated key is, in
5189 general, the character the user expects to appear as the result of the
5190 key combination when typing the text into a text entry zone, for
5191 example.
5192
5193 A few examples to clarify this (all assume that CAPS LOCK is unpressed
5194 and the standard US keyboard): when the 'A' key is pressed, the key
5195 down event key code is equal to ASCII A == 65. But the char event key
5196 code is ASCII a == 97. On the other hand, if you press both SHIFT and
5197 'A' keys simultaneously , the key code in key down event will still be
5198 just 'A' while the char event key code parameter will now be 'A' as
5199 well.
5200
5201 Although in this simple case it is clear that the correct key code
5202 could be found in the key down event handler by checking the value
5203 returned by `ShiftDown`, in general you should use EVT_CHAR for this
5204 as for non alphanumeric keys or non-US keyboard layouts the
5205 translation is keyboard-layout dependent and can only be done properly
5206 by the system itself.
5207
5208 Another kind of translation is done when the control key is pressed:
5209 for example, for CTRL-A key press the key down event still carries the
5210 same key code 'A' as usual but the char event will have key code of 1,
5211 the ASCII value of this key combination.
5212
5213 You may discover how the other keys on your system behave
5214 interactively by running the KeyEvents sample in the wxPython demo and
5215 pressing some keys while the blue box at the top has the keyboard
5216 focus.
5217
5218 **Note**: If a key down event is caught and the event handler does not
5219 call event.Skip() then the coresponding char event will not
5220 happen. This is by design and enables the programs that handle both
5221 types of events to be a bit simpler.
5222
5223 **Note for Windows programmers**: The key and char events in wxWidgets
5224 are similar to but slightly different from Windows WM_KEYDOWN and
5225 WM_CHAR events. In particular, Alt-x combination will generate a char
5226 event in wxWidgets (unless it is used as an accelerator).
5227
5228 **Tip**: be sure to call event.Skip() for events that you don't
5229 process in key event function, otherwise menu shortcuts may cease to
5230 work under Windows.
5231
5232 """
1bd55598
RD
5233 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5234 __repr__ = _swig_repr
5235 def __init__(self, *args, **kwargs):
5ba5649b 5236 """
2131d850 5237 __init__(self, EventType eventType=wxEVT_NULL) -> KeyEvent
5ba5649b
RD
5238
5239 Construct a new `wx.KeyEvent`. Valid event types are:
5240 *
5241 """
1bd55598 5242 _core_.KeyEvent_swiginit(self,_core_.new_KeyEvent(*args, **kwargs))
b1fcee84
RD
5243 def GetModifiers(*args, **kwargs):
5244 """
5245 GetModifiers(self) -> int
5246
5247 Returns a bitmask of the current modifier settings. Can be used to
5248 check if the key event has exactly the given modifiers without having
5249 to explicitly check that the other modifiers are not down. For
5250 example::
5251
5252 if event.GetModifers() == wx.MOD_CONTROL:
5253 DoSomething()
5254
5255 """
5256 return _core_.KeyEvent_GetModifiers(*args, **kwargs)
5257
d55e5bfc 5258 def ControlDown(*args, **kwargs):
5ba5649b
RD
5259 """
5260 ControlDown(self) -> bool
5261
5262 Returns ``True`` if the Control key was down at the time of the event.
5263 """
5b5c9bc7 5264 return _core_.KeyEvent_ControlDown(*args, **kwargs)
d55e5bfc
RD
5265
5266 def MetaDown(*args, **kwargs):
5ba5649b
RD
5267 """
5268 MetaDown(self) -> bool
5269
5270 Returns ``True`` if the Meta key was down at the time of the event.
5271 """
5b5c9bc7 5272 return _core_.KeyEvent_MetaDown(*args, **kwargs)
d55e5bfc
RD
5273
5274 def AltDown(*args, **kwargs):
5ba5649b
RD
5275 """
5276 AltDown(self) -> bool
5277
5278 Returns ``True`` if the Alt key was down at the time of the event.
5279 """
5b5c9bc7 5280 return _core_.KeyEvent_AltDown(*args, **kwargs)
d55e5bfc
RD
5281
5282 def ShiftDown(*args, **kwargs):
5ba5649b
RD
5283 """
5284 ShiftDown(self) -> bool
5285
5286 Returns ``True`` if the Shift key was down at the time of the event.
5287 """
5b5c9bc7 5288 return _core_.KeyEvent_ShiftDown(*args, **kwargs)
d55e5bfc 5289
412d302d
RD
5290 def CmdDown(*args, **kwargs):
5291 """
5292 CmdDown(self) -> bool
5293
5294 "Cmd" is a pseudo key which is the same as Control for PC and Unix
5295 platforms but the special "Apple" (a.k.a as "Command") key on
5ba5649b 5296 Macs. It makes often sense to use it instead of, say, `ControlDown`
412d302d
RD
5297 because Cmd key is used for the same thing under Mac as Ctrl
5298 elsewhere. The Ctrl still exists, it's just not used for this
5299 purpose. So for non-Mac platforms this is the same as `ControlDown`
5300 and Macs this is the same as `MetaDown`.
5301 """
5b5c9bc7 5302 return _core_.KeyEvent_CmdDown(*args, **kwargs)
412d302d 5303
d55e5bfc 5304 def HasModifiers(*args, **kwargs):
5ba5649b
RD
5305 """
5306 HasModifiers(self) -> bool
5307
5308 Returns true if either CTRL or ALT keys was down at the time of the
5309 key event. Note that this function does not take into account neither
5310 SHIFT nor META key states (the reason for ignoring the latter is that
5311 it is common for NUMLOCK key to be configured as META under X but the
5312 key presses even while NUMLOCK is on should be still processed
5313 normally).
5314 """
5b5c9bc7 5315 return _core_.KeyEvent_HasModifiers(*args, **kwargs)
d55e5bfc
RD
5316
5317 def GetKeyCode(*args, **kwargs):
5ba5649b
RD
5318 """
5319 GetKeyCode(self) -> int
5320
5321 Returns the virtual key code. ASCII events return normal ASCII values,
5322 while non-ASCII events return values such as WXK_LEFT for the left
5323 cursor key. See `wx.KeyEvent` for a full list of the virtual key
5324 codes.
5325
5326 Note that in Unicode build, the returned value is meaningful only if
5327 the user entered a character that can be represented in current
5328 locale's default charset. You can obtain the corresponding Unicode
5329 character using `GetUnicodeKey`.
5330 """
5b5c9bc7 5331 return _core_.KeyEvent_GetKeyCode(*args, **kwargs)
d55e5bfc 5332
bb4524c4 5333 def GetUnicodeKey(*args, **kwargs):
5ba5649b
RD
5334 """
5335 GetUnicodeKey(self) -> int
5336
5337 Returns the Unicode character corresponding to this key event. This
5338 function is only meaningfule in a Unicode build of wxPython.
5339 """
5b5c9bc7 5340 return _core_.KeyEvent_GetUnicodeKey(*args, **kwargs)
d55e5bfc 5341
bb4524c4 5342 GetUniChar = GetUnicodeKey
b850e7f3
RD
5343 def SetUnicodeKey(*args, **kwargs):
5344 """
5345 SetUnicodeKey(self, int uniChar)
5346
5347 Set the Unicode value of the key event, but only if this is a Unicode
5348 build of wxPython.
5349 """
5350 return _core_.KeyEvent_SetUnicodeKey(*args, **kwargs)
5351
d55e5bfc 5352 def GetRawKeyCode(*args, **kwargs):
5ba5649b
RD
5353 """
5354 GetRawKeyCode(self) -> unsigned int
5355
5356 Returns the raw key code for this event. This is a platform-dependent
5357 scan code which should only be used in advanced
5358 applications. Currently the raw key codes are not supported by all
5359 ports.
5360 """
5b5c9bc7 5361 return _core_.KeyEvent_GetRawKeyCode(*args, **kwargs)
d55e5bfc
RD
5362
5363 def GetRawKeyFlags(*args, **kwargs):
5ba5649b
RD
5364 """
5365 GetRawKeyFlags(self) -> unsigned int
5366
5367 Returns the low level key flags for this event. The flags are
5368 platform-dependent and should only be used in advanced applications.
5369 Currently the raw key flags are not supported by all ports.
5370 """
5b5c9bc7 5371 return _core_.KeyEvent_GetRawKeyFlags(*args, **kwargs)
d55e5bfc
RD
5372
5373 def GetPosition(*args, **kwargs):
5374 """
5b5c9bc7 5375 GetPosition(self) -> Point
d55e5bfc 5376
5ba5649b 5377 Find the position of the event, if applicable.
d55e5bfc 5378 """
5b5c9bc7 5379 return _core_.KeyEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5380
5381 def GetPositionTuple(*args, **kwargs):
5382 """
5383 GetPositionTuple() -> (x,y)
5384
5ba5649b 5385 Find the position of the event, if applicable.
d55e5bfc 5386 """
5b5c9bc7 5387 return _core_.KeyEvent_GetPositionTuple(*args, **kwargs)
d55e5bfc
RD
5388
5389 def GetX(*args, **kwargs):
5ba5649b
RD
5390 """
5391 GetX(self) -> int
5392
5393 Returns the X position (in client coordinates) of the event, if
5394 applicable.
5395 """
5b5c9bc7 5396 return _core_.KeyEvent_GetX(*args, **kwargs)
d55e5bfc
RD
5397
5398 def GetY(*args, **kwargs):
5ba5649b
RD
5399 """
5400 GetY(self) -> int
5401
5402 Returns the Y position (in client coordinates) of the event, if
5403 applicable.
5404 """
5b5c9bc7
RD
5405 return _core_.KeyEvent_GetY(*args, **kwargs)
5406
5407 m_x = property(_core_.KeyEvent_m_x_get, _core_.KeyEvent_m_x_set)
5408 m_y = property(_core_.KeyEvent_m_y_get, _core_.KeyEvent_m_y_set)
5409 m_keyCode = property(_core_.KeyEvent_m_keyCode_get, _core_.KeyEvent_m_keyCode_set)
5410 m_controlDown = property(_core_.KeyEvent_m_controlDown_get, _core_.KeyEvent_m_controlDown_set)
5411 m_shiftDown = property(_core_.KeyEvent_m_shiftDown_get, _core_.KeyEvent_m_shiftDown_set)
5412 m_altDown = property(_core_.KeyEvent_m_altDown_get, _core_.KeyEvent_m_altDown_set)
5413 m_metaDown = property(_core_.KeyEvent_m_metaDown_get, _core_.KeyEvent_m_metaDown_set)
5414 m_scanCode = property(_core_.KeyEvent_m_scanCode_get, _core_.KeyEvent_m_scanCode_set)
5415 m_rawCode = property(_core_.KeyEvent_m_rawCode_get, _core_.KeyEvent_m_rawCode_set)
5416 m_rawFlags = property(_core_.KeyEvent_m_rawFlags_get, _core_.KeyEvent_m_rawFlags_set)
ac5d357a
RD
5417 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
5418 Modifiers = property(GetModifiers,doc="See `GetModifiers`")
5419 Position = property(GetPosition,doc="See `GetPosition`")
5420 RawKeyCode = property(GetRawKeyCode,doc="See `GetRawKeyCode`")
5421 RawKeyFlags = property(GetRawKeyFlags,doc="See `GetRawKeyFlags`")
5422 UnicodeKey = property(GetUnicodeKey,SetUnicodeKey,doc="See `GetUnicodeKey` and `SetUnicodeKey`")
5423 X = property(GetX,doc="See `GetX`")
5424 Y = property(GetY,doc="See `GetY`")
2131d850 5425_core_.KeyEvent_swigregister(KeyEvent)
d55e5bfc
RD
5426
5427#---------------------------------------------------------------------------
5428
5b5c9bc7 5429class SizeEvent(Event):
5ba5649b
RD
5430 """
5431 A size event holds information about size change events. The EVT_SIZE
5432 handler function will be called when the window it is bound to has
5433 been resized.
5434
5435 Note that the size passed is of the whole window: call
5436 `wx.Window.GetClientSize` for the area which may be used by the
5437 application.
5438
5439 When a window is resized, usually only a small part of the window is
5440 damaged and and that area is all that is in the update region for the
5441 next paint event. However, if your drawing depends on the size of the
5442 window, you may need to clear the DC explicitly and repaint the whole
5443 window. In which case, you may need to call `wx.Window.Refresh` to
5444 invalidate the entire window.
5445
5446 """
1bd55598
RD
5447 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5448 __repr__ = _swig_repr
5449 def __init__(self, *args, **kwargs):
5ba5649b
RD
5450 """
5451 __init__(self, Size sz=DefaultSize, int winid=0) -> SizeEvent
5452
5453 Construct a new ``wx.SizeEvent``.
5454 """
1bd55598 5455 _core_.SizeEvent_swiginit(self,_core_.new_SizeEvent(*args, **kwargs))
d55e5bfc 5456 def GetSize(*args, **kwargs):
5ba5649b
RD
5457 """
5458 GetSize(self) -> Size
5459
5460 Returns the entire size of the window generating the size change
5461 event.
5462 """
5b5c9bc7 5463 return _core_.SizeEvent_GetSize(*args, **kwargs)
d55e5bfc
RD
5464
5465 def GetRect(*args, **kwargs):
5b5c9bc7
RD
5466 """GetRect(self) -> Rect"""
5467 return _core_.SizeEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
5468
5469 def SetRect(*args, **kwargs):
5b5c9bc7
RD
5470 """SetRect(self, Rect rect)"""
5471 return _core_.SizeEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
5472
5473 def SetSize(*args, **kwargs):
5b5c9bc7
RD
5474 """SetSize(self, Size size)"""
5475 return _core_.SizeEvent_SetSize(*args, **kwargs)
d55e5bfc 5476
5b5c9bc7
RD
5477 m_size = property(_core_.SizeEvent_m_size_get, _core_.SizeEvent_m_size_set)
5478 m_rect = property(_core_.SizeEvent_m_rect_get, _core_.SizeEvent_m_rect_set)
33d6fd3b
RD
5479 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
5480 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
2131d850 5481_core_.SizeEvent_swigregister(SizeEvent)
d55e5bfc
RD
5482
5483#---------------------------------------------------------------------------
5484
5b5c9bc7 5485class MoveEvent(Event):
5ba5649b
RD
5486 """
5487 This event object is sent for EVT_MOVE event bindings when a window is
5488 moved to a new position.
5489 """
1bd55598
RD
5490 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5491 __repr__ = _swig_repr
5492 def __init__(self, *args, **kwargs):
5ba5649b
RD
5493 """
5494 __init__(self, Point pos=DefaultPosition, int winid=0) -> MoveEvent
5495
5496 Constructor.
5497 """
1bd55598 5498 _core_.MoveEvent_swiginit(self,_core_.new_MoveEvent(*args, **kwargs))
d55e5bfc 5499 def GetPosition(*args, **kwargs):
5ba5649b
RD
5500 """
5501 GetPosition(self) -> Point
5502
5503 Returns the position of the window generating the move change event.
5504 """
5b5c9bc7 5505 return _core_.MoveEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5506
5507 def GetRect(*args, **kwargs):
5b5c9bc7
RD
5508 """GetRect(self) -> Rect"""
5509 return _core_.MoveEvent_GetRect(*args, **kwargs)
d55e5bfc
RD
5510
5511 def SetRect(*args, **kwargs):
5b5c9bc7
RD
5512 """SetRect(self, Rect rect)"""
5513 return _core_.MoveEvent_SetRect(*args, **kwargs)
d55e5bfc
RD
5514
5515 def SetPosition(*args, **kwargs):
5b5c9bc7
RD
5516 """SetPosition(self, Point pos)"""
5517 return _core_.MoveEvent_SetPosition(*args, **kwargs)
d55e5bfc 5518
fef4c27a
RD
5519 m_pos = property(GetPosition, SetPosition)
5520 m_rect = property(GetRect, SetRect)
5521
57332a5a
RD
5522 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
5523 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
2131d850 5524_core_.MoveEvent_swigregister(MoveEvent)
d55e5bfc
RD
5525
5526#---------------------------------------------------------------------------
5527
5b5c9bc7 5528class PaintEvent(Event):
5ba5649b
RD
5529 """
5530 A paint event is sent when a window's contents needs to be repainted.
5531 Note that in an EVT_PAINT handler the application must *always* create
5532 a `wx.PaintDC` object, even if you do not use it. Otherwise MS
5533 Windows assumes that the window has not been painted yet and will send
5534 the event again, causing endless refreshes.
5535
5536 You can optimize painting by retrieving the rectangles that have been
5537 damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
5538 and only repainting these rectangles. The rectangles are in terms of
5539 the client area, and are unscrolled, so you will need to do some
5540 calculations using the current view position to obtain logical,
5541 scrolled units.
5542
5543 """
1bd55598
RD
5544 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5545 __repr__ = _swig_repr
5546 def __init__(self, *args, **kwargs):
5b5c9bc7 5547 """__init__(self, int Id=0) -> PaintEvent"""
1bd55598 5548 _core_.PaintEvent_swiginit(self,_core_.new_PaintEvent(*args, **kwargs))
2131d850 5549_core_.PaintEvent_swigregister(PaintEvent)
d55e5bfc 5550
5b5c9bc7
RD
5551class NcPaintEvent(Event):
5552 """Proxy of C++ NcPaintEvent class"""
1bd55598
RD
5553 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5554 __repr__ = _swig_repr
5555 def __init__(self, *args, **kwargs):
5b5c9bc7 5556 """__init__(self, int winid=0) -> NcPaintEvent"""
1bd55598 5557 _core_.NcPaintEvent_swiginit(self,_core_.new_NcPaintEvent(*args, **kwargs))
2131d850 5558_core_.NcPaintEvent_swigregister(NcPaintEvent)
d55e5bfc
RD
5559
5560#---------------------------------------------------------------------------
5561
5b5c9bc7 5562class EraseEvent(Event):
5ba5649b
RD
5563 """
5564 An erase event is sent whenever the background of a window needs to be
5565 repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
5566 binder. On some platforms, such as GTK+, this event is simulated
5567 (simply generated just before the paint event) and may cause flicker.
5568
5569 To paint a custom background use the `GetDC` method and use the returned
5570 device context if it is not ``None``, otherwise create a temporary
5571 `wx.ClientDC` and draw on that.
5572
5573 """
1bd55598
RD
5574 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5575 __repr__ = _swig_repr
5576 def __init__(self, *args, **kwargs):
5ba5649b
RD
5577 """
5578 __init__(self, int Id=0, DC dc=None) -> EraseEvent
5579
5580 Constructor
5581 """
1bd55598 5582 _core_.EraseEvent_swiginit(self,_core_.new_EraseEvent(*args, **kwargs))
d55e5bfc 5583 def GetDC(*args, **kwargs):
5ba5649b
RD
5584 """
5585 GetDC(self) -> DC
5586
5587 Returns the device context the event handler should draw upon. If
5588 ``None`` is returned then create a temporary `wx.ClientDC` and use
5589 that instead.
5590 """
5b5c9bc7 5591 return _core_.EraseEvent_GetDC(*args, **kwargs)
d55e5bfc 5592
ac5d357a 5593 DC = property(GetDC,doc="See `GetDC`")
2131d850 5594_core_.EraseEvent_swigregister(EraseEvent)
d55e5bfc
RD
5595
5596#---------------------------------------------------------------------------
5597
5b5c9bc7 5598class FocusEvent(Event):
5ba5649b
RD
5599 """
5600 A focus event is sent when a window's focus changes. The window losing
5601 focus receives an EVT_KILL_FOCUS event while the window gaining it
5602 gets an EVT_SET_FOCUS event.
5603
5604 Notice that the set focus event happens both when the user gives focus
5605 to the window (whether using the mouse or keyboard) and when it is
5606 done from the program itself using `wx.Window.SetFocus`.
5607
5608 """
1bd55598
RD
5609 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5610 __repr__ = _swig_repr
5611 def __init__(self, *args, **kwargs):
5ba5649b 5612 """
2131d850 5613 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> FocusEvent
5ba5649b
RD
5614
5615 Constructor
5616 """
1bd55598 5617 _core_.FocusEvent_swiginit(self,_core_.new_FocusEvent(*args, **kwargs))
d55e5bfc 5618 def GetWindow(*args, **kwargs):
5ba5649b
RD
5619 """
5620 GetWindow(self) -> Window
5621
5622 Returns the other window associated with this event, that is the
5623 window which had the focus before for the EVT_SET_FOCUS event and the
5624 window which is going to receive focus for the wxEVT_KILL_FOCUS event.
5625
5626 Warning: the window returned may be None!
5627 """
5b5c9bc7 5628 return _core_.FocusEvent_GetWindow(*args, **kwargs)
d55e5bfc
RD
5629
5630 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
5631 """SetWindow(self, Window win)"""
5632 return _core_.FocusEvent_SetWindow(*args, **kwargs)
d55e5bfc 5633
ac5d357a 5634 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 5635_core_.FocusEvent_swigregister(FocusEvent)
d55e5bfc
RD
5636
5637#---------------------------------------------------------------------------
5638
5b5c9bc7 5639class ChildFocusEvent(CommandEvent):
5ba5649b 5640 """
33d6fd3b
RD
5641 A child focus event is sent to a (parent-)window when one of its child
5642 windows gains focus, so that the window could restore the focus back
5643 to its corresponding child if it loses it now and regains later.
5644
5645 Notice that child window is the direct child of the window receiving
5646 the event, and so may not be the actual widget recieving focus if it
5647 is further down the containment heirarchy. Use `wx.Window.FindFocus`
5648 to get the widget that is actually receiving focus.
5ba5649b 5649 """
1bd55598
RD
5650 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5651 __repr__ = _swig_repr
5652 def __init__(self, *args, **kwargs):
5ba5649b
RD
5653 """
5654 __init__(self, Window win=None) -> ChildFocusEvent
5655
5656 Constructor
5657 """
1bd55598 5658 _core_.ChildFocusEvent_swiginit(self,_core_.new_ChildFocusEvent(*args, **kwargs))
d55e5bfc 5659 def GetWindow(*args, **kwargs):
5ba5649b
RD
5660 """
5661 GetWindow(self) -> Window
5662
33d6fd3b
RD
5663 The window, or (grand)parent of the window which has just received the
5664 focus.
5ba5649b 5665 """
5b5c9bc7 5666 return _core_.ChildFocusEvent_GetWindow(*args, **kwargs)
d55e5bfc 5667
2bf58437 5668 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 5669_core_.ChildFocusEvent_swigregister(ChildFocusEvent)
d55e5bfc
RD
5670
5671#---------------------------------------------------------------------------
5672
5b5c9bc7 5673class ActivateEvent(Event):
5ba5649b
RD
5674 """
5675 An activate event is sent when a top-level window or the entire
5676 application is being activated or deactivated.
5677
5678 A top-level window (a dialog or frame) receives an activate event when
5679 is being activated or deactivated. This is indicated visually by the
5680 title bar changing colour, and a subwindow gaining the keyboard focus.
5681 An application is activated or deactivated when one of its frames
5682 becomes activated, or a frame becomes inactivate resulting in all
5683 application frames being inactive.
5684
5685 Please note that usually you should call event.Skip() in your handlers
5686 for these events so the default handlers will still be called, as not
5687 doing so can result in strange effects.
5688
5689 """
1bd55598
RD
5690 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5691 __repr__ = _swig_repr
5692 def __init__(self, *args, **kwargs):
5ba5649b 5693 """
2131d850 5694 __init__(self, EventType type=wxEVT_NULL, bool active=True, int Id=0) -> ActivateEvent
5ba5649b
RD
5695
5696 Constructor
5697 """
1bd55598 5698 _core_.ActivateEvent_swiginit(self,_core_.new_ActivateEvent(*args, **kwargs))
d55e5bfc 5699 def GetActive(*args, **kwargs):
5ba5649b
RD
5700 """
5701 GetActive(self) -> bool
5702
5703 Returns true if the application or window is being activated, false
5704 otherwise.
5705 """
5b5c9bc7 5706 return _core_.ActivateEvent_GetActive(*args, **kwargs)
d55e5bfc 5707
2bf58437 5708 Active = property(GetActive,doc="See `GetActive`")
2131d850 5709_core_.ActivateEvent_swigregister(ActivateEvent)
d55e5bfc
RD
5710
5711#---------------------------------------------------------------------------
5712
5b5c9bc7 5713class InitDialogEvent(Event):
5ba5649b
RD
5714 """
5715 A wx.InitDialogEvent is sent as a dialog is being initialised, or for
5716 any window when `wx.Window.InitDialog` is called. Handlers for this
5717 event can transfer data to the window, or anything else that should be
5718 done before the user begins editing the form. The default handler
5719 calls `wx.Window.TransferDataToWindow`.
5720 """
1bd55598
RD
5721 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5722 __repr__ = _swig_repr
5723 def __init__(self, *args, **kwargs):
5ba5649b
RD
5724 """
5725 __init__(self, int Id=0) -> InitDialogEvent
5726
5727 Constructor
5728 """
1bd55598 5729 _core_.InitDialogEvent_swiginit(self,_core_.new_InitDialogEvent(*args, **kwargs))
2131d850 5730_core_.InitDialogEvent_swigregister(InitDialogEvent)
d55e5bfc
RD
5731
5732#---------------------------------------------------------------------------
5733
5b5c9bc7 5734class MenuEvent(Event):
5ba5649b
RD
5735 """
5736 This class is used for a variety of menu-related events. Note that
5737 these do not include menu command events, which are handled by sending
5738 `wx.CommandEvent` objects.
5739
5740 The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
5741 text in the first field of the status bar.
5742 """
1bd55598
RD
5743 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5744 __repr__ = _swig_repr
5745 def __init__(self, *args, **kwargs):
5ba5649b 5746 """
2131d850 5747 __init__(self, EventType type=wxEVT_NULL, int winid=0, Menu menu=None) -> MenuEvent
5ba5649b
RD
5748
5749 Constructor
5750 """
1bd55598 5751 _core_.MenuEvent_swiginit(self,_core_.new_MenuEvent(*args, **kwargs))
d55e5bfc 5752 def GetMenuId(*args, **kwargs):
5ba5649b
RD
5753 """
5754 GetMenuId(self) -> int
5755
5756 Returns the menu identifier associated with the event. This method
5757 should be only used with the HIGHLIGHT events.
5758 """
5b5c9bc7 5759 return _core_.MenuEvent_GetMenuId(*args, **kwargs)
d55e5bfc
RD
5760
5761 def IsPopup(*args, **kwargs):
5ba5649b
RD
5762 """
5763 IsPopup(self) -> bool
5764
5765 Returns ``True`` if the menu which is being opened or closed is a
5766 popup menu, ``False`` if it is a normal one. This method should only
5767 be used with the OPEN and CLOSE events.
5768 """
5b5c9bc7 5769 return _core_.MenuEvent_IsPopup(*args, **kwargs)
d55e5bfc
RD
5770
5771 def GetMenu(*args, **kwargs):
5ba5649b
RD
5772 """
5773 GetMenu(self) -> Menu
5774
5775 Returns the menu which is being opened or closed. This method should
5776 only be used with the OPEN and CLOSE events.
5777 """
5b5c9bc7 5778 return _core_.MenuEvent_GetMenu(*args, **kwargs)
d55e5bfc 5779
57332a5a
RD
5780 Menu = property(GetMenu,doc="See `GetMenu`")
5781 MenuId = property(GetMenuId,doc="See `GetMenuId`")
2131d850 5782_core_.MenuEvent_swigregister(MenuEvent)
d55e5bfc
RD
5783
5784#---------------------------------------------------------------------------
5785
5b5c9bc7 5786class CloseEvent(Event):
5ba5649b
RD
5787 """
5788 This event class contains information about window and session close
5789 events.
5790
5791 The handler function for EVT_CLOSE is called when the user has tried
5792 to close a a frame or dialog box using the window manager controls or
5793 the system menu. It can also be invoked by the application itself
5794 programmatically, for example by calling the `wx.Window.Close`
5795 function.
5796
5797 You should check whether the application is forcing the deletion of
5798 the window using `CanVeto`. If it returns ``False``, you must destroy
5799 the window using `wx.Window.Destroy`. If the return value is ``True``,
5800 it is up to you whether you respond by destroying the window or not.
5801 For example you may wish to display a message dialog prompting to save
5802 files or to cancel the close.
5803
5804 If you don't destroy the window, you should call `Veto` to let the
5805 calling code know that you did not destroy the window. This allows the
5806 `wx.Window.Close` function to return ``True`` or ``False`` depending
5807 on whether the close instruction was honored or not.
5808 """
1bd55598
RD
5809 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5810 __repr__ = _swig_repr
5811 def __init__(self, *args, **kwargs):
5ba5649b 5812 """
2131d850 5813 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> CloseEvent
5ba5649b
RD
5814
5815 Constructor.
5816 """
1bd55598 5817 _core_.CloseEvent_swiginit(self,_core_.new_CloseEvent(*args, **kwargs))
d55e5bfc 5818 def SetLoggingOff(*args, **kwargs):
5ba5649b
RD
5819 """
5820 SetLoggingOff(self, bool logOff)
5821
5822 Sets the 'logging off' flag.
5823 """
5b5c9bc7 5824 return _core_.CloseEvent_SetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5825
5826 def GetLoggingOff(*args, **kwargs):
5ba5649b
RD
5827 """
5828 GetLoggingOff(self) -> bool
5829
034e3677
RD
5830 Returns ``True`` if the user is logging off or ``False`` if the
5831 system is shutting down. This method can only be called for end
5832 session and query end session events, it doesn't make sense for close
5833 window event.
5ba5649b 5834 """
5b5c9bc7 5835 return _core_.CloseEvent_GetLoggingOff(*args, **kwargs)
d55e5bfc
RD
5836
5837 def Veto(*args, **kwargs):
5ba5649b
RD
5838 """
5839 Veto(self, bool veto=True)
5840
5841 Call this from your event handler to veto a system shutdown or to
5842 signal to the calling application that a window close did not happen.
5843
5844 You can only veto a shutdown or close if `CanVeto` returns true.
5845 """
5b5c9bc7 5846 return _core_.CloseEvent_Veto(*args, **kwargs)
d55e5bfc 5847
5ba5649b
RD
5848 def GetVeto(*args, **kwargs):
5849 """GetVeto(self) -> bool"""
5850 return _core_.CloseEvent_GetVeto(*args, **kwargs)
5851
d55e5bfc 5852 def SetCanVeto(*args, **kwargs):
5ba5649b
RD
5853 """
5854 SetCanVeto(self, bool canVeto)
5855
5856 Sets the 'can veto' flag.
5857 """
5b5c9bc7 5858 return _core_.CloseEvent_SetCanVeto(*args, **kwargs)
d55e5bfc
RD
5859
5860 def CanVeto(*args, **kwargs):
5ba5649b
RD
5861 """
5862 CanVeto(self) -> bool
d55e5bfc 5863
5ba5649b
RD
5864 Returns true if you can veto a system shutdown or a window close
5865 event. Vetoing a window close event is not possible if the calling
5866 code wishes to force the application to exit, and so this function
5867 must be called to check this.
5868 """
5869 return _core_.CloseEvent_CanVeto(*args, **kwargs)
d55e5bfc 5870
2bf58437 5871 LoggingOff = property(GetLoggingOff,SetLoggingOff,doc="See `GetLoggingOff` and `SetLoggingOff`")
2131d850 5872_core_.CloseEvent_swigregister(CloseEvent)
d55e5bfc
RD
5873
5874#---------------------------------------------------------------------------
5875
5b5c9bc7 5876class ShowEvent(Event):
5ba5649b 5877 """An EVT_SHOW event is sent when a window is shown or hidden."""
1bd55598
RD
5878 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5879 __repr__ = _swig_repr
5880 def __init__(self, *args, **kwargs):
5ba5649b
RD
5881 """
5882 __init__(self, int winid=0, bool show=False) -> ShowEvent
5883
5884 An EVT_SHOW event is sent when a window is shown or hidden.
5885 """
1bd55598 5886 _core_.ShowEvent_swiginit(self,_core_.new_ShowEvent(*args, **kwargs))
d55e5bfc
RD
5887 def SetShow(*args, **kwargs):
5888 """SetShow(self, bool show)"""
5b5c9bc7 5889 return _core_.ShowEvent_SetShow(*args, **kwargs)
d55e5bfc
RD
5890
5891 def GetShow(*args, **kwargs):
5892 """GetShow(self) -> bool"""
5b5c9bc7 5893 return _core_.ShowEvent_GetShow(*args, **kwargs)
d55e5bfc 5894
33d6fd3b 5895 Show = property(GetShow,SetShow,doc="See `GetShow` and `SetShow`")
2131d850 5896_core_.ShowEvent_swigregister(ShowEvent)
d55e5bfc
RD
5897
5898#---------------------------------------------------------------------------
5899
5b5c9bc7 5900class IconizeEvent(Event):
5ba5649b
RD
5901 """
5902 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5903 restored.
5904 """
1bd55598
RD
5905 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5906 __repr__ = _swig_repr
5907 def __init__(self, *args, **kwargs):
5ba5649b
RD
5908 """
5909 __init__(self, int id=0, bool iconized=True) -> IconizeEvent
5910
5911 An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
5912 restored.
5913 """
1bd55598 5914 _core_.IconizeEvent_swiginit(self,_core_.new_IconizeEvent(*args, **kwargs))
d55e5bfc 5915 def Iconized(*args, **kwargs):
5ba5649b
RD
5916 """
5917 Iconized(self) -> bool
5918
5919 Returns ``True`` if the frame has been iconized, ``False`` if it has
5920 been restored.
5921 """
5b5c9bc7 5922 return _core_.IconizeEvent_Iconized(*args, **kwargs)
d55e5bfc 5923
2131d850 5924_core_.IconizeEvent_swigregister(IconizeEvent)
d55e5bfc
RD
5925
5926#---------------------------------------------------------------------------
5927
5b5c9bc7 5928class MaximizeEvent(Event):
5ba5649b 5929 """An EVT_MAXIMIZE event is sent when a frame is maximized or restored."""
1bd55598
RD
5930 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5931 __repr__ = _swig_repr
5932 def __init__(self, *args, **kwargs):
5ba5649b
RD
5933 """
5934 __init__(self, int id=0) -> MaximizeEvent
5935
5936 An EVT_MAXIMIZE event is sent when a frame is maximized or restored.
5937 """
1bd55598 5938 _core_.MaximizeEvent_swiginit(self,_core_.new_MaximizeEvent(*args, **kwargs))
2131d850 5939_core_.MaximizeEvent_swigregister(MaximizeEvent)
d55e5bfc
RD
5940
5941#---------------------------------------------------------------------------
5942
5b5c9bc7 5943class DropFilesEvent(Event):
5ba5649b
RD
5944 """
5945 This class is used for drop files events, that is, when files have
5946 been dropped onto the window. This functionality is only available
5947 under Windows. The window must have previously been enabled for
5948 dropping by calling `wx.Window.DragAcceptFiles`.
5949
5950 Important note: this is a separate implementation to the more general
5951 drag and drop implementation using `wx.FileDropTarget`, and etc. This
5952 implementation uses the older, Windows message-based approach of
5953 dropping files.
5954
5955 Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
5956 events.
5957
5958 """
1bd55598
RD
5959 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
5960 def __init__(self): raise AttributeError, "No constructor defined"
5961 __repr__ = _swig_repr
d55e5bfc 5962 def GetPosition(*args, **kwargs):
5ba5649b
RD
5963 """
5964 GetPosition(self) -> Point
5965
5966 Returns the position at which the files were dropped.
5967 """
5b5c9bc7 5968 return _core_.DropFilesEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
5969
5970 def GetNumberOfFiles(*args, **kwargs):
5ba5649b
RD
5971 """
5972 GetNumberOfFiles(self) -> int
5973
5974 Returns the number of files dropped.
5975 """
5b5c9bc7 5976 return _core_.DropFilesEvent_GetNumberOfFiles(*args, **kwargs)
d55e5bfc
RD
5977
5978 def GetFiles(*args, **kwargs):
5ba5649b
RD
5979 """
5980 GetFiles(self) -> PyObject
5981
5982 Returns a list of the filenames that were dropped.
5983 """
5b5c9bc7 5984 return _core_.DropFilesEvent_GetFiles(*args, **kwargs)
d55e5bfc 5985
2bf58437
RD
5986 Files = property(GetFiles,doc="See `GetFiles`")
5987 NumberOfFiles = property(GetNumberOfFiles,doc="See `GetNumberOfFiles`")
5988 Position = property(GetPosition,doc="See `GetPosition`")
2131d850 5989_core_.DropFilesEvent_swigregister(DropFilesEvent)
d55e5bfc
RD
5990
5991#---------------------------------------------------------------------------
5992
5b5c9bc7
RD
5993UPDATE_UI_PROCESS_ALL = _core_.UPDATE_UI_PROCESS_ALL
5994UPDATE_UI_PROCESS_SPECIFIED = _core_.UPDATE_UI_PROCESS_SPECIFIED
5995class UpdateUIEvent(CommandEvent):
5ba5649b
RD
5996 """
5997 This class is used for EVT_UPDATE_UI pseudo-events which are sent by
5998 wxWidgets to give an application the chance to update various user
5999 interface elements.
6000
6001 Without update UI events, an application has to work hard to
6002 check/uncheck, enable/disable, and set the text for elements such as
6003 menu items and toolbar buttons. The code for doing this has to be
6004 mixed up with the code that is invoked when an action is invoked for a
6005 menu item or button.
6006
6007 With update UI events, you define an event handler to look at the
6008 state of the application and change UI elements accordingly. wxWidgets
6009 will call your handler functions in idle time, so you don't have to
6010 worry where to call this code. In addition to being a clearer and more
6011 declarative method, it also means you don't have to worry whether
6012 you're updating a toolbar or menubar identifier. The same handler can
6013 update a menu item and toolbar button, if the ID values are the same.
6014
6015 Instead of directly manipulating the menu or button, you call
6016 functions in the event object, such as `Check`. wxWidgets will
6017 determine whether such a call has been made, and which UI element to
6018 update.
6019
6020 These events will work for popup menus as well as menubars. Just
6021 before a menu is popped up, `wx.Menu.UpdateUI` is called to process
6022 any UI events for the window that owns the menu.
6023
6024 If you find that the overhead of UI update processing is affecting
6025 your application, you can do one or both of the following:
6026
6027 1. Call `wx.UpdateUIEvent.SetMode` with a value of
6028 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
6029 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
6030 receive update events. No other windows will receive update
6031 events.
6032
6033 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
6034 value to set the delay between updates. You may need to call
6035 `wx.Window.UpdateWindowUI` at critical points, for example when
6036 a dialog is about to be shown, in case the user sees a slight
6037 delay before windows are updated.
6038
6039 Note that although events are sent in idle time, defining a EVT_IDLE
6040 handler for a window does not affect this because the events are sent
6041 from an internal idle handler.
6042
6043 wxWidgets tries to optimize update events on some platforms. On
6044 Windows and GTK+, events for menubar items are only sent when the menu
6045 is about to be shown, and not in idle time.
6046
6047 """
1bd55598
RD
6048 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6049 __repr__ = _swig_repr
6050 def __init__(self, *args, **kwargs):
5ba5649b
RD
6051 """
6052 __init__(self, int commandId=0) -> UpdateUIEvent
6053
6054 Constructor
6055 """
1bd55598 6056 _core_.UpdateUIEvent_swiginit(self,_core_.new_UpdateUIEvent(*args, **kwargs))
d55e5bfc 6057 def GetChecked(*args, **kwargs):
5ba5649b
RD
6058 """
6059 GetChecked(self) -> bool
6060
6061 Returns ``True`` if the UI element should be checked.
6062 """
5b5c9bc7 6063 return _core_.UpdateUIEvent_GetChecked(*args, **kwargs)
d55e5bfc
RD
6064
6065 def GetEnabled(*args, **kwargs):
5ba5649b
RD
6066 """
6067 GetEnabled(self) -> bool
6068
6069 Returns ``True`` if the UI element should be enabled.
6070 """
5b5c9bc7 6071 return _core_.UpdateUIEvent_GetEnabled(*args, **kwargs)
d55e5bfc 6072
b1fcee84
RD
6073 def GetShown(*args, **kwargs):
6074 """
6075 GetShown(self) -> bool
6076
6077 Returns ``True`` if the UI element should be shown.
6078 """
6079 return _core_.UpdateUIEvent_GetShown(*args, **kwargs)
6080
d55e5bfc 6081 def GetText(*args, **kwargs):
5ba5649b
RD
6082 """
6083 GetText(self) -> String
6084
6085 Returns the text that should be set for the UI element.
6086 """
5b5c9bc7 6087 return _core_.UpdateUIEvent_GetText(*args, **kwargs)
d55e5bfc
RD
6088
6089 def GetSetText(*args, **kwargs):
5ba5649b
RD
6090 """
6091 GetSetText(self) -> bool
6092
6093 Returns ``True`` if the application has called `SetText`. For
6094 wxWidgets internal use only.
6095 """
5b5c9bc7 6096 return _core_.UpdateUIEvent_GetSetText(*args, **kwargs)
d55e5bfc
RD
6097
6098 def GetSetChecked(*args, **kwargs):
5ba5649b
RD
6099 """
6100 GetSetChecked(self) -> bool
6101
6102 Returns ``True`` if the application has called `Check`. For wxWidgets
6103 internal use only.
6104 """
5b5c9bc7 6105 return _core_.UpdateUIEvent_GetSetChecked(*args, **kwargs)
d55e5bfc
RD
6106
6107 def GetSetEnabled(*args, **kwargs):
5ba5649b
RD
6108 """
6109 GetSetEnabled(self) -> bool
6110
6111 Returns ``True`` if the application has called `Enable`. For wxWidgets
6112 internal use only.
6113 """
5b5c9bc7 6114 return _core_.UpdateUIEvent_GetSetEnabled(*args, **kwargs)
d55e5bfc 6115
b1fcee84
RD
6116 def GetSetShown(*args, **kwargs):
6117 """
6118 GetSetShown(self) -> bool
6119
6120 Returns ``True`` if the application has called `Show`. For wxWidgets
6121 internal use only.
6122 """
6123 return _core_.UpdateUIEvent_GetSetShown(*args, **kwargs)
6124
d55e5bfc 6125 def Check(*args, **kwargs):
5ba5649b
RD
6126 """
6127 Check(self, bool check)
6128
6129 Check or uncheck the UI element.
6130 """
5b5c9bc7 6131 return _core_.UpdateUIEvent_Check(*args, **kwargs)
d55e5bfc
RD
6132
6133 def Enable(*args, **kwargs):
5ba5649b
RD
6134 """
6135 Enable(self, bool enable)
6136
6137 Enable or disable the UI element.
6138 """
5b5c9bc7 6139 return _core_.UpdateUIEvent_Enable(*args, **kwargs)
d55e5bfc 6140
b1fcee84
RD
6141 def Show(*args, **kwargs):
6142 """
6143 Show(self, bool show)
6144
6145 Show or hide the UI element.
6146 """
6147 return _core_.UpdateUIEvent_Show(*args, **kwargs)
6148
d55e5bfc 6149 def SetText(*args, **kwargs):
5ba5649b
RD
6150 """
6151 SetText(self, String text)
6152
6153 Sets the text for this UI element.
6154 """
5b5c9bc7 6155 return _core_.UpdateUIEvent_SetText(*args, **kwargs)
d55e5bfc
RD
6156
6157 def SetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6158 """
6159 SetUpdateInterval(long updateInterval)
6160
6161 Sets the interval between updates in milliseconds. Set to -1 to
6162 disable updates, or to 0 to update as frequently as possible. The
6163 default is 0.
6164
6165 Use this to reduce the overhead of UI update events if your
6166 application has a lot of windows. If you set the value to -1 or
6167 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6168 at appropriate points in your application, such as when a dialog is
6169 about to be shown.
6170 """
5b5c9bc7 6171 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
6172
6173 SetUpdateInterval = staticmethod(SetUpdateInterval)
6174 def GetUpdateInterval(*args, **kwargs):
5ba5649b
RD
6175 """
6176 GetUpdateInterval() -> long
6177
6178 Returns the current interval between updates in milliseconds. -1
6179 disables updates, 0 updates as frequently as possible.
6180 """
5b5c9bc7 6181 return _core_.UpdateUIEvent_GetUpdateInterval(*args, **kwargs)
d55e5bfc
RD
6182
6183 GetUpdateInterval = staticmethod(GetUpdateInterval)
6184 def CanUpdate(*args, **kwargs):
5ba5649b
RD
6185 """
6186 CanUpdate(Window win) -> bool
6187
6188 Returns ``True`` if it is appropriate to update (send UI update events
6189 to) this window.
6190
6191 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6192 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6193 events were last sent in idle time, and the update interval, to
6194 determine whether events should be sent to this window now. By default
6195 this will always return true because the update mode is initially
6196 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6197 events will be sent as often as possible. You can reduce the frequency
6198 that events are sent by changing the mode and/or setting an update
6199 interval.
6200
6201 """
5b5c9bc7 6202 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc
RD
6203
6204 CanUpdate = staticmethod(CanUpdate)
6205 def ResetUpdateTime(*args, **kwargs):
5ba5649b
RD
6206 """
6207 ResetUpdateTime()
6208
6209 Used internally to reset the last-updated time to the current time. It
6210 is assumed that update events are normally sent in idle time, so this
6211 is called at the end of idle processing.
6212 """
5b5c9bc7 6213 return _core_.UpdateUIEvent_ResetUpdateTime(*args, **kwargs)
d55e5bfc
RD
6214
6215 ResetUpdateTime = staticmethod(ResetUpdateTime)
6216 def SetMode(*args, **kwargs):
5ba5649b
RD
6217 """
6218 SetMode(int mode)
6219
6220 Specify how wxWidgets will send update events: to all windows, or only
6221 to those which specify that they will process the events.
6222
6223 The mode may be one of the following values:
6224
6225 ============================= ==========================================
6226 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6227 is the default setting.
6228 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6229 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6230 style set.
6231 ============================= ==========================================
6232
6233 """
5b5c9bc7 6234 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
6235
6236 SetMode = staticmethod(SetMode)
6237 def GetMode(*args, **kwargs):
5ba5649b
RD
6238 """
6239 GetMode() -> int
6240
6241 Returns a value specifying how wxWidgets will send update events: to
6242 all windows, or only to those which specify that they will process the
6243 events.
6244 """
5b5c9bc7 6245 return _core_.UpdateUIEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6246
6247 GetMode = staticmethod(GetMode)
dba7934c
RD
6248 Checked = property(GetChecked,Check,doc="See `GetChecked`")
6249 Enabled = property(GetEnabled,Enable,doc="See `GetEnabled`")
6250 Shown = property(GetShown,Show,doc="See `GetShown`")
6251 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
2131d850 6252_core_.UpdateUIEvent_swigregister(UpdateUIEvent)
d55e5bfc 6253
5b5c9bc7 6254def UpdateUIEvent_SetUpdateInterval(*args, **kwargs):
1bd55598 6255 """
5ba5649b
RD
6256 UpdateUIEvent_SetUpdateInterval(long updateInterval)
6257
6258 Sets the interval between updates in milliseconds. Set to -1 to
6259 disable updates, or to 0 to update as frequently as possible. The
6260 default is 0.
6261
6262 Use this to reduce the overhead of UI update events if your
6263 application has a lot of windows. If you set the value to -1 or
6264 greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
6265 at appropriate points in your application, such as when a dialog is
6266 about to be shown.
6267 """
1bd55598 6268 return _core_.UpdateUIEvent_SetUpdateInterval(*args, **kwargs)
d55e5bfc 6269
1bd55598
RD
6270def UpdateUIEvent_GetUpdateInterval(*args):
6271 """
5ba5649b
RD
6272 UpdateUIEvent_GetUpdateInterval() -> long
6273
6274 Returns the current interval between updates in milliseconds. -1
6275 disables updates, 0 updates as frequently as possible.
6276 """
1bd55598 6277 return _core_.UpdateUIEvent_GetUpdateInterval(*args)
d55e5bfc 6278
5b5c9bc7 6279def UpdateUIEvent_CanUpdate(*args, **kwargs):
1bd55598 6280 """
5ba5649b
RD
6281 UpdateUIEvent_CanUpdate(Window win) -> bool
6282
6283 Returns ``True`` if it is appropriate to update (send UI update events
6284 to) this window.
6285
6286 This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
6287 the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
6288 events were last sent in idle time, and the update interval, to
6289 determine whether events should be sent to this window now. By default
6290 this will always return true because the update mode is initially
6291 wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
6292 events will be sent as often as possible. You can reduce the frequency
6293 that events are sent by changing the mode and/or setting an update
6294 interval.
6295
6296 """
1bd55598 6297 return _core_.UpdateUIEvent_CanUpdate(*args, **kwargs)
d55e5bfc 6298
1bd55598
RD
6299def UpdateUIEvent_ResetUpdateTime(*args):
6300 """
5ba5649b
RD
6301 UpdateUIEvent_ResetUpdateTime()
6302
6303 Used internally to reset the last-updated time to the current time. It
6304 is assumed that update events are normally sent in idle time, so this
6305 is called at the end of idle processing.
6306 """
1bd55598 6307 return _core_.UpdateUIEvent_ResetUpdateTime(*args)
d55e5bfc 6308
5b5c9bc7 6309def UpdateUIEvent_SetMode(*args, **kwargs):
1bd55598 6310 """
5ba5649b
RD
6311 UpdateUIEvent_SetMode(int mode)
6312
6313 Specify how wxWidgets will send update events: to all windows, or only
6314 to those which specify that they will process the events.
6315
6316 The mode may be one of the following values:
6317
6318 ============================= ==========================================
6319 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
6320 is the default setting.
6321 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
6322 have the wx.WS_EX_PROCESS_UI_UPDATES extra
6323 style set.
6324 ============================= ==========================================
6325
6326 """
1bd55598 6327 return _core_.UpdateUIEvent_SetMode(*args, **kwargs)
d55e5bfc 6328
1bd55598
RD
6329def UpdateUIEvent_GetMode(*args):
6330 """
5ba5649b
RD
6331 UpdateUIEvent_GetMode() -> int
6332
6333 Returns a value specifying how wxWidgets will send update events: to
6334 all windows, or only to those which specify that they will process the
6335 events.
6336 """
1bd55598 6337 return _core_.UpdateUIEvent_GetMode(*args)
d55e5bfc
RD
6338
6339#---------------------------------------------------------------------------
6340
5b5c9bc7 6341class SysColourChangedEvent(Event):
5ba5649b
RD
6342 """
6343 This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
6344 when the user changes the colour settings using the control
6345 panel. This is only applicable under Windows.
6346
6347 The default event handler for this event propagates the event to child
6348 windows, since Windows only sends the events to top-level windows. If
6349 intercepting this event for a top-level window, remember to call
6350 `Skip` so the the base class handler will still be executed, or to
6351 pass the event on to the window's children explicitly.
6352
6353 """
1bd55598
RD
6354 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6355 __repr__ = _swig_repr
6356 def __init__(self, *args, **kwargs):
5ba5649b
RD
6357 """
6358 __init__(self) -> SysColourChangedEvent
6359
6360 Constructor
6361 """
1bd55598 6362 _core_.SysColourChangedEvent_swiginit(self,_core_.new_SysColourChangedEvent(*args, **kwargs))
2131d850 6363_core_.SysColourChangedEvent_swigregister(SysColourChangedEvent)
d55e5bfc
RD
6364
6365#---------------------------------------------------------------------------
6366
5b5c9bc7 6367class MouseCaptureChangedEvent(Event):
5ba5649b
RD
6368 """
6369 An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
6370 a window that loses its mouse capture. This is called even if
6371 `wx.Window.ReleaseMouse` was called by the application code. Handling
6372 this event allows an application to cater for unexpected capture
6373 releases which might otherwise confuse mouse handling code.
6374
6375 This event is implemented under Windows only.
6376 """
1bd55598
RD
6377 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6378 __repr__ = _swig_repr
6379 def __init__(self, *args, **kwargs):
5ba5649b
RD
6380 """
6381 __init__(self, int winid=0, Window gainedCapture=None) -> MouseCaptureChangedEvent
6382
6383 Constructor
6384 """
1bd55598 6385 _core_.MouseCaptureChangedEvent_swiginit(self,_core_.new_MouseCaptureChangedEvent(*args, **kwargs))
d55e5bfc 6386 def GetCapturedWindow(*args, **kwargs):
5ba5649b
RD
6387 """
6388 GetCapturedWindow(self) -> Window
6389
6390 Returns the window that gained the capture, or ``None`` if it was a
6391 non-wxWidgets window.
6392 """
5b5c9bc7 6393 return _core_.MouseCaptureChangedEvent_GetCapturedWindow(*args, **kwargs)
d55e5bfc 6394
57332a5a 6395 CapturedWindow = property(GetCapturedWindow,doc="See `GetCapturedWindow`")
2131d850 6396_core_.MouseCaptureChangedEvent_swigregister(MouseCaptureChangedEvent)
d55e5bfc
RD
6397
6398#---------------------------------------------------------------------------
6399
34e0a3bb
RD
6400class MouseCaptureLostEvent(Event):
6401 """
6402 A mouse capture lost event is sent to a window that obtained mouse
6403 capture, which was subsequently loss due to "external" event, for
6404 example when a dialog box is shown or if another application captures
6405 the mouse.
6406
6407 If this happens, this event is sent to all windows that are on the
6408 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6409 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6410 if the capture changes because of a call to CaptureMouse or
6411 ReleaseMouse.
6412
6413 This event is currently emitted under Windows only.
6414
6415 """
6416 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6417 __repr__ = _swig_repr
6418 def __init__(self, *args, **kwargs):
6419 """
6420 __init__(self, int winid=0) -> MouseCaptureLostEvent
6421
6422 A mouse capture lost event is sent to a window that obtained mouse
6423 capture, which was subsequently loss due to "external" event, for
6424 example when a dialog box is shown or if another application captures
6425 the mouse.
6426
6427 If this happens, this event is sent to all windows that are on the
6428 capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
6429 didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
6430 if the capture changes because of a call to CaptureMouse or
6431 ReleaseMouse.
6432
6433 This event is currently emitted under Windows only.
6434
6435 """
6436 _core_.MouseCaptureLostEvent_swiginit(self,_core_.new_MouseCaptureLostEvent(*args, **kwargs))
6437_core_.MouseCaptureLostEvent_swigregister(MouseCaptureLostEvent)
6438
6439#---------------------------------------------------------------------------
6440
5b5c9bc7 6441class DisplayChangedEvent(Event):
5ba5649b
RD
6442 """
6443 An EVT_DISPLAY_CHANGED event is sent to all windows when the display
6444 resolution has changed.
6445
6446 This event is implemented under Windows only.
6447 """
1bd55598
RD
6448 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6449 __repr__ = _swig_repr
6450 def __init__(self, *args, **kwargs):
5b5c9bc7 6451 """__init__(self) -> DisplayChangedEvent"""
1bd55598 6452 _core_.DisplayChangedEvent_swiginit(self,_core_.new_DisplayChangedEvent(*args, **kwargs))
2131d850 6453_core_.DisplayChangedEvent_swigregister(DisplayChangedEvent)
d55e5bfc
RD
6454
6455#---------------------------------------------------------------------------
6456
5b5c9bc7 6457class PaletteChangedEvent(Event):
5ba5649b
RD
6458 """
6459 An EVT_PALETTE_CHANGED event is sent when the system palette has
6460 changed, thereby giving each window a chance to redo their own to
6461 match.
6462
6463 This event is implemented under Windows only.
6464 """
1bd55598
RD
6465 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6466 __repr__ = _swig_repr
6467 def __init__(self, *args, **kwargs):
5ba5649b
RD
6468 """
6469 __init__(self, int id=0) -> PaletteChangedEvent
6470
6471 An EVT_PALETTE_CHANGED event is sent when the system palette has
6472 changed, thereby giving each window a chance to redo their own to
6473 match.
6474
6475 This event is implemented under Windows only.
6476 """
1bd55598 6477 _core_.PaletteChangedEvent_swiginit(self,_core_.new_PaletteChangedEvent(*args, **kwargs))
d55e5bfc 6478 def SetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
6479 """SetChangedWindow(self, Window win)"""
6480 return _core_.PaletteChangedEvent_SetChangedWindow(*args, **kwargs)
d55e5bfc
RD
6481
6482 def GetChangedWindow(*args, **kwargs):
5b5c9bc7
RD
6483 """GetChangedWindow(self) -> Window"""
6484 return _core_.PaletteChangedEvent_GetChangedWindow(*args, **kwargs)
d55e5bfc 6485
33d6fd3b 6486 ChangedWindow = property(GetChangedWindow,SetChangedWindow,doc="See `GetChangedWindow` and `SetChangedWindow`")
2131d850 6487_core_.PaletteChangedEvent_swigregister(PaletteChangedEvent)
d55e5bfc
RD
6488
6489#---------------------------------------------------------------------------
6490
5b5c9bc7 6491class QueryNewPaletteEvent(Event):
5ba5649b
RD
6492 """
6493 An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
6494 focus and should re-do its palette.
6495
6496 This event is implemented under Windows only.
6497 """
1bd55598
RD
6498 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6499 __repr__ = _swig_repr
6500 def __init__(self, *args, **kwargs):
5ba5649b
RD
6501 """
6502 __init__(self, int winid=0) -> QueryNewPaletteEvent
6503
6504 Constructor.
6505 """
1bd55598 6506 _core_.QueryNewPaletteEvent_swiginit(self,_core_.new_QueryNewPaletteEvent(*args, **kwargs))
d55e5bfc 6507 def SetPaletteRealized(*args, **kwargs):
5ba5649b
RD
6508 """
6509 SetPaletteRealized(self, bool realized)
6510
6511 App should set this if it changes the palette.
6512 """
5b5c9bc7 6513 return _core_.QueryNewPaletteEvent_SetPaletteRealized(*args, **kwargs)
d55e5bfc
RD
6514
6515 def GetPaletteRealized(*args, **kwargs):
6516 """GetPaletteRealized(self) -> bool"""
5b5c9bc7 6517 return _core_.QueryNewPaletteEvent_GetPaletteRealized(*args, **kwargs)
d55e5bfc 6518
33d6fd3b 6519 PaletteRealized = property(GetPaletteRealized,SetPaletteRealized,doc="See `GetPaletteRealized` and `SetPaletteRealized`")
2131d850 6520_core_.QueryNewPaletteEvent_swigregister(QueryNewPaletteEvent)
d55e5bfc
RD
6521
6522#---------------------------------------------------------------------------
6523
5b5c9bc7 6524class NavigationKeyEvent(Event):
5ba5649b
RD
6525 """
6526 EVT_NAVIGATION_KEY events are used to control moving the focus between
6527 widgets, otherwise known as tab-traversal. You woudl normally not
6528 catch navigation events in applications as there are already
6529 appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
6530 it useful to send navigation events in certain situations to change
6531 the focus in certain ways, although it's probably easier to just call
6532 `wx.Window.Navigate`.
6533 """
1bd55598
RD
6534 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6535 __repr__ = _swig_repr
6536 def __init__(self, *args, **kwargs):
5b5c9bc7 6537 """__init__(self) -> NavigationKeyEvent"""
1bd55598 6538 _core_.NavigationKeyEvent_swiginit(self,_core_.new_NavigationKeyEvent(*args, **kwargs))
d55e5bfc 6539 def GetDirection(*args, **kwargs):
5ba5649b
RD
6540 """
6541 GetDirection(self) -> bool
6542
6543 Returns ``True`` if the direction is forward, ``False`` otherwise.
6544 """
5b5c9bc7 6545 return _core_.NavigationKeyEvent_GetDirection(*args, **kwargs)
d55e5bfc
RD
6546
6547 def SetDirection(*args, **kwargs):
5ba5649b
RD
6548 """
6549 SetDirection(self, bool forward)
6550
6551 Specify the direction that the navigation should take. Usually the
6552 difference between using Tab and Shift-Tab.
6553 """
5b5c9bc7 6554 return _core_.NavigationKeyEvent_SetDirection(*args, **kwargs)
d55e5bfc
RD
6555
6556 def IsWindowChange(*args, **kwargs):
5ba5649b
RD
6557 """
6558 IsWindowChange(self) -> bool
6559
6560 Returns ``True`` if window change is allowed.
6561 """
5b5c9bc7 6562 return _core_.NavigationKeyEvent_IsWindowChange(*args, **kwargs)
d55e5bfc
RD
6563
6564 def SetWindowChange(*args, **kwargs):
5ba5649b
RD
6565 """
6566 SetWindowChange(self, bool ischange)
6567
6568 Specify if the navigation should be able to change parent windows.
6569 For example, changing notebook pages, etc. This is usually implemented
6570 by using Control-Tab.
6571 """
5b5c9bc7 6572 return _core_.NavigationKeyEvent_SetWindowChange(*args, **kwargs)
d55e5bfc 6573
68350608 6574 def IsFromTab(*args, **kwargs):
5ba5649b
RD
6575 """
6576 IsFromTab(self) -> bool
6577
6578 Returns ``True`` if the navigation event is originated from the Tab
6579 key.
6580 """
5b5c9bc7 6581 return _core_.NavigationKeyEvent_IsFromTab(*args, **kwargs)
68350608
RD
6582
6583 def SetFromTab(*args, **kwargs):
5ba5649b
RD
6584 """
6585 SetFromTab(self, bool bIs)
6586
6587 Set to true under MSW if the event was generated using the tab key.
6588 This is required for proper navogation over radio buttons.
6589 """
5b5c9bc7 6590 return _core_.NavigationKeyEvent_SetFromTab(*args, **kwargs)
68350608 6591
908b74cd 6592 def SetFlags(*args, **kwargs):
5ba5649b
RD
6593 """
6594 SetFlags(self, long flags)
6595
6596 Set the navigation flags to a combination of the following:
6597
6598 * wx.NavigationKeyEvent.IsBackward
6599 * wx.NavigationKeyEvent.IsForward
6600 * wx.NavigationKeyEvent.WinChange
6601 * wx.NavigationKeyEvent.FromTab
6602
6603 """
5b5c9bc7 6604 return _core_.NavigationKeyEvent_SetFlags(*args, **kwargs)
908b74cd 6605
d55e5bfc 6606 def GetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6607 """
6608 GetCurrentFocus(self) -> Window
6609
6610 Returns the child window which currenty has the focus. May be
6611 ``None``.
6612 """
5b5c9bc7 6613 return _core_.NavigationKeyEvent_GetCurrentFocus(*args, **kwargs)
d55e5bfc
RD
6614
6615 def SetCurrentFocus(*args, **kwargs):
5ba5649b
RD
6616 """
6617 SetCurrentFocus(self, Window win)
6618
6619 Set the window that has the focus.
6620 """
5b5c9bc7 6621 return _core_.NavigationKeyEvent_SetCurrentFocus(*args, **kwargs)
d55e5bfc 6622
5b5c9bc7
RD
6623 IsBackward = _core_.NavigationKeyEvent_IsBackward
6624 IsForward = _core_.NavigationKeyEvent_IsForward
6625 WinChange = _core_.NavigationKeyEvent_WinChange
6626 FromTab = _core_.NavigationKeyEvent_FromTab
57332a5a
RD
6627 CurrentFocus = property(GetCurrentFocus,SetCurrentFocus,doc="See `GetCurrentFocus` and `SetCurrentFocus`")
6628 Direction = property(GetDirection,SetDirection,doc="See `GetDirection` and `SetDirection`")
2131d850 6629_core_.NavigationKeyEvent_swigregister(NavigationKeyEvent)
d55e5bfc
RD
6630
6631#---------------------------------------------------------------------------
6632
5b5c9bc7 6633class WindowCreateEvent(CommandEvent):
5ba5649b
RD
6634 """
6635 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6636 underlying GUI object) exists.
6637 """
1bd55598
RD
6638 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6639 __repr__ = _swig_repr
6640 def __init__(self, *args, **kwargs):
5ba5649b
RD
6641 """
6642 __init__(self, Window win=None) -> WindowCreateEvent
6643
6644 The EVT_WINDOW_CREATE event is sent as soon as the window object (the
6645 underlying GUI object) exists.
6646 """
1bd55598 6647 _core_.WindowCreateEvent_swiginit(self,_core_.new_WindowCreateEvent(*args, **kwargs))
d55e5bfc 6648 def GetWindow(*args, **kwargs):
5ba5649b
RD
6649 """
6650 GetWindow(self) -> Window
6651
6652 Returns the window that this event refers to.
6653 """
5b5c9bc7 6654 return _core_.WindowCreateEvent_GetWindow(*args, **kwargs)
d55e5bfc 6655
dba7934c 6656 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6657_core_.WindowCreateEvent_swigregister(WindowCreateEvent)
d55e5bfc 6658
5b5c9bc7 6659class WindowDestroyEvent(CommandEvent):
5ba5649b 6660 """
943e8dfd
RD
6661 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6662 when the GUI window is destroyed.
6663
6664 When a class derived from `wx.Window` is destroyed its destructor will
6665 have already run by the time this event is sent. Therefore this event
6666 will not usually be received at all by the window itself. Since it is
6667 received after the destructor has run, an object should not try to
6668 handle its own wx.WindowDestroyEvent, but it can be used to get
6669 notification of the destruction of another window.
5ba5649b 6670 """
1bd55598
RD
6671 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6672 __repr__ = _swig_repr
6673 def __init__(self, *args, **kwargs):
5ba5649b
RD
6674 """
6675 __init__(self, Window win=None) -> WindowDestroyEvent
6676
943e8dfd
RD
6677 The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
6678 when the GUI window is destroyed.
6679
6680 When a class derived from `wx.Window` is destroyed its destructor will
6681 have already run by the time this event is sent. Therefore this event
6682 will not usually be received at all by the window itself. Since it is
6683 received after the destructor has run, an object should not try to
6684 handle its own wx.WindowDestroyEvent, but it can be used to get
6685 notification of the destruction of another window.
5ba5649b 6686 """
1bd55598 6687 _core_.WindowDestroyEvent_swiginit(self,_core_.new_WindowDestroyEvent(*args, **kwargs))
d55e5bfc 6688 def GetWindow(*args, **kwargs):
5ba5649b
RD
6689 """
6690 GetWindow(self) -> Window
6691
6692 Returns the window that this event refers to.
6693 """
5b5c9bc7 6694 return _core_.WindowDestroyEvent_GetWindow(*args, **kwargs)
d55e5bfc 6695
dba7934c 6696 Window = property(GetWindow,doc="See `GetWindow`")
2131d850 6697_core_.WindowDestroyEvent_swigregister(WindowDestroyEvent)
d55e5bfc
RD
6698
6699#---------------------------------------------------------------------------
6700
5b5c9bc7 6701class ContextMenuEvent(CommandEvent):
5ba5649b
RD
6702 """
6703 This class is used for context menu events (EVT_CONTECT_MENU,) sent to
6704 give the application a chance to show a context (popup) menu.
6705 """
1bd55598
RD
6706 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6707 __repr__ = _swig_repr
6708 def __init__(self, *args, **kwargs):
5ba5649b 6709 """
2131d850 6710 __init__(self, EventType type=wxEVT_NULL, int winid=0, Point pt=DefaultPosition) -> ContextMenuEvent
5ba5649b
RD
6711
6712 Constructor.
6713 """
1bd55598 6714 _core_.ContextMenuEvent_swiginit(self,_core_.new_ContextMenuEvent(*args, **kwargs))
d55e5bfc 6715 def GetPosition(*args, **kwargs):
5ba5649b
RD
6716 """
6717 GetPosition(self) -> Point
6718
6719 Returns the position (in screen coordinants) at which the menu should
6720 be shown.
6721 """
5b5c9bc7 6722 return _core_.ContextMenuEvent_GetPosition(*args, **kwargs)
d55e5bfc
RD
6723
6724 def SetPosition(*args, **kwargs):
5ba5649b
RD
6725 """
6726 SetPosition(self, Point pos)
6727
6728 Sets the position at which the menu should be shown.
6729 """
5b5c9bc7 6730 return _core_.ContextMenuEvent_SetPosition(*args, **kwargs)
d55e5bfc 6731
2bf58437 6732 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
2131d850 6733_core_.ContextMenuEvent_swigregister(ContextMenuEvent)
d55e5bfc
RD
6734
6735#---------------------------------------------------------------------------
6736
5b5c9bc7
RD
6737IDLE_PROCESS_ALL = _core_.IDLE_PROCESS_ALL
6738IDLE_PROCESS_SPECIFIED = _core_.IDLE_PROCESS_SPECIFIED
6739class IdleEvent(Event):
5ba5649b
RD
6740 """
6741 This class is used for EVT_IDLE events, which are generated and sent
6742 when the application *becomes* idle. In other words, the when the
6743 event queue becomes empty then idle events are sent to all windows (by
6744 default) and as long as none of them call `RequestMore` then there are
6745 no more idle events until after the system event queue has some normal
6746 events and then becomes empty again.
6747
6748 By default, idle events are sent to all windows. If this is causing a
6749 significant overhead in your application, you can call
6750 `wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
6751 set the wx.WS_EX_PROCESS_IDLE extra window style for every window
6752 which should receive idle events. Then idle events will only be sent
6753 to those windows and not to any others.
6754 """
1bd55598
RD
6755 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6756 __repr__ = _swig_repr
6757 def __init__(self, *args, **kwargs):
5ba5649b
RD
6758 """
6759 __init__(self) -> IdleEvent
6760
6761 Constructor
6762 """
1bd55598 6763 _core_.IdleEvent_swiginit(self,_core_.new_IdleEvent(*args, **kwargs))
d55e5bfc 6764 def RequestMore(*args, **kwargs):
5ba5649b
RD
6765 """
6766 RequestMore(self, bool needMore=True)
6767
6768 Tells wxWidgets that more processing is required. This function can be
6769 called by an EVT_IDLE handler for a window to indicate that the
6770 application should forward the EVT_IDLE event once more to the
6771 application windows. If no window calls this function during its
6772 EVT_IDLE handler, then the application will remain in a passive event
6773 loop until a new event is posted to the application by the windowing
6774 system.
6775 """
5b5c9bc7 6776 return _core_.IdleEvent_RequestMore(*args, **kwargs)
d55e5bfc
RD
6777
6778 def MoreRequested(*args, **kwargs):
5ba5649b
RD
6779 """
6780 MoreRequested(self) -> bool
6781
6782 Returns ``True`` if the OnIdle function processing this event
6783 requested more processing time.
6784 """
5b5c9bc7 6785 return _core_.IdleEvent_MoreRequested(*args, **kwargs)
d55e5bfc
RD
6786
6787 def SetMode(*args, **kwargs):
5ba5649b
RD
6788 """
6789 SetMode(int mode)
6790
6791 Static method for specifying how wxWidgets will send idle events: to
6792 all windows, or only to those which specify that they will process the
6793 events.
6794
6795 The mode can be one of the following values:
6796
6797 ========================= ========================================
6798 wx.IDLE_PROCESS_ALL Send idle events to all windows
6799 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6800 the wx.WS_EX_PROCESS_IDLE extra style
6801 flag set.
6802 ========================= ========================================
6803
6804 """
5b5c9bc7 6805 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc
RD
6806
6807 SetMode = staticmethod(SetMode)
6808 def GetMode(*args, **kwargs):
5ba5649b
RD
6809 """
6810 GetMode() -> int
6811
6812 Static method returning a value specifying how wxWidgets will send
6813 idle events: to all windows, or only to those which specify that they
6814 will process the events.
6815 """
5b5c9bc7 6816 return _core_.IdleEvent_GetMode(*args, **kwargs)
d55e5bfc
RD
6817
6818 GetMode = staticmethod(GetMode)
6819 def CanSend(*args, **kwargs):
5ba5649b
RD
6820 """
6821 CanSend(Window win) -> bool
6822
6823 Returns ``True`` if it is appropriate to send idle events to this
6824 window.
6825
6826 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6827 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6828 events should be sent to this window now. By default this will always
6829 return ``True`` because the update mode is initially
6830 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6831 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6832 """
5b5c9bc7 6833 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6834
6835 CanSend = staticmethod(CanSend)
2131d850 6836_core_.IdleEvent_swigregister(IdleEvent)
d55e5bfc 6837
5b5c9bc7 6838def IdleEvent_SetMode(*args, **kwargs):
1bd55598 6839 """
5ba5649b
RD
6840 IdleEvent_SetMode(int mode)
6841
6842 Static method for specifying how wxWidgets will send idle events: to
6843 all windows, or only to those which specify that they will process the
6844 events.
6845
6846 The mode can be one of the following values:
6847
6848 ========================= ========================================
6849 wx.IDLE_PROCESS_ALL Send idle events to all windows
6850 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
6851 the wx.WS_EX_PROCESS_IDLE extra style
6852 flag set.
6853 ========================= ========================================
6854
6855 """
1bd55598 6856 return _core_.IdleEvent_SetMode(*args, **kwargs)
d55e5bfc 6857
1bd55598
RD
6858def IdleEvent_GetMode(*args):
6859 """
5ba5649b
RD
6860 IdleEvent_GetMode() -> int
6861
6862 Static method returning a value specifying how wxWidgets will send
6863 idle events: to all windows, or only to those which specify that they
6864 will process the events.
6865 """
1bd55598 6866 return _core_.IdleEvent_GetMode(*args)
d55e5bfc 6867
5b5c9bc7 6868def IdleEvent_CanSend(*args, **kwargs):
1bd55598 6869 """
5ba5649b
RD
6870 IdleEvent_CanSend(Window win) -> bool
6871
6872 Returns ``True`` if it is appropriate to send idle events to this
6873 window.
6874
6875 This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
6876 the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
6877 events should be sent to this window now. By default this will always
6878 return ``True`` because the update mode is initially
6879 wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
6880 to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.
6881 """
1bd55598 6882 return _core_.IdleEvent_CanSend(*args, **kwargs)
d55e5bfc
RD
6883
6884#---------------------------------------------------------------------------
6885
2131d850
RD
6886class ClipboardTextEvent(CommandEvent):
6887 """
6888 A Clipboard Text event is sent when a window intercepts a text
6889 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6890 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6891 popup menu command, etc. NOTE : under windows these events are *NOT*
6892 generated automatically for a Rich Edit text control.
6893 """
6894 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6895 __repr__ = _swig_repr
6896 def __init__(self, *args, **kwargs):
6897 """
6898 __init__(self, EventType type=wxEVT_NULL, int winid=0) -> ClipboardTextEvent
6899
6900 A Clipboard Text event is sent when a window intercepts a text
6901 copy/cut/paste message, i.e. the user has cut/copied/pasted data
6902 from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
6903 popup menu command, etc. NOTE : under windows these events are *NOT*
6904 generated automatically for a Rich Edit text control.
6905 """
6906 _core_.ClipboardTextEvent_swiginit(self,_core_.new_ClipboardTextEvent(*args, **kwargs))
6907_core_.ClipboardTextEvent_swigregister(ClipboardTextEvent)
6908
6909#---------------------------------------------------------------------------
6910
5b5c9bc7 6911class PyEvent(Event):
5ba5649b
RD
6912 """
6913 wx.PyEvent can be used as a base class for implementing custom event
6914 types in Python. You should derived from this class instead of
6915 `wx.Event` because this class is Python-aware and is able to transport
6916 its Python bits safely through the wxWidgets event system and have
6917 them still be there when the event handler is invoked.
6918
6919 :see: `wx.PyCommandEvent`
6920
6921 """
1bd55598
RD
6922 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6923 __repr__ = _swig_repr
6924 def __init__(self, *args, **kwargs):
2131d850 6925 """__init__(self, int winid=0, EventType eventType=wxEVT_NULL) -> PyEvent"""
1bd55598 6926 _core_.PyEvent_swiginit(self,_core_.new_PyEvent(*args, **kwargs))
5ba5649b 6927 self._SetSelf(self)
d55e5bfc 6928
1bd55598
RD
6929 __swig_destroy__ = _core_.delete_PyEvent
6930 __del__ = lambda self : None;
5ba5649b
RD
6931 def _SetSelf(*args, **kwargs):
6932 """_SetSelf(self, PyObject self)"""
6933 return _core_.PyEvent__SetSelf(*args, **kwargs)
d55e5bfc 6934
5ba5649b
RD
6935 def _GetSelf(*args, **kwargs):
6936 """_GetSelf(self) -> PyObject"""
6937 return _core_.PyEvent__GetSelf(*args, **kwargs)
d55e5bfc 6938
2131d850 6939_core_.PyEvent_swigregister(PyEvent)
d55e5bfc 6940
5b5c9bc7 6941class PyCommandEvent(CommandEvent):
5ba5649b
RD
6942 """
6943 wx.PyCommandEvent can be used as a base class for implementing custom
6944 event types in Python, where the event shoudl travel up to parent
6945 windows looking for a handler. You should derived from this class
6946 instead of `wx.CommandEvent` because this class is Python-aware and is
6947 able to transport its Python bits safely through the wxWidgets event
6948 system and have them still be there when the event handler is invoked.
6949
6950 :see: `wx.PyEvent`
6951
6952 """
1bd55598
RD
6953 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6954 __repr__ = _swig_repr
6955 def __init__(self, *args, **kwargs):
2131d850 6956 """__init__(self, EventType eventType=wxEVT_NULL, int id=0) -> PyCommandEvent"""
1bd55598 6957 _core_.PyCommandEvent_swiginit(self,_core_.new_PyCommandEvent(*args, **kwargs))
5ba5649b 6958 self._SetSelf(self)
d55e5bfc 6959
1bd55598
RD
6960 __swig_destroy__ = _core_.delete_PyCommandEvent
6961 __del__ = lambda self : None;
5ba5649b
RD
6962 def _SetSelf(*args, **kwargs):
6963 """_SetSelf(self, PyObject self)"""
6964 return _core_.PyCommandEvent__SetSelf(*args, **kwargs)
d55e5bfc 6965
5ba5649b
RD
6966 def _GetSelf(*args, **kwargs):
6967 """_GetSelf(self) -> PyObject"""
6968 return _core_.PyCommandEvent__GetSelf(*args, **kwargs)
d55e5bfc 6969
2131d850 6970_core_.PyCommandEvent_swigregister(PyCommandEvent)
d55e5bfc 6971
5b5c9bc7 6972class DateEvent(CommandEvent):
5ba5649b
RD
6973 """
6974 This event class holds information about a date change event and is
6975 used together with `wx.DatePickerCtrl`. It also serves as a base class
6976 for `wx.calendar.CalendarEvent`. Bind these event types with
6977 EVT_DATE_CHANGED.
6978 """
1bd55598
RD
6979 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
6980 __repr__ = _swig_repr
6981 def __init__(self, *args, **kwargs):
2131d850 6982 """__init__(self, Window win, DateTime dt, EventType type) -> DateEvent"""
1bd55598 6983 _core_.DateEvent_swiginit(self,_core_.new_DateEvent(*args, **kwargs))
53aa7709 6984 def GetDate(*args, **kwargs):
5ba5649b
RD
6985 """
6986 GetDate(self) -> DateTime
6987
6988 Returns the date.
6989 """
5b5c9bc7 6990 return _core_.DateEvent_GetDate(*args, **kwargs)
53aa7709
RD
6991
6992 def SetDate(*args, **kwargs):
5ba5649b
RD
6993 """
6994 SetDate(self, DateTime date)
6995
6996 Sets the date carried by the event, normally only used by the library
6997 internally.
6998 """
5b5c9bc7 6999 return _core_.DateEvent_SetDate(*args, **kwargs)
53aa7709 7000
2bf58437 7001 Date = property(GetDate,SetDate,doc="See `GetDate` and `SetDate`")
2131d850 7002_core_.DateEvent_swigregister(DateEvent)
53aa7709 7003
5b5c9bc7 7004wxEVT_DATE_CHANGED = _core_.wxEVT_DATE_CHANGED
53aa7709
RD
7005EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
7006
4976f996
RD
7007class EventBlocker(EvtHandler):
7008 """Helper class to temporarily disable event handling for a window."""
7009 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7010 __repr__ = _swig_repr
7011 def __init__(self, *args, **kwargs):
7012 """
7013 __init__(self, Window win, EventType type=wxEVT_ANY) -> EventBlocker
7014
7015 Helper class to temporarily disable event handling for a window.
7016 """
7017 _core_.EventBlocker_swiginit(self,_core_.new_EventBlocker(*args, **kwargs))
7018 __swig_destroy__ = _core_.delete_EventBlocker
7019 __del__ = lambda self : None;
7020 def Block(*args, **kwargs):
7021 """Block(self, EventType type)"""
7022 return _core_.EventBlocker_Block(*args, **kwargs)
7023
7024_core_.EventBlocker_swigregister(EventBlocker)
7025
d55e5bfc
RD
7026#---------------------------------------------------------------------------
7027
5b5c9bc7
RD
7028PYAPP_ASSERT_SUPPRESS = _core_.PYAPP_ASSERT_SUPPRESS
7029PYAPP_ASSERT_EXCEPTION = _core_.PYAPP_ASSERT_EXCEPTION
7030PYAPP_ASSERT_DIALOG = _core_.PYAPP_ASSERT_DIALOG
7031PYAPP_ASSERT_LOG = _core_.PYAPP_ASSERT_LOG
7032PRINT_WINDOWS = _core_.PRINT_WINDOWS
7033PRINT_POSTSCRIPT = _core_.PRINT_POSTSCRIPT
7034class PyApp(EvtHandler):
d6c14a4c
RD
7035 """
7036 The ``wx.PyApp`` class is an *implementation detail*, please use the
7037 `wx.App` class (or some other derived class) instead.
7038 """
1bd55598
RD
7039 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7040 __repr__ = _swig_repr
7041 def __init__(self, *args, **kwargs):
d55e5bfc 7042 """
5b5c9bc7 7043 __init__(self) -> PyApp
d55e5bfc
RD
7044
7045 Create a new application object, starting the bootstrap process.
7046 """
1bd55598 7047 _core_.PyApp_swiginit(self,_core_.new_PyApp(*args, **kwargs))
c25f90f6 7048 self._setOORInfo(self, False);PyApp._setCallbackInfo(self, self, PyApp)
d55e5bfc 7049
1bd55598
RD
7050 __swig_destroy__ = _core_.delete_PyApp
7051 __del__ = lambda self : None;
d55e5bfc 7052 def _setCallbackInfo(*args, **kwargs):
c25f90f6 7053 """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref=False)"""
5b5c9bc7 7054 return _core_.PyApp__setCallbackInfo(*args, **kwargs)
d55e5bfc
RD
7055
7056 def GetAppName(*args, **kwargs):
7057 """
5b5c9bc7 7058 GetAppName(self) -> String
d55e5bfc
RD
7059
7060 Get the application name.
7061 """
5b5c9bc7 7062 return _core_.PyApp_GetAppName(*args, **kwargs)
d55e5bfc
RD
7063
7064 def SetAppName(*args, **kwargs):
7065 """
5b5c9bc7 7066 SetAppName(self, String name)
d55e5bfc 7067
d6c14a4c
RD
7068 Set the application name. This value may be used automatically by
7069 `wx.Config` and such.
d55e5bfc 7070 """
5b5c9bc7 7071 return _core_.PyApp_SetAppName(*args, **kwargs)
d55e5bfc
RD
7072
7073 def GetClassName(*args, **kwargs):
7074 """
5b5c9bc7 7075 GetClassName(self) -> String
d55e5bfc
RD
7076
7077 Get the application's class name.
7078 """
5b5c9bc7 7079 return _core_.PyApp_GetClassName(*args, **kwargs)
d55e5bfc
RD
7080
7081 def SetClassName(*args, **kwargs):
7082 """
5b5c9bc7 7083 SetClassName(self, String name)
d55e5bfc 7084
d6c14a4c
RD
7085 Set the application's class name. This value may be used for
7086 X-resources if applicable for the platform
d55e5bfc 7087 """
5b5c9bc7 7088 return _core_.PyApp_SetClassName(*args, **kwargs)
d55e5bfc
RD
7089
7090 def GetVendorName(*args, **kwargs):
7091 """
5b5c9bc7 7092 GetVendorName(self) -> String
d55e5bfc
RD
7093
7094 Get the application's vendor name.
7095 """
5b5c9bc7 7096 return _core_.PyApp_GetVendorName(*args, **kwargs)
d55e5bfc
RD
7097
7098 def SetVendorName(*args, **kwargs):
7099 """
5b5c9bc7 7100 SetVendorName(self, String name)
d55e5bfc 7101
d6c14a4c
RD
7102 Set the application's vendor name. This value may be used
7103 automatically by `wx.Config` and such.
d55e5bfc 7104 """
5b5c9bc7 7105 return _core_.PyApp_SetVendorName(*args, **kwargs)
d55e5bfc
RD
7106
7107 def GetTraits(*args, **kwargs):
7108 """
7109 GetTraits(self) -> wxAppTraits
7110
d6c14a4c
RD
7111 Return (and create if necessary) the app traits object to which we
7112 delegate for everything which either should be configurable by the
7113 user (then he can change the default behaviour simply by overriding
7114 CreateTraits() and returning his own traits object) or which is
7115 GUI/console dependent as then wx.AppTraits allows us to abstract the
7116 differences behind the common facade.
7117
7118 :todo: Add support for overriding CreateAppTraits in wxPython.
d55e5bfc 7119 """
5b5c9bc7 7120 return _core_.PyApp_GetTraits(*args, **kwargs)
d55e5bfc
RD
7121
7122 def ProcessPendingEvents(*args, **kwargs):
7123 """
7124 ProcessPendingEvents(self)
7125
d6c14a4c
RD
7126 Process all events in the Pending Events list -- it is necessary to
7127 call this function to process posted events. This normally happens
7128 during each event loop iteration.
d55e5bfc 7129 """
5b5c9bc7 7130 return _core_.PyApp_ProcessPendingEvents(*args, **kwargs)
d55e5bfc
RD
7131
7132 def Yield(*args, **kwargs):
7133 """
7134 Yield(self, bool onlyIfNeeded=False) -> bool
7135
d6c14a4c
RD
7136 Process all currently pending events right now, instead of waiting
7137 until return to the event loop. It is an error to call ``Yield``
7138 recursively unless the value of ``onlyIfNeeded`` is True.
d55e5bfc 7139
d6c14a4c 7140 :warning: This function is dangerous as it can lead to unexpected
15817c7e
RD
7141 reentrancies (i.e. when called from an event handler it may
7142 result in calling the same event handler again), use with
7143 extreme care or, better, don't use at all!
d55e5bfc 7144
d6c14a4c 7145 :see: `wx.Yield`, `wx.YieldIfNeeded`, `wx.SafeYield`
15817c7e 7146
d55e5bfc 7147 """
5b5c9bc7 7148 return _core_.PyApp_Yield(*args, **kwargs)
d55e5bfc
RD
7149
7150 def WakeUpIdle(*args, **kwargs):
7151 """
7152 WakeUpIdle(self)
7153
d6c14a4c
RD
7154 Make sure that idle events are sent again.
7155 :see: `wx.WakeUpIdle`
d55e5bfc 7156 """
5b5c9bc7 7157 return _core_.PyApp_WakeUpIdle(*args, **kwargs)
d55e5bfc 7158
84f85550
RD
7159 def IsMainLoopRunning(*args, **kwargs):
7160 """
7161 IsMainLoopRunning() -> bool
7162
7163 Returns True if we're running the main loop, i.e. if the events can
7164 currently be dispatched.
7165 """
5b5c9bc7 7166 return _core_.PyApp_IsMainLoopRunning(*args, **kwargs)
84f85550
RD
7167
7168 IsMainLoopRunning = staticmethod(IsMainLoopRunning)
d55e5bfc
RD
7169 def MainLoop(*args, **kwargs):
7170 """
7171 MainLoop(self) -> int
7172
d6c14a4c
RD
7173 Execute the main GUI loop, the function doesn't normally return until
7174 all top level windows have been closed and destroyed.
d55e5bfc 7175 """
5b5c9bc7 7176 return _core_.PyApp_MainLoop(*args, **kwargs)
d55e5bfc
RD
7177
7178 def Exit(*args, **kwargs):
7179 """
7180 Exit(self)
7181
7182 Exit the main loop thus terminating the application.
d6c14a4c 7183 :see: `wx.Exit`
d55e5bfc 7184 """
5b5c9bc7 7185 return _core_.PyApp_Exit(*args, **kwargs)
d55e5bfc 7186
ac5d357a
RD
7187 def GetLayoutDirection(*args, **kwargs):
7188 """
994453b8 7189 GetLayoutDirection(self) -> int
ac5d357a
RD
7190
7191 Return the layout direction for the current locale.
7192 """
7193 return _core_.PyApp_GetLayoutDirection(*args, **kwargs)
7194
d55e5bfc
RD
7195 def ExitMainLoop(*args, **kwargs):
7196 """
7197 ExitMainLoop(self)
7198
d6c14a4c
RD
7199 Exit the main GUI loop during the next iteration of the main
7200 loop, (i.e. it does not stop the program immediately!)
d55e5bfc 7201 """
5b5c9bc7 7202 return _core_.PyApp_ExitMainLoop(*args, **kwargs)
d55e5bfc
RD
7203
7204 def Pending(*args, **kwargs):
7205 """
7206 Pending(self) -> bool
7207
7208 Returns True if there are unprocessed events in the event queue.
7209 """
5b5c9bc7 7210 return _core_.PyApp_Pending(*args, **kwargs)
d55e5bfc
RD
7211
7212 def Dispatch(*args, **kwargs):
7213 """
7214 Dispatch(self) -> bool
7215
7216 Process the first event in the event queue (blocks until an event
7217 appears if there are none currently)
7218 """
5b5c9bc7 7219 return _core_.PyApp_Dispatch(*args, **kwargs)
d55e5bfc
RD
7220
7221 def ProcessIdle(*args, **kwargs):
7222 """
7223 ProcessIdle(self) -> bool
7224
d6c14a4c
RD
7225 Called from the MainLoop when the application becomes idle (there are
7226 no pending events) and sends a `wx.IdleEvent` to all interested
7227 parties. Returns True if more idle events are needed, False if not.
d55e5bfc 7228 """
5b5c9bc7 7229 return _core_.PyApp_ProcessIdle(*args, **kwargs)
d55e5bfc
RD
7230
7231 def SendIdleEvents(*args, **kwargs):
7232 """
5b5c9bc7 7233 SendIdleEvents(self, Window win, IdleEvent event) -> bool
d55e5bfc 7234
d6c14a4c
RD
7235 Send idle event to window and all subwindows. Returns True if more
7236 idle time is requested.
d55e5bfc 7237 """
5b5c9bc7 7238 return _core_.PyApp_SendIdleEvents(*args, **kwargs)
d55e5bfc
RD
7239
7240 def IsActive(*args, **kwargs):
7241 """
7242 IsActive(self) -> bool
7243
7244 Return True if our app has focus.
7245 """
5b5c9bc7 7246 return _core_.PyApp_IsActive(*args, **kwargs)
d55e5bfc
RD
7247
7248 def SetTopWindow(*args, **kwargs):
7249 """
5b5c9bc7 7250 SetTopWindow(self, Window win)
d55e5bfc 7251
d6c14a4c 7252 Set the *main* top level window
d55e5bfc 7253 """
5b5c9bc7 7254 return _core_.PyApp_SetTopWindow(*args, **kwargs)
d55e5bfc
RD
7255
7256 def GetTopWindow(*args, **kwargs):
7257 """
5b5c9bc7 7258 GetTopWindow(self) -> Window
d55e5bfc 7259
d6c14a4c
RD
7260 Return the *main* top level window (if it hadn't been set previously
7261 with SetTopWindow(), will return just some top level window and, if
7262 there not any, will return None)
d55e5bfc 7263 """
5b5c9bc7 7264 return _core_.PyApp_GetTopWindow(*args, **kwargs)
d55e5bfc
RD
7265
7266 def SetExitOnFrameDelete(*args, **kwargs):
7267 """
7268 SetExitOnFrameDelete(self, bool flag)
7269
d6c14a4c
RD
7270 Control the exit behaviour: by default, the program will exit the main
7271 loop (and so, usually, terminate) when the last top-level program
7272 window is deleted. Beware that if you disable this behaviour (with
7273 SetExitOnFrameDelete(False)), you'll have to call ExitMainLoop()
7274 explicitly from somewhere.
d55e5bfc 7275 """
5b5c9bc7 7276 return _core_.PyApp_SetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
7277
7278 def GetExitOnFrameDelete(*args, **kwargs):
7279 """
7280 GetExitOnFrameDelete(self) -> bool
7281
7282 Get the current exit behaviour setting.
7283 """
5b5c9bc7 7284 return _core_.PyApp_GetExitOnFrameDelete(*args, **kwargs)
d55e5bfc
RD
7285
7286 def SetUseBestVisual(*args, **kwargs):
7287 """
eccab1a7 7288 SetUseBestVisual(self, bool flag, bool forceTrueColour=False)
d55e5bfc 7289
d6c14a4c
RD
7290 Set whether the app should try to use the best available visual on
7291 systems where more than one is available, (Sun, SGI, XFree86 4, etc.)
d55e5bfc 7292 """
5b5c9bc7 7293 return _core_.PyApp_SetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
7294
7295 def GetUseBestVisual(*args, **kwargs):
7296 """
7297 GetUseBestVisual(self) -> bool
7298
7299 Get current UseBestVisual setting.
7300 """
5b5c9bc7 7301 return _core_.PyApp_GetUseBestVisual(*args, **kwargs)
d55e5bfc
RD
7302
7303 def SetPrintMode(*args, **kwargs):
7304 """SetPrintMode(self, int mode)"""
5b5c9bc7 7305 return _core_.PyApp_SetPrintMode(*args, **kwargs)
d55e5bfc
RD
7306
7307 def GetPrintMode(*args, **kwargs):
7308 """GetPrintMode(self) -> int"""
5b5c9bc7 7309 return _core_.PyApp_GetPrintMode(*args, **kwargs)
d55e5bfc
RD
7310
7311 def SetAssertMode(*args, **kwargs):
7312 """
7313 SetAssertMode(self, int mode)
7314
15817c7e 7315 Set the OnAssert behaviour for debug and hybrid builds.
d55e5bfc 7316 """
5b5c9bc7 7317 return _core_.PyApp_SetAssertMode(*args, **kwargs)
d55e5bfc
RD
7318
7319 def GetAssertMode(*args, **kwargs):
7320 """
7321 GetAssertMode(self) -> int
7322
7323 Get the current OnAssert behaviour setting.
7324 """
5b5c9bc7 7325 return _core_.PyApp_GetAssertMode(*args, **kwargs)
d55e5bfc
RD
7326
7327 def GetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 7328 """GetMacSupportPCMenuShortcuts() -> bool"""
5b5c9bc7 7329 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7330
7331 GetMacSupportPCMenuShortcuts = staticmethod(GetMacSupportPCMenuShortcuts)
7332 def GetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 7333 """GetMacAboutMenuItemId() -> long"""
5b5c9bc7 7334 return _core_.PyApp_GetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7335
7336 GetMacAboutMenuItemId = staticmethod(GetMacAboutMenuItemId)
7337 def GetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 7338 """GetMacPreferencesMenuItemId() -> long"""
5b5c9bc7 7339 return _core_.PyApp_GetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7340
7341 GetMacPreferencesMenuItemId = staticmethod(GetMacPreferencesMenuItemId)
7342 def GetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 7343 """GetMacExitMenuItemId() -> long"""
5b5c9bc7 7344 return _core_.PyApp_GetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7345
7346 GetMacExitMenuItemId = staticmethod(GetMacExitMenuItemId)
7347 def GetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
7348 """GetMacHelpMenuTitleName() -> String"""
7349 return _core_.PyApp_GetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
7350
7351 GetMacHelpMenuTitleName = staticmethod(GetMacHelpMenuTitleName)
7352 def SetMacSupportPCMenuShortcuts(*args, **kwargs):
d6c14a4c 7353 """SetMacSupportPCMenuShortcuts(bool val)"""
5b5c9bc7 7354 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc
RD
7355
7356 SetMacSupportPCMenuShortcuts = staticmethod(SetMacSupportPCMenuShortcuts)
7357 def SetMacAboutMenuItemId(*args, **kwargs):
d6c14a4c 7358 """SetMacAboutMenuItemId(long val)"""
5b5c9bc7 7359 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc
RD
7360
7361 SetMacAboutMenuItemId = staticmethod(SetMacAboutMenuItemId)
7362 def SetMacPreferencesMenuItemId(*args, **kwargs):
d6c14a4c 7363 """SetMacPreferencesMenuItemId(long val)"""
5b5c9bc7 7364 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc
RD
7365
7366 SetMacPreferencesMenuItemId = staticmethod(SetMacPreferencesMenuItemId)
7367 def SetMacExitMenuItemId(*args, **kwargs):
d6c14a4c 7368 """SetMacExitMenuItemId(long val)"""
5b5c9bc7 7369 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc
RD
7370
7371 SetMacExitMenuItemId = staticmethod(SetMacExitMenuItemId)
7372 def SetMacHelpMenuTitleName(*args, **kwargs):
5b5c9bc7
RD
7373 """SetMacHelpMenuTitleName(String val)"""
7374 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc
RD
7375
7376 SetMacHelpMenuTitleName = staticmethod(SetMacHelpMenuTitleName)
7377 def _BootstrapApp(*args, **kwargs):
7378 """
7379 _BootstrapApp(self)
7380
7381 For internal use only
7382 """
5b5c9bc7 7383 return _core_.PyApp__BootstrapApp(*args, **kwargs)
d55e5bfc
RD
7384
7385 def GetComCtl32Version(*args, **kwargs):
7386 """
d6c14a4c 7387 GetComCtl32Version() -> int
d55e5bfc 7388
d6c14a4c
RD
7389 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7390 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 7391 """
5b5c9bc7 7392 return _core_.PyApp_GetComCtl32Version(*args, **kwargs)
d55e5bfc
RD
7393
7394 GetComCtl32Version = staticmethod(GetComCtl32Version)
33d6fd3b 7395 def IsDisplayAvailable(*args, **kwargs):
fc46b7f3 7396 """
33d6fd3b 7397 IsDisplayAvailable() -> bool
fc46b7f3
RD
7398
7399 Tests if it is possible to create a GUI in the current environment.
7400 This will mean different things on the different platforms.
7401
7402 * On X Windows systems this function will return ``False`` if it is
7403 not able to open a connection to the X display, which can happen
7404 if $DISPLAY is not set, or is not set correctly.
7405
7406 * On Mac OS X a ``False`` return value will mean that wx is not
7407 able to access the window manager, which can happen if logged in
7408 remotely or if running from the normal version of python instead
7409 of the framework version, (i.e., pythonw.)
7410
7411 * On MS Windows...
7412
7413 """
33d6fd3b
RD
7414 return _core_.PyApp_IsDisplayAvailable(*args, **kwargs)
7415
7416 IsDisplayAvailable = staticmethod(IsDisplayAvailable)
7417 AppName = property(GetAppName,SetAppName,doc="See `GetAppName` and `SetAppName`")
7418 AssertMode = property(GetAssertMode,SetAssertMode,doc="See `GetAssertMode` and `SetAssertMode`")
7419 ClassName = property(GetClassName,SetClassName,doc="See `GetClassName` and `SetClassName`")
7420 ExitOnFrameDelete = property(GetExitOnFrameDelete,SetExitOnFrameDelete,doc="See `GetExitOnFrameDelete` and `SetExitOnFrameDelete`")
7421 LayoutDirection = property(GetLayoutDirection,doc="See `GetLayoutDirection`")
7422 PrintMode = property(GetPrintMode,SetPrintMode,doc="See `GetPrintMode` and `SetPrintMode`")
7423 TopWindow = property(GetTopWindow,SetTopWindow,doc="See `GetTopWindow` and `SetTopWindow`")
7424 Traits = property(GetTraits,doc="See `GetTraits`")
7425 UseBestVisual = property(GetUseBestVisual,SetUseBestVisual,doc="See `GetUseBestVisual` and `SetUseBestVisual`")
7426 VendorName = property(GetVendorName,SetVendorName,doc="See `GetVendorName` and `SetVendorName`")
7427 Active = property(IsActive)
2131d850 7428_core_.PyApp_swigregister(PyApp)
d55e5bfc 7429
1bd55598
RD
7430def PyApp_IsMainLoopRunning(*args):
7431 """
5b5c9bc7 7432 PyApp_IsMainLoopRunning() -> bool
84f85550
RD
7433
7434 Returns True if we're running the main loop, i.e. if the events can
7435 currently be dispatched.
7436 """
1bd55598 7437 return _core_.PyApp_IsMainLoopRunning(*args)
84f85550 7438
1bd55598
RD
7439def PyApp_GetMacSupportPCMenuShortcuts(*args):
7440 """PyApp_GetMacSupportPCMenuShortcuts() -> bool"""
7441 return _core_.PyApp_GetMacSupportPCMenuShortcuts(*args)
d55e5bfc 7442
1bd55598
RD
7443def PyApp_GetMacAboutMenuItemId(*args):
7444 """PyApp_GetMacAboutMenuItemId() -> long"""
7445 return _core_.PyApp_GetMacAboutMenuItemId(*args)
d55e5bfc 7446
1bd55598
RD
7447def PyApp_GetMacPreferencesMenuItemId(*args):
7448 """PyApp_GetMacPreferencesMenuItemId() -> long"""
7449 return _core_.PyApp_GetMacPreferencesMenuItemId(*args)
d55e5bfc 7450
1bd55598
RD
7451def PyApp_GetMacExitMenuItemId(*args):
7452 """PyApp_GetMacExitMenuItemId() -> long"""
7453 return _core_.PyApp_GetMacExitMenuItemId(*args)
d55e5bfc 7454
1bd55598
RD
7455def PyApp_GetMacHelpMenuTitleName(*args):
7456 """PyApp_GetMacHelpMenuTitleName() -> String"""
7457 return _core_.PyApp_GetMacHelpMenuTitleName(*args)
d55e5bfc 7458
5b5c9bc7 7459def PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs):
1bd55598
RD
7460 """PyApp_SetMacSupportPCMenuShortcuts(bool val)"""
7461 return _core_.PyApp_SetMacSupportPCMenuShortcuts(*args, **kwargs)
d55e5bfc 7462
5b5c9bc7 7463def PyApp_SetMacAboutMenuItemId(*args, **kwargs):
1bd55598
RD
7464 """PyApp_SetMacAboutMenuItemId(long val)"""
7465 return _core_.PyApp_SetMacAboutMenuItemId(*args, **kwargs)
d55e5bfc 7466
5b5c9bc7 7467def PyApp_SetMacPreferencesMenuItemId(*args, **kwargs):
1bd55598
RD
7468 """PyApp_SetMacPreferencesMenuItemId(long val)"""
7469 return _core_.PyApp_SetMacPreferencesMenuItemId(*args, **kwargs)
d55e5bfc 7470
5b5c9bc7 7471def PyApp_SetMacExitMenuItemId(*args, **kwargs):
1bd55598
RD
7472 """PyApp_SetMacExitMenuItemId(long val)"""
7473 return _core_.PyApp_SetMacExitMenuItemId(*args, **kwargs)
d55e5bfc 7474
5b5c9bc7 7475def PyApp_SetMacHelpMenuTitleName(*args, **kwargs):
1bd55598
RD
7476 """PyApp_SetMacHelpMenuTitleName(String val)"""
7477 return _core_.PyApp_SetMacHelpMenuTitleName(*args, **kwargs)
d55e5bfc 7478
1bd55598
RD
7479def PyApp_GetComCtl32Version(*args):
7480 """
5b5c9bc7 7481 PyApp_GetComCtl32Version() -> int
d55e5bfc 7482
d6c14a4c
RD
7483 Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if
7484 it wasn't found at all. Raises an exception on non-Windows platforms.
d55e5bfc 7485 """
1bd55598 7486 return _core_.PyApp_GetComCtl32Version(*args)
d55e5bfc 7487
33d6fd3b 7488def PyApp_IsDisplayAvailable(*args):
fc46b7f3 7489 """
33d6fd3b 7490 PyApp_IsDisplayAvailable() -> bool
fc46b7f3
RD
7491
7492 Tests if it is possible to create a GUI in the current environment.
7493 This will mean different things on the different platforms.
7494
7495 * On X Windows systems this function will return ``False`` if it is
7496 not able to open a connection to the X display, which can happen
7497 if $DISPLAY is not set, or is not set correctly.
7498
7499 * On Mac OS X a ``False`` return value will mean that wx is not
7500 able to access the window manager, which can happen if logged in
7501 remotely or if running from the normal version of python instead
7502 of the framework version, (i.e., pythonw.)
7503
7504 * On MS Windows...
7505
7506 """
33d6fd3b 7507 return _core_.PyApp_IsDisplayAvailable(*args)
fc46b7f3 7508
d55e5bfc
RD
7509#---------------------------------------------------------------------------
7510
7511
1bd55598
RD
7512def Exit(*args):
7513 """
5b5c9bc7 7514 Exit()
d55e5bfc
RD
7515
7516 Force an exit of the application. Convenience for wx.GetApp().Exit()
7517 """
1bd55598 7518 return _core_.Exit(*args)
d55e5bfc 7519
1bd55598
RD
7520def Yield(*args):
7521 """
5b5c9bc7 7522 Yield() -> bool
d55e5bfc
RD
7523
7524 Yield to other apps/messages. Convenience for wx.GetApp().Yield()
7525 """
1bd55598 7526 return _core_.Yield(*args)
d55e5bfc 7527
1bd55598
RD
7528def YieldIfNeeded(*args):
7529 """
5b5c9bc7 7530 YieldIfNeeded() -> bool
d55e5bfc
RD
7531
7532 Yield to other apps/messages. Convenience for wx.GetApp().Yield(True)
7533 """
1bd55598 7534 return _core_.YieldIfNeeded(*args)
d55e5bfc 7535
5b5c9bc7 7536def SafeYield(*args, **kwargs):
1bd55598 7537 """
5b5c9bc7 7538 SafeYield(Window win=None, bool onlyIfNeeded=False) -> bool
d55e5bfc 7539
d6c14a4c
RD
7540 This function is similar to `wx.Yield`, except that it disables the
7541 user input to all program windows before calling `wx.Yield` and
7542 re-enables it again afterwards. If ``win`` is not None, this window
7543 will remain enabled, allowing the implementation of some limited user
7544 interaction.
d55e5bfc 7545
d6c14a4c 7546 :Returns: the result of the call to `wx.Yield`.
d55e5bfc 7547 """
1bd55598 7548 return _core_.SafeYield(*args, **kwargs)
d55e5bfc 7549
1bd55598
RD
7550def WakeUpIdle(*args):
7551 """
5b5c9bc7 7552 WakeUpIdle()
d55e5bfc 7553
d6c14a4c
RD
7554 Cause the message queue to become empty again, so idle events will be
7555 sent.
d55e5bfc 7556 """
1bd55598 7557 return _core_.WakeUpIdle(*args)
d55e5bfc 7558
5b5c9bc7 7559def PostEvent(*args, **kwargs):
1bd55598 7560 """
5b5c9bc7 7561 PostEvent(EvtHandler dest, Event event)
d55e5bfc 7562
d6c14a4c
RD
7563 Send an event to a window or other wx.EvtHandler to be processed
7564 later.
d55e5bfc 7565 """
1bd55598 7566 return _core_.PostEvent(*args, **kwargs)
d55e5bfc 7567
1bd55598
RD
7568def App_CleanUp(*args):
7569 """
5b5c9bc7 7570 App_CleanUp()
d55e5bfc 7571
15817c7e 7572 For internal use only, it is used to cleanup after wxWidgets when
d6c14a4c 7573 Python shuts down.
d55e5bfc 7574 """
1bd55598 7575 return _core_.App_CleanUp(*args)
d55e5bfc 7576
1bd55598
RD
7577def GetApp(*args):
7578 """
5b5c9bc7 7579 GetApp() -> PyApp
d55e5bfc
RD
7580
7581 Return a reference to the current wx.App object.
7582 """
1bd55598 7583 return _core_.GetApp(*args)
5cbf236d 7584
5b5c9bc7 7585def SetDefaultPyEncoding(*args, **kwargs):
1bd55598 7586 """
5cbf236d
RD
7587 SetDefaultPyEncoding(string encoding)
7588
7589 Sets the encoding that wxPython will use when it needs to convert a
7590 Python string or unicode object to or from a wxString.
62d32a5f
RD
7591
7592 The default encoding is the value of ``locale.getdefaultlocale()[1]``
7593 but please be aware that the default encoding within the same locale
7594 may be slightly different on different platforms. For example, please
7595 see http://www.alanwood.net/demos/charsetdiffs.html for differences
7596 between the common latin/roman encodings.
5cbf236d 7597 """
1bd55598 7598 return _core_.SetDefaultPyEncoding(*args, **kwargs)
5cbf236d 7599
1bd55598
RD
7600def GetDefaultPyEncoding(*args):
7601 """
5cbf236d
RD
7602 GetDefaultPyEncoding() -> string
7603
7604 Gets the current encoding that wxPython will use when it needs to
7605 convert a Python string or unicode object to or from a wxString.
7606 """
1bd55598 7607 return _core_.GetDefaultPyEncoding(*args)
d55e5bfc
RD
7608#----------------------------------------------------------------------
7609
7610class PyOnDemandOutputWindow:
7611 """
7612 A class that can be used for redirecting Python's stdout and
7613 stderr streams. It will do nothing until something is wrriten to
7614 the stream at which point it will create a Frame with a text area
7615 and write the text there.
7616 """
7617 def __init__(self, title = "wxPython: stdout/stderr"):
7618 self.frame = None
7619 self.title = title
412d302d
RD
7620 self.pos = wx.DefaultPosition
7621 self.size = (450, 300)
d55e5bfc
RD
7622 self.parent = None
7623
7624 def SetParent(self, parent):
7625 """Set the window to be used as the popup Frame's parent."""
7626 self.parent = parent
7627
7628
7629 def CreateOutputWindow(self, st):
412d302d
RD
7630 self.frame = wx.Frame(self.parent, -1, self.title, self.pos, self.size,
7631 style=wx.DEFAULT_FRAME_STYLE)
d55e5bfc 7632 self.text = wx.TextCtrl(self.frame, -1, "",
412d302d 7633 style=wx.TE_MULTILINE|wx.TE_READONLY)
d55e5bfc 7634 self.text.AppendText(st)
d55e5bfc 7635 self.frame.Show(True)
2131d850 7636 self.frame.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
d55e5bfc
RD
7637
7638
7639 def OnCloseWindow(self, event):
7640 if self.frame is not None:
7641 self.frame.Destroy()
7642 self.frame = None
7643 self.text = None
7644
7645
7646 # These methods provide the file-like output behaviour.
7647 def write(self, text):
7648 """
7649 Create the output window if needed and write the string to it.
7650 If not called in the context of the gui thread then uses
7651 CallAfter to do the work there.
7652 """
7653 if self.frame is None:
7654 if not wx.Thread_IsMain():
7655 wx.CallAfter(self.CreateOutputWindow, text)
7656 else:
7657 self.CreateOutputWindow(text)
7658 else:
7659 if not wx.Thread_IsMain():
7660 wx.CallAfter(self.text.AppendText, text)
7661 else:
7662 self.text.AppendText(text)
7663
7664
7665 def close(self):
7666 if self.frame is not None:
7667 wx.CallAfter(self.frame.Close)
7668
7669
bb4524c4
RD
7670 def flush(self):
7671 pass
7672
7673
d55e5bfc
RD
7674
7675#----------------------------------------------------------------------
7676
7677_defRedirect = (wx.Platform == '__WXMSW__' or wx.Platform == '__WXMAC__')
fc46b7f3 7678
d55e5bfc
RD
7679class App(wx.PyApp):
7680 """
d6c14a4c
RD
7681 The ``wx.App`` class represents the application and is used to:
7682
7683 * bootstrap the wxPython system and initialize the underlying
7684 gui toolkit
7685 * set and get application-wide properties
7686 * implement the windowing system main message or event loop,
7687 and to dispatch events to window instances
7688 * etc.
7689
7690 Every application must have a ``wx.App`` instance, and all
7691 creation of UI objects should be delayed until after the
7692 ``wx.App`` object has been created in order to ensure that the gui
7693 platform and wxWidgets have been fully initialized.
7694
7695 Normally you would derive from this class and implement an
7696 ``OnInit`` method that creates a frame and then calls
7697 ``self.SetTopWindow(frame)``.
7698
7699 :see: `wx.PySimpleApp` for a simpler app class that can be used
15817c7e 7700 directly.
d55e5bfc 7701 """
d6c14a4c 7702
d55e5bfc
RD
7703 outputWindowClass = PyOnDemandOutputWindow
7704
d6c14a4c
RD
7705 def __init__(self, redirect=_defRedirect, filename=None,
7706 useBestVisual=False, clearSigInt=True):
7707 """
7708 Construct a ``wx.App`` object.
7709
7710 :param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
7711 redirected? Defaults to True on Windows and Mac, False
7712 otherwise. If `filename` is None then output will be
7713 redirected to a window that pops up as needed. (You can
7714 control what kind of window is created for the output by
7715 resetting the class variable ``outputWindowClass`` to a
7716 class of your choosing.)
7717
7718 :param filename: The name of a file to redirect output to, if
7719 redirect is True.
7720
7721 :param useBestVisual: Should the app try to use the best
7722 available visual provided by the system (only relevant on
7723 systems that have more than one visual.) This parameter
7724 must be used instead of calling `SetUseBestVisual` later
7725 on because it must be set before the underlying GUI
7726 toolkit is initialized.
7727
7728 :param clearSigInt: Should SIGINT be cleared? This allows the
7729 app to terminate upon a Ctrl-C in the console like other
7730 GUI apps will.
7731
7732 :note: You should override OnInit to do applicaition
7733 initialization to ensure that the system, toolkit and
7734 wxWidgets are fully initialized.
7735 """
fc46b7f3 7736
d55e5bfc
RD
7737 wx.PyApp.__init__(self)
7738
fc46b7f3 7739 # make sure we can create a GUI
33d6fd3b 7740 if not self.IsDisplayAvailable():
fc46b7f3
RD
7741
7742 if wx.Platform == "__WXMAC__":
7743 msg = """This program needs access to the screen.
7744Please run with 'pythonw', not 'python', and only when you are logged
7745in on the main display of your Mac."""
7746
7747 elif wx.Platform == "__WXGTK__":
7748 msg ="Unable to access the X Display, is $DISPLAY set properly?"
d55e5bfc 7749
fc46b7f3
RD
7750 else:
7751 msg = "Unable to create GUI"
7752 # TODO: more description is needed for wxMSW...
7753
7754 raise SystemExit(msg)
7755
d55e5bfc
RD
7756 # This has to be done before OnInit
7757 self.SetUseBestVisual(useBestVisual)
7758
7759 # Set the default handler for SIGINT. This fixes a problem
7760 # where if Ctrl-C is pressed in the console that started this
7761 # app then it will not appear to do anything, (not even send
7762 # KeyboardInterrupt???) but will later segfault on exit. By
7763 # setting the default handler then the app will exit, as
7764 # expected (depending on platform.)
d6c14a4c
RD
7765 if clearSigInt:
7766 try:
7767 import signal
7768 signal.signal(signal.SIGINT, signal.SIG_DFL)
7769 except:
7770 pass
d55e5bfc
RD
7771
7772 # Save and redirect the stdio to a window?
7773 self.stdioWin = None
7774 self.saveStdio = (_sys.stdout, _sys.stderr)
7775 if redirect:
7776 self.RedirectStdio(filename)
7777
8fb0e70a
RD
7778 # Use Python's install prefix as the default
7779 wx.StandardPaths.Get().SetInstallPrefix(_sys.prefix)
7780
48a0c021
RD
7781 # Until the new native control for wxMac is up to par, still use the generic one.
7782 wx.SystemOptions.SetOptionInt("mac.listctrl.always_use_generic", 1)
7783
d55e5bfc
RD
7784 # This finishes the initialization of wxWindows and then calls
7785 # the OnInit that should be present in the derived class
7786 self._BootstrapApp()
7787
7788
2131d850
RD
7789 def OnPreInit(self):
7790 """
7791 Things that must be done after _BootstrapApp has done its
7792 thing, but would be nice if they were already done by the time
7793 that OnInit is called.
7794 """
7795 wx.StockGDI._initStockObjects()
7796
7797
66af7a75
RD
7798 def __del__(self, destroy=wx.PyApp.__del__):
7799 self.RestoreStdio() # Just in case the MainLoop was overridden
7800 destroy(self)
d55e5bfc 7801
7993762b 7802 def Destroy(self):
b39fe951 7803 self.this.own(False)
7993762b 7804 wx.PyApp.Destroy(self)
d55e5bfc
RD
7805
7806 def SetTopWindow(self, frame):
7807 """Set the \"main\" top level window"""
7808 if self.stdioWin:
7809 self.stdioWin.SetParent(frame)
7810 wx.PyApp.SetTopWindow(self, frame)
7811
7812
7813 def MainLoop(self):
7814 """Execute the main GUI event loop"""
7815 wx.PyApp.MainLoop(self)
7816 self.RestoreStdio()
7817
7818
7819 def RedirectStdio(self, filename=None):
7820 """Redirect sys.stdout and sys.stderr to a file or a popup window."""
7821 if filename:
7822 _sys.stdout = _sys.stderr = open(filename, 'a')
7823 else:
7824 self.stdioWin = self.outputWindowClass()
7825 _sys.stdout = _sys.stderr = self.stdioWin
7826
7827
7828 def RestoreStdio(self):
66af7a75
RD
7829 try:
7830 _sys.stdout, _sys.stderr = self.saveStdio
7831 except:
7832 pass
d55e5bfc
RD
7833
7834
412d302d
RD
7835 def SetOutputWindowAttributes(self, title=None, pos=None, size=None):
7836 """
7837 Set the title, position and/or size of the output window if
f5b96ee1
RD
7838 the stdio has been redirected. This should be called before
7839 any output would cause the output window to be created.
412d302d
RD
7840 """
7841 if self.stdioWin:
7842 if title is not None:
7843 self.stdioWin.title = title
7844 if pos is not None:
7845 self.stdioWin.pos = pos
7846 if size is not None:
7847 self.stdioWin.size = size
7848
7849
7850
d55e5bfc 7851
d6c14a4c 7852# change from wx.PyApp_XX to wx.App_XX
d55e5bfc
RD
7853App_GetMacSupportPCMenuShortcuts = _core_.PyApp_GetMacSupportPCMenuShortcuts
7854App_GetMacAboutMenuItemId = _core_.PyApp_GetMacAboutMenuItemId
7855App_GetMacPreferencesMenuItemId = _core_.PyApp_GetMacPreferencesMenuItemId
7856App_GetMacExitMenuItemId = _core_.PyApp_GetMacExitMenuItemId
7857App_GetMacHelpMenuTitleName = _core_.PyApp_GetMacHelpMenuTitleName
7858App_SetMacSupportPCMenuShortcuts = _core_.PyApp_SetMacSupportPCMenuShortcuts
7859App_SetMacAboutMenuItemId = _core_.PyApp_SetMacAboutMenuItemId
7860App_SetMacPreferencesMenuItemId = _core_.PyApp_SetMacPreferencesMenuItemId
7861App_SetMacExitMenuItemId = _core_.PyApp_SetMacExitMenuItemId
7862App_SetMacHelpMenuTitleName = _core_.PyApp_SetMacHelpMenuTitleName
7863App_GetComCtl32Version = _core_.PyApp_GetComCtl32Version
7864
7865#----------------------------------------------------------------------------
7866
7867class PySimpleApp(wx.App):
7868 """
7869 A simple application class. You can just create one of these and
7870 then then make your top level windows later, and not have to worry
d6c14a4c 7871 about OnInit. For example::
d55e5bfc 7872
d6c14a4c
RD
7873 app = wx.PySimpleApp()
7874 frame = wx.Frame(None, title='Hello World')
7875 frame.Show()
7876 app.MainLoop()
7877
7878 :see: `wx.App`
7879 """
7880
7881 def __init__(self, redirect=False, filename=None,
7882 useBestVisual=False, clearSigInt=True):
7883 """
7884 :see: `wx.App.__init__`
7885 """
7886 wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
d55e5bfc
RD
7887
7888 def OnInit(self):
d55e5bfc
RD
7889 return True
7890
7891
d6c14a4c 7892
d55e5bfc
RD
7893# Is anybody using this one?
7894class PyWidgetTester(wx.App):
7895 def __init__(self, size = (250, 100)):
7896 self.size = size
7897 wx.App.__init__(self, 0)
7898
7899 def OnInit(self):
7900 self.frame = wx.Frame(None, -1, "Widget Tester", pos=(0,0), size=self.size)
7901 self.SetTopWindow(self.frame)
7902 return True
7903
d6c14a4c
RD
7904 def SetWidget(self, widgetClass, *args, **kwargs):
7905 w = widgetClass(self.frame, *args, **kwargs)
d55e5bfc
RD
7906 self.frame.Show(True)
7907
7908#----------------------------------------------------------------------------
7909# DO NOT hold any other references to this object. This is how we
d6c14a4c 7910# know when to cleanup system resources that wxWidgets is holding. When
d55e5bfc 7911# the sys module is unloaded, the refcount on sys.__wxPythonCleanup
d6c14a4c 7912# goes to zero and it calls the wx.App_CleanUp function.
d55e5bfc
RD
7913
7914class __wxPyCleanup:
7915 def __init__(self):
7916 self.cleanup = _core_.App_CleanUp
7917 def __del__(self):
7918 self.cleanup()
7919
7920_sys.__wxPythonCleanup = __wxPyCleanup()
7921
7922## # another possible solution, but it gets called too early...
d6c14a4c
RD
7923## import atexit
7924## atexit.register(_core_.wxApp_CleanUp)
d55e5bfc
RD
7925
7926
7927#----------------------------------------------------------------------------
7928
7929#---------------------------------------------------------------------------
7930
5b5c9bc7
RD
7931class EventLoop(object):
7932 """Proxy of C++ EventLoop class"""
1bd55598
RD
7933 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7934 __repr__ = _swig_repr
7935 def __init__(self, *args, **kwargs):
5b5c9bc7 7936 """__init__(self) -> EventLoop"""
1bd55598
RD
7937 _core_.EventLoop_swiginit(self,_core_.new_EventLoop(*args, **kwargs))
7938 __swig_destroy__ = _core_.delete_EventLoop
7939 __del__ = lambda self : None;
b411df4a
RD
7940 def Run(*args, **kwargs):
7941 """Run(self) -> int"""
5b5c9bc7 7942 return _core_.EventLoop_Run(*args, **kwargs)
b411df4a
RD
7943
7944 def Exit(*args, **kwargs):
7945 """Exit(self, int rc=0)"""
5b5c9bc7 7946 return _core_.EventLoop_Exit(*args, **kwargs)
b411df4a
RD
7947
7948 def Pending(*args, **kwargs):
7949 """Pending(self) -> bool"""
5b5c9bc7 7950 return _core_.EventLoop_Pending(*args, **kwargs)
b411df4a
RD
7951
7952 def Dispatch(*args, **kwargs):
7953 """Dispatch(self) -> bool"""
5b5c9bc7 7954 return _core_.EventLoop_Dispatch(*args, **kwargs)
b411df4a
RD
7955
7956 def IsRunning(*args, **kwargs):
7957 """IsRunning(self) -> bool"""
5b5c9bc7 7958 return _core_.EventLoop_IsRunning(*args, **kwargs)
b411df4a
RD
7959
7960 def GetActive(*args, **kwargs):
5b5c9bc7
RD
7961 """GetActive() -> EventLoop"""
7962 return _core_.EventLoop_GetActive(*args, **kwargs)
b411df4a
RD
7963
7964 GetActive = staticmethod(GetActive)
7965 def SetActive(*args, **kwargs):
5b5c9bc7
RD
7966 """SetActive(EventLoop loop)"""
7967 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a
RD
7968
7969 SetActive = staticmethod(SetActive)
2131d850 7970_core_.EventLoop_swigregister(EventLoop)
b411df4a 7971
1bd55598
RD
7972def EventLoop_GetActive(*args):
7973 """EventLoop_GetActive() -> EventLoop"""
7974 return _core_.EventLoop_GetActive(*args)
b411df4a 7975
5b5c9bc7 7976def EventLoop_SetActive(*args, **kwargs):
1bd55598
RD
7977 """EventLoop_SetActive(EventLoop loop)"""
7978 return _core_.EventLoop_SetActive(*args, **kwargs)
b411df4a 7979
32fe5131
RD
7980class EventLoopActivator(object):
7981 """Proxy of C++ EventLoopActivator class"""
1bd55598
RD
7982 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
7983 __repr__ = _swig_repr
7984 def __init__(self, *args, **kwargs):
32fe5131 7985 """__init__(self, EventLoop evtLoop) -> EventLoopActivator"""
1bd55598
RD
7986 _core_.EventLoopActivator_swiginit(self,_core_.new_EventLoopActivator(*args, **kwargs))
7987 __swig_destroy__ = _core_.delete_EventLoopActivator
7988 __del__ = lambda self : None;
2131d850 7989_core_.EventLoopActivator_swigregister(EventLoopActivator)
32fe5131 7990
b411df4a
RD
7991#---------------------------------------------------------------------------
7992
eec1c382
RD
7993ACCEL_ALT = _core_.ACCEL_ALT
7994ACCEL_CTRL = _core_.ACCEL_CTRL
7995ACCEL_SHIFT = _core_.ACCEL_SHIFT
7996ACCEL_NORMAL = _core_.ACCEL_NORMAL
7997ACCEL_CMD = _core_.ACCEL_CMD
5b5c9bc7 7998class AcceleratorEntry(object):
d6c14a4c
RD
7999 """
8000 A class used to define items in an `wx.AcceleratorTable`. wxPython
8001 programs can choose to use wx.AcceleratorEntry objects, but using a
8002 list of 3-tuple of integers (flags, keyCode, cmdID) usually works just
15817c7e 8003 as well. See `__init__` for of the tuple values.
d6c14a4c
RD
8004
8005 :see: `wx.AcceleratorTable`
8006 """
1bd55598
RD
8007 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8008 __repr__ = _swig_repr
8009 def __init__(self, *args, **kwargs):
d6c14a4c 8010 """
5b5c9bc7 8011 __init__(self, int flags=0, int keyCode=0, int cmdID=0) -> AcceleratorEntry
d6c14a4c
RD
8012
8013 Construct a wx.AcceleratorEntry.
d6c14a4c 8014 """
1bd55598
RD
8015 _core_.AcceleratorEntry_swiginit(self,_core_.new_AcceleratorEntry(*args, **kwargs))
8016 __swig_destroy__ = _core_.delete_AcceleratorEntry
8017 __del__ = lambda self : None;
d55e5bfc 8018 def Set(*args, **kwargs):
d6c14a4c
RD
8019 """
8020 Set(self, int flags, int keyCode, int cmd)
d55e5bfc 8021
d6c14a4c
RD
8022 (Re)set the attributes of a wx.AcceleratorEntry.
8023 :see `__init__`
8024 """
5b5c9bc7 8025 return _core_.AcceleratorEntry_Set(*args, **kwargs)
d55e5bfc 8026
ac5d357a
RD
8027 def Create(*args, **kwargs):
8028 """
8029 Create(String str) -> AcceleratorEntry
8030
8031 Create accelerator corresponding to the specified string, or None if
8032 it coulnd't be parsed.
8033 """
8034 return _core_.AcceleratorEntry_Create(*args, **kwargs)
8035
8036 Create = staticmethod(Create)
d55e5bfc 8037 def GetFlags(*args, **kwargs):
d6c14a4c
RD
8038 """
8039 GetFlags(self) -> int
8040
8041 Get the AcceleratorEntry's flags.
8042 """
5b5c9bc7 8043 return _core_.AcceleratorEntry_GetFlags(*args, **kwargs)
d55e5bfc
RD
8044
8045 def GetKeyCode(*args, **kwargs):
d6c14a4c
RD
8046 """
8047 GetKeyCode(self) -> int
8048
8049 Get the AcceleratorEntry's keycode.
8050 """
5b5c9bc7 8051 return _core_.AcceleratorEntry_GetKeyCode(*args, **kwargs)
d55e5bfc
RD
8052
8053 def GetCommand(*args, **kwargs):
d6c14a4c
RD
8054 """
8055 GetCommand(self) -> int
8056
8057 Get the AcceleratorEntry's command ID.
8058 """
5b5c9bc7 8059 return _core_.AcceleratorEntry_GetCommand(*args, **kwargs)
d55e5bfc 8060
ac5d357a
RD
8061 def IsOk(*args, **kwargs):
8062 """IsOk(self) -> bool"""
8063 return _core_.AcceleratorEntry_IsOk(*args, **kwargs)
8064
8065 def ToString(*args, **kwargs):
8066 """
8067 ToString(self) -> String
8068
8069 Returns a string representation for the this accelerator. The string
8070 is formatted using the <flags>-<keycode> format where <flags> maybe a
8071 hyphen-separed list of "shift|alt|ctrl"
8072
8073 """
8074 return _core_.AcceleratorEntry_ToString(*args, **kwargs)
8075
8076 def FromString(*args, **kwargs):
8077 """
8078 FromString(self, String str) -> bool
8079
8080 Returns true if the given string correctly initialized this object.
8081 """
8082 return _core_.AcceleratorEntry_FromString(*args, **kwargs)
8083
2bf58437
RD
8084 Command = property(GetCommand,doc="See `GetCommand`")
8085 Flags = property(GetFlags,doc="See `GetFlags`")
8086 KeyCode = property(GetKeyCode,doc="See `GetKeyCode`")
2131d850 8087_core_.AcceleratorEntry_swigregister(AcceleratorEntry)
d55e5bfc 8088
ac5d357a
RD
8089def AcceleratorEntry_Create(*args, **kwargs):
8090 """
8091 AcceleratorEntry_Create(String str) -> AcceleratorEntry
8092
8093 Create accelerator corresponding to the specified string, or None if
8094 it coulnd't be parsed.
8095 """
8096 return _core_.AcceleratorEntry_Create(*args, **kwargs)
8097
5b5c9bc7 8098class AcceleratorTable(Object):
d6c14a4c
RD
8099 """
8100 An accelerator table allows the application to specify a table of
8101 keyboard shortcuts for menus or other commands. On Windows, menu or
8102 button commands are supported; on GTK, only menu commands are
8103 supported.
d6c14a4c 8104 """
1bd55598
RD
8105 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8106 __repr__ = _swig_repr
8107 def __init__(self, *args, **kwargs):
d55e5bfc
RD
8108 """
8109 __init__(entries) -> AcceleratorTable
8110
d6c14a4c
RD
8111 Construct an AcceleratorTable from a list of `wx.AcceleratorEntry`
8112 items or or of 3-tuples (flags, keyCode, cmdID)
8113
8114 :see: `wx.AcceleratorEntry`
d55e5bfc 8115 """
1bd55598
RD
8116 _core_.AcceleratorTable_swiginit(self,_core_.new_AcceleratorTable(*args, **kwargs))
8117 __swig_destroy__ = _core_.delete_AcceleratorTable
8118 __del__ = lambda self : None;
b39fe951
RD
8119 def IsOk(*args, **kwargs):
8120 """IsOk(self) -> bool"""
8121 return _core_.AcceleratorTable_IsOk(*args, **kwargs)
d55e5bfc 8122
b39fe951 8123 Ok = IsOk
2131d850 8124_core_.AcceleratorTable_swigregister(AcceleratorTable)
d55e5bfc 8125
cbfc9df6
RD
8126def GetAccelFromString(label):
8127 entry = AcceleratorEntry()
8128 entry.FromString(label)
8129 return entry
d55e5bfc 8130
d55e5bfc
RD
8131#---------------------------------------------------------------------------
8132
5b5c9bc7 8133class VisualAttributes(object):
d55e5bfc 8134 """struct containing all the visual attributes of a control"""
1bd55598
RD
8135 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8136 __repr__ = _swig_repr
8137 def __init__(self, *args, **kwargs):
d55e5bfc 8138 """
5b5c9bc7 8139 __init__(self) -> VisualAttributes
d55e5bfc
RD
8140
8141 struct containing all the visual attributes of a control
8142 """
1bd55598
RD
8143 _core_.VisualAttributes_swiginit(self,_core_.new_VisualAttributes(*args, **kwargs))
8144 __swig_destroy__ = _core_.delete_VisualAttributes
8145 __del__ = lambda self : None;
5b5c9bc7
RD
8146 font = property(_core_.VisualAttributes_font_get, _core_.VisualAttributes_font_set)
8147 colFg = property(_core_.VisualAttributes_colFg_get, _core_.VisualAttributes_colFg_set)
8148 colBg = property(_core_.VisualAttributes_colBg_get, _core_.VisualAttributes_colBg_set)
2131d850 8149_core_.VisualAttributes_swigregister(VisualAttributes)
5b5c9bc7 8150NullAcceleratorTable = cvar.NullAcceleratorTable
d55e5bfc
RD
8151PanelNameStr = cvar.PanelNameStr
8152
5b5c9bc7
RD
8153WINDOW_VARIANT_NORMAL = _core_.WINDOW_VARIANT_NORMAL
8154WINDOW_VARIANT_SMALL = _core_.WINDOW_VARIANT_SMALL
8155WINDOW_VARIANT_MINI = _core_.WINDOW_VARIANT_MINI
8156WINDOW_VARIANT_LARGE = _core_.WINDOW_VARIANT_LARGE
8157WINDOW_VARIANT_MAX = _core_.WINDOW_VARIANT_MAX
8158class Window(EvtHandler):
d55e5bfc
RD
8159 """
8160 wx.Window is the base class for all windows and represents any visible
8161 object on the screen. All controls, top level windows and so on are
8162 wx.Windows. Sizers and device contexts are not however, as they don't
8163 appear on screen themselves.
8164
8165 """
1bd55598
RD
8166 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
8167 __repr__ = _swig_repr
8168 def __init__(self, *args, **kwargs):
d55e5bfc 8169 """
5b5c9bc7
RD
8170 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
8171 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> Window
d55e5bfc
RD
8172
8173 Construct and show a generic Window.
8174 """
1bd55598 8175 _core_.Window_swiginit(self,_core_.new_Window(*args, **kwargs))
d55e5bfc
RD
8176 self._setOORInfo(self)
8177
8178 def Create(*args, **kwargs):
8179 """
5b5c9bc7
RD
8180 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
8181 Size size=DefaultSize, long style=0, String name=PanelNameStr) -> bool
d55e5bfc
RD
8182
8183 Create the GUI part of the Window for 2-phase creation mode.
8184 """
5b5c9bc7 8185 return _core_.Window_Create(*args, **kwargs)
d55e5bfc
RD
8186
8187 def Close(*args, **kwargs):
8188 """
8189 Close(self, bool force=False) -> bool
8190
8191 This function simply generates a EVT_CLOSE event whose handler usually
8192 tries to close the window. It doesn't close the window itself,
8193 however. If force is False (the default) then the window's close
8194 handler will be allowed to veto the destruction of the window.
d55e5bfc 8195 """
5b5c9bc7 8196 return _core_.Window_Close(*args, **kwargs)
d55e5bfc
RD
8197
8198 def Destroy(*args, **kwargs):
8199 """
8200 Destroy(self) -> bool
8201
8202 Destroys the window safely. Frames and dialogs are not destroyed
8203 immediately when this function is called -- they are added to a list
8204 of windows to be deleted on idle time, when all the window's events
8205 have been processed. This prevents problems with events being sent to
8206 non-existent windows.
8207
8208 Returns True if the window has either been successfully deleted, or it
8209 has been added to the list of windows pending real deletion.
8210 """
b39fe951
RD
8211 args[0].this.own(False)
8212 return _core_.Window_Destroy(*args, **kwargs)
d55e5bfc
RD
8213
8214 def DestroyChildren(*args, **kwargs):
8215 """
8216 DestroyChildren(self) -> bool
8217
15817c7e
RD
8218 Destroys all children of a window. Called automatically by the
8219 destructor.
d55e5bfc 8220 """
5b5c9bc7 8221 return _core_.Window_DestroyChildren(*args, **kwargs)
d55e5bfc
RD
8222
8223 def IsBeingDeleted(*args, **kwargs):
8224 """
8225 IsBeingDeleted(self) -> bool
8226
8227 Is the window in the process of being deleted?
8228 """
5b5c9bc7 8229 return _core_.Window_IsBeingDeleted(*args, **kwargs)
d55e5bfc 8230
d55e5bfc
RD
8231 def SetLabel(*args, **kwargs):
8232 """
5b5c9bc7 8233 SetLabel(self, String label)
d55e5bfc
RD
8234
8235 Set the text which the window shows in its label if applicable.
8236 """
5b5c9bc7 8237 return _core_.Window_SetLabel(*args, **kwargs)
d55e5bfc
RD
8238
8239 def GetLabel(*args, **kwargs):
8240 """
5b5c9bc7 8241 GetLabel(self) -> String
d55e5bfc 8242
15817c7e
RD
8243 Generic way of getting a label from any window, for identification
8244 purposes. The interpretation of this function differs from class to
8245 class. For frames and dialogs, the value returned is the title. For
8246 buttons or static text controls, it is the button text. This function
8247 can be useful for meta-programs such as testing tools or special-needs
8248 access programs)which need to identify windows by name.
d55e5bfc 8249 """
5b5c9bc7 8250 return _core_.Window_GetLabel(*args, **kwargs)
d55e5bfc
RD
8251
8252 def SetName(*args, **kwargs):
8253 """
5b5c9bc7 8254 SetName(self, String name)
d55e5bfc 8255
15817c7e
RD
8256 Sets the window's name. The window name is used for ressource setting
8257 in X, it is not the same as the window title/label
d55e5bfc 8258 """
5b5c9bc7 8259 return _core_.Window_SetName(*args, **kwargs)
d55e5bfc
RD
8260
8261 def GetName(*args, **kwargs):
8262 """
5b5c9bc7 8263 GetName(self) -> String
d55e5bfc 8264
15817c7e
RD
8265 Returns the windows name. This name is not guaranteed to be unique;
8266 it is up to the programmer to supply an appropriate name in the window
8267 constructor or via wx.Window.SetName.
d55e5bfc 8268 """
5b5c9bc7 8269 return _core_.Window_GetName(*args, **kwargs)
d55e5bfc
RD
8270
8271 def SetWindowVariant(*args, **kwargs):
8272 """
8273 SetWindowVariant(self, int variant)
8274
15817c7e
RD
8275 Sets the variant of the window/font size to use for this window, if
8276 the platform supports variants, for example, wxMac.
d55e5bfc 8277 """
5b5c9bc7 8278 return _core_.Window_SetWindowVariant(*args, **kwargs)
d55e5bfc
RD
8279
8280 def GetWindowVariant(*args, **kwargs):
8281 """GetWindowVariant(self) -> int"""
5b5c9bc7 8282 return _core_.Window_GetWindowVariant(*args, **kwargs)
d55e5bfc
RD
8283
8284 def SetId(*args, **kwargs):
8285 """
8286 SetId(self, int winid)
8287
8288 Sets the identifier of the window. Each window has an integer
8289 identifier. If the application has not provided one, an identifier
8290 will be generated. Normally, the identifier should be provided on
8291 creation and should not be modified subsequently.
8292 """
5b5c9bc7 8293 return _core_.Window_SetId(*args, **kwargs)
d55e5bfc
RD
8294
8295 def GetId(*args, **kwargs):
8296 """
8297 GetId(self) -> int
8298
8299 Returns the identifier of the window. Each window has an integer
8300 identifier. If the application has not provided one (or the default Id
8301 -1 is used) then an unique identifier with a negative value will be
8302 generated.
8303 """
5b5c9bc7 8304 return _core_.Window_GetId(*args, **kwargs)
d55e5bfc
RD
8305
8306 def NewControlId(*args, **kwargs):
8307 """
d6c14a4c 8308 NewControlId() -> int
d55e5bfc
RD
8309
8310 Generate a control id for the controls which were not given one.
8311 """
5b5c9bc7 8312 return _core_.Window_NewControlId(*args, **kwargs)
d55e5bfc
RD
8313
8314 NewControlId = staticmethod(NewControlId)
8315 def NextControlId(*args, **kwargs):
8316 """
d6c14a4c 8317 NextControlId(int winid) -> int
d55e5bfc
RD
8318
8319 Get the id of the control following the one with the given
15817c7e 8320 autogenerated) id
d55e5bfc 8321 """
5b5c9bc7 8322 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc
RD
8323
8324 NextControlId = staticmethod(NextControlId)
8325 def PrevControlId(*args, **kwargs):
8326 """
d6c14a4c 8327 PrevControlId(int winid) -> int
d55e5bfc
RD
8328
8329 Get the id of the control preceding the one with the given
15817c7e 8330 autogenerated) id
d55e5bfc 8331 """
5b5c9bc7 8332 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc
RD
8333
8334 PrevControlId = staticmethod(PrevControlId)
ac5d357a
RD
8335 def GetLayoutDirection(*args, **kwargs):
8336 """
994453b8 8337 GetLayoutDirection(self) -> int
ac5d357a
RD
8338
8339 Get the layout direction (LTR or RTL) for this window. Returns
8340 ``wx.Layout_Default`` if layout direction is not supported.
8341 """
8342 return _core_.Window_GetLayoutDirection(*args, **kwargs)
8343
8344 def SetLayoutDirection(*args, **kwargs):
8345 """
994453b8 8346 SetLayoutDirection(self, int dir)
ac5d357a
RD
8347
8348 Set the layout direction (LTR or RTL) for this window.
8349 """
8350 return _core_.Window_SetLayoutDirection(*args, **kwargs)
8351
8352 def AdjustForLayoutDirection(*args, **kwargs):
8353 """
8354 AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
8355
8356 Mirror coordinates for RTL layout if this window uses it and if the
8357 mirroring is not done automatically like Win32.
8358 """
8359 return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
8360
d55e5bfc
RD
8361 def SetSize(*args, **kwargs):
8362 """
5b5c9bc7 8363 SetSize(self, Size size)
d55e5bfc
RD
8364
8365 Sets the size of the window in pixels.
8366 """
5b5c9bc7 8367 return _core_.Window_SetSize(*args, **kwargs)
d55e5bfc
RD
8368
8369 def SetDimensions(*args, **kwargs):
8370 """
5b5c9bc7 8371 SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
8372
8373 Sets the position and size of the window in pixels. The sizeFlags
8374 parameter indicates the interpretation of the other params if they are
62d32a5f
RD
8375 equal to -1.
8376
8377 ======================== ======================================
8378 wx.SIZE_AUTO A -1 indicates that a class-specific
8379 default should be used.
8380 wx.SIZE_USE_EXISTING Axisting dimensions should be used if
8381 -1 values are supplied.
8382 wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be
8383 interpreted as real dimensions, not
8384 default values.
8385 ======================== ======================================
8386
d55e5bfc 8387 """
5b5c9bc7 8388 return _core_.Window_SetDimensions(*args, **kwargs)
d55e5bfc
RD
8389
8390 def SetRect(*args, **kwargs):
8391 """
5b5c9bc7 8392 SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
d55e5bfc
RD
8393
8394 Sets the position and size of the window in pixels using a wx.Rect.
8395 """
5b5c9bc7 8396 return _core_.Window_SetRect(*args, **kwargs)
d55e5bfc
RD
8397
8398 def SetSizeWH(*args, **kwargs):
8399 """
8400 SetSizeWH(self, int width, int height)
8401
8402 Sets the size of the window in pixels.
8403 """
5b5c9bc7 8404 return _core_.Window_SetSizeWH(*args, **kwargs)
d55e5bfc
RD
8405
8406 def Move(*args, **kwargs):
8407 """
5b5c9bc7 8408 Move(self, Point pt, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
8409
8410 Moves the window to the given position.
8411 """
5b5c9bc7 8412 return _core_.Window_Move(*args, **kwargs)
d55e5bfc
RD
8413
8414 SetPosition = Move
8415 def MoveXY(*args, **kwargs):
8416 """
5b5c9bc7 8417 MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
d55e5bfc
RD
8418
8419 Moves the window to the given position.
8420 """
5b5c9bc7 8421 return _core_.Window_MoveXY(*args, **kwargs)
d55e5bfc 8422
580080c5 8423 def SetInitialSize(*args, **kwargs):
f8167d6e 8424 """
580080c5 8425 SetInitialSize(self, Size size=DefaultSize)
f8167d6e
RD
8426
8427 A 'Smart' SetSize that will fill in default size components with the
8428 window's *best size* values. Also set's the minsize for use with sizers.
8429 """
580080c5 8430 return _core_.Window_SetInitialSize(*args, **kwargs)
f8167d6e 8431
580080c5 8432 SetBestFittingSize = wx._deprecated(SetInitialSize, 'Use `SetInitialSize`')
d55e5bfc
RD
8433 def Raise(*args, **kwargs):
8434 """
8435 Raise(self)
8436
943e8dfd 8437 Raises the window to the top of the window hierarchy. In current
70b63a99 8438 version of wxWidgets this works both for managed and child windows.
d55e5bfc 8439 """
5b5c9bc7 8440 return _core_.Window_Raise(*args, **kwargs)
d55e5bfc
RD
8441
8442 def Lower(*args, **kwargs):
8443 """
8444 Lower(self)
8445
943e8dfd 8446 Lowers the window to the bottom of the window hierarchy. In current
70b63a99 8447 version of wxWidgets this works both for managed and child windows.
d55e5bfc 8448 """
5b5c9bc7 8449 return _core_.Window_Lower(*args, **kwargs)
d55e5bfc
RD
8450
8451 def SetClientSize(*args, **kwargs):
8452 """
5b5c9bc7 8453 SetClientSize(self, Size size)
d55e5bfc
RD
8454
8455 This sets the size of the window client area in pixels. Using this
8456 function to size a window tends to be more device-independent than
8457 wx.Window.SetSize, since the application need not worry about what
8458 dimensions the border or title bar have when trying to fit the window
8459 around panel items, for example.
8460 """
5b5c9bc7 8461 return _core_.Window_SetClientSize(*args, **kwargs)
d55e5bfc
RD
8462
8463 def SetClientSizeWH(*args, **kwargs):
8464 """
8465 SetClientSizeWH(self, int width, int height)
8466
8467 This sets the size of the window client area in pixels. Using this
8468 function to size a window tends to be more device-independent than
8469 wx.Window.SetSize, since the application need not worry about what
8470 dimensions the border or title bar have when trying to fit the window
8471 around panel items, for example.
8472 """
5b5c9bc7 8473 return _core_.Window_SetClientSizeWH(*args, **kwargs)
d55e5bfc
RD
8474
8475 def SetClientRect(*args, **kwargs):
8476 """
5b5c9bc7 8477 SetClientRect(self, Rect rect)
d55e5bfc
RD
8478
8479 This sets the size of the window client area in pixels. Using this
8480 function to size a window tends to be more device-independent than
8481 wx.Window.SetSize, since the application need not worry about what
8482 dimensions the border or title bar have when trying to fit the window
8483 around panel items, for example.
8484 """
5b5c9bc7 8485 return _core_.Window_SetClientRect(*args, **kwargs)
d55e5bfc
RD
8486
8487 def GetPosition(*args, **kwargs):
8488 """
5b5c9bc7 8489 GetPosition(self) -> Point
d55e5bfc 8490
1c71765a
RD
8491 Get the window's position. Notice that the position is in client
8492 coordinates for child windows and screen coordinates for the top level
8493 ones, use `GetScreenPosition` if you need screen coordinates for all
8494 kinds of windows.
d55e5bfc 8495 """
5b5c9bc7 8496 return _core_.Window_GetPosition(*args, **kwargs)
d55e5bfc
RD
8497
8498 def GetPositionTuple(*args, **kwargs):
8499 """
8500 GetPositionTuple() -> (x,y)
8501
1c71765a
RD
8502 Get the window's position. Notice that the position is in client
8503 coordinates for child windows and screen coordinates for the top level
8504 ones, use `GetScreenPosition` if you need screen coordinates for all
8505 kinds of windows.
d55e5bfc 8506 """
5b5c9bc7 8507 return _core_.Window_GetPositionTuple(*args, **kwargs)
d55e5bfc 8508
1c71765a
RD
8509 def GetScreenPosition(*args, **kwargs):
8510 """
8511 GetScreenPosition(self) -> Point
8512
8513 Get the position of the window in screen coordinantes.
8514 """
8515 return _core_.Window_GetScreenPosition(*args, **kwargs)
8516
8517 def GetScreenPositionTuple(*args, **kwargs):
8518 """
8519 GetScreenPositionTuple() -> (x,y)
8520
8521 Get the position of the window in screen coordinantes.
8522 """
8523 return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
8524
8525 def GetScreenRect(*args, **kwargs):
8526 """
8527 GetScreenRect(self) -> Rect
8528
8529 Returns the size and position of the window in screen coordinantes as
8530 a `wx.Rect` object.
8531 """
8532 return _core_.Window_GetScreenRect(*args, **kwargs)
8533
d55e5bfc
RD
8534 def GetSize(*args, **kwargs):
8535 """
5b5c9bc7 8536 GetSize(self) -> Size
d55e5bfc
RD
8537
8538 Get the window size.
8539 """
5b5c9bc7 8540 return _core_.Window_GetSize(*args, **kwargs)
d55e5bfc
RD
8541
8542 def GetSizeTuple(*args, **kwargs):
8543 """
8544 GetSizeTuple() -> (width, height)
8545
8546 Get the window size.
8547 """
5b5c9bc7 8548 return _core_.Window_GetSizeTuple(*args, **kwargs)
d55e5bfc
RD
8549
8550 def GetRect(*args, **kwargs):
8551 """
5b5c9bc7 8552 GetRect(self) -> Rect
d55e5bfc 8553
1c71765a 8554 Returns the size and position of the window as a `wx.Rect` object.
d55e5bfc 8555 """
5b5c9bc7 8556 return _core_.Window_GetRect(*args, **kwargs)
d55e5bfc
RD
8557
8558 def GetClientSize(*args, **kwargs):
8559 """
5b5c9bc7 8560 GetClientSize(self) -> Size
d55e5bfc
RD
8561
8562 This gets the size of the window's 'client area' in pixels. The client
8563 area is the area which may be drawn on by the programmer, excluding
8564 title bar, border, scrollbars, etc.
8565 """
5b5c9bc7 8566 return _core_.Window_GetClientSize(*args, **kwargs)
d55e5bfc
RD
8567
8568 def GetClientSizeTuple(*args, **kwargs):
8569 """
8570 GetClientSizeTuple() -> (width, height)
8571
8572 This gets the size of the window's 'client area' in pixels. The client
8573 area is the area which may be drawn on by the programmer, excluding
8574 title bar, border, scrollbars, etc.
8575 """
5b5c9bc7 8576 return _core_.Window_GetClientSizeTuple(*args, **kwargs)
d55e5bfc
RD
8577
8578 def GetClientAreaOrigin(*args, **kwargs):
8579 """
5b5c9bc7 8580 GetClientAreaOrigin(self) -> Point
d55e5bfc
RD
8581
8582 Get the origin of the client area of the window relative to the
8583 window's top left corner (the client area may be shifted because of
8584 the borders, scrollbars, other decorations...)
8585 """
5b5c9bc7 8586 return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
d55e5bfc
RD
8587
8588 def GetClientRect(*args, **kwargs):
8589 """
5b5c9bc7 8590 GetClientRect(self) -> Rect
d55e5bfc 8591
0439c23b 8592 Get the client area position and size as a `wx.Rect` object.
d55e5bfc 8593 """
5b5c9bc7 8594 return _core_.Window_GetClientRect(*args, **kwargs)
d55e5bfc
RD
8595
8596 def GetBestSize(*args, **kwargs):
8597 """
5b5c9bc7 8598 GetBestSize(self) -> Size
d55e5bfc 8599
bfddbb17 8600 This function returns the best acceptable minimal size for the
15817c7e
RD
8601 window, if applicable. For example, for a static text control, it will
8602 be the minimal size such that the control label is not truncated. For
8603 windows containing subwindows (suzh aswx.Panel), the size returned by
8604 this function will be the same as the size the window would have had
8605 after calling Fit.
d55e5bfc 8606 """
5b5c9bc7 8607 return _core_.Window_GetBestSize(*args, **kwargs)
d55e5bfc
RD
8608
8609 def GetBestSizeTuple(*args, **kwargs):
8610 """
8611 GetBestSizeTuple() -> (width, height)
8612
bfddbb17 8613 This function returns the best acceptable minimal size for the
15817c7e
RD
8614 window, if applicable. For example, for a static text control, it will
8615 be the minimal size such that the control label is not truncated. For
8616 windows containing subwindows (suzh aswx.Panel), the size returned by
8617 this function will be the same as the size the window would have had
8618 after calling Fit.
d55e5bfc 8619 """
5b5c9bc7 8620 return _core_.Window_GetBestSizeTuple(*args, **kwargs)
d55e5bfc 8621
a001823c
RD
8622 def InvalidateBestSize(*args, **kwargs):
8623 """
8624 InvalidateBestSize(self)
8625
8626 Reset the cached best size value so it will be recalculated the next
8627 time it is needed.
8628 """
5b5c9bc7 8629 return _core_.Window_InvalidateBestSize(*args, **kwargs)
a001823c 8630
e2813725
RD
8631 def CacheBestSize(*args, **kwargs):
8632 """
8633 CacheBestSize(self, Size size)
8634
8635 Cache the best size so it doesn't need to be calculated again, (at least until
8636 some properties of the window change.)
8637 """
8638 return _core_.Window_CacheBestSize(*args, **kwargs)
8639
580080c5 8640 def GetEffectiveMinSize(*args, **kwargs):
a001823c 8641 """
580080c5 8642 GetEffectiveMinSize(self) -> Size
a001823c
RD
8643
8644 This function will merge the window's best size into the window's
8645 minimum size, giving priority to the min size components, and returns
8646 the results.
8647
8648 """
580080c5 8649 return _core_.Window_GetEffectiveMinSize(*args, **kwargs)
a001823c 8650
0d82d64e 8651 GetBestFittingSize = wx._deprecated(GetEffectiveMinSize, 'Use `GetEffectiveMinSize` instead.')
8f514ab4
RD
8652 def GetAdjustedBestSize(self):
8653 s = self.GetBestSize()
8654 return wx.Size(max(s.width, self.GetMinWidth()),
8655 max(s.height, self.GetMinHeight()))
580080c5 8656 GetAdjustedBestSize = wx._deprecated(GetAdjustedBestSize, 'Use `GetEffectiveMinSize` instead.')
d55e5bfc
RD
8657
8658 def Center(*args, **kwargs):
8659 """
5b5c9bc7 8660 Center(self, int direction=BOTH)
d55e5bfc
RD
8661
8662 Centers the window. The parameter specifies the direction for
8663 cetering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may
8664 also include wx.CENTER_ON_SCREEN flag if you want to center the window
8665 on the entire screen and not on its parent window. If it is a
8666 top-level window and has no parent then it will always be centered
8667 relative to the screen.
8668 """
5b5c9bc7 8669 return _core_.Window_Center(*args, **kwargs)
d55e5bfc
RD
8670
8671 Centre = Center
d55e5bfc
RD
8672 def CenterOnParent(*args, **kwargs):
8673 """
5b5c9bc7 8674 CenterOnParent(self, int dir=BOTH)
d55e5bfc
RD
8675
8676 Center with respect to the the parent window
8677 """
5b5c9bc7 8678 return _core_.Window_CenterOnParent(*args, **kwargs)
d55e5bfc
RD
8679
8680 CentreOnParent = CenterOnParent
8681 def Fit(*args, **kwargs):
8682 """
8683 Fit(self)
8684
8685 Sizes the window so that it fits around its subwindows. This function
8686 won't do anything if there are no subwindows and will only really work
8687 correctly if sizers are used for the subwindows layout. Also, if the
8688 window has exactly one subwindow it is better (faster and the result
8689 is more precise as Fit adds some margin to account for fuzziness of
8690 its calculations) to call window.SetClientSize(child.GetSize())
8691 instead of calling Fit.
8692 """
5b5c9bc7 8693 return _core_.Window_Fit(*args, **kwargs)
d55e5bfc
RD
8694
8695 def FitInside(*args, **kwargs):
8696 """
8697 FitInside(self)
8698
8699 Similar to Fit, but sizes the interior (virtual) size of a
8700 window. Mainly useful with scrolled windows to reset scrollbars after
8701 sizing changes that do not trigger a size event, and/or scrolled
8702 windows without an interior sizer. This function similarly won't do
8703 anything if there are no subwindows.
8704 """
5b5c9bc7 8705 return _core_.Window_FitInside(*args, **kwargs)
d55e5bfc 8706
03837c5c 8707 def SetSizeHints(*args, **kwargs):
d55e5bfc
RD
8708 """
8709 SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1,
8710 int incH=-1)
d55e5bfc
RD
8711
8712 Allows specification of minimum and maximum window sizes, and window
8713 size increments. If a pair of values is not set (or set to -1), the
8714 default values will be used. If this function is called, the user
908b74cd
RD
8715 will not be able to size the window outside the given bounds (if it is
8716 a top-level window.) Sizers will also inspect the minimum window size
8717 and will use that value if set when calculating layout.
8718
8719 The resizing increments are only significant under Motif or Xt.
d55e5bfc 8720 """
5b5c9bc7 8721 return _core_.Window_SetSizeHints(*args, **kwargs)
d55e5bfc 8722
03837c5c
RD
8723 def SetSizeHintsSz(*args, **kwargs):
8724 """
5b5c9bc7 8725 SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
03837c5c
RD
8726
8727 Allows specification of minimum and maximum window sizes, and window
8728 size increments. If a pair of values is not set (or set to -1), the
8729 default values will be used. If this function is called, the user
8730 will not be able to size the window outside the given bounds (if it is
8731 a top-level window.) Sizers will also inspect the minimum window size
8732 and will use that value if set when calculating layout.
8733
8734 The resizing increments are only significant under Motif or Xt.
8735 """
5b5c9bc7 8736 return _core_.Window_SetSizeHintsSz(*args, **kwargs)
03837c5c
RD
8737
8738 def SetVirtualSizeHints(*args, **kwargs):
d55e5bfc 8739 """
908b74cd 8740 SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
d55e5bfc
RD
8741
8742 Allows specification of minimum and maximum virtual window sizes. If a
8743 pair of values is not set (or set to -1), the default values will be
8744 used. If this function is called, the user will not be able to size
8745 the virtual area of the window outside the given bounds.
8746 """
5b5c9bc7 8747 return _core_.Window_SetVirtualSizeHints(*args, **kwargs)
03837c5c
RD
8748
8749 def SetVirtualSizeHintsSz(*args, **kwargs):
8750 """
5b5c9bc7 8751 SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
03837c5c
RD
8752
8753 Allows specification of minimum and maximum virtual window sizes. If a
8754 pair of values is not set (or set to -1), the default values will be
8755 used. If this function is called, the user will not be able to size
8756 the virtual area of the window outside the given bounds.
8757 """
5b5c9bc7 8758 return _core_.Window_SetVirtualSizeHintsSz(*args, **kwargs)
d55e5bfc 8759
908b74cd 8760 def GetMaxSize(*args, **kwargs):
5b5c9bc7
RD
8761 """GetMaxSize(self) -> Size"""
8762 return _core_.Window_GetMaxSize(*args, **kwargs)
908b74cd
RD
8763
8764 def GetMinSize(*args, **kwargs):
5b5c9bc7
RD
8765 """GetMinSize(self) -> Size"""
8766 return _core_.Window_GetMinSize(*args, **kwargs)
908b74cd
RD
8767
8768 def SetMinSize(*args, **kwargs):
8769 """
5b5c9bc7 8770 SetMinSize(self, Size minSize)
908b74cd
RD
8771
8772 A more convenient method than `SetSizeHints` for setting just the
8773 min size.
8774 """
5b5c9bc7 8775 return _core_.Window_SetMinSize(*args, **kwargs)
908b74cd
RD
8776
8777 def SetMaxSize(*args, **kwargs):
8778 """
5b5c9bc7 8779 SetMaxSize(self, Size maxSize)
908b74cd
RD
8780
8781 A more convenient method than `SetSizeHints` for setting just the
8782 max size.
8783 """
5b5c9bc7 8784 return _core_.Window_SetMaxSize(*args, **kwargs)
908b74cd 8785
d55e5bfc
RD
8786 def GetMinWidth(*args, **kwargs):
8787 """GetMinWidth(self) -> int"""
5b5c9bc7 8788 return _core_.Window_GetMinWidth(*args, **kwargs)
d55e5bfc
RD
8789
8790 def GetMinHeight(*args, **kwargs):
8791 """GetMinHeight(self) -> int"""
5b5c9bc7 8792 return _core_.Window_GetMinHeight(*args, **kwargs)
d55e5bfc
RD
8793
8794 def GetMaxWidth(*args, **kwargs):
8795 """GetMaxWidth(self) -> int"""
5b5c9bc7 8796 return _core_.Window_GetMaxWidth(*args, **kwargs)
d55e5bfc
RD
8797
8798 def GetMaxHeight(*args, **kwargs):
8799 """GetMaxHeight(self) -> int"""
5b5c9bc7 8800 return _core_.Window_GetMaxHeight(*args, **kwargs)
d55e5bfc 8801
d55e5bfc
RD
8802 def SetVirtualSize(*args, **kwargs):
8803 """
5b5c9bc7 8804 SetVirtualSize(self, Size size)
d55e5bfc
RD
8805
8806 Set the the virtual size of a window in pixels. For most windows this
8807 is just the client area of the window, but for some like scrolled
8808 windows it is more or less independent of the screen window size.
8809 """
5b5c9bc7 8810 return _core_.Window_SetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8811
8812 def SetVirtualSizeWH(*args, **kwargs):
8813 """
8814 SetVirtualSizeWH(self, int w, int h)
8815
8816 Set the the virtual size of a window in pixels. For most windows this
8817 is just the client area of the window, but for some like scrolled
8818 windows it is more or less independent of the screen window size.
8819 """
5b5c9bc7 8820 return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
d55e5bfc
RD
8821
8822 def GetVirtualSize(*args, **kwargs):
8823 """
5b5c9bc7 8824 GetVirtualSize(self) -> Size
d55e5bfc
RD
8825
8826 Get the the virtual size of the window in pixels. For most windows
8827 this is just the client area of the window, but for some like scrolled
8828 windows it is more or less independent of the screen window size.
8829 """
5b5c9bc7 8830 return _core_.Window_GetVirtualSize(*args, **kwargs)
d55e5bfc
RD
8831
8832 def GetVirtualSizeTuple(*args, **kwargs):
8833 """
8834 GetVirtualSizeTuple() -> (width, height)
8835
8836 Get the the virtual size of the window in pixels. For most windows
8837 this is just the client area of the window, but for some like scrolled
8838 windows it is more or less independent of the screen window size.
8839 """
5b5c9bc7 8840 return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
d55e5bfc 8841
cbdf0fb0
RD
8842 def GetWindowBorderSize(*args, **kwargs):
8843 """
8844 GetWindowBorderSize(self) -> Size
8845
8846 Return the size of the left/right and top/bottom borders.
8847 """
8848 return _core_.Window_GetWindowBorderSize(*args, **kwargs)
8849
d55e5bfc
RD
8850 def GetBestVirtualSize(*args, **kwargs):
8851 """
5b5c9bc7 8852 GetBestVirtualSize(self) -> Size
d55e5bfc
RD
8853
8854 Return the largest of ClientSize and BestSize (as determined by a
8855 sizer, interior children, or other means)
8856 """
5b5c9bc7 8857 return _core_.Window_GetBestVirtualSize(*args, **kwargs)
d55e5bfc
RD
8858
8859 def Show(*args, **kwargs):
8860 """
8861 Show(self, bool show=True) -> bool
8862
8863 Shows or hides the window. You may need to call Raise for a top level
8864 window if you want to bring it to top, although this is not needed if
8865 Show is called immediately after the frame creation. Returns True if
8866 the window has been shown or hidden or False if nothing was done
8867 because it already was in the requested state.
8868 """
5b5c9bc7 8869 return _core_.Window_Show(*args, **kwargs)
d55e5bfc
RD
8870
8871 def Hide(*args, **kwargs):
8872 """
8873 Hide(self) -> bool
8874
8875 Equivalent to calling Show(False).
8876 """
5b5c9bc7 8877 return _core_.Window_Hide(*args, **kwargs)
d55e5bfc
RD
8878
8879 def Enable(*args, **kwargs):
8880 """
8881 Enable(self, bool enable=True) -> bool
8882
8883 Enable or disable the window for user input. Note that when a parent
8884 window is disabled, all of its children are disabled as well and they
8885 are reenabled again when the parent is. Returns true if the window
8886 has been enabled or disabled, false if nothing was done, i.e. if the
8887 window had already been in the specified state.
8888 """
5b5c9bc7 8889 return _core_.Window_Enable(*args, **kwargs)
d55e5bfc
RD
8890
8891 def Disable(*args, **kwargs):
8892 """
8893 Disable(self) -> bool
8894
8895 Disables the window, same as Enable(false).
8896 """
5b5c9bc7 8897 return _core_.Window_Disable(*args, **kwargs)
d55e5bfc
RD
8898
8899 def IsShown(*args, **kwargs):
8900 """
8901 IsShown(self) -> bool
8902
8903 Returns true if the window is shown, false if it has been hidden.
8904 """
5b5c9bc7 8905 return _core_.Window_IsShown(*args, **kwargs)
d55e5bfc
RD
8906
8907 def IsEnabled(*args, **kwargs):
8908 """
8909 IsEnabled(self) -> bool
8910
8911 Returns true if the window is enabled for input, false otherwise.
cbfc9df6
RD
8912 This method takes into account the enabled state of parent windows up
8913 to the top-level window.
d55e5bfc 8914 """
5b5c9bc7 8915 return _core_.Window_IsEnabled(*args, **kwargs)
d55e5bfc 8916
cbfc9df6
RD
8917 def IsThisEnabled(*args, **kwargs):
8918 """
8919 IsThisEnabled(self) -> bool
8920
8921 Returns the internal enabled state independent of the parent(s) state,
8922 i.e. the state in which the window would be if all of its parents are
8923 enabled. Use `IsEnabled` to get the effective window state.
8924 """
8925 return _core_.Window_IsThisEnabled(*args, **kwargs)
8926
33d6fd3b
RD
8927 def IsShownOnScreen(*args, **kwargs):
8928 """
8929 IsShownOnScreen(self) -> bool
8930
8931 Returns ``True`` if the window is physically visible on the screen,
8932 i.e. it is shown and all its parents up to the toplevel window are
8933 shown as well.
8934 """
8935 return _core_.Window_IsShownOnScreen(*args, **kwargs)
8936
d55e5bfc
RD
8937 def SetWindowStyleFlag(*args, **kwargs):
8938 """
8939 SetWindowStyleFlag(self, long style)
8940
15817c7e
RD
8941 Sets the style of the window. Please note that some styles cannot be
8942 changed after the window creation and that Refresh() might need to be
8943 called after changing the others for the change to take place
8944 immediately.
d55e5bfc 8945 """
5b5c9bc7 8946 return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8947
8948 def GetWindowStyleFlag(*args, **kwargs):
8949 """
8950 GetWindowStyleFlag(self) -> long
8951
8952 Gets the window style that was passed to the constructor or Create
8953 method.
8954 """
5b5c9bc7 8955 return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
d55e5bfc
RD
8956
8957 SetWindowStyle = SetWindowStyleFlag; GetWindowStyle = GetWindowStyleFlag
8958 def HasFlag(*args, **kwargs):
8959 """
8960 HasFlag(self, int flag) -> bool
8961
8962 Test if the given style is set for this window.
8963 """
5b5c9bc7 8964 return _core_.Window_HasFlag(*args, **kwargs)
d55e5bfc
RD
8965
8966 def IsRetained(*args, **kwargs):
8967 """
8968 IsRetained(self) -> bool
8969
8970 Returns true if the window is retained, false otherwise. Retained
8971 windows are only available on X platforms.
8972 """
5b5c9bc7 8973 return _core_.Window_IsRetained(*args, **kwargs)
d55e5bfc 8974
5917d041
RD
8975 def ToggleWindowStyle(*args, **kwargs):
8976 """
8977 ToggleWindowStyle(self, int flag) -> bool
8978
8979 Turn the flag on if it had been turned off before and vice versa,
8980 returns True if the flag is turned on by this function call.
8981 """
8982 return _core_.Window_ToggleWindowStyle(*args, **kwargs)
8983
d55e5bfc
RD
8984 def SetExtraStyle(*args, **kwargs):
8985 """
8986 SetExtraStyle(self, long exStyle)
8987
8988 Sets the extra style bits for the window. Extra styles are the less
8989 often used style bits which can't be set with the constructor or with
8990 SetWindowStyleFlag()
8991 """
5b5c9bc7 8992 return _core_.Window_SetExtraStyle(*args, **kwargs)
d55e5bfc
RD
8993
8994 def GetExtraStyle(*args, **kwargs):
8995 """
8996 GetExtraStyle(self) -> long
8997
8998 Returns the extra style bits for the window.
8999 """
5b5c9bc7 9000 return _core_.Window_GetExtraStyle(*args, **kwargs)
d55e5bfc
RD
9001
9002 def MakeModal(*args, **kwargs):
9003 """
9004 MakeModal(self, bool modal=True)
9005
9006 Disables all other windows in the application so that the user can
9007 only interact with this window. Passing False will reverse this
9008 effect.
9009 """
5b5c9bc7 9010 return _core_.Window_MakeModal(*args, **kwargs)
d55e5bfc
RD
9011
9012 def SetThemeEnabled(*args, **kwargs):
9013 """
9014 SetThemeEnabled(self, bool enableTheme)
9015
9016 This function tells a window if it should use the system's "theme"
9017 code to draw the windows' background instead if its own background
9018 drawing code. This will only have an effect on platforms that support
9019 the notion of themes in user defined windows. One such platform is
9020 GTK+ where windows can have (very colourful) backgrounds defined by a
9021 user's selected theme.
9022
9023 Dialogs, notebook pages and the status bar have this flag set to true
9024 by default so that the default look and feel is simulated best.
9025 """
5b5c9bc7 9026 return _core_.Window_SetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
9027
9028 def GetThemeEnabled(*args, **kwargs):
9029 """
9030 GetThemeEnabled(self) -> bool
9031
9032 Return the themeEnabled flag.
9033 """
5b5c9bc7 9034 return _core_.Window_GetThemeEnabled(*args, **kwargs)
d55e5bfc
RD
9035
9036 def SetFocus(*args, **kwargs):
9037 """
9038 SetFocus(self)
9039
9040 Set's the focus to this window, allowing it to receive keyboard input.
9041 """
5b5c9bc7 9042 return _core_.Window_SetFocus(*args, **kwargs)
d55e5bfc
RD
9043
9044 def SetFocusFromKbd(*args, **kwargs):
9045 """
9046 SetFocusFromKbd(self)
9047
9048 Set focus to this window as the result of a keyboard action. Normally
9049 only called internally.
9050 """
5b5c9bc7 9051 return _core_.Window_SetFocusFromKbd(*args, **kwargs)
d55e5bfc
RD
9052
9053 def FindFocus(*args, **kwargs):
9054 """
5b5c9bc7 9055 FindFocus() -> Window
d55e5bfc
RD
9056
9057 Returns the window or control that currently has the keyboard focus,
9058 or None.
9059 """
5b5c9bc7 9060 return _core_.Window_FindFocus(*args, **kwargs)
d55e5bfc
RD
9061
9062 FindFocus = staticmethod(FindFocus)
9063 def AcceptsFocus(*args, **kwargs):
9064 """
9065 AcceptsFocus(self) -> bool
9066
9067 Can this window have focus?
9068 """
5b5c9bc7 9069 return _core_.Window_AcceptsFocus(*args, **kwargs)
d55e5bfc 9070
cbfc9df6
RD
9071 def CanAcceptFocus(*args, **kwargs):
9072 """
9073 CanAcceptFocus(self) -> bool
9074
9075 Can this window have focus right now?
9076 """
9077 return _core_.Window_CanAcceptFocus(*args, **kwargs)
9078
d55e5bfc
RD
9079 def AcceptsFocusFromKeyboard(*args, **kwargs):
9080 """
9081 AcceptsFocusFromKeyboard(self) -> bool
9082
9083 Can this window be given focus by keyboard navigation? if not, the
9084 only way to give it focus (provided it accepts it at all) is to click
9085 it.
9086 """
5b5c9bc7 9087 return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
d55e5bfc 9088
cbfc9df6
RD
9089 def CanAcceptFocusFromKeyboard(*args, **kwargs):
9090 """
9091 CanAcceptFocusFromKeyboard(self) -> bool
9092
9093 Can this window be assigned focus from keyboard right now?
9094 """
9095 return _core_.Window_CanAcceptFocusFromKeyboard(*args, **kwargs)
9096
9097 def NavigateIn(*args, **kwargs):
9098 """
9099 NavigateIn(self, int flags=NavigationKeyEvent.IsForward) -> bool
9100
9101 Navigates inside this window.
9102 """
9103 return _core_.Window_NavigateIn(*args, **kwargs)
9104
908b74cd
RD
9105 def Navigate(*args, **kwargs):
9106 """
9107 Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
9108
cbfc9df6
RD
9109 Does keyboard navigation starting from this window to another. This is
9110 equivalient to self.GetParent().NavigateIn().
908b74cd 9111 """
5b5c9bc7 9112 return _core_.Window_Navigate(*args, **kwargs)
908b74cd 9113
bf26d883
RD
9114 def MoveAfterInTabOrder(*args, **kwargs):
9115 """
5b5c9bc7 9116 MoveAfterInTabOrder(self, Window win)
bf26d883
RD
9117
9118 Moves this window in the tab navigation order after the specified
9119 sibling window. This means that when the user presses the TAB key on
9120 that other window, the focus switches to this window.
9121
9122 The default tab order is the same as creation order. This function
9123 and `MoveBeforeInTabOrder` allow to change it after creating all the
9124 windows.
9125
9126 """
5b5c9bc7 9127 return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
bf26d883
RD
9128
9129 def MoveBeforeInTabOrder(*args, **kwargs):
9130 """
5b5c9bc7 9131 MoveBeforeInTabOrder(self, Window win)
bf26d883
RD
9132
9133 Same as `MoveAfterInTabOrder` except that it inserts this window just
9134 before win instead of putting it right after it.
9135 """
5b5c9bc7 9136 return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
bf26d883 9137
d55e5bfc
RD
9138 def GetChildren(*args, **kwargs):
9139 """
9140 GetChildren(self) -> PyObject
9141
9142 Returns a list of the window's children. NOTE: Currently this is a
9143 copy of the child window list maintained by the window, so the return
9144 value of this function is only valid as long as the window's children
9145 do not change.
9146 """
5b5c9bc7 9147 return _core_.Window_GetChildren(*args, **kwargs)
d55e5bfc
RD
9148
9149 def GetParent(*args, **kwargs):
9150 """
5b5c9bc7 9151 GetParent(self) -> Window
d55e5bfc
RD
9152
9153 Returns the parent window of this window, or None if there isn't one.
9154 """
5b5c9bc7 9155 return _core_.Window_GetParent(*args, **kwargs)
d55e5bfc
RD
9156
9157 def GetGrandParent(*args, **kwargs):
9158 """
5b5c9bc7 9159 GetGrandParent(self) -> Window
d55e5bfc 9160
15817c7e
RD
9161 Returns the parent of the parent of this window, or None if there
9162 isn't one.
d55e5bfc 9163 """
5b5c9bc7 9164 return _core_.Window_GetGrandParent(*args, **kwargs)
d55e5bfc 9165
cbfc9df6
RD
9166 def GetTopLevelParent(*args, **kwargs):
9167 """
9168 GetTopLevelParent(self) -> Window
9169
9170 Returns the first frame or dialog in this window's parental hierarchy.
9171 """
9172 return _core_.Window_GetTopLevelParent(*args, **kwargs)
9173
d55e5bfc
RD
9174 def IsTopLevel(*args, **kwargs):
9175 """
9176 IsTopLevel(self) -> bool
9177
9178 Returns true if the given window is a top-level one. Currently all
9179 frames and dialogs are always considered to be top-level windows (even
9180 if they have a parent window).
9181 """
5b5c9bc7 9182 return _core_.Window_IsTopLevel(*args, **kwargs)
d55e5bfc
RD
9183
9184 def Reparent(*args, **kwargs):
9185 """
5b5c9bc7 9186 Reparent(self, Window newParent) -> bool
d55e5bfc
RD
9187
9188 Reparents the window, i.e the window will be removed from its current
9189 parent window (e.g. a non-standard toolbar in a wxFrame) and then
9190 re-inserted into another. Available on Windows and GTK. Returns True
9191 if the parent was changed, False otherwise (error or newParent ==
9192 oldParent)
9193 """
5b5c9bc7 9194 return _core_.Window_Reparent(*args, **kwargs)
d55e5bfc
RD
9195
9196 def AddChild(*args, **kwargs):
9197 """
5b5c9bc7 9198 AddChild(self, Window child)
d55e5bfc
RD
9199
9200 Adds a child window. This is called automatically by window creation
9201 functions so should not be required by the application programmer.
9202 """
5b5c9bc7 9203 return _core_.Window_AddChild(*args, **kwargs)
d55e5bfc
RD
9204
9205 def RemoveChild(*args, **kwargs):
9206 """
5b5c9bc7 9207 RemoveChild(self, Window child)
d55e5bfc
RD
9208
9209 Removes a child window. This is called automatically by window
9210 deletion functions so should not be required by the application
9211 programmer.
9212 """
5b5c9bc7 9213 return _core_.Window_RemoveChild(*args, **kwargs)
d55e5bfc 9214
704eda0c
RD
9215 def SetDoubleBuffered(*args, **kwargs):
9216 """
9217 SetDoubleBuffered(self, bool on)
9218
9219 Currently wxGTK2 only.
9220 """
9221 return _core_.Window_SetDoubleBuffered(*args, **kwargs)
9222
d55e5bfc
RD
9223 def FindWindowById(*args, **kwargs):
9224 """
5b5c9bc7 9225 FindWindowById(self, long winid) -> Window
d55e5bfc
RD
9226
9227 Find a chld of this window by window ID
9228 """
5b5c9bc7 9229 return _core_.Window_FindWindowById(*args, **kwargs)
d55e5bfc
RD
9230
9231 def FindWindowByName(*args, **kwargs):
9232 """
5b5c9bc7 9233 FindWindowByName(self, String name) -> Window
d55e5bfc
RD
9234
9235 Find a child of this window by name
9236 """
5b5c9bc7 9237 return _core_.Window_FindWindowByName(*args, **kwargs)
d55e5bfc
RD
9238
9239 def GetEventHandler(*args, **kwargs):
9240 """
5b5c9bc7 9241 GetEventHandler(self) -> EvtHandler
d55e5bfc
RD
9242
9243 Returns the event handler for this window. By default, the window is
9244 its own event handler.
9245 """
5b5c9bc7 9246 return _core_.Window_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
9247
9248 def SetEventHandler(*args, **kwargs):
9249 """
5b5c9bc7 9250 SetEventHandler(self, EvtHandler handler)
d55e5bfc
RD
9251
9252 Sets the event handler for this window. An event handler is an object
d49bdf34
RD
9253 that is capable of processing the events sent to a window. (In other
9254 words, is able to dispatch the events to handler function.) By
9255 default, the window is its own event handler, but an application may
9256 wish to substitute another, for example to allow central
9257 implementation of event-handling for a variety of different window
9258 classes.
d55e5bfc 9259
15817c7e 9260 It is usually better to use `wx.Window.PushEventHandler` since this sets
d55e5bfc 9261 up a chain of event handlers, where an event not handled by one event
d49bdf34 9262 handler is handed off to the next one in the chain.
d55e5bfc 9263 """
5b5c9bc7 9264 return _core_.Window_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
9265
9266 def PushEventHandler(*args, **kwargs):
9267 """
5b5c9bc7 9268 PushEventHandler(self, EvtHandler handler)
d55e5bfc
RD
9269
9270 Pushes this event handler onto the event handler stack for the window.
9271 An event handler is an object that is capable of processing the events
d49bdf34
RD
9272 sent to a window. (In other words, is able to dispatch the events to
9273 handler function.) By default, the window is its own event handler,
9274 but an application may wish to substitute another, for example to
9275 allow central implementation of event-handling for a variety of
9276 different window classes.
d55e5bfc
RD
9277
9278 wx.Window.PushEventHandler allows an application to set up a chain of
9279 event handlers, where an event not handled by one event handler is
d49bdf34
RD
9280 handed to the next one in the chain. Use `wx.Window.PopEventHandler`
9281 to remove the event handler. Ownership of the handler is *not* given
9282 to the window, so you should be sure to pop the handler before the
9283 window is destroyed and either let PopEventHandler destroy it, or call
9284 its Destroy method yourself.
d55e5bfc 9285 """
5b5c9bc7 9286 return _core_.Window_PushEventHandler(*args, **kwargs)
d55e5bfc
RD
9287
9288 def PopEventHandler(*args, **kwargs):
9289 """
5b5c9bc7 9290 PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
d55e5bfc
RD
9291
9292 Removes and returns the top-most event handler on the event handler
9293 stack. If deleteHandler is True then the wx.EvtHandler object will be
d49bdf34 9294 destroyed after it is popped, and ``None`` will be returned instead.
d55e5bfc 9295 """
5b5c9bc7 9296 return _core_.Window_PopEventHandler(*args, **kwargs)
d55e5bfc
RD
9297
9298 def RemoveEventHandler(*args, **kwargs):
9299 """
5b5c9bc7 9300 RemoveEventHandler(self, EvtHandler handler) -> bool
d55e5bfc 9301
15817c7e 9302 Find the given handler in the event handler chain and remove (but not
d49bdf34 9303 delete) it from the event handler chain, returns True if it was found
15817c7e
RD
9304 and False otherwise (this also results in an assert failure so this
9305 function should only be called when the handler is supposed to be
9306 there.)
d55e5bfc 9307 """
5b5c9bc7 9308 return _core_.Window_RemoveEventHandler(*args, **kwargs)
d55e5bfc
RD
9309
9310 def SetValidator(*args, **kwargs):
9311 """
5b5c9bc7 9312 SetValidator(self, Validator validator)
d55e5bfc
RD
9313
9314 Deletes the current validator (if any) and sets the window validator,
9315 having called wx.Validator.Clone to create a new validator of this
9316 type.
9317 """
5b5c9bc7 9318 return _core_.Window_SetValidator(*args, **kwargs)
d55e5bfc
RD
9319
9320 def GetValidator(*args, **kwargs):
9321 """
5b5c9bc7 9322 GetValidator(self) -> Validator
d55e5bfc
RD
9323
9324 Returns a pointer to the current validator for the window, or None if
9325 there is none.
9326 """
5b5c9bc7 9327 return _core_.Window_GetValidator(*args, **kwargs)
d55e5bfc
RD
9328
9329 def Validate(*args, **kwargs):
9330 """
9331 Validate(self) -> bool
9332
9333 Validates the current values of the child controls using their
15817c7e
RD
9334 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9335 style flag set, the method will also call Validate() of all child
9336 windows. Returns false if any of the validations failed.
d55e5bfc 9337 """
5b5c9bc7 9338 return _core_.Window_Validate(*args, **kwargs)
d55e5bfc
RD
9339
9340 def TransferDataToWindow(*args, **kwargs):
9341 """
9342 TransferDataToWindow(self) -> bool
9343
15817c7e
RD
9344 Transfers values to child controls from data areas specified by their
9345 validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra
9346 style flag set, the method will also call TransferDataToWindow() of
9347 all child windows.
d55e5bfc 9348 """
5b5c9bc7 9349 return _core_.Window_TransferDataToWindow(*args, **kwargs)
d55e5bfc
RD
9350
9351 def TransferDataFromWindow(*args, **kwargs):
9352 """
9353 TransferDataFromWindow(self) -> bool
9354
15817c7e
RD
9355 Transfers values from child controls to data areas specified by their
9356 validators. Returns false if a transfer failed. If the window has
9357 wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will
9358 also call TransferDataFromWindow() of all child windows.
d55e5bfc 9359 """
5b5c9bc7 9360 return _core_.Window_TransferDataFromWindow(*args, **kwargs)
d55e5bfc
RD
9361
9362 def InitDialog(*args, **kwargs):
9363 """
9364 InitDialog(self)
9365
15817c7e
RD
9366 Sends an EVT_INIT_DIALOG event, whose handler usually transfers data
9367 to the dialog via validators.
d55e5bfc 9368 """
5b5c9bc7 9369 return _core_.Window_InitDialog(*args, **kwargs)
d55e5bfc
RD
9370
9371 def SetAcceleratorTable(*args, **kwargs):
9372 """
5b5c9bc7 9373 SetAcceleratorTable(self, AcceleratorTable accel)
d55e5bfc
RD
9374
9375 Sets the accelerator table for this window.
9376 """
5b5c9bc7 9377 return _core_.Window_SetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
9378
9379 def GetAcceleratorTable(*args, **kwargs):
9380 """
5b5c9bc7 9381 GetAcceleratorTable(self) -> AcceleratorTable
d55e5bfc
RD
9382
9383 Gets the accelerator table for this window.
9384 """
5b5c9bc7 9385 return _core_.Window_GetAcceleratorTable(*args, **kwargs)
d55e5bfc
RD
9386
9387 def RegisterHotKey(*args, **kwargs):
9388 """
9389 RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
9390
9391 Registers a system wide hotkey. Every time the user presses the hotkey
9392 registered here, this window will receive a hotkey event. It will
9393 receive the event even if the application is in the background and
9394 does not have the input focus because the user is working with some
9395 other application. To bind an event handler function to this hotkey
9396 use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
9397 hotkey was registered successfully.
9398 """
5b5c9bc7 9399 return _core_.Window_RegisterHotKey(*args, **kwargs)
d55e5bfc
RD
9400
9401 def UnregisterHotKey(*args, **kwargs):
9402 """
9403 UnregisterHotKey(self, int hotkeyId) -> bool
9404
9405 Unregisters a system wide hotkey.
9406 """
5b5c9bc7 9407 return _core_.Window_UnregisterHotKey(*args, **kwargs)
d55e5bfc
RD
9408
9409 def ConvertDialogPointToPixels(*args, **kwargs):
9410 """
5b5c9bc7 9411 ConvertDialogPointToPixels(self, Point pt) -> Point
d55e5bfc
RD
9412
9413 Converts a point or size from dialog units to pixels. Dialog units
9414 are used for maintaining a dialog's proportions even if the font
9415 changes. For the x dimension, the dialog units are multiplied by the
9416 average character width and then divided by 4. For the y dimension,
9417 the dialog units are multiplied by the average character height and
9418 then divided by 8.
9419 """
5b5c9bc7 9420 return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
d55e5bfc
RD
9421
9422 def ConvertDialogSizeToPixels(*args, **kwargs):
9423 """
5b5c9bc7 9424 ConvertDialogSizeToPixels(self, Size sz) -> Size
d55e5bfc
RD
9425
9426 Converts a point or size from dialog units to pixels. Dialog units
9427 are used for maintaining a dialog's proportions even if the font
9428 changes. For the x dimension, the dialog units are multiplied by the
9429 average character width and then divided by 4. For the y dimension,
9430 the dialog units are multiplied by the average character height and
9431 then divided by 8.
9432 """
5b5c9bc7 9433 return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
d55e5bfc
RD
9434
9435 def DLG_PNT(*args, **kwargs):
9436 """
5b5c9bc7 9437 DLG_PNT(self, Point pt) -> Point
d55e5bfc
RD
9438
9439 Converts a point or size from dialog units to pixels. Dialog units
9440 are used for maintaining a dialog's proportions even if the font
9441 changes. For the x dimension, the dialog units are multiplied by the
9442 average character width and then divided by 4. For the y dimension,
9443 the dialog units are multiplied by the average character height and
9444 then divided by 8.
9445 """
5b5c9bc7 9446 return _core_.Window_DLG_PNT(*args, **kwargs)
d55e5bfc
RD
9447
9448 def DLG_SZE(*args, **kwargs):
9449 """
5b5c9bc7 9450 DLG_SZE(self, Size sz) -> Size
d55e5bfc
RD
9451
9452 Converts a point or size from dialog units to pixels. Dialog units
9453 are used for maintaining a dialog's proportions even if the font
9454 changes. For the x dimension, the dialog units are multiplied by the
9455 average character width and then divided by 4. For the y dimension,
9456 the dialog units are multiplied by the average character height and
9457 then divided by 8.
9458 """
5b5c9bc7 9459 return _core_.Window_DLG_SZE(*args, **kwargs)
d55e5bfc
RD
9460
9461 def ConvertPixelPointToDialog(*args, **kwargs):
5b5c9bc7
RD
9462 """ConvertPixelPointToDialog(self, Point pt) -> Point"""
9463 return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
d55e5bfc
RD
9464
9465 def ConvertPixelSizeToDialog(*args, **kwargs):
5b5c9bc7
RD
9466 """ConvertPixelSizeToDialog(self, Size sz) -> Size"""
9467 return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
d55e5bfc
RD
9468
9469 def WarpPointer(*args, **kwargs):
9470 """
9471 WarpPointer(self, int x, int y)
9472
9473 Moves the pointer to the given position on the window.
9474
9475 NOTE: This function is not supported under Mac because Apple Human
9476 Interface Guidelines forbid moving the mouse cursor programmatically.
9477 """
5b5c9bc7 9478 return _core_.Window_WarpPointer(*args, **kwargs)
d55e5bfc
RD
9479
9480 def CaptureMouse(*args, **kwargs):
9481 """
9482 CaptureMouse(self)
9483
9484 Directs all mouse input to this window. Call wx.Window.ReleaseMouse to
9485 release the capture.
9486
9487 Note that wxWindows maintains the stack of windows having captured the
9488 mouse and when the mouse is released the capture returns to the window
9489 which had had captured it previously and it is only really released if
9490 there were no previous window. In particular, this means that you must
34e0a3bb
RD
9491 release the mouse as many times as you capture it, unless the window
9492 receives the `wx.MouseCaptureLostEvent` event.
9493
9494 Any application which captures the mouse in the beginning of some
9495 operation *must* handle `wx.MouseCaptureLostEvent` and cancel this
9496 operation when it receives the event. The event handler must not
9497 recapture mouse.
d55e5bfc 9498 """
5b5c9bc7 9499 return _core_.Window_CaptureMouse(*args, **kwargs)
d55e5bfc
RD
9500
9501 def ReleaseMouse(*args, **kwargs):
9502 """
9503 ReleaseMouse(self)
9504
9505 Releases mouse input captured with wx.Window.CaptureMouse.
9506 """
5b5c9bc7 9507 return _core_.Window_ReleaseMouse(*args, **kwargs)
d55e5bfc
RD
9508
9509 def GetCapture(*args, **kwargs):
9510 """
5b5c9bc7 9511 GetCapture() -> Window
d55e5bfc
RD
9512
9513 Returns the window which currently captures the mouse or None
9514 """
5b5c9bc7 9515 return _core_.Window_GetCapture(*args, **kwargs)
d55e5bfc
RD
9516
9517 GetCapture = staticmethod(GetCapture)
9518 def HasCapture(*args, **kwargs):
9519 """
9520 HasCapture(self) -> bool
9521
9522 Returns true if this window has the current mouse capture.
9523 """
5b5c9bc7 9524 return _core_.Window_HasCapture(*args, **kwargs)
d55e5bfc
RD
9525
9526 def Refresh(*args, **kwargs):
9527 """
5b5c9bc7 9528 Refresh(self, bool eraseBackground=True, Rect rect=None)
d55e5bfc
RD
9529
9530 Mark the specified rectangle (or the whole window) as "dirty" so it
9531 will be repainted. Causes an EVT_PAINT event to be generated and sent
9532 to the window.
9533 """
5b5c9bc7 9534 return _core_.Window_Refresh(*args, **kwargs)
d55e5bfc
RD
9535
9536 def RefreshRect(*args, **kwargs):
9537 """
5b5c9bc7 9538 RefreshRect(self, Rect rect, bool eraseBackground=True)
d55e5bfc
RD
9539
9540 Redraws the contents of the given rectangle: the area inside it will
9541 be repainted. This is the same as Refresh but has a nicer syntax.
9542 """
5b5c9bc7 9543 return _core_.Window_RefreshRect(*args, **kwargs)
d55e5bfc
RD
9544
9545 def Update(*args, **kwargs):
9546 """
9547 Update(self)
9548
9549 Calling this method immediately repaints the invalidated area of the
9550 window instead of waiting for the EVT_PAINT event to happen, (normally
9551 this would usually only happen when the flow of control returns to the
9552 event loop.) Notice that this function doesn't refresh the window and
9b940138 9553 does nothing if the window has been already repainted. Use `Refresh`
d55e5bfc
RD
9554 first if you want to immediately redraw the window (or some portion of
9555 it) unconditionally.
9556 """
5b5c9bc7 9557 return _core_.Window_Update(*args, **kwargs)
d55e5bfc
RD
9558
9559 def ClearBackground(*args, **kwargs):
9560 """
9561 ClearBackground(self)
9562
9563 Clears the window by filling it with the current background
9564 colour. Does not cause an erase background event to be generated.
9565 """
5b5c9bc7 9566 return _core_.Window_ClearBackground(*args, **kwargs)
d55e5bfc
RD
9567
9568 def Freeze(*args, **kwargs):
9569 """
9570 Freeze(self)
9571
15817c7e
RD
9572 Freezes the window or, in other words, prevents any updates from
9573 taking place on screen, the window is not redrawn at all. Thaw must be
9574 called to reenable window redrawing. Calls to Freeze/Thaw may be
9575 nested, with the actual Thaw being delayed until all the nesting has
9576 been undone.
d55e5bfc
RD
9577
9578 This method is useful for visual appearance optimization (for example,
9579 it is a good idea to use it before inserting large amount of text into
9580 a wxTextCtrl under wxGTK) but is not implemented on all platforms nor
9581 for all controls so it is mostly just a hint to wxWindows and not a
9582 mandatory directive.
9583 """
5b5c9bc7 9584 return _core_.Window_Freeze(*args, **kwargs)
d55e5bfc 9585
33d6fd3b
RD
9586 def IsFrozen(*args, **kwargs):
9587 """
9588 IsFrozen(self) -> bool
9589
9590 Returns ``True`` if the window has been frozen and not thawed yet.
9591
9592 :see: `Freeze` and `Thaw`
9593 """
9594 return _core_.Window_IsFrozen(*args, **kwargs)
9595
d55e5bfc
RD
9596 def Thaw(*args, **kwargs):
9597 """
9598 Thaw(self)
9599
9600 Reenables window updating after a previous call to Freeze. Calls to
15817c7e
RD
9601 Freeze/Thaw may be nested, so Thaw must be called the same number of
9602 times that Freeze was before the window will be updated.
d55e5bfc 9603 """
5b5c9bc7 9604 return _core_.Window_Thaw(*args, **kwargs)
d55e5bfc
RD
9605
9606 def PrepareDC(*args, **kwargs):
9607 """
5b5c9bc7 9608 PrepareDC(self, DC dc)
d55e5bfc
RD
9609
9610 Call this function to prepare the device context for drawing a
9611 scrolled image. It sets the device origin according to the current
9612 scroll position.
9613 """
5b5c9bc7 9614 return _core_.Window_PrepareDC(*args, **kwargs)
d55e5bfc 9615
b39fe951
RD
9616 def IsDoubleBuffered(*args, **kwargs):
9617 """
9618 IsDoubleBuffered(self) -> bool
9619
9620 Returns ``True`` if the window contents is double-buffered by the
9621 system, i.e. if any drawing done on the window is really done on a
9622 temporary backing surface and transferred to the screen all at once
9623 later.
9624 """
9625 return _core_.Window_IsDoubleBuffered(*args, **kwargs)
9626
d55e5bfc
RD
9627 def GetUpdateRegion(*args, **kwargs):
9628 """
5b5c9bc7 9629 GetUpdateRegion(self) -> Region
d55e5bfc
RD
9630
9631 Returns the region specifying which parts of the window have been
9632 damaged. Should only be called within an EVT_PAINT handler.
9633 """
5b5c9bc7 9634 return _core_.Window_GetUpdateRegion(*args, **kwargs)
d55e5bfc
RD
9635
9636 def GetUpdateClientRect(*args, **kwargs):
9637 """
5b5c9bc7 9638 GetUpdateClientRect(self) -> Rect
d55e5bfc
RD
9639
9640 Get the update rectangle region bounding box in client coords.
9641 """
5b5c9bc7 9642 return _core_.Window_GetUpdateClientRect(*args, **kwargs)
d55e5bfc
RD
9643
9644 def IsExposed(*args, **kwargs):
9645 """
9646 IsExposed(self, int x, int y, int w=1, int h=1) -> bool
9647
9648 Returns true if the given point or rectangle area has been exposed
9649 since the last repaint. Call this in an paint event handler to
9650 optimize redrawing by only redrawing those areas, which have been
9651 exposed.
9652 """
5b5c9bc7 9653 return _core_.Window_IsExposed(*args, **kwargs)
d55e5bfc
RD
9654
9655 def IsExposedPoint(*args, **kwargs):
9656 """
5b5c9bc7 9657 IsExposedPoint(self, Point pt) -> bool
d55e5bfc
RD
9658
9659 Returns true if the given point or rectangle area has been exposed
9660 since the last repaint. Call this in an paint event handler to
9661 optimize redrawing by only redrawing those areas, which have been
9662 exposed.
9663 """
5b5c9bc7 9664 return _core_.Window_IsExposedPoint(*args, **kwargs)
d55e5bfc
RD
9665
9666 def IsExposedRect(*args, **kwargs):
9667 """
5b5c9bc7 9668 IsExposedRect(self, Rect rect) -> bool
d55e5bfc
RD
9669
9670 Returns true if the given point or rectangle area has been exposed
9671 since the last repaint. Call this in an paint event handler to
9672 optimize redrawing by only redrawing those areas, which have been
9673 exposed.
9674 """
5b5c9bc7 9675 return _core_.Window_IsExposedRect(*args, **kwargs)
d55e5bfc
RD
9676
9677 def GetDefaultAttributes(*args, **kwargs):
9678 """
5b5c9bc7 9679 GetDefaultAttributes(self) -> VisualAttributes
d55e5bfc 9680
15817c7e
RD
9681 Get the default attributes for an instance of this class. This is
9682 useful if you want to use the same font or colour in your own control
9683 as in a standard control -- which is a much better idea than hard
9684 coding specific colours or fonts which might look completely out of
a5ee0656 9685 place on the user's system, especially if it uses themes.
d55e5bfc 9686 """
5b5c9bc7 9687 return _core_.Window_GetDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9688
9689 def GetClassDefaultAttributes(*args, **kwargs):
9690 """
5b5c9bc7 9691 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 9692
15817c7e
RD
9693 Get the default attributes for this class. This is useful if you want
9694 to use the same font or colour in your own control as in a standard
9695 control -- which is a much better idea than hard coding specific
a5ee0656
RD
9696 colours or fonts which might look completely out of place on the
9697 user's system, especially if it uses themes.
d55e5bfc
RD
9698
9699 The variant parameter is only relevant under Mac currently and is
15817c7e 9700 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
9701 the returned font. See `wx.Window.SetWindowVariant` for more about
9702 this.
d55e5bfc 9703 """
5b5c9bc7 9704 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
9705
9706 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
9707 def SetBackgroundColour(*args, **kwargs):
9708 """
5b5c9bc7 9709 SetBackgroundColour(self, Colour colour) -> bool
d55e5bfc
RD
9710
9711 Sets the background colour of the window. Returns True if the colour
9712 was changed. The background colour is usually painted by the default
9713 EVT_ERASE_BACKGROUND event handler function under Windows and
f8167d6e
RD
9714 automatically under GTK. Using `wx.NullColour` will reset the window
9715 to the default background colour.
d55e5bfc 9716
a5ee0656 9717 Note that setting the background colour may not cause an immediate
f8167d6e 9718 refresh, so you may wish to call `ClearBackground` or `Refresh` after
d55e5bfc
RD
9719 calling this function.
9720
f8167d6e
RD
9721 Using this function will disable attempts to use themes for this
9722 window, if the system supports them. Use with care since usually the
9723 themes represent the appearance chosen by the user to be used for all
9724 applications on the system.
d55e5bfc 9725 """
5b5c9bc7 9726 return _core_.Window_SetBackgroundColour(*args, **kwargs)
d55e5bfc 9727
412d302d 9728 def SetOwnBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
9729 """SetOwnBackgroundColour(self, Colour colour)"""
9730 return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9731
9732 def SetForegroundColour(*args, **kwargs):
9733 """
5b5c9bc7 9734 SetForegroundColour(self, Colour colour) -> bool
d55e5bfc
RD
9735
9736 Sets the foreground colour of the window. Returns True is the colour
9737 was changed. The interpretation of foreground colour is dependent on
9738 the window class; it may be the text colour or other colour, or it may
9739 not be used at all.
9740 """
5b5c9bc7 9741 return _core_.Window_SetForegroundColour(*args, **kwargs)
d55e5bfc 9742
fa47d7a7 9743 def SetOwnForegroundColour(*args, **kwargs):
5b5c9bc7
RD
9744 """SetOwnForegroundColour(self, Colour colour)"""
9745 return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
d55e5bfc
RD
9746
9747 def GetBackgroundColour(*args, **kwargs):
9748 """
5b5c9bc7 9749 GetBackgroundColour(self) -> Colour
d55e5bfc
RD
9750
9751 Returns the background colour of the window.
9752 """
5b5c9bc7 9753 return _core_.Window_GetBackgroundColour(*args, **kwargs)
d55e5bfc
RD
9754
9755 def GetForegroundColour(*args, **kwargs):
9756 """
5b5c9bc7 9757 GetForegroundColour(self) -> Colour
d55e5bfc
RD
9758
9759 Returns the foreground colour of the window. The interpretation of
9760 foreground colour is dependent on the window class; it may be the text
9761 colour or other colour, or it may not be used at all.
9762 """
5b5c9bc7 9763 return _core_.Window_GetForegroundColour(*args, **kwargs)
d55e5bfc 9764
dcb8fc74
RD
9765 def InheritsBackgroundColour(*args, **kwargs):
9766 """InheritsBackgroundColour(self) -> bool"""
5b5c9bc7 9767 return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
dcb8fc74
RD
9768
9769 def UseBgCol(*args, **kwargs):
9770 """UseBgCol(self) -> bool"""
5b5c9bc7 9771 return _core_.Window_UseBgCol(*args, **kwargs)
dcb8fc74 9772
0f63ec68
RD
9773 def SetBackgroundStyle(*args, **kwargs):
9774 """
9775 SetBackgroundStyle(self, int style) -> bool
9776
9777 Returns the background style of the window. The background style
9778 indicates how the background of the window is drawn.
9779
9780 ====================== ========================================
9781 wx.BG_STYLE_SYSTEM The background colour or pattern should
9782 be determined by the system
9783 wx.BG_STYLE_COLOUR The background should be a solid colour
9784 wx.BG_STYLE_CUSTOM The background will be implemented by the
9785 application.
9786 ====================== ========================================
9787
9788 On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of
9789 a custom background, such as a tiled bitmap. Currently the style has
9790 no effect on other platforms.
9791
9792 :see: `GetBackgroundStyle`, `SetBackgroundColour`
9793 """
5b5c9bc7 9794 return _core_.Window_SetBackgroundStyle(*args, **kwargs)
0f63ec68
RD
9795
9796 def GetBackgroundStyle(*args, **kwargs):
9797 """
9798 GetBackgroundStyle(self) -> int
9799
9800 Returns the background style of the window.
9801
9802 :see: `SetBackgroundStyle`
9803 """
5b5c9bc7 9804 return _core_.Window_GetBackgroundStyle(*args, **kwargs)
0f63ec68 9805
51b83b37
RD
9806 def HasTransparentBackground(*args, **kwargs):
9807 """
9808 HasTransparentBackground(self) -> bool
9809
9810 Returns True if this window's background is transparent (as, for
9811 example, for `wx.StaticText`) and should show the parent window's
9812 background.
9813
9814 This method is mostly used internally by the library itself and you
9815 normally shouldn't have to call it. You may, however, have to override
9816 it in your custom control classes to ensure that background is painted
9817 correctly.
9818 """
5b5c9bc7 9819 return _core_.Window_HasTransparentBackground(*args, **kwargs)
51b83b37 9820
d55e5bfc
RD
9821 def SetCursor(*args, **kwargs):
9822 """
5b5c9bc7 9823 SetCursor(self, Cursor cursor) -> bool
d55e5bfc
RD
9824
9825 Sets the window's cursor. Notice that the window cursor also sets it
9826 for the children of the window implicitly.
9827
9828 The cursor may be wx.NullCursor in which case the window cursor will
9829 be reset back to default.
9830 """
5b5c9bc7 9831 return _core_.Window_SetCursor(*args, **kwargs)
d55e5bfc
RD
9832
9833 def GetCursor(*args, **kwargs):
9834 """
5b5c9bc7 9835 GetCursor(self) -> Cursor
d55e5bfc
RD
9836
9837 Return the cursor associated with this window.
9838 """
5b5c9bc7 9839 return _core_.Window_GetCursor(*args, **kwargs)
d55e5bfc
RD
9840
9841 def SetFont(*args, **kwargs):
9842 """
5b5c9bc7 9843 SetFont(self, Font font) -> bool
d55e5bfc
RD
9844
9845 Sets the font for this window.
9846 """
5b5c9bc7 9847 return _core_.Window_SetFont(*args, **kwargs)
d55e5bfc 9848
fa47d7a7 9849 def SetOwnFont(*args, **kwargs):
5b5c9bc7
RD
9850 """SetOwnFont(self, Font font)"""
9851 return _core_.Window_SetOwnFont(*args, **kwargs)
d55e5bfc
RD
9852
9853 def GetFont(*args, **kwargs):
9854 """
5b5c9bc7 9855 GetFont(self) -> Font
d55e5bfc
RD
9856
9857 Returns the default font used for this window.
9858 """
5b5c9bc7 9859 return _core_.Window_GetFont(*args, **kwargs)
d55e5bfc
RD
9860
9861 def SetCaret(*args, **kwargs):
9862 """
5b5c9bc7 9863 SetCaret(self, Caret caret)
d55e5bfc
RD
9864
9865 Sets the caret associated with the window.
9866 """
5b5c9bc7 9867 return _core_.Window_SetCaret(*args, **kwargs)
d55e5bfc
RD
9868
9869 def GetCaret(*args, **kwargs):
9870 """
5b5c9bc7 9871 GetCaret(self) -> Caret
d55e5bfc
RD
9872
9873 Returns the caret associated with the window.
9874 """
5b5c9bc7 9875 return _core_.Window_GetCaret(*args, **kwargs)
d55e5bfc
RD
9876
9877 def GetCharHeight(*args, **kwargs):
9878 """
9879 GetCharHeight(self) -> int
9880
9881 Get the (average) character size for the current font.
9882 """
5b5c9bc7 9883 return _core_.Window_GetCharHeight(*args, **kwargs)
d55e5bfc
RD
9884
9885 def GetCharWidth(*args, **kwargs):
9886 """
9887 GetCharWidth(self) -> int
9888
9889 Get the (average) character size for the current font.
9890 """
5b5c9bc7 9891 return _core_.Window_GetCharWidth(*args, **kwargs)
d55e5bfc
RD
9892
9893 def GetTextExtent(*args, **kwargs):
fd2dc343
RD
9894 """
9895 GetTextExtent(String string) -> (width, height)
9896
9897 Get the width and height of the text using the current font.
9898 """
5b5c9bc7 9899 return _core_.Window_GetTextExtent(*args, **kwargs)
d55e5bfc
RD
9900
9901 def GetFullTextExtent(*args, **kwargs):
9902 """
9903 GetFullTextExtent(String string, Font font=None) ->
9904 (width, height, descent, externalLeading)
9905
9906 Get the width, height, decent and leading of the text using the
9907 current or specified font.
9908 """
5b5c9bc7 9909 return _core_.Window_GetFullTextExtent(*args, **kwargs)
d55e5bfc
RD
9910
9911 def ClientToScreenXY(*args, **kwargs):
9912 """
9913 ClientToScreenXY(int x, int y) -> (x,y)
9914
9915 Converts to screen coordinates from coordinates relative to this window.
9916 """
5b5c9bc7 9917 return _core_.Window_ClientToScreenXY(*args, **kwargs)
d55e5bfc
RD
9918
9919 def ScreenToClientXY(*args, **kwargs):
9920 """
9921 ScreenToClientXY(int x, int y) -> (x,y)
9922
9923 Converts from screen to client window coordinates.
9924 """
5b5c9bc7 9925 return _core_.Window_ScreenToClientXY(*args, **kwargs)
d55e5bfc
RD
9926
9927 def ClientToScreen(*args, **kwargs):
9928 """
5b5c9bc7 9929 ClientToScreen(self, Point pt) -> Point
d55e5bfc
RD
9930
9931 Converts to screen coordinates from coordinates relative to this window.
9932 """
5b5c9bc7 9933 return _core_.Window_ClientToScreen(*args, **kwargs)
d55e5bfc
RD
9934
9935 def ScreenToClient(*args, **kwargs):
9936 """
5b5c9bc7 9937 ScreenToClient(self, Point pt) -> Point
d55e5bfc
RD
9938
9939 Converts from screen to client window coordinates.
9940 """
5b5c9bc7 9941 return _core_.Window_ScreenToClient(*args, **kwargs)
d55e5bfc
RD
9942
9943 def HitTestXY(*args, **kwargs):
9944 """
9945 HitTestXY(self, int x, int y) -> int
9946
9947 Test where the given (in client coords) point lies
9948 """
5b5c9bc7 9949 return _core_.Window_HitTestXY(*args, **kwargs)
d55e5bfc
RD
9950
9951 def HitTest(*args, **kwargs):
9952 """
5b5c9bc7 9953 HitTest(self, Point pt) -> int
d55e5bfc
RD
9954
9955 Test where the given (in client coords) point lies
9956 """
5b5c9bc7 9957 return _core_.Window_HitTest(*args, **kwargs)
d55e5bfc
RD
9958
9959 def GetBorder(*args):
9960 """
9961 GetBorder(self, long flags) -> int
9962 GetBorder(self) -> int
9963
9964 Get border for the flags of this window
9965 """
5b5c9bc7 9966 return _core_.Window_GetBorder(*args)
d55e5bfc
RD
9967
9968 def UpdateWindowUI(*args, **kwargs):
9969 """
5b5c9bc7 9970 UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
d55e5bfc
RD
9971
9972 This function sends EVT_UPDATE_UI events to the window. The particular
9973 implementation depends on the window; for example a wx.ToolBar will
9974 send an update UI event for each toolbar button, and a wx.Frame will
9975 send an update UI event for each menubar menu item. You can call this
9976 function from your application to ensure that your UI is up-to-date at
9977 a particular point in time (as far as your EVT_UPDATE_UI handlers are
9978 concerned). This may be necessary if you have called
5ba5649b 9979 `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to
d55e5bfc
RD
9980 limit the overhead that wxWindows incurs by sending update UI events
9981 in idle time.
d55e5bfc 9982 """
5b5c9bc7 9983 return _core_.Window_UpdateWindowUI(*args, **kwargs)
d55e5bfc
RD
9984
9985 def PopupMenuXY(*args, **kwargs):
9986 """
5b5c9bc7 9987 PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
d55e5bfc 9988
b0503257
RD
9989 Pops up the given menu at the specified coordinates, relative to this window,
9990 and returns control when the user has dismissed the menu. If a menu item is
9991 selected, the corresponding menu event is generated and will be processed as
9992 usual. If the default position is given then the current position of the
9993 mouse cursor will be used.
d55e5bfc 9994 """
5b5c9bc7 9995 return _core_.Window_PopupMenuXY(*args, **kwargs)
d55e5bfc
RD
9996
9997 def PopupMenu(*args, **kwargs):
9998 """
5b5c9bc7 9999 PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
d55e5bfc 10000
b0503257
RD
10001 Pops up the given menu at the specified coordinates, relative to this window,
10002 and returns control when the user has dismissed the menu. If a menu item is
10003 selected, the corresponding menu event is generated and will be processed as
10004 usual. If the default position is given then the current position of the
10005 mouse cursor will be used.
d55e5bfc 10006 """
5b5c9bc7 10007 return _core_.Window_PopupMenu(*args, **kwargs)
d55e5bfc 10008
1eeb270e
RD
10009 def HasMultiplePages(*args, **kwargs):
10010 """HasMultiplePages(self) -> bool"""
10011 return _core_.Window_HasMultiplePages(*args, **kwargs)
10012
d55e5bfc
RD
10013 def GetHandle(*args, **kwargs):
10014 """
10015 GetHandle(self) -> long
10016
10017 Returns the platform-specific handle (as a long integer) of the
10018 physical window. Currently on wxMac it returns the handle of the
10019 toplevel parent of the window.
10020 """
5b5c9bc7 10021 return _core_.Window_GetHandle(*args, **kwargs)
d55e5bfc 10022
629e65c2
RD
10023 def AssociateHandle(*args, **kwargs):
10024 """
10025 AssociateHandle(self, long handle)
10026
10027 Associate the window with a new native handle
10028 """
5b5c9bc7 10029 return _core_.Window_AssociateHandle(*args, **kwargs)
629e65c2
RD
10030
10031 def DissociateHandle(*args, **kwargs):
10032 """
10033 DissociateHandle(self)
10034
10035 Dissociate the current native handle from the window
10036 """
5b5c9bc7 10037 return _core_.Window_DissociateHandle(*args, **kwargs)
629e65c2 10038
d55e5bfc
RD
10039 def HasScrollbar(*args, **kwargs):
10040 """
10041 HasScrollbar(self, int orient) -> bool
10042
10043 Does the window have the scrollbar for this orientation?
10044 """
5b5c9bc7 10045 return _core_.Window_HasScrollbar(*args, **kwargs)
d55e5bfc
RD
10046
10047 def SetScrollbar(*args, **kwargs):
10048 """
15817c7e 10049 SetScrollbar(self, int orientation, int position, int thumbSize, int range,
d55e5bfc
RD
10050 bool refresh=True)
10051
10052 Sets the scrollbar properties of a built-in scrollbar.
d55e5bfc 10053 """
5b5c9bc7 10054 return _core_.Window_SetScrollbar(*args, **kwargs)
d55e5bfc
RD
10055
10056 def SetScrollPos(*args, **kwargs):
10057 """
10058 SetScrollPos(self, int orientation, int pos, bool refresh=True)
10059
10060 Sets the position of one of the built-in scrollbars.
10061 """
5b5c9bc7 10062 return _core_.Window_SetScrollPos(*args, **kwargs)
d55e5bfc
RD
10063
10064 def GetScrollPos(*args, **kwargs):
10065 """
10066 GetScrollPos(self, int orientation) -> int
10067
10068 Returns the built-in scrollbar position.
10069 """
5b5c9bc7 10070 return _core_.Window_GetScrollPos(*args, **kwargs)
d55e5bfc
RD
10071
10072 def GetScrollThumb(*args, **kwargs):
10073 """
10074 GetScrollThumb(self, int orientation) -> int
10075
10076 Returns the built-in scrollbar thumb size.
10077 """
5b5c9bc7 10078 return _core_.Window_GetScrollThumb(*args, **kwargs)
d55e5bfc
RD
10079
10080 def GetScrollRange(*args, **kwargs):
10081 """
10082 GetScrollRange(self, int orientation) -> int
10083
10084 Returns the built-in scrollbar range.
10085 """
5b5c9bc7 10086 return _core_.Window_GetScrollRange(*args, **kwargs)
d55e5bfc
RD
10087
10088 def ScrollWindow(*args, **kwargs):
10089 """
5b5c9bc7 10090 ScrollWindow(self, int dx, int dy, Rect rect=None)
d55e5bfc
RD
10091
10092 Physically scrolls the pixels in the window and move child windows
10093 accordingly. Use this function to optimise your scrolling
10094 implementations, to minimise the area that must be redrawn. Note that
10095 it is rarely required to call this function from a user program.
d55e5bfc 10096 """
5b5c9bc7 10097 return _core_.Window_ScrollWindow(*args, **kwargs)
d55e5bfc
RD
10098
10099 def ScrollLines(*args, **kwargs):
10100 """
10101 ScrollLines(self, int lines) -> bool
10102
10103 If the platform and window class supports it, scrolls the window by
10104 the given number of lines down, if lines is positive, or up if lines
10105 is negative. Returns True if the window was scrolled, False if it was
10106 already on top/bottom and nothing was done.
10107 """
5b5c9bc7 10108 return _core_.Window_ScrollLines(*args, **kwargs)
d55e5bfc
RD
10109
10110 def ScrollPages(*args, **kwargs):
10111 """
10112 ScrollPages(self, int pages) -> bool
10113
15817c7e 10114 If the platform and window class supports it, scrolls the window by
d55e5bfc
RD
10115 the given number of pages down, if pages is positive, or up if pages
10116 is negative. Returns True if the window was scrolled, False if it was
10117 already on top/bottom and nothing was done.
10118 """
5b5c9bc7 10119 return _core_.Window_ScrollPages(*args, **kwargs)
d55e5bfc
RD
10120
10121 def LineUp(*args, **kwargs):
10122 """
10123 LineUp(self) -> bool
10124
10125 This is just a wrapper for ScrollLines(-1).
10126 """
5b5c9bc7 10127 return _core_.Window_LineUp(*args, **kwargs)
d55e5bfc
RD
10128
10129 def LineDown(*args, **kwargs):
10130 """
10131 LineDown(self) -> bool
10132
10133 This is just a wrapper for ScrollLines(1).
10134 """
5b5c9bc7 10135 return _core_.Window_LineDown(*args, **kwargs)
d55e5bfc
RD
10136
10137 def PageUp(*args, **kwargs):
10138 """
10139 PageUp(self) -> bool
10140
10141 This is just a wrapper for ScrollPages(-1).
10142 """
5b5c9bc7 10143 return _core_.Window_PageUp(*args, **kwargs)
d55e5bfc
RD
10144
10145 def PageDown(*args, **kwargs):
10146 """
10147 PageDown(self) -> bool
10148
10149 This is just a wrapper for ScrollPages(1).
10150 """
5b5c9bc7 10151 return _core_.Window_PageDown(*args, **kwargs)
d55e5bfc
RD
10152
10153 def SetHelpText(*args, **kwargs):
10154 """
5b5c9bc7 10155 SetHelpText(self, String text)
d55e5bfc
RD
10156
10157 Sets the help text to be used as context-sensitive help for this
10158 window. Note that the text is actually stored by the current
f52cbe90 10159 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 10160 """
5b5c9bc7 10161 return _core_.Window_SetHelpText(*args, **kwargs)
d55e5bfc
RD
10162
10163 def SetHelpTextForId(*args, **kwargs):
10164 """
5b5c9bc7 10165 SetHelpTextForId(self, String text)
d55e5bfc
RD
10166
10167 Associate this help text with all windows with the same id as this
10168 one.
10169 """
5b5c9bc7 10170 return _core_.Window_SetHelpTextForId(*args, **kwargs)
d55e5bfc 10171
b850e7f3
RD
10172 def GetHelpTextAtPoint(*args, **kwargs):
10173 """
10174 GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
10175
10176 Get the help string associated with the given position in this window.
10177
10178 Notice that pt may be invalid if event origin is keyboard or unknown
10179 and this method should return the global window help text then
10180
10181 """
10182 return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
10183
d55e5bfc
RD
10184 def GetHelpText(*args, **kwargs):
10185 """
5b5c9bc7 10186 GetHelpText(self) -> String
d55e5bfc
RD
10187
10188 Gets the help text to be used as context-sensitive help for this
10189 window. Note that the text is actually stored by the current
f52cbe90 10190 `wx.HelpProvider` implementation, and not in the window object itself.
d55e5bfc 10191 """
5b5c9bc7 10192 return _core_.Window_GetHelpText(*args, **kwargs)
d55e5bfc
RD
10193
10194 def SetToolTipString(*args, **kwargs):
10195 """
5b5c9bc7 10196 SetToolTipString(self, String tip)
d55e5bfc
RD
10197
10198 Attach a tooltip to the window.
10199 """
5b5c9bc7 10200 return _core_.Window_SetToolTipString(*args, **kwargs)
d55e5bfc
RD
10201
10202 def SetToolTip(*args, **kwargs):
10203 """
5b5c9bc7 10204 SetToolTip(self, ToolTip tip)
d55e5bfc
RD
10205
10206 Attach a tooltip to the window.
10207 """
5b5c9bc7 10208 return _core_.Window_SetToolTip(*args, **kwargs)
d55e5bfc
RD
10209
10210 def GetToolTip(*args, **kwargs):
10211 """
5b5c9bc7 10212 GetToolTip(self) -> ToolTip
d55e5bfc
RD
10213
10214 get the associated tooltip or None if none
10215 """
5b5c9bc7 10216 return _core_.Window_GetToolTip(*args, **kwargs)
d55e5bfc
RD
10217
10218 def SetDropTarget(*args, **kwargs):
10219 """
5b5c9bc7 10220 SetDropTarget(self, DropTarget dropTarget)
d55e5bfc
RD
10221
10222 Associates a drop target with this window. If the window already has
10223 a drop target, it is deleted.
10224 """
5b5c9bc7 10225 return _core_.Window_SetDropTarget(*args, **kwargs)
d55e5bfc
RD
10226
10227 def GetDropTarget(*args, **kwargs):
10228 """
5b5c9bc7 10229 GetDropTarget(self) -> DropTarget
d55e5bfc
RD
10230
10231 Returns the associated drop target, which may be None.
10232 """
5b5c9bc7 10233 return _core_.Window_GetDropTarget(*args, **kwargs)
d55e5bfc 10234
5ba5649b
RD
10235 def DragAcceptFiles(*args, **kwargs):
10236 """
10237 DragAcceptFiles(self, bool accept)
10238
10239 Enables or disables eligibility for drop file events, EVT_DROP_FILES.
10240 Only functional on Windows.
10241 """
10242 return _core_.Window_DragAcceptFiles(*args, **kwargs)
10243
d55e5bfc
RD
10244 def SetConstraints(*args, **kwargs):
10245 """
5b5c9bc7 10246 SetConstraints(self, LayoutConstraints constraints)
d55e5bfc
RD
10247
10248 Sets the window to have the given layout constraints. If an existing
10249 layout constraints object is already owned by the window, it will be
10250 deleted. Pass None to disassociate and delete the window's current
10251 constraints.
10252
10253 You must call SetAutoLayout to tell a window to use the constraints
10254 automatically in its default EVT_SIZE handler; otherwise, you must
10255 handle EVT_SIZE yourself and call Layout() explicitly. When setting
10256 both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have
10257 effect.
10258 """
5b5c9bc7 10259 return _core_.Window_SetConstraints(*args, **kwargs)
d55e5bfc
RD
10260
10261 def GetConstraints(*args, **kwargs):
10262 """
5b5c9bc7 10263 GetConstraints(self) -> LayoutConstraints
d55e5bfc
RD
10264
10265 Returns a pointer to the window's layout constraints, or None if there
10266 are none.
10267 """
5b5c9bc7 10268 return _core_.Window_GetConstraints(*args, **kwargs)
d55e5bfc
RD
10269
10270 def SetAutoLayout(*args, **kwargs):
10271 """
10272 SetAutoLayout(self, bool autoLayout)
10273
10274 Determines whether the Layout function will be called automatically
b1fcee84
RD
10275 when the window is resized. lease note that this only happens for the
10276 windows usually used to contain children, namely `wx.Panel` and
10277 `wx.TopLevelWindow` (and the classes deriving from them).
10278
10279 This method is called implicitly by `SetSizer` but if you use
10280 `SetConstraints` you should call it manually or otherwise the window
10281 layout won't be correctly updated when its size changes.
d55e5bfc 10282 """
5b5c9bc7 10283 return _core_.Window_SetAutoLayout(*args, **kwargs)
d55e5bfc
RD
10284
10285 def GetAutoLayout(*args, **kwargs):
10286 """
10287 GetAutoLayout(self) -> bool
10288
10289 Returns the current autoLayout setting
10290 """
5b5c9bc7 10291 return _core_.Window_GetAutoLayout(*args, **kwargs)
d55e5bfc
RD
10292
10293 def Layout(*args, **kwargs):
10294 """
10295 Layout(self) -> bool
10296
10297 Invokes the constraint-based layout algorithm or the sizer-based
10298 algorithm for this window. See SetAutoLayout: when auto layout is on,
10299 this function gets called automatically by the default EVT_SIZE
10300 handler when the window is resized.
10301 """
5b5c9bc7 10302 return _core_.Window_Layout(*args, **kwargs)
d55e5bfc
RD
10303
10304 def SetSizer(*args, **kwargs):
10305 """
5b5c9bc7 10306 SetSizer(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
10307
10308 Sets the window to have the given layout sizer. The window will then
10309 own the object, and will take care of its deletion. If an existing
10310 layout sizer object is already owned by the window, it will be deleted
10311 if the deleteOld parameter is true. Note that this function will also
10312 call SetAutoLayout implicitly with a True parameter if the sizer is
b411df4a 10313 non-None, and False otherwise.
d55e5bfc 10314 """
5b5c9bc7 10315 return _core_.Window_SetSizer(*args, **kwargs)
d55e5bfc
RD
10316
10317 def SetSizerAndFit(*args, **kwargs):
10318 """
5b5c9bc7 10319 SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
d55e5bfc
RD
10320
10321 The same as SetSizer, except it also sets the size hints for the
10322 window based on the sizer's minimum size.
10323 """
5b5c9bc7 10324 return _core_.Window_SetSizerAndFit(*args, **kwargs)
d55e5bfc
RD
10325
10326 def GetSizer(*args, **kwargs):
10327 """
5b5c9bc7 10328 GetSizer(self) -> Sizer
d55e5bfc
RD
10329
10330 Return the sizer associated with the window by a previous call to
10331 SetSizer or None if there isn't one.
10332 """
5b5c9bc7 10333 return _core_.Window_GetSizer(*args, **kwargs)
d55e5bfc
RD
10334
10335 def SetContainingSizer(*args, **kwargs):
10336 """
5b5c9bc7 10337 SetContainingSizer(self, Sizer sizer)
d55e5bfc
RD
10338
10339 This normally does not need to be called by application code. It is
10340 called internally when a window is added to a sizer, and is used so
10341 the window can remove itself from the sizer when it is destroyed.
10342 """
5b5c9bc7 10343 return _core_.Window_SetContainingSizer(*args, **kwargs)
d55e5bfc
RD
10344
10345 def GetContainingSizer(*args, **kwargs):
10346 """
5b5c9bc7 10347 GetContainingSizer(self) -> Sizer
d55e5bfc
RD
10348
10349 Return the sizer that this window is a member of, if any, otherwise None.
10350 """
5b5c9bc7 10351 return _core_.Window_GetContainingSizer(*args, **kwargs)
d55e5bfc
RD
10352
10353 def InheritAttributes(*args, **kwargs):
10354 """
10355 InheritAttributes(self)
10356
15817c7e
RD
10357 This function is (or should be, in case of custom controls) called
10358 during window creation to intelligently set up the window visual
10359 attributes, that is the font and the foreground and background
10360 colours.
10361
10362 By 'intelligently' the following is meant: by default, all windows use
10363 their own default attributes. However if some of the parent's
10364 attributes are explicitly changed (that is, using SetFont and not
fa47d7a7 10365 SetOwnFont) and if the corresponding attribute hadn't been
15817c7e
RD
10366 explicitly set for this window itself, then this window takes the same
10367 value as used by the parent. In addition, if the window overrides
10368 ShouldInheritColours to return false, the colours will not be changed
10369 no matter what and only the font might.
10370
a7bb0a9d
RD
10371 This rather complicated logic is necessary in order to accommodate the
10372 different usage scenarios. The most common one is when all default
15817c7e
RD
10373 attributes are used and in this case, nothing should be inherited as
10374 in modern GUIs different controls use different fonts (and colours)
10375 than their siblings so they can't inherit the same value from the
10376 parent. However it was also deemed desirable to allow to simply change
10377 the attributes of all children at once by just changing the font or
10378 colour of their common parent, hence in this case we do inherit the
10379 parents attributes.
10380
d55e5bfc 10381 """
5b5c9bc7 10382 return _core_.Window_InheritAttributes(*args, **kwargs)
d55e5bfc
RD
10383
10384 def ShouldInheritColours(*args, **kwargs):
10385 """
10386 ShouldInheritColours(self) -> bool
10387
10388 Return true from here to allow the colours of this window to be
15817c7e
RD
10389 changed by InheritAttributes, returning false forbids inheriting them
10390 from the parent window.
d55e5bfc 10391
15817c7e
RD
10392 The base class version returns false, but this method is overridden in
10393 wxControl where it returns true.
d55e5bfc 10394 """
5b5c9bc7 10395 return _core_.Window_ShouldInheritColours(*args, **kwargs)
d55e5bfc 10396
fc46b7f3
RD
10397 def CanSetTransparent(*args, **kwargs):
10398 """
10399 CanSetTransparent(self) -> bool
10400
10401 Returns ``True`` if the platform supports setting the transparency for
10402 this window. Note that this method will err on the side of caution,
10403 so it is possible that this will return ``False`` when it is in fact
10404 possible to set the transparency.
10405
10406 NOTE: On X-windows systems the X server must have the composite
10407 extension loaded, and there must be a composite manager program (such
10408 as xcompmgr) running.
10409 """
10410 return _core_.Window_CanSetTransparent(*args, **kwargs)
10411
10412 def SetTransparent(*args, **kwargs):
10413 """
10414 SetTransparent(self, byte alpha) -> bool
10415
10416 Attempt to set the transparency of this window to the ``alpha`` value,
10417 returns True on success. The ``alpha`` value is an integer in the
10418 range of 0 to 255, where 0 is fully transparent and 255 is fully
10419 opaque.
10420 """
10421 return _core_.Window_SetTransparent(*args, **kwargs)
10422
d55e5bfc
RD
10423 def PostCreate(self, pre):
10424 """
10425 Phase 3 of the 2-phase create <wink!>
10426 Call this method after precreating the window with the 2-phase create method.
10427 """
10428 self.this = pre.this
10429 self.thisown = pre.thisown
10430 pre.thisown = 0
10431 if hasattr(self, '_setOORInfo'):
4976f996
RD
10432 try:
10433 self._setOORInfo(self)
10434 except TypeError:
10435 pass
d55e5bfc 10436 if hasattr(self, '_setCallbackInfo'):
4976f996
RD
10437 try:
10438 self._setCallbackInfo(self, pre.__class__)
10439 except TypeError:
10440 pass
d55e5bfc 10441
7e08d4ef 10442 def SendSizeEvent(self):
92515dfc 10443 self.GetEventHandler().ProcessEvent(wx.SizeEvent((-1,-1)))
7e08d4ef 10444
2bf58437 10445 AcceleratorTable = property(GetAcceleratorTable,SetAcceleratorTable,doc="See `GetAcceleratorTable` and `SetAcceleratorTable`")
2bf58437
RD
10446 AutoLayout = property(GetAutoLayout,SetAutoLayout,doc="See `GetAutoLayout` and `SetAutoLayout`")
10447 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
10448 BackgroundStyle = property(GetBackgroundStyle,SetBackgroundStyle,doc="See `GetBackgroundStyle` and `SetBackgroundStyle`")
580080c5 10449 EffectiveMinSize = property(GetEffectiveMinSize,doc="See `GetEffectiveMinSize`")
2bf58437
RD
10450 BestSize = property(GetBestSize,doc="See `GetBestSize`")
10451 BestVirtualSize = property(GetBestVirtualSize,doc="See `GetBestVirtualSize`")
10452 Border = property(GetBorder,doc="See `GetBorder`")
10453 Caret = property(GetCaret,SetCaret,doc="See `GetCaret` and `SetCaret`")
10454 CharHeight = property(GetCharHeight,doc="See `GetCharHeight`")
10455 CharWidth = property(GetCharWidth,doc="See `GetCharWidth`")
10456 Children = property(GetChildren,doc="See `GetChildren`")
10457 ClientAreaOrigin = property(GetClientAreaOrigin,doc="See `GetClientAreaOrigin`")
10458 ClientRect = property(GetClientRect,SetClientRect,doc="See `GetClientRect` and `SetClientRect`")
10459 ClientSize = property(GetClientSize,SetClientSize,doc="See `GetClientSize` and `SetClientSize`")
10460 Constraints = property(GetConstraints,SetConstraints,doc="See `GetConstraints` and `SetConstraints`")
10461 ContainingSizer = property(GetContainingSizer,SetContainingSizer,doc="See `GetContainingSizer` and `SetContainingSizer`")
10462 Cursor = property(GetCursor,SetCursor,doc="See `GetCursor` and `SetCursor`")
10463 DefaultAttributes = property(GetDefaultAttributes,doc="See `GetDefaultAttributes`")
10464 DropTarget = property(GetDropTarget,SetDropTarget,doc="See `GetDropTarget` and `SetDropTarget`")
10465 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10466 ExtraStyle = property(GetExtraStyle,SetExtraStyle,doc="See `GetExtraStyle` and `SetExtraStyle`")
10467 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
10468 ForegroundColour = property(GetForegroundColour,SetForegroundColour,doc="See `GetForegroundColour` and `SetForegroundColour`")
2bf58437 10469 GrandParent = property(GetGrandParent,doc="See `GetGrandParent`")
cbfc9df6 10470 TopLevelParent = property(GetTopLevelParent,doc="See `GetTopLevelParent`")
2bf58437
RD
10471 Handle = property(GetHandle,doc="See `GetHandle`")
10472 HelpText = property(GetHelpText,SetHelpText,doc="See `GetHelpText` and `SetHelpText`")
2bf58437
RD
10473 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
10474 Label = property(GetLabel,SetLabel,doc="See `GetLabel` and `SetLabel`")
994453b8 10475 LayoutDirection = property(GetLayoutDirection,SetLayoutDirection,doc="See `GetLayoutDirection` and `SetLayoutDirection`")
2bf58437
RD
10476 MaxHeight = property(GetMaxHeight,doc="See `GetMaxHeight`")
10477 MaxSize = property(GetMaxSize,SetMaxSize,doc="See `GetMaxSize` and `SetMaxSize`")
10478 MaxWidth = property(GetMaxWidth,doc="See `GetMaxWidth`")
10479 MinHeight = property(GetMinHeight,doc="See `GetMinHeight`")
10480 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
10481 MinWidth = property(GetMinWidth,doc="See `GetMinWidth`")
10482 Name = property(GetName,SetName,doc="See `GetName` and `SetName`")
10483 Parent = property(GetParent,doc="See `GetParent`")
10484 Position = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
10485 Rect = property(GetRect,SetRect,doc="See `GetRect` and `SetRect`")
10486 ScreenPosition = property(GetScreenPosition,doc="See `GetScreenPosition`")
10487 ScreenRect = property(GetScreenRect,doc="See `GetScreenRect`")
2bf58437
RD
10488 Size = property(GetSize,SetSize,doc="See `GetSize` and `SetSize`")
10489 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
2bf58437
RD
10490 ThemeEnabled = property(GetThemeEnabled,SetThemeEnabled,doc="See `GetThemeEnabled` and `SetThemeEnabled`")
10491 ToolTip = property(GetToolTip,SetToolTip,doc="See `GetToolTip` and `SetToolTip`")
10492 UpdateClientRect = property(GetUpdateClientRect,doc="See `GetUpdateClientRect`")
10493 UpdateRegion = property(GetUpdateRegion,doc="See `GetUpdateRegion`")
10494 Validator = property(GetValidator,SetValidator,doc="See `GetValidator` and `SetValidator`")
10495 VirtualSize = property(GetVirtualSize,SetVirtualSize,doc="See `GetVirtualSize` and `SetVirtualSize`")
10496 WindowStyle = property(GetWindowStyle,SetWindowStyle,doc="See `GetWindowStyle` and `SetWindowStyle`")
10497 WindowStyleFlag = property(GetWindowStyleFlag,SetWindowStyleFlag,doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`")
10498 WindowVariant = property(GetWindowVariant,SetWindowVariant,doc="See `GetWindowVariant` and `SetWindowVariant`")
ac5d357a
RD
10499 Shown = property(IsShown,Show,doc="See `IsShown` and `Show`")
10500 Enabled = property(IsEnabled,Enable,doc="See `IsEnabled` and `Enable`")
10501 TopLevel = property(IsTopLevel,doc="See `IsTopLevel`")
2131d850 10502_core_.Window_swigregister(Window)
d55e5bfc
RD
10503
10504def PreWindow(*args, **kwargs):
10505 """
5b5c9bc7 10506 PreWindow() -> Window
d55e5bfc
RD
10507
10508 Precreate a Window for 2-phase creation.
10509 """
5b5c9bc7 10510 val = _core_.new_PreWindow(*args, **kwargs)
d55e5bfc
RD
10511 return val
10512
1bd55598
RD
10513def Window_NewControlId(*args):
10514 """
5b5c9bc7 10515 Window_NewControlId() -> int
d55e5bfc
RD
10516
10517 Generate a control id for the controls which were not given one.
10518 """
1bd55598 10519 return _core_.Window_NewControlId(*args)
d55e5bfc 10520
5b5c9bc7 10521def Window_NextControlId(*args, **kwargs):
1bd55598 10522 """
5b5c9bc7 10523 Window_NextControlId(int winid) -> int
d55e5bfc
RD
10524
10525 Get the id of the control following the one with the given
15817c7e 10526 autogenerated) id
d55e5bfc 10527 """
1bd55598 10528 return _core_.Window_NextControlId(*args, **kwargs)
d55e5bfc 10529
5b5c9bc7 10530def Window_PrevControlId(*args, **kwargs):
1bd55598 10531 """
5b5c9bc7 10532 Window_PrevControlId(int winid) -> int
d55e5bfc
RD
10533
10534 Get the id of the control preceding the one with the given
15817c7e 10535 autogenerated) id
d55e5bfc 10536 """
1bd55598 10537 return _core_.Window_PrevControlId(*args, **kwargs)
d55e5bfc 10538
1bd55598
RD
10539def Window_FindFocus(*args):
10540 """
5b5c9bc7 10541 Window_FindFocus() -> Window
d55e5bfc
RD
10542
10543 Returns the window or control that currently has the keyboard focus,
10544 or None.
10545 """
1bd55598 10546 return _core_.Window_FindFocus(*args)
d55e5bfc 10547
1bd55598
RD
10548def Window_GetCapture(*args):
10549 """
5b5c9bc7 10550 Window_GetCapture() -> Window
d55e5bfc
RD
10551
10552 Returns the window which currently captures the mouse or None
10553 """
1bd55598 10554 return _core_.Window_GetCapture(*args)
d55e5bfc 10555
5b5c9bc7 10556def Window_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 10557 """
5b5c9bc7 10558 Window_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
d55e5bfc 10559
15817c7e
RD
10560 Get the default attributes for this class. This is useful if you want
10561 to use the same font or colour in your own control as in a standard
10562 control -- which is a much better idea than hard coding specific
a5ee0656
RD
10563 colours or fonts which might look completely out of place on the
10564 user's system, especially if it uses themes.
d55e5bfc
RD
10565
10566 The variant parameter is only relevant under Mac currently and is
15817c7e 10567 ignore under other platforms. Under Mac, it will change the size of
a5ee0656
RD
10568 the returned font. See `wx.Window.SetWindowVariant` for more about
10569 this.
d55e5bfc 10570 """
1bd55598 10571 return _core_.Window_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
10572
10573def DLG_PNT(win, point_or_x, y=None):
10574 """
10575 Convenience function for converting a Point or (x,y) in
10576 dialog units to pixel units.
10577 """
10578 if y is None:
10579 return win.ConvertDialogPointToPixels(point_or_x)
10580 else:
10581 return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
10582
10583def DLG_SZE(win, size_width, height=None):
10584 """
10585 Convenience function for converting a Size or (w,h) in
10586 dialog units to pixel units.
10587 """
10588 if height is None:
10589 return win.ConvertDialogSizeToPixels(size_width)
10590 else:
10591 return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
10592
10593
5b5c9bc7 10594def FindWindowById(*args, **kwargs):
1bd55598 10595 """
5b5c9bc7 10596 FindWindowById(long id, Window parent=None) -> Window
d55e5bfc
RD
10597
10598 Find the first window in the application with the given id. If parent
10599 is None, the search will start from all top-level frames and dialog
10600 boxes; if non-None, the search will be limited to the given window
10601 hierarchy. The search is recursive in both cases.
10602 """
1bd55598 10603 return _core_.FindWindowById(*args, **kwargs)
d55e5bfc 10604
5b5c9bc7 10605def FindWindowByName(*args, **kwargs):
1bd55598 10606 """
5b5c9bc7 10607 FindWindowByName(String name, Window parent=None) -> Window
d55e5bfc
RD
10608
10609 Find a window by its name (as given in a window constructor or Create
10610 function call). If parent is None, the search will start from all
10611 top-level frames and dialog boxes; if non-None, the search will be
10612 limited to the given window hierarchy. The search is recursive in both
10613 cases.
10614
10615 If no window with such name is found, wx.FindWindowByLabel is called.
10616 """
1bd55598 10617 return _core_.FindWindowByName(*args, **kwargs)
d55e5bfc 10618
5b5c9bc7 10619def FindWindowByLabel(*args, **kwargs):
1bd55598 10620 """
5b5c9bc7 10621 FindWindowByLabel(String label, Window parent=None) -> Window
d55e5bfc
RD
10622
10623 Find a window by its label. Depending on the type of window, the label
10624 may be a window title or panel item label. If parent is None, the
10625 search will start from all top-level frames and dialog boxes; if
10626 non-None, the search will be limited to the given window
10627 hierarchy. The search is recursive in both cases.
10628 """
1bd55598 10629 return _core_.FindWindowByLabel(*args, **kwargs)
d55e5bfc 10630
5b5c9bc7 10631def Window_FromHWND(*args, **kwargs):
1bd55598
RD
10632 """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window"""
10633 return _core_.Window_FromHWND(*args, **kwargs)
3215336e 10634
1bd55598
RD
10635def GetTopLevelWindows(*args):
10636 """
3215336e
RD
10637 GetTopLevelWindows() -> PyObject
10638
10639 Returns a list of the the application's top-level windows, (frames,
10640 dialogs, etc.) NOTE: Currently this is a copy of the list maintained
10641 by wxWidgets, and so it is only valid as long as no top-level windows
10642 are closed or new top-level windows are created.
10643
10644 """
1bd55598 10645 return _core_.GetTopLevelWindows(*args)
d55e5bfc
RD
10646#---------------------------------------------------------------------------
10647
5b5c9bc7
RD
10648class Validator(EvtHandler):
10649 """Proxy of C++ Validator class"""
1bd55598
RD
10650 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10651 __repr__ = _swig_repr
10652 def __init__(self, *args, **kwargs):
5b5c9bc7 10653 """__init__(self) -> Validator"""
1bd55598 10654 _core_.Validator_swiginit(self,_core_.new_Validator(*args, **kwargs))
d55e5bfc
RD
10655 self._setOORInfo(self)
10656
10657 def Clone(*args, **kwargs):
5b5c9bc7
RD
10658 """Clone(self) -> Validator"""
10659 return _core_.Validator_Clone(*args, **kwargs)
d55e5bfc
RD
10660
10661 def Validate(*args, **kwargs):
5b5c9bc7
RD
10662 """Validate(self, Window parent) -> bool"""
10663 return _core_.Validator_Validate(*args, **kwargs)
d55e5bfc
RD
10664
10665 def TransferToWindow(*args, **kwargs):
10666 """TransferToWindow(self) -> bool"""
5b5c9bc7 10667 return _core_.Validator_TransferToWindow(*args, **kwargs)
d55e5bfc
RD
10668
10669 def TransferFromWindow(*args, **kwargs):
10670 """TransferFromWindow(self) -> bool"""
5b5c9bc7 10671 return _core_.Validator_TransferFromWindow(*args, **kwargs)
d55e5bfc
RD
10672
10673 def GetWindow(*args, **kwargs):
5b5c9bc7
RD
10674 """GetWindow(self) -> Window"""
10675 return _core_.Validator_GetWindow(*args, **kwargs)
d55e5bfc
RD
10676
10677 def SetWindow(*args, **kwargs):
5b5c9bc7
RD
10678 """SetWindow(self, Window window)"""
10679 return _core_.Validator_SetWindow(*args, **kwargs)
d55e5bfc
RD
10680
10681 def IsSilent(*args, **kwargs):
d6c14a4c 10682 """IsSilent() -> bool"""
5b5c9bc7 10683 return _core_.Validator_IsSilent(*args, **kwargs)
d55e5bfc
RD
10684
10685 IsSilent = staticmethod(IsSilent)
10686 def SetBellOnError(*args, **kwargs):
d6c14a4c 10687 """SetBellOnError(int doIt=True)"""
5b5c9bc7 10688 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc
RD
10689
10690 SetBellOnError = staticmethod(SetBellOnError)
dba7934c 10691 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 10692_core_.Validator_swigregister(Validator)
d55e5bfc 10693
1bd55598
RD
10694def Validator_IsSilent(*args):
10695 """Validator_IsSilent() -> bool"""
10696 return _core_.Validator_IsSilent(*args)
d55e5bfc 10697
5b5c9bc7 10698def Validator_SetBellOnError(*args, **kwargs):
1bd55598
RD
10699 """Validator_SetBellOnError(int doIt=True)"""
10700 return _core_.Validator_SetBellOnError(*args, **kwargs)
d55e5bfc 10701
5b5c9bc7
RD
10702class PyValidator(Validator):
10703 """Proxy of C++ PyValidator class"""
1bd55598
RD
10704 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10705 __repr__ = _swig_repr
10706 def __init__(self, *args, **kwargs):
5b5c9bc7 10707 """__init__(self) -> PyValidator"""
1bd55598 10708 _core_.PyValidator_swiginit(self,_core_.new_PyValidator(*args, **kwargs))
c25f90f6 10709 self._setOORInfo(self);PyValidator._setCallbackInfo(self, self, PyValidator)
d55e5bfc
RD
10710
10711 def _setCallbackInfo(*args, **kwargs):
c25f90f6 10712 """_setCallbackInfo(self, PyObject self, PyObject _class, int incref=1)"""
5b5c9bc7 10713 return _core_.PyValidator__setCallbackInfo(*args, **kwargs)
d55e5bfc 10714
2131d850 10715_core_.PyValidator_swigregister(PyValidator)
d55e5bfc
RD
10716
10717#---------------------------------------------------------------------------
10718
5b5c9bc7
RD
10719class Menu(EvtHandler):
10720 """Proxy of C++ Menu class"""
1bd55598
RD
10721 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10722 __repr__ = _swig_repr
10723 def __init__(self, *args, **kwargs):
5b5c9bc7 10724 """__init__(self, String title=EmptyString, long style=0) -> Menu"""
1bd55598 10725 _core_.Menu_swiginit(self,_core_.new_Menu(*args, **kwargs))
d55e5bfc
RD
10726 self._setOORInfo(self)
10727
10728 def Append(*args, **kwargs):
ac5d357a
RD
10729 """
10730 Append(self, int id, String text=EmptyString, String help=EmptyString,
10731 int kind=ITEM_NORMAL) -> MenuItem
10732 """
5b5c9bc7 10733 return _core_.Menu_Append(*args, **kwargs)
d55e5bfc
RD
10734
10735 def AppendSeparator(*args, **kwargs):
5b5c9bc7
RD
10736 """AppendSeparator(self) -> MenuItem"""
10737 return _core_.Menu_AppendSeparator(*args, **kwargs)
d55e5bfc
RD
10738
10739 def AppendCheckItem(*args, **kwargs):
5b5c9bc7
RD
10740 """AppendCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10741 return _core_.Menu_AppendCheckItem(*args, **kwargs)
d55e5bfc
RD
10742
10743 def AppendRadioItem(*args, **kwargs):
5b5c9bc7
RD
10744 """AppendRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10745 return _core_.Menu_AppendRadioItem(*args, **kwargs)
d55e5bfc
RD
10746
10747 def AppendMenu(*args, **kwargs):
5b5c9bc7
RD
10748 """AppendMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10749 return _core_.Menu_AppendMenu(*args, **kwargs)
d55e5bfc 10750
da91cb0f
RD
10751 def AppendSubMenu(*args, **kwargs):
10752 """AppendSubMenu(self, Menu submenu, String text, String help=EmptyString) -> MenuItem"""
10753 return _core_.Menu_AppendSubMenu(*args, **kwargs)
10754
d55e5bfc 10755 def AppendItem(*args, **kwargs):
5b5c9bc7
RD
10756 """AppendItem(self, MenuItem item) -> MenuItem"""
10757 return _core_.Menu_AppendItem(*args, **kwargs)
d55e5bfc 10758
d55e5bfc 10759 def InsertItem(*args, **kwargs):
5b5c9bc7
RD
10760 """InsertItem(self, size_t pos, MenuItem item) -> MenuItem"""
10761 return _core_.Menu_InsertItem(*args, **kwargs)
d55e5bfc 10762
1bd55598
RD
10763 def PrependItem(*args, **kwargs):
10764 """PrependItem(self, MenuItem item) -> MenuItem"""
10765 return _core_.Menu_PrependItem(*args, **kwargs)
10766
10767 def Break(*args, **kwargs):
10768 """Break(self)"""
10769 return _core_.Menu_Break(*args, **kwargs)
10770
d55e5bfc
RD
10771 def Insert(*args, **kwargs):
10772 """
ac5d357a 10773 Insert(self, size_t pos, int id, String text=EmptyString, String help=EmptyString,
5b5c9bc7 10774 int kind=ITEM_NORMAL) -> MenuItem
d55e5bfc 10775 """
5b5c9bc7 10776 return _core_.Menu_Insert(*args, **kwargs)
d55e5bfc
RD
10777
10778 def InsertSeparator(*args, **kwargs):
5b5c9bc7
RD
10779 """InsertSeparator(self, size_t pos) -> MenuItem"""
10780 return _core_.Menu_InsertSeparator(*args, **kwargs)
d55e5bfc
RD
10781
10782 def InsertCheckItem(*args, **kwargs):
5b5c9bc7
RD
10783 """InsertCheckItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10784 return _core_.Menu_InsertCheckItem(*args, **kwargs)
d55e5bfc
RD
10785
10786 def InsertRadioItem(*args, **kwargs):
5b5c9bc7
RD
10787 """InsertRadioItem(self, size_t pos, int id, String text, String help=EmptyString) -> MenuItem"""
10788 return _core_.Menu_InsertRadioItem(*args, **kwargs)
d55e5bfc
RD
10789
10790 def InsertMenu(*args, **kwargs):
5b5c9bc7
RD
10791 """InsertMenu(self, size_t pos, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10792 return _core_.Menu_InsertMenu(*args, **kwargs)
d55e5bfc 10793
d55e5bfc 10794 def Prepend(*args, **kwargs):
ac5d357a
RD
10795 """
10796 Prepend(self, int id, String text=EmptyString, String help=EmptyString,
10797 int kind=ITEM_NORMAL) -> MenuItem
10798 """
5b5c9bc7 10799 return _core_.Menu_Prepend(*args, **kwargs)
d55e5bfc
RD
10800
10801 def PrependSeparator(*args, **kwargs):
5b5c9bc7
RD
10802 """PrependSeparator(self) -> MenuItem"""
10803 return _core_.Menu_PrependSeparator(*args, **kwargs)
d55e5bfc
RD
10804
10805 def PrependCheckItem(*args, **kwargs):
5b5c9bc7
RD
10806 """PrependCheckItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10807 return _core_.Menu_PrependCheckItem(*args, **kwargs)
d55e5bfc
RD
10808
10809 def PrependRadioItem(*args, **kwargs):
5b5c9bc7
RD
10810 """PrependRadioItem(self, int id, String text, String help=EmptyString) -> MenuItem"""
10811 return _core_.Menu_PrependRadioItem(*args, **kwargs)
d55e5bfc
RD
10812
10813 def PrependMenu(*args, **kwargs):
5b5c9bc7
RD
10814 """PrependMenu(self, int id, String text, Menu submenu, String help=EmptyString) -> MenuItem"""
10815 return _core_.Menu_PrependMenu(*args, **kwargs)
d55e5bfc
RD
10816
10817 def Remove(*args, **kwargs):
5b5c9bc7
RD
10818 """Remove(self, int id) -> MenuItem"""
10819 return _core_.Menu_Remove(*args, **kwargs)
d55e5bfc 10820
59ccbf7f 10821 def RemoveItem(self, item):
5b5c9bc7 10822 """RemoveItem(self, MenuItem item) -> MenuItem"""
59ccbf7f
RD
10823 #// The return object is always the parameter, so return that
10824 #// proxy instead of the new one
10825 val = _core_.Menu_RemoveItem(self, item)
10826 item.this.own(val.this.own())
10827 val.this.disown()
10828 return item
10829
d55e5bfc
RD
10830
10831 def Delete(*args, **kwargs):
10832 """Delete(self, int id) -> bool"""
5b5c9bc7 10833 return _core_.Menu_Delete(*args, **kwargs)
d55e5bfc
RD
10834
10835 def DeleteItem(*args, **kwargs):
5b5c9bc7
RD
10836 """DeleteItem(self, MenuItem item) -> bool"""
10837 return _core_.Menu_DeleteItem(*args, **kwargs)
d55e5bfc
RD
10838
10839 def Destroy(*args, **kwargs):
10840 """
10841 Destroy(self)
10842
10843 Deletes the C++ object this Python object is a proxy for.
10844 """
b39fe951
RD
10845 args[0].this.own(False)
10846 return _core_.Menu_Destroy(*args, **kwargs)
d55e5bfc
RD
10847
10848 def DestroyId(*args, **kwargs):
b39fe951
RD
10849 """DestroyId(self, int id) -> bool"""
10850 return _core_.Menu_DestroyId(*args, **kwargs)
d55e5bfc
RD
10851
10852 def DestroyItem(*args, **kwargs):
b39fe951
RD
10853 """DestroyItem(self, MenuItem item) -> bool"""
10854 return _core_.Menu_DestroyItem(*args, **kwargs)
d55e5bfc
RD
10855
10856 def GetMenuItemCount(*args, **kwargs):
10857 """GetMenuItemCount(self) -> size_t"""
5b5c9bc7 10858 return _core_.Menu_GetMenuItemCount(*args, **kwargs)
d55e5bfc
RD
10859
10860 def GetMenuItems(*args, **kwargs):
10861 """GetMenuItems(self) -> PyObject"""
5b5c9bc7 10862 return _core_.Menu_GetMenuItems(*args, **kwargs)
d55e5bfc
RD
10863
10864 def FindItem(*args, **kwargs):
5b5c9bc7
RD
10865 """FindItem(self, String item) -> int"""
10866 return _core_.Menu_FindItem(*args, **kwargs)
d55e5bfc
RD
10867
10868 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
10869 """FindItemById(self, int id) -> MenuItem"""
10870 return _core_.Menu_FindItemById(*args, **kwargs)
d55e5bfc
RD
10871
10872 def FindItemByPosition(*args, **kwargs):
5b5c9bc7
RD
10873 """FindItemByPosition(self, size_t position) -> MenuItem"""
10874 return _core_.Menu_FindItemByPosition(*args, **kwargs)
d55e5bfc
RD
10875
10876 def Enable(*args, **kwargs):
10877 """Enable(self, int id, bool enable)"""
5b5c9bc7 10878 return _core_.Menu_Enable(*args, **kwargs)
d55e5bfc
RD
10879
10880 def IsEnabled(*args, **kwargs):
10881 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 10882 return _core_.Menu_IsEnabled(*args, **kwargs)
d55e5bfc
RD
10883
10884 def Check(*args, **kwargs):
10885 """Check(self, int id, bool check)"""
5b5c9bc7 10886 return _core_.Menu_Check(*args, **kwargs)
d55e5bfc
RD
10887
10888 def IsChecked(*args, **kwargs):
10889 """IsChecked(self, int id) -> bool"""
5b5c9bc7 10890 return _core_.Menu_IsChecked(*args, **kwargs)
d55e5bfc
RD
10891
10892 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
10893 """SetLabel(self, int id, String label)"""
10894 return _core_.Menu_SetLabel(*args, **kwargs)
d55e5bfc
RD
10895
10896 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
10897 """GetLabel(self, int id) -> String"""
10898 return _core_.Menu_GetLabel(*args, **kwargs)
d55e5bfc
RD
10899
10900 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
10901 """SetHelpString(self, int id, String helpString)"""
10902 return _core_.Menu_SetHelpString(*args, **kwargs)
d55e5bfc
RD
10903
10904 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
10905 """GetHelpString(self, int id) -> String"""
10906 return _core_.Menu_GetHelpString(*args, **kwargs)
d55e5bfc
RD
10907
10908 def SetTitle(*args, **kwargs):
5b5c9bc7
RD
10909 """SetTitle(self, String title)"""
10910 return _core_.Menu_SetTitle(*args, **kwargs)
d55e5bfc
RD
10911
10912 def GetTitle(*args, **kwargs):
5b5c9bc7
RD
10913 """GetTitle(self) -> String"""
10914 return _core_.Menu_GetTitle(*args, **kwargs)
d55e5bfc
RD
10915
10916 def SetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10917 """SetEventHandler(self, EvtHandler handler)"""
10918 return _core_.Menu_SetEventHandler(*args, **kwargs)
d55e5bfc
RD
10919
10920 def GetEventHandler(*args, **kwargs):
5b5c9bc7
RD
10921 """GetEventHandler(self) -> EvtHandler"""
10922 return _core_.Menu_GetEventHandler(*args, **kwargs)
d55e5bfc
RD
10923
10924 def SetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10925 """SetInvokingWindow(self, Window win)"""
10926 return _core_.Menu_SetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10927
10928 def GetInvokingWindow(*args, **kwargs):
5b5c9bc7
RD
10929 """GetInvokingWindow(self) -> Window"""
10930 return _core_.Menu_GetInvokingWindow(*args, **kwargs)
d55e5bfc
RD
10931
10932 def GetStyle(*args, **kwargs):
10933 """GetStyle(self) -> long"""
5b5c9bc7 10934 return _core_.Menu_GetStyle(*args, **kwargs)
d55e5bfc
RD
10935
10936 def UpdateUI(*args, **kwargs):
5b5c9bc7
RD
10937 """UpdateUI(self, EvtHandler source=None)"""
10938 return _core_.Menu_UpdateUI(*args, **kwargs)
d55e5bfc
RD
10939
10940 def GetMenuBar(*args, **kwargs):
5b5c9bc7
RD
10941 """GetMenuBar(self) -> MenuBar"""
10942 return _core_.Menu_GetMenuBar(*args, **kwargs)
d55e5bfc
RD
10943
10944 def Attach(*args, **kwargs):
10945 """Attach(self, wxMenuBarBase menubar)"""
5b5c9bc7 10946 return _core_.Menu_Attach(*args, **kwargs)
d55e5bfc
RD
10947
10948 def Detach(*args, **kwargs):
10949 """Detach(self)"""
5b5c9bc7 10950 return _core_.Menu_Detach(*args, **kwargs)
d55e5bfc
RD
10951
10952 def IsAttached(*args, **kwargs):
10953 """IsAttached(self) -> bool"""
5b5c9bc7 10954 return _core_.Menu_IsAttached(*args, **kwargs)
d55e5bfc
RD
10955
10956 def SetParent(*args, **kwargs):
5b5c9bc7
RD
10957 """SetParent(self, Menu parent)"""
10958 return _core_.Menu_SetParent(*args, **kwargs)
d55e5bfc
RD
10959
10960 def GetParent(*args, **kwargs):
5b5c9bc7
RD
10961 """GetParent(self) -> Menu"""
10962 return _core_.Menu_GetParent(*args, **kwargs)
d55e5bfc 10963
57332a5a
RD
10964 EventHandler = property(GetEventHandler,SetEventHandler,doc="See `GetEventHandler` and `SetEventHandler`")
10965 HelpString = property(GetHelpString,SetHelpString,doc="See `GetHelpString` and `SetHelpString`")
10966 InvokingWindow = property(GetInvokingWindow,SetInvokingWindow,doc="See `GetInvokingWindow` and `SetInvokingWindow`")
10967 MenuBar = property(GetMenuBar,doc="See `GetMenuBar`")
10968 MenuItemCount = property(GetMenuItemCount,doc="See `GetMenuItemCount`")
10969 MenuItems = property(GetMenuItems,doc="See `GetMenuItems`")
10970 Parent = property(GetParent,SetParent,doc="See `GetParent` and `SetParent`")
10971 Style = property(GetStyle,doc="See `GetStyle`")
10972 Title = property(GetTitle,SetTitle,doc="See `GetTitle` and `SetTitle`")
2131d850 10973_core_.Menu_swigregister(Menu)
5b5c9bc7 10974DefaultValidator = cvar.DefaultValidator
d55e5bfc
RD
10975
10976#---------------------------------------------------------------------------
10977
5b5c9bc7
RD
10978class MenuBar(Window):
10979 """Proxy of C++ MenuBar class"""
1bd55598
RD
10980 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
10981 __repr__ = _swig_repr
10982 def __init__(self, *args, **kwargs):
5b5c9bc7 10983 """__init__(self, long style=0) -> MenuBar"""
1bd55598 10984 _core_.MenuBar_swiginit(self,_core_.new_MenuBar(*args, **kwargs))
d55e5bfc
RD
10985 self._setOORInfo(self)
10986
10987 def Append(*args, **kwargs):
5b5c9bc7
RD
10988 """Append(self, Menu menu, String title) -> bool"""
10989 return _core_.MenuBar_Append(*args, **kwargs)
d55e5bfc
RD
10990
10991 def Insert(*args, **kwargs):
5b5c9bc7
RD
10992 """Insert(self, size_t pos, Menu menu, String title) -> bool"""
10993 return _core_.MenuBar_Insert(*args, **kwargs)
d55e5bfc
RD
10994
10995 def GetMenuCount(*args, **kwargs):
10996 """GetMenuCount(self) -> size_t"""
5b5c9bc7 10997 return _core_.MenuBar_GetMenuCount(*args, **kwargs)
d55e5bfc
RD
10998
10999 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
11000 """GetMenu(self, size_t pos) -> Menu"""
11001 return _core_.MenuBar_GetMenu(*args, **kwargs)
d55e5bfc
RD
11002
11003 def Replace(*args, **kwargs):
5b5c9bc7
RD
11004 """Replace(self, size_t pos, Menu menu, String title) -> Menu"""
11005 return _core_.MenuBar_Replace(*args, **kwargs)
d55e5bfc
RD
11006
11007 def Remove(*args, **kwargs):
5b5c9bc7
RD
11008 """Remove(self, size_t pos) -> Menu"""
11009 return _core_.MenuBar_Remove(*args, **kwargs)
d55e5bfc
RD
11010
11011 def EnableTop(*args, **kwargs):
11012 """EnableTop(self, size_t pos, bool enable)"""
5b5c9bc7 11013 return _core_.MenuBar_EnableTop(*args, **kwargs)
d55e5bfc
RD
11014
11015 def IsEnabledTop(*args, **kwargs):
11016 """IsEnabledTop(self, size_t pos) -> bool"""
5b5c9bc7 11017 return _core_.MenuBar_IsEnabledTop(*args, **kwargs)
d55e5bfc
RD
11018
11019 def SetLabelTop(*args, **kwargs):
5b5c9bc7
RD
11020 """SetLabelTop(self, size_t pos, String label)"""
11021 return _core_.MenuBar_SetLabelTop(*args, **kwargs)
d55e5bfc
RD
11022
11023 def GetLabelTop(*args, **kwargs):
5b5c9bc7
RD
11024 """GetLabelTop(self, size_t pos) -> String"""
11025 return _core_.MenuBar_GetLabelTop(*args, **kwargs)
d55e5bfc
RD
11026
11027 def FindMenuItem(*args, **kwargs):
5b5c9bc7
RD
11028 """FindMenuItem(self, String menu, String item) -> int"""
11029 return _core_.MenuBar_FindMenuItem(*args, **kwargs)
d55e5bfc
RD
11030
11031 def FindItemById(*args, **kwargs):
5b5c9bc7
RD
11032 """FindItemById(self, int id) -> MenuItem"""
11033 return _core_.MenuBar_FindItemById(*args, **kwargs)
d55e5bfc
RD
11034
11035 def FindMenu(*args, **kwargs):
5b5c9bc7
RD
11036 """FindMenu(self, String title) -> int"""
11037 return _core_.MenuBar_FindMenu(*args, **kwargs)
d55e5bfc
RD
11038
11039 def Enable(*args, **kwargs):
11040 """Enable(self, int id, bool enable)"""
5b5c9bc7 11041 return _core_.MenuBar_Enable(*args, **kwargs)
d55e5bfc
RD
11042
11043 def Check(*args, **kwargs):
11044 """Check(self, int id, bool check)"""
5b5c9bc7 11045 return _core_.MenuBar_Check(*args, **kwargs)
d55e5bfc
RD
11046
11047 def IsChecked(*args, **kwargs):
11048 """IsChecked(self, int id) -> bool"""
5b5c9bc7 11049 return _core_.MenuBar_IsChecked(*args, **kwargs)
d55e5bfc
RD
11050
11051 def IsEnabled(*args, **kwargs):
11052 """IsEnabled(self, int id) -> bool"""
5b5c9bc7 11053 return _core_.MenuBar_IsEnabled(*args, **kwargs)
d55e5bfc
RD
11054
11055 def SetLabel(*args, **kwargs):
5b5c9bc7
RD
11056 """SetLabel(self, int id, String label)"""
11057 return _core_.MenuBar_SetLabel(*args, **kwargs)
d55e5bfc
RD
11058
11059 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
11060 """GetLabel(self, int id) -> String"""
11061 return _core_.MenuBar_GetLabel(*args, **kwargs)
d55e5bfc
RD
11062
11063 def SetHelpString(*args, **kwargs):
5b5c9bc7
RD
11064 """SetHelpString(self, int id, String helpString)"""
11065 return _core_.MenuBar_SetHelpString(*args, **kwargs)
d55e5bfc
RD
11066
11067 def GetHelpString(*args, **kwargs):
5b5c9bc7
RD
11068 """GetHelpString(self, int id) -> String"""
11069 return _core_.MenuBar_GetHelpString(*args, **kwargs)
d55e5bfc
RD
11070
11071 def GetFrame(*args, **kwargs):
11072 """GetFrame(self) -> wxFrame"""
5b5c9bc7 11073 return _core_.MenuBar_GetFrame(*args, **kwargs)
d55e5bfc
RD
11074
11075 def IsAttached(*args, **kwargs):
11076 """IsAttached(self) -> bool"""
5b5c9bc7 11077 return _core_.MenuBar_IsAttached(*args, **kwargs)
d55e5bfc
RD
11078
11079 def Attach(*args, **kwargs):
11080 """Attach(self, wxFrame frame)"""
5b5c9bc7 11081 return _core_.MenuBar_Attach(*args, **kwargs)
d55e5bfc
RD
11082
11083 def Detach(*args, **kwargs):
11084 """Detach(self)"""
5b5c9bc7 11085 return _core_.MenuBar_Detach(*args, **kwargs)
d55e5bfc 11086
587d0f36
RD
11087 def UpdateMenus(*args, **kwargs):
11088 """UpdateMenus(self)"""
11089 return _core_.MenuBar_UpdateMenus(*args, **kwargs)
11090
4f433fef
RD
11091 def SetAutoWindowMenu(*args, **kwargs):
11092 """SetAutoWindowMenu(bool enable)"""
11093 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
11094
11095 SetAutoWindowMenu = staticmethod(SetAutoWindowMenu)
11096 def GetAutoWindowMenu(*args, **kwargs):
11097 """GetAutoWindowMenu() -> bool"""
11098 return _core_.MenuBar_GetAutoWindowMenu(*args, **kwargs)
11099
11100 GetAutoWindowMenu = staticmethod(GetAutoWindowMenu)
ac5d357a
RD
11101 def GetMenus(self):
11102 """Return a list of (menu, label) items for the menus in the MenuBar. """
11103 return [(self.GetMenu(i), self.GetLabelTop(i))
11104 for i in range(self.GetMenuCount())]
11105
11106 def SetMenus(self, items):
11107 """Clear and add new menus to the MenuBar from a list of (menu, label) items. """
11108 for i in range(self.GetMenuCount()-1, -1, -1):
11109 self.Remove(i)
11110 for m, l in items:
11111 self.Append(m, l)
11112
57332a5a 11113 Frame = property(GetFrame,doc="See `GetFrame`")
57332a5a
RD
11114 MenuCount = property(GetMenuCount,doc="See `GetMenuCount`")
11115 Menus = property(GetMenus,SetMenus,doc="See `GetMenus` and `SetMenus`")
2131d850 11116_core_.MenuBar_swigregister(MenuBar)
d55e5bfc 11117
4f433fef 11118def MenuBar_SetAutoWindowMenu(*args, **kwargs):
1bd55598
RD
11119 """MenuBar_SetAutoWindowMenu(bool enable)"""
11120 return _core_.MenuBar_SetAutoWindowMenu(*args, **kwargs)
4f433fef 11121
1bd55598
RD
11122def MenuBar_GetAutoWindowMenu(*args):
11123 """MenuBar_GetAutoWindowMenu() -> bool"""
11124 return _core_.MenuBar_GetAutoWindowMenu(*args)
4f433fef 11125
d55e5bfc
RD
11126#---------------------------------------------------------------------------
11127
5b5c9bc7
RD
11128class MenuItem(Object):
11129 """Proxy of C++ MenuItem class"""
1bd55598
RD
11130 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11131 __repr__ = _swig_repr
11132 def __init__(self, *args, **kwargs):
d55e5bfc 11133 """
89d1e2ee 11134 __init__(self, Menu parentMenu=None, int id=ID_SEPARATOR, String text=EmptyString,
5b5c9bc7
RD
11135 String help=EmptyString, int kind=ITEM_NORMAL,
11136 Menu subMenu=None) -> MenuItem
d55e5bfc 11137 """
1bd55598
RD
11138 _core_.MenuItem_swiginit(self,_core_.new_MenuItem(*args, **kwargs))
11139 __swig_destroy__ = _core_.delete_MenuItem
11140 __del__ = lambda self : None;
89d1e2ee 11141 def Destroy(self): pass
d55e5bfc 11142 def GetMenu(*args, **kwargs):
5b5c9bc7
RD
11143 """GetMenu(self) -> Menu"""
11144 return _core_.MenuItem_GetMenu(*args, **kwargs)
d55e5bfc
RD
11145
11146 def SetMenu(*args, **kwargs):
5b5c9bc7
RD
11147 """SetMenu(self, Menu menu)"""
11148 return _core_.MenuItem_SetMenu(*args, **kwargs)
d55e5bfc
RD
11149
11150 def SetId(*args, **kwargs):
11151 """SetId(self, int id)"""
5b5c9bc7 11152 return _core_.MenuItem_SetId(*args, **kwargs)
d55e5bfc
RD
11153
11154 def GetId(*args, **kwargs):
11155 """GetId(self) -> int"""
5b5c9bc7 11156 return _core_.MenuItem_GetId(*args, **kwargs)
d55e5bfc
RD
11157
11158 def IsSeparator(*args, **kwargs):
11159 """IsSeparator(self) -> bool"""
5b5c9bc7 11160 return _core_.MenuItem_IsSeparator(*args, **kwargs)
d55e5bfc
RD
11161
11162 def SetText(*args, **kwargs):
5b5c9bc7
RD
11163 """SetText(self, String str)"""
11164 return _core_.MenuItem_SetText(*args, **kwargs)
d55e5bfc
RD
11165
11166 def GetLabel(*args, **kwargs):
5b5c9bc7
RD
11167 """GetLabel(self) -> String"""
11168 return _core_.MenuItem_GetLabel(*args, **kwargs)
d55e5bfc
RD
11169
11170 def GetText(*args, **kwargs):
5b5c9bc7
RD
11171 """GetText(self) -> String"""
11172 return _core_.MenuItem_GetText(*args, **kwargs)
d55e5bfc
RD
11173
11174 def GetLabelFromText(*args, **kwargs):
5b5c9bc7
RD
11175 """GetLabelFromText(String text) -> String"""
11176 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc
RD
11177
11178 GetLabelFromText = staticmethod(GetLabelFromText)
11179 def GetKind(*args, **kwargs):
11180 """GetKind(self) -> int"""
5b5c9bc7 11181 return _core_.MenuItem_GetKind(*args, **kwargs)
d55e5bfc
RD
11182
11183 def SetKind(*args, **kwargs):
11184 """SetKind(self, int kind)"""
5b5c9bc7 11185 return _core_.MenuItem_SetKind(*args, **kwargs)
d55e5bfc
RD
11186
11187 def SetCheckable(*args, **kwargs):
11188 """SetCheckable(self, bool checkable)"""
5b5c9bc7 11189 return _core_.MenuItem_SetCheckable(*args, **kwargs)
d55e5bfc
RD
11190
11191 def IsCheckable(*args, **kwargs):
11192 """IsCheckable(self) -> bool"""
5b5c9bc7 11193 return _core_.MenuItem_IsCheckable(*args, **kwargs)
d55e5bfc
RD
11194
11195 def IsSubMenu(*args, **kwargs):
11196 """IsSubMenu(self) -> bool"""
5b5c9bc7 11197 return _core_.MenuItem_IsSubMenu(*args, **kwargs)
d55e5bfc
RD
11198
11199 def SetSubMenu(*args, **kwargs):
5b5c9bc7
RD
11200 """SetSubMenu(self, Menu menu)"""
11201 return _core_.MenuItem_SetSubMenu(*args, **kwargs)
d55e5bfc
RD
11202
11203 def GetSubMenu(*args, **kwargs):
5b5c9bc7
RD
11204 """GetSubMenu(self) -> Menu"""
11205 return _core_.MenuItem_GetSubMenu(*args, **kwargs)
d55e5bfc
RD
11206
11207 def Enable(*args, **kwargs):
11208 """Enable(self, bool enable=True)"""
5b5c9bc7 11209 return _core_.MenuItem_Enable(*args, **kwargs)
d55e5bfc
RD
11210
11211 def IsEnabled(*args, **kwargs):
11212 """IsEnabled(self) -> bool"""
5b5c9bc7 11213 return _core_.MenuItem_IsEnabled(*args, **kwargs)
d55e5bfc
RD
11214
11215 def Check(*args, **kwargs):
11216 """Check(self, bool check=True)"""
5b5c9bc7 11217 return _core_.MenuItem_Check(*args, **kwargs)
d55e5bfc
RD
11218
11219 def IsChecked(*args, **kwargs):
11220 """IsChecked(self) -> bool"""
5b5c9bc7 11221 return _core_.MenuItem_IsChecked(*args, **kwargs)
d55e5bfc
RD
11222
11223 def Toggle(*args, **kwargs):
11224 """Toggle(self)"""
5b5c9bc7 11225 return _core_.MenuItem_Toggle(*args, **kwargs)
d55e5bfc
RD
11226
11227 def SetHelp(*args, **kwargs):
5b5c9bc7
RD
11228 """SetHelp(self, String str)"""
11229 return _core_.MenuItem_SetHelp(*args, **kwargs)
d55e5bfc
RD
11230
11231 def GetHelp(*args, **kwargs):
5b5c9bc7
RD
11232 """GetHelp(self) -> String"""
11233 return _core_.MenuItem_GetHelp(*args, **kwargs)
d55e5bfc
RD
11234
11235 def GetAccel(*args, **kwargs):
5b5c9bc7
RD
11236 """GetAccel(self) -> AcceleratorEntry"""
11237 return _core_.MenuItem_GetAccel(*args, **kwargs)
d55e5bfc
RD
11238
11239 def SetAccel(*args, **kwargs):
5b5c9bc7
RD
11240 """SetAccel(self, AcceleratorEntry accel)"""
11241 return _core_.MenuItem_SetAccel(*args, **kwargs)
d55e5bfc 11242
32fe5131
RD
11243 def SetBitmap(*args, **kwargs):
11244 """SetBitmap(self, Bitmap bitmap)"""
11245 return _core_.MenuItem_SetBitmap(*args, **kwargs)
11246
11247 def GetBitmap(*args, **kwargs):
11248 """GetBitmap(self) -> Bitmap"""
11249 return _core_.MenuItem_GetBitmap(*args, **kwargs)
11250
c1280d1e 11251 def SetFont(*args, **kwargs):
5b5c9bc7
RD
11252 """SetFont(self, Font font)"""
11253 return _core_.MenuItem_SetFont(*args, **kwargs)
c1280d1e
RD
11254
11255 def GetFont(*args, **kwargs):
5b5c9bc7
RD
11256 """GetFont(self) -> Font"""
11257 return _core_.MenuItem_GetFont(*args, **kwargs)
c1280d1e
RD
11258
11259 def SetTextColour(*args, **kwargs):
5b5c9bc7
RD
11260 """SetTextColour(self, Colour colText)"""
11261 return _core_.MenuItem_SetTextColour(*args, **kwargs)
c1280d1e
RD
11262
11263 def GetTextColour(*args, **kwargs):
5b5c9bc7
RD
11264 """GetTextColour(self) -> Colour"""
11265 return _core_.MenuItem_GetTextColour(*args, **kwargs)
c1280d1e
RD
11266
11267 def SetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
11268 """SetBackgroundColour(self, Colour colBack)"""
11269 return _core_.MenuItem_SetBackgroundColour(*args, **kwargs)
c1280d1e
RD
11270
11271 def GetBackgroundColour(*args, **kwargs):
5b5c9bc7
RD
11272 """GetBackgroundColour(self) -> Colour"""
11273 return _core_.MenuItem_GetBackgroundColour(*args, **kwargs)
c1280d1e
RD
11274
11275 def SetBitmaps(*args, **kwargs):
5b5c9bc7
RD
11276 """SetBitmaps(self, Bitmap bmpChecked, Bitmap bmpUnchecked=wxNullBitmap)"""
11277 return _core_.MenuItem_SetBitmaps(*args, **kwargs)
c1280d1e
RD
11278
11279 def SetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
11280 """SetDisabledBitmap(self, Bitmap bmpDisabled)"""
11281 return _core_.MenuItem_SetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
11282
11283 def GetDisabledBitmap(*args, **kwargs):
5b5c9bc7
RD
11284 """GetDisabledBitmap(self) -> Bitmap"""
11285 return _core_.MenuItem_GetDisabledBitmap(*args, **kwargs)
c1280d1e
RD
11286
11287 def SetMarginWidth(*args, **kwargs):
11288 """SetMarginWidth(self, int nWidth)"""
5b5c9bc7 11289 return _core_.MenuItem_SetMarginWidth(*args, **kwargs)
c1280d1e
RD
11290
11291 def GetMarginWidth(*args, **kwargs):
11292 """GetMarginWidth(self) -> int"""
5b5c9bc7 11293 return _core_.MenuItem_GetMarginWidth(*args, **kwargs)
c1280d1e 11294
d55e5bfc 11295 def GetDefaultMarginWidth(*args, **kwargs):
d6c14a4c 11296 """GetDefaultMarginWidth() -> int"""
5b5c9bc7 11297 return _core_.MenuItem_GetDefaultMarginWidth(*args, **kwargs)
d55e5bfc
RD
11298
11299 GetDefaultMarginWidth = staticmethod(GetDefaultMarginWidth)
c1280d1e
RD
11300 def IsOwnerDrawn(*args, **kwargs):
11301 """IsOwnerDrawn(self) -> bool"""
5b5c9bc7 11302 return _core_.MenuItem_IsOwnerDrawn(*args, **kwargs)
c1280d1e
RD
11303
11304 def SetOwnerDrawn(*args, **kwargs):
11305 """SetOwnerDrawn(self, bool ownerDrawn=True)"""
5b5c9bc7 11306 return _core_.MenuItem_SetOwnerDrawn(*args, **kwargs)
c1280d1e
RD
11307
11308 def ResetOwnerDrawn(*args, **kwargs):
11309 """ResetOwnerDrawn(self)"""
5b5c9bc7 11310 return _core_.MenuItem_ResetOwnerDrawn(*args, **kwargs)
c1280d1e 11311
57332a5a
RD
11312 Accel = property(GetAccel,SetAccel,doc="See `GetAccel` and `SetAccel`")
11313 BackgroundColour = property(GetBackgroundColour,SetBackgroundColour,doc="See `GetBackgroundColour` and `SetBackgroundColour`")
11314 Bitmap = property(GetBitmap,SetBitmap,doc="See `GetBitmap` and `SetBitmap`")
11315 DisabledBitmap = property(GetDisabledBitmap,SetDisabledBitmap,doc="See `GetDisabledBitmap` and `SetDisabledBitmap`")
11316 Font = property(GetFont,SetFont,doc="See `GetFont` and `SetFont`")
11317 Help = property(GetHelp,SetHelp,doc="See `GetHelp` and `SetHelp`")
11318 Id = property(GetId,SetId,doc="See `GetId` and `SetId`")
11319 Kind = property(GetKind,SetKind,doc="See `GetKind` and `SetKind`")
11320 Label = property(GetLabel,doc="See `GetLabel`")
11321 MarginWidth = property(GetMarginWidth,SetMarginWidth,doc="See `GetMarginWidth` and `SetMarginWidth`")
11322 Menu = property(GetMenu,SetMenu,doc="See `GetMenu` and `SetMenu`")
11323 SubMenu = property(GetSubMenu,SetSubMenu,doc="See `GetSubMenu` and `SetSubMenu`")
11324 Text = property(GetText,SetText,doc="See `GetText` and `SetText`")
11325 TextColour = property(GetTextColour,SetTextColour,doc="See `GetTextColour` and `SetTextColour`")
2131d850 11326_core_.MenuItem_swigregister(MenuItem)
d55e5bfc 11327
5b5c9bc7 11328def MenuItem_GetLabelFromText(*args, **kwargs):
1bd55598
RD
11329 """MenuItem_GetLabelFromText(String text) -> String"""
11330 return _core_.MenuItem_GetLabelFromText(*args, **kwargs)
d55e5bfc 11331
1bd55598
RD
11332def MenuItem_GetDefaultMarginWidth(*args):
11333 """MenuItem_GetDefaultMarginWidth() -> int"""
11334 return _core_.MenuItem_GetDefaultMarginWidth(*args)
d55e5bfc
RD
11335
11336#---------------------------------------------------------------------------
11337
5b5c9bc7 11338class Control(Window):
d55e5bfc
RD
11339 """
11340 This is the base class for a control or 'widget'.
11341
15817c7e
RD
11342 A control is generally a small window which processes user input
11343 and/or displays one or more item of data.
d55e5bfc 11344 """
1bd55598
RD
11345 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11346 __repr__ = _swig_repr
11347 def __init__(self, *args, **kwargs):
d55e5bfc 11348 """
5b5c9bc7
RD
11349 __init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
11350 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11351 String name=ControlNameStr) -> Control
d55e5bfc 11352
15817c7e
RD
11353 Create a Control. Normally you should only call this from a subclass'
11354 __init__ as a plain old wx.Control is not very useful.
d55e5bfc 11355 """
1bd55598 11356 _core_.Control_swiginit(self,_core_.new_Control(*args, **kwargs))
d55e5bfc
RD
11357 self._setOORInfo(self)
11358
11359 def Create(*args, **kwargs):
11360 """
5b5c9bc7
RD
11361 Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
11362 Size size=DefaultSize, long style=0, Validator validator=DefaultValidator,
11363 String name=ControlNameStr) -> bool
d55e5bfc
RD
11364
11365 Do the 2nd phase and create the GUI control.
11366 """
5b5c9bc7 11367 return _core_.Control_Create(*args, **kwargs)
d55e5bfc 11368
1eeb270e
RD
11369 def GetAlignment(*args, **kwargs):
11370 """
11371 GetAlignment(self) -> int
11372
11373 Get the control alignment (left/right/centre, top/bottom/centre)
11374 """
11375 return _core_.Control_GetAlignment(*args, **kwargs)
11376
34e0a3bb 11377 def GetLabelText(*args, **kwargs):
1eeb270e 11378 """
1eeb270e
RD
11379 GetLabelText(self) -> String
11380
11381 Get just the text of the label, without mnemonic characters ('&')
11382 """
34e0a3bb 11383 return _core_.Control_GetLabelText(*args, **kwargs)
1eeb270e 11384
d55e5bfc
RD
11385 def Command(*args, **kwargs):
11386 """
5b5c9bc7 11387 Command(self, CommandEvent event)
d55e5bfc 11388
15817c7e
RD
11389 Simulates the effect of the user issuing a command to the item.
11390
11391 :see: `wx.CommandEvent`
11392
d55e5bfc 11393 """
5b5c9bc7 11394 return _core_.Control_Command(*args, **kwargs)
d55e5bfc 11395
d55e5bfc 11396 def GetClassDefaultAttributes(*args, **kwargs):
110da5b0 11397 """
5b5c9bc7 11398 GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
11399
11400 Get the default attributes for this class. This is useful if you want
11401 to use the same font or colour in your own control as in a standard
11402 control -- which is a much better idea than hard coding specific
11403 colours or fonts which might look completely out of place on the
11404 user's system, especially if it uses themes.
11405
11406 The variant parameter is only relevant under Mac currently and is
11407 ignore under other platforms. Under Mac, it will change the size of
11408 the returned font. See `wx.Window.SetWindowVariant` for more about
11409 this.
11410 """
5b5c9bc7 11411 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
11412
11413 GetClassDefaultAttributes = staticmethod(GetClassDefaultAttributes)
2bf58437 11414 Alignment = property(GetAlignment,doc="See `GetAlignment`")
2bf58437 11415 LabelText = property(GetLabelText,doc="See `GetLabelText`")
2131d850 11416_core_.Control_swigregister(Control)
d55e5bfc
RD
11417ControlNameStr = cvar.ControlNameStr
11418
11419def PreControl(*args, **kwargs):
11420 """
5b5c9bc7 11421 PreControl() -> Control
d55e5bfc
RD
11422
11423 Precreate a Control control for 2-phase creation
11424 """
5b5c9bc7 11425 val = _core_.new_PreControl(*args, **kwargs)
d55e5bfc
RD
11426 return val
11427
5b5c9bc7 11428def Control_GetClassDefaultAttributes(*args, **kwargs):
1bd55598 11429 """
5b5c9bc7 11430 Control_GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
110da5b0
RD
11431
11432 Get the default attributes for this class. This is useful if you want
11433 to use the same font or colour in your own control as in a standard
11434 control -- which is a much better idea than hard coding specific
11435 colours or fonts which might look completely out of place on the
11436 user's system, especially if it uses themes.
11437
11438 The variant parameter is only relevant under Mac currently and is
11439 ignore under other platforms. Under Mac, it will change the size of
11440 the returned font. See `wx.Window.SetWindowVariant` for more about
11441 this.
11442 """
1bd55598 11443 return _core_.Control_GetClassDefaultAttributes(*args, **kwargs)
d55e5bfc
RD
11444
11445#---------------------------------------------------------------------------
11446
5b5c9bc7 11447class ItemContainer(object):
d55e5bfc 11448 """
53aa7709
RD
11449 The wx.ItemContainer class defines an interface which is implemented
11450 by all controls which have string subitems, each of which may be
11451 selected, such as `wx.ListBox`, `wx.CheckListBox`, `wx.Choice` as well
11452 as `wx.ComboBox` which implements an extended interface deriving from
15817c7e 11453 this one.
d55e5bfc 11454
15817c7e
RD
11455 It defines the methods for accessing the control's items and although
11456 each of the derived classes implements them differently, they still
11457 all conform to the same interface.
d55e5bfc 11458
15817c7e
RD
11459 The items in a wx.ItemContainer have (non empty) string labels and,
11460 optionally, client data associated with them.
d55e5bfc
RD
11461
11462 """
1bd55598
RD
11463 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11464 def __init__(self): raise AttributeError, "No constructor defined"
11465 __repr__ = _swig_repr
d55e5bfc
RD
11466 def Append(*args, **kwargs):
11467 """
5b5c9bc7 11468 Append(self, String item, PyObject clientData=None) -> int
d55e5bfc 11469
15817c7e
RD
11470 Adds the item to the control, associating the given data with the item
11471 if not None. The return value is the index of the newly added item
11472 which may be different from the last one if the control is sorted (e.g.
11473 has wx.LB_SORT or wx.CB_SORT style).
d55e5bfc 11474 """
5b5c9bc7 11475 return _core_.ItemContainer_Append(*args, **kwargs)
d55e5bfc
RD
11476
11477 def AppendItems(*args, **kwargs):
11478 """
f5b96ee1 11479 AppendItems(self, List strings)
d55e5bfc 11480
15817c7e
RD
11481 Apend several items at once to the control. Notice that calling this
11482 method may be much faster than appending the items one by one if you
11483 need to add a lot of items.
d55e5bfc 11484 """
5b5c9bc7 11485 return _core_.ItemContainer_AppendItems(*args, **kwargs)
d55e5bfc
RD
11486
11487 def Insert(*args, **kwargs):
11488 """
d359a380 11489 Insert(self, String item, int pos, PyObject clientData=None) -> int
d55e5bfc 11490
15817c7e 11491 Insert an item into the control before the item at the ``pos`` index,
d55e5bfc
RD
11492 optionally associating some data object with the item.
11493 """
5b5c9bc7 11494 return _core_.ItemContainer_Insert(*args, **kwargs)
d55e5bfc
RD
11495
11496 def Clear(*args, **kwargs):
11497 """
11498 Clear(self)
11499
11500 Removes all items from the control.
11501 """
5b5c9bc7 11502 return _core_.ItemContainer_Clear(*args, **kwargs)
d55e5bfc
RD
11503
11504 def Delete(*args, **kwargs):
11505 """
d359a380 11506 Delete(self, int n)
d55e5bfc 11507
15817c7e
RD
11508 Deletes the item at the zero-based index 'n' from the control. Note
11509 that it is an error (signalled by a `wx.PyAssertionError` exception if
11510 enabled) to remove an item with the index negative or greater or equal
11511 than the number of items in the control.
d55e5bfc 11512 """
5b5c9bc7 11513 return _core_.ItemContainer_Delete(*args, **kwargs)
d55e5bfc 11514
53aa7709
RD
11515 def GetClientData(*args, **kwargs):
11516 """
d359a380 11517 GetClientData(self, int n) -> PyObject
53aa7709
RD
11518
11519 Returns the client data associated with the given item, (if any.)
11520 """
5b5c9bc7 11521 return _core_.ItemContainer_GetClientData(*args, **kwargs)
53aa7709
RD
11522
11523 def SetClientData(*args, **kwargs):
11524 """
d359a380 11525 SetClientData(self, int n, PyObject clientData)
53aa7709
RD
11526
11527 Associate the given client data with the item at position n.
11528 """
5b5c9bc7 11529 return _core_.ItemContainer_SetClientData(*args, **kwargs)
53aa7709 11530
d55e5bfc
RD
11531 def GetCount(*args, **kwargs):
11532 """
d359a380 11533 GetCount(self) -> int
d55e5bfc
RD
11534
11535 Returns the number of items in the control.
11536 """
5b5c9bc7 11537 return _core_.ItemContainer_GetCount(*args, **kwargs)
d55e5bfc
RD
11538
11539 def IsEmpty(*args, **kwargs):
11540 """
11541 IsEmpty(self) -> bool
11542
11543 Returns True if the control is empty or False if it has some items.
11544 """
5b5c9bc7 11545 return _core_.ItemContainer_IsEmpty(*args, **kwargs)
d55e5bfc
RD
11546
11547 def GetString(*args, **kwargs):
11548 """
d359a380 11549 GetString(self, int n) -> String
d55e5bfc
RD
11550
11551 Returns the label of the item with the given index.
11552 """
5b5c9bc7 11553 return _core_.ItemContainer_GetString(*args, **kwargs)
d55e5bfc
RD
11554
11555 def GetStrings(*args, **kwargs):
11556 """GetStrings(self) -> wxArrayString"""
5b5c9bc7 11557 return _core_.ItemContainer_GetStrings(*args, **kwargs)
d55e5bfc
RD
11558
11559 def SetString(*args, **kwargs):
11560 """
d359a380 11561 SetString(self, int n, String s)
d55e5bfc
RD
11562
11563 Sets the label for the given item.
11564 """
5b5c9bc7 11565 return _core_.ItemContainer_SetString(*args, **kwargs)
d55e5bfc
RD
11566
11567 def FindString(*args, **kwargs):
11568 """
5b5c9bc7 11569 FindString(self, String s) -> int
d55e5bfc
RD
11570
11571 Finds an item whose label matches the given string. Returns the
15817c7e
RD
11572 zero-based position of the item, or ``wx.NOT_FOUND`` if the string was not
11573 found.
d55e5bfc 11574 """
5b5c9bc7 11575 return _core_.ItemContainer_FindString(*args, **kwargs)
d55e5bfc 11576
53aa7709 11577 def SetSelection(*args, **kwargs):
d55e5bfc 11578 """
53aa7709 11579 SetSelection(self, int n)
d55e5bfc
RD
11580
11581 Sets the item at index 'n' to be the selected item.
11582 """
5b5c9bc7 11583 return _core_.ItemContainer_SetSelection(*args, **kwargs)
d55e5bfc 11584
d55e5bfc
RD
11585 def GetSelection(*args, **kwargs):
11586 """
11587 GetSelection(self) -> int
11588
15817c7e
RD
11589 Returns the index of the selected item or ``wx.NOT_FOUND`` if no item
11590 is selected.
d55e5bfc 11591 """
5b5c9bc7 11592 return _core_.ItemContainer_GetSelection(*args, **kwargs)
d55e5bfc 11593
53aa7709 11594 def SetStringSelection(*args, **kwargs):
5b5c9bc7
RD
11595 """SetStringSelection(self, String s) -> bool"""
11596 return _core_.ItemContainer_SetStringSelection(*args, **kwargs)
53aa7709 11597
d55e5bfc
RD
11598 def GetStringSelection(*args, **kwargs):
11599 """
5b5c9bc7 11600 GetStringSelection(self) -> String
d55e5bfc 11601
15817c7e
RD
11602 Returns the label of the selected item or an empty string if no item
11603 is selected.
d55e5bfc 11604 """
5b5c9bc7 11605 return _core_.ItemContainer_GetStringSelection(*args, **kwargs)
d55e5bfc 11606
53aa7709 11607 def Select(*args, **kwargs):
d55e5bfc 11608 """
53aa7709 11609 Select(self, int n)
d55e5bfc 11610
53aa7709
RD
11611 This is the same as `SetSelection` and exists only because it is
11612 slightly more natural for controls which support multiple selection.
d55e5bfc 11613 """
5b5c9bc7 11614 return _core_.ItemContainer_Select(*args, **kwargs)
d55e5bfc 11615
ac5d357a
RD
11616 def GetItems(self):
11617 """Return a list of the strings in the control"""
11618 return [self.GetString(i) for i in xrange(self.GetCount())]
11619
11620 def SetItems(self, items):
11621 """Clear and set the strings in the control from a list"""
11622 self.Clear()
11623 for i in items:
11624 self.Append(i)
11625
11626 Count = property(GetCount,doc="See `GetCount`")
11627 Items = property(GetItems,SetItems,doc="See `GetItems` and `SetItems`")
11628 Selection = property(GetSelection,SetSelection,doc="See `GetSelection` and `SetSelection`")
11629 StringSelection = property(GetStringSelection,SetStringSelection,doc="See `GetStringSelection` and `SetStringSelection`")
11630 Strings = property(GetStrings,doc="See `GetStrings`")
2131d850 11631_core_.ItemContainer_swigregister(ItemContainer)
d55e5bfc
RD
11632
11633#---------------------------------------------------------------------------
11634
5b5c9bc7 11635class ControlWithItems(Control,ItemContainer):
d55e5bfc 11636 """
15817c7e
RD
11637 wx.ControlWithItems combines the ``wx.ItemContainer`` class with the
11638 wx.Control class, and is used for the base class of various controls
11639 that have items.
d55e5bfc 11640 """
1bd55598
RD
11641 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11642 def __init__(self): raise AttributeError, "No constructor defined"
11643 __repr__ = _swig_repr
2131d850 11644_core_.ControlWithItems_swigregister(ControlWithItems)
d55e5bfc
RD
11645
11646#---------------------------------------------------------------------------
11647
cbfc9df6
RD
11648class SizerFlags(object):
11649 """
11650 Normally, when you add an item to a sizer via `wx.Sizer.Add`, you have
11651 to specify a lot of flags and parameters which can be unwieldy. This
11652 is where wx.SizerFlags comes in: it allows you to specify all
11653 parameters using the named methods instead. For example, instead of::
11654
11655 sizer.Add(ctrl, 0, wx.EXPAND | wx.ALL, 10)
11656
11657 you can now write::
11658
11659 sizer.AddF(ctrl, wx.SizerFlags().Expand().Border(wx.ALL, 10))
11660
11661 This is more readable and also allows you to create wx.SizerFlags
11662 objects which can be reused for several sizer items.::
11663
11664 flagsExpand = wx.SizerFlags(1)
11665 flagsExpand.Expand().Border(wx.ALL, 10)
11666 sizer.AddF(ctrl1, flagsExpand)
11667 sizer.AddF(ctrl2, flagsExpand)
11668
11669 Note that by specification, all methods of wx.SizerFlags return the
11670 wx.SizerFlags object itself allowing chaining multiple method calls
11671 like in the examples above.
11672 """
11673 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11674 __repr__ = _swig_repr
11675 def __init__(self, *args, **kwargs):
11676 """
11677 __init__(self, int proportion=0) -> SizerFlags
11678
11679 Constructs the flags object with the specified proportion.
11680 """
11681 _core_.SizerFlags_swiginit(self,_core_.new_SizerFlags(*args, **kwargs))
11682 __swig_destroy__ = _core_.delete_SizerFlags
11683 __del__ = lambda self : None;
11684 def Proportion(*args, **kwargs):
11685 """
11686 Proportion(self, int proportion) -> SizerFlags
11687
11688 Sets the item's proportion value.
11689 """
11690 return _core_.SizerFlags_Proportion(*args, **kwargs)
11691
11692 def Align(*args, **kwargs):
11693 """
11694 Align(self, int alignment) -> SizerFlags
11695
11696 Sets the item's alignment
11697 """
11698 return _core_.SizerFlags_Align(*args, **kwargs)
11699
11700 def Expand(*args, **kwargs):
11701 """
11702 Expand(self) -> SizerFlags
11703
11704 Sets the wx.EXPAND flag, which will cause the item to be expanded to
11705 fill as much space as it is given by the sizer.
11706 """
11707 return _core_.SizerFlags_Expand(*args, **kwargs)
11708
11709 def Centre(*args, **kwargs):
11710 """
11711 Centre(self) -> SizerFlags
11712
11713 Same as `Center` for those with an alternate dialect of English.
11714 """
11715 return _core_.SizerFlags_Centre(*args, **kwargs)
11716
11717 def Center(*args, **kwargs):
11718 """
11719 Center(self) -> SizerFlags
11720
11721 Sets the centering alignment flags.
11722 """
11723 return _core_.SizerFlags_Center(*args, **kwargs)
11724
11725 def Left(*args, **kwargs):
11726 """
11727 Left(self) -> SizerFlags
11728
11729 Aligns the object to the left, a shortcut for calling
11730 Align(wx.ALIGN_LEFT)
11731 """
11732 return _core_.SizerFlags_Left(*args, **kwargs)
11733
11734 def Right(*args, **kwargs):
11735 """
11736 Right(self) -> SizerFlags
11737
11738 Aligns the object to the right, a shortcut for calling
11739 Align(wx.ALIGN_RIGHT)
11740 """
11741 return _core_.SizerFlags_Right(*args, **kwargs)
11742
11743 def Top(*args, **kwargs):
11744 """
11745 Top(self) -> SizerFlags
11746
11747 Aligns the object to the top of the available space, a shortcut for
11748 calling Align(wx.ALIGN_TOP)
11749 """
11750 return _core_.SizerFlags_Top(*args, **kwargs)
11751
11752 def Bottom(*args, **kwargs):
11753 """
11754 Bottom(self) -> SizerFlags
11755
11756 Aligns the object to the bottom of the available space, a shortcut for
11757 calling Align(wx.ALIGN_BOTTOM)
11758 """
11759 return _core_.SizerFlags_Bottom(*args, **kwargs)
11760
11761 def Shaped(*args, **kwargs):
11762 """
11763 Shaped(self) -> SizerFlags
11764
11765 Sets the wx.SHAPED flag.
11766 """
11767 return _core_.SizerFlags_Shaped(*args, **kwargs)
11768
11769 def FixedMinSize(*args, **kwargs):
11770 """
11771 FixedMinSize(self) -> SizerFlags
11772
11773 Sets the wx.FIXED_MINSIZE flag.
11774 """
11775 return _core_.SizerFlags_FixedMinSize(*args, **kwargs)
11776
11777 def Border(*args, **kwargs):
11778 """
11779 Border(self, int direction=ALL, int borderInPixels=-1) -> SizerFlags
11780
11781 Sets the border of the item in the direction(s) or sides given by the
11782 direction parameter. If the borderInPixels value is not given then
11783 the default border size (see `GetDefaultBorder`) will be used.
11784 """
11785 return _core_.SizerFlags_Border(*args, **kwargs)
11786
11787 def DoubleBorder(*args, **kwargs):
11788 """
11789 DoubleBorder(self, int direction=ALL) -> SizerFlags
11790
11791 Sets the border in the given direction to twice the default border
11792 size.
11793 """
11794 return _core_.SizerFlags_DoubleBorder(*args, **kwargs)
11795
11796 def TripleBorder(*args, **kwargs):
11797 """
11798 TripleBorder(self, int direction=ALL) -> SizerFlags
11799
11800 Sets the border in the given direction to three times the default
11801 border size.
11802 """
11803 return _core_.SizerFlags_TripleBorder(*args, **kwargs)
11804
11805 def HorzBorder(*args, **kwargs):
11806 """
11807 HorzBorder(self) -> SizerFlags
11808
11809 Sets the left and right borders to the default border size.
11810 """
11811 return _core_.SizerFlags_HorzBorder(*args, **kwargs)
11812
11813 def DoubleHorzBorder(*args, **kwargs):
11814 """
11815 DoubleHorzBorder(self) -> SizerFlags
11816
11817 Sets the left and right borders to twice the default border size.
11818 """
11819 return _core_.SizerFlags_DoubleHorzBorder(*args, **kwargs)
11820
11821 def GetDefaultBorder(*args, **kwargs):
11822 """
11823 GetDefaultBorder() -> int
11824
11825 Returns the default border size used by the other border methods
11826 """
11827 return _core_.SizerFlags_GetDefaultBorder(*args, **kwargs)
11828
11829 GetDefaultBorder = staticmethod(GetDefaultBorder)
11830 def GetProportion(*args, **kwargs):
11831 """
11832 GetProportion(self) -> int
11833
11834 Returns the proportion value to be used in the sizer item.
11835 """
11836 return _core_.SizerFlags_GetProportion(*args, **kwargs)
11837
11838 def GetFlags(*args, **kwargs):
11839 """
11840 GetFlags(self) -> int
11841
11842 Returns the flags value to be used in the sizer item.
11843 """
11844 return _core_.SizerFlags_GetFlags(*args, **kwargs)
11845
11846 def GetBorderInPixels(*args, **kwargs):
11847 """
11848 GetBorderInPixels(self) -> int
11849
11850 Returns the border value in pixels to be used in the sizer item.
11851 """
11852 return _core_.SizerFlags_GetBorderInPixels(*args, **kwargs)
11853
11854_core_.SizerFlags_swigregister(SizerFlags)
11855
11856def SizerFlags_GetDefaultBorder(*args):
11857 """
11858 SizerFlags_GetDefaultBorder() -> int
11859
11860 Returns the default border size used by the other border methods
11861 """
11862 return _core_.SizerFlags_GetDefaultBorder(*args)
11863
5b5c9bc7 11864class SizerItem(Object):
bfddbb17
RD
11865 """
11866 The wx.SizerItem class is used to track the position, size and other
2131d850
RD
11867 attributes of each item managed by a `wx.Sizer`. It is not usually
11868 necessary to use this class because the sizer elements can also be
11869 identified by their positions or window or sizer references but
11870 sometimes it may be more convenient to use wx.SizerItem directly.
11871 Also, custom classes derived from `wx.PySizer` will probably need to
11872 use the collection of wx.SizerItems held by wx.Sizer when calculating
11873 layout.
bfddbb17
RD
11874
11875 :see: `wx.Sizer`, `wx.GBSizerItem`
11876 """
1bd55598
RD
11877 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
11878 __repr__ = _swig_repr
11879 def __init__(self, *args, **kwargs):
bfddbb17 11880 """
5b5c9bc7 11881 __init__(self) -> SizerItem
bfddbb17
RD
11882
11883 Constructs an empty wx.SizerItem. Either a window, sizer or spacer
11884 size will need to be set before this item can be used in a Sizer.
11885
11886 You will probably never need to create a wx.SizerItem directly as they
11887 are created automatically when the sizer's Add, Insert or Prepend
11888 methods are called.
11889
11890 :see: `wx.SizerItemSpacer`, `wx.SizerItemWindow`, `wx.SizerItemSizer`
11891 """
1bd55598
RD
11892 _core_.SizerItem_swiginit(self,_core_.new_SizerItem(*args, **kwargs))
11893 __swig_destroy__ = _core_.delete_SizerItem
11894 __del__ = lambda self : None;
d55e5bfc 11895 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
11896 """
11897 DeleteWindows(self)
11898
11899 Destroy the window or the windows in a subsizer, depending on the type
11900 of item.
11901 """
5b5c9bc7 11902 return _core_.SizerItem_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
11903
11904 def DetachSizer(*args, **kwargs):
bfddbb17
RD
11905 """
11906 DetachSizer(self)
11907
11908 Enable deleting the SizerItem without destroying the contained sizer.
11909 """
5b5c9bc7 11910 return _core_.SizerItem_DetachSizer(*args, **kwargs)
d55e5bfc
RD
11911
11912 def GetSize(*args, **kwargs):
bfddbb17 11913 """
5b5c9bc7 11914 GetSize(self) -> Size
bfddbb17
RD
11915
11916 Get the current size of the item, as set in the last Layout.
11917 """
5b5c9bc7 11918 return _core_.SizerItem_GetSize(*args, **kwargs)
d55e5bfc
RD
11919
11920 def CalcMin(*args, **kwargs):
bfddbb17 11921 """
5b5c9bc7 11922 CalcMin(self) -> Size
bfddbb17
RD
11923
11924 Calculates the minimum desired size for the item, including any space
11925 needed by borders.
11926 """
5b5c9bc7 11927 return _core_.SizerItem_CalcMin(*args, **kwargs)
d55e5bfc
RD
11928
11929 def SetDimension(*args, **kwargs):
bfddbb17 11930 """
5b5c9bc7 11931 SetDimension(self, Point pos, Size size)
bfddbb17
RD
11932
11933 Set the position and size of the space allocated for this item by the
11934 sizer, and adjust the position and size of the item (window or
11935 subsizer) to be within that space taking alignment and borders into
11936 account.
11937 """
5b5c9bc7 11938 return _core_.SizerItem_SetDimension(*args, **kwargs)
d55e5bfc
RD
11939
11940 def GetMinSize(*args, **kwargs):
bfddbb17 11941 """
5b5c9bc7 11942 GetMinSize(self) -> Size
bfddbb17
RD
11943
11944 Get the minimum size needed for the item.
11945 """
5b5c9bc7 11946 return _core_.SizerItem_GetMinSize(*args, **kwargs)
d55e5bfc 11947
a001823c
RD
11948 def GetMinSizeWithBorder(*args, **kwargs):
11949 """
5b5c9bc7 11950 GetMinSizeWithBorder(self) -> Size
a001823c
RD
11951
11952 Get the minimum size needed for the item with space for the borders
11953 added, if needed.
11954 """
5b5c9bc7 11955 return _core_.SizerItem_GetMinSizeWithBorder(*args, **kwargs)
a001823c 11956
d55e5bfc
RD
11957 def SetInitSize(*args, **kwargs):
11958 """SetInitSize(self, int x, int y)"""
5b5c9bc7 11959 return _core_.SizerItem_SetInitSize(*args, **kwargs)
d55e5bfc
RD
11960
11961 def SetRatioWH(*args, **kwargs):
bfddbb17
RD
11962 """
11963 SetRatioWH(self, int width, int height)
11964
11965 Set the ratio item attribute.
11966 """
5b5c9bc7 11967 return _core_.SizerItem_SetRatioWH(*args, **kwargs)
d55e5bfc
RD
11968
11969 def SetRatioSize(*args, **kwargs):
bfddbb17 11970 """
5b5c9bc7 11971 SetRatioSize(self, Size size)
bfddbb17
RD
11972
11973 Set the ratio item attribute.
11974 """
5b5c9bc7 11975 return _core_.SizerItem_SetRatioSize(*args, **kwargs)
d55e5bfc
RD
11976
11977 def SetRatio(*args, **kwargs):
bfddbb17
RD
11978 """
11979 SetRatio(self, float ratio)
11980
11981 Set the ratio item attribute.
11982 """
5b5c9bc7 11983 return _core_.SizerItem_SetRatio(*args, **kwargs)
d55e5bfc
RD
11984
11985 def GetRatio(*args, **kwargs):
bfddbb17
RD
11986 """
11987 GetRatio(self) -> float
11988
11989 Set the ratio item attribute.
11990 """
5b5c9bc7 11991 return _core_.SizerItem_GetRatio(*args, **kwargs)
d55e5bfc 11992
070c48b4
RD
11993 def GetRect(*args, **kwargs):
11994 """
5b5c9bc7 11995 GetRect(self) -> Rect
070c48b4
RD
11996
11997 Returns the rectangle that the sizer item should occupy
11998 """
5b5c9bc7 11999 return _core_.SizerItem_GetRect(*args, **kwargs)
070c48b4 12000
d55e5bfc 12001 def IsWindow(*args, **kwargs):
bfddbb17
RD
12002 """
12003 IsWindow(self) -> bool
12004
12005 Is this sizer item a window?
12006 """
5b5c9bc7 12007 return _core_.SizerItem_IsWindow(*args, **kwargs)
d55e5bfc
RD
12008
12009 def IsSizer(*args, **kwargs):
bfddbb17
RD
12010 """
12011 IsSizer(self) -> bool
12012
12013 Is this sizer item a subsizer?
12014 """
5b5c9bc7 12015 return _core_.SizerItem_IsSizer(*args, **kwargs)
d55e5bfc
RD
12016
12017 def IsSpacer(*args, **kwargs):
bfddbb17
RD
12018 """
12019 IsSpacer(self) -> bool
12020
12021 Is this sizer item a spacer?
12022 """
5b5c9bc7 12023 return _core_.SizerItem_IsSpacer(*args, **kwargs)
d55e5bfc
RD
12024
12025 def SetProportion(*args, **kwargs):
bfddbb17
RD
12026 """
12027 SetProportion(self, int proportion)
12028
12029 Set the proportion value for this item.
12030 """
5b5c9bc7 12031 return _core_.SizerItem_SetProportion(*args, **kwargs)
d55e5bfc
RD
12032
12033 def GetProportion(*args, **kwargs):
bfddbb17
RD
12034 """
12035 GetProportion(self) -> int
12036
12037 Get the proportion value for this item.
12038 """
5b5c9bc7 12039 return _core_.SizerItem_GetProportion(*args, **kwargs)
d55e5bfc 12040
bfddbb17
RD
12041 SetOption = wx._deprecated(SetProportion, "Please use `SetProportion` instead.")
12042 GetOption = wx._deprecated(GetProportion, "Please use `GetProportion` instead.")
d55e5bfc 12043 def SetFlag(*args, **kwargs):
bfddbb17
RD
12044 """
12045 SetFlag(self, int flag)
12046
12047 Set the flag value for this item.
12048 """
5b5c9bc7 12049 return _core_.SizerItem_SetFlag(*args, **kwargs)
d55e5bfc
RD
12050
12051 def GetFlag(*args, **kwargs):
bfddbb17
RD
12052 """
12053 GetFlag(self) -> int
12054
12055 Get the flag value for this item.
12056 """
5b5c9bc7 12057 return _core_.SizerItem_GetFlag(*args, **kwargs)
d55e5bfc
RD
12058
12059 def SetBorder(*args, **kwargs):
bfddbb17
RD
12060 """
12061 SetBorder(self, int border)
12062
12063 Set the border value for this item.
12064 """
5b5c9bc7 12065 return _core_.SizerItem_SetBorder(*args, **kwargs)
d55e5bfc
RD
12066
12067 def GetBorder(*args, **kwargs):
bfddbb17
RD
12068 """
12069 GetBorder(self) -> int
12070
12071 Get the border value for this item.
12072 """
5b5c9bc7 12073 return _core_.SizerItem_GetBorder(*args, **kwargs)
d55e5bfc
RD
12074
12075 def GetWindow(*args, **kwargs):
bfddbb17 12076 """
5b5c9bc7 12077 GetWindow(self) -> Window
bfddbb17
RD
12078
12079 Get the window (if any) that is managed by this sizer item.
12080 """
5b5c9bc7 12081 return _core_.SizerItem_GetWindow(*args, **kwargs)
d55e5bfc
RD
12082
12083 def SetWindow(*args, **kwargs):
bfddbb17 12084 """
5b5c9bc7 12085 SetWindow(self, Window window)
bfddbb17
RD
12086
12087 Set the window to be managed by this sizer item.
12088 """
5b5c9bc7 12089 return _core_.SizerItem_SetWindow(*args, **kwargs)
d55e5bfc
RD
12090
12091 def GetSizer(*args, **kwargs):
bfddbb17 12092 """
5b5c9bc7 12093 GetSizer(self) -> Sizer
bfddbb17
RD
12094
12095 Get the subsizer (if any) that is managed by this sizer item.
12096 """
5b5c9bc7 12097 return _core_.SizerItem_GetSizer(*args, **kwargs)
d55e5bfc
RD
12098
12099 def SetSizer(*args, **kwargs):
bfddbb17 12100 """
5b5c9bc7 12101 SetSizer(self, Sizer sizer)
bfddbb17
RD
12102
12103 Set the subsizer to be managed by this sizer item.
12104 """
5b5c9bc7 12105 return _core_.SizerItem_SetSizer(*args, **kwargs)
d55e5bfc
RD
12106
12107 def GetSpacer(*args, **kwargs):
bfddbb17 12108 """
5b5c9bc7 12109 GetSpacer(self) -> Size
bfddbb17
RD
12110
12111 Get the size of the spacer managed by this sizer item.
12112 """
5b5c9bc7 12113 return _core_.SizerItem_GetSpacer(*args, **kwargs)
d55e5bfc
RD
12114
12115 def SetSpacer(*args, **kwargs):
bfddbb17 12116 """
5b5c9bc7 12117 SetSpacer(self, Size size)
bfddbb17
RD
12118
12119 Set the size of the spacer to be managed by this sizer item.
12120 """
5b5c9bc7 12121 return _core_.SizerItem_SetSpacer(*args, **kwargs)
d55e5bfc
RD
12122
12123 def Show(*args, **kwargs):
bfddbb17
RD
12124 """
12125 Show(self, bool show)
12126
12127 Set the show item attribute, which sizers use to determine if the item
12128 is to be made part of the layout or not. If the item is tracking a
12129 window then it is shown or hidden as needed.
12130 """
5b5c9bc7 12131 return _core_.SizerItem_Show(*args, **kwargs)
d55e5bfc
RD
12132
12133 def IsShown(*args, **kwargs):
bfddbb17
RD
12134 """
12135 IsShown(self) -> bool
12136
12137 Is the item to be shown in the layout?
12138 """
5b5c9bc7 12139 return _core_.SizerItem_IsShown(*args, **kwargs)
d55e5bfc
RD
12140
12141 def GetPosition(*args, **kwargs):
bfddbb17 12142 """
5b5c9bc7 12143 GetPosition(self) -> Point
bfddbb17
RD
12144
12145 Returns the current position of the item, as set in the last Layout.
12146 """
5b5c9bc7 12147 return _core_.SizerItem_GetPosition(*args, **kwargs)
d55e5bfc
RD
12148
12149 def GetUserData(*args, **kwargs):
bfddbb17
RD
12150 """
12151 GetUserData(self) -> PyObject
12152
12153 Returns the userData associated with this sizer item, or None if there
12154 isn't any.
12155 """
5b5c9bc7 12156 return _core_.SizerItem_GetUserData(*args, **kwargs)
d55e5bfc 12157
32fe5131
RD
12158 def SetUserData(*args, **kwargs):
12159 """
12160 SetUserData(self, PyObject userData)
12161
12162 Associate a Python object with this sizer item.
12163 """
12164 return _core_.SizerItem_SetUserData(*args, **kwargs)
12165
33d6fd3b
RD
12166 Border = property(GetBorder,SetBorder,doc="See `GetBorder` and `SetBorder`")
12167 Flag = property(GetFlag,SetFlag,doc="See `GetFlag` and `SetFlag`")
12168 MinSize = property(GetMinSize,doc="See `GetMinSize`")
12169 MinSizeWithBorder = property(GetMinSizeWithBorder,doc="See `GetMinSizeWithBorder`")
12170 Position = property(GetPosition,doc="See `GetPosition`")
12171 Proportion = property(GetProportion,SetProportion,doc="See `GetProportion` and `SetProportion`")
12172 Ratio = property(GetRatio,SetRatio,doc="See `GetRatio` and `SetRatio`")
12173 Rect = property(GetRect,doc="See `GetRect`")
12174 Size = property(GetSize,doc="See `GetSize`")
12175 Sizer = property(GetSizer,SetSizer,doc="See `GetSizer` and `SetSizer`")
12176 Spacer = property(GetSpacer,SetSpacer,doc="See `GetSpacer` and `SetSpacer`")
12177 UserData = property(GetUserData,SetUserData,doc="See `GetUserData` and `SetUserData`")
12178 Window = property(GetWindow,SetWindow,doc="See `GetWindow` and `SetWindow`")
2131d850 12179_core_.SizerItem_swigregister(SizerItem)
d55e5bfc 12180
bfddbb17 12181def SizerItemWindow(*args, **kwargs):
d55e5bfc 12182 """
5b5c9bc7
RD
12183 SizerItemWindow(Window window, int proportion, int flag, int border,
12184 PyObject userData=None) -> SizerItem
bfddbb17
RD
12185
12186 Constructs a `wx.SizerItem` for tracking a window.
d55e5bfc 12187 """
5b5c9bc7 12188 val = _core_.new_SizerItemWindow(*args, **kwargs)
d55e5bfc
RD
12189 return val
12190
bfddbb17 12191def SizerItemSpacer(*args, **kwargs):
d55e5bfc 12192 """
bfddbb17 12193 SizerItemSpacer(int width, int height, int proportion, int flag, int border,
5b5c9bc7 12194 PyObject userData=None) -> SizerItem
bfddbb17
RD
12195
12196 Constructs a `wx.SizerItem` for tracking a spacer.
d55e5bfc 12197 """
5b5c9bc7 12198 val = _core_.new_SizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
12199 return val
12200
12201def SizerItemSizer(*args, **kwargs):
12202 """
5b5c9bc7
RD
12203 SizerItemSizer(Sizer sizer, int proportion, int flag, int border,
12204 PyObject userData=None) -> SizerItem
bfddbb17
RD
12205
12206 Constructs a `wx.SizerItem` for tracking a subsizer
d55e5bfc 12207 """
5b5c9bc7 12208 val = _core_.new_SizerItemSizer(*args, **kwargs)
d55e5bfc
RD
12209 return val
12210
5b5c9bc7 12211class Sizer(Object):
bfddbb17
RD
12212 """
12213 wx.Sizer is the abstract base class used for laying out subwindows in
12214 a window. You cannot use wx.Sizer directly; instead, you will have to
12215 use one of the sizer classes derived from it such as `wx.BoxSizer`,
1d5ee749
RD
12216 `wx.StaticBoxSizer`, `wx.GridSizer`, `wx.FlexGridSizer` and
12217 `wx.GridBagSizer`.
bfddbb17
RD
12218
12219 The concept implemented by sizers in wxWidgets is closely related to
12220 layout tools in other GUI toolkits, such as Java's AWT, the GTK
12221 toolkit or the Qt toolkit. It is based upon the idea of the individual
12222 subwindows reporting their minimal required size and their ability to
12223 get stretched if the size of the parent window has changed. This will
12224 most often mean that the programmer does not set the original size of
12225 a dialog in the beginning, rather the dialog will assigned a sizer and
12226 this sizer will be queried about the recommended size. The sizer in
12227 turn will query its children, which can be normal windows or contorls,
12228 empty space or other sizers, so that a hierarchy of sizers can be
12229 constructed. Note that wxSizer does not derive from wxWindow and thus
12230 do not interfere with tab ordering and requires very little resources
12231 compared to a real window on screen.
12232
12233 What makes sizers so well fitted for use in wxWidgets is the fact that
12234 every control reports its own minimal size and the algorithm can
12235 handle differences in font sizes or different window (dialog item)
12236 sizes on different platforms without problems. If for example the
12237 standard font as well as the overall design of Mac widgets requires
12238 more space than on Windows, then the initial size of a dialog using a
12239 sizer will automatically be bigger on Mac than on Windows.
12240 """
1bd55598
RD
12241 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12242 def __init__(self): raise AttributeError, "No constructor defined"
12243 __repr__ = _swig_repr
12244 __swig_destroy__ = _core_.delete_Sizer
12245 __del__ = lambda self : None;
d55e5bfc
RD
12246 def _setOORInfo(*args, **kwargs):
12247 """_setOORInfo(self, PyObject _self)"""
5b5c9bc7 12248 return _core_.Sizer__setOORInfo(*args, **kwargs)
d55e5bfc
RD
12249
12250 def Add(*args, **kwargs):
12251 """
bfddbb17 12252 Add(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 12253 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
12254
12255 Appends a child item to the sizer.
d55e5bfc 12256 """
5b5c9bc7 12257 return _core_.Sizer_Add(*args, **kwargs)
d55e5bfc 12258
cbfc9df6
RD
12259 def AddF(*args, **kwargs):
12260 """
12261 AddF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12262
12263 Similar to `Add` but uses the `wx.SizerFlags` convenience class for
12264 setting the various flags, options and borders.
12265 """
12266 return _core_.Sizer_AddF(*args, **kwargs)
12267
d55e5bfc
RD
12268 def Insert(*args, **kwargs):
12269 """
bfddbb17 12270 Insert(self, int before, item, int proportion=0, int flag=0, int border=0,
070c48b4 12271 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
12272
12273 Inserts a new item into the list of items managed by this sizer before
12274 the item at index *before*. See `Add` for a description of the parameters.
d55e5bfc 12275 """
5b5c9bc7 12276 return _core_.Sizer_Insert(*args, **kwargs)
d55e5bfc 12277
cbfc9df6
RD
12278 def InsertF(*args, **kwargs):
12279 """
12280 InsertF(self, int before, item, wx.SizerFlags flags) -> wx.SizerItem
12281
12282 Similar to `Insert`, but uses the `wx.SizerFlags` convenience class
12283 for setting the various flags, options and borders.
12284 """
12285 return _core_.Sizer_InsertF(*args, **kwargs)
12286
d55e5bfc
RD
12287 def Prepend(*args, **kwargs):
12288 """
bfddbb17 12289 Prepend(self, item, int proportion=0, int flag=0, int border=0,
070c48b4 12290 PyObject userData=None) -> wx.SizerItem
bfddbb17
RD
12291
12292 Adds a new item to the begining of the list of sizer items managed by
12293 this sizer. See `Add` for a description of the parameters.
d55e5bfc 12294 """
5b5c9bc7 12295 return _core_.Sizer_Prepend(*args, **kwargs)
d55e5bfc 12296
cbfc9df6
RD
12297 def PrependF(*args, **kwargs):
12298 """
12299 PrependF(self, item, wx.SizerFlags flags) -> wx.SizerItem
12300
12301 Similar to `Prepend` but uses the `wx.SizerFlags` convenience class
12302 for setting the various flags, options and borders.
12303 """
12304 return _core_.Sizer_PrependF(*args, **kwargs)
12305
d55e5bfc 12306 def Remove(*args, **kwargs):
bfddbb17
RD
12307 """
12308 Remove(self, item) -> bool
12309
12310 Removes an item from the sizer and destroys it. This method does not
12311 cause any layout or resizing to take place, call `Layout` to update
12312 the layout on screen after removing a child from the sizer. The
12313 *item* parameter can be either a window, a sizer, or the zero-based
12314 index of an item to remove. Returns True if the child item was found
12315 and removed.
12316 """
5b5c9bc7 12317 return _core_.Sizer_Remove(*args, **kwargs)
d55e5bfc 12318
1a6bba1e 12319 def Detach(*args, **kwargs):
bfddbb17
RD
12320 """
12321 Detach(self, item) -> bool
12322
12323 Detaches an item from the sizer without destroying it. This method
12324 does not cause any layout or resizing to take place, call `Layout` to
12325 do so. The *item* parameter can be either a window, a sizer, or the
12326 zero-based index of the item to be detached. Returns True if the child item
12327 was found and detached.
12328 """
5b5c9bc7 12329 return _core_.Sizer_Detach(*args, **kwargs)
1a6bba1e 12330
070c48b4
RD
12331 def GetItem(*args, **kwargs):
12332 """
cbfc9df6 12333 GetItem(self, item, recursive=False) -> wx.SizerItem
070c48b4
RD
12334
12335 Returns the `wx.SizerItem` which holds the *item* given. The *item*
12336 parameter can be either a window, a sizer, or the zero-based index of
4d170c95 12337 the item to be found.
070c48b4 12338 """
5b5c9bc7 12339 return _core_.Sizer_GetItem(*args, **kwargs)
070c48b4 12340
d55e5bfc 12341 def _SetItemMinSize(*args, **kwargs):
5b5c9bc7
RD
12342 """_SetItemMinSize(self, PyObject item, Size size)"""
12343 return _core_.Sizer__SetItemMinSize(*args, **kwargs)
d55e5bfc 12344
ac5d357a
RD
12345 def _ReplaceWin(*args, **kwargs):
12346 """_ReplaceWin(self, Window oldwin, Window newwin, bool recursive=False) -> bool"""
12347 return _core_.Sizer__ReplaceWin(*args, **kwargs)
12348
12349 def _ReplaceSizer(*args, **kwargs):
12350 """_ReplaceSizer(self, Sizer oldsz, Sizer newsz, bool recursive=False) -> bool"""
12351 return _core_.Sizer__ReplaceSizer(*args, **kwargs)
12352
12353 def _ReplaceItem(*args, **kwargs):
12354 """_ReplaceItem(self, size_t index, SizerItem newitem) -> bool"""
12355 return _core_.Sizer__ReplaceItem(*args, **kwargs)
12356
12357 def Replace(self, olditem, item, recursive=False):
12358 """
12359 Detaches the given ``olditem`` from the sizer and replaces it with
12360 ``item`` which can be a window, sizer, or `wx.SizerItem`. The
12361 detached child is destroyed only if it is not a window, (because
12362 windows are owned by their parent, not the sizer.) The
12363 ``recursive`` parameter can be used to search for the given
12364 element recursivly in subsizers.
12365
12366 This method does not cause any layout or resizing to take place,
12367 call `Layout` to do so.
12368
12369 Returns ``True`` if the child item was found and removed.
12370 """
12371 if isinstance(olditem, wx.Window):
12372 return self._ReplaceWin(olditem, item, recursive)
cbfc9df6 12373 elif isinstance(olditem, wx.Sizer):
ac5d357a 12374 return self._ReplaceSizer(olditem, item, recursive)
cbfc9df6 12375 elif isinstance(olditem, int):
ac5d357a
RD
12376 return self._ReplaceItem(olditem, item)
12377 else:
12378 raise TypeError("Expected Window, Sizer, or integer for first parameter.")
12379
12380 def SetContainingWindow(*args, **kwargs):
12381 """
12382 SetContainingWindow(self, Window window)
12383
12384 Set (or unset) the window this sizer is used in.
12385 """
12386 return _core_.Sizer_SetContainingWindow(*args, **kwargs)
12387
12388 def GetContainingWindow(*args, **kwargs):
12389 """
12390 GetContainingWindow(self) -> Window
12391
12392 Get the window this sizer is used in.
12393 """
12394 return _core_.Sizer_GetContainingWindow(*args, **kwargs)
12395
bfddbb17
RD
12396 def SetItemMinSize(self, item, *args):
12397 """
12398 SetItemMinSize(self, item, Size size)
12399
12400 Sets the minimum size that will be allocated for an item in the sizer.
12401 The *item* parameter can be either a window, a sizer, or the
12402 zero-based index of the item. If a window or sizer is given then it
12403 will be searched for recursivly in subsizers if neccessary.
12404 """
12405 if len(args) == 2:
12406 # for backward compatibility accept separate width,height args too
12407 return self._SetItemMinSize(item, args)
12408 else:
12409 return self._SetItemMinSize(item, args[0])
12410
d55e5bfc 12411 def AddItem(*args, **kwargs):
bfddbb17
RD
12412 """
12413 AddItem(self, SizerItem item)
12414
12415 Adds a `wx.SizerItem` to the sizer.
12416 """
5b5c9bc7 12417 return _core_.Sizer_AddItem(*args, **kwargs)
d55e5bfc
RD
12418
12419 def InsertItem(*args, **kwargs):
bfddbb17
RD
12420 """
12421 InsertItem(self, int index, SizerItem item)
12422
12423 Inserts a `wx.SizerItem` to the sizer at the position given by *index*.
12424 """
5b5c9bc7 12425 return _core_.Sizer_InsertItem(*args, **kwargs)
d55e5bfc
RD
12426
12427 def PrependItem(*args, **kwargs):
bfddbb17
RD
12428 """
12429 PrependItem(self, SizerItem item)
12430
12431 Prepends a `wx.SizerItem` to the sizer.
12432 """
5b5c9bc7 12433 return _core_.Sizer_PrependItem(*args, **kwargs)
d55e5bfc 12434
bfddbb17 12435 def AddMany(self, items):
d6c14a4c
RD
12436 """
12437 AddMany is a convenience method for adding several items
12438 to a sizer at one time. Simply pass it a list of tuples,
12439 where each tuple consists of the parameters that you
12440 would normally pass to the `Add` method.
12441 """
bfddbb17
RD
12442 for item in items:
12443 if type(item) != type(()) or (len(item) == 2 and type(item[0]) == type(1)):
12444 item = (item, )
12445 self.Add(*item)
d55e5bfc 12446
0d2c9713
RD
12447 def AddSpacer(self, *args, **kw):
12448 """AddSpacer(int size) --> SizerItem
12449
12450 Add a spacer that is (size,size) pixels.
12451 """
12452 if args and type(args[0]) == int:
12453 return self.Add( (args[0],args[0] ), 0)
12454 else: # otherwise stay compatible with old AddSpacer
12455 return self.Add(*args, **kw)
12456 def PrependSpacer(self, *args, **kw):
12457 """PrependSpacer(int size) --> SizerItem
12458
12459 Prepend a spacer that is (size, size) pixels."""
12460 if args and type(args[0]) == int:
12461 return self.Prepend( (args[0],args[0] ), 0)
12462 else: # otherwise stay compatible with old PrependSpacer
12463 return self.Prepend(*args, **kw)
12464 def InsertSpacer(self, index, *args, **kw):
12465 """InsertSpacer(int index, int size) --> SizerItem
12466
12467 Insert a spacer at position index that is (size, size) pixels."""
12468 if args and type(args[0]) == int:
12469 return self.Insert( index, (args[0],args[0] ), 0)
12470 else: # otherwise stay compatible with old InsertSpacer
12471 return self.Insert(index, *args, **kw)
12472
12473
12474 def AddStretchSpacer(self, prop=1):
12475 """AddStretchSpacer(int prop=1) --> SizerItem
12476
12477 Add a stretchable spacer."""
12478 return self.Add((0,0), prop)
12479 def PrependStretchSpacer(self, prop=1):
12480 """PrependStretchSpacer(int prop=1) --> SizerItem
12481
12482 Prepend a stretchable spacer."""
12483 return self.Prepend((0,0), prop)
12484 def InsertStretchSpacer(self, index, prop=1):
12485 """InsertStretchSpacer(int index, int prop=1) --> SizerItem
12486
12487 Insert a stretchable spacer."""
12488 return self.Insert(index, (0,0), prop)
12489
12490
d55e5bfc 12491 # for backwards compatibility only, please do not use in new code
7fbf8399
RD
12492 def AddWindow(self, *args, **kw):
12493 """Compatibility alias for `Add`."""
12494 return self.Add(*args, **kw)
12495 def AddSizer(self, *args, **kw):
12496 """Compatibility alias for `Add`."""
12497 return self.Add(*args, **kw)
7fbf8399
RD
12498
12499 def PrependWindow(self, *args, **kw):
12500 """Compatibility alias for `Prepend`."""
12501 return self.Prepend(*args, **kw)
12502 def PrependSizer(self, *args, **kw):
12503 """Compatibility alias for `Prepend`."""
12504 return self.Prepend(*args, **kw)
7fbf8399
RD
12505
12506 def InsertWindow(self, *args, **kw):
12507 """Compatibility alias for `Insert`."""
12508 return self.Insert(*args, **kw)
12509 def InsertSizer(self, *args, **kw):
12510 """Compatibility alias for `Insert`."""
7fbf8399
RD
12511 return self.Insert(*args, **kw)
12512
12513 def RemoveWindow(self, *args, **kw):
12514 """Compatibility alias for `Remove`."""
12515 return self.Remove(*args, **kw)
12516 def RemoveSizer(self, *args, **kw):
12517 """Compatibility alias for `Remove`."""
12518 return self.Remove(*args, **kw)
12519 def RemovePos(self, *args, **kw):
12520 """Compatibility alias for `Remove`."""
12521 return self.Remove(*args, **kw)
d55e5bfc
RD
12522
12523
d55e5bfc 12524 def SetDimension(*args, **kwargs):
bfddbb17
RD
12525 """
12526 SetDimension(self, int x, int y, int width, int height)
12527
12528 Call this to force the sizer to take the given dimension and thus
12529 force the items owned by the sizer to resize themselves according to
12530 the rules defined by the parameter in the `Add`, `Insert` or `Prepend`
12531 methods.
12532 """
5b5c9bc7 12533 return _core_.Sizer_SetDimension(*args, **kwargs)
d55e5bfc
RD
12534
12535 def SetMinSize(*args, **kwargs):
bfddbb17 12536 """
5b5c9bc7 12537 SetMinSize(self, Size size)
bfddbb17
RD
12538
12539 Call this to give the sizer a minimal size. Normally, the sizer will
12540 calculate its minimal size based purely on how much space its children
12541 need. After calling this method `GetMinSize` will return either the
12542 minimal size as requested by its children or the minimal size set
12543 here, depending on which is bigger.
12544 """
5b5c9bc7 12545 return _core_.Sizer_SetMinSize(*args, **kwargs)
d55e5bfc
RD
12546
12547 def GetSize(*args, **kwargs):
bfddbb17 12548 """
5b5c9bc7 12549 GetSize(self) -> Size
bfddbb17
RD
12550
12551 Returns the current size of the space managed by the sizer.
12552 """
5b5c9bc7 12553 return _core_.Sizer_GetSize(*args, **kwargs)
d55e5bfc
RD
12554
12555 def GetPosition(*args, **kwargs):
bfddbb17 12556 """
5b5c9bc7 12557 GetPosition(self) -> Point
bfddbb17
RD
12558
12559 Returns the current position of the sizer's managed space.
12560 """
5b5c9bc7 12561 return _core_.Sizer_GetPosition(*args, **kwargs)
d55e5bfc
RD
12562
12563 def GetMinSize(*args, **kwargs):
bfddbb17 12564 """
5b5c9bc7 12565 GetMinSize(self) -> Size
bfddbb17
RD
12566
12567 Returns the minimal size of the sizer. This is either the combined
12568 minimal size of all the children and their borders or the minimal size
12569 set by SetMinSize, depending on which is bigger.
12570 """
5b5c9bc7 12571 return _core_.Sizer_GetMinSize(*args, **kwargs)
d55e5bfc
RD
12572
12573 def GetSizeTuple(self):
1a6bba1e 12574 return self.GetSize().Get()
d55e5bfc 12575 def GetPositionTuple(self):
1a6bba1e 12576 return self.GetPosition().Get()
d55e5bfc 12577 def GetMinSizeTuple(self):
1a6bba1e 12578 return self.GetMinSize().Get()
d55e5bfc
RD
12579
12580 def RecalcSizes(*args, **kwargs):
bfddbb17
RD
12581 """
12582 RecalcSizes(self)
12583
12584 Using the sizes calculated by `CalcMin` reposition and resize all the
12585 items managed by this sizer. You should not need to call this directly as
12586 it is called by `Layout`.
12587 """
5b5c9bc7 12588 return _core_.Sizer_RecalcSizes(*args, **kwargs)
d55e5bfc
RD
12589
12590 def CalcMin(*args, **kwargs):
bfddbb17 12591 """
5b5c9bc7 12592 CalcMin(self) -> Size
bfddbb17
RD
12593
12594 This method is where the sizer will do the actual calculation of its
12595 children's minimal sizes. You should not need to call this directly as
12596 it is called by `Layout`.
12597 """
5b5c9bc7 12598 return _core_.Sizer_CalcMin(*args, **kwargs)
d55e5bfc
RD
12599
12600 def Layout(*args, **kwargs):
bfddbb17
RD
12601 """
12602 Layout(self)
12603
12604 This method will force the recalculation and layout of the items
12605 controlled by the sizer using the current space allocated to the
12606 sizer. Normally this is called automatically from the owning window's
12607 EVT_SIZE handler, but it is also useful to call it from user code when
12608 one of the items in a sizer change size, or items are added or
12609 removed.
12610 """
5b5c9bc7 12611 return _core_.Sizer_Layout(*args, **kwargs)
d55e5bfc
RD
12612
12613 def Fit(*args, **kwargs):
bfddbb17 12614 """
5b5c9bc7 12615 Fit(self, Window window) -> Size
bfddbb17
RD
12616
12617 Tell the sizer to resize the *window* to match the sizer's minimal
12618 size. This is commonly done in the constructor of the window itself in
12619 order to set its initial size to match the needs of the children as
12620 determined by the sizer. Returns the new size.
12621
12622 For a top level window this is the total window size, not the client size.
12623 """
5b5c9bc7 12624 return _core_.Sizer_Fit(*args, **kwargs)
d55e5bfc
RD
12625
12626 def FitInside(*args, **kwargs):
bfddbb17 12627 """
5b5c9bc7 12628 FitInside(self, Window window)
bfddbb17
RD
12629
12630 Tell the sizer to resize the *virtual size* of the *window* to match the
12631 sizer's minimal size. This will not alter the on screen size of the
12632 window, but may cause the addition/removal/alteration of scrollbars
12633 required to view the virtual area in windows which manage it.
12634
12635 :see: `wx.ScrolledWindow.SetScrollbars`, `SetVirtualSizeHints`
12636
12637 """
5b5c9bc7 12638 return _core_.Sizer_FitInside(*args, **kwargs)
d55e5bfc
RD
12639
12640 def SetSizeHints(*args, **kwargs):
bfddbb17 12641 """
5b5c9bc7 12642 SetSizeHints(self, Window window)
bfddbb17
RD
12643
12644 Tell the sizer to set (and `Fit`) the minimal size of the *window* to
12645 match the sizer's minimal size. This is commonly done in the
12646 constructor of the window itself if the window is resizable (as are
12647 many dialogs under Unix and frames on probably all platforms) in order
12648 to prevent the window from being sized smaller than the minimal size
12649 required by the sizer.
12650 """
5b5c9bc7 12651 return _core_.Sizer_SetSizeHints(*args, **kwargs)
d55e5bfc
RD
12652
12653 def SetVirtualSizeHints(*args, **kwargs):
bfddbb17 12654 """
5b5c9bc7 12655 SetVirtualSizeHints(self, Window window)
bfddbb17
RD
12656
12657 Tell the sizer to set the minimal size of the window virtual area to
12658 match the sizer's minimal size. For windows with managed scrollbars
12659 this will set them appropriately.
12660
12661 :see: `wx.ScrolledWindow.SetScrollbars`
12662
12663 """
5b5c9bc7 12664 return _core_.Sizer_SetVirtualSizeHints(*args, **kwargs)
d55e5bfc
RD
12665
12666 def Clear(*args, **kwargs):
bfddbb17
RD
12667 """
12668 Clear(self, bool deleteWindows=False)
12669
12670 Clear all items from the sizer, optionally destroying the window items
12671 as well.
12672 """
5b5c9bc7 12673 return _core_.Sizer_Clear(*args, **kwargs)
d55e5bfc
RD
12674
12675 def DeleteWindows(*args, **kwargs):
bfddbb17
RD
12676 """
12677 DeleteWindows(self)
12678
12679 Destroy all windows managed by the sizer.
12680 """
5b5c9bc7 12681 return _core_.Sizer_DeleteWindows(*args, **kwargs)
d55e5bfc
RD
12682
12683 def GetChildren(*args, **kwargs):
bfddbb17 12684 """
51b83b37 12685 GetChildren(self) -> list
bfddbb17
RD
12686
12687 Returns a list of all the `wx.SizerItem` objects managed by the sizer.
12688 """
5b5c9bc7 12689 return _core_.Sizer_GetChildren(*args, **kwargs)
d55e5bfc
RD
12690
12691 def Show(*args, **kwargs):
bfddbb17 12692 """
b411df4a 12693 Show(self, item, bool show=True, bool recursive=false) -> bool
d55e5bfc 12694
bfddbb17
RD
12695 Shows or hides an item managed by the sizer. To make a sizer item
12696 disappear or reappear, use Show followed by `Layout`. The *item*
12697 parameter can be either a window, a sizer, or the zero-based index of
629e65c2
RD
12698 the item. Use the recursive parameter to show or hide an item in a
12699 subsizer. Returns True if the item was found.
bfddbb17 12700 """
5b5c9bc7 12701 return _core_.Sizer_Show(*args, **kwargs)
d55e5bfc
RD
12702
12703 def IsShown(*args, **kwargs):
bfddbb17
RD
12704 """
12705 IsShown(self, item)
12706
b1fcee84 12707 Determines if the item is currently shown. To make a sizer
bfddbb17
RD
12708 item disappear or reappear, use Show followed by `Layout`. The *item*
12709 parameter can be either a window, a sizer, or the zero-based index of
12710 the item.
12711 """
5b5c9bc7 12712 return _core_.Sizer_IsShown(*args, **kwargs)
d55e5bfc 12713
629e65c2 12714 def Hide(self, item, recursive=False):
bfddbb17 12715 """
27fb7603 12716 A convenience method for `Show` (item, False, recursive).
bfddbb17 12717 """
06759a38 12718 return self.Show(item, False, recursive)
bfddbb17 12719
d55e5bfc 12720 def ShowItems(*args, **kwargs):
bfddbb17
RD
12721 """
12722 ShowItems(self, bool show)
12723
84f85550 12724 Recursively call `wx.SizerItem.Show` on all sizer items.
bfddbb17 12725 """
5b5c9bc7 12726 return _core_.Sizer_ShowItems(*args, **kwargs)
d55e5bfc 12727
33d6fd3b
RD
12728 Children = property(GetChildren,doc="See `GetChildren`")
12729 ContainingWindow = property(GetContainingWindow,SetContainingWindow,doc="See `GetContainingWindow` and `SetContainingWindow`")
12730 MinSize = property(GetMinSize,SetMinSize,doc="See `GetMinSize` and `SetMinSize`")
12731 Position = property(GetPosition,doc="See `GetPosition`")
12732 Size = property(GetSize,doc="See `GetSize`")
2131d850 12733_core_.Sizer_swigregister(Sizer)
d55e5bfc 12734
5b5c9bc7 12735class PySizer(Sizer):
bfddbb17
RD
12736 """
12737 wx.PySizer is a special version of `wx.Sizer` that has been
12738 instrumented to allow the C++ virtual methods to be overloaded in
12739 Python derived classes. You would derive from this class if you are
12740 wanting to implement a custom sizer in Python code. Simply implement
12741 `CalcMin` and `RecalcSizes` in the derived class and you're all set.
12742 For example::
12743
12744 class MySizer(wx.PySizer):
12745 def __init__(self):
12746 wx.PySizer.__init__(self)
12747
12748 def CalcMin(self):
12749 for item in self.GetChildren():
12750 # calculate the total minimum width and height needed
12751 # by all items in the sizer according to this sizer's
12752 # layout algorithm.
12753 ...
12754 return wx.Size(width, height)
12755
12756 def RecalcSizes(self):
12757 # find the space allotted to this sizer
12758 pos = self.GetPosition()
12759 size = self.GetSize()
12760 for item in self.GetChildren():
12761 # Recalculate (if necessary) the position and size of
12762 # each item and then call item.SetDimension to do the
12763 # actual positioning and sizing of the items within the
12764 # space alloted to this sizer.
12765 ...
12766 item.SetDimension(itemPos, itemSize)
12767
12768
12769 When `Layout` is called it first calls `CalcMin` followed by
12770 `RecalcSizes` so you can optimize a bit by saving the results of
62d32a5f 12771 `CalcMin` and reusing them in `RecalcSizes`.
bfddbb17
RD
12772
12773 :see: `wx.SizerItem`, `wx.Sizer.GetChildren`
12774
12775
12776 """
1bd55598
RD
12777 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12778 __repr__ = _swig_repr
12779 def __init__(self, *args, **kwargs):
bfddbb17 12780 """
5b5c9bc7 12781 __init__(self) -> PySizer
bfddbb17
RD
12782
12783 Creates a wx.PySizer. Must be called from the __init__ in the derived
12784 class.
12785 """
1bd55598 12786 _core_.PySizer_swiginit(self,_core_.new_PySizer(*args, **kwargs))
c25f90f6 12787 self._setOORInfo(self);PySizer._setCallbackInfo(self, self, PySizer)
d55e5bfc
RD
12788
12789 def _setCallbackInfo(*args, **kwargs):
12790 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
5b5c9bc7 12791 return _core_.PySizer__setCallbackInfo(*args, **kwargs)
d55e5bfc 12792
2131d850 12793_core_.PySizer_swigregister(PySizer)
d55e5bfc
RD
12794
12795#---------------------------------------------------------------------------
12796
5b5c9bc7 12797class BoxSizer(Sizer):
bfddbb17
RD
12798 """
12799 The basic idea behind a box sizer is that windows will most often be
12800 laid out in rather simple basic geometry, typically in a row or a
12801 column or nested hierarchies of either. A wx.BoxSizer will lay out
12802 its items in a simple row or column, depending on the orientation
12803 parameter passed to the constructor.
12804 """
1bd55598
RD
12805 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12806 __repr__ = _swig_repr
12807 def __init__(self, *args, **kwargs):
bfddbb17 12808 """
5b5c9bc7 12809 __init__(self, int orient=HORIZONTAL) -> BoxSizer
bfddbb17
RD
12810
12811 Constructor for a wx.BoxSizer. *orient* may be one of ``wx.VERTICAL``
12812 or ``wx.HORIZONTAL`` for creating either a column sizer or a row
12813 sizer.
12814 """
1bd55598 12815 _core_.BoxSizer_swiginit(self,_core_.new_BoxSizer(*args, **kwargs))
d55e5bfc
RD
12816 self._setOORInfo(self)
12817
12818 def GetOrientation(*args, **kwargs):
bfddbb17
RD
12819 """
12820 GetOrientation(self) -> int
12821
12822 Returns the current orientation of the sizer.
12823 """
5b5c9bc7 12824 return _core_.BoxSizer_GetOrientation(*args, **kwargs)
d55e5bfc
RD
12825
12826 def SetOrientation(*args, **kwargs):
bfddbb17
RD
12827 """
12828 SetOrientation(self, int orient)
d55e5bfc 12829
bfddbb17
RD
12830 Resets the orientation of the sizer.
12831 """
5b5c9bc7 12832 return _core_.BoxSizer_SetOrientation(*args, **kwargs)
d55e5bfc 12833
2bf58437 12834 Orientation = property(GetOrientation,SetOrientation,doc="See `GetOrientation` and `SetOrientation`")
2131d850 12835_core_.BoxSizer_swigregister(BoxSizer)
d55e5bfc
RD
12836
12837#---------------------------------------------------------------------------
12838
5b5c9bc7 12839class StaticBoxSizer(BoxSizer):
bfddbb17
RD
12840 """
12841 wx.StaticBoxSizer derives from and functions identically to the
12842 `wx.BoxSizer` and adds a `wx.StaticBox` around the items that the sizer
12843 manages. Note that this static box must be created separately and
12844 passed to the sizer constructor.
12845 """
1bd55598
RD
12846 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12847 __repr__ = _swig_repr
12848 def __init__(self, *args, **kwargs):
bfddbb17 12849 """
5b5c9bc7 12850 __init__(self, StaticBox box, int orient=HORIZONTAL) -> StaticBoxSizer
bfddbb17
RD
12851
12852 Constructor. It takes an associated static box and the orientation
12853 *orient* as parameters - orient can be either of ``wx.VERTICAL`` or
12854 ``wx.HORIZONTAL``.
12855 """
1bd55598 12856 _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs))
d55e5bfc
RD
12857 self._setOORInfo(self)
12858
12859 def GetStaticBox(*args, **kwargs):
bfddbb17 12860 """
5b5c9bc7 12861 GetStaticBox(self) -> StaticBox
d55e5bfc 12862
bfddbb17
RD
12863 Returns the static box associated with this sizer.
12864 """
5b5c9bc7 12865 return _core_.StaticBoxSizer_GetStaticBox(*args, **kwargs)
d55e5bfc 12866
33d6fd3b 12867 StaticBox = property(GetStaticBox,doc="See `GetStaticBox`")
2131d850 12868_core_.StaticBoxSizer_swigregister(StaticBoxSizer)
d55e5bfc
RD
12869
12870#---------------------------------------------------------------------------
12871
5b5c9bc7 12872class GridSizer(Sizer):
bfddbb17
RD
12873 """
12874 A grid sizer is a sizer which lays out its children in a
12875 two-dimensional table with all cells having the same size. In other
12876 words, the width of each cell within the grid is the width of the
12877 widest item added to the sizer and the height of each grid cell is the
12878 height of the tallest item. An optional vertical and/or horizontal
12879 gap between items can also be specified (in pixels.)
12880
12881 Items are placed in the cells of the grid in the order they are added,
12882 in row-major order. In other words, the first row is filled first,
12883 then the second, and so on until all items have been added. (If
12884 neccessary, additional rows will be added as items are added.) If you
12885 need to have greater control over the cells that items are placed in
12886 then use the `wx.GridBagSizer`.
12887
12888 """
1bd55598
RD
12889 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
12890 __repr__ = _swig_repr
12891 def __init__(self, *args, **kwargs):
bfddbb17 12892 """
5b5c9bc7 12893 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> GridSizer
bfddbb17
RD
12894
12895 Constructor for a wx.GridSizer. *rows* and *cols* determine the number
12896 of columns and rows in the sizer - if either of the parameters is
12897 zero, it will be calculated to from the total number of children in
12898 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
12899 define extra space between all children.
12900 """
1bd55598 12901 _core_.GridSizer_swiginit(self,_core_.new_GridSizer(*args, **kwargs))
d55e5bfc
RD
12902 self._setOORInfo(self)
12903
d55e5bfc 12904 def SetCols(*args, **kwargs):
bfddbb17
RD
12905 """
12906 SetCols(self, int cols)
12907
12908 Sets the number of columns in the sizer.
12909 """
5b5c9bc7 12910 return _core_.GridSizer_SetCols(*args, **kwargs)
d55e5bfc
RD
12911
12912 def SetRows(*args, **kwargs):
bfddbb17
RD
12913 """
12914 SetRows(self, int rows)
12915
12916 Sets the number of rows in the sizer.
12917 """
5b5c9bc7 12918 return _core_.GridSizer_SetRows(*args, **kwargs)
d55e5bfc
RD
12919
12920 def SetVGap(*args, **kwargs):
bfddbb17
RD
12921 """
12922 SetVGap(self, int gap)
12923
12924 Sets the vertical gap (in pixels) between the cells in the sizer.
12925 """
5b5c9bc7 12926 return _core_.GridSizer_SetVGap(*args, **kwargs)
d55e5bfc
RD
12927
12928 def SetHGap(*args, **kwargs):
bfddbb17
RD
12929 """
12930 SetHGap(self, int gap)
12931
12932 Sets the horizontal gap (in pixels) between cells in the sizer
12933 """
5b5c9bc7 12934 return _core_.GridSizer_SetHGap(*args, **kwargs)
d55e5bfc
RD
12935
12936 def GetCols(*args, **kwargs):
bfddbb17
RD
12937 """
12938 GetCols(self) -> int
12939
12940 Returns the number of columns in the sizer.
12941 """
5b5c9bc7 12942 return _core_.GridSizer_GetCols(*args, **kwargs)
d55e5bfc
RD
12943
12944 def GetRows(*args, **kwargs):
bfddbb17
RD
12945 """
12946 GetRows(self) -> int
12947
12948 Returns the number of rows in the sizer.
12949 """
5b5c9bc7 12950 return _core_.GridSizer_GetRows(*args, **kwargs)
d55e5bfc
RD
12951
12952 def GetVGap(*args, **kwargs):
bfddbb17
RD
12953 """
12954 GetVGap(self) -> int
12955
12956 Returns the vertical gap (in pixels) between the cells in the sizer.
12957 """
5b5c9bc7 12958 return _core_.GridSizer_GetVGap(*args, **kwargs)
d55e5bfc
RD
12959
12960 def GetHGap(*args, **kwargs):
bfddbb17
RD
12961 """
12962 GetHGap(self) -> int
12963
12964 Returns the horizontal gap (in pixels) between cells in the sizer.
12965 """
5b5c9bc7 12966 return _core_.GridSizer_GetHGap(*args, **kwargs)
d55e5bfc 12967
1bd55598
RD
12968 def CalcRowsCols(self):
12969 """
12970 CalcRowsCols() -> (rows, cols)
12971
12972 Calculates how many rows and columns will be in the sizer based
12973 on the current number of items and also the rows, cols specified
12974 in the constructor.
12975 """
12976 nitems = len(self.GetChildren())
12977 rows = self.GetRows()
12978 cols = self.GetCols()
12979 assert rows != 0 or cols != 0, "Grid sizer must have either rows or columns fixed"
12980 if cols != 0:
12981 rows = (nitems + cols - 1) / cols
12982 elif rows != 0:
12983 cols = (nitems + rows - 1) / rows
12984 return (rows, cols)
d55e5bfc 12985
ac5d357a
RD
12986 Cols = property(GetCols,SetCols,doc="See `GetCols` and `SetCols`")
12987 HGap = property(GetHGap,SetHGap,doc="See `GetHGap` and `SetHGap`")
12988 Rows = property(GetRows,SetRows,doc="See `GetRows` and `SetRows`")
12989 VGap = property(GetVGap,SetVGap,doc="See `GetVGap` and `SetVGap`")
2131d850 12990_core_.GridSizer_swigregister(GridSizer)
d55e5bfc
RD
12991
12992#---------------------------------------------------------------------------
12993
5b5c9bc7
RD
12994FLEX_GROWMODE_NONE = _core_.FLEX_GROWMODE_NONE
12995FLEX_GROWMODE_SPECIFIED = _core_.FLEX_GROWMODE_SPECIFIED
12996FLEX_GROWMODE_ALL = _core_.FLEX_GROWMODE_ALL
12997class FlexGridSizer(GridSizer):
bfddbb17
RD
12998 """
12999 A flex grid sizer is a sizer which lays out its children in a
13000 two-dimensional table with all table cells in one row having the same
13001 height and all cells in one column having the same width, but all
13002 rows or all columns are not necessarily the same height or width as in
13003 the `wx.GridSizer`.
13004
13005 wx.FlexGridSizer can also size items equally in one direction but
13006 unequally ("flexibly") in the other. If the sizer is only flexible
13007 in one direction (this can be changed using `SetFlexibleDirection`), it
13008 needs to be decided how the sizer should grow in the other ("non
13009 flexible") direction in order to fill the available space. The
13010 `SetNonFlexibleGrowMode` method serves this purpose.
13011
13012
13013 """
1bd55598
RD
13014 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13015 __repr__ = _swig_repr
13016 def __init__(self, *args, **kwargs):
bfddbb17 13017 """
5b5c9bc7 13018 __init__(self, int rows=1, int cols=0, int vgap=0, int hgap=0) -> FlexGridSizer
bfddbb17
RD
13019
13020 Constructor for a wx.FlexGridSizer. *rows* and *cols* determine the
13021 number of columns and rows in the sizer - if either of the parameters
13022 is zero, it will be calculated to from the total number of children in
13023 the sizer, thus making the sizer grow dynamically. *vgap* and *hgap*
13024 define extra space between all children.
13025 """
1bd55598 13026 _core_.FlexGridSizer_swiginit(self,_core_.new_FlexGridSizer(*args, **kwargs))
d55e5bfc
RD
13027 self._setOORInfo(self)
13028
bfddbb17
RD
13029 def AddGrowableRow(*args, **kwargs):
13030 """
13031 AddGrowableRow(self, size_t idx, int proportion=0)
d55e5bfc 13032
bfddbb17
RD
13033 Specifies that row *idx* (starting from zero) should be grown if there
13034 is extra space available to the sizer.
d55e5bfc 13035
bfddbb17
RD
13036 The *proportion* parameter has the same meaning as the stretch factor
13037 for the box sizers except that if all proportions are 0, then all
13038 columns are resized equally (instead of not being resized at all).
13039 """
5b5c9bc7 13040 return _core_.FlexGridSizer_AddGrowableRow(*args, **kwargs)
d55e5bfc
RD
13041
13042 def RemoveGrowableRow(*args, **kwargs):
bfddbb17
RD
13043 """
13044 RemoveGrowableRow(self, size_t idx)
13045
13046 Specifies that row *idx* is no longer growable.
13047 """
5b5c9bc7 13048 return _core_.FlexGridSizer_RemoveGrowableRow(*args, **kwargs)
d55e5bfc
RD
13049
13050 def AddGrowableCol(*args, **kwargs):
bfddbb17
RD
13051 """
13052 AddGrowableCol(self, size_t idx, int proportion=0)
13053
13054 Specifies that column *idx* (starting from zero) should be grown if
13055 there is extra space available to the sizer.
13056
13057 The *proportion* parameter has the same meaning as the stretch factor
13058 for the box sizers except that if all proportions are 0, then all
13059 columns are resized equally (instead of not being resized at all).
13060 """
5b5c9bc7 13061 return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
d55e5bfc
RD
13062
13063 def RemoveGrowableCol(*args, **kwargs):
bfddbb17
RD
13064 """
13065 RemoveGrowableCol(self, size_t idx)
13066
13067 Specifies that column *idx* is no longer growable.
13068 """
5b5c9bc7 13069 return _core_.FlexGridSizer_RemoveGrowableCol(*args, **kwargs)
d55e5bfc
RD
13070
13071 def SetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
13072 """
13073 SetFlexibleDirection(self, int direction)
13074
13075 Specifies whether the sizer should flexibly resize its columns, rows,
13076 or both. Argument *direction* can be one of the following values. Any
13077 other value is ignored.
13078
13079 ============== =======================================
13080 wx.VERTICAL Rows are flexibly sized.
13081 wx.HORIZONTAL Columns are flexibly sized.
13082 wx.BOTH Both rows and columns are flexibly sized
13083 (this is the default value).
13084 ============== =======================================
13085
13086 Note that this method does not trigger relayout.
13087
13088 """
5b5c9bc7 13089 return _core_.FlexGridSizer_SetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
13090
13091 def GetFlexibleDirection(*args, **kwargs):
bfddbb17
RD
13092 """
13093 GetFlexibleDirection(self) -> int
13094
13095 Returns a value that specifies whether the sizer
13096 flexibly resizes its columns, rows, or both (default).
13097
13098 :see: `SetFlexibleDirection`
13099 """
5b5c9bc7 13100 return _core_.FlexGridSizer_GetFlexibleDirection(*args, **kwargs)
d55e5bfc
RD
13101
13102 def SetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
13103 """
13104 SetNonFlexibleGrowMode(self, int mode)
13105
13106 Specifies how the sizer should grow in the non-flexible direction if
13107 there is one (so `SetFlexibleDirection` must have been called
13108 previously). Argument *mode* can be one of the following values:
13109
13110 ========================== =================================================
13111 wx.FLEX_GROWMODE_NONE Sizer doesn't grow in the non flexible direction.
13112 wx.FLEX_GROWMODE_SPECIFIED Sizer honors growable columns/rows set with
13113 `AddGrowableCol` and `AddGrowableRow`. In this
13114 case equal sizing applies to minimum sizes of
13115 columns or rows (this is the default value).
13116 wx.FLEX_GROWMODE_ALL Sizer equally stretches all columns or rows in
13117 the non flexible direction, whether they are
13118 growable or not in the flexbile direction.
13119 ========================== =================================================
13120
13121 Note that this method does not trigger relayout.
bfddbb17 13122 """
5b5c9bc7 13123 return _core_.FlexGridSizer_SetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
13124
13125 def GetNonFlexibleGrowMode(*args, **kwargs):
bfddbb17
RD
13126 """
13127 GetNonFlexibleGrowMode(self) -> int
13128
13129 Returns the value that specifies how the sizer grows in the
13130 non-flexible direction if there is one.
13131
13132 :see: `SetNonFlexibleGrowMode`
13133 """
5b5c9bc7 13134 return _core_.FlexGridSizer_GetNonFlexibleGrowMode(*args, **kwargs)
d55e5bfc
RD
13135
13136 def GetRowHeights(*args, **kwargs):
fd2dc343
RD
13137 """
13138 GetRowHeights(self) -> list
13139
13140 Returns a list of integers representing the heights of each of the
13141 rows in the sizer.
13142 """
5b5c9bc7 13143 return _core_.FlexGridSizer_GetRowHeights(*args, **kwargs)
d55e5bfc
RD
13144
13145 def GetColWidths(*args, **kwargs):
fd2dc343
RD
13146 """
13147 GetColWidths(self) -> list
13148
13149 Returns a list of integers representing the widths of each of the
13150 columns in the sizer.
13151 """
5b5c9bc7 13152 return _core_.FlexGridSizer_GetColWidths(*args, **kwargs)
d55e5bfc 13153
ac5d357a
RD
13154 ColWidths = property(GetColWidths,doc="See `GetColWidths`")
13155 FlexibleDirection = property(GetFlexibleDirection,SetFlexibleDirection,doc="See `GetFlexibleDirection` and `SetFlexibleDirection`")
13156 NonFlexibleGrowMode = property(GetNonFlexibleGrowMode,SetNonFlexibleGrowMode,doc="See `GetNonFlexibleGrowMode` and `SetNonFlexibleGrowMode`")
13157 RowHeights = property(GetRowHeights,doc="See `GetRowHeights`")
2131d850 13158_core_.FlexGridSizer_swigregister(FlexGridSizer)
d55e5bfc 13159
5b5c9bc7 13160class StdDialogButtonSizer(BoxSizer):
62d32a5f
RD
13161 """
13162 A special sizer that knows how to order and position standard buttons
13163 in order to conform to the current platform's standards. You simply
13164 need to add each `wx.Button` to the sizer, and be sure to create the
53aa7709 13165 buttons using the standard ID's. Then call `Realize` and the sizer
62d32a5f
RD
13166 will take care of the rest.
13167
13168 """
1bd55598
RD
13169 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13170 __repr__ = _swig_repr
13171 def __init__(self, *args, **kwargs):
5b5c9bc7 13172 """__init__(self) -> StdDialogButtonSizer"""
1bd55598 13173 _core_.StdDialogButtonSizer_swiginit(self,_core_.new_StdDialogButtonSizer(*args, **kwargs))
62d32a5f
RD
13174 def AddButton(*args, **kwargs):
13175 """
13176 AddButton(self, wxButton button)
13177
13178 Use this to add the buttons to this sizer. Do not use the `Add`
13179 method in the base class.
13180 """
5b5c9bc7 13181 return _core_.StdDialogButtonSizer_AddButton(*args, **kwargs)
62d32a5f 13182
53aa7709 13183 def Realize(*args, **kwargs):
62d32a5f 13184 """
53aa7709 13185 Realize(self)
62d32a5f
RD
13186
13187 This funciton needs to be called after all the buttons have been added
13188 to the sizer. It will reorder them and position them in a platform
13189 specifc manner.
13190 """
5b5c9bc7 13191 return _core_.StdDialogButtonSizer_Realize(*args, **kwargs)
51b83b37
RD
13192
13193 def SetAffirmativeButton(*args, **kwargs):
13194 """SetAffirmativeButton(self, wxButton button)"""
5b5c9bc7 13195 return _core_.StdDialogButtonSizer_SetAffirmativeButton(*args, **kwargs)
51b83b37
RD
13196
13197 def SetNegativeButton(*args, **kwargs):
13198 """SetNegativeButton(self, wxButton button)"""
5b5c9bc7 13199 return _core_.StdDialogButtonSizer_SetNegativeButton(*args, **kwargs)
51b83b37
RD
13200
13201 def SetCancelButton(*args, **kwargs):
13202 """SetCancelButton(self, wxButton button)"""
5b5c9bc7 13203 return _core_.StdDialogButtonSizer_SetCancelButton(*args, **kwargs)
62d32a5f
RD
13204
13205 def GetAffirmativeButton(*args, **kwargs):
13206 """GetAffirmativeButton(self) -> wxButton"""
5b5c9bc7 13207 return _core_.StdDialogButtonSizer_GetAffirmativeButton(*args, **kwargs)
62d32a5f
RD
13208
13209 def GetApplyButton(*args, **kwargs):
13210 """GetApplyButton(self) -> wxButton"""
5b5c9bc7 13211 return _core_.StdDialogButtonSizer_GetApplyButton(*args, **kwargs)
62d32a5f
RD
13212
13213 def GetNegativeButton(*args, **kwargs):
13214 """GetNegativeButton(self) -> wxButton"""
5b5c9bc7 13215 return _core_.StdDialogButtonSizer_GetNegativeButton(*args, **kwargs)
62d32a5f
RD
13216
13217 def GetCancelButton(*args, **kwargs):
13218 """GetCancelButton(self) -> wxButton"""
5b5c9bc7 13219 return _core_.StdDialogButtonSizer_GetCancelButton(*args, **kwargs)
62d32a5f
RD
13220
13221 def GetHelpButton(*args, **kwargs):
13222 """GetHelpButton(self) -> wxButton"""
5b5c9bc7 13223 return _core_.StdDialogButtonSizer_GetHelpButton(*args, **kwargs)
62d32a5f 13224
33d6fd3b
RD
13225 AffirmativeButton = property(GetAffirmativeButton,SetAffirmativeButton,doc="See `GetAffirmativeButton` and `SetAffirmativeButton`")
13226 ApplyButton = property(GetApplyButton,doc="See `GetApplyButton`")
13227 CancelButton = property(GetCancelButton,SetCancelButton,doc="See `GetCancelButton` and `SetCancelButton`")
13228 HelpButton = property(GetHelpButton,doc="See `GetHelpButton`")
13229 NegativeButton = property(GetNegativeButton,SetNegativeButton,doc="See `GetNegativeButton` and `SetNegativeButton`")
2131d850 13230_core_.StdDialogButtonSizer_swigregister(StdDialogButtonSizer)
62d32a5f 13231
d55e5bfc
RD
13232#---------------------------------------------------------------------------
13233
5b5c9bc7 13234class GBPosition(object):
bfddbb17
RD
13235 """
13236 This class represents the position of an item in a virtual grid of
13237 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13238 typemaps that will automatically convert from a 2-element sequence of
13239 integers to a wx.GBPosition, so you can use the more pythonic
13240 representation of the position nearly transparently in Python code.
13241 """
1bd55598
RD
13242 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13243 __repr__ = _swig_repr
13244 def __init__(self, *args, **kwargs):
bfddbb17 13245 """
5b5c9bc7 13246 __init__(self, int row=0, int col=0) -> GBPosition
bfddbb17
RD
13247
13248 This class represents the position of an item in a virtual grid of
13249 rows and columns managed by a `wx.GridBagSizer`. wxPython has
13250 typemaps that will automatically convert from a 2-element sequence of
13251 integers to a wx.GBPosition, so you can use the more pythonic
13252 representation of the position nearly transparently in Python code.
13253 """
1bd55598
RD
13254 _core_.GBPosition_swiginit(self,_core_.new_GBPosition(*args, **kwargs))
13255 __swig_destroy__ = _core_.delete_GBPosition
13256 __del__ = lambda self : None;
d55e5bfc
RD
13257 def GetRow(*args, **kwargs):
13258 """GetRow(self) -> int"""
5b5c9bc7 13259 return _core_.GBPosition_GetRow(*args, **kwargs)
d55e5bfc
RD
13260
13261 def GetCol(*args, **kwargs):
13262 """GetCol(self) -> int"""
5b5c9bc7 13263 return _core_.GBPosition_GetCol(*args, **kwargs)
d55e5bfc
RD
13264
13265 def SetRow(*args, **kwargs):
13266 """SetRow(self, int row)"""
5b5c9bc7 13267 return _core_.GBPosition_SetRow(*args, **kwargs)
d55e5bfc
RD
13268
13269 def SetCol(*args, **kwargs):
13270 """SetCol(self, int col)"""
5b5c9bc7 13271 return _core_.GBPosition_SetCol(*args, **kwargs)
d55e5bfc
RD
13272
13273 def __eq__(*args, **kwargs):
e9d6f3a4
RD
13274 """
13275 __eq__(self, PyObject other) -> bool
13276
13277 Compare GBPosition for equality.
13278 """
5b5c9bc7 13279 return _core_.GBPosition___eq__(*args, **kwargs)
d55e5bfc
RD
13280
13281 def __ne__(*args, **kwargs):
e9d6f3a4
RD
13282 """
13283 __ne__(self, PyObject other) -> bool
13284
13285 Compare GBPosition for inequality.
13286 """
5b5c9bc7 13287 return _core_.GBPosition___ne__(*args, **kwargs)
d55e5bfc
RD
13288
13289 def Set(*args, **kwargs):
13290 """Set(self, int row=0, int col=0)"""
5b5c9bc7 13291 return _core_.GBPosition_Set(*args, **kwargs)
d55e5bfc
RD
13292
13293 def Get(*args, **kwargs):
13294 """Get(self) -> PyObject"""
5b5c9bc7 13295 return _core_.GBPosition_Get(*args, **kwargs)
d55e5bfc 13296
15817c7e 13297 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
13298 def __str__(self): return str(self.Get())
13299 def __repr__(self): return 'wx.GBPosition'+str(self.Get())
13300 def __len__(self): return len(self.Get())
13301 def __getitem__(self, index): return self.Get()[index]
13302 def __setitem__(self, index, val):
13303 if index == 0: self.SetRow(val)
13304 elif index == 1: self.SetCol(val)
13305 else: raise IndexError
13306 def __nonzero__(self): return self.Get() != (0,0)
13307 __safe_for_unpickling__ = True
13308 def __reduce__(self): return (wx.GBPosition, self.Get())
13309
13310 row = property(GetRow, SetRow)
13311 col = property(GetCol, SetCol)
13312
2131d850 13313_core_.GBPosition_swigregister(GBPosition)
d55e5bfc 13314
5b5c9bc7 13315class GBSpan(object):
bfddbb17
RD
13316 """
13317 This class is used to hold the row and column spanning attributes of
13318 items in a `wx.GridBagSizer`. wxPython has typemaps that will
13319 automatically convert from a 2-element sequence of integers to a
13320 wx.GBSpan, so you can use the more pythonic representation of the span
13321 nearly transparently in Python code.
13322
13323 """
1bd55598
RD
13324 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13325 __repr__ = _swig_repr
13326 def __init__(self, *args, **kwargs):
bfddbb17 13327 """
5b5c9bc7 13328 __init__(self, int rowspan=1, int colspan=1) -> GBSpan
bfddbb17
RD
13329
13330 Construct a new wxGBSpan, optionally setting the rowspan and
13331 colspan. The default is (1,1). (Meaning that the item occupies one
13332 cell in each direction.
13333 """
1bd55598
RD
13334 _core_.GBSpan_swiginit(self,_core_.new_GBSpan(*args, **kwargs))
13335 __swig_destroy__ = _core_.delete_GBSpan
13336 __del__ = lambda self : None;
d55e5bfc
RD
13337 def GetRowspan(*args, **kwargs):
13338 """GetRowspan(self) -> int"""
5b5c9bc7 13339 return _core_.GBSpan_GetRowspan(*args, **kwargs)
d55e5bfc
RD
13340
13341 def GetColspan(*args, **kwargs):
13342 """GetColspan(self) -> int"""
5b5c9bc7 13343 return _core_.GBSpan_GetColspan(*args, **kwargs)
d55e5bfc
RD
13344
13345 def SetRowspan(*args, **kwargs):
13346 """SetRowspan(self, int rowspan)"""
5b5c9bc7 13347 return _core_.GBSpan_SetRowspan(*args, **kwargs)
d55e5bfc
RD
13348
13349 def SetColspan(*args, **kwargs):
13350 """SetColspan(self, int colspan)"""
5b5c9bc7 13351 return _core_.GBSpan_SetColspan(*args, **kwargs)
d55e5bfc
RD
13352
13353 def __eq__(*args, **kwargs):
e9d6f3a4
RD
13354 """
13355 __eq__(self, PyObject other) -> bool
13356
13357 Compare wxGBSpan for equality.
13358 """
5b5c9bc7 13359 return _core_.GBSpan___eq__(*args, **kwargs)
d55e5bfc
RD
13360
13361 def __ne__(*args, **kwargs):
e9d6f3a4
RD
13362 """
13363 __ne__(self, PyObject other) -> bool
13364
13365 Compare GBSpan for inequality.
13366 """
5b5c9bc7 13367 return _core_.GBSpan___ne__(*args, **kwargs)
d55e5bfc
RD
13368
13369 def Set(*args, **kwargs):
13370 """Set(self, int rowspan=1, int colspan=1)"""
5b5c9bc7 13371 return _core_.GBSpan_Set(*args, **kwargs)
d55e5bfc
RD
13372
13373 def Get(*args, **kwargs):
13374 """Get(self) -> PyObject"""
5b5c9bc7 13375 return _core_.GBSpan_Get(*args, **kwargs)
d55e5bfc 13376
15817c7e 13377 asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
d55e5bfc
RD
13378 def __str__(self): return str(self.Get())
13379 def __repr__(self): return 'wx.GBSpan'+str(self.Get())
13380 def __len__(self): return len(self.Get())
13381 def __getitem__(self, index): return self.Get()[index]
13382 def __setitem__(self, index, val):
13383 if index == 0: self.SetRowspan(val)
13384 elif index == 1: self.SetColspan(val)
13385 else: raise IndexError
13386 def __nonzero__(self): return self.Get() != (0,0)
13387 __safe_for_unpickling__ = True
13388 def __reduce__(self): return (wx.GBSpan, self.Get())
13389
13390 rowspan = property(GetRowspan, SetRowspan)
13391 colspan = property(GetColspan, SetColspan)
13392
2131d850 13393_core_.GBSpan_swigregister(GBSpan)
d55e5bfc 13394
5b5c9bc7 13395class GBSizerItem(SizerItem):
bfddbb17
RD
13396 """
13397 The wx.GBSizerItem class is used to track the additional data about
13398 items in a `wx.GridBagSizer` such as the item's position in the grid
13399 and how many rows or columns it spans.
13400
13401 """
1bd55598
RD
13402 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13403 __repr__ = _swig_repr
13404 def __init__(self, *args, **kwargs):
bfddbb17 13405 """
5b5c9bc7 13406 __init__(self) -> GBSizerItem
bfddbb17
RD
13407
13408 Constructs an empty wx.GBSizerItem. Either a window, sizer or spacer
13409 size will need to be set, as well as a position and span before this
13410 item can be used in a Sizer.
13411
13412 You will probably never need to create a wx.GBSizerItem directly as they
13413 are created automatically when the sizer's Add method is called.
13414 """
1bd55598
RD
13415 _core_.GBSizerItem_swiginit(self,_core_.new_GBSizerItem(*args, **kwargs))
13416 __swig_destroy__ = _core_.delete_GBSizerItem
13417 __del__ = lambda self : None;
d55e5bfc 13418 def GetPos(*args, **kwargs):
bfddbb17 13419 """
5b5c9bc7 13420 GetPos(self) -> GBPosition
bfddbb17
RD
13421
13422 Get the grid position of the item
13423 """
5b5c9bc7 13424 return _core_.GBSizerItem_GetPos(*args, **kwargs)
d55e5bfc
RD
13425
13426 def GetPosTuple(self): return self.GetPos().Get()
13427 def GetSpan(*args, **kwargs):
bfddbb17 13428 """
5b5c9bc7 13429 GetSpan(self) -> GBSpan
bfddbb17
RD
13430
13431 Get the row and column spanning of the item
13432 """
5b5c9bc7 13433 return _core_.GBSizerItem_GetSpan(*args, **kwargs)
d55e5bfc
RD
13434
13435 def GetSpanTuple(self): return self.GetSpan().Get()
13436 def SetPos(*args, **kwargs):
bfddbb17 13437 """
5b5c9bc7 13438 SetPos(self, GBPosition pos) -> bool
bfddbb17
RD
13439
13440 If the item is already a member of a sizer then first ensure that
13441 there is no other item that would intersect with this one at the new
13442 position, then set the new position. Returns True if the change is
13443 successful and after the next Layout() the item will be moved.
13444 """
5b5c9bc7 13445 return _core_.GBSizerItem_SetPos(*args, **kwargs)
d55e5bfc
RD
13446
13447 def SetSpan(*args, **kwargs):
bfddbb17 13448 """
5b5c9bc7 13449 SetSpan(self, GBSpan span) -> bool
bfddbb17
RD
13450
13451 If the item is already a member of a sizer then first ensure that
13452 there is no other item that would intersect with this one with its new
13453 spanning size, then set the new spanning. Returns True if the change
13454 is successful and after the next Layout() the item will be resized.
13455
13456 """
5b5c9bc7 13457 return _core_.GBSizerItem_SetSpan(*args, **kwargs)
d55e5bfc 13458
bfddbb17 13459 def Intersects(*args, **kwargs):
d55e5bfc 13460 """
5b5c9bc7 13461 Intersects(self, GBSizerItem other) -> bool
bfddbb17
RD
13462
13463 Returns True if this item and the other item instersect.
d55e5bfc 13464 """
5b5c9bc7 13465 return _core_.GBSizerItem_Intersects(*args, **kwargs)
bfddbb17
RD
13466
13467 def IntersectsPos(*args, **kwargs):
13468 """
5b5c9bc7 13469 IntersectsPos(self, GBPosition pos, GBSpan span) -> bool
bfddbb17
RD
13470
13471 Returns True if the given pos/span would intersect with this item.
13472 """
5b5c9bc7 13473 return _core_.GBSizerItem_IntersectsPos(*args, **kwargs)
d55e5bfc
RD
13474
13475 def GetEndPos(*args, **kwargs):
bfddbb17 13476 """
5b5c9bc7 13477 GetEndPos(self) -> GBPosition
bfddbb17
RD
13478
13479 Get the row and column of the endpoint of this item.
13480 """
5b5c9bc7 13481 return _core_.GBSizerItem_GetEndPos(*args, **kwargs)
d55e5bfc
RD
13482
13483 def GetGBSizer(*args, **kwargs):
bfddbb17 13484 """
5b5c9bc7 13485 GetGBSizer(self) -> GridBagSizer
bfddbb17
RD
13486
13487 Get the sizer this item is a member of.
13488 """
5b5c9bc7 13489 return _core_.GBSizerItem_GetGBSizer(*args, **kwargs)
d55e5bfc
RD
13490
13491 def SetGBSizer(*args, **kwargs):
bfddbb17 13492 """
5b5c9bc7 13493 SetGBSizer(self, GridBagSizer sizer)
bfddbb17
RD
13494
13495 Set the sizer this item is a member of.
13496 """
5b5c9bc7 13497 return _core_.GBSizerItem_SetGBSizer(*args, **kwargs)
d55e5bfc 13498
ac5d357a
RD
13499 EndPos = property(GetEndPos,doc="See `GetEndPos`")
13500 GBSizer = property(GetGBSizer,SetGBSizer,doc="See `GetGBSizer` and `SetGBSizer`")
13501 Pos = property(GetPos,SetPos,doc="See `GetPos` and `SetPos`")
13502 Span = property(GetSpan,SetSpan,doc="See `GetSpan` and `SetSpan`")
2131d850 13503_core_.GBSizerItem_swigregister(GBSizerItem)
5b5c9bc7 13504DefaultSpan = cvar.DefaultSpan
d55e5bfc
RD
13505
13506def GBSizerItemWindow(*args, **kwargs):
13507 """
5b5c9bc7
RD
13508 GBSizerItemWindow(Window window, GBPosition pos, GBSpan span, int flag,
13509 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
13510
13511 Construct a `wx.GBSizerItem` for a window.
d55e5bfc 13512 """
5b5c9bc7 13513 val = _core_.new_GBSizerItemWindow(*args, **kwargs)
d55e5bfc
RD
13514 return val
13515
13516def GBSizerItemSizer(*args, **kwargs):
13517 """
5b5c9bc7
RD
13518 GBSizerItemSizer(Sizer sizer, GBPosition pos, GBSpan span, int flag,
13519 int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
13520
13521 Construct a `wx.GBSizerItem` for a sizer
d55e5bfc 13522 """
5b5c9bc7 13523 val = _core_.new_GBSizerItemSizer(*args, **kwargs)
d55e5bfc
RD
13524 return val
13525
13526def GBSizerItemSpacer(*args, **kwargs):
13527 """
5b5c9bc7
RD
13528 GBSizerItemSpacer(int width, int height, GBPosition pos, GBSpan span,
13529 int flag, int border, PyObject userData=None) -> GBSizerItem
bfddbb17
RD
13530
13531 Construct a `wx.GBSizerItem` for a spacer.
d55e5bfc 13532 """
5b5c9bc7 13533 val = _core_.new_GBSizerItemSpacer(*args, **kwargs)
d55e5bfc
RD
13534 return val
13535
5b5c9bc7 13536class GridBagSizer(FlexGridSizer):
bfddbb17
RD
13537 """
13538 A `wx.Sizer` that can lay out items in a virtual grid like a
13539 `wx.FlexGridSizer` but in this case explicit positioning of the items
13540 is allowed using `wx.GBPosition`, and items can optionally span more
13541 than one row and/or column using `wx.GBSpan`. The total size of the
13542 virtual grid is determined by the largest row and column that items are
13543 positioned at, adjusted for spanning.
13544
13545 """
1bd55598
RD
13546 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13547 __repr__ = _swig_repr
13548 def __init__(self, *args, **kwargs):
bfddbb17 13549 """
5b5c9bc7 13550 __init__(self, int vgap=0, int hgap=0) -> GridBagSizer
bfddbb17
RD
13551
13552 Constructor, with optional parameters to specify the gap between the
13553 rows and columns.
13554 """
1bd55598 13555 _core_.GridBagSizer_swiginit(self,_core_.new_GridBagSizer(*args, **kwargs))
03e46024
RD
13556 self._setOORInfo(self)
13557
d55e5bfc
RD
13558 def Add(*args, **kwargs):
13559 """
bfddbb17 13560 Add(self, item, GBPosition pos, GBSpan span=DefaultSpan, int flag=0,
070c48b4 13561 int border=0, userData=None) -> wx.GBSizerItem
bfddbb17
RD
13562
13563 Adds an item to the sizer at the grid cell *pos*, optionally spanning
13564 more than one row or column as specified with *span*. The remaining
13565 args behave similarly to `wx.Sizer.Add`.
13566
13567 Returns True if the item was successfully placed at the given cell
13568 position, False if something was already there.
13569
d55e5bfc 13570 """
5b5c9bc7 13571 return _core_.GridBagSizer_Add(*args, **kwargs)
d55e5bfc
RD
13572
13573 def AddItem(*args, **kwargs):
bfddbb17 13574 """
070c48b4 13575 Add(self, GBSizerItem item) -> wx.GBSizerItem
bfddbb17
RD
13576
13577 Add an item to the sizer using a `wx.GBSizerItem`. Returns True if
13578 the item was successfully placed at its given cell position, False if
13579 something was already there.
13580 """
5b5c9bc7 13581 return _core_.GridBagSizer_AddItem(*args, **kwargs)
d55e5bfc 13582
84f85550
RD
13583 def GetCellSize(*args, **kwargs):
13584 """
5b5c9bc7 13585 GetCellSize(self, int row, int col) -> Size
84f85550
RD
13586
13587 Get the size of the specified cell, including hgap and
13588 vgap. Only valid after a Layout.
13589 """
5b5c9bc7 13590 return _core_.GridBagSizer_GetCellSize(*args, **kwargs)
84f85550 13591
d55e5bfc 13592 def GetEmptyCellSize(*args, **kwargs):
bfddbb17 13593 """
5b5c9bc7 13594 GetEmptyCellSize(self) -> Size
bfddbb17
RD
13595
13596 Get the size used for cells in the grid with no item.
13597 """
5b5c9bc7 13598 return _core_.GridBagSizer_GetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
13599
13600 def SetEmptyCellSize(*args, **kwargs):
bfddbb17 13601 """
5b5c9bc7 13602 SetEmptyCellSize(self, Size sz)
bfddbb17
RD
13603
13604 Set the size used for cells in the grid with no item.
13605 """
5b5c9bc7 13606 return _core_.GridBagSizer_SetEmptyCellSize(*args, **kwargs)
d55e5bfc
RD
13607
13608 def GetItemPosition(*args):
13609 """
bfddbb17
RD
13610 GetItemPosition(self, item) -> GBPosition
13611
13612 Get the grid position of the specified *item* where *item* is either a
13613 window or subsizer that is a member of this sizer, or a zero-based
13614 index of an item.
d55e5bfc 13615 """
5b5c9bc7 13616 return _core_.GridBagSizer_GetItemPosition(*args)
d55e5bfc
RD
13617
13618 def SetItemPosition(*args):
13619 """
bfddbb17
RD
13620 SetItemPosition(self, item, GBPosition pos) -> bool
13621
13622 Set the grid position of the specified *item* where *item* is either a
13623 window or subsizer that is a member of this sizer, or a zero-based
13624 index of an item. Returns True on success. If the move is not
13625 allowed (because an item is already there) then False is returned.
13626
d55e5bfc 13627 """
5b5c9bc7 13628 return _core_.GridBagSizer_SetItemPosition(*args)
d55e5bfc
RD
13629
13630 def GetItemSpan(*args):
13631 """
bfddbb17
RD
13632 GetItemSpan(self, item) -> GBSpan
13633
13634 Get the row/col spanning of the specified *item* where *item* is
13635 either a window or subsizer that is a member of this sizer, or a
13636 zero-based index of an item.
d55e5bfc 13637 """
5b5c9bc7 13638 return _core_.GridBagSizer_GetItemSpan(*args)
d55e5bfc
RD
13639
13640 def SetItemSpan(*args):
13641 """
bfddbb17
RD
13642 SetItemSpan(self, item, GBSpan span) -> bool
13643
13644 Set the row/col spanning of the specified *item* where *item* is
13645 either a window or subsizer that is a member of this sizer, or a
13646 zero-based index of an item. Returns True on success. If the move is
13647 not allowed (because an item is already there) then False is returned.
d55e5bfc 13648 """
5b5c9bc7 13649 return _core_.GridBagSizer_SetItemSpan(*args)
d55e5bfc
RD
13650
13651 def FindItem(*args):
13652 """
bfddbb17
RD
13653 FindItem(self, item) -> GBSizerItem
13654
13655 Find the sizer item for the given window or subsizer, returns None if
13656 not found. (non-recursive)
d55e5bfc 13657 """
5b5c9bc7 13658 return _core_.GridBagSizer_FindItem(*args)
d55e5bfc 13659
b08d67c2
RD
13660 def GetItem(self, item):
13661 gbsi = None
13662 si = wx.FlexGridSizer.GetItem(self, item)
13663 if not si:
13664 return None
13665 if type(item) is not int:
13666 gbsi = self.FindItem(item)
13667 if gbsi: return gbsi
13668 return si
13669
d55e5bfc 13670 def FindItemAtPosition(*args, **kwargs):
bfddbb17 13671 """
5b5c9bc7 13672 FindItemAtPosition(self, GBPosition pos) -> GBSizerItem
bfddbb17
RD
13673
13674 Return the sizer item for the given grid cell, or None if there is no
13675 item at that position. (non-recursive)
13676 """
5b5c9bc7 13677 return _core_.GridBagSizer_FindItemAtPosition(*args, **kwargs)
d55e5bfc
RD
13678
13679 def FindItemAtPoint(*args, **kwargs):
bfddbb17 13680 """
5b5c9bc7 13681 FindItemAtPoint(self, Point pt) -> GBSizerItem
bfddbb17
RD
13682
13683 Return the sizer item located at the point given in *pt*, or None if
13684 there is no item at that point. The (x,y) coordinates in pt correspond
13685 to the client coordinates of the window using the sizer for
13686 layout. (non-recursive)
13687 """
5b5c9bc7 13688 return _core_.GridBagSizer_FindItemAtPoint(*args, **kwargs)
d55e5bfc 13689
bfddbb17
RD
13690 def CheckForIntersection(*args, **kwargs):
13691 """
5b5c9bc7 13692 CheckForIntersection(self, GBSizerItem item, GBSizerItem excludeItem=None) -> bool
d55e5bfc 13693
bfddbb17
RD
13694 Look at all items and see if any intersect (or would overlap) the
13695 given *item*. Returns True if so, False if there would be no overlap.
13696 If an *excludeItem* is given then it will not be checked for
13697 intersection, for example it may be the item we are checking the
13698 position of.
d55e5bfc 13699
bfddbb17 13700 """
5b5c9bc7 13701 return _core_.GridBagSizer_CheckForIntersection(*args, **kwargs)
d55e5bfc 13702
bfddbb17 13703 def CheckForIntersectionPos(*args, **kwargs):
d55e5bfc 13704 """
5b5c9bc7 13705 CheckForIntersectionPos(self, GBPosition pos, GBSpan span, GBSizerItem excludeItem=None) -> bool
bfddbb17
RD
13706
13707 Look at all items and see if any intersect (or would overlap) the
13708 given position and span. Returns True if so, False if there would be
13709 no overlap. If an *excludeItem* is given then it will not be checked
13710 for intersection, for example it may be the item we are checking the
13711 position of.
d55e5bfc 13712 """
5b5c9bc7 13713 return _core_.GridBagSizer_CheckForIntersectionPos(*args, **kwargs)
d55e5bfc 13714
2131d850 13715_core_.GridBagSizer_swigregister(GridBagSizer)
d55e5bfc
RD
13716
13717#---------------------------------------------------------------------------
13718
5b5c9bc7
RD
13719Left = _core_.Left
13720Top = _core_.Top
13721Right = _core_.Right
13722Bottom = _core_.Bottom
13723Width = _core_.Width
13724Height = _core_.Height
13725Centre = _core_.Centre
13726Center = _core_.Center
13727CentreX = _core_.CentreX
13728CentreY = _core_.CentreY
13729Unconstrained = _core_.Unconstrained
13730AsIs = _core_.AsIs
13731PercentOf = _core_.PercentOf
13732Above = _core_.Above
13733Below = _core_.Below
13734LeftOf = _core_.LeftOf
13735RightOf = _core_.RightOf
13736SameAs = _core_.SameAs
13737Absolute = _core_.Absolute
13738class IndividualLayoutConstraint(Object):
d55e5bfc 13739 """
15817c7e
RD
13740 Objects of this class are stored in the `wx.LayoutConstraints` class as
13741 one of eight possible constraints that a window can be involved in.
13742 You will never need to create an instance of
13743 wx.IndividualLayoutConstraint, rather you should create a
13744 `wx.LayoutConstraints` instance and use the individual contstraints
d55e5bfc 13745 that it contains.
d55e5bfc 13746 """
1bd55598
RD
13747 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13748 def __init__(self): raise AttributeError, "No constructor defined"
13749 __repr__ = _swig_repr
d55e5bfc 13750 def Set(*args, **kwargs):
15817c7e 13751 """
5b5c9bc7 13752 Set(self, int rel, Window otherW, int otherE, int val=0, int marg=wxLAYOUT_DEFAULT_MARGIN)
15817c7e
RD
13753
13754 Sets the properties of the constraint. Normally called by one of the
13755 convenience functions such as Above, RightOf, SameAs.
13756 """
5b5c9bc7 13757 return _core_.IndividualLayoutConstraint_Set(*args, **kwargs)
d55e5bfc
RD
13758
13759 def LeftOf(*args, **kwargs):
13760 """
5b5c9bc7 13761 LeftOf(self, Window sibling, int marg=0)
d55e5bfc 13762
15817c7e
RD
13763 Constrains this edge to be to the left of the given window, with an
13764 optional margin. Implicitly, this is relative to the left edge of the
13765 other window.
d55e5bfc 13766 """
5b5c9bc7 13767 return _core_.IndividualLayoutConstraint_LeftOf(*args, **kwargs)
d55e5bfc
RD
13768
13769 def RightOf(*args, **kwargs):
13770 """
5b5c9bc7 13771 RightOf(self, Window sibling, int marg=0)
d55e5bfc 13772
15817c7e
RD
13773 Constrains this edge to be to the right of the given window, with an
13774 optional margin. Implicitly, this is relative to the right edge of the
13775 other window.
d55e5bfc 13776 """
5b5c9bc7 13777 return _core_.IndividualLayoutConstraint_RightOf(*args, **kwargs)
d55e5bfc
RD
13778
13779 def Above(*args, **kwargs):
13780 """
5b5c9bc7 13781 Above(self, Window sibling, int marg=0)
d55e5bfc 13782
15817c7e
RD
13783 Constrains this edge to be above the given window, with an optional
13784 margin. Implicitly, this is relative to the top edge of the other
13785 window.
d55e5bfc 13786 """
5b5c9bc7 13787 return _core_.IndividualLayoutConstraint_Above(*args, **kwargs)
d55e5bfc
RD
13788
13789 def Below(*args, **kwargs):
13790 """
5b5c9bc7 13791 Below(self, Window sibling, int marg=0)
d55e5bfc 13792
15817c7e
RD
13793 Constrains this edge to be below the given window, with an optional
13794 margin. Implicitly, this is relative to the bottom edge of the other
13795 window.
d55e5bfc 13796 """
5b5c9bc7 13797 return _core_.IndividualLayoutConstraint_Below(*args, **kwargs)
d55e5bfc
RD
13798
13799 def SameAs(*args, **kwargs):
13800 """
5b5c9bc7 13801 SameAs(self, Window otherW, int edge, int marg=0)
d55e5bfc 13802
15817c7e
RD
13803 Constrains this edge or dimension to be to the same as the edge of the
13804 given window, with an optional margin.
d55e5bfc 13805 """
5b5c9bc7 13806 return _core_.IndividualLayoutConstraint_SameAs(*args, **kwargs)
d55e5bfc
RD
13807
13808 def PercentOf(*args, **kwargs):
13809 """
5b5c9bc7 13810 PercentOf(self, Window otherW, int wh, int per)
d55e5bfc 13811
15817c7e
RD
13812 Constrains this edge or dimension to be to a percentage of the given
13813 window, with an optional margin.
d55e5bfc 13814 """
5b5c9bc7 13815 return _core_.IndividualLayoutConstraint_PercentOf(*args, **kwargs)
d55e5bfc
RD
13816
13817 def Absolute(*args, **kwargs):
13818 """
13819 Absolute(self, int val)
13820
15817c7e 13821 Constrains this edge or dimension to be the given absolute value.
d55e5bfc 13822 """
5b5c9bc7 13823 return _core_.IndividualLayoutConstraint_Absolute(*args, **kwargs)
d55e5bfc
RD
13824
13825 def Unconstrained(*args, **kwargs):
13826 """
13827 Unconstrained(self)
13828
15817c7e
RD
13829 Sets this edge or dimension to be unconstrained, that is, dependent on
13830 other edges and dimensions from which this value can be deduced.
d55e5bfc 13831 """
5b5c9bc7 13832 return _core_.IndividualLayoutConstraint_Unconstrained(*args, **kwargs)
d55e5bfc
RD
13833
13834 def AsIs(*args, **kwargs):
13835 """
13836 AsIs(self)
13837
15817c7e
RD
13838 Sets this edge or constraint to be whatever the window's value is at
13839 the moment. If either of the width and height constraints are *as is*,
13840 the window will not be resized, but moved instead. This is important
13841 when considering panel items which are intended to have a default
13842 size, such as a button, which may take its size from the size of the
13843 button label.
d55e5bfc 13844 """
5b5c9bc7 13845 return _core_.IndividualLayoutConstraint_AsIs(*args, **kwargs)
d55e5bfc
RD
13846
13847 def GetOtherWindow(*args, **kwargs):
5b5c9bc7
RD
13848 """GetOtherWindow(self) -> Window"""
13849 return _core_.IndividualLayoutConstraint_GetOtherWindow(*args, **kwargs)
d55e5bfc
RD
13850
13851 def GetMyEdge(*args, **kwargs):
13852 """GetMyEdge(self) -> int"""
5b5c9bc7 13853 return _core_.IndividualLayoutConstraint_GetMyEdge(*args, **kwargs)
d55e5bfc
RD
13854
13855 def SetEdge(*args, **kwargs):
13856 """SetEdge(self, int which)"""
5b5c9bc7 13857 return _core_.IndividualLayoutConstraint_SetEdge(*args, **kwargs)
d55e5bfc
RD
13858
13859 def SetValue(*args, **kwargs):
13860 """SetValue(self, int v)"""
5b5c9bc7 13861 return _core_.IndividualLayoutConstraint_SetValue(*args, **kwargs)
d55e5bfc
RD
13862
13863 def GetMargin(*args, **kwargs):
13864 """GetMargin(self) -> int"""
5b5c9bc7 13865 return _core_.IndividualLayoutConstraint_GetMargin(*args, **kwargs)
d55e5bfc
RD
13866
13867 def SetMargin(*args, **kwargs):
13868 """SetMargin(self, int m)"""
5b5c9bc7 13869 return _core_.IndividualLayoutConstraint_SetMargin(*args, **kwargs)
d55e5bfc
RD
13870
13871 def GetValue(*args, **kwargs):
13872 """GetValue(self) -> int"""
5b5c9bc7 13873 return _core_.IndividualLayoutConstraint_GetValue(*args, **kwargs)
d55e5bfc
RD
13874
13875 def GetPercent(*args, **kwargs):
13876 """GetPercent(self) -> int"""
5b5c9bc7 13877 return _core_.IndividualLayoutConstraint_GetPercent(*args, **kwargs)
d55e5bfc
RD
13878
13879 def GetOtherEdge(*args, **kwargs):
13880 """GetOtherEdge(self) -> int"""
5b5c9bc7 13881 return _core_.IndividualLayoutConstraint_GetOtherEdge(*args, **kwargs)
d55e5bfc
RD
13882
13883 def GetDone(*args, **kwargs):
13884 """GetDone(self) -> bool"""
5b5c9bc7 13885 return _core_.IndividualLayoutConstraint_GetDone(*args, **kwargs)
d55e5bfc
RD
13886
13887 def SetDone(*args, **kwargs):
13888 """SetDone(self, bool d)"""
5b5c9bc7 13889 return _core_.IndividualLayoutConstraint_SetDone(*args, **kwargs)
d55e5bfc
RD
13890
13891 def GetRelationship(*args, **kwargs):
13892 """GetRelationship(self) -> int"""
5b5c9bc7 13893 return _core_.IndividualLayoutConstraint_GetRelationship(*args, **kwargs)
d55e5bfc
RD
13894
13895 def SetRelationship(*args, **kwargs):
13896 """SetRelationship(self, int r)"""
5b5c9bc7 13897 return _core_.IndividualLayoutConstraint_SetRelationship(*args, **kwargs)
d55e5bfc
RD
13898
13899 def ResetIfWin(*args, **kwargs):
13900 """
5b5c9bc7 13901 ResetIfWin(self, Window otherW) -> bool
d55e5bfc
RD
13902
13903 Reset constraint if it mentions otherWin
13904 """
5b5c9bc7 13905 return _core_.IndividualLayoutConstraint_ResetIfWin(*args, **kwargs)
d55e5bfc
RD
13906
13907 def SatisfyConstraint(*args, **kwargs):
13908 """
5b5c9bc7 13909 SatisfyConstraint(self, LayoutConstraints constraints, Window win) -> bool
d55e5bfc
RD
13910
13911 Try to satisfy constraint
13912 """
5b5c9bc7 13913 return _core_.IndividualLayoutConstraint_SatisfyConstraint(*args, **kwargs)
d55e5bfc
RD
13914
13915 def GetEdge(*args, **kwargs):
13916 """
5b5c9bc7 13917 GetEdge(self, int which, Window thisWin, Window other) -> int
d55e5bfc
RD
13918
13919 Get the value of this edge or dimension, or if this
13920 is not determinable, -1.
13921 """
5b5c9bc7 13922 return _core_.IndividualLayoutConstraint_GetEdge(*args, **kwargs)
d55e5bfc 13923
ac5d357a
RD
13924 Done = property(GetDone,SetDone,doc="See `GetDone` and `SetDone`")
13925 Margin = property(GetMargin,SetMargin,doc="See `GetMargin` and `SetMargin`")
13926 MyEdge = property(GetMyEdge,doc="See `GetMyEdge`")
13927 OtherEdge = property(GetOtherEdge,doc="See `GetOtherEdge`")
13928 OtherWindow = property(GetOtherWindow,doc="See `GetOtherWindow`")
13929 Percent = property(GetPercent,doc="See `GetPercent`")
13930 Relationship = property(GetRelationship,SetRelationship,doc="See `GetRelationship` and `SetRelationship`")
13931 Value = property(GetValue,SetValue,doc="See `GetValue` and `SetValue`")
2131d850 13932_core_.IndividualLayoutConstraint_swigregister(IndividualLayoutConstraint)
d55e5bfc 13933
5b5c9bc7 13934class LayoutConstraints(Object):
d55e5bfc 13935 """
15817c7e
RD
13936 **Note:** constraints are now deprecated and you should use sizers
13937 instead.
d55e5bfc 13938
15817c7e
RD
13939 Objects of this class can be associated with a window to define its
13940 layout constraints, with respect to siblings or its parent.
d55e5bfc
RD
13941
13942 The class consists of the following eight constraints of class
13943 wx.IndividualLayoutConstraint, some or all of which should be accessed
13944 directly to set the appropriate constraints.
13945
13946 * left: represents the left hand edge of the window
13947 * right: represents the right hand edge of the window
13948 * top: represents the top edge of the window
13949 * bottom: represents the bottom edge of the window
13950 * width: represents the width of the window
13951 * height: represents the height of the window
13952 * centreX: represents the horizontal centre point of the window
13953 * centreY: represents the vertical centre point of the window
13954
15817c7e
RD
13955 Most constraints are initially set to have the relationship
13956 wxUnconstrained, which means that their values should be calculated by
13957 looking at known constraints. The exceptions are width and height,
13958 which are set to wxAsIs to ensure that if the user does not specify a
13959 constraint, the existing width and height will be used, to be
13960 compatible with panel items which often have take a default size. If
13961 the constraint is ``wx.AsIs``, the dimension will not be changed.
13962
13963 :see: `wx.IndividualLayoutConstraint`, `wx.Window.SetConstraints`
d55e5bfc
RD
13964
13965 """
1bd55598
RD
13966 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
13967 __repr__ = _swig_repr
5b5c9bc7
RD
13968 left = property(_core_.LayoutConstraints_left_get)
13969 top = property(_core_.LayoutConstraints_top_get)
13970 right = property(_core_.LayoutConstraints_right_get)
13971 bottom = property(_core_.LayoutConstraints_bottom_get)
13972 width = property(_core_.LayoutConstraints_width_get)
13973 height = property(_core_.LayoutConstraints_height_get)
13974 centreX = property(_core_.LayoutConstraints_centreX_get)
13975 centreY = property(_core_.LayoutConstraints_centreY_get)
1bd55598 13976 def __init__(self, *args, **kwargs):
5b5c9bc7 13977 """__init__(self) -> LayoutConstraints"""
1bd55598
RD
13978 _core_.LayoutConstraints_swiginit(self,_core_.new_LayoutConstraints(*args, **kwargs))
13979 __swig_destroy__ = _core_.delete_LayoutConstraints
13980 __del__ = lambda self : None;
d55e5bfc
RD
13981 def SatisfyConstraints(*args, **kwargs):
13982 """SatisfyConstraints(Window win) -> (areSatisfied, noChanges)"""
5b5c9bc7 13983 return _core_.LayoutConstraints_SatisfyConstraints(*args, **kwargs)
d55e5bfc
RD
13984
13985 def AreSatisfied(*args, **kwargs):
13986 """AreSatisfied(self) -> bool"""
5b5c9bc7 13987 return _core_.LayoutConstraints_AreSatisfied(*args, **kwargs)
d55e5bfc 13988
2131d850 13989_core_.LayoutConstraints_swigregister(LayoutConstraints)
d55e5bfc
RD
13990
13991#----------------------------------------------------------------------------
13992
13993# Use Python's bool constants if available, make some if not
13994try:
13995 True
13996except NameError:
13997 __builtins__.True = 1==1
13998 __builtins__.False = 1==0
13999 def bool(value): return not not value
14000 __builtins__.bool = bool
14001
14002
14003
14004# workarounds for bad wxRTTI names
14005__wxPyPtrTypeMap['wxGauge95'] = 'wxGauge'
14006__wxPyPtrTypeMap['wxSlider95'] = 'wxSlider'
14007__wxPyPtrTypeMap['wxStatusBar95'] = 'wxStatusBar'
14008
14009
14010#----------------------------------------------------------------------------
14011# Load version numbers from __version__... Ensure that major and minor
0f63ec68 14012# versions are the same for both wxPython and wxWidgets.
d55e5bfc
RD
14013
14014from __version__ import *
14015__version__ = VERSION_STRING
14016
0f63ec68
RD
14017assert MAJOR_VERSION == _core_.MAJOR_VERSION, "wxPython/wxWidgets version mismatch"
14018assert MINOR_VERSION == _core_.MINOR_VERSION, "wxPython/wxWidgets version mismatch"
d55e5bfc
RD
14019if RELEASE_VERSION != _core_.RELEASE_VERSION:
14020 import warnings
0f63ec68 14021 warnings.warn("wxPython/wxWidgets release number mismatch")
d55e5bfc 14022
f9bf356b
RD
14023
14024def version():
14025 """Returns a string containing version and port info"""
14026 ctype = wx.USE_UNICODE and 'unicode' or 'ansi'
14027 if wx.Platform == '__WXMSW__':
14028 port = 'msw'
14029 elif wx.Platform == '__WXMAC__':
14030 port = 'mac'
14031 elif wx.Platform == '__WXGTK__':
14032 port = 'gtk'
14033 if 'gtk2' in wx.PlatformInfo:
14034 port = 'gtk2'
14035 else:
14036 port = '?'
14037
14038 return "%s (%s-%s)" % (wx.VERSION_STRING, port, ctype)
14039
14040
d55e5bfc
RD
14041#----------------------------------------------------------------------------
14042
7993762b
RD
14043# Set wxPython's default string<-->unicode conversion encoding from
14044# the locale, but only if Python's default hasn't been changed. (We
14045# assume that if the user has customized it already then that is the
14046# encoding we need to use as well.)
14047#
14048# The encoding selected here is used when string or unicode objects
14049# need to be converted in order to pass them to wxWidgets. Please be
14050# aware that the default encoding within the same locale may be
14051# slightly different on different platforms. For example, please see
62d32a5f
RD
14052# http://www.alanwood.net/demos/charsetdiffs.html for differences
14053# between the common latin/roman encodings.
3837a853
RD
14054
14055default = _sys.getdefaultencoding()
14056if default == 'ascii':
14057 import locale
14058 import codecs
14059 try:
474e2ff2
RD
14060 if hasattr(locale, 'getpreferredencoding'):
14061 default = locale.getpreferredencoding()
14062 else:
14063 default = locale.getdefaultlocale()[1]
3837a853 14064 codecs.lookup(default)
7993762b 14065 except (ValueError, LookupError, TypeError):
3837a853
RD
14066 default = _sys.getdefaultencoding()
14067 del locale
14068 del codecs
5cbf236d
RD
14069if default:
14070 wx.SetDefaultPyEncoding(default)
14071del default
5cbf236d
RD
14072
14073#----------------------------------------------------------------------------
14074
d55e5bfc
RD
14075class PyDeadObjectError(AttributeError):
14076 pass
14077
14078class _wxPyDeadObject(object):
14079 """
14080 Instances of wx objects that are OOR capable will have their __class__
14081 changed to this class when the C++ object is deleted. This should help
14082 prevent crashes due to referencing a bogus C++ pointer.
14083 """
14084 reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)"
14085 attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed."
14086
14087 def __repr__(self):
14088 if not hasattr(self, "_name"):
14089 self._name = "[unknown]"
14090 return self.reprStr % self._name
14091
14092 def __getattr__(self, *args):
14093 if not hasattr(self, "_name"):
14094 self._name = "[unknown]"
14095 raise PyDeadObjectError(self.attrStr % self._name)
14096
14097 def __nonzero__(self):
14098 return 0
14099
14100
14101
14102class PyUnbornObjectError(AttributeError):
14103 pass
14104
14105class _wxPyUnbornObject(object):
14106 """
14107 Some stock objects are created when the wx._core module is
14108 imported, but their C++ instance is not created until the wx.App
14109 object is created and initialized. These object instances will
14110 temporarily have their __class__ changed to this class so an
14111 exception will be raised if they are used before the C++ instance
14112 is ready.
14113 """
14114
14115 reprStr = "wxPython wrapper for UNBORN object! (The C++ object is not initialized yet.)"
14116 attrStr = "The C++ part of this object has not been initialized, attribute access not allowed."
14117
14118 def __repr__(self):
14119 #if not hasattr(self, "_name"):
14120 # self._name = "[unknown]"
14121 return self.reprStr #% self._name
14122
14123 def __getattr__(self, *args):
14124 #if not hasattr(self, "_name"):
14125 # self._name = "[unknown]"
14126 raise PyUnbornObjectError(self.attrStr) # % self._name )
14127
14128 def __nonzero__(self):
14129 return 0
14130
14131
14132#----------------------------------------------------------------------------
d55e5bfc
RD
14133
14134def CallAfter(callable, *args, **kw):
14135 """
14136 Call the specified function after the current and pending event
14137 handlers have been completed. This is also good for making GUI
0439c23b
RD
14138 method calls from non-GUI threads. Any extra positional or
14139 keyword args are passed on to the callable when it is called.
14140
846c181b 14141 :see: `wx.CallLater`
d55e5bfc
RD
14142 """
14143 app = wx.GetApp()
a001823c 14144 assert app is not None, 'No wx.App created yet'
d55e5bfc 14145
891bb194
RD
14146 if not hasattr(app, "_CallAfterId"):
14147 app._CallAfterId = wx.NewEventType()
14148 app.Connect(-1, -1, app._CallAfterId,
14149 lambda event: event.callable(*event.args, **event.kw) )
d55e5bfc 14150 evt = wx.PyEvent()
891bb194 14151 evt.SetEventType(app._CallAfterId)
d55e5bfc
RD
14152 evt.callable = callable
14153 evt.args = args
14154 evt.kw = kw
14155 wx.PostEvent(app, evt)
14156
d55e5bfc
RD
14157#----------------------------------------------------------------------------
14158
14159
846c181b 14160class CallLater:
d55e5bfc 14161 """
6e0de3df 14162 A convenience class for `wx.Timer`, that calls the given callable
d55e5bfc
RD
14163 object once after the given amount of milliseconds, passing any
14164 positional or keyword args. The return value of the callable is
0439c23b 14165 availbale after it has been run with the `GetResult` method.
d55e5bfc
RD
14166
14167 If you don't need to get the return value or restart the timer
14168 then there is no need to hold a reference to this object. It will
14169 hold a reference to itself while the timer is running (the timer
14170 has a reference to self.Notify) but the cycle will be broken when
846c181b 14171 the timer completes, automatically cleaning up the wx.CallLater
d55e5bfc 14172 object.
0439c23b
RD
14173
14174 :see: `wx.CallAfter`
d55e5bfc
RD
14175 """
14176 def __init__(self, millis, callable, *args, **kwargs):
14177 self.millis = millis
14178 self.callable = callable
14179 self.SetArgs(*args, **kwargs)
14180 self.runCount = 0
14181 self.running = False
14182 self.hasRun = False
14183 self.result = None
14184 self.timer = None
14185 self.Start()
14186
14187 def __del__(self):
14188 self.Stop()
14189
14190
14191 def Start(self, millis=None, *args, **kwargs):
14192 """
14193 (Re)start the timer
14194 """
14195 self.hasRun = False
14196 if millis is not None:
14197 self.millis = millis
14198 if args or kwargs:
14199 self.SetArgs(*args, **kwargs)
14200 self.Stop()
14201 self.timer = wx.PyTimer(self.Notify)
14202 self.timer.Start(self.millis, wx.TIMER_ONE_SHOT)
14203 self.running = True
14204 Restart = Start
14205
14206
14207 def Stop(self):
14208 """
14209 Stop and destroy the timer.
14210 """
14211 if self.timer is not None:
14212 self.timer.Stop()
14213 self.timer = None
14214
14215
14216 def GetInterval(self):
14217 if self.timer is not None:
14218 return self.timer.GetInterval()
14219 else:
14220 return 0
14221
14222
14223 def IsRunning(self):
14224 return self.timer is not None and self.timer.IsRunning()
14225
14226
14227 def SetArgs(self, *args, **kwargs):
14228 """
14229 (Re)set the args passed to the callable object. This is
14230 useful in conjunction with Restart if you want to schedule a
14231 new call to the same callable object but with different
14232 parameters.
14233 """
14234 self.args = args
14235 self.kwargs = kwargs
14236
14237
14238 def HasRun(self):
14239 return self.hasRun
14240
14241 def GetResult(self):
14242 return self.result
14243
14244 def Notify(self):
14245 """
14246 The timer has expired so call the callable.
14247 """
14248 if self.callable and getattr(self.callable, 'im_self', True):
14249 self.runCount += 1
14250 self.running = False
14251 self.result = self.callable(*self.args, **self.kwargs)
14252 self.hasRun = True
14253 if not self.running:
14254 # if it wasn't restarted, then cleanup
14255 wx.CallAfter(self.Stop)
14256
ac5d357a
RD
14257 Interval = property(GetInterval)
14258 Result = property(GetResult)
d55e5bfc
RD
14259
14260
846c181b
RD
14261class FutureCall(CallLater):
14262 """A compatibility alias for `CallLater`."""
14263
d55e5bfc
RD
14264#----------------------------------------------------------------------------
14265# Control which items in this module should be documented by epydoc.
14266# We allow only classes and functions, which will help reduce the size
14267# of the docs by filtering out the zillions of constants, EVT objects,
14268# and etc that don't make much sense by themselves, but are instead
14269# documented (or will be) as part of the classes/functions/methods
14270# where they should be used.
14271
d6c14a4c
RD
14272class __DocFilter:
14273 """
14274 A filter for epydoc that only allows non-Ptr classes and
34e0a3bb 14275 functions, in order to reduce the clutter in the API docs.
d6c14a4c
RD
14276 """
14277 def __init__(self, globals):
14278 self._globals = globals
14279
14280 def __call__(self, name):
14281 import types
14282 obj = self._globals.get(name, None)
34e0a3bb
RD
14283
14284 # only document classes and function
d6c14a4c
RD
14285 if type(obj) not in [type, types.ClassType, types.FunctionType, types.BuiltinFunctionType]:
14286 return False
34e0a3bb
RD
14287
14288 # skip other things that are private or will be documented as part of somethign else
1bd55598 14289 if name.startswith('_') or name.startswith('EVT') or name.endswith('_swigregister') or name.endswith('Ptr') :
d6c14a4c 14290 return False
34e0a3bb
RD
14291
14292 # skip functions that are duplicates of static functions in a class
14293 if name.find('_') != -1:
14294 cls = self._globals.get(name.split('_')[0], None)
14295 methname = name.split('_')[1]
14296 if hasattr(cls, methname) and type(getattr(cls, methname)) is types.FunctionType:
14297 return False
14298
d6c14a4c 14299 return True
d55e5bfc
RD
14300
14301#----------------------------------------------------------------------------
14302#----------------------------------------------------------------------------
14303
14304# Import other modules in this package that should show up in the
14305# "core" wx namespace
14306from _gdi import *
14307from _windows import *
14308from _controls import *
14309from _misc import *
14310
d55e5bfc
RD
14311#----------------------------------------------------------------------------
14312#----------------------------------------------------------------------------
14313
14314
32fe5131 14315